UNPKG

@ckeditor/ckeditor5-revision-history

Version:

Document revision history feature for CKEditor 5.

23 lines • 9.19 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 _0x1db713=_0x2251;(function(_0x21ccbe,_0x5dc0df){const _0x196611=_0x2251,_0x30d0c6=_0x21ccbe();while(!![]){try{const _0x16b16c=parseInt(_0x196611(0x11d))/0x1+parseInt(_0x196611(0x151))/0x2+-parseInt(_0x196611(0x118))/0x3+parseInt(_0x196611(0x124))/0x4+parseInt(_0x196611(0x14f))/0x5+parseInt(_0x196611(0x12f))/0x6+-parseInt(_0x196611(0x113))/0x7*(parseInt(_0x196611(0x13e))/0x8);if(_0x16b16c===_0x5dc0df)break;else _0x30d0c6['push'](_0x30d0c6['shift']());}catch(_0x597870){_0x30d0c6['push'](_0x30d0c6['shift']());}}}(_0x343a,0x29e4a));import{Plugin as _0x5075a9}from'ckeditor5/src/core.js';function _0x343a(){const _0x29ad15=['editor','showRevisionViewerCallback','buttonView','79289zpWFHJ','init','The\x20revision\x20name\x20cannot\x20be\x20empty.','addMany','reset','165036hqLnue','set','RevisionHistoryUI','revisionName','role','257470jKMQKA','_saveRevisionFormView','execute','errorText','isEnabled','focus','isReadOnly','489324jpufUc','RevisionTracker','Save\x20current\x20revision','menuBar:revisionHistory','Accept','menu','plugins','menuitem','_registerMenuComponent','revisionHistory.requireRevisionName','isOpen','111354hBSuSx','ck-button-action','Revision\x20history','componentFactory','get','pluginName','saveRevision','_createSaveRevisionFormView','revisionNameInputView','revisionSave','_showDialog','view','requires','Open\x20revision\x20history','delegate','416kBvchd','bind','children','isOfficialPlugin','isReady','Dialog','revisionHistory','submit','add','Cancel','panelView','locale','hide','isPremiumPlugin','editing','show','items','670830xiejWQ','render','566168PJwzdY','config'];_0x343a=function(){return _0x29ad15;};return _0x343a();}import{IconHistory as _0x577bce}from'ckeditor5/src/icons.js';import{createDropdown as _0x3ce62a,ButtonView as _0x55ff28,ListItemView as _0x20536f,ListView as _0x435198,MenuBarMenuListItemButtonView as _0x4ef05b,MenuBarMenuListItemView as _0x40b462,MenuBarMenuListView as _0x3d00ff,MenuBarMenuView as _0x3f47c9}from'ckeditor5/src/ui.js';function _0x2251(_0x36fec9,_0x85004d){const _0x343a2e=_0x343a();return _0x2251=function(_0x225107,_0x1ba85e){_0x225107=_0x225107-0x113;let _0x512aa3=_0x343a2e[_0x225107];return _0x512aa3;},_0x2251(_0x36fec9,_0x85004d);}import{RevisionTracker as _0x1e4d97}from'../../revisiontracker.js';import{RevisionHistorySaveRevisionFormView as _0x5de555}from'./revisionhistorysaverevisionformview.js';import{getTranslation as _0x49c02d}from'../../utils/common-translations.js';export class RevisionHistoryUI extends _0x5075a9{static get[_0x1db713(0x134)](){const _0x2fedd7=_0x1db713;return _0x2fedd7(0x11a);}static get[_0x1db713(0x141)](){return!0x0;}static get[_0x1db713(0x14b)](){return!0x0;}static get[_0x1db713(0x13b)](){return[_0x1e4d97];}[_0x1db713(0x11e)];[_0x1db713(0x114)](){const _0x1bf38c=_0x1db713,_0x9f8140=this[_0x1bf38c(0x153)],_0xae0066=_0x9f8140[_0x1bf38c(0x12a)][_0x1bf38c(0x133)](_0x1bf38c(0x125));_0x9f8140['ui'][_0x1bf38c(0x132)][_0x1bf38c(0x146)](_0x1bf38c(0x144),_0x48d714=>{const _0x136cbc=_0x1bf38c,_0x389908=_0x3ce62a(_0x48d714),_0x53cca4=_0x389908[_0x136cbc(0x148)][_0x136cbc(0x140)],_0x4d078a=new _0x435198(_0x48d714),_0x1f7356=new _0x20536f(_0x48d714),_0x464832=new _0x55ff28(_0x48d714),_0x5726fc=new _0x20536f(_0x48d714),_0x5826a6=new _0x55ff28(_0x48d714);return _0x389908[_0x136cbc(0x13f)](_0x136cbc(0x121))['to'](_0xae0066,_0x136cbc(0x142),_0xae0066,_0x136cbc(0x121),_0x9f8140,_0x136cbc(0x123),(_0x30f40d,_0x39f57f,_0x2a4cee)=>_0x30f40d&&_0x39f57f&&!_0x2a4cee),_0x389908[_0x136cbc(0x155)][_0x136cbc(0x119)]({'icon':_0x577bce,'label':_0x49c02d(_0x48d714,_0x136cbc(0x131)),'tooltip':!0x0}),_0x464832[_0x136cbc(0x119)]({'label':_0x49c02d(_0x48d714,_0x136cbc(0x126)),'withText':!0x0,'role':_0x136cbc(0x12b)}),_0x464832[_0x136cbc(0x13f)](_0x136cbc(0x121))['to'](_0xae0066,_0x136cbc(0x142),_0xae0066,_0x136cbc(0x121),_0x9f8140,_0x136cbc(0x123),(_0x56257a,_0x57661f,_0x4eb417)=>_0x56257a&&_0x57661f&&!_0x4eb417),_0x464832['on'](_0x136cbc(0x11f),()=>this[_0x136cbc(0x139)]()),_0x5826a6[_0x136cbc(0x119)]({'label':_0x49c02d(_0x48d714,_0x136cbc(0x13c)),'withText':!0x0,'role':_0x136cbc(0x12b)}),_0x5826a6[_0x136cbc(0x13f)](_0x136cbc(0x121))['to'](_0xae0066,_0x136cbc(0x142),_0x9f8140,_0x136cbc(0x123),(_0x266e8b,_0x101137)=>_0x266e8b&&!_0x101137),_0x5826a6['on'](_0x136cbc(0x11f),()=>{const _0x2ce057=_0x136cbc;_0x9f8140[_0x2ce057(0x152)][_0x2ce057(0x133)](_0x2ce057(0x144))[_0x2ce057(0x154)](),_0x389908[_0x2ce057(0x12e)]=!0x1,_0x9f8140[_0x2ce057(0x14c)][_0x2ce057(0x13a)][_0x2ce057(0x122)]();}),_0x1f7356[_0x136cbc(0x140)][_0x136cbc(0x146)](_0x464832),_0x5726fc[_0x136cbc(0x140)][_0x136cbc(0x146)](_0x5826a6),_0x4d078a[_0x136cbc(0x11c)]=_0x136cbc(0x129),_0x4d078a[_0x136cbc(0x14e)][_0x136cbc(0x116)]([_0x1f7356,_0x5726fc]),_0x53cca4[_0x136cbc(0x146)](_0x4d078a),_0x389908;}),_0x9f8140['ui'][_0x1bf38c(0x132)][_0x1bf38c(0x146)](_0x1bf38c(0x127),()=>this[_0x1bf38c(0x12c)]());}[_0x1db713(0x12c)](){const _0x107df1=_0x1db713,_0xd085f9=this[_0x107df1(0x153)],_0x43cfd6=_0xd085f9[_0x107df1(0x149)],_0xe4a9cb=new _0x3f47c9(_0x43cfd6),_0x437649=new _0x3d00ff(_0x43cfd6);_0xe4a9cb[_0x107df1(0x155)][_0x107df1(0x119)]({'icon':_0x577bce,'label':_0x49c02d(_0x43cfd6,_0x107df1(0x131))});const _0x180214=new _0x40b462(_0x43cfd6,_0xe4a9cb),_0x59ecd8=new _0x4ef05b(_0x43cfd6);_0x59ecd8[_0x107df1(0x119)]({'label':_0x49c02d(_0x43cfd6,_0x107df1(0x126))}),_0x59ecd8[_0x107df1(0x13d)](_0x107df1(0x11f))['to'](_0xe4a9cb),_0x59ecd8['on'](_0x107df1(0x11f),()=>{const _0x35c0af=_0x107df1;this[_0x35c0af(0x139)]();}),_0x180214[_0x107df1(0x140)][_0x107df1(0x146)](_0x59ecd8),_0x437649[_0x107df1(0x14e)][_0x107df1(0x146)](_0x180214);const _0x3fa88d=new _0x40b462(_0x43cfd6,_0xe4a9cb),_0x40f3f0=new _0x4ef05b(_0x43cfd6);return _0x40f3f0[_0x107df1(0x119)]({'label':_0x49c02d(_0x43cfd6,_0x107df1(0x13c))}),_0x40f3f0[_0x107df1(0x13d)](_0x107df1(0x11f))['to'](_0xe4a9cb),_0x40f3f0['on'](_0x107df1(0x11f),()=>{const _0x200190=_0x107df1;_0xd085f9[_0x200190(0x152)][_0x200190(0x133)](_0x200190(0x144))[_0x200190(0x154)]();}),_0x3fa88d[_0x107df1(0x140)][_0x107df1(0x146)](_0x40f3f0),_0x437649[_0x107df1(0x14e)][_0x107df1(0x146)](_0x3fa88d),_0xe4a9cb[_0x107df1(0x148)][_0x107df1(0x140)][_0x107df1(0x146)](_0x437649),_0xe4a9cb;}[_0x1db713(0x139)](){const _0x3f5a20=_0x1db713,_0x152325=this[_0x3f5a20(0x153)],_0x32cdc6=_0x152325[_0x3f5a20(0x149)],_0x41797a=_0x152325[_0x3f5a20(0x12a)][_0x3f5a20(0x133)](_0x3f5a20(0x143)),_0x34ce13=_0x152325[_0x3f5a20(0x12a)][_0x3f5a20(0x133)](_0x3f5a20(0x125));function _0x4dd15b(_0x1ac517){const _0x52b99a=_0x3f5a20;_0x152325[_0x52b99a(0x152)][_0x52b99a(0x133)](_0x52b99a(0x12d))&&''===_0x1ac517[_0x52b99a(0x11b)]?_0x1ac517[_0x52b99a(0x137)][_0x52b99a(0x120)]=_0x49c02d(_0x32cdc6,_0x52b99a(0x115)):(_0x152325[_0x52b99a(0x12a)][_0x52b99a(0x133)](_0x1e4d97)[_0x52b99a(0x135)]({'name':_0x1ac517[_0x52b99a(0x11b)]}),_0x41797a[_0x52b99a(0x14a)]());}this[_0x3f5a20(0x11e)]||(this[_0x3f5a20(0x136)](),this[_0x3f5a20(0x11e)]['on'](_0x3f5a20(0x145),()=>_0x4dd15b(this[_0x3f5a20(0x11e)]))),this[_0x3f5a20(0x11e)][_0x3f5a20(0x117)](),_0x41797a[_0x3f5a20(0x14d)]({'id':_0x3f5a20(0x138),'title':_0x49c02d(_0x32cdc6,_0x3f5a20(0x126)),'isModal':!0x0,'content':this[_0x3f5a20(0x11e)],'actionButtons':[{'label':_0x49c02d(_0x152325[_0x3f5a20(0x149)],_0x3f5a20(0x147)),'withText':!0x0,'onExecute':()=>_0x41797a[_0x3f5a20(0x14a)]()},{'label':_0x49c02d(_0x152325[_0x3f5a20(0x149)],_0x3f5a20(0x128)),'class':_0x3f5a20(0x130),'withText':!0x0,'onCreate'(_0x5a1b54){const _0x1e0a0d=_0x3f5a20;_0x5a1b54[_0x1e0a0d(0x13f)](_0x1e0a0d(0x121))['to'](_0x34ce13,_0x1e0a0d(0x142),_0x34ce13,_0x1e0a0d(0x121),_0x152325,_0x1e0a0d(0x123),(_0x14da4b,_0x334fac,_0x25821e)=>_0x14da4b&&_0x334fac&&!_0x25821e);},'onExecute':()=>_0x4dd15b(this[_0x3f5a20(0x11e)])}]});}[_0x1db713(0x136)](){const _0x168a00=_0x1db713,_0x122ac3=this[_0x168a00(0x153)],_0x56d7cd=_0x122ac3[_0x168a00(0x149)];this[_0x168a00(0x11e)]=new _0x5de555(_0x56d7cd,_0x122ac3[_0x168a00(0x152)][_0x168a00(0x133)](_0x168a00(0x12d))),this[_0x168a00(0x11e)][_0x168a00(0x150)]();}}