summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js
diff options
context:
space:
mode:
authorCocographique <nmi@odoo.com>2018-07-25 10:03:30 +0200
committerqsm-odoo <qsm@odoo.com>2018-08-13 18:30:01 +0200
commit4dce6cc98b2b95a00249ac29245305e08f288e6c (patch)
tree43f76425632b4af977339a341e44e401e66e22de /addons/web_editor/static/src/js
parent2623644ba871de1954f2f33fc0caab7643eec93a (diff)
[IMP] website, *: review snippets and colors
* web, web_editor, website_hr_recruitment, website_mail_channel, website_mass_mailing - Review all snippets and add new ones - Add lots of new options - Use odoo colors as default theme colors task-38878
Diffstat (limited to 'addons/web_editor/static/src/js')
-rw-r--r--addons/web_editor/static/src/js/editor/rte.summernote.js2
-rw-r--r--addons/web_editor/static/src/js/editor/snippets.editor.js1
-rw-r--r--addons/web_editor/static/src/js/editor/summernote.js2
-rw-r--r--addons/web_editor/static/src/js/tours/rte.js2
-rw-r--r--addons/web_editor/static/src/js/widgets/widgets.js9
5 files changed, 11 insertions, 5 deletions
diff --git a/addons/web_editor/static/src/js/editor/rte.summernote.js b/addons/web_editor/static/src/js/editor/rte.summernote.js
index 4cd15d4c3d7..e450874b95d 100644
--- a/addons/web_editor/static/src/js/editor/rte.summernote.js
+++ b/addons/web_editor/static/src/js/editor/rte.summernote.js
@@ -286,6 +286,7 @@ eventHandler.modules.popover.button.update = function ($container, oStyle) {
$container.find('button[data-event="imageShape"][data-value="fa-spin"]').toggleClass("active", $(oStyle.image).hasClass("fa-spin"));
$container.find('button[data-event="imageShape"][data-value="shadow"]').toggleClass("active", $(oStyle.image).hasClass("shadow"));
+ $container.find('.btn-group:has(button[data-event="imageShape"])').removeClass("d-none");
} else {
$container.find('.d-none:not(.only_fa, .note-recent-color)').removeClass('d-none');
@@ -1034,6 +1035,7 @@ $.summernote.lang.odoo = {
normal: _t('Normal'),
blockquote: _t('Quote'),
pre: _t('Code'),
+ small: _t('Small'),
h1: _t('Header 1'),
h2: _t('Header 2'),
h3: _t('Header 3'),
diff --git a/addons/web_editor/static/src/js/editor/snippets.editor.js b/addons/web_editor/static/src/js/editor/snippets.editor.js
index e3a8803619a..f5cbb34c802 100644
--- a/addons/web_editor/static/src/js/editor/snippets.editor.js
+++ b/addons/web_editor/static/src/js/editor/snippets.editor.js
@@ -288,7 +288,6 @@ var SnippetEditor = Widget.extend({
option.__order = i++;
return option.attachTo($el);
});
- $ul.append($('<div/>', {class: 'dropdown-divider'}));
var $parents = this.$target.parents();
_.each($parents, function (parent) {
diff --git a/addons/web_editor/static/src/js/editor/summernote.js b/addons/web_editor/static/src/js/editor/summernote.js
index 0ef7881b920..f420f951633 100644
--- a/addons/web_editor/static/src/js/editor/summernote.js
+++ b/addons/web_editor/static/src/js/editor/summernote.js
@@ -1033,7 +1033,7 @@ options.keyMap.mac['ESCAPE'] = 'cancel';
options.keyMap.mac['UP'] = 'up';
options.keyMap.mac['DOWN'] = 'down';
-options.styleTags = ['p', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote'];
+options.styleTags = ['p', 'pre', 'small', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote'];
$.summernote.pluginEvents.insertTable = function (event, editor, layoutInfo, sDim) {
var $editable = layoutInfo.editable();
diff --git a/addons/web_editor/static/src/js/tours/rte.js b/addons/web_editor/static/src/js/tours/rte.js
index 0bd1440e487..b997944a98b 100644
--- a/addons/web_editor/static/src/js/tours/rte.js
+++ b/addons/web_editor/static/src/js/tours/rte.js
@@ -314,7 +314,7 @@ tour.register('rte_inline', {
trigger: '#wrapwrap img:first[width][height][style*="-radius"][style*="1px"][style*="padding"]',
}, {
content: "check the font image src",
- trigger: '#wrapwrap img:eq(1)[src^="/web_editor/font_to_img/"][src$="/rgb(0,123,255)/32"]',
+ trigger: '#wrapwrap img:eq(1)[src^="/web_editor/font_to_img/"][src$="/rgb(0,160,157)/32"]',
}, {
content: "check the font class to css",
trigger: '#wrapwrap img:eq(1)[height]:not([class*="fa"])',
diff --git a/addons/web_editor/static/src/js/widgets/widgets.js b/addons/web_editor/static/src/js/widgets/widgets.js
index 74fbfe18f01..3103dc91505 100644
--- a/addons/web_editor/static/src/js/widgets/widgets.js
+++ b/addons/web_editor/static/src/js/widgets/widgets.js
@@ -1525,10 +1525,15 @@ var LinkDialog = Dialog.extend({
}
var style = this.$('input[name="link_style_color"]:checked').val() || '';
+ var shape = this.$('select[name="link_style_shape"]').val() || '';
var size = this.$('select[name="link_style_size"]').val() || '';
+ var shapes = shape.split(',');
+ var outline = shapes[0] === 'outline';
+ shape = shapes.slice(outline ? 1 : 0).join(' ');
var classes = (this.data.className || '')
- + ((style && style.length) ? (' btn btn-' + style) : '')
- + ((size && size.length) ? (' btn-' + size) : '');
+ + (style ? (' btn btn-' + (outline ? 'outline-' : '') + style) : '')
+ + (shape ? (' ' + shape) : '')
+ + (size ? (' btn-' + size) : '');
var isNewWindow = this.$('input[name="is_new_window"]').prop('checked');
if (url.indexOf('@') >= 0 && url.indexOf('mailto:') < 0 && !url.match(/^http[s]?/i)) {