don't let ckeditor jquery adapter abort javascript execution (#5750)

This commit is contained in:
Frédéric Péters 2014-10-17 14:11:33 +02:00
parent 75362c2132
commit 3f118b6d23
4 changed files with 14 additions and 5 deletions

View File

@ -100,8 +100,8 @@ class Category(StorableObject):
if editable and is_accessible('categories'):
root_url = get_publisher().get_root_url()
get_response().add_javascript(['jquery.js', 'jquery-ui.js',
'ckeditor/ckeditor.js', 'ckeditor/adapters/jquery.js',
'qommon.wysiwyg.js'])
'ckeditor/ckeditor.js', 'qommon.wysiwyg.js',
'ckeditor/adapters/jquery.js'])
get_response().add_javascript_code('var LIVE_EDIT_TOOLTIP = "%s";\n' % \
_('Double click to edit the text'))
get_response().add_css_include('../js/smoothness/jquery-ui-1.10.0.custom.min.css')

View File

@ -58,8 +58,8 @@ class TextsDirectory(Directory):
if is_accessible('settings'):
root_url = get_publisher().get_root_url()
get_response().add_javascript(['jquery.js', 'jquery-ui.js',
'ckeditor/ckeditor.js', 'ckeditor/adapters/jquery.js',
'qommon.wysiwyg.js'])
'ckeditor/ckeditor.js', 'qommon.wysiwyg.js',
'ckeditor/adapters/jquery.js'])
get_response().add_javascript_code('var LIVE_EDIT_TOOLTIP = "%s";\n' % \
_('Double click to edit the text'))
get_response().add_css_include('../js/smoothness/jquery-ui-1.10.0.custom.min.css')

View File

@ -1119,7 +1119,7 @@ class WysiwygTextWidget(TextWidget):
def render_content(self):
get_response().add_javascript(['jquery.js', 'ckeditor/ckeditor.js',
'ckeditor/adapters/jquery.js', 'qommon.wysiwyg.js'])
'qommon.wysiwyg.js', 'ckeditor/adapters/jquery.js'])
attrs = self.attrs.copy()

View File

@ -1,4 +1,13 @@
/* makes sure javascript loading is not interrupted by ckeditor jquery adapter
* throwing an error about the environment being incompatible. */
CKEDITOR.env.origIsCompatible = CKEDITOR.env.isCompatible;
CKEDITOR.env.isCompatible = true;
$(document).ready( function() {
if (CKEDITOR.env.origIsCompatible == false) {
/* bail out if ckeditor advertised itself as not supported */
return;
}
$('div.WysiwygTextWidget textarea').ckeditor();
$('.block-edit-custom-text a.edit-custom-text').hide();
$('.block-edit-custom-text').tooltip({