Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • osian/sucs-site
  • kais58/sucs-site
  • imranh/sucs-site
  • foshjedi2004/sucs-site
  • gigosaurus/sucs-site
  • matstn/sucs-site
  • ripp_/sucs-site
  • eggnog/sucs-site
  • sucssite/sucs-site
  • elbows/sucs-site
  • realitykiller/sucs-site
  • crox/sucs-site
  • vectre/sucs-site
  • welshbyte/sucs-site
  • paperclipman/sucs-site
15 results
Show changes
Showing
with 0 additions and 565 deletions
/**
* $RCSfile: editor_plugin_src.js,v $
* $Revision: 1.31 $
* $Date: 2006/05/03 10:46:41 $
*
* @author Moxiecode
* @copyright Copyright 2004-2006, Moxiecode Systems AB, All rights reserved.
*/
/* Import plugin specific language pack */
//tinyMCE.importPluginLanguagePack('contextmenu', 'en,tr,zh_cn,cs,fa,fr_ca,fr,de,nb');
if (!tinyMCE.settings['contextmenu_skip_plugin_css']) {
tinyMCE.loadCSS(tinyMCE.baseURL + "/plugins/contextmenu/css/contextmenu.css");
}
var TinyMCE_ContextMenuPlugin = {
// Private fields
_contextMenu : null,
getInfo : function() {
return {
longname : 'Context menus',
author : 'Moxiecode Systems',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_contextmenu.html',
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
};
},
initInstance : function(inst) {
// Is not working on MSIE 5.0 or Opera no contextmenu event
if (tinyMCE.isMSIE5_0 && tinyMCE.isOpera)
return;
TinyMCE_ContextMenuPlugin._contextMenu = new TinyMCE_ContextMenu({
commandhandler : "TinyMCE_ContextMenuPlugin._commandHandler",
spacer_image : tinyMCE.baseURL + "/plugins/contextmenu/images/spacer.gif"
});
// Add hide event handles
tinyMCE.addEvent(inst.getDoc(), "click", TinyMCE_ContextMenuPlugin._hideContextMenu);
tinyMCE.addEvent(inst.getDoc(), "keypress", TinyMCE_ContextMenuPlugin._hideContextMenu);
tinyMCE.addEvent(inst.getDoc(), "keydown", TinyMCE_ContextMenuPlugin._hideContextMenu);
tinyMCE.addEvent(document, "click", TinyMCE_ContextMenuPlugin._hideContextMenu);
tinyMCE.addEvent(document, "keypress", TinyMCE_ContextMenuPlugin._hideContextMenu);
tinyMCE.addEvent(document, "keydown", TinyMCE_ContextMenuPlugin._hideContextMenu);
// Attach contextmenu event
if (tinyMCE.isGecko) {
tinyMCE.addEvent(inst.getDoc(), "contextmenu", function(e) {TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE ? inst.contentWindow.event : e, inst);});
} else
tinyMCE.addEvent(inst.getDoc(), "contextmenu", TinyMCE_ContextMenuPlugin._onContextMenu);
},
// Private plugin internal methods
_onContextMenu : function(e) {
var elm = tinyMCE.isMSIE ? e.srcElement : e.target;
var targetInst, body;
// Find instance
if ((body = tinyMCE.getParentElement(elm, "body")) != null) {
for (var n in tinyMCE.instances) {
var inst = tinyMCE.instances[n];
if (!tinyMCE.isInstance(inst))
continue;
if (body == inst.getBody()) {
targetInst = inst;
break;
}
}
return TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE ? targetInst.contentWindow.event : e, targetInst);
}
},
_showContextMenu : function(e, inst) {
function getAttrib(elm, name) {
return elm.getAttribute(name) ? elm.getAttribute(name) : "";
}
var x, y, elm, contextMenu;
var pos = tinyMCE.getAbsPosition(inst.iframeElement);
x = tinyMCE.isMSIE ? e.screenX : pos.absLeft + (e.pageX - inst.getBody().scrollLeft);
y = tinyMCE.isMSIE ? e.screenY : pos.absTop + (e.pageY - inst.getBody().scrollTop);
elm = tinyMCE.isMSIE ? e.srcElement : e.target;
contextMenu = this._contextMenu;
contextMenu.inst = inst;
// Mozilla needs some time
window.setTimeout(function () {
var theme = tinyMCE.getParam("theme");
contextMenu.clearAll();
var sel = inst.selection.getSelectedText().length != 0 || elm.nodeName == "IMG";
// Default items
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/cut.gif", "$lang_cut_desc", "Cut", "", !sel);
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/copy.gif", "$lang_copy_desc", "Copy", "", !sel);
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_paste_desc", "Paste", "", false);
if (sel || (elm ? (elm.nodeName == 'A') || (elm.nodeName == 'IMG') : false)) {
contextMenu.addSeparator();
contextMenu.addItem(tinyMCE.baseURL + "/themes/advanced/images/link.gif", "$lang_link_desc", inst.hasPlugin("advlink") ? "mceAdvLink" : "mceLink");
contextMenu.addItem(tinyMCE.baseURL + "/themes/advanced/images/unlink.gif", "$lang_unlink_desc", "unlink", "", (elm ? (elm.nodeName != 'A') && (elm.nodeName != 'IMG') : true));
}
// Get element
elm = tinyMCE.getParentElement(elm, "img,table,td" + (inst.hasPlugin("advhr") ? ',hr' : ''));
if (elm) {
switch (elm.nodeName) {
case "IMG":
contextMenu.addSeparator();
// If flash
if (tinyMCE.getAttrib(elm, 'class').indexOf('mceItemFlash') != -1)
contextMenu.addItem(tinyMCE.baseURL + "/plugins/flash/images/flash.gif", "$lang_flash_props", "mceFlash");
else
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/image.gif", "$lang_image_props_desc", inst.hasPlugin("advimage") ? "mceAdvImage" : "mceImage");
break;
case "HR":
contextMenu.addSeparator();
contextMenu.addItem(tinyMCE.baseURL + "/plugins/advhr/images/advhr.gif", "$lang_insert_advhr_desc", "mceAdvancedHr");
break;
case "TABLE":
case "TD":
// Is table plugin loaded
if (inst.hasPlugin("table")) {
var colspan = (elm.nodeName == "TABLE") ? "" : getAttrib(elm, "colspan");
var rowspan = (elm.nodeName == "TABLE") ? "" : getAttrib(elm, "rowspan");
colspan = colspan == "" ? "1" : colspan;
rowspan = rowspan == "" ? "1" : rowspan;
contextMenu.addSeparator();
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/cut.gif", "$lang_table_cut_row_desc", "mceTableCutRow");
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/copy.gif", "$lang_table_copy_row_desc", "mceTableCopyRow");
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_table_paste_row_before_desc", "mceTablePasteRowBefore", "", inst.tableRowClipboard == null);
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_table_paste_row_after_desc", "mceTablePasteRowAfter", "", inst.tableRowClipboard == null);
/* contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyleft.gif", "$lang_justifyleft_desc", "JustifyLeft", "", false);
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifycenter.gif", "$lang_justifycenter_desc", "JustifyCenter", "", false);
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyright.gif", "$lang_justifyright_desc", "JustifyRight", "", false);
contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyfull.gif", "$lang_justifyfull_desc", "JustifyFull", "", false);*/
contextMenu.addSeparator();
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_desc", "mceInsertTable", "insert");
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_props_desc", "mceInsertTable");
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_cell_props.gif", "$lang_table_cell_desc", "mceTableCellProps");
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete.gif", "$lang_table_del", "mceTableDelete");
contextMenu.addSeparator();
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_row_props.gif", "$lang_table_row_desc", "mceTableRowProps");
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_row_before.gif", "$lang_table_row_before_desc", "mceTableInsertRowBefore");
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_row_after.gif", "$lang_table_row_after_desc", "mceTableInsertRowAfter");
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete_row.gif", "$lang_table_delete_row_desc", "mceTableDeleteRow");
contextMenu.addSeparator();
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_col_before.gif", "$lang_table_col_before_desc", "mceTableInsertColBefore");
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_col_after.gif", "$lang_table_col_after_desc", "mceTableInsertColAfter");
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete_col.gif", "$lang_table_delete_col_desc", "mceTableDeleteCol");
contextMenu.addSeparator();
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_split_cells.gif", "$lang_table_split_cells_desc", "mceTableSplitCells", "", (colspan == "1" && rowspan == "1"));
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_merge_cells.gif", "$lang_table_merge_cells_desc", "mceTableMergeCells", "", false);
}
break;
}
} else {
// Add table specific
if (inst.hasPlugin("table")) {
contextMenu.addSeparator();
contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_desc", "mceInsertTable", "insert");
}
}
contextMenu.show(x, y);
}, 10);
// Cancel default handeling
tinyMCE.cancelEvent(e);
return false;
},
_hideContextMenu : function() {
if (TinyMCE_ContextMenuPlugin._contextMenu)
TinyMCE_ContextMenuPlugin._contextMenu.hide();
},
_commandHandler : function(command, value) {
var cm = TinyMCE_ContextMenuPlugin._contextMenu;
cm.hide();
// UI must be true on these
var ui = false;
if (command == "mceInsertTable" || command == "mceTableCellProps" || command == "mceTableRowProps" || command == "mceTableMergeCells")
ui = true;
if (command == "Paste")
value = null;
if (tinyMCE.getParam("dialog_type") == "modal" && tinyMCE.isMSIE) {
// Cell properties will generate access denied error is this isn't done?!
window.setTimeout(function() {
cm.inst.execCommand(command, ui, value);
}, 100);
} else
cm.inst.execCommand(command, ui, value);
}
};
tinyMCE.addPlugin("contextmenu", TinyMCE_ContextMenuPlugin);
// Context menu class
function TinyMCE_ContextMenu(settings) {
// Default value function
function defParam(key, def_val) {
settings[key] = typeof(settings[key]) != "undefined" ? settings[key] : def_val;
}
var self = this;
this.isMSIE = (navigator.appName == "Microsoft Internet Explorer");
// Setup contextmenu div
this.contextMenuDiv = document.createElement("div");
this.contextMenuDiv.className = "contextMenu";
this.contextMenuDiv.setAttribute("class", "contextMenu");
this.contextMenuDiv.style.display = "none";
this.contextMenuDiv.style.position = 'absolute';
this.contextMenuDiv.style.zindex = 1000;
this.contextMenuDiv.style.left = '0';
this.contextMenuDiv.style.top = '0';
this.contextMenuDiv.unselectable = "on";
document.body.appendChild(this.contextMenuDiv);
// Setup default values
defParam("commandhandler", "");
defParam("spacer_image", "images/spacer.gif");
this.items = new Array();
this.settings = settings;
this.html = "";
// IE Popup
if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera) {
this.pop = window.createPopup();
doc = this.pop.document;
doc.open();
doc.write('<html><head><link href="' + tinyMCE.baseURL + '/plugins/contextmenu/css/contextmenu.css" rel="stylesheet" type="text/css" /></head><body unselectable="yes" class="contextMenuIEPopup"></body></html>');
doc.close();
}
};
TinyMCE_ContextMenu.prototype = {
clearAll : function() {
this.html = "";
this.contextMenuDiv.innerHTML = "";
},
addSeparator : function() {
this.html += '<tr class="contextMenuItem"><td class="contextMenuIcon"><img src="' + this.settings['spacer_image'] + '" width="20" height="1" class="contextMenuImage" /></td><td><img class="contextMenuSeparator" width="1" height="1" src="' + this.settings['spacer_image'] + '" /></td></tr>';
},
addItem : function(icon, title, command, value, disabled) {
if (title.charAt(0) == '$')
title = tinyMCE.getLang(title.substring(1));
var onMouseDown = '';
var html = '';
if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0)
onMouseDown = 'contextMenu.execCommand(\'' + command + '\', \'' + value + '\');return false;';
else
onMouseDown = this.settings['commandhandler'] + '(\'' + command + '\', \'' + value + '\');return false;';
if (icon == "")
icon = this.settings['spacer_image'];
if (!disabled)
html += '<tr class="contextMenuItem">';
else
html += '<tr class="contextMenuItemDisabled">';
html += '<td class="contextMenuIcon"><img src="' + icon + '" width="20" height="20" class="contextMenuImage" /></td>';
html += '<td><div class="contextMenuText">';
html += '<a href="javascript:void(0);" onclick="' + onMouseDown + '" onmousedown="return false;">&#160;';
// Add text
html += title;
html += '&#160;</a>';
html += '</div></td>';
html += '</tr>';
// Add to main
this.html += html;
},
show : function(x, y) {
var vp, width, height;
if (this.html == "")
return;
var html = '';
html += '<a href="#"></a><table border="0" cellpadding="0" cellspacing="0">';
html += this.html;
html += '</table>';
this.contextMenuDiv.innerHTML = html;
// Get dimensions
this.contextMenuDiv.style.display = "block";
width = this.contextMenuDiv.offsetWidth;
height = this.contextMenuDiv.offsetHeight;
this.contextMenuDiv.style.display = "none";
if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera) {
// Setup popup and show
this.pop.document.body.innerHTML = '<div class="contextMenu">' + html + "</div>";
this.pop.document.tinyMCE = tinyMCE;
this.pop.document.contextMenu = this;
this.pop.show(x, y, width, height);
} else {
vp = this.getViewPort();
this.contextMenuDiv.style.left = (x > vp.width - width ? vp.width - width : x) + 'px';
this.contextMenuDiv.style.top = (y > vp.height - height ? vp.height - height : y) + 'px';
this.contextMenuDiv.style.display = "block";
}
},
getViewPort : function() {
return {
width : document.documentElement.offsetWidth || document.body.offsetWidth,
height : self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
};
},
hide : function() {
if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera)
this.pop.hide();
else
this.contextMenuDiv.style.display = "none";
},
execCommand : function(command, value) {
eval(this.settings['commandhandler'] + "(command, value);");
}
};
Check the TinyMCE documentation for details on this plugin.
tinyMCE.importPluginLanguagePack('directionality','en,tr,sv,fr_ca,zh_cn,cs,da,he,nb,de,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,pl,nl,fr,pt_br');var TinyMCE_DirectionalityPlugin={getInfo:function(){return{longname:'Directionality',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_directionality.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},getControlHTML:function(cn){switch(cn){case"ltr":return tinyMCE.getButtonHTML(cn,'lang_directionality_ltr_desc','{$pluginurl}/images/ltr.gif','mceDirectionLTR');case"rtl":return tinyMCE.getButtonHTML(cn,'lang_directionality_rtl_desc','{$pluginurl}/images/rtl.gif','mceDirectionRTL');}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceDirectionLTR":var inst=tinyMCE.getInstanceById(editor_id);var elm=tinyMCE.getParentElement(inst.getFocusElement(),"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(elm)elm.setAttribute("dir","ltr");tinyMCE.triggerNodeChange(false);return true;case"mceDirectionRTL":var inst=tinyMCE.getInstanceById(editor_id);var elm=tinyMCE.getParentElement(inst.getFocusElement(),"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(elm)elm.setAttribute("dir","rtl");tinyMCE.triggerNodeChange(false);return true;}return false;},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){function getAttrib(elm,name){return elm.getAttribute(name)?elm.getAttribute(name):"";}if(node==null)return;var elm=tinyMCE.getParentElement(node,"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(!elm){tinyMCE.switchClass(editor_id+'_ltr','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_rtl','mceButtonDisabled');return true;}tinyMCE.switchClass(editor_id+'_ltr','mceButtonNormal');tinyMCE.switchClass(editor_id+'_rtl','mceButtonNormal');var dir=getAttrib(elm,"dir");if(dir=="ltr"||dir=="")tinyMCE.switchClass(editor_id+'_ltr','mceButtonSelected');else tinyMCE.switchClass(editor_id+'_rtl','mceButtonSelected');return true;}};tinyMCE.addPlugin("directionality",TinyMCE_DirectionalityPlugin);
\ No newline at end of file
/**
* $RCSfile: editor_plugin_src.js,v $
* $Revision: 1.16 $
* $Date: 2006/02/10 21:34:28 $
*
* @author Moxiecode
* @copyright Copyright 2004-2006, Moxiecode Systems AB, All rights reserved.
*/
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('directionality', 'en,tr,sv,fr_ca,zh_cn,cs,da,he,nb,de,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,pl,nl,fr,pt_br');
var TinyMCE_DirectionalityPlugin = {
getInfo : function() {
return {
longname : 'Directionality',
author : 'Moxiecode Systems',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_directionality.html',
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
};
},
getControlHTML : function(cn) {
switch (cn) {
case "ltr":
return tinyMCE.getButtonHTML(cn, 'lang_directionality_ltr_desc', '{$pluginurl}/images/ltr.gif', 'mceDirectionLTR');
case "rtl":
return tinyMCE.getButtonHTML(cn, 'lang_directionality_rtl_desc', '{$pluginurl}/images/rtl.gif', 'mceDirectionRTL');
}
return "";
},
execCommand : function(editor_id, element, command, user_interface, value) {
// Handle commands
switch (command) {
case "mceDirectionLTR":
var inst = tinyMCE.getInstanceById(editor_id);
var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
if (elm)
elm.setAttribute("dir", "ltr");
tinyMCE.triggerNodeChange(false);
return true;
case "mceDirectionRTL":
var inst = tinyMCE.getInstanceById(editor_id);
var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
if (elm)
elm.setAttribute("dir", "rtl");
tinyMCE.triggerNodeChange(false);
return true;
}
// Pass to next handler in chain
return false;
},
handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
function getAttrib(elm, name) {
return elm.getAttribute(name) ? elm.getAttribute(name) : "";
}
if (node == null)
return;
var elm = tinyMCE.getParentElement(node, "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
if (!elm) {
tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonDisabled');
tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonDisabled');
return true;
}
tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonNormal');
tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonNormal');
var dir = getAttrib(elm, "dir");
if (dir == "ltr" || dir == "")
tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonSelected');
else
tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonSelected');
return true;
}
};
tinyMCE.addPlugin("directionality", TinyMCE_DirectionalityPlugin);
// UK lang variables
tinyMCE.addToLang('',{
directionality_ltr_desc : 'Direction left to right',
directionality_rtl_desc : 'Direction right to left'
});
Check the TinyMCE documentation for details on this plugin.
tinyMCE.importPluginLanguagePack('emotions','en,tr,sv,zh_cn,cs,fa,fr_ca,fr,de,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,zh_tw,zh_tw_utf8,sk');var TinyMCE_EmotionsPlugin={getInfo:function(){return{longname:'Emotions',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_emotions.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},getControlHTML:function(cn){switch(cn){case"emotions":return tinyMCE.getButtonHTML(cn,'lang_emotions_desc','{$pluginurl}/images/emotions.gif','mceEmotion');}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceEmotion":var template=new Array();template['file']='../../plugins/emotions/emotions.htm';template['width']=160;template['height']=160;template['width']+=tinyMCE.getLang('lang_emotions_delta_width',0);template['height']+=tinyMCE.getLang('lang_emotions_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;}return false;}};tinyMCE.addPlugin('emotions',TinyMCE_EmotionsPlugin);
\ No newline at end of file
/**
* $RCSfile: editor_plugin_src.js,v $
* $Revision: 1.23 $
* $Date: 2006/02/10 16:29:38 $
*
* @author Moxiecode
* @copyright Copyright 2004-2006, Moxiecode Systems AB, All rights reserved.
*/
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('emotions', 'en,tr,sv,zh_cn,cs,fa,fr_ca,fr,de,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,zh_tw,zh_tw_utf8,sk');
// Plucin static class
var TinyMCE_EmotionsPlugin = {
getInfo : function() {
return {
longname : 'Emotions',
author : 'Moxiecode Systems',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_emotions.html',
version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
};
},
/**
* Returns the HTML contents of the emotions control.
*/
getControlHTML : function(cn) {
switch (cn) {
case "emotions":
return tinyMCE.getButtonHTML(cn, 'lang_emotions_desc', '{$pluginurl}/images/emotions.gif', 'mceEmotion');
}
return "";
},
/**
* Executes the mceEmotion command.
*/
execCommand : function(editor_id, element, command, user_interface, value) {
// Handle commands
switch (command) {
case "mceEmotion":
var template = new Array();
template['file'] = '../../plugins/emotions/emotions.htm'; // Relative to theme
template['width'] = 160;
template['height'] = 160;
// Language specific width and height addons
template['width'] += tinyMCE.getLang('lang_emotions_delta_width', 0);
template['height'] += tinyMCE.getLang('lang_emotions_delta_height', 0);
tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
return true;
}
// Pass to next handler in chain
return false;
}
};
// Register plugin
tinyMCE.addPlugin('emotions', TinyMCE_EmotionsPlugin);
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{$lang_emotions_title}</title>
<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
<script language="javascript" type="text/javascript" src="jscripts/functions.js"></script>
<base target="_self" />
</head>
<body style="display: none">
<div align="center">
<div class="title">{$lang_emotions_title}:<br /><br /></div>
<table border="0" cellspacing="0" cellpadding="4">
<tr>
<td><a href="javascript:insertEmotion('smiley-cool.gif','lang_emotions_cool');"><img src="images/smiley-cool.gif" width="18" height="18" border="0" alt="{$lang_emotions_cool}" title="{$lang_emotions_cool}" /></a></td>
<td><a href="javascript:insertEmotion('smiley-cry.gif','lang_emotions_cry');"><img src="images/smiley-cry.gif" width="18" height="18" border="0" alt="{$lang_emotions_cry}" title="{$lang_emotions_cry}" /></a></td>
<td><a href="javascript:insertEmotion('smiley-embarassed.gif','lang_emotions_embarassed');"><img src="images/smiley-embarassed.gif" width="18" height="18" border="0" alt="{$lang_emotions_embarassed}" title="{$lang_emotions_embarassed}" /></a></td>
<td><a href="javascript:insertEmotion('smiley-foot-in-mouth.gif','lang_emotions_foot_in_mouth');"><img src="images/smiley-foot-in-mouth.gif" width="18" height="18" border="0" alt="{$lang_emotions_foot_in_mouth}" title="{$lang_emotions_foot_in_mouth}" /></a></td>
</tr>
<tr>
<td><a href="javascript:insertEmotion('smiley-frown.gif','lang_emotions_frown');"><img src="images/smiley-frown.gif" width="18" height="18" border="0" alt="{$lang_emotions_frown}" title="{$lang_emotions_frown}" /></a></td>
<td><a href="javascript:insertEmotion('smiley-innocent.gif','lang_emotions_innocent');"><img src="images/smiley-innocent.gif" width="18" height="18" border="0" alt="{$lang_emotions_innocent}" title="{$lang_emotions_innocent}" /></a></td>
<td><a href="javascript:insertEmotion('smiley-kiss.gif','lang_emotions_kiss');"><img src="images/smiley-kiss.gif" width="18" height="18" border="0" alt="{$lang_emotions_kiss}" title="{$lang_emotions_kiss}" /></a></td>
<td><a href="javascript:insertEmotion('smiley-laughing.gif','lang_emotions_laughing');"><img src="images/smiley-laughing.gif" width="18" height="18" border="0" alt="{$lang_emotions_laughing}" title="{$lang_emotions_laughing}" /></a></td>
</tr>
<tr>
<td><a href="javascript:insertEmotion('smiley-money-mouth.gif','lang_emotions_money_mouth');"><img src="images/smiley-money-mouth.gif" width="18" height="18" border="0" alt="{$lang_emotions_money_mouth}" title="{$lang_emotions_money_mouth}" /></a></td>
<td><a href="javascript:insertEmotion('smiley-sealed.gif','lang_emotions_sealed');"><img src="images/smiley-sealed.gif" width="18" height="18" border="0" alt="{$lang_emotions_sealed}" title="{$lang_emotions_sealed}" /></a></td>
<td><a href="javascript:insertEmotion('smiley-smile.gif','lang_emotions_smile');"><img src="images/smiley-smile.gif" width="18" height="18" border="0" alt="{$lang_emotions_smile}" title="{$lang_emotions_smile}" /></a></td>
<td><a href="javascript:insertEmotion('smiley-surprised.gif','lang_emotions_surprised');"><img src="images/smiley-surprised.gif" width="18" height="18" border="0" alt="{$lang_emotions_surprised}" title="{$lang_emotions_surprised}" /></a></td>
</tr>
<tr>
<td><a href="javascript:insertEmotion('smiley-tongue-out.gif','lang_emotions_tongue_out');"><img src="images/smiley-tongue-out.gif" width="18" height="18" border="0" alt="{$lang_emotions_tongue-out}" title="{$lang_emotions_tongue_out}" /></a></td>
<td><a href="javascript:insertEmotion('smiley-undecided.gif','lang_emotions_undecided');"><img src="images/smiley-undecided.gif" width="18" height="18" border="0" alt="{$lang_emotions_undecided}" title="{$lang_emotions_undecided}" /></a></td>
<td><a href="javascript:insertEmotion('smiley-wink.gif','lang_emotions_wink');"><img src="images/smiley-wink.gif" width="18" height="18" border="0" alt="{$lang_emotions_wink}" title="{$lang_emotions_wink}" /></a></td>
<td><a href="javascript:insertEmotion('smiley-yell.gif','lang_emotions_yell');"><img src="images/smiley-yell.gif" width="18" height="18" border="0" alt="{$lang_emotions_yell}" title="{$lang_emotions_yell}" /></a></td>
</tr>
</table>
</div>
</body>
</html>
These emotions where taken from Mozilla Thunderbird.
I hope they don't get angry if I use them here after all this is a open source project aswell.