Sha256: 6c137a2871724898763976e6e8a548085ac18e2b62046bb30ac43ae76f463b2e

Contents?: true

Size: 1.47 KB

Versions: 4

Compression:

Stored size: 1.47 KB

Contents

/**
 * $Id: ControlManager.js 999 2009-02-10 17:42:58Z spocke $
 *
 * @author Moxiecode
 * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
 */

(function(tinymce) {
	tinymce.CommandManager = function() {
		var execCommands = {}, queryStateCommands = {}, queryValueCommands = {};

		function add(collection, cmd, func, scope) {
			if (typeof(cmd) == 'string')
				cmd = [cmd];

			tinymce.each(cmd, function(cmd) {
				collection[cmd.toLowerCase()] = {func : func, scope : scope};
			});
		};

		tinymce.extend(this, {
			add : function(cmd, func, scope) {
				add(execCommands, cmd, func, scope);
			},

			addQueryStateHandler : function(cmd, func, scope) {
				add(queryStateCommands, cmd, func, scope);
			},

			addQueryValueHandler : function(cmd, func, scope) {
				add(queryValueCommands, cmd, func, scope);
			},

			execCommand : function(scope, cmd, ui, value, args) {
				if (cmd = execCommands[cmd.toLowerCase()]) {
					if (cmd.func.call(scope || cmd.scope, ui, value, args) !== false)
						return true;
				}
			},

			queryCommandValue : function() {
				if (cmd = queryValueCommands[cmd.toLowerCase()])
					return cmd.func.call(scope || cmd.scope, ui, value, args);
			},

			queryCommandState : function() {
				if (cmd = queryStateCommands[cmd.toLowerCase()])
					return cmd.func.call(scope || cmd.scope, ui, value, args);
			}
		});
	};

	tinymce.GlobalCommands = new tinymce.CommandManager();
})(tinymce);

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
westarete-skylinecms-3.0.8.20100329 public/skyline/javascripts/src/skyline.editor/vendor/tinymce/jscripts/tiny_mce/classes/CommandManager.js
westarete-skylinecms-3.0.8.20100330 public/skyline/javascripts/src/skyline.editor/vendor/tinymce/jscripts/tiny_mce/classes/CommandManager.js
skylinecms-3.0.8 public/skyline/javascripts/src/skyline.editor/vendor/tinymce/jscripts/tiny_mce/classes/CommandManager.js
skylinecms-3.0.7 public/skyline/javascripts/src/skyline.editor/vendor/tinymce/jscripts/tiny_mce/classes/CommandManager.js