Skip to content

Commit

Permalink
Various updates to modules to not use dojo global variable, except fo…
Browse files Browse the repository at this point in the history
…r exporting the modules' symbols. Refs #14220 !strict.
  • Loading branch information
wkeese committed Nov 4, 2011
1 parent 39da6e0 commit e909568
Show file tree
Hide file tree
Showing 12 changed files with 87 additions and 81 deletions.
4 changes: 2 additions & 2 deletions _base/Deferred.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define(["./kernel", "./lang"], function(dojo, lang){
define(["./kernel", "./config", "./lang"], function(dojo, config, lang){
// module:
// dojo/_base/Deferred
// summary:
Expand Down Expand Up @@ -213,7 +213,7 @@ define(["./kernel", "./lang"], function(dojo, lang){
complete(error);
this.results = [null, error];
if(!error || error.log !== false){
(dojo.config.deferredOnError || function(x){ console.error(x); })(error);
(config.deferredOnError || function(x){ console.error(x); })(error);
}
};
// call progress to provide updates on the progress on the completion of the promise
Expand Down
15 changes: 8 additions & 7 deletions _base/fx.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
define(["./kernel", "./lang", "../Evented", "./Color", "./connect", "./sniff", "../dom", "../dom-style"], function(dojo, lang, Evented, Color, connect, has, dom, style){
define(["./kernel", "./config", "./lang", "../Evented", "./Color", "./connect", "./sniff", "../dom", "../dom-style"],
function(dojo, config, lang, Evented, Color, connect, has, dom, style){
// module:
// dojo/_base/fx
// summary:
Expand Down Expand Up @@ -54,7 +55,7 @@ define(["./kernel", "./lang", "../Evented", "./Color", "./connect", "./sniff", "

lang.extend(dojo.Animation, {
// duration: Integer
// The time in milliseonds the animation will take to run
// The time in milliseconds the animation will take to run
duration: 350,

/*=====
Expand Down Expand Up @@ -138,7 +139,7 @@ define(["./kernel", "./lang", "../Evented", "./Color", "./connect", "./sniff", "
// The arguments to pass to the event.
var a = args||[];
if(this[evt]){
if(dojo.config.debugAtAllCosts){
if(config.debugAtAllCosts){
this[evt].apply(this, a);
}else{
try{
Expand Down Expand Up @@ -450,7 +451,7 @@ define(["./kernel", "./lang", "../Evented", "./Color", "./connect", "./sniff", "
};

/*=====
dojo.declare("dojo.__AnimArgs", [dojo.__FadeArgs], {
declare("dojo.__AnimArgs", [dojo.__FadeArgs], {
// Properties: Object?
// A hash map of style properties to Objects describing the transition,
// such as the properties of dojo._Line with an additional 'units' property
Expand Down Expand Up @@ -481,7 +482,7 @@ define(["./kernel", "./lang", "../Evented", "./Color", "./connect", "./sniff", "
// Dojo figures out the start value for the width and converts the
// integer specified for the width to the more expressive but
// verbose form `{ width: { end: '400', units: 'px' } }` which you
// can also specify directly. Defaults to 'px' if ommitted.
// can also specify directly. Defaults to 'px' if omitted.
//
// example:
// Animate width, height, and padding over 2 seconds... the
Expand Down Expand Up @@ -517,7 +518,7 @@ define(["./kernel", "./lang", "../Evented", "./Color", "./connect", "./sniff", "
// example:
// Like all `dojo.Animation`s, animateProperty returns a handle to the
// Animation instance, which fires the events common to Dojo FX. Use `dojo.connect`
// to access these events outside of the Animation definiton:
// to access these events outside of the Animation definition:
// | var anim = dojo.animateProperty({
// | node:"someId",
// | properties:{
Expand All @@ -533,7 +534,7 @@ define(["./kernel", "./lang", "../Evented", "./Color", "./connect", "./sniff", "
// example:
// Each property can be a function whose return value is substituted along.
// Additionally, each measurement (eg: start, end) can be a function. The node
// reference is passed direcly to callbacks.
// reference is passed directly to callbacks.
// | dojo.animateProperty({
// | node:"mine",
// | properties:{
Expand Down
27 changes: 14 additions & 13 deletions _base/xhr.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
define([
"./kernel", "./sniff", "require", "../io-query", "../dom", "../dom-form", "./Deferred", "./json", "./lang", "./array", "../on"
], function(dojo, has, require, ioq, dom, domForm, deferred, json, lang, array, on){
"./kernel", "./sniff", "require", "../io-query", "../dom", "../dom-form", "./Deferred",
"./config", "./json", "./lang", "./array", "../on"
], function(dojo, has, require, ioq, dom, domForm, deferred, config, json, lang, array, on){
// module:
// dojo/_base.xhr
// summary:
Expand Down Expand Up @@ -105,7 +106,7 @@ define([
// use the standard `json` contentHandler, and prefix your "JSON" with: {}&&
//
// use djConfig.useCommentedJson = true to turn off the notice
if(!dojo.config.useCommentedJson){
if(!config.useCommentedJson){
console.warn("Consider using the standard mimetype:application/json."
+ " json-commenting can introduce security issues. To"
+ " decrease the chances of hijacking, use the standard the 'json' handler and"
Expand Down Expand Up @@ -349,7 +350,7 @@ define([

var ioArgs = {args: args, url: args.url};

//Get values from form if requestd.
//Get values from form if requested.
var formObject = null;
if(args.form){
var form = dom.byId(args.form);
Expand Down Expand Up @@ -427,7 +428,7 @@ define([
d.ioArgs = ioArgs;

// FIXME: need to wire up the xhr object's abort method to something
// analagous in the Deferred
// analogous in the Deferred
return d;
};

Expand Down Expand Up @@ -463,7 +464,7 @@ define([
};

// avoid setting a timer per request. It degrades performance on IE
// something fierece if we don't use unified loops.
// something fierce if we don't use unified loops.
var _inFlightIntvl = null;
var _inFlight = [];

Expand Down Expand Up @@ -494,7 +495,7 @@ define([
// first sync call ends the browser hangs
if(!dojo._blockAsync){
// we need manual loop because we often modify _inFlight (and therefore 'i') while iterating
// note: the second clause is an assigment on purpose, lint may complain
// note: the second clause is an assignment on purpose, lint may complain
for(var i = 0, tif; i < _inFlight.length && (tif = _inFlight[i]); i++){
var dfd = tif.dfd;
var func = function(){
Expand All @@ -518,7 +519,7 @@ define([
}
}
};
if(dojo.config.debugAtAllCosts){
if(config.debugAtAllCosts){
func.call(this);
}else{
// try{
Expand Down Expand Up @@ -637,7 +638,7 @@ define([
};

/*=====
dojo.declare("dojo.__XhrArgs", dojo.__IoArgs, {
declare("dojo.__XhrArgs", dojo.__IoArgs, {
constructor: function(){
// summary:
// In addition to the properties listed for the dojo._IoArgs type,
Expand Down Expand Up @@ -713,7 +714,7 @@ define([
if(hdr.toLowerCase() === "content-type" && !args.contentType){
args.contentType = args.headers[hdr];
}else if(args.headers[hdr]){
//Only add header if it has a value. This allows for instnace, skipping
//Only add header if it has a value. This allows for instance, skipping
//insertion of X-Requested-With by specifying empty value.
xhr.setRequestHeader(hdr, args.headers[hdr]);
}
Expand All @@ -728,7 +729,7 @@ define([
}
// FIXME: set other headers here!
dojo._ioNotifyStart(dfd);
if(dojo.config.debugAtAllCosts){
if(config.debugAtAllCosts){
xhr.send(ioArgs.query);
}else{
try{
Expand All @@ -751,7 +752,7 @@ define([

dojo.rawXhrPost = dojo.xhrPost = function(/*dojo.__XhrArgs*/ args){
// summary:
// Sends an HTTP POST request to the server. In addtion to the properties
// Sends an HTTP POST request to the server. In addition to the properties
// listed for the dojo.__XhrArgs type, the following property is allowed:
// postData:
// String. Send raw data in the body of the POST request.
Expand All @@ -760,7 +761,7 @@ define([

dojo.rawXhrPut = dojo.xhrPut = function(/*dojo.__XhrArgs*/ args){
// summary:
// Sends an HTTP PUT request to the server. In addtion to the properties
// Sends an HTTP PUT request to the server. In addition to the properties
// listed for the dojo.__XhrArgs type, the following property is allowed:
// putData:
// String. Send raw data in the body of the PUT request.
Expand Down
8 changes: 5 additions & 3 deletions data/api/Identity.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
define(["../..", "./Read"], function(dojo) {
define(["../../_base/declare", "./Read"], function(declare, Read) {
// module:
// dojo/data/api/Identity
// summary:
// TODOC

/*=====
Read = dojo.data.api.Read;
=====*/

dojo.declare("dojo.data.api.Identity", dojo.data.api.Read, {
return declare("dojo.data.api.Identity", Read, {
// summary:
// This is an abstract API that data provider implementations conform to.
// This file defines methods signatures and intentionally leaves all the
Expand Down Expand Up @@ -103,5 +106,4 @@ dojo.declare("dojo.data.api.Identity", dojo.data.api.Read, {
}
});

return dojo.data.api.Identity;
});
11 changes: 7 additions & 4 deletions data/api/Notification.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
define(["../..", "./Read"], function(dojo) {
define(["../../_base/declare", "./Read"], function(declare, Read) {
// module:
// dojo/data/api/Notification
// summary:
// TODOC

/*=====
Read = dojo.data.api.Read;
=====*/

dojo.declare("dojo.data.api.Notification", dojo.data.api.Read, {

return declare("dojo.data.api.Notification", Read, {
// summary:
// This is an abstract API that data provider implementations conform to.
// This file defines functions signatures and intentionally leaves all the
Expand Down Expand Up @@ -90,7 +94,7 @@ dojo.declare("dojo.data.api.Notification", dojo.data.api.Read, {
// attribute: "attribute-name-string", //The attribute the new item was assigned to.
// oldValue: something //Whatever was the previous value for the attribute.
// //If it is a single-value attribute only, then this value will be a single value.
// //If it was a multi-valued attribute, then this will be an array of all the values minues the new one.
// //If it was a multi-valued attribute, then this will be an array of all the values minus the new one.
// newValue: something //The new value of the attribute. In the case of single value calls, such as setValue, this value will be
// //generally be an atomic value of some sort (string, int, etc, object). In the case of multi-valued attributes,
// //it will be an array.
Expand Down Expand Up @@ -118,5 +122,4 @@ dojo.declare("dojo.data.api.Notification", dojo.data.api.Read, {
}
});

return dojo.data.api.Notification;
});
9 changes: 4 additions & 5 deletions data/api/Read.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
define(["../..", "./Request"], function(dojo) {
define(["../../_base/declare"], function(declare) {
// module:
// dojo/data/api/Read
// summary:
// TODOC


dojo.declare("dojo.data.api.Read", null, {
return declare("dojo.data.api.Read", null, {
// summary:
// This is an abstract API that data provider implementations conform to.
// This file defines methods signatures and intentionally leaves all the
Expand Down Expand Up @@ -246,7 +246,7 @@ dojo.declare("dojo.data.api.Read", null, {
// an attribute named attrFoo, with a value that starts with 'value'.
//
// The *queryOptions* parameter
// The queryOptions parameter is an optional parameter used to specify optiosn that may modify
// The queryOptions parameter is an optional parameter used to specify options that may modify
// the query in some fashion, such as doing a case insensitive search, or doing a deep search
// where all items in a hierarchical representation of data are scanned instead of just the root
// items. It currently defines two options that all datastores should attempt to honor if possible:
Expand Down Expand Up @@ -414,7 +414,7 @@ dojo.declare("dojo.data.api.Read", null, {
// description:
// The close() method is intended for instructing the store to 'close' out
// any information associated with a particular request. In general, this API
// expects to recieve as a parameter a request object returned from a fetch.
// expects to receive as a parameter a request object returned from a fetch.
// It will then close out anything associated with that request, such as
// clearing any internal datastore caches and closing any 'open' connections.
// For some store implementations, this call may be a no-op.
Expand Down Expand Up @@ -481,5 +481,4 @@ dojo.declare("dojo.data.api.Read", null, {
}
});

return dojo.data.api.Read;
});
7 changes: 3 additions & 4 deletions data/api/Request.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
define(["../.."], function(dojo) {
define(["../../_base/declare"], function(declare) {
// module:
// dojo/data/api/Request
// summary:
// TODOC


dojo.declare("dojo.data.api.Request", null, {
return declare("dojo.data.api.Request", null, {
// summary:
// This class defines out the semantics of what a 'Request' object looks like
// when returned from a fetch() method. In general, a request object is
// nothing more than the original keywordArgs from fetch with an abort function
// attached to it to allow users to abort a particular request if they so choose.
// No other functions are required on a general Request object return. That does not
// inhibit other store implementations from adding extentions to it, of course.
// inhibit other store implementations from adding extensions to it, of course.
//
// This is an abstract API that data provider implementations conform to.
// This file defines methods signatures and intentionally leaves all the
Expand All @@ -32,5 +32,4 @@ dojo.declare("dojo.data.api.Request", null, {
}
});

return dojo.data.api.Request;
});
21 changes: 12 additions & 9 deletions data/api/Write.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
define(["../..", "./Read"], function(dojo) {
// module:
// dojo/data/api/Write
// summary:
// TODOC
define(["../../_base/declare", "./Read"], function(declare, Read) {

// module:
// dojo/data/api/Write
// summary:
// TODOC

/*=====
Read = dojo.data.api.Read;
=====*/

dojo.declare("dojo.data.api.Write", dojo.data.api.Read, {
return declare("dojo.data.api.Write", Read, {
// summary:
// This is an abstract API that data provider implementations conform to.
// This file defines function signatures and intentionally leaves all the
// functionss unimplemented.
// functions unimplemented.

getFeatures: function(){
// summary:
Expand All @@ -29,7 +33,7 @@ dojo.declare("dojo.data.api.Write", dojo.data.api.Read, {
// in the new item. In addition, for stores that support hierarchical item
// creation, an optional second parameter is accepted that defines what item is the parent
// of the new item and what attribute of that item should the new item be assigned to.
// In general, this will assume that the attribute targetted is multi-valued and a new item
// In general, this will assume that the attribute targeted is multi-valued and a new item
// is appended onto the list of values for that attribute.
//
// keywordArgs:
Expand Down Expand Up @@ -217,5 +221,4 @@ dojo.declare("dojo.data.api.Write", dojo.data.api.Read, {
}
});

return dojo.data.api.Write;
});
Loading

0 comments on commit e909568

Please sign in to comment.