SimpleSignalCommands.js
资源名称:oa.rar [点击查看]
上传用户:kimgenplus
上传日期:2016-06-05
资源大小:20877k
文件大小:2k
源码类别:
OA系统
开发平台:
Java
- /*
- Copyright (c) 2004-2006, The Dojo Foundation
- All Rights Reserved.
- Licensed under the Academic Free License version 2.1 or above OR the
- modified BSD license. For more information on Dojo licensing, see:
- http://dojotoolkit.org/community/licensing.shtml
- */
- dojo.provide("dojo.widget.Editor2Plugin.SimpleSignalCommands");
- dojo.require("dojo.widget.Editor2");
- dojo.declare("dojo.widget.Editor2Plugin.SimpleSignalCommand", dojo.widget.Editor2Command, function (editor, name) {
- if (dojo.widget.Editor2.prototype[name] == undefined) {
- dojo.widget.Editor2.prototype[name] = function () {
- };
- }
- }, {execute:function () {
- this._editor[this._name]();
- }});
- if (dojo.widget.Editor2Plugin["SimpleSignalCommands"]) {
- dojo.widget.Editor2Plugin["_SimpleSignalCommands"] = dojo.widget.Editor2Plugin["SimpleSignalCommands"];
- }
- dojo.widget.Editor2Plugin.SimpleSignalCommands = {signals:["save", "insertImage"], Handler:function (name) {
- if (name.toLowerCase() == "save") {
- return new dojo.widget.Editor2ToolbarButton("Save");
- } else {
- if (name.toLowerCase() == "insertimage") {
- return new dojo.widget.Editor2ToolbarButton("InsertImage");
- }
- }
- }, getCommand:function (editor, name) {
- var signal;
- dojo.lang.every(this.signals, function (s) {
- if (s.toLowerCase() == name.toLowerCase()) {
- signal = s;
- return false;
- }
- return true;
- });
- if (signal) {
- return new dojo.widget.Editor2Plugin.SimpleSignalCommand(editor, signal);
- }
- }};
- if (dojo.widget.Editor2Plugin["_SimpleSignalCommands"]) {
- dojo.lang.mixin(dojo.widget.Editor2Plugin.SimpleSignalCommands, dojo.widget.Editor2Plugin["_SimpleSignalCommands"]);
- }
- dojo.widget.Editor2Manager.registerHandler(dojo.widget.Editor2Plugin.SimpleSignalCommands, "getCommand");
- dojo.widget.Editor2ToolbarItemManager.registerHandler(dojo.widget.Editor2Plugin.SimpleSignalCommands.Handler);