summaryrefslogtreecommitdiff
path: root/addons/website/static/src
diff options
context:
space:
mode:
authorddm <ddm@openerp.com>2013-10-11 16:17:59 +0200
committerddm <ddm@openerp.com>2013-10-11 16:17:59 +0200
commit2d1720811c2dc5f459d83c385ea5f05bb30a5e47 (patch)
tree0d4edb2909492b206d81c477319d5d7ac0fb28e5 /addons/website/static/src
parente5ef2e27e4fb932963155584e7e437af6a6f18a0 (diff)
parente14a26ee13c5754b4cdbb53323a54c4da283a768 (diff)
[MERGE] trunk-website-al
bzr revid: ddm@openerp.com-20131011141759-uqo52ta0haqyn3z6
Diffstat (limited to 'addons/website/static/src')
-rw-r--r--addons/website/static/src/css/editor.css97
-rw-r--r--addons/website/static/src/css/editor.sass90
-rw-r--r--addons/website/static/src/js/website.editor.js25
-rw-r--r--addons/website/static/src/xml/website.editor.xml3
4 files changed, 135 insertions, 80 deletions
diff --git a/addons/website/static/src/css/editor.css b/addons/website/static/src/css/editor.css
index 0368995185d..a541274f00d 100644
--- a/addons/website/static/src/css/editor.css
+++ b/addons/website/static/src/css/editor.css
@@ -1,4 +1,3 @@
-@charset "utf-8";
/* ---- CKEditor Minimal Reset ---- */
.navbar.navbar-inverse .cke_chrome {
border: none;
@@ -178,17 +177,23 @@ table.editorbar-panel td.selected {
}
#oe_snippets .scroll {
white-space: nowrap;
- overflow-y: auto;
+ overflow-y: none;
}
#oe_snippets .nav {
- position: fixed;
+ display: inline-block;
+ border-bottom: none !important;
+ vertical-align: middle;
+ margin-top: 5px;
+ min-width: 120px;
+ margin-left: 6px;
z-index: 1;
- border: 0;
}
#oe_snippets .nav > li {
- display: inline-block;
+ display: block;
float: none;
- font-size: 13px;
+}
+#oe_snippets .nav > li.active {
+ background: black !important;
}
#oe_snippets .nav > li > a {
padding: 2px 10px !important;
@@ -196,10 +201,14 @@ table.editorbar-panel td.selected {
display: block;
border: 0;
}
+#oe_snippets .pill-content {
+ border: 0;
+}
#oe_snippets .tab-content {
- margin-top: 24px;
display: inline-block;
white-space: nowrap;
+ background: black;
+ margin-top: 5px;
}
#oe_snippets .tab-content > div {
background: black;
@@ -207,7 +216,6 @@ table.editorbar-panel td.selected {
}
#oe_snippets .tab-content > div label {
width: 44px;
- height: 100%;
color: white;
padding-left: 10px;
}
@@ -227,10 +235,9 @@ table.editorbar-panel td.selected {
}
.oe_snippet {
- display: inline-block;
+ float: left;
vertical-align: top;
width: 100px;
- height: 100px;
margin: 1px;
margin-top: 0px;
position: relative;
@@ -249,14 +256,31 @@ table.editorbar-panel td.selected {
color: white;
position: relative;
}
+.oe_snippet .oe_snippet_thumbnail:hover .oe_snippet_thumbnail_img {
+ -webkit-transform: scale(0.95, 0.95);
+ -moz-transform: scale(0.95, 0.95);
+ -ms-transform: scale(0.95, 0.95);
+ -o-transform: scale(0.95, 0.95);
+ transform: scale(0.95, 0.95);
+}
.oe_snippet .oe_snippet_thumbnail .oe_snippet_thumbnail_title {
font-size: 12px;
display: block;
+ text-shadow: 0 0 2px black;
}
.oe_snippet .oe_snippet_thumbnail .oe_snippet_thumbnail_img {
+ -webkit-transition: all 150ms linear;
+ -moz-transition: all 150ms linear;
+ -o-transition: all 150ms linear;
+ transition: all 150ms linear;
-webkit-box-shadow: inset 0px 0px 0px 3px #333333;
-moz-box-shadow: inset 0px 0px 0px 3px #333333;
box-shadow: inset 0px 0px 0px 3px #333333;
+ -webkit-transform: scale(1, 1);
+ -moz-transform: scale(1, 1);
+ -ms-transform: scale(1, 1);
+ -o-transform: scale(1, 1);
+ transform: scale(1, 1);
}
.oe_snippet .oe_snippet_thumbnail span, .oe_snippet .oe_snippet_thumbnail div {
line-height: 18px;
@@ -305,20 +329,21 @@ table.editorbar-panel td.selected {
margin: 0px -24px !important;
}
.oe_drop_zone.oe_insert.oe_overlay {
- background: rgba(153, 0, 255, 0.17);
border-radius: 3px;
+ background: rgba(153, 0, 255, 0.5);
}
.oe_drop_zone, .oe_drop_zone_style {
- background: rgba(153, 0, 255, 0.17);
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- -ms-border-radius: 3px;
- -o-border-radius: 3px;
- border-radius: 3px;
+ border: none;
+ background: rgba(153, 0, 255, 0.3);
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ -ms-border-radius: 4px;
+ -o-border-radius: 4px;
+ border-radius: 4px;
}
.oe_drop_zone.oe_hover, .oe_drop_zone_style.oe_hover {
- background: rgba(0, 255, 133, 0.22);
+ background: rgba(0, 255, 133, 0.3);
z-index: 1001;
}
@@ -355,7 +380,7 @@ table.editorbar-panel td.selected {
-webkit-box-shadow: 0px 0px 0px 1px rgba(255, 255, 255, 0.3), 0px 0px 0px 1px rgba(255, 255, 255, 0.3) inset;
-moz-box-shadow: 0px 0px 0px 1px rgba(255, 255, 255, 0.3), 0px 0px 0px 1px rgba(255, 255, 255, 0.3) inset;
box-shadow: 0px 0px 0px 1px rgba(255, 255, 255, 0.3), 0px 0px 0px 1px rgba(255, 255, 255, 0.3) inset;
- border-color: rgba(153, 0, 255, 0.5);
+ border-color: rgba(0, 0, 0, 0.5);
}
.oe_overlay.oe_active .oe_handle {
display: block !important;
@@ -367,39 +392,43 @@ table.editorbar-panel td.selected {
left: 50%;
display: block;
background: white;
- border: solid 1px #9900ff;
- -webkit-border-radius: 8px;
- -moz-border-radius: 8px;
- -ms-border-radius: 8px;
- -o-border-radius: 8px;
- border-radius: 8px;
- width: 16px;
- height: 16px;
- margin: -8px;
+ border: solid 1px rgba(0, 0, 0, 0.2);
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ -ms-border-radius: 5px;
+ -o-border-radius: 5px;
+ border-radius: 5px;
+ width: 18px;
+ height: 18px;
+ margin: -9px;
padding-left: 1px;
font-size: 14px;
line-height: 14px;
- color: #9900ff;
+ font-family: FontAwesome;
+ color: rgba(0, 0, 0, 0.5);
-webkit-transition: background 100ms linear;
-moz-transition: background 100ms linear;
-o-transition: background 100ms linear;
transition: background 100ms linear;
}
.oe_overlay.oe_active .oe_handle:hover:before {
- background: #9900ff;
+ background: rgba(0, 0, 0, 0.5);
color: white;
+ -webkit-box-shadow: 0 0 5px 3px rgba(255, 255, 255, 0.7);
+ -moz-box-shadow: 0 0 5px 3px rgba(255, 255, 255, 0.7);
+ box-shadow: 0 0 5px 3px rgba(255, 255, 255, 0.7);
}
.oe_overlay.oe_active .oe_handle.e:before {
- content: "⇨";
+ content: "\F061";
}
.oe_overlay.oe_active .oe_handle.s:before {
- content: "⇩";
+ content: "\F063";
}
.oe_overlay.oe_active .oe_handle.w:before {
- content: "⇦";
+ content: "\F060";
}
.oe_overlay.oe_active .oe_handle.n:before {
- content: "⇧";
+ content: "\F062";
}
.oe_overlay .icon.btn {
display: inline-block;
diff --git a/addons/website/static/src/css/editor.sass b/addons/website/static/src/css/editor.sass
index 26838496cc8..ddb860ddd33 100644
--- a/addons/website/static/src/css/editor.sass
+++ b/addons/website/static/src/css/editor.sass
@@ -4,6 +4,17 @@
@import "compass/css3/user-interface"
@import "compass/css3/transition"
+//smartphones, iPhone, portrait 480x320 phones
+$smart_phone: 320px
+//portrait e-readers (Nook/Kindle), smaller tablets @ 600 or @ 640 wide.*/
+$small-tablet: 481px
+//portrait tablets, portrait iPad, landscape e-readers, landscape 800x480 or 854x480 phones
+$portrait-tablet: 641px
+//tablet, landscape iPad, lo-res laptops ands desktops
+$tablet: 961px
+//big landscape tablets, laptops, and desktops
+$desktop: 1025px
+
/* ---- CKEditor Minimal Reset ---- */
.navbar.navbar-inverse .cke_chrome
@@ -146,32 +157,40 @@ table.editorbar-panel
height: auto
.scroll
white-space: nowrap
- overflow-y: auto
+ overflow-y: none
.nav
+ display: inline-block
+ border-bottom: none !important
+ vertical-align: middle
+ margin-top: 5px
+ min-width: 120px
+ margin-left: 6px
> li
- display: inline-block
+ display: block
float: none
- font-size: 13px
+ &.active
+ background: black !important
> a
padding: 2px 10px !important
- width: 100%
+ width: 100%
display: block
border: 0
- position: fixed
z-index: 1
+ .pill-content
border: 0
.tab-content
- margin-top: 24px
display: inline-block
white-space: nowrap
- > div
+ background: black
+ margin-top: 5px
+ > div
background: rgb(0,0,0)
padding: 5px
label
width: 44px
- height: 100%
color: #fff
padding-left: 10px
+
div
width: 100px
text-align: center
@@ -179,10 +198,9 @@ table.editorbar-panel
@include transform-origin(50% 50%)
.oe_snippet
- display: inline-block
+ float: left
vertical-align: top
width: 100px
- height: 100px
margin: 1px
margin-top: 0px
position: relative
@@ -197,11 +215,17 @@ table.editorbar-panel
background: transparent
color: white
position: relative
+ &:hover
+ .oe_snippet_thumbnail_img
+ @include transform( scale(.95,.95))
.oe_snippet_thumbnail_title
font-size: 12px
display: block
+ +text-shadow(0 0 2px rgb(0,0,0))
.oe_snippet_thumbnail_img
+ @include transition(all 150ms linear)
+box-shadow(inset 0px 0px 0px 3px #333333)
+ @include transform( scale(1,1))
span, div
line-height: 18px
& > :not(.oe_snippet_thumbnail)
@@ -236,14 +260,19 @@ table.editorbar-panel
position: relative
margin: 0px -24px !important
&.oe_overlay
- background: rgba(153, 0, 255, 0.17)
border-radius: 3px
-
+ //@include background-image( repeating-linear-gradient(45deg, rgba(255,255,255,.1) ,rgba(255,255,255,.1) 35px, rgba(0,0,0,.1) 35px, rgba(0,0,0,.1) 75px))
+ //background-size: 100px 100px
+ background: rgba(153, 0, 255,.5)
+
.oe_drop_zone, .oe_drop_zone_style
- background: rgba(153, 0, 255, 0.17)
- +border-radius(3px)
+ border: none
+ //@include background-image( repeating-linear-gradient(45deg, rgba(255,255,255,.1) ,rgba(255,255,255,.1) 35px, rgba(0,0,0,.1) 35px, rgba(0,0,0,.1) 75px))
+ //background-size: 100px 100px
+ background: rgba(153, 0, 255, .3)
+ +border-radius(4px)
&.oe_hover
- background: rgba(0, 255, 133, 0.22)
+ background: rgba(0, 255, 133, .3)
z-index: 1001
.oe_drop_zone_style
@@ -258,6 +287,7 @@ table.editorbar-panel
display: none
position: absolute
background: transparent
+ //@include background-image( repeating-linear-gradient(45deg, rgba(255,255,255,.02) ,rgba(255,255,255,.02) 35px, rgba(0,0,0,.02) 35px, rgba(0,0,0,.02) 75px))
+border-radius(3px)
@include transition(opacity 100ms linear)
+box-sizing(border-box)
@@ -267,7 +297,7 @@ table.editorbar-panel
border-style: dashed
border-width: 1px
+box-shadow(0px 0px 0px 1px rgba(255,255,255,0.3), 0px 0px 0px 1px rgba(255,255,255,0.3) inset)
- border-color: rgba(153, 0, 255, 0.5)
+ border-color: rgba(0, 0, 0, 0.5)
.oe_handle
display: block !important
pointer-events: auto
@@ -277,27 +307,29 @@ table.editorbar-panel
left: 50%
display: block
background: rgba(255, 255, 255, 1)
- border: solid 1px rgba(153, 0, 255, 1)
- +border-radius(8px)
- width: 16px
- height: 16px
- margin: -8px
+ border: solid 1px rgba(0, 0, 0, .2)
+ +border-radius(5px)
+ width: 18px
+ height: 18px
+ margin: -9px
padding-left: 1px
font-size: 14px
line-height: 14px
- color: rgba(153, 0, 255, 1)
+ font-family: FontAwesome
+ color: rgba(0,0,0,.5)
@include transition(background 100ms linear)
&:hover:before
- background: rgba(153, 0, 255, 1)
+ background: rgba(0, 0, 0, .5)
color: #fff
+ +box-shadow(0 0 5px 3px rgba(255,255,255,.7))
.oe_handle.e:before
- content: "⇨"
+ content: "\F061"
.oe_handle.s:before
- content: "⇩"
+ content: "\F063"
.oe_handle.w:before
- content: "⇦"
+ content: "\F060"
.oe_handle.n:before
- content: "⇧"
+ content: "\F062"
.icon.btn
display: inline-block
@@ -432,10 +464,6 @@ $ace_width: 720px
$editorbar_height: 40px
// TODO Fix => might break with themes
$navbar_height: 51px
-@mixin pointer-events($type: none)
- $type: unquote($type)
- @include experimental(pointer-events, $type,-moz, -webkit, not -o, not -ms, -khtml, official)
-
@mixin editor-font
font-size: 14px
diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js
index 7d3ebc74321..d839252bc58 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',
@@ -604,7 +602,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);
});
@@ -801,6 +799,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 =>
diff --git a/addons/website/static/src/xml/website.editor.xml b/addons/website/static/src/xml/website.editor.xml
index 157d19b56c0..66da9692d8e 100644
--- a/addons/website/static/src/xml/website.editor.xml
+++ b/addons/website/static/src/xml/website.editor.xml
@@ -55,8 +55,7 @@
New page
</label>
</h3>
- <input type="text" class="form-control pages url-source"
- id="link-new" pattern="[\\w/-]+"/>
+ <input type="text" class="form-control pages url-source" id="link-new"/>
</li>
<li class="list-group-item form-group clearfix">
<div class="pull-right">