wysiwyg-rails 4.5.0 → 4.5.1
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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/froala_editor.min.js +2 -2
- data/app/assets/javascripts/froala_editor.pkgd.min.js +2 -2
- data/app/assets/javascripts/languages/ar.js +1 -1
- data/app/assets/javascripts/languages/bs.js +1 -1
- data/app/assets/javascripts/languages/cs.js +1 -1
- data/app/assets/javascripts/languages/da.js +1 -1
- data/app/assets/javascripts/languages/de.js +1 -1
- data/app/assets/javascripts/languages/el.js +1 -1
- data/app/assets/javascripts/languages/en_ca.js +1 -1
- data/app/assets/javascripts/languages/en_gb.js +1 -1
- data/app/assets/javascripts/languages/es.js +1 -1
- data/app/assets/javascripts/languages/et.js +1 -1
- data/app/assets/javascripts/languages/fa.js +1 -1
- data/app/assets/javascripts/languages/fi.js +1 -1
- data/app/assets/javascripts/languages/fr.js +1 -1
- data/app/assets/javascripts/languages/he.js +1 -1
- data/app/assets/javascripts/languages/hr.js +1 -1
- data/app/assets/javascripts/languages/hu.js +1 -1
- data/app/assets/javascripts/languages/id.js +1 -1
- data/app/assets/javascripts/languages/it.js +1 -1
- data/app/assets/javascripts/languages/ja.js +1 -1
- data/app/assets/javascripts/languages/ko.js +1 -1
- data/app/assets/javascripts/languages/ku.js +1 -1
- data/app/assets/javascripts/languages/me.js +1 -1
- data/app/assets/javascripts/languages/nb.js +1 -1
- data/app/assets/javascripts/languages/nl.js +1 -1
- data/app/assets/javascripts/languages/pl.js +1 -1
- data/app/assets/javascripts/languages/pt_br.js +1 -1
- data/app/assets/javascripts/languages/pt_pt.js +1 -1
- data/app/assets/javascripts/languages/ro.js +1 -1
- data/app/assets/javascripts/languages/ru.js +1 -1
- data/app/assets/javascripts/languages/sk.js +1 -1
- data/app/assets/javascripts/languages/sl.js +1 -1
- data/app/assets/javascripts/languages/sr.js +1 -1
- data/app/assets/javascripts/languages/sv.js +1 -1
- data/app/assets/javascripts/languages/th.js +1 -1
- data/app/assets/javascripts/languages/tr.js +1 -1
- data/app/assets/javascripts/languages/uk.js +1 -1
- data/app/assets/javascripts/languages/vi.js +1 -1
- data/app/assets/javascripts/languages/zh_cn.js +1 -1
- data/app/assets/javascripts/languages/zh_tw.js +1 -1
- data/app/assets/javascripts/plugins/align.min.js +2 -2
- data/app/assets/javascripts/plugins/char_counter.min.js +1 -1
- data/app/assets/javascripts/plugins/code_beautifier.min.js +2 -2
- data/app/assets/javascripts/plugins/code_view.min.js +1 -1
- data/app/assets/javascripts/plugins/colors.min.js +1 -1
- data/app/assets/javascripts/plugins/cryptojs.min.js +1 -1
- data/app/assets/javascripts/plugins/draggable.min.js +1 -1
- data/app/assets/javascripts/plugins/edit_in_popup.min.js +1 -1
- data/app/assets/javascripts/plugins/emoticons.min.js +1 -1
- data/app/assets/javascripts/plugins/entities.min.js +1 -1
- data/app/assets/javascripts/plugins/file.min.js +1 -1
- data/app/assets/javascripts/plugins/files_manager.min.js +1 -1
- data/app/assets/javascripts/plugins/filestack.min.js +2 -2
- data/app/assets/javascripts/plugins/font_family.min.js +1 -1
- data/app/assets/javascripts/plugins/font_size.min.js +1 -1
- data/app/assets/javascripts/plugins/forms.min.js +1 -1
- data/app/assets/javascripts/plugins/fullscreen.min.js +1 -1
- data/app/assets/javascripts/plugins/help.min.js +1 -1
- data/app/assets/javascripts/plugins/image.min.js +1 -1
- data/app/assets/javascripts/plugins/image_manager.min.js +1 -1
- data/app/assets/javascripts/plugins/inline_class.min.js +1 -1
- data/app/assets/javascripts/plugins/inline_style.min.js +1 -1
- data/app/assets/javascripts/plugins/line_breaker.min.js +1 -1
- data/app/assets/javascripts/plugins/line_height.min.js +1 -1
- data/app/assets/javascripts/plugins/link.min.js +1 -1
- data/app/assets/javascripts/plugins/lists.min.js +1 -1
- data/app/assets/javascripts/plugins/markdown.min.js +1 -1
- data/app/assets/javascripts/plugins/paragraph_format.min.js +1 -1
- data/app/assets/javascripts/plugins/paragraph_style.min.js +1 -1
- data/app/assets/javascripts/plugins/print.min.js +1 -1
- data/app/assets/javascripts/plugins/quick_insert.min.js +1 -1
- data/app/assets/javascripts/plugins/quote.min.js +1 -1
- data/app/assets/javascripts/plugins/save.min.js +1 -1
- data/app/assets/javascripts/plugins/special_characters.min.js +1 -1
- data/app/assets/javascripts/plugins/table.min.js +2 -2
- data/app/assets/javascripts/plugins/track_changes.min.js +2 -2
- data/app/assets/javascripts/plugins/trim_video.min.js +1 -1
- data/app/assets/javascripts/plugins/url.min.js +1 -1
- data/app/assets/javascripts/plugins/video.min.js +1 -1
- data/app/assets/javascripts/plugins/word_counter.min.js +1 -1
- data/app/assets/javascripts/plugins/word_paste.min.js +1 -1
- data/app/assets/javascripts/plugins.pkgd.min.js +2 -2
- data/app/assets/javascripts/third_party/embedly.min.js +1 -1
- data/app/assets/javascripts/third_party/font_awesome.min.js +1 -1
- data/app/assets/javascripts/third_party/image_tui.min.js +1 -1
- data/app/assets/javascripts/third_party/showdown.min.js +1 -1
- data/app/assets/javascripts/third_party/spell_checker.min.js +1 -1
- data/app/assets/stylesheets/froala_editor.css +1 -1
- data/app/assets/stylesheets/froala_editor.min.css +1 -1
- data/app/assets/stylesheets/froala_editor.pkgd.css +12 -2
- data/app/assets/stylesheets/froala_editor.pkgd.min.css +2 -2
- data/app/assets/stylesheets/froala_style.css +1 -1
- data/app/assets/stylesheets/froala_style.min.css +1 -1
- data/app/assets/stylesheets/plugins/char_counter.css +1 -1
- data/app/assets/stylesheets/plugins/char_counter.min.css +1 -1
- data/app/assets/stylesheets/plugins/code_view.css +1 -1
- data/app/assets/stylesheets/plugins/code_view.min.css +1 -1
- data/app/assets/stylesheets/plugins/colors.css +1 -1
- data/app/assets/stylesheets/plugins/colors.min.css +1 -1
- data/app/assets/stylesheets/plugins/draggable.css +1 -1
- data/app/assets/stylesheets/plugins/draggable.min.css +1 -1
- data/app/assets/stylesheets/plugins/emoticons.css +1 -1
- data/app/assets/stylesheets/plugins/emoticons.min.css +1 -1
- data/app/assets/stylesheets/plugins/file.css +1 -1
- data/app/assets/stylesheets/plugins/file.min.css +1 -1
- data/app/assets/stylesheets/plugins/files_manager.css +1 -1
- data/app/assets/stylesheets/plugins/files_manager.min.css +1 -1
- data/app/assets/stylesheets/plugins/filestack.css +1 -1
- data/app/assets/stylesheets/plugins/filestack.min.css +1 -1
- data/app/assets/stylesheets/plugins/fullscreen.css +1 -1
- data/app/assets/stylesheets/plugins/fullscreen.min.css +1 -1
- data/app/assets/stylesheets/plugins/help.css +1 -1
- data/app/assets/stylesheets/plugins/help.min.css +1 -1
- data/app/assets/stylesheets/plugins/image.css +1 -1
- data/app/assets/stylesheets/plugins/image.min.css +1 -1
- data/app/assets/stylesheets/plugins/image_manager.css +1 -1
- data/app/assets/stylesheets/plugins/image_manager.min.css +1 -1
- data/app/assets/stylesheets/plugins/line_breaker.css +1 -1
- data/app/assets/stylesheets/plugins/line_breaker.min.css +1 -1
- data/app/assets/stylesheets/plugins/markdown.css +1 -1
- data/app/assets/stylesheets/plugins/markdown.min.css +1 -1
- data/app/assets/stylesheets/plugins/quick_insert.css +1 -1
- data/app/assets/stylesheets/plugins/quick_insert.min.css +1 -1
- data/app/assets/stylesheets/plugins/special_characters.css +1 -1
- data/app/assets/stylesheets/plugins/special_characters.min.css +1 -1
- data/app/assets/stylesheets/plugins/table.css +12 -2
- data/app/assets/stylesheets/plugins/table.min.css +2 -2
- data/app/assets/stylesheets/plugins/trim_video.css +1 -1
- data/app/assets/stylesheets/plugins/trim_video.min.css +1 -1
- data/app/assets/stylesheets/plugins/video.css +1 -1
- data/app/assets/stylesheets/plugins/video.min.css +1 -1
- data/app/assets/stylesheets/plugins.pkgd.css +12 -2
- data/app/assets/stylesheets/plugins.pkgd.min.css +2 -2
- data/app/assets/stylesheets/themes/dark.css +4 -1
- data/app/assets/stylesheets/themes/dark.min.css +2 -2
- data/app/assets/stylesheets/themes/gray.css +4 -1
- data/app/assets/stylesheets/themes/gray.min.css +2 -2
- data/app/assets/stylesheets/themes/royal.css +4 -1
- data/app/assets/stylesheets/themes/royal.min.css +2 -2
- data/app/assets/stylesheets/third_party/embedly.css +1 -1
- data/app/assets/stylesheets/third_party/embedly.min.css +1 -1
- data/app/assets/stylesheets/third_party/font_awesome.css +1 -1
- data/app/assets/stylesheets/third_party/font_awesome.min.css +1 -1
- data/app/assets/stylesheets/third_party/image_tui.css +1 -1
- data/app/assets/stylesheets/third_party/image_tui.min.css +1 -1
- data/app/assets/stylesheets/third_party/spell_checker.css +1 -1
- data/app/assets/stylesheets/third_party/spell_checker.min.css +1 -1
- data/lib/wysiwyg-rails/version.rb +1 -1
- metadata +2 -2
@@ -1,7 +1,7 @@
|
|
1
1
|
/*!
|
2
|
-
* froala_editor v4.5.
|
2
|
+
* froala_editor v4.5.1 (https://www.froala.com/wysiwyg-editor)
|
3
3
|
* License https://froala.com/wysiwyg-editor/terms/
|
4
4
|
* Copyright 2014-2025 Froala Labs
|
5
5
|
*/
|
6
6
|
|
7
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],t):t(e.FroalaEditor)}(this,function(j){"use strict";function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=Array(t);a<t;a++)n[a]=e[a];return n}function $(e){return function t(e){if(Array.isArray(e))return i(e)}(e)||function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function n(e,t){if(e){if("string"==typeof e)return i(e,t);var a={}.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?i(e,t):void 0}}(e)||function r(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}j=j&&j.hasOwnProperty("default")?j["default"]:j,Object.assign(j.DEFAULTS,{trackChangesEnabled:!1,showChangesEnabled:!1}),j.PLUGINS.track_changes=function(P){var O=P.$;O.fn.isAfter=function(e){var t=O(this),a=t.parents(),n=e.parents(),r=t;for(var i in a){var s=e;if(a.hasOwnProperty(i)){var l=O(a[i]);for(var o in n)if(n.hasOwnProperty(o)){var c=O(n[o]);if(l[0]===c[0]){var d=r.index();return s.index()<d}s=c}r=l}}return!1};var s,r,l=[],D="",V="",B="",H="",C=[],i=[],S=null,K=[],d=!1;function o(){return l.pop()}function N(e){var t=!(!e||8!=e.keyCode),a=e&&13==e.keyCode,n=!(!e||46!=e.keyCode);if(P.opts.trackChangesEnabled){P.selection.restore(),e&&e.composing&&(P.selection.save(),P.selection.ranges()[0].collapse(!1));var r=P.selection.ranges(0),i=r.startContainer,s=!1,l=t&&0===r.startOffset&&P.$el.get(0).firstChild===i;if(t&&0===r.startOffset&&P.$el.get(0).firstChild!==i&&i!==document){for(var o=U(i);o&&o.nodeType===Node.TEXT_NODE&&1===o.length&&8203===o.textContent.charCodeAt(0);)o=U(o);o&&(i=o,s=!0)}var c=O(i).parentsUntil(P.$el,"[data-tracking=true]");if(O(i).data("tracking")&&t){P.markers.insert();var d=P.$el.find(".fr-marker");return d[0].previousSibling&&"IMG"===d[0].previousSibling.tagName||P.selection.clear(),void O(d).remove()}if(!c.length||O(i).data("tracking-deleted")&&t||"TD"==i.tagName||a){if(P.selection.isCollapsed()){if(s){var g=i;if(g&&g.nodeType!==Node.TEXT_NODE&&0<g.childNodes.length){for(var h=null,f=g.childNodes.length-1;0<=f;f--)if(g.childNodes[f].nodeType===Node.TEXT_NODE){h=g.childNodes[f];break}null!==h&&(g=h)}var p=r.cloneRange();p.setStart(g,g.length),p.setEnd(g,g.length),P.selection.get().removeAllRanges(),P.selection.get().addRange(p)}!s&&l||P.markers.insert();var u=P.$el.find(".fr-marker");if(e&&e.composing&&(u=O(u[1])),!u.length)return;var k="pending-".concat(P.id,"-").concat(P.track_changes.getPendingChanges().length),m=P.opts.showChangesEnabled?'class="fr-highlight-change"':"";if(t||n){if(t){if(!u[0].previousSibling||u[0].previousSibling.nodeType!==Node.ELEMENT_NODE||!u[0].previousSibling.lastChild||u[0].previousSibling.lastChild.nodeType!==Node.ELEMENT_NODE||"IMG"!==u[0].previousSibling.lastChild.tagName){for(;O(u[0].previousSibling).data("tracking");)u.insertBefore(u.prev());O(u[0].previousSibling).find("[data-tracking=true]").length&&u.insertBefore(O(u[0].previousSibling).find("[data-tracking=true]").eq(0))}}else if(O(i).data("tracking")){if(!i.nextSibling)return void(u[0].nextSibling&&"IMG"===u[0].nextSibling.tagName&&u[0].nextSibling.remove());u.insertBefore(i.nextSibling),G(u)}else G(u);var v=u[0]&&u[0].previousSibling?u[0].previousSibling.nodeValue:"",b=v&&v.slice(0,-(e.selectionLength?e.selectionLength:1));n&&(u[0].nextSibling&&"SPAN"!==u[0].nextSibling.tagName&&null===u[0].nextSibling.nodeValue&&u[0].nextSibling.firstChild&&u[0].nextSibling.firstChild.before(u[0]),b=(v=u[0].nextSibling?u[0].nextSibling.nodeValue:" ")&&v.slice(1)),n&&u[0].nextSibling&&"isPasted"===u[0].nextSibling.id?b=(v=u[0].nextSibling?u[0].nextSibling.textContent:" ")&&v.slice(1):t&&u[0].previousSibling&&"isPasted"===u[0].previousSibling.id&&(b=(v=u[0].previousSibling?u[0].previousSibling.textContent:" ")&&v.slice(0,-(e.selectionLength?e.selectionLength:1)));var C,S=O('<span data-tracking="true" data-track-id="'.concat(k,'" ').concat(m,"></span>")),N=O('<span data-tracking-deleted="true" class="fr-tracking-deleted" '.concat(P.helpers.isIOS()?"":'contenteditable="false"',"></span>"));P.opts.showChangesEnabled||(P.helpers.isMobile()?N.addClass("fr-track-hide-mobile"):N.addClass("fr-track-hide"));var E=!1,y=!1;if(t)try{var x=u[0]&&u[0].previousSibling;if(u[0]&&u[0].previousElementSibling&&"I"===u[0].previousElementSibling.tagName&&!v&&(C=u[0].previousElementSibling),x&&3===x.nodeType&&"SPAN"!==x.parentNode.tagName&&x.previousSibling&&"SPAN"===x.previousSibling.tagName&&" "===x.nodeValue&&0<O(x.previousSibling).find(".fr-emoticon").length?C=x.previousSibling:x&&"SPAN"===x.parentNode.tagName&&0<O(x.parentNode).find(".fr-emoticon").length?(C=x.parentNode,E=!0):x&&("SPAN"===x.tagName&&"isPasted"!==x.id||"HR"===x.tagName)?C=x:O(u).parent().prev().is("hr")?(C=O(u).parent().prev().get(0),E=y=!0):x&&"IMG"===x.tagName&&(C=x,O(S).prepend("".concat(j.MARKERS)),O(S).append("".concat(j.MARKERS))),P.helpers.isMobile()&&u[0]&&!C&&!v&&!b)return;E?(O(u[0].parentNode).after(S),y?O(u).parent().remove():O(u).remove()):u[0]?e.composing?O(u).after(S):O(u).before(S):O(H).before(S)}catch(e){H&&O(H).before(S)}else if(n){var A=u[0].nextSibling;u[0].nextElementSibling&&"I"===u[0].nextElementSibling.tagName&&!u[0].nextSibling.nodeValue?C=u[0].nextElementSibling:A&&3===A.nodeType&&"SPAN"!==A.parentNode.tagName&&A.nextSibling&&"SPAN"===A.nextSibling.tagName&&" "===A.nodeValue&&0<O(A.nextSibling).find(".fr-emoticon").length?C=A.nextSibling:A&&"SPAN"===A.parentNode.tagName&&0<O(A.parentNode).find(".fr-emoticon").length?(C=A.parentNode,E=!0):A&&"SPAN"===A.tagName&&u[0].nextSibling&&"isPasted"!==u[0].nextSibling.id?C=A:A&&"IMG"===A.tagName&&(C=A,O(S).prepend("".concat(j.MARKERS)),O(S).append("".concat(j.MARKERS))),E?(O(u[0].parentNode).before(S),O(u).remove()):O(u).after(S)}if(e.composing?K.push({span:S,"delete":N}):(P.helpers.isIOS()&&K.push({"delete":N}),O(S).prepend(N)),!C&&(C=v&&v.replace(b,""),P.helpers.isMobile()&&D&&!e.composing)){var M=P.selection.get().focusNode,_=P.selection.get().focusOffset,T=1;V&&M&&V.isSameNode(M)&&(T=B-_),C=D.replace(/\u00a0/g," ").replace(v.replace(/\u00a0/g," "),"").slice(0,T)}if(C&&(E?(O(N).append(O(O(C).get(0).outerHTML)),P.markers.insert()):O(N).append(C)),C&&0==C.length)return;P.browser.msie&&t&&(O(S).prepend("".concat(j.MARKERS)),O(S).append("".concat(j.MARKERS))),t&&(b||""===b)&&u[0].previousSibling?u[0].previousSibling.nodeValue=b:n&&(O(S).append("".concat(j.MARKERS)),u[0].nextSibling.nodeValue=b)}else{var I=j.INVISIBLE_SPACE;if(e&&P.helpers.isMobile()&&((I=u[0]&&u[0].previousSibling&&u[0].previousSibling.nodeValue?u[0].previousSibling.nodeValue.slice(-1):j.INVISIBLE_SPACE)&&u[0]&&u[0].previousSibling&&u[0].previousSibling.nodeValue?u[0].previousSibling.nodeValue=u[0].previousSibling.nodeValue.slice(0,-1):!u[0]||u[0].previousSibling||u[0].nextSibling||I!==j.INVISIBLE_SPACE||(I=P.selection.get().focusNode.nodeValue.slice(B,P.selection.get().focusOffset),P.selection.get().focusNode.nodeValue=P.selection.get().focusNode.nodeValue.slice(P.selection.get().focusOffset))),a){if(u.parent().parent().is("li"))return;var w=O("<p></p>");return void(0<u.closest("p").length&&(u.closest("p").after(w),w.append(u),P.markers.remove(),setTimeout(function(){w.prev().text()!==String.fromCharCode(8203)&&""!==w.prev().text()||w.prev().remove(),P.selection.setAfter(w[0])},1)))}u[0].previousSibling&&"BR"===u[0].previousSibling.tagName&&u[0].previousSibling.remove(),u.replaceWith('<span data-tracking="true" data-track-id="'.concat(k,'" ').concat(m,">").concat(I+j.MARKERS,"</span>"))}P.selection.restore(),P.track_changes.pushChange(k)}else{P.selection.save();var L=P.$el.find('.fr-marker[data-type="true"]').length&&P.$el.find('.fr-marker[data-type="true"]').get(0),R=P.$el.find('.fr-marker[data-type="false"]').length&&P.$el.find('.fr-marker[data-type="false"]').get(0);if(O(L).parent().hasClass("fr-emoticon")&&O(L).parent().before(L),O(L).isAfter(O(R))){var $=L;L=R,R=$}F(L,R,e&&e.deletion),P.selection.restore()}P.helpers.isMobile()&&D&&P.markers.remove()}}}function G(e){if(O(e[0].nextSibling).data("tracking")){for(;O(e[0].nextSibling).data("tracking")&&(!(0<O(e[0].previousElementSibling).find("[data-tracking-deleted=true]").length&&0<O(e[0].nextElementSibling).find("[data-tracking-deleted=true]").length)||O(e[0].previousSibling).data("tracking"));)O(e).insertAfter(e.next());e.insertBefore(e[0].previousSibling)}}function U(e){var t=e.previousSibling;if(!t){var a=O(e).parent().get(0).previousSibling;null!==a&&(t=a.lastChild||a)}return t}function F(e,t){var a=2<arguments.length&&arguments[2]!==undefined&&arguments[2];if(e&&(!e.isSameNode(t)||!O(e).hasClass("fr-marker"))){for(;e.nodeType===Node.COMMENT_NODE;)e=e.nextSibling;if(O(e).parent().is("table")&&0!==O(e).parent().next().text().length&&F(O(e).parent().next()[0],t,a),"TD"!==e.tagName||1!==e.childNodes.length||"BR"!==e.childNodes[0].tagName){if(P.node.isBlock(e)&&"HR"!==e.tagName)return P.node.hasClass(e.firstChild,"fr-marker")?F(e.firstChild.nextSibling,t,a):F(e.firstChild,t,a),!1;if("BR"===e.tagName&&"TD"===e.parentElement.tagName){var n=e.parentElement.nextElementSibling;O(e).remove(),F(n,t)}var r="pending-".concat(P.id,"-").concat(P.track_changes.getPendingChanges().length),i=P.opts.showChangesEnabled?'class="fr-highlight-change"':"",s=O('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),l=O('<span data-tracking-deleted="true" class="fr-tracking-deleted" '.concat(P.helpers.isIOS()?"":'contenteditable="false"',"></span>"));P.opts.showChangesEnabled||(P.helpers.isMobile()?l.addClass("fr-track-hide-mobile"):l.addClass("fr-track-hide"));var o=e;for(O(e).before(s),P.track_changes.pushChange(r);o&&O(o).hasClass("fr-marker");)o=o.nextSibling;for(var c=!1;o&&!c&&!O(o).hasClass("fr-marker")&&!O(o).is("[data-track-id]")&&0===O(o).find("fr-marker").length&&"UL"!==o.tagName&&"OL"!==o.tagName;){var d=o;if("IMG"===o.tagName&&O(o).data("tracking-img","true"),P.node.isBlock(o)&&"HR"!==e.tagName)return F(o.firstChild,t,a),!1;if(o)for(var g=o.childNodes,h=0;h<g.length;h++)if(g[h].className&&"fr-marker"===g[h].className){c=!0,F(o.firstChild,t,a);break}c||(o=o.nextSibling,O(l).append(d))}if(!o||"UL"!==o.tagName&&"OL"!==o.tagName||F(o,t,a),a?K.push({span:s,"delete":l}):(P.helpers.isIOS()&&K.push({"delete":l}),O(s).prepend(l)),P.browser.msie?O(s).prepend("".concat(j.INVISIBLE_SPACE+j.MARKERS)):O(s).prepend("".concat(j.INVISIBLE_SPACE)),O(s).append("".concat(j.INVISIBLE_SPACE+j.MARKERS)),!o&&!e.isSameNode(t)){for(var f=s.get(0).parentNode;f&&!f.nextSibling&&!P.node.isElement(f);)f=f.parentNode;if(f){var p=f.nextSibling;p&&(P.node.isBlock(p)?"HR"===p.tagName?F(p.nextSibling,t,a):(P.browser.mozilla&&"LI"===f.tagName&&"SPAN"===f.lastChild.tagName&&O(f.lastChild).hasClass("fr-marker")&&f.lastChild.remove(),F(p.firstChild,t,a)):F(p,t,a))}}}}}function E(e){if(P.opts.trackChangesEnabled){P.selection.restore();var t=P.selection.ranges(0).startContainer,a=O(t).parentsUntil(P.$el,"[data-tracking=true]");if(O(t).data("tracking"))return;if(!a.length&&!P.selection.isCollapsed()&&"quote"!=e){P.selection.save(),f(P.$el.find('.fr-marker[data-type="true"]').length&&P.$el.find('.fr-marker[data-type="true"]').get(0),P.$el.find('.fr-marker[data-type="false"]').length&&P.$el.find('.fr-marker[data-type="false"]').get(0));var n=P.$el.find('.fr-marker[data-type="true"]').length&&P.$el.find('.fr-marker[data-type="true"]').get(0),r=n.parentNode;if(r&&"A"===r.tagName&&r.firstChild&&"SPAN"===r.firstChild.tagName&&2<r.firstChild.childNodes.length&&"STRONG"===r.firstChild.childNodes[3].tagName)O(r.firstChild.childNodes[3].firstChild).before(n);else{for(var i=n.previousSibling.firstChild;i&&"SPAN"!==i.tagName;)i=i.nextSibling;O(i).after(n)}P.selection.restore()}}}function f(e,t,a){if(e&&!("<br>"===O(e).html()&&O(e).parent().is("td")||(O(e).parent().is("table")&&0!==O(e).parent().next().text().length&&f(O(e).parent().next()[0],t,a),O(e).is("br")&&O(e).parent().length&&O(e).parent().is("td")&&0===O(e).parent().text().length))){for(a||(a="pending-".concat(P.id,"-").concat(P.track_changes.getPendingChanges().length),P.track_changes.pushChange(a));e.nodeType===Node.COMMENT_NODE;)e=e.nextSibling;if(P.node.isBlock(e)&&"HR"!==e.tagName)return P.node.hasClass(e.firstChild,"fr-marker")?f(e.firstChild.nextSibling,t,a):f(e.firstChild,t,a),!1;var n=P.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=O('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>")),i=O('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false" style="display:none"></span>'),s=e;for(O(e).before(r);s&&O(s).hasClass("fr-marker");)s=s.nextSibling;for(var l=!1;s&&!l&&!O(s).hasClass("fr-marker")&&0===O(s).find("fr-marker").length&&"UL"!==s.tagName&&"OL"!==s.tagName;){var o=s;if(P.node.isBlock(s)&&"HR"!==e.tagName)return f(s.firstChild,t,a),!1;if(s)for(var c=s.childNodes,d=0;d<c.length;d++)if(c[d].className&&"fr-marker"===c[d].className){l=!0,f(s.firstChild,t,a);break}l||(s=s.nextSibling,O(i).append(o.cloneNode(!0)),O(r).append(o))}if(!s||"UL"!==s.tagName&&"OL"!==s.tagName||f(s,t,a),O(s).hasClass("fr-marker")&&O(r).append(s),O(r).prepend(i),O(r).prepend("".concat(j.INVISIBLE_SPACE)),O(r).append("".concat(j.INVISIBLE_SPACE)),!s&&!e.isSameNode(t)){for(var g=r.get(0).parentNode;g&&!g.nextSibling&&!P.node.isElement(g);)g=g.parentNode;if(g){var h=g.nextSibling;h&&(P.node.isBlock(h)?"HR"===h.tagName?f(h.nextSibling,t,a):f(h.firstChild,t,a):f(h,t,a))}}}}function c(e,t,a){var n=P.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=O('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>")),i=O('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');P.opts.showChangesEnabled||i.addClass("fr-track-hide"),i.append(t.get(0).innerHTML),r.append(i);var s=e.get(0).innerHTML;e.html(""),e.append(r),r.append(s)}function g(){if(P.events.trigger("image.hideResizer"),P.events.trigger("video.hideResizer"),P.html.cleanEmptyTags(!0),P.helpers.isMobile())for(var e=P.$el.find("img[data-tracking-img]"),t=0;t<e.length;t++){var a=O(e.get(t));a.parent()&&a.parent().data("tracking")||a.removeData("tracking-img")}}function e(){P.$el.find("li").each(function(){0===this.innerText.replace(/\u200B/g,"").length&&this.remove()})}function t(){var e=o();if(e){var t,a=P.$el.find("[data-track-id=".concat(e,"]"));if(a.length){var n=a.parent("a");if(n.length){var r=O(n.get(0).outerHTML).text();1===[].filter.call(r,function(e){return 8203!==e.charCodeAt(0)}).length&&(t=n)}for(var i=0;i<a.length;i++){var s=a.get(i),l=O(a).data("tracking-deleted")?O(a):O(s).find("[data-tracking-deleted=true]");l.length&&(l.get(0).remove?l.get(0).remove():l.get(0).parentNode.removeChild(l.get(0))),s.hasAttribute("style")?(O(s).removeData("tracking"),O(s).removeData("track-id"),O(s).removeClass("fr-highlight-change")):(P.selection.save(),0<O(s).find("IFRAME").length?(O(s).removeData("tracking"),O(s).removeData("track-id"),O(s).removeClass("fr-highlight-change")):s.outerHTML=s.innerHTML,P.selection.restore())}}t&&t.remove()}g()}function a(){var e=o();if(e){var t=P.$el.find("[data-track-id=".concat(e,"]"));if(t.length){P.selection.save();for(var a=t.length-1;0<=a;a--){var n=O(t).data("tracking-deleted")?O(t):O(t.get(a)).find("[data-tracking-deleted=true]");if(n.length)if(0<O(t).find("IFRAME").length)O(t).removeData("tracking"),O(t).removeData("track-id"),O(t).removeClass("fr-highlight-change"),O(t).removeClass("fr-tracking-deleted"),O(t).removeData("tracking-deleted"),O(t).removeAttr("contenteditable");else n.parent("[data-tracking=true]").data("track-id")==e?(O(t.get(a)).find("[data-tracking-deleted=true]").remove(),t.get(a).outerHTML=n.get(0).innerHTML):t.get(a).remove?t.get(a).remove():t.get(a).parentNode.removeChild(t.get(a));else t.get(a).remove?t.get(a).remove():t.get(a).parentNode.removeChild(t.get(a))}P.selection.restore()}}g()}return P.events.on("keydown",function(e){var t;if(!P.opts.trackChangesEnabled)return!0;if(s=null===(t=P.selection.get())||void 0===t||null===(t=t.focusNode)||void 0===t?void 0:t.nodeValue,P.helpers.isAndroid()){var a,n,r=P.selection.get();D=null==r||null===(a=r.focusNode)||void 0===a?void 0:a.nodeValue,V=null==r?void 0:r.focusNode,H=null===(n=V)||void 0===n?void 0:n.nextSibling,B=null==r?void 0:r.focusOffset}else if(function i(e){return(!P.keys.ctrlKey(e)||e.which!==j.KEYCODE.Z&&e.which!==j.KEYCODE.C)&&(48<=e.keyCode&&e.keyCode<=57||65<=e.keyCode&&e.keyCode<=90||97<=e.keyCode&&e.keyCode<=122||186<=e.keyCode&&e.keyCode<=222||13===e.keyCode||8===e.keyCode||32===e.keyCode||46===e.keyCode||96<=e.keyCode&&e.keyCode<=111)}(e))if(!P.keys.ctrlKey(e)||"b"!==e.key&&"i"!==e.key&&"u"!==e.key){if(P.keys.ctrlKey(e)&&"a"===e.key||P.keys.ctrlKey(e)&&"s"===e.key||P.keys.ctrlKey(e)&&"x"===e.key)return;N(e)}else E()},!0),P.events.on("cut",function(e){if(!P.opts.trackChangesEnabled)return!0;for(var t=P.selection.get().getRangeAt(0).cloneContents(),a="",n="",r=0;r<t.childNodes.length;r++){var i=t.childNodes[r],s=i.outerHTML,l=i.textContent;i.nodeType===Node.TEXT_NODE&&(l=s=i.textContent.replace(/\u200B/g,"")),a+=s,n+=l}P.paste.saveCopiedText(a,n,!0),N(e)},!0),P.events.on("keyup",function(e){if(!P.opts.trackChangesEnabled)return!0;var t;if(P.helpers.isMobile())if(r=null===(t=P.selection.get())||void 0===t||null===(t=t.focusNode)||void 0===t?void 0:t.nodeValue,d){for(var a=0;a<K.length;a++)P.opts.showChangesEnabled&&O(K[a].span).empty(),O(K[a].span).prepend(K[a]["delete"]);d=!(K=[])}else if(P.helpers.isIOS()){for(var n=0;n<K.length;n++)r&&1===r.length&&s&&1==s.length?(O(K[n]["delete"]).attr("contenteditable","true"),O(K[n]["delete"]).addClass("fr-ios-mobile-disable-select")):O(K[n]["delete"]).attr("contenteditable","false");K=[]}else{if(46===e.keyCode)return!0;N(e)}},!0),P.events.on("beforeinput",function(e){var t=e.originalEvent,a=!1;if(!P.opts.trackChangesEnabled)return!0;if(P.helpers.isAndroid()){var n=P.selection.get(),r=P.selection.ranges(0),i=r.startContainer,s=r.endContainer,l=O(i).parentsUntil(P.$el,"[data-tracking=true]"),o=O(s).parentsUntil(P.$el,"[data-tracking=true]");if("insertCompositionText"===t.inputType)if(""===t.data)a=!0;else if(n.toString().length>t.data.length){if(0<l.length||0<o.length)return d=!0,e.preventDefault(),!1;a=!0,e.composing=!0}if("insertText"!==t.inputType||P.selection.isCollapsed()||(a=!0),a||"deleteContentBackward"===t.inputType){var c;if(d=!0,i.lastChild&&!n.toString()&&null!==(c=i.lastChild.children)&&void 0!==c&&null!==(c=c.item(0))&&void 0!==c&&c.hasAttribute("contenteditable"))return;e.keyCode=8,e.deletion=!0,N(e)}}},!0),P.events.on("paste.before",function(e){P.opts.trackChangesEnabled&&P.helpers.isMobile()&&N(e)},!0),P.events.on("paste.after",function(e){if(P.opts.trackChangesEnabled){P.markers.insert();for(var t=P.$el.find(".fr-marker"),a=t.next();a.is("br");){var n=a.next();a.remove(),a=n}if(a.is("ul")||a.is("ol")){var r=t.closest("ul, ol"),i=a.children("li");i.find("[data-tracking=true]").add(i.closest("[data-tracking=true]")).addClass("fr-highlight-change");var s=0<a.closest("li").next().length?a.closest("li").next():function o(e){return e.append('<li data-temp-li="true"></li>').find("li").last()}(r);i.each(function(){var e=O(this),t="pending-".concat(P.id,"-").concat(P.track_changes.getPendingChanges().length),a=P.opts.showChangesEnabled?'class="fr-highlight-change"':"";O('<li><span data-tracking="true" data-track-id="'.concat(t,'" ').concat(a,">").concat(e.html(),"</span></li>")).insertBefore(s),P.track_changes.pushChange(t)});var l=r.find("li[data-temp-li=true");0<l.length&&l.remove(),a.remove()}P.markers.remove()}},!0),P.events.on("image.inserted",function(e){P.helpers.isMobile()&&P.opts.trackChangesEnabled&&e.data("tracking-img",!0)}),P.events.on("image.removed",function(e){if(P.helpers.isMobile()&&P.opts.trackChangesEnabled&&!e.data("tracking-img")&&!e.parent().data("tracking")){var t=P.selection.ranges(0).startContainer,a=O(t).parentsUntil(P.$el,"[data-tracking=true]");P.markers.insert();var n=P.$el.find(".fr-marker"),r="pending-".concat(P.id,"-").concat(P.track_changes.getPendingChanges().length),i=P.opts.showChangesEnabled?'class="fr-highlight-change"':"",s=O('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),l=O('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');P.opts.showChangesEnabled||l.addClass("fr-track-hide"),e.data("tracking-img",!0),O(t).data("tracking")||a.length?(O(n).replaceWith(l),O(l).append(e),P.markers.remove()):(O(n).replaceWith(s),O(s).prepend(l),O(l).append(e),P.markers.remove(),P.track_changes.pushChange(r))}}),P.events.on("commands.before",function(t){if(!P.opts.trackChangesEnabled)return!0;var e=["applytextColor","bold","italic","underline","strikeThrough","subscript","superscript","fontFamily","fontSize","textColor","applybackgroundColor","inlineClass","inlineStyle","alignLeft","alignCenter","formatOLSimple","alignRight","alignJustify","formatOL","formatUL","paragraphFormat","paragraphStyle","lineHeight","outdent","indent","quote"];if(["change","applyAll","applyLast","removeLast","showChanges","trackChanges","moreTrackChanges","undo","redo","fullscreen","print","getPDF","spellChecker","selectAll","html","help"].filter(function(e){return e===t}).length||e.filter(function(e){return e===t}).length){if(e.filter(function(e){return e===t}).length&&"paragraphFormat"!==t&&"paragraphStyle"!==t&&"lineHeight"!==t)E(t);else if("paragraphFormat"===t||"paragraphStyle"===t||"lineHeight"===t){P.selection.save();for(var a=P.$el.find('.fr-marker[data-type="true"]').length&&P.$el.find('.fr-marker[data-type="true"]').get(0),n=P.opts.showChangesEnabled?'class="fr-highlight-change"':"",r="pending-".concat(P.id,"-").concat(P.track_changes.getPendingChanges().length),i=O('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(n,"></span>")),s=O('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false" style="display:none"></span>'),l=a.parentNode.cloneNode(!0),o=l.childNodes,c=0;c<o.length;)o[c].className&&"fr-marker"===o[c].className?o[c].remove():c++;O(s).append(l),O(i).append(s),O(a.parentNode).after(O("<p></p>")),O(a.parentNode.nextSibling).append(i),i=O('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(n,"></span>")),O(a.parentNode.nextSibling).after(O("<p></p>")),O(a.parentNode.nextSibling.nextSibling).append(i),i.append(a.parentNode),P.track_changes.pushChange(r),P.selection.restore()}}else{if(j.COMMANDS[t]&&(j.COMMANDS[t].hasOwnProperty("type")&&"dropdown"===j.COMMANDS[t].type||j.COMMANDS[t].more_btn||j.COMMANDS[t].popup)){if("insertImage"!=t&&"insertFile"!=t)return}else if("clearFormatting"===t){if(P.opts.trackChangesEnabled){S=P.selection.blocks();for(var d=[],g=0,h=0;h<S.length;h++){g=h<g?g:h;var f=O(S[h]);if(f.is("li"))f.siblings("li").each(function(e,t){O(t).find("li").length&&(d.push({index:g,item:t}),g+=1)});C[h]=O("<span>".concat(f.get(0).innerHTML,"</span>"))}for(var p=0,u=d;p<u.length;p++){var k=u[p],m=k.index,v=k.item,b=O(O(v).get(0).outerHTML);b.find("ul").remove(),b.find("ol").remove(),C=[].concat($(C.slice(0,m+1)),[O("<span>".concat(b.get(0).innerHTML,"</span>"))],$(C.slice(m+1))),S=[].concat($(S.slice(0,m+1)),[v],$(S.slice(m+1)))}}return}N()}},!0),P.events.on("commands.after",function(e){if(!P.opts.trackChangesEnabled)return!0;if(0<=["undo","redo"].indexOf(e))!function r(){var e=P.$el.find("[data-tracking=true]");l.splice(0,l.length);for(var t=0;t<e.length;t++){var a=O(e.get(t)).data("track-id");l[a.slice(a.lastIndexOf("-")+1)]=a}}();else if("clearFormatting"==e&&P.opts.trackChangesEnabled){var t="pending-".concat(P.id,"-").concat(P.track_changes.getPendingChanges().length);for(var a in S){var n=O(S[a]);C[a]&&(c(n,C[a],t),C[a]=null,i[a]=null)}P.track_changes.pushChange(t),C=[],S=null}},!0),P.events.on("quickInsert.commands.before",function(e){P.opts.trackChangesEnabled&&N(e)}),{toggleTracking:function n(){P.opts.trackChangesEnabled&&-1<P.html.get(!0,!0).indexOf("data-tracking")||P.opts.trackChangesEnabled&&0<P.$el.find("[data-tracking=true]").length?alert("Your editor has pending changes. Please resolve them before turning off Track Changes in the toolbar."):(P.commands.moreTrackChanges(),P.opts.trackChangesEnabled=!P.opts.trackChangesEnabled,P.opts.trackChangesEnabled||(P.opts.showChangesEnabled=!1))},pushChange:function h(e){l.push(e)},insertChangeAt:function p(e,t){l=[].concat($(l.slice(0,e)),[t],$(l.slice(e)))},popChange:o,getPendingChanges:function u(){return l},showChanges:function k(){if(P.opts.showChangesEnabled=!P.opts.showChangesEnabled,function r(e,t){for(var a=0;a<e.length;a++)t?(O(e.get(a)).removeClass("fr-track-hide"),O(e.get(a)).removeClass("fr-track-hide-mobile")):P.helpers.isMobile()?O(e.get(a)).addClass("fr-track-hide-mobile"):O(e.get(a)).addClass("fr-track-hide")}(P.$el.find(".fr-tracking-deleted"),P.opts.showChangesEnabled),P.opts.showChangesEnabled)for(var e=P.$el.find("[data-tracking=true]").not(".fr-highlight-change"),t=0;t<e.length;t++)O(e.get(t)).addClass("fr-highlight-change");else for(var a=P.$el.find(".fr-highlight-change"),n=0;n<a.length;n++)O(a.get(n)).removeClass("fr-highlight-change")},acceptAllChanges:function m(){for(;0!=P.track_changes.getPendingChanges().length;)t();l=[],e(),P.$el.find("li").each(function(){!O(this).children()[0]||"OL"!==O(this).children()[0].tagName&&"UL"!==O(this).children()[0].tagName||e()})},rejectAllChanges:function v(){for(;0!=P.track_changes.getPendingChanges().length;)a();l=[]},acceptSingleChange:t,rejectSingleChange:a,refresh:function b(e){var t,a,n=P.$el.find("[data-tracking=true]");e.toggleClass("fr-disabled",!l.length),e.toggleClass("fr-active",l.length).attr("aria-pressed",l.length),0<!n.length&&(e.removeClass("fr-active"),e.addClass("fr-disabled"));var r=null===(t=P.$tb)||void 0===t?void 0:t.find('.fr-command[data-cmd="markdown"]');r&&P.opts.trackChangesEnabled?r.addClass("fr-disabled"):r&&!O(".fr-active.fr-popup").length&&r.removeClass("fr-disabled");var i=null===(a=P.$tb)||void 0===a?void 0:a.find('.fr-command[data-cmd="showChanges"]');i&&P.opts.trackChangesEnabled&&i.removeClass("fr-disabled")},replaceSpecialItem:function y(e){P.selection.setBefore(e.get(0)),P.selection.setAfter(e.get(0)),f(P.$el.find('.fr-marker[data-type="true"]').length&&P.$el.find('.fr-marker[data-type="true"]').get(0),P.$el.find('.fr-marker[data-type="false"]').length&&P.$el.find('.fr-marker[data-type="false"]').get(0))},removeSpecialItem:function x(e){P.selection.setBefore(e.get(0)),P.selection.setAfter(e.get(0)),F(P.$el.find('.fr-marker[data-type="true"]').length&&P.$el.find('.fr-marker[data-type="true"]').get(0),P.$el.find('.fr-marker[data-type="false"]').length&&P.$el.find('.fr-marker[data-type="false"]').get(0))},removedTable:function A(e){var t=!1;if(e.find("[data-tracking=true]").each(function(){0<this.innerText.replace(/\u200B/g,"").length&&(t=!0)}),t)alert("Your table has pending changes. Please resolve them before remove table.");else{var r="pending-".concat(P.id,"-").concat(P.track_changes.getPendingChanges().length),i=P.opts.showChangesEnabled?'class="fr-highlight-change"':"",a=O('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),n=O('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');e.before(a),e.find("tr").find("> td").each(function(){var e=O('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),t=O('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>'),a=O(this),n=a[0].innerText;O(t)[0].innerText=n,a[0].innerText="",e.prepend(t),a.prepend(e)}),n.append(e),a.append(n),P.track_changes.pushChange(r)}},addQuote:function M(e){var t="pending-".concat(P.id,"-").concat(P.track_changes.getPendingChanges().length),a=P.opts.showChangesEnabled?'class="fr-highlight-change"':"",n=O('<div data-tracking="true" data-track-id="'.concat(t,'" ').concat(a,"></div>")),r=O('<div data-tracking="true" data-track-id="'.concat(t,'" ').concat(a,"></div>")),i=O('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');P.opts.showChangesEnabled||i.addClass("fr-track-hide"),e.before(r),e.before(n);var s=e.get(0).innerHTML;i.append(s),n.append(i),r.append(e),r.find('[data-tracking="true"]').each(function(e,t){O(t).children().eq(0).insertBefore(O(t)),O(t).remove()}),P.track_changes.pushChange(t)},removeQuote:function _(e,t){if(!(0<t)){var a="pending-".concat(P.id,"-").concat(P.track_changes.getPendingChanges().length),n=P.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=O('<div data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></div>")),i=O('<div data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></div>")),s=O('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');P.opts.showChangesEnabled||s.addClass("fr-track-hide"),e.before(i),e.before(r);var l=e.find("blockQuote").eq(0).html();l||(l=e.html()),s.append(e),r.append(s),i.append(l),i.find('[data-tracking="true"]').each(function(e,t){O(t).children().eq(0).insertBefore(O(t)),O(t).remove()}),P.track_changes.pushChange(a)}},wrapInTracking:function T(e,t){var a="pending-".concat(P.id,"-").concat(P.track_changes.getPendingChanges().length),n=P.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=O('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>"));t&&r.addClass(t);var i=O('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');return P.opts.showChangesEnabled||i.addClass("fr-track-hide"),e.before(r),r.append(e),P.track_changes.pushChange(a),r},wrapInDelete:function I(e){var t=O('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');return P.opts.showChangesEnabled||(P.helpers.isMobile()?t.addClass("fr-track-hide-mobile"):t.addClass("fr-track-hide")),t.append(e),t},wrapLinkInTracking:function w(e,t){var a="pending-".concat(P.id,"-").concat(P.track_changes.getPendingChanges().length),n=P.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=O('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>"));return e.before(r),r.append(e),P.track_changes.insertChangeAt(t-1,a),r},pasteInEmptyEdior:function L(e){var t=P.$el.find(".fr-highlight-change");O(t)[0].style.display="block",O(t)[0].innerHTML=e},pasteInEdior:function R(e){var t=P.$el.find(".fr-marker");O(t)[0].outerHTML=e,P.markers.remove()}}},j.DefineIcon("trackChanges",{NAME:"enable-tracking",SVG_KEY:"trackChanges"}),j.DefineIcon("showChanges",{NAME:"show-changes",SVG_KEY:"showTrackChanges"}),j.DefineIcon("applyAll",{NAME:"apply-all",SVG_KEY:"acceptAllChanges"}),j.DefineIcon("removeAll",{NAME:"remove-all",SVG_KEY:"rejectAllChanges"}),j.DefineIcon("applyLast",{NAME:"apply-last",SVG_KEY:"acceptSingleChange"}),j.DefineIcon("removeLast",{NAME:"remove-last",SVG_KEY:"rejectSingleChange"}),j.RegisterCommand("trackChanges",{type:"button",title:"Enable Track Changes",plugin:"track_changes",showOnMobile:!0,callback:function(){this.track_changes.toggleTracking()},refreshAfterCallback:!0,forcedRefresh:!0,refresh:function(e){if(e&&this.$tb){var t=this.$tb.find('.fr-more-toolbar[data-name="'.concat(e.attr("id"),'"]')),a=0!==t.length&&t.hasClass("fr-expanded");(this.opts.trackChangesEnabled&&this.opts.toolbarContainer&&!a||!this.opts.trackChangesEnabled&&this.opts.toolbarContainer&&a)&&(this.$tb.find('.fr-more-toolbar[data-name="'.concat(e.attr("id"),'"]')).toggleClass("fr-expanded"),this.$box.toggleClass("fr-toolbar-open"),this.$tb.toggleClass("fr-toolbar-open"),e.toggleClass("fr-open")),e.toggleClass("fr-active",this.opts.trackChangesEnabled).attr("aria-pressed",this.opts.trackChangesEnabled)}}}),j.RegisterCommand("showChanges",{type:"button",icon:"showChanges",title:"Show Changes",plugin:"track_changes",undo:!1,focus:!1,accessibilityFocus:!0,forcedRefresh:!0,refreshAfterCallback:!0,toggle:!0,callback:function(){this.track_changes.showChanges()},refresh:function(e){e.toggleClass("fr-active",this.opts.showChangesEnabled).attr("aria-pressed",this.opts.showChangesEnabled)}}),j.RegisterCommand("applyAll",{type:"button",icon:"applyAll",title:"Accept All Changes",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.acceptAllChanges()},refresh:function(e){this.opts.trackChangesEnabled&&this.track_changes.refresh(e)}}),j.RegisterCommand("removeAll",{type:"button",icon:"removeAll",title:"Reject All Changes",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.rejectAllChanges()},refresh:function(e){this.opts.trackChangesEnabled&&this.track_changes.refresh(e)}}),j.RegisterCommand("applyLast",{type:"button",icon:"applyLast",title:"Accept Single Change",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.acceptSingleChange()},refresh:function(e){this.opts.trackChangesEnabled&&this.track_changes.refresh(e)}}),j.RegisterCommand("removeLast",{type:"button",icon:"removeLast",title:"Reject Single Change",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.rejectSingleChange()},refresh:function(e){this.opts.trackChangesEnabled&&this.track_changes.refresh(e)}})});
|
7
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],t):t(e.FroalaEditor)}(this,function(X){"use strict";function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=Array(t);a<t;a++)n[a]=e[a];return n}function z(e){return function t(e){if(Array.isArray(e))return i(e)}(e)||function a(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function n(e,t){if(e){if("string"==typeof e)return i(e,t);var a={}.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?i(e,t):void 0}}(e)||function r(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}X=X&&X.hasOwnProperty("default")?X["default"]:X,Object.assign(X.DEFAULTS,{trackChangesEnabled:!1,showChangesEnabled:!1}),X.PLUGINS.track_changes=function(L){var O=L.$;O.fn.isAfter=function(e){var t=O(this),a=t.parents(),n=e.parents(),r=t;for(var i in a){var s=e;if(a.hasOwnProperty(i)){var l=O(a[i]);for(var o in n)if(n.hasOwnProperty(o)){var d=O(n[o]);if(l[0]===d[0]){var c=r.index();return s.index()<c}s=d}r=l}}return!1};var s,r,l=[],D="",V="",B="",H="",b=[],i=[],S=null,K=[],c=!1;L.events.on("keydown",function(e){var t;if(!L.opts.trackChangesEnabled)return!0;if(s=null===(t=L.selection.get())||void 0===t||null===(t=t.focusNode)||void 0===t?void 0:t.nodeValue,L.helpers.isAndroid()){var a,n,r=L.selection.get();D=null==r||null===(a=r.focusNode)||void 0===a?void 0:a.nodeValue,V=null==r?void 0:r.focusNode,H=null===(n=V)||void 0===n?void 0:n.nextSibling,B=null==r?void 0:r.focusOffset}else if(function i(e){return(!L.keys.ctrlKey(e)||e.which!==X.KEYCODE.Z&&e.which!==X.KEYCODE.C)&&(48<=e.keyCode&&e.keyCode<=57||65<=e.keyCode&&e.keyCode<=90||97<=e.keyCode&&e.keyCode<=122||186<=e.keyCode&&e.keyCode<=222||13===e.keyCode||8===e.keyCode||32===e.keyCode||46===e.keyCode||96<=e.keyCode&&e.keyCode<=111)}(e))if(!L.keys.ctrlKey(e)||"b"!==e.key&&"i"!==e.key&&"u"!==e.key){if(L.keys.ctrlKey(e)&&"a"===e.key||L.keys.ctrlKey(e)&&"s"===e.key||L.keys.ctrlKey(e)&&"x"===e.key)return;N(e)}else E()},!0),L.events.on("cut",function(e){if(!L.opts.trackChangesEnabled)return!0;for(var t=L.selection.get().getRangeAt(0).cloneContents(),a="",n="",r=0;r<t.childNodes.length;r++){var i=t.childNodes[r],s=i.outerHTML,l=i.textContent;i.nodeType===Node.TEXT_NODE&&(l=s=i.textContent.replace(/\u200B/g,"")),a+=s,n+=l}L.paste.saveCopiedText(a,n,!0),N(e)},!0),L.events.on("keyup",function(e){if(!L.opts.trackChangesEnabled)return!0;var t;if(L.helpers.isMobile())if(r=null===(t=L.selection.get())||void 0===t||null===(t=t.focusNode)||void 0===t?void 0:t.nodeValue,c){for(var a=0;a<K.length;a++)L.opts.showChangesEnabled&&O(K[a].span).empty(),O(K[a].span).prepend(K[a]["delete"]);c=!(K=[])}else if(L.helpers.isIOS()){for(var n=0;n<K.length;n++)r&&1===r.length&&s&&1==s.length?(O(K[n]["delete"]).attr("contenteditable","true"),O(K[n]["delete"]).addClass("fr-ios-mobile-disable-select")):O(K[n]["delete"]).attr("contenteditable","false");K=[]}else{if(46===e.keyCode)return!0;N(e)}},!0),L.events.on("beforeinput",function(e){var t=e.originalEvent,a=!1;if(!L.opts.trackChangesEnabled)return!0;if(L.helpers.isAndroid()){var n=L.selection.get(),r=L.selection.ranges(0),i=r.startContainer,s=r.endContainer,l=O(i).parentsUntil(L.$el,"[data-tracking=true]"),o=O(s).parentsUntil(L.$el,"[data-tracking=true]");if("insertCompositionText"===t.inputType)if(""===t.data)a=!0;else if(n.toString().length>t.data.length){if(0<l.length||0<o.length)return c=!0,e.preventDefault(),!1;a=!0,e.composing=!0}if("insertText"!==t.inputType||L.selection.isCollapsed()||(a=!0),a||"deleteContentBackward"===t.inputType){var d;if(c=!0,i.lastChild&&!n.toString()&&null!==(d=i.lastChild.children)&&void 0!==d&&null!==(d=d.item(0))&&void 0!==d&&d.hasAttribute("contenteditable"))return;e.keyCode=8,e.deletion=!0,N(e)}}},!0),L.events.on("paste.before",function(e){L.opts.trackChangesEnabled&&L.helpers.isMobile()&&N(e)},!0),L.events.on("paste.after",function(e){if(L.opts.trackChangesEnabled){L.markers.insert();for(var t=L.$el.find(".fr-marker"),a=t.next();a.is("br");){var n=a.next();a.remove(),a=n}if(a.is("ul")||a.is("ol")){var r=t.closest("ul, ol"),i=a.children("li");i.find("[data-tracking=true]").add(i.closest("[data-tracking=true]")).addClass("fr-highlight-change");var s=0<a.closest("li").next().length?a.closest("li").next():function o(e){return e.append('<li data-temp-li="true"></li>').find("li").last()}(r);i.each(function(){var e=O(this),t="pending-".concat(L.id,"-").concat(L.track_changes.getPendingChanges().length),a=L.opts.showChangesEnabled?'class="fr-highlight-change"':"";O('<li><span data-tracking="true" data-track-id="'.concat(t,'" ').concat(a,">").concat(e.html(),"</span></li>")).insertBefore(s),L.track_changes.pushChange(t)});var l=r.find("li[data-temp-li=true");0<l.length&&l.remove(),a.remove()}L.markers.remove()}},!0),L.events.on("image.inserted",function(e){L.helpers.isMobile()&&L.opts.trackChangesEnabled&&e.data("tracking-img",!0)}),L.events.on("image.removed",function(e){if(L.helpers.isMobile()&&L.opts.trackChangesEnabled&&!e.data("tracking-img")&&!e.parent().data("tracking")){var t=L.selection.ranges(0).startContainer,a=O(t).parentsUntil(L.$el,"[data-tracking=true]");L.markers.insert();var n=L.$el.find(".fr-marker"),r="pending-".concat(L.id,"-").concat(L.track_changes.getPendingChanges().length),i=L.opts.showChangesEnabled?'class="fr-highlight-change"':"",s=O('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),l=O('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');L.opts.showChangesEnabled||l.addClass("fr-track-hide"),e.data("tracking-img",!0),O(t).data("tracking")||a.length?(O(n).replaceWith(l),O(l).append(e),L.markers.remove()):(O(n).replaceWith(s),O(s).prepend(l),O(l).append(e),L.markers.remove(),L.track_changes.pushChange(r))}}),L.events.on("commands.before",function(t){if(!L.opts.trackChangesEnabled)return!0;var e=["applytextColor","bold","italic","underline","strikeThrough","subscript","superscript","fontFamily","fontSize","textColor","applybackgroundColor","inlineClass","inlineStyle","alignLeft","alignCenter","formatOLSimple","alignRight","alignJustify","formatOL","formatUL","paragraphFormat","paragraphStyle","lineHeight","outdent","indent","quote"];if(["change","applyAll","applyLast","removeLast","showChanges","trackChanges","moreTrackChanges","undo","redo","fullscreen","print","getPDF","spellChecker","selectAll","html","help"].filter(function(e){return e===t}).length||e.filter(function(e){return e===t}).length){if(e.filter(function(e){return e===t}).length&&"paragraphFormat"!==t&&"paragraphStyle"!==t&&"lineHeight"!==t)E(t);else if("paragraphFormat"===t||"paragraphStyle"===t||"lineHeight"===t){L.selection.save();for(var a=L.$el.find('.fr-marker[data-type="true"]').length&&L.$el.find('.fr-marker[data-type="true"]').get(0),n=L.opts.showChangesEnabled?'class="fr-highlight-change"':"",r="pending-".concat(L.id,"-").concat(L.track_changes.getPendingChanges().length),i=O('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(n,"></span>")),s=O('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false" style="display:none"></span>'),l=a.parentNode.cloneNode(!0),o=l.childNodes,d=0;d<o.length;)o[d].className&&"fr-marker"===o[d].className?o[d].remove():d++;O(s).append(l),O(i).append(s),O(a.parentNode).after(O("<p></p>")),O(a.parentNode.nextSibling).append(i),i=O('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(n,"></span>")),O(a.parentNode.nextSibling).after(O("<p></p>")),O(a.parentNode.nextSibling.nextSibling).append(i),i.append(a.parentNode),L.track_changes.pushChange(r),L.selection.restore()}}else{if(X.COMMANDS[t]&&(X.COMMANDS[t].hasOwnProperty("type")&&"dropdown"===X.COMMANDS[t].type||X.COMMANDS[t].more_btn||X.COMMANDS[t].popup)){if("insertImage"!=t&&"insertFile"!=t)return}else if("clearFormatting"===t){if(L.opts.trackChangesEnabled){S=L.selection.blocks();for(var c=[],g=0,h=0;h<S.length;h++){g=h<g?g:h;var f=O(S[h]);if(f.is("li"))f.siblings("li").each(function(e,t){O(t).find("li").length&&(c.push({index:g,item:t}),g+=1)});b[h]=O("<span>".concat(f.get(0).innerHTML,"</span>"))}for(var p=0,u=c;p<u.length;p++){var k=u[p],v=k.index,m=k.item,C=O(O(m).get(0).outerHTML);C.find("ul").remove(),C.find("ol").remove(),b=[].concat(z(b.slice(0,v+1)),[O("<span>".concat(C.get(0).innerHTML,"</span>"))],z(b.slice(v+1))),S=[].concat(z(S.slice(0,v+1)),[m],z(S.slice(v+1)))}}return}N()}},!0),L.events.on("commands.after",function(e){if(!L.opts.trackChangesEnabled)return!0;if(0<=["undo","redo"].indexOf(e))!function r(){var e=L.$el.find("[data-tracking=true]");l.splice(0,l.length);for(var t=0;t<e.length;t++){var a=O(e.get(t)).data("track-id");l[a.slice(a.lastIndexOf("-")+1)]=a}}();else if("clearFormatting"==e&&L.opts.trackChangesEnabled){var t="pending-".concat(L.id,"-").concat(L.track_changes.getPendingChanges().length);for(var a in S){var n=O(S[a]);b[a]&&(u(n,b[a],t),b[a]=null,i[a]=null)}L.track_changes.pushChange(t),b=[],S=null}},!0),L.events.on("quickInsert.commands.before",function(e){L.opts.trackChangesEnabled&&N(e)});var o=null,d=!1,g=null;function h(e){var t=null;if("undefined"!=typeof L.doc.caretPositionFromPoint){var a=L.doc.caretPositionFromPoint(e.clientX,e.clientY);t={offsetNode:a.offsetNode,offset:a.offset}}else if("undefined"!=typeof L.doc.caretRangeFromPoint){var n=L.doc.caretRangeFromPoint(e.clientX,e.clientY);t={offsetNode:n.startContainer,offset:n.startOffset}}return t}function f(){return l.pop()}function N(e){var t=!(!e||8!=e.keyCode),a=e&&13==e.keyCode,n=!(!e||46!=e.keyCode);if(L.opts.trackChangesEnabled){L.selection.restore(),e&&e.composing&&(L.selection.save(),L.selection.ranges()[0].collapse(!1));var r=L.selection.ranges(0),i=r.startContainer,s=!1,l=t&&0===r.startOffset&&L.$el.get(0).firstChild===i;if(t&&0===r.startOffset&&L.$el.get(0).firstChild!==i&&i!==document){for(var o=U(i);o&&o.nodeType===Node.TEXT_NODE&&1===o.length&&8203===o.textContent.charCodeAt(0);)o=U(o);o&&(i=o,s=!0)}var d=O(i).parentsUntil(L.$el,"[data-tracking=true]");if(O(i).data("tracking")&&t){L.markers.insert();var c=L.$el.find(".fr-marker");return c[0].previousSibling&&"IMG"===c[0].previousSibling.tagName||L.selection.clear(),void O(c).remove()}if(!d.length||O(i).data("tracking-deleted")&&t||"TD"==i.tagName||a){if(L.selection.isCollapsed()){if(s){var g=i;if(g&&g.nodeType!==Node.TEXT_NODE&&0<g.childNodes.length){for(var h=null,f=g.childNodes.length-1;0<=f;f--)if(g.childNodes[f].nodeType===Node.TEXT_NODE){h=g.childNodes[f];break}null!==h&&(g=h)}var p=r.cloneRange();p.setStart(g,g.length),p.setEnd(g,g.length),L.selection.get().removeAllRanges(),L.selection.get().addRange(p)}!s&&l||e&&"drop"===e.type&&0<L.$el.find(".fr-marker").length||L.markers.insert();var u=L.$el.find(".fr-marker");if(e&&e.composing&&(u=O(u[1])),!u.length)return;var k="pending-".concat(L.id,"-").concat(L.track_changes.getPendingChanges().length),v=L.opts.showChangesEnabled?'class="fr-highlight-change"':"";if(t||n){if(t){if(!u[0].previousSibling||u[0].previousSibling.nodeType!==Node.ELEMENT_NODE||!u[0].previousSibling.lastChild||u[0].previousSibling.lastChild.nodeType!==Node.ELEMENT_NODE||"IMG"!==u[0].previousSibling.lastChild.tagName){for(;O(u[0].previousSibling).data("tracking");)u.insertBefore(u.prev());O(u[0].previousSibling).find("[data-tracking=true]").length&&u.insertBefore(O(u[0].previousSibling).find("[data-tracking=true]").eq(0))}}else if(O(i).data("tracking")){if(!i.nextSibling)return void(u[0].nextSibling&&"IMG"===u[0].nextSibling.tagName&&u[0].nextSibling.remove());u.insertBefore(i.nextSibling),F(u)}else F(u);var m=u[0]&&u[0].previousSibling?u[0].previousSibling.nodeValue:"",C=m&&m.slice(0,-(e.selectionLength?e.selectionLength:1));n&&(u[0].nextSibling&&"SPAN"!==u[0].nextSibling.tagName&&null===u[0].nextSibling.nodeValue&&u[0].nextSibling.firstChild&&u[0].nextSibling.firstChild.before(u[0]),C=(m=u[0].nextSibling?u[0].nextSibling.nodeValue:" ")&&m.slice(1)),n&&u[0].nextSibling&&"isPasted"===u[0].nextSibling.id?C=(m=u[0].nextSibling?u[0].nextSibling.textContent:" ")&&m.slice(1):t&&u[0].previousSibling&&"isPasted"===u[0].previousSibling.id&&(C=(m=u[0].previousSibling?u[0].previousSibling.textContent:" ")&&m.slice(0,-(e.selectionLength?e.selectionLength:1)));var b,S=O('<span data-tracking="true" data-track-id="'.concat(k,'" ').concat(v,"></span>")),N=O('<span data-tracking-deleted="true" class="fr-tracking-deleted" '.concat(L.helpers.isIOS()?"":'contenteditable="false"',"></span>"));L.opts.showChangesEnabled||(L.helpers.isMobile()?N.addClass("fr-track-hide-mobile"):N.addClass("fr-track-hide"));var E=!1,y=!1;if(t)try{var x=u[0]&&u[0].previousSibling;if(u[0]&&u[0].previousElementSibling&&"I"===u[0].previousElementSibling.tagName&&!m&&(b=u[0].previousElementSibling),x&&3===x.nodeType&&"SPAN"!==x.parentNode.tagName&&x.previousSibling&&"SPAN"===x.previousSibling.tagName&&" "===x.nodeValue&&0<O(x.previousSibling).find(".fr-emoticon").length?b=x.previousSibling:x&&"SPAN"===x.parentNode.tagName&&0<O(x.parentNode).find(".fr-emoticon").length?(b=x.parentNode,E=!0):x&&("SPAN"===x.tagName&&"isPasted"!==x.id||"HR"===x.tagName)?b=x:O(u).parent().prev().is("hr")?(b=O(u).parent().prev().get(0),E=y=!0):x&&"IMG"===x.tagName&&(b=x,O(S).prepend("".concat(X.MARKERS)),O(S).append("".concat(X.MARKERS))),L.helpers.isMobile()&&u[0]&&!b&&!m&&!C)return;E?(O(u[0].parentNode).after(S),y?O(u).parent().remove():O(u).remove()):u[0]?e.composing?O(u).after(S):O(u).before(S):O(H).before(S)}catch(e){H&&O(H).before(S)}else if(n){var A=u[0].nextSibling;u[0].nextElementSibling&&"I"===u[0].nextElementSibling.tagName&&!u[0].nextSibling.nodeValue?b=u[0].nextElementSibling:A&&3===A.nodeType&&"SPAN"!==A.parentNode.tagName&&A.nextSibling&&"SPAN"===A.nextSibling.tagName&&" "===A.nodeValue&&0<O(A.nextSibling).find(".fr-emoticon").length?b=A.nextSibling:A&&"SPAN"===A.parentNode.tagName&&0<O(A.parentNode).find(".fr-emoticon").length?(b=A.parentNode,E=!0):A&&"SPAN"===A.tagName&&u[0].nextSibling&&"isPasted"!==u[0].nextSibling.id?b=A:A&&"IMG"===A.tagName&&(b=A,O(S).prepend("".concat(X.MARKERS)),O(S).append("".concat(X.MARKERS))),E?(O(u[0].parentNode).before(S),O(u).remove()):O(u).after(S)}if(e.composing?K.push({span:S,"delete":N}):(L.helpers.isIOS()&&K.push({"delete":N}),O(S).prepend(N)),!b&&(b=m&&m.replace(C,""),L.helpers.isMobile()&&D&&!e.composing)){var _=L.selection.get().focusNode,M=L.selection.get().focusOffset,T=1;V&&_&&V.isSameNode(_)&&(T=B-M),b=D.replace(/\u00a0/g," ").replace(m.replace(/\u00a0/g," "),"").slice(0,T)}if(b&&(E?(O(N).append(O(O(b).get(0).outerHTML)),L.markers.insert()):O(N).append(b)),b&&0==b.length)return;L.browser.msie&&t&&(O(S).prepend("".concat(X.MARKERS)),O(S).append("".concat(X.MARKERS))),t&&(C||""===C)&&u[0].previousSibling?u[0].previousSibling.nodeValue=C:n&&(O(S).append("".concat(X.MARKERS)),u[0].nextSibling.nodeValue=C)}else{var I=X.INVISIBLE_SPACE;if(e&&L.helpers.isMobile()&&((I=u[0]&&u[0].previousSibling&&u[0].previousSibling.nodeValue?u[0].previousSibling.nodeValue.slice(-1):X.INVISIBLE_SPACE)&&u[0]&&u[0].previousSibling&&u[0].previousSibling.nodeValue?u[0].previousSibling.nodeValue=u[0].previousSibling.nodeValue.slice(0,-1):!u[0]||u[0].previousSibling||u[0].nextSibling||I!==X.INVISIBLE_SPACE||(I=L.selection.get().focusNode.nodeValue.slice(B,L.selection.get().focusOffset),L.selection.get().focusNode.nodeValue=L.selection.get().focusNode.nodeValue.slice(L.selection.get().focusOffset))),a){if(u.parent().parent().is("li"))return;var P=O("<p></p>");return void(0<u.closest("p").length&&(u.closest("p").after(P),P.append(u),L.markers.remove(),setTimeout(function(){P.prev().text()!==String.fromCharCode(8203)&&""!==P.prev().text()||P.prev().remove(),L.selection.setAfter(P[0])},1)))}u[0].previousSibling&&"BR"===u[0].previousSibling.tagName&&u[0].previousSibling.remove(),u.replaceWith('<span data-tracking="true" data-track-id="'.concat(k,'" ').concat(v,">").concat(I+X.MARKERS,"</span>"))}L.selection.restore(),L.track_changes.pushChange(k)}else{L.selection.save();var w=L.$el.find('.fr-marker[data-type="true"]').length&&L.$el.find('.fr-marker[data-type="true"]').get(0),R=L.$el.find('.fr-marker[data-type="false"]').length&&L.$el.find('.fr-marker[data-type="false"]').get(0);if(O(w).parent().hasClass("fr-emoticon")&&O(w).parent().before(w),O(w).isAfter(O(R))){var $=w;w=R,R=$}G(w,R,e&&e.deletion),L.selection.restore()}L.helpers.isMobile()&&D&&L.markers.remove()}}}function F(e){if(O(e[0].nextSibling).data("tracking")){for(;O(e[0].nextSibling).data("tracking")&&(!(0<O(e[0].previousElementSibling).find("[data-tracking-deleted=true]").length&&0<O(e[0].nextElementSibling).find("[data-tracking-deleted=true]").length)||O(e[0].previousSibling).data("tracking"));)O(e).insertAfter(e.next());e.insertBefore(e[0].previousSibling)}}function U(e){var t=e.previousSibling;if(!t){var a=O(e).parent().get(0).previousSibling;null!==a&&(t=a.lastChild||a)}return t}function G(e,t){var a=2<arguments.length&&arguments[2]!==undefined&&arguments[2];if(e&&(!e.isSameNode(t)||!O(e).hasClass("fr-marker"))){for(;e.nodeType===Node.COMMENT_NODE;)e=e.nextSibling;if(O(e).parent().is("table")&&0!==O(e).parent().next().text().length&&G(O(e).parent().next()[0],t,a),"TD"!==e.tagName||1!==e.childNodes.length||"BR"!==e.childNodes[0].tagName){if(L.node.isBlock(e)&&"HR"!==e.tagName)return L.node.hasClass(e.firstChild,"fr-marker")?G(e.firstChild.nextSibling,t,a):G(e.firstChild,t,a),!1;if("BR"===e.tagName&&"TD"===e.parentElement.tagName){var n=e.parentElement.nextElementSibling;O(e).remove(),G(n,t)}var r="pending-".concat(L.id,"-").concat(L.track_changes.getPendingChanges().length),i=L.opts.showChangesEnabled?'class="fr-highlight-change"':"",s=O('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),l=O('<span data-tracking-deleted="true" class="fr-tracking-deleted" '.concat(L.helpers.isIOS()?"":'contenteditable="false"',"></span>"));L.opts.showChangesEnabled||(L.helpers.isMobile()?l.addClass("fr-track-hide-mobile"):l.addClass("fr-track-hide"));var o=e;for(O(e).before(s),L.track_changes.pushChange(r);o&&O(o).hasClass("fr-marker");)o=o.nextSibling;for(var d=!1;o&&!d&&!O(o).hasClass("fr-marker")&&!O(o).is("[data-track-id]")&&0===O(o).find("fr-marker").length&&"UL"!==o.tagName&&"OL"!==o.tagName;){var c=o;if("IMG"===o.tagName&&O(o).data("tracking-img","true"),L.node.isBlock(o)&&"HR"!==e.tagName)return G(o.firstChild,t,a),!1;if(o)for(var g=o.childNodes,h=0;h<g.length;h++)if(g[h].className&&"fr-marker"===g[h].className){d=!0,G(o.firstChild,t,a);break}d||(o=o.nextSibling,O(l).append(c))}if(!o||"UL"!==o.tagName&&"OL"!==o.tagName||G(o,t,a),a?K.push({span:s,"delete":l}):(L.helpers.isIOS()&&K.push({"delete":l}),O(s).prepend(l)),L.browser.msie?O(s).prepend("".concat(X.INVISIBLE_SPACE+X.MARKERS)):O(s).prepend("".concat(X.INVISIBLE_SPACE)),O(s).append("".concat(X.INVISIBLE_SPACE+X.MARKERS)),!o&&!e.isSameNode(t)){for(var f=s.get(0).parentNode;f&&!f.nextSibling&&!L.node.isElement(f);)f=f.parentNode;if(f){var p=f.nextSibling;p&&(L.node.isBlock(p)?"HR"===p.tagName?G(p.nextSibling,t,a):(L.browser.mozilla&&"LI"===f.tagName&&"SPAN"===f.lastChild.tagName&&O(f.lastChild).hasClass("fr-marker")&&f.lastChild.remove(),G(p.firstChild,t,a)):G(p,t,a))}}}}}function E(e){if(L.opts.trackChangesEnabled){L.selection.restore();var t=L.selection.ranges(0).startContainer,a=O(t).parentsUntil(L.$el,"[data-tracking=true]");if(O(t).data("tracking"))return;if(!a.length&&!L.selection.isCollapsed()&&"quote"!=e){L.selection.save(),p(L.$el.find('.fr-marker[data-type="true"]').length&&L.$el.find('.fr-marker[data-type="true"]').get(0),L.$el.find('.fr-marker[data-type="false"]').length&&L.$el.find('.fr-marker[data-type="false"]').get(0));var n=L.$el.find('.fr-marker[data-type="true"]').length&&L.$el.find('.fr-marker[data-type="true"]').get(0),r=n.parentNode;if(r&&"A"===r.tagName&&r.firstChild&&"SPAN"===r.firstChild.tagName&&2<r.firstChild.childNodes.length&&"STRONG"===r.firstChild.childNodes[3].tagName)O(r.firstChild.childNodes[3].firstChild).before(n);else{for(var i=n.previousSibling.firstChild;i&&"SPAN"!==i.tagName;)i=i.nextSibling;O(i).after(n)}L.selection.restore()}}}function p(e,t,a){if(e&&!("<br>"===O(e).html()&&O(e).parent().is("td")||(O(e).parent().is("table")&&0!==O(e).parent().next().text().length&&p(O(e).parent().next()[0],t,a),O(e).is("br")&&O(e).parent().length&&O(e).parent().is("td")&&0===O(e).parent().text().length))){for(a||(a="pending-".concat(L.id,"-").concat(L.track_changes.getPendingChanges().length),L.track_changes.pushChange(a));e.nodeType===Node.COMMENT_NODE;)e=e.nextSibling;if(L.node.isBlock(e)&&"HR"!==e.tagName)return L.node.hasClass(e.firstChild,"fr-marker")?p(e.firstChild.nextSibling,t,a):p(e.firstChild,t,a),!1;var n=L.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=O('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>")),i=O('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false" style="display:none"></span>'),s=e;for(O(e).before(r);s&&O(s).hasClass("fr-marker");)s=s.nextSibling;for(var l=!1;s&&!l&&!O(s).hasClass("fr-marker")&&0===O(s).find("fr-marker").length&&"UL"!==s.tagName&&"OL"!==s.tagName;){var o=s;if(L.node.isBlock(s)&&"HR"!==e.tagName)return p(s.firstChild,t,a),!1;if(s)for(var d=s.childNodes,c=0;c<d.length;c++)if(d[c].className&&"fr-marker"===d[c].className){l=!0,p(s.firstChild,t,a);break}l||(s=s.nextSibling,O(i).append(o.cloneNode(!0)),O(r).append(o))}if(!s||"UL"!==s.tagName&&"OL"!==s.tagName||p(s,t,a),O(s).hasClass("fr-marker")&&O(r).append(s),O(r).prepend(i),O(r).prepend("".concat(X.INVISIBLE_SPACE)),O(r).append("".concat(X.INVISIBLE_SPACE)),!s&&!e.isSameNode(t)){for(var g=r.get(0).parentNode;g&&!g.nextSibling&&!L.node.isElement(g);)g=g.parentNode;if(g){var h=g.nextSibling;h&&(L.node.isBlock(h)?"HR"===h.tagName?p(h.nextSibling,t,a):p(h.firstChild,t,a):p(h,t,a))}}}}function a(e){var t=O('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');return L.opts.showChangesEnabled||(L.helpers.isMobile()?t.addClass("fr-track-hide-mobile"):t.addClass("fr-track-hide")),t.append(e),t}function n(e,t){var a="pending-".concat(L.id,"-").concat(L.track_changes.getPendingChanges().length),n=L.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=O('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>"));t&&r.addClass(t);var i=O('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');return L.opts.showChangesEnabled||i.addClass("fr-track-hide"),e.before(r),r.append(e),L.track_changes.pushChange(a),r}function u(e,t,a){var n=L.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=O('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>")),i=O('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');L.opts.showChangesEnabled||i.addClass("fr-track-hide"),i.append(t.get(0).innerHTML),r.append(i);var s=e.get(0).innerHTML;e.html(""),e.append(r),r.append(s)}function k(){if(L.events.trigger("image.hideResizer"),L.events.trigger("video.hideResizer"),L.html.cleanEmptyTags(!0),L.helpers.isMobile())for(var e=L.$el.find("img[data-tracking-img]"),t=0;t<e.length;t++){var a=O(e.get(t));a.parent()&&a.parent().data("tracking")||a.removeData("tracking-img")}}function e(){L.$el.find("li").each(function(){0===this.innerText.replace(/\u200B/g,"").length&&this.remove()})}function t(){var e=f();if(e){var t,a=L.$el.find("[data-track-id=".concat(e,"]"));if(a.length){var n=a.parent("a");if(n.length){var r=O(n.get(0).outerHTML).text();1===[].filter.call(r,function(e){return 8203!==e.charCodeAt(0)}).length&&(t=n)}for(var i=0;i<a.length;i++){var s=a.get(i),l=O(a).data("tracking-deleted")?O(a):O(s).find("[data-tracking-deleted=true]");l.length&&(l.get(0).remove?l.get(0).remove():l.get(0).parentNode.removeChild(l.get(0))),s.hasAttribute("style")?(O(s).removeData("tracking"),O(s).removeData("track-id"),O(s).removeClass("fr-highlight-change")):(L.selection.save(),0<O(s).find("IFRAME").length?(O(s).removeData("tracking"),O(s).removeData("track-id"),O(s).removeClass("fr-highlight-change")):s.outerHTML=s.innerHTML,L.selection.restore())}}t&&t.remove()}k()}function v(){var e=f();if(e){var t=L.$el.find("[data-track-id=".concat(e,"]"));if(t.length){L.selection.save();for(var a=t.length-1;0<=a;a--){var n=O(t).data("tracking-deleted")?O(t):O(t.get(a)).find("[data-tracking-deleted=true]");if(n.length)if(0<O(t).find("IFRAME").length)O(t).removeData("tracking"),O(t).removeData("track-id"),O(t).removeClass("fr-highlight-change"),O(t).removeClass("fr-tracking-deleted"),O(t).removeData("tracking-deleted"),O(t).removeAttr("contenteditable");else n.parent("[data-tracking=true]").data("track-id")==e?(O(t.get(a)).find("[data-tracking-deleted=true]").remove(),t.get(a).outerHTML=n.get(0).innerHTML):t.get(a).remove?t.get(a).remove():t.get(a).parentNode.removeChild(t.get(a));else t.get(a).remove?t.get(a).remove():t.get(a).parentNode.removeChild(t.get(a))}L.selection.restore()}}k()}return L.events.on("drop",function(e){if(L.opts.trackChangesEnabled){var t=h(e),a=L.selection.ranges(0);if(t&&L.$el.contains(t.offsetNode)&&L.selection.inEditor()&&a&&(a.startContainer===t.offsetNode&&a.startOffset===t.offset||a.endContainer===t.offsetNode&&a.endOffset===t.offset||a.startContainer===t.offsetNode&&a.endContainer===t.offsetNode&&t.offset>=a.startOffset&&t.offset<=a.endOffset))return;var n=O(e.target);if(n.hasClass("fr-highlight-change")&&n.children(".fr-tracking-deleted").length)return e.preventDefault(),e.stopPropagation(),!1;if(e.originalEvent.dataTransfer&&0===e.originalEvent.dataTransfer.items.length&&0===e.originalEvent.dataTransfer.files.length)return;L.undo.saveStep();var r=L.track_changes.getPendingChanges().length;N(e),r!==L.track_changes.getPendingChanges().length&&(d=!0,g=L.id),o=e}},!0),L.events.on("paste.beforeCleanup",function(e){if(L.opts.trackChangesEnabled&&o){var t=O(h(o).offsetNode).parentsUntil(L.$el,'[data-tracking="true"]');return d&&g===L.id&&0===t.length&&f(),N(o),o=null,d=!1,e}},!0),L.events.on("element.beforeDrop",function(e){if(L.opts.trackChangesEnabled){var t=n(a(e.clone()));e.after(t),d=!0,g=L.id}},!0),L.events.on("element.dropped",function(e){L.opts.trackChangesEnabled&&(d&&g===L.id&&(f(),d=!1,g=null),n(e),o=null)},!0),{toggleTracking:function m(){L.opts.trackChangesEnabled&&-1<L.html.get(!0,!0).indexOf("data-tracking")||L.opts.trackChangesEnabled&&0<L.$el.find("[data-tracking=true]").length?alert("Your editor has pending changes. Please resolve them before turning off Track Changes in the toolbar."):(L.commands.moreTrackChanges(),L.opts.trackChangesEnabled=!L.opts.trackChangesEnabled,L.opts.trackChangesEnabled||(L.opts.showChangesEnabled=!1))},pushChange:function C(e){l.push(e)},insertChangeAt:function y(e,t){l=[].concat(z(l.slice(0,e)),[t],z(l.slice(e)))},popChange:f,getPendingChanges:function x(){return l},showChanges:function A(){if(L.opts.showChangesEnabled=!L.opts.showChangesEnabled,function r(e,t){for(var a=0;a<e.length;a++)t?(O(e.get(a)).removeClass("fr-track-hide"),O(e.get(a)).removeClass("fr-track-hide-mobile")):L.helpers.isMobile()?O(e.get(a)).addClass("fr-track-hide-mobile"):O(e.get(a)).addClass("fr-track-hide")}(L.$el.find(".fr-tracking-deleted"),L.opts.showChangesEnabled),L.opts.showChangesEnabled)for(var e=L.$el.find("[data-tracking=true]").not(".fr-highlight-change"),t=0;t<e.length;t++)O(e.get(t)).addClass("fr-highlight-change");else for(var a=L.$el.find(".fr-highlight-change"),n=0;n<a.length;n++)O(a.get(n)).removeClass("fr-highlight-change")},acceptAllChanges:function _(){for(;0!=L.track_changes.getPendingChanges().length;)t();l=[],e(),L.$el.find("li").each(function(){!O(this).children()[0]||"OL"!==O(this).children()[0].tagName&&"UL"!==O(this).children()[0].tagName||e()})},rejectAllChanges:function M(){for(;0!=L.track_changes.getPendingChanges().length;)v();l=[]},acceptSingleChange:t,rejectSingleChange:v,refresh:function T(e){var t,a,n=L.$el.find("[data-tracking=true]");e.toggleClass("fr-disabled",!l.length),e.toggleClass("fr-active",l.length).attr("aria-pressed",l.length),0<!n.length&&(e.removeClass("fr-active"),e.addClass("fr-disabled"));var r=null===(t=L.$tb)||void 0===t?void 0:t.find('.fr-command[data-cmd="markdown"]');r&&L.opts.trackChangesEnabled?r.addClass("fr-disabled"):r&&!O(".fr-active.fr-popup").length&&r.removeClass("fr-disabled");var i=null===(a=L.$tb)||void 0===a?void 0:a.find('.fr-command[data-cmd="showChanges"]');i&&L.opts.trackChangesEnabled&&i.removeClass("fr-disabled")},replaceSpecialItem:function I(e){L.selection.setBefore(e.get(0)),L.selection.setAfter(e.get(0)),p(L.$el.find('.fr-marker[data-type="true"]').length&&L.$el.find('.fr-marker[data-type="true"]').get(0),L.$el.find('.fr-marker[data-type="false"]').length&&L.$el.find('.fr-marker[data-type="false"]').get(0))},removeSpecialItem:function P(e){L.selection.setBefore(e.get(0)),L.selection.setAfter(e.get(0)),G(L.$el.find('.fr-marker[data-type="true"]').length&&L.$el.find('.fr-marker[data-type="true"]').get(0),L.$el.find('.fr-marker[data-type="false"]').length&&L.$el.find('.fr-marker[data-type="false"]').get(0))},removedTable:function w(e){var t=!1;if(e.find("[data-tracking=true]").each(function(){0<this.innerText.replace(/\u200B/g,"").length&&(t=!0)}),t)alert("Your table has pending changes. Please resolve them before remove table.");else{var r="pending-".concat(L.id,"-").concat(L.track_changes.getPendingChanges().length),i=L.opts.showChangesEnabled?'class="fr-highlight-change"':"",a=O('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),n=O('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');e.before(a),e.find("tr").find("> td").each(function(){var e=O('<span data-tracking="true" data-track-id="'.concat(r,'" ').concat(i,"></span>")),t=O('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>'),a=O(this),n=a[0].innerText;O(t)[0].innerText=n,a[0].innerText="",e.prepend(t),a.prepend(e)}),n.append(e),a.append(n),L.track_changes.pushChange(r)}},addQuote:function R(e){var t="pending-".concat(L.id,"-").concat(L.track_changes.getPendingChanges().length),a=L.opts.showChangesEnabled?'class="fr-highlight-change"':"",n=O('<div data-tracking="true" data-track-id="'.concat(t,'" ').concat(a,"></div>")),r=O('<div data-tracking="true" data-track-id="'.concat(t,'" ').concat(a,"></div>")),i=O('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');L.opts.showChangesEnabled||i.addClass("fr-track-hide"),e.before(r),e.before(n);var s=e.get(0).innerHTML;i.append(s),n.append(i),r.append(e),r.find('[data-tracking="true"]').each(function(e,t){O(t).children().eq(0).insertBefore(O(t)),O(t).remove()}),L.track_changes.pushChange(t)},removeQuote:function $(e,t){if(!(0<t)){var a="pending-".concat(L.id,"-").concat(L.track_changes.getPendingChanges().length),n=L.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=O('<div data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></div>")),i=O('<div data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></div>")),s=O('<span data-tracking-deleted="true" class="fr-tracking-deleted" contenteditable="false"></span>');L.opts.showChangesEnabled||s.addClass("fr-track-hide"),e.before(i),e.before(r);var l=e.find("blockQuote").eq(0).html();l||(l=e.html()),s.append(e),r.append(s),i.append(l),i.find('[data-tracking="true"]').each(function(e,t){O(t).children().eq(0).insertBefore(O(t)),O(t).remove()}),L.track_changes.pushChange(a)}},wrapInTracking:n,wrapInDelete:a,wrapLinkInTracking:function j(e,t){var a="pending-".concat(L.id,"-").concat(L.track_changes.getPendingChanges().length),n=L.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=O('<span data-tracking="true" data-track-id="'.concat(a,'" ').concat(n,"></span>"));return e.before(r),r.append(e),L.track_changes.insertChangeAt(t-1,a),r},pasteInEmptyEdior:function Y(e){var t=L.$el.find(".fr-highlight-change");O(t)[0].style.display="block",O(t)[0].innerHTML=e},pasteInEdior:function q(e){var t=L.$el.find(".fr-marker");O(t)[0].outerHTML=e,L.markers.remove()}}},X.DefineIcon("trackChanges",{NAME:"enable-tracking",SVG_KEY:"trackChanges"}),X.DefineIcon("showChanges",{NAME:"show-changes",SVG_KEY:"showTrackChanges"}),X.DefineIcon("applyAll",{NAME:"apply-all",SVG_KEY:"acceptAllChanges"}),X.DefineIcon("removeAll",{NAME:"remove-all",SVG_KEY:"rejectAllChanges"}),X.DefineIcon("applyLast",{NAME:"apply-last",SVG_KEY:"acceptSingleChange"}),X.DefineIcon("removeLast",{NAME:"remove-last",SVG_KEY:"rejectSingleChange"}),X.RegisterCommand("trackChanges",{type:"button",title:"Enable Track Changes",plugin:"track_changes",showOnMobile:!0,callback:function(){this.track_changes.toggleTracking()},refreshAfterCallback:!0,forcedRefresh:!0,refresh:function(e){if(e&&this.$tb){var t=this.$tb.find('.fr-more-toolbar[data-name="'.concat(e.attr("id"),'"]')),a=0!==t.length&&t.hasClass("fr-expanded");(this.opts.trackChangesEnabled&&this.opts.toolbarContainer&&!a||!this.opts.trackChangesEnabled&&this.opts.toolbarContainer&&a)&&(this.$tb.find('.fr-more-toolbar[data-name="'.concat(e.attr("id"),'"]')).toggleClass("fr-expanded"),this.$box.toggleClass("fr-toolbar-open"),this.$tb.toggleClass("fr-toolbar-open"),e.toggleClass("fr-open")),e.toggleClass("fr-active",this.opts.trackChangesEnabled).attr("aria-pressed",this.opts.trackChangesEnabled)}}}),X.RegisterCommand("showChanges",{type:"button",icon:"showChanges",title:"Show Changes",plugin:"track_changes",undo:!1,focus:!1,accessibilityFocus:!0,forcedRefresh:!0,refreshAfterCallback:!0,toggle:!0,callback:function(){this.track_changes.showChanges()},refresh:function(e){e.toggleClass("fr-active",this.opts.showChangesEnabled).attr("aria-pressed",this.opts.showChangesEnabled)}}),X.RegisterCommand("applyAll",{type:"button",icon:"applyAll",title:"Accept All Changes",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.acceptAllChanges()},refresh:function(e){this.opts.trackChangesEnabled&&this.track_changes.refresh(e)}}),X.RegisterCommand("removeAll",{type:"button",icon:"removeAll",title:"Reject All Changes",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.rejectAllChanges()},refresh:function(e){this.opts.trackChangesEnabled&&this.track_changes.refresh(e)}}),X.RegisterCommand("applyLast",{type:"button",icon:"applyLast",title:"Accept Single Change",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.acceptSingleChange()},refresh:function(e){this.opts.trackChangesEnabled&&this.track_changes.refresh(e)}}),X.RegisterCommand("removeLast",{type:"button",icon:"removeLast",title:"Reject Single Change",plugin:"track_changes",toggle:!0,refreshAfterCallback:!0,forcedRefresh:!0,callback:function(){0<this.track_changes.getPendingChanges().length&&this.track_changes.rejectSingleChange()},refresh:function(e){this.opts.trackChangesEnabled&&this.track_changes.refresh(e)}})});
|