summaryrefslogtreecommitdiff
path: root/addons/website/static
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2014-09-05 15:28:22 +0200
committerChristophe Simonis <chs@odoo.com>2014-09-05 15:28:22 +0200
commit31bf30d2d0eb78baaa36360b99fe58bf7cd4c9e7 (patch)
treed7be61ecd6bb4c8b5552e39b03e2a64eebbbf323 /addons/website/static
parentafba9e8817c458640ae446ac7aaaab79be4fe1e9 (diff)
parented1c173971968eaa96693cb4e1547efa6e6c34e0 (diff)
[MERGE] forward port of branch 8.0 up to ed1c173
Diffstat (limited to 'addons/website/static')
-rw-r--r--addons/website/static/src/css/website.css5
-rw-r--r--addons/website/static/src/css/website.sass7
-rw-r--r--addons/website/static/src/js/website.editor.js20
-rw-r--r--addons/website/static/src/js/website.seo.js2
-rw-r--r--addons/website/static/src/js/website.snippets.editor.js10
-rw-r--r--addons/website/static/src/js/website.translator.js2
6 files changed, 34 insertions, 12 deletions
diff --git a/addons/website/static/src/css/website.css b/addons/website/static/src/css/website.css
index 055ac7fb4e3..09d00d6d0b6 100644
--- a/addons/website/static/src/css/website.css
+++ b/addons/website/static/src/css/website.css
@@ -570,12 +570,15 @@ div.media_iframe_video {
div.media_iframe_video iframe {
width: 100%;
height: 100%;
+ position: absolute;
+ margin-left: -50%;
}
-div.media_iframe_video div {
+div.media_iframe_video .css_editable_mode_display {
position: absolute;
width: 100%;
height: 100%;
display: none;
+ z-index: 2;
}
/* Mobile view */
diff --git a/addons/website/static/src/css/website.sass b/addons/website/static/src/css/website.sass
index ba47a12c90f..b9d7dc1fa9d 100644
--- a/addons/website/static/src/css/website.sass
+++ b/addons/website/static/src/css/website.sass
@@ -99,7 +99,7 @@ header
margin-right: 0 !important
.css_non_editable_mode_hidden
- display: none
+ display: none !important
/* ----- BOOTSTRAP FIX ----- */
@@ -473,11 +473,14 @@ div.media_iframe_video
iframe
width: 100%
height: 100%
- div
+ position: absolute
+ margin-left: -50%
+ .css_editable_mode_display
position: absolute
width: 100%
height: 100%
display: none
+ z-index: 2
/* Mobile view */
diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js
index 205d8dde076..5ef971f98b0 100644
--- a/addons/website/static/src/js/website.editor.js
+++ b/addons/website/static/src/js/website.editor.js
@@ -1151,6 +1151,7 @@
make_link: function (url, new_window, label, classes) {
},
bind_data: function () {
+ var self = this;
var href = this.element && (this.element.data( 'cke-saved-href')
|| this.element.getAttribute('href'));
var new_window = this.element
@@ -1158,8 +1159,13 @@
: false;
var text = this.element ? this.element.getText() : '';
if (!text.length) {
- var selection = this.editor.getSelection();
- text = selection.getSelectedText();
+ if (this.editor) {
+ text = this.editor.getSelection().getSelectedText();
+ } else {
+ text = this.data.name;
+ href = this.data.url;
+ new_window = this.data.new_window;
+ }
}
this.$('input#link-text').val(text);
@@ -1180,8 +1186,14 @@
this.$('input.email-address').val(match[1]).change();
}
if (href && !$control) {
- this.$('input.url').val(href).change();
- this.$('input.window-new').closest("div").show();
+ this.page_exists(href).then(function (exist) {
+ if (exist) {
+ self.$('#link-page').select2('data', {'id': href, 'text': href});
+ } else {
+ self.$('input.url').val(href).change();
+ self.$('input.window-new').closest("div").show();
+ }
+ });
}
this.preview();
},
diff --git a/addons/website/static/src/js/website.seo.js b/addons/website/static/src/js/website.seo.js
index 8d28237f924..7e32a780bf1 100644
--- a/addons/website/static/src/js/website.seo.js
+++ b/addons/website/static/src/js/website.seo.js
@@ -86,7 +86,7 @@
}
});
}
- $.getJSON("http://suggest.hp.af.cm/suggest/"+encodeURIComponent(this.root + " "), addSuggestions);
+ $.getJSON("/website/seo_suggest/" + encodeURIComponent(this.root + " "), addSuggestions);
},
});
diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js
index e734d361da9..116f55713ec 100644
--- a/addons/website/static/src/js/website.snippets.editor.js
+++ b/addons/website/static/src/js/website.snippets.editor.js
@@ -247,13 +247,14 @@
var self = this;
var snipped_event_flag;
self.$wrapwrap.on('click', function (event) {
- if (snipped_event_flag || !event.srcElement) {
+ var srcElement = event.srcElement || (event.originalEvent && (event.originalEvent.originalTarget || event.originalEvent.target));
+ if (snipped_event_flag || !srcElement) {
return;
}
snipped_event_flag = true;
setTimeout(function () {snipped_event_flag = false;}, 0);
- var $target = $(event.srcElement);
+ var $target = $(srcElement);
if ($target.parents(".oe_overlay").length) {
return;
@@ -644,7 +645,7 @@
var styles = this.$target.data("snippet-option-ids") || {};
styles[option_id] = this;
this.$target.data("snippet-option-ids", styles);
- this.$overlay = this.$target.data('overlay');
+ this.$overlay = this.$target.data('overlay') || $('<div>');
this.option= option_id;
this.$el = option.$el.find(">li").clone();
this.data = option.$el.data();
@@ -1505,6 +1506,9 @@
new website.editor.MediaDialog(self, self.element).appendTo(document.body);
self.BuildingBlock.make_active(false);
}
+ setTimeout(function () {
+ self.$target.find(".css_editable_mode_display").removeAttr("_moz_abspos");
+ },0);
},
});
diff --git a/addons/website/static/src/js/website.translator.js b/addons/website/static/src/js/website.translator.js
index 674b2f727b9..a1800799c0c 100644
--- a/addons/website/static/src/js/website.translator.js
+++ b/addons/website/static/src/js/website.translator.js
@@ -130,7 +130,7 @@
node.setAttribute('data-oe-translation-view-id', view_id);
var content = node.childNodes[0].data.trim();
var trans = this.translations.filter(function (t) {
- return t.res_id === view_id && t.value === content;
+ return t.res_id === view_id && t.value.trim() === content;
});
if (trans.length) {
node.setAttribute('data-oe-translation-id', trans[0].id);