From 3751379f1e9a4c215fb6eb898b4ccc67659b9ace Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 10 May 2022 21:51:50 +0700 Subject: initial commit 2 --- addons/mass_mailing/static/description/icon.png | Bin 0 -> 10108 bytes addons/mass_mailing/static/description/icon.svg | 1 + .../static/src/css/basic_theme_readonly.css | 7 + .../mass_mailing/static/src/css/email_template.css | 21 + .../static/src/img/blocks/block_banner.png | Bin 0 -> 604 bytes .../src/img/blocks/block_comparison_table.png | Bin 0 -> 171 bytes .../static/src/img/blocks/block_discount1.png | Bin 0 -> 1327 bytes .../static/src/img/blocks/block_discount2.png | Bin 0 -> 1024 bytes .../static/src/img/blocks/block_event.png | Bin 0 -> 821 bytes .../src/img/blocks/block_footer_separator.png | Bin 0 -> 574 bytes .../static/src/img/blocks/block_footer_social.png | Bin 0 -> 1017 bytes .../src/img/blocks/block_footer_social_left.png | Bin 0 -> 722 bytes .../src/img/blocks/block_footer_tag_line.png | Bin 0 -> 648 bytes .../static/src/img/blocks/block_header_browser.png | Bin 0 -> 376 bytes .../static/src/img/blocks/block_header_logo.png | Bin 0 -> 317 bytes .../static/src/img/blocks/block_header_social.png | Bin 0 -> 746 bytes .../src/img/blocks/block_header_text_social.png | Bin 0 -> 730 bytes .../static/src/img/blocks/block_image.png | Bin 0 -> 642 bytes .../static/src/img/blocks/block_image_text.png | Bin 0 -> 622 bytes .../static/src/img/blocks/block_paragraph.png | Bin 0 -> 149 bytes .../static/src/img/blocks/block_steps.png | Bin 0 -> 650 bytes .../static/src/img/blocks/block_text_image.png | Bin 0 -> 611 bytes .../static/src/img/blocks/block_three_cols.png | Bin 0 -> 692 bytes .../static/src/img/blocks/block_title_sub.png | Bin 0 -> 240 bytes .../static/src/img/blocks/block_title_text.png | Bin 0 -> 813 bytes .../static/src/img/blocks/block_two_cols.png | Bin 0 -> 689 bytes .../theme_basic/s_default_image_block_banner.jpg | Bin 0 -> 1522 bytes .../theme_basic/s_default_image_block_event.jpg | Bin 0 -> 1154 bytes .../theme_basic/s_default_image_block_image.jpg | Bin 0 -> 2336 bytes .../s_default_image_block_image_text.jpg | Bin 0 -> 2033 bytes .../s_default_image_block_text_image.jpg | Bin 0 -> 1575 bytes .../s_default_image_block_three_cols_1.jpg | Bin 0 -> 917 bytes .../s_default_image_block_three_cols_2.jpg | Bin 0 -> 917 bytes .../s_default_image_block_three_cols_3.jpg | Bin 0 -> 917 bytes .../s_default_image_block_two_cols_1.jpg | Bin 0 -> 1489 bytes .../s_default_image_block_two_cols_2.jpg | Bin 0 -> 1489 bytes .../src/img/theme_basic/s_default_image_logo.png | Bin 0 -> 4589 bytes .../src/img/theme_default/demo/signature.png | Bin 0 -> 8385 bytes .../theme_default/s_default_image_block_banner.jpg | Bin 0 -> 33832 bytes .../theme_default/s_default_image_block_event.jpg | Bin 0 -> 26456 bytes .../theme_default/s_default_image_block_image.jpg | Bin 0 -> 30662 bytes .../s_default_image_block_image_text.jpg | Bin 0 -> 9522 bytes .../s_default_image_block_text_image.jpg | Bin 0 -> 26381 bytes .../s_default_image_block_three_cols_1.jpg | Bin 0 -> 6598 bytes .../s_default_image_block_three_cols_2.jpg | Bin 0 -> 5645 bytes .../s_default_image_block_three_cols_3.jpg | Bin 0 -> 14684 bytes .../s_default_image_block_two_cols_1.jpg | Bin 0 -> 10341 bytes .../s_default_image_block_two_cols_2.jpg | Bin 0 -> 13659 bytes .../src/img/theme_default/s_default_image_logo.png | Bin 0 -> 1046 bytes .../src/img/theme_imgs/basic_thumb_large.png | Bin 0 -> 11781 bytes .../static/src/img/theme_imgs/basic_thumb_logo.png | Bin 0 -> 909 bytes .../src/img/theme_imgs/basic_thumb_small.png | Bin 0 -> 7771 bytes .../src/img/theme_imgs/default_thumb_large.png | Bin 0 -> 17035 bytes .../src/img/theme_imgs/default_thumb_logo.png | Bin 0 -> 153 bytes .../src/img/theme_imgs/default_thumb_small.png | Bin 0 -> 3058 bytes addons/mass_mailing/static/src/js/mass_mailing.js | 15 + .../static/src/js/mass_mailing_link_dialog_fix.js | 75 +++ .../src/js/mass_mailing_list_kanban_record.js | 18 + .../src/js/mass_mailing_list_kanban_renderer.js | 16 + .../static/src/js/mass_mailing_list_kanban_view.js | 19 + .../static/src/js/mass_mailing_snippets.js | 153 ++++++ .../static/src/js/mass_mailing_widget.js | 520 +++++++++++++++++++++ .../static/src/js/tours/mass_mailing_tour.js | 88 ++++ addons/mass_mailing/static/src/js/unsubscribe.js | 198 ++++++++ .../mass_mailing/static/src/scss/mass_mailing.scss | 50 ++ .../static/src/scss/mass_mailing.ui.jw.scss | 0 .../static/src/scss/mass_mailing.ui.scss | 206 ++++++++ .../static/src/scss/mass_mailing.ui.shadow.scss | 0 .../static/src/scss/mass_mailing_mobile.scss | 7 + .../static/src/scss/themes/theme_basic.scss | 54 +++ .../static/src/scss/themes/theme_default.scss | 307 ++++++++++++ .../mass_mailing/static/src/xml/mass_mailing.xml | 22 + .../static/tests/mass_mailing_html_tests.js | 108 +++++ 73 files changed, 1885 insertions(+) create mode 100644 addons/mass_mailing/static/description/icon.png create mode 100644 addons/mass_mailing/static/description/icon.svg create mode 100644 addons/mass_mailing/static/src/css/basic_theme_readonly.css create mode 100644 addons/mass_mailing/static/src/css/email_template.css create mode 100755 addons/mass_mailing/static/src/img/blocks/block_banner.png create mode 100755 addons/mass_mailing/static/src/img/blocks/block_comparison_table.png create mode 100755 addons/mass_mailing/static/src/img/blocks/block_discount1.png create mode 100755 addons/mass_mailing/static/src/img/blocks/block_discount2.png create mode 100755 addons/mass_mailing/static/src/img/blocks/block_event.png create mode 100755 addons/mass_mailing/static/src/img/blocks/block_footer_separator.png create mode 100755 addons/mass_mailing/static/src/img/blocks/block_footer_social.png create mode 100755 addons/mass_mailing/static/src/img/blocks/block_footer_social_left.png create mode 100755 addons/mass_mailing/static/src/img/blocks/block_footer_tag_line.png create mode 100755 addons/mass_mailing/static/src/img/blocks/block_header_browser.png create mode 100755 addons/mass_mailing/static/src/img/blocks/block_header_logo.png create mode 100755 addons/mass_mailing/static/src/img/blocks/block_header_social.png create mode 100755 addons/mass_mailing/static/src/img/blocks/block_header_text_social.png create mode 100755 addons/mass_mailing/static/src/img/blocks/block_image.png create mode 100755 addons/mass_mailing/static/src/img/blocks/block_image_text.png create mode 100755 addons/mass_mailing/static/src/img/blocks/block_paragraph.png create mode 100755 addons/mass_mailing/static/src/img/blocks/block_steps.png create mode 100755 addons/mass_mailing/static/src/img/blocks/block_text_image.png create mode 100755 addons/mass_mailing/static/src/img/blocks/block_three_cols.png create mode 100755 addons/mass_mailing/static/src/img/blocks/block_title_sub.png create mode 100755 addons/mass_mailing/static/src/img/blocks/block_title_text.png create mode 100755 addons/mass_mailing/static/src/img/blocks/block_two_cols.png create mode 100644 addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_banner.jpg create mode 100644 addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_event.jpg create mode 100644 addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_image.jpg create mode 100644 addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_image_text.jpg create mode 100644 addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_text_image.jpg create mode 100644 addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_three_cols_1.jpg create mode 100644 addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_three_cols_2.jpg create mode 100644 addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_three_cols_3.jpg create mode 100644 addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_two_cols_1.jpg create mode 100644 addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_two_cols_2.jpg create mode 100644 addons/mass_mailing/static/src/img/theme_basic/s_default_image_logo.png create mode 100644 addons/mass_mailing/static/src/img/theme_default/demo/signature.png create mode 100755 addons/mass_mailing/static/src/img/theme_default/s_default_image_block_banner.jpg create mode 100755 addons/mass_mailing/static/src/img/theme_default/s_default_image_block_event.jpg create mode 100755 addons/mass_mailing/static/src/img/theme_default/s_default_image_block_image.jpg create mode 100755 addons/mass_mailing/static/src/img/theme_default/s_default_image_block_image_text.jpg create mode 100755 addons/mass_mailing/static/src/img/theme_default/s_default_image_block_text_image.jpg create mode 100755 addons/mass_mailing/static/src/img/theme_default/s_default_image_block_three_cols_1.jpg create mode 100755 addons/mass_mailing/static/src/img/theme_default/s_default_image_block_three_cols_2.jpg create mode 100755 addons/mass_mailing/static/src/img/theme_default/s_default_image_block_three_cols_3.jpg create mode 100755 addons/mass_mailing/static/src/img/theme_default/s_default_image_block_two_cols_1.jpg create mode 100755 addons/mass_mailing/static/src/img/theme_default/s_default_image_block_two_cols_2.jpg create mode 100755 addons/mass_mailing/static/src/img/theme_default/s_default_image_logo.png create mode 100644 addons/mass_mailing/static/src/img/theme_imgs/basic_thumb_large.png create mode 100644 addons/mass_mailing/static/src/img/theme_imgs/basic_thumb_logo.png create mode 100644 addons/mass_mailing/static/src/img/theme_imgs/basic_thumb_small.png create mode 100644 addons/mass_mailing/static/src/img/theme_imgs/default_thumb_large.png create mode 100644 addons/mass_mailing/static/src/img/theme_imgs/default_thumb_logo.png create mode 100644 addons/mass_mailing/static/src/img/theme_imgs/default_thumb_small.png create mode 100644 addons/mass_mailing/static/src/js/mass_mailing.js create mode 100644 addons/mass_mailing/static/src/js/mass_mailing_link_dialog_fix.js create mode 100644 addons/mass_mailing/static/src/js/mass_mailing_list_kanban_record.js create mode 100644 addons/mass_mailing/static/src/js/mass_mailing_list_kanban_renderer.js create mode 100644 addons/mass_mailing/static/src/js/mass_mailing_list_kanban_view.js create mode 100644 addons/mass_mailing/static/src/js/mass_mailing_snippets.js create mode 100644 addons/mass_mailing/static/src/js/mass_mailing_widget.js create mode 100644 addons/mass_mailing/static/src/js/tours/mass_mailing_tour.js create mode 100644 addons/mass_mailing/static/src/js/unsubscribe.js create mode 100644 addons/mass_mailing/static/src/scss/mass_mailing.scss create mode 100644 addons/mass_mailing/static/src/scss/mass_mailing.ui.jw.scss create mode 100644 addons/mass_mailing/static/src/scss/mass_mailing.ui.scss create mode 100644 addons/mass_mailing/static/src/scss/mass_mailing.ui.shadow.scss create mode 100644 addons/mass_mailing/static/src/scss/mass_mailing_mobile.scss create mode 100644 addons/mass_mailing/static/src/scss/themes/theme_basic.scss create mode 100644 addons/mass_mailing/static/src/scss/themes/theme_default.scss create mode 100644 addons/mass_mailing/static/src/xml/mass_mailing.xml create mode 100644 addons/mass_mailing/static/tests/mass_mailing_html_tests.js (limited to 'addons/mass_mailing/static') diff --git a/addons/mass_mailing/static/description/icon.png b/addons/mass_mailing/static/description/icon.png new file mode 100644 index 00000000..768a9dbb Binary files /dev/null and b/addons/mass_mailing/static/description/icon.png differ diff --git a/addons/mass_mailing/static/description/icon.svg b/addons/mass_mailing/static/description/icon.svg new file mode 100644 index 00000000..b48aed5a --- /dev/null +++ b/addons/mass_mailing/static/description/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addons/mass_mailing/static/src/css/basic_theme_readonly.css b/addons/mass_mailing/static/src/css/basic_theme_readonly.css new file mode 100644 index 00000000..340eec95 --- /dev/null +++ b/addons/mass_mailing/static/src/css/basic_theme_readonly.css @@ -0,0 +1,7 @@ +/* We want to show system's default font in the mail sent with the basic theme. + And so we remove font-family from basic theme while saving. But by doing so + in readonly mode is not getting proper font in odoo. So we added if from here. + */ +#wrapwrap .o_layout.o_basic_theme { + font-family: -apple-system, "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; +} diff --git a/addons/mass_mailing/static/src/css/email_template.css b/addons/mass_mailing/static/src/css/email_template.css new file mode 100644 index 00000000..edd9c0c3 --- /dev/null +++ b/addons/mass_mailing/static/src/css/email_template.css @@ -0,0 +1,21 @@ +.openerp .oe_kanban_email_template { + width: 360px; + height: 340px; +} + +.openerp .oe_kanban_email_template .oe_kanban_content{ + height: 320px; + overflow: hidden !important; +} + +.kanban_html_preview { + pointer-events: none; + width: 600px; + -webkit-transform: scale(.50); + -ms-transform: scale(.50); + transform: scale(.50); + -webkit-transform-origin: 0 0; + -ms-transform-origin: 0 0; + transform-origin: 0 0; + margin: 0; +} diff --git a/addons/mass_mailing/static/src/img/blocks/block_banner.png b/addons/mass_mailing/static/src/img/blocks/block_banner.png new file mode 100755 index 00000000..bcf62bd1 Binary files /dev/null and b/addons/mass_mailing/static/src/img/blocks/block_banner.png differ diff --git a/addons/mass_mailing/static/src/img/blocks/block_comparison_table.png b/addons/mass_mailing/static/src/img/blocks/block_comparison_table.png new file mode 100755 index 00000000..63c810cc Binary files /dev/null and b/addons/mass_mailing/static/src/img/blocks/block_comparison_table.png differ diff --git a/addons/mass_mailing/static/src/img/blocks/block_discount1.png b/addons/mass_mailing/static/src/img/blocks/block_discount1.png new file mode 100755 index 00000000..478d2525 Binary files /dev/null and b/addons/mass_mailing/static/src/img/blocks/block_discount1.png differ diff --git a/addons/mass_mailing/static/src/img/blocks/block_discount2.png b/addons/mass_mailing/static/src/img/blocks/block_discount2.png new file mode 100755 index 00000000..0a14a917 Binary files /dev/null and b/addons/mass_mailing/static/src/img/blocks/block_discount2.png differ diff --git a/addons/mass_mailing/static/src/img/blocks/block_event.png b/addons/mass_mailing/static/src/img/blocks/block_event.png new file mode 100755 index 00000000..4dba58c9 Binary files /dev/null and b/addons/mass_mailing/static/src/img/blocks/block_event.png differ diff --git a/addons/mass_mailing/static/src/img/blocks/block_footer_separator.png b/addons/mass_mailing/static/src/img/blocks/block_footer_separator.png new file mode 100755 index 00000000..6af266fc Binary files /dev/null and b/addons/mass_mailing/static/src/img/blocks/block_footer_separator.png differ diff --git a/addons/mass_mailing/static/src/img/blocks/block_footer_social.png b/addons/mass_mailing/static/src/img/blocks/block_footer_social.png new file mode 100755 index 00000000..41992607 Binary files /dev/null and b/addons/mass_mailing/static/src/img/blocks/block_footer_social.png differ diff --git a/addons/mass_mailing/static/src/img/blocks/block_footer_social_left.png b/addons/mass_mailing/static/src/img/blocks/block_footer_social_left.png new file mode 100755 index 00000000..ee39ed7c Binary files /dev/null and b/addons/mass_mailing/static/src/img/blocks/block_footer_social_left.png differ diff --git a/addons/mass_mailing/static/src/img/blocks/block_footer_tag_line.png b/addons/mass_mailing/static/src/img/blocks/block_footer_tag_line.png new file mode 100755 index 00000000..73b5a29e Binary files /dev/null and b/addons/mass_mailing/static/src/img/blocks/block_footer_tag_line.png differ diff --git a/addons/mass_mailing/static/src/img/blocks/block_header_browser.png b/addons/mass_mailing/static/src/img/blocks/block_header_browser.png new file mode 100755 index 00000000..c05196e7 Binary files /dev/null and b/addons/mass_mailing/static/src/img/blocks/block_header_browser.png differ diff --git a/addons/mass_mailing/static/src/img/blocks/block_header_logo.png b/addons/mass_mailing/static/src/img/blocks/block_header_logo.png new file mode 100755 index 00000000..eae72c93 Binary files /dev/null and b/addons/mass_mailing/static/src/img/blocks/block_header_logo.png differ diff --git a/addons/mass_mailing/static/src/img/blocks/block_header_social.png b/addons/mass_mailing/static/src/img/blocks/block_header_social.png new file mode 100755 index 00000000..43aaec4c Binary files /dev/null and b/addons/mass_mailing/static/src/img/blocks/block_header_social.png differ diff --git a/addons/mass_mailing/static/src/img/blocks/block_header_text_social.png b/addons/mass_mailing/static/src/img/blocks/block_header_text_social.png new file mode 100755 index 00000000..61bb97fd Binary files /dev/null and b/addons/mass_mailing/static/src/img/blocks/block_header_text_social.png differ diff --git a/addons/mass_mailing/static/src/img/blocks/block_image.png b/addons/mass_mailing/static/src/img/blocks/block_image.png new file mode 100755 index 00000000..e918a8d7 Binary files /dev/null and b/addons/mass_mailing/static/src/img/blocks/block_image.png differ diff --git a/addons/mass_mailing/static/src/img/blocks/block_image_text.png b/addons/mass_mailing/static/src/img/blocks/block_image_text.png new file mode 100755 index 00000000..de9e18f3 Binary files /dev/null and b/addons/mass_mailing/static/src/img/blocks/block_image_text.png differ diff --git a/addons/mass_mailing/static/src/img/blocks/block_paragraph.png b/addons/mass_mailing/static/src/img/blocks/block_paragraph.png new file mode 100755 index 00000000..bfba996c Binary files /dev/null and b/addons/mass_mailing/static/src/img/blocks/block_paragraph.png differ diff --git a/addons/mass_mailing/static/src/img/blocks/block_steps.png b/addons/mass_mailing/static/src/img/blocks/block_steps.png new file mode 100755 index 00000000..e977a105 Binary files /dev/null and b/addons/mass_mailing/static/src/img/blocks/block_steps.png differ diff --git a/addons/mass_mailing/static/src/img/blocks/block_text_image.png b/addons/mass_mailing/static/src/img/blocks/block_text_image.png new file mode 100755 index 00000000..c0832ebd Binary files /dev/null and b/addons/mass_mailing/static/src/img/blocks/block_text_image.png differ diff --git a/addons/mass_mailing/static/src/img/blocks/block_three_cols.png b/addons/mass_mailing/static/src/img/blocks/block_three_cols.png new file mode 100755 index 00000000..cd72e7b8 Binary files /dev/null and b/addons/mass_mailing/static/src/img/blocks/block_three_cols.png differ diff --git a/addons/mass_mailing/static/src/img/blocks/block_title_sub.png b/addons/mass_mailing/static/src/img/blocks/block_title_sub.png new file mode 100755 index 00000000..1320ccc5 Binary files /dev/null and b/addons/mass_mailing/static/src/img/blocks/block_title_sub.png differ diff --git a/addons/mass_mailing/static/src/img/blocks/block_title_text.png b/addons/mass_mailing/static/src/img/blocks/block_title_text.png new file mode 100755 index 00000000..399f13c2 Binary files /dev/null and b/addons/mass_mailing/static/src/img/blocks/block_title_text.png differ diff --git a/addons/mass_mailing/static/src/img/blocks/block_two_cols.png b/addons/mass_mailing/static/src/img/blocks/block_two_cols.png new file mode 100755 index 00000000..79e19de0 Binary files /dev/null and b/addons/mass_mailing/static/src/img/blocks/block_two_cols.png differ diff --git a/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_banner.jpg b/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_banner.jpg new file mode 100644 index 00000000..872366f9 Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_banner.jpg differ diff --git a/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_event.jpg b/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_event.jpg new file mode 100644 index 00000000..50a9d033 Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_event.jpg differ diff --git a/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_image.jpg b/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_image.jpg new file mode 100644 index 00000000..047516fe Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_image.jpg differ diff --git a/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_image_text.jpg b/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_image_text.jpg new file mode 100644 index 00000000..59a1806d Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_image_text.jpg differ diff --git a/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_text_image.jpg b/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_text_image.jpg new file mode 100644 index 00000000..0009598d Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_text_image.jpg differ diff --git a/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_three_cols_1.jpg b/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_three_cols_1.jpg new file mode 100644 index 00000000..7a7f2bbd Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_three_cols_1.jpg differ diff --git a/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_three_cols_2.jpg b/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_three_cols_2.jpg new file mode 100644 index 00000000..7a7f2bbd Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_three_cols_2.jpg differ diff --git a/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_three_cols_3.jpg b/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_three_cols_3.jpg new file mode 100644 index 00000000..7a7f2bbd Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_three_cols_3.jpg differ diff --git a/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_two_cols_1.jpg b/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_two_cols_1.jpg new file mode 100644 index 00000000..98ed24c6 Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_two_cols_1.jpg differ diff --git a/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_two_cols_2.jpg b/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_two_cols_2.jpg new file mode 100644 index 00000000..98ed24c6 Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_basic/s_default_image_block_two_cols_2.jpg differ diff --git a/addons/mass_mailing/static/src/img/theme_basic/s_default_image_logo.png b/addons/mass_mailing/static/src/img/theme_basic/s_default_image_logo.png new file mode 100644 index 00000000..064f09c1 Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_basic/s_default_image_logo.png differ diff --git a/addons/mass_mailing/static/src/img/theme_default/demo/signature.png b/addons/mass_mailing/static/src/img/theme_default/demo/signature.png new file mode 100644 index 00000000..36cb2642 Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_default/demo/signature.png differ diff --git a/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_banner.jpg b/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_banner.jpg new file mode 100755 index 00000000..e6a85a38 Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_banner.jpg differ diff --git a/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_event.jpg b/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_event.jpg new file mode 100755 index 00000000..91fff96b Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_event.jpg differ diff --git a/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_image.jpg b/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_image.jpg new file mode 100755 index 00000000..3ca5ebb5 Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_image.jpg differ diff --git a/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_image_text.jpg b/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_image_text.jpg new file mode 100755 index 00000000..87251f5f Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_image_text.jpg differ diff --git a/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_text_image.jpg b/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_text_image.jpg new file mode 100755 index 00000000..10f6102f Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_text_image.jpg differ diff --git a/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_three_cols_1.jpg b/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_three_cols_1.jpg new file mode 100755 index 00000000..fa939c89 Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_three_cols_1.jpg differ diff --git a/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_three_cols_2.jpg b/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_three_cols_2.jpg new file mode 100755 index 00000000..35a8006b Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_three_cols_2.jpg differ diff --git a/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_three_cols_3.jpg b/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_three_cols_3.jpg new file mode 100755 index 00000000..e33e6679 Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_three_cols_3.jpg differ diff --git a/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_two_cols_1.jpg b/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_two_cols_1.jpg new file mode 100755 index 00000000..9a55e535 Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_two_cols_1.jpg differ diff --git a/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_two_cols_2.jpg b/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_two_cols_2.jpg new file mode 100755 index 00000000..38c77b3c Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_default/s_default_image_block_two_cols_2.jpg differ diff --git a/addons/mass_mailing/static/src/img/theme_default/s_default_image_logo.png b/addons/mass_mailing/static/src/img/theme_default/s_default_image_logo.png new file mode 100755 index 00000000..1f5169a2 Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_default/s_default_image_logo.png differ diff --git a/addons/mass_mailing/static/src/img/theme_imgs/basic_thumb_large.png b/addons/mass_mailing/static/src/img/theme_imgs/basic_thumb_large.png new file mode 100644 index 00000000..380661de Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_imgs/basic_thumb_large.png differ diff --git a/addons/mass_mailing/static/src/img/theme_imgs/basic_thumb_logo.png b/addons/mass_mailing/static/src/img/theme_imgs/basic_thumb_logo.png new file mode 100644 index 00000000..2a562249 Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_imgs/basic_thumb_logo.png differ diff --git a/addons/mass_mailing/static/src/img/theme_imgs/basic_thumb_small.png b/addons/mass_mailing/static/src/img/theme_imgs/basic_thumb_small.png new file mode 100644 index 00000000..32b14ab1 Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_imgs/basic_thumb_small.png differ diff --git a/addons/mass_mailing/static/src/img/theme_imgs/default_thumb_large.png b/addons/mass_mailing/static/src/img/theme_imgs/default_thumb_large.png new file mode 100644 index 00000000..d93ecd63 Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_imgs/default_thumb_large.png differ diff --git a/addons/mass_mailing/static/src/img/theme_imgs/default_thumb_logo.png b/addons/mass_mailing/static/src/img/theme_imgs/default_thumb_logo.png new file mode 100644 index 00000000..157ab855 Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_imgs/default_thumb_logo.png differ diff --git a/addons/mass_mailing/static/src/img/theme_imgs/default_thumb_small.png b/addons/mass_mailing/static/src/img/theme_imgs/default_thumb_small.png new file mode 100644 index 00000000..5c851797 Binary files /dev/null and b/addons/mass_mailing/static/src/img/theme_imgs/default_thumb_small.png differ diff --git a/addons/mass_mailing/static/src/js/mass_mailing.js b/addons/mass_mailing/static/src/js/mass_mailing.js new file mode 100644 index 00000000..e74d97f5 --- /dev/null +++ b/addons/mass_mailing/static/src/js/mass_mailing.js @@ -0,0 +1,15 @@ +odoo.define('mass_mailing.mass_mailing', function (require) { +"use strict"; + +var KanbanColumn = require('web.KanbanColumn'); + +KanbanColumn.include({ + init: function () { + this._super.apply(this, arguments); + if (this.modelName === 'mailing.mailing') { + this.draggable = false; + } + }, +}); + +}); diff --git a/addons/mass_mailing/static/src/js/mass_mailing_link_dialog_fix.js b/addons/mass_mailing/static/src/js/mass_mailing_link_dialog_fix.js new file mode 100644 index 00000000..6b46340b --- /dev/null +++ b/addons/mass_mailing/static/src/js/mass_mailing_link_dialog_fix.js @@ -0,0 +1,75 @@ + +odoo.define('mass_mailing.fix.LinkDialog', function (require) { +'use strict'; + +const LinkDialog = require('wysiwyg.widgets.LinkDialog'); + +/** + * Primary and link buttons are "hacked" by mailing themes scss. We thus + * have to fix their preview if possible. + */ +LinkDialog.include({ + /** + * @override + */ + start() { + const ret = this._super(...arguments); + if (!$(this.editable).find('.o_mail_wrapper').length) { + return ret; + } + + this.opened().then(() => { + // Ugly hack to show the real color for link and primary which + // depend on the mailing themes. Note: the hack is not enough as + // the mailing theme changes those colors in some environment, + // sometimes (for example 'btn-primary in this snippet looks like + // that')... we'll consider this a limitation until a master + // refactoring of those mailing themes. + this.__realMMColors = {}; + const $previewArea = $('
').addClass('o_mail_snippet_general'); + $(this.editable).find('.o_layout').append($previewArea); + _.each(['link', 'primary', 'secondary'], type => { + const $el = $(''); + $el.appendTo($previewArea); + this.__realMMColors[type] = { + 'border-color': $el.css('border-top-color'), + 'background-color': $el.css('background-color'), + 'color': $el.css('color'), + }; + $el.remove(); + + this.$('.form-group .o_btn_preview.btn-' + type) + .css(_.pick(this.__realMMColors[type], 'background-color', 'color')); + }); + $previewArea.remove(); + + this._adaptPreview(); + }); + + return ret; + }, + + //-------------------------------------------------------------------------- + // Private + //-------------------------------------------------------------------------- + + /** + * @override + */ + _adaptPreview() { + this._super(...arguments); + if (this.__realMMColors) { + var $preview = this.$("#link-preview"); + $preview.css('border-color', ''); + $preview.css('background-color', ''); + $preview.css('color', ''); + _.each(['link', 'primary', 'secondary'], type => { + if ($preview.hasClass('btn-' + type) || type === 'link' && !$preview.hasClass('btn')) { + $preview.css(this.__realMMColors[type]); + } + }); + } + }, +}); + +}); diff --git a/addons/mass_mailing/static/src/js/mass_mailing_list_kanban_record.js b/addons/mass_mailing/static/src/js/mass_mailing_list_kanban_record.js new file mode 100644 index 00000000..52d7076b --- /dev/null +++ b/addons/mass_mailing/static/src/js/mass_mailing_list_kanban_record.js @@ -0,0 +1,18 @@ +odoo.define('mass_mailing.ListKanbanRecord', function (require) { +"use strict"; + +var KanbanRecord = require('web.KanbanRecord'); + +var MassMailingListKanbanRecord = KanbanRecord.extend({ + /** + * @override + * @private + */ + _openRecord: function () { + this.$('.o_mailing_list_kanban_boxes a').first().click(); + } +}); + +return MassMailingListKanbanRecord; + +}); diff --git a/addons/mass_mailing/static/src/js/mass_mailing_list_kanban_renderer.js b/addons/mass_mailing/static/src/js/mass_mailing_list_kanban_renderer.js new file mode 100644 index 00000000..b9804e72 --- /dev/null +++ b/addons/mass_mailing/static/src/js/mass_mailing_list_kanban_renderer.js @@ -0,0 +1,16 @@ +odoo.define('mass_mailing.ListKanbanRenderer', function (require) { +"use strict"; + +var MassMailingListKanbanRecord = require('mass_mailing.ListKanbanRecord'); + +var KanbanRenderer = require('web.KanbanRenderer'); + +var MassMailingListKanbanRenderer = KanbanRenderer.extend({ + config: _.extend({}, KanbanRenderer.prototype.config, { + KanbanRecord: MassMailingListKanbanRecord, + }) +}); + +return MassMailingListKanbanRenderer; + +}); diff --git a/addons/mass_mailing/static/src/js/mass_mailing_list_kanban_view.js b/addons/mass_mailing/static/src/js/mass_mailing_list_kanban_view.js new file mode 100644 index 00000000..86bac695 --- /dev/null +++ b/addons/mass_mailing/static/src/js/mass_mailing_list_kanban_view.js @@ -0,0 +1,19 @@ +odoo.define('mass_mailing.ListKanbanView', function (require) { +"use strict"; + +var MassMailingListKanbanRenderer = require('mass_mailing.ListKanbanRenderer'); + +var KanbanView = require('web.KanbanView'); +var view_registry = require('web.view_registry'); + +var MassMailingListKanbanView = KanbanView.extend({ + config: _.extend({}, KanbanView.prototype.config, { + Renderer: MassMailingListKanbanRenderer, + }), +}); + +view_registry.add('mass_mailing_list_kanban', MassMailingListKanbanView); + +return MassMailingListKanbanView; + +}); diff --git a/addons/mass_mailing/static/src/js/mass_mailing_snippets.js b/addons/mass_mailing/static/src/js/mass_mailing_snippets.js new file mode 100644 index 00000000..ef4bd007 --- /dev/null +++ b/addons/mass_mailing/static/src/js/mass_mailing_snippets.js @@ -0,0 +1,153 @@ +odoo.define('mass_mailing.snippets.options', function (require) { +"use strict"; + +var options = require('web_editor.snippets.options'); + +// Snippet option for resizing image and column width inline like excel +options.registry.mass_mailing_sizing_x = options.Class.extend({ + /** + * @override + */ + start: function () { + var def = this._super.apply(this, arguments); + + this.containerWidth = this.$target.parent().closest("td, table, div").width(); + + var self = this; + var offset, sib_offset, target_width, sib_width; + + this.$overlay.find(".o_handle.e, .o_handle.w").removeClass("readonly"); + this.isIMG = this.$target.is("img"); + if (this.isIMG) { + this.$overlay.find(".o_handle.w").addClass("readonly"); + } + + var $body = $(this.ownerDocument.body); + this.$overlay.find(".o_handle").on('mousedown', function (event) { + event.preventDefault(); + var $handle = $(this); + var compass = false; + + _.each(['n', 's', 'e', 'w'], function (handler) { + if ($handle.hasClass(handler)) { compass = handler; } + }); + if (self.isIMG) { compass = "image"; } + + $body.on("mousemove.mass_mailing_width_x", function (event) { + event.preventDefault(); + offset = self.$target.offset().left; + target_width = self.get_max_width(self.$target); + if (compass === 'e' && self.$target.next().offset()) { + sib_width = self.get_max_width(self.$target.next()); + sib_offset = self.$target.next().offset().left; + self.change_width(event, self.$target, target_width, offset, true); + self.change_width(event, self.$target.next(), sib_width, sib_offset, false); + } + if (compass === 'w' && self.$target.prev().offset()) { + sib_width = self.get_max_width(self.$target.prev()); + sib_offset = self.$target.prev().offset().left; + self.change_width(event, self.$target, target_width, offset, false); + self.change_width(event, self.$target.prev(), sib_width, sib_offset, true); + } + if (compass === 'image') { + self.change_width(event, self.$target, target_width, offset, true); + } + }); + $body.one("mouseup", function () { + $body.off('.mass_mailing_width_x'); + }); + }); + + return def; + }, + change_width: function (event, target, target_width, offset, grow) { + target.css("width", grow ? (event.pageX - offset) : (offset + target_width - event.pageX)); + this.trigger_up('cover_update'); + }, + get_int_width: function (el) { + return parseInt($(el).css("width"), 10); + }, + get_max_width: function ($el) { + return this.containerWidth - _.reduce(_.map($el.siblings(), this.get_int_width), function (memo, w) { return memo + w; }); + }, + onFocus: function () { + this._super.apply(this, arguments); + + if (this.$target.is("td, th")) { + this.$overlay.find(".o_handle.e, .o_handle.w").toggleClass("readonly", this.$target.siblings().length === 0); + } + }, +}); + +options.registry.mass_mailing_table_item = options.Class.extend({ + onClone: function (options) { + this._super.apply(this, arguments); + + // If we cloned a td or th element... + if (options.isCurrent && this.$target.is("td, th")) { + // ... and that the td or th element was alone on its row ... + if (this.$target.siblings().length === 1) { + var $tr = this.$target.parent(); + $tr.clone().empty().insertAfter($tr).append(this.$target); // ... move the clone in a new row instead + return; + } + + // ... if not, if the clone neighbor is an empty cell, remove this empty cell (like if the clone content had been put in that cell) + var $next = this.$target.next(); + if ($next.length && $next.text().trim() === "") { + $next.remove(); + return; + } + + // ... if not, insert an empty col in each other row, at the index of the clone + var width = this.$target.width(); + var $trs = this.$target.closest("table").children("thead, tbody, tfoot").addBack().children("tr").not(this.$target.parent()); + _.each($trs.children(":nth-child(" + this.$target.index() + ")"), function (col) { + $(col).after($("", {style: "width: " + width + "px;"})); + }); + } + }, + onRemove: function () { + this._super.apply(this, arguments); + + // If we are removing a td or th element which was not alone on its row ... + if (this.$target.is("td, th") && this.$target.siblings().length > 0) { + var $trs = this.$target.closest("table").children("thead, tbody, tfoot").addBack().children("tr").not(this.$target.parent()); + if ($trs.length) { // ... if there are other rows in the table ... + var $last_tds = $trs.children(":last-child"); + if (_.reduce($last_tds, function (memo, td) { return memo + (td.innerHTML || ""); }, "").trim() === "") { + $last_tds.remove(); // ... remove the potential full empty column in the table + } else { + this.$target.parent().append(""); // ... else, if there is no full empty column, append an empty col in the current row + } + } + } + }, +}); + +// Adding compatibility for the outlook compliance of mailings. +// Commit of such compatibility : a14f89c8663c9cafecb1cc26918055e023ecbe42 +options.registry.BackgroundImage = options.registry.BackgroundImage.extend({ + start: function () { + this._super(); + if (this.snippets && this.snippets.split('.')[0] === "mass_mailing") { + var $table_target = this.$target.find('table:first'); + if ($table_target.length) { + this.$target = $table_target; + } + } + } +}); + +// TODO remove in master when removing the XML div. The option has been disabled +// in 14.0 because of tricky problems to resolve that require refactoring: +// the ability to clean snippet without saving and reloading the page. +options.registry.SnippetSave.include({ + + async saveSnippet(previewMode, widgetValue, params) {}, + + async _computeVisibility() { + return false; + }, +}); +}); diff --git a/addons/mass_mailing/static/src/js/mass_mailing_widget.js b/addons/mass_mailing/static/src/js/mass_mailing_widget.js new file mode 100644 index 00000000..b39cb917 --- /dev/null +++ b/addons/mass_mailing/static/src/js/mass_mailing_widget.js @@ -0,0 +1,520 @@ +odoo.define('mass_mailing.FieldHtml', function (require) { +'use strict'; + +var config = require('web.config'); +var core = require('web.core'); +var FieldHtml = require('web_editor.field.html'); +var fieldRegistry = require('web.field_registry'); +var convertInline = require('web_editor.convertInline'); + +var _t = core._t; + + +var MassMailingFieldHtml = FieldHtml.extend({ + xmlDependencies: (FieldHtml.prototype.xmlDependencies || []).concat(["/mass_mailing/static/src/xml/mass_mailing.xml"]), + jsLibs: [ + '/mass_mailing/static/src/js/mass_mailing_link_dialog_fix.js', + ], + + custom_events: _.extend({}, FieldHtml.prototype.custom_events, { + snippets_loaded: '_onSnippetsLoaded', + }), + + /** + * @override + */ + init: function () { + this._super.apply(this, arguments); + if (!this.nodeOptions.snippets) { + this.nodeOptions.snippets = 'mass_mailing.email_designer_snippets'; + } + + // All the code related to this __extraAssetsForIframe variable is an + // ugly hack to restore mass mailing options in stable versions. The + // whole logic has to be refactored as soon as possible... + this.__extraAssetsForIframe = [{ + jsLibs: ['/mass_mailing/static/src/js/mass_mailing_snippets.js'], + }]; + }, + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + /** + * Commit the change in 'style-inline' on an other field nodeOptions: + * + * - inline-field: fieldName to save the html value converted into inline code + * + * @override + */ + commitChanges: function () { + var self = this; + if (config.isDebug() && this.mode === 'edit') { + var layoutInfo = $.summernote.core.dom.makeLayoutInfo(this.wysiwyg.$editor); + $.summernote.pluginEvents.codeview(undefined, undefined, layoutInfo, false); + } + if (this.mode === 'readonly' || !this.isRendered) { + return this._super(); + } + var fieldName = this.nodeOptions['inline-field']; + + if (this.$content.find('.o_basic_theme').length) { + this.$content.find('*').css('font-family', ''); + } + + var $editable = this.wysiwyg.getEditable(); + + return this.wysiwyg.saveModifiedImages(this.$content).then(function () { + return self.wysiwyg.save().then(function (result) { + self._isDirty = result.isDirty; + + convertInline.attachmentThumbnailToLinkImg($editable); + convertInline.fontToImg($editable); + convertInline.classToStyle($editable); + + // fix outlook image rendering bug + _.each(['width', 'height'], function(attribute) { + $editable.find('img[style*="width"], img[style*="height"]').attr(attribute, function(){ + return $(this)[attribute](); + }).css(attribute, function(){ + return $(this).get(0).style[attribute] || 'auto'; + }); + }); + + self.trigger_up('field_changed', { + dataPointID: self.dataPointID, + changes: _.object([fieldName], [self._unWrap($editable.html())]) + }); + self.wysiwyg.setValue(result.html); + + if (self._isDirty && self.mode === 'edit') { + return self._doAction(); + } + }); + }); + }, + /** + * The html_frame widget is opened in an iFrame that has its URL encoded + * with all the key/values returned by this method. + * + * Some fields can get very long values and we want to omit them for the URL building. + * + * @override + */ + getDatarecord: function () { + return _.omit(this._super(), [ + 'mailing_domain', + 'contact_list_ids', + 'body_html', + 'attachment_ids' + ]); + }, + //-------------------------------------------------------------------------- + // Private + //-------------------------------------------------------------------------- + + /** + * Returns true if must force the user to choose a theme. + * + * @private + * @returns {Boolean} + */ + _checkIfMustForceThemeChoice: function () { + var firstChoice = this._editableAreaIsEmpty(); + this.$content.closest('body').toggleClass("o_force_mail_theme_choice", firstChoice); + return firstChoice; + }, + /** + * Returns true if the editable area is empty. + * + * @private + * @param {JQuery} [$layout] + * @returns {Boolean} + */ + _editableAreaIsEmpty: function ($layout) { + $layout = $layout || this.$content.find(".o_layout"); + var $mailWrapper = $layout.children(".o_mail_wrapper"); + var $mailWrapperContent = $mailWrapper.find('.o_mail_wrapper_td'); + if (!$mailWrapperContent.length) { // compatibility + $mailWrapperContent = $mailWrapper; + } + var value; + if ($mailWrapperContent.length > 0) { + value = $mailWrapperContent.html(); + } else if ($layout.length) { + value = $layout.html(); + } else { + value = this.wysiwyg.getValue(); + } + var blankEditable = "


"; + return value === "" || value === blankEditable; + }, + /** + * @override + */ + _renderEdit: function () { + this._isFromInline = !!this.value; + if (!this.value) { + this.value = this.recordData[this.nodeOptions['inline-field']]; + } + return this._super.apply(this, arguments); + }, + /** + * @override + */ + _renderReadonly: function () { + this.value = this.recordData[this.nodeOptions['inline-field']]; + return this._super.apply(this, arguments); + }, + + /** + * @override + * @returns {JQuery} + */ + _renderTranslateButton: function () { + var fieldName = this.nodeOptions['inline-field']; + if (_t.database.multi_lang && this.record.fields[fieldName].translate && this.res_id) { + return $('