diff options
Diffstat (limited to 'addons/website/static/src')
| -rw-r--r-- | addons/website/static/src/css/editor.css | 3 | ||||
| -rw-r--r-- | addons/website/static/src/css/editor.sass | 2 | ||||
| -rw-r--r-- | addons/website/static/src/css/website.css | 10 | ||||
| -rw-r--r-- | addons/website/static/src/css/website.sass | 8 | ||||
| -rw-r--r-- | addons/website/static/src/img/deers.jpg | bin | 134084 -> 336308 bytes | |||
| -rw-r--r-- | addons/website/static/src/img/deers_thumb.jpg | bin | 34440 -> 53388 bytes | |||
| -rw-r--r-- | addons/website/static/src/js/website.editor.js | 17 | ||||
| -rw-r--r-- | addons/website/static/src/js/website.js | 21 | ||||
| -rw-r--r-- | addons/website/static/src/js/website.seo.js | 2 | ||||
| -rw-r--r-- | addons/website/static/src/js/website.snippets.animation.js | 3 | ||||
| -rw-r--r-- | addons/website/static/src/js/website.translator.js | 19 |
11 files changed, 54 insertions, 31 deletions
diff --git a/addons/website/static/src/css/editor.css b/addons/website/static/src/css/editor.css index 6b631348651..b49c6a14afe 100644 --- a/addons/website/static/src/css/editor.css +++ b/addons/website/static/src/css/editor.css @@ -636,8 +636,7 @@ ul.oe_menu_editor .disclose { } .oe_ace_view_editor.oe_ace_closed { z-index: -1000; - filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); - opacity: 0; + display: none } .oe_include_bundles { diff --git a/addons/website/static/src/css/editor.sass b/addons/website/static/src/css/editor.sass index 73c000f737a..23762bb5fe4 100644 --- a/addons/website/static/src/css/editor.sass +++ b/addons/website/static/src/css/editor.sass @@ -546,7 +546,7 @@ $infobar_height: 20px +opacity(0.97) &.oe_ace_closed z-index: -1000 - +opacity(0) + display: none .oe_include_bundles font-weight: normal diff --git a/addons/website/static/src/css/website.css b/addons/website/static/src/css/website.css index a7d05da9eed..872d82b460f 100644 --- a/addons/website/static/src/css/website.css +++ b/addons/website/static/src/css/website.css @@ -213,6 +213,10 @@ li > p { margin: 0; } +font[style*='background'], font[class*='bg-'] { + padding: 0 2px +} + .o_ul_toggle_self, .o_ul_toggle_next { display: none; } @@ -342,8 +346,10 @@ body > nav.navbar { z-index: 10000; } -nav.navbar + #wrapwrap { - padding-top: 34px; +@media (min-width: 767px) { + nav.navbar + #wrapwrap { + padding-top: 34px; + } } /* ----- BOOTSTRAP FIX ----- */ diff --git a/addons/website/static/src/css/website.sass b/addons/website/static/src/css/website.sass index 022b07066ad..223bab94a0b 100644 --- a/addons/website/static/src/css/website.sass +++ b/addons/website/static/src/css/website.sass @@ -130,6 +130,9 @@ li > * > li > * > li > * > li > * > li > * > li > ol li > p margin: 0 +font[style*='background'], font[class*='bg-'] + padding: 0 2px + .o_ul_toggle_self, .o_ul_toggle_next display: none .o_ul_folded @@ -238,8 +241,9 @@ body > nav.navbar width: 100% position: absolute z-index: 10000 -nav.navbar + #wrapwrap - padding-top: 34px +@media (max-min: 767px) + nav.navbar + #wrapwrap + padding-top: 34px /* ----- BOOTSTRAP FIX ----- */ diff --git a/addons/website/static/src/img/deers.jpg b/addons/website/static/src/img/deers.jpg Binary files differindex 042f427c0b9..9f4b368a18f 100644 --- a/addons/website/static/src/img/deers.jpg +++ b/addons/website/static/src/img/deers.jpg diff --git a/addons/website/static/src/img/deers_thumb.jpg b/addons/website/static/src/img/deers_thumb.jpg Binary files differindex 0771162ae49..4a955f5c892 100644 --- a/addons/website/static/src/img/deers_thumb.jpg +++ b/addons/website/static/src/img/deers_thumb.jpg diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js index 9cc84746454..5e12647a63a 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -937,6 +937,7 @@ function change_default_bootstrap_animation_to_edit() { website.no_editor = !!$(document.documentElement).data('editable-no-editor'); + website.add_template_file('/website/static/src/xml/website.xml'); website.add_template_file('/website/static/src/xml/website.editor.xml'); website.dom_ready.done(function () { website.ready().then(init_editor); @@ -965,6 +966,16 @@ website.dom_ready.done(function () { }); }); + website.error = function(data, url) { + var $error = $(openerp.qweb.render('website.error_dialog', { + 'title': data.data ? data.data.arguments[0] : "", + 'message': data.data ? data.data.arguments[1] : data.statusText, + 'backend_url': url + })); + $error.appendTo("body"); + $error.modal('show'); + }; + /* ----- TOP EDITOR BAR FOR ADMIN ---- */ var EditorBar = Widget.extend({ @@ -1411,6 +1422,12 @@ var Dialog = Widget.extend({ }, close: function () { this.$el.modal('hide'); + }, + destroy: function () { + this.$el.modal('hide').remove(); + if($(".modal.in").length>0){ + $('body').addClass('modal-open'); + } }, }); diff --git a/addons/website/static/src/js/website.js b/addons/website/static/src/js/website.js index 3212bf824a1..f0876b44747 100644 --- a/addons/website/static/src/js/website.js +++ b/addons/website/static/src/js/website.js @@ -4,6 +4,7 @@ odoo.define('website.website', function (require) { var ajax = require('web.ajax'); var core = require('web.core'); var session = require('web.session'); +var Tour = require('web.Tour'); var _t = core._t; @@ -169,16 +170,6 @@ function prompt(options, qweb) { return def; } -function error(data, url) { - var $error = $(core.qweb.render('website.error_dialog', { - 'title': data.data ? data.data.arguments[0] : "", - 'message': data.data ? data.data.arguments[1] : data.statusText, - 'backend_url': url - })); - $error.appendTo("body"); - $error.modal('show'); -} - function form(url, method, params) { var htmlform = document.createElement('form'); htmlform.setAttribute('action', url); @@ -270,8 +261,6 @@ function add_template_file(template) { return def; } -add_template_file('/website/static/src/xml/website.xml'); - var dom_ready = $.Deferred(); $(document).ready(function () { dom_ready.resolve(); @@ -402,6 +391,11 @@ dom_ready.then(function () { $('#oe_applications').before($collapse); $collapse.wrap('<div class="visible-xs"/>'); $('[data-target="#oe_applications"]').attr("data-target", "#oe_applications_collapse"); + }); + + Tour.autoRunning = false; + ready().then(function () { + setTimeout(Tour.running,0); }); return { @@ -412,7 +406,6 @@ return { parseHash: parseHash, reload: reload, prompt: prompt, - error: error, form: form, init_kanban: init_kanban, add_template_file: add_template_file, @@ -433,4 +426,4 @@ var Session = require('web.Session'); return new Session(null, null, {modules: ['website']}); -});
\ No newline at end of file +}); diff --git a/addons/website/static/src/js/website.seo.js b/addons/website/static/src/js/website.seo.js index 5a848157493..31a8ebd3e92 100644 --- a/addons/website/static/src/js/website.seo.js +++ b/addons/website/static/src/js/website.seo.js @@ -499,7 +499,7 @@ var Configurator = Widget.extend({ descriptionChanged: function () { var self = this; setTimeout(function () { - var description = self.$('textarea[name=seo_page_description]').attr('value'); + var description = self.$('textarea[name=seo_page_description]').val(); self.htmlPage.changeDescription(description); self.renderPreview(); }, 0); diff --git a/addons/website/static/src/js/website.snippets.animation.js b/addons/website/static/src/js/website.snippets.animation.js index 8d5c98111b3..0b1c7befaa1 100644 --- a/addons/website/static/src/js/website.snippets.animation.js +++ b/addons/website/static/src/js/website.snippets.animation.js @@ -168,7 +168,8 @@ animationRegistry.share = Animation.extend({ var title = encodeURIComponent($("title").text()); this.$("a").each(function () { var $a = $(this); - $a.attr("href", $(this).attr("href").replace("{url}", url).replace("{title}", title)); + var url_regex = /\{url\}|%7Burl%7D/, title_regex = /\{title\}|%7Btitle%7D/; + $a.attr("href", $(this).attr("href").replace(url_regex, url).replace(title_regex, title)); if ($a.attr("target") && $a.attr("target").match(/_blank/i) && !$a.closest('.o_editable').length) { $a.on('click', function () { window.open(this.href,'','menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=550,width=600'); diff --git a/addons/website/static/src/js/website.translator.js b/addons/website/static/src/js/website.translator.js index 050a649715a..775012e1aa8 100644 --- a/addons/website/static/src/js/website.translator.js +++ b/addons/website/static/src/js/website.translator.js @@ -67,7 +67,10 @@ editor.EditorBar.include({ var link = $('.js_language_selector a[data-default-lang]')[0]; if (link) { link.search += (link.search ? '&' : '?') + 'enable_editor=1'; - window.location = link.attributes.href.value; + var url = link.pathname + link.search + window.location.hash; + link.pathname = '/website/lang/default'; + link.search = '?' + $.param({r: url}); + window.location = link.href; } }, translate: function () { @@ -89,7 +92,8 @@ editor.EditorBar.include({ var $editables = $('[data-oe-model="ir.ui.view"]') .not('link, script') .not('.oe_snippets,.oe_snippet, .oe_snippet *, .navbar-toggle') - .not('[data-oe-type]'); + .not('[data-oe-type]') + .add($('[data-oe-translate="1"]:not([data-oe-model="ir.ui.view"])').addClass('o_editable')); $editables.each(function () { var $node = $(this); @@ -112,7 +116,7 @@ editor.EditorBar.include({ self.sanitizeNode($node[0]); } if (self.getInitialContent($node[0]) !== $node.text()) { - $node.addClass('oe_dirty').removeClass('oe_translatable_todo oe_translatable_inprogress'); + $node.addClass('o_dirty').removeClass('oe_translatable_todo oe_translatable_inprogress'); } }, 0); }); @@ -133,7 +137,7 @@ editor.EditorBar.include({ // TODO: link nodes with same content node.className += ' oe_translatable_text'; node.setAttribute('data-oe-translation-view-id', view_id); - var content = node.childNodes[0].data.trim(); + var content = $(node).text().trim(); var trans = this.translations.filter(function (t) { return t.res_id === view_id && t.value.trim() === content; }); @@ -152,10 +156,9 @@ editor.EditorBar.include({ }, save: function () { var self = this; - var mysuper = this._super; var trans = {}; // this._super.apply(this, arguments); - $('.oe_translatable_text.oe_dirty').each(function () { + $('.oe_translatable_text.o_dirty').each(function () { var $node = $(this); var data = $node.data(); if (!trans[data.oeTranslationViewId]) { @@ -171,8 +174,7 @@ editor.EditorBar.include({ 'data': trans, 'lang': website.get_context()['lang'], }).then(function () { - window.onbeforeunload = null; - website.reload(); + self._save(); }).fail(function () { // TODO: bootstrap alert with error message alert("Could not save translation"); @@ -185,6 +187,7 @@ editor.EditorBar.include({ if (node.attributes['data-oe-translate'].value == '1') { node.className += ' oe_translatable_field'; } + this.markTranslatableNode(node, view_id); } else if (node.childNodes.length === 1 && this.isTextNode(node.childNodes[0]) && !node.getAttribute('data-oe-model')) { |
