Wrong case for use jquery compability mode

igor.ro - August 11, 2009 - 12:52
Project:jQuery Compatibility Mode
Version:6.x-1.5
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:by design
Description

We have case for use mode like

if (after('Drupal.', $contents, FALSE) && (after('$(', $contents)) && !after('(function($)', $contents, FALSE) && !after('var run_through_jquery_compatibility_mode = FALSE;', $contents, FALSE)) {
return TRUE;
}

It means that file must contatins Drupal. and $(.

Suggest to use

if ((after('Drupal.', $contents, FALSE) || after('$(', $contents)) && !after('(function($)', $contents, FALSE) && !after('var run_through_jquery_compatibility_mode = FALSE;', $contents, FALSE)) {
return TRUE;
}

Here is a patch.

Thanks.

AttachmentSize
jquery_compatibility.patch944 bytes

#1

igor.ro - August 29, 2009 - 07:32
Status:active» needs review

#2

crystaldawn - November 11, 2009 - 16:39
Status:needs review» by design

The reason it requires drupal and $( is because not all files that have $( are drupal jquery files. And since this module is meant only for those that have to deal with drupal, I have required the word drupal to be in it. I couldnt think of any situation where the two would never both be present. What is your use case where only $( was available?

 
 

Drupal is a registered trademark of Dries Buytaert.