Commits

Luke Plant committed 6bbaa29

Fixed issue #40 - javascript error with django-cms 2.3

Thanks to Zak Patterson for the report and original patch.

  • Participants
  • Parent commits 6a34471

Comments (0)

Files changed (2)

semanticeditor/static/semanticeditor/javascript/wymeditor/plugins/semantic/wymeditor.semantic.js

  * parsing and provide list of allowed CSS classes.
  */
 
+(function(jQuery){ // protect against jQuery being redefined
+
 function PresentationControls(wym, opts) {
     this.wym = wym;
     this.opts = opts;
     var wym = this;
     var c = new PresentationControls(wym, options);
 };
+
+
+})(jQuery);

semanticeditor/templates/semanticeditor/editorwidget.html

 
 {% include "cms/plugins/widgets/widget_lib.js" %}
 
+(function(jQuery){
 
-
-$(document).ready(function(){
-    $('#id_{{ name }}').wymeditor({
+jQuery(document).ready(function(){
+    jQuery('#id_{{ name }}').wymeditor({
         lang: '{{ language }}',
         skin: 'semanticeditor',
         skinPath: "{{ SEMANTICEDITOR_MEDIA_URL }}javascript/wymeditor/skins/semanticeditor/",
     /* onclick for 'Insert object' */
 	
 	function init_buttons(placeholder){
-		$('span.insert-object').click(function(){
-			var select = $(this).parent().children("select");
+		jQuery('span.insert-object').click(function(){
+			var select = jQuery(this).parent().children("select");
 			var pluginvalue = select.attr('value');
 			var splits = window.location.href.split("?")[0].split("/");
 			var parent_id = Number(splits[splits.length - 2]);
-			var language = $('#id_language').attr('value');
+			var language = jQuery('#id_language').attr('value');
 			
 			if (pluginvalue == "") {
 				alert("{% filter escapejs %}{% trans "Please select a plugin type." %}{% endfilter %}");
 		}).css("cursor", "pointer").css("margin", "5px");
 		
 		/* onclick for 'Edit selected object' */
-		$('span.edit-object').click(function(){
+		jQuery('span.edit-object').click(function(){
 			var texteditor = get_editor(placeholder);
 			if (texteditor == null || texteditor.selectedObject == null) {
 				alert("{% filter escapejs %}{% trans "Text editor does not support editing objects." %}{% endfilter %}");
 	}
 });
 
-
+})(jQuery);
 
 function get_plugin_html(){
 	html = '<div class="plugin-select-holder">'