diff options
| author | Xavier Morel <xmo@openerp.com> | 2013-10-14 10:54:59 +0200 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2013-10-14 10:54:59 +0200 |
| commit | 2e352ce187d2685df64ebd36f669a8abd88d5f65 (patch) | |
| tree | 529af9c967929ca13896e8464abdc8fe9d02710c /addons/website/static/src/js/website.editor.js | |
| parent | 3e349a2bf7c76f5136935b531c5b3fb65833e8be (diff) | |
| parent | 063a698313e522596a0f784206a9d17b9f31dafa (diff) | |
[MERGE] from trunk
bzr revid: xmo@openerp.com-20131014085459-dhbypq0hg3lzzf3j
Diffstat (limited to 'addons/website/static/src/js/website.editor.js')
| -rw-r--r-- | addons/website/static/src/js/website.editor.js | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js index 30514b25780..ffb0f9b86a3 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -3,13 +3,12 @@ var website = openerp.website; // $.fn.data automatically parses value, '0'|'1' -> 0|1 - website.is_editable = $(document.documentElement).data('editable'); website.templates.push('/website/static/src/xml/website.editor.xml'); website.dom_ready.done(function () { var is_smartphone = $(document.body)[0].clientWidth < 767; - if (website.is_editable && !is_smartphone) { + if (!is_smartphone) { website.ready().then(website.init_editor); } }); @@ -21,16 +20,15 @@ return new website.editor.RTEImageDialog(editor).appendTo(document.body); } - if (website.is_editable) { - // only enable editors manually - CKEDITOR.disableAutoInline = true; - // EDIT ALL THE THINGS - CKEDITOR.dtd.$editable = $.extend( - {}, CKEDITOR.dtd.$block, CKEDITOR.dtd.$inline); - // Disable removal of empty elements on CKEDITOR activation. Empty - // elements are used for e.g. support of FontAwesome icons - CKEDITOR.dtd.$removeEmpty = {}; - } + // only enable editors manually + CKEDITOR.disableAutoInline = true; + // EDIT ALL THE THINGS + CKEDITOR.dtd.$editable = $.extend( + {}, CKEDITOR.dtd.$block, CKEDITOR.dtd.$inline); + // Disable removal of empty elements on CKEDITOR activation. Empty + // elements are used for e.g. support of FontAwesome icons + CKEDITOR.dtd.$removeEmpty = {}; + website.init_editor = function () { CKEDITOR.plugins.add('customdialogs', { // requires: 'link,image', @@ -211,8 +209,9 @@ } }); // Adding Static Menus - menu.append('<li class="divider"></li><li><a href="/page/website.themes">Change Theme</a></li>'); + menu.append('<li class="divider"></li><li class="js_change_theme"><a href="/page/website.themes">Change Theme</a></li>'); menu.append('<li class="divider"></li><li><a data-action="ace" href="#">Advanced view editor</a></li>'); + self.trigger('rte:customize_menu_ready'); } ); }); @@ -616,7 +615,7 @@ } else if ($e.hasClass('pages')) { // Create the page, get the URL back done = $.get(_.str.sprintf( - '/pagenew/%s?noredirect', encodeURIComponent(val))) + '/pagenew/%s?noredirect', encodeURI(val))) .then(function (response) { self.make_link(response, false, val); }); @@ -813,6 +812,7 @@ var element, editor = this.editor; if (!(element = this.element)) { element = editor.document.createElement('img'); + element.addClass('img'); // focus event handler interactions between bootstrap (modal) // and ckeditor (RTE) lead to blowing the stack in Safari and // Chrome (but not FF) when this is done synchronously => |
