Craft.Redactor=Craft.Redactor||{},Craft.Redactor.PluginBase={app:null,title:null,apiTarget:null,icon:null,elementSiteId:null,init:function(t){this.app=t},start:function(){this.title=this.app.lang.get(this.title)},overrideButton:function(t){var e=this.app.toolbar.getButton(t);if(e){var i=e.$icon.get(0),r=t+"_placeholder",a=this.app.toolbar.addButtonAfter(t,r,{title:this.title});e.remove();var o={title:this.title,api:this.apiTarget},n=this.app.toolbar.addButtonAfter(r,t,o);a.remove(),n.setIcon(i)}else this.addButton(t)},addButton:function(t,e){var i,r,a=this.app.toolbar.getButtonsKeys(),o={title:this.title,api:this.apiTarget};void 0!==e&&(a=this.app.toolbar.getButtons()).length>e&&(i="before",r=a[e]),this.app.toolbar.addButton(t,o,i,r).setIcon($('<i class="re-icon-'+t+'"></i>').get(0))},setElementSiteId:function(t){this.elementSiteId=t},registerCmdS:function(t,e){Garnish.shortcutManager.addLayer(),Garnish.shortcutManager.registerShortcut({keyCode:Garnish.S_KEY,ctrl:!0},(function(){t()})),Garnish.shortcutManager.registerShortcut(Garnish.ESC_KEY,(function(){e()}))},saveSelection:function(t){t.selection.isCollapsed()?(t.selection.save(),t.selectionMarkers=!1):(t.selection.saveMarkers(),t.selectionMarkers=!0)},restoreSelection:function(t){t.selectionMarkers?t.selection.restoreMarkers():t.selection.restore(),t.selectionMarkers=!1}};
//# sourceMappingURL=PluginBase.js.map