/*! * summernote highlight plugin * http://www.hyl.pw/ * * Released under the MIT license */ (function (factory) { /* global define */ 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: jQuery factory(window.jQuery); } }(function ($) { // Extends plugins for adding highlight. // - plugin is external module for customizing. $.extend($.summernote.plugins, { /** * @param {Object} context - context object has status of editor. */ 'highlight': function (context) { var self = this; var ui = $.summernote.ui; var $editor = context.layoutInfo.editor; var options = context.options; var lang = options.langInfo; // add button context.memo('button.highlight', function () { // create button var button = ui.button({ contents: '', tooltip: 'highlight', click: function () { self.show() } }); // create jQuery object from button instance. var $highlight = button.render(); return $highlight; }); this.createDialog = function () { var $box = $('
'); var $selectGroup = $('
'); var $textGroup = $('
'); var $select = $('