Permalink
Browse files

Code cleanup for doc parser, mostly using / notation to avoid inlinin…

…g problems.
  • Loading branch information...
1 parent 2c5d365 commit 9a31c85ee657d9a83507b46b06891cb79f562f9c @edchat committed Jun 8, 2012
Showing with 82 additions and 99 deletions.
  1. +16 −20 Generate.js
  2. +3 −7 Group.js
  3. +7 −7 ListController.js
  4. +6 −6 ModelRefController.js
  5. +6 −7 Output.js
  6. +9 −14 Repeat.js
  7. +3 −3 StatefulSeries.js
  8. +10 −10 StoreRefController.js
  9. +2 −2 parserExtension.js
  10. +20 −23 sync.js
View
@@ -6,11 +6,7 @@ define([
"./at",
"./Group",
"dijit/form/TextBox"
-], function(array, lang, declare, Container){
- /*=====
- Container = dojox.mvc._Container;
- declare = dojo.declare;
- =====*/
+], function(array, lang, declare, Container, at){
return declare("dojox.mvc.Generate", [Container], {
// summary:
@@ -29,7 +25,7 @@ define([
// defaultWidgetMapping: Object
// The mapping of types to a widget class. Set widgetMapping to override this.
//
- _defaultWidgetMapping: {"String" : "dijit.form.TextBox"},
+ _defaultWidgetMapping: {"String" : "dijit/form/TextBox"},
// defaultClassMapping: Object
// The mapping of class to use. Set classMapping to override this.
@@ -42,7 +38,7 @@ define([
//
_defaultIdNameMapping: {"String" : "textbox_t"},
- // children: dojo.Stateful
+ // children: dojo/Stateful
// The array of data model that is used to render child nodes.
children: null,
@@ -57,7 +53,7 @@ define([
////////////////////// PRIVATE METHODS ////////////////////////
- _setChildrenAttr: function(/*dojo.Stateful*/ value){
+ _setChildrenAttr: function(/*dojo/Stateful*/ value){
// summary:
// Handler for calls to set("children", val).
// description:
@@ -75,11 +71,11 @@ define([
}
},
- _buildContained: function(/*dojo.Stateful*/ children){
+ _buildContained: function(/*dojo/Stateful*/ children){
// summary:
// Destroy any existing generated view, recreate it from scratch
// parse the new contents.
- // children: dojo.Stateful
+ // children: dojo/Stateful
// The array of child widgets.
// tags:
// private
@@ -94,11 +90,11 @@ define([
this._createBody();
},
- _generateBody: function(/*dojo.Stateful*/ children, /*Boolean*/ hideHeading){
+ _generateBody: function(/*dojo/Stateful*/ children, /*Boolean*/ hideHeading){
// summary:
// Generate the markup for the view associated with this generate
// container.
- // children: dojo.Stateful
+ // children: dojo/Stateful
// The associated data to generate a view for.
// hideHeading: Boolean
// Whether the property name should be displayed as a heading.
@@ -136,10 +132,10 @@ define([
return body.join("");
},
- _generateRepeat: function(/*dojox.mvc.StatefulArray*/ children, /*String*/ repeatHeading){
+ _generateRepeat: function(/*dojox/mvc/StatefulArray*/ children, /*String*/ repeatHeading){
// summary:
// Generate a repeating model-bound view.
- // children: dojox.mvc.StatefulArray
+ // children: dojox/mvc/StatefulArray
// The bound node (a collection/array node) to generate a
// repeating UI/view for.
// repeatHeading: String
@@ -148,16 +144,16 @@ define([
// private
var headingClass = (this.classMapping && this.classMapping["Heading"]) ? this.classMapping["Heading"] : this._defaultClassMapping["Heading"];
- return '<div data-dojo-type="dojox.mvc.Group" data-dojo-props="target: dojox.mvc.at(\'rel:\', \'' + repeatHeading + '\')" + id="' + this.id + '_r' + this._counter++ + '">'
+ return '<div data-dojo-type="dojox/mvc/Group" data-dojo-props="target: at(\'rel:\', \'' + repeatHeading + '\')" + id="' + this.id + '_r' + this._counter++ + '">'
+ '<div class="' + headingClass + '\">' + repeatHeading + '</div>'
+ this._generateBody(children, true)
+ '</div>';
},
- _generateGroup: function(/*dojo.Stateful*/ model, /*String*/ groupHeading, /*Boolean*/ hideHeading){
+ _generateGroup: function(/*dojo/Stateful*/ model, /*String*/ groupHeading, /*Boolean*/ hideHeading){
// summary:
// Generate a hierarchical model-bound view.
- // model: dojo.Stateful
+ // model: dojo/Stateful
// The bound (intermediate) model to generate a hierarchical view portion for.
// groupHeading: String
// The heading to be used for this portion.
@@ -166,7 +162,7 @@ define([
// tags:
// private
- var html = ['<div data-dojo-type="dojox.mvc.Group" data-dojo-props="target: dojox.mvc.at(\'rel:\', \'' + groupHeading + '\')" + id="' + this.id + '_g' + this._counter++ + '">'];
+ var html = ['<div data-dojo-type="dojox/mvc/Group" data-dojo-props="target: at(\'rel:\', \'' + groupHeading + '\')" + id="' + this.id + '_g' + this._counter++ + '">'];
if(!hideHeading){
var headingClass = (this.classMapping && this.classMapping["Heading"]) ? this.classMapping["Heading"] : this._defaultClassMapping["Heading"];
html.push('<div class="' + headingClass + '\">' + groupHeading + '</div>');
@@ -181,7 +177,7 @@ define([
// prop: String
// The data model property name.
// referToValue: Boolean
- // True if the property is dojox.mvc.StatefulModel with "value" attribute.
+ // True if the property is dojox/mvc/StatefulModel with "value" attribute.
// tags:
// private
// TODO: Data type based widget generation / enhanced meta-data
@@ -192,7 +188,7 @@ define([
var labelClass = (this.classMapping && this.classMapping["Label"]) ? this.classMapping["Label"] : this._defaultClassMapping["Label"];
var stringClass = (this.classMapping && this.classMapping["String"]) ? this.classMapping["String"] : this._defaultClassMapping["String"];
var rowClass = (this.classMapping && this.classMapping["Row"]) ? this.classMapping["Row"] : this._defaultClassMapping["Row"];
- var bindingSyntax = 'value: dojox.mvc.at(\'rel:' + (referToValue && prop || '') + '\', \'' + (referToValue ? 'value' : prop) + '\')';
+ var bindingSyntax = 'value: at(\'rel:' + (referToValue && prop || '') + '\', \'' + (referToValue ? 'value' : prop) + '\')';
return '<div class="' + rowClass + '\">' +
'<label class="' + labelClass + '\">' + prop + ':</label>' +
View
@@ -1,19 +1,15 @@
define(["dojo/_base/declare", "dijit/_WidgetBase", "dojo/_base/lang"], function(declare, _WidgetBase, lang){
- /*=====
- WidgetBase = dijit._WidgetBase;
- declare = dojo.declare;
- =====*/
return declare("dojox.mvc.Group", _WidgetBase, {
// summary:
// A simple model-bound container widget with single-node binding to a data model.
//
// description:
- // A group is usually bound to an intermediate dojo.Stateful node in the data model.
+ // A group is usually bound to an intermediate dojo/Stateful node in the data model.
// Child dijits or custom view components inside a group inherit their parent
// data binding context from it.
- // target: dojo.Stateful
+ // target: dojo/Stateful
// The data model used for relative data binding.
target: null,
@@ -31,7 +27,7 @@ define(["dojo/_base/declare", "dijit/_WidgetBase", "dojo/_base/lang"], function
this.inherited(arguments);
},
- _setTargetAttr: function(/*dojo.Stateful*/ value){
+ _setTargetAttr: function(/*dojo/Stateful*/ value){
// summary:
// Handler for calls to set("target", val).
// description:
View
@@ -4,7 +4,7 @@ define([
"dojo/_base/declare",
"./ModelRefController"
], function(array, lang, declare, ModelRefController){
- function unwatchHandles(/*dojox.mvc.ListController*/ c){
+ function unwatchHandles(/*dojox/mvc/ListController*/ c){
// summary:
// Unwatch model watch handles.
@@ -16,7 +16,7 @@ define([
}
}
- function setRefInModel(/*dojox.mvc.ListController*/ ctrl, /*dojo.Stateful*/ old, /*dojo.Stateful*/ current){
+ function setRefInModel(/*dojox/mvc/ListController*/ ctrl, /*dojo/Stateful*/ old, /*dojo/Stateful*/ current){
// summary:
// A function called when this controller gets newer value as the list data.
@@ -52,7 +52,7 @@ define([
ctrl._setCursorIndexAttr(ctrl.cursorIndex);
}
- function setRefCursor(/*dojox.mvc.ListController*/ ctrl, /*dojo.Stateful*/ old, /*dojo.Stateful*/ current){
+ function setRefCursor(/*dojox/mvc/ListController*/ ctrl, /*dojo/Stateful*/ old, /*dojo/Stateful*/ current){
// summary:
// A function called when this controller gets newer value as the data of current selection.
// description:
@@ -109,8 +109,8 @@ define([
// | </head>
// | <body>
// | <script type="dojo/require">at: "dojox/mvc/at"</script>
- // | <span id="ctrl" data-dojo-type="dojox.mvc.ListController" data-dojo-props="model: model"></span>
- // | <input type="text" data-dojo-type="dijit.form.TextBox" data-dojo-props="value: at('widget:ctrl', 'value')">
+ // | <span id="ctrl" data-dojo-type="dojox/mvc/ListController" data-dojo-props="model: model"></span>
+ // | <input type="text" data-dojo-type="dijit/form/TextBox" data-dojo-props="value: at('widget:ctrl', 'value')">
// | </body>
// | </html>
@@ -126,11 +126,11 @@ define([
// The index of the selected element in the model.
cursorIndex: -1,
- // cursor: dojo.Stateful
+ // cursor: dojo/Stateful
// The selected element in the model array.
cursor: null,
- // model: dojox.mvc.StatefulArray
+ // model: dojox/mvc/StatefulArray
// The data model working as an array.
model: null,
View
@@ -7,13 +7,13 @@ define([
], function(array, declare, lang, Stateful, _Controller){
return declare("dojox.mvc.ModelRefController", _Controller, {
// summary:
- // A controller that keeps a reference to dojo.Stateful-based data model.
+ // A controller that keeps a reference to dojo/Stateful-based data model.
// description:
// Does the following on behalf of such model:
//
- // * Provides data from model via dojo.Stateful get() interface
- // * Stores data to model via dojo.Stateful set() interface
- // * Watches for change in model via dojo.Stateful watch() interface (The callback is called when there is a change in data model, as well as when the data model itself is replaced with different one)
+ // * Provides data from model via dojo/Stateful get() interface
+ // * Stores data to model via dojo/Stateful set() interface
+ // * Watches for change in model via dojo/Stateful watch() interface (The callback is called when there is a change in data model, as well as when the data model itself is replaced with different one)
//
// Can also be used to do some application-specific stuffs upon change in properties in model, by defining setter functions.
// Doing so will help keep models and widgets free from application-specific logic, and will help keep application logic free from specifics of models and widgets.
@@ -41,8 +41,8 @@ define([
// | </head>
// | <body>
// | <script type="dojo/require">at: "dojox/mvc/at"</script>
- // | <span id="ctrl" data-dojo-type="dojox.mvc.ModelRefController" data-dojo-props="model: modelFoo"></span>
- // | <input type="text" data-dojo-type="dijit.form.TextBox" data-dojo-props="value: at('widget:ctrl', 'value')">
+ // | <span id="ctrl" data-dojo-type="dojox/mvc/ModelRefController" data-dojo-props="model: modelFoo"></span>
+ // | <input type="text" data-dojo-type="dijit/form/TextBox" data-dojo-props="value: at('widget:ctrl', 'value')">
// | </body>
// | </html>
View
@@ -5,11 +5,6 @@ define([
"dijit/_WidgetBase",
"dojo/regexp"
], function(declare, lang, dom, _WidgetBase, regexp){
- /*=====
- declare = dojo.declare;
- dom = dojo.dom;
- _WidgetBase = dijit._WidgetBase;
- =====*/
return declare("dojox.mvc.Output", _WidgetBase, {
// summary:
@@ -19,12 +14,12 @@ define([
// description:
// Simple output example:
//
- // | <span dojoType="dojox.mvc.Output" ref="model.balance">
+ // | <span dojoType="dojox/mvc/Output" ref="model.balance">
// | Your balance is: ${this.value}
// | </span>
//
// The output widget being data-bound, if the balance changes in the
- // dojox.mvc.StatefulModel, the content within the <span> will be
+ // dojox/mvc/StatefulModel, the content within the <span> will be
// updated accordingly.
// exprchar: Character
@@ -49,6 +44,10 @@ define([
set: function(name, value){
// summary:
// Override and refresh output on value change.
+ // name:
+ // The property to set.
+ // value:
+ // The value to set in the property.
this.inherited(arguments);
if(name === "value"){
this._output();
View
@@ -11,11 +11,6 @@ define([
"dijit/registry",
"./_Container"
], function(declare, lang, has, win, dom, domconstruct, array, query, when, registry, _Container){
- /*=====
- declare = dojo.declare;
- dom = dojo.dom;
- _Container = dojox.mvc._Container;
- =====*/
return declare("dojox.mvc.Repeat", _Container, {
// summary:
@@ -24,7 +19,7 @@ define([
// iteration within the collection.
//
// description:
- // A repeat is bound to an intermediate dojo.Stateful node corresponding
+ // A repeat is bound to an intermediate dojo/Stateful node corresponding
// to an array in the data model. Child dijits or custom view components
// inside it inherit their parent data binding context from it.
@@ -38,8 +33,8 @@ define([
// model. Then, the following CRUD-style UI displays all the names in
// the search results in text boxes where they may be updated or such.
//
- // | <div dojoType="dojox.mvc.Repeat" ref="Results">
- // | <div class="row" dojoType="dojox.mvc.Group" ref="${this.index}">
+ // | <div dojoType="dojox/mvc/Repeat" ref="Results">
+ // | <div class="row" dojoType="dojox/mvc/Group" ref="${this.index}">
// | <label for="nameInput${this.index}">Name:</label>
// | <input dojoType="dijit.form.TextBox" id="nameInput${this.index}" ref="'Name'"></input>
// | </div>
@@ -57,7 +52,7 @@ define([
// a Repeat inside of a dojox.mobile list.
removeRepeatNode : false,
- // children: dojox.mvc.StatefulArray
+ // children: dojox/mvc/StatefulArray
// The array of data model that is used to render child nodes.
children: null,
@@ -109,7 +104,7 @@ define([
////////////////////// PRIVATE METHODS ////////////////////////
- _setChildrenAttr: function(/*dojo.Stateful*/ value){
+ _setChildrenAttr: function(/*dojo/Stateful*/ value){
// summary:
// Handler for calls to set("children", val).
// description:
@@ -127,11 +122,11 @@ define([
}
},
- _buildContained: function(/*dojox.mvc.StatefulArray*/ children){
+ _buildContained: function(/*dojox/mvc/StatefulArray*/ children){
// summary:
// Destroy any existing contained view, recreate the repeating UI
// markup and parse the new contents.
- // children: dojox.mvc.StatefulArray
+ // children: dojox/mvc/StatefulArray
// The array of child widgets.
// tags:
// private
@@ -202,10 +197,10 @@ define([
});
},
- _updateAddRemoveWatch: function(/*dojo.Stateful*/ children){
+ _updateAddRemoveWatch: function(/*dojo/Stateful*/ children){
// summary:
// Updates the watch handle when binding changes.
- // children: dojo.Stateful
+ // children: dojo/Stateful
// The array of child widgets.
// tags:
// private
View
@@ -6,7 +6,7 @@ define([
], function(darray, declare, lang, at){
return declare("dojox.mvc.StatefulSeries", null, {
// summary:
- // Chart data plugin ("series") that watches for properties specified in dojox.mvc.at handles in the given data.
+ // Chart data plugin ("series") that watches for properties specified in dojox/mvc/at handles in the given data.
// At initialization, and when the properties are updated, creates the data from data given and updates the chart.
constructor: function(/*Anything[]*/ items){
@@ -22,10 +22,10 @@ define([
if((item || {}).atsignature == "dojox.mvc.at"){
var target = item.target, targetProp = item.targetProp;
if(lang.isString(target)){
- throw new Error("Literal-based dojox/mvc/at is not supported in dojox.mvc.StatefulSeries.");
+ throw new Error("Literal-based dojox/mvc/at is not supported in dojox/mvc/StatefulSeries.");
}
if(item.bindDirection && !(item.bindDirection & at.from)){
- console.warn("Data binding bindDirection option is ignored in dojox.mvc.StatefulSeries.");
+ console.warn("Data binding bindDirection option is ignored in dojox/mvc/StatefulSeries.");
}
if(targetProp && lang.isFunction(target.set) && lang.isFunction(target.watch)){
var converter = item.converter, formatFunc = (converter || {}).format && lang.hitch({target: target, source: this}, converter.format);
Oops, something went wrong.

0 comments on commit 9a31c85

Please sign in to comment.