@richscripts/richtexteditor 2.9.0 → 2.11.0

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.
@@ -165,7 +165,8 @@ function RTE_Plugin_ImageEditor() {
165
165
  savebtn.innerText = "Saving...";
166
166
 
167
167
  var dataurl = imgeditor.toDataURL();
168
- if (!config.file_upload_handler) {
168
+ var uploadHandler = config.file_upload_handler || window.rte_file_upload_handler;
169
+ if (!uploadHandler) {
169
170
  img.src = dataurl;
170
171
  editor.notifySelectionChange();
171
172
  dialoginner.close();
@@ -174,7 +175,7 @@ function RTE_Plugin_ImageEditor() {
174
175
 
175
176
  var file = dataURLToBlob(dataurl);
176
177
 
177
- config.file_upload_handler(file, function (url, error) {
178
+ uploadHandler(file, function (url, error) {
178
179
  if (url) {
179
180
  img.src = url;
180
181
  editor.notifySelectionChange();
@@ -100,6 +100,12 @@ function RTE_Plugin_RubyAnnotation() {
100
100
  "@supports (display:ruby){.rte-ruby-annotated>rp{display:none;}}"
101
101
  ].join("");
102
102
  hostDoc.head.appendChild(style);
103
+ // A <style> element's rules are dropped under a strict style-src; this
104
+ // re-injects them through the CSSOM in that case only. Missed in 2.9.0,
105
+ // found by auditing the FULL bundle rather than a sample of plugins.
106
+ if (editor && typeof editor.ensureStyleSheetLive === "function") {
107
+ editor.ensureStyleSheetLive(hostDoc, style, "rte-ruby-style", style.textContent);
108
+ }
103
109
  }
104
110
 
105
111
  function editableRoot() {
@@ -552,6 +552,12 @@ function RTE_Plugin_StateInspector() {
552
552
  "@media (max-width: 1100px){.rte-state-inspector-shell{display:block;}.rte-state-inspector-panel{margin-top:12px;max-width:none;width:100%;}.rte-state-inspector-body{max-height:340px;}}"
553
553
  ].join("");
554
554
  hostDoc.head.appendChild(style);
555
+ // A <style> element's rules are dropped under a strict style-src; this
556
+ // re-injects them through the CSSOM in that case only. Missed in 2.9.0,
557
+ // found by auditing the FULL bundle rather than a sample of plugins.
558
+ if (editor && typeof editor.ensureStyleSheetLive === "function") {
559
+ editor.ensureStyleSheetLive(hostDoc, style, "rte-state-inspector-style", style.textContent);
560
+ }
555
561
  }
556
562
 
557
563
  function ensureShell() {