app/tiny_mce/plugins/emotions/js/emotions.js
author Sverre Rabbelier <srabbelier@gmail.com>
Sun, 07 Dec 2008 13:49:22 +0000
changeset 697 190b65431579
parent 154 d2377425d3f2
permissions -rwxr-xr-x
Prepare for callbacks that return more than one menu This paves the way for callbacks that dynamically construct their menu based on in-db content, such as Programs and Documents. Patch by: Sverre Rabbelier

tinyMCEPopup.requireLangPack();

var EmotionsDialog = {
	init : function(ed) {
		tinyMCEPopup.resizeToInnerSize();
	},

	insert : function(file, title) {
		var ed = tinyMCEPopup.editor, dom = ed.dom;

		tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', {
			src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file,
			alt : ed.getLang(title),
			title : ed.getLang(title),
			border : 0
		}));

		tinyMCEPopup.close();
	}
};

tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog);