a:27:{s:9:"#provides";s:21:"dijit._editor._Plugin";s:9:"#resource";s:18:"_editor/_Plugin.js";s:9:"#requires";a:3:{i:0;a:2:{i:0;s:6:"common";i:1;s:13:"dijit._Widget";}i:1;a:2:{i:0;s:6:"common";i:1;s:12:"dijit.Editor";}i:2;a:2:{i:0;s:6:"common";i:1;s:17:"dijit.form.Button";}}s:21:"dijit._editor._Plugin";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:4:"args";a:2:{s:8:"optional";b:1;s:4:"type";s:6:"Object";}s:4:"node";a:2:{s:8:"optional";b:1;s:4:"type";s:7:"DomNode";}}s:6:"source";s:63:" if(args){ dojo.mixin(this, args); } this._connects=[];";s:14:"private_parent";b:1;s:9:"classlike";b:1;s:7:"summary";s:0:"";}s:28:"dijit._editor._Plugin.editor";a:6:{s:9:"prototype";s:21:"dijit._editor._Plugin";s:8:"instance";s:21:"dijit._editor._Plugin";s:4:"tags";a:1:{i:0;s:5:"const";}s:4:"type";s:12:"dijit.Editor";s:7:"summary";s:27:"Points to the parent editor";s:14:"private_parent";b:1;}s:37:"dijit._editor._Plugin.iconClassPrefix";a:5:{s:9:"prototype";s:21:"dijit._editor._Plugin";s:4:"tags";a:1:{i:0;s:5:"const";}s:4:"type";s:6:"String";s:7:"summary";s:85:"The CSS class name for the button node is formed from `iconClassPrefix` and `command`";s:14:"private_parent";b:1;}s:28:"dijit._editor._Plugin.button";a:5:{s:9:"prototype";s:21:"dijit._editor._Plugin";s:8:"instance";s:21:"dijit._editor._Plugin";s:4:"type";s:13:"dijit._Widget";s:7:"summary";s:187:"Pointer to `dijit.form.Button` or other widget (ex: `dijit.form.FilteringSelect`) that controls this plugin. If not specified, will be created on initialization according to `buttonClass`";s:14:"private_parent";b:1;}s:34:"dijit._editor._Plugin.queryCommand";a:4:{s:9:"prototype";s:21:"dijit._editor._Plugin";s:4:"type";s:4:"TODO";s:7:"summary";s:14:"unused, remove";s:14:"private_parent";b:1;}s:29:"dijit._editor._Plugin.command";a:4:{s:9:"prototype";s:21:"dijit._editor._Plugin";s:4:"type";s:6:"String";s:7:"summary";s:195:"String like "insertUnorderedList", "outdent", "justifyCenter", etc. that represents an editor command. Passed to editor.execCommand() if `useDefaultCommand` is true.";s:14:"private_parent";b:1;}s:32:"dijit._editor._Plugin.commandArg";a:4:{s:9:"prototype";s:21:"dijit._editor._Plugin";s:4:"type";s:8:"anything";s:7:"summary";s:61:"Argument to execCommand() after command. TODO: unused, remove";s:14:"private_parent";b:1;}s:39:"dijit._editor._Plugin.useDefaultCommand";a:4:{s:9:"prototype";s:21:"dijit._editor._Plugin";s:4:"type";s:7:"Boolean";s:7:"summary";s:103:"If true, this plugin executes by calling Editor.execCommand() with the argument specified in `command`.";s:14:"private_parent";b:1;}s:33:"dijit._editor._Plugin.buttonClass";a:4:{s:9:"prototype";s:21:"dijit._editor._Plugin";s:4:"type";s:6:"Widget";s:7:"summary";s:134:"Class Class for button to control this plugin. This is used to instantiate the button, unless `button` itself is specified directly.";s:14:"private_parent";b:1;}s:30:"dijit._editor._Plugin.getLabel";a:8:{s:9:"prototype";s:21:"dijit._editor._Plugin";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:3:"key";a:1:{s:4:"type";s:6:"String";}}s:6:"source";s:46:" return this.editor.commands[key]; // String";s:7:"summary";s:39:"Returns the label to use for the button";s:4:"tags";s:7:"private";s:7:"returns";s:6:"String";s:14:"private_parent";b:1;}s:33:"dijit._editor._Plugin._initButton";a:8:{s:9:"prototype";s:21:"dijit._editor._Plugin";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"props";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:442:" if(this.command.length){ var label = this.getLabel(this.command); var className = this.iconClassPrefix+" "+this.iconClassPrefix + this.command.charAt(0).toUpperCase() + this.command.substr(1); if(!this.button){ props = dojo.mixin({ label: label, showLabel: false, iconClass: className, dropDown: this.dropDown, tabIndex: "-1" }, props || {}); this.button = new this.buttonClass(props); } }";s:7:"summary";s:130:"Initialize the button that will control this plugin. This code only works for plugins controlling built-in commands in the editor.";s:4:"tags";s:19:"protected extension";s:7:"private";b:1;s:14:"private_parent";b:1;}s:29:"dijit._editor._Plugin.destroy";a:7:{s:9:"prototype";s:21:"dijit._editor._Plugin";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"f";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:2782:"dojo.provide("dijit._editor._Plugin"); dojo.require("dijit._Widget"); dojo.require("dijit.Editor"); dojo.require("dijit.form.Button"); dojo.declare("dijit._editor._Plugin", null, { // summary // Base class for a "plugin" to the editor, which is usually // a single button on the Toolbar and some associated code constructor: function(/*Object?*/args, /*DomNode?*/node){ if(args){ dojo.mixin(this, args); } this._connects=[]; }, // editor: [const] dijit.Editor // Points to the parent editor editor: null, // iconClassPrefix: [const] String // The CSS class name for the button node is formed from `iconClassPrefix` and `command` iconClassPrefix: "dijitEditorIcon", // button: dijit._Widget? // Pointer to `dijit.form.Button` or other widget (ex: `dijit.form.FilteringSelect`) that controls this plugin. // If not specified, will be created on initialization according to `buttonClass` button: null, // queryCommand: ??? // TODO: unused, remove queryCommand: null, // command: String // String like "insertUnorderedList", "outdent", "justifyCenter", etc. that represents an editor command. // Passed to editor.execCommand() if `useDefaultCommand` is true. command: "", // commandArg: anything // Argument to execCommand() after command. // TODO: unused, remove commandArg: null, // useDefaultCommand: Boolean // If true, this plugin executes by calling Editor.execCommand() with the argument specified in `command`. useDefaultCommand: true, // buttonClass: Widget Class // Class for button to control this plugin. This is used to instantiate the button, unless `button` itself // is specified directly. buttonClass: dijit.form.Button, getLabel: function(/*String*/key){ // summary: // Returns the label to use for the button // tags: // private return this.editor.commands[key]; // String }, _initButton: function(props){ // summary: // Initialize the button that will control this plugin. // This code only works for plugins controlling built-in commands in the editor. // tags: // protected extension if(this.command.length){ var label = this.getLabel(this.command); var className = this.iconClassPrefix+" "+this.iconClassPrefix + this.command.charAt(0).toUpperCase() + this.command.substr(1); if(!this.button){ props = dojo.mixin({ label: label, showLabel: false, iconClass: className, dropDown: this.dropDown, tabIndex: "-1" }, props || {}); this.button = new this.buttonClass(props); } } }, destroy: function(f){ // summary: // Destroy this plugin // TODO: remove f parameter, it's unused dojo.forEach(this._connects, dojo.disconnect); if(this.dropDown){ this.dropDown.destroyRecursive(); }";s:7:"returns";s:6:"String";s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:29:"dijit._editor._Plugin.connect";a:7:{s:9:"prototype";s:21:"dijit._editor._Plugin";s:4:"type";s:8:"Function";s:10:"parameters";a:3:{s:1:"o";a:1:{s:4:"type";s:0:"";}s:1:"f";a:1:{s:4:"type";s:0:"";}s:2:"tf";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:52:" this._connects.push(dojo.connect(o, f, this, tf));";s:7:"summary";s:123:"Make a dojo.connect() that is automatically disconnected when this plugin is destroyed. Similar to `dijit._Widget.connect`.";s:4:"tags";s:9:"protected";s:14:"private_parent";b:1;}s:33:"dijit._editor._Plugin.updateState";a:6:{s:9:"prototype";s:21:"dijit._editor._Plugin";s:4:"type";s:8:"Function";s:6:"source";s:637:" var e = this.editor, c = this.command, checked, enabled; if(!e || !e.isLoaded || !c.length){ return; } if(this.button){ try{ enabled = e.queryCommandEnabled(c); if(this.enabled !== enabled){ this.enabled = enabled; this.button.attr('disabled', !enabled); } if(typeof this.button.checked == 'boolean'){ checked = e.queryCommandState(c); if(this.checked !== checked){ this.checked = checked; this.button.attr('checked', e.queryCommandState(c)); } } }catch(e){ console.log(e); // FIXME: we shouldn't have debug statements in our code. Log as an error? } }";s:7:"summary";s:62:"Change state of the plugin to respond to events in the editor.";s:11:"description";s:455:"This is called on meaningful events in the editor, such as change of selection or caret position (but not simple typing of alphanumeric keys). It gives the plugin a chance to update the CSS of its button. For example, the "bold" plugin will highlight/unhighlight the bold button depending on whether the characters next to the caret are bold or not. Only makes sense when `useDefaultCommand` is true, as it calls Editor.queryCommandEnabled(`command`).";s:14:"private_parent";b:1;}s:31:"dijit._editor._Plugin.setEditor";a:7:{s:9:"prototype";s:21:"dijit._editor._Plugin";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:6:"editor";a:1:{s:4:"type";s:12:"dijit.Editor";}}s:6:"source";s:5187:"dojo.provide("dijit._editor._Plugin"); dojo.require("dijit._Widget"); dojo.require("dijit.Editor"); dojo.require("dijit.form.Button"); dojo.declare("dijit._editor._Plugin", null, { // summary // Base class for a "plugin" to the editor, which is usually // a single button on the Toolbar and some associated code constructor: function(/*Object?*/args, /*DomNode?*/node){ if(args){ dojo.mixin(this, args); } this._connects=[]; }, // editor: [const] dijit.Editor // Points to the parent editor editor: null, // iconClassPrefix: [const] String // The CSS class name for the button node is formed from `iconClassPrefix` and `command` iconClassPrefix: "dijitEditorIcon", // button: dijit._Widget? // Pointer to `dijit.form.Button` or other widget (ex: `dijit.form.FilteringSelect`) that controls this plugin. // If not specified, will be created on initialization according to `buttonClass` button: null, // queryCommand: ??? // TODO: unused, remove queryCommand: null, // command: String // String like "insertUnorderedList", "outdent", "justifyCenter", etc. that represents an editor command. // Passed to editor.execCommand() if `useDefaultCommand` is true. command: "", // commandArg: anything // Argument to execCommand() after command. // TODO: unused, remove commandArg: null, // useDefaultCommand: Boolean // If true, this plugin executes by calling Editor.execCommand() with the argument specified in `command`. useDefaultCommand: true, // buttonClass: Widget Class // Class for button to control this plugin. This is used to instantiate the button, unless `button` itself // is specified directly. buttonClass: dijit.form.Button, getLabel: function(/*String*/key){ // summary: // Returns the label to use for the button // tags: // private return this.editor.commands[key]; // String }, _initButton: function(props){ // summary: // Initialize the button that will control this plugin. // This code only works for plugins controlling built-in commands in the editor. // tags: // protected extension if(this.command.length){ var label = this.getLabel(this.command); var className = this.iconClassPrefix+" "+this.iconClassPrefix + this.command.charAt(0).toUpperCase() + this.command.substr(1); if(!this.button){ props = dojo.mixin({ label: label, showLabel: false, iconClass: className, dropDown: this.dropDown, tabIndex: "-1" }, props || {}); this.button = new this.buttonClass(props); } } }, destroy: function(f){ // summary: // Destroy this plugin // TODO: remove f parameter, it's unused dojo.forEach(this._connects, dojo.disconnect); if(this.dropDown){ this.dropDown.destroyRecursive(); } }, connect: function(o, f, tf){ // summary: // Make a dojo.connect() that is automatically disconnected when this plugin is destroyed. // Similar to `dijit._Widget.connect`. // tags: // protected this._connects.push(dojo.connect(o, f, this, tf)); }, updateState: function(){ // summary: // Change state of the plugin to respond to events in the editor. // description: // This is called on meaningful events in the editor, such as change of selection // or caret position (but not simple typing of alphanumeric keys). It gives the // plugin a chance to update the CSS of its button. // // For example, the "bold" plugin will highlight/unhighlight the bold button depending on whether the // characters next to the caret are bold or not. // // Only makes sense when `useDefaultCommand` is true, as it calls Editor.queryCommandEnabled(`command`). var e = this.editor, c = this.command, checked, enabled; if(!e || !e.isLoaded || !c.length){ return; } if(this.button){ try{ enabled = e.queryCommandEnabled(c); if(this.enabled !== enabled){ this.enabled = enabled; this.button.attr('disabled', !enabled); } if(typeof this.button.checked == 'boolean'){ checked = e.queryCommandState(c); if(this.checked !== checked){ this.checked = checked; this.button.attr('checked', e.queryCommandState(c)); } } }catch(e){ console.log(e); // FIXME: we shouldn't have debug statements in our code. Log as an error? } } }, setEditor: function(/*dijit.Editor*/ editor){ // summary: // Tell the plugin which Editor it is associated with. // TODO: refactor code to just pass editor to constructor. // FIXME: detatch from previous editor!! this.editor = editor; // FIXME: prevent creating this if we don't need to (i.e., editor can't handle our command) this._initButton(); // FIXME: wire up editor to button here! if(this.command.length && !this.editor.queryCommandAvailable(this.command)){ // console.debug("hiding:", this.command); if(this.button){ this.button.domNode.style.display = "none"; } } if(this.button && this.useDefaultCommand){ this.connect(this.button, "onClick", dojo.hitch(this.editor, "execCommand", this.command, this.commandArg) ); } this.connect(this.editor, "onNormalizedDisplayChanged", "updateState");";s:7:"returns";s:6:"String";s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:32:"dijit._editor._Plugin.setToolbar";a:7:{s:9:"prototype";s:21:"dijit._editor._Plugin";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:7:"toolbar";a:1:{s:4:"type";s:13:"dijit.Toolbar";}}s:6:"source";s:5541:"dojo.provide("dijit._editor._Plugin"); dojo.require("dijit._Widget"); dojo.require("dijit.Editor"); dojo.require("dijit.form.Button"); dojo.declare("dijit._editor._Plugin", null, { // summary // Base class for a "plugin" to the editor, which is usually // a single button on the Toolbar and some associated code constructor: function(/*Object?*/args, /*DomNode?*/node){ if(args){ dojo.mixin(this, args); } this._connects=[]; }, // editor: [const] dijit.Editor // Points to the parent editor editor: null, // iconClassPrefix: [const] String // The CSS class name for the button node is formed from `iconClassPrefix` and `command` iconClassPrefix: "dijitEditorIcon", // button: dijit._Widget? // Pointer to `dijit.form.Button` or other widget (ex: `dijit.form.FilteringSelect`) that controls this plugin. // If not specified, will be created on initialization according to `buttonClass` button: null, // queryCommand: ??? // TODO: unused, remove queryCommand: null, // command: String // String like "insertUnorderedList", "outdent", "justifyCenter", etc. that represents an editor command. // Passed to editor.execCommand() if `useDefaultCommand` is true. command: "", // commandArg: anything // Argument to execCommand() after command. // TODO: unused, remove commandArg: null, // useDefaultCommand: Boolean // If true, this plugin executes by calling Editor.execCommand() with the argument specified in `command`. useDefaultCommand: true, // buttonClass: Widget Class // Class for button to control this plugin. This is used to instantiate the button, unless `button` itself // is specified directly. buttonClass: dijit.form.Button, getLabel: function(/*String*/key){ // summary: // Returns the label to use for the button // tags: // private return this.editor.commands[key]; // String }, _initButton: function(props){ // summary: // Initialize the button that will control this plugin. // This code only works for plugins controlling built-in commands in the editor. // tags: // protected extension if(this.command.length){ var label = this.getLabel(this.command); var className = this.iconClassPrefix+" "+this.iconClassPrefix + this.command.charAt(0).toUpperCase() + this.command.substr(1); if(!this.button){ props = dojo.mixin({ label: label, showLabel: false, iconClass: className, dropDown: this.dropDown, tabIndex: "-1" }, props || {}); this.button = new this.buttonClass(props); } } }, destroy: function(f){ // summary: // Destroy this plugin // TODO: remove f parameter, it's unused dojo.forEach(this._connects, dojo.disconnect); if(this.dropDown){ this.dropDown.destroyRecursive(); } }, connect: function(o, f, tf){ // summary: // Make a dojo.connect() that is automatically disconnected when this plugin is destroyed. // Similar to `dijit._Widget.connect`. // tags: // protected this._connects.push(dojo.connect(o, f, this, tf)); }, updateState: function(){ // summary: // Change state of the plugin to respond to events in the editor. // description: // This is called on meaningful events in the editor, such as change of selection // or caret position (but not simple typing of alphanumeric keys). It gives the // plugin a chance to update the CSS of its button. // // For example, the "bold" plugin will highlight/unhighlight the bold button depending on whether the // characters next to the caret are bold or not. // // Only makes sense when `useDefaultCommand` is true, as it calls Editor.queryCommandEnabled(`command`). var e = this.editor, c = this.command, checked, enabled; if(!e || !e.isLoaded || !c.length){ return; } if(this.button){ try{ enabled = e.queryCommandEnabled(c); if(this.enabled !== enabled){ this.enabled = enabled; this.button.attr('disabled', !enabled); } if(typeof this.button.checked == 'boolean'){ checked = e.queryCommandState(c); if(this.checked !== checked){ this.checked = checked; this.button.attr('checked', e.queryCommandState(c)); } } }catch(e){ console.log(e); // FIXME: we shouldn't have debug statements in our code. Log as an error? } } }, setEditor: function(/*dijit.Editor*/ editor){ // summary: // Tell the plugin which Editor it is associated with. // TODO: refactor code to just pass editor to constructor. // FIXME: detatch from previous editor!! this.editor = editor; // FIXME: prevent creating this if we don't need to (i.e., editor can't handle our command) this._initButton(); // FIXME: wire up editor to button here! if(this.command.length && !this.editor.queryCommandAvailable(this.command)){ // console.debug("hiding:", this.command); if(this.button){ this.button.domNode.style.display = "none"; } } if(this.button && this.useDefaultCommand){ this.connect(this.button, "onClick", dojo.hitch(this.editor, "execCommand", this.command, this.commandArg) ); } this.connect(this.editor, "onNormalizedDisplayChanged", "updateState"); }, setToolbar: function(/*dijit.Toolbar*/ toolbar){ // summary: // Tell the plugin to add itself to the toolbar (if there is a button associated with the plugin). // TODO: refactor code to just pass toolbar to constructor. if(this.button){ toolbar.addChild(this.button); } // console.debug("adding", this.button, "to:", toolbar);";s:7:"returns";s:6:"String";s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:29:"dijit._editor._Plugin.enabled";a:3:{s:8:"instance";s:21:"dijit._editor._Plugin";s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:36:"dijit._editor._Plugin.button.checked";a:3:{s:8:"instance";s:21:"dijit._editor._Plugin";s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:29:"dijit._editor._Plugin.checked";a:3:{s:8:"instance";s:21:"dijit._editor._Plugin";s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:50:"dijit._editor._Plugin.button.domNode.style.display";a:3:{s:8:"instance";s:21:"dijit._editor._Plugin";s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:31:"dijit._editor._Plugin._connects";a:4:{s:8:"instance";s:21:"dijit._editor._Plugin";s:7:"private";b:1;s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:4:"this";a:2:{s:6:"mixins";a:1:{s:6:"normal";a:1:{i:0;s:4:"args";}}s:7:"summary";s:0:"";}s:13:"dijit._editor";a:3:{s:4:"type";s:6:"Object";s:7:"private";b:1;s:7:"summary";s:0:"";}s:5:"dijit";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}}