Skip to content

Commit

Permalink
tabs --> spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
wkeese committed Dec 21, 2011
1 parent c25c018 commit da94b0e
Show file tree
Hide file tree
Showing 139 changed files with 4,059 additions and 4,057 deletions.
296 changes: 148 additions & 148 deletions build/buildSystem.rst

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions build/customBase.rst
Expand Up @@ -44,9 +44,9 @@ In the profile for your build, specify the following for your dojo layer (note t
layers: [
{
name: "dojo.js",
customBase: true,
dependencies: [
name: "dojo.js",
customBase: true,
dependencies: [
]
},
Expand Down
22 changes: 11 additions & 11 deletions build/expand-provide.rst
Expand Up @@ -35,14 +35,14 @@ Or mix the option into your profile:

.. js ::
dependencies = {
// expand dojo.provide calls
expandProvide: true,
// rest of profile:
layers: [{ /* ... */ }],
prefixes: [
[ "dijit", "../dijit" ],
[ "dojox", "../dojox" ]
]
}
dependencies = {
// expand dojo.provide calls
expandProvide: true,
// rest of profile:
layers: [{ /* ... */ }],
prefixes: [
[ "dijit", "../dijit" ],
[ "dojox", "../dojox" ]
]
}
68 changes: 34 additions & 34 deletions build/localizationExample.rst
Expand Up @@ -45,21 +45,21 @@ A custom build profile might look like this:
.. code-block :: text
dependencies = {
layers: [
{
name: "testdijits.js",
resourceName: "testdijits", /* This is what is dojo.provide()'d by the layer */
dependencies: [
"testdijits.Foo"
]
}
],
layers: [
{
name: "testdijits.js",
resourceName: "testdijits", /* This is what is dojo.provide()'d by the layer */
dependencies: [
"testdijits.Foo"
]
}
],
prefixes: [
[ "dijit", "../dijit" ],
[ "dojox", "../dojox" ],
[ "testdijits", "../../testdijits"]
]
prefixes: [
[ "dijit", "../dijit" ],
[ "dojox", "../dojox" ],
[ "testdijits", "../../testdijits"]
]
};
Remember that the build process first copies all directories mentioned in ``prefixes`` to the build output directory, and then resolves all relative paths relative to that subtree; it does not resolve paths relative to your original source directories. The build will find Foo.js by looking up its namespace "testdijits" in the prefixes section, and resolve the "../../testdijits" path relative to the directory containing dojo.js. Run the build with a command like:
Expand All @@ -84,19 +84,19 @@ So far, no localization. Let's add a string resource. Our Foo.js implementatio
dojo.require("dijit._Templated");
dojo.declare("testdijits.Foo", [ dijit._Widget, dijit._Templated ], {
// Our template contains a localised string from the messages bundle
templateString: "<div><p>The string: ${messages.test}</div>",
// On creation, pull in the correct strings bundle
postMixInProperties: function(){
this.inherited(arguments);
console.log("Foo calling requireLocalization..");
dojo.requireLocalization("testdijits", "Foo");
console.log("Foo calling getLocalization for lang ", this.lang);
this.messages = dojo.i18n.getLocalization("testdijits", "Foo", this.lang);
console.log("TEST LOCALIZATION: ", this.messages);
}
// Our template contains a localised string from the messages bundle
templateString: "<div><p>The string: ${messages.test}</div>",
// On creation, pull in the correct strings bundle
postMixInProperties: function(){
this.inherited(arguments);
console.log("Foo calling requireLocalization..");
dojo.requireLocalization("testdijits", "Foo");
console.log("Foo calling getLocalization for lang ", this.lang);
this.messages = dojo.i18n.getLocalization("testdijits", "Foo", this.lang);
console.log("TEST LOCALIZATION: ", this.messages);
}
})
So the template contains a template variable usage, ${messages.test}. Before the template is processed, the widget lifecycle dictates that ``postMixInProperties`` is called, which our implementation uses to prepare and make available a ``this.messages`` variable. This is simply a variable on our dijit instance. When the template is then processed in ``buildRendering`` later in the lifecycle, the ${messages.test} reference is resolved from ``this.messages.test``.
Expand All @@ -121,7 +121,7 @@ The ``testdijits/nls/Foo.js`` file should contain:
define({ root:
// begin v1.x content
({
test: 'this is a test'
test: 'this is a test'
})
// end v1.x content
})
Expand All @@ -142,13 +142,13 @@ To use this dijit, use a simple test file such as ``test.html``:
<!DOCTYPE html>
<html><head><title>Localized build test</title>
<script type="text/javascript">
var djConfig = {
parseOnLoad: true
};
var djConfig = {
parseOnLoad: true
};
</script>
<script type="text/javascript" src="test/dojo/dojo.js"></script>
<script type="text/javascript">
dojo.require("testdijits.Foo");
dojo.require("testdijits.Foo");
</script>
</head>
<body>
Expand Down Expand Up @@ -222,7 +222,7 @@ To use your built layer, link to it after the link to dojo.js:
<script type="text/javascript" src="test/dojo/dojo.js"></script>
<script type="text/javascript" src="test/dojo/testdijits.js"></script>
<script type="text/javascript">
dojo.require("testdijits.Foo");
dojo.require("testdijits.Foo");
</script>
Suddenly, the load performance is very different. The Net panel now shows:
Expand Down Expand Up @@ -289,7 +289,7 @@ From here it's simple to add another strings resource, along with the single ``t
define({ root:
// begin v1.x content
({
test: 'FRENCH this is a test FRENCH'
test: 'FRENCH this is a test FRENCH'
})
// end v1.x content
})
Expand Down
80 changes: 40 additions & 40 deletions build/pre17/build.rst
Expand Up @@ -166,52 +166,52 @@ Here is a sample profile from the Dojo 1.2.3 release directory tree, ``/utils/bu
//
// <server root>/js/src/mylayer.profile.js
//
// This profile is used just to illustrate the layout of a layered build.
// All layers have an implicit dependency on dojo.js.
// This profile is used just to illustrate the layout of a layered build.
// All layers have an implicit dependency on dojo.js.
//
// Normally you should not specify a layer object for dojo.js, as it will
// be built by default with the right options. Custom dojo.js files are
// possible, but not recommended for most apps.
dependencies = {
layers: [
{
// This layer will be discarded, it is just used
// to specify some modules that should not be included
// in a later layer, but something that should not be
// saved as an actual layer output. The important property
// is the "discard" property. If set to true, then the layer
// will not be a saved layer in the release directory.
name: "acme.discard",
resourceName: "acme.discard",
discard: true,
// Path to the copyright file must be relative to
// the util/buildscripts directory, or an absolute path.
copyrightFile: "myCopyright.txt",
dependencies: [
"dojo.string"
]
},
{
dependencies = {
layers: [
{
// This layer will be discarded, it is just used
// to specify some modules that should not be included
// in a later layer, but something that should not be
// saved as an actual layer output. The important property
// is the "discard" property. If set to true, then the layer
// will not be a saved layer in the release directory.
name: "acme.discard",
resourceName: "acme.discard",
discard: true,
// Path to the copyright file must be relative to
// the util/buildscripts directory, or an absolute path.
copyrightFile: "myCopyright.txt",
dependencies: [
"dojo.string"
]
},
{
// one of the stock layers. It builds a "roll up" for
// dijit.dijit which includes most of the infrastructure needed to
// build widgets in a single file. We explicitly ignore the string
// stuff via the previous exclude layer.
// where the output file goes, relative to the dojo dir
name: "../dijit/dijit.js",
name: "../dijit/dijit.js",
// what the module's name will be, i.e., what gets generated
// for dojo.provide(<name here>);
resourceName: "dijit.dijit",
resourceName: "dijit.dijit",
// modules not to include code for
layerDependencies: [
layerDependencies: [
"string.discard"
],
],
// modules to use as the "source" for this layer
dependencies: [
"dijit.dijit"
]
},
dependencies: [
"dijit.dijit"
]
},
{
// where to put the output relative to the Dojo root in a build
name: "../acme/mylayer.js"
Expand All @@ -220,20 +220,20 @@ Here is a sample profile from the Dojo 1.2.3 release directory tree, ``/utils/bu
// what other layers to assume will have already been loaded
// specifying modules here prevents them from being included in
// this layer's output file
layerDependencies: [
layerDependencies: [
"dijit.dijit"
],
],
// which modules to pull in. All of the dependencies not
// provided by dojo.js or other items in the "layerDependencies"
// array are also included.
dependencies: [
dependencies: [
// our acme.mylayer specifies all the stuff our app will
// need, so we don't need to list them all out here.
"acme.mylayer"
]
}
],
prefixes: [
// the system knows where to find the "dojo/" directory, but we
// need to tell it about everything else. Directories listed here
Expand All @@ -243,16 +243,16 @@ Here is a sample profile from the Dojo 1.2.3 release directory tree, ``/utils/bu
[ "acme", "../acme" ]
]
}
// If you choose to optimize the JS files in a prefix directory (via the
// optimize= build parameter), you can choose to have a custom copyright
// text prepended to the optimized file. To do this, specify the path to a
// file tha contains the copyright info as the third array item in the
// prefixes array. For instance:
// prefixes: [
// [ "acme", "/path/to/acme", "/path/to/acme/copyright.txt"]
// ]
//
// prefixes: [
// [ "acme", "/path/to/acme", "/path/to/acme/copyright.txt"]
// ]
//
// NOTE:
// If no copyright is specified in this optimize case, then by default,
// the Dojo copyright will be used.
Expand Down
2 changes: 1 addition & 1 deletion build/profiles.rst
Expand Up @@ -64,7 +64,7 @@ Each member of the top level ``layers`` array is an object similar to (in many b
discard: false,
copyrightFile: "myCopyright.txt",
dependencies: [
// List of resources this layer depends on
// List of resources this layer depends on
'dijit.form.Button',
'dojox.data.Grid'
]
Expand Down
46 changes: 23 additions & 23 deletions build/transforms/depsDump.rst
Expand Up @@ -28,25 +28,25 @@ rooted at the property ``idTree`` of the output JSON object. Consider the follow

.. js ::
idTree: {
dojo:{
"*":0
_base:{
array:{
"*":1
},
lang:{
"*":2
},
// etc.
},
// etc.
},
dijit:{
"*":487,
// etc.
}
}
idTree: {
dojo:{
"*":0
_base:{
array:{
"*":1
},
lang:{
"*":2
},
// etc.
},
// etc.
},
dijit:{
"*":487,
// etc.
}
}
The partial ``idTree`` value given above contains a forest with the ``dojo`` and ``dijit`` trees. The modules dojo,
dojo/_base/array, dojo/_base/lang, and dijit have the identifiers 0, 1, 2, and 487 respectively.
Expand All @@ -72,10 +72,10 @@ For example, the following profile will output a dot program for the dependency

.. js ::
var profile = {
depsDumpDotFilename:"dojo-base-json.dot",
dotModules:"dojo/_base/json"
}
var profile = {
depsDumpDotFilename:"dojo-base-json.dot",
dotModules:"dojo/_base/json"
}
This could then be used to generate a PNG of the graph as follows (assuming Graphvis is installed).

Expand Down
26 changes: 13 additions & 13 deletions build/transforms/hasFixup.rst
Expand Up @@ -30,11 +30,11 @@ the final ``staticHasFeature`` map. For example, assume the following two profil
.. js ::
profile = {
staticHasFeatures:{
featureX:1,
featureY:1,
featureZ:0
}
staticHasFeatures:{
featureX:1,
featureY:1,
featureZ:0
}
// other profile properties, if any
};
Expand All @@ -44,12 +44,12 @@ the final ``staticHasFeature`` map. For example, assume the following two profil
.. js ::
profile = {
staticHasFeatures:{
featureY:0,
featureZ:-1,
anotherFeature:1
}
// other profile properties, if any
staticHasFeatures:{
featureY:0,
featureZ:-1,
anotherFeature:1
}
// other profile properties, if any
};
If these two profiles were provided on the command line as follows
Expand All @@ -64,8 +64,8 @@ Then the aggregate profile would have the following value for the property ``sta
staticHasFeatures:{
featureX:1, // only mentioned in profile-a
featureY:0, // profile-b value overrides profile-a value
anotherFeature:1 // only mentioned in profile-b
featureY:0, // profile-b value overrides profile-a value
anotherFeature:1 // only mentioned in profile-b
}
Notice that "featureZ" was removed because the profile-b which was mixed after profile-a contains the value of -1 for
Expand Down

0 comments on commit da94b0e

Please sign in to comment.