Browse files

tabs --> spaces

  • Loading branch information...
1 parent c25c018 commit da94b0e88f226f364135904a826c2c26029af3e5 @wkeese wkeese committed Dec 21, 2011
Showing with 4,059 additions and 4,057 deletions.
  1. +148 −148 build/buildSystem.rst
  2. +3 −3 build/customBase.rst
  3. +11 −11 build/expand-provide.rst
  4. +34 −34 build/localizationExample.rst
  5. +40 −40 build/pre17/build.rst
  6. +1 −1 build/profiles.rst
  7. +23 −23 build/transforms/depsDump.rst
  8. +13 −13 build/transforms/hasFixup.rst
  9. +55 −55 build/transforms/writeDojo.rst
  10. +3 −3 dijit/Editor.rst
  11. +1 −1 dojo/Evented.rst
  12. +2 −2 dojo/aspect.rst
  13. +1 −1 dojo/back.rst
  14. +31 −31 dojo/data/ItemFileReadStore.rst
  15. +1 −1 dojo/date/locale/format.rst
  16. +46 −46 dojo/fx/easing.rst
  17. +6 −6 dojo/fx/wipeOut.rst
  18. +7 −7 dojo/gears.rst
  19. +6 −6 dojo/hash.rst
  20. +57 −57 dojo/html.rst
  21. +65 −65 dojo/iframe_history.html
  22. +9 −9 dojo/parser.rst
  23. +30 −30 dojo/position.rst
  24. +38 −38 dojo/query.rst
  25. +1 −1 dojo/uacss.rst
  26. +19 −19 dojox/analytics.rst
  27. +1 −1 dojox/atom/io/model/Link.rst
  28. +2 −2 dojox/charting/DataChart.rst
  29. +16 −16 dojox/cometd.rst
  30. +46 −46 dojox/data/AppStore.rst
  31. +4 −4 dojox/data/AtomReadStore.rst
  32. +2 −2 dojox/data/CsvStore.rst
  33. +26 −26 dojox/data/FlickrStore.rst
  34. +5 −5 dojox/data/JsonRestStore.rst
  35. +1 −1 dojox/data/OpmlStore.rst
  36. +1 −1 dojox/data/WikipediaStore.rst
  37. +57 −57 dojox/data/XmlStore-examples.rst
  38. +30 −30 dojox/data/XmlStore.rst
  39. +10 −10 dojox/date/hebrew.rst
  40. +19 −19 dojox/date/islamic.rst
  41. +213 −213 dojox/drawing.rst
  42. +2 −2 dojox/editor/plugins/AutoSave.rst
  43. +3 −3 dojox/editor/plugins/AutoUrlLink.rst
  44. +2 −2 dojox/editor/plugins/LocalImage.rst
  45. +1 −1 dojox/editor/plugins/SpellCheck.rst
  46. +5 −5 dojox/form/FileUploader.rst
  47. +10 −10 dojox/form/ListInput.rst
  48. +2 −2 dojox/form/MultiComboBox.rst
  49. +34 −34 dojox/form/Rating.rst
  50. +2 −2 dojox/form/Uploader.rst
  51. +9 −9 dojox/form/uploader/FileList.rst
  52. +3 −3 dojox/fx/ext-dojo/reverse.rst
  53. +6 −6 dojox/gantt.rst
  54. +114 −114 dojox/gauges/AnalogGauge.rst
  55. +113 −113 dojox/gauges/BarGauge.rst
  56. +8 −8 dojox/gauges/GlossyCircularGauge.rst
  57. +8 −8 dojox/gauges/GlossyHorizontalGauge.rst
  58. +8 −8 dojox/gauges/GlossySemiCircularGauge.rst
  59. +66 −66 dojox/geo/charting.rst
  60. +2 −2 dojox/geo/charting/Map.rst
  61. +10 −10 dojox/gfx/utils/toSvg.rst
  62. +32 −32 dojox/grid/EnhancedGrid.rst
  63. +234 −234 dojox/grid/EnhancedGrid/plugins/CellMerge.rst
  64. +3 −3 dojox/grid/EnhancedGrid/plugins/Cookie.rst
  65. +228 −228 dojox/grid/EnhancedGrid/plugins/DnD.rst
  66. +97 −97 dojox/grid/EnhancedGrid/plugins/Exporter.rst
  67. +208 −208 dojox/grid/EnhancedGrid/plugins/Filter.rst
  68. +34 −34 dojox/grid/EnhancedGrid/plugins/IndirectSelection.rst
  69. +32 −32 dojox/grid/EnhancedGrid/plugins/NestedSorting.rst
  70. +9 −9 dojox/grid/EnhancedGrid/plugins/Pagination.rst
  71. +136 −136 dojox/grid/EnhancedGrid/plugins/Printer.rst
  72. +1 −1 dojox/grid/EnhancedGrid/plugins/Search.rst
  73. +142 −142 dojox/grid/EnhancedGrid/plugins/Selector.rst
  74. +42 −42 dojox/grid/LazyTreeGrid.rst
  75. +2 −2 dojox/grid/example_Adding_and_deleting_data.rst
  76. +2 −2 dojox/grid/example_Editing_data.rst
  77. +2 −2 dojox/grid/example_Filtering_data.rst
  78. +16 −16 dojox/grid/example_grid_styling_rows.rst
  79. +164 −164 dojox/grid/griddate.rst
  80. +1 −1 dojox/html/set.rst
  81. +3 −3 dojox/image/FlickrBadge.rst
  82. +2 −2 dojox/image/Gallery.rst
  83. +18 −18 dojox/image/LightboxNano.rst
  84. +6 −6 dojox/image/Magnifier.rst
  85. +19 −19 dojox/image/MagnifierLite.rst
  86. +19 −19 dojox/image/SlideShow.rst
  87. +11 −11 dojox/io/OAuth.rst
  88. +1 −1 dojox/json/query.rst
  89. +20 −20 dojox/lang/typed.rst
  90. +13 −13 dojox/layout/RotatorContainer.rst
  91. +11 −11 dojox/mobile.rst
  92. +2 −2 dojox/mobile/Button.rst
  93. +2 −2 dojox/mobile/CheckBox.rst
  94. +10 −10 dojox/mobile/ComboBox.rst
  95. +2 −2 dojox/mobile/EdgeToEdgeDataList.rst
  96. +3 −3 dojox/mobile/Heading.rst
  97. +8 −8 dojox/mobile/IconContainer.rst
  98. +25 −24 dojox/mobile/ListItem.rst
  99. +8 −8 dojox/mobile/ProgressIndicator.rst
  100. +2 −2 dojox/mobile/RadioButton.rst
  101. +4 −3 dojox/mobile/RoundRectDataList.rst
  102. +23 −23 dojox/mobile/SpinWheel.rst
  103. +2 −2 dojox/mobile/Switch.rst
  104. +10 −10 dojox/mobile/TabBar.rst
  105. +3 −3 dojox/mobile/TextArea.rst
  106. +2 −2 dojox/mobile/TextBox.rst
  107. +2 −2 dojox/mobile/ToggleButton.rst
  108. +1 −1 dojox/mobile/View.rst
  109. +79 −79 dojox/mobile/dynamic-content-loading.rst
  110. +1 −1 dojox/mobile/faq.rst
  111. +25 −25 dojox/mobile/internationalization.rst
  112. +10 −10 dojox/mobile/transition-events.rst
  113. +3 −3 dojox/mvc/Generate.rst
  114. +26 −26 dojox/mvc/Group.rst
  115. +4 −4 dojox/mvc/_DataBindingMixin.rst
  116. +22 −22 dojox/rpc.rst
  117. +10 −10 dojox/string/Builder.rst
  118. +114 −114 dojox/widget/AnalogGauge.rst
  119. +113 −113 dojox/widget/BarGauge.rst
  120. +3 −3 dojox/widget/Calendar.rst
  121. +48 −48 dojox/widget/Portlet.rst
  122. +1 −1 dojox/widget/rotator/Pan.rst
  123. +55 −55 loader/amd.rst
  124. +7 −7 loader/legacy.rst
  125. +57 −57 quickstart/Animation.rst
  126. +28 −28 quickstart/arrays.rst
  127. +2 −2 quickstart/custom-builds.rst
  128. +1 −1 quickstart/layoutWidgetHierarchies.rst
  129. +9 −9 quickstart/numbersDates.rst
  130. +50 −50 quickstart/rest.rst
  131. +1 −1 quickstart/widgetHierarchies.rst
  132. +9 −9 quickstart/writingWidgets.rst
  133. +1 −1 quickstart/writingWidgets/a11y.rst
  134. +21 −21 releasenotes/1.5.rst
  135. +21 −21 releasenotes/1.5_ja.rst
  136. +3 −3 releasenotes/1.6.rst
  137. +21 −21 releasenotes/1.8.rst
  138. +17 −17 util/doctools/generate.rst
  139. +188 −188 util/doctools/markup.rst
