Init Repo
129
static/plugins/kindeditor/plugins/emoticons/emoticons.js
Executable file
@@ -0,0 +1,129 @@
|
||||
/*******************************************************************************
|
||||
* 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();
|
||||
});
|
||||
}
|
||||
function createEmoticonsTable(pageNum, parentDiv) {
|
||||
var table = document.createElement('table');
|
||||
parentDiv.append(table);
|
||||
if (previewDiv) {
|
||||
K(table).mouseover(function() {
|
||||
previewDiv.show('block');
|
||||
});
|
||||
K(table).mouseout(function() {
|
||||
previewDiv.hide();
|
||||
});
|
||||
elements.push(K(table));
|
||||
}
|
||||
table.className = 'ke-table';
|
||||
table.cellPadding = 0;
|
||||
table.cellSpacing = 0;
|
||||
table.border = 0;
|
||||
var num = (pageNum - 1) * cells + startNum;
|
||||
for (var i = 0; i < rows; i++) {
|
||||
var row = table.insertRow(i);
|
||||
for (var j = 0; j < cols; j++) {
|
||||
var cell = K(row.insertCell(j));
|
||||
cell.addClass('ke-cell');
|
||||
bindCellEvent(cell, j, num);
|
||||
var span = K('<span class="ke-img"></span>')
|
||||
.css('background-position', '-' + (24 * num) + 'px 0px')
|
||||
.css('background-image', 'url(' + path + 'static.gif)');
|
||||
cell.append(span);
|
||||
elements.push(cell);
|
||||
num++;
|
||||
}
|
||||
}
|
||||
return table;
|
||||
}
|
||||
var table = createEmoticonsTable(currentPageNum, wrapperDiv);
|
||||
function removeEvent() {
|
||||
K.each(elements, function() {
|
||||
this.unbind();
|
||||
});
|
||||
}
|
||||
var pageDiv;
|
||||
function bindPageEvent(el, pageNum) {
|
||||
el.click(function(e) {
|
||||
removeEvent();
|
||||
table.parentNode.removeChild(table);
|
||||
pageDiv.remove();
|
||||
table = createEmoticonsTable(pageNum, wrapperDiv);
|
||||
createPageTable(pageNum);
|
||||
currentPageNum = pageNum;
|
||||
e.stop();
|
||||
});
|
||||
}
|
||||
function createPageTable(currentPageNum) {
|
||||
pageDiv = K('<div class="ke-page"></div>');
|
||||
wrapperDiv.append(pageDiv);
|
||||
for (var pageNum = 1; pageNum <= pages; pageNum++) {
|
||||
if (currentPageNum !== pageNum) {
|
||||
var a = K('<a href="javascript:;">[' + pageNum + ']</a>');
|
||||
bindPageEvent(a, pageNum);
|
||||
pageDiv.append(a);
|
||||
elements.push(a);
|
||||
} else {
|
||||
pageDiv.append(K('@[' + pageNum + ']'));
|
||||
}
|
||||
pageDiv.append(K('@ '));
|
||||
}
|
||||
}
|
||||
createPageTable(currentPageNum);
|
||||
});
|
||||
});
|
||||
BIN
static/plugins/kindeditor/plugins/emoticons/images/0.gif
Executable file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/1.gif
Executable file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/10.gif
Executable file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/100.gif
Executable file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/101.gif
Executable file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/102.gif
Executable file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/103.gif
Executable file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/104.gif
Executable file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/105.gif
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/106.gif
Executable file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/107.gif
Executable file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/108.gif
Executable file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/109.gif
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/11.gif
Executable file
|
After Width: | Height: | Size: 7.8 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/110.gif
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/111.gif
Executable file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/112.gif
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/113.gif
Executable file
|
After Width: | Height: | Size: 1015 B |
BIN
static/plugins/kindeditor/plugins/emoticons/images/114.gif
Executable file
|
After Width: | Height: | Size: 1003 B |
BIN
static/plugins/kindeditor/plugins/emoticons/images/115.gif
Executable file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/116.gif
Executable file
|
After Width: | Height: | Size: 996 B |
BIN
static/plugins/kindeditor/plugins/emoticons/images/117.gif
Executable file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/118.gif
Executable file
|
After Width: | Height: | Size: 1012 B |
BIN
static/plugins/kindeditor/plugins/emoticons/images/119.gif
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/12.gif
Executable file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/120.gif
Executable file
|
After Width: | Height: | Size: 1008 B |
BIN
static/plugins/kindeditor/plugins/emoticons/images/121.gif
Executable file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/122.gif
Executable file
|
After Width: | Height: | Size: 999 B |
BIN
static/plugins/kindeditor/plugins/emoticons/images/123.gif
Executable file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/124.gif
Executable file
|
After Width: | Height: | Size: 1022 B |
BIN
static/plugins/kindeditor/plugins/emoticons/images/125.gif
Executable file
|
After Width: | Height: | Size: 1013 B |
BIN
static/plugins/kindeditor/plugins/emoticons/images/126.gif
Executable file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/127.gif
Executable file
|
After Width: | Height: | Size: 956 B |
BIN
static/plugins/kindeditor/plugins/emoticons/images/128.gif
Executable file
|
After Width: | Height: | Size: 1022 B |
BIN
static/plugins/kindeditor/plugins/emoticons/images/129.gif
Executable file
|
After Width: | Height: | Size: 972 B |
BIN
static/plugins/kindeditor/plugins/emoticons/images/13.gif
Executable file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/130.gif
Executable file
|
After Width: | Height: | Size: 980 B |
BIN
static/plugins/kindeditor/plugins/emoticons/images/131.gif
Executable file
|
After Width: | Height: | Size: 945 B |
BIN
static/plugins/kindeditor/plugins/emoticons/images/132.gif
Executable file
|
After Width: | Height: | Size: 936 B |
BIN
static/plugins/kindeditor/plugins/emoticons/images/133.gif
Executable file
|
After Width: | Height: | Size: 1012 B |
BIN
static/plugins/kindeditor/plugins/emoticons/images/134.gif
Executable file
|
After Width: | Height: | Size: 968 B |
BIN
static/plugins/kindeditor/plugins/emoticons/images/14.gif
Executable file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/15.gif
Executable file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/16.gif
Executable file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/17.gif
Executable file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/18.gif
Executable file
|
After Width: | Height: | Size: 7.9 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/19.gif
Executable file
|
After Width: | Height: | Size: 7.9 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/2.gif
Executable file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/20.gif
Executable file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/21.gif
Executable file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/22.gif
Executable file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/23.gif
Executable file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/24.gif
Executable file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/25.gif
Executable file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/26.gif
Executable file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/27.gif
Executable file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/28.gif
Executable file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/29.gif
Executable file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/3.gif
Executable file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/30.gif
Executable file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/31.gif
Executable file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/32.gif
Executable file
|
After Width: | Height: | Size: 7.0 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/33.gif
Executable file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/34.gif
Executable file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/35.gif
Executable file
|
After Width: | Height: | Size: 13 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/36.gif
Executable file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/37.gif
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/38.gif
Executable file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/39.gif
Executable file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/4.gif
Executable file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/40.gif
Executable file
|
After Width: | Height: | Size: 9.9 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/41.gif
Executable file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/42.gif
Executable file
|
After Width: | Height: | Size: 13 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/43.gif
Executable file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/44.gif
Executable file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/45.gif
Executable file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/46.gif
Executable file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/47.gif
Executable file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/48.gif
Executable file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/49.gif
Executable file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/5.gif
Executable file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/50.gif
Executable file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/51.gif
Executable file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/52.gif
Executable file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/53.gif
Executable file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/54.gif
Executable file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/55.gif
Executable file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/56.gif
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/57.gif
Executable file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/58.gif
Executable file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/59.gif
Executable file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/6.gif
Executable file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/60.gif
Executable file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/61.gif
Executable file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/62.gif
Executable file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/63.gif
Executable file
|
After Width: | Height: | Size: 971 B |
BIN
static/plugins/kindeditor/plugins/emoticons/images/64.gif
Executable file
|
After Width: | Height: | Size: 988 B |
BIN
static/plugins/kindeditor/plugins/emoticons/images/65.gif
Executable file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
static/plugins/kindeditor/plugins/emoticons/images/66.gif
Executable file
|
After Width: | Height: | Size: 1.1 KiB |