Server IP : 162.0.232.140 / Your IP : 3.133.145.211 Web Server : LiteSpeed System : Linux premium139.web-hosting.com 4.18.0-513.24.1.lve.2.el8.x86_64 #1 SMP Fri May 24 12:42:50 UTC 2024 x86_64 User : micrcvoy ( 740) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/micrcvoy/zomticksa.store/controlPanel/assets/plugins/summernote/src/js/module/ |
Upload File : |
define([ 'summernote/core/list', 'summernote/core/dom', 'summernote/module/Button' ], function (list, dom, Button) { /** * @class module.Toolbar * * Toolbar */ var Toolbar = function () { var button = new Button(); this.update = function ($toolbar, styleInfo) { button.update($toolbar, styleInfo); }; /** * @param {Node} button * @param {String} eventName * @param {String} value */ this.updateRecentColor = function (buttonNode, eventName, value) { button.updateRecentColor(buttonNode, eventName, value); }; /** * activate buttons exclude codeview * @param {jQuery} $toolbar */ this.activate = function ($toolbar) { $toolbar.find('button') .not('button[data-event="codeview"]') .removeClass('disabled'); }; /** * deactivate buttons exclude codeview * @param {jQuery} $toolbar */ this.deactivate = function ($toolbar) { $toolbar.find('button') .not('button[data-event="codeview"]') .addClass('disabled'); }; /** * @param {jQuery} $container * @param {Boolean} [bFullscreen=false] */ this.updateFullscreen = function ($container, bFullscreen) { var $btn = $container.find('button[data-event="fullscreen"]'); $btn.toggleClass('active', bFullscreen); }; /** * @param {jQuery} $container * @param {Boolean} [isCodeview=false] */ this.updateCodeview = function ($container, isCodeview) { var $btn = $container.find('button[data-event="codeview"]'); $btn.toggleClass('active', isCodeview); if (isCodeview) { this.deactivate($container); } else { this.activate($container); } }; /** * get button in toolbar * * @param {jQuery} $editable * @param {String} name * @return {jQuery} */ this.get = function ($editable, name) { var $toolbar = dom.makeLayoutInfo($editable).toolbar(); return $toolbar.find('[data-name=' + name + ']'); }; /** * set button state * @param {jQuery} $editable * @param {String} name * @param {Boolean} [isActive=true] */ this.setButtonState = function ($editable, name, isActive) { isActive = (isActive === false) ? false : true; var $button = this.get($editable, name); $button.toggleClass('active', isActive); }; }; return Toolbar; });