]> git.parisson.com Git - teleforma.git/commitdiff
Fix tinymce
authorYoan Le Clanche <yoanl@pilotsystems.net>
Thu, 13 Jan 2022 14:10:30 +0000 (15:10 +0100)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Thu, 13 Jan 2022 14:10:30 +0000 (15:10 +0100)
teleforma/static/django_tinymce/init_tinymce.js [deleted file]

diff --git a/teleforma/static/django_tinymce/init_tinymce.js b/teleforma/static/django_tinymce/init_tinymce.js
deleted file mode 100644 (file)
index 99c141a..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-(function ($) {
-  function initTinyMCE($e) {
-    if ($e.parents('.empty-form').length == 0) {  // Don't do empty inlines
-      var mce_conf = $.parseJSON($e.attr('data-mce-conf'));
-      var id = $e.attr('id');
-      if ('elements' in mce_conf && mce_conf['mode'] == 'exact') {
-        mce_conf['elements'] = id;
-      }
-      if ($e.attr('data-mce-gz-conf')) {
-        tinyMCE_GZ.init($.parseJSON($e.attr('data-mce-gz-conf')));
-      }
-      if (!tinyMCE.editors[id]) {
-        tinyMCE.init(mce_conf);
-      }
-    }
-  }
-
-  $(function () {
-    // initialize the TinyMCE editors on load
-    $('.tinymce').each(function () {
-      initTinyMCE($(this));
-    });
-
-    // initialize the TinyMCE editor after adding an inline
-    // XXX: We don't use jQuery's click event as it won't work in Django 1.4
-    document.body.addEventListener("click", function(ev) {
-      if(!ev.target.parentNode || ev.target.parentNode.className.indexOf("add-row") === -1) {
-        return;
-      }
-      var $addRow = $(ev.target.parentNode);
-      setTimeout(function() {  // We have to wait until the inline is added
-        $('textarea.tinymce', $addRow.parent()).each(function () {
-          initTinyMCE($(this));
-        });
-      }, 0);
-    }, true);
-  });
-}(jQuery));