4.7 update

ax - July 27, 2006 - 19:54
Project:AJAX Spellcheck
Version:HEAD
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:active
Description

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).]

AttachmentSize
ajax_spellcheck.patch1.44 KB

#1

Thox - July 27, 2006 - 20:43

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.

In fact, I'd personally add the <base> tag back in, although I don't know the reasons why it was removed.

#2

ax - July 28, 2006 - 00:04

> 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?

#3

ax - August 2, 2006 - 19:59

see http://drupal.org/node/76637 (Streamline JavaScript addition and add settings storage) :

As more JavaScript enabled modules are available, it's quite a problem to not get collisions between their configuration variables. This patch provides a centralized place where modules can put their settings that are required for the current page by putting them in the global (JavaScript) variable Drupal.

This patch also cleans up the act of adding a JavaScript file to the page by exposing the HTML code in a theme function for easy manipulation.

 
 

Drupal is a registered trademark of Dries Buytaert.