UNPKG

@ckeditor/ckeditor5-revision-history

Version:

Document revision history feature for CKEditor 5.

23 lines • 9.13 kB
/* * Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved. * * * * * +---------------------------------------------------------------------------------+ * | | * | Hello stranger! | * | | * | | * | What you're currently looking at is the source code of a legally protected, | * | proprietary software. Any attempts to deobfuscate / disassemble this code | * | are forbidden and will result in legal consequences. | * | | * | | * +---------------------------------------------------------------------------------+ * * * * */ const _0x2ddc60=_0xe925;function _0x1b9b(){const _0x46415f=['role','Open\x20revision\x20history','Revision\x20history','revisionHistory.requireRevisionName','232sQkHmR','requires','submit','_createSaveRevisionFormView','reset','isPremiumPlugin','editing','errorText','locale','isEnabled','revisionSave','isOpen','execute','editor','addMany','55VpRoeX','Cancel','454642ofZcIq','showRevisionViewerCallback','saveRevision','RevisionHistoryUI','The\x20revision\x20name\x20cannot\x20be\x20empty.','buttonView','panelView','delegate','show','componentFactory','976347ojYkTJ','render','pluginName','revisionName','items','add','Dialog','view','108342coGZjH','revisionHistory','children','4280dTfdNY','_saveRevisionFormView','focus','16411680BpomnQ','config','1092066NtReCw','menuitem','_showDialog','plugins','hide','7GWXBli','Accept','isReadOnly','isOfficialPlugin','_registerMenuComponent','revisionNameInputView','bind','isReady','menu','init','RevisionTracker','menuBar:revisionHistory','get','1983774eUmhIq','ck-button-action','set','Save\x20current\x20revision'];_0x1b9b=function(){return _0x46415f;};return _0x1b9b();}function _0xe925(_0x113179,_0x3ed036){const _0x1b9b2c=_0x1b9b();return _0xe925=function(_0xe92589,_0x34a48d){_0xe92589=_0xe92589-0xd6;let _0x347f64=_0x1b9b2c[_0xe92589];return _0x347f64;},_0xe925(_0x113179,_0x3ed036);}(function(_0x88bb65,_0xbc4636){const _0x5ba2d4=_0xe925,_0x32a73f=_0x88bb65();while(!![]){try{const _0x351fa1=-parseInt(_0x5ba2d4(0xf4))/0x1+-parseInt(_0x5ba2d4(0x10e))/0x2+parseInt(_0x5ba2d4(0xfe))/0x3+parseInt(_0x5ba2d4(0x109))/0x4*(-parseInt(_0x5ba2d4(0xf2))/0x5)+parseInt(_0x5ba2d4(0xdb))/0x6*(-parseInt(_0x5ba2d4(0x113))/0x7)+parseInt(_0x5ba2d4(0xe3))/0x8*(-parseInt(_0x5ba2d4(0x106))/0x9)+parseInt(_0x5ba2d4(0x10c))/0xa;if(_0x351fa1===_0xbc4636)break;else _0x32a73f['push'](_0x32a73f['shift']());}catch(_0x5a1b07){_0x32a73f['push'](_0x32a73f['shift']());}}}(_0x1b9b,0x43009));import{Plugin as _0x77bcbb}from'ckeditor5/src/core.js';import{IconHistory as _0x227152}from'ckeditor5/src/icons.js';import{createDropdown as _0x2ddb84,ButtonView as _0x2e8035,ListItemView as _0x12973c,ListView as _0x1fb056,MenuBarMenuListItemButtonView as _0x1f0fa8,MenuBarMenuListItemView as _0x4f7ec9,MenuBarMenuListView as _0x36c1c6,MenuBarMenuView as _0x5604ff}from'ckeditor5/src/ui.js';import _0x45544f from'../../revisiontracker.js';import _0x239195 from'./revisionhistorysaverevisionformview.js';import{getTranslation as _0x35e2f6}from'../../utils/common-translations.js';export default class f extends _0x77bcbb{static get[_0x2ddc60(0x100)](){const _0x5cf5e3=_0x2ddc60;return _0x5cf5e3(0xf7);}static get[_0x2ddc60(0x116)](){return!0x0;}static get[_0x2ddc60(0xe8)](){return!0x0;}static get[_0x2ddc60(0xe4)](){return[_0x45544f];}[_0x2ddc60(0x10a)];[_0x2ddc60(0xd7)](){const _0x4f898c=_0x2ddc60,_0x4ae71c=this[_0x4f898c(0xf0)],_0xd6aef9=_0x4ae71c[_0x4f898c(0x111)][_0x4f898c(0xda)](_0x4f898c(0xd8));_0x4ae71c['ui'][_0x4f898c(0xfd)][_0x4f898c(0x103)](_0x4f898c(0x107),_0xde7e5b=>{const _0x91f893=_0x4f898c,_0x133fb7=_0x2ddb84(_0xde7e5b),_0x1bb839=_0x133fb7[_0x91f893(0xfa)][_0x91f893(0x108)],_0x3b9cc3=new _0x1fb056(_0xde7e5b),_0x2911b5=new _0x12973c(_0xde7e5b),_0x5726c4=new _0x2e8035(_0xde7e5b),_0x25ccd1=new _0x12973c(_0xde7e5b),_0x5bb049=new _0x2e8035(_0xde7e5b);return _0x133fb7[_0x91f893(0x119)](_0x91f893(0xec))['to'](_0xd6aef9,_0x91f893(0x11a),_0xd6aef9,_0x91f893(0xec),_0x4ae71c,_0x91f893(0x115),(_0x13cd7d,_0x37a04f,_0x6f6028)=>_0x13cd7d&&_0x37a04f&&!_0x6f6028),_0x133fb7[_0x91f893(0xf9)][_0x91f893(0xdd)]({'icon':_0x227152,'label':_0x35e2f6(_0xde7e5b,_0x91f893(0xe1)),'tooltip':!0x0}),_0x5726c4[_0x91f893(0xdd)]({'label':_0x35e2f6(_0xde7e5b,_0x91f893(0xde)),'withText':!0x0,'role':_0x91f893(0x10f)}),_0x5726c4[_0x91f893(0x119)](_0x91f893(0xec))['to'](_0xd6aef9,_0x91f893(0x11a),_0xd6aef9,_0x91f893(0xec),_0x4ae71c,_0x91f893(0x115),(_0x350130,_0x183f78,_0x53a41a)=>_0x350130&&_0x183f78&&!_0x53a41a),_0x5726c4['on'](_0x91f893(0xef),()=>this[_0x91f893(0x110)]()),_0x5bb049[_0x91f893(0xdd)]({'label':_0x35e2f6(_0xde7e5b,_0x91f893(0xe0)),'withText':!0x0,'role':_0x91f893(0x10f)}),_0x5bb049[_0x91f893(0x119)](_0x91f893(0xec))['to'](_0xd6aef9,_0x91f893(0x11a),_0x4ae71c,_0x91f893(0x115),(_0x30cc42,_0x2a2010)=>_0x30cc42&&!_0x2a2010),_0x5bb049['on'](_0x91f893(0xef),()=>{const _0x45b4df=_0x91f893;_0x4ae71c[_0x45b4df(0x10d)][_0x45b4df(0xda)](_0x45b4df(0x107))[_0x45b4df(0xf5)](),_0x133fb7[_0x45b4df(0xee)]=!0x1,_0x4ae71c[_0x45b4df(0xe9)][_0x45b4df(0x105)][_0x45b4df(0x10b)]();}),_0x2911b5[_0x91f893(0x108)][_0x91f893(0x103)](_0x5726c4),_0x25ccd1[_0x91f893(0x108)][_0x91f893(0x103)](_0x5bb049),_0x3b9cc3[_0x91f893(0xdf)]=_0x91f893(0xd6),_0x3b9cc3[_0x91f893(0x102)][_0x91f893(0xf1)]([_0x2911b5,_0x25ccd1]),_0x1bb839[_0x91f893(0x103)](_0x3b9cc3),_0x133fb7;}),_0x4ae71c['ui'][_0x4f898c(0xfd)][_0x4f898c(0x103)](_0x4f898c(0xd9),()=>this[_0x4f898c(0x117)]());}[_0x2ddc60(0x117)](){const _0x580ded=_0x2ddc60,_0x5ec9a3=this[_0x580ded(0xf0)],_0x4faf3e=_0x5ec9a3[_0x580ded(0xeb)],_0x37e71c=new _0x5604ff(_0x4faf3e),_0x259f99=new _0x36c1c6(_0x4faf3e);_0x37e71c[_0x580ded(0xf9)][_0x580ded(0xdd)]({'icon':_0x227152,'label':_0x35e2f6(_0x4faf3e,_0x580ded(0xe1))});const _0x4948cb=new _0x4f7ec9(_0x4faf3e,_0x37e71c),_0x5951e5=new _0x1f0fa8(_0x4faf3e);_0x5951e5[_0x580ded(0xdd)]({'label':_0x35e2f6(_0x4faf3e,_0x580ded(0xde))}),_0x5951e5[_0x580ded(0xfb)](_0x580ded(0xef))['to'](_0x37e71c),_0x5951e5['on'](_0x580ded(0xef),()=>{const _0xea93ef=_0x580ded;this[_0xea93ef(0x110)]();}),_0x4948cb[_0x580ded(0x108)][_0x580ded(0x103)](_0x5951e5),_0x259f99[_0x580ded(0x102)][_0x580ded(0x103)](_0x4948cb);const _0x3df3e9=new _0x4f7ec9(_0x4faf3e,_0x37e71c),_0x21e054=new _0x1f0fa8(_0x4faf3e);return _0x21e054[_0x580ded(0xdd)]({'label':_0x35e2f6(_0x4faf3e,_0x580ded(0xe0))}),_0x21e054[_0x580ded(0xfb)](_0x580ded(0xef))['to'](_0x37e71c),_0x21e054['on'](_0x580ded(0xef),()=>{const _0xc5ae67=_0x580ded;_0x5ec9a3[_0xc5ae67(0x10d)][_0xc5ae67(0xda)](_0xc5ae67(0x107))[_0xc5ae67(0xf5)]();}),_0x3df3e9[_0x580ded(0x108)][_0x580ded(0x103)](_0x21e054),_0x259f99[_0x580ded(0x102)][_0x580ded(0x103)](_0x3df3e9),_0x37e71c[_0x580ded(0xfa)][_0x580ded(0x108)][_0x580ded(0x103)](_0x259f99),_0x37e71c;}[_0x2ddc60(0x110)](){const _0x38812e=_0x2ddc60,_0x435497=this[_0x38812e(0xf0)],_0xfb4fd8=_0x435497[_0x38812e(0xeb)],_0x10eddc=_0x435497[_0x38812e(0x111)][_0x38812e(0xda)](_0x38812e(0x104)),_0x562479=_0x435497[_0x38812e(0x111)][_0x38812e(0xda)](_0x38812e(0xd8));function _0x4a6278(_0x42c7ce){const _0x3ac405=_0x38812e;_0x435497[_0x3ac405(0x10d)][_0x3ac405(0xda)](_0x3ac405(0xe2))&&''===_0x42c7ce[_0x3ac405(0x101)]?_0x42c7ce[_0x3ac405(0x118)][_0x3ac405(0xea)]=_0x35e2f6(_0xfb4fd8,_0x3ac405(0xf8)):(_0x435497[_0x3ac405(0x111)][_0x3ac405(0xda)](_0x45544f)[_0x3ac405(0xf6)]({'name':_0x42c7ce[_0x3ac405(0x101)]}),_0x10eddc[_0x3ac405(0x112)]());}this[_0x38812e(0x10a)]||(this[_0x38812e(0xe6)](),this[_0x38812e(0x10a)]['on'](_0x38812e(0xe5),()=>_0x4a6278(this[_0x38812e(0x10a)]))),this[_0x38812e(0x10a)][_0x38812e(0xe7)](),_0x10eddc[_0x38812e(0xfc)]({'id':_0x38812e(0xed),'title':_0x35e2f6(_0xfb4fd8,_0x38812e(0xde)),'isModal':!0x0,'content':this[_0x38812e(0x10a)],'actionButtons':[{'label':_0x35e2f6(_0x435497[_0x38812e(0xeb)],_0x38812e(0xf3)),'withText':!0x0,'onExecute':()=>_0x10eddc[_0x38812e(0x112)]()},{'label':_0x35e2f6(_0x435497[_0x38812e(0xeb)],_0x38812e(0x114)),'class':_0x38812e(0xdc),'withText':!0x0,'onCreate'(_0x5e437e){const _0x2070a6=_0x38812e;_0x5e437e[_0x2070a6(0x119)](_0x2070a6(0xec))['to'](_0x562479,_0x2070a6(0x11a),_0x562479,_0x2070a6(0xec),_0x435497,_0x2070a6(0x115),(_0x51b940,_0x1df2dc,_0x42693a)=>_0x51b940&&_0x1df2dc&&!_0x42693a);},'onExecute':()=>_0x4a6278(this[_0x38812e(0x10a)])}]});}[_0x2ddc60(0xe6)](){const _0x400255=_0x2ddc60,_0x3ca95f=this[_0x400255(0xf0)],_0x5da0c0=_0x3ca95f[_0x400255(0xeb)];this[_0x400255(0x10a)]=new _0x239195(_0x5da0c0,_0x3ca95f[_0x400255(0x10d)][_0x400255(0xda)](_0x400255(0xe2))),this[_0x400255(0x10a)][_0x400255(0xff)]();}}