View
296 build/buildSystem.rst
@@ -217,12 +217,12 @@ understanding and debugging how a particular build system invocation is consumin
~/dev/dtk/util/buildscripts:./build.sh --v1 someValue --v2 123 --true true --false false --null null --check-args
running under node.js
{
- false:false,
- null:null,
- profiles:[],
- true:true,
- v1:"someValue",
- v2:123
+ false:false,
+ null:null,
+ profiles:[],
+ true:true,
+ v1:"someValue",
+ v2:123
}
This example points out that number, true, false, and null values are not stored as strings but rather are converted to
@@ -259,10 +259,10 @@ If we invoke the build system with the ``profile`` switch indicating that profil
running under node.js
processing profile resource /home/rcgill/dev/dtk/util/build/examples/simple1.profile.js
{profiles:[{
- basePath:"/home/rcgill/dev/dtk/util/build/examples",
- someOtherProperty:"someOtherValue",
- someProperty:"someValue"
- }]}
+ basePath:"/home/rcgill/dev/dtk/util/build/examples",
+ someOtherProperty:"someOtherValue",
+ someProperty:"someValue"
+ }]}
Notice the build system automatically appends the ".profile.js" suffix to the profile argument if that argument does not
contain a file type. When a profile argument is given with no file type, *and* the profile argument contains no path
@@ -280,7 +280,7 @@ has contents:
.. js ::
var profile = {
- basePath:"."
+ basePath:"."
};
Which causes the following ``basePath`` initialization:
@@ -303,16 +303,16 @@ has contents:
.. js ::
function timestamp(){
- // this function isn't really necessary...
- // just using it to show you can call a function to get a profile property value
- var d = new Date();
- return d.getFullYear() + '-' + (d.getMonth()+1) + "-" + d.getDate() + "-" +
- d.getHours() + ':' + d.getMinutes() + ":" + d.getSeconds();
+ // this function isn't really necessary...
+ // just using it to show you can call a function to get a profile property value
+ var d = new Date();
+ return d.getFullYear() + '-' + (d.getMonth()+1) + "-" + d.getDate() + "-" +
+ d.getHours() + ':' + d.getMinutes() + ":" + d.getSeconds();
}
var profile = {
- basePath:".",
- buildTimestamp:timestamp()
+ basePath:".",
+ buildTimestamp:timestamp()
};
When exercised with the ``check-args`` switch, you should see something like this:
@@ -323,9 +323,9 @@ When exercised with the ``check-args`` switch, you should see something like thi
running under node.js
processing profile resource /home/rcgill/dev/dtk/util/build/examples/profile-with-code.profile.js
{profiles:[{
- basePath:"/home/rcgill/dev/dtk/util/build/examples",
- buildTimestamp:"2011-9-29-21:34:2"
- }]}
+ basePath:"/home/rcgill/dev/dtk/util/build/examples",
+ buildTimestamp:"2011-9-29-21:34:2"
+ }]}
Configuration Resources
------------------------
@@ -339,13 +339,13 @@ allow all or part of an application's build profile to be contained within the a
.. js ::
var dojoConfig = {
- packages:[{
- name:"dojo",
- location:"../../../dojo"
- },{
- name:"dijit",
- location:"../../../dijit"
- }]
+ packages:[{
+ name:"dojo",
+ location:"../../../dojo"
+ },{
+ name:"dijit",
+ location:"../../../dijit"
+ }]
};
When exercised with the ``check-args`` switch, you should see something like this:
@@ -356,18 +356,18 @@ When exercised with the ``check-args`` switch, you should see something like thi
running under node.js
processing dojoConfig resource /home/rcgill/dev/dtk/util/build/examples/dojoConfig.js
{profiles:[{
- basePath:"/home/rcgill/dev/dtk/util/build/examples",
- packages:[
- {
- location:"../../../dojo",
- name:"dojo"
- },
- {
- location:"../../../dijit",
- name:"dijit"
- }
- ]
- }]}
+ basePath:"/home/rcgill/dev/dtk/util/build/examples",
+ packages:[
+ {
+ location:"../../../dojo",
+ name:"dojo"
+ },
+ {
+ location:"../../../dijit",
+ name:"dijit"
+ }
+ ]
+ }]}
Notice that basePath, as automatically provided by the build system, when combined with the package locations, give the
correct locations of the dojo and dijit packages. Also take note that you must provide the complete filename, including
@@ -379,13 +379,13 @@ global AMD require function. For example, /util/build/examples/require.js has co
.. js ::
require({
- packages:[{
- name:"dojo",
- location:"../../../dojo"
- },{
- name:"dijit",
- location:"../../../dijit"
- }]
+ packages:[{
+ name:"dojo",
+ location:"../../../dojo"
+ },{
+ name:"dijit",
+ location:"../../../dijit"
+ }]
});
When exercised with the ``check-args`` switch, you should see something like this:
@@ -396,18 +396,18 @@ When exercised with the ``check-args`` switch, you should see something like thi
running under node.js
processing require resource /home/rcgill/dev/dtk/util/build/examples/require.js
{profiles:[{
- basePath:"/home/rcgill/dev/dtk/util/build/examples",
- packages:[
- {
- location:"../../../dojo",
- name:"dojo"
- },
- {
- location:"../../../dijit",
- name:"dijit"
- }
- ]
- }]}
+ basePath:"/home/rcgill/dev/dtk/util/build/examples",
+ packages:[
+ {
+ location:"../../../dojo",
+ name:"dojo"
+ },
+ {
+ location:"../../../dijit",
+ name:"dijit"
+ }
+ ]
+ }]}
As usual, if absent or relative, basePath is automatically computed. Just like ``dojoConfig``, you must provide the
complete filename.
@@ -426,13 +426,13 @@ As each package.json resource is processed, a profile object is manufactured wit
.. code-block :: text
{
- basePath:
- packages:[{
- name:packageJson.progName || packageJson.name,
- packageJson:{
- __selfFilename:<path at which the package.Json file resides>
- <remaining packageJson properties>
- }]
+ basePath:
+ packages:[{
+ name:packageJson.progName || packageJson.name,
+ packageJson:{
+ __selfFilename:<path at which the package.Json file resides>
+ <remaining packageJson properties>
+ }]
}
Notice that the package.json object is embedded in a package configuration object that the package.json object
@@ -526,11 +526,11 @@ might look like this:
.. js ::
var profile = {
- // point basePath to ~/dev
- basePath:"..",
+ // point basePath to ~/dev
+ basePath:"..",
- releaseDir:"./acme-deploy",
- trees:[
+ releaseDir:"./acme-deploy",
+ trees:[
["./dtk/dojo", "./lib/dojo"]
["./dtk/dijit", "./lib/dijit"]
["./acme/lib", "./lib/acme"]
@@ -557,23 +557,23 @@ configurations just like the loader. Here is the previous example expressed usin
.. js ::
var profile = {
- // point basePath to ~/dev
- basePath:"..",
+ // point basePath to ~/dev
+ basePath:"..",
- // point releaseDir to ~/dev/acme-deploy
- releaseDir:"./acme-deploy"
+ // point releaseDir to ~/dev/acme-deploy
+ releaseDir:"./acme-deploy"
- // now a typical loader packages configuration
- packages:[{
- name:"dojo",
- location:"./dtk/dojo"
- },{
- name:"dijit",
- location:"./dtk/dijit"
- },{
- name:"acme",
- location:"./acme/lib"
- }],
+ // now a typical loader packages configuration
+ packages:[{
+ name:"dojo",
+ location:"./dtk/dojo"
+ },{
+ name:"dijit",
+ location:"./dtk/dijit"
+ },{
+ name:"acme",
+ location:"./acme/lib"
+ }],
}
The destination location of each package may be given explicitly in the optional, per-package ``destLocation``
@@ -586,19 +586,19 @@ configuration in the resource ~/dev/acme/config.js like this:
.. js ::
var dojoConfig = {
- // loader configuration...
- packages:[{
- name:dojo,
- location:"./dtk/dojo"
- },{
- name:dijit,
- location:"./dtk/dijit"
- },{
- name:acme,
- location:"./acme/lib"
- }],
- deps:["main"]
- }
+ // loader configuration...
+ packages:[{
+ name:dojo,
+ location:"./dtk/dojo"
+ },{
+ name:dijit,
+ location:"./dtk/dijit"
+ },{
+ name:acme,
+ location:"./acme/lib"
+ }],
+ deps:["main"]
+ }
This configuration may be used to load the application, maybe something like this in the <head> element in
~/dev/acme/main.html.
@@ -607,18 +607,18 @@ This configuration may be used to load the application, maybe something like thi
<head>
<script src="./config.js"></script>
- <script src="../dtk/dojo/dojo.js"></script>
- <!-- other stuff...maybe -->
+ <script src="../dtk/dojo/dojo.js"></script>
+ <!-- other stuff...maybe -->
</head>
Given this, the profile at ~/dev/acme/app.profile.js could be rewritten like this:
.. js ::
var profile = {
- // point basePath to ~/dev
- basePath:"..",
- releaseDir:"./acme-deploy",
+ // point basePath to ~/dev
+ basePath:"..",
+ releaseDir:"./acme-deploy",
}
Finally, both the config.js and profile must be provided to the build system to get the desired effect
@@ -635,28 +635,28 @@ it does not define, you can put profile properties directly in the loader config
.. js ::
- var dojoConfig = {
- // loader configuration...
- packages:[{
- name:dojo,
- location:"./dtk/dojo"
- },{
- name:dijit,
- location:"./dtk/dijit"
- },{
- name:acme,
- location:"./acme/lib"
- }],
- deps:["main"],
-
- // now for some profile properties...
-
- // point basePath to ~/dev
- basePath:"..",
-
- // point releaseDir to ~/dev/acme-deploy
- releaseDir:"./acme-deploy"
- }
+ var dojoConfig = {
+ // loader configuration...
+ packages:[{
+ name:dojo,
+ location:"./dtk/dojo"
+ },{
+ name:dijit,
+ location:"./dtk/dijit"
+ },{
+ name:acme,
+ location:"./acme/lib"
+ }],
+ deps:["main"],
+
+ // now for some profile properties...
+
+ // point basePath to ~/dev
+ basePath:"..",
+
+ // point releaseDir to ~/dev/acme-deploy
+ releaseDir:"./acme-deploy"
+ }
This eliminates the need for the profile resource completely.
@@ -673,29 +673,29 @@ For example, the previous loader configuration could be rewritten as follows:
.. js ::
- var dojoConfig = {
- // loader configuration...
- packages:[{
- name:dojo,
- location:"./dtk/dojo"
- },{
- name:dijit,
- location:"./dtk/dijit"
- },{
- name:acme,
- location:"./acme/lib"
- }],
- deps:["main"],
-
- // now for some profile properties...
- build:{
- // point basePath to ~/dev
- basePath:"..",
-
- // point releaseDir to ~/dev/acme-deploy
- releaseDir:"./acme-deploy"
- }
- }
+ var dojoConfig = {
+ // loader configuration...
+ packages:[{
+ name:dojo,
+ location:"./dtk/dojo"
+ },{
+ name:dijit,
+ location:"./dtk/dijit"
+ },{
+ name:acme,
+ location:"./acme/lib"
+ }],
+ deps:["main"],
+
+ // now for some profile properties...
+ build:{
+ // point basePath to ~/dev
+ basePath:"..",
+
+ // point releaseDir to ~/dev/acme-deploy
+ releaseDir:"./acme-deploy"
+ }
+ }
And used to execute a build like this:
View
6 build/customBase.rst
@@ -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: [
]
},
View
22 build/expand-provide.rst
@@ -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" ]
+ ]
+ }
View
68 build/localizationExample.rst
@@ -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:
@@ -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``.
@@ -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
})
@@ -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>
@@ -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:
@@ -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
})
View
80 build/pre17/build.rst
@@ -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"
@@ -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
@@ -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.
View
2 build/profiles.rst
@@ -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'
]
View
46 build/transforms/depsDump.rst
@@ -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.
@@ -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).
View
26 build/transforms/hasFixup.rst
@@ -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
};
@@ -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
@@ -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
View
110 build/transforms/writeDojo.rst
@@ -35,17 +35,17 @@ The dojo loader is not an AMD module. The source version of the loader looks lik
})
//>>excludeStart("replaceLoaderConfig", kwArgs.replaceLoaderConfig);
(
- // userConfig
- (function(){
- // make sure we're looking at global dojoConfig etc.
- return this.dojoConfig || this.djConfig || this.require || {};
- })(),
+ // userConfig
+ (function(){
+ // make sure we're looking at global dojoConfig etc.
+ return this.dojoConfig || this.djConfig || this.require || {};
+ })(),
- // defaultConfig
- {
- // the default configuration as provided by the source version of dojo goes here
- // see dojo/dojo.js for details
- }
+ // defaultConfig
+ {
+ // the default configuration as provided by the source version of dojo goes here
+ // see dojo/dojo.js for details
+ }
);
//>>excludeEnd("replaceLoaderConfig")
@@ -63,10 +63,10 @@ need not be a JSON object and may contain functions. For example,
userConfig:{
hasCache:{
someFeature:function(global, doc, element){
- // the has feature test for someFeature
- }
- }
- }
+ // the has feature test for someFeature
+ }
+ }
+ }
};
If no value if given for ``userConfig``, then it defaults to the string ``"this.dojoConfig || this.djConfig ||
@@ -112,47 +112,47 @@ loader factory text can then be used to write the loader resource (usually dojo.
By default, the dojo/dojo module is a layer module that includes the single module dojo/main which results in loader
so-called "dojo base". At the time of writing, dojo/main includes the following modules:
- dojo/main
- dojo/_base/kernel
- dojo/has
- dojo/_base/config
- dojo/_base/sniff
- dojo/_base/lang
- dojo/_base/array
- dojo/ready
- dojo/domReady
- dojo/_base/declare
- dojo/_base/Deferred
- dojo/_base/json
- dojo/json
- dojo/_base/Color
- dojo/_base/browser
- dojo/_base/connect
- dojo/on
- dojo/topic
- dojo/Evented
- dojo/aspect
- dojo/_base/event
- dojo/dom-geometry
- dojo/_base/window
- dojo/dom
- dojo/dom-style
- dojo/mouse
- dojo/keys
- dojo/_base/unload
- dojo/_base/html
- dojo/dom-attr
- dojo/dom-prop
- dojo/dom-construct
- dojo/dom-class
- dojo/_base/NodeList
- dojo/query
- dojo/selector/_loader
- dojo/NodeList-dom
- dojo/_base/xhr
- dojo/io-query
- dojo/dom-form
- dojo/_base/fx
+ dojo/main
+ dojo/_base/kernel
+ dojo/has
+ dojo/_base/config
+ dojo/_base/sniff
+ dojo/_base/lang
+ dojo/_base/array
+ dojo/ready
+ dojo/domReady
+ dojo/_base/declare
+ dojo/_base/Deferred
+ dojo/_base/json
+ dojo/json
+ dojo/_base/Color
+ dojo/_base/browser
+ dojo/_base/connect
+ dojo/on
+ dojo/topic
+ dojo/Evented
+ dojo/aspect
+ dojo/_base/event
+ dojo/dom-geometry
+ dojo/_base/window
+ dojo/dom
+ dojo/dom-style
+ dojo/mouse
+ dojo/keys
+ dojo/_base/unload
+ dojo/_base/html
+ dojo/dom-attr
+ dojo/dom-prop
+ dojo/dom-construct
+ dojo/dom-class
+ dojo/_base/NodeList
+ dojo/query
+ dojo/selector/_loader
+ dojo/NodeList-dom
+ dojo/_base/xhr
+ dojo/io-query
+ dojo/dom-form
+ dojo/_base/fx
This default may be overridden by providing an explicit dojo/dojo layer configuration (see xxx writeAmd). Historically,
this technique has been termed building a "custom base". However, as of v1.7, specifying the contents of the dojo/dojo
View
6 dijit/Editor.rst
@@ -165,8 +165,8 @@ This example starts from scratch, thus removing some items from the toolbar (as
.. html ::
<div data-dojo-type="dijit.Editor" id="editor3"
- data-dojo-props="plugins:['bold','italic','|','createLink'],
- onChange:function(){console.log('editor3 onChange handler: ' + arguments[0])}">
+ data-dojo-props="plugins:['bold','italic','|','createLink'],
+ onChange:function(){console.log('editor3 onChange handler: ' + arguments[0])}">
<p>This instance is created with customized toolbar/ plugins</p>
</div>
@@ -279,7 +279,7 @@ It's used along with setting height="" parameter setting.
.. html ::
<div data-dojo-type="dijit.Editor" id="editor5"
- data-dojo-props="extraPlugins:['dijit._editor.plugins.AlwaysShowToolbar']">
+ data-dojo-props="extraPlugins:['dijit._editor.plugins.AlwaysShowToolbar']">
<p>
This editor is created from a div with AlwaysShowToolbar plugin (do not forget to set height="").
</p>
View
2 dojo/Evented.rst
@@ -23,7 +23,7 @@ The Evented class provides two methods, on(eventType, listener) and emit(eventTy
define(["dojo/Evented"], function(Evented){
var MyComponent = dojo.declare([Evented], {
startup: function(){
- // once we are done with startup, fire the "ready" event
+ // once we are done with startup, fire the "ready" event
this.emit("ready", {});
}
});
View
4 dojo/aspect.rst
@@ -85,8 +85,8 @@ The target is the object with the method. The methodName is the name of the meth
if(method == "PUT"){
// if the method is PUT, change it to a POST and put the method in the parameter string
args.url += "?x-method=PUT";
- // return the new args
- return ["POST", args];
+ // return the new args
+ return ["POST", args];
}
});
// this will execute the original our advising function and then dojo.xhr
View
2 dojo/back.rst
@@ -138,7 +138,7 @@ dojo.back needs either a local dojo.js or a local iframe_history.html
this.backForwardOutputDivId = backForwardOutputDivId;
this.changeUrl = bookmarkValue || false;
}
-
+
dojo.extend(ApplicationState, {
back: function(){ this.showStateData( "we got here going back" ); },
forward: function(){ this.showStateData( "we got here going forward" ); },
View
62 dojo/data/ItemFileReadStore.rst
@@ -301,16 +301,16 @@ The general case type map handles the situation where some processing on the val
{
"type0": {
- "type": constructorFunction(),
- "deserialize": function(value)
+ "type": constructorFunction(),
+ "deserialize": function(value)
},
"type1": {
- "type": constructorFunction(),
- "deserialize": function(value)
+ "type": constructorFunction(),
+ "deserialize": function(value)
},
"type2": {
- "type": constructorFunction(),
- "deserialize": function(value)
+ "type": constructorFunction(),
+ "deserialize": function(value)
},
...
"typeN": {
@@ -450,19 +450,19 @@ ItemFileReadStore uses the dojo.data.util.sorter helper functions to implement i
var store = new dojo.data.ItemFileReadStore({data: { identifier: "uniqueId",
items: [ {uniqueId: 1, status:"CLOSED"},
{uniqueId: 2, status:"OPEN"},
- {uniqueId: 3, status:"PENDING"},
- {uniqueId: 4, status:"BLOCKED"},
- {uniqueId: 5, status:"CLOSED"},
- {uniqueId: 6, status:"OPEN"},
- {uniqueId: 7, status:"PENDING"},
- {uniqueId: 8, status:"PENDING"},
- {uniqueId: 10, status:"BLOCKED"},
- {uniqueId: 12, status:"BLOCKED"},
- {uniqueId: 11, status:"OPEN"},
- {uniqueId: 9, status:"CLOSED"}
- ]
+ {uniqueId: 3, status:"PENDING"},
+ {uniqueId: 4, status:"BLOCKED"},
+ {uniqueId: 5, status:"CLOSED"},
+ {uniqueId: 6, status:"OPEN"},
+ {uniqueId: 7, status:"PENDING"},
+ {uniqueId: 8, status:"PENDING"},
+ {uniqueId: 10, status:"BLOCKED"},
+ {uniqueId: 12, status:"BLOCKED"},
+ {uniqueId: 11, status:"OPEN"},
+ {uniqueId: 9, status:"CLOSED"}
+ ]
}});
-
+
// Define the comparator function for status.
store.comparatorMap = {};
store.comparatorMap["status"] = function(a, b){
@@ -478,7 +478,7 @@ ItemFileReadStore uses the dojo.data.util.sorter helper functions to implement i
}
return ret;
};
-
+
var sortAttributes = [{attribute: "status", descending: true}, { attribute: "uniqueId", descending: true}];
function completed(items, findResult){
for(var i = 0; i < items.length; i++){
@@ -856,17 +856,17 @@ Demonstrating custom sorting
items: [
{uniqueId: 1, status:"CLOSED"},
{uniqueId: 2, status:"OPEN"},
- {uniqueId: 3, status:"PENDING"},
- {uniqueId: 4, status:"BLOCKED"},
- {uniqueId: 5, status:"CLOSED"},
- {uniqueId: 6, status:"OPEN"},
- {uniqueId: 7, status:"PENDING"},
- {uniqueId: 8, status:"PENDING"},
- {uniqueId: 10, status:"BLOCKED"},
- {uniqueId: 12, status:"BLOCKED"},
- {uniqueId: 11, status:"OPEN"},
- {uniqueId: 9, status:"CLOSED"}
- ]
+ {uniqueId: 3, status:"PENDING"},
+ {uniqueId: 4, status:"BLOCKED"},
+ {uniqueId: 5, status:"CLOSED"},
+ {uniqueId: 6, status:"OPEN"},
+ {uniqueId: 7, status:"PENDING"},
+ {uniqueId: 8, status:"PENDING"},
+ {uniqueId: 10, status:"BLOCKED"},
+ {uniqueId: 12, status:"BLOCKED"},
+ {uniqueId: 11, status:"OPEN"},
+ {uniqueId: 9, status:"CLOSED"}
+ ]
};
// This function performs some basic dojo initialization. In this case it connects the button
@@ -889,7 +889,7 @@ Demonstrating custom sorting
}
return ret;
};
-
+
// Function to perform a fetch on the datastore when a button is clicked
function getItems(){
View
2 dojo/date/locale/format.rst
@@ -78,7 +78,7 @@ dojo.date.locale.format(dateObject, options)
Pattern Meaning Thu Mar 26 2009 13:37:43.777 (EST) Notes
====================== ==================== ====================================== ======
G era AD
- " " Anno Domini GGGG
+ " " Anno Domini GGGG
y year 2009 yyy
qQ quarter 1
M month March MMMM
View
92 dojo/fx/easing.rst
@@ -18,7 +18,7 @@ Instead of having to write the easing function yourself, dojo provides a collect
Easing Functions
================
-All functions follow a simple naming convention of "ease type" + "when". If the name of the function ends in Out, the easing described appears towards the end of the animation. "In" means during the beginning, and InOut means both ranges of the Animation will applied, both beginning and end.
+All functions follow a simple naming convention of "ease type" + "when". If the name of the function ends in Out, the easing described appears towards the end of the animation. "In" means during the beginning, and InOut means both ranges of the Animation will applied, both beginning and end.
+---------------------------------------+------------------------------------------------------------------------------------------------------+
@@ -148,58 +148,58 @@ Example: Playing with Easing
dojo.ready(function(){
// Function linked to the button to trigger the fade.
function moveIt(){
- // Set initial state and get the easing from the dropdown
+ // Set initial state and get the easing from the dropdown
dojo.style("moveableNode", "marginLeft", "0px");
- var easing = dijit.byId("easingSelector").attr("value");
- var ef = dojo.fx.easing[easing];
- if(ef){
- var moveArgs = {
- node: "moveableNode",
- properties: { marginLeft: {start: 0, end: 400, unit: "px"} },
- easing: ef,
- duration: 5000
- };
- dojo.animateProperty(moveArgs).play();
- }
+ var easing = dijit.byId("easingSelector").attr("value");
+ var ef = dojo.fx.easing[easing];
+ if(ef){
+ var moveArgs = {
+ node: "moveableNode",
+ properties: { marginLeft: {start: 0, end: 400, unit: "px"} },
+ easing: ef,
+ duration: 5000
+ };
+ dojo.animateProperty(moveArgs).play();
+ }
}
dojo.connect(dijit.byId("moveButton"), "onClick", moveIt);
});
.. html ::
- <select data-dojo-type="dijit.form.ComboBox" id="easingSelector">
- <option>linear</option>
- <option>quadIn</option>
- <option>quadOut</option>
- <option>quadInOut</option>
- <option>cubicIn</option>
- <option>cubicOut</option>
- <option>cubicInOut</option>
- <option>quartIn</option>
- <option>quartOut</option>
- <option>quartInOut</option>
- <option>quintIn</option>
- <option>quintOut</option>
- <option>quintInOut</option>
- <option>sineIn</option>
- <option>sineOut</option>
- <option>sineInOut</option>
- <option>expoIn</option>
- <option>expoOut</option>
- <option>expoInOut</option>
- <option>circIn</option>
- <option>circOut</option>
- <option>circInOut</option>
- <option>backIn</option>
- <option>backOut</option>
- <option>backInOut</option>
- <option>elasticIn</option>
- <option>elasticOut</option>
- <option>elasticInOut</option>
- <option>bounceIn</option>
- <option>bounceOut</option>
- <option>bounceInOut</option>
- </select>
+ <select data-dojo-type="dijit.form.ComboBox" id="easingSelector">
+ <option>linear</option>
+ <option>quadIn</option>
+ <option>quadOut</option>
+ <option>quadInOut</option>
+ <option>cubicIn</option>
+ <option>cubicOut</option>
+ <option>cubicInOut</option>
+ <option>quartIn</option>
+ <option>quartOut</option>
+ <option>quartInOut</option>
+ <option>quintIn</option>
+ <option>quintOut</option>
+ <option>quintInOut</option>
+ <option>sineIn</option>
+ <option>sineOut</option>
+ <option>sineInOut</option>
+ <option>expoIn</option>
+ <option>expoOut</option>
+ <option>expoInOut</option>
+ <option>circIn</option>
+ <option>circOut</option>
+ <option>circInOut</option>
+ <option>backIn</option>
+ <option>backOut</option>
+ <option>backInOut</option>
+ <option>elasticIn</option>
+ <option>elasticOut</option>
+ <option>elasticInOut</option>
+ <option>bounceIn</option>
+ <option>bounceOut</option>
+ <option>bounceInOut</option>
+ </select>
<button data-dojo-type="dijit.form.Button" id="moveButton">Move the div!</button>
<div id="moveableNode" style="width: 100px; height: 100px; background-color: red; margin-left: 0px;"></div>
View
12 dojo/fx/wipeOut.rst
@@ -40,8 +40,8 @@ Example 1: Wipe out a dom node
dojo.ready(function(){
// Function linked to the button to trigger the wipe.
function wipeIt(){
- dojo.style("basicWipeNode", "height", "");
- dojo.style("basicWipeNode", "display", "block");
+ dojo.style("basicWipeNode", "height", "");
+ dojo.style("basicWipeNode", "display", "block");
var wipeArgs = {
node: "basicWipeNode"
};
@@ -70,8 +70,8 @@ Example 2: Wipe out a dom node with a custom duration
dojo.ready(function(){
// Function linked to the button to trigger the wipe.
function wipeIt(){
- dojo.style("basicWipeNode1", "height", "");
- dojo.style("basicWipeNode1", "display", "block");
+ dojo.style("basicWipeNode1", "height", "");
+ dojo.style("basicWipeNode1", "display", "block");
var wipeArgs = {
node: "basicWipeNode1",
duration: 5000
@@ -103,8 +103,8 @@ Example 3: Wipe out a dom node with an easing function
dojo.ready(function(){
// Function linked to the button to trigger the wipe.
function wipeIt(){
- dojo.style("basicWipeNode2", "height", "");
- dojo.style("basicWipeNode2", "display", "block");
+ dojo.style("basicWipeNode2", "height", "");
+ dojo.style("basicWipeNode2", "display", "block");
var wipeArgs = {
node: "basicWipeNode2",
duration: 5000,
View
14 dojo/gears.rst
@@ -14,13 +14,13 @@ Dojo 1.7 (AMD)
.. js ::
- require(["dojo/gears", "dojo/ready"], function(gears, ready){
- ready(function(){
- if(gears.available){
- // safe to assume google.gears.factory is a gears factory
- }
- });
- });
+ require(["dojo/gears", "dojo/ready"], function(gears, ready){
+ ready(function(){
+ if(gears.available){
+ // safe to assume google.gears.factory is a gears factory
+ }
+ });
+ });
Dojo < 1.7
----------
View
12 dojo/hash.rst
@@ -46,7 +46,7 @@ To use dojo.hash to listen for hash changes:
require(["dojo/_base/connect", "dojo/hash"], function(connect, hash){
connect.subscribe("/dojo/hashchange", context, callback);
});
-
+
// Dojo < 1.7
dojo.subscribe("/dojo/hashchange", context, callback);
..
@@ -69,7 +69,7 @@ Setter
require(["dojo/hash"], function(hash){
hash("someHashValue");
});
-
+
// Dojo < 1.7
dojo.hash("someHashValue");
..
@@ -83,7 +83,7 @@ Setter
require(["dojo/hash"], function(hash){
hash("someHashValue", true);
});
-
+
// Dojo < 1.7
dojo.hash("someHashValue", true);
..
@@ -98,7 +98,7 @@ Getter
require(["dojo/hash"], function(hash){
var hashValue = hash();
});
-
+
// Dojo < 1.7
var hashValue = dojo.hash();
..
@@ -115,7 +115,7 @@ Examples
require(["dojo/_base/connect", "dojo/hash"], function(connect, hash){
connect.subscribe("/dojo/hashchange", context, callback);
});
-
+
// Dojo < 1.7
dojo.subscribe("/dojo/hashchange", context, callback);
..
@@ -132,7 +132,7 @@ Examples
}
hash(ioQuery.objectToQuery(obj));
});
-
+
// Dojo < 1.7
function(){
var obj = {
View
114 dojo/html.rst
@@ -28,13 +28,13 @@ Examples
// Dojo 1.7 (AMD)
<script type="text/javascript">
- require(["dojo/html", "dojo/ready"], function(html, ready){
- ready(function(){
- // the first argument is a node reference
- console.log("loaded");
- html.set(dojo.byId("mycontent"), "loaded!");
- });
- });
+ require(["dojo/html", "dojo/ready"], function(html, ready){
+ ready(function(){
+ // the first argument is a node reference
+ console.log("loaded");
+ html.set(dojo.byId("mycontent"), "loaded!");
+ });
+ });
</script>
<div id="mycontent">
@@ -47,12 +47,12 @@ Examples
// Dojo < 1.7
<script type="text/javascript">
- dojo.require("dojo.html");
- dojo.addOnLoad(function(){
- // the first argument is a node reference
- console.log("loaded");
- dojo.html.set(dojo.byId("mycontent"), "loaded!");
- });
+ dojo.require("dojo.html");
+ dojo.addOnLoad(function(){
+ // the first argument is a node reference
+ console.log("loaded");
+ dojo.html.set(dojo.byId("mycontent"), "loaded!");
+ });
</script>
<div id="mycontent">
@@ -72,29 +72,29 @@ Of course, if that was all you needed to do, you'd be better of just setting inn
<script type="text/javascript">
- require(["dojo/html", "dojo/dom", "dojo/_base/connect", "dijit.form.NumberTextBox"], function(html, dom, connect, numberTextBox){
- var sethandle = connect.connect(dom.byId("setbtn"), "onclick", function(){
-
- html.set(dom.byId("mytable"), '<tr>'
- +'<td><label>How much?</label></td>'
- +'<td><input type="text" data-dojo-type="dijit.form.NumberTextBox" value="0"'
- + ' constraints="{min:0,max:20,places:0}"'
- + ' promptMessage= "Enter a value between 0 and +20"'
- + ' required= "true" invalidMessage= "Wrong!" />'
- +'</td>'
- +'</tr>', {
- parseContent: true,
- onBegin: function(){
- this.inherited("onBegin", arguments);
- }
- });
- connect.disconnect(sethandle);
- sethandle = null;
- dom.byId("setbtn").innerHTML = "Done";
- });
- });
+ require(["dojo/html", "dojo/dom", "dojo/_base/connect", "dijit.form.NumberTextBox"], function(html, dom, connect, numberTextBox){
+ var sethandle = connect.connect(dom.byId("setbtn"), "onclick", function(){
+
+ html.set(dom.byId("mytable"), '<tr>'
+ +'<td><label>How much?</label></td>'
+ +'<td><input type="text" data-dojo-type="dijit.form.NumberTextBox" value="0"'
+ + ' constraints="{min:0,max:20,places:0}"'
+ + ' promptMessage= "Enter a value between 0 and +20"'
+ + ' required= "true" invalidMessage= "Wrong!" />'
+ +'</td>'
+ +'</tr>', {
+ parseContent: true,
+ onBegin: function(){
+ this.inherited("onBegin", arguments);
+ }
+ });
+ connect.disconnect(sethandle);
+ sethandle = null;
+ dom.byId("setbtn").innerHTML = "Done";
+ });
+ });
</script>
-
+
.. html ::
@@ -106,28 +106,28 @@ Of course, if that was all you needed to do, you'd be better of just setting inn
<script type="text/javascript">
- dojo.require("dojo.html");
-
- var sethandle = dojo.connect(dojo.byId("setbtn"), "onclick", function(){
-
- dojo.html.set(dojo.byId("mytable"), '<tr>'
- +'<td><label>How much?</label></td>'
- +'<td><input type="text" data-dojo-type="dijit.form.NumberTextBox" value="0"'
- + ' constraints="{min:0, max:20, places:0}"'
- + ' promptMessage= "Enter a value between 0 and +20"'
- + ' required= "true" invalidMessage= "Wrong!" />'
- +'</td>'
- +'</tr>', {
- parseContent: true,
- onBegin: function(){
- dojo.require('dijit.form.NumberTextBox');
- this.inherited("onBegin", arguments);
- }
- });
- dojo.disconnect(sethandle);
- sethandle = null;
- dojo.byId("setbtn").innerHTML = "Done";
- });
+ dojo.require("dojo.html");
+
+ var sethandle = dojo.connect(dojo.byId("setbtn"), "onclick", function(){
+
+ dojo.html.set(dojo.byId("mytable"), '<tr>'
+ +'<td><label>How much?</label></td>'
+ +'<td><input type="text" data-dojo-type="dijit.form.NumberTextBox" value="0"'
+ + ' constraints="{min:0, max:20, places:0}"'
+ + ' promptMessage= "Enter a value between 0 and +20"'
+ + ' required= "true" invalidMessage= "Wrong!" />'
+ +'</td>'
+ +'</tr>', {
+ parseContent: true,
+ onBegin: function(){
+ dojo.require('dijit.form.NumberTextBox');
+ this.inherited("onBegin", arguments);
+ }
+ });
+ dojo.disconnect(sethandle);
+ sethandle = null;
+ dojo.byId("setbtn").innerHTML = "Done";
+ });
</script>
We're getting a lot done here. First, note that we're setting content on a table. Some browsers get very unhappy when you try and set ``innerHTML`` on tables (and other elements) - ``dojo.html.set`` handles all that for you. Also, note that the content includes a widget, and we've added a 3rd parameter to our ``set()`` call - an object with some configuration for this set operation. ``parseContent: true`` tells ``set`` that when the content has been slopped in there, it should run the parser over the element.
View
130 dojo/iframe_history.html
@@ -1,79 +1,79 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
- <title></title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
- <script type="text/javascript">
- // <!--
- var noInit = false;
-
- function defineParams(sparams){
- if(sparams){
- var ss = (sparams.indexOf("&amp;") >= 0) ? "&amp;" : "&";
- sparams = sparams.split(ss);
- for(var x=0; x<sparams.length; x++){
- var tp = sparams[x].split("=");
- if(typeof window[tp[0]] != "undefined"){
- window[tp[0]] = ((tp[1]=="true")||(tp[1]=="false")) ? eval(tp[1]) : tp[1];
- }
- }
- }
- }
-
- function init(){
- // parse the query string if there is one to try to get params that
- // we can act on. Also allow params to be in a fragment identifier.
- var query = null;
- var frag = null;
- var url = document.location.href;
- var hashIndex = url.indexOf("#");
-
- // Extract fragment identifier
- if(hashIndex != -1){
- frag = url.substring(hashIndex + 1, url.length);
- url = url.substring(0, hashIndex);
- }
+ <title></title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
+ <script type="text/javascript">
+ // <!--
+ var noInit = false;
- // Extract querystring
- var parts = url.split("?");
- if(parts.length == 2){
- query = parts[1];
- }
+ function defineParams(sparams){
+ if(sparams){
+ var ss = (sparams.indexOf("&amp;") >= 0) ? "&amp;" : "&";
+ sparams = sparams.split(ss);
+ for(var x=0; x<sparams.length; x++){
+ var tp = sparams[x].split("=");
+ if(typeof window[tp[0]] != "undefined"){
+ window[tp[0]] = ((tp[1]=="true")||(tp[1]=="false")) ? eval(tp[1]) : tp[1];
+ }
+ }
+ }
+ }
- defineParams(query);
- defineParams(frag);
+ function init(){
+ // parse the query string if there is one to try to get params that
+ // we can act on. Also allow params to be in a fragment identifier.
+ var query = null;
+ var frag = null;
+ var url = document.location.href;
+ var hashIndex = url.indexOf("#");
- if(noInit){ return; }
- var hasParentDojo = false;
- try{
- hasParentDojo = window.parent != window && window.parent["dojo"];
- }catch(e){
- alert("Initializing iframe_history.html failed. If you are using a cross-domain Dojo build,"
- + " please save iframe_history.html to your domain and set djConfig.dojoIframeHistoryUrl"
- + " to the path on your domain to iframe_history.html");
- throw e;
- }
+ // Extract fragment identifier
+ if(hashIndex != -1){
+ frag = url.substring(hashIndex + 1, url.length);
+ url = url.substring(0, hashIndex);
+ }
- if(hasParentDojo){
- // Set the page title so IE history shows up with a somewhat correct name.
- document.title = window.parent.document.title;
-
- // Notify parent that we are loaded.
- var pdj = window.parent.dojo;
- if(pdj["back"]){
- pdj.back._iframeLoaded(null, window.location);
- }
- }
+ // Extract querystring
+ var parts = url.split("?");
+ if(parts.length == 2){
+ query = parts[1];
+ }
- }
- // -->
- </script>
+ defineParams(query);
+ defineParams(frag);
+
+ if(noInit){ return; }
+ var hasParentDojo = false;
+ try{
+ hasParentDojo = window.parent != window && window.parent["dojo"];
+ }catch(e){
+ alert("Initializing iframe_history.html failed. If you are using a cross-domain Dojo build,"
+ + " please save iframe_history.html to your domain and set djConfig.dojoIframeHistoryUrl"
+ + " to the path on your domain to iframe_history.html");
+ throw e;
+ }
+
+ if(hasParentDojo){
+ // Set the page title so IE history shows up with a somewhat correct name.
+ document.title = window.parent.document.title;
+
+ // Notify parent that we are loaded.
+ var pdj = window.parent.dojo;
+ if(pdj["back"]){
+ pdj.back._iframeLoaded(null, window.location);
+ }
+ }
+
+ }
+ // -->
+ </script>
</head>
<body onload="try{ init(); }catch(e){ alert(e); }">
- <h4>The Dojo Toolkit -- iframe_history.html</h4>
+ <h4>The Dojo Toolkit -- iframe_history.html</h4>
- <p>This file is used in Dojo's back/fwd button management.</p>
+ <p>This file is used in Dojo's back/fwd button management.</p>
</body>
</html>
View
18 dojo/parser.rst
@@ -80,8 +80,8 @@ To run the parser when your page loads, add a data-dojo-config="parseOnLoad: tru
.. html ::
- <script type="text/javascript" src="dojo/dojo.js"
- data-dojo-config="parseOnLoad: true"></script>
+ <script type="text/javascript" src="dojo/dojo.js"
+ data-dojo-config="parseOnLoad: true"></script>
@@ -422,13 +422,13 @@ Load some HTML content from a :ref:`remote URL <quickstart/ajax>`, and convert t
// Dojo 1.7 (AMD)
require(["dojo/_base/xhr", "dojo/parser", "dojo/dom"], function(xhr, parser, dom){
- xhr.get({
- url: "widgets.html",
- load: function(data){
- dom.byId("container").innerHTML = data;
- parser.parse("container");
- }
- });
+ xhr.get({
+ url: "widgets.html",
+ load: function(data){
+ dom.byId("container").innerHTML = data;
+ parser.parse("container");
+ }
+ });
});
.. js ::
View
60 dojo/position.rst
@@ -117,45 +117,45 @@ To see the effect of dojo.position's includeScroll boolean parameter, scroll the
function compareMethods(){
var testNode = dojo.byId('testNode'),
- contentBox = dojo.contentBox(testNode),
- marginBox = dojo.marginBox(testNode),
- position_win = dojo.position(testNode, true),
- position_view = dojo.position(testNode, false),
- coords_win = dojo.coords(testNode, true),
- coords_view = dojo.coords(testNode, false);
- for(var attr in {x:0, y:0, w:0, h:0, l:0, t:0}){
- for(var fcn in {position_win:0, position_view:0, marginBox:0, contentBox:0, coords_win:0, coords_view:0}){
- var val = eval(fcn)[attr];
- dojo.byId(fcn+"_"+attr).innerHTML = !isNaN(val)?val:"--";
- }
- }
+ contentBox = dojo.contentBox(testNode),
+ marginBox = dojo.marginBox(testNode),
+ position_win = dojo.position(testNode, true),
+ position_view = dojo.position(testNode, false),
+ coords_win = dojo.coords(testNode, true),
+ coords_view = dojo.coords(testNode, false);
+ for(var attr in {x:0, y:0, w:0, h:0, l:0, t:0}){
+ for(var fcn in {position_win:0, position_view:0, marginBox:0, contentBox:0, coords_win:0, coords_view:0}){
+ var val = eval(fcn)[attr];
+ dojo.byId(fcn+"_"+attr).innerHTML = !isNaN(val)?val:"--";
+ }
+ }
}
dojo.ready(function(){
- compareMethods();
+ compareMethods();
});
.. html ::
<fieldset style="display:inline;border:15px solid gray;border-width:15px 0 0 15px;margin:0px;padding:0px;font:14px monospace;background-color:white;outline:1px dotted black;">
- <fieldset style="display:inline;border:0px;border:0px;padding:0px;width:270px;height:165px;overflow:hidden;position:relative;left:-15px;top:-15px;">
- <div id="testNode" style="display:inline;margin:25px;border:20px solid gray;padding:30px;float:left;position:relative;left:15px;top:15px;" onclick="compareMethods()">
- <center style="display:block;margin:0px;padding:0px;border:0px;width:120px;height:15px;background-color:gray;color:white;overflow:hidden;">120x15 content</center>
- <nobr style="position:absolute;left:2px;top:2px;color:black;">padding 30px</nobr>
- <nobr style="position:absolute;left:-18px;top:-18px;color:white;">border 20px</nobr>
- <nobr style="position:absolute;left:-43px;top:-43px;color:black;">margin 25px</nobr>
- <nobr style="position:absolute;left:-63px;top:-63px;color:white;">left/top 15px</nobr>
- </div>
- </fieldset>
+ <fieldset style="display:inline;border:0px;border:0px;padding:0px;width:270px;height:165px;overflow:hidden;position:relative;left:-15px;top:-15px;">
+ <div id="testNode" style="display:inline;margin:25px;border:20px solid gray;padding:30px;float:left;position:relative;left:15px;top:15px;" onclick="compareMethods()">
+ <center style="display:block;margin:0px;padding:0px;border:0px;width:120px;height:15px;background-color:gray;color:white;overflow:hidden;">120x15 content</center>
+ <nobr style="position:absolute;left:2px;top:2px;color:black;">padding 30px</nobr>
+ <nobr style="position:absolute;left:-18px;top:-18px;color:white;">border 20px</nobr>
+ <nobr style="position:absolute;left:-43px;top:-43px;color:black;">margin 25px</nobr>
+ <nobr style="position:absolute;left:-63px;top:-63px;color:white;">left/top 15px</nobr>
+ </div>
+ </fieldset>
</fieldset>
<table rules=all cellpadding=2 cellspacing=2 border=2 style="font:16px monospace;text-align:center;">
- <tr><td></td><td colspan="6">attribute</td></tr>
- <tr><td>function</td><td>x</td><td>y</td><td>w</td><td>h</td><td>l</td><td>t</td></tr>
- <tr><td style="text-align:left;">dojo.position(node,true)</td><td id="position_win_x"></td><td id="position_win_y"></td><td id="position_win_w"></td><td id="position_win_h"></td><td id="position_win_l"></td><td id="position_win_t"></td></tr>
- <tr><td style="text-align:left;">dojo.position(node,false)</td><td id="position_view_x"></td><td id="position_view_y"></td><td id="position_view_w"></td><td id="position_view_h"></td><td id="position_view_l"></td><td id="position_view_t"></td></tr>
- <tr><td style="text-align:left;">dojo.marginBox(node)</td><td id="marginBox_x"></td><td id="marginBox_y"></td><td id="marginBox_w"></td><td id="marginBox_h"></td><td id="marginBox_l"></td><td id="marginBox_t"></td></tr>
- <tr><td style="text-align:left;">dojo.contentBox(node)</td><td id="contentBox_x"></td><td id="contentBox_y"></td><td id="contentBox_w"></td><td id="contentBox_h"></td><td id="contentBox_l"></td><td id="contentBox_t"></td></tr>
- <tr style="color:gray;"><td style="text-align:left;">dojo.coords(node,true)</td><td id="coords_win_x"></td><td id="coords_win_y"></td><td id="coords_win_w"></td><td id="coords_win_h"></td><td id="coords_win_l"></td><td id="coords_win_t"></td></tr>
- <tr style="color:gray;"><td style="text-align:left;">dojo.coords(node,false)</td><td id="coords_view_x"></td><td id="coords_view_y"></td><td id="coords_view_w"></td><td id="coords_view_h"></td><td id="coords_view_l"></td><td id="coords_view_t"></td></tr>
+ <tr><td></td><td colspan="6">attribute</td></tr>
+ <tr><td>function</td><td>x</td><td>y</td><td>w</td><td>h</td><td>l</td><td>t</td></tr>
+ <tr><td style="text-align:left;">dojo.position(node,true)</td><td id="position_win_x"></td><td id="position_win_y"></td><td id="position_win_w"></td><td id="position_win_h"></td><td id="position_win_l"></td><td id="position_win_t"></td></tr>
+ <tr><td style="text-align:left;">dojo.position(node,false)</td><td id="position_view_x"></td><td id="position_view_y"></td><td id="position_view_w"></td><td id="position_view_h"></td><td id="position_view_l"></td><td id="position_view_t"></td></tr>
+ <tr><td style="text-align:left;">dojo.marginBox(node)</td><td id="marginBox_x"></td><td id="marginBox_y"></td><td id="marginBox_w"></td><td id="marginBox_h"></td><td id="marginBox_l"></td><td id="marginBox_t"></td></tr>
+ <tr><td style="text-align:left;">dojo.contentBox(node)</td><td id="contentBox_x"></td><td id="contentBox_y"></td><td id="contentBox_w"></td><td id="contentBox_h"></td><td id="contentBox_l"></td><td id="contentBox_t"></td></tr>
+ <tr style="color:gray;"><td style="text-align:left;">dojo.coords(node,true)</td><td id="coords_win_x"></td><td id="coords_win_y"></td><td id="coords_win_w"></td><td id="coords_win_h"></td><td id="coords_win_l"></td><td id="coords_win_t"></td></tr>
+ <tr style="color:gray;"><td style="text-align:left;">dojo.coords(node,false)</td><td id="coords_view_x"></td><td id="coords_view_y"></td><td id="coords_view_w"></td><td id="coords_view_h"></td><td id="coords_view_l"></td><td id="coords_view_t"></td></tr>
</table>