Permalink
Browse files

Fix dijit/_base API doc, in particular only show the symbols exported…

… by each module, even if the module (for back-compat reasons) is returning dijit itself. Refs #13101 !strict.
  • Loading branch information...
1 parent f0db9e2 commit 56ead8145b75e3da0d2a98315684b07cec05eb23 @wkeese wkeese committed Jul 11, 2012
Showing with 99 additions and 106 deletions.
  1. +7 −2 _Calendar.js
  2. +10 −6 _base/focus.js
  3. +12 −54 _base/manager.js
  4. +21 −27 _base/place.js
  5. +7 −2 _base/popup.js
  6. +7 −2 _base/scroll.js
  7. +8 −2 _base/sniff.js
  8. +8 −1 _base/typematic.js
  9. +12 −8 _base/wai.js
  10. +7 −2 _base/window.js
View
9 _Calendar.js
@@ -6,8 +6,13 @@ define([
// module:
// dijit/_Calendar
- // summary:
- // Deprecated widget, used dijit/Calendar instead. Will be removed in 2.0.
+
+ /*=====
+ return {
+ // summary:
+ // Deprecated widget, used dijit/Calendar instead. Will be removed in 2.0.
+ };
+ =====*/
kernel.deprecated("dijit._Calendar is deprecated", "dijit._Calendar moved to dijit.Calendar", 2.0);
View
16 _base/focus.js
@@ -10,11 +10,12 @@ define([
// module:
// dijit/_base/focus
- // summary:
- // Deprecated module to monitor currently focused node and stack of currently focused widgets.
- // New code should access dijit/focus directly.
- lang.mixin(dijit, {
+ var exports = {
+ // summary:
+ // Deprecated module to monitor currently focused node and stack of currently focused widgets.
+ // New code should access dijit/focus directly.
+
// _curFocus: DomNode
// Currently focused item on screen
_curFocus: null,
@@ -245,7 +246,7 @@ define([
handle && handle.remove();
}
- });
+ };
// Override focus singleton's focus function so that dijit.focus()
// has backwards compatible behavior of restoring selection (although
@@ -315,5 +316,8 @@ define([
topic.publish("widgetFocus", widget, by); // publish
});
- return dijit;
+ lang.mixin(dijit, exports);
+
+ /*===== return exports; =====*/
+ return dijit; // for back compat :-(
});
View
66 _base/manager.js
@@ -1,77 +1,35 @@
define([
"dojo/_base/array",
"dojo/_base/config", // defaultDuration
- /*===== "dojo/_base/lang", =====*/
+ "dojo/_base/lang",
"../registry",
"../main" // for setting exports to dijit namespace
-], function(array, config, /*===== lang, =====*/ registry, dijit){
+], function(array, config, lang, registry, dijit){
// module:
// dijit/_base/manager
- // summary:
- // Shim to methods on registry, plus a few other declarations.
- // New code should access dijit/registry directly when possible.
- /*=====
- dijit.byId = function(id){
+ var exports = {
// summary:
- // Returns a widget by it's id, or if passed a widget, no-op (like dom.byId())
- // id: String|dijit._Widget
- return registry.byId(id); // dijit/_WidgetBase
+ // Deprecated. Shim to methods on registry, plus a few other declarations.
+ // New code should access dijit/registry directly when possible.
};
- dijit.getUniqueId = function(widgetType){
- // summary:
- // Generates a unique id for a given widgetType
- // widgetType: String
- return registry.getUniqueId(widgetType); // String
- };
-
- dijit.findWidgets = function(root){
- // summary:
- // Search subtree under root returning widgets found.
- // Doesn't search for nested widgets (ie, widgets inside other widgets).
- // root: DOMNode
- return registry.findWidgets(root);
- };
-
- dijit._destroyAll = function(){
- // summary:
- // Code to destroy all widgets and do other cleanup on page unload
-
- return registry._destroyAll();
- };
-
- dijit.byNode = function(node){
- // summary:
- // Returns the widget corresponding to the given DOMNode
- // node: DOMNode
- return registry.byNode(node); // dijit/_WidgetBase
- };
-
- dijit.getEnclosingWidget = function(node){
- // summary:
- // Returns the widget whose DOM tree contains the specified DOMNode, or null if
- // the node is not contained within the DOM tree of any widget
- // node: DOMNode
- return registry.getEnclosingWidget(node);
- };
- =====*/
array.forEach(["byId", "getUniqueId", "findWidgets", "_destroyAll", "byNode", "getEnclosingWidget"], function(name){
- dijit[name] = registry[name];
+ exports[name] = registry[name];
});
- dijit.defaultDuration = config["defaultDuration"] || 200;
- /*=====
- lang.mixin(dijit, {
+ lang.mixin(exports, {
// defaultDuration: Integer
// The default fx.animation speed (in ms) to use for all Dijit
// transitional fx.animations, unless otherwise specified
// on a per-instance basis. Defaults to 200, overrided by
// `djConfig.defaultDuration`
- defaultDuration: 200
+ defaultDuration: config["defaultDuration"] || 200
});
- =====*/
- return dijit;
+ lang.mixin(dijit, exports);
+
+ /*===== return exports; =====*/
+ return dijit; // for back compat :-(
});
View
48 _base/place.js
@@ -1,43 +1,36 @@
define([
"dojo/_base/array", // array.forEach
- "dojo/_base/lang", // lang.isArray
+ "dojo/_base/lang", // lang.isArray, lang.mixin
"dojo/window", // windowUtils.getBox
"../place",
"../main" // export to dijit namespace
], function(array, lang, windowUtils, place, dijit){
// module:
// dijit/_base/place
- // summary:
- // Back compatibility module, new code should use dijit/place directly instead of using this module.
- dijit.getViewport = function(){
+
+ var exports = {
+ // summary:
+ // Deprecated back compatibility module, new code should use dijit/place directly instead of using this module.
+ };
+
+ exports.getViewport = function(){
// summary:
// Deprecated method to return the dimensions and scroll position of the viewable area of a browser window.
// New code should use windowUtils.getBox()
return windowUtils.getBox();
};
- /*=====
- dijit.placeOnScreen = function(node, pos, corners, padding){
- // summary:
- // Positions one of the node's corners at specified position
- // such that node is fully visible in viewport.
- // Deprecated, new code should use dijit.place.at() instead.
- };
- =====*/
- dijit.placeOnScreen = place.at;
+ exports.placeOnScreen = place.at;
- /*=====
- dijit.placeOnScreenAroundElement = function(node, aroundElement, aroundCorners, layoutNode){
+ exports.placeOnScreenAroundElement = function(node, aroundNode, aroundCorners, layoutNode){
// summary:
// Like dijit.placeOnScreenAroundNode(), except it accepts an arbitrary object
// for the "around" argument and finds a proper processor to place a node.
// Deprecated, new code should use dijit.place.around() instead.
- };
- =====*/
- dijit.placeOnScreenAroundElement = function(node, aroundNode, aroundCorners, layoutNode){
+
// Convert old style {"BL": "TL", "BR": "TR"} type argument
// to style needed by dijit.place code:
// [
@@ -57,33 +50,32 @@ define([
return place.around(node, aroundNode, positions, true, layoutNode);
};
+ exports.placeOnScreenAroundNode = exports.placeOnScreenAroundElement;
/*=====
- dijit.placeOnScreenAroundNode = function(node, aroundNode, aroundCorners, layoutNode){
+ exports.placeOnScreenAroundNode = function(node, aroundNode, aroundCorners, layoutNode){
// summary:
// Position node adjacent or kitty-corner to aroundNode
// such that it's fully visible in viewport.
// Deprecated, new code should use dijit.place.around() instead.
};
=====*/
- dijit.placeOnScreenAroundNode = dijit.placeOnScreenAroundElement;
+ exports.placeOnScreenAroundRectangle = exports.placeOnScreenAroundElement;
/*=====
- dijit.placeOnScreenAroundRectangle = function(node, aroundRect, aroundCorners, layoutNode){
+ exports.placeOnScreenAroundRectangle = function(node, aroundRect, aroundCorners, layoutNode){
// summary:
// Like dijit.placeOnScreenAroundNode(), except that the "around"
// parameter is an arbitrary rectangle on the screen (x, y, width, height)
// instead of a dom node.
// Deprecated, new code should use dijit.place.around() instead.
};
=====*/
- dijit.placeOnScreenAroundRectangle = dijit.placeOnScreenAroundElement;
- dijit.getPopupAroundAlignment = function(/*Array*/ position, /*Boolean*/ leftToRight){
+ exports.getPopupAroundAlignment = function(/*Array*/ position, /*Boolean*/ leftToRight){
// summary:
// Deprecated method, unneeded when using dijit/place directly.
// Transforms the passed array of preferred positions into a format suitable for
// passing as the aroundCorners argument to dijit.placeOnScreenAroundElement.
- //
// position: String[]
// This variable controls the position of the drop down.
// It's an array of strings with the following values:
@@ -97,10 +89,9 @@ define([
//
// The list is positions is tried, in order, until a position is found where the drop down fits
// within the viewport.
- //
// leftToRight: Boolean
// Whether the popup will be displaying in leftToRight mode.
- //
+
var align = {};
array.forEach(position, function(pos){
var ltr = leftToRight;
@@ -133,5 +124,8 @@ define([
return align;
};
- return dijit;
+ lang.mixin(dijit, exports);
+
+ /*===== return exports; =====*/
+ return dijit; // for back compat :-(
});
View
9 _base/popup.js
@@ -7,8 +7,13 @@ define([
// module:
// dijit/_base/popup
-// summary:
-// Old module for popups, new code should use dijit/popup directly
+
+/*=====
+return {
+ // summary:
+ // Deprecated. Old module for popups, new code should use dijit/popup directly.
+};
+=====*/
// Hack support for old API passing in node instead of a widget (to various methods)
View
9 _base/scroll.js
@@ -4,8 +4,13 @@ define([
], function(windowUtils, dijit){
// module:
// dijit/_base/scroll
- // summary:
- // Back compatibility module, new code should use windowUtils directly instead of using this module.
+
+ /*=====
+ return {
+ // summary:
+ // Back compatibility module, new code should use windowUtils directly instead of using this module.
+ };
+ =====*/
dijit.scrollIntoView = function(/*DomNode*/ node, /*Object?*/ pos){
// summary:
View
10 _base/sniff.js
@@ -1,6 +1,12 @@
define([ "dojo/uacss" ], function(){
+
// module:
// dijit/_base/sniff
- // summary:
- // Back compatibility module, new code should require dojo/uacss directly instead of this module.
+
+ /*=====
+ return {
+ // summary:
+ // Deprecated, back compatibility module, new code should require dojo/uacss directly instead of this module.
+ };
+ =====*/
});
View
9 _base/typematic.js
@@ -1,3 +1,10 @@
define(["../typematic"], function(){
- // for back-compat, just loads top level module
+
+ /*=====
+ return {
+ // summary:
+ // Deprecated, for back-compat, just loads top level module
+ };
+ =====*/
+
});
View
20 _base/wai.js
@@ -7,13 +7,14 @@ define([
// module:
// dijit/_base/wai
- // summary:
- // Deprecated methods for setting/getting wai roles and states.
- // New code should call setAttribute()/getAttribute() directly.
- //
- // Also loads hccss to apply dj_a11y class to root node if machine is in high-contrast mode.
- lang.mixin(dijit, {
+ var exports = {
+ // summary:
+ // Deprecated methods for setting/getting wai roles and states.
+ // New code should call setAttribute()/getAttribute() directly.
+ //
+ // Also loads hccss to apply dj_a11y class to root node if machine is in high-contrast mode.
+
hasWaiRole: function(/*Element*/ elem, /*String?*/ role){
// summary:
// Determines if an element has a particular role.
@@ -99,7 +100,10 @@ define([
elem.removeAttribute("aria-"+state);
}
- });
+ };
+
+ lang.mixin(dijit, exports);
- return dijit;
+ /*===== return exports; =====*/
+ return dijit; // for back compat :-(
});
View
9 _base/window.js
@@ -4,8 +4,13 @@ define([
], function(windowUtils, dijit){
// module:
// dijit/_base/window
- // summary:
- // Back compatibility module, new code should use windowUtils directly instead of using this module.
+
+ /*=====
+ return {
+ // summary:
+ // Back compatibility module, new code should use windowUtils directly instead of using this module.
+ };
+ =====*/
dijit.getDocumentWindow = function(doc){
return windowUtils.get(doc);

0 comments on commit 56ead81

Please sign in to comment.