The stubbed-out function in js_theming.js that is named Drupal.urlEncode() appears to be a duplicate of a function already provided in drupal.js.
Drupal.encodeURIComponent() appears to provide the same functionality (correctly handing slashes and some entities) that Drupal.urlEncode() provides. Apparently, the drupal.js developers decided to name the function after its nearest JS neighbor (encodeURIComponent()) rather than its nearest Drupal PHP neighbor. ('course the scant documentation on Drupal.encodeURIComponent certainly doesn't help clear this up).
So if I'm correctly interpreting the comments in js_theming.js, then I suppose there are a few possible courses of action:
* Perhaps wrapping Drupal.encodeURIComponent() would be a useful thing to do. After all, Drupal.urlEncode() is a lot easier to intuit than Drupal.encodeURIComponent().
* Or, Drupal.urlEncode() could simply be removed.
BTW -- there is a minor formatting error in the function declaration for Drupal.strEqual (at least in the dev release -- haven't checked CVS at all). There is a space between the Drupal. and the strEqual. Seems silly to file a bug just about that, though.
Comment | File | Size | Author |
---|---|---|---|
#3 | patch_311865_02.txt | 3.92 KB | mbutcher |
Comments
Comment #1
litwol CreditAttribution: litwol commentedI created urlEncode out of lack of knowledge that encodeURIComponent existed.
I am very open to help in collaborating to fix this and provide new features. Would you be willing to provide a patch since you've noticed this and seem to have better understanding of the issue than myself. I wrote this module over a weekend to strart something 'cool' and i lacked proper JS knowledge to do it right from the beginning. please help :). Thank you very much.
Comment #2
mbutcher CreditAttribution: mbutcher commentedThe module is indeed very cool, and I am happy to have found it.
I would be happy to contribute a patch for the issue.
Comment #3
mbutcher CreditAttribution: mbutcher commentedAttached is a patch that addresses several issues with various aspects of the URL encoding features. Among the fixes in the patch:
See also #316749: Messaging Bugs for a patch to messaging that relates to this patch (by removing dependency on Drupal.strEqual()).
Comment #4
litwol CreditAttribution: litwol commentedCommited: http://drupal.org/cvs?commit=147974
Thank you. I hope more patches from you will follow :-D. new functionality etc :-D
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.