mjmlhelper 2.1.1 → 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -57,5 +57,14 @@
57
57
  text-align: center !important;
58
58
  }
59
59
  }
60
+ /* more aggressive (disabled) */
61
+ /*
62
+ @media only screen and (max-width: 500px) {
63
+ *[style*='text-align:left'],
64
+ *[style*='text-align: left'] {
65
+ text-align: center !important;
66
+ }
67
+ }
68
+ */
60
69
  </style>
61
70
  </mj-raw>
package/mjmlhelper.js CHANGED
@@ -75,6 +75,11 @@ class mjmlhelper {
75
75
  data.substring(0, pos) +
76
76
  ' body[spellcheck="false"] > div:first-child, body[spellcheck="false"] > div:first-child + div { max-width:600px;margin:0 auto; } ' +
77
77
  data.substring(pos);
78
+ // move inline wysiwyg overlay to bottom
79
+ data =
80
+ data.substring(0, pos) +
81
+ ' .tox-editor-header[style*="top: 0px"] { top:auto !important; bottom:0 !important; } ' +
82
+ data.substring(pos);
78
83
  // hide tinymce overlay that always goes in the way
79
84
  data =
80
85
  data.substring(0, pos) +
@@ -84,7 +89,26 @@ class mjmlhelper {
84
89
  data = data.substring(0, pos) + ' body.cred_modal:before { display: none !important; } ' + data.substring(pos);
85
90
  // fix font size 0 problem (https://github.com/vielhuber/mjmlhelper/issues/1)
86
91
  data = data.substring(0, pos) + ' .mce-content-body { font-size: 13px; } ' + data.substring(pos);
87
-
92
+ // fix problem where img sizes get overwritten
93
+ data = data.substring(0, pos) + ' .preserve-cr-full-size { width:100% !important; height:auto !important; } ' + data.substring(pos);
94
+ positions = this.findAllPositions('<img', data);
95
+ shift = 0;
96
+ positions.forEach(positions__value => {
97
+ let begin = positions__value + shift,
98
+ end = data.indexOf('>', begin) + '>'.length,
99
+ tag = data.substring(begin, end);
100
+ if( tag.indexOf('width:100%') > -1 ) {
101
+ if( tag.indexOf('class="') > -1 ) {
102
+ data = data.substring(0, begin) + tag.replace('class="', 'class="preserve-cr-full-size ') + data.substring(end);
103
+ shift += 'class="preserve-cr-full-size '.length - 'class="'.length;
104
+ }
105
+ else {
106
+ data = data.substring(0, begin) + tag.replace('<img ', '<img class="preserve-cr-full-size" ') + data.substring(end);
107
+ shift += '<img class="preserve-cr-full-size" '.length - '<img '.length;
108
+ }
109
+ }
110
+ });
111
+
88
112
  // placeholders
89
113
  data = this.replaceAll(data, '%UNSUBSCRIBE%', '{UNSUBSCRIBE}');
90
114
  data = this.replaceAll(data, '%WEBVERSION%', '{ONLINE_VERSION}');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mjmlhelper",
3
- "version": "2.1.1",
3
+ "version": "2.1.4",
4
4
  "description": "",
5
5
  "main": "mjmlhelper.js",
6
6
  "dependencies": {