summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js/website.backend.iframe.js
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@odoo.com>2015-07-07 16:02:53 +0200
committerChristophe Matthieu <chm@odoo.com>2015-07-10 17:00:11 +0200
commit8c559044a5e1be111dcb577ad7e5ab462c1002a0 (patch)
treeba1602e15b2bca38babd6cca63a41da1d05b4321 /addons/website/static/src/js/website.backend.iframe.js
parenta616c57c609da0e5e56835dcb45e1c05590d25b8 (diff)
[IMP] web_editor: split website into web_editor (to use editor in backend for html field) and website
Diffstat (limited to 'addons/website/static/src/js/website.backend.iframe.js')
-rw-r--r--addons/website/static/src/js/website.backend.iframe.js75
1 files changed, 0 insertions, 75 deletions
diff --git a/addons/website/static/src/js/website.backend.iframe.js b/addons/website/static/src/js/website.backend.iframe.js
deleted file mode 100644
index 925fb6aa4b1..00000000000
--- a/addons/website/static/src/js/website.backend.iframe.js
+++ /dev/null
@@ -1,75 +0,0 @@
-odoo.define('website.backend.iframe', function (require) {
-'use strict';
-
-var editor = require('website.editor');
-var snippet_editor = require('website.snippets.editor');
-
-window.top.odoo[callback+"_set_value"] = function (value, fields_values) {
- var $editable = $("#wrapwrap .o_editable:first");
- if (value !== $editable.html()) {
- if ($('body').hasClass('editor_enable')) {
- editor.editor_bar.rte.historyRecordUndo($editable);
- editor.editor_bar.snippets.make_active(false);
- }
- $editable.html(value);
- }
-};
-
-editor.EditorBar.include({
- start: function () {
- var self = this;
- var res = this._super.apply(this, arguments);
- if (location.search.indexOf("enable_editor") !== -1) {
- this.on('rte:ready', this, function () {
- $("#website-top-edit").hide();
- setTimeout(function () {
- if (window.top.odoo[callback+"_editor"]) {
- window.top.odoo[callback+"_editor"](this);
- }
- }, 0);
-
- var $editable = $("#wrapwrap .o_editable:first");
- setTimeout(function () {
- $($editable.find("*").filter(function () {return !this.children.length;}).first()[0] || $editable)
- .focusIn().trigger("mousedown").trigger("keyup");
- },0);
-
- this.rte.on('change', this, function () {
- window.top.odoo[callback+"_downup"]($editable.prop('innerHTML'));
- });
-
-
- $(window).on('keydown', function (event) {
- if(event.keyCode === 27 && $("body", window.top.document).hasClass("o_form_FieldTextHtml_fullscreen")) {
- $(".o_fullscreen").trigger("click");
- }
- $(window).trigger('resize');
- });
-
- });
-
- var style = document.createElement("style");
- style.textContent = "#wrapwrap > main > * { margin-top: 50px; }";
- $("head").append(style);
-
- this.on("snippets:ready", this, function () {
- $(window.top).trigger("resize");
- });
-
- } else if (window.top.odoo[callback+"_editor"]) {
- window.top.odoo[callback+"_editor"](this);
- }
- return res;
- },
- cancel: function () {
- return;
- },
-});
-
-snippet_editor.BuildingBlock.include({
- _get_snippet_url: function () {
- return snippets_url;
- }
-});
-
-});