diff --git a/addons/mail/static/src/less/client_action.less b/addons/mail/static/src/less/client_action.less index 8811eb28f4f..b2749199ca4 100644 --- a/addons/mail/static/src/less/client_action.less +++ b/addons/mail/static/src/less/client_action.less @@ -312,15 +312,6 @@ .o_mail_navbar_dropdown { width: 350px; padding: 0; - @media (max-width: @screen-xs-max) { - background-color: white!important; - max-height: none!important; - position: fixed!important; - top: @navbar-height; - right: 0; - bottom: 0; - left: 0; - } .o_spinner { .o-flex-display(); diff --git a/addons/mass_mailing/static/src/css/mass_mailing_editor.css b/addons/mass_mailing/static/src/css/mass_mailing_editor.css deleted file mode 100644 index e2efcf87efa..00000000000 --- a/addons/mass_mailing/static/src/css/mass_mailing_editor.css +++ /dev/null @@ -1,116 +0,0 @@ -#email_theme_list, #email_template_list { - clear: both; - text-align: center; -} - -#email_theme_list > div, #email_template_list > div { - width: 200px; - display: inline-block; - position: relative; -} - -.theme_thumbnail{ - position:inherit; - margin-top:15px; -} -.theme_thumbnail div{ - -webkit-transition: opacity 0.5s; - transition: opacity 0.5s; -} -.theme_thumbnail img.img{ - height: 180px; - width: auto; -} - -.modal-body .theme_thumbnail img.img{ - height: 100px; -} - -.theme_thumbnail div.overlay{ - z-index: 2; - max-height: 135px; - position:absolute; - padding:25% 0; - opacity: 0; - width: 100%; -} -.theme_thumbnail div.overlay p{ - color:#616161; - font-weight:bold; - text-transform: capitalize; -} -.theme_thumbnail:hover>img.img{ - opacity:0.3; -} -.theme_thumbnail:hover>div.overlay{ - opacity: 1; -} - -.email_head { - border-width: 0px 0px 2px 0px; -} -.email_head div{ - font-size:14px; -} -.email_head .popover-title{ - font-weight:bold; -} - -.template_name{ - width: 160px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} -.email_template *{ - -webkit-transition: opacity 0.5s; - transition: opacity 0.5s; -} -.email_template:hover .template_thumbnail{ - opacity:0.3; -} -.email_template:hover .template_options{ - opacity:1; -} - -/***************************/ - -#templates{ - margin-top: 50px; - width: 98%; -} -#choose_template{ - display: none; - margin: 5px; - position: fixed; - top: 0; - right: 28px; - z-index: 2000; -} -#choose_template span{ - padding: 1px 5px; - height: 24px; -} -#templates .template_preview_border{ - overflow: hidden !important; - border: 2px solid grey; - height: 300px; -} -#email_template_list > div{ - overflow: hidden; - height: 300px; -} -#email_template_list .theme_thumbnail div.overlay{ - max-height: 300px; -} -#templates .template_preview{ - -webkit-transform: scale(.33); - -ms-transform: scale(.33); - transform: scale(.33); - -webkit-transform-origin: 0 0; - -ms-transform-origin: 0 0; - transform-origin: 0 0; -} -.theme_thumbnail:hover>.template_preview{ - opacity:0.3; -} diff --git a/addons/mass_mailing/static/src/js/mass_mailing_editor.js b/addons/mass_mailing/static/src/js/mass_mailing_editor.js index 7b312373e8d..7e84ff62594 100644 --- a/addons/mass_mailing/static/src/js/mass_mailing_editor.js +++ b/addons/mass_mailing/static/src/js/mass_mailing_editor.js @@ -165,7 +165,7 @@ web_editor.Class.include({ } var $editable = $("#editable_area"); $(".o_table_handler").remove(); - $editable.parent().add("#oe_snippets, #templates, .note-popover").toggleClass("hidden"); + $editable.add("#oe_snippets, #templates, .note-popover").toggleClass("hidden"); $("#choose_template").children().toggleClass("hidden"); $("body").trigger("resize"); $(window.top).trigger('resize'); @@ -177,7 +177,7 @@ web_editor.Class.include({ var $editable = $("#editable_area"); this.rte.historyRecordUndo($editable); $editable.html( $(event.target).closest(".theme_thumbnail").find(".js_content").html() ); - $editable.parent().add("#oe_snippets, #templates, .note-popover").toggleClass("hidden"); + $editable.add("#oe_snippets, #templates, .note-popover").toggleClass("hidden"); $("#choose_template").children().toggleClass("hidden"); setTimeout(function () { $("body").trigger("resize"); @@ -191,8 +191,8 @@ web_editor.Class.include({ event.preventDefault(); }, set_snippet_theme: function (theme) { - $("#o_left_bar .o_panel_body > div").addClass("hidden"); - $("#o_left_bar .o_panel_body > div."+theme).removeClass("hidden"); + $("#oe_snippets .o_panel_body > div").addClass("hidden"); + $("#oe_snippets .o_panel_body > div."+theme).removeClass("hidden"); $("#editable_area").trigger("content_changed"); }, get_snippet_template: function (mailing_model) { @@ -225,7 +225,7 @@ snippets_editor.Class.include({ clean_for_save: function () { this._super(); var $editable = $("#editable_area"); - var theme = ($("#o_left_bar .o_panel_body > div:not(.hidden)").attr("class") || "").replace(/^\s*|\s*o_mail_block[^\s]+\s*|\s*oe_snippet\s*|\s*ui-draggable\s*|\s*$/g, ''); + var theme = ($("#oe_snippets .o_panel_body > div:not(.hidden)").attr("class") || "").replace(/^\s*|\s*o_mail_block[^\s]+\s*|\s*oe_snippet\s*|\s*ui-draggable\s*|\s*$/g, ''); var $theme = $("#editable_area [data-snippet-theme]").removeAttr("data-snippet-theme").removeData("snippet-theme"); $editable.children().first().attr("data-snippet-theme", theme); $editable.find(":not(br):hidden").remove(); diff --git a/addons/mass_mailing/static/src/less/mass_mailing_editor.less b/addons/mass_mailing/static/src/less/mass_mailing_editor.less new file mode 100644 index 00000000000..e463ec1b6d1 --- /dev/null +++ b/addons/mass_mailing/static/src/less/mass_mailing_editor.less @@ -0,0 +1,121 @@ + +#email_theme_list, #email_template_list { + clear: both; + text-align: center; + + > div { + width: 200px; + display: inline-block; + position: relative; + } +} +.theme_thumbnail { + position: inherit; + margin-top: 15px; + + div { + .o-transition(opacity, 0.5s); + + &.overlay { + z-index: 2; + max-height: 135px; + position:absolute; + padding:25% 0; + opacity: 0; + width: 100%; + + p { + color:#616161; + font-weight:bold; + text-transform: capitalize; + } + } + } + img.img { + width: auto; + height: 180px; + } + + &:hover { + > img.img { + opacity:0.3; + } + > div.overlay { + opacity: 1; + } + > .template_preview { + opacity:0.3; + } + } +} +.modal-body .theme_thumbnail img.img { + height: 100px; +} +.email_head { + border-width: 0px 0px 2px 0px; + div { + font-size:14px; + } + .popover-title { + font-weight:bold; + } +} +.template_name { + width: 160px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.email_template * { + .o-transition(opacity, 0.5s); + &:hover { + .template_thumbnail { + opacity:0.3; + } + .template_options { + opacity:1; + } + } +} +#templates { + margin: -@odoo-navbar-height 0 0 -@o-we-sidebar-width; + padding: 10px @odoo-horizontal-padding; + border: 1px solid @odoo-brand-secondary; + background-color: white; + + .template_preview_border { + overflow: hidden !important; + border: 2px solid grey; + height: 300px; + } + .template_preview { + -webkit-transform: scale(.33); + -ms-transform: scale(.33); + transform: scale(.33); + -webkit-transform-origin: 0 0; + -ms-transform-origin: 0 0; + transform-origin: 0 0; + } +} +#choose_template { + display: none; + margin: 5px; + position: fixed; + top: 0; + right: 28px; + z-index: 2000; + + span { + padding: 1px 5px; + height: 24px; + } +} +#email_template_list { + > div { + overflow: hidden; + height: 300px; + } + .theme_thumbnail div.overlay { + max-height: 300px; + } +} diff --git a/addons/mass_mailing/views/editor_field_html.xml b/addons/mass_mailing/views/editor_field_html.xml index 11224aa4fbb..77244586669 100644 --- a/addons/mass_mailing/views/editor_field_html.xml +++ b/addons/mass_mailing/views/editor_field_html.xml @@ -1,13 +1,15 @@ - - + + - - - - + diff --git a/addons/mass_mailing/views/snippets_themes.xml b/addons/mass_mailing/views/snippets_themes.xml index 2bce3bb239b..c718d5d2955 100644 --- a/addons/mass_mailing/views/snippets_themes.xml +++ b/addons/mass_mailing/views/snippets_themes.xml @@ -1,512 +1,510 @@ - - - - + + - + diff --git a/addons/web_editor/static/lib/summernote/src/js/Renderer.js b/addons/web_editor/static/lib/summernote/src/js/Renderer.js index ac45698cd62..52d0975ee47 100644 --- a/addons/web_editor/static/lib/summernote/src/js/Renderer.js +++ b/addons/web_editor/static/lib/summernote/src/js/Renderer.js @@ -31,6 +31,7 @@ define([ var title = options.title; var className = options.className; var dropdown = options.dropdown; + var no_caret = options.no_caret; var hide = options.hide; return (dropdown ? '
' + label + - (dropdown ? ' ' : '') + + ((dropdown && !no_caret)? ' ' : '') + '' + (dropdown || '') + (dropdown ? '
' : ''); @@ -216,36 +217,60 @@ define([ color: function (lang, options) { var colorButtonLabel = ''; - + '" id="colors_preview" style="color:white;background-color:#B35E9B">'; var colorButton = tplButton(colorButtonLabel, { className: 'note-recent-color', title: lang.color.recent, event: 'color', - value: '{"backColor":"yellow"}' + value: '{"backColor":"#B35E9B"}' }); - var items = [ - '
  • ', - '
    ' + lang.color.background + '
    ', - '
    ' + lang.color.setTransparent + '
    ', - '
    ', - '
    ', - '
    ' + lang.color.foreground + '
    ', - '
    ', - lang.color.resetToDefault, - '
    ', - '
    ', - '
  • ' - ]; + // This is a copy of web_editor.snippet.option.colorpicker qweb template + var colorpicker_template = '' + + ''; - var moreButton = tplButton('', { - title: lang.color.more, - dropdown: tplDropdown(items) + var foreground = formatStr(colorpicker_template, [lang.color.foreground, lang.color.reset, 'foreColor']); + var background = formatStr(colorpicker_template, [lang.color.background, lang.color.transparent, 'backColor']); + + var foregroundButton = tplButton('', { + title: lang.color.foreground, + className: 'o_foreground_toggle', + dropdown: foreground, + no_caret: true, + }); + var backgroundButton = tplButton('', { + title: lang.color.background, + className: 'o_background_toggle', + dropdown: background, + no_caret: true, }); - return colorButton + moreButton; + return colorButton + foregroundButton + backgroundButton; + + function formatStr(str, values) { + return str.replace(/{(\d+)}/g, function (match, number) { + return (values[number] !== undefined)? values[number] : match; + }); + }; }, bold: function (lang, options) { return tplIconButton(options.iconPrefix + options.icons.font.bold, { @@ -793,12 +818,13 @@ define([ }); var body = document.body; + var $container = $('#web_editor-toolbars') // create Popover var $popover = $(this.tplPopovers(langInfo, options)); // ODOO: user (maybe) overrided method $popover.addClass('note-air-layout'); $popover.attr('id', 'note-popover-' + id); - $popover.appendTo(body); + $popover.appendTo($container); createTooltip($popover, keyMap); this.createPalette($popover, options); // ODOO: use (maybe) overrided method @@ -806,7 +832,7 @@ define([ var $handle = $(tplHandles(options)); $handle.addClass('note-air-layout'); $handle.attr('id', 'note-handle-' + id); - $handle.appendTo(body); + $handle.appendTo($container); // create Dialog var $dialog = $(tplDialogs(langInfo, options)); @@ -815,7 +841,7 @@ define([ $dialog.find('button.close, a.modal-close').click(function () { $(this).closest('.modal').modal('hide'); }); - $dialog.appendTo(body); + $dialog.appendTo($container); }; /** diff --git a/addons/web_editor/static/lib/summernote/src/js/defaults.js b/addons/web_editor/static/lib/summernote/src/js/defaults.js index f7b0c0c6379..9d8e0bab661 100644 --- a/addons/web_editor/static/lib/summernote/src/js/defaults.js +++ b/addons/web_editor/static/lib/summernote/src/js/defaults.js @@ -357,7 +357,7 @@ define('summernote/defaults', function () { }, style: { style: 'Style', - normal: 'Normal', + normal: 'Paragraph', blockquote: 'Quote', pre: 'Code', h1: 'Header 1', diff --git a/addons/web_editor/static/lib/summernote/src/less/elements.less b/addons/web_editor/static/lib/summernote/src/less/elements.less deleted file mode 100644 index 2ece26af004..00000000000 --- a/addons/web_editor/static/lib/summernote/src/less/elements.less +++ /dev/null @@ -1,156 +0,0 @@ -/*--------------------------------------------------- - LESS Elements 0.9 - --------------------------------------------------- - A set of useful LESS mixins - More info at: http://lesselements.com - ---------------------------------------------------*/ - -.gradient(@color: #F5F5F5, @start: #EEE, @stop: #FFF) { - background: @color; - background: -webkit-gradient(linear, - left bottom, - left top, - color-stop(0, @start), - color-stop(1, @stop)); - background: -ms-linear-gradient(bottom, - @start, - @stop); - background: -moz-linear-gradient(center bottom, - @start 0%, - @stop 100%); - background: -o-linear-gradient(@stop, - @start); - filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",@stop,@start)); -} -.bw-gradient(@color: #F5F5F5, @start: 0, @stop: 255) { - background: @color; - background: -webkit-gradient(linear, - left bottom, - left top, - color-stop(0, rgb(@start,@start,@start)), - color-stop(1, rgb(@stop,@stop,@stop))); - background: -ms-linear-gradient(bottom, - rgb(@start,@start,@start) 0%, - rgb(@stop,@stop,@stop) 100%); - background: -moz-linear-gradient(center bottom, - rgb(@start,@start,@start) 0%, - rgb(@stop,@stop,@stop) 100%); - background: -o-linear-gradient(rgb(@stop,@stop,@stop), - rgb(@start,@start,@start)); - filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",rgb(@stop,@stop,@stop),rgb(@start,@start,@start))); -} -.bordered(@top-color: #EEE, @right-color: #EEE, @bottom-color: #EEE, @left-color: #EEE) { - border-top: solid 1px @top-color; - border-left: solid 1px @left-color; - border-right: solid 1px @right-color; - border-bottom: solid 1px @bottom-color; -} -.drop-shadow(@x-axis: 0, @y-axis: 1px, @blur: 2px, @alpha: 0.1) { - -webkit-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha); - -moz-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha); - box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha); -} -.rounded(@radius: 2px) { - -webkit-border-radius: @radius; - -moz-border-radius: @radius; - border-radius: @radius; -} -.border-radius(@topright: 0, @bottomright: 0, @bottomleft: 0, @topleft: 0) { - -webkit-border-top-right-radius: @topright; - -webkit-border-bottom-right-radius: @bottomright; - -webkit-border-bottom-left-radius: @bottomleft; - -webkit-border-top-left-radius: @topleft; - -moz-border-radius-topright: @topright; - -moz-border-radius-bottomright: @bottomright; - -moz-border-radius-bottomleft: @bottomleft; - -moz-border-radius-topleft: @topleft; - border-top-right-radius: @topright; - border-bottom-right-radius: @bottomright; - border-bottom-left-radius: @bottomleft; - border-top-left-radius: @topleft; - .background-clip(padding-box); -} -.opacity(@opacity: 0.5) { - -webkit-opacity: @opacity; - -khtml-opacity: @opacity; - -moz-opacity: @opacity; - opacity: @opacity; - @opperc: @opacity * 100; - -ms-filter: ~"progid:DXImageTransform.Microsoft.Alpha(opacity=@{opperc})"; - filter: ~"alpha(opacity=@{opperc})"; -} -.transition-duration(@duration: 0.2s) { - -moz-transition-duration: @duration; - -webkit-transition-duration: @duration; - -o-transition-duration: @duration; - transition-duration: @duration; -} -.transform(...) { - -webkit-transform: @arguments; - -moz-transform: @arguments; - -o-transform: @arguments; - -ms-transform: @arguments; - transform: @arguments; -} -.rotation(@deg:5deg){ - .transform(rotate(@deg)); -} -.scale(@ratio:1.5){ - .transform(scale(@ratio)); -} -.transition(@duration:0.2s, @ease:ease-out) { - -webkit-transition: all @duration @ease; - -moz-transition: all @duration @ease; - -o-transition: all @duration @ease; - transition: all @duration @ease; -} -.inner-shadow(@horizontal:0, @vertical:1px, @blur:2px, @alpha: 0.4) { - -webkit-box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha); - -moz-box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha); - box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha); -} -.box-shadow(@arguments) { - -webkit-box-shadow: @arguments; - -moz-box-shadow: @arguments; - box-shadow: @arguments; -} -.box-sizing(@sizing: border-box) { - -ms-box-sizing: @sizing; - -moz-box-sizing: @sizing; - -webkit-box-sizing: @sizing; - box-sizing: @sizing; -} -.user-select(@argument: none) { - -webkit-user-select: @argument; - -moz-user-select: @argument; - -ms-user-select: @argument; - user-select: @argument; -} -.columns(@colwidth: 250px, @colcount: 0, @colgap: 50px, @columnRuleColor: #EEE, @columnRuleStyle: solid, @columnRuleWidth: 1px) { - -moz-column-width: @colwidth; - -moz-column-count: @colcount; - -moz-column-gap: @colgap; - -moz-column-rule-color: @columnRuleColor; - -moz-column-rule-style: @columnRuleStyle; - -moz-column-rule-width: @columnRuleWidth; - -webkit-column-width: @colwidth; - -webkit-column-count: @colcount; - -webkit-column-gap: @colgap; - -webkit-column-rule-color: @columnRuleColor; - -webkit-column-rule-style: @columnRuleStyle; - -webkit-column-rule-width: @columnRuleWidth; - column-width: @colwidth; - column-count: @colcount; - column-gap: @colgap; - column-rule-color: @columnRuleColor; - column-rule-style: @columnRuleStyle; - column-rule-width: @columnRuleWidth; -} -.translate(@x:0, @y:0) { - .transform(translate(@x, @y)); -} -.background-clip(@argument: padding-box) { - -moz-background-clip: @argument; - -webkit-background-clip: @argument; - background-clip: @argument; -} diff --git a/addons/web_editor/static/lib/summernote/src/less/summernote.less b/addons/web_editor/static/lib/summernote/src/less/summernote.less index 806d1860ed7..512216845b2 100644 --- a/addons/web_editor/static/lib/summernote/src/less/summernote.less +++ b/addons/web_editor/static/lib/summernote/src/less/summernote.less @@ -1,5 +1,3 @@ -/* @_import "elements.less"; ODOO: removed call directly */ - /* Theme Variables ------------------------------------------*/ @border-color: #a9a9a9; @@ -102,8 +100,8 @@ resize: none; /* override BS2 default style */ - .box-sizing(border-box); - .rounded(0); + box-sizing: border-box; + border-radius: 0; margin-bottom: 0; } } @@ -224,7 +222,7 @@ margin: 3px; padding: 0 3px; cursor: pointer; - .rounded(5px); + border-radius: 5px; } .note-color-row { @@ -324,12 +322,12 @@ font-size: 12px; color: #ccc; background-color: #222 !important; - .opacity(0.9); + opacity: 0.9; .modal-content { background: transparent; border: 1px solid white; - .box-shadow(none); - .rounded(5px); + box-shadow: none; + border-radius: 5px; } /* BS2's background pacth. */ @@ -403,7 +401,7 @@ width: 100%; height: 100%; background-color: black; - .opacity(0.30) + opacity: 0.3; } .note-control-handle { @@ -462,8 +460,8 @@ color: white; background-color: black; font-size: 12px; - .rounded(5px); - .opacity(0.7); + border-radius: 5px; + opacity: 0.7; } } } diff --git a/addons/web_editor/static/lib/summernote/summernote.css b/addons/web_editor/static/lib/summernote/summernote.css deleted file mode 100644 index f22f83c5acd..00000000000 --- a/addons/web_editor/static/lib/summernote/summernote.css +++ /dev/null @@ -1 +0,0 @@ -.note-editor{position:relative;border:1px solid #a9a9a9}.note-editor .note-dropzone{position:absolute;z-index:1;display:none;color:#87cefa;background-color:white;border:2px dashed #87cefa;opacity:.95;pointer-event:none}.note-editor .note-dropzone .note-dropzone-message{display:table-cell;font-size:28px;font-weight:bold;text-align:center;vertical-align:middle}.note-editor .note-dropzone.hover{color:#098ddf;border:2px dashed #098ddf}.note-editor.dragover .note-dropzone{display:table}.note-editor .note-toolbar{background-color:#f5f5f5;border-bottom:1px solid #a9a9a9}.note-editor.fullscreen{position:fixed;top:0;left:0;z-index:1050;width:100%}.note-editor.fullscreen .note-editable{background-color:white}.note-editor.fullscreen .note-resizebar{display:none}.note-editor.codeview .note-editable{display:none}.note-editor.codeview .note-codable{display:block}.note-editor .note-statusbar{background-color:#f5f5f5}.note-editor .note-statusbar .note-resizebar{width:100%;height:8px;cursor:ns-resize;border-top:1px solid #a9a9a9}.note-editor .note-statusbar .note-resizebar .note-icon-bar{width:20px;margin:1px auto;border-top:1px solid #a9a9a9}.note-editor .note-editable{padding:10px;overflow:auto;outline:0}.note-editor .note-editable[contenteditable="false"]{background-color:#e5e5e5}.note-editor .note-codable{display:none;width:100%;padding:10px;margin-bottom:0;font-family:Menlo,Monaco,monospace,sans-serif;font-size:14px;color:#ccc;background-color:#222;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;box-shadow:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;resize:none}.note-air-editor{outline:0}.note-popover .popover{max-width:none}.note-popover .popover .popover-content a{display:inline-block;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}.note-popover .popover .arrow{left:20px}.note-popover .popover .popover-content,.note-toolbar{padding:0 0 5px 5px;margin:0}.note-popover .popover .popover-content>.btn-group,.note-toolbar>.btn-group{margin-top:5px;margin-right:5px;margin-left:0}.note-popover .popover .popover-content .note-table .dropdown-menu,.note-toolbar .note-table .dropdown-menu{min-width:0;padding:5px}.note-popover .popover .popover-content .note-table .dropdown-menu .note-dimension-picker,.note-toolbar .note-table .dropdown-menu .note-dimension-picker{font-size:18px}.note-popover .popover .popover-content .note-table .dropdown-menu .note-dimension-picker .note-dimension-picker-mousecatcher,.note-toolbar .note-table .dropdown-menu .note-dimension-picker .note-dimension-picker-mousecatcher{position:absolute!important;z-index:3;width:10em;height:10em;cursor:pointer}.note-popover .popover .popover-content .note-table .dropdown-menu .note-dimension-picker .note-dimension-picker-unhighlighted,.note-toolbar .note-table .dropdown-menu .note-dimension-picker .note-dimension-picker-unhighlighted{position:relative!important;z-index:1;width:5em;height:5em;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIj4+Pjp6ekKlAqjAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKhmnaJzPAAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC') repeat}.note-popover .popover .popover-content .note-table .dropdown-menu .note-dimension-picker .note-dimension-picker-highlighted,.note-toolbar .note-table .dropdown-menu .note-dimension-picker .note-dimension-picker-highlighted{position:absolute!important;z-index:2;width:1em;height:1em;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIjd6vvD2f9LKLW+AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKwNDEVT0AAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC') repeat}.note-popover .popover .popover-content .note-style h1,.note-toolbar .note-style h1,.note-popover .popover .popover-content .note-style h2,.note-toolbar .note-style h2,.note-popover .popover .popover-content .note-style h3,.note-toolbar .note-style h3,.note-popover .popover .popover-content .note-style h4,.note-toolbar .note-style h4,.note-popover .popover .popover-content .note-style h5,.note-toolbar .note-style h5,.note-popover .popover .popover-content .note-style h6,.note-toolbar .note-style h6,.note-popover .popover .popover-content .note-style blockquote,.note-toolbar .note-style blockquote{margin:0}.note-popover .popover .popover-content .note-color .dropdown-toggle,.note-toolbar .note-color .dropdown-toggle{width:20px;padding-left:5px}.note-popover .popover .popover-content .note-color .dropdown-menu,.note-toolbar .note-color .dropdown-menu{min-width:340px}.note-popover .popover .popover-content .note-color .dropdown-menu .btn-group,.note-toolbar .note-color .dropdown-menu .btn-group{margin:0}.note-popover .popover .popover-content .note-color .dropdown-menu .btn-group:first-child,.note-toolbar .note-color .dropdown-menu .btn-group:first-child{margin:0 5px}.note-popover .popover .popover-content .note-color .dropdown-menu .btn-group .note-palette-title,.note-toolbar .note-color .dropdown-menu .btn-group .note-palette-title{margin:2px 7px;font-size:12px;text-align:center;border-bottom:1px solid #eee}.note-popover .popover .popover-content .note-color .dropdown-menu .btn-group .note-color-reset,.note-toolbar .note-color .dropdown-menu .btn-group .note-color-reset{padding:0 3px;margin:3px;font-size:11px;cursor:pointer;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.note-popover .popover .popover-content .note-color .dropdown-menu .btn-group .note-color-row,.note-toolbar .note-color .dropdown-menu .btn-group .note-color-row{height:20px}.note-popover .popover .popover-content .note-color .dropdown-menu .btn-group .note-color-reset:hover,.note-toolbar .note-color .dropdown-menu .btn-group .note-color-reset:hover{background:#eee}.note-popover .popover .popover-content .note-para .dropdown-menu,.note-toolbar .note-para .dropdown-menu{min-width:216px;padding:5px}.note-popover .popover .popover-content .note-para .dropdown-menu>div:first-child,.note-toolbar .note-para .dropdown-menu>div:first-child{margin-right:5px}.note-popover .popover .popover-content .dropdown-menu,.note-toolbar .dropdown-menu{min-width:90px}.note-popover .popover .popover-content .dropdown-menu.right,.note-toolbar .dropdown-menu.right{right:0;left:auto}.note-popover .popover .popover-content .dropdown-menu.right::before,.note-toolbar .dropdown-menu.right::before{right:9px;left:auto!important}.note-popover .popover .popover-content .dropdown-menu.right::after,.note-toolbar .dropdown-menu.right::after{right:10px;left:auto!important}.note-popover .popover .popover-content .dropdown-menu li a i,.note-toolbar .dropdown-menu li a i{color:deepskyblue;visibility:hidden}.note-popover .popover .popover-content .dropdown-menu li a.checked i,.note-toolbar .dropdown-menu li a.checked i{visibility:visible}.note-popover .popover .popover-content .note-fontsize-10,.note-toolbar .note-fontsize-10{font-size:10px}.note-popover .popover .popover-content .note-color-palette,.note-toolbar .note-color-palette{line-height:1}.note-popover .popover .popover-content .note-color-palette div .note-color-btn,.note-toolbar .note-color-palette div .note-color-btn{width:20px;height:20px;padding:0;margin:0;border:1px solid #fff}.note-popover .popover .popover-content .note-color-palette div .note-color-btn:hover,.note-toolbar .note-color-palette div .note-color-btn:hover{border:1px solid #000}.note-dialog>div{display:none}.note-dialog .note-image-dialog .note-dropzone{min-height:100px;margin-bottom:10px;font-size:30px;line-height:4;color:lightgray;text-align:center;border:4px dashed lightgray}.note-dialog .note-help-dialog{font-size:12px;color:#ccc;background:transparent;background-color:#222!important;border:0;-webkit-opacity:.9;-khtml-opacity:.9;-moz-opacity:.9;opacity:.9;-ms-filter:alpha(opacity=90);filter:alpha(opacity=90)}.note-dialog .note-help-dialog .modal-content{background:transparent;border:1px solid white;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.note-dialog .note-help-dialog a{font-size:12px;color:white}.note-dialog .note-help-dialog .title{padding-bottom:5px;font-size:14px;font-weight:bold;color:white;border-bottom:white 1px solid}.note-dialog .note-help-dialog .modal-close{font-size:14px;color:#dd0;cursor:pointer}.note-dialog .note-help-dialog .note-shortcut-layout{width:100%}.note-dialog .note-help-dialog .note-shortcut-layout td{vertical-align:top}.note-dialog .note-help-dialog .note-shortcut{margin-top:8px}.note-dialog .note-help-dialog .note-shortcut th{font-size:13px;color:#dd0;text-align:left}.note-dialog .note-help-dialog .note-shortcut td:first-child{min-width:110px;padding-right:10px;font-family:"Courier New";color:#dd0;text-align:right}.note-handle .note-control-selection{position:absolute;display:none;border:1px solid black}.note-handle .note-control-selection>div{position:absolute}.note-handle .note-control-selection .note-control-selection-bg{width:100%;height:100%;background-color:black;-webkit-opacity:.3;-khtml-opacity:.3;-moz-opacity:.3;opacity:.3;-ms-filter:alpha(opacity=30);filter:alpha(opacity=30)}.note-handle .note-control-selection .note-control-handle{width:7px;height:7px;border:1px solid black}.note-handle .note-control-selection .note-control-holder{width:7px;height:7px;border:1px solid black}.note-handle .note-control-selection .note-control-sizing{width:7px;height:7px;background-color:white;border:1px solid black}.note-handle .note-control-selection .note-control-nw{top:-5px;left:-5px;border-right:0;border-bottom:0}.note-handle .note-control-selection .note-control-ne{top:-5px;right:-5px;border-bottom:0;border-left:none}.note-handle .note-control-selection .note-control-sw{bottom:-5px;left:-5px;border-top:0;border-right:0}.note-handle .note-control-selection .note-control-se{right:-5px;bottom:-5px;cursor:se-resize}.note-handle .note-control-selection .note-control-selection-info{right:0;bottom:0;padding:5px;margin:5px;font-size:12px;color:white;background-color:black;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-opacity:.7;-khtml-opacity:.7;-moz-opacity:.7;opacity:.7;-ms-filter:alpha(opacity=70);filter:alpha(opacity=70)} \ No newline at end of file diff --git a/addons/web_editor/static/src/css/backend.css b/addons/web_editor/static/src/css/backend.css deleted file mode 100644 index 2512b1de9c0..00000000000 --- a/addons/web_editor/static/src/css/backend.css +++ /dev/null @@ -1,79 +0,0 @@ -.oe_form_field_html_text .note-editable { - min-height: 180px; - font: initial !important; - font-family: inherit !important; - line-height: initial !important; - color: initial !important; -} -.oe_form_field_html_text .o_readonly { - min-height: 1em; - width: 100%; - margin: 0; - padding: 0; - border: 0; -} -.oe_form_field_html_text .note-editable p { - font-family: 'Lucida Grande', Helvetica, Verdana, Arial, sans-serif; - -webkit-margin-before: 0; - font-size: 13px; -} - -.oe_form_field_html iframe { - display: block; - width: 100%; - border: 0; - padding: 0; - margin: 0; - min-height: 300px; - min-height: -webkit-calc(100vh - 170px); - min-height: calc(100vh - 170px); -} -.o_form_FieldTextHtml_fullscreen .oe_form_field_html.o_form_fullscreen_ancestor iframe { - position: absolute !important; - left: 0 !important; - right: 0 !important; - top: 0 !important; - bottom: 0 !important; - width: 100% !important; - min-height: 100% !important; - z-index: 1001 !important; - border: 0; -} - -.o_form_FieldTextHtml_fullscreen * { - display: none; -} -.o_form_FieldTextHtml_fullscreen .o_form_fullscreen_ancestor { - display: block !important; - position: static !important; - top: 0 !important; - left: 0 !important; - overflow: visible !important; - width: auto !important; - overflow: hidden !important; -} - -.openerp .oe_form .oe_form_field_html_translate textarea { - min-width: 60px; - width: 100%; - color: #4c4c4c; - font: normal 13px "Lucida Grande", Helvetica, Verdana, Arial, sans-serif; -} -.openerp .oe_form_readonly .oe_form .oe_form_field_html_translate textarea { - border:0; - background: #fff; -} -.openerp .oe_form_editable .oe_form .oe_form_field_html_translate > button { - float: right; - margin: -6px -3px 0 0; -} -.openerp .oe_form_editable .oe_form .oe_form_field_html_translate > .note-editable { - border: 1px solid #ccc; - min-height: 22px; - border-radius: 3px; -} -.openerp .oe_form_editable .oe_form .oe_form_field_html_translate .note-editable [contentEditable='true']:hover { - -moz-box-shadow: #DDCC33 0 0 5px 2px inset; - -webkit-box-shadow: #DDCC33 0 0 5px 2px inset; - box-shadow: #DDCC33 0 0 5px 2px inset; -} \ No newline at end of file diff --git a/addons/web_editor/static/src/css/common.sass b/addons/web_editor/static/src/css/common.sass deleted file mode 100644 index 264f0166c49..00000000000 --- a/addons/web_editor/static/src/css/common.sass +++ /dev/null @@ -1,4 +0,0 @@ -@import "compass/css3" -@import "compass/css3/user-interface" -@import "compass/css3/transition" -@import "compass/support" diff --git a/addons/web_editor/static/src/css/editor.css b/addons/web_editor/static/src/css/editor.css deleted file mode 100644 index ab39d4e1e37..00000000000 --- a/addons/web_editor/static/src/css/editor.css +++ /dev/null @@ -1,1010 +0,0 @@ -/* ---- EDITOR BAR ---- {{{ */ -.note-popover, .o_css_editor, .web_editor-dialog, .note-image-dialog { - /* button */ - /* form */ - /* col */ - /* dropdown */ - /* list-group */ - /* tab */ - /* pager */ - /* add submenu css */ - /* global */ -} -.note-popover *, .o_css_editor *, .web_editor-dialog *, .note-image-dialog * { - box-sizing: border-box; -} -.note-popover a, .o_css_editor a, .web_editor-dialog a, .note-image-dialog a { - text-decoration: none; -} -.note-popover ul, .note-popover ol, .o_css_editor ul, .o_css_editor ol, .web_editor-dialog ul, .web_editor-dialog ol, .note-image-dialog ul, .note-image-dialog ol { - margin-top: 0; - margin-bottom: 10px; -} -.note-popover .clearfix:before, .note-popover .clearfix:after, .note-popover .dl-horizontal dd:before, .note-popover .dl-horizontal dd:after, .note-popover .container:before, .note-popover .container:after, .note-popover .container-fluid:before, .note-popover .container-fluid:after, .note-popover .row:before, .note-popover .row:after, .note-popover .form-horizontal .form-group:before, .note-popover .form-horizontal .form-group:after, .note-popover .btn-toolbar:before, .note-popover .btn-toolbar:after, .note-popover .btn-group-vertical > .btn-group:before, .note-popover .btn-group-vertical > .btn-group:after, .note-popover .nav:before, .note-popover .nav:after, .note-popover .navbar:before, .note-popover .navbar:after, .note-popover .navbar-header:before, .note-popover .navbar-header:after, .note-popover .navbar-collapse:before, .note-popover .navbar-collapse:after, .note-popover .pager:before, .note-popover .pager:after, .note-popover .panel-body:before, .note-popover .panel-body:after, .note-popover .modal-footer:before, .note-popover .modal-footer:after, .o_css_editor .clearfix:before, .o_css_editor .clearfix:after, .o_css_editor .dl-horizontal dd:before, .o_css_editor .dl-horizontal dd:after, .o_css_editor .container:before, .o_css_editor .container:after, .o_css_editor .container-fluid:before, .o_css_editor .container-fluid:after, .o_css_editor .row:before, .o_css_editor .row:after, .o_css_editor .form-horizontal .form-group:before, .o_css_editor .form-horizontal .form-group:after, .o_css_editor .btn-toolbar:before, .o_css_editor .btn-toolbar:after, .o_css_editor .btn-group-vertical > .btn-group:before, .o_css_editor .btn-group-vertical > .btn-group:after, .o_css_editor .nav:before, .o_css_editor .nav:after, .o_css_editor .navbar:before, .o_css_editor .navbar:after, .o_css_editor .navbar-header:before, .o_css_editor .navbar-header:after, .o_css_editor .navbar-collapse:before, .o_css_editor .navbar-collapse:after, .o_css_editor .pager:before, .o_css_editor .pager:after, .o_css_editor .panel-body:before, .o_css_editor .panel-body:after, .o_css_editor .modal-footer:before, .o_css_editor .modal-footer:after, .web_editor-dialog .clearfix:before, .web_editor-dialog .clearfix:after, .web_editor-dialog .dl-horizontal dd:before, .web_editor-dialog .dl-horizontal dd:after, .web_editor-dialog .container:before, .web_editor-dialog .container:after, .web_editor-dialog .container-fluid:before, .web_editor-dialog .container-fluid:after, .web_editor-dialog .row:before, .web_editor-dialog .row:after, .web_editor-dialog .form-horizontal .form-group:before, .web_editor-dialog .form-horizontal .form-group:after, .web_editor-dialog .btn-toolbar:before, .web_editor-dialog .btn-toolbar:after, .web_editor-dialog .btn-group-vertical > .btn-group:before, .web_editor-dialog .btn-group-vertical > .btn-group:after, .web_editor-dialog .nav:before, .web_editor-dialog .nav:after, .web_editor-dialog .navbar:before, .web_editor-dialog .navbar:after, .web_editor-dialog .navbar-header:before, .web_editor-dialog .navbar-header:after, .web_editor-dialog .navbar-collapse:before, .web_editor-dialog .navbar-collapse:after, .web_editor-dialog .pager:before, .web_editor-dialog .pager:after, .web_editor-dialog .panel-body:before, .web_editor-dialog .panel-body:after, .web_editor-dialog .modal-footer:before, .web_editor-dialog .modal-footer:after, .note-image-dialog .clearfix:before, .note-image-dialog .clearfix:after, .note-image-dialog .dl-horizontal dd:before, .note-image-dialog .dl-horizontal dd:after, .note-image-dialog .container:before, .note-image-dialog .container:after, .note-image-dialog .container-fluid:before, .note-image-dialog .container-fluid:after, .note-image-dialog .row:before, .note-image-dialog .row:after, .note-image-dialog .form-horizontal .form-group:before, .note-image-dialog .form-horizontal .form-group:after, .note-image-dialog .btn-toolbar:before, .note-image-dialog .btn-toolbar:after, .note-image-dialog .btn-group-vertical > .btn-group:before, .note-image-dialog .btn-group-vertical > .btn-group:after, .note-image-dialog .nav:before, .note-image-dialog .nav:after, .note-image-dialog .navbar:before, .note-image-dialog .navbar:after, .note-image-dialog .navbar-header:before, .note-image-dialog .navbar-header:after, .note-image-dialog .navbar-collapse:before, .note-image-dialog .navbar-collapse:after, .note-image-dialog .pager:before, .note-image-dialog .pager:after, .note-image-dialog .panel-body:before, .note-image-dialog .panel-body:after, .note-image-dialog .modal-footer:before, .note-image-dialog .modal-footer:after { - content: " "; - display: table; - clear: both; -} -.note-popover .caret, .o_css_editor .caret, .web_editor-dialog .caret, .note-image-dialog .caret { - display: inline-block; - width: 0; - height: 0; - vertical-align: middle; - border-top: 4px solid; - border-right: 4px solid transparent; - border-left: 4px solid transparent; -} -.note-popover .btn.dropdown-toggle, .o_css_editor .btn.dropdown-toggle, .web_editor-dialog .btn.dropdown-toggle, .note-image-dialog .btn.dropdown-toggle { - position: relative; - float: left; -} -.note-popover .btn, .o_css_editor .btn, .web_editor-dialog .btn, .note-image-dialog .btn { - display: inline-block; - margin-bottom: 0; - font-weight: 400; - text-align: center; - vertical-align: middle; - cursor: pointer; - background-image: none; - border: 1px solid transparent; - white-space: nowrap; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - border-radius: 4px; -} -.note-popover .btn .caret, .o_css_editor .btn .caret, .web_editor-dialog .btn .caret, .note-image-dialog .btn .caret { - margin-left: 0; -} -.note-popover .btn.disabled, .note-popover .btn[disabled], .note-popover .btn.disabled:hover, .note-popover .btn[disabled]:active, .o_css_editor .btn.disabled, .o_css_editor .btn[disabled], .o_css_editor .btn.disabled:hover, .o_css_editor .btn[disabled]:active, .web_editor-dialog .btn.disabled, .web_editor-dialog .btn[disabled], .web_editor-dialog .btn.disabled:hover, .web_editor-dialog .btn[disabled]:active, .note-image-dialog .btn.disabled, .note-image-dialog .btn[disabled], .note-image-dialog .btn.disabled:hover, .note-image-dialog .btn[disabled]:active { - cursor: not-allowed; - pointer-events: none; - opacity: 0.65; - filter: alpha(opacity=65); - -webkit-box-shadow: none; - box-shadow: none; -} -.note-popover .btn-sm, .o_css_editor .btn-sm, .web_editor-dialog .btn-sm, .note-image-dialog .btn-sm { - padding: 5px 10px; - font-size: 12px; - line-height: 1.5; - border-radius: 3px; -} -.note-popover .btn-group, .o_css_editor .btn-group, .web_editor-dialog .btn-group, .note-image-dialog .btn-group { - padding-top: 0; - margin-top: 0; - position: relative; - display: inline-block; - vertical-align: middle; -} -.note-popover .btn-group > .btn, .o_css_editor .btn-group > .btn, .web_editor-dialog .btn-group > .btn, .note-image-dialog .btn-group > .btn { - position: relative; - float: left; -} -.note-popover .btn-group > .btn:first-child, .o_css_editor .btn-group > .btn:first-child, .web_editor-dialog .btn-group > .btn:first-child, .note-image-dialog .btn-group > .btn:first-child { - margin-left: 0; -} -.note-popover .btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle), .o_css_editor .btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle), .web_editor-dialog .btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle), .note-image-dialog .btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { - border-top-right-radius: 0; - border-bottom-right-radius: 0; -} -.note-popover .btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle), .o_css_editor .btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle), .web_editor-dialog .btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle), .note-image-dialog .btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { - border-radius: 0; -} -.note-popover .btn-group > .btn:last-child:not(:first-child), .note-popover .btn-group > .btn > .dropdown-toggle:not(:first-child), .o_css_editor .btn-group > .btn:last-child:not(:first-child), .o_css_editor .btn-group > .btn > .dropdown-toggle:not(:first-child), .web_editor-dialog .btn-group > .btn:last-child:not(:first-child), .web_editor-dialog .btn-group > .btn > .dropdown-toggle:not(:first-child), .note-image-dialog .btn-group > .btn:last-child:not(:first-child), .note-image-dialog .btn-group > .btn > .dropdown-toggle:not(:first-child) { - border-bottom-left-radius: 0; - border-top-left-radius: 0; -} -.note-popover .btn-group > .btn + .dropdown-toggle, .o_css_editor .btn-group > .btn + .dropdown-toggle, .web_editor-dialog .btn-group > .btn + .dropdown-toggle, .note-image-dialog .btn-group > .btn + .dropdown-toggle { - padding-left: 8px; - padding-right: 8px; -} -.note-popover .btn-group > .btn.active, .o_css_editor .btn-group > .btn.active, .web_editor-dialog .btn-group > .btn.active, .note-image-dialog .btn-group > .btn.active { - color: #333; - background-color: #e6e6e6; - border-color: #adadad; -} -.note-popover .btn-group .btn + .btn, .note-popover .btn-group .btn + .btn-group, .note-popover .btn-group + .btn, .note-popover .btn-group + .btn-group, .o_css_editor .btn-group .btn + .btn, .o_css_editor .btn-group .btn + .btn-group, .o_css_editor .btn-group + .btn, .o_css_editor .btn-group + .btn-group, .web_editor-dialog .btn-group .btn + .btn, .web_editor-dialog .btn-group .btn + .btn-group, .web_editor-dialog .btn-group + .btn, .web_editor-dialog .btn-group + .btn-group, .note-image-dialog .btn-group .btn + .btn, .note-image-dialog .btn-group .btn + .btn-group, .note-image-dialog .btn-group + .btn, .note-image-dialog .btn-group + .btn-group { - margin-left: -1px; -} -.note-popover .btn-link, .o_css_editor .btn-link, .web_editor-dialog .btn-link, .note-image-dialog .btn-link { - border-color: transparent; - color: #428bca; -} -.note-popover .btn-link:hover, .note-popover .btn-link:focus, .o_css_editor .btn-link:hover, .o_css_editor .btn-link:focus, .web_editor-dialog .btn-link:hover, .web_editor-dialog .btn-link:focus, .note-image-dialog .btn-link:hover, .note-image-dialog .btn-link:focus { - color: #2a6496; - text-decoration: underline; - background-color: transparent; -} -.note-popover .form-group, .o_css_editor .form-group, .web_editor-dialog .form-group, .note-image-dialog .form-group { - margin-bottom: 15px; -} -.note-popover .form-control, .o_css_editor .form-control, .web_editor-dialog .form-control, .note-image-dialog .form-control { - display: block; - width: 100%; - height: 34px; - padding: 6px 12px; - font-size: 14px; - line-height: 1.42857; - color: #555; - background-color: #fff; - background-image: none; - border: 1px solid #ccc; - border-radius: 4px; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); -} -.note-popover .form-horizontal .form-group, .o_css_editor .form-horizontal .form-group, .web_editor-dialog .form-horizontal .form-group, .note-image-dialog .form-horizontal .form-group { - margin-left: -15px; - margin-right: -15px; -} -.note-popover .form-group, .o_css_editor .form-group, .web_editor-dialog .form-group, .note-image-dialog .form-group { - margin-bottom: 15px; -} -.note-popover .form-control.select2-container, .o_css_editor .form-control.select2-container, .web_editor-dialog .form-control.select2-container, .note-image-dialog .form-control.select2-container { - height: auto !important; - padding: 0; -} -.note-popover label, .o_css_editor label, .web_editor-dialog label, .note-image-dialog label { - display: inline-block; - max-width: 100%; - margin-bottom: 5px; - font-weight: 700; -} -.note-popover .col-sm-1, .note-popover .col-sm-2, .note-popover .col-sm-3, .note-popover .col-sm-4, .note-popover .col-sm-5, .note-popover .col-sm-6, .note-popover .col-sm-7, .note-popover .col-sm-8, .note-popover .col-sm-9, .note-popover .col-sm-10, .note-popover .col-sm-11, .note-popover .col-sm-12, .note-popover .col-lg-12, .o_css_editor .col-sm-1, .o_css_editor .col-sm-2, .o_css_editor .col-sm-3, .o_css_editor .col-sm-4, .o_css_editor .col-sm-5, .o_css_editor .col-sm-6, .o_css_editor .col-sm-7, .o_css_editor .col-sm-8, .o_css_editor .col-sm-9, .o_css_editor .col-sm-10, .o_css_editor .col-sm-11, .o_css_editor .col-sm-12, .o_css_editor .col-lg-12, .web_editor-dialog .col-sm-1, .web_editor-dialog .col-sm-2, .web_editor-dialog .col-sm-3, .web_editor-dialog .col-sm-4, .web_editor-dialog .col-sm-5, .web_editor-dialog .col-sm-6, .web_editor-dialog .col-sm-7, .web_editor-dialog .col-sm-8, .web_editor-dialog .col-sm-9, .web_editor-dialog .col-sm-10, .web_editor-dialog .col-sm-11, .web_editor-dialog .col-sm-12, .web_editor-dialog .col-lg-12, .note-image-dialog .col-sm-1, .note-image-dialog .col-sm-2, .note-image-dialog .col-sm-3, .note-image-dialog .col-sm-4, .note-image-dialog .col-sm-5, .note-image-dialog .col-sm-6, .note-image-dialog .col-sm-7, .note-image-dialog .col-sm-8, .note-image-dialog .col-sm-9, .note-image-dialog .col-sm-10, .note-image-dialog .col-sm-11, .note-image-dialog .col-sm-12, .note-image-dialog .col-lg-12 { - position: relative; - min-height: 1px; - padding-left: 15px; - padding-right: 15px; - width: 100%; -} -.note-popover .dropdown, .o_css_editor .dropdown, .web_editor-dialog .dropdown, .note-image-dialog .dropdown { - position: relative; -} -.note-popover .dropdown > .btn, .note-popover .btn-group > .btn, .o_css_editor .dropdown > .btn, .o_css_editor .btn-group > .btn, .web_editor-dialog .dropdown > .btn, .web_editor-dialog .btn-group > .btn, .note-image-dialog .dropdown > .btn, .note-image-dialog .btn-group > .btn { - color: #333; - background-color: #fff; - border-color: #ccc; - text-decoration: none; -} -.note-popover .dropdown > .btn-primary, .note-popover .btn-group > .btn-primary, .o_css_editor .dropdown > .btn-primary, .o_css_editor .btn-group > .btn-primary, .web_editor-dialog .dropdown > .btn-primary, .web_editor-dialog .btn-group > .btn-primary, .note-image-dialog .dropdown > .btn-primary, .note-image-dialog .btn-group > .btn-primary { - color: #fff; - background-color: #428bca; - border-color: #357ebd; -} -.note-popover .dropdown-menu, .o_css_editor .dropdown-menu, .web_editor-dialog .dropdown-menu, .note-image-dialog .dropdown-menu { - position: absolute; - top: 100%; - left: 0; - z-index: 1000; - display: none; - float: left; - min-width: 160px; - padding: 5px 0; - margin: 2px 0 0; - list-style: none; - font-size: 14px; - text-align: left; - background-color: #fff; - border: 1px solid #ccc; - border: 1px solid rgba(0, 0, 0, 0.15); - border-radius: 4px; - -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); - box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); - background-clip: padding-box; -} -.note-popover .dropdown-menu > li > a, .o_css_editor .dropdown-menu > li > a, .web_editor-dialog .dropdown-menu > li > a, .note-image-dialog .dropdown-menu > li > a { - display: block !important; - padding: 3px 20px; - clear: both; - font-weight: normal; - color: #666; - white-space: nowrap; - background: transparent; -} -.note-popover .dropdown-menu > li.active > a, .o_css_editor .dropdown-menu > li.active > a, .web_editor-dialog .dropdown-menu > li.active > a, .note-image-dialog .dropdown-menu > li.active > a { - color: #fff; - text-decoration: none; - background-color: #428bca; - outline: 0; -} -.note-popover .open > .dropdown-menu, .o_css_editor .open > .dropdown-menu, .web_editor-dialog .open > .dropdown-menu, .note-image-dialog .open > .dropdown-menu { - display: block; -} -.note-popover .list-group, .o_css_editor .list-group, .web_editor-dialog .list-group, .note-image-dialog .list-group { - margin-bottom: 20px; - padding-left: 0; -} -.note-popover .list-group-item, .o_css_editor .list-group-item, .web_editor-dialog .list-group-item, .note-image-dialog .list-group-item { - position: relative; - display: block; - padding: 10px 15px; - margin-bottom: -1px; - background-color: #fff; - border: 1px solid #ddd; -} -.note-popover .list-group-item:first-child, .o_css_editor .list-group-item:first-child, .web_editor-dialog .list-group-item:first-child, .note-image-dialog .list-group-item:first-child { - border-top-right-radius: 4px; - border-top-left-radius: 4px; -} -.note-popover .list-group-item:last-child, .o_css_editor .list-group-item:last-child, .web_editor-dialog .list-group-item:last-child, .note-image-dialog .list-group-item:last-child { - margin-bottom: 0; - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; -} -.note-popover .list-group-item-heading, .o_css_editor .list-group-item-heading, .web_editor-dialog .list-group-item-heading, .note-image-dialog .list-group-item-heading { - margin-top: 0; - margin-bottom: 5px; -} -.note-popover .list-group-item.active, .o_css_editor .list-group-item.active, .web_editor-dialog .list-group-item.active, .note-image-dialog .list-group-item.active { - z-index: 2; - color: #fff; - background-color: #428bca; - border-color: #428bca; -} -.note-popover .tab-content > .tab-pane, .o_css_editor .tab-content > .tab-pane, .web_editor-dialog .tab-content > .tab-pane, .note-image-dialog .tab-content > .tab-pane { - display: none; -} -.note-popover .tab-content > .active, .o_css_editor .tab-content > .active, .web_editor-dialog .tab-content > .active, .note-image-dialog .tab-content > .active { - display: block; -} -.note-popover .nav, .o_css_editor .nav, .web_editor-dialog .nav, .note-image-dialog .nav { - margin-bottom: 0; - padding-left: 0; - list-style: none; -} -.note-popover .nav > li, .o_css_editor .nav > li, .web_editor-dialog .nav > li, .note-image-dialog .nav > li { - position: relative; - display: block; -} -.note-popover .nav > li > a, .o_css_editor .nav > li > a, .web_editor-dialog .nav > li > a, .note-image-dialog .nav > li > a { - position: relative; - display: block; - padding: 10px 15px; -} -.note-popover .nav-tabs, .o_css_editor .nav-tabs, .web_editor-dialog .nav-tabs, .note-image-dialog .nav-tabs { - border-bottom: 1px solid #ddd; -} -.note-popover .nav-tabs > li, .o_css_editor .nav-tabs > li, .web_editor-dialog .nav-tabs > li, .note-image-dialog .nav-tabs > li { - float: left; - margin-bottom: -1px; -} -.note-popover .nav-tabs > li > a, .o_css_editor .nav-tabs > li > a, .web_editor-dialog .nav-tabs > li > a, .note-image-dialog .nav-tabs > li > a { - margin-right: 2px; - line-height: 1.42857; - border: 1px solid transparent; - border-radius: 4px 4px 0 0; -} -.note-popover .nav-tabs > li.active > a, .note-popover .nav-tabs > li.active > a:hover, .note-popover .nav-tabs > li.active > a:focus, .o_css_editor .nav-tabs > li.active > a, .o_css_editor .nav-tabs > li.active > a:hover, .o_css_editor .nav-tabs > li.active > a:focus, .web_editor-dialog .nav-tabs > li.active > a, .web_editor-dialog .nav-tabs > li.active > a:hover, .web_editor-dialog .nav-tabs > li.active > a:focus, .note-image-dialog .nav-tabs > li.active > a, .note-image-dialog .nav-tabs > li.active > a:hover, .note-image-dialog .nav-tabs > li.active > a:focus { - color: #8c8c8c; - background-color: #fff; - border: 1px solid #ddd; - border-bottom-color: transparent; - cursor: default; -} -.note-popover .pager, .o_css_editor .pager, .web_editor-dialog .pager, .note-image-dialog .pager { - padding-left: 0; - margin: 20px 0; - list-style: none; - text-align: center; -} -.note-popover .pager li, .o_css_editor .pager li, .web_editor-dialog .pager li, .note-image-dialog .pager li { - display: inline; -} -.note-popover .pager li > a, .note-popover .pager li > span, .o_css_editor .pager li > a, .o_css_editor .pager li > span, .web_editor-dialog .pager li > a, .web_editor-dialog .pager li > span, .note-image-dialog .pager li > a, .note-image-dialog .pager li > span { - display: inline-block; - padding: 5px 14px; - background-color: #fff; - border: 1px solid #ddd; - border-radius: 15px; -} -.note-popover .pager .previous > a, .note-popover .pager .previous > span, .o_css_editor .pager .previous > a, .o_css_editor .pager .previous > span, .web_editor-dialog .pager .previous > a, .web_editor-dialog .pager .previous > span, .note-image-dialog .pager .previous > a, .note-image-dialog .pager .previous > span { - float: left; -} -.note-popover .pager .disabled > a, .note-popover .pager .disabled > a:hover, .note-popover .pager .disabled > a:focus, .note-popover .pager .disabled > span, .o_css_editor .pager .disabled > a, .o_css_editor .pager .disabled > a:hover, .o_css_editor .pager .disabled > a:focus, .o_css_editor .pager .disabled > span, .web_editor-dialog .pager .disabled > a, .web_editor-dialog .pager .disabled > a:hover, .web_editor-dialog .pager .disabled > a:focus, .web_editor-dialog .pager .disabled > span, .note-image-dialog .pager .disabled > a, .note-image-dialog .pager .disabled > a:hover, .note-image-dialog .pager .disabled > a:focus, .note-image-dialog .pager .disabled > span { - color: #b3b3b3; - background-color: #fff; - cursor: not-allowed; -} -.note-popover .dropdown-submenu, .o_css_editor .dropdown-submenu, .web_editor-dialog .dropdown-submenu, .note-image-dialog .dropdown-submenu { - position: relative; - z-index: 1000; -} -.note-popover .dropdown-submenu > .dropdown-menu, .o_css_editor .dropdown-submenu > .dropdown-menu, .web_editor-dialog .dropdown-submenu > .dropdown-menu, .note-image-dialog .dropdown-submenu > .dropdown-menu { - top: 0; - left: 100%; - margin-top: -6px; - margin-left: -1px; - -webkit-border-radius: 0 6px 6px 6px; - -moz-border-radius: 0 6px 6px 6px; - border-radius: 0 6px 6px 6px; -} -.note-popover .dropdown-submenu:hover > .dropdown-menu, .o_css_editor .dropdown-submenu:hover > .dropdown-menu, .web_editor-dialog .dropdown-submenu:hover > .dropdown-menu, .note-image-dialog .dropdown-submenu:hover > .dropdown-menu { - display: block; -} -.note-popover .dropdown-submenu:hover > a:after, .o_css_editor .dropdown-submenu:hover > a:after, .web_editor-dialog .dropdown-submenu:hover > a:after, .note-image-dialog .dropdown-submenu:hover > a:after { - border-left-color: #ffffff; -} -.note-popover .dropdown-submenu > a:after, .o_css_editor .dropdown-submenu > a:after, .web_editor-dialog .dropdown-submenu > a:after, .note-image-dialog .dropdown-submenu > a:after { - display: block; - content: " "; - float: right; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; - border-width: 5px 0 5px 5px; - border-left-color: #cccccc; - margin-top: 5px; - margin-right: -10px; -} -.note-popover .dropdown-submenu.pull-left, .o_css_editor .dropdown-submenu.pull-left, .web_editor-dialog .dropdown-submenu.pull-left, .note-image-dialog .dropdown-submenu.pull-left { - float: none; -} -.note-popover .dropdown-submenu.pull-left > .dropdown-menu, .o_css_editor .dropdown-submenu.pull-left > .dropdown-menu, .web_editor-dialog .dropdown-submenu.pull-left > .dropdown-menu, .note-image-dialog .dropdown-submenu.pull-left > .dropdown-menu { - left: -100%; - margin-left: 10px; - -webkit-border-radius: 6px 0 6px 6px; - -moz-border-radius: 6px 0 6px 6px; - border-radius: 6px 0 6px 6px; -} -.note-popover .hidden, .o_css_editor .hidden, .web_editor-dialog .hidden, .note-image-dialog .hidden { - display: none !important; -} -.note-popover .img-responsive, .o_css_editor .img-responsive, .web_editor-dialog .img-responsive, .note-image-dialog .img-responsive { - display: block; - width: 100% \9; - max-width: 100%; - height: auto; -} -.note-popover .well, .o_css_editor .well, .web_editor-dialog .well, .note-image-dialog .well { - min-height: 20px; - padding: 19px; - margin-bottom: 20px; - background-color: #f5f5f5; - border: 1px solid #e3e3e3; - border-radius: 4px; - -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); -} -.note-popover .sr-only, .o_css_editor .sr-only, .web_editor-dialog .sr-only, .note-image-dialog .sr-only { - position: absolute; - width: 1px; - height: 1px; - margin: -1px; - padding: 0; - overflow: hidden; - clip: rect(0, 0, 0, 0); - border: 0; -} -.note-popover .text-center, .o_css_editor .text-center, .web_editor-dialog .text-center, .note-image-dialog .text-center { - text-align: center; -} -.note-popover .text-muted, .o_css_editor .text-muted, .web_editor-dialog .text-muted, .note-image-dialog .text-muted { - color: #b3b3b3; -} - -.note-popover .btn { - height: 30px; -} - -.note-popover, .o_css_editor { - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 14px; - line-height: 1.42857; - color: #666; -} -.note-popover button, .o_css_editor button { - margin: 0; -} -.note-popover a, .o_css_editor a { - color: #428bca; -} -.note-popover a:hover, .note-popover a:focus, .o_css_editor a:hover, .o_css_editor a:focus { - color: #2a6496; - text-decoration: underline; -} -.note-popover .popover, .o_css_editor .popover { - position: fixed !important; - top: 1px !important; - right: auto !important; - left: 300px !important; - margin-top: 0 !important; - border: 0; - background: transparent; - box-shadow: none; - -webkit-box-shadow: none; - z-index: 1040; - padding: 1px; - text-align: left; - white-space: normal; - border-radius: 6px; - max-width: none; -} -.note-popover .popover .popover-content, .o_css_editor .popover .popover-content { - padding: 0; - margin: 0 0 0 6px; -} -.note-popover .popover .popover-content .note-para .dropdown-menu, .o_css_editor .popover .popover-content .note-para .dropdown-menu { - min-width: 148px !important; - padding: 5px 0 5px 5px !important; -} -.note-popover .popover .popover-content .note-ul .dropdown-menu, .o_css_editor .popover .popover-content .note-ul .dropdown-menu { - min-width: 150px !important; - padding: 5px 0 5px 5px !important; -} -.note-popover .popover .popover-content .note-ul .dropdown-menu .note-li, .o_css_editor .popover .popover-content .note-ul .dropdown-menu .note-li { - margin-right: 5px; -} -.note-popover .popover .popover-content .colorpicker, .o_css_editor .popover .popover-content .colorpicker { - margin: 0; -} -.note-popover .popover .popover-content .colorpicker td > *, .o_css_editor .popover .popover-content .colorpicker td > * { - width: 20px; - height: 20px; - padding: 0; - margin: 0; - border: 1px solid #fff; -} -.note-popover .popover .popover-content .btn-group, .o_css_editor .popover .popover-content .btn-group { - margin: 0 5px 0 0; -} -.note-popover .popover .popover-content > a, .o_css_editor .popover .popover-content > a { - border-radius: 3px; - background-color: #fff; - border-color: #ccc; - padding: 4px 10px; - font-size: 14px; - line-height: 1.5; -} -.note-popover .popover .popover-content > span, .o_css_editor .popover .popover-content > span { - display: inline-block; - max-width: 200px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - vertical-align: middle; - border-radius: 3px; - background-color: white; - border-color: #cccccc; - padding: 4px 10px; - font-size: 14px; - line-height: 1.5; -} -.note-popover .arrow, .o_css_editor .arrow { - display: none; -} - -.note-popover .btn-default, .o_css_editor .btn-default, .web_editor-dialog .modal-footer .btn-default { - color: #333; - background-color: #fff; - border-color: #ccc; -} -.note-popover .btn-primary, .o_css_editor .btn-primary, .web_editor-dialog .modal-footer .btn-primary { - color: #fff; - background-color: #428bca; - border-color: #357ebd; -} - -.web_editor-dialog, .note-image-dialog { - color: #666; - display: none; - overflow: hidden; - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 1050; - -webkit-overflow-scrolling: touch; - outline: 0; -} -.web_editor-dialog .btn, .note-image-dialog .btn { - border-color: #ccc; -} -.web_editor-dialog .btn-link, .note-image-dialog .btn-link { - border-color: transparent; -} -.web_editor-dialog .btn-primary, .note-image-dialog .btn-primary { - color: #fff; - background-color: #428bca; - border-color: #357ebd; -} -.web_editor-dialog .btn-danger, .note-image-dialog .btn-danger { - color: #fff; - background-color: #d9534f; - border-color: #d43f3a; -} -.web_editor-dialog .modal-header a, .web_editor-dialog .modal-footer a, .note-image-dialog .modal-header a, .note-image-dialog .modal-footer a { - color: #428bca; -} -.web_editor-dialog .modal-header a:hover, .web_editor-dialog .modal-header a:focus, .web_editor-dialog .modal-footer a:hover, .web_editor-dialog .modal-footer a:focus, .note-image-dialog .modal-header a:hover, .note-image-dialog .modal-header a:focus, .note-image-dialog .modal-footer a:hover, .note-image-dialog .modal-footer a:focus { - color: #2a6496; - text-decoration: underline; -} -.web_editor-dialog .modal-header .btn, .web_editor-dialog .modal-footer .btn, .note-image-dialog .modal-header .btn, .note-image-dialog .modal-footer .btn { - border-color: #ccc; - padding: 6px 12px; - font-size: 14px; - line-height: 1.42857; - border-radius: 4px; -} -.web_editor-dialog .link-style .dropdown > .btn, .note-image-dialog .link-style .dropdown > .btn { - min-width: 160px; -} -.web_editor-dialog .link-style li, .note-image-dialog .link-style li { - text-align: center; -} -.web_editor-dialog .link-style li label, .note-image-dialog .link-style li label { - width: 100px; - margin: 0 5px; -} -.web_editor-dialog .link-style li label input.link-style, .note-image-dialog .link-style li label input.link-style { - display: none; -} -.web_editor-dialog .modal-title, .note-image-dialog .modal-title { - margin: 0; - line-height: 1.42857; -} -.web_editor-dialog .modal-dialog, .note-image-dialog .modal-dialog { - position: relative; - width: auto; - margin: 10px; -} -.web_editor-dialog .modal-content, .note-image-dialog .modal-content { - position: relative; - background-color: #fff; - border: 1px solid #999; - border: 1px solid rgba(0, 0, 0, 0.2); - border-radius: 6px; - -webkit-box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); - box-shadow: 0 3px 9px rgba(0, 0, 0, 0.5); - background-clip: padding-box; - outline: 0; -} -.web_editor-dialog .modal-header, .note-image-dialog .modal-header { - padding: 15px; - border-bottom: 1px solid #e5e5e5; - min-height: 16.43px; -} -.web_editor-dialog .modal-header .close, .note-image-dialog .modal-header .close { - margin-top: -2px; -} -.web_editor-dialog .modal-body, .note-image-dialog .modal-body { - position: relative; - padding: 15px; -} -.web_editor-dialog .modal-footer, .note-image-dialog .modal-footer { - text-align: left; - padding: 15px; - border-top: 1px solid #e5e5e5; -} -.web_editor-dialog .close, .note-image-dialog .close { - float: right; - font-size: 21px; - font-weight: 700; - line-height: 1; - color: #000; - text-shadow: 0 1px 0 #fff; - opacity: 0.2; - filter: alpha(opacity=20); -} -.web_editor-dialog button.close, .note-image-dialog button.close { - padding: 0; - cursor: pointer; - background: 0 0; - border: 0; - -webkit-appearance: none; -} - -.note-image-dialog .btn { - height: 34px; - font-size: 14px; -} - -@media (min-width: 768px) { - .web_editor-dialog .modal-dialog, .note-image-dialog .modal-dialog { - width: 600px; - margin: 30px auto; - } - .web_editor-dialog .modal-content, .note-image-dialog .modal-content { - -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); - box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5); - } - - .note-popover .col-sm-1, .note-popover .col-sm-2, .note-popover .col-sm-3, .note-popover .col-sm-4, .note-popover .col-sm-5, .note-popover .col-sm-6, .note-popover .col-sm-7, .note-popover .col-sm-8, .note-popover .col-sm-9, .note-popover .col-sm-10, .note-popover .col-sm-11, .note-popover .col-sm-12, .o_css_editor .col-sm-1, .o_css_editor .col-sm-2, .o_css_editor .col-sm-3, .o_css_editor .col-sm-4, .o_css_editor .col-sm-5, .o_css_editor .col-sm-6, .o_css_editor .col-sm-7, .o_css_editor .col-sm-8, .o_css_editor .col-sm-9, .o_css_editor .col-sm-10, .o_css_editor .col-sm-11, .o_css_editor .col-sm-12, .web_editor-dialog .col-sm-1, .web_editor-dialog .col-sm-2, .web_editor-dialog .col-sm-3, .web_editor-dialog .col-sm-4, .web_editor-dialog .col-sm-5, .web_editor-dialog .col-sm-6, .web_editor-dialog .col-sm-7, .web_editor-dialog .col-sm-8, .web_editor-dialog .col-sm-9, .web_editor-dialog .col-sm-10, .web_editor-dialog .col-sm-11, .web_editor-dialog .col-sm-12, .note-image-dialog .col-sm-1, .note-image-dialog .col-sm-2, .note-image-dialog .col-sm-3, .note-image-dialog .col-sm-4, .note-image-dialog .col-sm-5, .note-image-dialog .col-sm-6, .note-image-dialog .col-sm-7, .note-image-dialog .col-sm-8, .note-image-dialog .col-sm-9, .note-image-dialog .col-sm-10, .note-image-dialog .col-sm-11, .note-image-dialog .col-sm-12 { - float: left; - } - .note-popover .col-sm-12, .o_css_editor .col-sm-12, .web_editor-dialog .col-sm-12, .note-image-dialog .col-sm-12 { - width: 100%; - } - .note-popover .col-sm-11, .o_css_editor .col-sm-11, .web_editor-dialog .col-sm-11, .note-image-dialog .col-sm-11 { - width: 91.66667%; - } - .note-popover .col-sm-10, .o_css_editor .col-sm-10, .web_editor-dialog .col-sm-10, .note-image-dialog .col-sm-10 { - width: 83.33333%; - } - .note-popover .col-sm-9, .o_css_editor .col-sm-9, .web_editor-dialog .col-sm-9, .note-image-dialog .col-sm-9 { - width: 75%; - } - .note-popover .col-sm-8, .o_css_editor .col-sm-8, .web_editor-dialog .col-sm-8, .note-image-dialog .col-sm-8 { - width: 66.66667%; - } - .note-popover .col-sm-7, .o_css_editor .col-sm-7, .web_editor-dialog .col-sm-7, .note-image-dialog .col-sm-7 { - width: 58.33333%; - } - .note-popover .col-sm-6, .o_css_editor .col-sm-6, .web_editor-dialog .col-sm-6, .note-image-dialog .col-sm-6 { - width: 50%; - } - .note-popover .col-sm-5, .o_css_editor .col-sm-5, .web_editor-dialog .col-sm-5, .note-image-dialog .col-sm-5 { - width: 41.66667%; - } - .note-popover .col-sm-4, .o_css_editor .col-sm-4, .web_editor-dialog .col-sm-4, .note-image-dialog .col-sm-4 { - width: 33.33333%; - } - .note-popover .col-sm-3, .o_css_editor .col-sm-3, .web_editor-dialog .col-sm-3, .note-image-dialog .col-sm-3 { - width: 25%; - } - .note-popover .col-sm-2, .o_css_editor .col-sm-2, .web_editor-dialog .col-sm-2, .note-image-dialog .col-sm-2 { - width: 16.66667%; - } - .note-popover .col-sm-1, .o_css_editor .col-sm-1, .web_editor-dialog .col-sm-1, .note-image-dialog .col-sm-1 { - width: 8.33333%; - } - .note-popover .form-horizontal .control-label, .o_css_editor .form-horizontal .control-label, .web_editor-dialog .form-horizontal .control-label, .note-image-dialog .form-horizontal .control-label { - text-align: right; - margin-bottom: 0; - padding-top: 7px; - } - .note-popover .form-inline .form-group, .o_css_editor .form-inline .form-group, .web_editor-dialog .form-inline .form-group, .note-image-dialog .form-inline .form-group { - display: inline-block; - margin-bottom: 0; - vertical-align: middle; - } -} -.modal-open .web_editor-dialog, .modal-open .note-image-dialog { - overflow-x: hidden; - overflow-y: auto; -} - -.editor_enable .modal-backdrop { - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 1040; - background-color: #000; -} -.editor_enable .modal-backdrop.in { - opacity: 0.5; - filter: alpha(opacity=50); -} - -.note-image-dialog .select-media { - width: 80%; -} -.note-image-dialog .existing-attachments .pager { - margin: 0; -} -.note-image-dialog .existing-attachments .pager .disabled { - display: none; -} -.note-image-dialog .existing-attachments .existing-attachment-cell { - position: relative; -} -.note-image-dialog .existing-attachments .existing-attachment-cell .o_attachment_border { - border: 1px solid #848490; - text-align: center; -} -.note-image-dialog .existing-attachments .existing-attachment-cell .o_image { - max-width: 100%; - padding-top: 80%; - max-height: 100%; - display: inline-block; -} -.note-image-dialog .existing-attachments .existing-attachment-cell .o_image img { - width: 100%; -} -.note-image-dialog .existing-attachments .existing-attachment-cell .o_webimage { - background-image: none; - padding-top: 0; - width: 100%; - height: initial; - vertical-align: middle; -} -.note-image-dialog .existing-attachments .existing-attachment-cell .existing-attachment-remove { - position: absolute; - top: 0; - left: 15px; - z-index: 1; - cursor: pointer; - background: white; - padding: 2px; - border: 1px solid #848490; - border-top: none; - border-left: none; - -moz-border-radius-bottomright: 8px; - -webkit-border-bottom-right-radius: 8px; - border-bottom-right-radius: 8px; -} -.note-image-dialog .existing-attachments .existing-attachment-cell.media_selected > * { - border-width: 5px; - border-color: #00f8f8; -} -.note-image-dialog .image-preview { - margin-bottom: 0.5em; -} -.note-image-dialog .font-icons-icons { - font-size: 2em; - max-height: 9em; - overflow: auto; -} -.note-image-dialog .font-icons-icons .font-icons-icon { - display: inline-block; - width: 2em; - padding: 0.25em; - text-align: center; - cursor: pointer; -} -.note-image-dialog .font-icons { - position: relative; - display: block; -} -.note-image-dialog .font-icons:before { - filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70); - opacity: 0.7; - position: absolute; - top: 2px; - left: 3px; - font-size: 2em; -} -.note-image-dialog #icon-search { - padding-left: 2.5em; -} -.note-image-dialog .font-icons-selected { - background-color: #ddd; -} -.note-image-dialog.nosave .wait { - display: inline-block !important; - visibility: visible !important; -} -.note-image-dialog.nosave .modal-body .filepicker, .note-image-dialog.nosave .modal-body .image-preview { - display: none; -} -.note-image-dialog.nosave .modal-body .wait { - width: 100%; -} -.note-image-dialog.nosave .modal-footer .save { - display: none; -} -.note-image-dialog .preview-container { - text-align: center; - line-height: 100px; - height: 100px; -} -.note-image-dialog .preview-container > * { - max-height: 100px; - line-height: 100px; - margin: 0 auto; - display: inline-block; -} - -/* }}} */ -/* ---- COLOR-PICKER ---- {{{ */ -.colorpicker { - margin: 0 auto; - background: transparent; - border: 0; -} -.colorpicker td { - padding: 0; - background: transparent; -} -.colorpicker td > * { - width: 16px; - height: 16px; - border-radius: 2px; - margin: 3px; - padding: 0; - border-width: 1px; - display: block; -} -.colorpicker .only-text { - display: none; -} -.colorpicker .automatic-color { - background: #fff; - border-left: 7px solid #f33; - border-top: 7px solid #0e0; - border-right: 8px solid #33f; - border-bottom: 8px solid #fe0; - margin: 4px 3px 3px 3px; - width: 0; - height: 0; -} - -/* }}} */ -/* ---- TRANSLATIONS ---- {{{ */ -.oe_translate_examples li { - margin: 10px; - padding: 4px; -} - -html[lang] > body.editor_enable [data-oe-translation-state] { - background: rgba(255, 255, 90, 0.5) !important; -} -html[lang] > body.editor_enable [data-oe-translation-state]:hover { - background: inherit !important; - cursor: text; -} -html[lang] > body.editor_enable [data-oe-translation-state="translated"] { - background: rgba(120, 215, 110, 0.5) !important; -} - -html[data-translatable] .oe_field_translate { - display: block; -} - -html[data-translatable] .oe_field_translate { - display: none; -} - -/* }}} */ -/* ---- editable ---- {{{ */ -.o_editable:not(:empty):not([data-oe-model="ir.ui.view"]):not([data-oe-type="html"]):hover, .o_editable[data-oe-type]:not([data-oe-model="ir.ui.view"]):not([data-oe-type="html"]):hover { - /* to do change into primary color in less */ - -moz-box-shadow: #3071a9 0 0 5px 2px inset; - -webkit-box-shadow: #3071a9 0 0 5px 2px inset; - box-shadow: #3071a9 0 0 5px 2px inset; -} -.o_editable:focus, .o_editable[data-oe-type] { - min-height: 0.8em; - min-width: 8px; -} -.o_editable.o_is_inline_editable { - display: inline-block; -} -.o_editable:focus { - outline: none !important; -} - -/* Prevent the text contents of draggable elements from being selectable. */ -[draggable] { - -moz-user-select: none; - -khtml-user-select: none; - -webkit-user-select: none; - user-select: none; -} - -.o_editable .btn, .btn.o_editable { - -webkit-user-select: auto; - -moz-user-select: auto; - -ms-user-select: auto; - user-select: auto; - cursor: text !important; -} - -.o_editable .fa { - cursor: pointer; -} - -.css_editable_display { - display: block !important; -} - -.css_editable_hidden { - display: none !important; -} - -.editor_enable [data-oe-readonly]:hover { - cursor: default; -} -.editor_enable .css_editable_mode_hidden { - display: none; -} -.editor_enable .css_non_editable_mode_hidden { - display: block !important; -} -.editor_enable .media_iframe_video .css_editable_mode_display { - display: block !important; -} - -.editor_enable [placeholder]:empty:after { - content: "  " attr(placeholder); - opacity: 0.5; -} -.editor_enable [placeholder]:empty:active:after, [placeholder]:empty:focus:after { - content: none; -} -.editor_enable input[placeholder]:empty:after, .editor_enable textarea[placeholder]:empty:after, .editor_enable select[placeholder]:empty:after { - content: none; -} -.oe_empty[placeholder]:empty { - min-height: 220px !important; - background-repeat: no-repeat; - background-position: center; -} -.oe_empty[placeholder]:empty:not(.o_editable) { - background-image: url("/web_editor/static/src/img/edit_here.png") !important; -} -.oe_empty[placeholder]:empty:after, .oe_empty[placeholder]:empty:before { - opacity: 0.4; - overflow: hidden; - z-index: -1; - min-height: 1em; -} -.oe_empty[placeholder]:empty:after { - text-align: center; - padding-top: 160px; - display: block; - font-size: 24px; -} -.oe_empty[placeholder]:empty.o_no_placeholder_image { - background-image: none; - text-align: left; - padding-top: 0; -} -.oe_empty[placeholder]:empty[data-oe-type=html]:after { - font-size: 16px; -} - -.editor_has_snippets .oe_empty[placeholder]:empty { - background-image: url("/web_editor/static/src/img/drag_here.png") !important; -} - -#web_editor-top-edit { - width: 100%; - min-height: 34px; - height: 34px; - background-color: #222; - border-color: #080808; - border-width: 0 0 1px; - position: fixed; - border-radius: 0; - top: 0; - right: 0; - left: 0; - z-index: 1030; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); -} -#web_editor-top-edit .btn-link { - color: #b3b3b3; -} -#web_editor-top-edit > ul > li { - margin: 0; -} -#web_editor-top-edit form { - padding: 0 10px 0 15px; - border-top: 1px solid transparent; - border-bottom: 1px solid transparent; - margin: 0; -} -#web_editor-top-edit form button, #web_editor-top-edit form a { - padding: 4px 8px 4px 8px; - margin-top: 2px; - font-size: 13px; -} - -#editable_area { - margin-top: 34px; -} - -/* }}} */ -/* ---- HACK FOR COVERING UP EDITOR BOGUS P INSERTION --- {{{ */ -.oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child { - position: static; -} - -.css_editable_display { - display: none; -} - -.oe_carlos_danger { - outline: 1px solid red !important; - background-color: #ffd9dd !important; -} - -/* }}} */ diff --git a/addons/web_editor/static/src/css/editor.sass b/addons/web_editor/static/src/css/editor.sass deleted file mode 100644 index bf929e89002..00000000000 --- a/addons/web_editor/static/src/css/editor.sass +++ /dev/null @@ -1,876 +0,0 @@ -@import "compass/css3" -@import "compass/css3/user-interface" -@import "compass/css3/transition" -@import "compass/support" - - -/* ---- EDITOR BAR ---- {{{ */ - -.note-popover, .o_css_editor, .web_editor-dialog, .note-image-dialog - * - box-sizing: border-box - a - text-decoration: none - ul, ol - margin-top: 0 - margin-bottom: 10px - - .clearfix:before, .clearfix:after, .dl-horizontal dd:before, .dl-horizontal dd:after, .container:before, .container:after, .container-fluid:before, .container-fluid:after, .row:before, .row:after, .form-horizontal .form-group:before, .form-horizontal .form-group:after, .btn-toolbar:before, .btn-toolbar:after, .btn-group-vertical>.btn-group:before, .btn-group-vertical>.btn-group:after, .nav:before, .nav:after, .navbar:before, .navbar:after, .navbar-header:before, .navbar-header:after, .navbar-collapse:before, .navbar-collapse:after, .pager:before, .pager:after, .panel-body:before, .panel-body:after, .modal-footer:before, .modal-footer:after - content: " " - display: table - clear: both - - .caret - display: inline-block - width: 0 - height: 0 - vertical-align: middle - border-top: 4px solid - border-right: 4px solid transparent - border-left: 4px solid transparent - - /* button */ - - .btn.dropdown-toggle - position: relative - float: left - .btn - display: inline-block - margin-bottom: 0 - font-weight: 400 - text-align: center - vertical-align: middle - cursor: pointer - background-image: none - border: 1px solid transparent - white-space: nowrap - -webkit-user-select: none - -moz-user-select: none - -ms-user-select: none - user-select: none - border-radius: 4px - .caret - margin-left: 0 - &.disabled, &[disabled], &.disabled:hover, &[disabled]:active - cursor: not-allowed - pointer-events: none - opacity: .65 - filter: alpha(opacity=65) - -webkit-box-shadow: none - box-shadow: none - .btn-sm - padding: 5px 10px - font-size: 12px - line-height: 1.5 - border-radius: 3px - .btn-group - padding-top: 0 - margin-top: 0 - position: relative - display: inline-block - vertical-align: middle - > .btn - position: relative - float: left - &:first-child - margin-left: 0 - &:first-child:not(:last-child):not(.dropdown-toggle) - border-top-right-radius: 0 - border-bottom-right-radius: 0 - &:not(:first-child):not(:last-child):not(.dropdown-toggle) - border-radius: 0 - &:last-child:not(:first-child), >.dropdown-toggle:not(:first-child) - border-bottom-left-radius: 0 - border-top-left-radius: 0 - &+.dropdown-toggle - padding-left: 8px - padding-right: 8px - &.active - color: #333 - background-color: #e6e6e6 - border-color: #adadad - .btn+.btn, .btn+.btn-group, +.btn, +.btn-group - margin-left: -1px - .btn-link - border-color: transparent - color: #428bca - &:hover, &:focus - color: #2a6496 - text-decoration: underline - background-color: transparent - - /* form */ - - .form-group - margin-bottom: 15px - .form-control - display: block - width: 100% - height: 34px - padding: 6px 12px - font-size: 14px - line-height: 1.42857143 - color: #555 - background-color: #fff - background-image: none - border: 1px solid #ccc - border-radius: 4px - -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075) - box-shadow: inset 0 1px 1px rgba(0,0,0,.075) - .form-horizontal .form-group - margin-left: -15px - margin-right: -15px - .form-group - margin-bottom: 15px - .form-control.select2-container - height: auto !important - padding: 0 - label - display: inline-block - max-width: 100% - margin-bottom: 5px - font-weight: 700 - - /* col */ - - .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12, .col-lg-12 - position: relative - min-height: 1px - padding-left: 15px - padding-right: 15px - width: 100% - - /* dropdown */ - - .dropdown - position: relative - .dropdown, .btn-group - > .btn - color: #333 - background-color: #fff - border-color: #ccc - text-decoration: none - > .btn-primary - color: #fff - background-color: #428bca - border-color: #357ebd - .dropdown-menu - position: absolute - top: 100% - left: 0 - z-index: 1000 - display: none - float: left - min-width: 160px - padding: 5px 0 - margin: 2px 0 0 - list-style: none - font-size: 14px - text-align: left - background-color: #fff - border: 1px solid #ccc - border: 1px solid rgba(0,0,0,.15) - border-radius: 4px - -webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175) - box-shadow: 0 6px 12px rgba(0,0,0,.175) - background-clip: padding-box - > li > a - display: block !important - padding: 3px 20px - clear: both - font-weight: normal - color: #666 - white-space: nowrap - background: transparent - > li.active > a - color: #fff - text-decoration: none - background-color: #428bca - outline: 0 - .open > .dropdown-menu - display: block - - /* list-group */ - - .list-group - margin-bottom: 20px - padding-left: 0 - .list-group-item - position: relative - display: block - padding: 10px 15px - margin-bottom: -1px - background-color: #fff - border: 1px solid #ddd - .list-group-item:first-child - border-top-right-radius: 4px - border-top-left-radius: 4px - .list-group-item:last-child - margin-bottom: 0 - border-bottom-right-radius: 4px - border-bottom-left-radius: 4px - .list-group-item-heading - margin-top: 0 - margin-bottom: 5px - .list-group-item.active - z-index: 2 - color: #fff - background-color: #428bca - border-color: #428bca - - /* tab */ - - .tab-content > .tab-pane - display: none - .tab-content > .active - display: block - .nav - margin-bottom: 0 - padding-left: 0 - list-style: none - .nav > li - position: relative - display: block - .nav > li > a - position: relative - display: block - padding: 10px 15px - .nav-tabs - border-bottom: 1px solid #ddd - .nav-tabs > li - float: left - margin-bottom: -1px - .nav-tabs > li > a - margin-right: 2px - line-height: 1.42857143 - border: 1px solid transparent - border-radius: 4px 4px 0 0 - .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus - color: #8c8c8c - background-color: #fff - border: 1px solid #ddd - border-bottom-color: transparent - cursor: default - - /* pager */ - - .pager - padding-left: 0 - margin: 20px 0 - list-style: none - text-align: center - li - display: inline - li > a, li > span - display: inline-block - padding: 5px 14px - background-color: #fff - border: 1px solid #ddd - border-radius: 15px - .previous > a, .previous > span - float: left - .disabled > a, .disabled > a:hover, .disabled > a:focus, .disabled > span - color: #b3b3b3 - background-color: #fff - cursor: not-allowed - - /* add submenu css */ - - .dropdown-submenu - position: relative - z-index: 1000 - .dropdown-submenu - &>.dropdown-menu - top: 0 - left: 100% - margin-top: -6px - margin-left: -1px - -webkit-border-radius: 0 6px 6px 6px - -moz-border-radius: 0 6px 6px 6px - border-radius: 0 6px 6px 6px - &:hover - &>.dropdown-menu - display: block - &>a:after - border-left-color: #ffffff - &>a:after - display: block - content: " " - float: right - width: 0 - height: 0 - border-color: transparent - border-style: solid - border-width: 5px 0 5px 5px - border-left-color: #cccccc - margin-top: 5px - margin-right: -10px - &.pull-left - float: none - &>.dropdown-menu - left: -100% - margin-left: 10px - -webkit-border-radius: 6px 0 6px 6px - -moz-border-radius: 6px 0 6px 6px - border-radius: 6px 0 6px 6px - - /* global */ - - .hidden - display: none !important - .img-responsive - display: block - width: 100% \9 - max-width: 100% - height: auto - .well - min-height: 20px - padding: 19px - margin-bottom: 20px - background-color: #f5f5f5 - border: 1px solid #e3e3e3 - border-radius: 4px - -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.05) - box-shadow: inset 0 1px 1px rgba(0,0,0,.05) - .sr-only - position: absolute - width: 1px - height: 1px - margin: -1px - padding: 0 - overflow: hidden - clip: rect(0,0,0,0) - border: 0 - .text-center - text-align: center - .text-muted - color: #b3b3b3 - -.note-popover .btn - height: 30px -.note-popover, .o_css_editor - font-family: "Helvetica Neue",Helvetica,Arial,sans-serif - font-size: 14px - line-height: 1.42857143 - color: #666 - button - margin: 0 - a - color: #428bca - &:hover, &:focus - color: #2a6496 - text-decoration: underline - - .popover - position: fixed !important - top: 1px !important - right: auto !important - left: 300px !important - margin-top: 0 !important - border: 0 - background: transparent - box-shadow: none - -webkit-box-shadow: none - z-index: 1040 - padding: 1px - text-align: left - white-space: normal - border-radius: 6px - max-width: none - .popover-content - padding: 0 - margin: 0 0 0 6px - .note-para .dropdown-menu - min-width: 148px !important - padding: 5px 0 5px 5px !important - .note-ul .dropdown-menu - min-width: 150px !important - padding: 5px 0 5px 5px !important - .note-li - margin-right: 5px - .colorpicker - margin: 0 - td > * - width: 20px - height: 20px - padding: 0 - margin: 0 - border: 1px solid #fff - .btn-group - margin: 0 5px 0 0 - > a - border-radius: 3px - background-color: #fff - border-color: #ccc - padding: 4px 10px - font-size: 14px - line-height: 1.5 - > span - display: inline-block - max-width: 200px - overflow: hidden - text-overflow: ellipsis - white-space: nowrap - vertical-align: middle - border-radius: 3px - background-color: white - border-color: #cccccc - padding: 4px 10px - font-size: 14px - line-height: 1.5 - .arrow - display: none - -.note-popover, .o_css_editor, .web_editor-dialog .modal-footer - .btn-default - color: #333 - background-color: #fff - border-color: #ccc - .btn-primary - color: #fff - background-color: #428bca - border-color: #357ebd - -.web_editor-dialog, .note-image-dialog - color: #666 - display: none - overflow: hidden - position: fixed - top: 0 - right: 0 - bottom: 0 - left: 0 - z-index: 1050 - -webkit-overflow-scrolling: touch - outline: 0 - .btn - border-color: #ccc - .btn-link - border-color: transparent - .btn-primary - color: #fff - background-color: #428bca - border-color: #357ebd - .btn-danger - color: #fff - background-color: #d9534f - border-color: #d43f3a - .modal-header, .modal-footer - a - color: #428bca - &:hover, &:focus - color: #2a6496 - text-decoration: underline - .btn - border-color: #ccc - padding: 6px 12px - font-size: 14px - line-height: 1.42857143 - border-radius: 4px - .link-style - .dropdown > .btn - min-width: 160px - li - text-align: center - label - width: 100px - margin: 0 5px - input.link-style - display: none - .modal-title - margin: 0 - line-height: 1.42857143 - .modal-dialog - position: relative - width: auto - margin: 10px - .modal-content - position: relative - background-color: #fff - border: 1px solid #999 - border: 1px solid rgba(0,0,0,.2) - border-radius: 6px - -webkit-box-shadow: 0 3px 9px rgba(0,0,0,.5) - box-shadow: 0 3px 9px rgba(0,0,0,.5) - background-clip: padding-box - outline: 0 - .modal-header - padding: 15px - border-bottom: 1px solid #e5e5e5 - min-height: 16.43px - .close - margin-top: -2px - .modal-body - position: relative - padding: 15px - .modal-footer - text-align: left - padding: 15px - border-top: 1px solid #e5e5e5 - .close - float: right - font-size: 21px - font-weight: 700 - line-height: 1 - color: #000 - text-shadow: 0 1px 0 #fff - opacity: .2 - filter: alpha(opacity=20) - button.close - padding: 0 - cursor: pointer - background: 0 0 - border: 0 - -webkit-appearance: none - -.note-image-dialog .btn - height: 34px - font-size: 14px - -@media (min-width: 768px) - .web_editor-dialog, .note-image-dialog - .modal-dialog - width: 600px - margin: 30px auto - .modal-content - -webkit-box-shadow: 0 5px 15px rgba(0,0,0,.5) - box-shadow: 0 5px 15px rgba(0,0,0,.5) - .note-popover, .o_css_editor, .web_editor-dialog, .note-image-dialog - .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 - float: left - .col-sm-12 - width: 100% - .col-sm-11 - width: 91.66666667% - .col-sm-10 - width: 83.33333333% - .col-sm-9 - width: 75% - .col-sm-8 - width: 66.66666667% - .col-sm-7 - width: 58.33333333% - .col-sm-6 - width: 50% - .col-sm-5 - width: 41.66666667% - .col-sm-4 - width: 33.33333333% - .col-sm-3 - width: 25% - .col-sm-2 - width: 16.66666667% - .col-sm-1 - width: 8.33333333% - .form-horizontal .control-label - text-align: right - margin-bottom: 0 - padding-top: 7px - .form-inline .form-group - display: inline-block - margin-bottom: 0 - vertical-align: middle - -.modal-open - .web_editor-dialog, .note-image-dialog - overflow-x: hidden - overflow-y: auto -.editor_enable - .modal-backdrop - position: fixed - top: 0 - right: 0 - bottom: 0 - left: 0 - z-index: 1040 - background-color: #000 - .modal-backdrop.in - opacity: .5 - filter: alpha(opacity=50) - -$attachment-border-color: #848490 -.note-image-dialog - .select-media - width: 80% - - .existing-attachments .pager - margin: 0 - .existing-attachments - .pager .disabled - display: none - - .existing-attachment-cell - position: relative - .o_attachment_border - border: 1px solid $attachment-border-color - text-align: center - .o_image - max-width: 100% - padding-top: 80% - max-height: 100% - display: inline-block - img - width: 100% - .o_webimage - background-image: none - padding-top: 0 - width: 100% - height: initial - vertical-align: middle - .existing-attachment-remove - position: absolute - top: 0 - left: 15px // padding-left on col-* - z-index: 1 - cursor: pointer - background: white - padding: 2px - border: 1px solid $attachment-border-color - border-top: none - border-left: none - +border-bottom-right-radius(8px) - &.media_selected - > * - border-width: 5px - border-color: rgb(0, 248, 248) - - .image-preview - margin-bottom: 0.5em - .font-icons-icons - font-size: 2em - max-height: 9em - overflow: auto - .font-icons-icon - display: inline-block - width: 2em - padding: 0.25em - text-align: center - cursor: pointer - .font-icons - position: relative - display: block - - &:before - +opacity(0.7) - position: absolute - top: 2px - left: 3px - font-size: 2em - #icon-search - padding-left: 2.5em - .font-icons-selected - background-color: #ddd - &.nosave - .wait - display: inline-block !important - visibility: visible !important - .modal-body - .filepicker, .image-preview - display: none - .wait - width: 100% - .modal-footer .save - display: none - .preview-container - text-align: center - line-height: 100px - height: 100px - > * - max-height: 100px - line-height: 100px - margin: 0 auto - display: inline-block - -/* }}} */ - -/* ---- COLOR-PICKER ---- {{{ */ - -.colorpicker - margin: 0 auto - background: transparent - border: 0 - td - padding: 0 - background: transparent - > * - width: 16px - height: 16px - border-radius: 2px - margin: 3px - padding: 0 - border-width: 1px - display: block - .only-text - display: none - .automatic-color - background: #fff - border-left: 7px solid #f33 - border-top: 7px solid #0e0 - border-right: 8px solid #33f - border-bottom: 8px solid #fe0 - margin: 4px 3px 3px 3px - width: 0 - height: 0 - -/* }}} */ - -/* ---- TRANSLATIONS ---- {{{ */ - -o_translatable_translated - -.oe_translate_examples li - margin: 10px - padding: 4px -html[lang] > body.editor_enable - [data-oe-translation-state] - background: rgba(255, 255, 90, 0.5) !important - &:hover - background: inherit !important - cursor: text - [data-oe-translation-state="translated"] - background: rgba(120, 215, 110, 0.5) !important -html[data-translatable] .oe_field_translate - display: block -html[data-translatable] .oe_field_translate - display: none - -/* }}} */ - -/* ---- editable ---- {{{ */ - -.o_editable - &:not(:empty),&[data-oe-type] - &:not([data-oe-model="ir.ui.view"]):not([data-oe-type="html"]):hover - /* to do change into primary color in less */ - -moz-box-shadow: #3071a9 0 0 5px 2px inset - -webkit-box-shadow: #3071a9 0 0 5px 2px inset - box-shadow: #3071a9 0 0 5px 2px inset - &:focus,&[data-oe-type] - min-height: 0.8em - min-width: 8px - &.o_is_inline_editable - display: inline-block - &:focus - outline: none !important - -/* Prevent the text contents of draggable elements from being selectable. */ -[draggable] - -moz-user-select: none - -khtml-user-select: none - -webkit-user-select: none - user-select: none - -// bootstrap makes .btn elements unselectable -> RTE double-click can't know -// about them either -.o_editable .btn, .btn.o_editable - -webkit-user-select: auto - -moz-user-select: auto - -ms-user-select: auto - user-select: auto - cursor: text !important -.o_editable .fa - cursor: pointer - -.css_editable_display - display: block !important - -.css_editable_hidden - display: none !important - -.editor_enable - [data-oe-readonly]:hover - cursor: default - .css_editable_mode_hidden - display: none - .css_non_editable_mode_hidden - display: block !important - .media_iframe_video .css_editable_mode_display - display: block !important - - [placeholder]:empty - content: " \00a0 " attr(placeholder) - [placeholder]:empty:active:after, [placeholder]:empty:focus:after - content: none - input, textarea, select - &[placeholder]:empty - content: none - -.oe_empty[placeholder]:empty - min-height: 220px !important - background-repeat: no-repeat - background-position: center - - &:not(.o_editable) - background-image: url('/web_editor/static/src/img/edit_here.png') !important - - &:after, &:before - opacity: 0.4 - overflow: hidden - z-index: -1 - min-height: 1em - - &:after - text-align: center - padding-top: 160px - display: block - font-size: 24px - - &.o_no_placeholder_image - background-image: none - text-align: left - padding-top: 0 - - &[data-oe-type=html] - &:after - font-size: 16px -.editor_has_snippets .oe_empty[placeholder]:empty - background-image: url('/web_editor/static/src/img/drag_here.png') !important - -#web_editor-top-edit - width: 100% - min-height: 34px - height: 34px - background-color: #222 - border-color: #080808 - border-width: 0 0 1px - position: fixed - border-radius: 0 - top: 0 - right: 0 - left: 0 - z-index: 1030 - -webkit-transform: translate3d(0,0,0) - transform: translate3d(0,0,0) - .btn-link - color: #b3b3b3 - > ul > li - margin: 0 - form - padding: 0 10px 0 15px - border-top: 1px solid transparent - border-bottom: 1px solid transparent - margin: 0 - button, a - padding: 4px 8px 4px 8px - margin-top: 2px - font-size: 13px - -#editable_area - margin-top: 34px - -/* }}} */ - - -/* ---- HACK FOR COVERING UP EDITOR BOGUS P INSERTION --- {{{ */ - -.oe_structure.oe_empty > .oe_drop_zone.oe_insert:only-child, [data-oe-type=html] > .oe_drop_zone.oe_insert:only-child - position: static - -.css_editable_display - display: none - -.oe_carlos_danger - outline: 1px solid red !important - background-color: #ffd9dd !important - -/* }}} */ diff --git a/addons/web_editor/static/src/css/inline.css b/addons/web_editor/static/src/css/inline.css deleted file mode 100644 index cba6343becb..00000000000 --- a/addons/web_editor/static/src/css/inline.css +++ /dev/null @@ -1,265 +0,0 @@ -body { - background-color: #fff; -} -#editable_area p { - margin: initial; -} -#editable_area a { - color: inherit; -} -#editable_area a:hover { - color: inherit; -} -#editable_area { - margin-top: 0 !important; - font: inherit !important; - line-height: inherit !important; - color: inherit !important; -} -#oe_snippets ~ #wrapwrap #editable_area { - margin-bottom: 100px; -} - -#wrapwrap > main > div:first-child { - max-width: 600px; - margin-left: auto; - margin-right: auto; - position: relative; -} - -.editor_enable #wrapwrap > main > div:first-child { - border-top: 1px dashed #888; - margin-top: 50px; -} - -.editor_enable #wrapwrap > main > div:first-child:before, #wrapwrap > main > div:first-child:after { - content: " "; - display: block; - height: 100%; - vertical-align: top; - position: fixed; - top: -4px; - overflow: hidden; - z-index: -1; - margin-top: 54px; -} -.editor_enable #wrapwrap > main > div:first-child[data-oe-placeholder]:empty:before { - content: " \00a0 " attr(data-oe-placeholder); -} - -.editor_enable #wrapwrap > main > div:first-child:before { - border-left: 1px dashed #000; - opacity: 0.4; - margin-left: -5px; -} -.editor_enable #wrapwrap > main > div:first-child:after { - border-left: 1px dashed #000; - opacity: 0.4; - margin-left: 605px; - width: 0; -} - -.note-color-palette .colorpicker { - display: none; -} - -/* ---- Default bootstrap values ---- {{{ */ -.tooltip { - position: absolute; - z-index: 1070; - display: block; - visibility: visible; - font-size: 12px; - line-height: 1.4; - opacity: 0; - filter: alpha(opacity=0); -} -.tooltip.in { - opacity: 0.9; - filter: alpha(opacity=90); -} -.tooltip.bottom { - margin-top: 3px; - padding: 5px 0; -} -.tooltip.bottom .tooltip-arrow { - top: 0; - left: 50%; - margin-left: -5px; - border-width: 0 5px 5px; - border-bottom-color: #000; -} - -.tooltip-arrow { - position: absolute; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; -} - -.tooltip-inner { - max-width: 200px; - padding: 3px 8px; - color: #fff; - text-align: center; - text-decoration: none; - background-color: #000; - border-radius: 4px; -} - -.fade:not(.modal-backdrop) { - opacity: 0; - -webkit-transition: opacity 0.15s linear; - -o-transition: opacity 0.15s linear; - transition: opacity 0.15s linear; -} - -.fade.in:not(.modal-backdrop) { - opacity: 1; -} - -.pull-right { - float: right; -} - -.center-block { - display: block; - margin-left: auto; - margin-right: auto; -} - -.pull-left { - float: left; -} - -.img-responsive { - display: block; - width: 100% \9; - max-width: 100%; - height: auto; -} - -.img-rounded { - border-radius: 6px; -} - -.img-thumbnail { - padding: 4px; - line-height: 1.42857; - background-color: #fff; - border: 1px solid #ddd; - border-radius: 4px; - -webkit-transition: all 0.2s ease-in-out; - -o-transition: all 0.2s ease-in-out; - transition: all 0.2s ease-in-out; - display: inline-block; - width: 100% \9; - max-width: 100%; - height: auto; -} - -.img-circle { - border-radius: 50%; -} - -.img-responsive { - text-align: center; -} - -img.shadow { - -moz-box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.2); - -webkit-box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.2); - box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.2); -} - -.fa-1x { - font-size: 1em; -} - -.fa-2x { - font-size: 2em; -} - -.fa-3x { - font-size: 3em; -} - -.fa-4x { - font-size: 4em; -} - -.fa-5x { - font-size: 5em; -} - -.fa-6x { - font-size: 6em; -} - -.fa-7x { - font-size: 7em; -} - -.fa-8x { - font-size: 8em; -} - -.fa-9x { - font-size: 9em; -} - -.fa-10x { - font-size: 10em; -} - -.text-primary { - color: #428bca; -} - -.text-success { - color: #3c763d; -} - -.text-info { - color: #31708f; -} - -.text-warning { - color: #8a6d3b; -} - -.text-danger { - color: #a94442; -} - -.bg-primary { - color: #fff; - background-color: #428bca; -} - -.bg-success { - background-color: #dff0d8; -} - -.bg-info { - background-color: #d9edf7; -} - -.bg-warning { - background-color: #fcf8e3; -} - -.bg-danger { - background-color: #f2dede; -} - -.hidden { - display: none; -} - -.img-responsive { - text-align: center; -} - -/* }}} */ \ No newline at end of file diff --git a/addons/web_editor/static/src/css/snippets.css b/addons/web_editor/static/src/css/snippets.css deleted file mode 100644 index e203e514e87..00000000000 --- a/addons/web_editor/static/src/css/snippets.css +++ /dev/null @@ -1,499 +0,0 @@ -@charset "UTF-8"; -/* ---- SNIPPET EDITOR ---- {{{ */ -#oe_snippets #o_left_bar, #oe_snippets #o_arrow { - position: fixed; - top: 34px; - left: 0px; - bottom: 0; - background: #282828; - -moz-box-shadow: 0px 10px 10px -10px black inset; - -webkit-box-shadow: 0px 10px 10px -10px black inset; - box-shadow: 0px 10px 10px -10px black inset; - font-size: 14px; -} -#oe_snippets #o_left_bar .snippets_loading, #oe_snippets #o_arrow .snippets_loading { - color: white; -} -#oe_snippets #o_arrow { - z-index: 1009; - width: 24px; - opacity: 0.75; -} -#oe_snippets #o_arrow > * { - position: absolute; - color: white; -} -#oe_snippets #o_arrow div { - -moz-transform: translateX(-36%) rotate(-90deg); - -ms-transform: translateX(-36%) rotate(-90deg); - -webkit-transform: translateX(-36%) rotate(-90deg); - transform: translateX(-36%) rotate(-90deg); - top: 50%; - white-space: nowrap; -} -#oe_snippets #o_arrow .fa { - width: 100%; - left: 40%; -} -#oe_snippets #o_left_bar { - left: -228px; - z-index: 1010; - width: 210px; - -moz-transition: all 500ms ease; - -o-transition: all 500ms ease; - -webkit-transition: all 500ms ease; - transition: all 500ms ease; -} -#oe_snippets #o_left_bar ul { - text-align: center; - margin: 0; - padding: 6px 0; - list-style-type: none; -} -#oe_snippets #o_left_bar ul li { - display: inline-block; - padding: 0 3px; -} -#oe_snippets #o_left_bar ul li a { - color: #aaa; -} -#oe_snippets #o_left_bar ul li .fa-stack { - overflow: hidden; -} -#oe_snippets #o_left_bar ul li.active a.fa, #oe_snippets #o_left_bar ul li.active .fa-stack-1x { - color: #428bca; -} -#oe_snippets.o_open #o_left_bar { - left: 0; -} -#oe_snippets .o_panel { - margin: 0; - border: 0; - width: 210px; -} -#oe_snippets .o_panel_header { - background: #dff0d8; - padding: 1px 8px; - color: #414141; - text-align: center; -} -#oe_snippets .o_panel_header .fa-stack { - overflow: hidden; - font-size: 1em; -} -#oe_snippets .o_panel_body { - white-space: normal; - background: black; - padding: 7px 3px; -} -#oe_snippets .o_panel_body > div { - background: black; -} -#oe_snippets .o_panel_body > div label { - width: 44px; - color: #fff; - padding-left: 10px; -} -#oe_snippets .o_panel_body > div label div { - width: 100px; - text-align: center; - -moz-transform: translate(-39px, 44px); - -webkit-transform: translate(-39px, 44px); - transform: translate(-39px, 44px); - -moz-transform-origin: 50% 50%; - -ms-transform-origin: 50% 50%; - -webkit-transform-origin: 50% 50%; - transform-origin: 50% 50%; -} - -.oe_snippet { - display: inline-block; - vertical-align: top; - width: 93px; - margin-left: 3px; - margin-right: 3px; - margin-top: 1px; - position: relative; - overflow: hidden; - -moz-user-select: -moz-none; - -ms-user-select: none; - -webkit-user-select: none; - user-select: none; - cursor: move; -} -.oe_snippet .oe_snippet_thumbnail { - text-align: center; - height: 100%; - background: transparent; - color: white; - position: relative; -} -.oe_snippet .oe_snippet_thumbnail:hover .oe_snippet_thumbnail_img { - -moz-transform: scale(0.95, 0.95); - -ms-transform: scale(0.95, 0.95); - -webkit-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 { - height: 74px; - width: 92px; - background-size: cover; - -moz-transform: scale(1, 1); - -ms-transform: scale(1, 1); - -webkit-transform: scale(1, 1); - transform: scale(1, 1); -} -.oe_snippet .oe_snippet_thumbnail span, .oe_snippet .oe_snippet_thumbnail div { - line-height: 18px; -} -.oe_snippet > :not(.oe_snippet_thumbnail) { - display: none !important; -} -.oe_snippet.disable .oe_snippet_thumbnail { - background-color: rgba(255, 0, 0, 0.75); -} -.oe_snippet.disable .oe_snippet_thumbnail_img { - opacity: 0.8; -} - -#oe_snippets .oe_snippet_thumbnail { - background: #747474, url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHJhZGlhbEdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY3g9IjUwJSIgY3k9IjUwJSIgcj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIgc3RvcC1vcGFjaXR5PSIwLjI1Ii8+PHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjMDAwMDAwIiBzdG9wLW9wYWNpdHk9IjAuNCIvPjwvcmFkaWFsR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); - background: #747474, -moz-radial-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.4)); - background: #747474, -webkit-radial-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.4)); - background: #747474, radial-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.4)); -} - -/* ---- SNIPPETS DROP ZONES ---- {{{ */ -.oe_drop_zone.oe_insert { - display: block; - height: 48px; - margin: 0px; - margin-top: -4px; - margin-bottom: -44px; - -moz-transition: margin 250ms linear; - -o-transition: margin 250ms linear; - -webkit-transition: margin 250ms linear; - transition: margin 250ms linear; - width: 100%; - position: absolute; - z-index: 1000; -} -.oe_drop_zone.oe_insert:not(.oe_vertical):before { - content: ""; - display: block; - border-top: dashed 2px rgba(209, 178, 255, 0.72); - position: relative; - top: 0px; -} -.oe_drop_zone.oe_insert.oe_hover:before { - border-top: dashed 2px rgba(116, 255, 161, 0.72); -} -.oe_drop_zone.oe_insert.oe_vertical { - width: 48px; - float: left; - position: relative; - margin: 0px -24px !important; -} -.oe_drop_zone.oe_insert.oe_vertical_text { - width: 48px; - float: none; - display: inline-block; - position: relative; - margin: 0px -24px !important; -} -.oe_drop_zone.oe_insert.oe_overlay { - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; - background: rgba(153, 0, 255, 0.5); -} - -.oe_drop_zone, .oe_drop_zone_style { - border: none; - background: rgba(153, 0, 255, 0.3); - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px; -} -.oe_drop_zone.oe_hover, .oe_drop_zone_style.oe_hover { - background: rgba(0, 255, 133, 0.3); - z-index: 1001; -} - -.oe_drop_zone_style { - color: white; - height: 48px; - margin-bottom: 32px; - padding-top: 12px; -} - -/* ---- SNIPPET MANIPULATOR ---- {{{ */ -.resize_editor_busy { - background-color: rgba(0, 0, 0, 0.3); -} - -.oe_overlay { - display: none; - height: 0; - position: absolute; - background: transparent; - z-index: 1001; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; - -moz-transition: opacity 100ms linear; - -o-transition: opacity 100ms linear; - -webkit-transition: opacity 100ms linear; - transition: opacity 100ms linear; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} -.oe_overlay.oe_active { - display: block; -} -.oe_overlay .oe_handle { - display: block !important; - position: absolute; - top: 50%; - left: 50%; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; - width: 16px; - height: 16px; - margin: -2px; -} -.oe_overlay .oe_handle > div { - z-index: 1; - position: absolute; - border-style: dashed; - border-width: 1px; - border-color: #666666; - -moz-box-shadow: 0px 0px 0px 1px rgba(255, 255, 255, 0.5), 0px 0px 0px 1px rgba(255, 255, 255, 0.5) inset; - -webkit-box-shadow: 0px 0px 0px 1px rgba(255, 255, 255, 0.5), 0px 0px 0px 1px rgba(255, 255, 255, 0.5) inset; - box-shadow: 0px 0px 0px 1px rgba(255, 255, 255, 0.5), 0px 0px 0px 1px rgba(255, 255, 255, 0.5) inset; -} -.oe_overlay .oe_handle.e:before, .oe_overlay .oe_handle.w:before, .oe_overlay .oe_handle.s:before, .oe_overlay .oe_handle.n:before, .oe_overlay .oe_handle.size .oe_handle_button { - z-index: 2; - position: relative; - top: 50%; - left: 50%; - display: block; - background: white; - border: solid 1px rgba(0, 0, 0, 0.2); - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - width: 18px; - height: 18px; - margin: -9px; - padding-left: 1px; - font-size: 14px; - line-height: 14px; - font-family: FontAwesome; - color: rgba(0, 0, 0, 0.5); - -moz-transition: background 100ms linear; - -o-transition: background 100ms linear; - -webkit-transition: background 100ms linear; - transition: background 100ms linear; -} -.oe_overlay .oe_handle.e:hover:before, .oe_overlay .oe_handle.w:hover:before, .oe_overlay .oe_handle.s:hover:before, .oe_overlay .oe_handle.n:hover:before { - background: rgba(0, 0, 0, 0.5); - color: #fff; - -moz-box-shadow: 0 0 5px 3px rgba(255, 255, 255, 0.7); - -webkit-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_handle.e, .oe_overlay .oe_handle.w { - top: 4px; - height: 100%; -} -.oe_overlay .oe_handle.e:before, .oe_overlay .oe_handle.w:before { - content: ""; - line-height: 16px; -} -.oe_overlay .oe_handle.e > div, .oe_overlay .oe_handle.w > div { - width: 0; - height: 100%; - top: 2px; - left: 8px; -} -.oe_overlay .oe_handle.e { - left: auto; - right: -6px; - cursor: w-resize; -} -.oe_overlay .oe_handle.w { - left: -6px; - cursor: e-resize; -} -.oe_overlay .oe_handle.s, .oe_overlay .oe_handle.n { - left: 2px; - width: 100%; -} -.oe_overlay .oe_handle.s:before, .oe_overlay .oe_handle.n:before { - content: ""; - text-align: center; - padding: 1px; -} -.oe_overlay .oe_handle.s > div, .oe_overlay .oe_handle.n > div { - width: 100%; - height: 0; - top: 7px; - left: 1px; -} -.oe_overlay .oe_handle.s { - top: auto; - cursor: n-resize; -} -.oe_overlay .oe_handle.n { - cursor: s-resize; -} -.oe_overlay .oe_handle.n > div { - top: 5px; -} -.oe_overlay .oe_handle.size { - z-index: 3; - top: auto; - left: 50%; - bottom: -6px; - margin-left: -50px; -} -.oe_overlay .oe_handle.size .oe_handle_button { - position: relative; - z-index: 3; - text-align: center; - margin-left: -52px; - margin-top: -10px; - left: 0px; -} -.oe_overlay .oe_handle.size .oe_handle_button:hover { - background: rgba(30, 30, 30, 0.8); - color: #fff; - -moz-box-shadow: 0 0 5px 3px rgba(255, 255, 255, 0.7); - -webkit-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_handle.size .size { - position: absolute; - width: 64px; - cursor: row-resize; - top: 9px; - margin-left: 52px; - padding: 0 5px; -} -.oe_overlay .oe_handle.size .auto_size { - position: absolute; - width: 100px; - top: 9px; - cursor: pointer; -} -.oe_overlay .oe_handle.readonly { - cursor: auto !important; -} -.oe_overlay .oe_handle.readonly:before, .oe_overlay .oe_handle.readonly.size { - display: none !important; -} -.oe_overlay .icon.btn { - display: inline-block; -} -.oe_overlay .oe_overlay_options { - position: absolute; - width: 100%; - top: -35px; - z-index: 1002; -} -.oe_overlay .oe_overlay_options > .btn-group { - display: -ms-flexbox; - display: -moz-box; - display: -webkit-box; - display: -webkit-flex; - display: flex; - -moz-justify-content: center; - -webkit-justify-content: center; - justify-content: center; -} -.oe_overlay .oe_overlay_options > .btn-group > * { - cursor: pointer; - -ms-flex: 0 0 auto; - -moz-flex: 0 0 auto; - -webkit-box-flex: 0; - -webkit-flex: 0 0 auto; - flex: 0 0 auto; -} -.oe_overlay .oe_overlay_options .btn, .oe_overlay .oe_overlay_options a { - cursor: pointer; -} -.oe_overlay .oe_overlay_options .dropdown { - display: inline-block; -} -.oe_overlay .oe_overlay_options .dropdown-menu { - text-align: left; - min-width: 180px; -} -.oe_overlay .oe_overlay_options .dropdown-menu select, .oe_overlay .oe_overlay_options .dropdown-menu input { - display: block; -} -.oe_overlay.block-w-left .w:before { - content: "" !important; -} -.oe_overlay.block-w-right .w:before { - content: "" !important; -} -.oe_overlay.block-w-left.block-w-right .w:before { - display: none !important; -} -.oe_overlay.block-e-left .e:before { - content: "" !important; -} -.oe_overlay.block-e-right .e:before { - content: "" !important; -} -.oe_overlay.block-e-left.block-e-right .e:before { - display: none !important; -} -.oe_overlay.block-s-top .s:before { - content: "" !important; -} -.oe_overlay.block-s-bottom .s:before { - content: "" !important; -} -.oe_overlay.block-n-top .n:before { - content: "" !important; -} -.oe_overlay.block-n-bottom .n:before { - content: "" !important; -} -.oe_overlay.o_keypress { - opacity: 0; - -webkit-transition: 0.8s; - -moz-transition: 0.8s; - -o-transition: 0.8s; - -transition: 0.8s; -} - -.s-resize-important, .s-resize-important * { - cursor: s-resize !important; -} - -.n-resize-important, .n-resize-important * { - cursor: n-resize !important; -} - -.e-resize-important, .e-resize-important * { - cursor: e-resize !important; -} - -.w-resize-important, .w-resize-important * { - cursor: w-resize !important; -} - -.move-important, .move-important * { - cursor: move !important; -} diff --git a/addons/web_editor/static/src/css/snippets.sass b/addons/web_editor/static/src/css/snippets.sass deleted file mode 100644 index 710c358a527..00000000000 --- a/addons/web_editor/static/src/css/snippets.sass +++ /dev/null @@ -1,384 +0,0 @@ -@import "compass/css3" -@import "compass/css3/user-interface" -@import "compass/css3/transition" - - -/* ---- SNIPPET EDITOR ---- {{{ */ - -#oe_snippets - #o_left_bar, #o_arrow - position: fixed - top: 34px - left: 0px - bottom: 0 - background: rgb(40,40,40) - +box-shadow(0px 10px 10px -10px black inset) - font-size: 14px - .snippets_loading - color: white - #o_arrow - z-index: 1009 - width: 24px - opacity: 0.75 - > * - position: absolute - color: white - div - @include transform( translateX(-36%) rotate(-90deg) ) - top: 50% - white-space: nowrap - .fa - width: 100% - left: 40% - #o_left_bar - left: -228px - z-index: 1010 - width: 210px - @include transition(all 500ms ease) - ul - text-align: center - margin: 0 - padding: 6px 0 - list-style-type: none - li - display: inline-block - padding: 0 3px - a - color: #aaa - .fa-stack - overflow: hidden - li.active a.fa, li.active .fa-stack-1x - color: #428bca - - &.o_open #o_left_bar - left: 0 - .o_panel - margin: 0 - border: 0 - width: 210px - .o_panel_header - background: #dff0d8 - padding: 1px 8px - color: #414141 - text-align: center - .fa-stack - overflow: hidden - font-size: 1em - .o_panel_body - white-space: normal - background: black - padding: 7px 3px - > div - background: rgb(0,0,0) - label - width: 44px - color: #fff - padding-left: 10px - - div - width: 100px - text-align: center - @include transform( translate(-39px, 44px) , rotate(-90deg) ) - @include transform-origin(50%) - -.oe_snippet - display: inline-block - vertical-align: top - width: 93px - margin-left: 3px - margin-right: 3px - margin-top: 1px - position: relative - overflow: hidden - +user-select(none) - cursor: move - .oe_snippet_thumbnail - text-align: center - height: 100% - 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 - height: 74px - width: 92px - background-size: cover - @include transform( scale(1,1)) - span, div - line-height: 18px - & > :not(.oe_snippet_thumbnail) - display: none !important - &.disable - .oe_snippet_thumbnail - background-color: rgba(255, 0, 0, 0.75) - .oe_snippet_thumbnail_img - opacity: 0.8 -#oe_snippets .oe_snippet_thumbnail - @include background(#747474, radial-gradient(rgba(0,0,0,0.25),rgba(0,0,0,0.4))) - -// }}}} - -/* ---- SNIPPETS DROP ZONES ---- {{{ */ - -.oe_drop_zone.oe_insert - display: block - height: 48px - margin: 0px - margin-top: -4px - margin-bottom: -44px - @include transition(margin 250ms linear) - width: 100% - position: absolute - z-index: 1000 - &:not(.oe_vertical):before - content: "" - display: block - border-top: dashed 2px rgba(209, 178, 255, 0.72) - position: relative - top: 0px - &.oe_hover:before - border-top: dashed 2px rgba(116, 255, 161, 0.72) - &.oe_vertical - width: 48px - float: left - position: relative - margin: 0px -24px !important - &.oe_vertical_text - width: 48px - float: none - display: inline-block - position: relative - margin: 0px -24px !important - &.oe_overlay - +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 - 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, .3) - z-index: 1001 - -.oe_drop_zone_style - color: white - height: 48px - margin-bottom: 32px - padding-top: 12px - -// }}} - -/* ---- SNIPPET MANIPULATOR ---- {{{ */ - -.resize_editor_busy - background-color: rgba(0,0,0,0.3) - -.oe_overlay - display: none - height: 0 - position: absolute - background: transparent - z-index: 1001 - //@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) - &.oe_active - display: block - .oe_handle - display: block !important - position: absolute - top: 50% - left: 50% - +box-sizing(border-box) - width: 16px - height: 16px - margin: -2px - > div - z-index: 1 - position: absolute - border-style: dashed - border-width: 1px - border-color: #666666 - +box-shadow(0px 0px 0px 1px rgba(255,255,255,0.5), 0px 0px 0px 1px rgba(255,255,255,0.5) inset) - &.e:before, &.w:before, &.s:before, &.n:before, &.size .oe_handle_button - z-index: 2 - position: relative - top: 50% - left: 50% - display: block - background: rgba(255, 255, 255, 1) - 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 - font-family: FontAwesome - color: rgba(0,0,0,.5) - @include transition(background 100ms linear) - &.e, &.w, &.s, &.n - &:hover:before - background: rgba(0, 0, 0, .5) - color: #fff - +box-shadow(0 0 5px 3px rgba(255,255,255,.7)) - &.e, &.w - top: 4px - height: 100% - &:before - content: "\f07e" - line-height: 16px - > div - width: 0 - height: 100% - top: 2px - left: 8px - &.e - left: auto - right: -6px - cursor: w-resize - &.w - left: -6px - cursor: e-resize - &.s, &.n - left: 2px - width: 100% - &:before - content: "\f07d" - text-align: center - padding: 1px - > div - width: 100% - height: 0 - top: 7px - left: 1px - &.s - top: auto - cursor: n-resize - &.n - cursor: s-resize - > div - top: 5px - &.size - z-index: 3 - top: auto - left: 50% - bottom: -6px - margin-left: -50px - .oe_handle_button - position: relative - z-index: 3 - text-align: center - margin-left: -52px - margin-top: -10px - left: 0px - &:hover - background: rgba(30, 30, 30, .8) - color: #fff - +box-shadow(0 0 5px 3px rgba(255,255,255,.7)) - .size - position: absolute - width: 64px - cursor: row-resize - top: 9px - margin-left: 52px - padding: 0 5px - .auto_size - position: absolute - width: 100px - top: 9px - cursor: pointer - &.readonly - cursor: auto !important - &:before, &.size - display: none !important - - .icon.btn - display: inline-block - - .oe_overlay_options - position: absolute - width: 100% - top: -35px - z-index: 1002 - > .btn-group - display: -ms-flexbox - display: -moz-box - display: -webkit-box - display: -webkit-flex - display: flex - -moz-justify-content: center - -webkit-justify-content: center - justify-content: center - > * - cursor: pointer - -ms-flex: 0 0 auto - -moz-flex: 0 0 auto - -webkit-box-flex: 0 - -webkit-flex: 0 0 auto - flex: 0 0 auto - .btn, a - cursor: pointer - .dropdown - display: inline-block - .dropdown-menu - text-align: left - min-width: 180px - .dropdown-menu select,.dropdown-menu input - display: block - - &.block-w-left .w:before - content: "\F061" !important - &.block-w-right .w:before - content: "\F060" !important - &.block-w-left.block-w-right .w:before - display: none !important - &.block-e-left .e:before - content: "\F061" !important - &.block-e-right .e:before - content: "\F060" !important - &.block-e-left.block-e-right .e:before - display: none !important - - &.block-s-top .s:before - content: "\F063" !important - &.block-s-bottom .s:before - content: "\f062" !important - &.block-n-top .n:before - content: "\F063" !important - &.block-n-bottom .n:before - content: "\f062" !important - - &.o_keypress - opacity: 0 - -webkit-transition: .8s - -moz-transition: .8s - -o-transition: .8s - -transition: .8s - - -.s-resize-important, .s-resize-important * - cursor: s-resize !important -.n-resize-important, .n-resize-important * - cursor: n-resize !important -.e-resize-important, .e-resize-important * - cursor: e-resize !important -.w-resize-important, .w-resize-important * - cursor: w-resize !important -.move-important, .move-important * - cursor: move !important - -// }}} diff --git a/addons/web_editor/static/src/css/web_editor.css b/addons/web_editor/static/src/css/web_editor.css deleted file mode 100644 index f83b5628b4e..00000000000 --- a/addons/web_editor/static/src/css/web_editor.css +++ /dev/null @@ -1,166 +0,0 @@ -/* ----- EDITOR ----- */ -.css_non_editable_mode_hidden { - display: none !important; -} - -/* ----- Editor (for public user, like forum) ----- */ -.note-toolbar { - margin-left: 0 !important; -} - -.note-popover .popover > .arrow { - display: none; -} - -/* ----- GENERIC LAYOUTING HELPERS ---- */ -.hidden { - display: none !important; -} - -/* table */ -#wrapwrap table.table, .o_editable table.table { - table-layout: fixed; -} -#wrapwrap table.table td, .o_editable table.table td { - min-width: 20px; -} - -/* Media */ -img.shadow { - -moz-box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.2); - -webkit-box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.2); - box-shadow: 0px 3px 8px rgba(0, 0, 0, 0.2); -} - -img.padding-small, .img.padding-small, span.fa.padding-small, iframe.padding-small { - padding: 4px; -} -img.padding-medium, .img.padding-medium, span.fa.padding-medium, iframe.padding-medium { - padding: 8px; -} -img.padding-large, .img.padding-large, span.fa.padding-large, iframe.padding-large { - padding: 16px; -} -img.padding-xl, .img.padding-xl, span.fa.padding-xl, iframe.padding-xl { - padding: 32px; -} - -div.media_iframe_video.padding-small iframe { - padding: 4px; -} -div.media_iframe_video.padding-medium iframe { - padding: 8px; -} -div.media_iframe_video.padding-large iframe { - padding: 16px; -} -div.media_iframe_video.padding-xl iframe { - padding: 32px; -} - -/* font awsome */ -.fa-6x { - font-size: 6em; -} - -.fa-7x { - font-size: 7em; -} - -.fa-8x { - font-size: 8em; -} - -.fa-9x { - font-size: 9em; -} - -.fa-10x { - font-size: 10em; -} - -.fa.center-block { - text-align: center; -} - -/* video */ -div.media_iframe_video { - margin: 0 auto; - text-align: center; - position: relative; - overflow: hidden; -} -div.media_iframe_video iframe { - width: 100%; - height: 100%; - top: 0; - position: absolute; - margin: 0 auto; - margin-left: -50%; -} -div.media_iframe_video .media_iframe_video_size { - padding-bottom: 66.5%; - position: relative; - width: 100%; - height: 0; -} -div.media_iframe_video .css_editable_mode_display { - position: absolute; - width: 100%; - height: 100%; - display: none; - z-index: 2; -} - -html[data-browser^="msie"] div.media_iframe_video iframe { - margin-left: 0; -} - -/* Mobile view */ -@media (max-width: 768px) { - img:not(.cke_iframe), .media_iframe_video, span.fa, i.fa { - -webkit-transform: none !important; - -moz-transform: none !important; - -ms-transform: none !important; - -o-transform: none !important; - transform: none !important; - } -} -/* ---- fields --- */ -address .fa.fa-mobile-phone { - margin: 0 3px 0 2px; -} -address .fa.fa-file-text-o { - margin-right: 1px; -} - -span[data-oe-type="monetary"] { - white-space: nowrap; -} - -/* ---- MENU ---- {{{ */ -div.oe_menu_buttons { - top: -8px; - right: -8px; -} - -ul.oe_menu_editor .fa-home { - display: none; -} -ul.oe_menu_editor > li:first-child > div > span > .fa-home { - display: block; -} -ul.oe_menu_editor .oe_menu_placeholder { - outline: 1px dashed #4183C4; -} -ul.oe_menu_editor ul { - list-style: none; -} -ul.oe_menu_editor li div { - cursor: move; -} -ul.oe_menu_editor .disclose { - cursor: pointer; - width: 10px; - display: none; -} diff --git a/addons/web_editor/static/src/css/web_editor.sass b/addons/web_editor/static/src/css/web_editor.sass deleted file mode 100644 index 2b5b4a8ee2f..00000000000 --- a/addons/web_editor/static/src/css/web_editor.sass +++ /dev/null @@ -1,141 +0,0 @@ -@charset "utf-8" -@import "common" - -/* ----- EDITOR ----- */ - -.css_non_editable_mode_hidden - display: none !important - -/* ----- Editor (for public user, like forum) ----- */ - -.note-toolbar - margin-left: 0 !important - -.note-popover .popover > .arrow - display: none - -/* ----- GENERIC LAYOUTING HELPERS ---- */ - -.hidden - display: none !important - -/* table */ - -#wrapwrap, .o_editable - table.table - table-layout: fixed - td - min-width: 20px - -/* Media */ - -img.shadow - +box-shadow(0px 3px 8px rgba(0, 0, 0, 0.2)) - -img, .img, span.fa, iframe - &.padding-small - padding: 4px - &.padding-medium - padding: 8px - &.padding-large - padding: 16px - &.padding-xl - padding: 32px -div.media_iframe_video - &.padding-small iframe - padding: 4px - &.padding-medium iframe - padding: 8px - &.padding-large iframe - padding: 16px - &.padding-xl iframe - padding: 32px - -/* font awsome */ - -.fa-6x - font-size: 6em -.fa-7x - font-size: 7em -.fa-8x - font-size: 8em -.fa-9x - font-size: 9em -.fa-10x - font-size: 10em -.fa.center-block - text-align: center - -/* video */ - -div.media_iframe_video - margin: 0 auto - text-align: center - position: relative - overflow: hidden - iframe - width: 100% - height: 100% - top: 0 - position: absolute - margin: 0 auto - margin-left: -50% - .media_iframe_video_size - padding-bottom: 66.5% - position: relative - width: 100% - height: 0 - .css_editable_mode_display - position: absolute - width: 100% - height: 100% - display: none - z-index: 2 - -html[data-browser^="msie"] div.media_iframe_video iframe - margin-left: 0 - -/* Mobile view */ - -@media (max-width: 768px) - img:not(.cke_iframe), .media_iframe_video, span.fa, i.fa - -webkit-transform: none !important - -moz-transform: none !important - -ms-transform: none !important - -o-transform: none !important - transform: none !important - -/* ---- fields --- */ - -address - .fa.fa-mobile-phone - margin: 0 3px 0 2px - .fa.fa-file-text-o - margin-right: 1px - -span[data-oe-type="monetary"] - white-space: nowrap - -/* ---- MENU ---- {{{ */ - -div.oe_menu_buttons - top: -8px - right: -8px - -ul.oe_menu_editor - .fa-home - display: none - > li:first-child > div > span > .fa-home - display: block - .oe_menu_placeholder - outline: 1px dashed #4183C4 - ul - list-style: none - li div - cursor: move - .disclose - cursor: pointer - width: 10px - display: none - -// }}} diff --git a/addons/web_editor/static/src/img/drag_here.png b/addons/web_editor/static/src/img/drag_here.png deleted file mode 100644 index 335c3a571bb..00000000000 Binary files a/addons/web_editor/static/src/img/drag_here.png and /dev/null differ diff --git a/addons/web_editor/static/src/img/edit_here.png b/addons/web_editor/static/src/img/edit_here.png deleted file mode 100644 index 77beff11c7b..00000000000 Binary files a/addons/web_editor/static/src/img/edit_here.png and /dev/null differ diff --git a/addons/web_editor/static/src/js/backend.js b/addons/web_editor/static/src/js/backend.js index 72bf61cbb7f..08712a05d0e 100644 --- a/addons/web_editor/static/src/js/backend.js +++ b/addons/web_editor/static/src/js/backend.js @@ -51,7 +51,7 @@ var FieldTextHtmlSimple = widget.extend({ } return config; }, - start: function() { + start: function () { var def = this._super.apply(this, arguments); this.$translate.remove(); this.$translate = $(); @@ -59,7 +59,7 @@ var FieldTextHtmlSimple = widget.extend({ this.$content.trigger('mouseup'); return def; }, - initialize_content: function() { + initialize_content: function () { var self = this; this.$textarea = this.$("textarea").val(this.get('value') || "


    "); this.$content = $(); @@ -118,20 +118,20 @@ var FieldTextHtmlSimple = widget.extend({ return value; }, focus: function() { - if (this.get("effective_readonly")) { + if (!(!this.get("effective_readonly") && this.$textarea)) { return false; } // on IE an error may occur when creating range on not displayed element try { - return this.$content.focusInEnd(); + return this.$textarea.focusInEnd(); } catch (e) { - return this.$content.focus(); + return this.$textarea.focus(); } }, resize: function() { this.$('iframe').css('height', '0px').css('height', Math.max(30, Math.min(this.$content[0] ? this.$content[0].scrollHeight : 0, 500)) + 'px'); }, - render_value: function() { + render_value: function () { var value = this.get('value'); this.$textarea.val(value || ''); this.$content.html(this.text_to_html(value)); @@ -148,10 +148,10 @@ var FieldTextHtmlSimple = widget.extend({ this.$('.note-toolbar').find('button[data-event="undo"]').attr('disabled', false); } }, - is_false: function() { + is_false: function () { return !this.get('value') || this.get('value') === "


    " || !this.get('value').match(/\S/); }, - before_save: function() { + before_save: function () { if (this.options['style-inline']) { transcoder.class_to_style(this.$content); transcoder.font_to_img(this.$content); @@ -268,7 +268,7 @@ var FieldTextHtml = widget.extend({ return src; }, - initialize_content: function() { + initialize_content: function () { this.$el.closest('.modal-body').css('max-height', 'none'); this.$iframe = this.$el.find('iframe'); this.document = null; @@ -334,7 +334,7 @@ var FieldTextHtml = widget.extend({ self.initialize_content(); }); }, - render_value: function() { + render_value: function () { if (this.lang !== this.view.dataset.context.lang || this.$iframe.attr('src').match(/[?&]edit_translations=1/)) { return; } @@ -354,7 +354,7 @@ var FieldTextHtml = widget.extend({ } } }, - is_false: function() { + is_false: function () { return this.get('value') === false || !this.$content.html() || !this.$content.html().match(/\S/); }, before_save: function () { diff --git a/addons/web_editor/static/src/js/base.js b/addons/web_editor/static/src/js/base.js index 4d8d128f60c..f65ecaa7c02 100644 --- a/addons/web_editor/static/src/js/base.js +++ b/addons/web_editor/static/src/js/base.js @@ -30,7 +30,7 @@ data.dom_ready = dom_ready; // todo: remove and load a bundle of translated templates var all_ready; -data.ready = function() { +data.ready = function () { if (!all_ready) { all_ready = $.when(dom_ready, ajax.loadXML()).then(translations); } else if(all_ready.state() === "resolved") { // can add async template @@ -40,9 +40,9 @@ data.ready = function() { }; function translations() { - function translate_node(node){ + function translate_node(node) { if(node.nodeType === 3) { // TEXT_NODE - if(node.nodeValue.match(/\S/)){ + if(node.nodeValue.match(/\S/)) { var space = node.nodeValue.match(/^([\s]*)([\s\S]*?)([\s]*)$/); node.nodeValue = space[1] + $.trim(_t(space[2])) + space[3]; } @@ -55,11 +55,11 @@ function translations() { 'mods': ['web_editor'], 'lang': data.get_context().lang }) - .then(function(trans) { + .then(function (trans) { _t.database.set_bundle(trans); }).then(function () { var keys = _.keys(qweb.templates); - for (var i = 0; i < keys.length; i++){ + for (var i = 0; i < keys.length; i++) { translate_node(qweb.templates[keys[i]]); } }).promise(); diff --git a/addons/web_editor/static/src/js/editor.js b/addons/web_editor/static/src/js/editor.js index 88d86bc825b..9e842bed4bc 100644 --- a/addons/web_editor/static/src/js/editor.js +++ b/addons/web_editor/static/src/js/editor.js @@ -63,9 +63,9 @@ editor.Class = Widget.extend({ template: 'web_editor.editorbar', events: { 'click button[data-action=save]': 'save', - 'click a[data-action=cancel]': 'cancel', + 'click button[data-action=cancel]': 'cancel', }, - init: function(parent) { + init: function (parent) { var self = this; var res = this._super.apply(this, arguments); this.parent = parent; @@ -75,7 +75,7 @@ editor.Class = Widget.extend({ }); return res; }, - start: function() { + start: function () { var self = this; $('.dropdown-toggle').dropdown(); @@ -86,14 +86,13 @@ editor.Class = Widget.extend({ this.rte.start(); var flag = false; - window.onbeforeunload = function(event) { + window.onbeforeunload = function (event) { if (rte.history.getEditableHasUndo().length && !flag) { flag = true; setTimeout(function () {flag=false;},0); return _t('This document is not saved!'); } }; - this.$('button[data-action="save"]').prop('disabled', true); return this._super(); }, display_placeholder: function () { @@ -119,9 +118,7 @@ editor.Class = Widget.extend({ } }); }, - rte_changed: function () { - this.$('button[data-action=save]').prop('disabled', !rte.history.getEditableHasUndo().length); - }, + rte_changed: function () {}, save: function () { return this.rte.save().then(function () { editor.reload(); diff --git a/addons/web_editor/static/src/js/inline.js b/addons/web_editor/static/src/js/inline.js index 2b6ee1c6595..8f63d603b20 100644 --- a/addons/web_editor/static/src/js/inline.js +++ b/addons/web_editor/static/src/js/inline.js @@ -57,10 +57,10 @@ snippet_editor.Class.include({ transcoder.class_to_style($editable); // fix outlook image rendering bug - _.each(['width', 'height'], function(attribute) { - $editable.find('img[style*="width"], img[style*="height"]').attr(attribute, function(){ + _.each(['width', 'height'], function (attribute) { + $editable.find('img[style*="width"], img[style*="height"]').attr(attribute, function () { return $(this)[attribute](); - }).css(attribute, function(){ + }).css(attribute, function () { return $(this).get(0).style[attribute] || 'auto'; }); }); diff --git a/addons/web_editor/static/src/js/rte.js b/addons/web_editor/static/src/js/rte.js index becaf978d17..bbd5e6616aa 100644 --- a/addons/web_editor/static/src/js/rte.js +++ b/addons/web_editor/static/src/js/rte.js @@ -203,7 +203,7 @@ var history = new History(); // add focusIn to jQuery to allow to move caret into a div of a contentEditable area $.extend($.expr[':'],{ - o_editable: function(node,i,m){ + o_editable: function (node,i,m) { while (node) { if (node.className) { if (node.className.indexOf('o_not_editable')!==-1 ) { @@ -423,11 +423,11 @@ var RTE = Widget.extend({ /** * Get HTML cloned element with text nodes escaped for XML storage */ - getEscapedElement: function($el) { + getEscapedElement: function ($el) { var escaped_el = $el.clone(); var to_escape = escaped_el.find('*').addBack(); to_escape = to_escape.not(to_escape.filter('object,iframe,script,style,[data-oe-model][data-oe-model!="ir.ui.view"]').find('*').addBack()); - to_escape.contents().each(function(){ + to_escape.contents().each(function () { if(this.nodeType == 3) { this.nodeValue = $('
    ').text(this.nodeValue).html(); } diff --git a/addons/web_editor/static/src/js/rte.summernote.js b/addons/web_editor/static/src/js/rte.summernote.js index 094d13340dc..31ee5db72fe 100644 --- a/addons/web_editor/static/src/js/rte.summernote.js +++ b/addons/web_editor/static/src/js/rte.summernote.js @@ -44,14 +44,68 @@ renderer.createPalette = function ($container, options) { return; } - var $color = $container.find('.note-color'); - var html = QWeb.render('web_editor.colorpicker'); - $color.find('.note-color-palette').prepend(html); - var $bg = $color.find('.colorpicker:first button'); - var $fore = $color.find('.colorpicker:last button'); + var $clpicker = $(QWeb.render('web_editor.colorpicker')); - $bg.each(function () { $(this).attr('data-event', 'backColor').attr('data-value', $(this).attr('class')); }); - $fore.each(function () { $(this).attr('data-event', 'foreColor').attr('data-value', $(this).attr('class').replace(/bg-/, 'text-')); }); + $container.find('.colorpicker').each(function (i, picker) { + var $picker = $(picker); + + var $sections = $clpicker.find('.o_colorpicker_section').clone(true); + + var $toggles = $picker.find('.o_colorpicker_section_menu'); + var $tabs = $picker.find('.o_colorpicker_section_tabs'); + var $defaultToggle = $toggles.find('li'); + var $defaultTab = $tabs.find('.tab-pane'); + + var newDefaultID = _.uniqueId(); + $defaultToggle.children('a').attr('href', $defaultToggle.children('a').attr('href') + newDefaultID); + $defaultTab.attr('id', $defaultTab.attr('id') + newDefaultID); + + if ($sections.length) { + $sections.each(function () { + var $section = $(this); + var id = 'o_palette_' + $section.data('name') + _.uniqueId(); + + var $li = $('
  • ') + .append($('', {href: '#' + id}) + .append($('', {'class': $section.data('iconClass') || '', html: $section.data('iconContent') || ''}))); + $defaultToggle.before($li); + + $defaultTab.before($section.addClass('tab-pane').attr('id', id)); + }); + } else { + var id = 'o_palette_other' + _.uniqueId(); + + var $li = $('
  • ') + .append($('', {href: '#' + id, 'aria-controls': id}) + .append($('', {'class': 'fa fa-magic'}))); + $toggles.prepend($li); + + $tabs.prepend($('
    ', {'class': 'tab-pane', id: id}).append($clpicker.clone(true))); + } + + $toggles.find('li:first-child').addClass('active'); + $tabs.find('div:first-child').addClass('active'); + + $toggles.on('click mouseover', '> li > a', function (e) { + e.preventDefault(); + e.stopPropagation(); + $(this).tab('show'); + }); + }); + + var $bg = $container.find('.o_background_toggle .dropdown-menu button'); + var $fore = $container.find('.o_foreground_toggle .dropdown-menu button'); + + $bg.each(function () { + var $el = $(this); + var className = $el.hasClass('note-color-btn')? $el.attr('title') : ('bg-' + $el.data('color')); + $el.attr('data-event', 'backColor').attr('data-value', className).addClass(className); + }); + $fore.each(function () { + var $el = $(this); + var className = $el.hasClass('note-color-btn')? $el.attr('title') : ('text-' + $el.data('color')); + $el.attr('data-event', 'foreColor').attr('data-value', className).addClass(className); + }); }; var fn_tplPopovers = renderer.tplPopovers; @@ -79,7 +133,7 @@ renderer.tplPopovers = function (lang, options) { var $alt = $('
    '); $alt.prependTo($imagePopover.find('.popover-content')); - $alt.append(''); + $alt.append(''); // padding button var $padding = $('
    '); @@ -144,7 +198,7 @@ renderer.tplPopovers = function (lang, options) { $imagePopover.find('.popover-content').append($airPopover.find(".note-history").clone()); $imagePopover.find('[data-event="showImageDialog"]').before($airPopover.find('[data-event="showLinkDialog"]').clone()); - + //////////////// link popover $linkPopover.find('.popover-content').append($airPopover.find(".note-history").clone()); @@ -343,7 +397,7 @@ eventHandler.modules.editor.imageShape = function ($editable, sValue) { eventHandler.modules.linkDialog.showLinkDialog = function ($editable, $dialog, linkInfo) { $editable.data('range').select(); $editable.data('NoteHistory').recordUndo(); - + var editor = new widgets.LinkDialog($editable, linkInfo); editor.appendTo(document.body); @@ -586,7 +640,7 @@ function summernote_mousedown (event) { rte.history.splitNext(); var $editable = $(event.target).closest(".o_editable, .note-editor"); - + if (!!document.documentMode) { summernote_ie_fix(event, function (node) { return node.tagName === "DIV" || node.tagName === "IMG" || (node.dataset && node.dataset.oeModel); }); } else if (last_div && event.target !== last_div) { @@ -698,22 +752,39 @@ eventHandler.attach = function (oLayoutInfo, options) { $(document).on('mousedown', summernote_mousedown); $(document).on('mouseup', summernote_mouseup); oLayoutInfo.editor().off('click').on('click', function (e) {e.preventDefault();}); // if the content editable is a link - oLayoutInfo.editor().on('dblclick', 'img, .media_iframe_video, span.fa, i.fa, span.fa, a.o_image', function (event) { + var imageSelector = 'img, .media_iframe_video, span.fa, i.fa, span.fa, a.o_image'; + var show_tooltip = true; + oLayoutInfo.editor().on('dblclick', imageSelector, function (event) { + show_tooltip = false; if (!$(event.target).closest(".note-toolbar").length) { // prevent icon edition of top bar for default summernote new widgets.MediaDialog(oLayoutInfo.editor(), event.target).appendTo(document.body); } }); + oLayoutInfo.editor().on('click', imageSelector, function (event) { + if (!$(event.target).closest(".note-toolbar").length) { // prevent icon edition of top bar for default summernote + setTimeout(function () { + if (show_tooltip) { + $(event.target).tooltip({title: _t('Double-click to edit'), trigger: 'manuel', container: 'body'}).tooltip('show'); + setTimeout(function () { + $(event.target).tooltip('destroy'); + }, 800); + } + }, 400); + show_tooltip = true; + } + }); if(oLayoutInfo.editor().is('[data-oe-model][data-oe-type="image"]')) { oLayoutInfo.editor().on('click', 'img', function (event) { $(event.target).trigger("dblclick"); }); } - oLayoutInfo.editable().on('mousedown', function(e) { + oLayoutInfo.editable().on('mousedown', function (e) { if(dom.isImg(e.target)) { range.createFromNode(e.target).select(); } }); $(document).on("keyup", reRangeSelectKey); + var clone_data = false; var $node = oLayoutInfo.editor(); if ($node.data('oe-model') || $node.data('oe-translation-id')) { @@ -867,7 +938,7 @@ $.summernote.lang.odoo = { recent: _t('Recent Color'), more: _t('More Color'), background: _t('Background Color'), - foreground: _t('Foreground Color'), + foreground: _t('Font Color'), transparent: _t('Transparent'), setTransparent: _t('Set transparent'), reset: _t('Reset'), diff --git a/addons/web_editor/static/src/js/snippets.animation.js b/addons/web_editor/static/src/js/snippets.animation.js index bb67d026e3c..f396bafcc30 100644 --- a/addons/web_editor/static/src/js/snippets.animation.js +++ b/addons/web_editor/static/src/js/snippets.animation.js @@ -43,7 +43,7 @@ var start = function (editable_mode, $target) { else continue; } - $(selector).each(function() { + $(selector).each(function () { var $snipped_id = $(this); if ( !$snipped_id.parents("#oe_snippets").length && !$snipped_id.parent("body").length && @@ -58,7 +58,7 @@ var start = function (editable_mode, $target) { }; var stop = function () { - $(ready).each(function() { + $(ready).each(function () { var $snipped_id = $(this); if ($snipped_id.data("snippet-view")) { $snipped_id.data("snippet-view").stop(); diff --git a/addons/web_editor/static/src/js/snippets.editor.js b/addons/web_editor/static/src/js/snippets.editor.js index 79db510bf6a..ef033dc07f3 100644 --- a/addons/web_editor/static/src/js/snippets.editor.js +++ b/addons/web_editor/static/src/js/snippets.editor.js @@ -18,7 +18,7 @@ var dummy = editor.dummy; ajax.loadXML('/web_editor/static/src/xml/snippets.xml', qweb); editor.Class.include({ - init: function() { + init: function () { var self = this; var res = this._super.apply(this, arguments); var $editable = this.rte.editable(); @@ -46,10 +46,10 @@ editor.Class.include({ /* ----- SNIPPET SELECTOR ---- */ $.extend($.expr[':'],{ - hasData: function(node,i,m){ + hasData: function (node,i,m) { return !!_.toArray(node.dataset).length; }, - data: function(node,i,m){ + data: function (node,i,m) { return $(node).data(m[3]); } }); @@ -75,28 +75,23 @@ $.fn.extend({ /* ----- BuildingBlock (managment of drag&drop and focus/blur snippets) ---- */ var BuildingBlock = Widget.extend({ - template: 'web_editor.snippets', + id: "oe_snippets", activeSnippets: [], init: function (parent, $editable) { this.parent = parent; this.$editable = $editable; this._super.apply(this, arguments); - if(!$('#oe_manipulators').length){ - $("
    ").appendTo('body'); + if(!$('#oe_manipulators').length) { + $("
    ", {id: "oe_manipulators", 'class': "o_css_editor"}).appendTo('body'); } this.$active_snipped_id = false; this.snippets = []; data.instance = this; }, - start: function() { + start: function () { var self = this; - this.$snippet = $("#oe_snippets"); - - this.$el - .on("mouseenter", function () { self.show(); }) - .on("mouseleave", function (event) { if (event.clientX>0 && event.clientY>0) self.hide(); }); $(window).resize(function () { setTimeout('$(document).click()',0); @@ -130,8 +125,7 @@ var BuildingBlock = Widget.extend({ self.$active_snipped_id.data("snippet-editor").$overlay.addClass('o_keypress'); } if ((event.metaKey || (event.ctrlKey && !event.altKey)) && event.shiftKey && event.keyCode >= 48 && event.keyCode <= 57) { - self.$snippet.find('.scroll:first > ul li:eq('+(event.keyCode-49)+') a').trigger("click"); - self.show(); + self.$('.scroll:first > ul li:eq('+(event.keyCode-49)+') a').trigger("click"); event.preventDefault(); } }); @@ -188,22 +182,19 @@ var BuildingBlock = Widget.extend({ var self = this; var url = this._get_snippet_url(); if (!url || !url.length) { - this.$snippet.detach(); + this.$el.detach(); return; } - this.$el.find("#o_left_bar").addClass("hidden"); return ajax.jsonRpc(url, 'call', {}).then(function (html) { self.compute_snippet_templates(html); self.trigger("snippets:ready"); }, function () { - self.$snippet.hide(); console.warn('Snippets template not found:', url); }); }, compute_snippet_templates: function (html) { var self = this; var $html = $(html); - var $left_bar = this.$el.find("#o_left_bar"); var $ul = $html.siblings("ul"); var $scroll = $html.siblings("#o_scroll"); @@ -309,16 +300,14 @@ var BuildingBlock = Widget.extend({ // hide scroll if no snippets defined if (!number) { - this.$snippet.detach(); - } else { - this.$el.find("#o_left_bar").removeClass("hidden"); + this.$el.detach(); } $("body").toggleClass("editor_has_snippets", !!number); // select all default text to edit (if snippet default text) self.$snippets.find('.oe_snippet_body, .oe_snippet_body *') .contents() - .filter(function() { + .filter(function () { return this.nodeType === 3 && this.textContent.match(/\S/); }).parent().addClass("o_default_snippet_text"); $(document).on("mouseup", ".o_default_snippet_text", function (event) { @@ -328,7 +317,6 @@ var BuildingBlock = Widget.extend({ var r = $.summernote.core.range.create(); $(r && r.sc).closest(".o_default_snippet_text").removeClass("o_default_snippet_text"); }); - // end // clean t-oe $html.find('[data-oe-model], [data-oe-type]').each(function () { @@ -339,14 +327,13 @@ var BuildingBlock = Widget.extend({ } } }); - // end $html.find('.o_not_editable').attr("contentEditable", false); - $left_bar.html($html); + this.$el.html($html); // animate for list of snippet blocks - $left_bar.on('click', '.scroll-link', function (event) { + this.$el.on('click', '.scroll-link', function (event) { event.preventDefault(); var targetOffset = $($(this).attr("href")).position().top - $ul.outerHeight() + $scroll[0].scrollTop; $scroll.animate({'scrollTop': targetOffset}, 750); @@ -367,55 +354,33 @@ var BuildingBlock = Widget.extend({ } $(last).addClass("active"); }); - // end - - // display scrollbar - $(window).on('resize', function () { - $scroll.css("overflow", ""); - var height = $left_bar.height() - $ul.outerHeight(); - $scroll.css("height", height); - var $last = $scroll.children(":visible").last().children(".o_panel_body"); - $last.css({'min-height': (height-$last.prev().outerHeight())+'px'}); - if ($scroll[0].scrollHeight + $ul[0].scrollHeight > document.body.clientHeight) { - $scroll.css("overflow", "auto").css("width", "226px"); - } else { - $scroll.css("width", ""); - } - }).trigger('resize'); - // end self.make_snippet_draggable(self.$snippets); }, - cover_target: function ($el, $target){ - if($el.data('not-cover_target')) return; + cover_target: function ($el, $target) { + if ($el.data('not-cover_target')) { + return; + } var pos = $target.offset(); var mt = parseInt($target.css("margin-top") || 0); var mb = parseInt($target.css("margin-bottom") || 0); - var width = $target.outerWidth(); - var bigger = pos.left+width > $("body").outerWidth()-8; $el.css({ - 'width': width, - 'top': pos.top - mt - 5, - 'left': pos.left-1 + width: $target.outerWidth(), + left: pos.left, + top: pos.top - mt, }); - $el.find(".oe_handle.e,.oe_handle.w").css({'height': $target.outerHeight() + mt + mb+1}); - if (bigger) { - $el.find(".oe_handle.e").css({right: 0, margin: 0}) - .find("div").css({right: 0, left: 'auto'}); - } else { - $el.find(".oe_handle.e").css({right: "", margin: ""}) - .find("div").css({right: "", left: ""}); - } - $el.find(".oe_handle.s").css({'top': $target.outerHeight() + mt + mb}); - $el.find(".oe_handle.size").css({'top': $target.outerHeight() + mt}); - $el.find(".oe_handle.s,.oe_handle.n").css({'width': width-2}); + $el.find('.oe_handles').css({ + height: $target.outerHeight(true), + }); + + $el.toggleClass('o_top_cover', pos.top <= (this.$('#o_scroll').position().top + 15)); }, show_blocks: function () { var self = this; var cache = {}; - this.$snippet.find(".o_panel").each(function () { + this.$(".o_panel").each(function () { var catcheck = false; var $category = $(this); $category.find(".oe_snippet_body").each(function () { @@ -450,15 +415,6 @@ var BuildingBlock = Widget.extend({ $('#oe_snippets .scroll a[data-toggle="tab"][href="#' + $category.attr("id") + '"]').toggle(catcheck); }); }, - show: function () { - var self = this; - this.make_active(false); - this.$el.addClass("o_open"); - this.show_blocks(); - }, - hide: function () { - this.$el.removeClass("o_open"); - }, bind_snippet_click_editor: function () { var self = this; var snipped_event_flag; @@ -541,7 +497,7 @@ var BuildingBlock = Widget.extend({ this.cover_target($snippet.data('overlay'), $snippet); this.snippet_focus($snippet); } - this.$snippet.trigger('snippet-activated', $snippet); + this.$el.trigger('snippet-activated', $snippet); if ($snippet) { $snippet.trigger('snippet-activated', $snippet); } @@ -554,7 +510,7 @@ var BuildingBlock = Widget.extend({ }, // activate drag and drop for the snippets in the snippet toolbar - make_snippet_draggable: function($snippets){ + make_snippet_draggable: function ($snippets) { var self = this; var $tumb = $snippets.find(".oe_snippet_thumbnail_img:first"); var left = $tumb.outerWidth()/2; @@ -572,8 +528,7 @@ var BuildingBlock = Widget.extend({ 'left': left, 'top': top }, - start: function(){ - self.hide(); + start: function () { dropped = false; // snippet_selectors => to get drop-near, drop-in $snippet = $(this); @@ -602,23 +557,25 @@ var BuildingBlock = Widget.extend({ return; } + self.make_active(false); self.activate_insertion_zones($selector_siblings, $selector_children); $('.oe_drop_zone').droppable({ - over: function(){ + over: function () { dropped = true; - $(this).first().after($toInsert); + $(this).first().after($toInsert).addClass('hidden'); }, - out: function(){ + out: function () { var prev = $toInsert.prev(); - if(this === prev[0]){ + if(this === prev[0]) { dropped = false; $toInsert.detach(); + $(this).removeClass('hidden'); } - } + }, }); }, - stop: function(ev, ui){ + stop: function (ev, ui) { $toInsert.removeClass('oe_snippet_body'); if (! dropped && self.$editable.find('.oe_drop_zone') && ui.position.top > 3) { @@ -658,7 +615,7 @@ var BuildingBlock = Widget.extend({ $target = $toInsert; setTimeout(function () { - self.$snippet.trigger('snippet-dropped', $target); + self.$el.trigger('snippet-dropped', $target); animation.start(true, $target); @@ -693,8 +650,8 @@ var BuildingBlock = Widget.extend({ }, // return the original snippet in the editor bar from a snippet id (string) - get_snippet_from_id: function(id){ - return $('.oe_snippet').filter(function(){ + get_snippet_from_id: function (id) { + return $('.oe_snippet').filter(function () { return $(this).data('option') === id; }).first(); }, @@ -704,12 +661,12 @@ var BuildingBlock = Widget.extend({ // in case the selected elements have children themselves, dropzones will be interleaved // with them. // selector.siblings -> will insert drop zones after and before selected elements - activate_insertion_zones: function($selector_siblings, $selector_children){ + activate_insertion_zones: function ($selector_siblings, $selector_children) { var self = this; - var zone_template = $("
    "); + var zone_template = $("
    "); if ($selector_children) { - $selector_children.each(function (){ + $selector_children.each(function () { var $zone = $(this); var css = window.getComputedStyle(this); var float = css.float || css.cssFloat; @@ -719,7 +676,7 @@ var BuildingBlock = Widget.extend({ var node = $drop[0].previousSibling; var test = !!(node && ((!node.tagName && node.textContent.match(/\S/)) || node.tagName === "BR")); if (test) { - $drop.addClass("oe_vertical oe_vertical_text").css({ + $drop.addClass("oe_vertical").css({ 'height': parseInt(window.getComputedStyle($zone[0]).lineHeight), 'float': 'none', 'display': 'inline-block' @@ -734,7 +691,7 @@ var BuildingBlock = Widget.extend({ var node = $drop[0].nextSibling; var test = !!(node && ((!node.tagName && node.textContent.match(/\S/)) || node.tagName === "BR")); if (test) { - $drop.addClass("oe_vertical oe_vertical_text").css({ + $drop.addClass("oe_vertical").css({ 'height': parseInt(window.getComputedStyle($zone[0]).lineHeight), 'float': 'none', 'display': 'inline-block' @@ -752,20 +709,20 @@ var BuildingBlock = Widget.extend({ } if ($selector_siblings) { - $selector_siblings.filter(':not(.oe_drop_zone):not(.oe_drop_clone)').each(function (){ + $selector_siblings.filter(':not(.oe_drop_zone):not(.oe_drop_clone)').each(function () { var $zone = $(this); var $drop; var css = window.getComputedStyle(this); var float = css.float || css.cssFloat; - if($zone.prev('.oe_drop_zone:visible').length === 0){ + if($zone.prev('.oe_drop_zone:visible').length === 0) { $drop = zone_template.clone(); if (float === "left" || float === "right") { $drop.addClass("oe_vertical").css('height', Math.max(Math.min($zone.outerHeight(), $zone.prev().outerHeight() || Infinity), 30)); } $zone.before($drop); } - if($zone.next('.oe_drop_zone:visible').length === 0){ + if($zone.next('.oe_drop_zone:visible').length === 0) { $drop = zone_template.clone(); if (float === "left" || float === "right") { $drop.addClass("oe_vertical").css('height', Math.max(Math.min($zone.outerHeight(), $zone.next().outerHeight() || Infinity), 30)); @@ -785,7 +742,7 @@ var BuildingBlock = Widget.extend({ // Cleaning consecutive zone and up zones placed between floating or inline elements. We do not like these kind of zones. var $zones = self.$editable.find('.oe_drop_zone:not(.oe_vertical)'); - $zones.each(function (){ + $zones.each(function () { var zone = $(this); var prev = zone.prev(); var next = zone.next(); @@ -799,12 +756,12 @@ var BuildingBlock = Widget.extend({ var disp_prev = prev.css('display') || null; var disp_next = next.css('display') || null; if( (float_prev === 'left' || float_prev === 'right') - && (float_next === 'left' || float_next === 'right') ){ + && (float_next === 'left' || float_next === 'right') ) { zone.remove(); }else if( !( disp_prev === null || disp_next === null || disp_prev === 'block' - || disp_next === 'block' )){ + || disp_next === 'block' )) { zone.remove(); } }); @@ -812,21 +769,21 @@ var BuildingBlock = Widget.extend({ // generate drop zones covering the elements selected by the selector // we generate overlay drop zones only to get an idea of where the snippet are, the drop - activate_overlay_zones: function($targets){ + activate_overlay_zones: function ($targets) { var self = this; - function is_visible($el){ + function is_visible($el) { return $el.css('display') != 'none' && $el.css('opacity') != '0' && $el.css('visibility') != 'hidden'; } // filter out invisible elements - $targets = $targets.filter(function(){ return is_visible($(this)); }); + $targets = $targets.filter(function () { return is_visible($(this)); }); // filter out elements with invisible parents - $targets = $targets.filter(function(){ - var parents = $(this).parents().filter(function(){ return !is_visible($(this)); }); + $targets = $targets.filter(function () { + var parents = $(this).parents().filter(function () { return !is_visible($(this)); }); return parents.length === 0; }); @@ -839,7 +796,7 @@ var BuildingBlock = Widget.extend({ if (document.body && document.body.addEventListener) { $zone.on("click mousedown mousedown", function passThrough(event) { event.preventDefault(); - $target.each(function() { + $target.each(function () { // check if clicked point (taken from event) is inside element event.srcElement = this; $(this).trigger(event.type); @@ -849,8 +806,8 @@ var BuildingBlock = Widget.extend({ } $zone.appendTo('#oe_manipulators'); - $zone.data('target',$target); - $target.data('overlay',$zone); + $zone.data('target', $target); + $target.data('overlay', $zone); var timer; $target.closest('.o_editable').on("content_changed", function (event) { @@ -890,7 +847,7 @@ var Editor = Class.extend({ }, // activate drag and drop for the snippets in the snippet toolbar - _drag_and_drop: function(){ + _drag_and_drop: function () { var self = this; this.dropped = false; this.$overlay.draggable({ @@ -902,7 +859,7 @@ var Editor = Class.extend({ left: 18, top: 14 }, - helper: function() { + helper: function () { var $clone = $(this).clone().css({width: "24px", height: "24px", border: 0}); $clone.find(".oe_overlay_options >:not(:contains(.oe_snippet_move)), .oe_handle").remove(); $clone.find(":not(.glyphicon)").css({position: 'absolute', top: 0, left: 0}); @@ -913,25 +870,24 @@ var Editor = Class.extend({ stop: _.bind(self._drag_and_drop_stop, self) }); }, - _drag_and_drop_after_insert_dropzone: function (){}, - _drag_and_drop_active_drop_zone: function ($zones){ + _drag_and_drop_after_insert_dropzone: function () {}, + _drag_and_drop_active_drop_zone: function ($zones) { var self = this; $zones.droppable({ - over: function(){ + over: function () { $(".oe_drop_zone.hide").removeClass("hide"); $(this).addClass("hide").first().after(self.$target); self.dropped = true; }, - out: function(){ + out: function () { $(this).removeClass("hide"); self.$target.detach(); self.dropped = false; }, }); }, - _drag_and_drop_start: function (){ + _drag_and_drop_start: function () { var self = this; - self.buildingBlock.hide(); self.buildingBlock.editor_busy = true; self.size = { width: self.$target.width(), @@ -952,6 +908,7 @@ var Editor = Class.extend({ else $selector_children = $selector_children.add(self.selector_children[i].all()); } + self.buildingBlock.make_active(false); self.buildingBlock.activate_insertion_zones($selector_siblings, $selector_children); $("body").addClass('move-important'); @@ -959,7 +916,7 @@ var Editor = Class.extend({ self._drag_and_drop_after_insert_dropzone(); self._drag_and_drop_active_drop_zone($('.oe_drop_zone')); }, - _drag_and_drop_stop: function (){ + _drag_and_drop_stop: function () { var self = this; var $dropzone = this.$target.prev(); var prev = $dropzone.length && $dropzone[0].previousSibling; @@ -984,7 +941,7 @@ var Editor = Class.extend({ $parent.prepend(this.$target); } - for (var i in this.styles){ + for (var i in this.styles) { this.styles[i].on_move(); } } @@ -992,9 +949,9 @@ var Editor = Class.extend({ self.buildingBlock.editor_busy = false; self.get_parent_block(); - setTimeout(function () { + _.defer(function () { self.buildingBlock.cover_target(self.$target.data('overlay'), self.$target); - },0); + }); }, load_style_options: function () { @@ -1071,7 +1028,7 @@ var Editor = Class.extend({ this.$target.after($clone); this.buildingBlock.call_for_all_snippets($clone, function (editor, $snippet) { - for (var i in editor.styles){ + for (var i in editor.styles) { editor.styles[i].on_clone($snippet); } }); @@ -1086,7 +1043,7 @@ var Editor = Class.extend({ var index = _.indexOf(this.buildingBlock.snippets, this.$target.get(0)); this.buildingBlock.call_for_all_snippets(this.$target, function (editor, $snippet) { - for (var i in editor.styles){ + for (var i in editor.styles) { editor.styles[i].on_remove(); } }); @@ -1120,7 +1077,7 @@ var Editor = Class.extend({ * (after the insertion of this.$body, if this.$body exists) */ drop_and_build_snippet: function () { - for (var i in this.styles){ + for (var i in this.styles) { this.styles[i].drop_and_build_snippet(); } }, @@ -1130,7 +1087,7 @@ var Editor = Class.extend({ */ on_focus : function () { this.$overlay.addClass('oe_active'); - for (var i in this.styles){ + for (var i in this.styles) { this.styles[i].on_focus(); } }, @@ -1139,7 +1096,7 @@ var Editor = Class.extend({ * This method is called when the user click outside the snippet in the dom, after a focus */ on_blur : function () { - for (var i in this.styles){ + for (var i in this.styles) { this.styles[i].on_blur(); } this.$overlay.removeClass('oe_active'); diff --git a/addons/web_editor/static/src/js/snippets.options.js b/addons/web_editor/static/src/js/snippets.options.js index 04477f3b768..811d0e9c175 100644 --- a/addons/web_editor/static/src/js/snippets.options.js +++ b/addons/web_editor/static/src/js/snippets.options.js @@ -1,546 +1,747 @@ odoo.define('web_editor.snippets.options', function (require) { -'use strict'; + 'use strict'; -var Class = require('web.Class'); -var ajax = require('web.ajax'); -var core = require('web.core'); -var base = require('web_editor.base'); -var editor = require('web_editor.editor'); -var widget = require('web_editor.widget'); -var animation = require('web_editor.snippets.animation'); + var Class = require('web.Class'); + var ajax = require('web.ajax'); + var core = require('web.core'); + var Dialog = require('web.Dialog'); + var base = require('web_editor.base'); + var editor = require('web_editor.editor'); + var widget = require('web_editor.widget'); + var animation = require('web_editor.snippets.animation'); -var qweb = core.qweb; + var qweb = core.qweb; + var _t = core._t; -/* ----- Editor option (object link the the xml with data-js) ---- */ + /* ----- Editor option (object link the the xml with data-js) ---- */ -var Option = Class.extend({ - // initialisation (don't overwrite) - init: function (BuildingBlock, editor, $target, option_id) { - this.buildingBlock = BuildingBlock; - this.editor = editor; - this.$target = $target; - var option = this.buildingBlock.templateOptions[option_id]; - 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.option= option_id; - this.$el = option.$el.find(">li").clone(); - this.data = option.$el.data(); - }, + var SnippetOption = Class.extend({ + // initialisation (don't overwrite) + init: function (BuildingBlock, editor, $target, option_id) { + this.buildingBlock = BuildingBlock; + this.editor = editor; + this.$target = $target; + var option = this.buildingBlock.templateOptions[option_id]; + 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.option= option_id; + this.$el = option.$el.find(">li").clone(); + this.data = option.$el.data(); + }, - // helper for this.$target.find - $: function (selector) { - return this.$target(selector); - }, + // helper for this.$target.find + $: function (selector) { + return this.$target(selector); + }, - _bind_li_menu: function () { - this.$el.filter("li:hasData").find('a:first') - .off('mouseenter click') - .on('mouseenter click', _.bind(this._mouse, this)); + _bind_li_menu: function () { + this.$el.filter("li:hasData").find('a:first') + .off('mouseenter click') + .on('mouseenter click', _.bind(this._mouse, this)); - this.$el - .off('mouseenter click', "li:hasData a") - .on('mouseenter click', "li:hasData a", _.bind(this._mouse, this)); + this.$el + .off('mouseenter click', "li:hasData a") + .on('mouseenter click', "li:hasData a", _.bind(this._mouse, this)); - this.$el.closest("ul").add(this.$el) - .off('mouseleave') - .on('mouseleave', _.bind(this.reset, this)); + this.$el.closest("ul").add(this.$el) + .off('mouseleave') + .on('mouseleave', _.bind(this.reset, this)); - this.$el - .off('mouseleave', "ul") - .on('mouseleave', "ul", _.bind(this.reset, this)); + this.$el + .off('mouseleave', "ul") + .on('mouseleave', "ul", _.bind(this.reset, this)); - this.reset_methods = []; - }, + this.reset_methods = []; + }, - /** - * this method handles mouse:over and mouse:leave on the snippet editor menu - */ - _time_mouseleave: null, - _mouse: function (event) { - var $next = $(event.currentTarget).parent(); + /** + * this method handles mouse:over and mouse:leave on the snippet editor menu + */ + _time_mouseleave: null, + _mouse: function (event) { + var $next = $(event.currentTarget).parent(); - // triggers preview or apply methods if a menu item has been clicked - this.select(event.type === "click" ? "click" : "over", $next); - if (event.type === 'click') { + // triggers preview or apply methods if a menu item has been clicked + this.select(event.type === "click" ? "click" : "over", $next); + if (event.type === 'click') { + this.set_active(); + this.$target.trigger("snippet-option-change", [this]); + } else { + this.$target.trigger("snippet-option-preview", [this]); + } + }, + /* + * select and set item active or not (add highlight item and his parents) + * called before start + */ + set_active: function () { + var classes = _.uniq((this.$target.attr("class") || '').split(/\s+/)); + this.$el.find('[data-toggle_class], [data-select_class]') + .add(this.$el) + .filter('[data-toggle_class], [data-select_class]') + .removeClass("active") + .filter('[data-toggle_class="' + classes.join('"], [data-toggle_class="') + '"] ,'+ + '[data-select_class="' + classes.join('"], [data-select_class="') + '"]') + .addClass("active"); + }, + + start: function () { this.set_active(); - this.$target.trigger("snippet-option-change", [this]); - } else { - this.$target.trigger("snippet-option-preview", [this]); - } - }, - /* - * select and set item active or not (add highlight item and his parents) - * called before start - */ - set_active: function () { - var classes = _.uniq((this.$target.attr("class") || '').split(/\s+/)); - this.$el.find('[data-toggle_class], [data-select_class]') - .add(this.$el) - .filter('[data-toggle_class], [data-select_class]') - .removeClass("active") - .filter('[data-toggle_class="' + classes.join('"], [data-toggle_class="') + '"] ,'+ - '[data-select_class="' + classes.join('"], [data-select_class="') + '"]') - .addClass("active"); - }, + this.$target.on('snippet-option-reset', _.bind(this.set_active, this)); + this._bind_li_menu(); + }, - start: function () { - this.set_active(); - this.$target.on('snippet-option-reset', _.bind(this.set_active, this)); - this._bind_li_menu(); - }, + on_focus : function () { + this._bind_li_menu(); + }, - on_focus : function () { - this._bind_li_menu(); - }, + on_blur : function () { + }, - on_blur : function () { - }, + on_clone: function ($clone) { + }, - on_clone: function ($clone) { - }, + on_move: function () { + }, - on_move: function () { - }, + on_remove: function () { + }, - on_remove: function () { - }, + drop_and_build_snippet: function () { + }, - drop_and_build_snippet: function () { - }, + reset: function () { + var self = this; + var lis = self.$el.add(self.$el.find('li')).filter('.active').get(); + lis.reverse(); + _.each(lis, function (li) { + var $li = $(li); + for (var k in self.reset_methods) { + var method = self.reset_methods[k]; + if ($li.is('[data-'+method+']') || $li.closest('[data-'+method+']').size()) { + delete self.reset_methods[k]; + } + } + self.select("reset", $li); + }); - reset: function () { - var self = this; - var lis = self.$el.add(self.$el.find('li')).filter('.active').get(); - lis.reverse(); - _.each(lis, function (li) { - var $li = $(li); for (var k in self.reset_methods) { var method = self.reset_methods[k]; - if ($li.is('[data-'+method+']') || $li.closest('[data-'+method+']').size()) { - delete self.reset_methods[k]; + if (method) { + self[method]("reset", null); } } - self.select("reset", $li); - }); + self.reset_methods = []; + self.$target.trigger("snippet-option-reset", [this]); + }, - for (var k in self.reset_methods) { - var method = self.reset_methods[k]; - if (method) { - self[method]("reset", null); + // call data-method args as method (data-only can be used) + select: function (type, $li) { + var self = this, + $methods = [], + el = $li[0]; + + if ($li.data('only') && type !== $li.data('only')) { + return; } - } - self.reset_methods = []; - self.$target.trigger("snippet-option-reset", [this]); - }, - // call data-method args as method (data-only can be used) - select: function (type, $li) { - var self = this, - $methods = [], - el = $li[0]; - - if ($li.data('only') && type !== $li.data('only')) { - return; - } - - if (type==="click") { - this.reset(); - this.buildingBlock.parent.rte.historyRecordUndo(this.$target); - } - - function filter (k) { return k !== 'oeId' && k !== 'oeModel' && k !== 'oeField' && k !== 'oeXpath' && k !== 'oeSourceId' && k !== 'only';} - function hasData(el) { - for (var k in el.dataset) { - if (filter (k)) { - return true; - } + if (type==="click") { + this.reset(); + this.buildingBlock.parent.rte.historyRecordUndo(this.$target); } - return false; - } - function method(el) { - var data = {}; - for (var k in el.dataset) { - if (filter (k)) { - data[k] = el.dataset[k]; - } - } - return data; - } - while (el && this.$el.is(el) || _.some(this.$el.map(function () {return $.contains(this, el);}).get()) ) { - if (hasData(el)) { - $methods.push(el); - } - el = el.parentNode; - } - - $methods.reverse(); - - _.each($methods, function (el) { - var $el = $(el); - var methods = method(el); - - for (var k in methods) { - if (self[k]) { - if (type !== "reset" && self.reset_methods.indexOf(k) === -1) { - self.reset_methods.push(k); + function filter (k) { return k !== 'oeId' && k !== 'oeModel' && k !== 'oeField' && k !== 'oeXpath' && k !== 'oeSourceId' && k !== 'only';} + function hasData(el) { + for (var k in el.dataset) { + if (filter (k)) { + return true; } - self[k](type, methods[k], $el); + } + return false; + } + function method(el) { + var data = {}; + for (var k in el.dataset) { + if (filter (k)) { + data[k] = el.dataset[k]; + } + } + return data; + } + + while (el && this.$el.is(el) || _.some(this.$el.map(function () {return $.contains(this, el);}).get()) ) { + if (hasData(el)) { + $methods.push(el); + } + el = el.parentNode; + } + + $methods.reverse(); + + _.each($methods, function (el) { + var $el = $(el); + var methods = method(el); + + for (var k in methods) { + if (self[k]) { + if (type !== "reset" && self.reset_methods.indexOf(k) === -1) { + self.reset_methods.push(k); + } + self[k](type, methods[k], $el); + } else { + console.error("'"+self.option+"' snippet have not method '"+k+"'"); + } + } + }); + }, + + // default method for snippet + toggle_class: function (type, value, $li) { + var $lis = this.$el.find('[data-toggle_class]').add(this.$el).filter('[data-toggle_class]'); + + function map ($lis) { + return $lis.map(function () {return $(this).data("toggle_class");}).get().join(" "); + } + var classes = map($lis); + var active_classes = map($lis.filter('.active, :has(.active)')); + + this.$target.removeClass(classes); + this.$target.addClass(active_classes); + + if (type !== 'reset') { + this.$target.toggleClass(value); + } + }, + select_class: function (type, value, $li) { + var $lis = this.$el.find('[data-select_class]').add(this.$el).filter('[data-select_class]'); + + var classes = $lis.map(function () {return $(this).data('select_class');}).get(); + + this.$target.removeClass(classes.join(" ")); + if(value) this.$target.addClass(value); + }, + eval: function (type, value, $li) { + var fn = new Function("node", "type", "value", "$li", value); + fn.call(this, this, type, value, $li); + }, + + clean_for_save: editor.dummy + }); + var registry = {}; + + /* ----- default options ---- */ + + // to remove after 9.0 (keep for compatibility without update with -u) + registry.media = SnippetOption.extend({ + start: function () { + var self =this; + this._super(); + animation.start(true, this.$target); + this.$target.closest(".o_editable").on("content_changed", function () { + if (!self.$target.parent().length) { + self.$target.remove(); + self.$overlay.remove(); + } + }); + }, + edition: function (type, value) { + if(type !== "click") return; + var self = this; + var _editor = new widget.MediaDialog(this.$target.closest('.o_editable'), this.$target[0]); + _editor.appendTo(document.body); + _editor.on('saved', this, function (item, old) { + self.editor.on_blur(); + self.buildingBlock.make_active(false); + if (self.$target.parent().data("oe-field") !== "image") { + setTimeout(function () { + self.buildingBlock.make_active($(item)); + },0); + } + $(item).trigger("content_changed"); + }); + }, + on_focus : function () { + var self = this; + var $parent = this.$target.parent(); + + if ($parent.data("oe-field") === "image" && $parent.hasClass('o_editable')) { + this.$overlay.addClass("hidden"); + self.edition('click', null); + self.buildingBlock.make_active(false); + } + } + }); + + registry.colorpicker = SnippetOption.extend({ + start: function () { + var self = this; + var res = this._super(); + + if (!this.$el.find('.colorpicker').length) { + var $pt = $(qweb.render('web_editor.snippet.option.colorpicker')); + var $clpicker = $(qweb.render('web_editor.colorpicker')); + + var $toggles = $pt.find('.o_colorpicker_section_menu'); + var $tabs = $pt.find('.o_colorpicker_section_tabs'); + + var $sections = $clpicker.find('.o_colorpicker_section'); + if ($sections.length) { + $sections.each(function () { + var $section = $(this); + var id = 'o_palette_' + $section.data('name') + _.uniqueId(); + + var $li = $('
  • ') + .append($('', {href: '#' + id}) + .append($('', {'class': $section.data('iconClass') || '', html: $section.data('iconContent') || ''}))); + $toggles.append($li); + + $tabs.append($section.addClass('tab-pane').attr('id', id)); + }); + $toggles.find('li').first().addClass('active'); + $tabs.find('div').first().addClass('active'); + + $toggles.on('click mouseover', '> li > a', function (e) { + e.preventDefault(); + e.stopPropagation(); + $(this).tab('show'); + }); } else { - console.error("'"+self.option+"' snippet have not method '"+k+"'"); + $toggles.parent().empty().append($clpicker); } + + this.$el.find('li').append($pt); } - }); - }, - - // default method for snippet - toggle_class: function (type, value, $li) { - var $lis = this.$el.find('[data-toggle_class]').add(this.$el).filter('[data-toggle_class]'); - - function map ($lis) { - return $lis.map(function () {return $(this).data("toggle_class");}).get().join(" "); - } - var classes = map($lis); - var active_classes = map($lis.filter('.active, :has(.active)')); - - this.$target.removeClass(classes); - this.$target.addClass(active_classes); - - if (type !== 'reset') { - this.$target.toggleClass(value); - } - }, - select_class: function (type, value, $li) { - var $lis = this.$el.find('[data-select_class]').add(this.$el).filter('[data-select_class]'); - - var classes = $lis.map(function () {return $(this).data('select_class');}).get(); - - this.$target.removeClass(classes.join(" ")); - if(value) this.$target.addClass(value); - }, - eval: function (type, value, $li) { - var fn = new Function("node", "type", "value", "$li", value); - fn.call(this, this, type, value, $li); - }, - - clean_for_save: editor.dummy -}); - -/* ----- default options ---- */ - -// to remove after 9.0 (keep for compatibility without update with -u) -var media = Option.extend({ - start: function () { - var self =this; - this._super(); - animation.start(true, this.$target); - this.$target.closest(".o_editable").on("content_changed", function () { - if (!self.$target.parent().length) { - self.$target.remove(); - self.$overlay.remove(); + if (this.$el.data('area')) { + this.$target = this.$target.find(this.$el.data('area')); + this.$el.removeData('area').removeAttr('area'); } - }); - }, - edition: function (type, value) { - if(type !== "click") return; - var self = this; - var _editor = new widget.MediaDialog(this.$target.closest('.o_editable'), this.$target[0]); - _editor.appendTo(document.body); - _editor.on('saved', this, function (item, old) { - self.editor.on_blur(); - self.buildingBlock.make_active(false); - if (self.$target.parent().data("oe-field") !== "image") { - setTimeout(function () { - self.buildingBlock.make_active($(item)); - },0); - } - $(item).trigger("content_changed"); - }); - }, - on_focus : function () { - var self = this; - var $parent = this.$target.parent(); - if ($parent.data("oe-field") === "image" && $parent.hasClass('o_editable')) { - this.$overlay.addClass("hidden"); - self.edition('click', null); - self.buildingBlock.make_active(false); - } - } -}); + var classes = []; + this.$el.find(".colorpicker button").map(function () { + var $color = $(this); + var className = 'bg-' + $color.data('color'); -var colorpicker = Option.extend({ - start: function () { - var self = this; - var res = this._super(); + $color.addClass(className); - if (!this.$el.find('.colorpicker').length) { - this.$el.find('li').append( qweb.render('web_editor.colorpicker') ); - } - if (this.$el.data('area')) { - this.$target = this.$target.find(this.$el.data('area')); - this.$el.removeData('area').removeAttr('area'); - } - - var classes = []; - this.$el.find(".colorpicker button").map(function () { - var $color = $(this); - var color = $color.attr("class"); - if (self.$target.hasClass(color)) { - self.color = color; - $color.parent().addClass("selected"); - } - classes.push(color); - }); - this.classes = classes.join(" "); - - this.bind_events(); - return res; - }, - bind_events: function () { - var self = this; - var $td = this.$el.find(".colorpicker td"); - var $colors = this.$el.find(".colorpicker button"); - $colors - .mouseenter(function () { - self.$target.removeClass(self.classes).addClass($(this).attr("class")); - }) - .mouseleave(function () { - self.$target.removeClass(self.classes) - .addClass($td.filter(".selected").children().attr("class")); - }) - .click(function () { - $td.removeClass("selected"); - $(this).parent().addClass("selected"); - self.$target.closest(".o_editable").trigger("content_changed"); - }); - } -}); - -var background = Option.extend({ - start: function ($change_target) { - this.$target = $change_target || this.$target; - this._super(); - var src = this.$target.css("background-image").replace(/url\(['"]*|['"]*\)|^none$/g, ""); - if (this.$target.hasClass('oe_custom_bg')) { - this.$el.find('li[data-choose_image]').data("background", src).attr("data-background", src); - } - }, - background: function(type, value, $li) { - if (value && value.length) { - this.$target.attr("style", 'background-image: url(' + value + '); ' + (this.$target.attr("style") || '').replace(/background-image:[^;]+/, '') ); - this.$target.addClass("oe_img_bg"); - } else { - this.$target.css("background-image", ""); - this.$target.removeClass("oe_img_bg").removeClass("oe_custom_bg"); - } - }, - select_class : function(type, value, $li) { - this.background(type, '', $li); - this._super(type, value, $li); - }, - choose_image: function(type, value, $li) { - if(type !== "click") return; - - var self = this; - var $image = $(''); - $image.attr("src", value); - $image.appendTo(self.$target); - - var _editor = new widget.MediaDialog(null, $image[0]); - _editor.appendTo(document.body); - _editor.$('[href="#editor-media-video"], [href="#editor-media-icon"]').addClass('hidden'); - - _editor.on('saved', self, function () { - var value = $image.attr("src"); - $image.remove(); - self.$el.find('li[data-choose_image]').data("background", value).attr("data-background", value); - self.background(type, value,$li); - self.$target.addClass('oe_custom_bg'); - self.$target.trigger("snippet-option-change", [self]); - self.set_active(); - }); - _editor.on('cancel', self, function () { - $image.remove(); - }); - }, - set_active: function () { - var self = this; - var src = this.$target.css("background-image").replace(/url\(['"]*|['"]*\)|^none$/g, ""); - this._super(); - - if (this.$target.hasClass('oe_custom_bg')) { - this.$el.find('li[data-choose_image]').data("background", src).attr("data-background", src); - } - - this.$el.find('li[data-background]:not([data-background=""])') - .removeClass("active") - .each(function () { - var background = $(this).data("background") || $(this).attr("data-background"); - if ((src.length && background.length && src.indexOf(background) !== -1) || (!src.length && !background.length)) { - $(this).addClass("active"); + if (self.$target.hasClass(className)) { + self.color = className; + $color.addClass("selected"); } + classes.push(className); }); + this.classes = classes.join(" "); - if (!this.$el.find('li[data-background].active').size()) { - this.$el.find('li[data-background=""]:not([data-choose_image])').addClass("active"); - } else { - this.$el.find('li[data-background=""]:not([data-choose_image])').removeClass("active"); - } - } -}); - -/* t-field options */ - -var many2one = Option.extend({ - start: function () { - var self = this; - - this.Model = this.$target.data('oe-many2one-model'); - this.ID = +this.$target.data('oe-many2one-id'); - - // create search button and bind search bar - this.$btn = $(qweb.render("web_editor.many2one.button")) - .insertAfter(this.$overlay.find('.oe_options')); - - this.$ul = this.$btn.find("ul"); - this.$search = this.$ul.find('li:first'); - this.$search.find('input').on('mousedown click mouseup keyup keydown', function (e) { - e.stopPropagation(); - }); - - // move menu item - setTimeout(function () { - if (self.$overlay.find('.oe_options').hasClass('hidden')) { - self.$btn.css('height', '0').find('> a').addClass('hidden'); - self.$ul.show().css({ - 'top': '-24px', 'margin': '0', 'padding': '2px 0', 'position': 'relative' + this.bind_events(); + return res; + }, + bind_events: function () { + var self = this; + var $colors = this.$el.find(".colorpicker button"); + $colors + .mouseenter(function () { + self.$target.removeClass(self.classes).addClass('bg-' + $(this).data("color")); + }) + .mouseleave(function () { + self.$target.removeClass(self.classes) + .addClass('bg-' + $colors.filter(".selected").data("color")); + }) + .click(function () { + $colors.removeClass("selected"); + $(this).addClass("selected"); + self.$target.closest(".o_editable").trigger("content_changed"); }); - } else { - self.$btn.find('a').on('click', function (e) { - self.clear(); - }); - } - },0); - // bind search input - this.$search.find('input') - .focus() - .on('keyup', function(e) { - self.find_existing($(this).val()); + this.$el.find('.note-color-reset').on('click', function () { + self.$target.removeClass(self.classes); }); - - // bind result - this.$ul.on('click', "li:not(:first) a", function (e) { - self.select_record(this); - }); - }, - - on_focus: function () { - this.$target.attr('contentEditable', 'false'); - this.clear(); - this._super(); - }, - - clear: function () { - var self = this; - this.$search.siblings().remove(); - self.$search.find('input').val(""); - setTimeout(function () { - self.$search.find('input').focus(); - },0); - }, - - find_existing: function (name) { - var self = this; - var domain = []; - if (!name || !name.length) { - self.$search.siblings().remove(); - return; } - if (isNaN(+name)) { - if (this.Model !== "res.partner") { - domain.push(['name', 'ilike', name]); + }); + + registry.background = SnippetOption.extend({ + start: function ($change_target) { + this.$target = $change_target || this.$target; + this._super(); + var src = this.$target.css("background-image").replace(/url\(['"]*|['"]*\)|^none$/g, ""); + if (this.$target.hasClass('oe_custom_bg')) { + this.$el.find('li[data-choose_image]').data("background", src).attr("data-background", src); + } + }, + background: function (type, value, $li) { + if (value && value.length) { + this.$target.attr("style", 'background-image: url(' + value + '); ' + (this.$target.attr("style") || '').replace(/background-image:[^;]+/, '') ); + this.$target.addClass("oe_img_bg"); } else { - domain.push('|', ['name', 'ilike', name], ['email', 'ilike', name]); + this.$target.css("background-image", ""); + this.$target.removeClass("oe_img_bg oe_custom_bg"); } - } else { - domain.push(['id', '=', name]); - } + }, + select_class : function (type, value, $li) { + this.background(type, '', $li); + this._super(type, value, $li); + }, + choose_image: function (type, value, $li) { + if(type !== "click") return; - ajax.jsonRpc('/web/dataset/call_kw', 'call', { - model: this.Model, - method: 'search_read', - args: [domain, this.Model === "res.partner" ? ['name', 'display_name', 'city', 'country_id'] : ['name', 'display_name']], - kwargs: { - order: 'name DESC', - limit: 5, - context: base.get_context(), + var self = this; + var $image = $(''); + $image.attr("src", value); + $image.appendTo(self.$target); + + var _editor = new widget.MediaDialog(null, $image[0]); + _editor.appendTo(document.body); + _editor.$('[href="#editor-media-video"], [href="#editor-media-icon"]').addClass('hidden'); + + _editor.on('saved', self, function () { + var value = $image.attr("src"); + $image.remove(); + self.$el.find('li[data-choose_image]').data("background", value).attr("data-background", value); + self.background(type, value,$li); + self.$target.addClass('oe_custom_bg'); + self.$target.trigger("snippet-option-change", [self]); + self.set_active(); + }); + _editor.on('cancel', self, function () { + $image.remove(); + }); + }, + set_active: function () { + var self = this; + var src = this.$target.css("background-image").replace(/url\(['"]*|['"]*\)|^none$/g, ""); + this._super(); + + if (this.$target.hasClass('oe_custom_bg')) { + this.$el.find('li[data-choose_image]').data("background", src).attr("data-background", src); } - }).then(function (result){ - self.$search.siblings().remove(); - self.$search.after(qweb.render("web_editor.many2one.search",{contacts:result})); - }); - }, - get_contact_rendering: function (options) { - return ajax.jsonRpc('/web/dataset/call_kw', 'call', { - model: 'ir.qweb.field.contact', - method: 'get_record_to_html', - args: [[this.ID]], - kwargs: { - options: options, - context: base.get_context(), - } - }); - }, - - select_record: function (li) { - var self = this; - - this.ID = +$(li).data("id"); - this.$target.attr('data-oe-many2one-id', this.ID).data('oe-many2one-id', this.ID); - - this.buildingBlock.parent.rte.historyRecordUndo(this.$target); - this.$target.trigger('content_changed'); - - if (self.$target.data('oe-type') === "contact") { - $('[data-oe-contact-options]') - .filter('[data-oe-model="'+self.$target.data('oe-model')+'"]') - .filter('[data-oe-id="'+self.$target.data('oe-id')+'"]') - .filter('[data-oe-field="'+self.$target.data('oe-field')+'"]') - .filter('[data-oe-contact-options!="'+self.$target.data('oe-contact-options')+'"]') - .add(self.$target) - .attr('data-oe-many2one-id', self.ID).data('oe-many2one-id', self.ID) + this.$el.find('li[data-background]:not([data-background=""])') + .removeClass("active") .each(function () { - var $node = $(this); - self.get_contact_rendering($node.data('oe-contact-options')) - .then(function (html){ - $node.html(html); - }); + var background = $(this).data("background") || $(this).attr("data-background"); + if ((src.length && background.length && src.indexOf(background) !== -1) || (!src.length && !background.length)) { + $(this).addClass("active"); + } }); - } else { - self.$target.html($(li).data("name")); + + if (!this.$el.find('li[data-background].active').size()) { + this.$el.find('li[data-background=""]:not([data-choose_image])').addClass("active"); + } else { + this.$el.find('li[data-background=""]:not([data-choose_image])').removeClass("active"); + } } + }); - setTimeout(function () { - self.buildingBlock.make_active(false); - },0); - } -}); - -/* end*/ - -return { - 'registry': { - 'media': media, - 'colorpicker': colorpicker, - 'background': background, - 'many2one': many2one, - }, - 'Class': Option -}; - + registry.background_position = SnippetOption.extend({ + start: function () { + var self = this; + var $btn = this.$overlay.find('.oe_options'); + $btn.on('show.bs.dropdown', function () { + if (self.$target.css('background-image') === 'none') { + $btn.find('.background_position_li').addClass('hidden'); + } else { + $btn.find('.background_position_li').removeClass('hidden'); + } + }); + }, + background_position: function (type, value, $li) { + if (type != 'click') { return; } + var self = this; + + this.previous_state = [this.$target.attr('class'), this.$target.css('background-size'), this.$target.css('background-position')]; + + this.bg_pos = self.$target.css('background-position').split(' '); + this.bg_siz = self.$target.css('background-size').split(' '); + + this.modal = new Dialog(null, { + title: _t("Background Image Options"), + $content: $(qweb.render('web_editor.dialog.background_position')), + buttons: [ + {text: _t("Ok"), classes: "btn-primary", close: true, click: _.bind(this.save, this)}, + {text: _t("Discard"), close: true, click: _.bind(this.discard, this)}, + ], + }).open(); + + this.modal.opened().then(function () { + // Fetch data form $target + var value = ((self.$target.hasClass('o_bg_img_opt_contain'))? 'contain' : ((self.$target.hasClass('o_bg_img_opt_custom'))? 'custom' : 'cover')); + self.modal.$("> label > input[value=" + value + "]").prop('checked', true); + + if(self.$target.hasClass("o_bg_img_opt_repeat")) { + self.modal.$("#o_bg_img_opt_contain_repeat").prop('checked', true); + self.modal.$("#o_bg_img_opt_custom_repeat").val('o_bg_img_opt_repeat'); + } else if (self.$target.hasClass("o_bg_img_opt_repeat_x")) { + self.modal.$("#o_bg_img_opt_custom_repeat").val('o_bg_img_opt_repeat_x'); + } else if (self.$target.hasClass("o_bg_img_opt_repeat_y")) { + self.modal.$("#o_bg_img_opt_custom_repeat").val('o_bg_img_opt_repeat_y'); + } + + if(self.bg_pos.length > 1) { + self.bg_pos = { + x: self.bg_pos[0], + y: self.bg_pos[1], + }; + self.modal.$("#o_bg_img_opt_custom_pos_x").val(self.bg_pos.x.replace('%', '')); + self.modal.$("#o_bg_img_opt_custom_pos_y").val(self.bg_pos.y.replace('%', '')); + } + if(self.bg_siz.length > 1) { + self.modal.$("#o_bg_img_opt_custom_size_x").val(self.bg_siz[0].replace('%', '')); + self.modal.$("#o_bg_img_opt_custom_size_y").val(self.bg_siz[1].replace('%', '')); + } + + // Focus Point + self.$focus = self.modal.$(".o_focus_point"); + self.update_pos_information(); + + var img_url = /\(['"]?([^'"]+)['"]?\)/g.exec(self.$target.css('background-image')); + img_url = (img_url && img_url[1]) || ''; + var $img = $('', {'class': 'img img-responsive', src: img_url}); + $img.on('load', function () { + self.bind_img_events($img); + }); + $img.prependTo(self.modal.$(".o_bg_img_opt_object")); + + // Bind events + self.modal.$el.on('change', '> label > input', function (e) { + self.modal.$('> .o_bg_img_opt').addClass('o_hidden') + .filter("[data-value=" + e.target.value + "]") + .removeClass('o_hidden'); + }); + self.modal.$el.on('change', 'input, select', function (e) { + self.save(); + }); + self.modal.$("> label > input:checked").trigger('change'); + }); + }, + bind_img_events: function ($img) { + var self = this; + + var mousedown = false; + $img.on('mousedown', function (e) { + mousedown = true; + }); + $img.on('mousemove', function (e) { + if (mousedown) { + _update(e); + } + }); + $img.on('mouseup', function (e) { + self.$focus.addClass('o_with_transition'); + _update(e); + setTimeout(function () { + self.$focus.removeClass('o_with_transition'); + }, 200); + mousedown = false; + }); + + function _update(e) { + var posX = e.pageX - $(e.target).offset().left; + var posY = e.pageY - $(e.target).offset().top; + self.bg_pos = { + x: clip_value(posX/$img.width()*100).toFixed(2) + '%', + y: clip_value(posY/$img.height()*100).toFixed(2) + '%', + }; + self.update_pos_information(); + self.save(); + } + + function clip_value(value) { + return Math.max(0, Math.min(value, 100)); + } + }, + update_pos_information: function () { + this.modal.$(".o_bg_img_opt_ui_info .o_x").text(this.bg_pos.x); + this.modal.$(".o_bg_img_opt_ui_info .o_y").text(this.bg_pos.y); + this.$focus.css({ + left: this.bg_pos.x, + top: this.bg_pos.y, + }); + }, + save: function () { + this.clean(); + + var bg_img_size = this.modal.$('> :not(label):not(.o_hidden)').data('value') || 'cover'; + switch (bg_img_size) { + case "cover": + this.$target.css('background-position', this.bg_pos.x + ' ' + this.bg_pos.y); + break; + case "contain": + this.$target.addClass('o_bg_img_opt_contain'); + this.$target.toggleClass('o_bg_img_opt_repeat', this.modal.$("#o_bg_img_opt_contain_repeat").prop("checked")); + break; + case "custom": + this.$target.addClass('o_bg_img_opt_custom'); + var sizeX = this.modal.$("#o_bg_img_opt_custom_size_x").val(); + var sizeY = this.modal.$("#o_bg_img_opt_custom_size_y").val(); + var posX = this.modal.$("#o_bg_img_opt_custom_pos_x").val(); + var posY = this.modal.$("#o_bg_img_opt_custom_pos_y").val(); + this.$target.addClass(this.modal.$("#o_bg_img_opt_custom_repeat").val()) + .css({ + 'background-size': ((sizeX)? sizeX + '%' : 'auto') + " " + ((sizeY)? sizeY + '%' : 'auto'), + 'background-position': ((posX)? posX + '%' : 'auto') + " " + ((posY)? posY + '%' : 'auto'), + }); + break; + } + }, + discard: function () { + this.clean(); + if (this.previous_state) { + this.$target.addClass(this.previous_state[0]).css({ + 'background-size': this.previous_state[1], + 'background-position': this.previous_state[2], + }); + } + }, + clean: function () { + this.$target.removeClass('o_bg_img_opt_contain o_bg_img_opt_custom o_bg_img_opt_repeat o_bg_img_opt_repeat_x o_bg_img_opt_repeat_y') + .css({ + 'background-size': '', + 'background-position': '', + }); + }, + }); + + /* t-field options */ + + registry.many2one = SnippetOption.extend({ + start: function () { + var self = this; + + this.Model = this.$target.data('oe-many2one-model'); + this.ID = +this.$target.data('oe-many2one-id'); + + // create search button and bind search bar + this.$btn = $(qweb.render("web_editor.many2one.button")) + .insertAfter(this.$overlay.find('.oe_options')); + + this.$ul = this.$btn.find("ul"); + this.$search = this.$ul.find('li:first'); + this.$search.find('input').on('mousedown click mouseup keyup keydown', function (e) { + e.stopPropagation(); + }); + + // move menu item + setTimeout(function () { + if (self.$overlay.find('.oe_options').hasClass('hidden')) { + self.$btn.css('height', '0').find('> a').addClass('hidden'); + self.$ul.show().css({ + 'top': '-24px', 'margin': '0', 'padding': '2px 0', 'position': 'relative' + }); + } else { + self.$btn.find('a').on('click', function (e) { + self.clear(); + }); + } + },0); + + // bind search input + this.$search.find('input') + .focus() + .on('keyup', function (e) { + self.find_existing($(this).val()); + }); + + // bind result + this.$ul.on('click', "li:not(:first) a", function (e) { + self.select_record(this); + }); + }, + + on_focus: function () { + this.$target.attr('contentEditable', 'false'); + this.clear(); + this._super(); + }, + + clear: function () { + var self = this; + this.$search.siblings().remove(); + self.$search.find('input').val(""); + setTimeout(function () { + self.$search.find('input').focus(); + },0); + }, + + find_existing: function (name) { + var self = this; + var domain = []; + if (!name || !name.length) { + self.$search.siblings().remove(); + return; + } + if (isNaN(+name)) { + if (this.Model !== "res.partner") { + domain.push(['name', 'ilike', name]); + } else { + domain.push('|', ['name', 'ilike', name], ['email', 'ilike', name]); + } + } else { + domain.push(['id', '=', name]); + } + + ajax.jsonRpc('/web/dataset/call_kw', 'call', { + model: this.Model, + method: 'search_read', + args: [domain, this.Model === "res.partner" ? ['name', 'display_name', 'city', 'country_id'] : ['name', 'display_name']], + kwargs: { + order: 'name DESC', + limit: 5, + context: base.get_context(), + } + }).then(function (result) { + self.$search.siblings().remove(); + self.$search.after(qweb.render("web_editor.many2one.search",{contacts:result})); + }); + }, + + get_contact_rendering: function (options) { + return ajax.jsonRpc('/web/dataset/call_kw', 'call', { + model: 'ir.qweb.field.contact', + method: 'get_record_to_html', + args: [[this.ID]], + kwargs: { + options: options, + context: base.get_context(), + } + }); + }, + + select_record: function (li) { + var self = this; + + this.ID = +$(li).data("id"); + this.$target.attr('data-oe-many2one-id', this.ID).data('oe-many2one-id', this.ID); + + this.buildingBlock.parent.rte.historyRecordUndo(this.$target); + this.$target.trigger('content_changed'); + + if (self.$target.data('oe-type') === "contact") { + $('[data-oe-contact-options]') + .filter('[data-oe-model="'+self.$target.data('oe-model')+'"]') + .filter('[data-oe-id="'+self.$target.data('oe-id')+'"]') + .filter('[data-oe-field="'+self.$target.data('oe-field')+'"]') + .filter('[data-oe-contact-options!="'+self.$target.data('oe-contact-options')+'"]') + .add(self.$target) + .attr('data-oe-many2one-id', self.ID).data('oe-many2one-id', self.ID) + .each(function () { + var $node = $(this); + self.get_contact_rendering($node.data('oe-contact-options')) + .then(function (html) { + $node.html(html); + }); + }); + } else { + self.$target.html($(li).data("name")); + } + + setTimeout(function () { + self.buildingBlock.make_active(false); + },0); + } + }); + + return { + registry: registry, + Class: SnippetOption, + }; }); diff --git a/addons/web_editor/static/src/js/summernote.js b/addons/web_editor/static/src/js/summernote.js index e4d1c5b27c4..5c9e86dc8df 100644 --- a/addons/web_editor/static/src/js/summernote.js +++ b/addons/web_editor/static/src/js/summernote.js @@ -210,7 +210,7 @@ dom.merge = function (node, begin, so, end, eo, mergeFilter, all) { while(end.lastChild) {end = end.lastChild;} eo = end.textContent.length-1; } else if (end.tagName) { - + } else if (end.tagName && end.childNodes[so]) { end = end.childNodes[so]; so = 0; @@ -234,7 +234,7 @@ dom.merge = function (node, begin, so, end, eo, mergeFilter, all) { if (cur === begin) { if (!all) add = true; } - + __merge(cur); dom.orderClass(dom.node(cur)); @@ -977,7 +977,7 @@ $.summernote.pluginEvents.tab = function (event, editor, layoutInfo, outdent) { $.summernote.pluginEvents.indent(event, editor, layoutInfo); } } else { - if (!outdent){ + if (!outdent) { if(dom.isText(r.sc)) { var next = r.sc.splitText(r.so); } else { @@ -1501,7 +1501,7 @@ $.summernote.pluginEvents.backspace = function (event, editor, layoutInfo) { dom.removeSpace(temp2.parentNode, temp2, 0, temp, 0); // clean before jump for not select invisible space between 2 tag temp2 = dom.lastChild(temp2); - + r = range.create(temp2, temp2.textContent.length, temp2, temp2.textContent.length); r.select(); @@ -1880,7 +1880,7 @@ eventHandler.modules.toolbar.button.updateRecentColor = function (elBtn, sEvent, font.className += ' ' + sValue; font.style.backgroundColor = ""; } else { - font.className = font.className.replace(/(^|\s+)bg-\S+/); + font.className = font.className.replace(/(^|\s+)bg-\S+/, ''); font.style.backgroundColor = sValue !== 'inherit' ? sValue : ""; } } @@ -1905,7 +1905,7 @@ eventHandler.modules.editor.redo = function ($popover) { // use image toolbar if current range is on image var fn_editor_currentstyle = eventHandler.modules.editor.currentStyle; -eventHandler.modules.editor.currentStyle = function(target) { +eventHandler.modules.editor.currentStyle = function (target) { var styleInfo = fn_editor_currentstyle.apply(this, arguments); // with our changes for inline editor, the targeted element could be a button of the editor if(!styleInfo.image || !dom.isEditable(styleInfo.image)) { diff --git a/addons/web_editor/static/src/js/tour.rte.js b/addons/web_editor/static/src/js/tour.rte.js index 8c3c494a73f..2d85600e578 100644 --- a/addons/web_editor/static/src/js/tour.rte.js +++ b/addons/web_editor/static/src/js/tour.rte.js @@ -10,7 +10,7 @@ var _t = core._t; base.ready().done(function () { -var click_event = function(el, type) { +var click_event = function (el, type) { var evt = document.createEvent("MouseEvents"); evt.initMouseEvent(type, true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, el); el.dispatchEvent(evt); @@ -61,7 +61,7 @@ Tour.register({ }, { waitFor: '#editable_area > section .row > div:first:not(:has(p font)) h1 font', - element: '.note-color button.dropdown-toggle:visible', + element: '.note-color button.dropdown-toggle:visible:first', title: "change selection to change text color", onload: function () { var $el = $('#editable_area > section .row > div:first:not(:has(p font)) h1 font'); @@ -70,12 +70,17 @@ Tour.register({ } }, { - element: 'div[data-target-event="foreColor"]:visible .note-color-row:eq(1) button[data-event="foreColor"]:first', + title: "Select foreground spectrum colorpanel", + waitFor: ".dropdown-menu:visible", + element: ".dropdown-menu:visible .o_colorpicker_section_menu li:last a", + }, + { + element: ".dropdown-menu:visible .note-color-row:eq(1) button[data-event=foreColor]:first", title: "change text color", }, { waitFor: '#editable_area > section .row > div:first h1 font:eq(2)', - element: '.note-color button.dropdown-toggle:visible', + element: '.note-color button.dropdown-toggle:visible:last', title: "change selection to change text bg-color again", onload: function () { var $el = $('#editable_area > section .row > div:first h1 font:eq(2)'); @@ -84,12 +89,17 @@ Tour.register({ } }, { - element: 'div[data-target-event="backColor"] .colorpicker button[data-event="backColor"]:first', + title: "Select background spectrum colorpanel", + waitFor: ".dropdown-menu:visible", + element: ".dropdown-menu:visible .o_colorpicker_section_menu li:last a", + }, + { + element: ".dropdown-menu:visible .note-color-row:eq(0) button[data-event=backColor]:first", title: "change text backColor again", }, { waitFor: '#editable_area > section .row > div:first h1 font:eq(4)', - element: '.note-color button.dropdown-toggle:visible', + element: '.note-color button.dropdown-toggle:visible:first', title: "change selection (h1 and p) to change text color with class", onload: function () { var $el = $('#editable_area > section .row > div:first h1 font:eq(4)'); @@ -98,7 +108,8 @@ Tour.register({ } }, { - element: 'div[data-target-event="foreColor"]:visible button[data-event="foreColor"][data-value^="text-"]:first', + waitFor: ".dropdown-menu:visible", + element: ".dropdown-menu:visible .note-color-row:eq(0) button[data-event=foreColor]:first", title: "change text foreColor again", }, { @@ -170,7 +181,7 @@ Tour.register({ title: "select a pictogram", }, { - waitFor: '#editor-media-icon.active span.font-icons-selected', + waitFor: '#editor-media-icon.active span.o_selected', element: '.modal button.save', title: "save pictogram", }, @@ -377,7 +388,7 @@ Tour.register({ title: "check the image style", }, { - waitFor: '#wrapwrap img:eq(1)[src^="/web_editor/font_to_img/"][src$="/rgb(66,139,202)/32"]', + waitFor: '#wrapwrap img:eq(1)[src^="/web_editor/font_to_img/"][src$="/rgb(51,122,183)/28"]', title: "check the font image src", }, { @@ -385,7 +396,7 @@ Tour.register({ title: "check the font class to css", }, { - waitFor: '#wrapwrap img:eq(2)[style*="float:right"]', + waitFor: '#wrapwrap img:eq(2)[style*="float: right"]', title: "check the second font class to css", }, ] diff --git a/addons/web_editor/static/src/js/translator.js b/addons/web_editor/static/src/js/translator.js index 39efbe1db2f..6932d5f9ed2 100644 --- a/addons/web_editor/static/src/js/translator.js +++ b/addons/web_editor/static/src/js/translator.js @@ -116,7 +116,6 @@ var Translate = Widget.extend({ }, start: function () { this._super(); - this.$('button[data-action=save]').prop('disabled', true); return this.edit(); }, setTarget: function ($target) { @@ -158,7 +157,7 @@ var Translate = Widget.extend({ }, edit: function () { var flag = false; - window.onbeforeunload = function(event) { + window.onbeforeunload = function (event) { if ($('.o_editable.o_dirty').length && !flag) { flag = true; setTimeout(function () {flag=false;},0); @@ -179,7 +178,6 @@ var Translate = Widget.extend({ var $node = $(node); var trans = this.getTranlationObject($node[0]); $node.toggleClass('o_dirty', trans.value !== $node.html().replace(/[ \t\n\r]+/, ' ')); - this.$('button[data-action=save]').prop('disabled', !$('.o_editable.o_dirty').length); }, getTranlationObject: function (node) { var $node = $(node); diff --git a/addons/web_editor/static/src/js/widgets.js b/addons/web_editor/static/src/js/widgets.js index 165f0b0e914..8db4c66180c 100644 --- a/addons/web_editor/static/src/js/widgets.js +++ b/addons/web_editor/static/src/js/widgets.js @@ -39,8 +39,8 @@ var Dialog = Widget.extend({ close: function () { this.$el.modal('hide'); }, - stop_escape: function(event) { - if($(".modal.in").length>0 && event.which == 27){ + stop_escape: function (event) { + if($(".modal.in").length>0 && event.which == 27) { event.stopPropagation(); } } @@ -72,7 +72,7 @@ var alt = Dialog.extend({ }, }); -var click_event = function(el, type) { +var click_event = function (el, type) { var evt = document.createEvent("MouseEvents"); evt.initMouseEvent(type, true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, el); el.dispatchEvent(evt); @@ -239,14 +239,14 @@ var ImageDialog = Widget.extend({ }, 'click button.filepicker': function () { var filepicker = this.$('input[type=file]'); - if (!_.isEmpty(filepicker)){ + if (!_.isEmpty(filepicker)) { filepicker[0].click(); } }, 'click .js_disable_optimization': function () { this.$('input[name="disable_optimization"]').val('1'); var filepicker = this.$('button.filepicker'); - if (!_.isEmpty(filepicker)){ + if (!_.isEmpty(filepicker)) { filepicker[0].click(); } }, @@ -256,8 +256,8 @@ var ImageDialog = Widget.extend({ 'keyup input.url': "change_input", //'change select.image-style': 'preview_image', 'click .existing-attachments [data-src]': 'select_existing', - 'click .existing-attachment-remove': 'try_remove', - 'keydown.dismiss.bs.modal': function(){}, + 'click .o_existing_attachment_remove': 'try_remove', + 'keydown.dismiss.bs.modal': function () {}, }), init: function (parent, media, options) { this._super(); @@ -417,7 +417,7 @@ var ImageDialog = Widget.extend({ this.$('button.filepicker').removeClass('btn-danger btn-success'); this.$('form').submit(); }, - file_selected: function(attachment, error) { + file_selected: function (attachment, error) { var $button = this.$('button.filepicker'); if (!error) { $button.addClass('btn-success'); @@ -497,14 +497,14 @@ var ImageDialog = Widget.extend({ }, selected_existing: function () { var self = this; - this.$('.existing-attachment-cell.media_selected').removeClass("media_selected"); - var $select = this.$('.existing-attachment-cell [data-src]').filter(function () { + this.$('.o_existing_attachment_cell.o_selected').removeClass("o_selected"); + var $select = this.$('.o_existing_attachment_cell [data-src]').filter(function () { var $img = $(this); return !!_.find(self.images, function (v) { return (v.url === $img.data("src") || ($img.data("url") && v.url === $img.data("url")) || v.id === $img.data("id")); }); }); - $select.closest('.existing-attachment-cell').addClass("media_selected"); + $select.closest('.o_existing_attachment_cell').addClass("o_selected"); return $select; }, try_remove: function (e) { @@ -535,7 +535,7 @@ var ImageDialog = Widget.extend({ var cacheCssSelectors = {}; -var getCssSelectors = function(filter) { +var getCssSelectors = function (filter) { var css = []; if (cacheCssSelectors[filter]) { return cacheCssSelectors[filter]; @@ -580,7 +580,7 @@ var getCssSelectors = function(filter) { } return cacheCssSelectors[filter] = css; }; -var computeFonts = _.once(function() { +var computeFonts = _.once(function () { _.each(fontIcons, function (data) { data.cssData = getCssSelectors(data.parser); data.alias = []; @@ -628,14 +628,14 @@ var fontIconsDialog = Widget.extend({ e.stopPropagation(); this.$('#fa-icon').val(e.target.getAttribute('data-id')); - $(".font-icons-icon").removeClass("font-icons-selected"); - $(e.target).addClass("font-icons-selected"); + $(".font-icons-icon").removeClass("o_selected"); + $(e.target).addClass("o_selected"); }, - 'keydown.dismiss.bs.modal': function(){}, + 'keydown.dismiss.bs.modal': function () {}, }), // extract list of font (like awsome) from the cheatsheet. - renderElement: function() { + renderElement: function () { this.iconsParser = fontIcons; this.icons = _.flatten(_.map(fontIcons, function (data) { return data.icons; @@ -750,7 +750,7 @@ var fontIconsDialog = Widget.extend({ continue; case '': continue; default: - $(".font-icons-icon").removeClass("font-icons-selected").filter("[data-alias*=',"+cls+",']").addClass("font-icons-selected"); + $(".font-icons-icon").removeClass("o_selected").filter("[data-alias*=',"+cls+",']").addClass("o_selected"); for (var k=0; k
  • Document
  • Pictogram
  • Video
  • - - -
    -
    -
    -
    -
    -
    -
    -
    -
    +
    +
    +
    +
    @@ -94,22 +202,24 @@
    - - +
    - +
    - — or — + — or —
    - +
    @@ -121,7 +231,7 @@
    - +
    + -
    - - - + + + $(this).parent().addClass('o_website_modal'); + - - - +
    +