WebUI/AchieveManageWeb/kindeditor-4.1.3/plugins/emoticons/emoticons.js

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/*******************************************************************************
* KindEditor - WYSIWYG HTML Editor for Internet
* Copyright (C) 2006-2011 kindsoft.net
*
* @author Roddy <luolonghao@gmail.com>
* @site http://www.kindsoft.net/
* @licence http://www.kindsoft.net/license.php
*******************************************************************************/

KindEditor.plugin('emoticons', function (K) {
    var self = this, name = 'emoticons',
		path = (self.emoticonsPath || self.pluginsPath + 'emoticons/images/'),
		allowPreview = self.allowPreviewEmoticons === undefined ? true : self.allowPreviewEmoticons,
		currentPageNum = 1;
    self.clickToolbar(name, function () {
        var rows = 5, cols = 9, total = 135, startNum = 0,
			cells = rows * cols, pages = Math.ceil(total / cells),
			colsHalf = Math.floor(cols / 2),
			wrapperDiv = K('<div class="ke-plugin-emoticons"></div>'),
			elements = [],
			menu = self.createMenu({
			    name: name,
			    beforeRemove: function () {
			        removeEvent();
			    }
			});
        menu.div.append(wrapperDiv);
        var previewDiv, previewImg;
        if (allowPreview) {
            previewDiv = K('<div class="ke-preview"></div>').css('right', 0);
            previewImg = K('<img class="ke-preview-img" src="' + path + startNum + '.gif" />');
            wrapperDiv.append(previewDiv);
            previewDiv.append(previewImg);
        }
        function bindCellEvent(cell, j, num) {
            if (previewDiv) {
                cell.mouseover(function () {
                    if (j > colsHalf) {
                        previewDiv.css('left', 0);
                        previewDiv.css('right', '');
                    } else {
                        previewDiv.css('left', '');
                        previewDiv.css('right', 0);
                    }
                    previewImg.attr('src', path + num + '.gif');
                    K(this).addClass('ke-on');
                });
            } else {
                cell.mouseover(function () {
                    K(this).addClass('ke-on');
                });
            }
            cell.mouseout(function () {
                K(this).removeClass('ke-on');
            });
            cell.click(function (e) {
                self.insertHtml('<img src="' + path + num + '.gif" border="0" alt="" />').hideMenu().focus();
                e.stop();
            });
        }
后面还有 69 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。