summaryrefslogtreecommitdiff
path: root/addons/website_mail/static/src
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@odoo.com>2015-02-06 11:21:20 +0100
committerJulien De Coster <jdc@odoo.com>2015-02-12 11:58:13 +0100
commit70c30fe5b1dbc12142fdac74819fe0e71817e5e3 (patch)
treefab7010d51179d1acee6ec76e80210cd1f571c06 /addons/website_mail/static/src
parent28ed28f9451edcb32f70daf7082d2ae91148b79c (diff)
[IMP] website_mail: improved template designer, added support for background color, font color and convert class to inline style in mail designer, changed snippet according to new format, added theme selector in mail_designer, added font-awesome support (convert in image) in mail snippets
Diffstat (limited to 'addons/website_mail/static/src')
-rw-r--r--addons/website_mail/static/src/css/snippets.css85
-rw-r--r--addons/website_mail/static/src/css/website_mail.css20
-rw-r--r--addons/website_mail/static/src/css/website_mail_iframe.css164
-rw-r--r--addons/website_mail/static/src/img/blocks/block_button.pngbin0 -> 1105 bytes
-rw-r--r--addons/website_mail/static/src/img/blocks/block_discount.pngbin0 -> 1330 bytes
-rw-r--r--addons/website_mail/static/src/img/blocks/block_discount2.pngbin0 -> 1384 bytes
-rw-r--r--addons/website_mail/static/src/img/blocks/block_event.pngbin0 -> 974 bytes
-rw-r--r--addons/website_mail/static/src/img/blocks/block_footer_copyright.pngbin0 -> 549 bytes
-rw-r--r--addons/website_mail/static/src/img/blocks/block_footer_seprator.pngbin0 -> 310 bytes
-rw-r--r--addons/website_mail/static/src/img/blocks/block_footer_social.pngbin0 -> 312 bytes
-rw-r--r--addons/website_mail/static/src/img/blocks/block_footer_tag_line.pngbin0 -> 322 bytes
-rw-r--r--addons/website_mail/static/src/img/blocks/block_footer_text.pngbin0 -> 595 bytes
-rw-r--r--addons/website_mail/static/src/img/blocks/block_four_columns.pngbin0 -> 1105 bytes
-rw-r--r--addons/website_mail/static/src/img/blocks/block_header_center_logo.pngbin0 -> 308 bytes
-rw-r--r--addons/website_mail/static/src/img/blocks/block_header_center_text.pngbin0 -> 535 bytes
-rw-r--r--addons/website_mail/static/src/img/blocks/block_header_social.pngbin0 -> 318 bytes
-rw-r--r--addons/website_mail/static/src/img/blocks/block_header_text_social.pngbin0 -> 548 bytes
-rw-r--r--addons/website_mail/static/src/img/blocks/block_image-text.pngbin0 -> 760 bytes
-rw-r--r--addons/website_mail/static/src/img/blocks/block_image_text.pngbin0 -> 1204 bytes
-rw-r--r--addons/website_mail/static/src/img/blocks/block_simple_text.pngbin0 -> 329 bytes
-rw-r--r--addons/website_mail/static/src/img/blocks/block_steps.pngbin0 -> 1457 bytes
-rw-r--r--addons/website_mail/static/src/img/blocks/block_table.pngbin0 -> 999 bytes
-rw-r--r--addons/website_mail/static/src/img/blocks/block_text_on_image.pngbin0 -> 2003 bytes
-rw-r--r--addons/website_mail/static/src/img/blocks/block_title.pngbin0 -> 308 bytes
-rw-r--r--addons/website_mail/static/src/img/blocks/block_title_text.pngbin0 -> 815 bytes
-rw-r--r--addons/website_mail/static/src/img/blocks/block_two-column-img.pngbin0 -> 949 bytes
-rw-r--r--addons/website_mail/static/src/img/blocks/block_two-column.pngbin0 -> 348 bytes
-rw-r--r--addons/website_mail/static/src/img/blocks/block_two_columns.pngbin1081 -> 0 bytes
-rw-r--r--addons/website_mail/static/src/img/blocks/block_user.pngbin0 -> 686 bytes
-rw-r--r--addons/website_mail/static/src/img/blocks/button_group_subscribe.pngbin2726 -> 0 bytes
-rw-r--r--addons/website_mail/static/src/img/theme_imgs/airmail.pngbin0 -> 2946 bytes
-rw-r--r--addons/website_mail/static/src/img/theme_imgs/skyline_bg.gifbin0 -> 156220 bytes
-rw-r--r--addons/website_mail/static/src/img/theme_imgs/social_facebook.pngbin0 -> 567 bytes
-rw-r--r--addons/website_mail/static/src/img/theme_imgs/social_googleplus.pngbin0 -> 1043 bytes
-rw-r--r--addons/website_mail/static/src/img/theme_imgs/social_linkedin.pngbin0 -> 620 bytes
-rw-r--r--addons/website_mail/static/src/img/theme_imgs/social_rss.pngbin0 -> 993 bytes
-rw-r--r--addons/website_mail/static/src/img/theme_imgs/social_twitter.pngbin0 -> 755 bytes
-rw-r--r--addons/website_mail/static/src/img/thumbnail/airmail.pngbin0 -> 37349 bytes
-rw-r--r--addons/website_mail/static/src/img/thumbnail/basic.pngbin0 -> 62162 bytes
-rw-r--r--addons/website_mail/static/src/img/thumbnail/cleave.pngbin0 -> 25411 bytes
-rw-r--r--addons/website_mail/static/src/img/thumbnail/go.pngbin0 -> 32984 bytes
-rw-r--r--addons/website_mail/static/src/img/thumbnail/narrative.pngbin0 -> 35545 bytes
-rw-r--r--addons/website_mail/static/src/img/thumbnail/neopolitan.pngbin0 -> 19425 bytes
-rw-r--r--addons/website_mail/static/src/img/thumbnail/skyline.pngbin0 -> 71590 bytes
-rw-r--r--addons/website_mail/static/src/img/thumbnail/sunday.pngbin0 -> 38233 bytes
-rw-r--r--addons/website_mail/static/src/img/thumbnail/zenflat.pngbin0 -> 24114 bytes
-rw-r--r--addons/website_mail/static/src/js/website_email_designer.js427
47 files changed, 653 insertions, 43 deletions
diff --git a/addons/website_mail/static/src/css/snippets.css b/addons/website_mail/static/src/css/snippets.css
new file mode 100644
index 00000000000..c6e3ce1716f
--- /dev/null
+++ b/addons/website_mail/static/src/css/snippets.css
@@ -0,0 +1,85 @@
+/* ---- thumbnail ---- */
+.oe_snippet.o_mail_block_header_center_logo .oe_snippet_thumbnail_img {
+ background-image: url("/website_mail/static/src/img/blocks/block_header_center_logo.png");
+}
+.oe_snippet.o_mail_block_header_center_text .oe_snippet_thumbnail_img {
+ background-image: url("/website_mail/static/src/img/blocks/block_header_center_text.png");
+}
+.oe_snippet.o_mail_block_header_social .oe_snippet_thumbnail_img {
+ background-image: url("/website_mail/static/src/img/blocks/block_header_social.png");
+}
+.oe_snippet.o_mail_block_header_text_social .oe_snippet_thumbnail_img {
+ background-image: url("/website_mail/static/src/img/blocks/block_header_text_social.png");
+}
+.oe_snippet.o_mail_block_text_image .oe_snippet_thumbnail_img {
+ background-image: url("/website/static/src/img/blocks/block_text_image.png");
+}
+.oe_snippet.o_mail_block_footer_copyright .oe_snippet_thumbnail_img {
+ background-image: url("/website_mail/static/src/img/blocks/block_footer_copyright.png");
+}
+.oe_snippet.o_mail_block_footer_social .oe_snippet_thumbnail_img {
+ background-image: url("/website_mail/static/src/img/blocks/block_footer_social.png");
+}
+.oe_snippet.o_mail_block_footer_text .oe_snippet_thumbnail_img {
+ background-image: url("/website_mail/static/src/img/blocks/block_footer_text.png");
+}
+.oe_snippet.o_mail_block_footer_seprator .oe_snippet_thumbnail_img {
+ background-image: url("/website_mail/static/src/img/blocks/block_footer_seprator.png");
+}
+.oe_snippet.o_mail_block_footer_tag_line .oe_snippet_thumbnail_img {
+ background-image: url("/website_mail/static/src/img/blocks/block_footer_tag_line.png");
+}
+.oe_snippet.o_mail_block_two_cols .oe_snippet_thumbnail_img{
+ background-image: url("/website_mail/static/src/img/blocks/block_two-column-img.png");
+}
+.oe_snippet.o_mail_block_two_cols_content .oe_snippet_thumbnail_img{
+ background-image: url("/website_mail/static/src/img/blocks/block_two-column.png");
+}
+.oe_snippet.o_mail_block_title_text .oe_snippet_thumbnail_img{
+ background-image: url("/website_mail/static/src/img/blocks/block_title_text.png")
+}
+.oe_snippet.o_mail_block_title_sub .oe_snippet_thumbnail_img{
+ background-image: url("/website_mail/static/src/img/blocks/block_title.png")
+}
+.oe_snippet.o_mail_block_image_text .oe_snippet_thumbnail_img{
+ background-image: url("/website_mail/static/src/img/blocks/block_image-text.png")
+}
+.oe_snippet.o_mail_block_text_button .oe_snippet_thumbnail_img{
+ background-image: url("/website/static/src/img/blocks/block_jumbotron.png")
+}
+.oe_snippet.o_mail_block_table_content .oe_snippet_thumbnail_img{
+ background-image: url("/website_mail/static/src/img/blocks/block_table.png")
+}
+.oe_snippet.o_mail_block_discount1 .oe_snippet_thumbnail_img{
+ background-image: url("/website_mail/static/src/img/blocks/block_discount.png")
+}
+.oe_snippet.o_mail_block_discount2 .oe_snippet_thumbnail_img{
+ background-image: url("/website_mail/static/src/img/blocks/block_discount2.png")
+}
+.oe_snippet.o_mail_block_event .oe_snippet_thumbnail_img{
+ background-image: url("/website_mail/static/src/img/blocks/block_event.png")
+}
+.oe_snippet.o_mail_block_image .oe_snippet_thumbnail_img{
+ background-image: url("/website_mail/static/src/img/blocks/block_image_text.png")
+}
+.oe_snippet.o_mail_block_profile .oe_snippet_thumbnail_img{
+ background-image: url("/website_mail/static/src/img/blocks/block_user.png")
+}
+.oe_snippet.o_mail_block_four_cols .oe_snippet_thumbnail_img{
+ background-image: url("/website_mail/static/src/img/blocks/block_four_columns.png")
+}
+.oe_snippet.o_mail_block_button .oe_snippet_thumbnail_img{
+ background-image: url("/website_mail/static/src/img/blocks/block_button.png")
+}
+.oe_snippet.o_mail_block_simple_text .oe_snippet_thumbnail_img{
+ background-image: url("/website_mail/static/src/img/blocks/block_simple_text.png")
+}
+.oe_snippet.o_mail_block_three_cols .oe_snippet_thumbnail_img{
+ background-image: url("/website_mail/static/src/img/blocks/block_three_columns.png")
+}
+.oe_snippet.o_mail_block_text_on_img .oe_snippet_thumbnail_img{
+ background-image: url("/website_mail/static/src/img/blocks/block_text_on_image.png")
+}
+.oe_snippet.o_mail_block_steps .oe_snippet_thumbnail_img{
+ background-image: url("/website_mail/static/src/img/blocks/block_steps.png")
+}
diff --git a/addons/website_mail/static/src/css/website_mail.css b/addons/website_mail/static/src/css/website_mail.css
index ef0bbce4ab3..5678442416c 100644
--- a/addons/website_mail/static/src/css/website_mail.css
+++ b/addons/website_mail/static/src/css/website_mail.css
@@ -1,24 +1,4 @@
.js_follow[data-follow='on'] .js_follow_btn ,
.js_follow[data-follow='off'] .js_unfollow_btn {
display: none;
-}
-
-.email_preview_border {
- overflow: hidden !important;
- border: 2px solid grey;
- height: 300px;
-}
-.email_preview {
- -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 0px -300px 0;
-}
-
-.o_mail_body {
- width: 620px;
- margin-left: 16px;
} \ No newline at end of file
diff --git a/addons/website_mail/static/src/css/website_mail_iframe.css b/addons/website_mail/static/src/css/website_mail_iframe.css
new file mode 100644
index 00000000000..6e8d6541c95
--- /dev/null
+++ b/addons/website_mail/static/src/css/website_mail_iframe.css
@@ -0,0 +1,164 @@
+body {
+ background-color: #fff;
+}
+p {
+ margin: initial;
+}
+a {
+ color: inherit;
+}
+a:hover {
+ color: inherit;
+}
+#wrapwrap .o_editable {
+ font: initial;
+ line-height: initial;
+ color: initial;
+}
+#oe_snippets ~ #wrapwrap .o_editable {
+ 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:before, #wrapwrap > main > div:first-child:after {
+ content: " ";
+ display: block;
+ height: 100%;
+ position: fixed;
+ top: -4px;
+ width: 0;
+ overflow: hidden;
+}
+.editor_enable #wrapwrap > main > div:first-child:before {
+ border-right: 1px dashed #ccc;
+ margin-left: -5px;
+}
+.editor_enable #wrapwrap > main > div:first-child:after {
+ border-left: 1px dashed #ccc;
+ margin-left: 605px;
+}
+
+.note-color-palette .colorpicker {
+ display: none;
+}
+
+/***************************/
+
+#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{
+ width: 98%;
+}
+#choose_template{
+ display: none;
+ margin: 5px;
+ padding: 1px 5px;
+ position: fixed;
+ top: 0;
+ right: 50px;
+ z-index: 2000;
+}
+#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;
+} \ No newline at end of file
diff --git a/addons/website_mail/static/src/img/blocks/block_button.png b/addons/website_mail/static/src/img/blocks/block_button.png
new file mode 100644
index 00000000000..3cc09522e05
--- /dev/null
+++ b/addons/website_mail/static/src/img/blocks/block_button.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/blocks/block_discount.png b/addons/website_mail/static/src/img/blocks/block_discount.png
new file mode 100644
index 00000000000..2d50e0dc242
--- /dev/null
+++ b/addons/website_mail/static/src/img/blocks/block_discount.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/blocks/block_discount2.png b/addons/website_mail/static/src/img/blocks/block_discount2.png
new file mode 100644
index 00000000000..eec00e52cbc
--- /dev/null
+++ b/addons/website_mail/static/src/img/blocks/block_discount2.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/blocks/block_event.png b/addons/website_mail/static/src/img/blocks/block_event.png
new file mode 100644
index 00000000000..251d52ddcea
--- /dev/null
+++ b/addons/website_mail/static/src/img/blocks/block_event.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/blocks/block_footer_copyright.png b/addons/website_mail/static/src/img/blocks/block_footer_copyright.png
new file mode 100644
index 00000000000..3b57fa068be
--- /dev/null
+++ b/addons/website_mail/static/src/img/blocks/block_footer_copyright.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/blocks/block_footer_seprator.png b/addons/website_mail/static/src/img/blocks/block_footer_seprator.png
new file mode 100644
index 00000000000..ea87ad3f176
--- /dev/null
+++ b/addons/website_mail/static/src/img/blocks/block_footer_seprator.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/blocks/block_footer_social.png b/addons/website_mail/static/src/img/blocks/block_footer_social.png
new file mode 100644
index 00000000000..b1ea137b2ae
--- /dev/null
+++ b/addons/website_mail/static/src/img/blocks/block_footer_social.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/blocks/block_footer_tag_line.png b/addons/website_mail/static/src/img/blocks/block_footer_tag_line.png
new file mode 100644
index 00000000000..cf12cc97358
--- /dev/null
+++ b/addons/website_mail/static/src/img/blocks/block_footer_tag_line.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/blocks/block_footer_text.png b/addons/website_mail/static/src/img/blocks/block_footer_text.png
new file mode 100644
index 00000000000..7f3553cd32d
--- /dev/null
+++ b/addons/website_mail/static/src/img/blocks/block_footer_text.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/blocks/block_four_columns.png b/addons/website_mail/static/src/img/blocks/block_four_columns.png
new file mode 100644
index 00000000000..6087b078261
--- /dev/null
+++ b/addons/website_mail/static/src/img/blocks/block_four_columns.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/blocks/block_header_center_logo.png b/addons/website_mail/static/src/img/blocks/block_header_center_logo.png
new file mode 100644
index 00000000000..f1c11cfcc3a
--- /dev/null
+++ b/addons/website_mail/static/src/img/blocks/block_header_center_logo.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/blocks/block_header_center_text.png b/addons/website_mail/static/src/img/blocks/block_header_center_text.png
new file mode 100644
index 00000000000..bf61eb36b0b
--- /dev/null
+++ b/addons/website_mail/static/src/img/blocks/block_header_center_text.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/blocks/block_header_social.png b/addons/website_mail/static/src/img/blocks/block_header_social.png
new file mode 100644
index 00000000000..cdd13628997
--- /dev/null
+++ b/addons/website_mail/static/src/img/blocks/block_header_social.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/blocks/block_header_text_social.png b/addons/website_mail/static/src/img/blocks/block_header_text_social.png
new file mode 100644
index 00000000000..c72dc2c0439
--- /dev/null
+++ b/addons/website_mail/static/src/img/blocks/block_header_text_social.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/blocks/block_image-text.png b/addons/website_mail/static/src/img/blocks/block_image-text.png
new file mode 100644
index 00000000000..8611573f98b
--- /dev/null
+++ b/addons/website_mail/static/src/img/blocks/block_image-text.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/blocks/block_image_text.png b/addons/website_mail/static/src/img/blocks/block_image_text.png
new file mode 100644
index 00000000000..6a2bcaf6b17
--- /dev/null
+++ b/addons/website_mail/static/src/img/blocks/block_image_text.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/blocks/block_simple_text.png b/addons/website_mail/static/src/img/blocks/block_simple_text.png
new file mode 100644
index 00000000000..7099744d742
--- /dev/null
+++ b/addons/website_mail/static/src/img/blocks/block_simple_text.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/blocks/block_steps.png b/addons/website_mail/static/src/img/blocks/block_steps.png
new file mode 100644
index 00000000000..2882bac0f59
--- /dev/null
+++ b/addons/website_mail/static/src/img/blocks/block_steps.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/blocks/block_table.png b/addons/website_mail/static/src/img/blocks/block_table.png
new file mode 100644
index 00000000000..e7f51cbe943
--- /dev/null
+++ b/addons/website_mail/static/src/img/blocks/block_table.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/blocks/block_text_on_image.png b/addons/website_mail/static/src/img/blocks/block_text_on_image.png
new file mode 100644
index 00000000000..d1e6cc1c722
--- /dev/null
+++ b/addons/website_mail/static/src/img/blocks/block_text_on_image.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/blocks/block_title.png b/addons/website_mail/static/src/img/blocks/block_title.png
new file mode 100644
index 00000000000..8382c843a4b
--- /dev/null
+++ b/addons/website_mail/static/src/img/blocks/block_title.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/blocks/block_title_text.png b/addons/website_mail/static/src/img/blocks/block_title_text.png
new file mode 100644
index 00000000000..cf785444dad
--- /dev/null
+++ b/addons/website_mail/static/src/img/blocks/block_title_text.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/blocks/block_two-column-img.png b/addons/website_mail/static/src/img/blocks/block_two-column-img.png
new file mode 100644
index 00000000000..3506415d8c2
--- /dev/null
+++ b/addons/website_mail/static/src/img/blocks/block_two-column-img.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/blocks/block_two-column.png b/addons/website_mail/static/src/img/blocks/block_two-column.png
new file mode 100644
index 00000000000..455ba378f53
--- /dev/null
+++ b/addons/website_mail/static/src/img/blocks/block_two-column.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/blocks/block_two_columns.png b/addons/website_mail/static/src/img/blocks/block_two_columns.png
deleted file mode 100644
index 55a3f0c1c99..00000000000
--- a/addons/website_mail/static/src/img/blocks/block_two_columns.png
+++ /dev/null
Binary files differ
diff --git a/addons/website_mail/static/src/img/blocks/block_user.png b/addons/website_mail/static/src/img/blocks/block_user.png
new file mode 100644
index 00000000000..d822f6f989e
--- /dev/null
+++ b/addons/website_mail/static/src/img/blocks/block_user.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/blocks/button_group_subscribe.png b/addons/website_mail/static/src/img/blocks/button_group_subscribe.png
deleted file mode 100644
index 204239a8e0c..00000000000
--- a/addons/website_mail/static/src/img/blocks/button_group_subscribe.png
+++ /dev/null
Binary files differ
diff --git a/addons/website_mail/static/src/img/theme_imgs/airmail.png b/addons/website_mail/static/src/img/theme_imgs/airmail.png
new file mode 100644
index 00000000000..943d0e4b5ce
--- /dev/null
+++ b/addons/website_mail/static/src/img/theme_imgs/airmail.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/theme_imgs/skyline_bg.gif b/addons/website_mail/static/src/img/theme_imgs/skyline_bg.gif
new file mode 100644
index 00000000000..fa91caa4c72
--- /dev/null
+++ b/addons/website_mail/static/src/img/theme_imgs/skyline_bg.gif
Binary files differ
diff --git a/addons/website_mail/static/src/img/theme_imgs/social_facebook.png b/addons/website_mail/static/src/img/theme_imgs/social_facebook.png
new file mode 100644
index 00000000000..59eff64afb4
--- /dev/null
+++ b/addons/website_mail/static/src/img/theme_imgs/social_facebook.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/theme_imgs/social_googleplus.png b/addons/website_mail/static/src/img/theme_imgs/social_googleplus.png
new file mode 100644
index 00000000000..0364cb0b9bb
--- /dev/null
+++ b/addons/website_mail/static/src/img/theme_imgs/social_googleplus.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/theme_imgs/social_linkedin.png b/addons/website_mail/static/src/img/theme_imgs/social_linkedin.png
new file mode 100644
index 00000000000..ff7309e3cf4
--- /dev/null
+++ b/addons/website_mail/static/src/img/theme_imgs/social_linkedin.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/theme_imgs/social_rss.png b/addons/website_mail/static/src/img/theme_imgs/social_rss.png
new file mode 100644
index 00000000000..da352edcfb8
--- /dev/null
+++ b/addons/website_mail/static/src/img/theme_imgs/social_rss.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/theme_imgs/social_twitter.png b/addons/website_mail/static/src/img/theme_imgs/social_twitter.png
new file mode 100644
index 00000000000..827c85801e6
--- /dev/null
+++ b/addons/website_mail/static/src/img/theme_imgs/social_twitter.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/thumbnail/airmail.png b/addons/website_mail/static/src/img/thumbnail/airmail.png
new file mode 100644
index 00000000000..4988a4fedf1
--- /dev/null
+++ b/addons/website_mail/static/src/img/thumbnail/airmail.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/thumbnail/basic.png b/addons/website_mail/static/src/img/thumbnail/basic.png
new file mode 100644
index 00000000000..2debbb4e7d2
--- /dev/null
+++ b/addons/website_mail/static/src/img/thumbnail/basic.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/thumbnail/cleave.png b/addons/website_mail/static/src/img/thumbnail/cleave.png
new file mode 100644
index 00000000000..34e97ac6683
--- /dev/null
+++ b/addons/website_mail/static/src/img/thumbnail/cleave.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/thumbnail/go.png b/addons/website_mail/static/src/img/thumbnail/go.png
new file mode 100644
index 00000000000..7c5f0ad00ce
--- /dev/null
+++ b/addons/website_mail/static/src/img/thumbnail/go.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/thumbnail/narrative.png b/addons/website_mail/static/src/img/thumbnail/narrative.png
new file mode 100644
index 00000000000..823e206aaf9
--- /dev/null
+++ b/addons/website_mail/static/src/img/thumbnail/narrative.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/thumbnail/neopolitan.png b/addons/website_mail/static/src/img/thumbnail/neopolitan.png
new file mode 100644
index 00000000000..37d8f9d7d16
--- /dev/null
+++ b/addons/website_mail/static/src/img/thumbnail/neopolitan.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/thumbnail/skyline.png b/addons/website_mail/static/src/img/thumbnail/skyline.png
new file mode 100644
index 00000000000..bdc7a5b815a
--- /dev/null
+++ b/addons/website_mail/static/src/img/thumbnail/skyline.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/thumbnail/sunday.png b/addons/website_mail/static/src/img/thumbnail/sunday.png
new file mode 100644
index 00000000000..2dd6444c686
--- /dev/null
+++ b/addons/website_mail/static/src/img/thumbnail/sunday.png
Binary files differ
diff --git a/addons/website_mail/static/src/img/thumbnail/zenflat.png b/addons/website_mail/static/src/img/thumbnail/zenflat.png
new file mode 100644
index 00000000000..690f08a29db
--- /dev/null
+++ b/addons/website_mail/static/src/img/thumbnail/zenflat.png
Binary files differ
diff --git a/addons/website_mail/static/src/js/website_email_designer.js b/addons/website_mail/static/src/js/website_email_designer.js
index 97a700c5c29..b6b62da7958 100644
--- a/addons/website_mail/static/src/js/website_email_designer.js
+++ b/addons/website_mail/static/src/js/website_email_designer.js
@@ -1,36 +1,417 @@
(function () {
'use strict';
+
var website = openerp.website;
+ var session = new openerp.Session();
+
+ // Snippet option for resizing image and column width inline like excel
+ website.snippet.options["width-x"] = website.snippet.Option.extend({
+ start: function () {
+ this.container_width = 600;
+ var parent = this.$target.closest('[data-max-width]');
+ if( parent.length ){
+ this.container_width = parseInt(parent.attr('data-max-width'));
+ }
+ var self = this;
+ var offset, sib_offset, target_width, sib_width;
+ this.is_image = false;
+ this._super();
- website.if_dom_contains('#email_designer', function () {
- website.snippet.BuildingBlock.include({
- _get_snippet_url: function () {
- return '/website_mail/snippets';
+ this.$overlay.find(".oe_handle.e, .oe_handle.w").removeClass("readonly");
+ if( this.$target.is('img')){
+ this.$overlay.find(".oe_handle.w").addClass("readonly");
+ this.$overlay.find(".oe_snippet_remove, .oe_snippet_move, .oe_snippet_clone").addClass("hidden");
+ this.is_image=true;
}
- });
- $('.js_template_set').off('click').click(function(ev) {
- // Copy the template to the body of the email
- $('#email_designer').show();
- $('#email_template').hide();
- $(".js_content", $(this).parent()).children().clone().appendTo('#email_body');
- $(".js_content", $(this).parent()).children().clone().appendTo('#email_body_html');
- $('#email_body').addClass('oe_dirty');
- $('#email_body_html').addClass('oe_dirty');
-
- openerp.website.editor_bar.edit();
- ev.preventDefault();
- });
+ this.$overlay.find(".oe_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.is_image){ compass = "image"; }
+ self.BuildingBlock.editor_busy = true;
+
+ var $body = $(document.body);
+
+ var body_mousemove = 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 ,'plus');
+ self.change_width(event, self.$target.next(), sib_width, sib_offset ,'minus');
+ }
+ 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 ,'minus');
+ self.change_width(event, self.$target.prev(), sib_width, sib_offset, 'plus');
+ }
+ if (compass === 'image'){
+ self.change_width(event, self.$target, target_width, offset ,'plus');
+ }
+ }
+ var body_mouseup = function(){
+ $body.unbind('mousemove', body_mousemove);
+ $body.unbind('mouseup', body_mouseup);
+ self.BuildingBlock.editor_busy = false;
+ self.$target.removeClass("resize_editor_busy");
+ };
+ $body.mousemove(body_mousemove);
+ $body.mouseup(body_mouseup);
+ });
+ },
+ change_width:function(event, target ,target_width, offset, type){
+ var self = this;
+ if(type == 'plus'){
+ var width = event.pageX-offset;
+ }else{
+ var width = offset + target_width - event.pageX;
+ }
+ target.css("width", width + "px");
+ self.BuildingBlock.cover_target(self.$overlay, self.$target);
+ return;
+ },
+ get_int_width: function ($el) {
+ var el_width = $el.css('width');
+ return parseInt(el_width);
+ },
+ get_max_width: function ($el) {
+ var max_width = 0;
+ var self = this;
+ _.each($el.siblings(),function(sib){
+ max_width += self.get_int_width($(sib));
+ })
+ return this.container_width - max_width;
+ },
+ on_clone: function ($clone) {
+ var clone_index = $(this.$target).index();
+ var $table = this.$target.parents('table[data-max-width]');
+ if($table.length == 1){
+ _.each($table.find('tbody>tr'),function(row){
+ var clone_selector = 'td:eq(' + clone_index + ')';
+ var $col_to_clone = $(row).find(clone_selector);
+ if($col_to_clone.length != 0){
+ $col_to_clone.after($col_to_clone.clone());
+ }
+ });
+ }
+ this._super($clone);
+ this.BuildingBlock.cover_target(this.$overlay, this.$target);
+ },
+ on_remove: function () {
+ var remove_index = $(this.$target).index();
+ var $table = this.$target.parents('table[data-max-width]');
+ if($table.length == 1){
+ _.each($table.find('tbody>tr'),function(row){
+ var remove_selector = 'td:eq(' + remove_index + ')';
+ $(row).find(remove_selector).remove();
+ });
+ }
+ this._super();
+ this.BuildingBlock.cover_target(this.$overlay, this.$target);
+ },
});
+
+ var fn_popover_update = $.summernote.eventHandler.popover.update;
+ $.summernote.eventHandler.popover.update = function ($popover, oStyle, isAirMode) {
+ fn_popover_update.call(this, $popover, oStyle, isAirMode);
+ $("span.o_table_handler, div.note-table").remove();
+ };
+
website.EditorBar.include({
- edit: function () {
+ start: function () {
+ var self = this;
+ if (location.search.indexOf("enable_editor") !== -1) {
+ this.on('rte:ready', this, function () {
+ $("#choose_template").off("click").on("click", _.bind(self.on_choose_template, self));
+ $(".theme_thumbnail [data-snippet-theme]").off("click").on("click", _.bind(self.on_set_snippet_theme, self));
+ $("#wrapwrap").on('click', function (event) {
+ if ($(event.target).is("#wrapwrap")) {
+ setTimeout(function () {
+ var node = $("#wrapwrap .o_editable:first *")
+ .filter(function () { return this.textContent.match(/\S|\u00A0/); })
+ .add($("#wrapwrap .o_editable:first"))
+ .last()[0];
+ $.summernote.core.range.create(node, $.summernote.core.dom.nodeLength(node)).select();
+ },0);
+ }
+ });
+ });
+ this.on("snippets:ready", this, _.bind(self.display_theme_from_html, self));
+ }
+ return this._super.apply(this, arguments);
+ },
+ display_theme_from_html: function () {
+ var theme = $("#wrapwrap .o_editable:first [data-snippet-theme]").data("snippet-theme");
+ if (theme) {
+ $("#choose_template").show();
+ this.set_snippet_theme(theme);
+ } else {
+ $("#choose_template").hide();
+ this.on_choose_template();
+ }
+ var mailing_model = JSON.parse($.deparam(location.search).datarecord).mailing_model;
+ if (mailing_model) {
+ this.get_snippet_template( mailing_model );
+ }
+ },
+
+ on_choose_template: function (event) {
+ if (event) {
+ $("#choose_template").show();
+ }
+ var $editable = $("#wrapwrap .o_editable:first");
+ $(".o_table_handler").remove();
+ $editable.parent().add("#oe_snippets, #templates, .note-popover").toggleClass("hidden");
+ $("#choose_template").children().toggleClass("hidden");
+ $("body").trigger("resize");
+ $(window.top).trigger('resize');
+ },
+ on_set_snippet_template: function (event) {
+ var $editable = $("#wrapwrap .o_editable:first");
+ 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");
+ $("#choose_template").children().toggleClass("hidden");
+ setTimeout(function () {
+ $("body").trigger("resize");
+ $("body")[0].scrollTop = 0;
+ },0);
+ event.preventDefault();
+ },
+ on_set_snippet_theme: function (event) {
+ this.set_snippet_theme($(event.target).data("snippet-theme"));
+ this.on_choose_template(event);
+ 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");
+ },
+ get_snippet_template: function (mailing_model) {
+ var self = this;
+ var domain = [['model', '=', mailing_model]];
+ session.model('mail.template').call('search_read', [domain]).then(function (datas) {
+ var $template = $("#templates > div:last").addClass("hidden");
+ var $tclone = $template.find("> div > div:first");
+ $tclone.siblings().remove();
+ _.each(datas, function (data) {
+ if (!data.body_html) {
+ return;
+ }
+ $template.removeClass("hidden");
+ var $clone = $tclone.clone().removeClass("hidden");
+ $clone.find("p:first").html(data.name);
+ $clone.find(".template_preview").html(data.body_html);
+ $tclone.after($clone);
+ });
+
+ $(".js_template_set").off("click").on("click", _.bind(self.on_set_snippet_template, self));
+ });
+ }
+ });
+
+ var cache = {};
+ var rulesCache = [];
+ website.getMatchedCSSRules = function getMatchedCSSRules(a) {
+ if(cache[a.tagName + "." +a.className]) {
+ return cache[a.tagName + "." +a.className];
+ }
+ if (!rulesCache.length) {
+ var sheets = document.styleSheets;
+ for(var i = 0; i < sheets.length; i++) {
+ var rules = sheets[i].rules || sheets[i].cssRules;
+ if (rules) {
+ for(var r = 0; r < rules.length; r++) {
+ var selectorText = rules[r].selectorText;
+ if (selectorText &&
+ rules[r].cssText &&
+ selectorText.indexOf(".") !== -1 &&
+ selectorText.indexOf(":hover") === -1 &&
+ selectorText.indexOf(":before") === -1 &&
+ selectorText.indexOf(":after") === -1 &&
+ selectorText.indexOf(":active") === -1 &&
+ selectorText.indexOf(":link") === -1 &&
+ selectorText.indexOf("::") === -1) {
+ var st = selectorText.split(/\s*,\s*/);
+ for (var k=0; k<st.length; k++) {
+ rulesCache.push({
+ 'selector': st[k],
+ 'style': rules[r].style,
+ 'point': st[k].split(/\s+/).length
+ });
+ }
+ }
+ }
+ }
+ }
+
+ rulesCache.sort(function (a,b) {
+ return a.point-b.point;
+ });
+ }
+
+ var css = [];
+ a.matches = a.matches || a.webkitMatchesSelector || a.mozMatchesSelector || a.msMatchesSelector || a.oMatchesSelector;
+ for(var r = 0; r < rulesCache.length; r++) {
+ if (a.matches(rulesCache[r].selector)) {
+ var style = rulesCache[r].style;
+ if (style.parentRule) {
+ var style_obj = {};
+ for (var k=0, len=style.length; k<len; k++) {
+ style_obj[style[k]] = style[style[k]];
+ }
+ rulesCache[r].style = style = style_obj;
+ }
+ css.push(style);
+ }
+ }
+
+ var style = {};
+ _.each(css, function (v,k) {
+ _.each(v, function (v,k) {
+ if (!style[k] || style[k].indexOf('important') === -1 || v.indexOf('important') !== -1) {
+ style[k] = v;
+ }
+ });
+ });
+
+ return cache[a.tagName + "." +a.className] = style;
+ };
+
+ $.fn.bindFirst = function(name, fn) {
+ this.bind(name, fn);
+ var handlers = $._data($(this).get(0), 'events')[name.split('.')[0]];
+ var handler = handlers.pop();
+ handlers.splice(0, 0, handler);
+ };
+
+ website.snippet.BuildingBlock.include({
+ start: function () {
+ var self = this;
this._super();
- $('body').on('click','#save_and_continue',_.bind(this.save_and_continue));
+ setTimeout(function () {
+ self.img_to_font();
+ self.style_to_class();
+ });
},
- save_and_continue: function() {
- openerp.website.editor_bar.save();
- window.location = $("#save_and_continue").attr("href");
+
+ _get_snippet_url: function () {
+ return snippets_url;
+ },
+ clean_for_save: function () {
+ this._super();
+ this.class_to_style();
+ this.font_to_img();
+ var $editable = $("#wrapwrap .o_editable:first");
+ 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 = $("#wrapwrap .o_editable:first [data-snippet-theme]").removeAttr("data-snippet-theme").removeData("snippet-theme");
+ $editable.children().first().attr("data-snippet-theme", theme);
+ $editable.find(":hidden").remove();
+ },
+ // convert font awsome into image
+ font_to_img: function () {
+ $("#wrapwrap .fa").each(function () {
+ var $font = $(this);
+ var content;
+ _.find(website.editor.fontIcons, function (font) {
+ return _.find(website.editor.getCssSelectors(font.parser), function (css) {
+ if ($font.is(css[0].replace(/::?before$/, ''))) {
+ content = css[1].match(/content:\s*['"](.)['"]/)[1];
+ return true;
+ }
+ });
+ });
+ if (content) {
+ var size = parseInt(parseFloat($font.css("font-size"))/parseFloat($font.parent().css("font-size")),10);
+ var src = _.str.sprintf('/website_mail/font_to_img/%s/%s/'+$font.width(), window.encodeURI(content), window.encodeURI($font.css("color")));
+ var $img = $("<img/>").attr("src", src)
+ .attr("data-class", $font.attr("class"))
+ .attr("style", $font.attr("style"))
+ .css({"height": size+"em"}).css("font-size", "");
+ $font.replaceWith($img);
+ } else {
+ $font.remove();
+ }
+ });
+ },
+ // convert image into font awsome
+ img_to_font: function () {
+ $("#wrapwrap img[src*='/website_mail/font_to_img/']").each(function () {
+ var $img = $(this);
+ var $font = $("<span/>").attr("class", $img.data("class")).attr("style", $img.attr("style")).css("height", "");
+ $img.replaceWith($font);
+ });
+ },
+
+ class_to_style: function () {
+ var $editable = $("#wrapwrap .o_editable:first");
+ var selector = _.map(rulesCache, function (a) { return a.selector;}).join(",");
+ $editable.find(selector).each(function () {
+ var $target = $(this);
+ var css = website.getMatchedCSSRules(this);
+ var style = $target.attr("style") || "";
+ _.each(css, function (v,k) {
+ if (style.indexOf(k) === -1) {
+ style = k+":"+v+";"+style;
+ }
+ });
+ $target.attr("style", style);
+ });
+ },
+
+ style_to_class: function () {
+ var cache = {};
+ var $editable = $("#wrapwrap .o_editable:first");
+ website.getMatchedCSSRules($editable[0]);
+ var selector = _.map(rulesCache, function (a) { return a.selector;}).join(",");
+ var $c = $('<span/>').appendTo("body");
+ $editable.find(selector).each(function () {
+ var $target = $(this);
+ var css = website.getMatchedCSSRules(this);
+ var style = "";
+ _.each(css, function (v,k) {
+ if (style.indexOf(k) === -1) {
+ style = k+":"+v+";"+style;
+ }
+ });
+ css = $c.attr("style", style).attr("style").split(/\s*;\s*/);
+ style = $target.attr("style") || "";
+ _.each(css, function (v) {
+ style = style.replace(v, '');
+ });
+ $target.attr("style", style.replace(/;+(\s;)*/g, ';').replace(/^;/g, ''));
+ });
+ $c.remove();
}
});
-})();
+
+ window.top.openerp[callback+"_set_value"] = function (value, fields_values) {
+ var $editable = $("#wrapwrap .o_editable:first");
+ value = value || "";
+ if (value.indexOf('on_change_model_and_list') === -1 && value !== $editable.html()) {
+ openerp.website.editor_bar.rte.historyRecordUndo($editable, true);
+ openerp.website.editor_bar.snippets.make_active(false);
+
+ $editable.html(value);
+
+ openerp.website.editor_bar.snippets.img_to_font();
+ openerp.website.editor_bar.snippets.style_to_class();
+ openerp.website.editor_bar.display_theme_from_html();
+ } else {
+ $editable.trigger("content_changed");
+ }
+ if (fields_values.mailing_model) {
+ openerp.website.editor_bar.get_snippet_template(fields_values.mailing_model);
+ }
+ };
+
+})(); \ No newline at end of file