attached patch makes the ajax spellcheck module work with Drupal 4.7. it should fix http://drupal.org/node/57084, http://drupal.org/node/49195, and http://drupal.org/node/70237. please test, review, and apply. thanks!
[technical details: problem with the current version is that spellcheck.js tries to get Drupals base url from the documents <base> tag (document.getElementsByTagName('base')[0].href). in Drupal 4.7, there is no <base> anymore. instead, this patch passes the ajax spellcheck endpoint (http://my.site.com/spellcheck, http://my.site.com/index.php?q=spellcheck, or similar) to spellcheck.js via the javascript variable ajax_spellcheck_path (using url(), so it works with both clean and plain urls).]
Comment | File | Size | Author |
---|---|---|---|
ajax_spellcheck.patch | 1.44 KB | ax |
Comments
Comment #1
Thox CreditAttribution: Thox commentedThis probably works but I believe it is the wrong way to go around this problem. The real solution is to provide the various javascript access to a
base_url
-like variable. Otherwise every script will be dumping out even more junk HTML / JavaScript which shouldn't be needed.In fact, I'd personally add the
<base>
tag back in, although I don't know the reasons why it was removed.Comment #2
ax CreditAttribution: ax commented> In fact, I'd personally add the <base> tag back in, although I don't
> know the reasons why it was removed.
http://drupal.org/node/13148
> This probably works but I believe it is the wrong way to go around
> this problem. The real solution is to provide the various javascript
> access to a base_url-like variable. Otherwise every script will be
> dumping out even more junk HTML / JavaScript which shouldn't be
> needed
+1 (for a way to pass variables from Drupal to the current document, outputted in a single <script>. probably a hook like drupal_add_js() (which should actually be drupal_add_js_file()) which collects variables passed from modules and outputs them all at once at the end)
don't have resources for this myself, though :(. anyone?
Comment #3
ax CreditAttribution: ax commentedsee http://drupal.org/node/76637 (Streamline JavaScript addition and add settings storage) :