forked from brandonaaron/jquery-spellcheck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjquery_spellcheck.php
30 lines (29 loc) · 1.25 KB
/
jquery_spellcheck.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
define("SPELLCHECKER_URL", "http://" . $_SERVER['SERVER_NAME'] . "/spellcheck/spellcheck.php");
define("SPELLCHECKER_CHECKER", "pspell");
define("SPELLCHECKER_EVENTS", "blur");
echo "\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"/spellcheck/spellcheck.css\" />\n";
echo "<script src=\"/spellcheck/jquery.spellcheck.js\" type=\"text/javascript\" charset=\"utf-8\"></script>\n";
echo "<script type=\"text/javascript\" charset=\"utf-8\">
jQuery(document).ready(function(jQuery) {
jQuery('textarea').each(
function() {
var self = this;
if(jQuery(self).hasClass('spellcheck')) {
jQuery(self).spellcheck({ events: '" . SPELLCHECKER_EVENTS . "', url: '" . SPELLCHECKER_URL . "', checker: '" . SPELLCHECKER_CHECKER . "', ignorecaps: 0 });
}
}
);
jQuery('input[type=text]').each(
function() {
var self = this;
if(jQuery(self).hasClass('spellcheck')) {
jQuery(self).spellcheck({ events: '" . SPELLCHECKER_EVENTS . "', url: '" . SPELLCHECKER_URL . "', checker: '" . SPELLCHECKER_CHECKER . "', ignorecaps: 0 });
}
}
);
});
</script>";
echo "\n";
?>