All Downloads are FREE. Search and download functionalities are using the official Maven repository.

template.js.tinymce.plugins.emoticons.plugin.js Maven / Gradle / Ivy

There is a newer version: 5.0.6
Show newest version
/**
 * plugin.js
 *
 * Released under LGPL License.
 * Copyright (c) 1999-2015 Ephox Corp. All rights reserved
 *
 * License: http://www.tinymce.com/license
 * Contributing: http://www.tinymce.com/contributing
 */

/*global tinymce:true */

tinymce.PluginManager.add('emoticons', function(editor, url) {
	var emoticons = [
		["cool", "cry", "embarassed", "foot-in-mouth"],
		["frown", "innocent", "kiss", "laughing"],
		["money-mouth", "sealed", "smile", "surprised"],
		["tongue-out", "undecided", "wink", "yell"]
	];

	function getHtml() {
		var emoticonsHtml;

		emoticonsHtml = '';

		tinymce.each(emoticons, function(row) {
			emoticonsHtml += '';

			tinymce.each(row, function(icon) {
				var emoticonUrl = url + '/img/smiley-' + icon + '.gif';

				emoticonsHtml += '';
			});

			emoticonsHtml += '';
		});

		emoticonsHtml += '
'; return emoticonsHtml; } editor.addButton('emoticons', { type: 'panelbutton', panel: { role: 'application', autohide: true, html: getHtml, onclick: function(e) { var linkElm = editor.dom.getParent(e.target, 'a'); if (linkElm) { editor.insertContent( '' + linkElm.getAttribute('data-mce-alt') + '' ); this.hide(); } } }, tooltip: 'Emoticons' }); });




© 2015 - 2024 Weber Informatics LLC | Privacy Policy