From 3fe5b817c3799bb02a6933b8ebc31ebc2f778956 Mon Sep 17 00:00:00 2001 From: vahid Date: Sat, 31 Jul 2021 19:00:57 +0430 Subject: [PATCH 1/7] fix tinymce 5.6 in edit content --- dist/jquery.grideditor.js | 2 +- dist/jquery.grideditor.min.js | 2 +- dist/jquery.grideditor.min.js.map | 2 +- package-lock.json | 3977 ++++++++++++++++++++++++++++- src/js/jquery.grideditor.js | 2 +- 5 files changed, 3966 insertions(+), 19 deletions(-) diff --git a/dist/jquery.grideditor.js b/dist/jquery.grideditor.js index 3c1c42e..feaf04a 100644 --- a/dist/jquery.grideditor.js +++ b/dist/jquery.grideditor.js @@ -221,7 +221,7 @@ $.fn.gridEditor = function( options ) { } function initRTE(e) { - if ($(this).hasClass('ge-rte-active')) { return; } + // if ($(this).hasClass('ge-rte-active')) { return; } var rte = getRTE($(this).data('ge-content-type')); if (rte) { diff --git a/dist/jquery.grideditor.min.js b/dist/jquery.grideditor.min.js index 060fe20..01b3b39 100644 --- a/dist/jquery.grideditor.min.js +++ b/dist/jquery.grideditor.min.js @@ -1,2 +1,2 @@ -!function(z){z.fn.gridEditor=function(I){var t=this,e=t.data("grideditor");if("getHtml"==I){if(e){e.deinit();var n=t.html();return e.init(),n}return t.html()}if("remove"!=I)return t.each(function(t,a){a=z(a);var i,s,r,c,l,d=z.extend({new_row_layouts:[[12],[6,6],[4,4,4],[3,3,3,3],[2,2,2,2,2,2],[2,8,2],[4,8],[8,4]],row_classes:[{label:"Example class",cssClass:"example-class"}],col_classes:[{label:"Example class",cssClass:"example-class"}],col_tools:[],row_tools:[],custom_filter:"",content_types:["tinymce"],valid_col_sizes:[1,2,3,4,5,6,7,8,9,10,11,12],source_textarea:""},I),f=["col-lg-","col-sm-","col-"],u=0,h=12;if(d.source_textarea){var e=z(d.source_textarea).val();if(0"+e+"").find(".row").addBack(".row").length){var n=E(),o=_(12).appendTo(n);o.find(".ge-content").html(e),e=o.html()}a.html(e)}if(a.children().length&&!a.find("div.row").length){var v=a.children();z('
').appendTo(a).find(".col-lg-12").append(v)}function m(t){var e=z(window);e.scrollTop()>s.offset().top&&e.scrollTop() .ge-tools-drawer").length){var e=z('
').prependTo(t);y(e,"Move","ge-move","fa fa-arrows-alt"),y(e,"Settings","","fa fa-cog",function(){n.toggle()}),d.row_tools.forEach(function(t){y(e,t.title||"",t.className||"",t.iconClass||"fa fa-wrench",t.on)}),y(e,"Remove row","","fa fa-trash-alt",function(){window.confirm("Delete row?")&&t.slideUp(function(){t.remove()})}),y(e,"Add column","ge-add-column","fa fa-plus-circle",function(){t.append(_(3)),p()});var n=C(t,d.row_classes).appendTo(e)}}),i.find(".column").each(function(){var i=z(this);if(!i.find("> .ge-tools-drawer").length){var e=z('
').prependTo(i);y(e,"Move","ge-move","fa fa-arrows-alt"),y(e,"Make column narrower\n(hold shift for min)","ge-decrease-col-width","fa fa-minus",function(t){var e=d.valid_col_sizes,n=f[u],o=e.indexOf(b(i,n)),a=e[D(o-1,0,e.length-1)];t.shiftKey&&(a=e[0]),k(i,n,Math.max(a,1))}),y(e,"Make column wider\n(hold shift for max)","ge-increase-col-width","fa fa-plus",function(t){var e=d.valid_col_sizes,n=f[u],o=e.indexOf(b(i,n)),a=e[D(o+1,0,e.length-1)];t.shiftKey&&(a=b(i)+function(t){return h-function(t){var e=f[u],n=0;return t.find('> [class*="'+e+'"]').each(function(){n+=b(z(this))}),n}(t)}(i.parent())),k(i,n,Math.min(a,h))}),y(e,"Settings","","fa fa-cog",function(){t.toggle()}),d.col_tools.forEach(function(t){y(e,t.title||"",t.className||"",t.iconClass||"fa fa-wrench",t.on)}),y(e,"Remove col","","fa fa-trash-alt",function(){window.confirm("Delete column?")&&i.animate({opacity:"hide",width:"hide",height:"hide"},400,function(){i.remove()})}),y(e,"Add row","ge-add-row","fa fa-plus-circle",function(){var t=E();i.append(t),t.append(_(6)).append(_(6)),p()});var t=C(i,d.col_classes).appendTo(e)}}),function(){function t(t,e){e.placeholder.css({height:e.item.outerHeight()})}i.find(".row").sortable({items:"> .column",connectWith:".ge-canvas .row",handle:"> .ge-tools-drawer .ge-move",start:t,tolerance:"pointer",helper:"clone"}),i.add(i.find(".column")).sortable({items:"> .row, > .ge-content",connectsWith:".ge-canvas, .ge-canvas .column",handle:"> .ge-tools-drawer .ge-move",start:t,helper:"clone"})}(),R(u)}function w(){i.removeClass("ge-editing");i.find(".ge-content").removeClass("ge-rte-active").each(function(){var t=z(this);A(t.data("ge-content-type")).deinit(d,t)});i.find(".ge-tools-drawer").remove(),i.add(i.find(".column")).add(i.find(".row")).sortable("destroy"),x(!1)}function y(t,e,n,o,a){var i=z('').appendTo(t);"function"==typeof a&&i.on("click",a),"object"==typeof a&&z.each(a,function(t,e){i.on(t,e)})}function C(n,t){var e=z('
');z('').attr("placeholder","id").val(n.attr("id")).attr("title","Set a unique identifier").appendTo(e).change(function(){n.attr("id",this.value)});var o=z('
').appendTo(e);return t.forEach(function(t){var e=z('').html(t.label).attr("title",t.title?t.title:'Toggle "'+t.label+'" styling').toggleClass("active btn-primary",n.hasClass(t.cssClass)).on("click",function(){e.toggleClass("active btn-primary"),n.toggleClass(t.cssClass,e.hasClass("active"))}).appendTo(o)}),e}function b(t,e){for(var n=T(t),o=0;o')}function _(e){return z("
").addClass(f.map(function(t){return t+e}).join(" ")).append(j().html(A(d.content_types[0]).initialContent))}function x(n){d.custom_filter.length&&z.each(d.custom_filter,function(t,e){"string"==typeof e&&(e=window[e]),e(i,n)})}function M(t){if(t.length){var e=j().insertAfter(t.last());t.appendTo(e),t=z()}}function j(){return z("
").addClass("ge-content ge-content-type-"+d.content_types[0]).attr("data-ge-content-type",d.content_types[0])}function R(n){u=n;["ge-layout-desktop","ge-layout-tablet","ge-layout-phone"].forEach(function(t,e){i.toggleClass(t,e==n)})}function A(t){return z.fn.gridEditor.RTEs[t]}function D(t,e,n){return Math.min(n,Math.max(e,t))}!function(){i=a.addClass("ge-canvas"),l=z('