Skip to content

Commit

Permalink
Fix module return values for dojox/editor plugins, refs #13101 !stric…
Browse files Browse the repository at this point in the history
…t. The modules need a lot more AMD work in general though.

git-svn-id: http://svn.dojotoolkit.org/src/dojox/trunk@31210 560b804f-0ae3-0310-86f3-f6aa0a117693
  • Loading branch information
wkeese committed Apr 11, 2013
1 parent 4885d84 commit de6e10e
Show file tree
Hide file tree
Showing 26 changed files with 491 additions and 486 deletions.
13 changes: 8 additions & 5 deletions editor/plugins/AutoSave.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ define([

dojo.experimental("dojox.editor.plugins.AutoSave");

dojo.declare("dojox.editor.plugins._AutoSaveSettingDialog", [_Widget, _TemplatedMixin, _WidgetsInTemplateMixin], {
var AutoSaveSettingDialog = dojo.declare("dojox.editor.plugins._AutoSaveSettingDialog", [_Widget, _TemplatedMixin, _WidgetsInTemplateMixin], {

// dialogTitle [public] String
// The tile of the Auto-Save setting dialog
Expand Down Expand Up @@ -177,7 +177,7 @@ dojo.declare("dojox.editor.plugins._AutoSaveSettingDialog", [_Widget, _Templated
}
});

dojo.declare("dojox.editor.plugins.AutoSave", Save, {
var AutoSave = dojo.declare("dojox.editor.plugins.AutoSave", Save, {
// summary:
// This plugin provides the auto save capability to the editor. The
// plugin saves the content of the editor in interval. When
Expand Down Expand Up @@ -235,7 +235,7 @@ dojo.declare("dojox.editor.plugins.AutoSave", Save, {
this._strings = dojo.i18n.getLocalization("dojox.editor.plugins", "AutoSave");
this._initButton();

this._saveSettingDialog = new dojox.editor.plugins._AutoSaveSettingDialog({
this._saveSettingDialog = new AutoSaveSettingDialog({
"dialogTitle": this._strings["saveSettingdialogTitle"],
"dialogDescription": this._strings["saveSettingdialogDescription"],
"paramName": this._strings["saveSettingdialogParamName"],
Expand Down Expand Up @@ -419,19 +419,22 @@ dojo.declare("dojox.editor.plugins.AutoSave", Save, {
}
});

// For monkey patching
AutoSave._AutoSaveSettingDialog = AutoSaveSettingDialog;

// Register this plugin.
dojo.subscribe(dijit._scopeName + ".Editor.getPlugin",null,function(o){
if(o.plugin){ return; }
var name = o.args.name.toLowerCase();
if(name == "autosave"){
o.plugin = new dojox.editor.plugins.AutoSave({
o.plugin = new AutoSave({
url: ("url" in o.args) ? o.args.url : "",
logResults: ("logResults" in o.args) ? o.args.logResults : true,
interval: ("interval" in o.args) ? o.args.interval : 5
});
}
});

return dojox.editor.plugins.AutoSave;
return AutoSave;

});
6 changes: 3 additions & 3 deletions editor/plugins/AutoUrlLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ define([
"dojo/string"
], function(dojo, dijit, dojox, _Plugin) {

dojo.declare("dojox.editor.plugins.AutoUrlLink", [_Plugin], {
var AutoUrlLink = dojo.declare("dojox.editor.plugins.AutoUrlLink", [_Plugin], {
// summary:
// This plugin can recognize a URL like string
// (such as http://www.website.com) and turn it into
Expand Down Expand Up @@ -223,10 +223,10 @@ dojo.subscribe(dijit._scopeName + ".Editor.getPlugin",null,function(o){
if(o.plugin){ return; }
var name = o.args.name.toLowerCase();
if(name === "autourllink"){
o.plugin = new dojox.editor.plugins.AutoUrlLink();
o.plugin = new AutoUrlLink();
}
});

return dojox.editor.plugins.AutoUrlLink;
return AutoUrlLink;

});
6 changes: 3 additions & 3 deletions editor/plugins/Blockquote.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ define([
"dojo/i18n!dojox/editor/plugins/nls/Blockquote"
], function(dojo, dijit, dojox, _Plugin) {

dojo.declare("dojox.editor.plugins.Blockquote", _Plugin, {
var Blockquote = dojo.declare("dojox.editor.plugins.Blockquote", _Plugin, {
// summary:
// This plugin provides Blockquote capability to the editor.
// window/tab
Expand Down Expand Up @@ -504,10 +504,10 @@ dojo.subscribe(dijit._scopeName + ".Editor.getPlugin",null,function(o){
if(o.plugin){ return; }
var name = o.args.name.toLowerCase();
if(name === "blockquote"){
o.plugin = new dojox.editor.plugins.Blockquote({});
o.plugin = new Blockquote({});
}
});

return dojox.editor.plugins.Blockquote;
return Blockquote;

});
13 changes: 8 additions & 5 deletions editor/plugins/Breadcrumb.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ define([

dojo.experimental("dojox.editor.plugins.Breadcrumb");

dojo.declare("dojox.editor.plugins._BreadcrumbMenuTitle",[_Widget, _TemplatedMixin, _Contained],{
var BreadcrumbMenuTitle = dojo.declare("dojox.editor.plugins._BreadcrumbMenuTitle",[_Widget, _TemplatedMixin, _Contained],{
// summary:
// Simple internal, non-clickable, menu entry to act as a menu title bar.
templateString: "<tr><td dojoAttachPoint=\"title\" colspan=\"4\" class=\"dijitToolbar\" style=\"font-weight: bold; padding: 3px;\"></td></tr>",
Expand All @@ -44,7 +44,7 @@ dojo.declare("dojox.editor.plugins._BreadcrumbMenuTitle",[_Widget, _TemplatedMix
});


dojo.declare("dojox.editor.plugins.Breadcrumb", _Plugin,{
var Breadcrumb = dojo.declare("dojox.editor.plugins.Breadcrumb", _Plugin,{
// summary:
// This plugin provides Breadcrumb capability to the editor. As you move
// around the editor, it updates with your current indention depth.
Expand Down Expand Up @@ -86,7 +86,7 @@ dojo.declare("dojox.editor.plugins.Breadcrumb", _Plugin,{
});

// Build the menu
this._menuTitle = new dojox.editor.plugins._BreadcrumbMenuTitle({menuTitle: strings.nodeActions});
this._menuTitle = new BreadcrumbMenuTitle({menuTitle: strings.nodeActions});
this._selCMenu = new dijit.MenuItem({label: strings.selectContents, onClick: dojo.hitch(this, this._selectContents)});
this._delCMenu = new dijit.MenuItem({label: strings.deleteContents, onClick: dojo.hitch(this, this._deleteContents)});
this._selEMenu = new dijit.MenuItem({label: strings.selectElement, onClick: dojo.hitch(this, this._selectElement)});
Expand Down Expand Up @@ -338,15 +338,18 @@ dojo.declare("dojox.editor.plugins.Breadcrumb", _Plugin,{
}
});

// For monkey patching
Breadcrumb._BreadcrumbMenuTitle = BreadcrumbMenuTitle;

// Register this plugin.
dojo.subscribe(dijit._scopeName + ".Editor.getPlugin",null,function(o){
if(o.plugin){ return; }
var name = o.args.name.toLowerCase();
if(name === "breadcrumb"){
o.plugin = new dojox.editor.plugins.Breadcrumb({});
o.plugin = new Breadcrumb({});
}
});

return dojox.editor.plugins.Breadcrumb;
return Breadcrumb;

});
16 changes: 9 additions & 7 deletions editor/plugins/CollapsibleToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ define([
"dojo/i18n!dojox/editor/plugins/nls/CollapsibleToolbar"
], function(dojo, dijit, dojox, _Widget, _TemplatedMixin, _Plugin) {

dojo.declare("dojox.editor.plugins._CollapsibleToolbarButton", [_Widget, _TemplatedMixin], {
var CollapsibleToolbarButton = dojo.declare("dojox.editor.plugins._CollapsibleToolbarButton", [_Widget, _TemplatedMixin], {
// summary:
// Simple internal widget for representing a clickable button for expand/collapse
// with A11Y support.
Expand Down Expand Up @@ -45,8 +45,7 @@ dojo.declare("dojox.editor.plugins._CollapsibleToolbarButton", [_Widget, _Templa
}
});


dojo.declare("dojox.editor.plugins.CollapsibleToolbar", _Plugin, {
var CollapsibleToolbar = dojo.declare("dojox.editor.plugins.CollapsibleToolbar", _Plugin, {
// summary:
// This plugin provides a weappable toolbar container to allow expand/collapse
// of the editor toolbars. This plugin should be registered first in most cases to
Expand Down Expand Up @@ -84,14 +83,14 @@ dojo.declare("dojox.editor.plugins.CollapsibleToolbar", _Plugin, {
var menuTd = dojo.create("td", {style: { width: "100%" }, tabindex: -1}, row);
var m = dojo.create("span", {style: { width: "100%" }, tabindex: -1}, menuTd);

var collapseButton = new dojox.editor.plugins._CollapsibleToolbarButton({
var collapseButton = new CollapsibleToolbarButton({
buttonClass: "dojoxCollapsibleToolbarCollapse",
title: strings.collapse,
text: "-",
textClass: "dojoxCollapsibleToolbarCollapseText"
});
dojo.place(collapseButton.domNode, openTd);
var expandButton = new dojox.editor.plugins._CollapsibleToolbarButton({
var expandButton = new CollapsibleToolbarButton({
buttonClass: "dojoxCollapsibleToolbarExpand",
title: strings.expand,
text: "+",
Expand Down Expand Up @@ -171,15 +170,18 @@ dojo.declare("dojox.editor.plugins.CollapsibleToolbar", _Plugin, {
}
});

// For monkey patching
CollapsibleToolbar._CollapsibleToolbarButton = CollapsibleToolbarButton;

// Register this plugin.
dojo.subscribe(dijit._scopeName + ".Editor.getPlugin",null,function(o){
if(o.plugin){ return; }
var name = o.args.name.toLowerCase();
if(name === "collapsibletoolbar"){
o.plugin = new dojox.editor.plugins.CollapsibleToolbar({});
o.plugin = new CollapsibleToolbar({});
}
});

return dojox.editor.plugins.CollapsibleToolbar;
return CollapsibleToolbar;

});
15 changes: 3 additions & 12 deletions editor/plugins/EntityPalette.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,12 @@ define([

dojo.experimental("dojox.editor.plugins.EntityPalette");

dojo.declare("dojox.editor.plugins.EntityPalette",
[_Widget, _TemplatedMixin, _PaletteMixin],
{
var EntityPalette = dojo.declare("dojox.editor.plugins.EntityPalette", [_Widget, _TemplatedMixin, _PaletteMixin], {
// summary:
// A keyboard accessible HTML entity-picking widget (for inserting symbol characters)
// description:
// Grid showing various entities, so the user can pick a certain entity.
// Can be used standalone, or as a popup.
//
// example:
// | <div dojoType="dojox.editor.plugins.EntityPalette"></div>
//
// example:
// | var picker = new dojox.editor.plugins.EntityPalette({ },srcNode);
// | picker.startup();

// templateString: [protected] String
// The basic template used to render the palette.
Expand Down Expand Up @@ -197,7 +188,7 @@ dojo.declare("dojox.editor.plugins.EntityPalette",
}
});

dojo.declare("dojox.editor.plugins.LatinEntity",
EntityPalette.LatinEntity = dojo.declare("dojox.editor.plugins.LatinEntity",
null,
{
// summary:
Expand Down Expand Up @@ -227,6 +218,6 @@ dojo.declare("dojox.editor.plugins.LatinEntity",
}
});

return dojox.editor.plugins.EntityPalette;
return EntityPalette;

});
34 changes: 20 additions & 14 deletions editor/plugins/FindReplace.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ define([
"dijit/form/Button",
"dijit/form/DropDownButton",
"dijit/form/ToggleButton",
"dojox/editor/plugins/ToolbarLineBreak",
"./ToolbarLineBreak",
"dojo/_base/connect",
"dojo/_base/declare",
"dojo/i18n",
Expand All @@ -29,7 +29,8 @@ define([

dojo.experimental("dojox.editor.plugins.FindReplace");

dojo.declare("dojox.editor.plugins._FindReplaceCloseBox", [_Widget, _TemplatedMixin, _WidgetsInTemplateMixin], {
var FindReplaceCloseBox = dojo.declare("dojox.editor.plugins._FindReplaceCloseBox",
[_Widget, _TemplatedMixin, _WidgetsInTemplateMixin], {
// summary:
// Base class for widgets that contains a button labeled X
// to close the tool bar.
Expand Down Expand Up @@ -58,7 +59,7 @@ dojo.declare("dojox.editor.plugins._FindReplaceCloseBox", [_Widget, _TemplatedMi
});


dojo.declare("dojox.editor.plugins._FindReplaceTextBox",
var FindReplaceTextBox = dojo.declare("dojox.editor.plugins._FindReplaceTextBox",
[_Widget, _TemplatedMixin, _WidgetsInTemplateMixin],{
// summary:
// Base class for widgets that contains a label (like "Font:")
Expand Down Expand Up @@ -164,7 +165,7 @@ dojo.declare("dojox.editor.plugins._FindReplaceTextBox",
});


dojo.declare("dojox.editor.plugins._FindReplaceCheckBox",
var FindReplaceCheckBox = dojo.declare("dojox.editor.plugins._FindReplaceCheckBox",
[_Widget, _TemplatedMixin, _WidgetsInTemplateMixin],{
// summary:
// Base class for widgets that contains a label (like "Match case: ")
Expand Down Expand Up @@ -245,7 +246,7 @@ dojo.declare("dojox.editor.plugins._FindReplaceCheckBox",
});


dojo.declare("dojox.editor.plugins._FindReplaceToolbar", Toolbar, {
var FindReplaceToolbar = dojo.declare("dojox.editor.plugins._FindReplaceToolbar", Toolbar, {
// summary:
// A toolbar that derived from dijit.Toolbar, which
// eliminates some unnecessary event response such as LEFT_ARROW pressing
Expand Down Expand Up @@ -276,7 +277,7 @@ dojo.declare("dojox.editor.plugins._FindReplaceToolbar", Toolbar, {
}
});

dojo.declare("dojox.editor.plugins.FindReplace",[_Plugin],{
var FindReplace = dojo.declare("dojox.editor.plugins.FindReplace",[_Plugin],{
// summary:
// This plugin provides a Find/Replace capability for the editor.
// Note that this plugin is NOT supported on Opera currently, as opera
Expand Down Expand Up @@ -450,23 +451,23 @@ dojo.declare("dojox.editor.plugins.FindReplace",[_Plugin],{
// public
this.inherited(arguments);
if(!dojo.isOpera){
var _tb = (this._frToolbar = new dojox.editor.plugins._FindReplaceToolbar());
var _tb = (this._frToolbar = new FindReplaceToolbar());
dojo.style(_tb.domNode, "display", "none");
dojo.place(_tb.domNode, toolbar.domNode, "after");
_tb.startup();

// IE6 will put the close box in a new line when its style is "float: right".
// So place the close box ahead of the other fields, which makes it align with
// the other components.
this._closeBox = new dojox.editor.plugins._FindReplaceCloseBox();
this._closeBox = new FindReplaceCloseBox();
_tb.addChild(this._closeBox);

// Define the search/replace fields.
this._findField = new dojox.editor.plugins._FindReplaceTextBox(
this._findField = new FindReplaceTextBox(
{label: this._strings["findLabel"], tooltip: this._strings["findTooltip"]});
_tb.addChild(this._findField);

this._replaceField = new dojox.editor.plugins._FindReplaceTextBox(
this._replaceField = new FindReplaceTextBox(
{label: this._strings["replaceLabel"], tooltip: this._strings["replaceTooltip"]});
_tb.addChild(this._replaceField);

Expand All @@ -489,11 +490,11 @@ dojo.declare("dojox.editor.plugins.FindReplace",[_Plugin],{
_tb.addChild(this._replaceAllButton);

// Define the option checkboxes.
this._caseSensitive = new dojox.editor.plugins._FindReplaceCheckBox(
this._caseSensitive = new FindReplaceCheckBox(
{label: this._strings["matchCase"], tooltip: this._strings["matchCaseTooltip"]});
_tb.addChild(this._caseSensitive);

this._backwards = new dojox.editor.plugins._FindReplaceCheckBox(
this._backwards = new FindReplaceCheckBox(
{label: this._strings["backwards"], tooltip: this._strings["backwardsTooltip"]});
_tb.addChild(this._backwards);

Expand Down Expand Up @@ -841,16 +842,21 @@ dojo.declare("dojox.editor.plugins.FindReplace",[_Plugin],{
}
});

// For monkey patching
FindReplace._FindReplaceCloseBox = FindReplaceCloseBox;
FindReplace._FindReplaceTextBox = FindReplaceTextBox;
FindReplace._FindReplaceCheckBox = FindReplaceCheckBox;
FindReplace._FindReplaceToolbar = FindReplaceToolbar;

// Register this plugin.
dojo.subscribe(dijit._scopeName + ".Editor.getPlugin",null,function(o){
if(o.plugin){ return; }
var name = o.args.name.toLowerCase();
if(name === "findreplace"){
o.plugin = new dojox.editor.plugins.FindReplace({});
o.plugin = new FindReplace({});
}
});

return dojox.editor.plugins.FindReplace;
return FindReplace;

});
6 changes: 3 additions & 3 deletions editor/plugins/InsertAnchor.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ define([
"dojo/i18n!dijit/nls/common"
], function(dojo, dijit, dojox, _Plugin ) {

dojo.declare("dojox.editor.plugins.InsertAnchor", _Plugin, {
var InsertAnchor = dojo.declare("dojox.editor.plugins.InsertAnchor", _Plugin, {
// summary:
// This plugin provides the basis for an insert anchor dialog for the
// dijit.Editor
Expand Down Expand Up @@ -422,10 +422,10 @@ dojo.subscribe(dijit._scopeName + ".Editor.getPlugin",null,function(o){
var name = o.args.name;
if(name) { name = name.toLowerCase(); }
if(name === "insertanchor"){
o.plugin = new dojox.editor.plugins.InsertAnchor();
o.plugin = new InsertAnchor();
}
});

return dojox.editor.plugins.InsertAnchor;
return InsertAnchor;

});
Loading

0 comments on commit de6e10e

Please sign in to comment.