Ticket #136 (assigned enhancement)

Opened 23 months ago

Last modified 3 months ago

Use a custom alias for jQuery

Reported by: dtetto Owned by: mr_lundis
Priority: minor Milestone: 1.x
Component: editor Version: trunk
Keywords: plugin,alias,jquery Cc:

Description

While the plugin correctly avoids overwriting/assuming the $ variable, it would be wonderful if the plugin used a custom alias (via closure), which would help it run in a high-conflict environment.

http://docs.jquery.com/Plugins/Authoring#Custom_Alias_in_plugin_code

As described, wrapping the plugin in

(function($) {
// plugin definition
})(jQuery);

seems to be the best practice in jQuery plugin development (note that the official jQuery UI plugins do this). This allows the function to run in environments where the jQuery variable can't always be assumed (i.e. after WYMeditor's initialization, the variable "jQuery" may be deleted, overwritten, or renamed.)

This is a small and simple change that would save me from having to manually do it to each WYM release, and being able to change all current instances of "jQuery" to "$" would be a tiny size optimization, too. :)

Change History

Changed 22 months ago by jf.hovinne

  • status changed from new to assigned
  • milestone set to 0.6

Right - will be implemented in 0.6.

Changed 5 months ago by mr_lundis

  • owner changed from jf.hovinne to mr_lundis
  • status changed from assigned to new

Changed 5 months ago by mr_lundis

  • status changed from new to assigned

Changed 3 months ago by mr_lundis

  • milestone changed from 2.0 to 1.x
Note: See TracTickets for help on using tickets.