Browse Source

Chooser -> Picker

pull/40/head
Jairo Llopis 9 years ago
parent
commit
21619a3fc9
  1. 4
      website_mail_snippet_bg_color/README.rst
  2. 4
      website_mail_snippet_bg_color/__openerp__.py
  3. 2
      website_mail_snippet_bg_color/i18n/es.po
  4. 0
      website_mail_snippet_bg_color/images/color_picker.png
  5. 8
      website_mail_snippet_bg_color/static/src/js/bg_color_chooser.js
  6. 2
      website_mail_snippet_bg_color/views/assets.xml
  7. 8
      website_mail_snippet_bg_color/views/snippets.xml

4
website_mail_snippet_bg_color/README.rst

@ -3,7 +3,7 @@
:alt: License: AGPL-3 :alt: License: AGPL-3
======================================= =======================================
Email Snippets Background Color Chooser
Email Snippets Background Color Picker
======================================= =======================================
This module extends the functionality of the website mail designer to support This module extends the functionality of the website mail designer to support
@ -18,7 +18,7 @@ To use this module, you need to:
``mass_mailing``. ``mass_mailing``.
#. Edit an email with the website mail designer. #. Edit an email with the website mail designer.
#. Drag & drop any snippet into the mail body. #. Drag & drop any snippet into the mail body.
#. Choose *Customize > Choose Background Color*.
#. Click *Customize > Pick Background Color*.
#. Pick any color, or enter its HTML code in the box, or press *Clear* to #. Pick any color, or enter its HTML code in the box, or press *Clear* to
remove it. remove it.
#. Press OK. #. Press OK.

4
website_mail_snippet_bg_color/__openerp__.py

@ -2,7 +2,7 @@
# © 2016 Antiun Ingeniería S.L. - Jairo Llopis # © 2016 Antiun Ingeniería S.L. - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{ {
"name": "Email Snippets Background Color Chooser",
"name": "Email Snippets Background Color Picker",
"summary": "Set any background color for any mail editor snippet", "summary": "Set any background color for any mail editor snippet",
"version": "8.0.1.0.0", "version": "8.0.1.0.0",
"category": "Marketing", "category": "Marketing",
@ -13,7 +13,7 @@
"installable": True, "installable": True,
"images": [ "images": [
"images/click_option.png", "images/click_option.png",
"images/color_chooser.png",
"images/color_picker.png",
"images/color_set.png", "images/color_set.png",
], ],
"depends": [ "depends": [

2
website_mail_snippet_bg_color/i18n/es.po

@ -19,5 +19,5 @@ msgstr ""
#. module: website_mail_snippet_bg_color #. module: website_mail_snippet_bg_color
#: view:website:website_mail.email_designer_snippets #: view:website:website_mail.email_designer_snippets
msgid "Choose Background Color"
msgid "Pick Background Color"
msgstr "Escoger el color de fondo" msgstr "Escoger el color de fondo"

0
website_mail_snippet_bg_color/images/color_chooser.png → website_mail_snippet_bg_color/images/color_picker.png

Before

Width: 868  |  Height: 496  |  Size: 41 KiB

After

Width: 868  |  Height: 496  |  Size: 41 KiB

8
website_mail_snippet_bg_color/static/src/js/bg_color_chooser.js

@ -5,16 +5,16 @@
(function ($) { (function ($) {
var snippet = openerp.website.snippet; var snippet = openerp.website.snippet;
snippet.options.bg_color_chooser = snippet.Option.extend({
snippet.options.bg_color_picker = snippet.Option.extend({
start: function () { start: function () {
var self = this; var self = this;
self._super(); self._super();
return self.$el.find(".js_bg_color_chooser").click(function(){
return self.choose();
return self.$el.find(".js_bg_color_picker").click(function(){
return self.pick();
}); });
}, },
choose: function() {
pick: function() {
var self = this; var self = this;
return CKEDITOR.instances.wrapwrap.getColorFromDialog( return CKEDITOR.instances.wrapwrap.getColorFromDialog(
function(color){ function(color){

2
website_mail_snippet_bg_color/views/assets.xml

@ -8,7 +8,7 @@
<template id="assets_editor" inherit_id="website.assets_editor"> <template id="assets_editor" inherit_id="website.assets_editor">
<xpath expr="."> <xpath expr=".">
<script type="text/javascript" <script type="text/javascript"
src="/website_mail_snippet_bg_color/static/src/js/bg_color_chooser.js"/>
src="/website_mail_snippet_bg_color/static/src/js/bg_color_picker.js"/>
</xpath> </xpath>
</template> </template>

8
website_mail_snippet_bg_color/views/snippets.xml

@ -9,15 +9,15 @@
inherit_id="website_mail.email_designer_snippets"> inherit_id="website_mail.email_designer_snippets">
<xpath expr="//div[@id='snippet_options']"> <xpath expr="//div[@id='snippet_options']">
<div <div
data-snippet-option-id='bg_color_chooser'
data-snippet-option-id='bg_color_picker'
data-selector="[data-oe-field='body_html'] > div, data-selector="[data-oe-field='body_html'] > div,
.oe_snippet_body, .oe_snippet_body,
.bg_color_chooser"
.bg_color_picker"
data-selector-siblings="[data-oe-field='body_html'] > *" data-selector-siblings="[data-oe-field='body_html'] > *"
data-selector-children="[data-oe-field='body_html']"> data-selector-children="[data-oe-field='body_html']">
<li> <li>
<a href="#" class="button js_bg_color_chooser">
Choose Background Color
<a href="#" class="button js_bg_color_picker">
Pick Background Color
</a> </a>
</li> </li>
</div> </div>

Loading…
Cancel
Save