From fcd97879e3cd57a15f91db81ff88da7c6c114b98 Mon Sep 17 00:00:00 2001 From: ddm Date: Tue, 27 Aug 2013 16:12:35 +0200 Subject: [PATCH] Improve SEO tools CSS across themes bzr revid: ddm@openerp.com-20130827141235-wfrx21hqem1v076b --- addons/website/static/src/css/editor.css | 23 +++++++++++------------ addons/website/static/src/css/editor.sass | 19 ++++++++++++------- addons/website/static/src/js/website.js | 12 ++++++++---- addons/website/static/src/xml/website.xml | 12 ++++-------- 4 files changed, 35 insertions(+), 31 deletions(-) diff --git a/addons/website/static/src/css/editor.css b/addons/website/static/src/css/editor.css index 207173c360c..f2a92a738a7 100644 --- a/addons/website/static/src/css/editor.css +++ b/addons/website/static/src/css/editor.css @@ -1,14 +1,13 @@ @charset "utf-8"; - - /* ---- CKEditor Minimal Reset ---- */ - .navbar.navbar-inverse .cke_chrome { border: none; } + .navbar.navbar-inverse .cke_inner { background: transparent; } + .navbar.navbar-inverse .cke_top { background: transparent; border: none; @@ -17,9 +16,7 @@ -moz-box-shadow: none; } - -/* ---- OpenERP ---- */ - +/* ---- OpenERP Style ---- */ .oe_hidden { display: none !important; } @@ -236,12 +233,13 @@ left: 0px; } -/* ---- MOBILE PREVIEW ---- */ +/* ---- MODAL DIALOGS ---- */ .oe_stop_scrolling { height: 100%; overflow: hidden; } +/* ---- MOBILE PREVIEW ---- */ .oe_mobile_preview.modal { height: 660px; background-color: black; @@ -282,7 +280,7 @@ } .oe_mobile_preview_header .close { - color: lightgrey; + color: #1a1a1a; opacity: 1; } .oe_mobile_preview_header .close:hover { @@ -290,11 +288,12 @@ opacity: 1; } +/* ---- SEO TOOLS ---- */ .oe_seo_configuration input { - width: inherit; + width: 90%; } .oe_seo_configuration textarea { - width: inherit; + width: 90%; } .oe_seo_configuration ul { list-style: none; @@ -304,9 +303,9 @@ } .oe_seo_keywords_list { - width: 39em; + width: 80%; } .oe_seo_keywords_list li { float: left; - width: 12em; + width: 15em; } diff --git a/addons/website/static/src/css/editor.sass b/addons/website/static/src/css/editor.sass index 031b27a10db..330686d4bf0 100644 --- a/addons/website/static/src/css/editor.sass +++ b/addons/website/static/src/css/editor.sass @@ -203,12 +203,14 @@ .oe_handle.nw,.oe_handle.w,.oe_handle.sw left: 0px -/* ---- MOBILE PREVIEW ---- */ +/* ---- MODAL DIALOGS ---- */ .oe_stop_scrolling height: 100% overflow: hidden +/* ---- MOBILE PREVIEW ---- */ + $mobile_preview_background: #000000 $mobile_preview_border: #1A1A1A $icon_close: #E00101 @@ -247,24 +249,27 @@ $icon_close: #E00101 .oe_mobile_preview_header .close - color: lightgrey + color: $mobile_preview_border opacity: 1 .close:hover color: $icon_close opacity: 1 +/* ---- SEO TOOLS ---- */ + +$remove_color: $icon_close .oe_seo_configuration input - width: inherit + width: 90% textarea - width: inherit + width: 90% ul list-style: none .oe_remove - color: $icon_close + color: $remove_color .oe_seo_keywords_list - width: 39em + width: 80% li float: left - width: 12em + width: 15em diff --git a/addons/website/static/src/js/website.js b/addons/website/static/src/js/website.js index d81c8bae996..2a54e9d569d 100644 --- a/addons/website/static/src/js/website.js +++ b/addons/website/static/src/js/website.js @@ -246,12 +246,15 @@ }, start: function () { $('body').addClass('oe_stop_scrolling'); - - this.$el.find('input[name=seo_page_url]').val(window.location.href); + this.$el.find('.js_seo_page_url').text(this.currentPage()); this.$el.find('input[name=seo_page_title]').val($('title').text()); - this.$el.modal(); }, + currentPage: function () { + var url = window.location.href; + var hashIndex = url.indexOf('#'); + return hashIndex > 0 ? url.substring(0, hashIndex): url; + }, keywords: function () { var result = []; this.$el.find('.js_seo_keyword').each(function () { @@ -272,7 +275,8 @@ } }, addKeyword: function () { - var word = this.$el.find('input[name=seo_page_keywords]').val().trim(); + var word = this.$el.find('input[name=seo_page_keywords]').val() + .replace(/[,;.:]+/gm, " ").replace(/ +/g, " ").trim(); if (word && !this.isKeywordListFull() && !this.isExistingKeyword(word)) { new website.seo.Keyword(this, { keyword: word diff --git a/addons/website/static/src/xml/website.xml b/addons/website/static/src/xml/website.xml index 5ac7f6f6f3b..630e9c4a55f 100644 --- a/addons/website/static/src/xml/website.xml +++ b/addons/website/static/src/xml/website.xml @@ -55,18 +55,14 @@ -