summaryrefslogtreecommitdiff
path: root/js/dojo-1.6/dojox/mobile
diff options
context:
space:
mode:
authorTristan Zur <tzur@web.web.ccwn.org>2014-03-27 22:27:47 +0100
committerTristan Zur <tzur@web.web.ccwn.org>2014-03-27 22:27:47 +0100
commitb62676ca5d3d6f6ba3f019ea3f99722e165a98d8 (patch)
tree86722cb80f07d4569f90088eeaea2fc2f6e2ef94 /js/dojo-1.6/dojox/mobile
Initial commit of intern.ccwn.org contentsHEADmaster
Diffstat (limited to 'js/dojo-1.6/dojox/mobile')
-rw-r--r--js/dojo-1.6/dojox/mobile/FixedSplitter.js108
-rw-r--r--js/dojo-1.6/dojox/mobile/FixedSplitter.xd.js113
-rw-r--r--js/dojo-1.6/dojox/mobile/FlippableView.js143
-rw-r--r--js/dojo-1.6/dojox/mobile/FlippableView.xd.js150
-rw-r--r--js/dojo-1.6/dojox/mobile/IconContainer.js318
-rw-r--r--js/dojo-1.6/dojox/mobile/IconContainer.xd.js323
-rw-r--r--js/dojo-1.6/dojox/mobile/README55
-rw-r--r--js/dojo-1.6/dojox/mobile/ScrollableView.js129
-rw-r--r--js/dojo-1.6/dojox/mobile/ScrollableView.xd.js136
-rw-r--r--js/dojo-1.6/dojox/mobile/TabBar.js216
-rw-r--r--js/dojo-1.6/dojox/mobile/TabBar.xd.js221
-rw-r--r--js/dojo-1.6/dojox/mobile/TabContainer.js162
-rw-r--r--js/dojo-1.6/dojox/mobile/TabContainer.xd.js167
-rw-r--r--js/dojo-1.6/dojox/mobile/_ScrollableMixin.js62
-rw-r--r--js/dojo-1.6/dojox/mobile/_ScrollableMixin.xd.js68
-rw-r--r--js/dojo-1.6/dojox/mobile/_base.js1215
-rw-r--r--js/dojo-1.6/dojox/mobile/_base.xd.js1220
-rw-r--r--js/dojo-1.6/dojox/mobile/app.js14
-rw-r--r--js/dojo-1.6/dojox/mobile/app.js.uncompressed.js9278
-rw-r--r--js/dojo-1.6/dojox/mobile/app.xd.js14
-rw-r--r--js/dojo-1.6/dojox/mobile/app.xd.js.uncompressed.js9318
-rw-r--r--js/dojo-1.6/dojox/mobile/app/AlertDialog.js193
-rw-r--r--js/dojo-1.6/dojox/mobile/app/AlertDialog.xd.js198
-rw-r--r--js/dojo-1.6/dojox/mobile/app/ImageThumbView.js400
-rw-r--r--js/dojo-1.6/dojox/mobile/app/ImageThumbView.xd.js406
-rw-r--r--js/dojo-1.6/dojox/mobile/app/ImageView.js727
-rw-r--r--js/dojo-1.6/dojox/mobile/app/ImageView.xd.js733
-rw-r--r--js/dojo-1.6/dojox/mobile/app/List.js656
-rw-r--r--js/dojo-1.6/dojox/mobile/app/List.xd.js662
-rw-r--r--js/dojo-1.6/dojox/mobile/app/ListSelector.js229
-rw-r--r--js/dojo-1.6/dojox/mobile/app/ListSelector.xd.js235
-rw-r--r--js/dojo-1.6/dojox/mobile/app/SceneAssistant.js67
-rw-r--r--js/dojo-1.6/dojox/mobile/app/SceneAssistant.xd.js71
-rw-r--r--js/dojo-1.6/dojox/mobile/app/SceneController.js181
-rw-r--r--js/dojo-1.6/dojox/mobile/app/SceneController.xd.js186
-rw-r--r--js/dojo-1.6/dojox/mobile/app/StageController.js143
-rw-r--r--js/dojo-1.6/dojox/mobile/app/StageController.xd.js148
-rw-r--r--js/dojo-1.6/dojox/mobile/app/TextBox.js330
-rw-r--r--js/dojo-1.6/dojox/mobile/app/TextBox.xd.js336
-rw-r--r--js/dojo-1.6/dojox/mobile/app/_FormWidget.js298
-rw-r--r--js/dojo-1.6/dojox/mobile/app/_FormWidget.xd.js304
-rw-r--r--js/dojo-1.6/dojox/mobile/app/_Widget.js41
-rw-r--r--js/dojo-1.6/dojox/mobile/app/_Widget.xd.js46
-rw-r--r--js/dojo-1.6/dojox/mobile/app/_base.js248
-rw-r--r--js/dojo-1.6/dojox/mobile/app/_base.xd.js267
-rw-r--r--js/dojo-1.6/dojox/mobile/app/_event.js131
-rw-r--r--js/dojo-1.6/dojox/mobile/app/_event.xd.js135
-rw-r--r--js/dojo-1.6/dojox/mobile/app/compat.js14
-rw-r--r--js/dojo-1.6/dojox/mobile/app/compat.js.uncompressed.js1700
-rw-r--r--js/dojo-1.6/dojox/mobile/app/compat.xd.js14
-rw-r--r--js/dojo-1.6/dojox/mobile/app/compat.xd.js.uncompressed.js1710
-rw-r--r--js/dojo-1.6/dojox/mobile/build/build.bat47
-rw-r--r--js/dojo-1.6/dojox/mobile/build/build.sh50
-rw-r--r--js/dojo-1.6/dojox/mobile/compat.js14
-rw-r--r--js/dojo-1.6/dojox/mobile/compat.js.uncompressed.js1586
-rw-r--r--js/dojo-1.6/dojox/mobile/compat.xd.js14
-rw-r--r--js/dojo-1.6/dojox/mobile/compat.xd.js.uncompressed.js1595
-rw-r--r--js/dojo-1.6/dojox/mobile/parser.js91
-rw-r--r--js/dojo-1.6/dojox/mobile/parser.xd.js96
-rw-r--r--js/dojo-1.6/dojox/mobile/scrollable.js806
-rw-r--r--js/dojo-1.6/dojox/mobile/scrollable.xd.js810
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/FixedSplitter.css22
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/android/android-app-compat.css24
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/android/android-app.css349
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/android/android-compat.css290
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/android/android.css840
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/android/compat/arrow-button-bg.pngbin0 -> 182 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/android/compat/arrow-button-head.pngbin0 -> 566 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/android/compat/blue-button-bg.pngbin0 -> 199 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/android/compat/blue-button-sel-bg.pngbin0 -> 182 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/android/compat/gray-arrow.pngbin0 -> 920 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/android/compat/heading-bg.pngbin0 -> 181 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/android/compat/icon-content-heading-bg.pngbin0 -> 193 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/android/compat/switch-blue-bg.pngbin0 -> 199 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/android/compat/switch-gray-bg.pngbin0 -> 183 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/android/compat/switch-green-bg.pngbin0 -> 161 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/android/compat/switch-knob-bg.pngbin0 -> 174 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/android/compat/tab-button-bg.pngbin0 -> 277 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/android/compat/tab-orange-button-bg.pngbin0 -> 197 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/android/compat/tab-sel-button-bg.pngbin0 -> 286 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/android/images/thumb-overlay-large.pngbin0 -> 3697 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/android/images/thumb-overlay-small.pngbin0 -> 1549 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/android/images/thumb-overlay.pngbin0 -> 2010 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/buttons-compat.css30
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/buttons.css191
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/compat/check-off-button.pngbin0 -> 1081 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/compat/check-on-button.pngbin0 -> 1148 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/compat/small-blue-button-bg.pngbin0 -> 190 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/compat/small-darkblue-button-bg.pngbin0 -> 192 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/compat/small-red-button-bg.pngbin0 -> 186 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/domButtons-compat.css6
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/domButtons.css6
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/domButtons/Common-compat.css3
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/domButtons/Common.css6
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonDownArrow-compat.css8
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonDownArrow.css21
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonPlus-compat.css8
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonPlus.css18
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonSearch-compat.css12
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonSearch.css33
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonUpArrow-compat.css8
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonUpArrow.css21
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/domButtons/compat/downarrow-button.pngbin0 -> 935 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/domButtons/compat/plus-button.pngbin0 -> 918 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/domButtons/compat/search-button.gifbin0 -> 910 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/domButtons/compat/search-button.pngbin0 -> 420 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/domButtons/compat/uparrow-button.pngbin0 -> 933 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/iphone/compat/arrow-button-bg.pngbin0 -> 195 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/iphone/compat/arrow-button-head.pngbin0 -> 878 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/iphone/compat/blue-button-bg.pngbin0 -> 199 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/iphone/compat/blue-button-sel-bg.pngbin0 -> 182 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/iphone/compat/edge-categ-bg.pngbin0 -> 130 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/iphone/compat/gray-arrow.pngbin0 -> 920 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/iphone/compat/heading-bg.pngbin0 -> 207 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/iphone/compat/icon-content-heading-bg.pngbin0 -> 193 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/iphone/compat/ipad-arrow-button-bg.pngbin0 -> 181 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/iphone/compat/ipad-arrow-button-head.pngbin0 -> 1212 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/iphone/compat/ipad-heading-bg.pngbin0 -> 195 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/iphone/compat/switch-blue-bg.pngbin0 -> 199 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/iphone/compat/switch-gray-bg.pngbin0 -> 183 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/iphone/compat/switch-knob-bg.pngbin0 -> 174 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/iphone/compat/tab-button-bg.pngbin0 -> 197 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/iphone/compat/tab-sel-button-bg.pngbin0 -> 200 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/iphone/compat/white-arrow.pngbin0 -> 920 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/iphone/images/thumb-overlay-large.pngbin0 -> 3697 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/iphone/images/thumb-overlay-small.pngbin0 -> 1549 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/iphone/images/thumb-overlay.pngbin0 -> 2010 bytes
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/iphone/ipad-compat.css12
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/iphone/ipad.css66
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/iphone/iphone-app-compat.css24
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/iphone/iphone-app.css341
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/iphone/iphone-compat.css297
-rw-r--r--js/dojo-1.6/dojox/mobile/themes/iphone/iphone.css858
133 files changed, 42842 insertions, 0 deletions
diff --git a/js/dojo-1.6/dojox/mobile/FixedSplitter.js b/js/dojo-1.6/dojox/mobile/FixedSplitter.js
new file mode 100644
index 0000000..c942b21
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/FixedSplitter.js
@@ -0,0 +1,108 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.mobile.FixedSplitter"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.FixedSplitter"] = true;
+dojo.provide("dojox.mobile.FixedSplitter");
+
+dojo.require("dijit._WidgetBase");
+
+// summary:
+// A layout container that splits the window horizontally or vertically.
+// description:
+// FixedSplitter is a very simple container widget that layouts its child
+// dom nodes side by side either horizontally or vertically.
+// An example usage of this widget would be to realize the split view on iPad.
+// There is no visual splitter between the children, and there is no
+// function to resize the child panes with drag-and-drop.
+// If you need a visual splitter, you can specify a border of a child
+// dom node with CSS.
+// A child of the widget can be a plain <div> or dojox.mobile.FixedSplitterPane.
+// example:
+// | <div dojoType="dojox.mobile.FixedSplitter" orientation="H">
+// | <div style="width:200px;border-right:1px solid black;">
+// | pane #1 (width=200px)
+// | </div>
+// | <div>
+// | pane #2
+// | </div>
+// | </div>
+
+dojo.declare(
+ "dojox.mobile.FixedSplitter",
+ dijit._WidgetBase,
+{
+ orientation: "H", // "H" or "V"
+
+ isContainer: true,
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef ? this.srcNodeRef : dojo.doc.createElement("DIV");
+ dojo.addClass(this.domNode, "mblFixedSpliter");
+ },
+
+ startup: function(){
+ var children = dojo.filter(this.domNode.childNodes, function(node){ return node.nodeType == 1; });
+ dojo.forEach(children, function(node){
+ dojo.addClass(node, "mblFixedSplitterPane"+this.orientation);
+ }, this);
+
+ dojo.forEach(this.getChildren(), function(child){if(child.startup){child.startup();}});
+ this._started = true;
+
+ var _this = this;
+ setTimeout(function(){
+ _this.resize();
+ }, 0);
+
+ var parent = dijit.getEnclosingWidget(this.domNode.parentNode);
+ if(!parent){
+ if(dojo.global.onorientationchange !== undefined){
+ this.connect(dojo.global, "onorientationchange", "resize");
+ }else{
+ this.connect(dojo.global, "onresize", "resize");
+ }
+ }
+ },
+
+ resize: function(changeSize, resultSize){
+ this.layout();
+ },
+
+ layout: function(){
+ var sz = this.orientation == "H" ? "w" : "h";
+ var children = dojo.filter(this.domNode.childNodes, function(node){ return node.nodeType == 1; });
+ var offset = 0;
+ for(var i = 0; i < children.length; i++){
+ dojo.marginBox(children[i], this.orientation == "H" ? {l:offset} : {t:offset});
+ if(i < children.length - 1){
+ offset += dojo.marginBox(children[i])[sz];
+ }
+ }
+
+ var l = dojo.marginBox(this.domNode)[sz] - offset;
+ var props = {};
+ props[sz] = l;
+ dojo.marginBox(children[children.length - 1], props);
+
+ dojo.forEach(this.getChildren(), function(child){
+ if(child.resize){ child.resize(); }
+ });
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.FixedSplitterPane",
+ dijit._WidgetBase,
+{
+ buildRendering: function(){
+ this.inherited(arguments);
+ dojo.addClass(this.domNode, "mblFixedSplitterPane");
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/mobile/FixedSplitter.xd.js b/js/dojo-1.6/dojox/mobile/FixedSplitter.xd.js
new file mode 100644
index 0000000..1436f4c
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/FixedSplitter.xd.js
@@ -0,0 +1,113 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.mobile.FixedSplitter"],
+["require", "dijit._WidgetBase"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.mobile.FixedSplitter"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.FixedSplitter"] = true;
+dojo.provide("dojox.mobile.FixedSplitter");
+
+dojo.require("dijit._WidgetBase");
+
+// summary:
+// A layout container that splits the window horizontally or vertically.
+// description:
+// FixedSplitter is a very simple container widget that layouts its child
+// dom nodes side by side either horizontally or vertically.
+// An example usage of this widget would be to realize the split view on iPad.
+// There is no visual splitter between the children, and there is no
+// function to resize the child panes with drag-and-drop.
+// If you need a visual splitter, you can specify a border of a child
+// dom node with CSS.
+// A child of the widget can be a plain <div> or dojox.mobile.FixedSplitterPane.
+// example:
+// | <div dojoType="dojox.mobile.FixedSplitter" orientation="H">
+// | <div style="width:200px;border-right:1px solid black;">
+// | pane #1 (width=200px)
+// | </div>
+// | <div>
+// | pane #2
+// | </div>
+// | </div>
+
+dojo.declare(
+ "dojox.mobile.FixedSplitter",
+ dijit._WidgetBase,
+{
+ orientation: "H", // "H" or "V"
+
+ isContainer: true,
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef ? this.srcNodeRef : dojo.doc.createElement("DIV");
+ dojo.addClass(this.domNode, "mblFixedSpliter");
+ },
+
+ startup: function(){
+ var children = dojo.filter(this.domNode.childNodes, function(node){ return node.nodeType == 1; });
+ dojo.forEach(children, function(node){
+ dojo.addClass(node, "mblFixedSplitterPane"+this.orientation);
+ }, this);
+
+ dojo.forEach(this.getChildren(), function(child){if(child.startup){child.startup();}});
+ this._started = true;
+
+ var _this = this;
+ setTimeout(function(){
+ _this.resize();
+ }, 0);
+
+ var parent = dijit.getEnclosingWidget(this.domNode.parentNode);
+ if(!parent){
+ if(dojo.global.onorientationchange !== undefined){
+ this.connect(dojo.global, "onorientationchange", "resize");
+ }else{
+ this.connect(dojo.global, "onresize", "resize");
+ }
+ }
+ },
+
+ resize: function(changeSize, resultSize){
+ this.layout();
+ },
+
+ layout: function(){
+ var sz = this.orientation == "H" ? "w" : "h";
+ var children = dojo.filter(this.domNode.childNodes, function(node){ return node.nodeType == 1; });
+ var offset = 0;
+ for(var i = 0; i < children.length; i++){
+ dojo.marginBox(children[i], this.orientation == "H" ? {l:offset} : {t:offset});
+ if(i < children.length - 1){
+ offset += dojo.marginBox(children[i])[sz];
+ }
+ }
+
+ var l = dojo.marginBox(this.domNode)[sz] - offset;
+ var props = {};
+ props[sz] = l;
+ dojo.marginBox(children[children.length - 1], props);
+
+ dojo.forEach(this.getChildren(), function(child){
+ if(child.resize){ child.resize(); }
+ });
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.FixedSplitterPane",
+ dijit._WidgetBase,
+{
+ buildRendering: function(){
+ this.inherited(arguments);
+ dojo.addClass(this.domNode, "mblFixedSplitterPane");
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/mobile/FlippableView.js b/js/dojo-1.6/dojox/mobile/FlippableView.js
new file mode 100644
index 0000000..79f1f80
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/FlippableView.js
@@ -0,0 +1,143 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.mobile.FlippableView"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.FlippableView"] = true;
+dojo.provide("dojox.mobile.FlippableView");
+
+dojo.require("dijit._WidgetBase");
+dojo.require("dojox.mobile");
+dojo.require("dojox.mobile._ScrollableMixin");
+
+// summary:
+// A container that can be flipped horizontally.
+// description:
+// FlippableView allows the user to swipe the screen left or right to
+// flip between the views.
+// When FlippableView is flipped, it finds an adjacent FlippableView,
+// and opens it.
+
+dojo.declare(
+ "dojox.mobile.FlippableView",
+ [dojox.mobile.View, dojox.mobile._ScrollableMixin],
+{
+ scrollDir: "f",
+ weight: 1.2,
+
+ buildRendering: function(){
+ this.inherited(arguments);
+ dojo.addClass(this.domNode, "mblFlippableView");
+ this.containerNode = this.domNode;
+ this.containerNode.style.position = "absolute";
+ },
+
+ onTouchStart: function(e){
+ var nextView = this._nextView(this.domNode);
+ if(nextView){
+ nextView.stopAnimation();
+ }
+ var prevView = this._previousView(this.domNode);
+ if(prevView){
+ prevView.stopAnimation();
+ }
+ this.inherited(arguments);
+ },
+
+ _nextView: function(node){
+ for(var n = node.nextSibling; n; n = n.nextSibling){
+ if(n.nodeType == 1){ return dijit.byNode(n); }
+ }
+ return null;
+ },
+
+ _previousView: function(node){
+ for(var n = node.previousSibling; n; n = n.previousSibling){
+ if(n.nodeType == 1){ return dijit.byNode(n); }
+ }
+ return null;
+ },
+
+ scrollTo: function(/*Object*/to){
+ if(!this._beingFlipped){
+ var newView, x;
+ if(to.x < 0){
+ newView = this._nextView(this.domNode);
+ x = to.x + this.domNode.offsetWidth;
+ }else{
+ newView = this._previousView(this.domNode);
+ x = to.x - this.domNode.offsetWidth;
+ }
+ if(newView){
+ newView.domNode.style.display = "";
+ newView._beingFlipped = true;
+ newView.scrollTo({x:x});
+ newView._beingFlipped = false;
+ }
+ }
+ this.inherited(arguments);
+ },
+
+ slideTo: function(/*Object*/to, /*Number*/duration, /*String*/easing){
+ if(!this._beingFlipped){
+ var w = this.domNode.offsetWidth;
+ var pos = this.getPos();
+ var newView, newX;
+ if(pos.x < 0){ // moving to left
+ newView = this._nextView(this.domNode);
+ if(pos.x < -w/4){ // slide to next
+ if(newView){
+ to.x = -w;
+ newX = 0;
+ }
+ }else{ // go back
+ if(newView){
+ newX = w;
+ }
+ }
+ }else{ // moving to right
+ newView = this._previousView(this.domNode);
+ if(pos.x > w/4){ // slide to previous
+ if(newView){
+ to.x = w;
+ newX = 0;
+ }
+ }else{ // go back
+ if(newView){
+ newX = -w;
+ }
+ }
+ }
+
+ if(newView){
+ newView._beingFlipped = true;
+ newView.slideTo({x:newX}, duration, easing);
+ newView._beingFlipped = false;
+
+ if(newX === 0){ // moving to another view
+ dojox.mobile.currentView = newView;
+ }
+ }
+ }
+ this.inherited(arguments);
+ },
+
+ onFlickAnimationEnd: function(e){
+ // Hide all the views other than the currently showing one.
+ // Otherwise, when the orientation is changed, other views
+ // may appear unexpectedly.
+ var children = this.domNode.parentNode.childNodes;
+ for(var i = 0; i < children.length; i++){
+ var c = children[i];
+ if(c.nodeType == 1 && c != dojox.mobile.currentView.domNode){
+ c.style.display = "none";
+ }
+ }
+ this.inherited(arguments);
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/mobile/FlippableView.xd.js b/js/dojo-1.6/dojox/mobile/FlippableView.xd.js
new file mode 100644
index 0000000..83b24c9
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/FlippableView.xd.js
@@ -0,0 +1,150 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.mobile.FlippableView"],
+["require", "dijit._WidgetBase"],
+["require", "dojox.mobile"],
+["require", "dojox.mobile._ScrollableMixin"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.mobile.FlippableView"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.FlippableView"] = true;
+dojo.provide("dojox.mobile.FlippableView");
+
+dojo.require("dijit._WidgetBase");
+dojo.require("dojox.mobile");
+dojo.require("dojox.mobile._ScrollableMixin");
+
+// summary:
+// A container that can be flipped horizontally.
+// description:
+// FlippableView allows the user to swipe the screen left or right to
+// flip between the views.
+// When FlippableView is flipped, it finds an adjacent FlippableView,
+// and opens it.
+
+dojo.declare(
+ "dojox.mobile.FlippableView",
+ [dojox.mobile.View, dojox.mobile._ScrollableMixin],
+{
+ scrollDir: "f",
+ weight: 1.2,
+
+ buildRendering: function(){
+ this.inherited(arguments);
+ dojo.addClass(this.domNode, "mblFlippableView");
+ this.containerNode = this.domNode;
+ this.containerNode.style.position = "absolute";
+ },
+
+ onTouchStart: function(e){
+ var nextView = this._nextView(this.domNode);
+ if(nextView){
+ nextView.stopAnimation();
+ }
+ var prevView = this._previousView(this.domNode);
+ if(prevView){
+ prevView.stopAnimation();
+ }
+ this.inherited(arguments);
+ },
+
+ _nextView: function(node){
+ for(var n = node.nextSibling; n; n = n.nextSibling){
+ if(n.nodeType == 1){ return dijit.byNode(n); }
+ }
+ return null;
+ },
+
+ _previousView: function(node){
+ for(var n = node.previousSibling; n; n = n.previousSibling){
+ if(n.nodeType == 1){ return dijit.byNode(n); }
+ }
+ return null;
+ },
+
+ scrollTo: function(/*Object*/to){
+ if(!this._beingFlipped){
+ var newView, x;
+ if(to.x < 0){
+ newView = this._nextView(this.domNode);
+ x = to.x + this.domNode.offsetWidth;
+ }else{
+ newView = this._previousView(this.domNode);
+ x = to.x - this.domNode.offsetWidth;
+ }
+ if(newView){
+ newView.domNode.style.display = "";
+ newView._beingFlipped = true;
+ newView.scrollTo({x:x});
+ newView._beingFlipped = false;
+ }
+ }
+ this.inherited(arguments);
+ },
+
+ slideTo: function(/*Object*/to, /*Number*/duration, /*String*/easing){
+ if(!this._beingFlipped){
+ var w = this.domNode.offsetWidth;
+ var pos = this.getPos();
+ var newView, newX;
+ if(pos.x < 0){ // moving to left
+ newView = this._nextView(this.domNode);
+ if(pos.x < -w/4){ // slide to next
+ if(newView){
+ to.x = -w;
+ newX = 0;
+ }
+ }else{ // go back
+ if(newView){
+ newX = w;
+ }
+ }
+ }else{ // moving to right
+ newView = this._previousView(this.domNode);
+ if(pos.x > w/4){ // slide to previous
+ if(newView){
+ to.x = w;
+ newX = 0;
+ }
+ }else{ // go back
+ if(newView){
+ newX = -w;
+ }
+ }
+ }
+
+ if(newView){
+ newView._beingFlipped = true;
+ newView.slideTo({x:newX}, duration, easing);
+ newView._beingFlipped = false;
+
+ if(newX === 0){ // moving to another view
+ dojox.mobile.currentView = newView;
+ }
+ }
+ }
+ this.inherited(arguments);
+ },
+
+ onFlickAnimationEnd: function(e){
+ // Hide all the views other than the currently showing one.
+ // Otherwise, when the orientation is changed, other views
+ // may appear unexpectedly.
+ var children = this.domNode.parentNode.childNodes;
+ for(var i = 0; i < children.length; i++){
+ var c = children[i];
+ if(c.nodeType == 1 && c != dojox.mobile.currentView.domNode){
+ c.style.display = "none";
+ }
+ }
+ this.inherited(arguments);
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/mobile/IconContainer.js b/js/dojo-1.6/dojox/mobile/IconContainer.js
new file mode 100644
index 0000000..c6de4a7
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/IconContainer.js
@@ -0,0 +1,318 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.mobile.IconContainer"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.IconContainer"] = true;
+dojo.provide("dojox.mobile.IconContainer");
+
+dojo.require("dojox.mobile");
+
+dojo.declare(
+ "dojox.mobile.IconContainer",
+ dijit._WidgetBase,
+{
+ defaultIcon: "",
+ transition: "below", // slide, flip, or below
+ pressedIconOpacity: 0.4,
+ iconBase: "",
+ iconPos: "",
+ back: "Home",
+ label: "My Application",
+ single: false,
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("UL");
+ this.domNode.className = "mblIconContainer";
+ var t = this._terminator = dojo.create("LI");
+ t.className = "mblIconItemTerminator";
+ t.innerHTML = "&nbsp;";
+ this.domNode.appendChild(t);
+ },
+
+ _setupSubNodes: function(ul){
+ var len = this.domNode.childNodes.length - 1; // -1 for terminator
+ for(i = 0; i < len; i++){
+ child = this.domNode.childNodes[i];
+ if(child.nodeType != 1){ continue; }
+ w = dijit.byNode(child);
+ if(this.single){
+ w.subNode.firstChild.style.display = "none";
+ }
+ ul.appendChild(w.subNode);
+ }
+ },
+
+ startup: function(){
+ var ul, i, len, child, w;
+ if(this.transition == "below"){
+ this._setupSubNodes(this.domNode);
+ }else{
+ var view = new dojox.mobile.View({id:this.id+"_mblApplView"});
+ var _this = this;
+ view.onAfterTransitionIn = function(moveTo, dir, transition, context, method){
+ _this._opening._open_1();
+ };
+ view.domNode.style.visibility = "hidden";
+ var heading = view._heading = new dojox.mobile.Heading({back:this.back, label:this.label, moveTo:this.domNode.parentNode.id, transition:this.transition});
+ view.addChild(heading);
+ ul = dojo.doc.createElement("UL");
+ ul.className = "mblIconContainer";
+ ul.style.marginTop = "0px";
+ this._setupSubNodes(ul);
+ view.domNode.appendChild(ul);
+ dojo.doc.body.appendChild(view.domNode);
+ heading.startup();
+ }
+ },
+
+ closeAll: function(){
+ var len = this.domNode.childNodes.length;
+ for(var i = 0; i < len; i++){
+ child = this.domNode.childNodes[i];
+ if(child.nodeType != 1){ continue; }
+ if(child == this._terminator){ break; }
+ w = dijit.byNode(child);
+ w.containerNode.parentNode.style.display = "none";
+ w.setOpacity(w.iconNode, 1);
+ }
+ },
+
+ addChild: function(widget){
+ this.domNode.insertBefore(widget.domNode, this._terminator);
+ widget.transition = this.transition;
+ if(this.transition == "below"){
+ this.domNode.appendChild(widget.subNode);
+ }
+ widget.inheritParams();
+ widget.setIcon();
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.IconItem",
+ dojox.mobile.AbstractItem,
+{
+ // description:
+ // Dynamic creation is not supported.
+ lazy: false,
+ requires: "",
+ timeout: 10,
+
+ templateString: '<li class="mblIconItem">'+
+ '<div class="mblIconArea" dojoAttachPoint="iconDivNode">'+
+ '<div><img src="${icon}" dojoAttachPoint="iconNode"></div>${label}'+
+ '</div>'+
+ '</li>',
+ templateStringSub: '<li class="mblIconItemSub" lazy="${lazy}" style="display:none;" dojoAttachPoint="contentNode">'+
+ '<h2 class="mblIconContentHeading" dojoAttachPoint="closeNode">'+
+ '<div class="mblBlueMinusButton" style="position:absolute;left:4px;top:2px;" dojoAttachPoint="closeIconNode"><div></div></div>${label}'+
+ '</h2>'+
+ '<div class="mblContent" dojoAttachPoint="containerNode"></div>'+
+ '</li>',
+
+ createTemplate: function(s){
+ dojo.forEach(["lazy","icon","label"], function(v){
+ while(s.indexOf("${"+v+"}") != -1){
+ s = s.replace("${"+v+"}", this[v]);
+ }
+ }, this);
+ var div = dojo.doc.createElement("DIV");
+ div.innerHTML = s;
+
+ /*
+ dojo.forEach(dojo.query("[dojoAttachPoint]", domNode), function(node){
+ this[node.getAttribute("dojoAttachPoint")] = node;
+ }, this);
+ */
+
+ var nodes = div.getElementsByTagName("*");
+ var i, len, s1;
+ len = nodes.length;
+ for(i = 0; i < len; i++){
+ s1 = nodes[i].getAttribute("dojoAttachPoint");
+ if(s1){
+ this[s1] = nodes[i];
+ }
+ }
+ var domNode = div.removeChild(div.firstChild);
+ div = null;
+ return domNode;
+ },
+
+ buildRendering: function(){
+ this.inheritParams();
+ this.domNode = this.createTemplate(this.templateString);
+ this.subNode = this.createTemplate(this.templateStringSub);
+ this.subNode._parentNode = this.domNode; // [custom property]
+
+ if(this.srcNodeRef){
+ // reparent
+ for(var i = 0, len = this.srcNodeRef.childNodes.length; i < len; i++){
+ this.containerNode.appendChild(this.srcNodeRef.removeChild(this.srcNodeRef.firstChild));
+ }
+ this.srcNodeRef.parentNode.replaceChild(this.domNode, this.srcNodeRef);
+ this.srcNodeRef = null;
+ }
+ this.setIcon();
+ },
+
+ setIcon: function(){
+ this.iconNode.src = this.icon;
+ dojox.mobile.setupIcon(this.iconNode, this.iconPos);
+ },
+
+ postCreate: function(){
+ this.connect(this.iconNode, "onmousedown", "onMouseDownIcon");
+ this.connect(this.iconNode, "onclick", "iconClicked");
+ this.connect(this.closeIconNode, "onclick", "closeIconClicked");
+ this.connect(this.iconNode, "onerror", "onError");
+ },
+
+ highlight: function(){
+ dojo.addClass(this.iconDivNode, "mblVibrate");
+ if(this.timeout > 0){
+ var _this = this;
+ setTimeout(function(){
+ _this.unhighlight();
+ }, this.timeout*1000);
+ }
+ },
+
+ unhighlight: function(){
+ dojo.removeClass(this.iconDivNode, "mblVibrate");
+ },
+
+ setOpacity: function(node, val){
+ node.style.opacity = val;
+ node.style.mozOpacity = val;
+ node.style.khtmlOpacity = val;
+ node.style.webkitOpacity = val;
+ },
+
+ instantiateWidget: function(e){
+ // avoid use of dojo.query
+ /*
+ var list = dojo.query('[dojoType]', this.containerNode);
+ for(var i = 0, len = list.length; i < len; i++){
+ dojo["require"](list[i].getAttribute("dojoType"));
+ }
+ */
+
+ var nodes = this.containerNode.getElementsByTagName("*");
+ var len = nodes.length;
+ var s;
+ for(var i = 0; i < len; i++){
+ s = nodes[i].getAttribute("dojoType");
+ if(s){
+ dojo["require"](s);
+ }
+ }
+
+ if(len > 0){
+ (dojox.mobile.parser || dojo.parser).parse(this.containerNode);
+ }
+ this.lazy = false;
+ },
+
+ isOpen: function(e){
+ return this.containerNode.style.display != "none";
+ },
+
+ onMouseDownIcon: function (e){
+ this.setOpacity(this.iconNode, this.getParentWidget().pressedIconOpacity);
+ },
+
+ iconClicked: function(e){
+ if(e){
+ setTimeout(dojo.hitch(this, function(d){ this.iconClicked(); }), 0);
+ return;
+ }
+ if(this.moveTo || this.href || this.url){
+ this.transitionTo(this.moveTo, this.href, this.url);
+ setTimeout(dojo.hitch(this, function(d){
+ this.setOpacity(this.iconNode, 1);
+ }), 1500);
+ }else{
+ this.open();
+ }
+ },
+
+ closeIconClicked: function(e){
+ if(e){
+ setTimeout(dojo.hitch(this, function(d){ this.closeIconClicked(); }), 0);
+ return;
+ }
+ this.close();
+ },
+
+ open: function(){
+ var parent = this.getParentWidget(); // IconContainer
+ if(this.transition == "below"){
+ if(parent.single){
+ parent.closeAll();
+ this.setOpacity(this.iconNode, this.getParentWidget().pressedIconOpacity);
+ }
+ this._open_1();
+ }else{
+ parent._opening = this;
+ if(parent.single){
+ parent.closeAll();
+ var view = dijit.byId(parent.id+"_mblApplView");
+ view._heading.setLabel(this.label);
+ }
+ this.transitionTo(parent.id+"_mblApplView");
+ }
+ },
+
+ _open_1: function(){
+ this.contentNode.style.display = "";
+ this.unhighlight();
+ if(this.lazy){
+ if(this.requires){
+ dojo.forEach(this.requires.split(/,/), function(c){
+ dojo["require"](c);
+ });
+ }
+ this.instantiateWidget();
+ }
+ this.contentNode.scrollIntoView();
+ this.onOpen();
+ },
+
+ close: function(){
+ if(dojo.isWebKit){
+ var t = this.domNode.parentNode.offsetWidth/8;
+ var y = this.iconNode.offsetLeft;
+ var pos = 0;
+ for(var i = 1; i <= 3; i++){
+ if(t*(2*i-1) < y && y <= t*(2*(i+1)-1)){
+ pos = i;
+ break;
+ }
+ }
+ dojo.addClass(this.containerNode.parentNode, "mblCloseContent mblShrink"+pos);
+ }else{
+ this.containerNode.parentNode.style.display = "none";
+ }
+ this.setOpacity(this.iconNode, 1);
+ this.onClose();
+ },
+
+ onOpen: function(){
+ // stub method to allow the application to connect to.
+ },
+
+ onClose: function(){
+ // stub method to allow the application to connect to.
+ },
+
+ onError: function(){
+ this.iconNode.src = this.getParentWidget().defaultIcon;
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/mobile/IconContainer.xd.js b/js/dojo-1.6/dojox/mobile/IconContainer.xd.js
new file mode 100644
index 0000000..220543c
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/IconContainer.xd.js
@@ -0,0 +1,323 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.mobile.IconContainer"],
+["require", "dojox.mobile"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.mobile.IconContainer"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.IconContainer"] = true;
+dojo.provide("dojox.mobile.IconContainer");
+
+dojo.require("dojox.mobile");
+
+dojo.declare(
+ "dojox.mobile.IconContainer",
+ dijit._WidgetBase,
+{
+ defaultIcon: "",
+ transition: "below", // slide, flip, or below
+ pressedIconOpacity: 0.4,
+ iconBase: "",
+ iconPos: "",
+ back: "Home",
+ label: "My Application",
+ single: false,
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("UL");
+ this.domNode.className = "mblIconContainer";
+ var t = this._terminator = dojo.create("LI");
+ t.className = "mblIconItemTerminator";
+ t.innerHTML = "&nbsp;";
+ this.domNode.appendChild(t);
+ },
+
+ _setupSubNodes: function(ul){
+ var len = this.domNode.childNodes.length - 1; // -1 for terminator
+ for(i = 0; i < len; i++){
+ child = this.domNode.childNodes[i];
+ if(child.nodeType != 1){ continue; }
+ w = dijit.byNode(child);
+ if(this.single){
+ w.subNode.firstChild.style.display = "none";
+ }
+ ul.appendChild(w.subNode);
+ }
+ },
+
+ startup: function(){
+ var ul, i, len, child, w;
+ if(this.transition == "below"){
+ this._setupSubNodes(this.domNode);
+ }else{
+ var view = new dojox.mobile.View({id:this.id+"_mblApplView"});
+ var _this = this;
+ view.onAfterTransitionIn = function(moveTo, dir, transition, context, method){
+ _this._opening._open_1();
+ };
+ view.domNode.style.visibility = "hidden";
+ var heading = view._heading = new dojox.mobile.Heading({back:this.back, label:this.label, moveTo:this.domNode.parentNode.id, transition:this.transition});
+ view.addChild(heading);
+ ul = dojo.doc.createElement("UL");
+ ul.className = "mblIconContainer";
+ ul.style.marginTop = "0px";
+ this._setupSubNodes(ul);
+ view.domNode.appendChild(ul);
+ dojo.doc.body.appendChild(view.domNode);
+ heading.startup();
+ }
+ },
+
+ closeAll: function(){
+ var len = this.domNode.childNodes.length;
+ for(var i = 0; i < len; i++){
+ child = this.domNode.childNodes[i];
+ if(child.nodeType != 1){ continue; }
+ if(child == this._terminator){ break; }
+ w = dijit.byNode(child);
+ w.containerNode.parentNode.style.display = "none";
+ w.setOpacity(w.iconNode, 1);
+ }
+ },
+
+ addChild: function(widget){
+ this.domNode.insertBefore(widget.domNode, this._terminator);
+ widget.transition = this.transition;
+ if(this.transition == "below"){
+ this.domNode.appendChild(widget.subNode);
+ }
+ widget.inheritParams();
+ widget.setIcon();
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.IconItem",
+ dojox.mobile.AbstractItem,
+{
+ // description:
+ // Dynamic creation is not supported.
+ lazy: false,
+ requires: "",
+ timeout: 10,
+
+ templateString: '<li class="mblIconItem">'+
+ '<div class="mblIconArea" dojoAttachPoint="iconDivNode">'+
+ '<div><img src="${icon}" dojoAttachPoint="iconNode"></div>${label}'+
+ '</div>'+
+ '</li>',
+ templateStringSub: '<li class="mblIconItemSub" lazy="${lazy}" style="display:none;" dojoAttachPoint="contentNode">'+
+ '<h2 class="mblIconContentHeading" dojoAttachPoint="closeNode">'+
+ '<div class="mblBlueMinusButton" style="position:absolute;left:4px;top:2px;" dojoAttachPoint="closeIconNode"><div></div></div>${label}'+
+ '</h2>'+
+ '<div class="mblContent" dojoAttachPoint="containerNode"></div>'+
+ '</li>',
+
+ createTemplate: function(s){
+ dojo.forEach(["lazy","icon","label"], function(v){
+ while(s.indexOf("${"+v+"}") != -1){
+ s = s.replace("${"+v+"}", this[v]);
+ }
+ }, this);
+ var div = dojo.doc.createElement("DIV");
+ div.innerHTML = s;
+
+ /*
+ dojo.forEach(dojo.query("[dojoAttachPoint]", domNode), function(node){
+ this[node.getAttribute("dojoAttachPoint")] = node;
+ }, this);
+ */
+
+ var nodes = div.getElementsByTagName("*");
+ var i, len, s1;
+ len = nodes.length;
+ for(i = 0; i < len; i++){
+ s1 = nodes[i].getAttribute("dojoAttachPoint");
+ if(s1){
+ this[s1] = nodes[i];
+ }
+ }
+ var domNode = div.removeChild(div.firstChild);
+ div = null;
+ return domNode;
+ },
+
+ buildRendering: function(){
+ this.inheritParams();
+ this.domNode = this.createTemplate(this.templateString);
+ this.subNode = this.createTemplate(this.templateStringSub);
+ this.subNode._parentNode = this.domNode; // [custom property]
+
+ if(this.srcNodeRef){
+ // reparent
+ for(var i = 0, len = this.srcNodeRef.childNodes.length; i < len; i++){
+ this.containerNode.appendChild(this.srcNodeRef.removeChild(this.srcNodeRef.firstChild));
+ }
+ this.srcNodeRef.parentNode.replaceChild(this.domNode, this.srcNodeRef);
+ this.srcNodeRef = null;
+ }
+ this.setIcon();
+ },
+
+ setIcon: function(){
+ this.iconNode.src = this.icon;
+ dojox.mobile.setupIcon(this.iconNode, this.iconPos);
+ },
+
+ postCreate: function(){
+ this.connect(this.iconNode, "onmousedown", "onMouseDownIcon");
+ this.connect(this.iconNode, "onclick", "iconClicked");
+ this.connect(this.closeIconNode, "onclick", "closeIconClicked");
+ this.connect(this.iconNode, "onerror", "onError");
+ },
+
+ highlight: function(){
+ dojo.addClass(this.iconDivNode, "mblVibrate");
+ if(this.timeout > 0){
+ var _this = this;
+ setTimeout(function(){
+ _this.unhighlight();
+ }, this.timeout*1000);
+ }
+ },
+
+ unhighlight: function(){
+ dojo.removeClass(this.iconDivNode, "mblVibrate");
+ },
+
+ setOpacity: function(node, val){
+ node.style.opacity = val;
+ node.style.mozOpacity = val;
+ node.style.khtmlOpacity = val;
+ node.style.webkitOpacity = val;
+ },
+
+ instantiateWidget: function(e){
+ // avoid use of dojo.query
+ /*
+ var list = dojo.query('[dojoType]', this.containerNode);
+ for(var i = 0, len = list.length; i < len; i++){
+ dojo["require"](list[i].getAttribute("dojoType"));
+ }
+ */
+
+ var nodes = this.containerNode.getElementsByTagName("*");
+ var len = nodes.length;
+ var s;
+ for(var i = 0; i < len; i++){
+ s = nodes[i].getAttribute("dojoType");
+ if(s){
+ dojo["require"](s);
+ }
+ }
+
+ if(len > 0){
+ (dojox.mobile.parser || dojo.parser).parse(this.containerNode);
+ }
+ this.lazy = false;
+ },
+
+ isOpen: function(e){
+ return this.containerNode.style.display != "none";
+ },
+
+ onMouseDownIcon: function (e){
+ this.setOpacity(this.iconNode, this.getParentWidget().pressedIconOpacity);
+ },
+
+ iconClicked: function(e){
+ if(e){
+ setTimeout(dojo.hitch(this, function(d){ this.iconClicked(); }), 0);
+ return;
+ }
+ if(this.moveTo || this.href || this.url){
+ this.transitionTo(this.moveTo, this.href, this.url);
+ setTimeout(dojo.hitch(this, function(d){
+ this.setOpacity(this.iconNode, 1);
+ }), 1500);
+ }else{
+ this.open();
+ }
+ },
+
+ closeIconClicked: function(e){
+ if(e){
+ setTimeout(dojo.hitch(this, function(d){ this.closeIconClicked(); }), 0);
+ return;
+ }
+ this.close();
+ },
+
+ open: function(){
+ var parent = this.getParentWidget(); // IconContainer
+ if(this.transition == "below"){
+ if(parent.single){
+ parent.closeAll();
+ this.setOpacity(this.iconNode, this.getParentWidget().pressedIconOpacity);
+ }
+ this._open_1();
+ }else{
+ parent._opening = this;
+ if(parent.single){
+ parent.closeAll();
+ var view = dijit.byId(parent.id+"_mblApplView");
+ view._heading.setLabel(this.label);
+ }
+ this.transitionTo(parent.id+"_mblApplView");
+ }
+ },
+
+ _open_1: function(){
+ this.contentNode.style.display = "";
+ this.unhighlight();
+ if(this.lazy){
+ if(this.requires){
+ dojo.forEach(this.requires.split(/,/), function(c){
+ dojo["require"](c);
+ });
+ }
+ this.instantiateWidget();
+ }
+ this.contentNode.scrollIntoView();
+ this.onOpen();
+ },
+
+ close: function(){
+ if(dojo.isWebKit){
+ var t = this.domNode.parentNode.offsetWidth/8;
+ var y = this.iconNode.offsetLeft;
+ var pos = 0;
+ for(var i = 1; i <= 3; i++){
+ if(t*(2*i-1) < y && y <= t*(2*(i+1)-1)){
+ pos = i;
+ break;
+ }
+ }
+ dojo.addClass(this.containerNode.parentNode, "mblCloseContent mblShrink"+pos);
+ }else{
+ this.containerNode.parentNode.style.display = "none";
+ }
+ this.setOpacity(this.iconNode, 1);
+ this.onClose();
+ },
+
+ onOpen: function(){
+ // stub method to allow the application to connect to.
+ },
+
+ onClose: function(){
+ // stub method to allow the application to connect to.
+ },
+
+ onError: function(){
+ this.iconNode.src = this.getParentWidget().defaultIcon;
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/mobile/README b/js/dojo-1.6/dojox/mobile/README
new file mode 100644
index 0000000..3bbbf27
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/README
@@ -0,0 +1,55 @@
+-------------------------------------------------------------------------------
+Project Name: dojox.mobile
+-------------------------------------------------------------------------------
+Version 0.01
+Release date: 03/23/2010
+-------------------------------------------------------------------------------
+Project state:
+ experimental
+-------------------------------------------------------------------------------
+[ NO ] l18n support?
+[ NO ] a11y support?
+-------------------------------------------------------------------------------
+Credits:
+ Jared Jurkiewicz (jared.jurkiewicz@gmail.com)
+ Yoshiroh Kamiyama (Contributor to Jared of base code).
+
+-------------------------------------------------------------------------------
+Project description
+
+This project tries to solve an area lacking in dojo, namely better
+support for mobile devices. This project provides through CSS3 and
+custom styles, interfaces that display and work well on mobile devices
+such as the Android and iPhone Smart Phones.
+
+The code is deliberately kept as lightweight as possible, using CSS3 animations
+and the like to perform the effects. There is a compat.js, which will simulate
+most of the effects using dojo.animateProperty and dojox.gfx where possible on
+browsers such as FireFox and IE. It will not load by default, it has to be
+required in separately.
+-------------------------------------------------------------------------------
+Dependencies:
+ dojo base
+ dijit/_Widget.js
+-------------------------------------------------------------------------------
+Documentation
+ Documentatation will reside at:
+ http://docs.dojocampus.org/dojox/mobile
+
+-------------------------------------------------------------------------------
+Installation instructions
+
+Grab the following from the Dojo SVN Repository:
+http://svn.dojotoolkit.org/src/dojox/trunk/mobile/*
+http://svn.dojotoolkit.org/src/dojox/trunk/mobile.js
+
+Install into the following directory structure:
+/dojox/mobile.js
+/dojox/mobile/*
+
+...which should be at the same level as your Dojo checkout.
+
+then dojo.require("dojox.mobile") in your application to load it.
+
+-------------------------------------------------------------------------------
+
diff --git a/js/dojo-1.6/dojox/mobile/ScrollableView.js b/js/dojo-1.6/dojox/mobile/ScrollableView.js
new file mode 100644
index 0000000..cb215dc
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/ScrollableView.js
@@ -0,0 +1,129 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.mobile.ScrollableView"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.ScrollableView"] = true;
+dojo.provide("dojox.mobile.ScrollableView");
+
+dojo.require("dijit._WidgetBase");
+dojo.require("dojox.mobile");
+dojo.require("dojox.mobile._ScrollableMixin");
+
+// summary:
+// A container that has a touch scrolling capability.
+// description:
+// ScrollableView is a subclass of View (=dojox.mobile.View).
+// Unlike the base View class, ScrollableView's domNode always stays
+// at the top of the screen and its height is "100%" of the screen.
+// In this fixed domNode, containerNode scrolls. Browser's default
+// scrolling behavior is disabled, and the scrolling machinery is
+// re-implemented with JavaScript. Thus the user does not need to use the
+// two-finger operation to scroll an inner DIV (containerNode).
+// The main purpose of this widget is to realize fixed-positioned header
+// and/or footer bars.
+
+dojo.declare(
+ "dojox.mobile.ScrollableView",
+ [dojox.mobile.View, dojox.mobile._ScrollableMixin],
+{
+ flippable: false,
+
+ buildRendering: function(){
+ this.inherited(arguments);
+ dojo.addClass(this.domNode, "mblScrollableView");
+ this.domNode.style.overflow = "hidden";
+ this.domNode.style.top = "0px";
+ this.domNode.style.height = "100%";
+ this.containerNode = dojo.create("DIV",
+ {className:"mblScrollableViewContainer"}, this.domNode);
+ this.containerNode.style.position = "absolute";
+ if(this.scrollDir === "v" || this.flippable){
+ this.containerNode.style.width = "100%";
+ }
+ this.reparent();
+ this.findAppBars();
+ },
+
+ addChild: function(widget){
+ var c = widget.domNode;
+ var fixed = this._checkFixedBar(c, true);
+ if(fixed){
+ this.domNode.appendChild(c);
+ if(fixed === "top"){
+ this.fixedHeaderHeight = c.offsetHeight;
+ this.containerNode.style.paddingTop = this.fixedHeaderHeight + "px";
+ }else if(fixed === "bottom"){
+ this.fixedFooterHeight = c.offsetHeight;
+ this.isLocalFooter = true;
+ c.style.bottom = "0px";
+ }
+ this.resizeView();
+ }else{
+ this.containerNode.appendChild(c);
+ }
+ },
+
+ reparent: function(){
+ // move all the children, except header and footer, to containerNode.
+ var i, idx, len, c;
+ for(i = 0, idx = 0, len = this.domNode.childNodes.length; i < len; i++){
+ c = this.domNode.childNodes[idx];
+ // search for view-specific header or footer
+ if(c === this.containerNode || this._checkFixedBar(c, true)){
+ idx++;
+ continue;
+ }
+ this.containerNode.appendChild(this.domNode.removeChild(c));
+ }
+ },
+
+ findAppBars: function(){
+ // search for application-specific header or footer
+ var i, len, c;
+ for(i = 0, len = dojo.body().childNodes.length; i < len; i++){
+ c = dojo.body().childNodes[i];
+ this._checkFixedBar(c, false);
+ }
+ if(this.domNode.parentNode){
+ for(i = 0, len = this.domNode.parentNode.childNodes.length; i < len; i++){
+ c = this.domNode.parentNode.childNodes[i];
+ this._checkFixedBar(c, false);
+ }
+ }
+ this.fixedHeaderHeight = this.fixedHeader ? this.fixedHeader.offsetHeight : 0;
+ this.fixedFooterHeight = this.fixedFooter ? this.fixedFooter.offsetHeight : 0;
+ },
+
+ _checkFixedBar: function(/*DomNode*/node){
+ if(node.nodeType === 1){
+ var fixed = node.getAttribute("fixed")
+ || (dijit.byNode(node) && dijit.byNode(node).fixed);
+ if(fixed){
+ dojo.style(node, {
+ position: "absolute",
+ width: "100%",
+ zIndex: 1
+ });
+ }
+ if(fixed === "top"){
+ node.style.top = "0px";
+ this.fixedHeader = node;
+ return fixed;
+ }else if(fixed === "bottom"){
+ this.fixedFooter = node;
+ return fixed;
+ }
+ }
+ return null;
+ },
+
+ onAfterTransitionIn: function(moveTo, dir, transition, context, method){
+ this.flashScrollBar();
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/mobile/ScrollableView.xd.js b/js/dojo-1.6/dojox/mobile/ScrollableView.xd.js
new file mode 100644
index 0000000..017631b
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/ScrollableView.xd.js
@@ -0,0 +1,136 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.mobile.ScrollableView"],
+["require", "dijit._WidgetBase"],
+["require", "dojox.mobile"],
+["require", "dojox.mobile._ScrollableMixin"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.mobile.ScrollableView"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.ScrollableView"] = true;
+dojo.provide("dojox.mobile.ScrollableView");
+
+dojo.require("dijit._WidgetBase");
+dojo.require("dojox.mobile");
+dojo.require("dojox.mobile._ScrollableMixin");
+
+// summary:
+// A container that has a touch scrolling capability.
+// description:
+// ScrollableView is a subclass of View (=dojox.mobile.View).
+// Unlike the base View class, ScrollableView's domNode always stays
+// at the top of the screen and its height is "100%" of the screen.
+// In this fixed domNode, containerNode scrolls. Browser's default
+// scrolling behavior is disabled, and the scrolling machinery is
+// re-implemented with JavaScript. Thus the user does not need to use the
+// two-finger operation to scroll an inner DIV (containerNode).
+// The main purpose of this widget is to realize fixed-positioned header
+// and/or footer bars.
+
+dojo.declare(
+ "dojox.mobile.ScrollableView",
+ [dojox.mobile.View, dojox.mobile._ScrollableMixin],
+{
+ flippable: false,
+
+ buildRendering: function(){
+ this.inherited(arguments);
+ dojo.addClass(this.domNode, "mblScrollableView");
+ this.domNode.style.overflow = "hidden";
+ this.domNode.style.top = "0px";
+ this.domNode.style.height = "100%";
+ this.containerNode = dojo.create("DIV",
+ {className:"mblScrollableViewContainer"}, this.domNode);
+ this.containerNode.style.position = "absolute";
+ if(this.scrollDir === "v" || this.flippable){
+ this.containerNode.style.width = "100%";
+ }
+ this.reparent();
+ this.findAppBars();
+ },
+
+ addChild: function(widget){
+ var c = widget.domNode;
+ var fixed = this._checkFixedBar(c, true);
+ if(fixed){
+ this.domNode.appendChild(c);
+ if(fixed === "top"){
+ this.fixedHeaderHeight = c.offsetHeight;
+ this.containerNode.style.paddingTop = this.fixedHeaderHeight + "px";
+ }else if(fixed === "bottom"){
+ this.fixedFooterHeight = c.offsetHeight;
+ this.isLocalFooter = true;
+ c.style.bottom = "0px";
+ }
+ this.resizeView();
+ }else{
+ this.containerNode.appendChild(c);
+ }
+ },
+
+ reparent: function(){
+ // move all the children, except header and footer, to containerNode.
+ var i, idx, len, c;
+ for(i = 0, idx = 0, len = this.domNode.childNodes.length; i < len; i++){
+ c = this.domNode.childNodes[idx];
+ // search for view-specific header or footer
+ if(c === this.containerNode || this._checkFixedBar(c, true)){
+ idx++;
+ continue;
+ }
+ this.containerNode.appendChild(this.domNode.removeChild(c));
+ }
+ },
+
+ findAppBars: function(){
+ // search for application-specific header or footer
+ var i, len, c;
+ for(i = 0, len = dojo.body().childNodes.length; i < len; i++){
+ c = dojo.body().childNodes[i];
+ this._checkFixedBar(c, false);
+ }
+ if(this.domNode.parentNode){
+ for(i = 0, len = this.domNode.parentNode.childNodes.length; i < len; i++){
+ c = this.domNode.parentNode.childNodes[i];
+ this._checkFixedBar(c, false);
+ }
+ }
+ this.fixedHeaderHeight = this.fixedHeader ? this.fixedHeader.offsetHeight : 0;
+ this.fixedFooterHeight = this.fixedFooter ? this.fixedFooter.offsetHeight : 0;
+ },
+
+ _checkFixedBar: function(/*DomNode*/node){
+ if(node.nodeType === 1){
+ var fixed = node.getAttribute("fixed")
+ || (dijit.byNode(node) && dijit.byNode(node).fixed);
+ if(fixed){
+ dojo.style(node, {
+ position: "absolute",
+ width: "100%",
+ zIndex: 1
+ });
+ }
+ if(fixed === "top"){
+ node.style.top = "0px";
+ this.fixedHeader = node;
+ return fixed;
+ }else if(fixed === "bottom"){
+ this.fixedFooter = node;
+ return fixed;
+ }
+ }
+ return null;
+ },
+
+ onAfterTransitionIn: function(moveTo, dir, transition, context, method){
+ this.flashScrollBar();
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/mobile/TabBar.js b/js/dojo-1.6/dojox/mobile/TabBar.js
new file mode 100644
index 0000000..557344d
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/TabBar.js
@@ -0,0 +1,216 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.mobile.TabBar"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.TabBar"] = true;
+dojo.provide("dojox.mobile.TabBar");
+
+dojo.require("dojox.mobile");
+
+dojo.declare(
+ "dojox.mobile.TabBar",
+ dijit._WidgetBase,
+{
+ iconBase: "",
+ iconPos: "",
+ barType: "tabBar", // "tabBar"(default) or "segmentedControl"
+ inHeading: false,
+
+ _fixedButtonWidth: 76,
+ _fixedButtonMargin: 17,
+ _largeScreenWidth: 500,
+
+ buildRendering: function(){
+ this._clsName = this.barType == "segmentedControl" ? "mblTabButton" : "mblTabBarButton";
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("H1");
+ this.domNode.className = this.barType == "segmentedControl" ? "mblTabPanelHeader" : "mblTabBar";
+ },
+
+ postCreate: function(){
+ if(dojo.global.onorientationchange !== undefined){
+ this.connect(dojo.global, "onorientationchange", "onResize");
+ }else{
+ this.connect(dojo.global, "onresize", "onResize");
+ }
+ },
+
+ startup: function(){
+ var _this = this;
+ setTimeout(function(){ // to get proper dimension
+ _this.onResize();
+ }, 0);
+ },
+
+ onResize: function(){
+ var i;
+ var w = dojo.marginBox(this.domNode.parentNode).w;
+ var bw = this._fixedButtonWidth;
+ var bm = this._fixedButtonMargin;
+
+ var children = this.containerNode.childNodes;
+ var arr = [];
+ for(i = 0; i < children.length; i++){
+ var c = children[i];
+ if(c.nodeType != 1){ continue; }
+ if(dojo.hasClass(c, this._clsName)){
+ arr.push(c);
+ }
+ }
+
+ var margin;
+ if(this.barType == "segmentedControl"){
+ margin = w;
+ var totalW = 0; // total width of all the buttons
+ for(i = 0; i < arr.length; i++){
+ margin -= dojo.marginBox(arr[i]).w;
+ arr[i].style.marginTop = "3px";
+ totalW += arr[i].offsetWidth;
+ }
+ margin = Math.floor(margin/2);
+ var parent = dijit.getEnclosingWidget(this.domNode.parentNode);
+ var inHeading = this.inHeading || parent instanceof dojox.mobile.Heading;
+ this.containerNode.style.padding = "3px 0px 0px " + (inHeading ? 0 : margin) + "px";
+ if(inHeading){
+ dojo.style(this.domNode, {
+ background: "none",
+ border: "none",
+ width: totalW + 2 + "px"
+ });
+ }
+ }else{
+ margin = Math.floor((w - (bw + bm * 2) * arr.length) / 2);
+ if(w < this._largeScreenWidth || margin < 0){
+ // If # of buttons is 4, for example, assign "25%" to each button.
+ // More precisely, 1%(left margin) + 98%(bar width) + 1%(right margin)
+ for(i = 0; i < arr.length; i++){
+ arr[i].style.width = Math.round(98/arr.length) + "%";
+ arr[i].style.margin = "0px";
+ }
+ this.containerNode.style.padding = "0px 0px 0px 1%";
+ }else{
+ // Fixed width buttons. Mainly for larger screen such as iPad.
+ for(i = 0; i < arr.length; i++){
+ arr[i].style.width = bw + "px";
+ arr[i].style.margin = "0 " + bm + "px";
+ }
+ this.containerNode.style.padding = "0px 0px 0px " + margin + "px";
+ }
+ }
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.TabBarButton",
+ dojox.mobile.AbstractItem,
+{
+ icon1: "", // unselected (dark) icon
+ icon2: "", // selected (highlight) icon
+ iconPos1: "", // unselected (dark) icon position
+ iconPos2: "", // selected (highlight) icon position
+ selected: false,
+ transition: "none",
+ tag: "LI",
+ selectOne: true,
+
+ inheritParams: function(){
+ var parent = this.getParentWidget();
+ this.parent = parent;
+ if(parent){
+ if(!this.transition){ this.transition = parent.transition; }
+ if(!this.icon1){ this.icon1 = parent.iconBase; }
+ if(!this.iconPos1){ this.iconPos1 = parent.iconPos; }
+ if(!this.icon2){ this.icon2 = parent.iconBase || this.icon1; }
+ if(!this.iconPos2){ this.iconPos2 = parent.iconPos || this.iconPos1; }
+ }
+ },
+
+ buildRendering: function(){
+ this.inheritParams();
+
+ this.anchorNode = dojo.create("A", {className:"mblTabBarButtonAnchor"});
+ var a = this.anchorNode;
+ this.connect(a, "onclick", "onClick");
+
+ var div = dojo.create("DIV", {className:"mblTabBarButtonDiv"}, a);
+ var divInner = dojo.create("DIV", {className:"mblTabBarButtonDiv mblTabBarButtonDivInner"}, div);
+
+ this.img1 = dojo.create("IMG", {className:"mblTabBarButtonIcon", src:this.icon1}, divInner);
+ this.img1.style.visibility = this.selected ? "hidden" : "";
+ dojox.mobile.setupIcon(this.img1, this.iconPos1);
+ this.img1.onload = function(){
+ // iPhone and Windows Safari sometimes fail to draw icon images.
+ // For some reason, this code solves the problem.
+ // Other browsers, including Chrome, do not have this problem.
+ this.style.width = this.width + "px";
+ this.style.height = this.height + "px";
+ };
+
+ this.img2 = dojo.create("IMG", {className:"mblTabBarButtonIcon", src:this.icon2}, divInner);
+ this.img2.style.visibility = this.selected ? "" : "hidden";
+ dojox.mobile.setupIcon(this.img2, this.iconPos2);
+ this.img2.onload = function(){
+ this.style.width = this.width + "px";
+ this.style.height = this.height + "px";
+ };
+
+ this.box = dojo.create("DIV", {className:"mblTabBarButtonTextBox"}, a);
+ var box = this.box;
+ var r = this.srcNodeRef;
+ if(r){
+ for(var i = 0, len = r.childNodes.length; i < len; i++){
+ box.appendChild(r.firstChild);
+ }
+ }
+ if(this.label){
+ box.appendChild(dojo.doc.createTextNode(this.label));
+ }
+
+ this.domNode = this.srcNodeRef || dojo.create(this.tag);
+ this.containerNode = this.domNode;
+ var _clsName = this.parent ? this.parent._clsName : "mblTabBarButton";
+ dojo.addClass(this.domNode, _clsName + (this.selected ? " mblTabButtonSelected" : ""));
+ this.domNode.appendChild(a);
+
+ this.createDomButton(this.domNode, a);
+ },
+
+ startup: function(){
+ var parent = this.getParentWidget();
+ this.parent = parent;
+ if(parent && parent.barType == "segmentedControl"){
+ // proper className may not be set when created dynamically
+ dojo.removeClass(this.domNode, "mblTabBarButton");
+ dojo.addClass(this.domNode, parent._clsName);
+ this.box.className = "";
+ }
+ },
+
+ select: function(deselect){
+ if(deselect){
+ this.selected = false;
+ dojo.removeClass(this.domNode, "mblTabButtonSelected");
+ }else{
+ this.selected = true;
+ dojo.addClass(this.domNode, "mblTabButtonSelected");
+ for(var i = 0, c = this.domNode.parentNode.childNodes; i < c.length; i++){
+ if(c[i].nodeType != 1){ continue; }
+ var w = dijit.byNode(c[i]); // sibling widget
+ if(w && w != this){
+ w.select(true);
+ }
+ }
+ }
+ this.img1.style.visibility = this.selected ? "hidden" : "";
+ this.img2.style.visibility = this.selected ? "" : "hidden";
+ },
+
+ onClick: function(e){
+ this.defaultClickAction();
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/mobile/TabBar.xd.js b/js/dojo-1.6/dojox/mobile/TabBar.xd.js
new file mode 100644
index 0000000..70211aa
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/TabBar.xd.js
@@ -0,0 +1,221 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.mobile.TabBar"],
+["require", "dojox.mobile"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.mobile.TabBar"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.TabBar"] = true;
+dojo.provide("dojox.mobile.TabBar");
+
+dojo.require("dojox.mobile");
+
+dojo.declare(
+ "dojox.mobile.TabBar",
+ dijit._WidgetBase,
+{
+ iconBase: "",
+ iconPos: "",
+ barType: "tabBar", // "tabBar"(default) or "segmentedControl"
+ inHeading: false,
+
+ _fixedButtonWidth: 76,
+ _fixedButtonMargin: 17,
+ _largeScreenWidth: 500,
+
+ buildRendering: function(){
+ this._clsName = this.barType == "segmentedControl" ? "mblTabButton" : "mblTabBarButton";
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("H1");
+ this.domNode.className = this.barType == "segmentedControl" ? "mblTabPanelHeader" : "mblTabBar";
+ },
+
+ postCreate: function(){
+ if(dojo.global.onorientationchange !== undefined){
+ this.connect(dojo.global, "onorientationchange", "onResize");
+ }else{
+ this.connect(dojo.global, "onresize", "onResize");
+ }
+ },
+
+ startup: function(){
+ var _this = this;
+ setTimeout(function(){ // to get proper dimension
+ _this.onResize();
+ }, 0);
+ },
+
+ onResize: function(){
+ var i;
+ var w = dojo.marginBox(this.domNode.parentNode).w;
+ var bw = this._fixedButtonWidth;
+ var bm = this._fixedButtonMargin;
+
+ var children = this.containerNode.childNodes;
+ var arr = [];
+ for(i = 0; i < children.length; i++){
+ var c = children[i];
+ if(c.nodeType != 1){ continue; }
+ if(dojo.hasClass(c, this._clsName)){
+ arr.push(c);
+ }
+ }
+
+ var margin;
+ if(this.barType == "segmentedControl"){
+ margin = w;
+ var totalW = 0; // total width of all the buttons
+ for(i = 0; i < arr.length; i++){
+ margin -= dojo.marginBox(arr[i]).w;
+ arr[i].style.marginTop = "3px";
+ totalW += arr[i].offsetWidth;
+ }
+ margin = Math.floor(margin/2);
+ var parent = dijit.getEnclosingWidget(this.domNode.parentNode);
+ var inHeading = this.inHeading || parent instanceof dojox.mobile.Heading;
+ this.containerNode.style.padding = "3px 0px 0px " + (inHeading ? 0 : margin) + "px";
+ if(inHeading){
+ dojo.style(this.domNode, {
+ background: "none",
+ border: "none",
+ width: totalW + 2 + "px"
+ });
+ }
+ }else{
+ margin = Math.floor((w - (bw + bm * 2) * arr.length) / 2);
+ if(w < this._largeScreenWidth || margin < 0){
+ // If # of buttons is 4, for example, assign "25%" to each button.
+ // More precisely, 1%(left margin) + 98%(bar width) + 1%(right margin)
+ for(i = 0; i < arr.length; i++){
+ arr[i].style.width = Math.round(98/arr.length) + "%";
+ arr[i].style.margin = "0px";
+ }
+ this.containerNode.style.padding = "0px 0px 0px 1%";
+ }else{
+ // Fixed width buttons. Mainly for larger screen such as iPad.
+ for(i = 0; i < arr.length; i++){
+ arr[i].style.width = bw + "px";
+ arr[i].style.margin = "0 " + bm + "px";
+ }
+ this.containerNode.style.padding = "0px 0px 0px " + margin + "px";
+ }
+ }
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.TabBarButton",
+ dojox.mobile.AbstractItem,
+{
+ icon1: "", // unselected (dark) icon
+ icon2: "", // selected (highlight) icon
+ iconPos1: "", // unselected (dark) icon position
+ iconPos2: "", // selected (highlight) icon position
+ selected: false,
+ transition: "none",
+ tag: "LI",
+ selectOne: true,
+
+ inheritParams: function(){
+ var parent = this.getParentWidget();
+ this.parent = parent;
+ if(parent){
+ if(!this.transition){ this.transition = parent.transition; }
+ if(!this.icon1){ this.icon1 = parent.iconBase; }
+ if(!this.iconPos1){ this.iconPos1 = parent.iconPos; }
+ if(!this.icon2){ this.icon2 = parent.iconBase || this.icon1; }
+ if(!this.iconPos2){ this.iconPos2 = parent.iconPos || this.iconPos1; }
+ }
+ },
+
+ buildRendering: function(){
+ this.inheritParams();
+
+ this.anchorNode = dojo.create("A", {className:"mblTabBarButtonAnchor"});
+ var a = this.anchorNode;
+ this.connect(a, "onclick", "onClick");
+
+ var div = dojo.create("DIV", {className:"mblTabBarButtonDiv"}, a);
+ var divInner = dojo.create("DIV", {className:"mblTabBarButtonDiv mblTabBarButtonDivInner"}, div);
+
+ this.img1 = dojo.create("IMG", {className:"mblTabBarButtonIcon", src:this.icon1}, divInner);
+ this.img1.style.visibility = this.selected ? "hidden" : "";
+ dojox.mobile.setupIcon(this.img1, this.iconPos1);
+ this.img1.onload = function(){
+ // iPhone and Windows Safari sometimes fail to draw icon images.
+ // For some reason, this code solves the problem.
+ // Other browsers, including Chrome, do not have this problem.
+ this.style.width = this.width + "px";
+ this.style.height = this.height + "px";
+ };
+
+ this.img2 = dojo.create("IMG", {className:"mblTabBarButtonIcon", src:this.icon2}, divInner);
+ this.img2.style.visibility = this.selected ? "" : "hidden";
+ dojox.mobile.setupIcon(this.img2, this.iconPos2);
+ this.img2.onload = function(){
+ this.style.width = this.width + "px";
+ this.style.height = this.height + "px";
+ };
+
+ this.box = dojo.create("DIV", {className:"mblTabBarButtonTextBox"}, a);
+ var box = this.box;
+ var r = this.srcNodeRef;
+ if(r){
+ for(var i = 0, len = r.childNodes.length; i < len; i++){
+ box.appendChild(r.firstChild);
+ }
+ }
+ if(this.label){
+ box.appendChild(dojo.doc.createTextNode(this.label));
+ }
+
+ this.domNode = this.srcNodeRef || dojo.create(this.tag);
+ this.containerNode = this.domNode;
+ var _clsName = this.parent ? this.parent._clsName : "mblTabBarButton";
+ dojo.addClass(this.domNode, _clsName + (this.selected ? " mblTabButtonSelected" : ""));
+ this.domNode.appendChild(a);
+
+ this.createDomButton(this.domNode, a);
+ },
+
+ startup: function(){
+ var parent = this.getParentWidget();
+ this.parent = parent;
+ if(parent && parent.barType == "segmentedControl"){
+ // proper className may not be set when created dynamically
+ dojo.removeClass(this.domNode, "mblTabBarButton");
+ dojo.addClass(this.domNode, parent._clsName);
+ this.box.className = "";
+ }
+ },
+
+ select: function(deselect){
+ if(deselect){
+ this.selected = false;
+ dojo.removeClass(this.domNode, "mblTabButtonSelected");
+ }else{
+ this.selected = true;
+ dojo.addClass(this.domNode, "mblTabButtonSelected");
+ for(var i = 0, c = this.domNode.parentNode.childNodes; i < c.length; i++){
+ if(c[i].nodeType != 1){ continue; }
+ var w = dijit.byNode(c[i]); // sibling widget
+ if(w && w != this){
+ w.select(true);
+ }
+ }
+ }
+ this.img1.style.visibility = this.selected ? "hidden" : "";
+ this.img2.style.visibility = this.selected ? "" : "hidden";
+ },
+
+ onClick: function(e){
+ this.defaultClickAction();
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/mobile/TabContainer.js b/js/dojo-1.6/dojox/mobile/TabContainer.js
new file mode 100644
index 0000000..170498c
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/TabContainer.js
@@ -0,0 +1,162 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.mobile.TabContainer"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.TabContainer"] = true;
+dojo.provide("dojox.mobile.TabContainer");
+
+dojo.require("dojox.mobile");
+
+// Deprecated. Use dojox.mobile.TabBar instead.
+dojo.declare(
+ "dojox.mobile.TabContainer",
+ dijit._WidgetBase,
+{
+ iconBase: "",
+ iconPos: "",
+ fixedHeader: false,
+
+ constructor: function(){
+ dojo.deprecated("dojox.mobile.TabContainer is deprecated", "use dojox.mobile.TabBar instead", 2.0);
+ },
+
+ buildRendering: function(){
+ var node = this.domNode = this.srcNodeRef;
+ node.className = "mblTabContainer";
+ var headerNode = this.tabHeaderNode = dojo.doc.createElement("DIV");
+ var paneNode = this.containerNode = dojo.doc.createElement("DIV");
+
+ // reparent
+ for(var i = 0, len = node.childNodes.length; i < len; i++){
+ paneNode.appendChild(node.removeChild(node.firstChild));
+ }
+
+ headerNode.className = "mblTabPanelHeader";
+ headerNode.align = "center";
+ if(this.fixedHeader){
+ var view = dijit.getEnclosingWidget(this.domNode.parentNode); // parentNode is null if created programmatically
+ view.domNode.insertBefore(headerNode, view.domNode.firstChild);
+ dojo.style(headerNode, {
+ position: "absolute",
+ width: "100%",
+ top: "0px",
+ zIndex: "1"
+ });
+ view.fixedHeader = headerNode;
+ }else{
+ node.appendChild(headerNode);
+ }
+ paneNode.className = "mblTabPanelPane";
+ node.appendChild(paneNode);
+ },
+
+ startup: function(){
+ this.createTabButtons();
+ this.inherited(arguments);
+ },
+
+ createTabButtons: function(){
+ var div = dojo.doc.createElement("DIV");
+ div.align = "center";
+ var tbl = dojo.doc.createElement("TABLE");
+ var cell = tbl.insertRow(-1).insertCell(-1);
+ var children = this.containerNode.childNodes;
+ for(var i = 0; i < children.length; i++){
+ var pane = children[i];
+ if(pane.nodeType != 1){ continue; }
+ var widget = dijit.byNode(pane);
+ if(widget.selected || !this._selectedPane){
+ this._selectedPane = widget;
+ }
+ pane.style.display = "none";
+ var tab = dojo.doc.createElement("DIV");
+ tab.className = "mblTabButton";
+ if(widget.icon){
+ var imgDiv = dojo.create("DIV");
+ var img = dojo.create("IMG");
+ imgDiv.className = "mblTabButtonImgDiv";
+ img.src = widget.icon;
+ dojox.mobile.setupIcon(img, widget.iconPos);
+ imgDiv.appendChild(img);
+ tab.appendChild(imgDiv);
+ }
+ tab.appendChild(dojo.doc.createTextNode(widget.label));
+ tab.pane = widget;
+ widget.tab = tab;
+ this.connect(tab, "onclick", "onTabClick");
+ cell.appendChild(tab);
+ }
+ div.appendChild(tbl);
+ this.tabHeaderNode.appendChild(div);
+ this.selectTab(this._selectedPane.tab);
+ },
+
+ selectTab: function(/*DomNode*/tab){
+ this._selectedPane.domNode.style.display = "none";
+ dojo.removeClass(this._selectedPane.tab, "mblTabButtonSelected");
+ this._selectedPane = tab.pane;
+ this._selectedPane.domNode.style.display = "";
+ dojo.addClass(tab, "mblTabButtonSelected");
+ if(dojo.isBB){
+ var ref = tab.nextSibling;
+ tab.parentNode.insertBefore(tab.parentNode.removeChild(tab), ref);
+ }
+ var view = dijit.getEnclosingWidget(this.domNode.parentNode);
+ if(this.fixedHeader){
+ // This widget stacks multiple panes and controls their visibility.
+ // Each pane cannot have its own scroll position status, because
+ // the entire widget scrolls.
+ // When in the fixedHeader mode, the user can always select a tab
+ // even when the current pane is scrolled down to the bottom.
+ // Even in such cases, the next page should be shown from the top.
+ if(view && view.scrollTo){
+ view.scrollTo({y:0});
+ }
+ }
+ view.flashScrollBar && view.flashScrollBar();
+ },
+
+ onTabClick: function(e){
+ var tab = e.currentTarget;
+ dojo.addClass(tab, "mblTabButtonHighlighted");
+ setTimeout(function(){
+ dojo.removeClass(tab, "mblTabButtonHighlighted");
+ }, 200);
+ this.selectTab(tab);
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.TabPane",
+ dijit._WidgetBase,
+{
+ label: "",
+ icon: "",
+ iconPos: "",
+ selected: false,
+
+ inheritParams: function(){
+ var parent = this.getParentWidget();
+ if(parent){
+ if(!this.icon){ this.icon = parent.iconBase; }
+ if(!this.iconPos){ this.iconPos = parent.iconPos; }
+ }
+ },
+
+ buildRendering: function(){
+ this.inheritParams();
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("DIV");
+ this.domNode.className = "mblTabPane";
+ },
+
+ getParentWidget: function(){
+ var ref = this.srcNodeRef || this.domNode;
+ return ref && ref.parentNode ? dijit.getEnclosingWidget(ref.parentNode) : null;
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/mobile/TabContainer.xd.js b/js/dojo-1.6/dojox/mobile/TabContainer.xd.js
new file mode 100644
index 0000000..b2a7d75
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/TabContainer.xd.js
@@ -0,0 +1,167 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.mobile.TabContainer"],
+["require", "dojox.mobile"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.mobile.TabContainer"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.TabContainer"] = true;
+dojo.provide("dojox.mobile.TabContainer");
+
+dojo.require("dojox.mobile");
+
+// Deprecated. Use dojox.mobile.TabBar instead.
+dojo.declare(
+ "dojox.mobile.TabContainer",
+ dijit._WidgetBase,
+{
+ iconBase: "",
+ iconPos: "",
+ fixedHeader: false,
+
+ constructor: function(){
+ dojo.deprecated("dojox.mobile.TabContainer is deprecated", "use dojox.mobile.TabBar instead", 2.0);
+ },
+
+ buildRendering: function(){
+ var node = this.domNode = this.srcNodeRef;
+ node.className = "mblTabContainer";
+ var headerNode = this.tabHeaderNode = dojo.doc.createElement("DIV");
+ var paneNode = this.containerNode = dojo.doc.createElement("DIV");
+
+ // reparent
+ for(var i = 0, len = node.childNodes.length; i < len; i++){
+ paneNode.appendChild(node.removeChild(node.firstChild));
+ }
+
+ headerNode.className = "mblTabPanelHeader";
+ headerNode.align = "center";
+ if(this.fixedHeader){
+ var view = dijit.getEnclosingWidget(this.domNode.parentNode); // parentNode is null if created programmatically
+ view.domNode.insertBefore(headerNode, view.domNode.firstChild);
+ dojo.style(headerNode, {
+ position: "absolute",
+ width: "100%",
+ top: "0px",
+ zIndex: "1"
+ });
+ view.fixedHeader = headerNode;
+ }else{
+ node.appendChild(headerNode);
+ }
+ paneNode.className = "mblTabPanelPane";
+ node.appendChild(paneNode);
+ },
+
+ startup: function(){
+ this.createTabButtons();
+ this.inherited(arguments);
+ },
+
+ createTabButtons: function(){
+ var div = dojo.doc.createElement("DIV");
+ div.align = "center";
+ var tbl = dojo.doc.createElement("TABLE");
+ var cell = tbl.insertRow(-1).insertCell(-1);
+ var children = this.containerNode.childNodes;
+ for(var i = 0; i < children.length; i++){
+ var pane = children[i];
+ if(pane.nodeType != 1){ continue; }
+ var widget = dijit.byNode(pane);
+ if(widget.selected || !this._selectedPane){
+ this._selectedPane = widget;
+ }
+ pane.style.display = "none";
+ var tab = dojo.doc.createElement("DIV");
+ tab.className = "mblTabButton";
+ if(widget.icon){
+ var imgDiv = dojo.create("DIV");
+ var img = dojo.create("IMG");
+ imgDiv.className = "mblTabButtonImgDiv";
+ img.src = widget.icon;
+ dojox.mobile.setupIcon(img, widget.iconPos);
+ imgDiv.appendChild(img);
+ tab.appendChild(imgDiv);
+ }
+ tab.appendChild(dojo.doc.createTextNode(widget.label));
+ tab.pane = widget;
+ widget.tab = tab;
+ this.connect(tab, "onclick", "onTabClick");
+ cell.appendChild(tab);
+ }
+ div.appendChild(tbl);
+ this.tabHeaderNode.appendChild(div);
+ this.selectTab(this._selectedPane.tab);
+ },
+
+ selectTab: function(/*DomNode*/tab){
+ this._selectedPane.domNode.style.display = "none";
+ dojo.removeClass(this._selectedPane.tab, "mblTabButtonSelected");
+ this._selectedPane = tab.pane;
+ this._selectedPane.domNode.style.display = "";
+ dojo.addClass(tab, "mblTabButtonSelected");
+ if(dojo.isBB){
+ var ref = tab.nextSibling;
+ tab.parentNode.insertBefore(tab.parentNode.removeChild(tab), ref);
+ }
+ var view = dijit.getEnclosingWidget(this.domNode.parentNode);
+ if(this.fixedHeader){
+ // This widget stacks multiple panes and controls their visibility.
+ // Each pane cannot have its own scroll position status, because
+ // the entire widget scrolls.
+ // When in the fixedHeader mode, the user can always select a tab
+ // even when the current pane is scrolled down to the bottom.
+ // Even in such cases, the next page should be shown from the top.
+ if(view && view.scrollTo){
+ view.scrollTo({y:0});
+ }
+ }
+ view.flashScrollBar && view.flashScrollBar();
+ },
+
+ onTabClick: function(e){
+ var tab = e.currentTarget;
+ dojo.addClass(tab, "mblTabButtonHighlighted");
+ setTimeout(function(){
+ dojo.removeClass(tab, "mblTabButtonHighlighted");
+ }, 200);
+ this.selectTab(tab);
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.TabPane",
+ dijit._WidgetBase,
+{
+ label: "",
+ icon: "",
+ iconPos: "",
+ selected: false,
+
+ inheritParams: function(){
+ var parent = this.getParentWidget();
+ if(parent){
+ if(!this.icon){ this.icon = parent.iconBase; }
+ if(!this.iconPos){ this.iconPos = parent.iconPos; }
+ }
+ },
+
+ buildRendering: function(){
+ this.inheritParams();
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("DIV");
+ this.domNode.className = "mblTabPane";
+ },
+
+ getParentWidget: function(){
+ var ref = this.srcNodeRef || this.domNode;
+ return ref && ref.parentNode ? dijit.getEnclosingWidget(ref.parentNode) : null;
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/mobile/_ScrollableMixin.js b/js/dojo-1.6/dojox/mobile/_ScrollableMixin.js
new file mode 100644
index 0000000..f9731f9
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/_ScrollableMixin.js
@@ -0,0 +1,62 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.mobile._ScrollableMixin"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile._ScrollableMixin"] = true;
+dojo.provide("dojox.mobile._ScrollableMixin");
+
+dojo.require("dijit._WidgetBase");
+dojo.require("dojox.mobile.scrollable");
+
+// summary:
+// Mixin for widgets to have a touch scrolling capability.
+// description:
+// Actual implementation is in scrollable.js.
+// scrollable.js is not a dojo class, but just a collection
+// of functions. This module makes scrollable.js a dojo class.
+
+dojo.declare(
+ "dojox.mobile._ScrollableMixin",
+ null,
+{
+ fixedHeader: "",
+ fixedFooter: "",
+
+ destroy: function(){
+ this.cleanup();
+ this.inherited(arguments);
+ },
+
+ startup: function(){
+ var params = {};
+ if(this.fixedHeader){
+ params.fixedHeaderHeight = dojo.byId(this.fixedHeader).offsetHeight;
+ }
+ if(this.fixedFooter){
+ var node = dojo.byId(this.fixedFooter);
+ if(node.parentNode == this.domNode){ // local footer
+ this.isLocalFooter = true;
+ node.style.bottom = "0px";
+ }
+ params.fixedFooterHeight = node.offsetHeight;
+ }
+ this.init(params);
+ this.inherited(arguments);
+ }
+});
+(function(){
+ var obj = new dojox.mobile.scrollable();
+ dojo.extend(dojox.mobile._ScrollableMixin, obj);
+ if(dojo.version.major == 1 && dojo.version.minor == 4){
+ // dojo-1.4 had a problem in inheritance behavior. (#10709 and #10788)
+ // This is a workaround to avoid the problem.
+ // There is no such a problem in dojo-1.3 and dojo-1.5.
+ dojo.mixin(dojox.mobile._ScrollableMixin._meta.hidden, obj);
+ }
+})();
+
+}
diff --git a/js/dojo-1.6/dojox/mobile/_ScrollableMixin.xd.js b/js/dojo-1.6/dojox/mobile/_ScrollableMixin.xd.js
new file mode 100644
index 0000000..fc3041a
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/_ScrollableMixin.xd.js
@@ -0,0 +1,68 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.mobile._ScrollableMixin"],
+["require", "dijit._WidgetBase"],
+["require", "dojox.mobile.scrollable"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.mobile._ScrollableMixin"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile._ScrollableMixin"] = true;
+dojo.provide("dojox.mobile._ScrollableMixin");
+
+dojo.require("dijit._WidgetBase");
+dojo.require("dojox.mobile.scrollable");
+
+// summary:
+// Mixin for widgets to have a touch scrolling capability.
+// description:
+// Actual implementation is in scrollable.js.
+// scrollable.js is not a dojo class, but just a collection
+// of functions. This module makes scrollable.js a dojo class.
+
+dojo.declare(
+ "dojox.mobile._ScrollableMixin",
+ null,
+{
+ fixedHeader: "",
+ fixedFooter: "",
+
+ destroy: function(){
+ this.cleanup();
+ this.inherited(arguments);
+ },
+
+ startup: function(){
+ var params = {};
+ if(this.fixedHeader){
+ params.fixedHeaderHeight = dojo.byId(this.fixedHeader).offsetHeight;
+ }
+ if(this.fixedFooter){
+ var node = dojo.byId(this.fixedFooter);
+ if(node.parentNode == this.domNode){ // local footer
+ this.isLocalFooter = true;
+ node.style.bottom = "0px";
+ }
+ params.fixedFooterHeight = node.offsetHeight;
+ }
+ this.init(params);
+ this.inherited(arguments);
+ }
+});
+(function(){
+ var obj = new dojox.mobile.scrollable();
+ dojo.extend(dojox.mobile._ScrollableMixin, obj);
+ if(dojo.version.major == 1 && dojo.version.minor == 4){
+ // dojo-1.4 had a problem in inheritance behavior. (#10709 and #10788)
+ // This is a workaround to avoid the problem.
+ // There is no such a problem in dojo-1.3 and dojo-1.5.
+ dojo.mixin(dojox.mobile._ScrollableMixin._meta.hidden, obj);
+ }
+})();
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/mobile/_base.js b/js/dojo-1.6/dojox/mobile/_base.js
new file mode 100644
index 0000000..af0a87e
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/_base.js
@@ -0,0 +1,1215 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.mobile._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile._base"] = true;
+dojo.provide("dojox.mobile._base");
+
+dojo.require("dijit._WidgetBase");
+dojo.isBB = (navigator.userAgent.indexOf("BlackBerry") != -1) && !dojo.isWebKit;
+
+// summary:
+// Mobile Widgets
+// description:
+// This module provides a number of widgets that can be used to build
+// web-based applications for mobile devices such as iPhone or Android.
+// These widgets work best with webkit-based browsers, such as Safari or
+// Chrome, since webkit-specific CSS3 features are used.
+// However, the widgets should work in a "graceful degradation" manner
+// even on non-CSS3 browsers, such as IE or Firefox. In that case,
+// fancy effects, such as animation, gradient color, or round corner
+// rectangle, may not work, but you can still operate your application.
+//
+// Furthermore, as a separate file, a compatibility module,
+// dojox.mobile.compat, is available that simulates some of CSS3 features
+// used in this module. If you use the compatibility module, fancy visual
+// effects work better even on non-CSS3 browsers.
+//
+// Note that use of dijit._Container, dijit._Contained, dijit._Templated,
+// and dojo.query is intentionally avoided to reduce download code size.
+
+dojo.declare(
+ "dojox.mobile.View",
+ dijit._WidgetBase,
+{
+ // summary:
+ // A widget that represents a view that occupies the full screen
+ // description:
+ // View acts as a container for any HTML and/or widgets. An entire HTML page
+ // can have multiple View widgets and the user can navigate through
+ // the views back and forth without page transitions.
+
+ // selected: Boolean
+ // If true, the view is displayed at startup time.
+ selected: false,
+
+ // keepScrollPos: Boolean
+ // If true, the scroll position is kept between views.
+ keepScrollPos: true,
+
+ _started: false,
+
+ constructor: function(params, node){
+ if(node){
+ dojo.byId(node).style.visibility = "hidden";
+ }
+ },
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("DIV");
+ this.domNode.className = "mblView";
+ this.connect(this.domNode, "webkitAnimationEnd", "onAnimationEnd");
+ this.connect(this.domNode, "webkitAnimationStart", "onAnimationStart");
+ var id = location.href.match(/#(\w+)([^\w=]|$)/) ? RegExp.$1 : null;
+
+ this._visible = this.selected && !id || this.id == id;
+
+ if(this.selected){
+ dojox.mobile._defaultView = this;
+ }
+ },
+
+ startup: function(){
+ if(this._started){ return; }
+ var _this = this;
+ setTimeout(function(){
+ if(!_this._visible){
+ _this.domNode.style.display = "none";
+ }else{
+ dojox.mobile.currentView = _this;
+ _this.onStartView();
+ }
+ _this.domNode.style.visibility = "visible";
+ }, dojo.isIE?100:0); // give IE a little time to complete drawing
+ this._started = true;
+ },
+
+ onStartView: function(){
+ // Stub function to connect to from your application.
+ // Called only when this view is shown at startup time.
+ },
+
+ onBeforeTransitionIn: function(moveTo, dir, transition, context, method){
+ // Stub function to connect to from your application.
+ },
+
+ onAfterTransitionIn: function(moveTo, dir, transition, context, method){
+ // Stub function to connect to from your application.
+ },
+
+ onBeforeTransitionOut: function(moveTo, dir, transition, context, method){
+ // Stub function to connect to from your application.
+ },
+
+ onAfterTransitionOut: function(moveTo, dir, transition, context, method){
+ // Stub function to connect to from your application.
+ },
+
+ _saveState: function(moveTo, dir, transition, context, method){
+ this._context = context;
+ this._method = method;
+ if(transition == "none" || !dojo.isWebKit){
+ transition = null;
+ }
+ this._moveTo = moveTo;
+ this._dir = dir;
+ this._transition = transition;
+ this._arguments = [];
+ var i;
+ for(i = 0; i < arguments.length; i++){
+ this._arguments.push(arguments[i]);
+ }
+ this._args = [];
+ if(context || method){
+ for(i = 5; i < arguments.length; i++){
+ this._args.push(arguments[i]);
+ }
+ }
+ },
+
+ performTransition: function(/*String*/moveTo, /*Number*/dir, /*String*/transition,
+ /*Object|null*/context, /*String|Function*/method /*optional args*/){
+ // summary:
+ // Function to perform the various types of view transitions, such as fade, slide, and flip.
+ // moveTo: String
+ // The destination view id to transition the current view to.
+ // If null, transitions to a blank view.
+ // dir: Number
+ // The transition direction. If 1, transition forward. If -1, transition backward.
+ // For example, the slide transition slides the view from right to left when dir == 1,
+ // and from left to right when dir == -1.
+ // transision: String
+ // The type of transition to perform. "slide", "fade", or "flip"
+ // context: Object
+ // The object that the callback function will receive as "this".
+ // method: String|Function
+ // A callback function that is called when the transition has been finished.
+ // A function reference, or name of a function in context.
+ // tags:
+ // public
+ // example:
+ // Transitions to the blank view, and then opens another page.
+ // | performTransition(null, 1, "slide", null, function(){location.href = href;});
+ if(dojo.hash){
+ if(typeof(moveTo) == "string" && moveTo.charAt(0) == '#' && !dojox.mobile._params){
+ dojox.mobile._params = [];
+ for(var i = 0; i < arguments.length; i++){
+ dojox.mobile._params.push(arguments[i]);
+ }
+ dojo.hash(moveTo);
+ return;
+ }
+ }
+ this._saveState.apply(this, arguments);
+ var toNode;
+ if(moveTo){
+ if(typeof(moveTo) == "string"){
+ // removes a leading hash mark (#) and params if exists
+ // ex. "#bar&myParam=0003" -> "bar"
+ moveTo.match(/^#?([^&]+)/);
+ toNode = RegExp.$1;
+ }else{
+ toNode = moveTo;
+ }
+ }else{
+ if(!this._dummyNode){
+ this._dummyNode = dojo.doc.createElement("DIV");
+ dojo.body().appendChild(this._dummyNode);
+ }
+ toNode = this._dummyNode;
+ }
+ var fromNode = this.domNode;
+ toNode = this.toNode = dojo.byId(toNode);
+ if(!toNode){ alert("dojox.mobile.View#performTransition: destination view not found: "+toNode); }
+ toNode.style.visibility = "hidden";
+ toNode.style.display = "";
+ this.onBeforeTransitionOut.apply(this, arguments);
+ var toWidget = dijit.byNode(toNode);
+ if(toWidget){
+ // perform view transition keeping the scroll position
+ if(this.keepScrollPos && !dijit.getEnclosingWidget(this.domNode.parentNode)){
+ var scrollTop = dojo.body().scrollTop || dojo.doc.documentElement.scrollTop || dojo.global.pageYOffset || 0;
+ if(dir == 1){
+ toNode.style.top = "0px";
+ if(scrollTop > 1){
+ fromNode.style.top = -scrollTop + "px";
+ if(dojo.config["mblHideAddressBar"] !== false){
+ setTimeout(function(){ // iPhone needs setTimeout
+ dojo.global.scrollTo(0, 1);
+ }, 0);
+ }
+ }
+ }else{
+ if(scrollTop > 1 || toNode.offsetTop !== 0){
+ var toTop = -toNode.offsetTop;
+ toNode.style.top = "0px";
+ fromNode.style.top = toTop - scrollTop + "px";
+ if(dojo.config["mblHideAddressBar"] !== false && toTop > 0){
+ setTimeout(function(){ // iPhone needs setTimeout
+ dojo.global.scrollTo(0, toTop + 1);
+ }, 0);
+ }
+ }
+ }
+ }else{
+ toNode.style.top = "0px";
+ }
+ toWidget.onBeforeTransitionIn.apply(toWidget, arguments);
+ }
+ toNode.style.display = "none";
+ toNode.style.visibility = "visible";
+ this._doTransition(fromNode, toNode, transition, dir);
+ },
+
+ _doTransition: function(fromNode, toNode, transition, dir){
+ var rev = (dir == -1) ? " reverse" : "";
+ toNode.style.display = "";
+ if(!transition || transition == "none"){
+ this.domNode.style.display = "none";
+ this.invokeCallback();
+ }else{
+ dojo.addClass(fromNode, transition + " out" + rev);
+ dojo.addClass(toNode, transition + " in" + rev);
+ }
+ },
+
+ onAnimationStart: function(e){
+ },
+
+ onAnimationEnd: function(e){
+ var isOut = false;
+ if(dojo.hasClass(this.domNode, "out")){
+ isOut = true;
+ this.domNode.style.display = "none";
+ dojo.forEach([this._transition,"in","out","reverse"], function(s){
+ dojo.removeClass(this.domNode, s);
+ }, this);
+ }
+ if(e.animationName.indexOf("shrink") === 0){
+ var li = e.target;
+ li.style.display = "none";
+ dojo.removeClass(li, "mblCloseContent");
+ }
+ if(isOut){
+ this.invokeCallback();
+ }
+ // this.domNode may be destroyed as a result of invoking the callback,
+ // so check for that before accessing it.
+ this.domNode && (this.domNode.className = "mblView");
+ },
+
+ invokeCallback: function(){
+ this.onAfterTransitionOut.apply(this, this._arguments);
+ var toWidget = dijit.byNode(this.toNode);
+ if(toWidget){
+ toWidget.onAfterTransitionIn.apply(toWidget, this._arguments);
+ }
+
+ dojox.mobile.currentView = toWidget;
+
+ var c = this._context, m = this._method;
+ if(!c && !m){ return; }
+ if(!m){
+ m = c;
+ c = null;
+ }
+ c = c || dojo.global;
+ if(typeof(m) == "string"){
+ c[m].apply(c, this._args);
+ }else{
+ m.apply(c, this._args);
+ }
+ },
+
+ getShowingView: function(){
+ // summary:
+ // Find the currently showing view from my sibling views.
+ // description:
+ // Note that dojox.mobile.currentView is the last shown view.
+ // If the page consists of a splitter, there are multiple showing views.
+ var nodes = this.domNode.parentNode.childNodes;
+ for(var i = 0; i < nodes.length; i++){
+ if(dojo.hasClass(nodes[i], "mblView") && dojo.style(nodes[i], "display") != "none"){
+ return dijit.byNode(nodes[i]);
+ }
+ }
+ },
+
+ show: function(){
+ // summary:
+ // Shows this view without a transition animation.
+ var fs = this.getShowingView().domNode.style; // from-style
+ var ts = this.domNode.style; // to-style
+ fs.display = "none";
+ ts.display = "";
+ dojox.mobile.currentView = this;
+ },
+
+ addChild: function(widget){
+ this.containerNode.appendChild(widget.domNode);
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.Heading",
+ dijit._WidgetBase,
+{
+ back: "",
+ href: "",
+ moveTo: "",
+ transition: "slide",
+ label: "",
+ iconBase: "",
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("H1");
+ this.domNode.className = "mblHeading";
+ this._view = dijit.getEnclosingWidget(this.domNode.parentNode); // parentNode is null if created programmatically
+ if(this.label){
+ this.domNode.appendChild(document.createTextNode(this.label));
+ }else{
+ this.label = "";
+ dojo.forEach(this.domNode.childNodes, function(n){
+ if(n.nodeType == 3){ this.label += n.nodeValue; }
+ }, this);
+ this.label = dojo.trim(this.label);
+ }
+ if(this.back){
+ var btn = dojo.create("DIV", {className:"mblArrowButton"}, this.domNode, "first");
+ var head = dojo.create("DIV", {className:"mblArrowButtonHead"}, btn);
+ var body = dojo.create("DIV", {className:"mblArrowButtonBody mblArrowButtonText"}, btn);
+
+ this._body = body;
+ this._head = head;
+ this._btn = btn;
+ body.innerHTML = this.back;
+ this.connect(body, "onclick", "onClick");
+ var neck = dojo.create("DIV", {className:"mblArrowButtonNeck"}, btn);
+ btn.style.width = body.offsetWidth + head.offsetWidth + "px";
+ this.setLabel(this.label);
+ }
+ },
+
+ startup: function(){
+ if(this._btn){
+ this._btn.style.width = this._body.offsetWidth + this._head.offsetWidth + "px";
+ }
+ },
+
+ onClick: function(e){
+ var h1 = this.domNode;
+ dojo.addClass(h1, "mblArrowButtonSelected");
+ setTimeout(function(){
+ dojo.removeClass(h1, "mblArrowButtonSelected");
+ }, 1000);
+ this.goTo(this.moveTo, this.href);
+ },
+
+ setLabel: function(label){
+ if(label != this.label){
+ this.label = label;
+ this.domNode.firstChild.nodeValue = label;
+ }
+ },
+
+ goTo: function(moveTo, href){
+ if(!this._view){
+ this._view = dijit.byNode(this.domNode.parentNode);
+ }
+ if(!this._view){ return; }
+ if(href){
+ this._view.performTransition(null, -1, this.transition, this, function(){location.href = href;});
+ }else{
+ if(dojox.mobile.app && dojox.mobile.app.STAGE_CONTROLLER_ACTIVE){
+ // If in a full mobile app, then use its mechanisms to move back a scene
+ dojo.publish("/dojox/mobile/app/goback");
+ }
+ else{
+ this._view.performTransition(moveTo, -1, this.transition);
+ }
+
+ }
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.RoundRect",
+ dijit._WidgetBase,
+{
+ shadow: false,
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("DIV");
+ this.domNode.className = this.shadow ? "mblRoundRect mblShadow" : "mblRoundRect";
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.RoundRectCategory",
+ dijit._WidgetBase,
+{
+ label: "",
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("H2");
+ this.domNode.className = "mblRoundRectCategory";
+ if(this.label){
+ this.domNode.innerHTML = this.label;
+ }else{
+ this.label = this.domNode.innerHTML;
+ }
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.EdgeToEdgeCategory",
+ dojox.mobile.RoundRectCategory,
+{
+ buildRendering: function(){
+ this.inherited(arguments);
+ this.domNode.className = "mblEdgeToEdgeCategory";
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.RoundRectList",
+ dijit._WidgetBase,
+{
+ transition: "slide",
+ iconBase: "",
+ iconPos: "",
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("UL");
+ this.domNode.className = "mblRoundRectList";
+ },
+
+ addChild: function(widget){
+ this.containerNode.appendChild(widget.domNode);
+ widget.inheritParams();
+ widget.setIcon();
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.EdgeToEdgeList",
+ dojox.mobile.RoundRectList,
+{
+ stateful: false, // keep the selection state or not
+ buildRendering: function(){
+ this.inherited(arguments);
+ this.domNode.className = "mblEdgeToEdgeList";
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.AbstractItem",
+ dijit._WidgetBase,
+{
+ icon: "",
+ iconPos: "", // top,left,width,height (ex. "0,0,29,29")
+ href: "",
+ hrefTarget: "",
+ moveTo: "",
+ scene: "",
+ clickable: false,
+ url: "",
+ transition: "",
+ transitionDir: 1,
+ callback: null,
+ sync: true,
+ label: "",
+ toggle: false,
+ _duration: 800, // duration of selection, milliseconds
+
+ inheritParams: function(){
+ var parent = this.getParentWidget();
+ if(parent){
+ if(!this.transition){ this.transition = parent.transition; }
+ if(!this.icon){ this.icon = parent.iconBase; }
+ if(!this.iconPos){ this.iconPos = parent.iconPos; }
+ }
+ },
+
+ findCurrentView: function(moveTo){
+ var w;
+ if(moveTo){
+ w = dijit.byId(moveTo);
+ if(w){ return w.getShowingView(); }
+ }
+ var n = this.domNode.parentNode;
+ while(true){
+ w = dijit.getEnclosingWidget(n);
+ if(!w){ return null; }
+ if(w.performTransition){ break; }
+ n = w.domNode.parentNode;
+ }
+ return w;
+ },
+
+ transitionTo: function(moveTo, href, url, scene){
+ var w = this.findCurrentView(moveTo); // the current view widget
+ if(!w || moveTo && w === dijit.byId(moveTo)){ return; }
+ if(href){
+ if(this.hrefTarget){
+ dojox.mobile.openWindow(this.href, this.hrefTarget);
+ }else{
+ w.performTransition(null, this.transitionDir, this.transition, this, function(){location.href = href;});
+ }
+ return;
+ } else if(scene){
+ dojo.publish("/dojox/mobile/app/pushScene", [scene]);
+ return;
+ }
+ if(url){
+ var id;
+ if(dojox.mobile._viewMap && dojox.mobile._viewMap[url]){
+ // external view has already been loaded
+ id = dojox.mobile._viewMap[url];
+ }else{
+ // get the specified external view and append it to the <body>
+ var text = this._text;
+ if(!text){
+ if(this.sync){
+ text = dojo.trim(dojo._getText(url));
+ }else{
+ dojo["require"]("dojo._base.xhr");
+ var prog = dojox.mobile.ProgressIndicator.getInstance();
+ dojo.body().appendChild(prog.domNode);
+ prog.start();
+ var xhr = dojo.xhrGet({
+ url: url,
+ handleAs: "text"
+ });
+ xhr.addCallback(dojo.hitch(this, function(response, ioArgs){
+ prog.stop();
+ if(response){
+ this._text = response;
+ this.transitionTo(moveTo, href, url, scene);
+ }
+ }));
+ xhr.addErrback(function(error){
+ prog.stop();
+ alert("Failed to load "+url+"\n"+(error.description||error));
+ });
+ return;
+ }
+ }
+ this._text = null;
+ id = this._parse(text);
+ if(!dojox.mobile._viewMap){
+ dojox.mobile._viewMap = [];
+ }
+ dojox.mobile._viewMap[url] = id;
+ }
+ moveTo = id;
+ }
+ w.performTransition(moveTo, this.transitionDir, this.transition, this.callback && this, this.callback);
+ },
+
+ _parse: function(text){
+ var container = dojo.create("DIV");
+ var view;
+ if(text.charAt(0) == "<"){ // html markup
+ container.innerHTML = text;
+ view = container.firstChild; // <div dojoType="dojox.mobile.View">
+ if(!view && view.nodeType != 1){
+ alert("dojox.mobile.AbstractItem#transitionTo: invalid view content");
+ return;
+ }
+ view.setAttribute("_started", "true"); // to avoid startup() is called
+ view.style.visibility = "hidden";
+ dojo.body().appendChild(container);
+ (dojox.mobile.parser || dojo.parser).parse(container);
+ }else if(text.charAt(0) == "{"){ // json
+ dojo.body().appendChild(container);
+ this._ws = [];
+ view = this._instantiate(eval('('+text+')'), container);
+ for(var i = 0; i < this._ws.length; i++){
+ var w = this._ws[i];
+ w.startup && !w._started && (!w.getParent || !w.getParent()) && w.startup();
+ }
+ this._ws = null;
+ }
+ view.style.display = "none";
+ view.style.visibility = "visible";
+ var id = view.id;
+ return dojo.hash ? "#" + id : id;
+ },
+
+ _instantiate: function(/*Object*/obj, /*DomNode*/node, /*Widget*/parent){
+ var widget;
+ for(var key in obj){
+ if(key.charAt(0) == "@"){ continue; }
+ var cls = dojo.getObject(key);
+ if(!cls){ continue; }
+ var params = {};
+ var proto = cls.prototype;
+ var objs = dojo.isArray(obj[key]) ? obj[key] : [obj[key]];
+ for(var i = 0; i < objs.length; i++){
+ for(var prop in objs[i]){
+ if(prop.charAt(0) == "@"){
+ var val = objs[i][prop];
+ prop = prop.substring(1);
+ if(typeof proto[prop] == "string"){
+ params[prop] = val;
+ }else if(typeof proto[prop] == "number"){
+ params[prop] = val - 0;
+ }else if(typeof proto[prop] == "boolean"){
+ params[prop] = (val != "false");
+ }else if(typeof proto[prop] == "object"){
+ params[prop] = eval("(" + val + ")");
+ }
+ }
+ }
+ widget = new cls(params, node);
+ if(!node){ // not to call View's startup()
+ this._ws.push(widget);
+ }
+ if(parent && parent.addChild){
+ parent.addChild(widget);
+ }
+ this._instantiate(objs[i], null, widget);
+ }
+ }
+ return widget && widget.domNode;
+ },
+
+ createDomButton: function(/*DomNode*/refNode, /*DomNode?*/toNode){
+ var s = refNode.className;
+ if(s.match(/mblDomButton\w+_(\d+)/)){
+ var nDiv = RegExp.$1 - 0;
+ for(var i = 0, p = (toNode||refNode); i < nDiv; i++){
+ p = dojo.create("DIV", null, p);
+ }
+ }
+ },
+
+ select: function(/*Boolean?*/deselect){
+ // subclass must implement
+ },
+
+ defaultClickAction: function(){
+ if(this.toggle){
+ this.select(this.selected);
+ }else if(!this.selected){
+ this.select();
+ if(!this.selectOne){
+ var _this = this;
+ setTimeout(function(){
+ _this.select(true);
+ }, this._duration);
+ }
+ if(this.moveTo || this.href || this.url || this.scene){
+ this.transitionTo(this.moveTo, this.href, this.url, this.scene);
+ }
+ }
+ },
+
+ getParentWidget: function(){
+ var ref = this.srcNodeRef || this.domNode;
+ return ref && ref.parentNode ? dijit.getEnclosingWidget(ref.parentNode) : null;
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.ListItem",
+ dojox.mobile.AbstractItem,
+{
+ rightText: "",
+ btnClass: "",
+ anchorLabel: false,
+ noArrow: false,
+ selected: false,
+
+ buildRendering: function(){
+ this.inheritParams();
+ var a = this.anchorNode = dojo.create("A");
+ a.className = "mblListItemAnchor";
+ var box = dojo.create("DIV");
+ box.className = "mblListItemTextBox";
+ if(this.anchorLabel){
+ box.style.cursor = "pointer";
+ }
+ var r = this.srcNodeRef;
+ if(r){
+ for(var i = 0, len = r.childNodes.length; i < len; i++){
+ box.appendChild(r.removeChild(r.firstChild));
+ }
+ }
+ if(this.label){
+ box.appendChild(dojo.doc.createTextNode(this.label));
+ }
+ a.appendChild(box);
+ if(this.rightText){
+ this._setRightTextAttr(this.rightText);
+ }
+
+ if(this.moveTo || this.href || this.url || this.clickable){
+ var parent = this.getParentWidget();
+ if(!this.noArrow && !(parent && parent.stateful)){
+ var arrow = dojo.create("DIV");
+ arrow.className = "mblArrow";
+ a.appendChild(arrow);
+ }
+ this.connect(a, "onclick", "onClick");
+ }else if(this.btnClass){
+ var div = this.btnNode = dojo.create("DIV");
+ div.className = this.btnClass+" mblRightButton";
+ div.appendChild(dojo.create("DIV"));
+ div.appendChild(dojo.create("P"));
+
+ var dummyDiv = dojo.create("DIV");
+ dummyDiv.className = "mblRightButtonContainer";
+ dummyDiv.appendChild(div);
+ a.appendChild(dummyDiv);
+ dojo.addClass(a, "mblListItemAnchorHasRightButton");
+ setTimeout(function(){
+ dummyDiv.style.width = div.offsetWidth + "px";
+ dummyDiv.style.height = div.offsetHeight + "px";
+ if(dojo.isIE){
+ // IE seems to ignore the height of LI without this..
+ a.parentNode.style.height = a.parentNode.offsetHeight + "px";
+ }
+ }, 0);
+ }
+ if(this.anchorLabel){
+ box.style.display = "inline"; // to narrow the text region
+ }
+ var li = this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("LI");
+ li.className = "mblListItem" + (this.selected ? " mblItemSelected" : "");
+ li.appendChild(a);
+ this.setIcon();
+ },
+
+ setIcon: function(){
+ if(this.iconNode){ return; }
+ var a = this.anchorNode;
+ if(this.icon && this.icon != "none"){
+ var img = this.iconNode = dojo.create("IMG");
+ img.className = "mblListItemIcon";
+ img.src = this.icon;
+ this.domNode.insertBefore(img, a);
+ dojox.mobile.setupIcon(this.iconNode, this.iconPos);
+ dojo.removeClass(a, "mblListItemAnchorNoIcon");
+ }else{
+ dojo.addClass(a, "mblListItemAnchorNoIcon");
+ }
+ },
+
+ onClick: function(e){
+ var a = e.currentTarget;
+ var li = a.parentNode;
+ if(dojo.hasClass(li, "mblItemSelected")){ return; } // already selected
+ if(this.anchorLabel){
+ for(var p = e.target; p.tagName != "LI"; p = p.parentNode){
+ if(p.className == "mblListItemTextBox"){
+ dojo.addClass(p, "mblListItemTextBoxSelected");
+ setTimeout(function(){
+ dojo.removeClass(p, "mblListItemTextBoxSelected");
+ }, 1000);
+ this.onAnchorLabelClicked(e);
+ return;
+ }
+ }
+ }
+ if(this.getParentWidget().stateful){
+ for(var i = 0, c = li.parentNode.childNodes; i < c.length; i++){
+ dojo.removeClass(c[i], "mblItemSelected");
+ }
+ }else{
+ setTimeout(function(){
+ dojo.removeClass(li, "mblItemSelected");
+ }, 1000);
+ }
+ dojo.addClass(li, "mblItemSelected");
+ this.transitionTo(this.moveTo, this.href, this.url, this.scene);
+ },
+
+ onAnchorLabelClicked: function(e){
+ },
+
+ _setRightTextAttr: function(/*String*/text){
+ this.rightText = text;
+ if(!this._rightTextNode){
+ this._rightTextNode = dojo.create("DIV", {className:"mblRightText"}, this.anchorNode);
+ }
+ this._rightTextNode.innerHTML = text;
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.Switch",
+ dijit._WidgetBase,
+{
+ value: "on",
+ leftLabel: "ON",
+ rightLabel: "OFF",
+ _width: 53,
+
+ buildRendering: function(){
+ this.domNode = this.srcNodeRef || dojo.doc.createElement("DIV");
+ this.domNode.className = "mblSwitch";
+ this.domNode.innerHTML =
+ '<div class="mblSwitchInner">'
+ + '<div class="mblSwitchBg mblSwitchBgLeft">'
+ + '<div class="mblSwitchText mblSwitchTextLeft">'+this.leftLabel+'</div>'
+ + '</div>'
+ + '<div class="mblSwitchBg mblSwitchBgRight">'
+ + '<div class="mblSwitchText mblSwitchTextRight">'+this.rightLabel+'</div>'
+ + '</div>'
+ + '<div class="mblSwitchKnob"></div>'
+ + '</div>';
+ var n = this.inner = this.domNode.firstChild;
+ this.left = n.childNodes[0];
+ this.right = n.childNodes[1];
+ this.knob = n.childNodes[2];
+
+ dojo.addClass(this.domNode, (this.value == "on") ? "mblSwitchOn" : "mblSwitchOff");
+ this[this.value == "off" ? "left" : "right"].style.display = "none";
+ },
+
+ postCreate: function(){
+ this.connect(this.knob, "onclick", "onClick");
+ this.connect(this.knob, "touchstart", "onTouchStart");
+ this.connect(this.knob, "mousedown", "onTouchStart");
+ },
+
+ _changeState: function(/*String*/state){
+ this.inner.style.left = "";
+ dojo.addClass(this.domNode, "mblSwitchAnimation");
+ dojo.removeClass(this.domNode, (state == "on") ? "mblSwitchOff" : "mblSwitchOn");
+ dojo.addClass(this.domNode, (state == "on") ? "mblSwitchOn" : "mblSwitchOff");
+
+ var _this = this;
+ setTimeout(function(){
+ _this[state == "off" ? "left" : "right"].style.display = "none";
+ dojo.removeClass(_this.domNode, "mblSwitchAnimation");
+ }, 300);
+ },
+
+ onClick: function(e){
+ if(this._moved){ return; }
+ this.value = (this.value == "on") ? "off" : "on";
+ this._changeState(this.value);
+ this.onStateChanged(this.value);
+ },
+
+ onTouchStart: function(e){
+ this._moved = false;
+ this.innerStartX = this.inner.offsetLeft;
+ if(e.targetTouches){
+ this.touchStartX = e.targetTouches[0].clientX;
+ this._conn1 = dojo.connect(this.inner, "touchmove", this, "onTouchMove");
+ this._conn2 = dojo.connect(this.inner, "touchend", this, "onTouchEnd");
+ }
+ this.left.style.display = "block";
+ this.right.style.display = "block";
+ dojo.stopEvent(e);
+ },
+
+ onTouchMove: function(e){
+ e.preventDefault();
+ var dx;
+ if(e.targetTouches){
+ if(e.targetTouches.length != 1){ return false; }
+ dx = e.targetTouches[0].clientX - this.touchStartX;
+ }else{
+ dx = e.clientX - this.touchStartX;
+ }
+ var pos = this.innerStartX + dx;
+ var d = 10;
+ if(pos <= -(this._width-d)){ pos = -this._width; }
+ if(pos >= -d){ pos = 0; }
+ this.inner.style.left = pos + "px";
+ this._moved = true;
+ },
+
+ onTouchEnd: function(e){
+ dojo.disconnect(this._conn1);
+ dojo.disconnect(this._conn2);
+ if(this.innerStartX == this.inner.offsetLeft){
+ if(dojo.isWebKit){
+ var ev = dojo.doc.createEvent("MouseEvents");
+ ev.initEvent("click", true, true);
+ this.knob.dispatchEvent(ev);
+ }
+ return;
+ }
+ var newState = (this.inner.offsetLeft < -(this._width/2)) ? "off" : "on";
+ this._changeState(newState);
+ if(newState != this.value){
+ this.value = newState;
+ this.onStateChanged(this.value);
+ }
+ },
+
+ onStateChanged: function(/*String*/newState){
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.Button",
+ dijit._WidgetBase,
+{
+ btnClass: "mblBlueButton",
+ duration: 1000, // duration of selection, milliseconds
+
+ label: null,
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("BUTTON");
+ this.domNode.className = "mblButton "+this.btnClass;
+
+ if(this.label){
+ this.domNode.innerHTML = this.label;
+ }
+
+ this.connect(this.domNode, "onclick", "onClick");
+ },
+
+ onClick: function(e){
+ var button = this.domNode;
+ var c = "mblButtonSelected "+this.btnClass+"Selected";
+ dojo.addClass(button, c);
+ setTimeout(function(){
+ dojo.removeClass(button, c);
+ }, this.duration);
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.ToolBarButton",
+ dojox.mobile.AbstractItem,
+{
+ selected: false,
+ _defaultColor: "mblColorDefault",
+ _selColor: "mblColorDefaultSel",
+
+ buildRendering: function(){
+ this.inheritParams();
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("div");
+ dojo.addClass(this.domNode, "mblToolbarButton mblArrowButtonText");
+ var color;
+ if(this.selected){
+ color = this._selColor;
+ }else if(this.domNode.className.indexOf("mblColor") == -1){
+ color = this._defaultColor;
+ }
+ dojo.addClass(this.domNode, color);
+
+ if(this.label){
+ this.domNode.innerHTML = this.label;
+ }else{
+ this.label = this.domNode.innerHTML;
+ }
+
+ if(this.icon && this.icon != "none"){
+ var img;
+ if(this.iconPos){
+ var iconDiv = dojo.create("DIV", null, this.domNode);
+ img = dojo.create("IMG", null, iconDiv);
+ img.style.position = "absolute";
+ var arr = this.iconPos.split(/[ ,]/);
+ dojo.style(iconDiv, {
+ position: "relative",
+ width: arr[2] + "px",
+ height: arr[3] + "px"
+ });
+ }else{
+ img = dojo.create("IMG", null, this.domNode);
+ }
+ img.src = this.icon;
+ dojox.mobile.setupIcon(img, this.iconPos);
+ this.iconNode = img;
+ }
+ this.createDomButton(this.domNode);
+ this.connect(this.domNode, "onclick", "onClick");
+ },
+
+ select: function(/*Boolean?*/deselect){
+ dojo.toggleClass(this.domNode, this._selColor, !deselect);
+ this.selected = !deselect;
+ },
+
+ onClick: function(e){
+ this.defaultClickAction();
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.ProgressIndicator",
+ null,
+{
+ interval: 100, // milliseconds
+ colors: [
+ "#C0C0C0", "#C0C0C0", "#C0C0C0", "#C0C0C0",
+ "#C0C0C0", "#C0C0C0", "#B8B9B8", "#AEAFAE",
+ "#A4A5A4", "#9A9A9A", "#8E8E8E", "#838383"
+ ],
+
+ _bars: [],
+
+ constructor: function(){
+ this.domNode = dojo.create("DIV");
+ this.domNode.className = "mblProgContainer";
+ for(var i = 0; i < 12; i++){
+ var div = dojo.create("DIV");
+ div.className = "mblProg mblProg"+i;
+ this.domNode.appendChild(div);
+ this._bars.push(div);
+ }
+ },
+
+ start: function(){
+ var cntr = 0;
+ var _this = this;
+ this.timer = setInterval(function(){
+ cntr--;
+ cntr = cntr < 0 ? 11 : cntr;
+ var c = _this.colors;
+ for(var i = 0; i < 12; i++){
+ var idx = (cntr + i) % 12;
+ _this._bars[i].style.backgroundColor = c[idx];
+ }
+ }, this.interval);
+ },
+
+ stop: function(){
+ if(this.timer){
+ clearInterval(this.timer);
+ }
+ this.timer = null;
+ if(this.domNode.parentNode){
+ this.domNode.parentNode.removeChild(this.domNode);
+ }
+ }
+});
+dojox.mobile.ProgressIndicator._instance = null;
+dojox.mobile.ProgressIndicator.getInstance = function(){
+ if(!dojox.mobile.ProgressIndicator._instance){
+ dojox.mobile.ProgressIndicator._instance = new dojox.mobile.ProgressIndicator();
+ }
+ return dojox.mobile.ProgressIndicator._instance;
+};
+
+dojox.mobile.addClass = function(){
+ // summary:
+ // Adds a theme class name to <body>.
+ // description:
+ // Finds the currently applied theme name, such as 'iphone' or 'android'
+ // from link elements, and adds it as a class name for the body element.
+ var elems = document.getElementsByTagName("link");
+ for(var i = 0, len = elems.length; i < len; i++){
+ if(elems[i].href.match(/dojox\/mobile\/themes\/(\w+)\//)){
+ dojox.mobile.theme = RegExp.$1;
+ dojo.addClass(dojo.body(), dojox.mobile.theme);
+ break;
+ }
+ }
+};
+
+dojox.mobile.setupIcon = function(/*DomNode*/iconNode, /*String*/iconPos){
+ if(iconNode && iconPos){
+ var arr = dojo.map(iconPos.split(/[ ,]/),
+ function(item){ return item - 0; });
+ var t = arr[0]; // top
+ var r = arr[1] + arr[2]; // right
+ var b = arr[0] + arr[3]; // bottom
+ var l = arr[1]; // left
+ iconNode.style.clip = "rect("+t+"px "+r+"px "+b+"px "+l+"px)";
+ iconNode.style.top = dojo.style(iconNode, "top") - t + "px";
+ iconNode.style.left = dojo.style(iconNode.parentNode, "paddingLeft") - l + "px";
+ }
+};
+
+dojox.mobile.hideAddressBar = function(){
+ dojo.body().style.minHeight = "1000px"; // to ensure enough height for scrollTo to work
+ setTimeout(function(){ scrollTo(0, 1); }, 100);
+ setTimeout(function(){ scrollTo(0, 1); }, 400);
+ setTimeout(function(){
+ scrollTo(0, 1);
+ // re-define the min-height with the actual height
+ dojo.body().style.minHeight = (dojo.global.innerHeight||dojo.doc.documentElement.clientHeight) + "px";
+ }, 1000);
+};
+
+dojox.mobile.openWindow = function(url, target){
+ dojo.global.open(url, target || "_blank");
+};
+
+dojo._loaders.unshift(function(){
+ // avoid use of dojo.query
+ /*
+ var list = dojo.query('[lazy=true] [dojoType]', null);
+ list.forEach(function(node, index, nodeList){
+ node.setAttribute("__dojoType", node.getAttribute("dojoType"));
+ node.removeAttribute("dojoType");
+ });
+ */
+
+ var nodes = dojo.body().getElementsByTagName("*");
+ var i, len, s;
+ len = nodes.length;
+ for(i = 0; i < len; i++){
+ s = nodes[i].getAttribute("dojoType");
+ if(s){
+ if(nodes[i].parentNode.getAttribute("lazy") == "true"){
+ nodes[i].setAttribute("__dojoType", s);
+ nodes[i].removeAttribute("dojoType");
+ }
+ }
+ }
+});
+
+dojo.addOnLoad(function(){
+ dojox.mobile.addClass();
+ if(dojo.config["mblApplyPageStyles"] !== false){
+ dojo.addClass(dojo.doc.documentElement, "mobile");
+ }
+
+ // You can disable hiding the address bar with the following djConfig.
+ // var djConfig = { mblHideAddressBar: false };
+ if(dojo.config["mblHideAddressBar"] !== false){
+ dojox.mobile.hideAddressBar();
+ if(dojo.config["mblAlwaysHideAddressBar"] == true){
+ if(dojo.global.onorientationchange !== undefined){
+ dojo.connect(dojo.global, "onorientationchange", dojox.mobile.hideAddressBar);
+ }else{
+ dojo.connect(dojo.global, "onresize", dojox.mobile.hideAddressBar);
+ }
+ }
+ }
+
+ // avoid use of dojo.query
+ /*
+ var list = dojo.query('[__dojoType]', null);
+ list.forEach(function(node, index, nodeList){
+ node.setAttribute("dojoType", node.getAttribute("__dojoType"));
+ node.removeAttribute("__dojoType");
+ });
+ */
+
+ var nodes = dojo.body().getElementsByTagName("*");
+ var i, len = nodes.length, s;
+ for(i = 0; i < len; i++){
+ s = nodes[i].getAttribute("__dojoType");
+ if(s){
+ nodes[i].setAttribute("dojoType", s);
+ nodes[i].removeAttribute("__dojoType");
+ }
+ }
+
+ if(dojo.hash){
+ // find widgets under root recursively
+ var findWidgets = function(root){
+ var arr;
+ arr = dijit.findWidgets(root);
+ var widgets = arr;
+ for(var i = 0; i < widgets.length; i++){
+ arr = arr.concat(findWidgets(widgets[i].containerNode));
+ }
+ return arr;
+ };
+ dojo.subscribe("/dojo/hashchange", null, function(value){
+ var view = dojox.mobile.currentView;
+ if(!view){ return; }
+ var params = dojox.mobile._params;
+ if(!params){ // browser back/forward button was pressed
+ var moveTo = value ? value : dojox.mobile._defaultView.id;
+ var widgets = findWidgets(view.domNode);
+ var dir = 1, transition = "slide";
+ for(i = 0; i < widgets.length; i++){
+ var w = widgets[i];
+ if("#"+moveTo == w.moveTo){
+ // found a widget that has the given moveTo
+ transition = w.transition;
+ dir = (w instanceof dojox.mobile.Heading) ? -1 : 1;
+ break;
+ }
+ }
+ params = [ moveTo, dir, transition ];
+ }
+ view.performTransition.apply(view, params);
+ dojox.mobile._params = null;
+ });
+ }
+
+ dojo.body().style.visibility = "visible";
+});
+
+dijit.getEnclosingWidget = function(node){
+ while(node && node.tagName !== "BODY"){
+ if(node.getAttribute && node.getAttribute("widgetId")){
+ return dijit.registry.byId(node.getAttribute("widgetId"));
+ }
+ node = node._parentNode || node.parentNode;
+ }
+ return null;
+};
+
+}
diff --git a/js/dojo-1.6/dojox/mobile/_base.xd.js b/js/dojo-1.6/dojox/mobile/_base.xd.js
new file mode 100644
index 0000000..079fecb
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/_base.xd.js
@@ -0,0 +1,1220 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.mobile._base"],
+["require", "dijit._WidgetBase"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.mobile._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile._base"] = true;
+dojo.provide("dojox.mobile._base");
+
+dojo.require("dijit._WidgetBase");
+dojo.isBB = (navigator.userAgent.indexOf("BlackBerry") != -1) && !dojo.isWebKit;
+
+// summary:
+// Mobile Widgets
+// description:
+// This module provides a number of widgets that can be used to build
+// web-based applications for mobile devices such as iPhone or Android.
+// These widgets work best with webkit-based browsers, such as Safari or
+// Chrome, since webkit-specific CSS3 features are used.
+// However, the widgets should work in a "graceful degradation" manner
+// even on non-CSS3 browsers, such as IE or Firefox. In that case,
+// fancy effects, such as animation, gradient color, or round corner
+// rectangle, may not work, but you can still operate your application.
+//
+// Furthermore, as a separate file, a compatibility module,
+// dojox.mobile.compat, is available that simulates some of CSS3 features
+// used in this module. If you use the compatibility module, fancy visual
+// effects work better even on non-CSS3 browsers.
+//
+// Note that use of dijit._Container, dijit._Contained, dijit._Templated,
+// and dojo.query is intentionally avoided to reduce download code size.
+
+dojo.declare(
+ "dojox.mobile.View",
+ dijit._WidgetBase,
+{
+ // summary:
+ // A widget that represents a view that occupies the full screen
+ // description:
+ // View acts as a container for any HTML and/or widgets. An entire HTML page
+ // can have multiple View widgets and the user can navigate through
+ // the views back and forth without page transitions.
+
+ // selected: Boolean
+ // If true, the view is displayed at startup time.
+ selected: false,
+
+ // keepScrollPos: Boolean
+ // If true, the scroll position is kept between views.
+ keepScrollPos: true,
+
+ _started: false,
+
+ constructor: function(params, node){
+ if(node){
+ dojo.byId(node).style.visibility = "hidden";
+ }
+ },
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("DIV");
+ this.domNode.className = "mblView";
+ this.connect(this.domNode, "webkitAnimationEnd", "onAnimationEnd");
+ this.connect(this.domNode, "webkitAnimationStart", "onAnimationStart");
+ var id = location.href.match(/#(\w+)([^\w=]|$)/) ? RegExp.$1 : null;
+
+ this._visible = this.selected && !id || this.id == id;
+
+ if(this.selected){
+ dojox.mobile._defaultView = this;
+ }
+ },
+
+ startup: function(){
+ if(this._started){ return; }
+ var _this = this;
+ setTimeout(function(){
+ if(!_this._visible){
+ _this.domNode.style.display = "none";
+ }else{
+ dojox.mobile.currentView = _this;
+ _this.onStartView();
+ }
+ _this.domNode.style.visibility = "visible";
+ }, dojo.isIE?100:0); // give IE a little time to complete drawing
+ this._started = true;
+ },
+
+ onStartView: function(){
+ // Stub function to connect to from your application.
+ // Called only when this view is shown at startup time.
+ },
+
+ onBeforeTransitionIn: function(moveTo, dir, transition, context, method){
+ // Stub function to connect to from your application.
+ },
+
+ onAfterTransitionIn: function(moveTo, dir, transition, context, method){
+ // Stub function to connect to from your application.
+ },
+
+ onBeforeTransitionOut: function(moveTo, dir, transition, context, method){
+ // Stub function to connect to from your application.
+ },
+
+ onAfterTransitionOut: function(moveTo, dir, transition, context, method){
+ // Stub function to connect to from your application.
+ },
+
+ _saveState: function(moveTo, dir, transition, context, method){
+ this._context = context;
+ this._method = method;
+ if(transition == "none" || !dojo.isWebKit){
+ transition = null;
+ }
+ this._moveTo = moveTo;
+ this._dir = dir;
+ this._transition = transition;
+ this._arguments = [];
+ var i;
+ for(i = 0; i < arguments.length; i++){
+ this._arguments.push(arguments[i]);
+ }
+ this._args = [];
+ if(context || method){
+ for(i = 5; i < arguments.length; i++){
+ this._args.push(arguments[i]);
+ }
+ }
+ },
+
+ performTransition: function(/*String*/moveTo, /*Number*/dir, /*String*/transition,
+ /*Object|null*/context, /*String|Function*/method /*optional args*/){
+ // summary:
+ // Function to perform the various types of view transitions, such as fade, slide, and flip.
+ // moveTo: String
+ // The destination view id to transition the current view to.
+ // If null, transitions to a blank view.
+ // dir: Number
+ // The transition direction. If 1, transition forward. If -1, transition backward.
+ // For example, the slide transition slides the view from right to left when dir == 1,
+ // and from left to right when dir == -1.
+ // transision: String
+ // The type of transition to perform. "slide", "fade", or "flip"
+ // context: Object
+ // The object that the callback function will receive as "this".
+ // method: String|Function
+ // A callback function that is called when the transition has been finished.
+ // A function reference, or name of a function in context.
+ // tags:
+ // public
+ // example:
+ // Transitions to the blank view, and then opens another page.
+ // | performTransition(null, 1, "slide", null, function(){location.href = href;});
+ if(dojo.hash){
+ if(typeof(moveTo) == "string" && moveTo.charAt(0) == '#' && !dojox.mobile._params){
+ dojox.mobile._params = [];
+ for(var i = 0; i < arguments.length; i++){
+ dojox.mobile._params.push(arguments[i]);
+ }
+ dojo.hash(moveTo);
+ return;
+ }
+ }
+ this._saveState.apply(this, arguments);
+ var toNode;
+ if(moveTo){
+ if(typeof(moveTo) == "string"){
+ // removes a leading hash mark (#) and params if exists
+ // ex. "#bar&myParam=0003" -> "bar"
+ moveTo.match(/^#?([^&]+)/);
+ toNode = RegExp.$1;
+ }else{
+ toNode = moveTo;
+ }
+ }else{
+ if(!this._dummyNode){
+ this._dummyNode = dojo.doc.createElement("DIV");
+ dojo.body().appendChild(this._dummyNode);
+ }
+ toNode = this._dummyNode;
+ }
+ var fromNode = this.domNode;
+ toNode = this.toNode = dojo.byId(toNode);
+ if(!toNode){ alert("dojox.mobile.View#performTransition: destination view not found: "+toNode); }
+ toNode.style.visibility = "hidden";
+ toNode.style.display = "";
+ this.onBeforeTransitionOut.apply(this, arguments);
+ var toWidget = dijit.byNode(toNode);
+ if(toWidget){
+ // perform view transition keeping the scroll position
+ if(this.keepScrollPos && !dijit.getEnclosingWidget(this.domNode.parentNode)){
+ var scrollTop = dojo.body().scrollTop || dojo.doc.documentElement.scrollTop || dojo.global.pageYOffset || 0;
+ if(dir == 1){
+ toNode.style.top = "0px";
+ if(scrollTop > 1){
+ fromNode.style.top = -scrollTop + "px";
+ if(dojo.config["mblHideAddressBar"] !== false){
+ setTimeout(function(){ // iPhone needs setTimeout
+ dojo.global.scrollTo(0, 1);
+ }, 0);
+ }
+ }
+ }else{
+ if(scrollTop > 1 || toNode.offsetTop !== 0){
+ var toTop = -toNode.offsetTop;
+ toNode.style.top = "0px";
+ fromNode.style.top = toTop - scrollTop + "px";
+ if(dojo.config["mblHideAddressBar"] !== false && toTop > 0){
+ setTimeout(function(){ // iPhone needs setTimeout
+ dojo.global.scrollTo(0, toTop + 1);
+ }, 0);
+ }
+ }
+ }
+ }else{
+ toNode.style.top = "0px";
+ }
+ toWidget.onBeforeTransitionIn.apply(toWidget, arguments);
+ }
+ toNode.style.display = "none";
+ toNode.style.visibility = "visible";
+ this._doTransition(fromNode, toNode, transition, dir);
+ },
+
+ _doTransition: function(fromNode, toNode, transition, dir){
+ var rev = (dir == -1) ? " reverse" : "";
+ toNode.style.display = "";
+ if(!transition || transition == "none"){
+ this.domNode.style.display = "none";
+ this.invokeCallback();
+ }else{
+ dojo.addClass(fromNode, transition + " out" + rev);
+ dojo.addClass(toNode, transition + " in" + rev);
+ }
+ },
+
+ onAnimationStart: function(e){
+ },
+
+ onAnimationEnd: function(e){
+ var isOut = false;
+ if(dojo.hasClass(this.domNode, "out")){
+ isOut = true;
+ this.domNode.style.display = "none";
+ dojo.forEach([this._transition,"in","out","reverse"], function(s){
+ dojo.removeClass(this.domNode, s);
+ }, this);
+ }
+ if(e.animationName.indexOf("shrink") === 0){
+ var li = e.target;
+ li.style.display = "none";
+ dojo.removeClass(li, "mblCloseContent");
+ }
+ if(isOut){
+ this.invokeCallback();
+ }
+ // this.domNode may be destroyed as a result of invoking the callback,
+ // so check for that before accessing it.
+ this.domNode && (this.domNode.className = "mblView");
+ },
+
+ invokeCallback: function(){
+ this.onAfterTransitionOut.apply(this, this._arguments);
+ var toWidget = dijit.byNode(this.toNode);
+ if(toWidget){
+ toWidget.onAfterTransitionIn.apply(toWidget, this._arguments);
+ }
+
+ dojox.mobile.currentView = toWidget;
+
+ var c = this._context, m = this._method;
+ if(!c && !m){ return; }
+ if(!m){
+ m = c;
+ c = null;
+ }
+ c = c || dojo.global;
+ if(typeof(m) == "string"){
+ c[m].apply(c, this._args);
+ }else{
+ m.apply(c, this._args);
+ }
+ },
+
+ getShowingView: function(){
+ // summary:
+ // Find the currently showing view from my sibling views.
+ // description:
+ // Note that dojox.mobile.currentView is the last shown view.
+ // If the page consists of a splitter, there are multiple showing views.
+ var nodes = this.domNode.parentNode.childNodes;
+ for(var i = 0; i < nodes.length; i++){
+ if(dojo.hasClass(nodes[i], "mblView") && dojo.style(nodes[i], "display") != "none"){
+ return dijit.byNode(nodes[i]);
+ }
+ }
+ },
+
+ show: function(){
+ // summary:
+ // Shows this view without a transition animation.
+ var fs = this.getShowingView().domNode.style; // from-style
+ var ts = this.domNode.style; // to-style
+ fs.display = "none";
+ ts.display = "";
+ dojox.mobile.currentView = this;
+ },
+
+ addChild: function(widget){
+ this.containerNode.appendChild(widget.domNode);
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.Heading",
+ dijit._WidgetBase,
+{
+ back: "",
+ href: "",
+ moveTo: "",
+ transition: "slide",
+ label: "",
+ iconBase: "",
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("H1");
+ this.domNode.className = "mblHeading";
+ this._view = dijit.getEnclosingWidget(this.domNode.parentNode); // parentNode is null if created programmatically
+ if(this.label){
+ this.domNode.appendChild(document.createTextNode(this.label));
+ }else{
+ this.label = "";
+ dojo.forEach(this.domNode.childNodes, function(n){
+ if(n.nodeType == 3){ this.label += n.nodeValue; }
+ }, this);
+ this.label = dojo.trim(this.label);
+ }
+ if(this.back){
+ var btn = dojo.create("DIV", {className:"mblArrowButton"}, this.domNode, "first");
+ var head = dojo.create("DIV", {className:"mblArrowButtonHead"}, btn);
+ var body = dojo.create("DIV", {className:"mblArrowButtonBody mblArrowButtonText"}, btn);
+
+ this._body = body;
+ this._head = head;
+ this._btn = btn;
+ body.innerHTML = this.back;
+ this.connect(body, "onclick", "onClick");
+ var neck = dojo.create("DIV", {className:"mblArrowButtonNeck"}, btn);
+ btn.style.width = body.offsetWidth + head.offsetWidth + "px";
+ this.setLabel(this.label);
+ }
+ },
+
+ startup: function(){
+ if(this._btn){
+ this._btn.style.width = this._body.offsetWidth + this._head.offsetWidth + "px";
+ }
+ },
+
+ onClick: function(e){
+ var h1 = this.domNode;
+ dojo.addClass(h1, "mblArrowButtonSelected");
+ setTimeout(function(){
+ dojo.removeClass(h1, "mblArrowButtonSelected");
+ }, 1000);
+ this.goTo(this.moveTo, this.href);
+ },
+
+ setLabel: function(label){
+ if(label != this.label){
+ this.label = label;
+ this.domNode.firstChild.nodeValue = label;
+ }
+ },
+
+ goTo: function(moveTo, href){
+ if(!this._view){
+ this._view = dijit.byNode(this.domNode.parentNode);
+ }
+ if(!this._view){ return; }
+ if(href){
+ this._view.performTransition(null, -1, this.transition, this, function(){location.href = href;});
+ }else{
+ if(dojox.mobile.app && dojox.mobile.app.STAGE_CONTROLLER_ACTIVE){
+ // If in a full mobile app, then use its mechanisms to move back a scene
+ dojo.publish("/dojox/mobile/app/goback");
+ }
+ else{
+ this._view.performTransition(moveTo, -1, this.transition);
+ }
+
+ }
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.RoundRect",
+ dijit._WidgetBase,
+{
+ shadow: false,
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("DIV");
+ this.domNode.className = this.shadow ? "mblRoundRect mblShadow" : "mblRoundRect";
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.RoundRectCategory",
+ dijit._WidgetBase,
+{
+ label: "",
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("H2");
+ this.domNode.className = "mblRoundRectCategory";
+ if(this.label){
+ this.domNode.innerHTML = this.label;
+ }else{
+ this.label = this.domNode.innerHTML;
+ }
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.EdgeToEdgeCategory",
+ dojox.mobile.RoundRectCategory,
+{
+ buildRendering: function(){
+ this.inherited(arguments);
+ this.domNode.className = "mblEdgeToEdgeCategory";
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.RoundRectList",
+ dijit._WidgetBase,
+{
+ transition: "slide",
+ iconBase: "",
+ iconPos: "",
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("UL");
+ this.domNode.className = "mblRoundRectList";
+ },
+
+ addChild: function(widget){
+ this.containerNode.appendChild(widget.domNode);
+ widget.inheritParams();
+ widget.setIcon();
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.EdgeToEdgeList",
+ dojox.mobile.RoundRectList,
+{
+ stateful: false, // keep the selection state or not
+ buildRendering: function(){
+ this.inherited(arguments);
+ this.domNode.className = "mblEdgeToEdgeList";
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.AbstractItem",
+ dijit._WidgetBase,
+{
+ icon: "",
+ iconPos: "", // top,left,width,height (ex. "0,0,29,29")
+ href: "",
+ hrefTarget: "",
+ moveTo: "",
+ scene: "",
+ clickable: false,
+ url: "",
+ transition: "",
+ transitionDir: 1,
+ callback: null,
+ sync: true,
+ label: "",
+ toggle: false,
+ _duration: 800, // duration of selection, milliseconds
+
+ inheritParams: function(){
+ var parent = this.getParentWidget();
+ if(parent){
+ if(!this.transition){ this.transition = parent.transition; }
+ if(!this.icon){ this.icon = parent.iconBase; }
+ if(!this.iconPos){ this.iconPos = parent.iconPos; }
+ }
+ },
+
+ findCurrentView: function(moveTo){
+ var w;
+ if(moveTo){
+ w = dijit.byId(moveTo);
+ if(w){ return w.getShowingView(); }
+ }
+ var n = this.domNode.parentNode;
+ while(true){
+ w = dijit.getEnclosingWidget(n);
+ if(!w){ return null; }
+ if(w.performTransition){ break; }
+ n = w.domNode.parentNode;
+ }
+ return w;
+ },
+
+ transitionTo: function(moveTo, href, url, scene){
+ var w = this.findCurrentView(moveTo); // the current view widget
+ if(!w || moveTo && w === dijit.byId(moveTo)){ return; }
+ if(href){
+ if(this.hrefTarget){
+ dojox.mobile.openWindow(this.href, this.hrefTarget);
+ }else{
+ w.performTransition(null, this.transitionDir, this.transition, this, function(){location.href = href;});
+ }
+ return;
+ } else if(scene){
+ dojo.publish("/dojox/mobile/app/pushScene", [scene]);
+ return;
+ }
+ if(url){
+ var id;
+ if(dojox.mobile._viewMap && dojox.mobile._viewMap[url]){
+ // external view has already been loaded
+ id = dojox.mobile._viewMap[url];
+ }else{
+ // get the specified external view and append it to the <body>
+ var text = this._text;
+ if(!text){
+ if(this.sync){
+ text = dojo.trim(dojo._getText(url));
+ }else{
+ dojo["require"]("dojo._base.xhr");
+ var prog = dojox.mobile.ProgressIndicator.getInstance();
+ dojo.body().appendChild(prog.domNode);
+ prog.start();
+ var xhr = dojo.xhrGet({
+ url: url,
+ handleAs: "text"
+ });
+ xhr.addCallback(dojo.hitch(this, function(response, ioArgs){
+ prog.stop();
+ if(response){
+ this._text = response;
+ this.transitionTo(moveTo, href, url, scene);
+ }
+ }));
+ xhr.addErrback(function(error){
+ prog.stop();
+ alert("Failed to load "+url+"\n"+(error.description||error));
+ });
+ return;
+ }
+ }
+ this._text = null;
+ id = this._parse(text);
+ if(!dojox.mobile._viewMap){
+ dojox.mobile._viewMap = [];
+ }
+ dojox.mobile._viewMap[url] = id;
+ }
+ moveTo = id;
+ }
+ w.performTransition(moveTo, this.transitionDir, this.transition, this.callback && this, this.callback);
+ },
+
+ _parse: function(text){
+ var container = dojo.create("DIV");
+ var view;
+ if(text.charAt(0) == "<"){ // html markup
+ container.innerHTML = text;
+ view = container.firstChild; // <div dojoType="dojox.mobile.View">
+ if(!view && view.nodeType != 1){
+ alert("dojox.mobile.AbstractItem#transitionTo: invalid view content");
+ return;
+ }
+ view.setAttribute("_started", "true"); // to avoid startup() is called
+ view.style.visibility = "hidden";
+ dojo.body().appendChild(container);
+ (dojox.mobile.parser || dojo.parser).parse(container);
+ }else if(text.charAt(0) == "{"){ // json
+ dojo.body().appendChild(container);
+ this._ws = [];
+ view = this._instantiate(eval('('+text+')'), container);
+ for(var i = 0; i < this._ws.length; i++){
+ var w = this._ws[i];
+ w.startup && !w._started && (!w.getParent || !w.getParent()) && w.startup();
+ }
+ this._ws = null;
+ }
+ view.style.display = "none";
+ view.style.visibility = "visible";
+ var id = view.id;
+ return dojo.hash ? "#" + id : id;
+ },
+
+ _instantiate: function(/*Object*/obj, /*DomNode*/node, /*Widget*/parent){
+ var widget;
+ for(var key in obj){
+ if(key.charAt(0) == "@"){ continue; }
+ var cls = dojo.getObject(key);
+ if(!cls){ continue; }
+ var params = {};
+ var proto = cls.prototype;
+ var objs = dojo.isArray(obj[key]) ? obj[key] : [obj[key]];
+ for(var i = 0; i < objs.length; i++){
+ for(var prop in objs[i]){
+ if(prop.charAt(0) == "@"){
+ var val = objs[i][prop];
+ prop = prop.substring(1);
+ if(typeof proto[prop] == "string"){
+ params[prop] = val;
+ }else if(typeof proto[prop] == "number"){
+ params[prop] = val - 0;
+ }else if(typeof proto[prop] == "boolean"){
+ params[prop] = (val != "false");
+ }else if(typeof proto[prop] == "object"){
+ params[prop] = eval("(" + val + ")");
+ }
+ }
+ }
+ widget = new cls(params, node);
+ if(!node){ // not to call View's startup()
+ this._ws.push(widget);
+ }
+ if(parent && parent.addChild){
+ parent.addChild(widget);
+ }
+ this._instantiate(objs[i], null, widget);
+ }
+ }
+ return widget && widget.domNode;
+ },
+
+ createDomButton: function(/*DomNode*/refNode, /*DomNode?*/toNode){
+ var s = refNode.className;
+ if(s.match(/mblDomButton\w+_(\d+)/)){
+ var nDiv = RegExp.$1 - 0;
+ for(var i = 0, p = (toNode||refNode); i < nDiv; i++){
+ p = dojo.create("DIV", null, p);
+ }
+ }
+ },
+
+ select: function(/*Boolean?*/deselect){
+ // subclass must implement
+ },
+
+ defaultClickAction: function(){
+ if(this.toggle){
+ this.select(this.selected);
+ }else if(!this.selected){
+ this.select();
+ if(!this.selectOne){
+ var _this = this;
+ setTimeout(function(){
+ _this.select(true);
+ }, this._duration);
+ }
+ if(this.moveTo || this.href || this.url || this.scene){
+ this.transitionTo(this.moveTo, this.href, this.url, this.scene);
+ }
+ }
+ },
+
+ getParentWidget: function(){
+ var ref = this.srcNodeRef || this.domNode;
+ return ref && ref.parentNode ? dijit.getEnclosingWidget(ref.parentNode) : null;
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.ListItem",
+ dojox.mobile.AbstractItem,
+{
+ rightText: "",
+ btnClass: "",
+ anchorLabel: false,
+ noArrow: false,
+ selected: false,
+
+ buildRendering: function(){
+ this.inheritParams();
+ var a = this.anchorNode = dojo.create("A");
+ a.className = "mblListItemAnchor";
+ var box = dojo.create("DIV");
+ box.className = "mblListItemTextBox";
+ if(this.anchorLabel){
+ box.style.cursor = "pointer";
+ }
+ var r = this.srcNodeRef;
+ if(r){
+ for(var i = 0, len = r.childNodes.length; i < len; i++){
+ box.appendChild(r.removeChild(r.firstChild));
+ }
+ }
+ if(this.label){
+ box.appendChild(dojo.doc.createTextNode(this.label));
+ }
+ a.appendChild(box);
+ if(this.rightText){
+ this._setRightTextAttr(this.rightText);
+ }
+
+ if(this.moveTo || this.href || this.url || this.clickable){
+ var parent = this.getParentWidget();
+ if(!this.noArrow && !(parent && parent.stateful)){
+ var arrow = dojo.create("DIV");
+ arrow.className = "mblArrow";
+ a.appendChild(arrow);
+ }
+ this.connect(a, "onclick", "onClick");
+ }else if(this.btnClass){
+ var div = this.btnNode = dojo.create("DIV");
+ div.className = this.btnClass+" mblRightButton";
+ div.appendChild(dojo.create("DIV"));
+ div.appendChild(dojo.create("P"));
+
+ var dummyDiv = dojo.create("DIV");
+ dummyDiv.className = "mblRightButtonContainer";
+ dummyDiv.appendChild(div);
+ a.appendChild(dummyDiv);
+ dojo.addClass(a, "mblListItemAnchorHasRightButton");
+ setTimeout(function(){
+ dummyDiv.style.width = div.offsetWidth + "px";
+ dummyDiv.style.height = div.offsetHeight + "px";
+ if(dojo.isIE){
+ // IE seems to ignore the height of LI without this..
+ a.parentNode.style.height = a.parentNode.offsetHeight + "px";
+ }
+ }, 0);
+ }
+ if(this.anchorLabel){
+ box.style.display = "inline"; // to narrow the text region
+ }
+ var li = this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("LI");
+ li.className = "mblListItem" + (this.selected ? " mblItemSelected" : "");
+ li.appendChild(a);
+ this.setIcon();
+ },
+
+ setIcon: function(){
+ if(this.iconNode){ return; }
+ var a = this.anchorNode;
+ if(this.icon && this.icon != "none"){
+ var img = this.iconNode = dojo.create("IMG");
+ img.className = "mblListItemIcon";
+ img.src = this.icon;
+ this.domNode.insertBefore(img, a);
+ dojox.mobile.setupIcon(this.iconNode, this.iconPos);
+ dojo.removeClass(a, "mblListItemAnchorNoIcon");
+ }else{
+ dojo.addClass(a, "mblListItemAnchorNoIcon");
+ }
+ },
+
+ onClick: function(e){
+ var a = e.currentTarget;
+ var li = a.parentNode;
+ if(dojo.hasClass(li, "mblItemSelected")){ return; } // already selected
+ if(this.anchorLabel){
+ for(var p = e.target; p.tagName != "LI"; p = p.parentNode){
+ if(p.className == "mblListItemTextBox"){
+ dojo.addClass(p, "mblListItemTextBoxSelected");
+ setTimeout(function(){
+ dojo.removeClass(p, "mblListItemTextBoxSelected");
+ }, 1000);
+ this.onAnchorLabelClicked(e);
+ return;
+ }
+ }
+ }
+ if(this.getParentWidget().stateful){
+ for(var i = 0, c = li.parentNode.childNodes; i < c.length; i++){
+ dojo.removeClass(c[i], "mblItemSelected");
+ }
+ }else{
+ setTimeout(function(){
+ dojo.removeClass(li, "mblItemSelected");
+ }, 1000);
+ }
+ dojo.addClass(li, "mblItemSelected");
+ this.transitionTo(this.moveTo, this.href, this.url, this.scene);
+ },
+
+ onAnchorLabelClicked: function(e){
+ },
+
+ _setRightTextAttr: function(/*String*/text){
+ this.rightText = text;
+ if(!this._rightTextNode){
+ this._rightTextNode = dojo.create("DIV", {className:"mblRightText"}, this.anchorNode);
+ }
+ this._rightTextNode.innerHTML = text;
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.Switch",
+ dijit._WidgetBase,
+{
+ value: "on",
+ leftLabel: "ON",
+ rightLabel: "OFF",
+ _width: 53,
+
+ buildRendering: function(){
+ this.domNode = this.srcNodeRef || dojo.doc.createElement("DIV");
+ this.domNode.className = "mblSwitch";
+ this.domNode.innerHTML =
+ '<div class="mblSwitchInner">'
+ + '<div class="mblSwitchBg mblSwitchBgLeft">'
+ + '<div class="mblSwitchText mblSwitchTextLeft">'+this.leftLabel+'</div>'
+ + '</div>'
+ + '<div class="mblSwitchBg mblSwitchBgRight">'
+ + '<div class="mblSwitchText mblSwitchTextRight">'+this.rightLabel+'</div>'
+ + '</div>'
+ + '<div class="mblSwitchKnob"></div>'
+ + '</div>';
+ var n = this.inner = this.domNode.firstChild;
+ this.left = n.childNodes[0];
+ this.right = n.childNodes[1];
+ this.knob = n.childNodes[2];
+
+ dojo.addClass(this.domNode, (this.value == "on") ? "mblSwitchOn" : "mblSwitchOff");
+ this[this.value == "off" ? "left" : "right"].style.display = "none";
+ },
+
+ postCreate: function(){
+ this.connect(this.knob, "onclick", "onClick");
+ this.connect(this.knob, "touchstart", "onTouchStart");
+ this.connect(this.knob, "mousedown", "onTouchStart");
+ },
+
+ _changeState: function(/*String*/state){
+ this.inner.style.left = "";
+ dojo.addClass(this.domNode, "mblSwitchAnimation");
+ dojo.removeClass(this.domNode, (state == "on") ? "mblSwitchOff" : "mblSwitchOn");
+ dojo.addClass(this.domNode, (state == "on") ? "mblSwitchOn" : "mblSwitchOff");
+
+ var _this = this;
+ setTimeout(function(){
+ _this[state == "off" ? "left" : "right"].style.display = "none";
+ dojo.removeClass(_this.domNode, "mblSwitchAnimation");
+ }, 300);
+ },
+
+ onClick: function(e){
+ if(this._moved){ return; }
+ this.value = (this.value == "on") ? "off" : "on";
+ this._changeState(this.value);
+ this.onStateChanged(this.value);
+ },
+
+ onTouchStart: function(e){
+ this._moved = false;
+ this.innerStartX = this.inner.offsetLeft;
+ if(e.targetTouches){
+ this.touchStartX = e.targetTouches[0].clientX;
+ this._conn1 = dojo.connect(this.inner, "touchmove", this, "onTouchMove");
+ this._conn2 = dojo.connect(this.inner, "touchend", this, "onTouchEnd");
+ }
+ this.left.style.display = "block";
+ this.right.style.display = "block";
+ dojo.stopEvent(e);
+ },
+
+ onTouchMove: function(e){
+ e.preventDefault();
+ var dx;
+ if(e.targetTouches){
+ if(e.targetTouches.length != 1){ return false; }
+ dx = e.targetTouches[0].clientX - this.touchStartX;
+ }else{
+ dx = e.clientX - this.touchStartX;
+ }
+ var pos = this.innerStartX + dx;
+ var d = 10;
+ if(pos <= -(this._width-d)){ pos = -this._width; }
+ if(pos >= -d){ pos = 0; }
+ this.inner.style.left = pos + "px";
+ this._moved = true;
+ },
+
+ onTouchEnd: function(e){
+ dojo.disconnect(this._conn1);
+ dojo.disconnect(this._conn2);
+ if(this.innerStartX == this.inner.offsetLeft){
+ if(dojo.isWebKit){
+ var ev = dojo.doc.createEvent("MouseEvents");
+ ev.initEvent("click", true, true);
+ this.knob.dispatchEvent(ev);
+ }
+ return;
+ }
+ var newState = (this.inner.offsetLeft < -(this._width/2)) ? "off" : "on";
+ this._changeState(newState);
+ if(newState != this.value){
+ this.value = newState;
+ this.onStateChanged(this.value);
+ }
+ },
+
+ onStateChanged: function(/*String*/newState){
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.Button",
+ dijit._WidgetBase,
+{
+ btnClass: "mblBlueButton",
+ duration: 1000, // duration of selection, milliseconds
+
+ label: null,
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("BUTTON");
+ this.domNode.className = "mblButton "+this.btnClass;
+
+ if(this.label){
+ this.domNode.innerHTML = this.label;
+ }
+
+ this.connect(this.domNode, "onclick", "onClick");
+ },
+
+ onClick: function(e){
+ var button = this.domNode;
+ var c = "mblButtonSelected "+this.btnClass+"Selected";
+ dojo.addClass(button, c);
+ setTimeout(function(){
+ dojo.removeClass(button, c);
+ }, this.duration);
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.ToolBarButton",
+ dojox.mobile.AbstractItem,
+{
+ selected: false,
+ _defaultColor: "mblColorDefault",
+ _selColor: "mblColorDefaultSel",
+
+ buildRendering: function(){
+ this.inheritParams();
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("div");
+ dojo.addClass(this.domNode, "mblToolbarButton mblArrowButtonText");
+ var color;
+ if(this.selected){
+ color = this._selColor;
+ }else if(this.domNode.className.indexOf("mblColor") == -1){
+ color = this._defaultColor;
+ }
+ dojo.addClass(this.domNode, color);
+
+ if(this.label){
+ this.domNode.innerHTML = this.label;
+ }else{
+ this.label = this.domNode.innerHTML;
+ }
+
+ if(this.icon && this.icon != "none"){
+ var img;
+ if(this.iconPos){
+ var iconDiv = dojo.create("DIV", null, this.domNode);
+ img = dojo.create("IMG", null, iconDiv);
+ img.style.position = "absolute";
+ var arr = this.iconPos.split(/[ ,]/);
+ dojo.style(iconDiv, {
+ position: "relative",
+ width: arr[2] + "px",
+ height: arr[3] + "px"
+ });
+ }else{
+ img = dojo.create("IMG", null, this.domNode);
+ }
+ img.src = this.icon;
+ dojox.mobile.setupIcon(img, this.iconPos);
+ this.iconNode = img;
+ }
+ this.createDomButton(this.domNode);
+ this.connect(this.domNode, "onclick", "onClick");
+ },
+
+ select: function(/*Boolean?*/deselect){
+ dojo.toggleClass(this.domNode, this._selColor, !deselect);
+ this.selected = !deselect;
+ },
+
+ onClick: function(e){
+ this.defaultClickAction();
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.ProgressIndicator",
+ null,
+{
+ interval: 100, // milliseconds
+ colors: [
+ "#C0C0C0", "#C0C0C0", "#C0C0C0", "#C0C0C0",
+ "#C0C0C0", "#C0C0C0", "#B8B9B8", "#AEAFAE",
+ "#A4A5A4", "#9A9A9A", "#8E8E8E", "#838383"
+ ],
+
+ _bars: [],
+
+ constructor: function(){
+ this.domNode = dojo.create("DIV");
+ this.domNode.className = "mblProgContainer";
+ for(var i = 0; i < 12; i++){
+ var div = dojo.create("DIV");
+ div.className = "mblProg mblProg"+i;
+ this.domNode.appendChild(div);
+ this._bars.push(div);
+ }
+ },
+
+ start: function(){
+ var cntr = 0;
+ var _this = this;
+ this.timer = setInterval(function(){
+ cntr--;
+ cntr = cntr < 0 ? 11 : cntr;
+ var c = _this.colors;
+ for(var i = 0; i < 12; i++){
+ var idx = (cntr + i) % 12;
+ _this._bars[i].style.backgroundColor = c[idx];
+ }
+ }, this.interval);
+ },
+
+ stop: function(){
+ if(this.timer){
+ clearInterval(this.timer);
+ }
+ this.timer = null;
+ if(this.domNode.parentNode){
+ this.domNode.parentNode.removeChild(this.domNode);
+ }
+ }
+});
+dojox.mobile.ProgressIndicator._instance = null;
+dojox.mobile.ProgressIndicator.getInstance = function(){
+ if(!dojox.mobile.ProgressIndicator._instance){
+ dojox.mobile.ProgressIndicator._instance = new dojox.mobile.ProgressIndicator();
+ }
+ return dojox.mobile.ProgressIndicator._instance;
+};
+
+dojox.mobile.addClass = function(){
+ // summary:
+ // Adds a theme class name to <body>.
+ // description:
+ // Finds the currently applied theme name, such as 'iphone' or 'android'
+ // from link elements, and adds it as a class name for the body element.
+ var elems = document.getElementsByTagName("link");
+ for(var i = 0, len = elems.length; i < len; i++){
+ if(elems[i].href.match(/dojox\/mobile\/themes\/(\w+)\//)){
+ dojox.mobile.theme = RegExp.$1;
+ dojo.addClass(dojo.body(), dojox.mobile.theme);
+ break;
+ }
+ }
+};
+
+dojox.mobile.setupIcon = function(/*DomNode*/iconNode, /*String*/iconPos){
+ if(iconNode && iconPos){
+ var arr = dojo.map(iconPos.split(/[ ,]/),
+ function(item){ return item - 0; });
+ var t = arr[0]; // top
+ var r = arr[1] + arr[2]; // right
+ var b = arr[0] + arr[3]; // bottom
+ var l = arr[1]; // left
+ iconNode.style.clip = "rect("+t+"px "+r+"px "+b+"px "+l+"px)";
+ iconNode.style.top = dojo.style(iconNode, "top") - t + "px";
+ iconNode.style.left = dojo.style(iconNode.parentNode, "paddingLeft") - l + "px";
+ }
+};
+
+dojox.mobile.hideAddressBar = function(){
+ dojo.body().style.minHeight = "1000px"; // to ensure enough height for scrollTo to work
+ setTimeout(function(){ scrollTo(0, 1); }, 100);
+ setTimeout(function(){ scrollTo(0, 1); }, 400);
+ setTimeout(function(){
+ scrollTo(0, 1);
+ // re-define the min-height with the actual height
+ dojo.body().style.minHeight = (dojo.global.innerHeight||dojo.doc.documentElement.clientHeight) + "px";
+ }, 1000);
+};
+
+dojox.mobile.openWindow = function(url, target){
+ dojo.global.open(url, target || "_blank");
+};
+
+dojo._loaders.unshift(function(){
+ // avoid use of dojo.query
+ /*
+ var list = dojo.query('[lazy=true] [dojoType]', null);
+ list.forEach(function(node, index, nodeList){
+ node.setAttribute("__dojoType", node.getAttribute("dojoType"));
+ node.removeAttribute("dojoType");
+ });
+ */
+
+ var nodes = dojo.body().getElementsByTagName("*");
+ var i, len, s;
+ len = nodes.length;
+ for(i = 0; i < len; i++){
+ s = nodes[i].getAttribute("dojoType");
+ if(s){
+ if(nodes[i].parentNode.getAttribute("lazy") == "true"){
+ nodes[i].setAttribute("__dojoType", s);
+ nodes[i].removeAttribute("dojoType");
+ }
+ }
+ }
+});
+
+dojo.addOnLoad(function(){
+ dojox.mobile.addClass();
+ if(dojo.config["mblApplyPageStyles"] !== false){
+ dojo.addClass(dojo.doc.documentElement, "mobile");
+ }
+
+ // You can disable hiding the address bar with the following djConfig.
+ // var djConfig = { mblHideAddressBar: false };
+ if(dojo.config["mblHideAddressBar"] !== false){
+ dojox.mobile.hideAddressBar();
+ if(dojo.config["mblAlwaysHideAddressBar"] == true){
+ if(dojo.global.onorientationchange !== undefined){
+ dojo.connect(dojo.global, "onorientationchange", dojox.mobile.hideAddressBar);
+ }else{
+ dojo.connect(dojo.global, "onresize", dojox.mobile.hideAddressBar);
+ }
+ }
+ }
+
+ // avoid use of dojo.query
+ /*
+ var list = dojo.query('[__dojoType]', null);
+ list.forEach(function(node, index, nodeList){
+ node.setAttribute("dojoType", node.getAttribute("__dojoType"));
+ node.removeAttribute("__dojoType");
+ });
+ */
+
+ var nodes = dojo.body().getElementsByTagName("*");
+ var i, len = nodes.length, s;
+ for(i = 0; i < len; i++){
+ s = nodes[i].getAttribute("__dojoType");
+ if(s){
+ nodes[i].setAttribute("dojoType", s);
+ nodes[i].removeAttribute("__dojoType");
+ }
+ }
+
+ if(dojo.hash){
+ // find widgets under root recursively
+ var findWidgets = function(root){
+ var arr;
+ arr = dijit.findWidgets(root);
+ var widgets = arr;
+ for(var i = 0; i < widgets.length; i++){
+ arr = arr.concat(findWidgets(widgets[i].containerNode));
+ }
+ return arr;
+ };
+ dojo.subscribe("/dojo/hashchange", null, function(value){
+ var view = dojox.mobile.currentView;
+ if(!view){ return; }
+ var params = dojox.mobile._params;
+ if(!params){ // browser back/forward button was pressed
+ var moveTo = value ? value : dojox.mobile._defaultView.id;
+ var widgets = findWidgets(view.domNode);
+ var dir = 1, transition = "slide";
+ for(i = 0; i < widgets.length; i++){
+ var w = widgets[i];
+ if("#"+moveTo == w.moveTo){
+ // found a widget that has the given moveTo
+ transition = w.transition;
+ dir = (w instanceof dojox.mobile.Heading) ? -1 : 1;
+ break;
+ }
+ }
+ params = [ moveTo, dir, transition ];
+ }
+ view.performTransition.apply(view, params);
+ dojox.mobile._params = null;
+ });
+ }
+
+ dojo.body().style.visibility = "visible";
+});
+
+dijit.getEnclosingWidget = function(node){
+ while(node && node.tagName !== "BODY"){
+ if(node.getAttribute && node.getAttribute("widgetId")){
+ return dijit.registry.byId(node.getAttribute("widgetId"));
+ }
+ node = node._parentNode || node.parentNode;
+ }
+ return null;
+};
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/mobile/app.js b/js/dojo-1.6/dojox/mobile/app.js
new file mode 100644
index 0000000..106bad2
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app.js
@@ -0,0 +1,14 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+/*
+ This is an optimized version of Dojo, built for deployment and not for
+ development. To get sources and documentation, please visit:
+
+ http://dojotoolkit.org
+*/
+
+if(!dojo._hasResource["dojo.window"]){dojo._hasResource["dojo.window"]=true;dojo.provide("dojo.window");dojo.getObject("window",true,dojo);dojo.window.getBox=function(){var _1=(dojo.doc.compatMode=="BackCompat")?dojo.body():dojo.doc.documentElement;var _2=dojo._docScroll();return {w:_1.clientWidth,h:_1.clientHeight,l:_2.x,t:_2.y};};dojo.window.get=function(_3){if(dojo.isIE&&window!==document.parentWindow){_3.parentWindow.execScript("document._parentWindow = window;","Javascript");var _4=_3._parentWindow;_3._parentWindow=null;return _4;}return _3.parentWindow||_3.defaultView;};dojo.window.scrollIntoView=function(_5,_6){try{_5=dojo.byId(_5);var _7=_5.ownerDocument||dojo.doc,_8=_7.body||dojo.body(),_9=_7.documentElement||_8.parentNode,_a=dojo.isIE,_b=dojo.isWebKit;if((!(dojo.isMoz||_a||_b||dojo.isOpera)||_5==_8||_5==_9)&&(typeof _5.scrollIntoView!="undefined")){_5.scrollIntoView(false);return;}var _c=_7.compatMode=="BackCompat",_d=_c?_8:_9,_e=_b?_8:_d,_f=_d.clientWidth,_10=_d.clientHeight,rtl=!dojo._isBodyLtr(),_11=_6||dojo.position(_5),el=_5.parentNode,_12=function(el){return ((_a<=6||(_a&&_c))?false:(dojo.style(el,"position").toLowerCase()=="fixed"));};if(_12(_5)){return;}while(el){if(el==_8){el=_e;}var _13=dojo.position(el),_14=_12(el);if(el==_e){_13.w=_f;_13.h=_10;if(_e==_9&&_a&&rtl){_13.x+=_e.offsetWidth-_13.w;}if(_13.x<0||!_a){_13.x=0;}if(_13.y<0||!_a){_13.y=0;}}else{var pb=dojo._getPadBorderExtents(el);_13.w-=pb.w;_13.h-=pb.h;_13.x+=pb.l;_13.y+=pb.t;}if(el!=_e){var _15=el.clientWidth,_16=_13.w-_15;if(_15>0&&_16>0){_13.w=_15;if(_a&&rtl){_13.x+=_16;}}_15=el.clientHeight;_16=_13.h-_15;if(_15>0&&_16>0){_13.h=_15;}}if(_14){if(_13.y<0){_13.h+=_13.y;_13.y=0;}if(_13.x<0){_13.w+=_13.x;_13.x=0;}if(_13.y+_13.h>_10){_13.h=_10-_13.y;}if(_13.x+_13.w>_f){_13.w=_f-_13.x;}}var l=_11.x-_13.x,t=_11.y-Math.max(_13.y,0),r=l+_11.w-_13.w,bot=t+_11.h-_13.h;if(r*l>0){var s=Math[l<0?"max":"min"](l,r);_11.x+=el.scrollLeft;el.scrollLeft+=(_a>=8&&!_c&&rtl)?-s:s;_11.x-=el.scrollLeft;}if(bot*t>0){_11.y+=el.scrollTop;el.scrollTop+=Math[t<0?"max":"min"](t,bot);_11.y-=el.scrollTop;}el=(el!=_e)&&!_14&&el.parentNode;}}catch(error){console.error("scrollIntoView: "+error);_5.scrollIntoView(false);}};}if(!dojo._hasResource["dijit._base.manager"]){dojo._hasResource["dijit._base.manager"]=true;dojo.provide("dijit._base.manager");dojo.declare("dijit.WidgetSet",null,{constructor:function(){this._hash={};this.length=0;},add:function(_17){if(this._hash[_17.id]){throw new Error("Tried to register widget with id=="+_17.id+" but that id is already registered");}this._hash[_17.id]=_17;this.length++;},remove:function(id){if(this._hash[id]){delete this._hash[id];this.length--;}},forEach:function(_18,_19){_19=_19||dojo.global;var i=0,id;for(id in this._hash){_18.call(_19,this._hash[id],i++,this._hash);}return this;},filter:function(_1a,_1b){_1b=_1b||dojo.global;var res=new dijit.WidgetSet(),i=0,id;for(id in this._hash){var w=this._hash[id];if(_1a.call(_1b,w,i++,this._hash)){res.add(w);}}return res;},byId:function(id){return this._hash[id];},byClass:function(cls){var res=new dijit.WidgetSet(),id,_1c;for(id in this._hash){_1c=this._hash[id];if(_1c.declaredClass==cls){res.add(_1c);}}return res;},toArray:function(){var ar=[];for(var id in this._hash){ar.push(this._hash[id]);}return ar;},map:function(_1d,_1e){return dojo.map(this.toArray(),_1d,_1e);},every:function(_1f,_20){_20=_20||dojo.global;var x=0,i;for(i in this._hash){if(!_1f.call(_20,this._hash[i],x++,this._hash)){return false;}}return true;},some:function(_21,_22){_22=_22||dojo.global;var x=0,i;for(i in this._hash){if(_21.call(_22,this._hash[i],x++,this._hash)){return true;}}return false;}});(function(){dijit.registry=new dijit.WidgetSet();var _23=dijit.registry._hash,_24=dojo.attr,_25=dojo.hasAttr,_26=dojo.style;dijit.byId=function(id){return typeof id=="string"?_23[id]:id;};var _27={};dijit.getUniqueId=function(_28){var id;do{id=_28+"_"+(_28 in _27?++_27[_28]:_27[_28]=0);}while(_23[id]);return dijit._scopeName=="dijit"?id:dijit._scopeName+"_"+id;};dijit.findWidgets=function(_29){var _2a=[];function _2b(_2c){for(var _2d=_2c.firstChild;_2d;_2d=_2d.nextSibling){if(_2d.nodeType==1){var _2e=_2d.getAttribute("widgetId");if(_2e){var _2f=_23[_2e];if(_2f){_2a.push(_2f);}}else{_2b(_2d);}}}};_2b(_29);return _2a;};dijit._destroyAll=function(){dijit._curFocus=null;dijit._prevFocus=null;dijit._activeStack=[];dojo.forEach(dijit.findWidgets(dojo.body()),function(_30){if(!_30._destroyed){if(_30.destroyRecursive){_30.destroyRecursive();}else{if(_30.destroy){_30.destroy();}}}});};if(dojo.isIE){dojo.addOnWindowUnload(function(){dijit._destroyAll();});}dijit.byNode=function(_31){return _23[_31.getAttribute("widgetId")];};dijit.getEnclosingWidget=function(_32){while(_32){var id=_32.getAttribute&&_32.getAttribute("widgetId");if(id){return _23[id];}_32=_32.parentNode;}return null;};var _33=(dijit._isElementShown=function(_34){var s=_26(_34);return (s.visibility!="hidden")&&(s.visibility!="collapsed")&&(s.display!="none")&&(_24(_34,"type")!="hidden");});dijit.hasDefaultTabStop=function(_35){switch(_35.nodeName.toLowerCase()){case "a":return _25(_35,"href");case "area":case "button":case "input":case "object":case "select":case "textarea":return true;case "iframe":var _36;try{var _37=_35.contentDocument;if("designMode" in _37&&_37.designMode=="on"){return true;}_36=_37.body;}catch(e1){try{_36=_35.contentWindow.document.body;}catch(e2){return false;}}return _36.contentEditable=="true"||(_36.firstChild&&_36.firstChild.contentEditable=="true");default:return _35.contentEditable=="true";}};var _38=(dijit.isTabNavigable=function(_39){if(_24(_39,"disabled")){return false;}else{if(_25(_39,"tabIndex")){return _24(_39,"tabIndex")>=0;}else{return dijit.hasDefaultTabStop(_39);}}});dijit._getTabNavigable=function(_3a){var _3b,_3c,_3d,_3e,_3f,_40,_41={};function _42(_43){return _43&&_43.tagName.toLowerCase()=="input"&&_43.type&&_43.type.toLowerCase()=="radio"&&_43.name&&_43.name.toLowerCase();};var _44=function(_45){dojo.query("> *",_45).forEach(function(_46){if((dojo.isIE&&_46.scopeName!=="HTML")||!_33(_46)){return;}if(_38(_46)){var _47=_24(_46,"tabIndex");if(!_25(_46,"tabIndex")||_47==0){if(!_3b){_3b=_46;}_3c=_46;}else{if(_47>0){if(!_3d||_47<_3e){_3e=_47;_3d=_46;}if(!_3f||_47>=_40){_40=_47;_3f=_46;}}}var rn=_42(_46);if(dojo.attr(_46,"checked")&&rn){_41[rn]=_46;}}if(_46.nodeName.toUpperCase()!="SELECT"){_44(_46);}});};if(_33(_3a)){_44(_3a);}function rs(_48){return _41[_42(_48)]||_48;};return {first:rs(_3b),last:rs(_3c),lowest:rs(_3d),highest:rs(_3f)};};dijit.getFirstInTabbingOrder=function(_49){var _4a=dijit._getTabNavigable(dojo.byId(_49));return _4a.lowest?_4a.lowest:_4a.first;};dijit.getLastInTabbingOrder=function(_4b){var _4c=dijit._getTabNavigable(dojo.byId(_4b));return _4c.last?_4c.last:_4c.highest;};dijit.defaultDuration=dojo.config["defaultDuration"]||200;})();}if(!dojo._hasResource["dijit._base.focus"]){dojo._hasResource["dijit._base.focus"]=true;dojo.provide("dijit._base.focus");dojo.mixin(dijit,{_curFocus:null,_prevFocus:null,isCollapsed:function(){return dijit.getBookmark().isCollapsed;},getBookmark:function(){var bm,rg,tg,sel=dojo.doc.selection,cf=dijit._curFocus;if(dojo.global.getSelection){sel=dojo.global.getSelection();if(sel){if(sel.isCollapsed){tg=cf?cf.tagName:"";if(tg){tg=tg.toLowerCase();if(tg=="textarea"||(tg=="input"&&(!cf.type||cf.type.toLowerCase()=="text"))){sel={start:cf.selectionStart,end:cf.selectionEnd,node:cf,pRange:true};return {isCollapsed:(sel.end<=sel.start),mark:sel};}}bm={isCollapsed:true};}else{rg=sel.getRangeAt(0);bm={isCollapsed:false,mark:rg.cloneRange()};}}}else{if(sel){tg=cf?cf.tagName:"";tg=tg.toLowerCase();if(cf&&tg&&(tg=="button"||tg=="textarea"||tg=="input")){if(sel.type&&sel.type.toLowerCase()=="none"){return {isCollapsed:true,mark:null};}else{rg=sel.createRange();return {isCollapsed:rg.text&&rg.text.length?false:true,mark:{range:rg,pRange:true}};}}bm={};try{rg=sel.createRange();bm.isCollapsed=!(sel.type=="Text"?rg.htmlText.length:rg.length);}catch(e){bm.isCollapsed=true;return bm;}if(sel.type.toUpperCase()=="CONTROL"){if(rg.length){bm.mark=[];var i=0,len=rg.length;while(i<len){bm.mark.push(rg.item(i++));}}else{bm.isCollapsed=true;bm.mark=null;}}else{bm.mark=rg.getBookmark();}}else{console.warn("No idea how to store the current selection for this browser!");}}return bm;},moveToBookmark:function(_4d){var _4e=dojo.doc,_4f=_4d.mark;if(_4f){if(dojo.global.getSelection){var sel=dojo.global.getSelection();if(sel&&sel.removeAllRanges){if(_4f.pRange){var r=_4f;var n=r.node;n.selectionStart=r.start;n.selectionEnd=r.end;}else{sel.removeAllRanges();sel.addRange(_4f);}}else{console.warn("No idea how to restore selection for this browser!");}}else{if(_4e.selection&&_4f){var rg;if(_4f.pRange){rg=_4f.range;}else{if(dojo.isArray(_4f)){rg=_4e.body.createControlRange();dojo.forEach(_4f,function(n){rg.addElement(n);});}else{rg=_4e.body.createTextRange();rg.moveToBookmark(_4f);}}rg.select();}}}},getFocus:function(_50,_51){var _52=!dijit._curFocus||(_50&&dojo.isDescendant(dijit._curFocus,_50.domNode))?dijit._prevFocus:dijit._curFocus;return {node:_52,bookmark:(_52==dijit._curFocus)&&dojo.withGlobal(_51||dojo.global,dijit.getBookmark),openedForWindow:_51};},focus:function(_53){if(!_53){return;}var _54="node" in _53?_53.node:_53,_55=_53.bookmark,_56=_53.openedForWindow,_57=_55?_55.isCollapsed:false;if(_54){var _58=(_54.tagName.toLowerCase()=="iframe")?_54.contentWindow:_54;if(_58&&_58.focus){try{_58.focus();}catch(e){}}dijit._onFocusNode(_54);}if(_55&&dojo.withGlobal(_56||dojo.global,dijit.isCollapsed)&&!_57){if(_56){_56.focus();}try{dojo.withGlobal(_56||dojo.global,dijit.moveToBookmark,null,[_55]);}catch(e2){}}},_activeStack:[],registerIframe:function(_59){return dijit.registerWin(_59.contentWindow,_59);},unregisterIframe:function(_5a){dijit.unregisterWin(_5a);},registerWin:function(_5b,_5c){var _5d=function(evt){dijit._justMouseDowned=true;setTimeout(function(){dijit._justMouseDowned=false;},0);if(dojo.isIE&&evt&&evt.srcElement&&evt.srcElement.parentNode==null){return;}dijit._onTouchNode(_5c||evt.target||evt.srcElement,"mouse");};var doc=dojo.isIE?_5b.document.documentElement:_5b.document;if(doc){if(dojo.isIE){_5b.document.body.attachEvent("onmousedown",_5d);var _5e=function(evt){if(evt.srcElement.tagName.toLowerCase()!="#document"&&dijit.isTabNavigable(evt.srcElement)){dijit._onFocusNode(_5c||evt.srcElement);}else{dijit._onTouchNode(_5c||evt.srcElement);}};doc.attachEvent("onactivate",_5e);var _5f=function(evt){dijit._onBlurNode(_5c||evt.srcElement);};doc.attachEvent("ondeactivate",_5f);return function(){_5b.document.detachEvent("onmousedown",_5d);doc.detachEvent("onactivate",_5e);doc.detachEvent("ondeactivate",_5f);doc=null;};}else{doc.body.addEventListener("mousedown",_5d,true);var _60=function(evt){dijit._onFocusNode(_5c||evt.target);};doc.addEventListener("focus",_60,true);var _61=function(evt){dijit._onBlurNode(_5c||evt.target);};doc.addEventListener("blur",_61,true);return function(){doc.body.removeEventListener("mousedown",_5d,true);doc.removeEventListener("focus",_60,true);doc.removeEventListener("blur",_61,true);doc=null;};}}},unregisterWin:function(_62){_62&&_62();},_onBlurNode:function(_63){dijit._prevFocus=dijit._curFocus;dijit._curFocus=null;if(dijit._justMouseDowned){return;}if(dijit._clearActiveWidgetsTimer){clearTimeout(dijit._clearActiveWidgetsTimer);}dijit._clearActiveWidgetsTimer=setTimeout(function(){delete dijit._clearActiveWidgetsTimer;dijit._setStack([]);dijit._prevFocus=null;},100);},_onTouchNode:function(_64,by){if(dijit._clearActiveWidgetsTimer){clearTimeout(dijit._clearActiveWidgetsTimer);delete dijit._clearActiveWidgetsTimer;}var _65=[];try{while(_64){var _66=dojo.attr(_64,"dijitPopupParent");if(_66){_64=dijit.byId(_66).domNode;}else{if(_64.tagName&&_64.tagName.toLowerCase()=="body"){if(_64===dojo.body()){break;}_64=dojo.window.get(_64.ownerDocument).frameElement;}else{var id=_64.getAttribute&&_64.getAttribute("widgetId"),_67=id&&dijit.byId(id);if(_67&&!(by=="mouse"&&_67.get("disabled"))){_65.unshift(id);}_64=_64.parentNode;}}}}catch(e){}dijit._setStack(_65,by);},_onFocusNode:function(_68){if(!_68){return;}if(_68.nodeType==9){return;}dijit._onTouchNode(_68);if(_68==dijit._curFocus){return;}if(dijit._curFocus){dijit._prevFocus=dijit._curFocus;}dijit._curFocus=_68;dojo.publish("focusNode",[_68]);},_setStack:function(_69,by){var _6a=dijit._activeStack;dijit._activeStack=_69;for(var _6b=0;_6b<Math.min(_6a.length,_69.length);_6b++){if(_6a[_6b]!=_69[_6b]){break;}}var _6c;for(var i=_6a.length-1;i>=_6b;i--){_6c=dijit.byId(_6a[i]);if(_6c){_6c._focused=false;_6c.set("focused",false);_6c._hasBeenBlurred=true;if(_6c._onBlur){_6c._onBlur(by);}dojo.publish("widgetBlur",[_6c,by]);}}for(i=_6b;i<_69.length;i++){_6c=dijit.byId(_69[i]);if(_6c){_6c._focused=true;_6c.set("focused",true);if(_6c._onFocus){_6c._onFocus(by);}dojo.publish("widgetFocus",[_6c,by]);}}}});dojo.addOnLoad(function(){var _6d=dijit.registerWin(window);if(dojo.isIE){dojo.addOnWindowUnload(function(){dijit.unregisterWin(_6d);_6d=null;});}});}if(!dojo._hasResource["dojo.AdapterRegistry"]){dojo._hasResource["dojo.AdapterRegistry"]=true;dojo.provide("dojo.AdapterRegistry");dojo.AdapterRegistry=function(_6e){this.pairs=[];this.returnWrappers=_6e||false;};dojo.extend(dojo.AdapterRegistry,{register:function(_6f,_70,_71,_72,_73){this.pairs[((_73)?"unshift":"push")]([_6f,_70,_71,_72]);},match:function(){for(var i=0;i<this.pairs.length;i++){var _74=this.pairs[i];if(_74[1].apply(this,arguments)){if((_74[3])||(this.returnWrappers)){return _74[2];}else{return _74[2].apply(this,arguments);}}}throw new Error("No match found");},unregister:function(_75){for(var i=0;i<this.pairs.length;i++){var _76=this.pairs[i];if(_76[0]==_75){this.pairs.splice(i,1);return true;}}return false;}});}if(!dojo._hasResource["dijit._base.place"]){dojo._hasResource["dijit._base.place"]=true;dojo.provide("dijit._base.place");dijit.getViewport=function(){return dojo.window.getBox();};dijit.placeOnScreen=function(_77,pos,_78,_79){var _7a=dojo.map(_78,function(_7b){var c={corner:_7b,pos:{x:pos.x,y:pos.y}};if(_79){c.pos.x+=_7b.charAt(1)=="L"?_79.x:-_79.x;c.pos.y+=_7b.charAt(0)=="T"?_79.y:-_79.y;}return c;});return dijit._place(_77,_7a);};dijit._place=function(_7c,_7d,_7e,_7f){var _80=dojo.window.getBox();if(!_7c.parentNode||String(_7c.parentNode.tagName).toLowerCase()!="body"){dojo.body().appendChild(_7c);}var _81=null;dojo.some(_7d,function(_82){var _83=_82.corner;var pos=_82.pos;var _84=0;var _85={w:_83.charAt(1)=="L"?(_80.l+_80.w)-pos.x:pos.x-_80.l,h:_83.charAt(1)=="T"?(_80.t+_80.h)-pos.y:pos.y-_80.t};if(_7e){var res=_7e(_7c,_82.aroundCorner,_83,_85,_7f);_84=typeof res=="undefined"?0:res;}var _86=_7c.style;var _87=_86.display;var _88=_86.visibility;_86.visibility="hidden";_86.display="";var mb=dojo.marginBox(_7c);_86.display=_87;_86.visibility=_88;var _89=Math.max(_80.l,_83.charAt(1)=="L"?pos.x:(pos.x-mb.w)),_8a=Math.max(_80.t,_83.charAt(0)=="T"?pos.y:(pos.y-mb.h)),_8b=Math.min(_80.l+_80.w,_83.charAt(1)=="L"?(_89+mb.w):pos.x),_8c=Math.min(_80.t+_80.h,_83.charAt(0)=="T"?(_8a+mb.h):pos.y),_8d=_8b-_89,_8e=_8c-_8a;_84+=(mb.w-_8d)+(mb.h-_8e);if(_81==null||_84<_81.overflow){_81={corner:_83,aroundCorner:_82.aroundCorner,x:_89,y:_8a,w:_8d,h:_8e,overflow:_84,spaceAvailable:_85};}return !_84;});if(_81.overflow&&_7e){_7e(_7c,_81.aroundCorner,_81.corner,_81.spaceAvailable,_7f);}var l=dojo._isBodyLtr(),s=_7c.style;s.top=_81.y+"px";s[l?"left":"right"]=(l?_81.x:_80.w-_81.x-_81.w)+"px";return _81;};dijit.placeOnScreenAroundNode=function(_8f,_90,_91,_92){_90=dojo.byId(_90);var _93=dojo.position(_90,true);return dijit._placeOnScreenAroundRect(_8f,_93.x,_93.y,_93.w,_93.h,_91,_92);};dijit.placeOnScreenAroundRectangle=function(_94,_95,_96,_97){return dijit._placeOnScreenAroundRect(_94,_95.x,_95.y,_95.width,_95.height,_96,_97);};dijit._placeOnScreenAroundRect=function(_98,x,y,_99,_9a,_9b,_9c){var _9d=[];for(var _9e in _9b){_9d.push({aroundCorner:_9e,corner:_9b[_9e],pos:{x:x+(_9e.charAt(1)=="L"?0:_99),y:y+(_9e.charAt(0)=="T"?0:_9a)}});}return dijit._place(_98,_9d,_9c,{w:_99,h:_9a});};dijit.placementRegistry=new dojo.AdapterRegistry();dijit.placementRegistry.register("node",function(n,x){return typeof x=="object"&&typeof x.offsetWidth!="undefined"&&typeof x.offsetHeight!="undefined";},dijit.placeOnScreenAroundNode);dijit.placementRegistry.register("rect",function(n,x){return typeof x=="object"&&"x" in x&&"y" in x&&"width" in x&&"height" in x;},dijit.placeOnScreenAroundRectangle);dijit.placeOnScreenAroundElement=function(_9f,_a0,_a1,_a2){return dijit.placementRegistry.match.apply(dijit.placementRegistry,arguments);};dijit.getPopupAroundAlignment=function(_a3,_a4){var _a5={};dojo.forEach(_a3,function(pos){switch(pos){case "after":_a5[_a4?"BR":"BL"]=_a4?"BL":"BR";break;case "before":_a5[_a4?"BL":"BR"]=_a4?"BR":"BL";break;case "below-alt":_a4=!_a4;case "below":_a5[_a4?"BL":"BR"]=_a4?"TL":"TR";_a5[_a4?"BR":"BL"]=_a4?"TR":"TL";break;case "above-alt":_a4=!_a4;case "above":default:_a5[_a4?"TL":"TR"]=_a4?"BL":"BR";_a5[_a4?"TR":"TL"]=_a4?"BR":"BL";break;}});return _a5;};}if(!dojo._hasResource["dijit._base.window"]){dojo._hasResource["dijit._base.window"]=true;dojo.provide("dijit._base.window");dijit.getDocumentWindow=function(doc){return dojo.window.get(doc);};}if(!dojo._hasResource["dijit._base.popup"]){dojo._hasResource["dijit._base.popup"]=true;dojo.provide("dijit._base.popup");dijit.popup={_stack:[],_beginZIndex:1000,_idGen:1,_createWrapper:function(_a6){var _a7=_a6.declaredClass?_a6._popupWrapper:(dojo.hasClass(_a6.parentNode,"dijitPopup")&&_a6.parentNode),_a8=_a6.domNode||_a6;if(!_a7){_a7=dojo.create("div",{"class":"dijitPopup",style:{display:"none"},role:"presentation"},dojo.body());_a7.appendChild(_a8);var s=_a8.style;s.display="";s.visibility="";s.position="";s.top="0px";if(_a6.declaredClass){_a6._popupWrapper=_a7;dojo.connect(_a6,"destroy",function(){dojo.destroy(_a7);delete _a6._popupWrapper;});}}return _a7;},moveOffScreen:function(_a9){var _aa=this._createWrapper(_a9);dojo.style(_aa,{visibility:"hidden",top:"-9999px",display:""});},hide:function(_ab){var _ac=this._createWrapper(_ab);dojo.style(_ac,"display","none");},getTopPopup:function(){var _ad=this._stack;for(var pi=_ad.length-1;pi>0&&_ad[pi].parent===_ad[pi-1].widget;pi--){}return _ad[pi];},open:function(_ae){var _af=this._stack,_b0=_ae.popup,_b1=_ae.orient||((_ae.parent?_ae.parent.isLeftToRight():dojo._isBodyLtr())?{"BL":"TL","BR":"TR","TL":"BL","TR":"BR"}:{"BR":"TR","BL":"TL","TR":"BR","TL":"BL"}),_b2=_ae.around,id=(_ae.around&&_ae.around.id)?(_ae.around.id+"_dropdown"):("popup_"+this._idGen++);while(_af.length&&(!_ae.parent||!dojo.isDescendant(_ae.parent.domNode,_af[_af.length-1].widget.domNode))){dijit.popup.close(_af[_af.length-1].widget);}var _b3=this._createWrapper(_b0);dojo.attr(_b3,{id:id,style:{zIndex:this._beginZIndex+_af.length},"class":"dijitPopup "+(_b0.baseClass||_b0["class"]||"").split(" ")[0]+"Popup",dijitPopupParent:_ae.parent?_ae.parent.id:""});if(dojo.isIE||dojo.isMoz){if(!_b0.bgIframe){_b0.bgIframe=new dijit.BackgroundIframe(_b3);}}var _b4=_b2?dijit.placeOnScreenAroundElement(_b3,_b2,_b1,_b0.orient?dojo.hitch(_b0,"orient"):null):dijit.placeOnScreen(_b3,_ae,_b1=="R"?["TR","BR","TL","BL"]:["TL","BL","TR","BR"],_ae.padding);_b3.style.display="";_b3.style.visibility="visible";_b0.domNode.style.visibility="visible";var _b5=[];_b5.push(dojo.connect(_b3,"onkeypress",this,function(evt){if(evt.charOrCode==dojo.keys.ESCAPE&&_ae.onCancel){dojo.stopEvent(evt);_ae.onCancel();}else{if(evt.charOrCode===dojo.keys.TAB){dojo.stopEvent(evt);var _b6=this.getTopPopup();if(_b6&&_b6.onCancel){_b6.onCancel();}}}}));if(_b0.onCancel){_b5.push(dojo.connect(_b0,"onCancel",_ae.onCancel));}_b5.push(dojo.connect(_b0,_b0.onExecute?"onExecute":"onChange",this,function(){var _b7=this.getTopPopup();if(_b7&&_b7.onExecute){_b7.onExecute();}}));_af.push({widget:_b0,parent:_ae.parent,onExecute:_ae.onExecute,onCancel:_ae.onCancel,onClose:_ae.onClose,handlers:_b5});if(_b0.onOpen){_b0.onOpen(_b4);}return _b4;},close:function(_b8){var _b9=this._stack;while((_b8&&dojo.some(_b9,function(_ba){return _ba.widget==_b8;}))||(!_b8&&_b9.length)){var top=_b9.pop(),_bb=top.widget,_bc=top.onClose;if(_bb.onClose){_bb.onClose();}dojo.forEach(top.handlers,dojo.disconnect);if(_bb&&_bb.domNode){this.hide(_bb);}if(_bc){_bc();}}}};dijit._frames=new function(){var _bd=[];this.pop=function(){var _be;if(_bd.length){_be=_bd.pop();_be.style.display="";}else{if(dojo.isIE<9){var _bf=dojo.config["dojoBlankHtmlUrl"]||(dojo.moduleUrl("dojo","resources/blank.html")+"")||"javascript:\"\"";var _c0="<iframe src='"+_bf+"'"+" style='position: absolute; left: 0px; top: 0px;"+"z-index: -1; filter:Alpha(Opacity=\"0\");'>";_be=dojo.doc.createElement(_c0);}else{_be=dojo.create("iframe");_be.src="javascript:\"\"";_be.className="dijitBackgroundIframe";dojo.style(_be,"opacity",0.1);}_be.tabIndex=-1;dijit.setWaiRole(_be,"presentation");}return _be;};this.push=function(_c1){_c1.style.display="none";_bd.push(_c1);};}();dijit.BackgroundIframe=function(_c2){if(!_c2.id){throw new Error("no id");}if(dojo.isIE||dojo.isMoz){var _c3=(this.iframe=dijit._frames.pop());_c2.appendChild(_c3);if(dojo.isIE<7||dojo.isQuirks){this.resize(_c2);this._conn=dojo.connect(_c2,"onresize",this,function(){this.resize(_c2);});}else{dojo.style(_c3,{width:"100%",height:"100%"});}}};dojo.extend(dijit.BackgroundIframe,{resize:function(_c4){if(this.iframe){dojo.style(this.iframe,{width:_c4.offsetWidth+"px",height:_c4.offsetHeight+"px"});}},destroy:function(){if(this._conn){dojo.disconnect(this._conn);this._conn=null;}if(this.iframe){dijit._frames.push(this.iframe);delete this.iframe;}}});}if(!dojo._hasResource["dijit._base.scroll"]){dojo._hasResource["dijit._base.scroll"]=true;dojo.provide("dijit._base.scroll");dijit.scrollIntoView=function(_c5,pos){dojo.window.scrollIntoView(_c5,pos);};}if(!dojo._hasResource["dojo.uacss"]){dojo._hasResource["dojo.uacss"]=true;dojo.provide("dojo.uacss");(function(){var d=dojo,_c6=d.doc.documentElement,ie=d.isIE,_c7=d.isOpera,maj=Math.floor,ff=d.isFF,_c8=d.boxModel.replace(/-/,""),_c9={dj_ie:ie,dj_ie6:maj(ie)==6,dj_ie7:maj(ie)==7,dj_ie8:maj(ie)==8,dj_ie9:maj(ie)==9,dj_quirks:d.isQuirks,dj_iequirks:ie&&d.isQuirks,dj_opera:_c7,dj_khtml:d.isKhtml,dj_webkit:d.isWebKit,dj_safari:d.isSafari,dj_chrome:d.isChrome,dj_gecko:d.isMozilla,dj_ff3:maj(ff)==3};_c9["dj_"+_c8]=true;var _ca="";for(var clz in _c9){if(_c9[clz]){_ca+=clz+" ";}}_c6.className=d.trim(_c6.className+" "+_ca);dojo._loaders.unshift(function(){if(!dojo._isBodyLtr()){var _cb="dj_rtl dijitRtl "+_ca.replace(/ /g,"-rtl ");_c6.className=d.trim(_c6.className+" "+_cb);}});})();}if(!dojo._hasResource["dijit._base.sniff"]){dojo._hasResource["dijit._base.sniff"]=true;dojo.provide("dijit._base.sniff");}if(!dojo._hasResource["dijit._base.typematic"]){dojo._hasResource["dijit._base.typematic"]=true;dojo.provide("dijit._base.typematic");dijit.typematic={_fireEventAndReload:function(){this._timer=null;this._callback(++this._count,this._node,this._evt);this._currentTimeout=Math.max(this._currentTimeout<0?this._initialDelay:(this._subsequentDelay>1?this._subsequentDelay:Math.round(this._currentTimeout*this._subsequentDelay)),this._minDelay);this._timer=setTimeout(dojo.hitch(this,"_fireEventAndReload"),this._currentTimeout);},trigger:function(evt,_cc,_cd,_ce,obj,_cf,_d0,_d1){if(obj!=this._obj){this.stop();this._initialDelay=_d0||500;this._subsequentDelay=_cf||0.9;this._minDelay=_d1||10;this._obj=obj;this._evt=evt;this._node=_cd;this._currentTimeout=-1;this._count=-1;this._callback=dojo.hitch(_cc,_ce);this._fireEventAndReload();this._evt=dojo.mixin({faux:true},evt);}},stop:function(){if(this._timer){clearTimeout(this._timer);this._timer=null;}if(this._obj){this._callback(-1,this._node,this._evt);this._obj=null;}},addKeyListener:function(_d2,_d3,_d4,_d5,_d6,_d7,_d8){if(_d3.keyCode){_d3.charOrCode=_d3.keyCode;dojo.deprecated("keyCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0");}else{if(_d3.charCode){_d3.charOrCode=String.fromCharCode(_d3.charCode);dojo.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0");}}return [dojo.connect(_d2,"onkeypress",this,function(evt){if(evt.charOrCode==_d3.charOrCode&&(_d3.ctrlKey===undefined||_d3.ctrlKey==evt.ctrlKey)&&(_d3.altKey===undefined||_d3.altKey==evt.altKey)&&(_d3.metaKey===undefined||_d3.metaKey==(evt.metaKey||false))&&(_d3.shiftKey===undefined||_d3.shiftKey==evt.shiftKey)){dojo.stopEvent(evt);dijit.typematic.trigger(evt,_d4,_d2,_d5,_d3,_d6,_d7,_d8);}else{if(dijit.typematic._obj==_d3){dijit.typematic.stop();}}}),dojo.connect(_d2,"onkeyup",this,function(evt){if(dijit.typematic._obj==_d3){dijit.typematic.stop();}})];},addMouseListener:function(_d9,_da,_db,_dc,_dd,_de){var dc=dojo.connect;return [dc(_d9,"mousedown",this,function(evt){dojo.stopEvent(evt);dijit.typematic.trigger(evt,_da,_d9,_db,_d9,_dc,_dd,_de);}),dc(_d9,"mouseup",this,function(evt){dojo.stopEvent(evt);dijit.typematic.stop();}),dc(_d9,"mouseout",this,function(evt){dojo.stopEvent(evt);dijit.typematic.stop();}),dc(_d9,"mousemove",this,function(evt){evt.preventDefault();}),dc(_d9,"dblclick",this,function(evt){dojo.stopEvent(evt);if(dojo.isIE){dijit.typematic.trigger(evt,_da,_d9,_db,_d9,_dc,_dd,_de);setTimeout(dojo.hitch(this,dijit.typematic.stop),50);}})];},addListener:function(_df,_e0,_e1,_e2,_e3,_e4,_e5,_e6){return this.addKeyListener(_e0,_e1,_e2,_e3,_e4,_e5,_e6).concat(this.addMouseListener(_df,_e2,_e3,_e4,_e5,_e6));}};}if(!dojo._hasResource["dijit._base.wai"]){dojo._hasResource["dijit._base.wai"]=true;dojo.provide("dijit._base.wai");dijit.wai={onload:function(){var div=dojo.create("div",{id:"a11yTestNode",style:{cssText:"border: 1px solid;"+"border-color:red green;"+"position: absolute;"+"height: 5px;"+"top: -999px;"+"background-image: url(\""+(dojo.config.blankGif||dojo.moduleUrl("dojo","resources/blank.gif"))+"\");"}},dojo.body());var cs=dojo.getComputedStyle(div);if(cs){var _e7=cs.backgroundImage;var _e8=(cs.borderTopColor==cs.borderRightColor)||(_e7!=null&&(_e7=="none"||_e7=="url(invalid-url:)"));dojo[_e8?"addClass":"removeClass"](dojo.body(),"dijit_a11y");if(dojo.isIE){div.outerHTML="";}else{dojo.body().removeChild(div);}}}};if(dojo.isIE||dojo.isMoz){dojo._loaders.unshift(dijit.wai.onload);}dojo.mixin(dijit,{hasWaiRole:function(_e9,_ea){var _eb=this.getWaiRole(_e9);return _ea?(_eb.indexOf(_ea)>-1):(_eb.length>0);},getWaiRole:function(_ec){return dojo.trim((dojo.attr(_ec,"role")||"").replace("wairole:",""));},setWaiRole:function(_ed,_ee){dojo.attr(_ed,"role",_ee);},removeWaiRole:function(_ef,_f0){var _f1=dojo.attr(_ef,"role");if(!_f1){return;}if(_f0){var t=dojo.trim((" "+_f1+" ").replace(" "+_f0+" "," "));dojo.attr(_ef,"role",t);}else{_ef.removeAttribute("role");}},hasWaiState:function(_f2,_f3){return _f2.hasAttribute?_f2.hasAttribute("aria-"+_f3):!!_f2.getAttribute("aria-"+_f3);},getWaiState:function(_f4,_f5){return _f4.getAttribute("aria-"+_f5)||"";},setWaiState:function(_f6,_f7,_f8){_f6.setAttribute("aria-"+_f7,_f8);},removeWaiState:function(_f9,_fa){_f9.removeAttribute("aria-"+_fa);}});}if(!dojo._hasResource["dijit._base"]){dojo._hasResource["dijit._base"]=true;dojo.provide("dijit._base");}if(!dojo._hasResource["dojo.Stateful"]){dojo._hasResource["dojo.Stateful"]=true;dojo.provide("dojo.Stateful");dojo.declare("dojo.Stateful",null,{postscript:function(_fb){if(_fb){dojo.mixin(this,_fb);}},get:function(_fc){return this[_fc];},set:function(_fd,_fe){if(typeof _fd==="object"){for(var x in _fd){this.set(x,_fd[x]);}return this;}var _ff=this[_fd];this[_fd]=_fe;if(this._watchCallbacks){this._watchCallbacks(_fd,_ff,_fe);}return this;},watch:function(name,_100){var _101=this._watchCallbacks;if(!_101){var self=this;_101=this._watchCallbacks=function(name,_102,_103,_104){var _105=function(_106){if(_106){_106=_106.slice();for(var i=0,l=_106.length;i<l;i++){try{_106[i].call(self,name,_102,_103);}catch(e){console.error(e);}}}};_105(_101["_"+name]);if(!_104){_105(_101["*"]);}};}if(!_100&&typeof name==="function"){_100=name;name="*";}else{name="_"+name;}var _107=_101[name];if(typeof _107!=="object"){_107=_101[name]=[];}_107.push(_100);return {unwatch:function(){_107.splice(dojo.indexOf(_107,_100),1);}};}});}if(!dojo._hasResource["dijit._WidgetBase"]){dojo._hasResource["dijit._WidgetBase"]=true;dojo.provide("dijit._WidgetBase");(function(){dojo.declare("dijit._WidgetBase",dojo.Stateful,{id:"",lang:"",dir:"","class":"",style:"",title:"",tooltip:"",baseClass:"",srcNodeRef:null,domNode:null,containerNode:null,attributeMap:{id:"",dir:"",lang:"","class":"",style:"",title:""},_blankGif:(dojo.config.blankGif||dojo.moduleUrl("dojo","resources/blank.gif")).toString(),postscript:function(_108,_109){this.create(_108,_109);},create:function(_10a,_10b){this.srcNodeRef=dojo.byId(_10b);this._connects=[];this._subscribes=[];if(this.srcNodeRef&&(typeof this.srcNodeRef.id=="string")){this.id=this.srcNodeRef.id;}if(_10a){this.params=_10a;dojo._mixin(this,_10a);}this.postMixInProperties();if(!this.id){this.id=dijit.getUniqueId(this.declaredClass.replace(/\./g,"_"));}dijit.registry.add(this);this.buildRendering();if(this.domNode){this._applyAttributes();var _10c=this.srcNodeRef;if(_10c&&_10c.parentNode&&this.domNode!==_10c){_10c.parentNode.replaceChild(this.domNode,_10c);}}if(this.domNode){this.domNode.setAttribute("widgetId",this.id);}this.postCreate();if(this.srcNodeRef&&!this.srcNodeRef.parentNode){delete this.srcNodeRef;}this._created=true;},_applyAttributes:function(){var _10d=function(attr,_10e){if((_10e.params&&attr in _10e.params)||_10e[attr]){_10e.set(attr,_10e[attr]);}};for(var attr in this.attributeMap){_10d(attr,this);}dojo.forEach(this._getSetterAttributes(),function(a){if(!(a in this.attributeMap)){_10d(a,this);}},this);},_getSetterAttributes:function(){var ctor=this.constructor;if(!ctor._setterAttrs){var r=(ctor._setterAttrs=[]),_10f,_110=ctor.prototype;for(var _111 in _110){if(dojo.isFunction(_110[_111])&&(_10f=_111.match(/^_set([a-zA-Z]*)Attr$/))&&_10f[1]){r.push(_10f[1].charAt(0).toLowerCase()+_10f[1].substr(1));}}}return ctor._setterAttrs;},postMixInProperties:function(){},buildRendering:function(){if(!this.domNode){this.domNode=this.srcNodeRef||dojo.create("div");}if(this.baseClass){var _112=this.baseClass.split(" ");if(!this.isLeftToRight()){_112=_112.concat(dojo.map(_112,function(name){return name+"Rtl";}));}dojo.addClass(this.domNode,_112);}},postCreate:function(){},startup:function(){this._started=true;},destroyRecursive:function(_113){this._beingDestroyed=true;this.destroyDescendants(_113);this.destroy(_113);},destroy:function(_114){this._beingDestroyed=true;this.uninitialize();var d=dojo,dfe=d.forEach,dun=d.unsubscribe;dfe(this._connects,function(_115){dfe(_115,d.disconnect);});dfe(this._subscribes,function(_116){dun(_116);});dfe(this._supportingWidgets||[],function(w){if(w.destroyRecursive){w.destroyRecursive();}else{if(w.destroy){w.destroy();}}});this.destroyRendering(_114);dijit.registry.remove(this.id);this._destroyed=true;},destroyRendering:function(_117){if(this.bgIframe){this.bgIframe.destroy(_117);delete this.bgIframe;}if(this.domNode){if(_117){dojo.removeAttr(this.domNode,"widgetId");}else{dojo.destroy(this.domNode);}delete this.domNode;}if(this.srcNodeRef){if(!_117){dojo.destroy(this.srcNodeRef);}delete this.srcNodeRef;}},destroyDescendants:function(_118){dojo.forEach(this.getChildren(),function(_119){if(_119.destroyRecursive){_119.destroyRecursive(_118);}});},uninitialize:function(){return false;},_setClassAttr:function(_11a){var _11b=this[this.attributeMap["class"]||"domNode"];dojo.replaceClass(_11b,_11a,this["class"]);this._set("class",_11a);},_setStyleAttr:function(_11c){var _11d=this[this.attributeMap.style||"domNode"];if(dojo.isObject(_11c)){dojo.style(_11d,_11c);}else{if(_11d.style.cssText){_11d.style.cssText+="; "+_11c;}else{_11d.style.cssText=_11c;}}this._set("style",_11c);},_attrToDom:function(attr,_11e){var _11f=this.attributeMap[attr];dojo.forEach(dojo.isArray(_11f)?_11f:[_11f],function(_120){var _121=this[_120.node||_120||"domNode"];var type=_120.type||"attribute";switch(type){case "attribute":if(dojo.isFunction(_11e)){_11e=dojo.hitch(this,_11e);}var _122=_120.attribute?_120.attribute:(/^on[A-Z][a-zA-Z]*$/.test(attr)?attr.toLowerCase():attr);dojo.attr(_121,_122,_11e);break;case "innerText":_121.innerHTML="";_121.appendChild(dojo.doc.createTextNode(_11e));break;case "innerHTML":_121.innerHTML=_11e;break;case "class":dojo.replaceClass(_121,_11e,this[attr]);break;}},this);},get:function(name){var _123=this._getAttrNames(name);return this[_123.g]?this[_123.g]():this[name];},set:function(name,_124){if(typeof name==="object"){for(var x in name){this.set(x,name[x]);}return this;}var _125=this._getAttrNames(name);if(this[_125.s]){var _126=this[_125.s].apply(this,Array.prototype.slice.call(arguments,1));}else{if(name in this.attributeMap){this._attrToDom(name,_124);}this._set(name,_124);}return _126||this;},_attrPairNames:{},_getAttrNames:function(name){var apn=this._attrPairNames;if(apn[name]){return apn[name];}var uc=name.charAt(0).toUpperCase()+name.substr(1);return (apn[name]={n:name+"Node",s:"_set"+uc+"Attr",g:"_get"+uc+"Attr"});},_set:function(name,_127){var _128=this[name];this[name]=_127;if(this._watchCallbacks&&this._created&&_127!==_128){this._watchCallbacks(name,_128,_127);}},toString:function(){return "[Widget "+this.declaredClass+", "+(this.id||"NO ID")+"]";},getDescendants:function(){return this.containerNode?dojo.query("[widgetId]",this.containerNode).map(dijit.byNode):[];},getChildren:function(){return this.containerNode?dijit.findWidgets(this.containerNode):[];},connect:function(obj,_129,_12a){var _12b=[dojo._connect(obj,_129,this,_12a)];this._connects.push(_12b);return _12b;},disconnect:function(_12c){for(var i=0;i<this._connects.length;i++){if(this._connects[i]==_12c){dojo.forEach(_12c,dojo.disconnect);this._connects.splice(i,1);return;}}},subscribe:function(_12d,_12e){var _12f=dojo.subscribe(_12d,this,_12e);this._subscribes.push(_12f);return _12f;},unsubscribe:function(_130){for(var i=0;i<this._subscribes.length;i++){if(this._subscribes[i]==_130){dojo.unsubscribe(_130);this._subscribes.splice(i,1);return;}}},isLeftToRight:function(){return this.dir?(this.dir=="ltr"):dojo._isBodyLtr();},placeAt:function(_131,_132){if(_131.declaredClass&&_131.addChild){_131.addChild(this,_132);}else{dojo.place(this.domNode,_131,_132);}return this;}});})();}if(!dojo._hasResource["dojox.mobile._base"]){dojo._hasResource["dojox.mobile._base"]=true;dojo.provide("dojox.mobile._base");dojo.isBB=(navigator.userAgent.indexOf("BlackBerry")!=-1)&&!dojo.isWebKit;dojo.declare("dojox.mobile.View",dijit._WidgetBase,{selected:false,keepScrollPos:true,_started:false,constructor:function(_133,node){if(node){dojo.byId(node).style.visibility="hidden";}},buildRendering:function(){this.domNode=this.containerNode=this.srcNodeRef||dojo.doc.createElement("DIV");this.domNode.className="mblView";this.connect(this.domNode,"webkitAnimationEnd","onAnimationEnd");this.connect(this.domNode,"webkitAnimationStart","onAnimationStart");var id=location.href.match(/#(\w+)([^\w=]|$)/)?RegExp.$1:null;this._visible=this.selected&&!id||this.id==id;if(this.selected){dojox.mobile._defaultView=this;}},startup:function(){if(this._started){return;}var _134=this;setTimeout(function(){if(!_134._visible){_134.domNode.style.display="none";}else{dojox.mobile.currentView=_134;_134.onStartView();}_134.domNode.style.visibility="visible";},dojo.isIE?100:0);this._started=true;},onStartView:function(){},onBeforeTransitionIn:function(_135,dir,_136,_137,_138){},onAfterTransitionIn:function(_139,dir,_13a,_13b,_13c){},onBeforeTransitionOut:function(_13d,dir,_13e,_13f,_140){},onAfterTransitionOut:function(_141,dir,_142,_143,_144){},_saveState:function(_145,dir,_146,_147,_148){this._context=_147;this._method=_148;if(_146=="none"||!dojo.isWebKit){_146=null;}this._moveTo=_145;this._dir=dir;this._transition=_146;this._arguments=[];var i;for(i=0;i<arguments.length;i++){this._arguments.push(arguments[i]);}this._args=[];if(_147||_148){for(i=5;i<arguments.length;i++){this._args.push(arguments[i]);}}},performTransition:function(_149,dir,_14a,_14b,_14c){if(dojo.hash){if(typeof (_149)=="string"&&_149.charAt(0)=="#"&&!dojox.mobile._params){dojox.mobile._params=[];for(var i=0;i<arguments.length;i++){dojox.mobile._params.push(arguments[i]);}dojo.hash(_149);return;}}this._saveState.apply(this,arguments);var _14d;if(_149){if(typeof (_149)=="string"){_149.match(/^#?([^&]+)/);_14d=RegExp.$1;}else{_14d=_149;}}else{if(!this._dummyNode){this._dummyNode=dojo.doc.createElement("DIV");dojo.body().appendChild(this._dummyNode);}_14d=this._dummyNode;}var _14e=this.domNode;_14d=this.toNode=dojo.byId(_14d);if(!_14d){alert("dojox.mobile.View#performTransition: destination view not found: "+_14d);}_14d.style.visibility="hidden";_14d.style.display="";this.onBeforeTransitionOut.apply(this,arguments);var _14f=dijit.byNode(_14d);if(_14f){if(this.keepScrollPos&&!dijit.getEnclosingWidget(this.domNode.parentNode)){var _150=dojo.body().scrollTop||dojo.doc.documentElement.scrollTop||dojo.global.pageYOffset||0;if(dir==1){_14d.style.top="0px";if(_150>1){_14e.style.top=-_150+"px";if(dojo.config["mblHideAddressBar"]!==false){setTimeout(function(){dojo.global.scrollTo(0,1);},0);}}}else{if(_150>1||_14d.offsetTop!==0){var _151=-_14d.offsetTop;_14d.style.top="0px";_14e.style.top=_151-_150+"px";if(dojo.config["mblHideAddressBar"]!==false&&_151>0){setTimeout(function(){dojo.global.scrollTo(0,_151+1);},0);}}}}else{_14d.style.top="0px";}_14f.onBeforeTransitionIn.apply(_14f,arguments);}_14d.style.display="none";_14d.style.visibility="visible";this._doTransition(_14e,_14d,_14a,dir);},_doTransition:function(_152,_153,_154,dir){var rev=(dir==-1)?" reverse":"";_153.style.display="";if(!_154||_154=="none"){this.domNode.style.display="none";this.invokeCallback();}else{dojo.addClass(_152,_154+" out"+rev);dojo.addClass(_153,_154+" in"+rev);}},onAnimationStart:function(e){},onAnimationEnd:function(e){var _155=false;if(dojo.hasClass(this.domNode,"out")){_155=true;this.domNode.style.display="none";dojo.forEach([this._transition,"in","out","reverse"],function(s){dojo.removeClass(this.domNode,s);},this);}if(e.animationName.indexOf("shrink")===0){var li=e.target;li.style.display="none";dojo.removeClass(li,"mblCloseContent");}if(_155){this.invokeCallback();}this.domNode&&(this.domNode.className="mblView");},invokeCallback:function(){this.onAfterTransitionOut.apply(this,this._arguments);var _156=dijit.byNode(this.toNode);if(_156){_156.onAfterTransitionIn.apply(_156,this._arguments);}dojox.mobile.currentView=_156;var c=this._context,m=this._method;if(!c&&!m){return;}if(!m){m=c;c=null;}c=c||dojo.global;if(typeof (m)=="string"){c[m].apply(c,this._args);}else{m.apply(c,this._args);}},getShowingView:function(){var _157=this.domNode.parentNode.childNodes;for(var i=0;i<_157.length;i++){if(dojo.hasClass(_157[i],"mblView")&&dojo.style(_157[i],"display")!="none"){return dijit.byNode(_157[i]);}}},show:function(){var fs=this.getShowingView().domNode.style;var ts=this.domNode.style;fs.display="none";ts.display="";dojox.mobile.currentView=this;},addChild:function(_158){this.containerNode.appendChild(_158.domNode);}});dojo.declare("dojox.mobile.Heading",dijit._WidgetBase,{back:"",href:"",moveTo:"",transition:"slide",label:"",iconBase:"",buildRendering:function(){this.domNode=this.containerNode=this.srcNodeRef||dojo.doc.createElement("H1");this.domNode.className="mblHeading";this._view=dijit.getEnclosingWidget(this.domNode.parentNode);if(this.label){this.domNode.appendChild(document.createTextNode(this.label));}else{this.label="";dojo.forEach(this.domNode.childNodes,function(n){if(n.nodeType==3){this.label+=n.nodeValue;}},this);this.label=dojo.trim(this.label);}if(this.back){var btn=dojo.create("DIV",{className:"mblArrowButton"},this.domNode,"first");var head=dojo.create("DIV",{className:"mblArrowButtonHead"},btn);var body=dojo.create("DIV",{className:"mblArrowButtonBody mblArrowButtonText"},btn);this._body=body;this._head=head;this._btn=btn;body.innerHTML=this.back;this.connect(body,"onclick","onClick");var neck=dojo.create("DIV",{className:"mblArrowButtonNeck"},btn);btn.style.width=body.offsetWidth+head.offsetWidth+"px";this.setLabel(this.label);}},startup:function(){if(this._btn){this._btn.style.width=this._body.offsetWidth+this._head.offsetWidth+"px";}},onClick:function(e){var h1=this.domNode;dojo.addClass(h1,"mblArrowButtonSelected");setTimeout(function(){dojo.removeClass(h1,"mblArrowButtonSelected");},1000);this.goTo(this.moveTo,this.href);},setLabel:function(_159){if(_159!=this.label){this.label=_159;this.domNode.firstChild.nodeValue=_159;}},goTo:function(_15a,href){if(!this._view){this._view=dijit.byNode(this.domNode.parentNode);}if(!this._view){return;}if(href){this._view.performTransition(null,-1,this.transition,this,function(){location.href=href;});}else{if(dojox.mobile.app&&dojox.mobile.app.STAGE_CONTROLLER_ACTIVE){dojo.publish("/dojox/mobile/app/goback");}else{this._view.performTransition(_15a,-1,this.transition);}}}});dojo.declare("dojox.mobile.RoundRect",dijit._WidgetBase,{shadow:false,buildRendering:function(){this.domNode=this.containerNode=this.srcNodeRef||dojo.doc.createElement("DIV");this.domNode.className=this.shadow?"mblRoundRect mblShadow":"mblRoundRect";}});dojo.declare("dojox.mobile.RoundRectCategory",dijit._WidgetBase,{label:"",buildRendering:function(){this.domNode=this.containerNode=this.srcNodeRef||dojo.doc.createElement("H2");this.domNode.className="mblRoundRectCategory";if(this.label){this.domNode.innerHTML=this.label;}else{this.label=this.domNode.innerHTML;}}});dojo.declare("dojox.mobile.EdgeToEdgeCategory",dojox.mobile.RoundRectCategory,{buildRendering:function(){this.inherited(arguments);this.domNode.className="mblEdgeToEdgeCategory";}});dojo.declare("dojox.mobile.RoundRectList",dijit._WidgetBase,{transition:"slide",iconBase:"",iconPos:"",buildRendering:function(){this.domNode=this.containerNode=this.srcNodeRef||dojo.doc.createElement("UL");this.domNode.className="mblRoundRectList";},addChild:function(_15b){this.containerNode.appendChild(_15b.domNode);_15b.inheritParams();_15b.setIcon();}});dojo.declare("dojox.mobile.EdgeToEdgeList",dojox.mobile.RoundRectList,{stateful:false,buildRendering:function(){this.inherited(arguments);this.domNode.className="mblEdgeToEdgeList";}});dojo.declare("dojox.mobile.AbstractItem",dijit._WidgetBase,{icon:"",iconPos:"",href:"",hrefTarget:"",moveTo:"",scene:"",clickable:false,url:"",transition:"",transitionDir:1,callback:null,sync:true,label:"",toggle:false,_duration:800,inheritParams:function(){var _15c=this.getParentWidget();if(_15c){if(!this.transition){this.transition=_15c.transition;}if(!this.icon){this.icon=_15c.iconBase;}if(!this.iconPos){this.iconPos=_15c.iconPos;}}},findCurrentView:function(_15d){var w;if(_15d){w=dijit.byId(_15d);if(w){return w.getShowingView();}}var n=this.domNode.parentNode;while(true){w=dijit.getEnclosingWidget(n);if(!w){return null;}if(w.performTransition){break;}n=w.domNode.parentNode;}return w;},transitionTo:function(_15e,href,url,_15f){var w=this.findCurrentView(_15e);if(!w||_15e&&w===dijit.byId(_15e)){return;}if(href){if(this.hrefTarget){dojox.mobile.openWindow(this.href,this.hrefTarget);}else{w.performTransition(null,this.transitionDir,this.transition,this,function(){location.href=href;});}return;}else{if(_15f){dojo.publish("/dojox/mobile/app/pushScene",[_15f]);return;}}if(url){var id;if(dojox.mobile._viewMap&&dojox.mobile._viewMap[url]){id=dojox.mobile._viewMap[url];}else{var text=this._text;if(!text){if(this.sync){text=dojo.trim(dojo._getText(url));}else{dojo["require"]("dojo._base.xhr");var prog=dojox.mobile.ProgressIndicator.getInstance();dojo.body().appendChild(prog.domNode);prog.start();var xhr=dojo.xhrGet({url:url,handleAs:"text"});xhr.addCallback(dojo.hitch(this,function(_160,_161){prog.stop();if(_160){this._text=_160;this.transitionTo(_15e,href,url,_15f);}}));xhr.addErrback(function(_162){prog.stop();alert("Failed to load "+url+"\n"+(_162.description||_162));});return;}}this._text=null;id=this._parse(text);if(!dojox.mobile._viewMap){dojox.mobile._viewMap=[];}dojox.mobile._viewMap[url]=id;}_15e=id;}w.performTransition(_15e,this.transitionDir,this.transition,this.callback&&this,this.callback);},_parse:function(text){var _163=dojo.create("DIV");var view;if(text.charAt(0)=="<"){_163.innerHTML=text;view=_163.firstChild;if(!view&&view.nodeType!=1){alert("dojox.mobile.AbstractItem#transitionTo: invalid view content");return;}view.setAttribute("_started","true");view.style.visibility="hidden";dojo.body().appendChild(_163);(dojox.mobile.parser||dojo.parser).parse(_163);}else{if(text.charAt(0)=="{"){dojo.body().appendChild(_163);this._ws=[];view=this._instantiate(eval("("+text+")"),_163);for(var i=0;i<this._ws.length;i++){var w=this._ws[i];w.startup&&!w._started&&(!w.getParent||!w.getParent())&&w.startup();}this._ws=null;}}view.style.display="none";view.style.visibility="visible";var id=view.id;return dojo.hash?"#"+id:id;},_instantiate:function(obj,node,_164){var _165;for(var key in obj){if(key.charAt(0)=="@"){continue;}var cls=dojo.getObject(key);if(!cls){continue;}var _166={};var _167=cls.prototype;var objs=dojo.isArray(obj[key])?obj[key]:[obj[key]];for(var i=0;i<objs.length;i++){for(var prop in objs[i]){if(prop.charAt(0)=="@"){var val=objs[i][prop];prop=prop.substring(1);if(typeof _167[prop]=="string"){_166[prop]=val;}else{if(typeof _167[prop]=="number"){_166[prop]=val-0;}else{if(typeof _167[prop]=="boolean"){_166[prop]=(val!="false");}else{if(typeof _167[prop]=="object"){_166[prop]=eval("("+val+")");}}}}}}_165=new cls(_166,node);if(!node){this._ws.push(_165);}if(_164&&_164.addChild){_164.addChild(_165);}this._instantiate(objs[i],null,_165);}}return _165&&_165.domNode;},createDomButton:function(_168,_169){var s=_168.className;if(s.match(/mblDomButton\w+_(\d+)/)){var nDiv=RegExp.$1-0;for(var i=0,p=(_169||_168);i<nDiv;i++){p=dojo.create("DIV",null,p);}}},select:function(_16a){},defaultClickAction:function(){if(this.toggle){this.select(this.selected);}else{if(!this.selected){this.select();if(!this.selectOne){var _16b=this;setTimeout(function(){_16b.select(true);},this._duration);}if(this.moveTo||this.href||this.url||this.scene){this.transitionTo(this.moveTo,this.href,this.url,this.scene);}}}},getParentWidget:function(){var ref=this.srcNodeRef||this.domNode;return ref&&ref.parentNode?dijit.getEnclosingWidget(ref.parentNode):null;}});dojo.declare("dojox.mobile.ListItem",dojox.mobile.AbstractItem,{rightText:"",btnClass:"",anchorLabel:false,noArrow:false,selected:false,buildRendering:function(){this.inheritParams();var a=this.anchorNode=dojo.create("A");a.className="mblListItemAnchor";var box=dojo.create("DIV");box.className="mblListItemTextBox";if(this.anchorLabel){box.style.cursor="pointer";}var r=this.srcNodeRef;if(r){for(var i=0,len=r.childNodes.length;i<len;i++){box.appendChild(r.removeChild(r.firstChild));}}if(this.label){box.appendChild(dojo.doc.createTextNode(this.label));}a.appendChild(box);if(this.rightText){this._setRightTextAttr(this.rightText);}if(this.moveTo||this.href||this.url||this.clickable){var _16c=this.getParentWidget();if(!this.noArrow&&!(_16c&&_16c.stateful)){var _16d=dojo.create("DIV");_16d.className="mblArrow";a.appendChild(_16d);}this.connect(a,"onclick","onClick");}else{if(this.btnClass){var div=this.btnNode=dojo.create("DIV");div.className=this.btnClass+" mblRightButton";div.appendChild(dojo.create("DIV"));div.appendChild(dojo.create("P"));var _16e=dojo.create("DIV");_16e.className="mblRightButtonContainer";_16e.appendChild(div);a.appendChild(_16e);dojo.addClass(a,"mblListItemAnchorHasRightButton");setTimeout(function(){_16e.style.width=div.offsetWidth+"px";_16e.style.height=div.offsetHeight+"px";if(dojo.isIE){a.parentNode.style.height=a.parentNode.offsetHeight+"px";}},0);}}if(this.anchorLabel){box.style.display="inline";}var li=this.domNode=this.containerNode=this.srcNodeRef||dojo.doc.createElement("LI");li.className="mblListItem"+(this.selected?" mblItemSelected":"");li.appendChild(a);this.setIcon();},setIcon:function(){if(this.iconNode){return;}var a=this.anchorNode;if(this.icon&&this.icon!="none"){var img=this.iconNode=dojo.create("IMG");img.className="mblListItemIcon";img.src=this.icon;this.domNode.insertBefore(img,a);dojox.mobile.setupIcon(this.iconNode,this.iconPos);dojo.removeClass(a,"mblListItemAnchorNoIcon");}else{dojo.addClass(a,"mblListItemAnchorNoIcon");}},onClick:function(e){var a=e.currentTarget;var li=a.parentNode;if(dojo.hasClass(li,"mblItemSelected")){return;}if(this.anchorLabel){for(var p=e.target;p.tagName!="LI";p=p.parentNode){if(p.className=="mblListItemTextBox"){dojo.addClass(p,"mblListItemTextBoxSelected");setTimeout(function(){dojo.removeClass(p,"mblListItemTextBoxSelected");},1000);this.onAnchorLabelClicked(e);return;}}}if(this.getParentWidget().stateful){for(var i=0,c=li.parentNode.childNodes;i<c.length;i++){dojo.removeClass(c[i],"mblItemSelected");}}else{setTimeout(function(){dojo.removeClass(li,"mblItemSelected");},1000);}dojo.addClass(li,"mblItemSelected");this.transitionTo(this.moveTo,this.href,this.url,this.scene);},onAnchorLabelClicked:function(e){},_setRightTextAttr:function(text){this.rightText=text;if(!this._rightTextNode){this._rightTextNode=dojo.create("DIV",{className:"mblRightText"},this.anchorNode);}this._rightTextNode.innerHTML=text;}});dojo.declare("dojox.mobile.Switch",dijit._WidgetBase,{value:"on",leftLabel:"ON",rightLabel:"OFF",_width:53,buildRendering:function(){this.domNode=this.srcNodeRef||dojo.doc.createElement("DIV");this.domNode.className="mblSwitch";this.domNode.innerHTML="<div class=\"mblSwitchInner\">"+"<div class=\"mblSwitchBg mblSwitchBgLeft\">"+"<div class=\"mblSwitchText mblSwitchTextLeft\">"+this.leftLabel+"</div>"+"</div>"+"<div class=\"mblSwitchBg mblSwitchBgRight\">"+"<div class=\"mblSwitchText mblSwitchTextRight\">"+this.rightLabel+"</div>"+"</div>"+"<div class=\"mblSwitchKnob\"></div>"+"</div>";var n=this.inner=this.domNode.firstChild;this.left=n.childNodes[0];this.right=n.childNodes[1];this.knob=n.childNodes[2];dojo.addClass(this.domNode,(this.value=="on")?"mblSwitchOn":"mblSwitchOff");this[this.value=="off"?"left":"right"].style.display="none";},postCreate:function(){this.connect(this.knob,"onclick","onClick");this.connect(this.knob,"touchstart","onTouchStart");this.connect(this.knob,"mousedown","onTouchStart");},_changeState:function(_16f){this.inner.style.left="";dojo.addClass(this.domNode,"mblSwitchAnimation");dojo.removeClass(this.domNode,(_16f=="on")?"mblSwitchOff":"mblSwitchOn");dojo.addClass(this.domNode,(_16f=="on")?"mblSwitchOn":"mblSwitchOff");var _170=this;setTimeout(function(){_170[_16f=="off"?"left":"right"].style.display="none";dojo.removeClass(_170.domNode,"mblSwitchAnimation");},300);},onClick:function(e){if(this._moved){return;}this.value=(this.value=="on")?"off":"on";this._changeState(this.value);this.onStateChanged(this.value);},onTouchStart:function(e){this._moved=false;this.innerStartX=this.inner.offsetLeft;if(e.targetTouches){this.touchStartX=e.targetTouches[0].clientX;this._conn1=dojo.connect(this.inner,"touchmove",this,"onTouchMove");this._conn2=dojo.connect(this.inner,"touchend",this,"onTouchEnd");}this.left.style.display="block";this.right.style.display="block";dojo.stopEvent(e);},onTouchMove:function(e){e.preventDefault();var dx;if(e.targetTouches){if(e.targetTouches.length!=1){return false;}dx=e.targetTouches[0].clientX-this.touchStartX;}else{dx=e.clientX-this.touchStartX;}var pos=this.innerStartX+dx;var d=10;if(pos<=-(this._width-d)){pos=-this._width;}if(pos>=-d){pos=0;}this.inner.style.left=pos+"px";this._moved=true;},onTouchEnd:function(e){dojo.disconnect(this._conn1);dojo.disconnect(this._conn2);if(this.innerStartX==this.inner.offsetLeft){if(dojo.isWebKit){var ev=dojo.doc.createEvent("MouseEvents");ev.initEvent("click",true,true);this.knob.dispatchEvent(ev);}return;}var _171=(this.inner.offsetLeft<-(this._width/2))?"off":"on";this._changeState(_171);if(_171!=this.value){this.value=_171;this.onStateChanged(this.value);}},onStateChanged:function(_172){}});dojo.declare("dojox.mobile.Button",dijit._WidgetBase,{btnClass:"mblBlueButton",duration:1000,label:null,buildRendering:function(){this.domNode=this.containerNode=this.srcNodeRef||dojo.doc.createElement("BUTTON");this.domNode.className="mblButton "+this.btnClass;if(this.label){this.domNode.innerHTML=this.label;}this.connect(this.domNode,"onclick","onClick");},onClick:function(e){var _173=this.domNode;var c="mblButtonSelected "+this.btnClass+"Selected";dojo.addClass(_173,c);setTimeout(function(){dojo.removeClass(_173,c);},this.duration);}});dojo.declare("dojox.mobile.ToolBarButton",dojox.mobile.AbstractItem,{selected:false,_defaultColor:"mblColorDefault",_selColor:"mblColorDefaultSel",buildRendering:function(){this.inheritParams();this.domNode=this.containerNode=this.srcNodeRef||dojo.doc.createElement("div");dojo.addClass(this.domNode,"mblToolbarButton mblArrowButtonText");var _174;if(this.selected){_174=this._selColor;}else{if(this.domNode.className.indexOf("mblColor")==-1){_174=this._defaultColor;}}dojo.addClass(this.domNode,_174);if(this.label){this.domNode.innerHTML=this.label;}else{this.label=this.domNode.innerHTML;}if(this.icon&&this.icon!="none"){var img;if(this.iconPos){var _175=dojo.create("DIV",null,this.domNode);img=dojo.create("IMG",null,_175);img.style.position="absolute";var arr=this.iconPos.split(/[ ,]/);dojo.style(_175,{position:"relative",width:arr[2]+"px",height:arr[3]+"px"});}else{img=dojo.create("IMG",null,this.domNode);}img.src=this.icon;dojox.mobile.setupIcon(img,this.iconPos);this.iconNode=img;}this.createDomButton(this.domNode);this.connect(this.domNode,"onclick","onClick");},select:function(_176){dojo.toggleClass(this.domNode,this._selColor,!_176);this.selected=!_176;},onClick:function(e){this.defaultClickAction();}});dojo.declare("dojox.mobile.ProgressIndicator",null,{interval:100,colors:["#C0C0C0","#C0C0C0","#C0C0C0","#C0C0C0","#C0C0C0","#C0C0C0","#B8B9B8","#AEAFAE","#A4A5A4","#9A9A9A","#8E8E8E","#838383"],_bars:[],constructor:function(){this.domNode=dojo.create("DIV");this.domNode.className="mblProgContainer";for(var i=0;i<12;i++){var div=dojo.create("DIV");div.className="mblProg mblProg"+i;this.domNode.appendChild(div);this._bars.push(div);}},start:function(){var cntr=0;var _177=this;this.timer=setInterval(function(){cntr--;cntr=cntr<0?11:cntr;var c=_177.colors;for(var i=0;i<12;i++){var idx=(cntr+i)%12;_177._bars[i].style.backgroundColor=c[idx];}},this.interval);},stop:function(){if(this.timer){clearInterval(this.timer);}this.timer=null;if(this.domNode.parentNode){this.domNode.parentNode.removeChild(this.domNode);}}});dojox.mobile.ProgressIndicator._instance=null;dojox.mobile.ProgressIndicator.getInstance=function(){if(!dojox.mobile.ProgressIndicator._instance){dojox.mobile.ProgressIndicator._instance=new dojox.mobile.ProgressIndicator();}return dojox.mobile.ProgressIndicator._instance;};dojox.mobile.addClass=function(){var _178=document.getElementsByTagName("link");for(var i=0,len=_178.length;i<len;i++){if(_178[i].href.match(/dojox\/mobile\/themes\/(\w+)\//)){dojox.mobile.theme=RegExp.$1;dojo.addClass(dojo.body(),dojox.mobile.theme);break;}}};dojox.mobile.setupIcon=function(_179,_17a){if(_179&&_17a){var arr=dojo.map(_17a.split(/[ ,]/),function(item){return item-0;});var t=arr[0];var r=arr[1]+arr[2];var b=arr[0]+arr[3];var l=arr[1];_179.style.clip="rect("+t+"px "+r+"px "+b+"px "+l+"px)";_179.style.top=dojo.style(_179,"top")-t+"px";_179.style.left=dojo.style(_179.parentNode,"paddingLeft")-l+"px";}};dojox.mobile.hideAddressBar=function(){dojo.body().style.minHeight="1000px";setTimeout(function(){scrollTo(0,1);},100);setTimeout(function(){scrollTo(0,1);},400);setTimeout(function(){scrollTo(0,1);dojo.body().style.minHeight=(dojo.global.innerHeight||dojo.doc.documentElement.clientHeight)+"px";},1000);};dojox.mobile.openWindow=function(url,_17b){dojo.global.open(url,_17b||"_blank");};dojo._loaders.unshift(function(){var _17c=dojo.body().getElementsByTagName("*");var i,len,s;len=_17c.length;for(i=0;i<len;i++){s=_17c[i].getAttribute("dojoType");if(s){if(_17c[i].parentNode.getAttribute("lazy")=="true"){_17c[i].setAttribute("__dojoType",s);_17c[i].removeAttribute("dojoType");}}}});dojo.addOnLoad(function(){dojox.mobile.addClass();if(dojo.config["mblApplyPageStyles"]!==false){dojo.addClass(dojo.doc.documentElement,"mobile");}if(dojo.config["mblHideAddressBar"]!==false){dojox.mobile.hideAddressBar();if(dojo.config["mblAlwaysHideAddressBar"]==true){if(dojo.global.onorientationchange!==undefined){dojo.connect(dojo.global,"onorientationchange",dojox.mobile.hideAddressBar);}else{dojo.connect(dojo.global,"onresize",dojox.mobile.hideAddressBar);}}}var _17d=dojo.body().getElementsByTagName("*");var i,len=_17d.length,s;for(i=0;i<len;i++){s=_17d[i].getAttribute("__dojoType");if(s){_17d[i].setAttribute("dojoType",s);_17d[i].removeAttribute("__dojoType");}}if(dojo.hash){var _17e=function(root){var arr;arr=dijit.findWidgets(root);var _17f=arr;for(var i=0;i<_17f.length;i++){arr=arr.concat(_17e(_17f[i].containerNode));}return arr;};dojo.subscribe("/dojo/hashchange",null,function(_180){var view=dojox.mobile.currentView;if(!view){return;}var _181=dojox.mobile._params;if(!_181){var _182=_180?_180:dojox.mobile._defaultView.id;var _183=_17e(view.domNode);var dir=1,_184="slide";for(i=0;i<_183.length;i++){var w=_183[i];if("#"+_182==w.moveTo){_184=w.transition;dir=(w instanceof dojox.mobile.Heading)?-1:1;break;}}_181=[_182,dir,_184];}view.performTransition.apply(view,_181);dojox.mobile._params=null;});}dojo.body().style.visibility="visible";});dijit.getEnclosingWidget=function(node){while(node&&node.tagName!=="BODY"){if(node.getAttribute&&node.getAttribute("widgetId")){return dijit.registry.byId(node.getAttribute("widgetId"));}node=node._parentNode||node.parentNode;}return null;};}if(!dojo._hasResource["dojox.mobile"]){dojo._hasResource["dojox.mobile"]=true;dojo.provide("dojox.mobile");dojo.experimental("dojox.mobile");}if(!dojo._hasResource["dojox.mobile.parser"]){dojo._hasResource["dojox.mobile.parser"]=true;dojo.provide("dojox.mobile.parser");dojo.provide("dojo.parser");dojox.mobile.parser=new function(){this.instantiate=function(list,_185){var ws=[];if(list){var i,len;len=list.length;for(i=0;i<len;i++){var node=list[i];var cls=dojo.getObject(dojo.attr(node,"dojoType"));var _186=cls.prototype;var _187={};if(_185){for(var name in _185){_187[name]=_185[name];}}for(var prop in _186){var val=dojo.attr(node,prop);if(!val){continue;}if(typeof _186[prop]=="string"){_187[prop]=val;}else{if(typeof _186[prop]=="number"){_187[prop]=val-0;}else{if(typeof _186[prop]=="boolean"){_187[prop]=(val!="false");}else{if(typeof _186[prop]=="object"){_187[prop]=eval("("+val+")");}}}}}_187["class"]=node.className;_187["style"]=node.style&&node.style.cssText;ws.push(new cls(_187,node));}len=ws.length;for(i=0;i<len;i++){var w=ws[i];w.startup&&!w._started&&(!w.getParent||!w.getParent())&&w.startup();}}return ws;};this.parse=function(_188,_189){if(!_188){_188=dojo.body();}else{if(!_189&&_188.rootNode){_188=_188.rootNode;}}var _18a=_188.getElementsByTagName("*");var list=[];for(var i=0,len=_18a.length;i<len;i++){if(_18a[i].getAttribute("dojoType")){list.push(_18a[i]);}}return this.instantiate(list,_189);};}();dojo._loaders.unshift(function(){if(dojo.config.parseOnLoad){dojox.mobile.parser.parse();}});}if(!dojo._hasResource["dojox.mobile.app._event"]){dojo._hasResource["dojox.mobile.app._event"]=true;dojo.provide("dojox.mobile.app._event");dojo.experimental("dojox.mobile.app._event.js");dojo.mixin(dojox.mobile.app,{eventMap:{},connectFlick:function(_18b,_18c,_18d){var _18e;var _18f;var _190=false;var _191;var _192;var _193;var _194;var _195;var time;var _196=dojo.connect("onmousedown",_18b,function(_197){_190=false;_18e=_197.targetTouches?_197.targetTouches[0].clientX:_197.clientX;_18f=_197.targetTouches?_197.targetTouches[0].clientY:_197.clientY;time=(new Date()).getTime();_193=dojo.connect(_18b,"onmousemove",_198);_194=dojo.connect(_18b,"onmouseup",onUp);});var _198=function(_199){dojo.stopEvent(_199);_191=_199.targetTouches?_199.targetTouches[0].clientX:_199.clientX;_192=_199.targetTouches?_199.targetTouches[0].clientY:_199.clientY;if(Math.abs(Math.abs(_191)-Math.abs(_18e))>15){_190=true;_195=(_191>_18e)?"ltr":"rtl";}else{if(Math.abs(Math.abs(_192)-Math.abs(_18f))>15){_190=true;_195=(_192>_18f)?"ttb":"btt";}}};var onUp=function(_19a){dojo.stopEvent(_19a);_193&&dojo.disconnect(_193);_194&&dojo.disconnect(_194);if(_190){var _19b={target:_18b,direction:_195,duration:(new Date()).getTime()-time};if(_18c&&_18d){_18c[_18d](_19b);}else{_18d(_19b);}}};}});dojox.mobile.app.isIPhone=(dojo.isSafari&&(navigator.userAgent.indexOf("iPhone")>-1||navigator.userAgent.indexOf("iPod")>-1));dojox.mobile.app.isWebOS=(navigator.userAgent.indexOf("webOS")>-1);dojox.mobile.app.isAndroid=(navigator.userAgent.toLowerCase().indexOf("android")>-1);if(dojox.mobile.app.isIPhone||dojox.mobile.app.isAndroid){dojox.mobile.app.eventMap={onmousedown:"ontouchstart",mousedown:"ontouchstart",onmouseup:"ontouchend",mouseup:"ontouchend",onmousemove:"ontouchmove",mousemove:"ontouchmove"};}dojo._oldConnect=dojo._connect;dojo._connect=function(obj,_19c,_19d,_19e,_19f){_19c=dojox.mobile.app.eventMap[_19c]||_19c;if(_19c=="flick"||_19c=="onflick"){if(dojo.global["Mojo"]){_19c=Mojo.Event.flick;}else{return dojox.mobile.app.connectFlick(obj,_19d,_19e);}}return dojo._oldConnect(obj,_19c,_19d,_19e,_19f);};}if(!dojo._hasResource["dojox.mobile.app._Widget"]){dojo._hasResource["dojox.mobile.app._Widget"]=true;dojo.provide("dojox.mobile.app._Widget");dojo.experimental("dojox.mobile.app._Widget");dojo.declare("dojox.mobile.app._Widget",dijit._WidgetBase,{getScroll:function(){return {x:dojo.global.scrollX,y:dojo.global.scrollY};},connect:function(_1a0,_1a1,fn){if(_1a1.toLowerCase()=="dblclick"||_1a1.toLowerCase()=="ondblclick"){if(dojo.global["Mojo"]){return this.connect(_1a0,Mojo.Event.tap,fn);}}return this.inherited(arguments);}});}if(!dojo._hasResource["dojox.mobile.app.SceneController"]){dojo._hasResource["dojox.mobile.app.SceneController"]=true;dojo.provide("dojox.mobile.app.SceneController");dojo.experimental("dojox.mobile.app.SceneController");(function(){var app=dojox.mobile.app;var _1a2={};dojo.declare("dojox.mobile.app.SceneController",dojox.mobile.View,{stageController:null,keepScrollPos:false,init:function(_1a3,_1a4){this.sceneName=_1a3;this.params=_1a4;var _1a5=app.resolveTemplate(_1a3);this._deferredInit=new dojo.Deferred();if(_1a2[_1a3]){this._setContents(_1a2[_1a3]);}else{dojo.xhrGet({url:_1a5,handleAs:"text"}).addCallback(dojo.hitch(this,this._setContents));}return this._deferredInit;},_setContents:function(_1a6){_1a2[this.sceneName]=_1a6;this.domNode.innerHTML="<div>"+_1a6+"</div>";var _1a7="";var _1a8=this.sceneName.split("-");for(var i=0;i<_1a8.length;i++){_1a7+=_1a8[i].substring(0,1).toUpperCase()+_1a8[i].substring(1);}_1a7+="Assistant";this.sceneAssistantName=_1a7;var _1a9=this;dojox.mobile.app.loadResourcesForScene(this.sceneName,function(){var _1aa;if(typeof (dojo.global[_1a7])!="undefined"){_1a9._initAssistant();}else{var _1ab=app.resolveAssistant(_1a9.sceneName);dojo.xhrGet({url:_1ab,handleAs:"text"}).addCallback(function(text){try{dojo.eval(text);}catch(e){throw e;}_1a9._initAssistant();});}});},_initAssistant:function(){var cls=dojo.getObject(this.sceneAssistantName);if(!cls){throw Error("Unable to resolve scene assistant "+this.sceneAssistantName);}this.assistant=new cls(this.params);this.assistant.controller=this;this.assistant.domNode=this.domNode.firstChild;this.assistant.setup();this._deferredInit.callback();},query:function(_1ac,node){return dojo.query(_1ac,node||this.domNode);},parse:function(node){var _1ad=this._widgets=dojox.mobile.parser.parse(node||this.domNode,{controller:this});for(var i=0;i<_1ad.length;i++){_1ad[i].set("controller",this);}},getWindowSize:function(){return {w:dojo.global.innerWidth,h:dojo.global.innerHeight};},showAlertDialog:function(_1ae){var size=dojo.marginBox(this.assistant.domNode);var _1af=new dojox.mobile.app.AlertDialog(dojo.mixin(_1ae,{controller:this}));this.assistant.domNode.appendChild(_1af.domNode);_1af.show();},popupSubMenu:function(info){var _1b0=new dojox.mobile.app.ListSelector({controller:this,destroyOnHide:true,onChoose:info.onChoose});this.assistant.domNode.appendChild(_1b0.domNode);_1b0.set("data",info.choices);_1b0.show(info.fromNode);}});})();}if(!dojo._hasResource["dojox.mobile.app.StageController"]){dojo._hasResource["dojox.mobile.app.StageController"]=true;dojo.provide("dojox.mobile.app.StageController");dojo.experimental("dojox.mobile.app.StageController");dojo.declare("dojox.mobile.app.StageController",null,{scenes:null,effect:"fade",constructor:function(node){this.domNode=node;this.scenes=[];if(dojo.config.mobileAnim){this.effect=dojo.config.mobileAnim;}},getActiveSceneController:function(){return this.scenes[this.scenes.length-1];},pushScene:function(_1b1,_1b2){if(this._opInProgress){return;}this._opInProgress=true;var node=dojo.create("div",{"class":"scene-wrapper",style:{visibility:"hidden"}},this.domNode);var _1b3=new dojox.mobile.app.SceneController({},node);if(this.scenes.length>0){this.scenes[this.scenes.length-1].assistant.deactivate();}this.scenes.push(_1b3);var _1b4=this;dojo.forEach(this.scenes,this.setZIndex);_1b3.stageController=this;_1b3.init(_1b1,_1b2).addCallback(function(){if(_1b4.scenes.length==1){_1b3.domNode.style.visibility="visible";_1b4.scenes[_1b4.scenes.length-1].assistant.activate(_1b2);_1b4._opInProgress=false;}else{_1b4.scenes[_1b4.scenes.length-2].performTransition(_1b4.scenes[_1b4.scenes.length-1].domNode,1,_1b4.effect,null,function(){_1b4.scenes[_1b4.scenes.length-1].assistant.activate(_1b2);_1b4._opInProgress=false;});}});},setZIndex:function(_1b5,idx){dojo.style(_1b5.domNode,"zIndex",idx+1);},popScene:function(data){if(this._opInProgress){return;}var _1b6=this;if(this.scenes.length>1){this._opInProgress=true;this.scenes[_1b6.scenes.length-2].assistant.activate(data);this.scenes[_1b6.scenes.length-1].performTransition(_1b6.scenes[this.scenes.length-2].domNode,-1,this.effect,null,function(){_1b6._destroyScene(_1b6.scenes[_1b6.scenes.length-1]);_1b6.scenes.splice(_1b6.scenes.length-1,1);_1b6._opInProgress=false;});}else{}},popScenesTo:function(_1b7,data){if(this._opInProgress){return;}while(this.scenes.length>2&&this.scenes[this.scenes.length-2].sceneName!=_1b7){this._destroyScene(this.scenes[this.scenes.length-2]);this.scenes.splice(this.scenes.length-2,1);}this.popScene(data);},_destroyScene:function(_1b8){_1b8.assistant.deactivate();_1b8.assistant.destroy();_1b8.destroyRecursive();}});}if(!dojo._hasResource["dojox.mobile.app.SceneAssistant"]){dojo._hasResource["dojox.mobile.app.SceneAssistant"]=true;dojo.provide("dojox.mobile.app.SceneAssistant");dojo.experimental("dojox.mobile.app.SceneAssistant");dojo.declare("dojox.mobile.app.SceneAssistant",null,{constructor:function(){},setup:function(){},activate:function(_1b9){},deactivate:function(){},destroy:function(){var _1ba=dojo.query("> [widgetId]",this.containerNode).map(dijit.byNode);dojo.forEach(_1ba,function(_1bb){_1bb.destroyRecursive();});this.disconnect();},connect:function(obj,_1bc,_1bd){if(!this._connects){this._connects=[];}this._connects.push(dojo.connect(obj,_1bc,_1bd));},disconnect:function(){dojo.forEach(this._connects,dojo.disconnect);this._connects=[];}});}if(!dojo._hasResource["dojox.mobile.app.AlertDialog"]){dojo._hasResource["dojox.mobile.app.AlertDialog"]=true;dojo.provide("dojox.mobile.app.AlertDialog");dojo.experimental("dojox.mobile.app.AlertDialog");dojo.declare("dojox.mobile.app.AlertDialog",dijit._WidgetBase,{title:"",text:"",controller:null,buttons:null,defaultButtonLabel:"OK",onChoose:null,constructor:function(){this.onClick=dojo.hitch(this,this.onClick);this._handleSelect=dojo.hitch(this,this._handleSelect);},buildRendering:function(){this.domNode=dojo.create("div",{"class":"alertDialog"});var _1be=dojo.create("div",{"class":"alertDialogBody"},this.domNode);dojo.create("div",{"class":"alertTitle",innerHTML:this.title||""},_1be);dojo.create("div",{"class":"alertText",innerHTML:this.text||""},_1be);var _1bf=dojo.create("div",{"class":"alertBtns"},_1be);if(!this.buttons||this.buttons.length==0){this.buttons=[{label:this.defaultButtonLabel,value:"ok","class":"affirmative"}];}var _1c0=this;dojo.forEach(this.buttons,function(_1c1){var btn=new dojox.mobile.Button({btnClass:_1c1["class"]||"",label:_1c1.label});btn._dialogValue=_1c1.value;dojo.place(btn.domNode,_1bf);_1c0.connect(btn,"onClick",_1c0._handleSelect);});var _1c2=this.controller.getWindowSize();this.mask=dojo.create("div",{"class":"dialogUnderlayWrapper",innerHTML:"<div class=\"dialogUnderlay\"></div>",style:{width:_1c2.w+"px",height:_1c2.h+"px"}},this.controller.assistant.domNode);this.connect(this.mask,"onclick",function(){_1c0.onChoose&&_1c0.onChoose();_1c0.hide();});},postCreate:function(){this.subscribe("/dojox/mobile/app/goback",this._handleSelect);},_handleSelect:function(_1c3){var node;if(_1c3&&_1c3.target){node=_1c3.target;while(!dijit.byNode(node)){node-node.parentNode;}}if(this.onChoose){this.onChoose(node?dijit.byNode(node)._dialogValue:undefined);}this.hide();},show:function(){this._doTransition(1);},hide:function(){this._doTransition(-1);},_doTransition:function(dir){var anim;var h=dojo.marginBox(this.domNode.firstChild).h;var _1c4=this.controller.getWindowSize().h;var high=_1c4-h;var low=_1c4;var _1c5=dojo.fx.slideTo({node:this.domNode,duration:400,top:{start:dir<0?high:low,end:dir<0?low:high}});var _1c6=dojo[dir<0?"fadeOut":"fadeIn"]({node:this.mask,duration:400});var anim=dojo.fx.combine([_1c5,_1c6]);var _1c7=this;dojo.connect(anim,"onEnd",this,function(){if(dir<0){_1c7.domNode.style.display="none";dojo.destroy(_1c7.domNode);dojo.destroy(_1c7.mask);}});anim.play();},destroy:function(){this.inherited(arguments);dojo.destroy(this.mask);},onClick:function(){}});}if(!dojo._hasResource["dojo.string"]){dojo._hasResource["dojo.string"]=true;dojo.provide("dojo.string");dojo.getObject("string",true,dojo);dojo.string.rep=function(str,num){if(num<=0||!str){return "";}var buf=[];for(;;){if(num&1){buf.push(str);}if(!(num>>=1)){break;}str+=str;}return buf.join("");};dojo.string.pad=function(text,size,ch,end){if(!ch){ch="0";}var out=String(text),pad=dojo.string.rep(ch,Math.ceil((size-out.length)/ch.length));return end?out+pad:pad+out;};dojo.string.substitute=function(_1c8,map,_1c9,_1ca){_1ca=_1ca||dojo.global;_1c9=_1c9?dojo.hitch(_1ca,_1c9):function(v){return v;};return _1c8.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g,function(_1cb,key,_1cc){var _1cd=dojo.getObject(key,false,map);if(_1cc){_1cd=dojo.getObject(_1cc,false,_1ca).call(_1ca,_1cd,key);}return _1c9(_1cd,key).toString();});};dojo.string.trim=String.prototype.trim?dojo.trim:function(str){str=str.replace(/^\s+/,"");for(var i=str.length-1;i>=0;i--){if(/\S/.test(str.charAt(i))){str=str.substring(0,i+1);break;}}return str;};}if(!dojo._hasResource["dojox.mobile.app.List"]){dojo._hasResource["dojox.mobile.app.List"]=true;dojo.provide("dojox.mobile.app.List");dojo.experimental("dojox.mobile.app.List");(function(){var _1ce={};dojo.declare("dojox.mobile.app.List",dijit._WidgetBase,{items:null,itemTemplate:"",emptyTemplate:"",dividerTemplate:"",dividerFunction:null,labelDelete:"Delete",labelCancel:"Cancel",controller:null,autoDelete:true,enableDelete:true,enableHold:true,formatters:null,_templateLoadCount:0,_mouseDownPos:null,baseClass:"list",constructor:function(){this._checkLoadComplete=dojo.hitch(this,this._checkLoadComplete);this._replaceToken=dojo.hitch(this,this._replaceToken);this._postDeleteAnim=dojo.hitch(this,this._postDeleteAnim);},postCreate:function(){var _1cf=this;if(this.emptyTemplate){this._templateLoadCount++;}if(this.itemTemplate){this._templateLoadCount++;}if(this.dividerTemplate){this._templateLoadCount++;}this.connect(this.domNode,"onmousedown",function(_1d0){var _1d1=_1d0;if(_1d0.targetTouches&&_1d0.targetTouches.length>0){_1d1=_1d0.targetTouches[0];}var _1d2=_1cf._getRowNode(_1d0.target);if(_1d2){_1cf._setDataInfo(_1d2,_1d0);_1cf._selectRow(_1d2);_1cf._mouseDownPos={x:_1d1.pageX,y:_1d1.pageY};_1cf._dragThreshold=null;}});this.connect(this.domNode,"onmouseup",function(_1d3){if(_1d3.targetTouches&&_1d3.targetTouches.length>0){_1d3=_1d3.targetTouches[0];}var _1d4=_1cf._getRowNode(_1d3.target);if(_1d4){_1cf._setDataInfo(_1d4,_1d3);if(_1cf._selectedRow){_1cf.onSelect(_1d4._data,_1d4._idx,_1d4);}this._deselectRow();}});if(this.enableDelete){this.connect(this.domNode,"mousemove",function(_1d5){dojo.stopEvent(_1d5);if(!_1cf._selectedRow){return;}var _1d6=_1cf._getRowNode(_1d5.target);if(_1cf.enableDelete&&_1d6&&!_1cf._deleting){_1cf.handleDrag(_1d5);}});}this.connect(this.domNode,"onclick",function(_1d7){if(_1d7.touches&&_1d7.touches.length>0){_1d7=_1d7.touches[0];}var _1d8=_1cf._getRowNode(_1d7.target,true);if(_1d8){_1cf._setDataInfo(_1d8,_1d7);}});this.connect(this.domNode,"mouseout",function(_1d9){if(_1d9.touches&&_1d9.touches.length>0){_1d9=_1d9.touches[0];}if(_1d9.target==_1cf._selectedRow){_1cf._deselectRow();}});if(!this.itemTemplate){throw Error("An item template must be provided to "+this.declaredClass);}this._loadTemplate(this.itemTemplate,"itemTemplate",this._checkLoadComplete);if(this.emptyTemplate){this._loadTemplate(this.emptyTemplate,"emptyTemplate",this._checkLoadComplete);}if(this.dividerTemplate){this._loadTemplate(this.dividerTemplate,"dividerTemplate",this._checkLoadComplete);}},handleDrag:function(_1da){var _1db=_1da;if(_1da.targetTouches&&_1da.targetTouches.length>0){_1db=_1da.targetTouches[0];}var diff=_1db.pageX-this._mouseDownPos.x;var _1dc=Math.abs(diff);if(_1dc>10&&!this._dragThreshold){this._dragThreshold=dojo.marginBox(this._selectedRow).w*0.6;if(!this.autoDelete){this.createDeleteButtons(this._selectedRow);}}this._selectedRow.style.left=(_1dc>10?diff:0)+"px";if(this._dragThreshold&&this._dragThreshold<_1dc){this.preDelete(diff);}},handleDragCancel:function(){if(this._deleting){return;}dojo.removeClass(this._selectedRow,"hold");this._selectedRow.style.left=0;this._mouseDownPos=null;this._dragThreshold=null;this._deleteBtns&&dojo.style(this._deleteBtns,"display","none");},preDelete:function(_1dd){var self=this;this._deleting=true;dojo.animateProperty({node:this._selectedRow,duration:400,properties:{left:{end:_1dd+((_1dd>0?1:-1)*this._dragThreshold*0.8)}},onEnd:dojo.hitch(this,function(){if(this.autoDelete){this.deleteRow(this._selectedRow);}})}).play();},deleteRow:function(row){dojo.style(row,{visibility:"hidden",minHeight:"0px"});dojo.removeClass(row,"hold");this._deleteAnimConn=this.connect(row,"webkitAnimationEnd",this._postDeleteAnim);dojo.addClass(row,"collapsed");},_postDeleteAnim:function(_1de){if(this._deleteAnimConn){this.disconnect(this._deleteAnimConn);this._deleteAnimConn=null;}var row=this._selectedRow;var _1df=row.nextSibling;var _1e0=row.previousSibling;if(_1e0&&_1e0._isDivider){if(!_1df||_1df._isDivider){_1e0.parentNode.removeChild(_1e0);}}row.parentNode.removeChild(row);this.onDelete(row._data,row._idx,this.items);while(_1df){if(_1df._idx){_1df._idx--;}_1df=_1df.nextSibling;}dojo.destroy(row);dojo.query("> *:not(.buttons)",this.domNode).forEach(this.applyClass);this._deleting=false;this._deselectRow();},createDeleteButtons:function(_1e1){var mb=dojo.marginBox(_1e1);var pos=dojo._abs(_1e1,true);if(!this._deleteBtns){this._deleteBtns=dojo.create("div",{"class":"buttons"},this.domNode);this.buttons=[];this.buttons.push(new dojox.mobile.Button({btnClass:"mblRedButton",label:this.labelDelete}));this.buttons.push(new dojox.mobile.Button({btnClass:"mblBlueButton",label:this.labelCancel}));dojo.place(this.buttons[0].domNode,this._deleteBtns);dojo.place(this.buttons[1].domNode,this._deleteBtns);dojo.addClass(this.buttons[0].domNode,"deleteBtn");dojo.addClass(this.buttons[1].domNode,"cancelBtn");this._handleButtonClick=dojo.hitch(this._handleButtonClick);this.connect(this._deleteBtns,"onclick",this._handleButtonClick);}dojo.removeClass(this._deleteBtns,"fade out fast");dojo.style(this._deleteBtns,{display:"",width:mb.w+"px",height:mb.h+"px",top:(_1e1.offsetTop)+"px",left:"0px"});},onDelete:function(data,_1e2,_1e3){_1e3.splice(_1e2,1);if(_1e3.length<1){this.render();}},cancelDelete:function(){this._deleting=false;this.handleDragCancel();},_handleButtonClick:function(_1e4){if(_1e4.touches&&_1e4.touches.length>0){_1e4=_1e4.touches[0];}var node=_1e4.target;if(dojo.hasClass(node,"deleteBtn")){this.deleteRow(this._selectedRow);}else{if(dojo.hasClass(node,"cancelBtn")){this.cancelDelete();}else{return;}}dojo.addClass(this._deleteBtns,"fade out");},applyClass:function(node,idx,_1e5){dojo.removeClass(node,"first last");if(idx==0){dojo.addClass(node,"first");}if(idx==_1e5.length-1){dojo.addClass(node,"last");}},_setDataInfo:function(_1e6,_1e7){_1e7.item=_1e6._data;_1e7.index=_1e6._idx;},onSelect:function(data,_1e8,_1e9){},_selectRow:function(row){if(this._deleting&&this._selectedRow&&row!=this._selectedRow){this.cancelDelete();}if(!dojo.hasClass(row,"row")){return;}if(this.enableHold||this.enableDelete){dojo.addClass(row,"hold");}this._selectedRow=row;},_deselectRow:function(){if(!this._selectedRow||this._deleting){return;}this.handleDragCancel();dojo.removeClass(this._selectedRow,"hold");this._selectedRow=null;},_getRowNode:function(_1ea,_1eb){while(_1ea&&!_1ea._data&&_1ea!=this.domNode){if(!_1eb&&dojo.hasClass(_1ea,"noclick")){return null;}_1ea=_1ea.parentNode;}return _1ea==this.domNode?null:_1ea;},applyTemplate:function(_1ec,data){return dojo._toDom(dojo.string.substitute(_1ec,data,this._replaceToken,this.formatters||this));},render:function(){dojo.query("> *:not(.buttons)",this.domNode).forEach(dojo.destroy);if(this.items.length<1&&this.emptyTemplate){dojo.place(dojo._toDom(this.emptyTemplate),this.domNode,"first");}else{this.domNode.appendChild(this._renderRange(0,this.items.length));}if(dojo.hasClass(this.domNode.parentNode,"mblRoundRect")){dojo.addClass(this.domNode.parentNode,"mblRoundRectList");}var divs=dojo.query("> .row",this.domNode);if(divs.length>0){dojo.addClass(divs[0],"first");dojo.addClass(divs[divs.length-1],"last");}},_renderRange:function(_1ed,_1ee){var rows=[];var row,i;var frag=document.createDocumentFragment();_1ed=Math.max(0,_1ed);_1ee=Math.min(_1ee,this.items.length);for(i=_1ed;i<_1ee;i++){row=this.applyTemplate(this.itemTemplate,this.items[i]);dojo.addClass(row,"row");row._data=this.items[i];row._idx=i;rows.push(row);}if(!this.dividerFunction||!this.dividerTemplate){for(i=_1ed;i<_1ee;i++){rows[i]._data=this.items[i];rows[i]._idx=i;frag.appendChild(rows[i]);}}else{var _1ef=null;var _1f0;var _1f1;for(i=_1ed;i<_1ee;i++){rows[i]._data=this.items[i];rows[i]._idx=i;_1f0=this.dividerFunction(this.items[i]);if(_1f0&&_1f0!=_1ef){_1f1=this.applyTemplate(this.dividerTemplate,{label:_1f0,item:this.items[i]});_1f1._isDivider=true;frag.appendChild(_1f1);_1ef=_1f0;}frag.appendChild(rows[i]);}}return frag;},_replaceToken:function(_1f2,key){if(key.charAt(0)=="!"){_1f2=dojo.getObject(key.substr(1),false,_this);}if(typeof _1f2=="undefined"){return "";}if(_1f2==null){return "";}return key.charAt(0)=="!"?_1f2:_1f2.toString().replace(/"/g,"&quot;");},_checkLoadComplete:function(){this._templateLoadCount--;if(this._templateLoadCount<1&&this.get("items")){this.render();}},_loadTemplate:function(url,_1f3,_1f4){if(!url){_1f4();return;}if(_1ce[url]){this.set(_1f3,_1ce[url]);_1f4();}else{var _1f5=this;dojo.xhrGet({url:url,sync:false,handleAs:"text",load:function(text){_1ce[url]=dojo.trim(text);_1f5.set(_1f3,_1ce[url]);_1f4();}});}},_setFormattersAttr:function(_1f6){this.formatters=_1f6;},_setItemsAttr:function(_1f7){this.items=_1f7||[];if(this._templateLoadCount<1&&_1f7){this.render();}},destroy:function(){if(this.buttons){dojo.forEach(this.buttons,function(_1f8){_1f8.destroy();});this.buttons=null;}this.inherited(arguments);}});})();}if(!dojo._hasResource["dojo.fx.Toggler"]){dojo._hasResource["dojo.fx.Toggler"]=true;dojo.provide("dojo.fx.Toggler");dojo.declare("dojo.fx.Toggler",null,{node:null,showFunc:dojo.fadeIn,hideFunc:dojo.fadeOut,showDuration:200,hideDuration:200,constructor:function(args){var _1f9=this;dojo.mixin(_1f9,args);_1f9.node=args.node;_1f9._showArgs=dojo.mixin({},args);_1f9._showArgs.node=_1f9.node;_1f9._showArgs.duration=_1f9.showDuration;_1f9.showAnim=_1f9.showFunc(_1f9._showArgs);_1f9._hideArgs=dojo.mixin({},args);_1f9._hideArgs.node=_1f9.node;_1f9._hideArgs.duration=_1f9.hideDuration;_1f9.hideAnim=_1f9.hideFunc(_1f9._hideArgs);dojo.connect(_1f9.showAnim,"beforeBegin",dojo.hitch(_1f9.hideAnim,"stop",true));dojo.connect(_1f9.hideAnim,"beforeBegin",dojo.hitch(_1f9.showAnim,"stop",true));},show:function(_1fa){return this.showAnim.play(_1fa||0);},hide:function(_1fb){return this.hideAnim.play(_1fb||0);}});}if(!dojo._hasResource["dojo.fx"]){dojo._hasResource["dojo.fx"]=true;dojo.provide("dojo.fx");(function(){var d=dojo,_1fc={_fire:function(evt,args){if(this[evt]){this[evt].apply(this,args||[]);}return this;}};var _1fd=function(_1fe){this._index=-1;this._animations=_1fe||[];this._current=this._onAnimateCtx=this._onEndCtx=null;this.duration=0;d.forEach(this._animations,function(a){this.duration+=a.duration;if(a.delay){this.duration+=a.delay;}},this);};d.extend(_1fd,{_onAnimate:function(){this._fire("onAnimate",arguments);},_onEnd:function(){d.disconnect(this._onAnimateCtx);d.disconnect(this._onEndCtx);this._onAnimateCtx=this._onEndCtx=null;if(this._index+1==this._animations.length){this._fire("onEnd");}else{this._current=this._animations[++this._index];this._onAnimateCtx=d.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd");this._current.play(0,true);}},play:function(_1ff,_200){if(!this._current){this._current=this._animations[this._index=0];}if(!_200&&this._current.status()=="playing"){return this;}var _201=d.connect(this._current,"beforeBegin",this,function(){this._fire("beforeBegin");}),_202=d.connect(this._current,"onBegin",this,function(arg){this._fire("onBegin",arguments);}),_203=d.connect(this._current,"onPlay",this,function(arg){this._fire("onPlay",arguments);d.disconnect(_201);d.disconnect(_202);d.disconnect(_203);});if(this._onAnimateCtx){d.disconnect(this._onAnimateCtx);}this._onAnimateCtx=d.connect(this._current,"onAnimate",this,"_onAnimate");if(this._onEndCtx){d.disconnect(this._onEndCtx);}this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd");this._current.play.apply(this._current,arguments);return this;},pause:function(){if(this._current){var e=d.connect(this._current,"onPause",this,function(arg){this._fire("onPause",arguments);d.disconnect(e);});this._current.pause();}return this;},gotoPercent:function(_204,_205){this.pause();var _206=this.duration*_204;this._current=null;d.some(this._animations,function(a){if(a.duration<=_206){this._current=a;return true;}_206-=a.duration;return false;});if(this._current){this._current.gotoPercent(_206/this._current.duration,_205);}return this;},stop:function(_207){if(this._current){if(_207){for(;this._index+1<this._animations.length;++this._index){this._animations[this._index].stop(true);}this._current=this._animations[this._index];}var e=d.connect(this._current,"onStop",this,function(arg){this._fire("onStop",arguments);d.disconnect(e);});this._current.stop();}return this;},status:function(){return this._current?this._current.status():"stopped";},destroy:function(){if(this._onAnimateCtx){d.disconnect(this._onAnimateCtx);}if(this._onEndCtx){d.disconnect(this._onEndCtx);}}});d.extend(_1fd,_1fc);dojo.fx.chain=function(_208){return new _1fd(_208);};var _209=function(_20a){this._animations=_20a||[];this._connects=[];this._finished=0;this.duration=0;d.forEach(_20a,function(a){var _20b=a.duration;if(a.delay){_20b+=a.delay;}if(this.duration<_20b){this.duration=_20b;}this._connects.push(d.connect(a,"onEnd",this,"_onEnd"));},this);this._pseudoAnimation=new d.Animation({curve:[0,1],duration:this.duration});var self=this;d.forEach(["beforeBegin","onBegin","onPlay","onAnimate","onPause","onStop","onEnd"],function(evt){self._connects.push(d.connect(self._pseudoAnimation,evt,function(){self._fire(evt,arguments);}));});};d.extend(_209,{_doAction:function(_20c,args){d.forEach(this._animations,function(a){a[_20c].apply(a,args);});return this;},_onEnd:function(){if(++this._finished>this._animations.length){this._fire("onEnd");}},_call:function(_20d,args){var t=this._pseudoAnimation;t[_20d].apply(t,args);},play:function(_20e,_20f){this._finished=0;this._doAction("play",arguments);this._call("play",arguments);return this;},pause:function(){this._doAction("pause",arguments);this._call("pause",arguments);return this;},gotoPercent:function(_210,_211){var ms=this.duration*_210;d.forEach(this._animations,function(a){a.gotoPercent(a.duration<ms?1:(ms/a.duration),_211);});this._call("gotoPercent",arguments);return this;},stop:function(_212){this._doAction("stop",arguments);this._call("stop",arguments);return this;},status:function(){return this._pseudoAnimation.status();},destroy:function(){d.forEach(this._connects,dojo.disconnect);}});d.extend(_209,_1fc);dojo.fx.combine=function(_213){return new _209(_213);};dojo.fx.wipeIn=function(args){var node=args.node=d.byId(args.node),s=node.style,o;var anim=d.animateProperty(d.mixin({properties:{height:{start:function(){o=s.overflow;s.overflow="hidden";if(s.visibility=="hidden"||s.display=="none"){s.height="1px";s.display="";s.visibility="";return 1;}else{var _214=d.style(node,"height");return Math.max(_214,1);}},end:function(){return node.scrollHeight;}}}},args));d.connect(anim,"onEnd",function(){s.height="auto";s.overflow=o;});return anim;};dojo.fx.wipeOut=function(args){var node=args.node=d.byId(args.node),s=node.style,o;var anim=d.animateProperty(d.mixin({properties:{height:{end:1}}},args));d.connect(anim,"beforeBegin",function(){o=s.overflow;s.overflow="hidden";s.display="";});d.connect(anim,"onEnd",function(){s.overflow=o;s.height="auto";s.display="none";});return anim;};dojo.fx.slideTo=function(args){var node=args.node=d.byId(args.node),top=null,left=null;var init=(function(n){return function(){var cs=d.getComputedStyle(n);var pos=cs.position;top=(pos=="absolute"?n.offsetTop:parseInt(cs.top)||0);left=(pos=="absolute"?n.offsetLeft:parseInt(cs.left)||0);if(pos!="absolute"&&pos!="relative"){var ret=d.position(n,true);top=ret.y;left=ret.x;n.style.position="absolute";n.style.top=top+"px";n.style.left=left+"px";}};})(node);init();var anim=d.animateProperty(d.mixin({properties:{top:args.top||0,left:args.left||0}},args));d.connect(anim,"beforeBegin",anim,init);return anim;};})();}if(!dojo._hasResource["dojox.mobile.app.ListSelector"]){dojo._hasResource["dojox.mobile.app.ListSelector"]=true;dojo.provide("dojox.mobile.app.ListSelector");dojo.experimental("dojox.mobile.app.ListSelector");dojo.declare("dojox.mobile.app.ListSelector",dojox.mobile.app._Widget,{data:null,controller:null,onChoose:null,destroyOnHide:false,_setDataAttr:function(data){this.data=data;if(this.data){this.render();}},postCreate:function(){dojo.addClass(this.domNode,"listSelector");var _215=this;this.connect(this.domNode,"onclick",function(_216){if(!dojo.hasClass(_216.target,"listSelectorRow")){return;}if(_215.onChoose){_215.onChoose(_215.data[_216.target._idx].value);}_215.hide();});this.connect(this.domNode,"onmousedown",function(_217){if(!dojo.hasClass(_217.target,"listSelectorRow")){return;}dojo.addClass(_217.target,"listSelectorRow-selected");});this.connect(this.domNode,"onmouseup",function(_218){if(!dojo.hasClass(_218.target,"listSelectorRow")){return;}dojo.removeClass(_218.target,"listSelectorRow-selected");});this.connect(this.domNode,"onmouseout",function(_219){if(!dojo.hasClass(_219.target,"listSelectorRow")){return;}dojo.removeClass(_219.target,"listSelectorRow-selected");});var _21a=this.controller.getWindowSize();this.mask=dojo.create("div",{"class":"dialogUnderlayWrapper",innerHTML:"<div class=\"dialogUnderlay\"></div>"},this.controller.assistant.domNode);this.connect(this.mask,"onclick",function(){_215.onChoose&&_215.onChoose();_215.hide();});},show:function(_21b){var _21c;var _21d=this.controller.getWindowSize();var _21e;if(_21b){_21e=dojo._abs(_21b);_21c=_21e;}else{_21c.x=_21d.w/2;_21c.y=200;}dojo.style(this.domNode,{opacity:0,display:"",width:Math.floor(_21d.w*0.8)+"px"});var _21f=0;dojo.query(">",this.domNode).forEach(function(node){dojo.style(node,{"float":"left"});_21f=Math.max(_21f,dojo.marginBox(node).w);dojo.style(node,{"float":"none"});});_21f=Math.min(_21f,Math.round(_21d.w*0.8))+dojo.style(this.domNode,"paddingLeft")+dojo.style(this.domNode,"paddingRight")+1;dojo.style(this.domNode,"width",_21f+"px");var _220=dojo.marginBox(this.domNode).h;var _221=this;var _222=_21e?Math.max(30,_21e.y-_220-10):this.getScroll().y+30;var _223=dojo.animateProperty({node:this.domNode,duration:400,properties:{width:{start:1,end:_21f},height:{start:1,end:_220},top:{start:_21c.y,end:_222},left:{start:_21c.x,end:(_21d.w/2-_21f/2)},opacity:{start:0,end:1},fontSize:{start:1}},onEnd:function(){dojo.style(_221.domNode,"width","inherit");}});var _224=dojo.fadeIn({node:this.mask,duration:400});dojo.fx.combine([_223,_224]).play();},hide:function(){var _225=this;var _226=dojo.animateProperty({node:this.domNode,duration:500,properties:{width:{end:1},height:{end:1},opacity:{end:0},fontSize:{end:1}},onEnd:function(){if(_225.get("destroyOnHide")){_225.destroy();}}});var _227=dojo.fadeOut({node:this.mask,duration:400});dojo.fx.combine([_226,_227]).play();},render:function(){dojo.empty(this.domNode);dojo.style(this.domNode,"opacity",0);var row;for(var i=0;i<this.data.length;i++){row=dojo.create("div",{"class":"listSelectorRow "+(this.data[i].className||""),innerHTML:this.data[i].label},this.domNode);row._idx=i;if(i==0){dojo.addClass(row,"first");}if(i==this.data.length-1){dojo.addClass(row,"last");}}},destroy:function(){this.inherited(arguments);dojo.destroy(this.mask);}});}if(!dojo._hasResource["dojox.mobile.app._FormWidget"]){dojo._hasResource["dojox.mobile.app._FormWidget"]=true;dojo.provide("dojox.mobile.app._FormWidget");dojo.experimental("dojox.mobile.app._FormWidget");dojo.declare("dojox.mobile.app._FormWidget",dijit._WidgetBase,{name:"",alt:"",value:"",type:"text",disabled:false,intermediateChanges:false,scrollOnFocus:false,attributeMap:dojo.delegate(dijit._WidgetBase.prototype.attributeMap,{value:"focusNode",id:"focusNode",alt:"focusNode",title:"focusNode"}),postMixInProperties:function(){this.nameAttrSetting=this.name?("name=\""+this.name.replace(/'/g,"&quot;")+"\""):"";this.inherited(arguments);},postCreate:function(){this.inherited(arguments);this.connect(this.domNode,"onmousedown","_onMouseDown");},_setDisabledAttr:function(_228){this.disabled=_228;dojo.attr(this.focusNode,"disabled",_228);if(this.valueNode){dojo.attr(this.valueNode,"disabled",_228);}},_onFocus:function(e){if(this.scrollOnFocus){dojo.window.scrollIntoView(this.domNode);}this.inherited(arguments);},isFocusable:function(){return !this.disabled&&!this.readOnly&&this.focusNode&&(dojo.style(this.domNode,"display")!="none");},focus:function(){this.focusNode.focus();},compare:function(val1,val2){if(typeof val1=="number"&&typeof val2=="number"){return (isNaN(val1)&&isNaN(val2))?0:val1-val2;}else{if(val1>val2){return 1;}else{if(val1<val2){return -1;}else{return 0;}}}},onChange:function(_229){},_onChangeActive:false,_handleOnChange:function(_22a,_22b){this._lastValue=_22a;if(this._lastValueReported==undefined&&(_22b===null||!this._onChangeActive)){this._resetValue=this._lastValueReported=_22a;}if((this.intermediateChanges||_22b||_22b===undefined)&&((typeof _22a!=typeof this._lastValueReported)||this.compare(_22a,this._lastValueReported)!=0)){this._lastValueReported=_22a;if(this._onChangeActive){if(this._onChangeHandle){clearTimeout(this._onChangeHandle);}this._onChangeHandle=setTimeout(dojo.hitch(this,function(){this._onChangeHandle=null;this.onChange(_22a);}),0);}}},create:function(){this.inherited(arguments);this._onChangeActive=true;},destroy:function(){if(this._onChangeHandle){clearTimeout(this._onChangeHandle);this.onChange(this._lastValueReported);}this.inherited(arguments);},_onMouseDown:function(e){if(this.isFocusable()){var _22c=this.connect(dojo.body(),"onmouseup",function(){if(this.isFocusable()){this.focus();}this.disconnect(_22c);});}},selectInputText:function(_22d,_22e,stop){var _22f=dojo.global;var _230=dojo.doc;_22d=dojo.byId(_22d);if(isNaN(_22e)){_22e=0;}if(isNaN(stop)){stop=_22d.value?_22d.value.length:0;}dijit.focus(_22d);if(_22f["getSelection"]&&_22d.setSelectionRange){_22d.setSelectionRange(_22e,stop);}}});dojo.declare("dojox.mobile.app._FormValueWidget",dojox.mobile.app._FormWidget,{readOnly:false,attributeMap:dojo.delegate(dojox.mobile.app._FormWidget.prototype.attributeMap,{value:"",readOnly:"focusNode"}),_setReadOnlyAttr:function(_231){this.readOnly=_231;dojo.attr(this.focusNode,"readOnly",_231);},postCreate:function(){this.inherited(arguments);if(this._resetValue===undefined){this._resetValue=this.value;}},_setValueAttr:function(_232,_233){this.value=_232;this._handleOnChange(_232,_233);},_getValueAttr:function(){return this._lastValue;},undo:function(){this._setValueAttr(this._lastValueReported,false);},reset:function(){this._hasBeenBlurred=false;this._setValueAttr(this._resetValue,true);}});}if(!dojo._hasResource["dojox.mobile.app.TextBox"]){dojo._hasResource["dojox.mobile.app.TextBox"]=true;dojo.provide("dojox.mobile.app.TextBox");dojo.experimental("dojox.mobile.app.TextBox");dojo.declare("dojox.mobile.app.TextBox",dojox.mobile.app._FormValueWidget,{trim:false,uppercase:false,lowercase:false,propercase:false,maxLength:"",selectOnClick:false,placeHolder:"",baseClass:"mblTextBox",attributeMap:dojo.delegate(dojox.mobile.app._FormValueWidget.prototype.attributeMap,{maxLength:"focusNode"}),buildRendering:function(){var node=this.srcNodeRef;if(!node||node.tagName!="INPUT"){node=dojo.create("input",{});}dojo.attr(node,{type:"text",value:dojo.attr(node,"value")||"",placeholder:this.placeHolder||null});this.domNode=this.textbox=this.focusNode=node;},_setPlaceHolderAttr:function(v){this.placeHolder=v;if(this.textbox){dojo.attr(this.textbox,"placeholder",v);}},_getValueAttr:function(){return this.parse(this.get("displayedValue"),this.constraints);},_setValueAttr:function(_234,_235,_236){var _237;if(_234!==undefined){_237=this.filter(_234);if(typeof _236!="string"){if(_237!==null&&((typeof _237!="number")||!isNaN(_237))){_236=this.filter(this.format(_237,this.constraints));}else{_236="";}}}if(_236!=null&&_236!=undefined&&((typeof _236)!="number"||!isNaN(_236))&&this.textbox.value!=_236){this.textbox.value=_236;}this.inherited(arguments,[_237,_235]);},displayedValue:"",_getDisplayedValueAttr:function(){return this.filter(this.textbox.value);},_setDisplayedValueAttr:function(_238){if(_238===null||_238===undefined){_238="";}else{if(typeof _238!="string"){_238=String(_238);}}this.textbox.value=_238;this._setValueAttr(this.get("value"),undefined,_238);},format:function(_239,_23a){return ((_239==null||_239==undefined)?"":(_239.toString?_239.toString():_239));},parse:function(_23b,_23c){return _23b;},_refreshState:function(){},_onInput:function(e){if(e&&e.type&&/key/i.test(e.type)&&e.keyCode){switch(e.keyCode){case dojo.keys.SHIFT:case dojo.keys.ALT:case dojo.keys.CTRL:case dojo.keys.TAB:return;}}if(this.intermediateChanges){var _23d=this;setTimeout(function(){_23d._handleOnChange(_23d.get("value"),false);},0);}this._refreshState();},postCreate:function(){this.textbox.setAttribute("value",this.textbox.value);this.inherited(arguments);if(dojo.isMoz||dojo.isOpera){this.connect(this.textbox,"oninput",this._onInput);}else{this.connect(this.textbox,"onkeydown",this._onInput);this.connect(this.textbox,"onkeyup",this._onInput);this.connect(this.textbox,"onpaste",this._onInput);this.connect(this.textbox,"oncut",this._onInput);}},_blankValue:"",filter:function(val){if(val===null){return this._blankValue;}if(typeof val!="string"){return val;}if(this.trim){val=dojo.trim(val);}if(this.uppercase){val=val.toUpperCase();}if(this.lowercase){val=val.toLowerCase();}if(this.propercase){val=val.replace(/[^\s]+/g,function(word){return word.substring(0,1).toUpperCase()+word.substring(1);});}return val;},_setBlurValue:function(){this._setValueAttr(this.get("value"),true);},_onBlur:function(e){if(this.disabled){return;}this._setBlurValue();this.inherited(arguments);if(this._selectOnClickHandle){this.disconnect(this._selectOnClickHandle);}if(this.selectOnClick&&dojo.isMoz){this.textbox.selectionStart=this.textbox.selectionEnd=undefined;}},_onFocus:function(by){if(this.disabled||this.readOnly){return;}if(this.selectOnClick&&by=="mouse"){this._selectOnClickHandle=this.connect(this.domNode,"onmouseup",function(){this.disconnect(this._selectOnClickHandle);var _23e;_23e=this.textbox.selectionStart==this.textbox.selectionEnd;if(_23e){this.selectInputText(this.textbox);}});}this._refreshState();this.inherited(arguments);},reset:function(){this.textbox.value="";this.inherited(arguments);}});}if(!dojo._hasResource["dojo.fx.easing"]){dojo._hasResource["dojo.fx.easing"]=true;dojo.provide("dojo.fx.easing");dojo.getObject("fx.easing",true,dojo);dojo.fx.easing={linear:function(n){return n;},quadIn:function(n){return Math.pow(n,2);},quadOut:function(n){return n*(n-2)*-1;},quadInOut:function(n){n=n*2;if(n<1){return Math.pow(n,2)/2;}return -1*((--n)*(n-2)-1)/2;},cubicIn:function(n){return Math.pow(n,3);},cubicOut:function(n){return Math.pow(n-1,3)+1;},cubicInOut:function(n){n=n*2;if(n<1){return Math.pow(n,3)/2;}n-=2;return (Math.pow(n,3)+2)/2;},quartIn:function(n){return Math.pow(n,4);},quartOut:function(n){return -1*(Math.pow(n-1,4)-1);},quartInOut:function(n){n=n*2;if(n<1){return Math.pow(n,4)/2;}n-=2;return -1/2*(Math.pow(n,4)-2);},quintIn:function(n){return Math.pow(n,5);},quintOut:function(n){return Math.pow(n-1,5)+1;},quintInOut:function(n){n=n*2;if(n<1){return Math.pow(n,5)/2;}n-=2;return (Math.pow(n,5)+2)/2;},sineIn:function(n){return -1*Math.cos(n*(Math.PI/2))+1;},sineOut:function(n){return Math.sin(n*(Math.PI/2));},sineInOut:function(n){return -1*(Math.cos(Math.PI*n)-1)/2;},expoIn:function(n){return (n==0)?0:Math.pow(2,10*(n-1));},expoOut:function(n){return (n==1)?1:(-1*Math.pow(2,-10*n)+1);},expoInOut:function(n){if(n==0){return 0;}if(n==1){return 1;}n=n*2;if(n<1){return Math.pow(2,10*(n-1))/2;}--n;return (-1*Math.pow(2,-10*n)+2)/2;},circIn:function(n){return -1*(Math.sqrt(1-Math.pow(n,2))-1);},circOut:function(n){n=n-1;return Math.sqrt(1-Math.pow(n,2));},circInOut:function(n){n=n*2;if(n<1){return -1/2*(Math.sqrt(1-Math.pow(n,2))-1);}n-=2;return 1/2*(Math.sqrt(1-Math.pow(n,2))+1);},backIn:function(n){var s=1.70158;return Math.pow(n,2)*((s+1)*n-s);},backOut:function(n){n=n-1;var s=1.70158;return Math.pow(n,2)*((s+1)*n+s)+1;},backInOut:function(n){var s=1.70158*1.525;n=n*2;if(n<1){return (Math.pow(n,2)*((s+1)*n-s))/2;}n-=2;return (Math.pow(n,2)*((s+1)*n+s)+2)/2;},elasticIn:function(n){if(n==0||n==1){return n;}var p=0.3;var s=p/4;n=n-1;return -1*Math.pow(2,10*n)*Math.sin((n-s)*(2*Math.PI)/p);},elasticOut:function(n){if(n==0||n==1){return n;}var p=0.3;var s=p/4;return Math.pow(2,-10*n)*Math.sin((n-s)*(2*Math.PI)/p)+1;},elasticInOut:function(n){if(n==0){return 0;}n=n*2;if(n==2){return 1;}var p=0.3*1.5;var s=p/4;if(n<1){n-=1;return -0.5*(Math.pow(2,10*n)*Math.sin((n-s)*(2*Math.PI)/p));}n-=1;return 0.5*(Math.pow(2,-10*n)*Math.sin((n-s)*(2*Math.PI)/p))+1;},bounceIn:function(n){return (1-dojo.fx.easing.bounceOut(1-n));},bounceOut:function(n){var s=7.5625;var p=2.75;var l;if(n<(1/p)){l=s*Math.pow(n,2);}else{if(n<(2/p)){n-=(1.5/p);l=s*Math.pow(n,2)+0.75;}else{if(n<(2.5/p)){n-=(2.25/p);l=s*Math.pow(n,2)+0.9375;}else{n-=(2.625/p);l=s*Math.pow(n,2)+0.984375;}}}return l;},bounceInOut:function(n){if(n<0.5){return dojo.fx.easing.bounceIn(n*2)/2;}return (dojo.fx.easing.bounceOut(n*2-1)/2)+0.5;}};}if(!dojo._hasResource["dojox.mobile.app.ImageView"]){dojo._hasResource["dojox.mobile.app.ImageView"]=true;dojo.provide("dojox.mobile.app.ImageView");dojo.experimental("dojox.mobile.app.ImageView");dojo.declare("dojox.mobile.app.ImageView",dojox.mobile.app._Widget,{zoom:1,zoomCenterX:0,zoomCenterY:0,maxZoom:5,autoZoomLevel:3,disableAutoZoom:false,disableSwipe:false,autoZoomEvent:null,_leftImg:null,_centerImg:null,_rightImg:null,_leftSmallImg:null,_centerSmallImg:null,_rightSmallImg:null,constructor:function(){this.panX=0;this.panY=0;this.handleLoad=dojo.hitch(this,this.handleLoad);this._updateAnimatedZoom=dojo.hitch(this,this._updateAnimatedZoom);this._updateAnimatedPan=dojo.hitch(this,this._updateAnimatedPan);this._onAnimPanEnd=dojo.hitch(this,this._onAnimPanEnd);},buildRendering:function(){this.inherited(arguments);this.canvas=dojo.create("canvas",{},this.domNode);dojo.addClass(this.domNode,"mblImageView");},postCreate:function(){this.inherited(arguments);this.size=dojo.marginBox(this.domNode);dojo.style(this.canvas,{width:this.size.w+"px",height:this.size.h+"px"});this.canvas.height=this.size.h;this.canvas.width=this.size.w;var _23f=this;this.connect(this.domNode,"onmousedown",function(_240){if(_23f.isAnimating()){return;}if(_23f.panX){_23f.handleDragEnd();}_23f.downX=_240.targetTouches?_240.targetTouches[0].clientX:_240.clientX;_23f.downY=_240.targetTouches?_240.targetTouches[0].clientY:_240.clientY;});this.connect(this.domNode,"onmousemove",function(_241){if(_23f.isAnimating()){return;}if((!_23f.downX&&_23f.downX!==0)||(!_23f.downY&&_23f.downY!==0)){return;}if((!_23f.disableSwipe&&_23f.zoom==1)||(!_23f.disableAutoZoom&&_23f.zoom!=1)){var x=_241.targetTouches?_241.targetTouches[0].clientX:_241.pageX;var y=_241.targetTouches?_241.targetTouches[0].clientY:_241.pageY;_23f.panX=x-_23f.downX;_23f.panY=y-_23f.downY;if(_23f.zoom==1){if(Math.abs(_23f.panX)>10){_23f.render();}}else{if(Math.abs(_23f.panX)>10||Math.abs(_23f.panY)>10){_23f.render();}}}});this.connect(this.domNode,"onmouseout",function(_242){if(!_23f.isAnimating()&&_23f.panX){_23f.handleDragEnd();}});this.connect(this.domNode,"onmouseover",function(_243){_23f.downX=_23f.downY=null;});this.connect(this.domNode,"onclick",function(_244){if(_23f.isAnimating()){return;}if(_23f.downX==null||_23f.downY==null){return;}var x=(_244.targetTouches?_244.targetTouches[0].clientX:_244.pageX);var y=(_244.targetTouches?_244.targetTouches[0].clientY:_244.pageY);if(Math.abs(_23f.panX)>14||Math.abs(_23f.panY)>14){_23f.downX=_23f.downY=null;_23f.handleDragEnd();return;}_23f.downX=_23f.downY=null;if(!_23f.disableAutoZoom){if(!_23f._centerImg||!_23f._centerImg._loaded){return;}if(_23f.zoom!=1){_23f.set("animatedZoom",1);return;}var pos=dojo._abs(_23f.domNode);var _245=_23f.size.w/_23f._centerImg.width;var _246=_23f.size.h/_23f._centerImg.height;_23f.zoomTo(((x-pos.x)/_245)-_23f.panX,((y-pos.y)/_246)-_23f.panY,_23f.autoZoomLevel);}});dojo.connect(this.domNode,"flick",this,"handleFlick");},isAnimating:function(){return this._anim&&this._anim.status()=="playing";},handleDragEnd:function(){this.downX=this.downY=null;if(this.zoom==1){if(!this.panX){return;}var _247=(this._leftImg&&this._leftImg._loaded)||(this._leftSmallImg&&this._leftSmallImg._loaded);var _248=(this._rightImg&&this._rightImg._loaded)||(this._rightSmallImg&&this._rightSmallImg._loaded);var _249=!(Math.abs(this.panX)<this._centerImg._baseWidth/2)&&((this.panX>0&&_247?1:0)||(this.panX<0&&_248?1:0));if(!_249){this._animPanTo(0,dojo.fx.easing.expoOut,700);}else{this.moveTo(this.panX);}}else{if(!this.panX&&!this.panY){return;}this.zoomCenterX-=(this.panX/this.zoom);this.zoomCenterY-=(this.panY/this.zoom);this.panX=this.panY=0;}},handleFlick:function(_24a){if(this.zoom==1&&_24a.duration<500){if(_24a.direction=="ltr"){this.moveTo(1);}else{if(_24a.direction=="rtl"){this.moveTo(-1);}}this.downX=this.downY=null;}},moveTo:function(_24b){_24b=_24b>0?1:-1;var _24c;if(_24b<1){if(this._rightImg&&this._rightImg._loaded){_24c=this._rightImg;}else{if(this._rightSmallImg&&this._rightSmallImg._loaded){_24c=this._rightSmallImg;}}}else{if(this._leftImg&&this._leftImg._loaded){_24c=this._leftImg;}else{if(this._leftSmallImg&&this._leftSmallImg._loaded){_24c=this._leftSmallImg;}}}this._moveDir=_24b;var _24d=this;if(_24c&&_24c._loaded){this._animPanTo(this.size.w*_24b,null,500,function(){_24d.panX=0;_24d.panY=0;if(_24b<0){_24d._switchImage("left","right");}else{_24d._switchImage("right","left");}_24d.render();_24d.onChange(_24b*-1);});}else{this._animPanTo(0,dojo.fx.easing.expoOut,700);}},_switchImage:function(_24e,_24f){var _250="_"+_24e+"SmallImg";var _251="_"+_24e+"Img";var _252="_"+_24f+"SmallImg";var _253="_"+_24f+"Img";this[_251]=this._centerImg;this[_250]=this._centerSmallImg;this[_251]._type=_24e;if(this[_250]){this[_250]._type=_24e;}this._centerImg=this[_253];this._centerSmallImg=this[_252];this._centerImg._type="center";if(this._centerSmallImg){this._centerSmallImg._type="center";}this[_253]=this[_252]=null;},_animPanTo:function(to,_254,_255,_256){this._animCallback=_256;this._anim=new dojo.Animation({curve:[this.panX,to],onAnimate:this._updateAnimatedPan,duration:_255||500,easing:_254,onEnd:this._onAnimPanEnd});this._anim.play();return this._anim;},onChange:function(_257){},_updateAnimatedPan:function(_258){this.panX=_258;this.render();},_onAnimPanEnd:function(){this.panX=this.panY=0;if(this._animCallback){this._animCallback();}},zoomTo:function(_259,_25a,zoom){this.set("zoomCenterX",_259);this.set("zoomCenterY",_25a);this.set("animatedZoom",zoom);},render:function(){var cxt=this.canvas.getContext("2d");cxt.clearRect(0,0,this.canvas.width,this.canvas.height);this._renderImg(this._centerSmallImg,this._centerImg,this.zoom==1?(this.panX<0?1:this.panX>0?-1:0):0);if(this.zoom==1&&this.panX!=0){if(this.panX>0){this._renderImg(this._leftSmallImg,this._leftImg,1);}else{this._renderImg(this._rightSmallImg,this._rightImg,-1);}}},_renderImg:function(_25b,_25c,_25d){var img=(_25c&&_25c._loaded)?_25c:_25b;if(!img||!img._loaded){return;}var cxt=this.canvas.getContext("2d");var _25e=img._baseWidth;var _25f=img._baseHeight;var _260=_25e*this.zoom;var _261=_25f*this.zoom;var _262=Math.min(this.size.w,_260);var _263=Math.min(this.size.h,_261);var _264=this.dispWidth=img.width*(_262/_260);var _265=this.dispHeight=img.height*(_263/_261);var _266=this.zoomCenterX-(this.panX/this.zoom);var _267=this.zoomCenterY-(this.panY/this.zoom);var _268=Math.floor(Math.max(_264/2,Math.min(img.width-_264/2,_266)));var _269=Math.floor(Math.max(_265/2,Math.min(img.height-_265/2,_267)));var _26a=Math.max(0,Math.round((img.width-_264)/2+(_268-img._centerX)));var _26b=Math.max(0,Math.round((img.height-_265)/2+(_269-img._centerY)));var _26c=Math.round(Math.max(0,this.canvas.width-_262)/2);var _26d=Math.round(Math.max(0,this.canvas.height-_263)/2);var _26e=_262;var _26f=_264;if(this.zoom==1&&_25d&&this.panX){if(this.panX<0){if(_25d>0){_262-=Math.abs(this.panX);_26c=0;}else{if(_25d<0){_262=Math.max(1,Math.abs(this.panX)-5);_26c=this.size.w-_262;}}}else{if(_25d>0){_262=Math.max(1,Math.abs(this.panX)-5);_26c=0;}else{if(_25d<0){_262-=Math.abs(this.panX);_26c=this.size.w-_262;}}}_264=Math.max(1,Math.floor(_264*(_262/_26e)));if(_25d>0){_26a=(_26a+_26f)-(_264);}_26a=Math.floor(_26a);}try{cxt.drawImage(img,Math.max(0,_26a),_26b,Math.min(_26f,_264),_265,_26c,_26d,Math.min(_26e,_262),_263);}catch(e){}},_setZoomAttr:function(_270){this.zoom=Math.min(this.maxZoom,Math.max(1,_270));if(this.zoom==1&&this._centerImg&&this._centerImg._loaded){if(!this.isAnimating()){this.zoomCenterX=this._centerImg.width/2;this.zoomCenterY=this._centerImg.height/2;}this.panX=this.panY=0;}this.render();},_setZoomCenterXAttr:function(_271){if(_271!=this.zoomCenterX){if(this._centerImg&&this._centerImg._loaded){_271=Math.min(this._centerImg.width,_271);}this.zoomCenterX=Math.max(0,Math.round(_271));}},_setZoomCenterYAttr:function(_272){if(_272!=this.zoomCenterY){if(this._centerImg&&this._centerImg._loaded){_272=Math.min(this._centerImg.height,_272);}this.zoomCenterY=Math.max(0,Math.round(_272));}},_setZoomCenterAttr:function(_273){if(_273.x!=this.zoomCenterX||_273.y!=this.zoomCenterY){this.set("zoomCenterX",_273.x);this.set("zoomCenterY",_273.y);this.render();}},_setAnimatedZoomAttr:function(_274){if(this._anim&&this._anim.status()=="playing"){return;}this._anim=new dojo.Animation({curve:[this.zoom,_274],onAnimate:this._updateAnimatedZoom,onEnd:this._onAnimEnd});this._anim.play();},_updateAnimatedZoom:function(_275){this._setZoomAttr(_275);},_setCenterUrlAttr:function(_276){this._setImage("center",_276);},_setLeftUrlAttr:function(_277){this._setImage("left",_277);},_setRightUrlAttr:function(_278){this._setImage("right",_278);},_setImage:function(name,_279){var _27a=null;var _27b=null;if(dojo.isString(_279)){_27b=_279;}else{_27b=_279.large;_27a=_279.small;}if(this["_"+name+"Img"]&&this["_"+name+"Img"]._src==_27b){return;}var _27c=this["_"+name+"Img"]=new Image();_27c._type=name;_27c._loaded=false;_27c._src=_27b;_27c._conn=dojo.connect(_27c,"onload",this.handleLoad);if(_27a){var _27d=this["_"+name+"SmallImg"]=new Image();_27d._type=name;_27d._loaded=false;_27d._conn=dojo.connect(_27d,"onload",this.handleLoad);_27d._isSmall=true;_27d._src=_27a;_27d.src=_27a;}_27c.src=_27b;},handleLoad:function(evt){var img=evt.target;img._loaded=true;dojo.disconnect(img._conn);var type=img._type;switch(type){case "center":this.zoomCenterX=img.width/2;this.zoomCenterY=img.height/2;break;}var _27e=img.height;var _27f=img.width;if(_27f/this.size.w<_27e/this.size.h){img._baseHeight=this.canvas.height;img._baseWidth=_27f/(_27e/this.size.h);}else{img._baseWidth=this.canvas.width;img._baseHeight=_27e/(_27f/this.size.w);}img._centerX=_27f/2;img._centerY=_27e/2;this.render();this.onLoad(img._type,img._src,img._isSmall);},onLoad:function(type,url,_280){}});}if(!dojo._hasResource["dojox.mobile.app.ImageThumbView"]){dojo._hasResource["dojox.mobile.app.ImageThumbView"]=true;dojo.provide("dojox.mobile.app.ImageThumbView");dojo.experimental("dojox.mobile.app.ImageThumbView");dojo.declare("dojox.mobile.app.ImageThumbView",dijit._WidgetBase,{items:[],urlParam:"url",labelParam:null,itemTemplate:"<div class=\"mblThumbInner\">"+"<div class=\"mblThumbOverlay\"></div>"+"<div class=\"mblThumbMask\">"+"<div class=\"mblThumbSrc\" style=\"background-image:url(${url})\"></div>"+"</div>"+"</div>",minPadding:4,maxPerRow:3,maxRows:-1,baseClass:"mblImageThumbView",thumbSize:"medium",animationEnabled:true,selectedIndex:-1,cache:null,cacheMustMatch:false,clickEvent:"onclick",cacheBust:false,disableHide:false,constructor:function(_281,node){},postCreate:function(){this.inherited(arguments);var _282=this;var _283="mblThumbHover";this.addThumb=dojo.hitch(this,this.addThumb);this.handleImgLoad=dojo.hitch(this,this.handleImgLoad);this.hideCached=dojo.hitch(this,this.hideCached);this._onLoadImages={};this.cache=[];this.visibleImages=[];this._cacheCounter=0;this.connect(this.domNode,this.clickEvent,function(_284){var _285=_282._getItemNodeFromEvent(_284);if(_285&&!_285._cached){_282.onSelect(_285._item,_285._index,_282.items);dojo.query(".selected",this.domNode).removeClass("selected");dojo.addClass(_285,"selected");}});dojo.addClass(this.domNode,this.thumbSize);this.resize();this.render();},onSelect:function(item,_286,_287){},_setAnimationEnabledAttr:function(_288){this.animationEnabled=_288;dojo[_288?"addClass":"removeClass"](this.domNode,"animated");},_setItemsAttr:function(_289){this.items=_289||[];var urls={};var i;for(i=0;i<this.items.length;i++){urls[this.items[i][this.urlParam]]=1;}var _28a=[];for(var url in this._onLoadImages){if(!urls[url]&&this._onLoadImages[url]._conn){dojo.disconnect(this._onLoadImages[url]._conn);this._onLoadImages[url].src=null;_28a.push(url);}}for(i=0;i<_28a.length;i++){delete this._onLoadImages[url];}this.render();},_getItemNode:function(node){while(node&&!dojo.hasClass(node,"mblThumb")&&node!=this.domNode){node=node.parentNode;}return (node==this.domNode)?null:node;},_getItemNodeFromEvent:function(_28b){if(_28b.touches&&_28b.touches.length>0){_28b=_28b.touches[0];}return this._getItemNode(_28b.target);},resize:function(){this._thumbSize=null;this._size=dojo.contentBox(this.domNode);this.disableHide=true;this.render();this.disableHide=false;},hideCached:function(){for(var i=0;i<this.cache.length;i++){if(this.cache[i]){dojo.style(this.cache[i],"display","none");}}},render:function(){var i;var url;var item;var _28c;while(this.visibleImages&&this.visibleImages.length>0){_28c=this.visibleImages.pop();this.cache.push(_28c);if(!this.disableHide){dojo.addClass(_28c,"hidden");}_28c._cached=true;}if(this.cache&&this.cache.length>0){setTimeout(this.hideCached,1000);}if(!this.items||this.items.length==0){return;}for(i=0;i<this.items.length;i++){item=this.items[i];url=(dojo.isString(item)?item:item[this.urlParam]);this.addThumb(item,url,i);if(this.maxRows>0&&(i+1)/this.maxPerRow>=this.maxRows){break;}}if(!this._thumbSize){return;}var _28d=0;var row=-1;var _28e=this._thumbSize.w+(this.padding*2);var _28f=this._thumbSize.h+(this.padding*2);var _290=this.thumbNodes=dojo.query(".mblThumb",this.domNode);var pos=0;_290=this.visibleImages;for(i=0;i<_290.length;i++){if(_290[i]._cached){continue;}if(pos%this.maxPerRow==0){row++;}_28d=pos%this.maxPerRow;this.place(_290[i],(_28d*_28e)+this.padding,(row*_28f)+this.padding);if(!_290[i]._loading){dojo.removeClass(_290[i],"hidden");}if(pos==this.selectedIndex){dojo[pos==this.selectedIndex?"addClass":"removeClass"](_290[i],"selected");}pos++;}var _291=Math.ceil(pos/this.maxPerRow);this._numRows=_291;this.setContainerHeight((_291*(this._thumbSize.h+this.padding*2)));},setContainerHeight:function(_292){dojo.style(this.domNode,"height",_292+"px");},addThumb:function(item,url,_293){var _294;var _295=false;if(this.cache.length>0){var _296=false;for(var i=0;i<this.cache.length;i++){if(this.cache[i]._url==url){_294=this.cache.splice(i,1)[0];_296=true;break;}}if(!_294&&!this.cacheMustMatch){_294=this.cache.pop();dojo.removeClass(_294,"selected");}else{_295=true;}}if(!_294){_294=dojo.create("div",{"class":"mblThumb hidden",innerHTML:dojo.string.substitute(this.itemTemplate,{url:url},null,this)},this.domNode);}if(this.labelParam){var _297=dojo.query(".mblThumbLabel",_294)[0];if(!_297){_297=dojo.create("div",{"class":"mblThumbLabel"},_294);}_297.innerHTML=item[this.labelParam]||"";}dojo.style(_294,"display","");if(!this.disableHide){dojo.addClass(_294,"hidden");}if(!_295){var _298=dojo.create("img",{});_298._thumbDiv=_294;_298._conn=dojo.connect(_298,"onload",this.handleImgLoad);_298._url=url;_294._loading=true;this._onLoadImages[url]=_298;if(_298){_298.src=url;}}this.visibleImages.push(_294);_294._index=_293;_294._item=item;_294._url=url;_294._cached=false;if(!this._thumbSize){this._thumbSize=dojo.marginBox(_294);if(this._thumbSize.h==0){this._thumbSize.h=100;this._thumbSize.w=100;}if(this.labelParam){this._thumbSize.h+=8;}this.calcPadding();}},handleImgLoad:function(_299){var img=_299.target;dojo.disconnect(img._conn);dojo.removeClass(img._thumbDiv,"hidden");img._thumbDiv._loading=false;img._conn=null;var url=img._url;if(this.cacheBust){url+=(url.indexOf("?")>-1?"&":"?")+"cacheBust="+(new Date()).getTime()+"_"+(this._cacheCounter++);}dojo.query(".mblThumbSrc",img._thumbDiv).style("backgroundImage","url("+url+")");delete this._onLoadImages[img._url];},calcPadding:function(){var _29a=this._size.w;var _29b=this._thumbSize.w;var _29c=_29b+this.minPadding;this.maxPerRow=Math.floor(_29a/_29c);this.padding=Math.floor((_29a-(_29b*this.maxPerRow))/(this.maxPerRow*2));},place:function(node,x,y){dojo.style(node,{"-webkit-transform":"translate("+x+"px,"+y+"px)"});},destroy:function(){var img;var _29d=0;for(var url in this._onLoadImages){img=this._onLoadImages[url];if(img){img.src=null;_29d++;}}this.inherited(arguments);}});}if(!dojo._hasResource["dojox.mobile.app._base"]){dojo._hasResource["dojox.mobile.app._base"]=true;dojo.provide("dojox.mobile.app._base");dojo.experimental("dojox.mobile.app._base");(function(){var _29e;var _29f;var _2a0=["dojox.mobile","dojox.mobile.parser"];var _2a1={};var _2a2;var _2a3;var _2a4=[];function _2a5(_2a6,_2a7){var _2a8;var url;do{_2a8=_2a6.pop();if(_2a8.source){url=_2a8.source;}else{if(_2a8.module){url=dojo.baseUrl+dojo._getModuleSymbols(_2a8.module).join("/")+".js";}else{alert("Error: invalid JavaScript resource "+dojo.toJson(_2a8));return;}}}while(_2a6.length>0&&_2a1[url]);if(_2a6.length<1&&_2a1[url]){_2a7();return;}dojo.xhrGet({url:url,sync:false}).addCallbacks(function(text){dojo["eval"](text);_2a1[url]=true;if(_2a6.length>0){_2a5(_2a6,_2a7);}else{_2a7();}},function(){alert("Failed to load resource "+url);});};var _2a9=function(){_29e=new dojox.mobile.app.StageController(_2a3);var _2aa={id:"com.test.app",version:"1.0.0",initialScene:"main"};if(dojo.global["appInfo"]){dojo.mixin(_2aa,dojo.global["appInfo"]);}_29f=dojox.mobile.app.info=_2aa;if(_29f.title){var _2ab=dojo.query("head title")[0]||dojo.create("title",{},dojo.query("head")[0]);document.title=_29f.title;}_29e.pushScene(_29f.initialScene);};var _2ac=function(){var _2ad=false;if(dojo.global.BackButton){BackButton.override();dojo.connect(document,"backKeyDown",function(e){dojo.publish("/dojox/mobile/app/goback");});_2ad=true;}else{if(dojo.global.Mojo){}}if(_2ad){dojo.addClass(dojo.body(),"mblNativeBack");}};dojo.mixin(dojox.mobile.app,{init:function(node){_2a3=node||dojo.body();dojox.mobile.app.STAGE_CONTROLLER_ACTIVE=true;dojo.subscribe("/dojox/mobile/app/goback",function(){_29e.popScene();});dojo.subscribe("/dojox/mobile/app/alert",function(_2ae){dojox.mobile.app.getActiveSceneController().showAlertDialog(_2ae);});dojo.subscribe("/dojox/mobile/app/pushScene",function(_2af,_2b0){_29e.pushScene(_2af,_2b0||{});});dojo.xhrGet({url:"view-resources.json",load:function(data){var _2b1=[];if(data){_2a4=data=dojo.fromJson(data);for(var i=0;i<data.length;i++){if(!data[i].scene){_2b1.push(data[i]);}}}if(_2b1.length>0){_2a5(_2b1,_2a9);}else{_2a9();}},error:_2a9});_2ac();},getActiveSceneController:function(){return _29e.getActiveSceneController();},getStageController:function(){return _29e;},loadResources:function(_2b2,_2b3){_2a5(_2b2,_2b3);},loadResourcesForScene:function(_2b4,_2b5){var _2b6=[];for(var i=0;i<_2a4.length;i++){if(_2a4[i].scene==_2b4){_2b6.push(_2a4[i]);}}if(_2b6.length>0){_2a5(_2b6,_2b5);}else{_2b5();}},resolveTemplate:function(_2b7){return "app/views/"+_2b7+"/"+_2b7+"-scene.html";},resolveAssistant:function(_2b8){return "app/assistants/"+_2b8+"-assistant.js";}});})();}if(!dojo._hasResource["dojox.mobileApp"]){dojo._hasResource["dojox.mobileApp"]=true;dojo.provide("dojox.mobileApp");}
diff --git a/js/dojo-1.6/dojox/mobile/app.js.uncompressed.js b/js/dojo-1.6/dojox/mobile/app.js.uncompressed.js
new file mode 100644
index 0000000..5acde1c
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app.js.uncompressed.js
@@ -0,0 +1,9278 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+/*
+ This is an optimized version of Dojo, built for deployment and not for
+ development. To get sources and documentation, please visit:
+
+ http://dojotoolkit.org
+*/
+
+if(!dojo._hasResource["dojo.window"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.window"] = true;
+dojo.provide("dojo.window");
+
+
+dojo.getObject("window", true, dojo);
+
+dojo.window.getBox = function(){
+ // summary:
+ // Returns the dimensions and scroll position of the viewable area of a browser window
+
+ var scrollRoot = (dojo.doc.compatMode == 'BackCompat') ? dojo.body() : dojo.doc.documentElement;
+
+ // get scroll position
+ var scroll = dojo._docScroll(); // scrollRoot.scrollTop/Left should work
+ return { w: scrollRoot.clientWidth, h: scrollRoot.clientHeight, l: scroll.x, t: scroll.y };
+};
+
+dojo.window.get = function(doc){
+ // summary:
+ // Get window object associated with document doc
+
+ // In some IE versions (at least 6.0), document.parentWindow does not return a
+ // reference to the real window object (maybe a copy), so we must fix it as well
+ // We use IE specific execScript to attach the real window reference to
+ // document._parentWindow for later use
+ if(dojo.isIE && window !== document.parentWindow){
+ /*
+ In IE 6, only the variable "window" can be used to connect events (others
+ may be only copies).
+ */
+ doc.parentWindow.execScript("document._parentWindow = window;", "Javascript");
+ //to prevent memory leak, unset it after use
+ //another possibility is to add an onUnload handler which seems overkill to me (liucougar)
+ var win = doc._parentWindow;
+ doc._parentWindow = null;
+ return win; // Window
+ }
+
+ return doc.parentWindow || doc.defaultView; // Window
+};
+
+dojo.window.scrollIntoView = function(/*DomNode*/ node, /*Object?*/ pos){
+ // summary:
+ // Scroll the passed node into view, if it is not already.
+
+ // don't rely on node.scrollIntoView working just because the function is there
+
+ try{ // catch unexpected/unrecreatable errors (#7808) since we can recover using a semi-acceptable native method
+ node = dojo.byId(node);
+ var doc = node.ownerDocument || dojo.doc,
+ body = doc.body || dojo.body(),
+ html = doc.documentElement || body.parentNode,
+ isIE = dojo.isIE, isWK = dojo.isWebKit;
+ // if an untested browser, then use the native method
+ if((!(dojo.isMoz || isIE || isWK || dojo.isOpera) || node == body || node == html) && (typeof node.scrollIntoView != "undefined")){
+ node.scrollIntoView(false); // short-circuit to native if possible
+ return;
+ }
+ var backCompat = doc.compatMode == 'BackCompat',
+ clientAreaRoot = backCompat? body : html,
+ scrollRoot = isWK ? body : clientAreaRoot,
+ rootWidth = clientAreaRoot.clientWidth,
+ rootHeight = clientAreaRoot.clientHeight,
+ rtl = !dojo._isBodyLtr(),
+ nodePos = pos || dojo.position(node),
+ el = node.parentNode,
+ isFixed = function(el){
+ return ((isIE <= 6 || (isIE && backCompat))? false : (dojo.style(el, 'position').toLowerCase() == "fixed"));
+ };
+ if(isFixed(node)){ return; } // nothing to do
+
+ while(el){
+ if(el == body){ el = scrollRoot; }
+ var elPos = dojo.position(el),
+ fixedPos = isFixed(el);
+
+ if(el == scrollRoot){
+ elPos.w = rootWidth; elPos.h = rootHeight;
+ if(scrollRoot == html && isIE && rtl){ elPos.x += scrollRoot.offsetWidth-elPos.w; } // IE workaround where scrollbar causes negative x
+ if(elPos.x < 0 || !isIE){ elPos.x = 0; } // IE can have values > 0
+ if(elPos.y < 0 || !isIE){ elPos.y = 0; }
+ }else{
+ var pb = dojo._getPadBorderExtents(el);
+ elPos.w -= pb.w; elPos.h -= pb.h; elPos.x += pb.l; elPos.y += pb.t;
+ }
+
+ if(el != scrollRoot){ // body, html sizes already have the scrollbar removed
+ var clientSize = el.clientWidth,
+ scrollBarSize = elPos.w - clientSize;
+ if(clientSize > 0 && scrollBarSize > 0){
+ elPos.w = clientSize;
+ if(isIE && rtl){ elPos.x += scrollBarSize; }
+ }
+ clientSize = el.clientHeight;
+ scrollBarSize = elPos.h - clientSize;
+ if(clientSize > 0 && scrollBarSize > 0){
+ elPos.h = clientSize;
+ }
+ }
+ if(fixedPos){ // bounded by viewport, not parents
+ if(elPos.y < 0){
+ elPos.h += elPos.y; elPos.y = 0;
+ }
+ if(elPos.x < 0){
+ elPos.w += elPos.x; elPos.x = 0;
+ }
+ if(elPos.y + elPos.h > rootHeight){
+ elPos.h = rootHeight - elPos.y;
+ }
+ if(elPos.x + elPos.w > rootWidth){
+ elPos.w = rootWidth - elPos.x;
+ }
+ }
+ // calculate overflow in all 4 directions
+ var l = nodePos.x - elPos.x, // beyond left: < 0
+ t = nodePos.y - Math.max(elPos.y, 0), // beyond top: < 0
+ r = l + nodePos.w - elPos.w, // beyond right: > 0
+ bot = t + nodePos.h - elPos.h; // beyond bottom: > 0
+ if(r * l > 0){
+ var s = Math[l < 0? "max" : "min"](l, r);
+ nodePos.x += el.scrollLeft;
+ el.scrollLeft += (isIE >= 8 && !backCompat && rtl)? -s : s;
+ nodePos.x -= el.scrollLeft;
+ }
+ if(bot * t > 0){
+ nodePos.y += el.scrollTop;
+ el.scrollTop += Math[t < 0? "max" : "min"](t, bot);
+ nodePos.y -= el.scrollTop;
+ }
+ el = (el != scrollRoot) && !fixedPos && el.parentNode;
+ }
+ }catch(error){
+ console.error('scrollIntoView: ' + error);
+ node.scrollIntoView(false);
+ }
+};
+
+}
+
+if(!dojo._hasResource["dijit._base.manager"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.manager"] = true;
+dojo.provide("dijit._base.manager");
+
+
+
+dojo.declare("dijit.WidgetSet", null, {
+ // summary:
+ // A set of widgets indexed by id. A default instance of this class is
+ // available as `dijit.registry`
+ //
+ // example:
+ // Create a small list of widgets:
+ // | var ws = new dijit.WidgetSet();
+ // | ws.add(dijit.byId("one"));
+ // | ws.add(dijit.byId("two"));
+ // | // destroy both:
+ // | ws.forEach(function(w){ w.destroy(); });
+ //
+ // example:
+ // Using dijit.registry:
+ // | dijit.registry.forEach(function(w){ /* do something */ });
+
+ constructor: function(){
+ this._hash = {};
+ this.length = 0;
+ },
+
+ add: function(/*dijit._Widget*/ widget){
+ // summary:
+ // Add a widget to this list. If a duplicate ID is detected, a error is thrown.
+ //
+ // widget: dijit._Widget
+ // Any dijit._Widget subclass.
+ if(this._hash[widget.id]){
+ throw new Error("Tried to register widget with id==" + widget.id + " but that id is already registered");
+ }
+ this._hash[widget.id] = widget;
+ this.length++;
+ },
+
+ remove: function(/*String*/ id){
+ // summary:
+ // Remove a widget from this WidgetSet. Does not destroy the widget; simply
+ // removes the reference.
+ if(this._hash[id]){
+ delete this._hash[id];
+ this.length--;
+ }
+ },
+
+ forEach: function(/*Function*/ func, /* Object? */thisObj){
+ // summary:
+ // Call specified function for each widget in this set.
+ //
+ // func:
+ // A callback function to run for each item. Is passed the widget, the index
+ // in the iteration, and the full hash, similar to `dojo.forEach`.
+ //
+ // thisObj:
+ // An optional scope parameter
+ //
+ // example:
+ // Using the default `dijit.registry` instance:
+ // | dijit.registry.forEach(function(widget){
+ // | console.log(widget.declaredClass);
+ // | });
+ //
+ // returns:
+ // Returns self, in order to allow for further chaining.
+
+ thisObj = thisObj || dojo.global;
+ var i = 0, id;
+ for(id in this._hash){
+ func.call(thisObj, this._hash[id], i++, this._hash);
+ }
+ return this; // dijit.WidgetSet
+ },
+
+ filter: function(/*Function*/ filter, /* Object? */thisObj){
+ // summary:
+ // Filter down this WidgetSet to a smaller new WidgetSet
+ // Works the same as `dojo.filter` and `dojo.NodeList.filter`
+ //
+ // filter:
+ // Callback function to test truthiness. Is passed the widget
+ // reference and the pseudo-index in the object.
+ //
+ // thisObj: Object?
+ // Option scope to use for the filter function.
+ //
+ // example:
+ // Arbitrary: select the odd widgets in this list
+ // | dijit.registry.filter(function(w, i){
+ // | return i % 2 == 0;
+ // | }).forEach(function(w){ /* odd ones */ });
+
+ thisObj = thisObj || dojo.global;
+ var res = new dijit.WidgetSet(), i = 0, id;
+ for(id in this._hash){
+ var w = this._hash[id];
+ if(filter.call(thisObj, w, i++, this._hash)){
+ res.add(w);
+ }
+ }
+ return res; // dijit.WidgetSet
+ },
+
+ byId: function(/*String*/ id){
+ // summary:
+ // Find a widget in this list by it's id.
+ // example:
+ // Test if an id is in a particular WidgetSet
+ // | var ws = new dijit.WidgetSet();
+ // | ws.add(dijit.byId("bar"));
+ // | var t = ws.byId("bar") // returns a widget
+ // | var x = ws.byId("foo"); // returns undefined
+
+ return this._hash[id]; // dijit._Widget
+ },
+
+ byClass: function(/*String*/ cls){
+ // summary:
+ // Reduce this widgetset to a new WidgetSet of a particular `declaredClass`
+ //
+ // cls: String
+ // The Class to scan for. Full dot-notated string.
+ //
+ // example:
+ // Find all `dijit.TitlePane`s in a page:
+ // | dijit.registry.byClass("dijit.TitlePane").forEach(function(tp){ tp.close(); });
+
+ var res = new dijit.WidgetSet(), id, widget;
+ for(id in this._hash){
+ widget = this._hash[id];
+ if(widget.declaredClass == cls){
+ res.add(widget);
+ }
+ }
+ return res; // dijit.WidgetSet
+},
+
+ toArray: function(){
+ // summary:
+ // Convert this WidgetSet into a true Array
+ //
+ // example:
+ // Work with the widget .domNodes in a real Array
+ // | dojo.map(dijit.registry.toArray(), function(w){ return w.domNode; });
+
+ var ar = [];
+ for(var id in this._hash){
+ ar.push(this._hash[id]);
+ }
+ return ar; // dijit._Widget[]
+},
+
+ map: function(/* Function */func, /* Object? */thisObj){
+ // summary:
+ // Create a new Array from this WidgetSet, following the same rules as `dojo.map`
+ // example:
+ // | var nodes = dijit.registry.map(function(w){ return w.domNode; });
+ //
+ // returns:
+ // A new array of the returned values.
+ return dojo.map(this.toArray(), func, thisObj); // Array
+ },
+
+ every: function(func, thisObj){
+ // summary:
+ // A synthetic clone of `dojo.every` acting explicitly on this WidgetSet
+ //
+ // func: Function
+ // A callback function run for every widget in this list. Exits loop
+ // when the first false return is encountered.
+ //
+ // thisObj: Object?
+ // Optional scope parameter to use for the callback
+
+ thisObj = thisObj || dojo.global;
+ var x = 0, i;
+ for(i in this._hash){
+ if(!func.call(thisObj, this._hash[i], x++, this._hash)){
+ return false; // Boolean
+ }
+ }
+ return true; // Boolean
+ },
+
+ some: function(func, thisObj){
+ // summary:
+ // A synthetic clone of `dojo.some` acting explictly on this WidgetSet
+ //
+ // func: Function
+ // A callback function run for every widget in this list. Exits loop
+ // when the first true return is encountered.
+ //
+ // thisObj: Object?
+ // Optional scope parameter to use for the callback
+
+ thisObj = thisObj || dojo.global;
+ var x = 0, i;
+ for(i in this._hash){
+ if(func.call(thisObj, this._hash[i], x++, this._hash)){
+ return true; // Boolean
+ }
+ }
+ return false; // Boolean
+ }
+
+});
+
+(function(){
+
+ /*=====
+ dijit.registry = {
+ // summary:
+ // A list of widgets on a page.
+ // description:
+ // Is an instance of `dijit.WidgetSet`
+ };
+ =====*/
+ dijit.registry = new dijit.WidgetSet();
+
+ var hash = dijit.registry._hash,
+ attr = dojo.attr,
+ hasAttr = dojo.hasAttr,
+ style = dojo.style;
+
+ dijit.byId = function(/*String|dijit._Widget*/ id){
+ // summary:
+ // Returns a widget by it's id, or if passed a widget, no-op (like dojo.byId())
+ return typeof id == "string" ? hash[id] : id; // dijit._Widget
+ };
+
+ var _widgetTypeCtr = {};
+ dijit.getUniqueId = function(/*String*/widgetType){
+ // summary:
+ // Generates a unique id for a given widgetType
+
+ var id;
+ do{
+ id = widgetType + "_" +
+ (widgetType in _widgetTypeCtr ?
+ ++_widgetTypeCtr[widgetType] : _widgetTypeCtr[widgetType] = 0);
+ }while(hash[id]);
+ return dijit._scopeName == "dijit" ? id : dijit._scopeName + "_" + id; // String
+ };
+
+ dijit.findWidgets = function(/*DomNode*/ root){
+ // summary:
+ // Search subtree under root returning widgets found.
+ // Doesn't search for nested widgets (ie, widgets inside other widgets).
+
+ var outAry = [];
+
+ function getChildrenHelper(root){
+ for(var node = root.firstChild; node; node = node.nextSibling){
+ if(node.nodeType == 1){
+ var widgetId = node.getAttribute("widgetId");
+ if(widgetId){
+ var widget = hash[widgetId];
+ if(widget){ // may be null on page w/multiple dojo's loaded
+ outAry.push(widget);
+ }
+ }else{
+ getChildrenHelper(node);
+ }
+ }
+ }
+ }
+
+ getChildrenHelper(root);
+ return outAry;
+ };
+
+ dijit._destroyAll = function(){
+ // summary:
+ // Code to destroy all widgets and do other cleanup on page unload
+
+ // Clean up focus manager lingering references to widgets and nodes
+ dijit._curFocus = null;
+ dijit._prevFocus = null;
+ dijit._activeStack = [];
+
+ // Destroy all the widgets, top down
+ dojo.forEach(dijit.findWidgets(dojo.body()), function(widget){
+ // Avoid double destroy of widgets like Menu that are attached to <body>
+ // even though they are logically children of other widgets.
+ if(!widget._destroyed){
+ if(widget.destroyRecursive){
+ widget.destroyRecursive();
+ }else if(widget.destroy){
+ widget.destroy();
+ }
+ }
+ });
+ };
+
+ if(dojo.isIE){
+ // Only run _destroyAll() for IE because we think it's only necessary in that case,
+ // and because it causes problems on FF. See bug #3531 for details.
+ dojo.addOnWindowUnload(function(){
+ dijit._destroyAll();
+ });
+ }
+
+ dijit.byNode = function(/*DOMNode*/ node){
+ // summary:
+ // Returns the widget corresponding to the given DOMNode
+ return hash[node.getAttribute("widgetId")]; // dijit._Widget
+ };
+
+ dijit.getEnclosingWidget = function(/*DOMNode*/ 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
+ while(node){
+ var id = node.getAttribute && node.getAttribute("widgetId");
+ if(id){
+ return hash[id];
+ }
+ node = node.parentNode;
+ }
+ return null;
+ };
+
+ var shown = (dijit._isElementShown = function(/*Element*/ elem){
+ var s = style(elem);
+ return (s.visibility != "hidden")
+ && (s.visibility != "collapsed")
+ && (s.display != "none")
+ && (attr(elem, "type") != "hidden");
+ });
+
+ dijit.hasDefaultTabStop = function(/*Element*/ elem){
+ // summary:
+ // Tests if element is tab-navigable even without an explicit tabIndex setting
+
+ // No explicit tabIndex setting, need to investigate node type
+ switch(elem.nodeName.toLowerCase()){
+ case "a":
+ // An <a> w/out a tabindex is only navigable if it has an href
+ return hasAttr(elem, "href");
+ case "area":
+ case "button":
+ case "input":
+ case "object":
+ case "select":
+ case "textarea":
+ // These are navigable by default
+ return true;
+ case "iframe":
+ // If it's an editor <iframe> then it's tab navigable.
+ var body;
+ try{
+ // non-IE
+ var contentDocument = elem.contentDocument;
+ if("designMode" in contentDocument && contentDocument.designMode == "on"){
+ return true;
+ }
+ body = contentDocument.body;
+ }catch(e1){
+ // contentWindow.document isn't accessible within IE7/8
+ // if the iframe.src points to a foreign url and this
+ // page contains an element, that could get focus
+ try{
+ body = elem.contentWindow.document.body;
+ }catch(e2){
+ return false;
+ }
+ }
+ return body.contentEditable == 'true' || (body.firstChild && body.firstChild.contentEditable == 'true');
+ default:
+ return elem.contentEditable == 'true';
+ }
+ };
+
+ var isTabNavigable = (dijit.isTabNavigable = function(/*Element*/ elem){
+ // summary:
+ // Tests if an element is tab-navigable
+
+ // TODO: convert (and rename method) to return effective tabIndex; will save time in _getTabNavigable()
+ if(attr(elem, "disabled")){
+ return false;
+ }else if(hasAttr(elem, "tabIndex")){
+ // Explicit tab index setting
+ return attr(elem, "tabIndex") >= 0; // boolean
+ }else{
+ // No explicit tabIndex setting, so depends on node type
+ return dijit.hasDefaultTabStop(elem);
+ }
+ });
+
+ dijit._getTabNavigable = function(/*DOMNode*/ root){
+ // summary:
+ // Finds descendants of the specified root node.
+ //
+ // description:
+ // Finds the following descendants of the specified root node:
+ // * the first tab-navigable element in document order
+ // without a tabIndex or with tabIndex="0"
+ // * the last tab-navigable element in document order
+ // without a tabIndex or with tabIndex="0"
+ // * the first element in document order with the lowest
+ // positive tabIndex value
+ // * the last element in document order with the highest
+ // positive tabIndex value
+ var first, last, lowest, lowestTabindex, highest, highestTabindex, radioSelected = {};
+ function radioName(node) {
+ // If this element is part of a radio button group, return the name for that group.
+ return node && node.tagName.toLowerCase() == "input" &&
+ node.type && node.type.toLowerCase() == "radio" &&
+ node.name && node.name.toLowerCase();
+ }
+ var walkTree = function(/*DOMNode*/parent){
+ dojo.query("> *", parent).forEach(function(child){
+ // Skip hidden elements, and also non-HTML elements (those in custom namespaces) in IE,
+ // since show() invokes getAttribute("type"), which crash on VML nodes in IE.
+ if((dojo.isIE && child.scopeName!=="HTML") || !shown(child)){
+ return;
+ }
+
+ if(isTabNavigable(child)){
+ var tabindex = attr(child, "tabIndex");
+ if(!hasAttr(child, "tabIndex") || tabindex == 0){
+ if(!first){ first = child; }
+ last = child;
+ }else if(tabindex > 0){
+ if(!lowest || tabindex < lowestTabindex){
+ lowestTabindex = tabindex;
+ lowest = child;
+ }
+ if(!highest || tabindex >= highestTabindex){
+ highestTabindex = tabindex;
+ highest = child;
+ }
+ }
+ var rn = radioName(child);
+ if(dojo.attr(child, "checked") && rn) {
+ radioSelected[rn] = child;
+ }
+ }
+ if(child.nodeName.toUpperCase() != 'SELECT'){
+ walkTree(child);
+ }
+ });
+ };
+ if(shown(root)){ walkTree(root) }
+ function rs(node) {
+ // substitute checked radio button for unchecked one, if there is a checked one with the same name.
+ return radioSelected[radioName(node)] || node;
+ }
+ return { first: rs(first), last: rs(last), lowest: rs(lowest), highest: rs(highest) };
+ }
+ dijit.getFirstInTabbingOrder = function(/*String|DOMNode*/ root){
+ // summary:
+ // Finds the descendant of the specified root node
+ // that is first in the tabbing order
+ var elems = dijit._getTabNavigable(dojo.byId(root));
+ return elems.lowest ? elems.lowest : elems.first; // DomNode
+ };
+
+ dijit.getLastInTabbingOrder = function(/*String|DOMNode*/ root){
+ // summary:
+ // Finds the descendant of the specified root node
+ // that is last in the tabbing order
+ var elems = dijit._getTabNavigable(dojo.byId(root));
+ return elems.last ? elems.last : elems.highest; // DomNode
+ };
+
+ /*=====
+ dojo.mixin(dijit, {
+ // defaultDuration: Integer
+ // The default animation speed (in ms) to use for all Dijit
+ // transitional animations, unless otherwise specified
+ // on a per-instance basis. Defaults to 200, overrided by
+ // `djConfig.defaultDuration`
+ defaultDuration: 200
+ });
+ =====*/
+
+ dijit.defaultDuration = dojo.config["defaultDuration"] || 200;
+
+})();
+
+}
+
+if(!dojo._hasResource["dijit._base.focus"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.focus"] = true;
+dojo.provide("dijit._base.focus");
+
+
+
+
+
+// summary:
+// These functions are used to query or set the focus and selection.
+//
+// Also, they trace when widgets become activated/deactivated,
+// so that the widget can fire _onFocus/_onBlur events.
+// "Active" here means something similar to "focused", but
+// "focus" isn't quite the right word because we keep track of
+// a whole stack of "active" widgets. Example: ComboButton --> Menu -->
+// MenuItem. The onBlur event for ComboButton doesn't fire due to focusing
+// on the Menu or a MenuItem, since they are considered part of the
+// ComboButton widget. It only happens when focus is shifted
+// somewhere completely different.
+
+dojo.mixin(dijit, {
+ // _curFocus: DomNode
+ // Currently focused item on screen
+ _curFocus: null,
+
+ // _prevFocus: DomNode
+ // Previously focused item on screen
+ _prevFocus: null,
+
+ isCollapsed: function(){
+ // summary:
+ // Returns true if there is no text selected
+ return dijit.getBookmark().isCollapsed;
+ },
+
+ getBookmark: function(){
+ // summary:
+ // Retrieves a bookmark that can be used with moveToBookmark to return to the same range
+ var bm, rg, tg, sel = dojo.doc.selection, cf = dijit._curFocus;
+
+ if(dojo.global.getSelection){
+ //W3C Range API for selections.
+ sel = dojo.global.getSelection();
+ if(sel){
+ if(sel.isCollapsed){
+ tg = cf? cf.tagName : "";
+ if(tg){
+ //Create a fake rangelike item to restore selections.
+ tg = tg.toLowerCase();
+ if(tg == "textarea" ||
+ (tg == "input" && (!cf.type || cf.type.toLowerCase() == "text"))){
+ sel = {
+ start: cf.selectionStart,
+ end: cf.selectionEnd,
+ node: cf,
+ pRange: true
+ };
+ return {isCollapsed: (sel.end <= sel.start), mark: sel}; //Object.
+ }
+ }
+ bm = {isCollapsed:true};
+ }else{
+ rg = sel.getRangeAt(0);
+ bm = {isCollapsed: false, mark: rg.cloneRange()};
+ }
+ }
+ }else if(sel){
+ // If the current focus was a input of some sort and no selection, don't bother saving
+ // a native bookmark. This is because it causes issues with dialog/page selection restore.
+ // So, we need to create psuedo bookmarks to work with.
+ tg = cf ? cf.tagName : "";
+ tg = tg.toLowerCase();
+ if(cf && tg && (tg == "button" || tg == "textarea" || tg == "input")){
+ if(sel.type && sel.type.toLowerCase() == "none"){
+ return {
+ isCollapsed: true,
+ mark: null
+ }
+ }else{
+ rg = sel.createRange();
+ return {
+ isCollapsed: rg.text && rg.text.length?false:true,
+ mark: {
+ range: rg,
+ pRange: true
+ }
+ };
+ }
+ }
+ bm = {};
+
+ //'IE' way for selections.
+ try{
+ // createRange() throws exception when dojo in iframe
+ //and nothing selected, see #9632
+ rg = sel.createRange();
+ bm.isCollapsed = !(sel.type == 'Text' ? rg.htmlText.length : rg.length);
+ }catch(e){
+ bm.isCollapsed = true;
+ return bm;
+ }
+ if(sel.type.toUpperCase() == 'CONTROL'){
+ if(rg.length){
+ bm.mark=[];
+ var i=0,len=rg.length;
+ while(i<len){
+ bm.mark.push(rg.item(i++));
+ }
+ }else{
+ bm.isCollapsed = true;
+ bm.mark = null;
+ }
+ }else{
+ bm.mark = rg.getBookmark();
+ }
+ }else{
+ console.warn("No idea how to store the current selection for this browser!");
+ }
+ return bm; // Object
+ },
+
+ moveToBookmark: function(/*Object*/bookmark){
+ // summary:
+ // Moves current selection to a bookmark
+ // bookmark:
+ // This should be a returned object from dijit.getBookmark()
+
+ var _doc = dojo.doc,
+ mark = bookmark.mark;
+ if(mark){
+ if(dojo.global.getSelection){
+ //W3C Rangi API (FF, WebKit, Opera, etc)
+ var sel = dojo.global.getSelection();
+ if(sel && sel.removeAllRanges){
+ if(mark.pRange){
+ var r = mark;
+ var n = r.node;
+ n.selectionStart = r.start;
+ n.selectionEnd = r.end;
+ }else{
+ sel.removeAllRanges();
+ sel.addRange(mark);
+ }
+ }else{
+ console.warn("No idea how to restore selection for this browser!");
+ }
+ }else if(_doc.selection && mark){
+ //'IE' way.
+ var rg;
+ if(mark.pRange){
+ rg = mark.range;
+ }else if(dojo.isArray(mark)){
+ rg = _doc.body.createControlRange();
+ //rg.addElement does not have call/apply method, so can not call it directly
+ //rg is not available in "range.addElement(item)", so can't use that either
+ dojo.forEach(mark, function(n){
+ rg.addElement(n);
+ });
+ }else{
+ rg = _doc.body.createTextRange();
+ rg.moveToBookmark(mark);
+ }
+ rg.select();
+ }
+ }
+ },
+
+ getFocus: function(/*Widget?*/ menu, /*Window?*/ openedForWindow){
+ // summary:
+ // Called as getFocus(), this returns an Object showing the current focus
+ // and selected text.
+ //
+ // Called as getFocus(widget), where widget is a (widget representing) a button
+ // that was just pressed, it returns where focus was before that button
+ // was pressed. (Pressing the button may have either shifted focus to the button,
+ // or removed focus altogether.) In this case the selected text is not returned,
+ // since it can't be accurately determined.
+ //
+ // menu: dijit._Widget or {domNode: DomNode} structure
+ // The button that was just pressed. If focus has disappeared or moved
+ // to this button, returns the previous focus. In this case the bookmark
+ // information is already lost, and null is returned.
+ //
+ // openedForWindow:
+ // iframe in which menu was opened
+ //
+ // returns:
+ // A handle to restore focus/selection, to be passed to `dijit.focus`
+ var node = !dijit._curFocus || (menu && dojo.isDescendant(dijit._curFocus, menu.domNode)) ? dijit._prevFocus : dijit._curFocus;
+ return {
+ node: node,
+ bookmark: (node == dijit._curFocus) && dojo.withGlobal(openedForWindow || dojo.global, dijit.getBookmark),
+ openedForWindow: openedForWindow
+ }; // Object
+ },
+
+ focus: function(/*Object || DomNode */ handle){
+ // summary:
+ // Sets the focused node and the selection according to argument.
+ // To set focus to an iframe's content, pass in the iframe itself.
+ // handle:
+ // object returned by get(), or a DomNode
+
+ if(!handle){ return; }
+
+ var node = "node" in handle ? handle.node : handle, // because handle is either DomNode or a composite object
+ bookmark = handle.bookmark,
+ openedForWindow = handle.openedForWindow,
+ collapsed = bookmark ? bookmark.isCollapsed : false;
+
+ // Set the focus
+ // Note that for iframe's we need to use the <iframe> to follow the parentNode chain,
+ // but we need to set focus to iframe.contentWindow
+ if(node){
+ var focusNode = (node.tagName.toLowerCase() == "iframe") ? node.contentWindow : node;
+ if(focusNode && focusNode.focus){
+ try{
+ // Gecko throws sometimes if setting focus is impossible,
+ // node not displayed or something like that
+ focusNode.focus();
+ }catch(e){/*quiet*/}
+ }
+ dijit._onFocusNode(node);
+ }
+
+ // set the selection
+ // do not need to restore if current selection is not empty
+ // (use keyboard to select a menu item) or if previous selection was collapsed
+ // as it may cause focus shift (Esp in IE).
+ if(bookmark && dojo.withGlobal(openedForWindow || dojo.global, dijit.isCollapsed) && !collapsed){
+ if(openedForWindow){
+ openedForWindow.focus();
+ }
+ try{
+ dojo.withGlobal(openedForWindow || dojo.global, dijit.moveToBookmark, null, [bookmark]);
+ }catch(e2){
+ /*squelch IE internal error, see http://trac.dojotoolkit.org/ticket/1984 */
+ }
+ }
+ },
+
+ // _activeStack: dijit._Widget[]
+ // List of currently active widgets (focused widget and it's ancestors)
+ _activeStack: [],
+
+ registerIframe: function(/*DomNode*/ iframe){
+ // summary:
+ // Registers listeners on the specified iframe so that any click
+ // or focus event on that iframe (or anything in it) is reported
+ // as a focus/click event on the <iframe> itself.
+ // description:
+ // Currently only used by editor.
+ // returns:
+ // Handle to pass to unregisterIframe()
+ return dijit.registerWin(iframe.contentWindow, iframe);
+ },
+
+ unregisterIframe: function(/*Object*/ handle){
+ // summary:
+ // Unregisters listeners on the specified iframe created by registerIframe.
+ // After calling be sure to delete or null out the handle itself.
+ // handle:
+ // Handle returned by registerIframe()
+
+ dijit.unregisterWin(handle);
+ },
+
+ registerWin: function(/*Window?*/targetWindow, /*DomNode?*/ effectiveNode){
+ // summary:
+ // Registers listeners on the specified window (either the main
+ // window or an iframe's window) to detect when the user has clicked somewhere
+ // or focused somewhere.
+ // description:
+ // Users should call registerIframe() instead of this method.
+ // targetWindow:
+ // If specified this is the window associated with the iframe,
+ // i.e. iframe.contentWindow.
+ // effectiveNode:
+ // If specified, report any focus events inside targetWindow as
+ // an event on effectiveNode, rather than on evt.target.
+ // returns:
+ // Handle to pass to unregisterWin()
+
+ // TODO: make this function private in 2.0; Editor/users should call registerIframe(),
+
+ var mousedownListener = function(evt){
+ dijit._justMouseDowned = true;
+ setTimeout(function(){ dijit._justMouseDowned = false; }, 0);
+
+ // workaround weird IE bug where the click is on an orphaned node
+ // (first time clicking a Select/DropDownButton inside a TooltipDialog)
+ if(dojo.isIE && evt && evt.srcElement && evt.srcElement.parentNode == null){
+ return;
+ }
+
+ dijit._onTouchNode(effectiveNode || evt.target || evt.srcElement, "mouse");
+ };
+ //dojo.connect(targetWindow, "onscroll", ???);
+
+ // Listen for blur and focus events on targetWindow's document.
+ // IIRC, I'm using attachEvent() rather than dojo.connect() because focus/blur events don't bubble
+ // through dojo.connect(), and also maybe to catch the focus events early, before onfocus handlers
+ // fire.
+ // Connect to <html> (rather than document) on IE to avoid memory leaks, but document on other browsers because
+ // (at least for FF) the focus event doesn't fire on <html> or <body>.
+ var doc = dojo.isIE ? targetWindow.document.documentElement : targetWindow.document;
+ if(doc){
+ if(dojo.isIE){
+ targetWindow.document.body.attachEvent('onmousedown', mousedownListener);
+ var activateListener = function(evt){
+ // IE reports that nodes like <body> have gotten focus, even though they have tabIndex=-1,
+ // Should consider those more like a mouse-click than a focus....
+ if(evt.srcElement.tagName.toLowerCase() != "#document" &&
+ dijit.isTabNavigable(evt.srcElement)){
+ dijit._onFocusNode(effectiveNode || evt.srcElement);
+ }else{
+ dijit._onTouchNode(effectiveNode || evt.srcElement);
+ }
+ };
+ doc.attachEvent('onactivate', activateListener);
+ var deactivateListener = function(evt){
+ dijit._onBlurNode(effectiveNode || evt.srcElement);
+ };
+ doc.attachEvent('ondeactivate', deactivateListener);
+
+ return function(){
+ targetWindow.document.detachEvent('onmousedown', mousedownListener);
+ doc.detachEvent('onactivate', activateListener);
+ doc.detachEvent('ondeactivate', deactivateListener);
+ doc = null; // prevent memory leak (apparent circular reference via closure)
+ };
+ }else{
+ doc.body.addEventListener('mousedown', mousedownListener, true);
+ var focusListener = function(evt){
+ dijit._onFocusNode(effectiveNode || evt.target);
+ };
+ doc.addEventListener('focus', focusListener, true);
+ var blurListener = function(evt){
+ dijit._onBlurNode(effectiveNode || evt.target);
+ };
+ doc.addEventListener('blur', blurListener, true);
+
+ return function(){
+ doc.body.removeEventListener('mousedown', mousedownListener, true);
+ doc.removeEventListener('focus', focusListener, true);
+ doc.removeEventListener('blur', blurListener, true);
+ doc = null; // prevent memory leak (apparent circular reference via closure)
+ };
+ }
+ }
+ },
+
+ unregisterWin: function(/*Handle*/ handle){
+ // summary:
+ // Unregisters listeners on the specified window (either the main
+ // window or an iframe's window) according to handle returned from registerWin().
+ // After calling be sure to delete or null out the handle itself.
+
+ // Currently our handle is actually a function
+ handle && handle();
+ },
+
+ _onBlurNode: function(/*DomNode*/ node){
+ // summary:
+ // Called when focus leaves a node.
+ // Usually ignored, _unless_ it *isn't* follwed by touching another node,
+ // which indicates that we tabbed off the last field on the page,
+ // in which case every widget is marked inactive
+ dijit._prevFocus = dijit._curFocus;
+ dijit._curFocus = null;
+
+ if(dijit._justMouseDowned){
+ // the mouse down caused a new widget to be marked as active; this blur event
+ // is coming late, so ignore it.
+ return;
+ }
+
+ // if the blur event isn't followed by a focus event then mark all widgets as inactive.
+ if(dijit._clearActiveWidgetsTimer){
+ clearTimeout(dijit._clearActiveWidgetsTimer);
+ }
+ dijit._clearActiveWidgetsTimer = setTimeout(function(){
+ delete dijit._clearActiveWidgetsTimer;
+ dijit._setStack([]);
+ dijit._prevFocus = null;
+ }, 100);
+ },
+
+ _onTouchNode: function(/*DomNode*/ node, /*String*/ by){
+ // summary:
+ // Callback when node is focused or mouse-downed
+ // node:
+ // The node that was touched.
+ // by:
+ // "mouse" if the focus/touch was caused by a mouse down event
+
+ // ignore the recent blurNode event
+ if(dijit._clearActiveWidgetsTimer){
+ clearTimeout(dijit._clearActiveWidgetsTimer);
+ delete dijit._clearActiveWidgetsTimer;
+ }
+
+ // compute stack of active widgets (ex: ComboButton --> Menu --> MenuItem)
+ var newStack=[];
+ try{
+ while(node){
+ var popupParent = dojo.attr(node, "dijitPopupParent");
+ if(popupParent){
+ node=dijit.byId(popupParent).domNode;
+ }else if(node.tagName && node.tagName.toLowerCase() == "body"){
+ // is this the root of the document or just the root of an iframe?
+ if(node === dojo.body()){
+ // node is the root of the main document
+ break;
+ }
+ // otherwise, find the iframe this node refers to (can't access it via parentNode,
+ // need to do this trick instead). window.frameElement is supported in IE/FF/Webkit
+ node=dojo.window.get(node.ownerDocument).frameElement;
+ }else{
+ // if this node is the root node of a widget, then add widget id to stack,
+ // except ignore clicks on disabled widgets (actually focusing a disabled widget still works,
+ // to support MenuItem)
+ var id = node.getAttribute && node.getAttribute("widgetId"),
+ widget = id && dijit.byId(id);
+ if(widget && !(by == "mouse" && widget.get("disabled"))){
+ newStack.unshift(id);
+ }
+ node=node.parentNode;
+ }
+ }
+ }catch(e){ /* squelch */ }
+
+ dijit._setStack(newStack, by);
+ },
+
+ _onFocusNode: function(/*DomNode*/ node){
+ // summary:
+ // Callback when node is focused
+
+ if(!node){
+ return;
+ }
+
+ if(node.nodeType == 9){
+ // Ignore focus events on the document itself. This is here so that
+ // (for example) clicking the up/down arrows of a spinner
+ // (which don't get focus) won't cause that widget to blur. (FF issue)
+ return;
+ }
+
+ dijit._onTouchNode(node);
+
+ if(node == dijit._curFocus){ return; }
+ if(dijit._curFocus){
+ dijit._prevFocus = dijit._curFocus;
+ }
+ dijit._curFocus = node;
+ dojo.publish("focusNode", [node]);
+ },
+
+ _setStack: function(/*String[]*/ newStack, /*String*/ by){
+ // summary:
+ // The stack of active widgets has changed. Send out appropriate events and records new stack.
+ // newStack:
+ // array of widget id's, starting from the top (outermost) widget
+ // by:
+ // "mouse" if the focus/touch was caused by a mouse down event
+
+ var oldStack = dijit._activeStack;
+ dijit._activeStack = newStack;
+
+ // compare old stack to new stack to see how many elements they have in common
+ for(var nCommon=0; nCommon<Math.min(oldStack.length, newStack.length); nCommon++){
+ if(oldStack[nCommon] != newStack[nCommon]){
+ break;
+ }
+ }
+
+ var widget;
+ // for all elements that have gone out of focus, send blur event
+ for(var i=oldStack.length-1; i>=nCommon; i--){
+ widget = dijit.byId(oldStack[i]);
+ if(widget){
+ widget._focused = false;
+ widget.set("focused", false);
+ widget._hasBeenBlurred = true;
+ if(widget._onBlur){
+ widget._onBlur(by);
+ }
+ dojo.publish("widgetBlur", [widget, by]);
+ }
+ }
+
+ // for all element that have come into focus, send focus event
+ for(i=nCommon; i<newStack.length; i++){
+ widget = dijit.byId(newStack[i]);
+ if(widget){
+ widget._focused = true;
+ widget.set("focused", true);
+ if(widget._onFocus){
+ widget._onFocus(by);
+ }
+ dojo.publish("widgetFocus", [widget, by]);
+ }
+ }
+ }
+});
+
+// register top window and all the iframes it contains
+dojo.addOnLoad(function(){
+ var handle = dijit.registerWin(window);
+ if(dojo.isIE){
+ dojo.addOnWindowUnload(function(){
+ dijit.unregisterWin(handle);
+ handle = null;
+ })
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojo.AdapterRegistry"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.AdapterRegistry"] = true;
+dojo.provide("dojo.AdapterRegistry");
+
+
+
+dojo.AdapterRegistry = function(/*Boolean?*/ returnWrappers){
+ // summary:
+ // A registry to make contextual calling/searching easier.
+ // description:
+ // Objects of this class keep list of arrays in the form [name, check,
+ // wrap, directReturn] that are used to determine what the contextual
+ // result of a set of checked arguments is. All check/wrap functions
+ // in this registry should be of the same arity.
+ // example:
+ // | // create a new registry
+ // | var reg = new dojo.AdapterRegistry();
+ // | reg.register("handleString",
+ // | dojo.isString,
+ // | function(str){
+ // | // do something with the string here
+ // | }
+ // | );
+ // | reg.register("handleArr",
+ // | dojo.isArray,
+ // | function(arr){
+ // | // do something with the array here
+ // | }
+ // | );
+ // |
+ // | // now we can pass reg.match() *either* an array or a string and
+ // | // the value we pass will get handled by the right function
+ // | reg.match("someValue"); // will call the first function
+ // | reg.match(["someValue"]); // will call the second
+
+ this.pairs = [];
+ this.returnWrappers = returnWrappers || false; // Boolean
+};
+
+dojo.extend(dojo.AdapterRegistry, {
+ register: function(/*String*/ name, /*Function*/ check, /*Function*/ wrap, /*Boolean?*/ directReturn, /*Boolean?*/ override){
+ // summary:
+ // register a check function to determine if the wrap function or
+ // object gets selected
+ // name:
+ // a way to identify this matcher.
+ // check:
+ // a function that arguments are passed to from the adapter's
+ // match() function. The check function should return true if the
+ // given arguments are appropriate for the wrap function.
+ // directReturn:
+ // If directReturn is true, the value passed in for wrap will be
+ // returned instead of being called. Alternately, the
+ // AdapterRegistry can be set globally to "return not call" using
+ // the returnWrappers property. Either way, this behavior allows
+ // the registry to act as a "search" function instead of a
+ // function interception library.
+ // override:
+ // If override is given and true, the check function will be given
+ // highest priority. Otherwise, it will be the lowest priority
+ // adapter.
+ this.pairs[((override) ? "unshift" : "push")]([name, check, wrap, directReturn]);
+ },
+
+ match: function(/* ... */){
+ // summary:
+ // Find an adapter for the given arguments. If no suitable adapter
+ // is found, throws an exception. match() accepts any number of
+ // arguments, all of which are passed to all matching functions
+ // from the registered pairs.
+ for(var i = 0; i < this.pairs.length; i++){
+ var pair = this.pairs[i];
+ if(pair[1].apply(this, arguments)){
+ if((pair[3])||(this.returnWrappers)){
+ return pair[2];
+ }else{
+ return pair[2].apply(this, arguments);
+ }
+ }
+ }
+ throw new Error("No match found");
+ },
+
+ unregister: function(name){
+ // summary: Remove a named adapter from the registry
+
+ // FIXME: this is kind of a dumb way to handle this. On a large
+ // registry this will be slow-ish and we can use the name as a lookup
+ // should we choose to trade memory for speed.
+ for(var i = 0; i < this.pairs.length; i++){
+ var pair = this.pairs[i];
+ if(pair[0] == name){
+ this.pairs.splice(i, 1);
+ return true;
+ }
+ }
+ return false;
+ }
+});
+
+}
+
+if(!dojo._hasResource["dijit._base.place"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.place"] = true;
+dojo.provide("dijit._base.place");
+
+
+
+
+
+dijit.getViewport = function(){
+ // summary:
+ // Returns the dimensions and scroll position of the viewable area of a browser window
+
+ return dojo.window.getBox();
+};
+
+/*=====
+dijit.__Position = function(){
+ // x: Integer
+ // horizontal coordinate in pixels, relative to document body
+ // y: Integer
+ // vertical coordinate in pixels, relative to document body
+
+ thix.x = x;
+ this.y = y;
+}
+=====*/
+
+
+dijit.placeOnScreen = function(
+ /* DomNode */ node,
+ /* dijit.__Position */ pos,
+ /* String[] */ corners,
+ /* dijit.__Position? */ padding){
+ // summary:
+ // Positions one of the node's corners at specified position
+ // such that node is fully visible in viewport.
+ // description:
+ // NOTE: node is assumed to be absolutely or relatively positioned.
+ // pos:
+ // Object like {x: 10, y: 20}
+ // corners:
+ // Array of Strings representing order to try corners in, like ["TR", "BL"].
+ // Possible values are:
+ // * "BL" - bottom left
+ // * "BR" - bottom right
+ // * "TL" - top left
+ // * "TR" - top right
+ // padding:
+ // set padding to put some buffer around the element you want to position.
+ // example:
+ // Try to place node's top right corner at (10,20).
+ // If that makes node go (partially) off screen, then try placing
+ // bottom left corner at (10,20).
+ // | placeOnScreen(node, {x: 10, y: 20}, ["TR", "BL"])
+
+ var choices = dojo.map(corners, function(corner){
+ var c = { corner: corner, pos: {x:pos.x,y:pos.y} };
+ if(padding){
+ c.pos.x += corner.charAt(1) == 'L' ? padding.x : -padding.x;
+ c.pos.y += corner.charAt(0) == 'T' ? padding.y : -padding.y;
+ }
+ return c;
+ });
+
+ return dijit._place(node, choices);
+}
+
+dijit._place = function(/*DomNode*/ node, choices, layoutNode, /*Object*/ aroundNodeCoords){
+ // summary:
+ // Given a list of spots to put node, put it at the first spot where it fits,
+ // of if it doesn't fit anywhere then the place with the least overflow
+ // choices: Array
+ // Array of elements like: {corner: 'TL', pos: {x: 10, y: 20} }
+ // Above example says to put the top-left corner of the node at (10,20)
+ // layoutNode: Function(node, aroundNodeCorner, nodeCorner, size)
+ // for things like tooltip, they are displayed differently (and have different dimensions)
+ // based on their orientation relative to the parent. This adjusts the popup based on orientation.
+ // It also passes in the available size for the popup, which is useful for tooltips to
+ // tell them that their width is limited to a certain amount. layoutNode() may return a value expressing
+ // how much the popup had to be modified to fit into the available space. This is used to determine
+ // what the best placement is.
+ // aroundNodeCoords: Object
+ // Size of aroundNode, ex: {w: 200, h: 50}
+
+ // get {x: 10, y: 10, w: 100, h:100} type obj representing position of
+ // viewport over document
+ var view = dojo.window.getBox();
+
+ // This won't work if the node is inside a <div style="position: relative">,
+ // so reattach it to dojo.doc.body. (Otherwise, the positioning will be wrong
+ // and also it might get cutoff)
+ if(!node.parentNode || String(node.parentNode.tagName).toLowerCase() != "body"){
+ dojo.body().appendChild(node);
+ }
+
+ var best = null;
+ dojo.some(choices, function(choice){
+ var corner = choice.corner;
+ var pos = choice.pos;
+ var overflow = 0;
+
+ // calculate amount of space available given specified position of node
+ var spaceAvailable = {
+ w: corner.charAt(1) == 'L' ? (view.l + view.w) - pos.x : pos.x - view.l,
+ h: corner.charAt(1) == 'T' ? (view.t + view.h) - pos.y : pos.y - view.t
+ };
+
+ // configure node to be displayed in given position relative to button
+ // (need to do this in order to get an accurate size for the node, because
+ // a tooltip's size changes based on position, due to triangle)
+ if(layoutNode){
+ var res = layoutNode(node, choice.aroundCorner, corner, spaceAvailable, aroundNodeCoords);
+ overflow = typeof res == "undefined" ? 0 : res;
+ }
+
+ // get node's size
+ var style = node.style;
+ var oldDisplay = style.display;
+ var oldVis = style.visibility;
+ style.visibility = "hidden";
+ style.display = "";
+ var mb = dojo.marginBox(node);
+ style.display = oldDisplay;
+ style.visibility = oldVis;
+
+ // coordinates and size of node with specified corner placed at pos,
+ // and clipped by viewport
+ var startX = Math.max(view.l, corner.charAt(1) == 'L' ? pos.x : (pos.x - mb.w)),
+ startY = Math.max(view.t, corner.charAt(0) == 'T' ? pos.y : (pos.y - mb.h)),
+ endX = Math.min(view.l + view.w, corner.charAt(1) == 'L' ? (startX + mb.w) : pos.x),
+ endY = Math.min(view.t + view.h, corner.charAt(0) == 'T' ? (startY + mb.h) : pos.y),
+ width = endX - startX,
+ height = endY - startY;
+
+ overflow += (mb.w - width) + (mb.h - height);
+
+ if(best == null || overflow < best.overflow){
+ best = {
+ corner: corner,
+ aroundCorner: choice.aroundCorner,
+ x: startX,
+ y: startY,
+ w: width,
+ h: height,
+ overflow: overflow,
+ spaceAvailable: spaceAvailable
+ };
+ }
+
+ return !overflow;
+ });
+
+ // In case the best position is not the last one we checked, need to call
+ // layoutNode() again.
+ if(best.overflow && layoutNode){
+ layoutNode(node, best.aroundCorner, best.corner, best.spaceAvailable, aroundNodeCoords);
+ }
+
+ // And then position the node. Do this last, after the layoutNode() above
+ // has sized the node, due to browser quirks when the viewport is scrolled
+ // (specifically that a Tooltip will shrink to fit as though the window was
+ // scrolled to the left).
+ //
+ // In RTL mode, set style.right rather than style.left so in the common case,
+ // window resizes move the popup along with the aroundNode.
+ var l = dojo._isBodyLtr(),
+ s = node.style;
+ s.top = best.y + "px";
+ s[l ? "left" : "right"] = (l ? best.x : view.w - best.x - best.w) + "px";
+
+ return best;
+}
+
+dijit.placeOnScreenAroundNode = function(
+ /* DomNode */ node,
+ /* DomNode */ aroundNode,
+ /* Object */ aroundCorners,
+ /* Function? */ layoutNode){
+
+ // summary:
+ // Position node adjacent or kitty-corner to aroundNode
+ // such that it's fully visible in viewport.
+ //
+ // description:
+ // Place node such that corner of node touches a corner of
+ // aroundNode, and that node is fully visible.
+ //
+ // aroundCorners:
+ // Ordered list of pairs of corners to try matching up.
+ // Each pair of corners is represented as a key/value in the hash,
+ // where the key corresponds to the aroundNode's corner, and
+ // the value corresponds to the node's corner:
+ //
+ // | { aroundNodeCorner1: nodeCorner1, aroundNodeCorner2: nodeCorner2, ...}
+ //
+ // The following strings are used to represent the four corners:
+ // * "BL" - bottom left
+ // * "BR" - bottom right
+ // * "TL" - top left
+ // * "TR" - top right
+ //
+ // layoutNode: Function(node, aroundNodeCorner, nodeCorner)
+ // For things like tooltip, they are displayed differently (and have different dimensions)
+ // based on their orientation relative to the parent. This adjusts the popup based on orientation.
+ //
+ // example:
+ // | dijit.placeOnScreenAroundNode(node, aroundNode, {'BL':'TL', 'TR':'BR'});
+ // This will try to position node such that node's top-left corner is at the same position
+ // as the bottom left corner of the aroundNode (ie, put node below
+ // aroundNode, with left edges aligned). If that fails it will try to put
+ // the bottom-right corner of node where the top right corner of aroundNode is
+ // (ie, put node above aroundNode, with right edges aligned)
+ //
+
+ // get coordinates of aroundNode
+ aroundNode = dojo.byId(aroundNode);
+ var aroundNodePos = dojo.position(aroundNode, true);
+
+ // place the node around the calculated rectangle
+ return dijit._placeOnScreenAroundRect(node,
+ aroundNodePos.x, aroundNodePos.y, aroundNodePos.w, aroundNodePos.h, // rectangle
+ aroundCorners, layoutNode);
+};
+
+/*=====
+dijit.__Rectangle = function(){
+ // x: Integer
+ // horizontal offset in pixels, relative to document body
+ // y: Integer
+ // vertical offset in pixels, relative to document body
+ // width: Integer
+ // width in pixels
+ // height: Integer
+ // height in pixels
+
+ this.x = x;
+ this.y = y;
+ this.width = width;
+ this.height = height;
+}
+=====*/
+
+
+dijit.placeOnScreenAroundRectangle = function(
+ /* DomNode */ node,
+ /* dijit.__Rectangle */ aroundRect,
+ /* Object */ aroundCorners,
+ /* Function */ 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.
+
+ return dijit._placeOnScreenAroundRect(node,
+ aroundRect.x, aroundRect.y, aroundRect.width, aroundRect.height, // rectangle
+ aroundCorners, layoutNode);
+};
+
+dijit._placeOnScreenAroundRect = function(
+ /* DomNode */ node,
+ /* Number */ x,
+ /* Number */ y,
+ /* Number */ width,
+ /* Number */ height,
+ /* Object */ aroundCorners,
+ /* Function */ layoutNode){
+
+ // summary:
+ // Like dijit.placeOnScreenAroundNode(), except it accepts coordinates
+ // of a rectangle to place node adjacent to.
+
+ // TODO: combine with placeOnScreenAroundRectangle()
+
+ // Generate list of possible positions for node
+ var choices = [];
+ for(var nodeCorner in aroundCorners){
+ choices.push( {
+ aroundCorner: nodeCorner,
+ corner: aroundCorners[nodeCorner],
+ pos: {
+ x: x + (nodeCorner.charAt(1) == 'L' ? 0 : width),
+ y: y + (nodeCorner.charAt(0) == 'T' ? 0 : height)
+ }
+ });
+ }
+
+ return dijit._place(node, choices, layoutNode, {w: width, h: height});
+};
+
+dijit.placementRegistry= new dojo.AdapterRegistry();
+dijit.placementRegistry.register("node",
+ function(n, x){
+ return typeof x == "object" &&
+ typeof x.offsetWidth != "undefined" && typeof x.offsetHeight != "undefined";
+ },
+ dijit.placeOnScreenAroundNode);
+dijit.placementRegistry.register("rect",
+ function(n, x){
+ return typeof x == "object" &&
+ "x" in x && "y" in x && "width" in x && "height" in x;
+ },
+ dijit.placeOnScreenAroundRectangle);
+
+dijit.placeOnScreenAroundElement = function(
+ /* DomNode */ node,
+ /* Object */ aroundElement,
+ /* Object */ aroundCorners,
+ /* Function */ layoutNode){
+
+ // summary:
+ // Like dijit.placeOnScreenAroundNode(), except it accepts an arbitrary object
+ // for the "around" argument and finds a proper processor to place a node.
+
+ return dijit.placementRegistry.match.apply(dijit.placementRegistry, arguments);
+};
+
+dijit.getPopupAroundAlignment = function(/*Array*/ position, /*Boolean*/ leftToRight){
+ // summary:
+ // 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:
+ //
+ // * before: places drop down to the left of the target node/widget, or to the right in
+ // the case of RTL scripts like Hebrew and Arabic
+ // * after: places drop down to the right of the target node/widget, or to the left in
+ // the case of RTL scripts like Hebrew and Arabic
+ // * above: drop down goes above target node
+ // * below: drop down goes below target node
+ //
+ // 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 = {};
+ dojo.forEach(position, function(pos){
+ switch(pos){
+ case "after":
+ align[leftToRight ? "BR" : "BL"] = leftToRight ? "BL" : "BR";
+ break;
+ case "before":
+ align[leftToRight ? "BL" : "BR"] = leftToRight ? "BR" : "BL";
+ break;
+ case "below-alt":
+ leftToRight = !leftToRight;
+ // fall through
+ case "below":
+ // first try to align left borders, next try to align right borders (or reverse for RTL mode)
+ align[leftToRight ? "BL" : "BR"] = leftToRight ? "TL" : "TR";
+ align[leftToRight ? "BR" : "BL"] = leftToRight ? "TR" : "TL";
+ break;
+ case "above-alt":
+ leftToRight = !leftToRight;
+ // fall through
+ case "above":
+ default:
+ // first try to align left borders, next try to align right borders (or reverse for RTL mode)
+ align[leftToRight ? "TL" : "TR"] = leftToRight ? "BL" : "BR";
+ align[leftToRight ? "TR" : "TL"] = leftToRight ? "BR" : "BL";
+ break;
+ }
+ });
+ return align;
+};
+
+}
+
+if(!dojo._hasResource["dijit._base.window"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.window"] = true;
+dojo.provide("dijit._base.window");
+
+
+
+
+dijit.getDocumentWindow = function(doc){
+ return dojo.window.get(doc);
+};
+
+}
+
+if(!dojo._hasResource["dijit._base.popup"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.popup"] = true;
+dojo.provide("dijit._base.popup");
+
+
+
+
+
+
+/*=====
+dijit.popup.__OpenArgs = function(){
+ // popup: Widget
+ // widget to display
+ // parent: Widget
+ // the button etc. that is displaying this popup
+ // around: DomNode
+ // DOM node (typically a button); place popup relative to this node. (Specify this *or* "x" and "y" parameters.)
+ // x: Integer
+ // Absolute horizontal position (in pixels) to place node at. (Specify this *or* "around" parameter.)
+ // y: Integer
+ // Absolute vertical position (in pixels) to place node at. (Specify this *or* "around" parameter.)
+ // orient: Object|String
+ // When the around parameter is specified, orient should be an
+ // ordered list of tuples of the form (around-node-corner, popup-node-corner).
+ // dijit.popup.open() tries to position the popup according to each tuple in the list, in order,
+ // until the popup appears fully within the viewport.
+ //
+ // The default value is {BL:'TL', TL:'BL'}, which represents a list of two tuples:
+ // 1. (BL, TL)
+ // 2. (TL, BL)
+ // where BL means "bottom left" and "TL" means "top left".
+ // So by default, it first tries putting the popup below the around node, left-aligning them,
+ // and then tries to put it above the around node, still left-aligning them. Note that the
+ // default is horizontally reversed when in RTL mode.
+ //
+ // When an (x,y) position is specified rather than an around node, orient is either
+ // "R" or "L". R (for right) means that it tries to put the popup to the right of the mouse,
+ // specifically positioning the popup's top-right corner at the mouse position, and if that doesn't
+ // fit in the viewport, then it tries, in order, the bottom-right corner, the top left corner,
+ // and the top-right corner.
+ // onCancel: Function
+ // callback when user has canceled the popup by
+ // 1. hitting ESC or
+ // 2. by using the popup widget's proprietary cancel mechanism (like a cancel button in a dialog);
+ // i.e. whenever popupWidget.onCancel() is called, args.onCancel is called
+ // onClose: Function
+ // callback whenever this popup is closed
+ // onExecute: Function
+ // callback when user "executed" on the popup/sub-popup by selecting a menu choice, etc. (top menu only)
+ // padding: dijit.__Position
+ // adding a buffer around the opening position. This is only useful when around is not set.
+ this.popup = popup;
+ this.parent = parent;
+ this.around = around;
+ this.x = x;
+ this.y = y;
+ this.orient = orient;
+ this.onCancel = onCancel;
+ this.onClose = onClose;
+ this.onExecute = onExecute;
+ this.padding = padding;
+}
+=====*/
+
+dijit.popup = {
+ // summary:
+ // This singleton is used to show/hide widgets as popups.
+
+ // _stack: dijit._Widget[]
+ // Stack of currently popped up widgets.
+ // (someone opened _stack[0], and then it opened _stack[1], etc.)
+ _stack: [],
+
+ // _beginZIndex: Number
+ // Z-index of the first popup. (If first popup opens other
+ // popups they get a higher z-index.)
+ _beginZIndex: 1000,
+
+ _idGen: 1,
+
+ _createWrapper: function(/*Widget || DomNode*/ widget){
+ // summary:
+ // Initialization for widgets that will be used as popups.
+ // Puts widget inside a wrapper DIV (if not already in one),
+ // and returns pointer to that wrapper DIV.
+
+ var wrapper = widget.declaredClass ? widget._popupWrapper : (dojo.hasClass(widget.parentNode, "dijitPopup") && widget.parentNode),
+ node = widget.domNode || widget;
+
+ if(!wrapper){
+ // Create wrapper <div> for when this widget [in the future] will be used as a popup.
+ // This is done early because of IE bugs where creating/moving DOM nodes causes focus
+ // to go wonky, see tests/robot/Toolbar.html to reproduce
+ wrapper = dojo.create("div",{
+ "class":"dijitPopup",
+ style:{ display: "none"},
+ role: "presentation"
+ }, dojo.body());
+ wrapper.appendChild(node);
+
+ var s = node.style;
+ s.display = "";
+ s.visibility = "";
+ s.position = "";
+ s.top = "0px";
+
+ if(widget.declaredClass){ // TODO: in 2.0 change signature to always take widget, then remove if()
+ widget._popupWrapper = wrapper;
+ dojo.connect(widget, "destroy", function(){
+ dojo.destroy(wrapper);
+ delete widget._popupWrapper;
+ });
+ }
+ }
+
+ return wrapper;
+ },
+
+ moveOffScreen: function(/*Widget || DomNode*/ widget){
+ // summary:
+ // Moves the popup widget off-screen.
+ // Do not use this method to hide popups when not in use, because
+ // that will create an accessibility issue: the offscreen popup is
+ // still in the tabbing order.
+
+ // Create wrapper if not already there
+ var wrapper = this._createWrapper(widget);
+
+ dojo.style(wrapper, {
+ visibility: "hidden",
+ top: "-9999px", // prevent transient scrollbar causing misalign (#5776), and initial flash in upper left (#10111)
+ display: ""
+ });
+ },
+
+ hide: function(/*dijit._Widget*/ widget){
+ // summary:
+ // Hide this popup widget (until it is ready to be shown).
+ // Initialization for widgets that will be used as popups
+ //
+ // Also puts widget inside a wrapper DIV (if not already in one)
+ //
+ // If popup widget needs to layout it should
+ // do so when it is made visible, and popup._onShow() is called.
+
+ // Create wrapper if not already there
+ var wrapper = this._createWrapper(widget);
+
+ dojo.style(wrapper, "display", "none");
+ },
+
+ getTopPopup: function(){
+ // summary:
+ // Compute the closest ancestor popup that's *not* a child of another popup.
+ // Ex: For a TooltipDialog with a button that spawns a tree of menus, find the popup of the button.
+ var stack = this._stack;
+ for(var pi=stack.length-1; pi > 0 && stack[pi].parent === stack[pi-1].widget; pi--){
+ /* do nothing, just trying to get right value for pi */
+ }
+ return stack[pi];
+ },
+
+ open: function(/*dijit.popup.__OpenArgs*/ args){
+ // summary:
+ // Popup the widget at the specified position
+ //
+ // example:
+ // opening at the mouse position
+ // | dijit.popup.open({popup: menuWidget, x: evt.pageX, y: evt.pageY});
+ //
+ // example:
+ // opening the widget as a dropdown
+ // | dijit.popup.open({parent: this, popup: menuWidget, around: this.domNode, onClose: function(){...}});
+ //
+ // Note that whatever widget called dijit.popup.open() should also listen to its own _onBlur callback
+ // (fired from _base/focus.js) to know that focus has moved somewhere else and thus the popup should be closed.
+
+ var stack = this._stack,
+ widget = args.popup,
+ orient = args.orient || (
+ (args.parent ? args.parent.isLeftToRight() : dojo._isBodyLtr()) ?
+ {'BL':'TL', 'BR':'TR', 'TL':'BL', 'TR':'BR'} :
+ {'BR':'TR', 'BL':'TL', 'TR':'BR', 'TL':'BL'}
+ ),
+ around = args.around,
+ id = (args.around && args.around.id) ? (args.around.id+"_dropdown") : ("popup_"+this._idGen++);
+
+ // If we are opening a new popup that isn't a child of a currently opened popup, then
+ // close currently opened popup(s). This should happen automatically when the old popups
+ // gets the _onBlur() event, except that the _onBlur() event isn't reliable on IE, see [22198].
+ while(stack.length && (!args.parent || !dojo.isDescendant(args.parent.domNode, stack[stack.length-1].widget.domNode))){
+ dijit.popup.close(stack[stack.length-1].widget);
+ }
+
+ // Get pointer to popup wrapper, and create wrapper if it doesn't exist
+ var wrapper = this._createWrapper(widget);
+
+
+ dojo.attr(wrapper, {
+ id: id,
+ style: {
+ zIndex: this._beginZIndex + stack.length
+ },
+ "class": "dijitPopup " + (widget.baseClass || widget["class"] || "").split(" ")[0] +"Popup",
+ dijitPopupParent: args.parent ? args.parent.id : ""
+ });
+
+ if(dojo.isIE || dojo.isMoz){
+ if(!widget.bgIframe){
+ // setting widget.bgIframe triggers cleanup in _Widget.destroy()
+ widget.bgIframe = new dijit.BackgroundIframe(wrapper);
+ }
+ }
+
+ // position the wrapper node and make it visible
+ var best = around ?
+ dijit.placeOnScreenAroundElement(wrapper, around, orient, widget.orient ? dojo.hitch(widget, "orient") : null) :
+ dijit.placeOnScreen(wrapper, args, orient == 'R' ? ['TR','BR','TL','BL'] : ['TL','BL','TR','BR'], args.padding);
+
+ wrapper.style.display = "";
+ wrapper.style.visibility = "visible";
+ widget.domNode.style.visibility = "visible"; // counteract effects from _HasDropDown
+
+ var handlers = [];
+
+ // provide default escape and tab key handling
+ // (this will work for any widget, not just menu)
+ handlers.push(dojo.connect(wrapper, "onkeypress", this, function(evt){
+ if(evt.charOrCode == dojo.keys.ESCAPE && args.onCancel){
+ dojo.stopEvent(evt);
+ args.onCancel();
+ }else if(evt.charOrCode === dojo.keys.TAB){
+ dojo.stopEvent(evt);
+ var topPopup = this.getTopPopup();
+ if(topPopup && topPopup.onCancel){
+ topPopup.onCancel();
+ }
+ }
+ }));
+
+ // watch for cancel/execute events on the popup and notify the caller
+ // (for a menu, "execute" means clicking an item)
+ if(widget.onCancel){
+ handlers.push(dojo.connect(widget, "onCancel", args.onCancel));
+ }
+
+ handlers.push(dojo.connect(widget, widget.onExecute ? "onExecute" : "onChange", this, function(){
+ var topPopup = this.getTopPopup();
+ if(topPopup && topPopup.onExecute){
+ topPopup.onExecute();
+ }
+ }));
+
+ stack.push({
+ widget: widget,
+ parent: args.parent,
+ onExecute: args.onExecute,
+ onCancel: args.onCancel,
+ onClose: args.onClose,
+ handlers: handlers
+ });
+
+ if(widget.onOpen){
+ // TODO: in 2.0 standardize onShow() (used by StackContainer) and onOpen() (used here)
+ widget.onOpen(best);
+ }
+
+ return best;
+ },
+
+ close: function(/*dijit._Widget?*/ popup){
+ // summary:
+ // Close specified popup and any popups that it parented.
+ // If no popup is specified, closes all popups.
+
+ var stack = this._stack;
+
+ // Basically work backwards from the top of the stack closing popups
+ // until we hit the specified popup, but IIRC there was some issue where closing
+ // a popup would cause others to close too. Thus if we are trying to close B in [A,B,C]
+ // closing C might close B indirectly and then the while() condition will run where stack==[A]...
+ // so the while condition is constructed defensively.
+ while((popup && dojo.some(stack, function(elem){return elem.widget == popup;})) ||
+ (!popup && stack.length)){
+ var top = stack.pop(),
+ widget = top.widget,
+ onClose = top.onClose;
+
+ if(widget.onClose){
+ // TODO: in 2.0 standardize onHide() (used by StackContainer) and onClose() (used here)
+ widget.onClose();
+ }
+ dojo.forEach(top.handlers, dojo.disconnect);
+
+ // Hide the widget and it's wrapper unless it has already been destroyed in above onClose() etc.
+ if(widget && widget.domNode){
+ this.hide(widget);
+ }
+
+ if(onClose){
+ onClose();
+ }
+ }
+ }
+};
+
+// TODO: remove dijit._frames, it isn't being used much, since popups never release their
+// iframes (see [22236])
+dijit._frames = new function(){
+ // summary:
+ // cache of iframes
+
+ var queue = [];
+
+ this.pop = function(){
+ var iframe;
+ if(queue.length){
+ iframe = queue.pop();
+ iframe.style.display="";
+ }else{
+ if(dojo.isIE < 9){
+ var burl = dojo.config["dojoBlankHtmlUrl"] || (dojo.moduleUrl("dojo", "resources/blank.html")+"") || "javascript:\"\"";
+ var html="<iframe src='" + burl + "'"
+ + " style='position: absolute; left: 0px; top: 0px;"
+ + "z-index: -1; filter:Alpha(Opacity=\"0\");'>";
+ iframe = dojo.doc.createElement(html);
+ }else{
+ iframe = dojo.create("iframe");
+ iframe.src = 'javascript:""';
+ iframe.className = "dijitBackgroundIframe";
+ dojo.style(iframe, "opacity", 0.1);
+ }
+ iframe.tabIndex = -1; // Magic to prevent iframe from getting focus on tab keypress - as style didn't work.
+ dijit.setWaiRole(iframe,"presentation");
+ }
+ return iframe;
+ };
+
+ this.push = function(iframe){
+ iframe.style.display="none";
+ queue.push(iframe);
+ }
+}();
+
+
+dijit.BackgroundIframe = function(/*DomNode*/ node){
+ // summary:
+ // For IE/FF z-index schenanigans. id attribute is required.
+ //
+ // description:
+ // new dijit.BackgroundIframe(node)
+ // Makes a background iframe as a child of node, that fills
+ // area (and position) of node
+
+ if(!node.id){ throw new Error("no id"); }
+ if(dojo.isIE || dojo.isMoz){
+ var iframe = (this.iframe = dijit._frames.pop());
+ node.appendChild(iframe);
+ if(dojo.isIE<7 || dojo.isQuirks){
+ this.resize(node);
+ this._conn = dojo.connect(node, 'onresize', this, function(){
+ this.resize(node);
+ });
+ }else{
+ dojo.style(iframe, {
+ width: '100%',
+ height: '100%'
+ });
+ }
+ }
+};
+
+dojo.extend(dijit.BackgroundIframe, {
+ resize: function(node){
+ // summary:
+ // Resize the iframe so it's the same size as node.
+ // Needed on IE6 and IE/quirks because height:100% doesn't work right.
+ if(this.iframe){
+ dojo.style(this.iframe, {
+ width: node.offsetWidth + 'px',
+ height: node.offsetHeight + 'px'
+ });
+ }
+ },
+ destroy: function(){
+ // summary:
+ // destroy the iframe
+ if(this._conn){
+ dojo.disconnect(this._conn);
+ this._conn = null;
+ }
+ if(this.iframe){
+ dijit._frames.push(this.iframe);
+ delete this.iframe;
+ }
+ }
+});
+
+}
+
+if(!dojo._hasResource["dijit._base.scroll"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.scroll"] = true;
+dojo.provide("dijit._base.scroll");
+
+
+
+
+dijit.scrollIntoView = function(/*DomNode*/ node, /*Object?*/ pos){
+ // summary:
+ // Scroll the passed node into view, if it is not already.
+ // Deprecated, use `dojo.window.scrollIntoView` instead.
+
+ dojo.window.scrollIntoView(node, pos);
+};
+
+}
+
+if(!dojo._hasResource["dojo.uacss"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.uacss"] = true;
+dojo.provide("dojo.uacss");
+
+
+
+(function(){
+ // summary:
+ // Applies pre-set CSS classes to the top-level HTML node, based on:
+ // - browser (ex: dj_ie)
+ // - browser version (ex: dj_ie6)
+ // - box model (ex: dj_contentBox)
+ // - text direction (ex: dijitRtl)
+ //
+ // In addition, browser, browser version, and box model are
+ // combined with an RTL flag when browser text is RTL. ex: dj_ie-rtl.
+
+ var d = dojo,
+ html = d.doc.documentElement,
+ ie = d.isIE,
+ opera = d.isOpera,
+ maj = Math.floor,
+ ff = d.isFF,
+ boxModel = d.boxModel.replace(/-/,''),
+
+ classes = {
+ dj_ie: ie,
+ dj_ie6: maj(ie) == 6,
+ dj_ie7: maj(ie) == 7,
+ dj_ie8: maj(ie) == 8,
+ dj_ie9: maj(ie) == 9,
+ dj_quirks: d.isQuirks,
+ dj_iequirks: ie && d.isQuirks,
+
+ // NOTE: Opera not supported by dijit
+ dj_opera: opera,
+
+ dj_khtml: d.isKhtml,
+
+ dj_webkit: d.isWebKit,
+ dj_safari: d.isSafari,
+ dj_chrome: d.isChrome,
+
+ dj_gecko: d.isMozilla,
+ dj_ff3: maj(ff) == 3
+ }; // no dojo unsupported browsers
+
+ classes["dj_" + boxModel] = true;
+
+ // apply browser, browser version, and box model class names
+ var classStr = "";
+ for(var clz in classes){
+ if(classes[clz]){
+ classStr += clz + " ";
+ }
+ }
+ html.className = d.trim(html.className + " " + classStr);
+
+ // If RTL mode, then add dj_rtl flag plus repeat existing classes with -rtl extension.
+ // We can't run the code below until the <body> tag has loaded (so we can check for dir=rtl).
+ // Unshift() is to run sniff code before the parser.
+ dojo._loaders.unshift(function(){
+ if(!dojo._isBodyLtr()){
+ var rtlClassStr = "dj_rtl dijitRtl " + classStr.replace(/ /g, "-rtl ")
+ html.className = d.trim(html.className + " " + rtlClassStr);
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dijit._base.sniff"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.sniff"] = true;
+dojo.provide("dijit._base.sniff");
+
+
+
+
+// summary:
+// Applies pre-set CSS classes to the top-level HTML node, see
+// `dojo.uacss` for details.
+//
+// Simply doing a require on this module will
+// establish this CSS. Modified version of Morris' CSS hack.
+
+}
+
+if(!dojo._hasResource["dijit._base.typematic"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.typematic"] = true;
+dojo.provide("dijit._base.typematic");
+
+
+
+dijit.typematic = {
+ // summary:
+ // These functions are used to repetitively call a user specified callback
+ // method when a specific key or mouse click over a specific DOM node is
+ // held down for a specific amount of time.
+ // Only 1 such event is allowed to occur on the browser page at 1 time.
+
+ _fireEventAndReload: function(){
+ this._timer = null;
+ this._callback(++this._count, this._node, this._evt);
+
+ // Schedule next event, timer is at most minDelay (default 10ms) to avoid
+ // browser overload (particularly avoiding starving DOH robot so it never gets to send a mouseup)
+ this._currentTimeout = Math.max(
+ this._currentTimeout < 0 ? this._initialDelay :
+ (this._subsequentDelay > 1 ? this._subsequentDelay : Math.round(this._currentTimeout * this._subsequentDelay)),
+ this._minDelay);
+ this._timer = setTimeout(dojo.hitch(this, "_fireEventAndReload"), this._currentTimeout);
+ },
+
+ trigger: function(/*Event*/ evt, /*Object*/ _this, /*DOMNode*/ node, /*Function*/ callback, /*Object*/ obj, /*Number*/ subsequentDelay, /*Number*/ initialDelay, /*Number?*/ minDelay){
+ // summary:
+ // Start a timed, repeating callback sequence.
+ // If already started, the function call is ignored.
+ // This method is not normally called by the user but can be
+ // when the normal listener code is insufficient.
+ // evt:
+ // key or mouse event object to pass to the user callback
+ // _this:
+ // pointer to the user's widget space.
+ // node:
+ // the DOM node object to pass the the callback function
+ // callback:
+ // function to call until the sequence is stopped called with 3 parameters:
+ // count:
+ // integer representing number of repeated calls (0..n) with -1 indicating the iteration has stopped
+ // node:
+ // the DOM node object passed in
+ // evt:
+ // key or mouse event object
+ // obj:
+ // user space object used to uniquely identify each typematic sequence
+ // subsequentDelay (optional):
+ // if > 1, the number of milliseconds until the 3->n events occur
+ // or else the fractional time multiplier for the next event's delay, default=0.9
+ // initialDelay (optional):
+ // the number of milliseconds until the 2nd event occurs, default=500ms
+ // minDelay (optional):
+ // the maximum delay in milliseconds for event to fire, default=10ms
+ if(obj != this._obj){
+ this.stop();
+ this._initialDelay = initialDelay || 500;
+ this._subsequentDelay = subsequentDelay || 0.90;
+ this._minDelay = minDelay || 10;
+ this._obj = obj;
+ this._evt = evt;
+ this._node = node;
+ this._currentTimeout = -1;
+ this._count = -1;
+ this._callback = dojo.hitch(_this, callback);
+ this._fireEventAndReload();
+ this._evt = dojo.mixin({faux: true}, evt);
+ }
+ },
+
+ stop: function(){
+ // summary:
+ // Stop an ongoing timed, repeating callback sequence.
+ if(this._timer){
+ clearTimeout(this._timer);
+ this._timer = null;
+ }
+ if(this._obj){
+ this._callback(-1, this._node, this._evt);
+ this._obj = null;
+ }
+ },
+
+ addKeyListener: function(/*DOMNode*/ node, /*Object*/ keyObject, /*Object*/ _this, /*Function*/ callback, /*Number*/ subsequentDelay, /*Number*/ initialDelay, /*Number?*/ minDelay){
+ // summary:
+ // Start listening for a specific typematic key.
+ // See also the trigger method for other parameters.
+ // keyObject:
+ // an object defining the key to listen for:
+ // charOrCode:
+ // the printable character (string) or keyCode (number) to listen for.
+ // keyCode:
+ // (deprecated - use charOrCode) the keyCode (number) to listen for (implies charCode = 0).
+ // charCode:
+ // (deprecated - use charOrCode) the charCode (number) to listen for.
+ // ctrlKey:
+ // desired ctrl key state to initiate the callback sequence:
+ // - pressed (true)
+ // - released (false)
+ // - either (unspecified)
+ // altKey:
+ // same as ctrlKey but for the alt key
+ // shiftKey:
+ // same as ctrlKey but for the shift key
+ // returns:
+ // an array of dojo.connect handles
+ if(keyObject.keyCode){
+ keyObject.charOrCode = keyObject.keyCode;
+ dojo.deprecated("keyCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.", "", "2.0");
+ }else if(keyObject.charCode){
+ keyObject.charOrCode = String.fromCharCode(keyObject.charCode);
+ dojo.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.", "", "2.0");
+ }
+ return [
+ dojo.connect(node, "onkeypress", this, function(evt){
+ if(evt.charOrCode == keyObject.charOrCode &&
+ (keyObject.ctrlKey === undefined || keyObject.ctrlKey == evt.ctrlKey) &&
+ (keyObject.altKey === undefined || keyObject.altKey == evt.altKey) &&
+ (keyObject.metaKey === undefined || keyObject.metaKey == (evt.metaKey || false)) && // IE doesn't even set metaKey
+ (keyObject.shiftKey === undefined || keyObject.shiftKey == evt.shiftKey)){
+ dojo.stopEvent(evt);
+ dijit.typematic.trigger(evt, _this, node, callback, keyObject, subsequentDelay, initialDelay, minDelay);
+ }else if(dijit.typematic._obj == keyObject){
+ dijit.typematic.stop();
+ }
+ }),
+ dojo.connect(node, "onkeyup", this, function(evt){
+ if(dijit.typematic._obj == keyObject){
+ dijit.typematic.stop();
+ }
+ })
+ ];
+ },
+
+ addMouseListener: function(/*DOMNode*/ node, /*Object*/ _this, /*Function*/ callback, /*Number*/ subsequentDelay, /*Number*/ initialDelay, /*Number?*/ minDelay){
+ // summary:
+ // Start listening for a typematic mouse click.
+ // See the trigger method for other parameters.
+ // returns:
+ // an array of dojo.connect handles
+ var dc = dojo.connect;
+ return [
+ dc(node, "mousedown", this, function(evt){
+ dojo.stopEvent(evt);
+ dijit.typematic.trigger(evt, _this, node, callback, node, subsequentDelay, initialDelay, minDelay);
+ }),
+ dc(node, "mouseup", this, function(evt){
+ dojo.stopEvent(evt);
+ dijit.typematic.stop();
+ }),
+ dc(node, "mouseout", this, function(evt){
+ dojo.stopEvent(evt);
+ dijit.typematic.stop();
+ }),
+ dc(node, "mousemove", this, function(evt){
+ evt.preventDefault();
+ }),
+ dc(node, "dblclick", this, function(evt){
+ dojo.stopEvent(evt);
+ if(dojo.isIE){
+ dijit.typematic.trigger(evt, _this, node, callback, node, subsequentDelay, initialDelay, minDelay);
+ setTimeout(dojo.hitch(this, dijit.typematic.stop), 50);
+ }
+ })
+ ];
+ },
+
+ addListener: function(/*Node*/ mouseNode, /*Node*/ keyNode, /*Object*/ keyObject, /*Object*/ _this, /*Function*/ callback, /*Number*/ subsequentDelay, /*Number*/ initialDelay, /*Number?*/ minDelay){
+ // summary:
+ // Start listening for a specific typematic key and mouseclick.
+ // This is a thin wrapper to addKeyListener and addMouseListener.
+ // See the addMouseListener and addKeyListener methods for other parameters.
+ // mouseNode:
+ // the DOM node object to listen on for mouse events.
+ // keyNode:
+ // the DOM node object to listen on for key events.
+ // returns:
+ // an array of dojo.connect handles
+ return this.addKeyListener(keyNode, keyObject, _this, callback, subsequentDelay, initialDelay, minDelay).concat(
+ this.addMouseListener(mouseNode, _this, callback, subsequentDelay, initialDelay, minDelay));
+ }
+};
+
+}
+
+if(!dojo._hasResource["dijit._base.wai"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.wai"] = true;
+dojo.provide("dijit._base.wai");
+
+
+
+dijit.wai = {
+ onload: function(){
+ // summary:
+ // Detects if we are in high-contrast mode or not
+
+ // This must be a named function and not an anonymous
+ // function, so that the widget parsing code can make sure it
+ // registers its onload function after this function.
+ // DO NOT USE "this" within this function.
+
+ // create div for testing if high contrast mode is on or images are turned off
+ var div = dojo.create("div",{
+ id: "a11yTestNode",
+ style:{
+ cssText:'border: 1px solid;'
+ + 'border-color:red green;'
+ + 'position: absolute;'
+ + 'height: 5px;'
+ + 'top: -999px;'
+ + 'background-image: url("' + (dojo.config.blankGif || dojo.moduleUrl("dojo", "resources/blank.gif")) + '");'
+ }
+ }, dojo.body());
+
+ // test it
+ var cs = dojo.getComputedStyle(div);
+ if(cs){
+ var bkImg = cs.backgroundImage;
+ var needsA11y = (cs.borderTopColor == cs.borderRightColor) || (bkImg != null && (bkImg == "none" || bkImg == "url(invalid-url:)" ));
+ dojo[needsA11y ? "addClass" : "removeClass"](dojo.body(), "dijit_a11y");
+ if(dojo.isIE){
+ div.outerHTML = ""; // prevent mixed-content warning, see http://support.microsoft.com/kb/925014
+ }else{
+ dojo.body().removeChild(div);
+ }
+ }
+ }
+};
+
+// Test if computer is in high contrast mode.
+// Make sure the a11y test runs first, before widgets are instantiated.
+if(dojo.isIE || dojo.isMoz){ // NOTE: checking in Safari messes things up
+ dojo._loaders.unshift(dijit.wai.onload);
+}
+
+dojo.mixin(dijit, {
+ hasWaiRole: function(/*Element*/ elem, /*String?*/ role){
+ // summary:
+ // Determines if an element has a particular role.
+ // returns:
+ // True if elem has the specific role attribute and false if not.
+ // For backwards compatibility if role parameter not provided,
+ // returns true if has a role
+ var waiRole = this.getWaiRole(elem);
+ return role ? (waiRole.indexOf(role) > -1) : (waiRole.length > 0);
+ },
+
+ getWaiRole: function(/*Element*/ elem){
+ // summary:
+ // Gets the role for an element (which should be a wai role).
+ // returns:
+ // The role of elem or an empty string if elem
+ // does not have a role.
+ return dojo.trim((dojo.attr(elem, "role") || "").replace("wairole:",""));
+ },
+
+ setWaiRole: function(/*Element*/ elem, /*String*/ role){
+ // summary:
+ // Sets the role on an element.
+ // description:
+ // Replace existing role attribute with new role.
+
+ dojo.attr(elem, "role", role);
+ },
+
+ removeWaiRole: function(/*Element*/ elem, /*String*/ role){
+ // summary:
+ // Removes the specified role from an element.
+ // Removes role attribute if no specific role provided (for backwards compat.)
+
+ var roleValue = dojo.attr(elem, "role");
+ if(!roleValue){ return; }
+ if(role){
+ var t = dojo.trim((" " + roleValue + " ").replace(" " + role + " ", " "));
+ dojo.attr(elem, "role", t);
+ }else{
+ elem.removeAttribute("role");
+ }
+ },
+
+ hasWaiState: function(/*Element*/ elem, /*String*/ state){
+ // summary:
+ // Determines if an element has a given state.
+ // description:
+ // Checks for an attribute called "aria-"+state.
+ // returns:
+ // true if elem has a value for the given state and
+ // false if it does not.
+
+ return elem.hasAttribute ? elem.hasAttribute("aria-"+state) : !!elem.getAttribute("aria-"+state);
+ },
+
+ getWaiState: function(/*Element*/ elem, /*String*/ state){
+ // summary:
+ // Gets the value of a state on an element.
+ // description:
+ // Checks for an attribute called "aria-"+state.
+ // returns:
+ // The value of the requested state on elem
+ // or an empty string if elem has no value for state.
+
+ return elem.getAttribute("aria-"+state) || "";
+ },
+
+ setWaiState: function(/*Element*/ elem, /*String*/ state, /*String*/ value){
+ // summary:
+ // Sets a state on an element.
+ // description:
+ // Sets an attribute called "aria-"+state.
+
+ elem.setAttribute("aria-"+state, value);
+ },
+
+ removeWaiState: function(/*Element*/ elem, /*String*/ state){
+ // summary:
+ // Removes a state from an element.
+ // description:
+ // Sets an attribute called "aria-"+state.
+
+ elem.removeAttribute("aria-"+state);
+ }
+});
+
+}
+
+if(!dojo._hasResource["dijit._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base"] = true;
+dojo.provide("dijit._base");
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+if(!dojo._hasResource["dojo.Stateful"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.Stateful"] = true;
+dojo.provide("dojo.Stateful");
+
+
+
+dojo.declare("dojo.Stateful", null, {
+ // summary:
+ // Base class for objects that provide named properties with optional getter/setter
+ // control and the ability to watch for property changes
+ // example:
+ // | var obj = new dojo.Stateful();
+ // | obj.watch("foo", function(){
+ // | console.log("foo changed to " + this.get("foo"));
+ // | });
+ // | obj.set("foo","bar");
+ postscript: function(mixin){
+ if(mixin){
+ dojo.mixin(this, mixin);
+ }
+ },
+
+ get: function(/*String*/name){
+ // summary:
+ // Get a property on a Stateful instance.
+ // name:
+ // The property to get.
+ // description:
+ // Get a named property on a Stateful object. The property may
+ // potentially be retrieved via a getter method in subclasses. In the base class
+ // this just retrieves the object's property.
+ // For example:
+ // | stateful = new dojo.Stateful({foo: 3});
+ // | stateful.get("foo") // returns 3
+ // | stateful.foo // returns 3
+
+ return this[name];
+ },
+ set: function(/*String*/name, /*Object*/value){
+ // summary:
+ // Set a property on a Stateful instance
+ // name:
+ // The property to set.
+ // value:
+ // The value to set in the property.
+ // description:
+ // Sets named properties on a stateful object and notifies any watchers of
+ // the property. A programmatic setter may be defined in subclasses.
+ // For example:
+ // | stateful = new dojo.Stateful();
+ // | stateful.watch(function(name, oldValue, value){
+ // | // this will be called on the set below
+ // | }
+ // | stateful.set(foo, 5);
+ //
+ // set() may also be called with a hash of name/value pairs, ex:
+ // | myObj.set({
+ // | foo: "Howdy",
+ // | bar: 3
+ // | })
+ // This is equivalent to calling set(foo, "Howdy") and set(bar, 3)
+ if(typeof name === "object"){
+ for(var x in name){
+ this.set(x, name[x]);
+ }
+ return this;
+ }
+ var oldValue = this[name];
+ this[name] = value;
+ if(this._watchCallbacks){
+ this._watchCallbacks(name, oldValue, value);
+ }
+ return this;
+ },
+ watch: function(/*String?*/name, /*Function*/callback){
+ // summary:
+ // Watches a property for changes
+ // name:
+ // Indicates the property to watch. This is optional (the callback may be the
+ // only parameter), and if omitted, all the properties will be watched
+ // returns:
+ // An object handle for the watch. The unwatch method of this object
+ // can be used to discontinue watching this property:
+ // | var watchHandle = obj.watch("foo", callback);
+ // | watchHandle.unwatch(); // callback won't be called now
+ // callback:
+ // The function to execute when the property changes. This will be called after
+ // the property has been changed. The callback will be called with the |this|
+ // set to the instance, the first argument as the name of the property, the
+ // second argument as the old value and the third argument as the new value.
+
+ var callbacks = this._watchCallbacks;
+ if(!callbacks){
+ var self = this;
+ callbacks = this._watchCallbacks = function(name, oldValue, value, ignoreCatchall){
+ var notify = function(propertyCallbacks){
+ if(propertyCallbacks){
+ propertyCallbacks = propertyCallbacks.slice();
+ for(var i = 0, l = propertyCallbacks.length; i < l; i++){
+ try{
+ propertyCallbacks[i].call(self, name, oldValue, value);
+ }catch(e){
+ console.error(e);
+ }
+ }
+ }
+ };
+ notify(callbacks['_' + name]);
+ if(!ignoreCatchall){
+ notify(callbacks["*"]); // the catch-all
+ }
+ }; // we use a function instead of an object so it will be ignored by JSON conversion
+ }
+ if(!callback && typeof name === "function"){
+ callback = name;
+ name = "*";
+ }else{
+ // prepend with dash to prevent name conflicts with function (like "name" property)
+ name = '_' + name;
+ }
+ var propertyCallbacks = callbacks[name];
+ if(typeof propertyCallbacks !== "object"){
+ propertyCallbacks = callbacks[name] = [];
+ }
+ propertyCallbacks.push(callback);
+ return {
+ unwatch: function(){
+ propertyCallbacks.splice(dojo.indexOf(propertyCallbacks, callback), 1);
+ }
+ };
+ }
+
+});
+
+}
+
+if(!dojo._hasResource["dijit._WidgetBase"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._WidgetBase"] = true;
+dojo.provide("dijit._WidgetBase");
+
+
+
+
+
+(function(){
+
+dojo.declare("dijit._WidgetBase", dojo.Stateful, {
+ // summary:
+ // Future base class for all Dijit widgets.
+ // _Widget extends this class adding support for various features needed by desktop.
+
+ // id: [const] String
+ // A unique, opaque ID string that can be assigned by users or by the
+ // system. If the developer passes an ID which is known not to be
+ // unique, the specified ID is ignored and the system-generated ID is
+ // used instead.
+ id: "",
+
+ // lang: [const] String
+ // Rarely used. Overrides the default Dojo locale used to render this widget,
+ // as defined by the [HTML LANG](http://www.w3.org/TR/html401/struct/dirlang.html#adef-lang) attribute.
+ // Value must be among the list of locales specified during by the Dojo bootstrap,
+ // formatted according to [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt) (like en-us).
+ lang: "",
+
+ // dir: [const] String
+ // Bi-directional support, as defined by the [HTML DIR](http://www.w3.org/TR/html401/struct/dirlang.html#adef-dir)
+ // attribute. Either left-to-right "ltr" or right-to-left "rtl". If undefined, widgets renders in page's
+ // default direction.
+ dir: "",
+
+ // class: String
+ // HTML class attribute
+ "class": "",
+
+ // style: String||Object
+ // HTML style attributes as cssText string or name/value hash
+ style: "",
+
+ // title: String
+ // HTML title attribute.
+ //
+ // For form widgets this specifies a tooltip to display when hovering over
+ // the widget (just like the native HTML title attribute).
+ //
+ // For TitlePane or for when this widget is a child of a TabContainer, AccordionContainer,
+ // etc., it's used to specify the tab label, accordion pane title, etc.
+ title: "",
+
+ // tooltip: String
+ // When this widget's title attribute is used to for a tab label, accordion pane title, etc.,
+ // this specifies the tooltip to appear when the mouse is hovered over that text.
+ tooltip: "",
+
+ // baseClass: [protected] String
+ // Root CSS class of the widget (ex: dijitTextBox), used to construct CSS classes to indicate
+ // widget state.
+ baseClass: "",
+
+ // srcNodeRef: [readonly] DomNode
+ // pointer to original DOM node
+ srcNodeRef: null,
+
+ // domNode: [readonly] DomNode
+ // This is our visible representation of the widget! Other DOM
+ // Nodes may by assigned to other properties, usually through the
+ // template system's dojoAttachPoint syntax, but the domNode
+ // property is the canonical "top level" node in widget UI.
+ domNode: null,
+
+ // containerNode: [readonly] DomNode
+ // Designates where children of the source DOM node will be placed.
+ // "Children" in this case refers to both DOM nodes and widgets.
+ // For example, for myWidget:
+ //
+ // | <div dojoType=myWidget>
+ // | <b> here's a plain DOM node
+ // | <span dojoType=subWidget>and a widget</span>
+ // | <i> and another plain DOM node </i>
+ // | </div>
+ //
+ // containerNode would point to:
+ //
+ // | <b> here's a plain DOM node
+ // | <span dojoType=subWidget>and a widget</span>
+ // | <i> and another plain DOM node </i>
+ //
+ // In templated widgets, "containerNode" is set via a
+ // dojoAttachPoint assignment.
+ //
+ // containerNode must be defined for any widget that accepts innerHTML
+ // (like ContentPane or BorderContainer or even Button), and conversely
+ // is null for widgets that don't, like TextBox.
+ containerNode: null,
+
+/*=====
+ // _started: Boolean
+ // startup() has completed.
+ _started: false,
+=====*/
+
+ // attributeMap: [protected] Object
+ // attributeMap sets up a "binding" between attributes (aka properties)
+ // of the widget and the widget's DOM.
+ // Changes to widget attributes listed in attributeMap will be
+ // reflected into the DOM.
+ //
+ // For example, calling set('title', 'hello')
+ // on a TitlePane will automatically cause the TitlePane's DOM to update
+ // with the new title.
+ //
+ // attributeMap is a hash where the key is an attribute of the widget,
+ // and the value reflects a binding to a:
+ //
+ // - DOM node attribute
+ // | focus: {node: "focusNode", type: "attribute"}
+ // Maps this.focus to this.focusNode.focus
+ //
+ // - DOM node innerHTML
+ // | title: { node: "titleNode", type: "innerHTML" }
+ // Maps this.title to this.titleNode.innerHTML
+ //
+ // - DOM node innerText
+ // | title: { node: "titleNode", type: "innerText" }
+ // Maps this.title to this.titleNode.innerText
+ //
+ // - DOM node CSS class
+ // | myClass: { node: "domNode", type: "class" }
+ // Maps this.myClass to this.domNode.className
+ //
+ // If the value is an array, then each element in the array matches one of the
+ // formats of the above list.
+ //
+ // There are also some shorthands for backwards compatibility:
+ // - string --> { node: string, type: "attribute" }, for example:
+ // | "focusNode" ---> { node: "focusNode", type: "attribute" }
+ // - "" --> { node: "domNode", type: "attribute" }
+ attributeMap: {id:"", dir:"", lang:"", "class":"", style:"", title:""},
+
+ // _blankGif: [protected] String
+ // Path to a blank 1x1 image.
+ // Used by <img> nodes in templates that really get their image via CSS background-image.
+ _blankGif: (dojo.config.blankGif || dojo.moduleUrl("dojo", "resources/blank.gif")).toString(),
+
+ //////////// INITIALIZATION METHODS ///////////////////////////////////////
+
+ postscript: function(/*Object?*/params, /*DomNode|String*/srcNodeRef){
+ // summary:
+ // Kicks off widget instantiation. See create() for details.
+ // tags:
+ // private
+ this.create(params, srcNodeRef);
+ },
+
+ create: function(/*Object?*/params, /*DomNode|String?*/srcNodeRef){
+ // summary:
+ // Kick off the life-cycle of a widget
+ // params:
+ // Hash of initialization parameters for widget, including
+ // scalar values (like title, duration etc.) and functions,
+ // typically callbacks like onClick.
+ // srcNodeRef:
+ // If a srcNodeRef (DOM node) is specified:
+ // - use srcNodeRef.innerHTML as my contents
+ // - if this is a behavioral widget then apply behavior
+ // to that srcNodeRef
+ // - otherwise, replace srcNodeRef with my generated DOM
+ // tree
+ // description:
+ // Create calls a number of widget methods (postMixInProperties, buildRendering, postCreate,
+ // etc.), some of which of you'll want to override. See http://docs.dojocampus.org/dijit/_Widget
+ // for a discussion of the widget creation lifecycle.
+ //
+ // Of course, adventurous developers could override create entirely, but this should
+ // only be done as a last resort.
+ // tags:
+ // private
+
+ // store pointer to original DOM tree
+ this.srcNodeRef = dojo.byId(srcNodeRef);
+
+ // For garbage collection. An array of handles returned by Widget.connect()
+ // Each handle returned from Widget.connect() is an array of handles from dojo.connect()
+ this._connects = [];
+
+ // For garbage collection. An array of handles returned by Widget.subscribe()
+ // The handle returned from Widget.subscribe() is the handle returned from dojo.subscribe()
+ this._subscribes = [];
+
+ // mix in our passed parameters
+ if(this.srcNodeRef && (typeof this.srcNodeRef.id == "string")){ this.id = this.srcNodeRef.id; }
+ if(params){
+ this.params = params;
+ dojo._mixin(this, params);
+ }
+ this.postMixInProperties();
+
+ // generate an id for the widget if one wasn't specified
+ // (be sure to do this before buildRendering() because that function might
+ // expect the id to be there.)
+ if(!this.id){
+ this.id = dijit.getUniqueId(this.declaredClass.replace(/\./g,"_"));
+ }
+ dijit.registry.add(this);
+
+ this.buildRendering();
+
+ if(this.domNode){
+ // Copy attributes listed in attributeMap into the [newly created] DOM for the widget.
+ // Also calls custom setters for all attributes with custom setters.
+ this._applyAttributes();
+
+ // If srcNodeRef was specified, then swap out original srcNode for this widget's DOM tree.
+ // For 2.0, move this after postCreate(). postCreate() shouldn't depend on the
+ // widget being attached to the DOM since it isn't when a widget is created programmatically like
+ // new MyWidget({}). See #11635.
+ var source = this.srcNodeRef;
+ if(source && source.parentNode && this.domNode !== source){
+ source.parentNode.replaceChild(this.domNode, source);
+ }
+ }
+
+ if(this.domNode){
+ // Note: for 2.0 may want to rename widgetId to dojo._scopeName + "_widgetId",
+ // assuming that dojo._scopeName even exists in 2.0
+ this.domNode.setAttribute("widgetId", this.id);
+ }
+ this.postCreate();
+
+ // If srcNodeRef has been processed and removed from the DOM (e.g. TemplatedWidget) then delete it to allow GC.
+ if(this.srcNodeRef && !this.srcNodeRef.parentNode){
+ delete this.srcNodeRef;
+ }
+
+ this._created = true;
+ },
+
+ _applyAttributes: function(){
+ // summary:
+ // Step during widget creation to copy all widget attributes to the
+ // DOM as per attributeMap and _setXXXAttr functions.
+ // description:
+ // Skips over blank/false attribute values, unless they were explicitly specified
+ // as parameters to the widget, since those are the default anyway,
+ // and setting tabIndex="" is different than not setting tabIndex at all.
+ //
+ // It processes the attributes in the attribute map first, and then
+ // it goes through and processes the attributes for the _setXXXAttr
+ // functions that have been specified
+ // tags:
+ // private
+ var condAttrApply = function(attr, scope){
+ if((scope.params && attr in scope.params) || scope[attr]){
+ scope.set(attr, scope[attr]);
+ }
+ };
+
+ // Do the attributes in attributeMap
+ for(var attr in this.attributeMap){
+ condAttrApply(attr, this);
+ }
+
+ // And also any attributes with custom setters
+ dojo.forEach(this._getSetterAttributes(), function(a){
+ if(!(a in this.attributeMap)){
+ condAttrApply(a, this);
+ }
+ }, this);
+ },
+
+ _getSetterAttributes: function(){
+ // summary:
+ // Returns list of attributes with custom setters for this widget
+ var ctor = this.constructor;
+ if(!ctor._setterAttrs){
+ var r = (ctor._setterAttrs = []),
+ attrs,
+ proto = ctor.prototype;
+ for(var fxName in proto){
+ if(dojo.isFunction(proto[fxName]) && (attrs = fxName.match(/^_set([a-zA-Z]*)Attr$/)) && attrs[1]){
+ r.push(attrs[1].charAt(0).toLowerCase() + attrs[1].substr(1));
+ }
+ }
+ }
+ return ctor._setterAttrs; // String[]
+ },
+
+ postMixInProperties: function(){
+ // summary:
+ // Called after the parameters to the widget have been read-in,
+ // but before the widget template is instantiated. Especially
+ // useful to set properties that are referenced in the widget
+ // template.
+ // tags:
+ // protected
+ },
+
+ buildRendering: function(){
+ // summary:
+ // Construct the UI for this widget, setting this.domNode
+ // description:
+ // Most widgets will mixin `dijit._Templated`, which implements this
+ // method.
+ // tags:
+ // protected
+
+ if(!this.domNode){
+ // Create root node if it wasn't created by _Templated
+ this.domNode = this.srcNodeRef || dojo.create('div');
+ }
+
+ // baseClass is a single class name or occasionally a space-separated list of names.
+ // Add those classes to the DOMNode. If RTL mode then also add with Rtl suffix.
+ // TODO: make baseClass custom setter
+ if(this.baseClass){
+ var classes = this.baseClass.split(" ");
+ if(!this.isLeftToRight()){
+ classes = classes.concat( dojo.map(classes, function(name){ return name+"Rtl"; }));
+ }
+ dojo.addClass(this.domNode, classes);
+ }
+ },
+
+ postCreate: function(){
+ // summary:
+ // Processing after the DOM fragment is created
+ // description:
+ // Called after the DOM fragment has been created, but not necessarily
+ // added to the document. Do not include any operations which rely on
+ // node dimensions or placement.
+ // tags:
+ // protected
+ },
+
+ startup: function(){
+ // summary:
+ // Processing after the DOM fragment is added to the document
+ // description:
+ // Called after a widget and its children have been created and added to the page,
+ // and all related widgets have finished their create() cycle, up through postCreate().
+ // This is useful for composite widgets that need to control or layout sub-widgets.
+ // Many layout widgets can use this as a wiring phase.
+ this._started = true;
+ },
+
+ //////////// DESTROY FUNCTIONS ////////////////////////////////
+
+ destroyRecursive: function(/*Boolean?*/ preserveDom){
+ // summary:
+ // Destroy this widget and its descendants
+ // description:
+ // This is the generic "destructor" function that all widget users
+ // should call to cleanly discard with a widget. Once a widget is
+ // destroyed, it is removed from the manager object.
+ // preserveDom:
+ // If true, this method will leave the original DOM structure
+ // alone of descendant Widgets. Note: This will NOT work with
+ // dijit._Templated widgets.
+
+ this._beingDestroyed = true;
+ this.destroyDescendants(preserveDom);
+ this.destroy(preserveDom);
+ },
+
+ destroy: function(/*Boolean*/ preserveDom){
+ // summary:
+ // Destroy this widget, but not its descendants.
+ // This method will, however, destroy internal widgets such as those used within a template.
+ // preserveDom: Boolean
+ // If true, this method will leave the original DOM structure alone.
+ // Note: This will not yet work with _Templated widgets
+
+ this._beingDestroyed = true;
+ this.uninitialize();
+ var d = dojo,
+ dfe = d.forEach,
+ dun = d.unsubscribe;
+ dfe(this._connects, function(array){
+ dfe(array, d.disconnect);
+ });
+ dfe(this._subscribes, function(handle){
+ dun(handle);
+ });
+
+ // destroy widgets created as part of template, etc.
+ dfe(this._supportingWidgets || [], function(w){
+ if(w.destroyRecursive){
+ w.destroyRecursive();
+ }else if(w.destroy){
+ w.destroy();
+ }
+ });
+
+ this.destroyRendering(preserveDom);
+ dijit.registry.remove(this.id);
+ this._destroyed = true;
+ },
+
+ destroyRendering: function(/*Boolean?*/ preserveDom){
+ // summary:
+ // Destroys the DOM nodes associated with this widget
+ // preserveDom:
+ // If true, this method will leave the original DOM structure alone
+ // during tear-down. Note: this will not work with _Templated
+ // widgets yet.
+ // tags:
+ // protected
+
+ if(this.bgIframe){
+ this.bgIframe.destroy(preserveDom);
+ delete this.bgIframe;
+ }
+
+ if(this.domNode){
+ if(preserveDom){
+ dojo.removeAttr(this.domNode, "widgetId");
+ }else{
+ dojo.destroy(this.domNode);
+ }
+ delete this.domNode;
+ }
+
+ if(this.srcNodeRef){
+ if(!preserveDom){
+ dojo.destroy(this.srcNodeRef);
+ }
+ delete this.srcNodeRef;
+ }
+ },
+
+ destroyDescendants: function(/*Boolean?*/ preserveDom){
+ // summary:
+ // Recursively destroy the children of this widget and their
+ // descendants.
+ // preserveDom:
+ // If true, the preserveDom attribute is passed to all descendant
+ // widget's .destroy() method. Not for use with _Templated
+ // widgets.
+
+ // get all direct descendants and destroy them recursively
+ dojo.forEach(this.getChildren(), function(widget){
+ if(widget.destroyRecursive){
+ widget.destroyRecursive(preserveDom);
+ }
+ });
+ },
+
+ uninitialize: function(){
+ // summary:
+ // Stub function. Override to implement custom widget tear-down
+ // behavior.
+ // tags:
+ // protected
+ return false;
+ },
+
+ ////////////////// GET/SET, CUSTOM SETTERS, ETC. ///////////////////
+
+ _setClassAttr: function(/*String*/ value){
+ // summary:
+ // Custom setter for the CSS "class" attribute
+ // tags:
+ // protected
+ var mapNode = this[this.attributeMap["class"] || 'domNode'];
+ dojo.replaceClass(mapNode, value, this["class"]);
+ this._set("class", value);
+ },
+
+ _setStyleAttr: function(/*String||Object*/ value){
+ // summary:
+ // Sets the style attribute of the widget according to value,
+ // which is either a hash like {height: "5px", width: "3px"}
+ // or a plain string
+ // description:
+ // Determines which node to set the style on based on style setting
+ // in attributeMap.
+ // tags:
+ // protected
+
+ var mapNode = this[this.attributeMap.style || 'domNode'];
+
+ // Note: technically we should revert any style setting made in a previous call
+ // to his method, but that's difficult to keep track of.
+
+ if(dojo.isObject(value)){
+ dojo.style(mapNode, value);
+ }else{
+ if(mapNode.style.cssText){
+ mapNode.style.cssText += "; " + value;
+ }else{
+ mapNode.style.cssText = value;
+ }
+ }
+
+ this._set("style", value);
+ },
+
+ _attrToDom: function(/*String*/ attr, /*String*/ value){
+ // summary:
+ // Reflect a widget attribute (title, tabIndex, duration etc.) to
+ // the widget DOM, as specified in attributeMap.
+ // Note some attributes like "type"
+ // cannot be processed this way as they are not mutable.
+ //
+ // tags:
+ // private
+
+ var commands = this.attributeMap[attr];
+ dojo.forEach(dojo.isArray(commands) ? commands : [commands], function(command){
+
+ // Get target node and what we are doing to that node
+ var mapNode = this[command.node || command || "domNode"]; // DOM node
+ var type = command.type || "attribute"; // class, innerHTML, innerText, or attribute
+
+ switch(type){
+ case "attribute":
+ if(dojo.isFunction(value)){ // functions execute in the context of the widget
+ value = dojo.hitch(this, value);
+ }
+
+ // Get the name of the DOM node attribute; usually it's the same
+ // as the name of the attribute in the widget (attr), but can be overridden.
+ // Also maps handler names to lowercase, like onSubmit --> onsubmit
+ var attrName = command.attribute ? command.attribute :
+ (/^on[A-Z][a-zA-Z]*$/.test(attr) ? attr.toLowerCase() : attr);
+
+ dojo.attr(mapNode, attrName, value);
+ break;
+ case "innerText":
+ mapNode.innerHTML = "";
+ mapNode.appendChild(dojo.doc.createTextNode(value));
+ break;
+ case "innerHTML":
+ mapNode.innerHTML = value;
+ break;
+ case "class":
+ dojo.replaceClass(mapNode, value, this[attr]);
+ break;
+ }
+ }, this);
+ },
+
+ get: function(name){
+ // summary:
+ // Get a property from a widget.
+ // name:
+ // The property to get.
+ // description:
+ // Get a named property from a widget. The property may
+ // potentially be retrieved via a getter method. If no getter is defined, this
+ // just retrieves the object's property.
+ // For example, if the widget has a properties "foo"
+ // and "bar" and a method named "_getFooAttr", calling:
+ // | myWidget.get("foo");
+ // would be equivalent to writing:
+ // | widget._getFooAttr();
+ // and:
+ // | myWidget.get("bar");
+ // would be equivalent to writing:
+ // | widget.bar;
+ var names = this._getAttrNames(name);
+ return this[names.g] ? this[names.g]() : this[name];
+ },
+
+ set: function(name, value){
+ // summary:
+ // Set a property on a widget
+ // name:
+ // The property to set.
+ // value:
+ // The value to set in the property.
+ // description:
+ // Sets named properties on a widget which may potentially be handled by a
+ // setter in the widget.
+ // For example, if the widget has a properties "foo"
+ // and "bar" and a method named "_setFooAttr", calling:
+ // | myWidget.set("foo", "Howdy!");
+ // would be equivalent to writing:
+ // | widget._setFooAttr("Howdy!");
+ // and:
+ // | myWidget.set("bar", 3);
+ // would be equivalent to writing:
+ // | widget.bar = 3;
+ //
+ // set() may also be called with a hash of name/value pairs, ex:
+ // | myWidget.set({
+ // | foo: "Howdy",
+ // | bar: 3
+ // | })
+ // This is equivalent to calling set(foo, "Howdy") and set(bar, 3)
+
+ if(typeof name === "object"){
+ for(var x in name){
+ this.set(x, name[x]);
+ }
+ return this;
+ }
+ var names = this._getAttrNames(name);
+ if(this[names.s]){
+ // use the explicit setter
+ var result = this[names.s].apply(this, Array.prototype.slice.call(arguments, 1));
+ }else{
+ // if param is specified as DOM node attribute, copy it
+ if(name in this.attributeMap){
+ this._attrToDom(name, value);
+ }
+ this._set(name, value);
+ }
+ return result || this;
+ },
+
+ _attrPairNames: {}, // shared between all widgets
+ _getAttrNames: function(name){
+ // summary:
+ // Helper function for get() and set().
+ // Caches attribute name values so we don't do the string ops every time.
+ // tags:
+ // private
+
+ var apn = this._attrPairNames;
+ if(apn[name]){ return apn[name]; }
+ var uc = name.charAt(0).toUpperCase() + name.substr(1);
+ return (apn[name] = {
+ n: name+"Node",
+ s: "_set"+uc+"Attr",
+ g: "_get"+uc+"Attr"
+ });
+ },
+
+ _set: function(/*String*/ name, /*anything*/ value){
+ // summary:
+ // Helper function to set new value for specified attribute, and call handlers
+ // registered with watch() if the value has changed.
+ var oldValue = this[name];
+ this[name] = value;
+ if(this._watchCallbacks && this._created && value !== oldValue){
+ this._watchCallbacks(name, oldValue, value);
+ }
+ },
+
+ toString: function(){
+ // summary:
+ // Returns a string that represents the widget
+ // description:
+ // When a widget is cast to a string, this method will be used to generate the
+ // output. Currently, it does not implement any sort of reversible
+ // serialization.
+ return '[Widget ' + this.declaredClass + ', ' + (this.id || 'NO ID') + ']'; // String
+ },
+
+ getDescendants: function(){
+ // summary:
+ // Returns all the widgets contained by this, i.e., all widgets underneath this.containerNode.
+ // This method should generally be avoided as it returns widgets declared in templates, which are
+ // supposed to be internal/hidden, but it's left here for back-compat reasons.
+
+ return this.containerNode ? dojo.query('[widgetId]', this.containerNode).map(dijit.byNode) : []; // dijit._Widget[]
+ },
+
+ getChildren: function(){
+ // summary:
+ // Returns all the widgets contained by this, i.e., all widgets underneath this.containerNode.
+ // Does not return nested widgets, nor widgets that are part of this widget's template.
+ return this.containerNode ? dijit.findWidgets(this.containerNode) : []; // dijit._Widget[]
+ },
+
+ connect: function(
+ /*Object|null*/ obj,
+ /*String|Function*/ event,
+ /*String|Function*/ method){
+ // summary:
+ // Connects specified obj/event to specified method of this object
+ // and registers for disconnect() on widget destroy.
+ // description:
+ // Provide widget-specific analog to dojo.connect, except with the
+ // implicit use of this widget as the target object.
+ // Events connected with `this.connect` are disconnected upon
+ // destruction.
+ // returns:
+ // A handle that can be passed to `disconnect` in order to disconnect before
+ // the widget is destroyed.
+ // example:
+ // | var btn = new dijit.form.Button();
+ // | // when foo.bar() is called, call the listener we're going to
+ // | // provide in the scope of btn
+ // | btn.connect(foo, "bar", function(){
+ // | console.debug(this.toString());
+ // | });
+ // tags:
+ // protected
+
+ var handles = [dojo._connect(obj, event, this, method)];
+ this._connects.push(handles);
+ return handles; // _Widget.Handle
+ },
+
+ disconnect: function(/* _Widget.Handle */ handles){
+ // summary:
+ // Disconnects handle created by `connect`.
+ // Also removes handle from this widget's list of connects.
+ // tags:
+ // protected
+ for(var i=0; i<this._connects.length; i++){
+ if(this._connects[i] == handles){
+ dojo.forEach(handles, dojo.disconnect);
+ this._connects.splice(i, 1);
+ return;
+ }
+ }
+ },
+
+ subscribe: function(
+ /*String*/ topic,
+ /*String|Function*/ method){
+ // summary:
+ // Subscribes to the specified topic and calls the specified method
+ // of this object and registers for unsubscribe() on widget destroy.
+ // description:
+ // Provide widget-specific analog to dojo.subscribe, except with the
+ // implicit use of this widget as the target object.
+ // example:
+ // | var btn = new dijit.form.Button();
+ // | // when /my/topic is published, this button changes its label to
+ // | // be the parameter of the topic.
+ // | btn.subscribe("/my/topic", function(v){
+ // | this.set("label", v);
+ // | });
+ var handle = dojo.subscribe(topic, this, method);
+
+ // return handles for Any widget that may need them
+ this._subscribes.push(handle);
+ return handle;
+ },
+
+ unsubscribe: function(/*Object*/ handle){
+ // summary:
+ // Unsubscribes handle created by this.subscribe.
+ // Also removes handle from this widget's list of subscriptions
+ for(var i=0; i<this._subscribes.length; i++){
+ if(this._subscribes[i] == handle){
+ dojo.unsubscribe(handle);
+ this._subscribes.splice(i, 1);
+ return;
+ }
+ }
+ },
+
+ isLeftToRight: function(){
+ // summary:
+ // Return this widget's explicit or implicit orientation (true for LTR, false for RTL)
+ // tags:
+ // protected
+ return this.dir ? (this.dir == "ltr") : dojo._isBodyLtr(); //Boolean
+ },
+
+ placeAt: function(/* String|DomNode|_Widget */reference, /* String?|Int? */position){
+ // summary:
+ // Place this widget's domNode reference somewhere in the DOM based
+ // on standard dojo.place conventions, or passing a Widget reference that
+ // contains and addChild member.
+ //
+ // description:
+ // A convenience function provided in all _Widgets, providing a simple
+ // shorthand mechanism to put an existing (or newly created) Widget
+ // somewhere in the dom, and allow chaining.
+ //
+ // reference:
+ // The String id of a domNode, a domNode reference, or a reference to a Widget posessing
+ // an addChild method.
+ //
+ // position:
+ // If passed a string or domNode reference, the position argument
+ // accepts a string just as dojo.place does, one of: "first", "last",
+ // "before", or "after".
+ //
+ // If passed a _Widget reference, and that widget reference has an ".addChild" method,
+ // it will be called passing this widget instance into that method, supplying the optional
+ // position index passed.
+ //
+ // returns:
+ // dijit._Widget
+ // Provides a useful return of the newly created dijit._Widget instance so you
+ // can "chain" this function by instantiating, placing, then saving the return value
+ // to a variable.
+ //
+ // example:
+ // | // create a Button with no srcNodeRef, and place it in the body:
+ // | var button = new dijit.form.Button({ label:"click" }).placeAt(dojo.body());
+ // | // now, 'button' is still the widget reference to the newly created button
+ // | dojo.connect(button, "onClick", function(e){ console.log('click'); });
+ //
+ // example:
+ // | // create a button out of a node with id="src" and append it to id="wrapper":
+ // | var button = new dijit.form.Button({},"src").placeAt("wrapper");
+ //
+ // example:
+ // | // place a new button as the first element of some div
+ // | var button = new dijit.form.Button({ label:"click" }).placeAt("wrapper","first");
+ //
+ // example:
+ // | // create a contentpane and add it to a TabContainer
+ // | var tc = dijit.byId("myTabs");
+ // | new dijit.layout.ContentPane({ href:"foo.html", title:"Wow!" }).placeAt(tc)
+
+ if(reference.declaredClass && reference.addChild){
+ reference.addChild(this, position);
+ }else{
+ dojo.place(this.domNode, reference, position);
+ }
+ return this;
+ }
+});
+
+})();
+
+}
+
+if(!dojo._hasResource["dojox.mobile._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile._base"] = true;
+dojo.provide("dojox.mobile._base");
+
+
+dojo.isBB = (navigator.userAgent.indexOf("BlackBerry") != -1) && !dojo.isWebKit;
+
+// summary:
+// Mobile Widgets
+// description:
+// This module provides a number of widgets that can be used to build
+// web-based applications for mobile devices such as iPhone or Android.
+// These widgets work best with webkit-based browsers, such as Safari or
+// Chrome, since webkit-specific CSS3 features are used.
+// However, the widgets should work in a "graceful degradation" manner
+// even on non-CSS3 browsers, such as IE or Firefox. In that case,
+// fancy effects, such as animation, gradient color, or round corner
+// rectangle, may not work, but you can still operate your application.
+//
+// Furthermore, as a separate file, a compatibility module,
+// dojox.mobile.compat, is available that simulates some of CSS3 features
+// used in this module. If you use the compatibility module, fancy visual
+// effects work better even on non-CSS3 browsers.
+//
+// Note that use of dijit._Container, dijit._Contained, dijit._Templated,
+// and dojo.query is intentionally avoided to reduce download code size.
+
+dojo.declare(
+ "dojox.mobile.View",
+ dijit._WidgetBase,
+{
+ // summary:
+ // A widget that represents a view that occupies the full screen
+ // description:
+ // View acts as a container for any HTML and/or widgets. An entire HTML page
+ // can have multiple View widgets and the user can navigate through
+ // the views back and forth without page transitions.
+
+ // selected: Boolean
+ // If true, the view is displayed at startup time.
+ selected: false,
+
+ // keepScrollPos: Boolean
+ // If true, the scroll position is kept between views.
+ keepScrollPos: true,
+
+ _started: false,
+
+ constructor: function(params, node){
+ if(node){
+ dojo.byId(node).style.visibility = "hidden";
+ }
+ },
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("DIV");
+ this.domNode.className = "mblView";
+ this.connect(this.domNode, "webkitAnimationEnd", "onAnimationEnd");
+ this.connect(this.domNode, "webkitAnimationStart", "onAnimationStart");
+ var id = location.href.match(/#(\w+)([^\w=]|$)/) ? RegExp.$1 : null;
+
+ this._visible = this.selected && !id || this.id == id;
+
+ if(this.selected){
+ dojox.mobile._defaultView = this;
+ }
+ },
+
+ startup: function(){
+ if(this._started){ return; }
+ var _this = this;
+ setTimeout(function(){
+ if(!_this._visible){
+ _this.domNode.style.display = "none";
+ }else{
+ dojox.mobile.currentView = _this;
+ _this.onStartView();
+ }
+ _this.domNode.style.visibility = "visible";
+ }, dojo.isIE?100:0); // give IE a little time to complete drawing
+ this._started = true;
+ },
+
+ onStartView: function(){
+ // Stub function to connect to from your application.
+ // Called only when this view is shown at startup time.
+ },
+
+ onBeforeTransitionIn: function(moveTo, dir, transition, context, method){
+ // Stub function to connect to from your application.
+ },
+
+ onAfterTransitionIn: function(moveTo, dir, transition, context, method){
+ // Stub function to connect to from your application.
+ },
+
+ onBeforeTransitionOut: function(moveTo, dir, transition, context, method){
+ // Stub function to connect to from your application.
+ },
+
+ onAfterTransitionOut: function(moveTo, dir, transition, context, method){
+ // Stub function to connect to from your application.
+ },
+
+ _saveState: function(moveTo, dir, transition, context, method){
+ this._context = context;
+ this._method = method;
+ if(transition == "none" || !dojo.isWebKit){
+ transition = null;
+ }
+ this._moveTo = moveTo;
+ this._dir = dir;
+ this._transition = transition;
+ this._arguments = [];
+ var i;
+ for(i = 0; i < arguments.length; i++){
+ this._arguments.push(arguments[i]);
+ }
+ this._args = [];
+ if(context || method){
+ for(i = 5; i < arguments.length; i++){
+ this._args.push(arguments[i]);
+ }
+ }
+ },
+
+ performTransition: function(/*String*/moveTo, /*Number*/dir, /*String*/transition,
+ /*Object|null*/context, /*String|Function*/method /*optional args*/){
+ // summary:
+ // Function to perform the various types of view transitions, such as fade, slide, and flip.
+ // moveTo: String
+ // The destination view id to transition the current view to.
+ // If null, transitions to a blank view.
+ // dir: Number
+ // The transition direction. If 1, transition forward. If -1, transition backward.
+ // For example, the slide transition slides the view from right to left when dir == 1,
+ // and from left to right when dir == -1.
+ // transision: String
+ // The type of transition to perform. "slide", "fade", or "flip"
+ // context: Object
+ // The object that the callback function will receive as "this".
+ // method: String|Function
+ // A callback function that is called when the transition has been finished.
+ // A function reference, or name of a function in context.
+ // tags:
+ // public
+ // example:
+ // Transitions to the blank view, and then opens another page.
+ // | performTransition(null, 1, "slide", null, function(){location.href = href;});
+ if(dojo.hash){
+ if(typeof(moveTo) == "string" && moveTo.charAt(0) == '#' && !dojox.mobile._params){
+ dojox.mobile._params = [];
+ for(var i = 0; i < arguments.length; i++){
+ dojox.mobile._params.push(arguments[i]);
+ }
+ dojo.hash(moveTo);
+ return;
+ }
+ }
+ this._saveState.apply(this, arguments);
+ var toNode;
+ if(moveTo){
+ if(typeof(moveTo) == "string"){
+ // removes a leading hash mark (#) and params if exists
+ // ex. "#bar&myParam=0003" -> "bar"
+ moveTo.match(/^#?([^&]+)/);
+ toNode = RegExp.$1;
+ }else{
+ toNode = moveTo;
+ }
+ }else{
+ if(!this._dummyNode){
+ this._dummyNode = dojo.doc.createElement("DIV");
+ dojo.body().appendChild(this._dummyNode);
+ }
+ toNode = this._dummyNode;
+ }
+ var fromNode = this.domNode;
+ toNode = this.toNode = dojo.byId(toNode);
+ if(!toNode){ alert("dojox.mobile.View#performTransition: destination view not found: "+toNode); }
+ toNode.style.visibility = "hidden";
+ toNode.style.display = "";
+ this.onBeforeTransitionOut.apply(this, arguments);
+ var toWidget = dijit.byNode(toNode);
+ if(toWidget){
+ // perform view transition keeping the scroll position
+ if(this.keepScrollPos && !dijit.getEnclosingWidget(this.domNode.parentNode)){
+ var scrollTop = dojo.body().scrollTop || dojo.doc.documentElement.scrollTop || dojo.global.pageYOffset || 0;
+ if(dir == 1){
+ toNode.style.top = "0px";
+ if(scrollTop > 1){
+ fromNode.style.top = -scrollTop + "px";
+ if(dojo.config["mblHideAddressBar"] !== false){
+ setTimeout(function(){ // iPhone needs setTimeout
+ dojo.global.scrollTo(0, 1);
+ }, 0);
+ }
+ }
+ }else{
+ if(scrollTop > 1 || toNode.offsetTop !== 0){
+ var toTop = -toNode.offsetTop;
+ toNode.style.top = "0px";
+ fromNode.style.top = toTop - scrollTop + "px";
+ if(dojo.config["mblHideAddressBar"] !== false && toTop > 0){
+ setTimeout(function(){ // iPhone needs setTimeout
+ dojo.global.scrollTo(0, toTop + 1);
+ }, 0);
+ }
+ }
+ }
+ }else{
+ toNode.style.top = "0px";
+ }
+ toWidget.onBeforeTransitionIn.apply(toWidget, arguments);
+ }
+ toNode.style.display = "none";
+ toNode.style.visibility = "visible";
+ this._doTransition(fromNode, toNode, transition, dir);
+ },
+
+ _doTransition: function(fromNode, toNode, transition, dir){
+ var rev = (dir == -1) ? " reverse" : "";
+ toNode.style.display = "";
+ if(!transition || transition == "none"){
+ this.domNode.style.display = "none";
+ this.invokeCallback();
+ }else{
+ dojo.addClass(fromNode, transition + " out" + rev);
+ dojo.addClass(toNode, transition + " in" + rev);
+ }
+ },
+
+ onAnimationStart: function(e){
+ },
+
+ onAnimationEnd: function(e){
+ var isOut = false;
+ if(dojo.hasClass(this.domNode, "out")){
+ isOut = true;
+ this.domNode.style.display = "none";
+ dojo.forEach([this._transition,"in","out","reverse"], function(s){
+ dojo.removeClass(this.domNode, s);
+ }, this);
+ }
+ if(e.animationName.indexOf("shrink") === 0){
+ var li = e.target;
+ li.style.display = "none";
+ dojo.removeClass(li, "mblCloseContent");
+ }
+ if(isOut){
+ this.invokeCallback();
+ }
+ // this.domNode may be destroyed as a result of invoking the callback,
+ // so check for that before accessing it.
+ this.domNode && (this.domNode.className = "mblView");
+ },
+
+ invokeCallback: function(){
+ this.onAfterTransitionOut.apply(this, this._arguments);
+ var toWidget = dijit.byNode(this.toNode);
+ if(toWidget){
+ toWidget.onAfterTransitionIn.apply(toWidget, this._arguments);
+ }
+
+ dojox.mobile.currentView = toWidget;
+
+ var c = this._context, m = this._method;
+ if(!c && !m){ return; }
+ if(!m){
+ m = c;
+ c = null;
+ }
+ c = c || dojo.global;
+ if(typeof(m) == "string"){
+ c[m].apply(c, this._args);
+ }else{
+ m.apply(c, this._args);
+ }
+ },
+
+ getShowingView: function(){
+ // summary:
+ // Find the currently showing view from my sibling views.
+ // description:
+ // Note that dojox.mobile.currentView is the last shown view.
+ // If the page consists of a splitter, there are multiple showing views.
+ var nodes = this.domNode.parentNode.childNodes;
+ for(var i = 0; i < nodes.length; i++){
+ if(dojo.hasClass(nodes[i], "mblView") && dojo.style(nodes[i], "display") != "none"){
+ return dijit.byNode(nodes[i]);
+ }
+ }
+ },
+
+ show: function(){
+ // summary:
+ // Shows this view without a transition animation.
+ var fs = this.getShowingView().domNode.style; // from-style
+ var ts = this.domNode.style; // to-style
+ fs.display = "none";
+ ts.display = "";
+ dojox.mobile.currentView = this;
+ },
+
+ addChild: function(widget){
+ this.containerNode.appendChild(widget.domNode);
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.Heading",
+ dijit._WidgetBase,
+{
+ back: "",
+ href: "",
+ moveTo: "",
+ transition: "slide",
+ label: "",
+ iconBase: "",
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("H1");
+ this.domNode.className = "mblHeading";
+ this._view = dijit.getEnclosingWidget(this.domNode.parentNode); // parentNode is null if created programmatically
+ if(this.label){
+ this.domNode.appendChild(document.createTextNode(this.label));
+ }else{
+ this.label = "";
+ dojo.forEach(this.domNode.childNodes, function(n){
+ if(n.nodeType == 3){ this.label += n.nodeValue; }
+ }, this);
+ this.label = dojo.trim(this.label);
+ }
+ if(this.back){
+ var btn = dojo.create("DIV", {className:"mblArrowButton"}, this.domNode, "first");
+ var head = dojo.create("DIV", {className:"mblArrowButtonHead"}, btn);
+ var body = dojo.create("DIV", {className:"mblArrowButtonBody mblArrowButtonText"}, btn);
+
+ this._body = body;
+ this._head = head;
+ this._btn = btn;
+ body.innerHTML = this.back;
+ this.connect(body, "onclick", "onClick");
+ var neck = dojo.create("DIV", {className:"mblArrowButtonNeck"}, btn);
+ btn.style.width = body.offsetWidth + head.offsetWidth + "px";
+ this.setLabel(this.label);
+ }
+ },
+
+ startup: function(){
+ if(this._btn){
+ this._btn.style.width = this._body.offsetWidth + this._head.offsetWidth + "px";
+ }
+ },
+
+ onClick: function(e){
+ var h1 = this.domNode;
+ dojo.addClass(h1, "mblArrowButtonSelected");
+ setTimeout(function(){
+ dojo.removeClass(h1, "mblArrowButtonSelected");
+ }, 1000);
+ this.goTo(this.moveTo, this.href);
+ },
+
+ setLabel: function(label){
+ if(label != this.label){
+ this.label = label;
+ this.domNode.firstChild.nodeValue = label;
+ }
+ },
+
+ goTo: function(moveTo, href){
+ if(!this._view){
+ this._view = dijit.byNode(this.domNode.parentNode);
+ }
+ if(!this._view){ return; }
+ if(href){
+ this._view.performTransition(null, -1, this.transition, this, function(){location.href = href;});
+ }else{
+ if(dojox.mobile.app && dojox.mobile.app.STAGE_CONTROLLER_ACTIVE){
+ // If in a full mobile app, then use its mechanisms to move back a scene
+ dojo.publish("/dojox/mobile/app/goback");
+ }
+ else{
+ this._view.performTransition(moveTo, -1, this.transition);
+ }
+
+ }
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.RoundRect",
+ dijit._WidgetBase,
+{
+ shadow: false,
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("DIV");
+ this.domNode.className = this.shadow ? "mblRoundRect mblShadow" : "mblRoundRect";
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.RoundRectCategory",
+ dijit._WidgetBase,
+{
+ label: "",
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("H2");
+ this.domNode.className = "mblRoundRectCategory";
+ if(this.label){
+ this.domNode.innerHTML = this.label;
+ }else{
+ this.label = this.domNode.innerHTML;
+ }
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.EdgeToEdgeCategory",
+ dojox.mobile.RoundRectCategory,
+{
+ buildRendering: function(){
+ this.inherited(arguments);
+ this.domNode.className = "mblEdgeToEdgeCategory";
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.RoundRectList",
+ dijit._WidgetBase,
+{
+ transition: "slide",
+ iconBase: "",
+ iconPos: "",
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("UL");
+ this.domNode.className = "mblRoundRectList";
+ },
+
+ addChild: function(widget){
+ this.containerNode.appendChild(widget.domNode);
+ widget.inheritParams();
+ widget.setIcon();
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.EdgeToEdgeList",
+ dojox.mobile.RoundRectList,
+{
+ stateful: false, // keep the selection state or not
+ buildRendering: function(){
+ this.inherited(arguments);
+ this.domNode.className = "mblEdgeToEdgeList";
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.AbstractItem",
+ dijit._WidgetBase,
+{
+ icon: "",
+ iconPos: "", // top,left,width,height (ex. "0,0,29,29")
+ href: "",
+ hrefTarget: "",
+ moveTo: "",
+ scene: "",
+ clickable: false,
+ url: "",
+ transition: "",
+ transitionDir: 1,
+ callback: null,
+ sync: true,
+ label: "",
+ toggle: false,
+ _duration: 800, // duration of selection, milliseconds
+
+ inheritParams: function(){
+ var parent = this.getParentWidget();
+ if(parent){
+ if(!this.transition){ this.transition = parent.transition; }
+ if(!this.icon){ this.icon = parent.iconBase; }
+ if(!this.iconPos){ this.iconPos = parent.iconPos; }
+ }
+ },
+
+ findCurrentView: function(moveTo){
+ var w;
+ if(moveTo){
+ w = dijit.byId(moveTo);
+ if(w){ return w.getShowingView(); }
+ }
+ var n = this.domNode.parentNode;
+ while(true){
+ w = dijit.getEnclosingWidget(n);
+ if(!w){ return null; }
+ if(w.performTransition){ break; }
+ n = w.domNode.parentNode;
+ }
+ return w;
+ },
+
+ transitionTo: function(moveTo, href, url, scene){
+ var w = this.findCurrentView(moveTo); // the current view widget
+ if(!w || moveTo && w === dijit.byId(moveTo)){ return; }
+ if(href){
+ if(this.hrefTarget){
+ dojox.mobile.openWindow(this.href, this.hrefTarget);
+ }else{
+ w.performTransition(null, this.transitionDir, this.transition, this, function(){location.href = href;});
+ }
+ return;
+ } else if(scene){
+ dojo.publish("/dojox/mobile/app/pushScene", [scene]);
+ return;
+ }
+ if(url){
+ var id;
+ if(dojox.mobile._viewMap && dojox.mobile._viewMap[url]){
+ // external view has already been loaded
+ id = dojox.mobile._viewMap[url];
+ }else{
+ // get the specified external view and append it to the <body>
+ var text = this._text;
+ if(!text){
+ if(this.sync){
+ text = dojo.trim(dojo._getText(url));
+ }else{
+ dojo["require"]("dojo._base.xhr");
+ var prog = dojox.mobile.ProgressIndicator.getInstance();
+ dojo.body().appendChild(prog.domNode);
+ prog.start();
+ var xhr = dojo.xhrGet({
+ url: url,
+ handleAs: "text"
+ });
+ xhr.addCallback(dojo.hitch(this, function(response, ioArgs){
+ prog.stop();
+ if(response){
+ this._text = response;
+ this.transitionTo(moveTo, href, url, scene);
+ }
+ }));
+ xhr.addErrback(function(error){
+ prog.stop();
+ alert("Failed to load "+url+"\n"+(error.description||error));
+ });
+ return;
+ }
+ }
+ this._text = null;
+ id = this._parse(text);
+ if(!dojox.mobile._viewMap){
+ dojox.mobile._viewMap = [];
+ }
+ dojox.mobile._viewMap[url] = id;
+ }
+ moveTo = id;
+ }
+ w.performTransition(moveTo, this.transitionDir, this.transition, this.callback && this, this.callback);
+ },
+
+ _parse: function(text){
+ var container = dojo.create("DIV");
+ var view;
+ if(text.charAt(0) == "<"){ // html markup
+ container.innerHTML = text;
+ view = container.firstChild; // <div dojoType="dojox.mobile.View">
+ if(!view && view.nodeType != 1){
+ alert("dojox.mobile.AbstractItem#transitionTo: invalid view content");
+ return;
+ }
+ view.setAttribute("_started", "true"); // to avoid startup() is called
+ view.style.visibility = "hidden";
+ dojo.body().appendChild(container);
+ (dojox.mobile.parser || dojo.parser).parse(container);
+ }else if(text.charAt(0) == "{"){ // json
+ dojo.body().appendChild(container);
+ this._ws = [];
+ view = this._instantiate(eval('('+text+')'), container);
+ for(var i = 0; i < this._ws.length; i++){
+ var w = this._ws[i];
+ w.startup && !w._started && (!w.getParent || !w.getParent()) && w.startup();
+ }
+ this._ws = null;
+ }
+ view.style.display = "none";
+ view.style.visibility = "visible";
+ var id = view.id;
+ return dojo.hash ? "#" + id : id;
+ },
+
+ _instantiate: function(/*Object*/obj, /*DomNode*/node, /*Widget*/parent){
+ var widget;
+ for(var key in obj){
+ if(key.charAt(0) == "@"){ continue; }
+ var cls = dojo.getObject(key);
+ if(!cls){ continue; }
+ var params = {};
+ var proto = cls.prototype;
+ var objs = dojo.isArray(obj[key]) ? obj[key] : [obj[key]];
+ for(var i = 0; i < objs.length; i++){
+ for(var prop in objs[i]){
+ if(prop.charAt(0) == "@"){
+ var val = objs[i][prop];
+ prop = prop.substring(1);
+ if(typeof proto[prop] == "string"){
+ params[prop] = val;
+ }else if(typeof proto[prop] == "number"){
+ params[prop] = val - 0;
+ }else if(typeof proto[prop] == "boolean"){
+ params[prop] = (val != "false");
+ }else if(typeof proto[prop] == "object"){
+ params[prop] = eval("(" + val + ")");
+ }
+ }
+ }
+ widget = new cls(params, node);
+ if(!node){ // not to call View's startup()
+ this._ws.push(widget);
+ }
+ if(parent && parent.addChild){
+ parent.addChild(widget);
+ }
+ this._instantiate(objs[i], null, widget);
+ }
+ }
+ return widget && widget.domNode;
+ },
+
+ createDomButton: function(/*DomNode*/refNode, /*DomNode?*/toNode){
+ var s = refNode.className;
+ if(s.match(/mblDomButton\w+_(\d+)/)){
+ var nDiv = RegExp.$1 - 0;
+ for(var i = 0, p = (toNode||refNode); i < nDiv; i++){
+ p = dojo.create("DIV", null, p);
+ }
+ }
+ },
+
+ select: function(/*Boolean?*/deselect){
+ // subclass must implement
+ },
+
+ defaultClickAction: function(){
+ if(this.toggle){
+ this.select(this.selected);
+ }else if(!this.selected){
+ this.select();
+ if(!this.selectOne){
+ var _this = this;
+ setTimeout(function(){
+ _this.select(true);
+ }, this._duration);
+ }
+ if(this.moveTo || this.href || this.url || this.scene){
+ this.transitionTo(this.moveTo, this.href, this.url, this.scene);
+ }
+ }
+ },
+
+ getParentWidget: function(){
+ var ref = this.srcNodeRef || this.domNode;
+ return ref && ref.parentNode ? dijit.getEnclosingWidget(ref.parentNode) : null;
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.ListItem",
+ dojox.mobile.AbstractItem,
+{
+ rightText: "",
+ btnClass: "",
+ anchorLabel: false,
+ noArrow: false,
+ selected: false,
+
+ buildRendering: function(){
+ this.inheritParams();
+ var a = this.anchorNode = dojo.create("A");
+ a.className = "mblListItemAnchor";
+ var box = dojo.create("DIV");
+ box.className = "mblListItemTextBox";
+ if(this.anchorLabel){
+ box.style.cursor = "pointer";
+ }
+ var r = this.srcNodeRef;
+ if(r){
+ for(var i = 0, len = r.childNodes.length; i < len; i++){
+ box.appendChild(r.removeChild(r.firstChild));
+ }
+ }
+ if(this.label){
+ box.appendChild(dojo.doc.createTextNode(this.label));
+ }
+ a.appendChild(box);
+ if(this.rightText){
+ this._setRightTextAttr(this.rightText);
+ }
+
+ if(this.moveTo || this.href || this.url || this.clickable){
+ var parent = this.getParentWidget();
+ if(!this.noArrow && !(parent && parent.stateful)){
+ var arrow = dojo.create("DIV");
+ arrow.className = "mblArrow";
+ a.appendChild(arrow);
+ }
+ this.connect(a, "onclick", "onClick");
+ }else if(this.btnClass){
+ var div = this.btnNode = dojo.create("DIV");
+ div.className = this.btnClass+" mblRightButton";
+ div.appendChild(dojo.create("DIV"));
+ div.appendChild(dojo.create("P"));
+
+ var dummyDiv = dojo.create("DIV");
+ dummyDiv.className = "mblRightButtonContainer";
+ dummyDiv.appendChild(div);
+ a.appendChild(dummyDiv);
+ dojo.addClass(a, "mblListItemAnchorHasRightButton");
+ setTimeout(function(){
+ dummyDiv.style.width = div.offsetWidth + "px";
+ dummyDiv.style.height = div.offsetHeight + "px";
+ if(dojo.isIE){
+ // IE seems to ignore the height of LI without this..
+ a.parentNode.style.height = a.parentNode.offsetHeight + "px";
+ }
+ }, 0);
+ }
+ if(this.anchorLabel){
+ box.style.display = "inline"; // to narrow the text region
+ }
+ var li = this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("LI");
+ li.className = "mblListItem" + (this.selected ? " mblItemSelected" : "");
+ li.appendChild(a);
+ this.setIcon();
+ },
+
+ setIcon: function(){
+ if(this.iconNode){ return; }
+ var a = this.anchorNode;
+ if(this.icon && this.icon != "none"){
+ var img = this.iconNode = dojo.create("IMG");
+ img.className = "mblListItemIcon";
+ img.src = this.icon;
+ this.domNode.insertBefore(img, a);
+ dojox.mobile.setupIcon(this.iconNode, this.iconPos);
+ dojo.removeClass(a, "mblListItemAnchorNoIcon");
+ }else{
+ dojo.addClass(a, "mblListItemAnchorNoIcon");
+ }
+ },
+
+ onClick: function(e){
+ var a = e.currentTarget;
+ var li = a.parentNode;
+ if(dojo.hasClass(li, "mblItemSelected")){ return; } // already selected
+ if(this.anchorLabel){
+ for(var p = e.target; p.tagName != "LI"; p = p.parentNode){
+ if(p.className == "mblListItemTextBox"){
+ dojo.addClass(p, "mblListItemTextBoxSelected");
+ setTimeout(function(){
+ dojo.removeClass(p, "mblListItemTextBoxSelected");
+ }, 1000);
+ this.onAnchorLabelClicked(e);
+ return;
+ }
+ }
+ }
+ if(this.getParentWidget().stateful){
+ for(var i = 0, c = li.parentNode.childNodes; i < c.length; i++){
+ dojo.removeClass(c[i], "mblItemSelected");
+ }
+ }else{
+ setTimeout(function(){
+ dojo.removeClass(li, "mblItemSelected");
+ }, 1000);
+ }
+ dojo.addClass(li, "mblItemSelected");
+ this.transitionTo(this.moveTo, this.href, this.url, this.scene);
+ },
+
+ onAnchorLabelClicked: function(e){
+ },
+
+ _setRightTextAttr: function(/*String*/text){
+ this.rightText = text;
+ if(!this._rightTextNode){
+ this._rightTextNode = dojo.create("DIV", {className:"mblRightText"}, this.anchorNode);
+ }
+ this._rightTextNode.innerHTML = text;
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.Switch",
+ dijit._WidgetBase,
+{
+ value: "on",
+ leftLabel: "ON",
+ rightLabel: "OFF",
+ _width: 53,
+
+ buildRendering: function(){
+ this.domNode = this.srcNodeRef || dojo.doc.createElement("DIV");
+ this.domNode.className = "mblSwitch";
+ this.domNode.innerHTML =
+ '<div class="mblSwitchInner">'
+ + '<div class="mblSwitchBg mblSwitchBgLeft">'
+ + '<div class="mblSwitchText mblSwitchTextLeft">'+this.leftLabel+'</div>'
+ + '</div>'
+ + '<div class="mblSwitchBg mblSwitchBgRight">'
+ + '<div class="mblSwitchText mblSwitchTextRight">'+this.rightLabel+'</div>'
+ + '</div>'
+ + '<div class="mblSwitchKnob"></div>'
+ + '</div>';
+ var n = this.inner = this.domNode.firstChild;
+ this.left = n.childNodes[0];
+ this.right = n.childNodes[1];
+ this.knob = n.childNodes[2];
+
+ dojo.addClass(this.domNode, (this.value == "on") ? "mblSwitchOn" : "mblSwitchOff");
+ this[this.value == "off" ? "left" : "right"].style.display = "none";
+ },
+
+ postCreate: function(){
+ this.connect(this.knob, "onclick", "onClick");
+ this.connect(this.knob, "touchstart", "onTouchStart");
+ this.connect(this.knob, "mousedown", "onTouchStart");
+ },
+
+ _changeState: function(/*String*/state){
+ this.inner.style.left = "";
+ dojo.addClass(this.domNode, "mblSwitchAnimation");
+ dojo.removeClass(this.domNode, (state == "on") ? "mblSwitchOff" : "mblSwitchOn");
+ dojo.addClass(this.domNode, (state == "on") ? "mblSwitchOn" : "mblSwitchOff");
+
+ var _this = this;
+ setTimeout(function(){
+ _this[state == "off" ? "left" : "right"].style.display = "none";
+ dojo.removeClass(_this.domNode, "mblSwitchAnimation");
+ }, 300);
+ },
+
+ onClick: function(e){
+ if(this._moved){ return; }
+ this.value = (this.value == "on") ? "off" : "on";
+ this._changeState(this.value);
+ this.onStateChanged(this.value);
+ },
+
+ onTouchStart: function(e){
+ this._moved = false;
+ this.innerStartX = this.inner.offsetLeft;
+ if(e.targetTouches){
+ this.touchStartX = e.targetTouches[0].clientX;
+ this._conn1 = dojo.connect(this.inner, "touchmove", this, "onTouchMove");
+ this._conn2 = dojo.connect(this.inner, "touchend", this, "onTouchEnd");
+ }
+ this.left.style.display = "block";
+ this.right.style.display = "block";
+ dojo.stopEvent(e);
+ },
+
+ onTouchMove: function(e){
+ e.preventDefault();
+ var dx;
+ if(e.targetTouches){
+ if(e.targetTouches.length != 1){ return false; }
+ dx = e.targetTouches[0].clientX - this.touchStartX;
+ }else{
+ dx = e.clientX - this.touchStartX;
+ }
+ var pos = this.innerStartX + dx;
+ var d = 10;
+ if(pos <= -(this._width-d)){ pos = -this._width; }
+ if(pos >= -d){ pos = 0; }
+ this.inner.style.left = pos + "px";
+ this._moved = true;
+ },
+
+ onTouchEnd: function(e){
+ dojo.disconnect(this._conn1);
+ dojo.disconnect(this._conn2);
+ if(this.innerStartX == this.inner.offsetLeft){
+ if(dojo.isWebKit){
+ var ev = dojo.doc.createEvent("MouseEvents");
+ ev.initEvent("click", true, true);
+ this.knob.dispatchEvent(ev);
+ }
+ return;
+ }
+ var newState = (this.inner.offsetLeft < -(this._width/2)) ? "off" : "on";
+ this._changeState(newState);
+ if(newState != this.value){
+ this.value = newState;
+ this.onStateChanged(this.value);
+ }
+ },
+
+ onStateChanged: function(/*String*/newState){
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.Button",
+ dijit._WidgetBase,
+{
+ btnClass: "mblBlueButton",
+ duration: 1000, // duration of selection, milliseconds
+
+ label: null,
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("BUTTON");
+ this.domNode.className = "mblButton "+this.btnClass;
+
+ if(this.label){
+ this.domNode.innerHTML = this.label;
+ }
+
+ this.connect(this.domNode, "onclick", "onClick");
+ },
+
+ onClick: function(e){
+ var button = this.domNode;
+ var c = "mblButtonSelected "+this.btnClass+"Selected";
+ dojo.addClass(button, c);
+ setTimeout(function(){
+ dojo.removeClass(button, c);
+ }, this.duration);
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.ToolBarButton",
+ dojox.mobile.AbstractItem,
+{
+ selected: false,
+ _defaultColor: "mblColorDefault",
+ _selColor: "mblColorDefaultSel",
+
+ buildRendering: function(){
+ this.inheritParams();
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("div");
+ dojo.addClass(this.domNode, "mblToolbarButton mblArrowButtonText");
+ var color;
+ if(this.selected){
+ color = this._selColor;
+ }else if(this.domNode.className.indexOf("mblColor") == -1){
+ color = this._defaultColor;
+ }
+ dojo.addClass(this.domNode, color);
+
+ if(this.label){
+ this.domNode.innerHTML = this.label;
+ }else{
+ this.label = this.domNode.innerHTML;
+ }
+
+ if(this.icon && this.icon != "none"){
+ var img;
+ if(this.iconPos){
+ var iconDiv = dojo.create("DIV", null, this.domNode);
+ img = dojo.create("IMG", null, iconDiv);
+ img.style.position = "absolute";
+ var arr = this.iconPos.split(/[ ,]/);
+ dojo.style(iconDiv, {
+ position: "relative",
+ width: arr[2] + "px",
+ height: arr[3] + "px"
+ });
+ }else{
+ img = dojo.create("IMG", null, this.domNode);
+ }
+ img.src = this.icon;
+ dojox.mobile.setupIcon(img, this.iconPos);
+ this.iconNode = img;
+ }
+ this.createDomButton(this.domNode);
+ this.connect(this.domNode, "onclick", "onClick");
+ },
+
+ select: function(/*Boolean?*/deselect){
+ dojo.toggleClass(this.domNode, this._selColor, !deselect);
+ this.selected = !deselect;
+ },
+
+ onClick: function(e){
+ this.defaultClickAction();
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.ProgressIndicator",
+ null,
+{
+ interval: 100, // milliseconds
+ colors: [
+ "#C0C0C0", "#C0C0C0", "#C0C0C0", "#C0C0C0",
+ "#C0C0C0", "#C0C0C0", "#B8B9B8", "#AEAFAE",
+ "#A4A5A4", "#9A9A9A", "#8E8E8E", "#838383"
+ ],
+
+ _bars: [],
+
+ constructor: function(){
+ this.domNode = dojo.create("DIV");
+ this.domNode.className = "mblProgContainer";
+ for(var i = 0; i < 12; i++){
+ var div = dojo.create("DIV");
+ div.className = "mblProg mblProg"+i;
+ this.domNode.appendChild(div);
+ this._bars.push(div);
+ }
+ },
+
+ start: function(){
+ var cntr = 0;
+ var _this = this;
+ this.timer = setInterval(function(){
+ cntr--;
+ cntr = cntr < 0 ? 11 : cntr;
+ var c = _this.colors;
+ for(var i = 0; i < 12; i++){
+ var idx = (cntr + i) % 12;
+ _this._bars[i].style.backgroundColor = c[idx];
+ }
+ }, this.interval);
+ },
+
+ stop: function(){
+ if(this.timer){
+ clearInterval(this.timer);
+ }
+ this.timer = null;
+ if(this.domNode.parentNode){
+ this.domNode.parentNode.removeChild(this.domNode);
+ }
+ }
+});
+dojox.mobile.ProgressIndicator._instance = null;
+dojox.mobile.ProgressIndicator.getInstance = function(){
+ if(!dojox.mobile.ProgressIndicator._instance){
+ dojox.mobile.ProgressIndicator._instance = new dojox.mobile.ProgressIndicator();
+ }
+ return dojox.mobile.ProgressIndicator._instance;
+};
+
+dojox.mobile.addClass = function(){
+ // summary:
+ // Adds a theme class name to <body>.
+ // description:
+ // Finds the currently applied theme name, such as 'iphone' or 'android'
+ // from link elements, and adds it as a class name for the body element.
+ var elems = document.getElementsByTagName("link");
+ for(var i = 0, len = elems.length; i < len; i++){
+ if(elems[i].href.match(/dojox\/mobile\/themes\/(\w+)\//)){
+ dojox.mobile.theme = RegExp.$1;
+ dojo.addClass(dojo.body(), dojox.mobile.theme);
+ break;
+ }
+ }
+};
+
+dojox.mobile.setupIcon = function(/*DomNode*/iconNode, /*String*/iconPos){
+ if(iconNode && iconPos){
+ var arr = dojo.map(iconPos.split(/[ ,]/),
+ function(item){ return item - 0; });
+ var t = arr[0]; // top
+ var r = arr[1] + arr[2]; // right
+ var b = arr[0] + arr[3]; // bottom
+ var l = arr[1]; // left
+ iconNode.style.clip = "rect("+t+"px "+r+"px "+b+"px "+l+"px)";
+ iconNode.style.top = dojo.style(iconNode, "top") - t + "px";
+ iconNode.style.left = dojo.style(iconNode.parentNode, "paddingLeft") - l + "px";
+ }
+};
+
+dojox.mobile.hideAddressBar = function(){
+ dojo.body().style.minHeight = "1000px"; // to ensure enough height for scrollTo to work
+ setTimeout(function(){ scrollTo(0, 1); }, 100);
+ setTimeout(function(){ scrollTo(0, 1); }, 400);
+ setTimeout(function(){
+ scrollTo(0, 1);
+ // re-define the min-height with the actual height
+ dojo.body().style.minHeight = (dojo.global.innerHeight||dojo.doc.documentElement.clientHeight) + "px";
+ }, 1000);
+};
+
+dojox.mobile.openWindow = function(url, target){
+ dojo.global.open(url, target || "_blank");
+};
+
+dojo._loaders.unshift(function(){
+ // avoid use of dojo.query
+ /*
+ var list = dojo.query('[lazy=true] [dojoType]', null);
+ list.forEach(function(node, index, nodeList){
+ node.setAttribute("__dojoType", node.getAttribute("dojoType"));
+ node.removeAttribute("dojoType");
+ });
+ */
+
+ var nodes = dojo.body().getElementsByTagName("*");
+ var i, len, s;
+ len = nodes.length;
+ for(i = 0; i < len; i++){
+ s = nodes[i].getAttribute("dojoType");
+ if(s){
+ if(nodes[i].parentNode.getAttribute("lazy") == "true"){
+ nodes[i].setAttribute("__dojoType", s);
+ nodes[i].removeAttribute("dojoType");
+ }
+ }
+ }
+});
+
+dojo.addOnLoad(function(){
+ dojox.mobile.addClass();
+ if(dojo.config["mblApplyPageStyles"] !== false){
+ dojo.addClass(dojo.doc.documentElement, "mobile");
+ }
+
+ // You can disable hiding the address bar with the following djConfig.
+ // var djConfig = { mblHideAddressBar: false };
+ if(dojo.config["mblHideAddressBar"] !== false){
+ dojox.mobile.hideAddressBar();
+ if(dojo.config["mblAlwaysHideAddressBar"] == true){
+ if(dojo.global.onorientationchange !== undefined){
+ dojo.connect(dojo.global, "onorientationchange", dojox.mobile.hideAddressBar);
+ }else{
+ dojo.connect(dojo.global, "onresize", dojox.mobile.hideAddressBar);
+ }
+ }
+ }
+
+ // avoid use of dojo.query
+ /*
+ var list = dojo.query('[__dojoType]', null);
+ list.forEach(function(node, index, nodeList){
+ node.setAttribute("dojoType", node.getAttribute("__dojoType"));
+ node.removeAttribute("__dojoType");
+ });
+ */
+
+ var nodes = dojo.body().getElementsByTagName("*");
+ var i, len = nodes.length, s;
+ for(i = 0; i < len; i++){
+ s = nodes[i].getAttribute("__dojoType");
+ if(s){
+ nodes[i].setAttribute("dojoType", s);
+ nodes[i].removeAttribute("__dojoType");
+ }
+ }
+
+ if(dojo.hash){
+ // find widgets under root recursively
+ var findWidgets = function(root){
+ var arr;
+ arr = dijit.findWidgets(root);
+ var widgets = arr;
+ for(var i = 0; i < widgets.length; i++){
+ arr = arr.concat(findWidgets(widgets[i].containerNode));
+ }
+ return arr;
+ };
+ dojo.subscribe("/dojo/hashchange", null, function(value){
+ var view = dojox.mobile.currentView;
+ if(!view){ return; }
+ var params = dojox.mobile._params;
+ if(!params){ // browser back/forward button was pressed
+ var moveTo = value ? value : dojox.mobile._defaultView.id;
+ var widgets = findWidgets(view.domNode);
+ var dir = 1, transition = "slide";
+ for(i = 0; i < widgets.length; i++){
+ var w = widgets[i];
+ if("#"+moveTo == w.moveTo){
+ // found a widget that has the given moveTo
+ transition = w.transition;
+ dir = (w instanceof dojox.mobile.Heading) ? -1 : 1;
+ break;
+ }
+ }
+ params = [ moveTo, dir, transition ];
+ }
+ view.performTransition.apply(view, params);
+ dojox.mobile._params = null;
+ });
+ }
+
+ dojo.body().style.visibility = "visible";
+});
+
+dijit.getEnclosingWidget = function(node){
+ while(node && node.tagName !== "BODY"){
+ if(node.getAttribute && node.getAttribute("widgetId")){
+ return dijit.registry.byId(node.getAttribute("widgetId"));
+ }
+ node = node._parentNode || node.parentNode;
+ }
+ return null;
+};
+
+}
+
+if(!dojo._hasResource["dojox.mobile"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile"] = true;
+dojo.provide("dojox.mobile");
+
+dojo.experimental("dojox.mobile");
+
+
+}
+
+if(!dojo._hasResource["dojox.mobile.parser"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.parser"] = true;
+dojo.provide("dojox.mobile.parser");
+dojo.provide("dojo.parser"); // not to load dojo.parser unexpectedly
+
+dojox.mobile.parser = new function(){
+ this.instantiate = function(list, defaultParams){
+ // summary:
+ // Function for instantiating a list of widget nodes.
+ // list:
+ // The list of DOMNodes to walk and instantiate widgets on.
+ var ws = [];
+ if(list){
+ var i, len;
+ len = list.length;
+ for(i = 0; i < len; i++){
+ var node = list[i];
+ var cls = dojo.getObject(dojo.attr(node, "dojoType"));
+ var proto = cls.prototype;
+ var params = {};
+
+ if(defaultParams){
+ for(var name in defaultParams){
+ params[name] = defaultParams[name];
+ }
+ }
+ for(var prop in proto){
+ var val = dojo.attr(node, prop);
+ if(!val){ continue; }
+ if(typeof proto[prop] == "string"){
+ params[prop] = val;
+ }else if(typeof proto[prop] == "number"){
+ params[prop] = val - 0;
+ }else if(typeof proto[prop] == "boolean"){
+ params[prop] = (val != "false");
+ }else if(typeof proto[prop] == "object"){
+ params[prop] = eval("(" + val + ")");
+ }
+ }
+ params["class"] = node.className;
+ params["style"] = node.style && node.style.cssText;
+ ws.push(new cls(params, node));
+ }
+ len = ws.length;
+ for(i = 0; i < len; i++){
+ var w = ws[i];
+ w.startup && !w._started && (!w.getParent || !w.getParent()) && w.startup();
+ }
+ }
+ return ws;
+ };
+
+ this.parse = function(rootNode, defaultParams){
+ // summary:
+ // Function to handle parsing for widgets in the current document.
+ // It is not as powerful as the full dojo parser, but it will handle basic
+ // use cases fine.
+ // rootNode:
+ // The root node in the document to parse from
+ if(!rootNode){
+ rootNode = dojo.body();
+ }else if(!defaultParams && rootNode.rootNode){
+ // Case where 'rootNode' is really a params object.
+ rootNode = rootNode.rootNode;
+ }
+
+ var nodes = rootNode.getElementsByTagName("*");
+ var list = [];
+ for(var i = 0, len = nodes.length; i < len; i++){
+ if(nodes[i].getAttribute("dojoType")){
+ list.push(nodes[i]);
+ }
+ }
+ return this.instantiate(list, defaultParams);
+ };
+}();
+dojo._loaders.unshift(function(){
+ if(dojo.config.parseOnLoad){
+ dojox.mobile.parser.parse();
+ }
+});
+
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app._event"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app._event"] = true;
+dojo.provide("dojox.mobile.app._event");
+dojo.experimental("dojox.mobile.app._event.js");
+
+dojo.mixin(dojox.mobile.app, {
+ eventMap: {},
+
+ connectFlick: function(target, context, method){
+ // summary:
+ // Listens for a flick event on a DOM node. If the mouse/touch
+ // moves more than 15 pixels in any given direction it is a flick.
+ // The synthetic event fired specifies the direction as
+ // <ul>
+ // <li><b>'ltr'</b> Left To Right</li>
+ // <li><b>'rtl'</b> Right To Left</li>
+ // <li><b>'ttb'</b> Top To Bottom</li>
+ // <li><b>'btt'</b> Bottom To Top</li>
+ // </ul>
+ // target: Node
+ // The DOM node to connect to
+
+ var startX;
+ var startY;
+ var isFlick = false;
+
+ var currentX;
+ var currentY;
+
+ var connMove;
+ var connUp;
+
+ var direction;
+
+ var time;
+
+ // Listen to to the mousedown/touchstart event
+ var connDown = dojo.connect("onmousedown", target, function(event){
+ isFlick = false;
+ startX = event.targetTouches ? event.targetTouches[0].clientX : event.clientX;
+ startY = event.targetTouches ? event.targetTouches[0].clientY : event.clientY;
+
+ time = (new Date()).getTime();
+
+ connMove = dojo.connect(target, "onmousemove", onMove);
+ connUp = dojo.connect(target, "onmouseup", onUp);
+ });
+
+ // The function that handles the mousemove/touchmove event
+ var onMove = function(event){
+ dojo.stopEvent(event);
+
+ currentX = event.targetTouches ? event.targetTouches[0].clientX : event.clientX;
+ currentY = event.targetTouches ? event.targetTouches[0].clientY : event.clientY;
+ if(Math.abs(Math.abs(currentX) - Math.abs(startX)) > 15){
+ isFlick = true;
+
+ direction = (currentX > startX) ? "ltr" : "rtl";
+ }else if(Math.abs(Math.abs(currentY) - Math.abs(startY)) > 15){
+ isFlick = true;
+
+ direction = (currentY > startY) ? "ttb" : "btt";
+ }
+ };
+
+ var onUp = function(event){
+ dojo.stopEvent(event);
+
+ connMove && dojo.disconnect(connMove);
+ connUp && dojo.disconnect(connUp);
+
+ if(isFlick){
+ var flickEvt = {
+ target: target,
+ direction: direction,
+ duration: (new Date()).getTime() - time
+ };
+ if(context && method){
+ context[method](flickEvt);
+ }else{
+ method(flickEvt);
+ }
+ }
+ };
+
+ }
+});
+
+dojox.mobile.app.isIPhone = (dojo.isSafari
+ && (navigator.userAgent.indexOf("iPhone") > -1 ||
+ navigator.userAgent.indexOf("iPod") > -1
+ ));
+dojox.mobile.app.isWebOS = (navigator.userAgent.indexOf("webOS") > -1);
+dojox.mobile.app.isAndroid = (navigator.userAgent.toLowerCase().indexOf("android") > -1);
+
+if(dojox.mobile.app.isIPhone || dojox.mobile.app.isAndroid){
+ // We are touchable.
+ // Override the dojo._connect function to replace mouse events with touch events
+
+ dojox.mobile.app.eventMap = {
+ onmousedown: "ontouchstart",
+ mousedown: "ontouchstart",
+ onmouseup: "ontouchend",
+ mouseup: "ontouchend",
+ onmousemove: "ontouchmove",
+ mousemove: "ontouchmove"
+ };
+
+}
+dojo._oldConnect = dojo._connect;
+dojo._connect = function(obj, event, context, method, dontFix){
+ event = dojox.mobile.app.eventMap[event] || event;
+ if(event == "flick" || event == "onflick"){
+ if(dojo.global["Mojo"]){
+ event = Mojo.Event.flick;
+ }else{
+ return dojox.mobile.app.connectFlick(obj, context, method);
+ }
+ }
+
+ return dojo._oldConnect(obj, event, context, method, dontFix);
+}
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app._Widget"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app._Widget"] = true;
+dojo.provide("dojox.mobile.app._Widget");
+dojo.experimental("dojox.mobile.app._Widget");
+
+
+
+dojo.declare("dojox.mobile.app._Widget", dijit._WidgetBase, {
+ // summary:
+ // The base mobile app widget.
+
+ getScroll: function(){
+ // summary:
+ // Returns the scroll position.
+ return {
+ x: dojo.global.scrollX,
+ y: dojo.global.scrollY
+ };
+ },
+
+ connect: function(target, event, fn){
+ if(event.toLowerCase() == "dblclick"
+ || event.toLowerCase() == "ondblclick"){
+
+ if(dojo.global["Mojo"]){
+ // Handle webOS tap event
+ return this.connect(target, Mojo.Event.tap, fn);
+ }
+ }
+ return this.inherited(arguments);
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app.SceneController"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.SceneController"] = true;
+dojo.provide("dojox.mobile.app.SceneController");
+dojo.experimental("dojox.mobile.app.SceneController");
+
+
+(function(){
+
+ var app = dojox.mobile.app;
+
+ var templates = {};
+
+ dojo.declare("dojox.mobile.app.SceneController", dojox.mobile.View, {
+
+ stageController: null,
+
+ keepScrollPos: false,
+
+ init: function(sceneName, params){
+ // summary:
+ // Initializes the scene by loading the HTML template and code, if it has
+ // not already been loaded
+
+ this.sceneName = sceneName;
+ this.params = params;
+ var templateUrl = app.resolveTemplate(sceneName);
+
+ this._deferredInit = new dojo.Deferred();
+
+ if(templates[sceneName]){
+ // If the template has been cached, do not load it again.
+ this._setContents(templates[sceneName]);
+ }else{
+ // Otherwise load the template
+ dojo.xhrGet({
+ url: templateUrl,
+ handleAs: "text"
+ }).addCallback(dojo.hitch(this, this._setContents));
+ }
+
+ return this._deferredInit;
+ },
+
+ _setContents: function(templateHtml){
+ // summary:
+ // Sets the content of the View, and invokes either the loading or
+ // initialization of the scene assistant.
+ templates[this.sceneName] = templateHtml;
+
+ this.domNode.innerHTML = "<div>" + templateHtml + "</div>";
+
+ var sceneAssistantName = "";
+
+ var nameParts = this.sceneName.split("-");
+
+ for(var i = 0; i < nameParts.length; i++){
+ sceneAssistantName += nameParts[i].substring(0, 1).toUpperCase()
+ + nameParts[i].substring(1);
+ }
+ sceneAssistantName += "Assistant";
+ this.sceneAssistantName = sceneAssistantName;
+
+ var _this = this;
+
+ dojox.mobile.app.loadResourcesForScene(this.sceneName, function(){
+
+ console.log("All resources for ",_this.sceneName," loaded");
+
+ var assistant;
+ if(typeof(dojo.global[sceneAssistantName]) != "undefined"){
+ _this._initAssistant();
+ }else{
+ var assistantUrl = app.resolveAssistant(_this.sceneName);
+
+ dojo.xhrGet({
+ url: assistantUrl,
+ handleAs: "text"
+ }).addCallback(function(text){
+ try{
+ dojo.eval(text);
+ }catch(e){
+ console.log("Error initializing code for scene " + _this.sceneName
+ + '. Please check for syntax errors');
+ throw e;
+ }
+ _this._initAssistant();
+ });
+ }
+ });
+
+ },
+
+ _initAssistant: function(){
+ // summary:
+ // Initializes the scene assistant. At this point, the View is
+ // populated with the HTML template, and the scene assistant type
+ // is declared.
+
+ console.log("Instantiating the scene assistant " + this.sceneAssistantName);
+
+ var cls = dojo.getObject(this.sceneAssistantName);
+
+ if(!cls){
+ throw Error("Unable to resolve scene assistant "
+ + this.sceneAssistantName);
+ }
+
+ this.assistant = new cls(this.params);
+
+ this.assistant.controller = this;
+ this.assistant.domNode = this.domNode.firstChild;
+
+ this.assistant.setup();
+
+ this._deferredInit.callback();
+ },
+
+ query: function(selector, node){
+ // summary:
+ // Queries for DOM nodes within either the node passed in as an argument
+ // or within this view.
+
+ return dojo.query(selector, node || this.domNode)
+ },
+
+ parse: function(node){
+ var widgets = this._widgets =
+ dojox.mobile.parser.parse(node || this.domNode, {
+ controller: this
+ });
+
+ // Tell all widgets what their controller is.
+ for(var i = 0; i < widgets.length; i++){
+ widgets[i].set("controller", this);
+ }
+ },
+
+ getWindowSize: function(){
+ // TODO, this needs cross browser testing
+
+ return {
+ w: dojo.global.innerWidth,
+ h: dojo.global.innerHeight
+ }
+ },
+
+ showAlertDialog: function(props){
+
+ var size = dojo.marginBox(this.assistant.domNode);
+ var dialog = new dojox.mobile.app.AlertDialog(
+ dojo.mixin(props, {controller: this}));
+ this.assistant.domNode.appendChild(dialog.domNode);
+
+ console.log("Appended " , dialog.domNode, " to ", this.assistant.domNode);
+ dialog.show();
+ },
+
+ popupSubMenu: function(info){
+ var widget = new dojox.mobile.app.ListSelector({
+ controller: this,
+ destroyOnHide: true,
+ onChoose: info.onChoose
+ });
+
+ this.assistant.domNode.appendChild(widget.domNode);
+
+ widget.set("data", info.choices);
+ widget.show(info.fromNode);
+ }
+ });
+
+})();
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app.StageController"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.StageController"] = true;
+dojo.provide("dojox.mobile.app.StageController");
+dojo.experimental("dojox.mobile.app.StageController");
+
+
+
+dojo.declare("dojox.mobile.app.StageController", null,{
+
+ // scenes: Array
+ // The list of scenes currently in existance in the app.
+ scenes: null,
+
+ effect: "fade",
+
+ constructor: function(node){
+ this.domNode = node;
+ this.scenes = [];
+
+ if(dojo.config.mobileAnim){
+ this.effect = dojo.config.mobileAnim;
+ }
+ },
+
+ getActiveSceneController: function(){
+ return this.scenes[this.scenes.length - 1];
+ },
+
+ pushScene: function(sceneName, params){
+ if(this._opInProgress){
+ return;
+ }
+ this._opInProgress = true;
+
+ // Push new scenes as the first element on the page.
+ var node = dojo.create("div", {
+ "class": "scene-wrapper",
+ style: {
+ visibility: "hidden"
+ }
+ }, this.domNode);
+
+ var controller = new dojox.mobile.app.SceneController({}, node);
+
+ if(this.scenes.length > 0){
+ this.scenes[this.scenes.length -1].assistant.deactivate();
+ }
+
+ this.scenes.push(controller);
+
+ var _this = this;
+
+ dojo.forEach(this.scenes, this.setZIndex);
+
+ controller.stageController = this;
+
+ controller.init(sceneName, params).addCallback(function(){
+
+ if(_this.scenes.length == 1){
+ controller.domNode.style.visibility = "visible";
+ _this.scenes[_this.scenes.length - 1].assistant.activate(params);
+ _this._opInProgress = false;
+ }else{
+ _this.scenes[_this.scenes.length - 2]
+ .performTransition(
+ _this.scenes[_this.scenes.length - 1].domNode,
+ 1,
+ _this.effect,
+ null,
+ function(){
+ // When the scene is ready, activate it.
+ _this.scenes[_this.scenes.length - 1].assistant.activate(params);
+ _this._opInProgress = false;
+ });
+ }
+ });
+ },
+
+ setZIndex: function(controller, idx){
+ dojo.style(controller.domNode, "zIndex", idx + 1);
+ },
+
+ popScene: function(data){
+ // performTransition: function(/*String*/moveTo, /*Number*/dir, /*String*/transition,
+ // /*Object|null*/context, /*String|Function*/method /*optional args*/){
+ if(this._opInProgress){
+ return;
+ }
+
+ var _this = this;
+ if(this.scenes.length > 1){
+
+ this._opInProgress = true;
+ this.scenes[_this.scenes.length - 2].assistant.activate(data);
+ this.scenes[_this.scenes.length - 1]
+ .performTransition(
+ _this.scenes[this.scenes.length - 2].domNode,
+ -1,
+ this.effect,
+ null,
+ function(){
+ // When the scene is no longer visible, destroy it
+ _this._destroyScene(_this.scenes[_this.scenes.length - 1]);
+ _this.scenes.splice(_this.scenes.length - 1, 1);
+ _this._opInProgress = false;
+ });
+ }else{
+ console.log("cannot pop the scene if there is just one");
+ }
+ },
+
+ popScenesTo: function(sceneName, data){
+ if(this._opInProgress){
+ return;
+ }
+
+ while(this.scenes.length > 2 &&
+ this.scenes[this.scenes.length - 2].sceneName != sceneName){
+ this._destroyScene(this.scenes[this.scenes.length - 2]);
+ this.scenes.splice(this.scenes.length - 2, 1);
+ }
+
+ this.popScene(data);
+ },
+
+ _destroyScene: function(scene){
+ scene.assistant.deactivate();
+ scene.assistant.destroy();
+ scene.destroyRecursive();
+ }
+
+
+});
+
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app.SceneAssistant"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.SceneAssistant"] = true;
+dojo.provide("dojox.mobile.app.SceneAssistant");
+dojo.experimental("dojox.mobile.app.SceneAssistant");
+
+dojo.declare("dojox.mobile.app.SceneAssistant", null, {
+ // summary:
+ // The base class for all scene assistants.
+
+ constructor: function(){
+
+ },
+
+ setup: function(){
+ // summary:
+ // Called to set up the widget. The UI is not visible at this time
+
+ },
+
+ activate: function(params){
+ // summary:
+ // Called each time the scene becomes visible. This can be as a result
+ // of a new scene being created, or a subsequent scene being destroyed
+ // and control transferring back to this scene assistant.
+ // params:
+ // Optional paramters, only passed when a subsequent scene pops itself
+ // off the stack and passes back data.
+ },
+
+ deactivate: function(){
+ // summary:
+ // Called each time the scene becomes invisible. This can be as a result
+ // of it being popped off the stack and destroyed,
+ // or another scene being created and pushed on top of it on the stack
+ },
+
+ destroy: function(){
+
+ var children =
+ dojo.query("> [widgetId]", this.containerNode).map(dijit.byNode);
+ dojo.forEach(children, function(child){ child.destroyRecursive(); });
+
+ this.disconnect();
+ },
+
+ connect: function(obj, method, callback){
+ if(!this._connects){
+ this._connects = [];
+ }
+ this._connects.push(dojo.connect(obj, method, callback));
+ },
+
+ disconnect: function(){
+ dojo.forEach(this._connects, dojo.disconnect);
+ this._connects = [];
+ }
+});
+
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app.AlertDialog"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.AlertDialog"] = true;
+dojo.provide("dojox.mobile.app.AlertDialog");
+dojo.experimental("dojox.mobile.app.AlertDialog");
+
+
+dojo.declare("dojox.mobile.app.AlertDialog", dijit._WidgetBase, {
+
+ // title: String
+ // The title of the AlertDialog
+ title: "",
+
+ // text: String
+ // The text message displayed in the AlertDialog
+ text: "",
+
+ // controller: Object
+ // The SceneController for the currently active scene
+ controller: null,
+
+ // buttons: Array
+ buttons: null,
+
+ defaultButtonLabel: "OK",
+
+ // onChoose: Function
+ // The callback function that is invoked when a button is tapped.
+ // If the dialog is cancelled, no parameter is passed to this function.
+ onChoose: null,
+
+ constructor: function(){
+ this.onClick = dojo.hitch(this, this.onClick);
+ this._handleSelect = dojo.hitch(this, this._handleSelect);
+ },
+
+ buildRendering: function(){
+ this.domNode = dojo.create("div",{
+ "class": "alertDialog"
+ });
+
+ // Create the outer dialog body
+ var dlgBody = dojo.create("div", {"class": "alertDialogBody"}, this.domNode);
+
+ // Create the title
+ dojo.create("div", {"class": "alertTitle", innerHTML: this.title || ""}, dlgBody);
+
+ // Create the text
+ dojo.create("div", {"class": "alertText", innerHTML: this.text || ""}, dlgBody);
+
+ // Create the node that encapsulates all the buttons
+ var btnContainer = dojo.create("div", {"class": "alertBtns"}, dlgBody);
+
+ // If no buttons have been defined, default to a single button saying OK
+ if(!this.buttons || this.buttons.length == 0){
+ this.buttons = [{
+ label: this.defaultButtonLabel,
+ value: "ok",
+ "class": "affirmative"
+ }];
+ }
+
+ var _this = this;
+
+ // Create each of the buttons
+ dojo.forEach(this.buttons, function(btnInfo){
+ var btn = new dojox.mobile.Button({
+ btnClass: btnInfo["class"] || "",
+ label: btnInfo.label
+ });
+ btn._dialogValue = btnInfo.value;
+ dojo.place(btn.domNode, btnContainer);
+ _this.connect(btn, "onClick", _this._handleSelect);
+ });
+
+ var viewportSize = this.controller.getWindowSize();
+
+ // Create the mask that blocks out the rest of the screen
+ this.mask = dojo.create("div", {"class": "dialogUnderlayWrapper",
+ innerHTML: "<div class=\"dialogUnderlay\"></div>",
+ style: {
+ width: viewportSize.w + "px",
+ height: viewportSize.h + "px"
+ }
+ }, this.controller.assistant.domNode);
+
+ this.connect(this.mask, "onclick", function(){
+ _this.onChoose && _this.onChoose();
+ _this.hide();
+ });
+ },
+
+ postCreate: function(){
+ this.subscribe("/dojox/mobile/app/goback", this._handleSelect);
+ },
+
+ _handleSelect: function(event){
+ // summary:
+ // Handle the selection of a value
+ var node;
+ console.log("handleSelect");
+ if(event && event.target){
+ node = event.target;
+
+ // Find the widget that was tapped.
+ while(!dijit.byNode(node)){
+ node - node.parentNode;
+ }
+ }
+
+ // If an onChoose function was provided, tell it what button
+ // value was chosen
+ if(this.onChoose){
+ this.onChoose(node ? dijit.byNode(node)._dialogValue: undefined);
+ }
+ // Hide the dialog
+ this.hide();
+ },
+
+ show: function(){
+ // summary:
+ // Show the dialog
+ this._doTransition(1);
+ },
+
+ hide: function(){
+ // summary:
+ // Hide the dialog
+ this._doTransition(-1);
+ },
+
+ _doTransition: function(dir){
+ // summary:
+ // Either shows or hides the dialog.
+ // dir:
+ // An integer. If positive, the dialog is shown. If negative,
+ // the dialog is hidden.
+
+ // TODO: replace this with CSS transitions
+
+ var anim;
+ var h = dojo.marginBox(this.domNode.firstChild).h;
+
+
+ var bodyHeight = this.controller.getWindowSize().h;
+ console.log("dialog height = " + h, " body height = " + bodyHeight);
+
+ var high = bodyHeight - h;
+ var low = bodyHeight;
+
+ var anim1 = dojo.fx.slideTo({
+ node: this.domNode,
+ duration: 400,
+ top: {start: dir < 0 ? high : low, end: dir < 0 ? low: high}
+ });
+
+ var anim2 = dojo[dir < 0 ? "fadeOut" : "fadeIn"]({
+ node: this.mask,
+ duration: 400
+ });
+
+ var anim = dojo.fx.combine([anim1, anim2]);
+
+ var _this = this;
+
+ dojo.connect(anim, "onEnd", this, function(){
+ if(dir < 0){
+ _this.domNode.style.display = "none";
+ dojo.destroy(_this.domNode);
+ dojo.destroy(_this.mask);
+ }
+ });
+ anim.play();
+ },
+
+ destroy: function(){
+ this.inherited(arguments);
+ dojo.destroy(this.mask);
+ },
+
+
+ onClick: function(){
+
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojo.string"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.string"] = true;
+dojo.provide("dojo.string");
+
+
+dojo.getObject("string", true, dojo);
+
+/*=====
+dojo.string = {
+ // summary: String utilities for Dojo
+};
+=====*/
+
+dojo.string.rep = function(/*String*/str, /*Integer*/num){
+ // summary:
+ // Efficiently replicate a string `n` times.
+ // str:
+ // the string to replicate
+ // num:
+ // number of times to replicate the string
+
+ if(num <= 0 || !str){ return ""; }
+
+ var buf = [];
+ for(;;){
+ if(num & 1){
+ buf.push(str);
+ }
+ if(!(num >>= 1)){ break; }
+ str += str;
+ }
+ return buf.join(""); // String
+};
+
+dojo.string.pad = function(/*String*/text, /*Integer*/size, /*String?*/ch, /*Boolean?*/end){
+ // summary:
+ // Pad a string to guarantee that it is at least `size` length by
+ // filling with the character `ch` at either the start or end of the
+ // string. Pads at the start, by default.
+ // text:
+ // the string to pad
+ // size:
+ // length to provide padding
+ // ch:
+ // character to pad, defaults to '0'
+ // end:
+ // adds padding at the end if true, otherwise pads at start
+ // example:
+ // | // Fill the string to length 10 with "+" characters on the right. Yields "Dojo++++++".
+ // | dojo.string.pad("Dojo", 10, "+", true);
+
+ if(!ch){
+ ch = '0';
+ }
+ var out = String(text),
+ pad = dojo.string.rep(ch, Math.ceil((size - out.length) / ch.length));
+ return end ? out + pad : pad + out; // String
+};
+
+dojo.string.substitute = function( /*String*/ template,
+ /*Object|Array*/map,
+ /*Function?*/ transform,
+ /*Object?*/ thisObject){
+ // summary:
+ // Performs parameterized substitutions on a string. Throws an
+ // exception if any parameter is unmatched.
+ // template:
+ // a string with expressions in the form `${key}` to be replaced or
+ // `${key:format}` which specifies a format function. keys are case-sensitive.
+ // map:
+ // hash to search for substitutions
+ // transform:
+ // a function to process all parameters before substitution takes
+ // place, e.g. mylib.encodeXML
+ // thisObject:
+ // where to look for optional format function; default to the global
+ // namespace
+ // example:
+ // Substitutes two expressions in a string from an Array or Object
+ // | // returns "File 'foo.html' is not found in directory '/temp'."
+ // | // by providing substitution data in an Array
+ // | dojo.string.substitute(
+ // | "File '${0}' is not found in directory '${1}'.",
+ // | ["foo.html","/temp"]
+ // | );
+ // |
+ // | // also returns "File 'foo.html' is not found in directory '/temp'."
+ // | // but provides substitution data in an Object structure. Dotted
+ // | // notation may be used to traverse the structure.
+ // | dojo.string.substitute(
+ // | "File '${name}' is not found in directory '${info.dir}'.",
+ // | { name: "foo.html", info: { dir: "/temp" } }
+ // | );
+ // example:
+ // Use a transform function to modify the values:
+ // | // returns "file 'foo.html' is not found in directory '/temp'."
+ // | dojo.string.substitute(
+ // | "${0} is not found in ${1}.",
+ // | ["foo.html","/temp"],
+ // | function(str){
+ // | // try to figure out the type
+ // | var prefix = (str.charAt(0) == "/") ? "directory": "file";
+ // | return prefix + " '" + str + "'";
+ // | }
+ // | );
+ // example:
+ // Use a formatter
+ // | // returns "thinger -- howdy"
+ // | dojo.string.substitute(
+ // | "${0:postfix}", ["thinger"], null, {
+ // | postfix: function(value, key){
+ // | return value + " -- howdy";
+ // | }
+ // | }
+ // | );
+
+ thisObject = thisObject || dojo.global;
+ transform = transform ?
+ dojo.hitch(thisObject, transform) : function(v){ return v; };
+
+ return template.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g,
+ function(match, key, format){
+ var value = dojo.getObject(key, false, map);
+ if(format){
+ value = dojo.getObject(format, false, thisObject).call(thisObject, value, key);
+ }
+ return transform(value, key).toString();
+ }); // String
+};
+
+/*=====
+dojo.string.trim = function(str){
+ // summary:
+ // Trims whitespace from both sides of the string
+ // str: String
+ // String to be trimmed
+ // returns: String
+ // Returns the trimmed string
+ // description:
+ // This version of trim() was taken from [Steven Levithan's blog](http://blog.stevenlevithan.com/archives/faster-trim-javascript).
+ // The short yet performant version of this function is dojo.trim(),
+ // which is part of Dojo base. Uses String.prototype.trim instead, if available.
+ return ""; // String
+}
+=====*/
+
+dojo.string.trim = String.prototype.trim ?
+ dojo.trim : // aliasing to the native function
+ function(str){
+ str = str.replace(/^\s+/, '');
+ for(var i = str.length - 1; i >= 0; i--){
+ if(/\S/.test(str.charAt(i))){
+ str = str.substring(0, i + 1);
+ break;
+ }
+ }
+ return str;
+ };
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app.List"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.List"] = true;
+dojo.provide("dojox.mobile.app.List");
+dojo.experimental("dojox.mobile.app.List");
+
+
+
+
+(function(){
+
+ var templateCache = {};
+
+ dojo.declare("dojox.mobile.app.List", dijit._WidgetBase, {
+ // summary:
+ // A templated list widget. Given a simple array of data objects
+ // and a HTML template, it renders a list of elements, with
+ // support for a swipe delete action. An optional template
+ // can be provided for when the list is empty.
+
+ // items: Array
+ // The array of data items that will be rendered.
+ items: null,
+
+ // itemTemplate: String
+ // The URL to the HTML file containing the markup for each individual
+ // data item.
+ itemTemplate: "",
+
+ // emptyTemplate: String
+ // The URL to the HTML file containing the HTML to display if there
+ // are no data items. This is optional.
+ emptyTemplate: "",
+
+ // dividerTemplate: String
+ // The URL to the HTML file containing the markup for the dividers
+ // between groups of list items
+ dividerTemplate: "",
+
+ // dividerFunction: Function
+ // Function to create divider elements. This should return a divider
+ // value for each item in the list
+ dividerFunction: null,
+
+ // labelDelete: String
+ // The label to display for the Delete button
+ labelDelete: "Delete",
+
+ // labelCancel: String
+ // The label to display for the Cancel button
+ labelCancel: "Cancel",
+
+ // controller: Object
+ //
+ controller: null,
+
+ // autoDelete: Boolean
+ autoDelete: true,
+
+ // enableDelete: Boolean
+ enableDelete: true,
+
+ // enableHold: Boolean
+ enableHold: true,
+
+ // formatters: Object
+ // A name/value map of functions used to format data for display
+ formatters: null,
+
+ // _templateLoadCount: Number
+ // The number of templates remaining to load before the list renders.
+ _templateLoadCount: 0,
+
+ // _mouseDownPos: Object
+ // The coordinates of where a mouseDown event was detected
+ _mouseDownPos: null,
+
+ baseClass: "list",
+
+ constructor: function(){
+ this._checkLoadComplete = dojo.hitch(this, this._checkLoadComplete);
+ this._replaceToken = dojo.hitch(this, this._replaceToken);
+ this._postDeleteAnim = dojo.hitch(this, this._postDeleteAnim);
+ },
+
+ postCreate: function(){
+
+ var _this = this;
+
+ if(this.emptyTemplate){
+ this._templateLoadCount++;
+ }
+ if(this.itemTemplate){
+ this._templateLoadCount++;
+ }
+ if(this.dividerTemplate){
+ this._templateLoadCount++;
+ }
+
+ this.connect(this.domNode, "onmousedown", function(event){
+ var touch = event;
+ if(event.targetTouches && event.targetTouches.length > 0){
+ touch = event.targetTouches[0];
+ }
+
+ // Find the node that was tapped/clicked
+ var rowNode = _this._getRowNode(event.target);
+
+ if(rowNode){
+ // Add the rows data to the event so it can be picked up
+ // by any listeners
+ _this._setDataInfo(rowNode, event);
+
+ // Select and highlight the row
+ _this._selectRow(rowNode);
+
+ // Record the position that was tapped
+ _this._mouseDownPos = {
+ x: touch.pageX,
+ y: touch.pageY
+ };
+ _this._dragThreshold = null;
+ }
+ });
+
+ this.connect(this.domNode, "onmouseup", function(event){
+ // When the mouse/finger comes off the list,
+ // call the onSelect function and deselect the row.
+ if(event.targetTouches && event.targetTouches.length > 0){
+ event = event.targetTouches[0];
+ }
+ var rowNode = _this._getRowNode(event.target);
+
+ if(rowNode){
+
+ _this._setDataInfo(rowNode, event);
+
+ if(_this._selectedRow){
+ _this.onSelect(rowNode._data, rowNode._idx, rowNode);
+ }
+
+ this._deselectRow();
+ }
+ });
+
+ // If swipe-to-delete is enabled, listen for the mouse moving
+ if(this.enableDelete){
+ this.connect(this.domNode, "mousemove", function(event){
+ dojo.stopEvent(event);
+ if(!_this._selectedRow){
+ return;
+ }
+ var rowNode = _this._getRowNode(event.target);
+
+ // Still check for enableDelete in case it's changed after
+ // this listener is added.
+ if(_this.enableDelete && rowNode && !_this._deleting){
+ _this.handleDrag(event);
+ }
+ });
+ }
+
+ // Put the data and index onto each onclick event.
+ this.connect(this.domNode, "onclick", function(event){
+ if(event.touches && event.touches.length > 0){
+ event = event.touches[0];
+ }
+ var rowNode = _this._getRowNode(event.target, true);
+
+ if(rowNode){
+ _this._setDataInfo(rowNode, event);
+ }
+ });
+
+ // If the mouse or finger moves off the selected row,
+ // deselect it.
+ this.connect(this.domNode, "mouseout", function(event){
+ if(event.touches && event.touches.length > 0){
+ event = event.touches[0];
+ }
+ if(event.target == _this._selectedRow){
+ _this._deselectRow();
+ }
+ });
+
+ // If no item template has been provided, it is an error.
+ if(!this.itemTemplate){
+ throw Error("An item template must be provided to " + this.declaredClass);
+ }
+
+ // Load the item template
+ this._loadTemplate(this.itemTemplate, "itemTemplate", this._checkLoadComplete);
+
+ if(this.emptyTemplate){
+ // If the optional empty template has been provided, load it.
+ this._loadTemplate(this.emptyTemplate, "emptyTemplate", this._checkLoadComplete);
+ }
+
+ if(this.dividerTemplate){
+ this._loadTemplate(this.dividerTemplate, "dividerTemplate", this._checkLoadComplete);
+ }
+ },
+
+ handleDrag: function(event){
+ // summary:
+ // Handles rows being swiped for deletion.
+ var touch = event;
+ if(event.targetTouches && event.targetTouches.length > 0){
+ touch = event.targetTouches[0];
+ }
+
+ // Get the distance that the mouse or finger has moved since
+ // beginning the swipe action.
+ var diff = touch.pageX - this._mouseDownPos.x;
+
+ var absDiff = Math.abs(diff);
+ if(absDiff > 10 && !this._dragThreshold){
+ // Make the user drag the row 60% of the width to remove it
+ this._dragThreshold = dojo.marginBox(this._selectedRow).w * 0.6;
+ if(!this.autoDelete){
+ this.createDeleteButtons(this._selectedRow);
+ }
+ }
+
+ this._selectedRow.style.left = (absDiff > 10 ? diff : 0) + "px";
+
+ // If the user has dragged the row more than the threshold, slide
+ // it off the screen in preparation for deletion.
+ if(this._dragThreshold && this._dragThreshold < absDiff){
+ this.preDelete(diff);
+ }
+ },
+
+ handleDragCancel: function(){
+ // summary:
+ // Handle a drag action being cancelled, for whatever reason.
+ // Reset handles, remove CSS classes etc.
+ if(this._deleting){
+ return;
+ }
+ dojo.removeClass(this._selectedRow, "hold");
+ this._selectedRow.style.left = 0;
+ this._mouseDownPos = null;
+ this._dragThreshold = null;
+
+ this._deleteBtns && dojo.style(this._deleteBtns, "display", "none");
+ },
+
+ preDelete: function(currentLeftPos){
+ // summary:
+ // Slides the row offscreen before it is deleted
+
+ // TODO: do this with CSS3!
+ var self = this;
+
+ this._deleting = true;
+
+ dojo.animateProperty({
+ node: this._selectedRow,
+ duration: 400,
+ properties: {
+ left: {
+ end: currentLeftPos +
+ ((currentLeftPos > 0 ? 1 : -1) * this._dragThreshold * 0.8)
+ }
+ },
+ onEnd: dojo.hitch(this, function(){
+ if(this.autoDelete){
+ this.deleteRow(this._selectedRow);
+ }
+ })
+ }).play();
+ },
+
+ deleteRow: function(row){
+
+ // First make the row invisible
+ // Put it back where it came from
+ dojo.style(row, {
+ visibility: "hidden",
+ minHeight: "0px"
+ });
+ dojo.removeClass(row, "hold");
+
+ this._deleteAnimConn =
+ this.connect(row, "webkitAnimationEnd", this._postDeleteAnim);
+
+ dojo.addClass(row, "collapsed");
+ },
+
+ _postDeleteAnim: function(event){
+ // summary:
+ // Completes the deletion of a row.
+
+ if(this._deleteAnimConn){
+ this.disconnect(this._deleteAnimConn);
+ this._deleteAnimConn = null;
+ }
+
+ var row = this._selectedRow;
+ var sibling = row.nextSibling;
+ var prevSibling = row.previousSibling;
+
+ // If the previous node is a divider and either this is
+ // the last element in the list, or the next node is
+ // also a divider, remove the divider for the deleted section.
+ if(prevSibling && prevSibling._isDivider){
+ if(!sibling || sibling._isDivider){
+ prevSibling.parentNode.removeChild(prevSibling);
+ }
+ }
+
+ row.parentNode.removeChild(row);
+ this.onDelete(row._data, row._idx, this.items);
+
+ // Decrement the index of each following row
+ while(sibling){
+ if(sibling._idx){
+ sibling._idx--;
+ }
+ sibling = sibling.nextSibling;
+ }
+
+ dojo.destroy(row);
+
+ // Fix up the 'first' and 'last' CSS classes on the rows
+ dojo.query("> *:not(.buttons)", this.domNode).forEach(this.applyClass);
+
+ this._deleting = false;
+ this._deselectRow();
+ },
+
+ createDeleteButtons: function(aroundNode){
+ // summary:
+ // Creates the two buttons displayed when confirmation is
+ // required before deletion of a row.
+ // aroundNode:
+ // The DOM node of the row about to be deleted.
+ var mb = dojo.marginBox(aroundNode);
+ var pos = dojo._abs(aroundNode, true);
+
+ if(!this._deleteBtns){
+ // Create the delete buttons.
+ this._deleteBtns = dojo.create("div",{
+ "class": "buttons"
+ }, this.domNode);
+
+ this.buttons = [];
+
+ this.buttons.push(new dojox.mobile.Button({
+ btnClass: "mblRedButton",
+ label: this.labelDelete
+ }));
+ this.buttons.push(new dojox.mobile.Button({
+ btnClass: "mblBlueButton",
+ label: this.labelCancel
+ }));
+
+ dojo.place(this.buttons[0].domNode, this._deleteBtns);
+ dojo.place(this.buttons[1].domNode, this._deleteBtns);
+
+ dojo.addClass(this.buttons[0].domNode, "deleteBtn");
+ dojo.addClass(this.buttons[1].domNode, "cancelBtn");
+
+ this._handleButtonClick = dojo.hitch(this._handleButtonClick);
+ this.connect(this._deleteBtns, "onclick", this._handleButtonClick);
+ }
+ dojo.removeClass(this._deleteBtns, "fade out fast");
+ dojo.style(this._deleteBtns, {
+ display: "",
+ width: mb.w + "px",
+ height: mb.h + "px",
+ top: (aroundNode.offsetTop) + "px",
+ left: "0px"
+ });
+ },
+
+ onDelete: function(data, index, array){
+ // summary:
+ // Called when a row is deleted
+ // data:
+ // The data related to the row being deleted
+ // index:
+ // The index of the data in the total array
+ // array:
+ // The array of data used.
+
+ array.splice(index, 1);
+
+ // If the data is empty, rerender in case an emptyTemplate has
+ // been provided
+ if(array.length < 1){
+ this.render();
+ }
+ },
+
+ cancelDelete: function(){
+ // summary:
+ // Cancels the deletion of a row.
+ this._deleting = false;
+ this.handleDragCancel();
+ },
+
+ _handleButtonClick: function(event){
+ // summary:
+ // Handles the click of one of the deletion buttons, either to
+ // delete the row or to cancel the deletion.
+ if(event.touches && event.touches.length > 0){
+ event = event.touches[0];
+ }
+ var node = event.target;
+ if(dojo.hasClass(node, "deleteBtn")){
+ this.deleteRow(this._selectedRow);
+ }else if(dojo.hasClass(node, "cancelBtn")){
+ this.cancelDelete();
+ }else{
+ return;
+ }
+ dojo.addClass(this._deleteBtns, "fade out");
+ },
+
+ applyClass: function(node, idx, array){
+ // summary:
+ // Applies the 'first' and 'last' CSS classes to the relevant
+ // rows.
+
+ dojo.removeClass(node, "first last");
+ if(idx == 0){
+ dojo.addClass(node, "first");
+ }
+ if(idx == array.length - 1){
+ dojo.addClass(node, "last");
+ }
+ },
+
+ _setDataInfo: function(rowNode, event){
+ // summary:
+ // Attaches the data item and index for each row to any event
+ // that occurs on that row.
+ event.item = rowNode._data;
+ event.index = rowNode._idx;
+ },
+
+ onSelect: function(data, index, rowNode){
+ // summary:
+ // Dummy function that is called when a row is tapped
+ },
+
+ _selectRow: function(row){
+ // summary:
+ // Selects a row, applies the relevant CSS classes.
+ if(this._deleting && this._selectedRow && row != this._selectedRow){
+ this.cancelDelete();
+ }
+
+ if(!dojo.hasClass(row, "row")){
+ return;
+ }
+ if(this.enableHold || this.enableDelete){
+ dojo.addClass(row, "hold");
+ }
+ this._selectedRow = row;
+ },
+
+ _deselectRow: function(){
+ // summary:
+ // Deselects a row, and cancels any drag actions that were
+ // occurring.
+ if(!this._selectedRow || this._deleting){
+ return;
+ }
+ this.handleDragCancel();
+ dojo.removeClass(this._selectedRow, "hold");
+ this._selectedRow = null;
+ },
+
+ _getRowNode: function(fromNode, ignoreNoClick){
+ // summary:
+ // Gets the DOM node of the row that is equal to or the parent
+ // of the node passed to this function.
+ while(fromNode && !fromNode._data && fromNode != this.domNode){
+ if(!ignoreNoClick && dojo.hasClass(fromNode, "noclick")){
+ return null;
+ }
+ fromNode = fromNode.parentNode;
+ }
+ return fromNode == this.domNode ? null : fromNode;
+ },
+
+ applyTemplate: function(template, data){
+ return dojo._toDom(dojo.string.substitute(
+ template, data, this._replaceToken, this.formatters || this));
+ },
+
+ render: function(){
+ // summary:
+ // Renders the list.
+
+ // Delete all existing nodes, except the deletion buttons.
+ dojo.query("> *:not(.buttons)", this.domNode).forEach(dojo.destroy);
+
+ // If there is no data, and an empty template has been provided,
+ // render it.
+ if(this.items.length < 1 && this.emptyTemplate){
+ dojo.place(dojo._toDom(this.emptyTemplate), this.domNode, "first");
+ }else{
+ this.domNode.appendChild(this._renderRange(0, this.items.length));
+ }
+ if(dojo.hasClass(this.domNode.parentNode, "mblRoundRect")){
+ dojo.addClass(this.domNode.parentNode, "mblRoundRectList")
+ }
+
+ var divs = dojo.query("> .row", this.domNode);
+ if(divs.length > 0){
+ dojo.addClass(divs[0], "first");
+ dojo.addClass(divs[divs.length - 1], "last");
+ }
+ },
+
+ _renderRange: function(startIdx, endIdx){
+
+ var rows = [];
+ var row, i;
+ var frag = document.createDocumentFragment();
+ startIdx = Math.max(0, startIdx);
+ endIdx = Math.min(endIdx, this.items.length);
+
+ for(i = startIdx; i < endIdx; i++){
+ // Create a document fragment containing the templated row
+ row = this.applyTemplate(this.itemTemplate, this.items[i]);
+ dojo.addClass(row, 'row');
+ row._data = this.items[i];
+ row._idx = i;
+ rows.push(row);
+ }
+ if(!this.dividerFunction || !this.dividerTemplate){
+ for(i = startIdx; i < endIdx; i++){
+ rows[i]._data = this.items[i];
+ rows[i]._idx = i;
+ frag.appendChild(rows[i]);
+ }
+ }else{
+ var prevDividerValue = null;
+ var dividerValue;
+ var divider;
+ for(i = startIdx; i < endIdx; i++){
+ rows[i]._data = this.items[i];
+ rows[i]._idx = i;
+
+ dividerValue = this.dividerFunction(this.items[i]);
+ if(dividerValue && dividerValue != prevDividerValue){
+ divider = this.applyTemplate(this.dividerTemplate, {
+ label: dividerValue,
+ item: this.items[i]
+ });
+ divider._isDivider = true;
+ frag.appendChild(divider);
+ prevDividerValue = dividerValue;
+ }
+ frag.appendChild(rows[i]);
+ }
+ }
+ return frag;
+ },
+
+ _replaceToken: function(value, key){
+ if(key.charAt(0) == '!'){ value = dojo.getObject(key.substr(1), false, _this); }
+ if(typeof value == "undefined"){ return ""; } // a debugging aide
+ if(value == null){ return ""; }
+
+ // Substitution keys beginning with ! will skip the transform step,
+ // in case a user wishes to insert unescaped markup, e.g. ${!foo}
+ return key.charAt(0) == "!" ? value :
+ // Safer substitution, see heading "Attribute values" in
+ // http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.3.2
+ value.toString().replace(/"/g,"&quot;"); //TODO: add &amp? use encodeXML method?
+
+ },
+
+ _checkLoadComplete: function(){
+ // summary:
+ // Checks if all templates have loaded
+ this._templateLoadCount--;
+
+ if(this._templateLoadCount < 1 && this.get("items")){
+ this.render();
+ }
+ },
+
+ _loadTemplate: function(url, thisAttr, callback){
+ // summary:
+ // Loads a template
+ if(!url){
+ callback();
+ return;
+ }
+
+ if(templateCache[url]){
+ this.set(thisAttr, templateCache[url]);
+ callback();
+ }else{
+ var _this = this;
+
+ dojo.xhrGet({
+ url: url,
+ sync: false,
+ handleAs: "text",
+ load: function(text){
+ templateCache[url] = dojo.trim(text);
+ _this.set(thisAttr, templateCache[url]);
+ callback();
+ }
+ });
+ }
+ },
+
+
+ _setFormattersAttr: function(formatters){
+ // summary:
+ // Sets the data items, and causes a rerender of the list
+ this.formatters = formatters;
+ },
+
+ _setItemsAttr: function(items){
+ // summary:
+ // Sets the data items, and causes a rerender of the list
+
+ this.items = items || [];
+
+ if(this._templateLoadCount < 1 && items){
+ this.render();
+ }
+ },
+
+ destroy: function(){
+ if(this.buttons){
+ dojo.forEach(this.buttons, function(button){
+ button.destroy();
+ });
+ this.buttons = null;
+ }
+
+ this.inherited(arguments);
+ }
+
+ });
+
+})();
+
+}
+
+if(!dojo._hasResource["dojo.fx.Toggler"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.fx.Toggler"] = true;
+dojo.provide("dojo.fx.Toggler");
+
+
+
+dojo.declare("dojo.fx.Toggler", null, {
+ // summary:
+ // A simple `dojo.Animation` toggler API.
+ //
+ // description:
+ // class constructor for an animation toggler. It accepts a packed
+ // set of arguments about what type of animation to use in each
+ // direction, duration, etc. All available members are mixed into
+ // these animations from the constructor (for example, `node`,
+ // `showDuration`, `hideDuration`).
+ //
+ // example:
+ // | var t = new dojo.fx.Toggler({
+ // | node: "nodeId",
+ // | showDuration: 500,
+ // | // hideDuration will default to "200"
+ // | showFunc: dojo.fx.wipeIn,
+ // | // hideFunc will default to "fadeOut"
+ // | });
+ // | t.show(100); // delay showing for 100ms
+ // | // ...time passes...
+ // | t.hide();
+
+ // node: DomNode
+ // the node to target for the showing and hiding animations
+ node: null,
+
+ // showFunc: Function
+ // The function that returns the `dojo.Animation` to show the node
+ showFunc: dojo.fadeIn,
+
+ // hideFunc: Function
+ // The function that returns the `dojo.Animation` to hide the node
+ hideFunc: dojo.fadeOut,
+
+ // showDuration:
+ // Time in milliseconds to run the show Animation
+ showDuration: 200,
+
+ // hideDuration:
+ // Time in milliseconds to run the hide Animation
+ hideDuration: 200,
+
+ // FIXME: need a policy for where the toggler should "be" the next
+ // time show/hide are called if we're stopped somewhere in the
+ // middle.
+ // FIXME: also would be nice to specify individual showArgs/hideArgs mixed into
+ // each animation individually.
+ // FIXME: also would be nice to have events from the animations exposed/bridged
+
+ /*=====
+ _showArgs: null,
+ _showAnim: null,
+
+ _hideArgs: null,
+ _hideAnim: null,
+
+ _isShowing: false,
+ _isHiding: false,
+ =====*/
+
+ constructor: function(args){
+ var _t = this;
+
+ dojo.mixin(_t, args);
+ _t.node = args.node;
+ _t._showArgs = dojo.mixin({}, args);
+ _t._showArgs.node = _t.node;
+ _t._showArgs.duration = _t.showDuration;
+ _t.showAnim = _t.showFunc(_t._showArgs);
+
+ _t._hideArgs = dojo.mixin({}, args);
+ _t._hideArgs.node = _t.node;
+ _t._hideArgs.duration = _t.hideDuration;
+ _t.hideAnim = _t.hideFunc(_t._hideArgs);
+
+ dojo.connect(_t.showAnim, "beforeBegin", dojo.hitch(_t.hideAnim, "stop", true));
+ dojo.connect(_t.hideAnim, "beforeBegin", dojo.hitch(_t.showAnim, "stop", true));
+ },
+
+ show: function(delay){
+ // summary: Toggle the node to showing
+ // delay: Integer?
+ // Ammount of time to stall playing the show animation
+ return this.showAnim.play(delay || 0);
+ },
+
+ hide: function(delay){
+ // summary: Toggle the node to hidden
+ // delay: Integer?
+ // Ammount of time to stall playing the hide animation
+ return this.hideAnim.play(delay || 0);
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojo.fx"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.fx"] = true;
+dojo.provide("dojo.fx");
+
+
+
+
+/*=====
+dojo.fx = {
+ // summary: Effects library on top of Base animations
+};
+=====*/
+(function(){
+
+ var d = dojo,
+ _baseObj = {
+ _fire: function(evt, args){
+ if(this[evt]){
+ this[evt].apply(this, args||[]);
+ }
+ return this;
+ }
+ };
+
+ var _chain = function(animations){
+ this._index = -1;
+ this._animations = animations||[];
+ this._current = this._onAnimateCtx = this._onEndCtx = null;
+
+ this.duration = 0;
+ d.forEach(this._animations, function(a){
+ this.duration += a.duration;
+ if(a.delay){ this.duration += a.delay; }
+ }, this);
+ };
+ d.extend(_chain, {
+ _onAnimate: function(){
+ this._fire("onAnimate", arguments);
+ },
+ _onEnd: function(){
+ d.disconnect(this._onAnimateCtx);
+ d.disconnect(this._onEndCtx);
+ this._onAnimateCtx = this._onEndCtx = null;
+ if(this._index + 1 == this._animations.length){
+ this._fire("onEnd");
+ }else{
+ // switch animations
+ this._current = this._animations[++this._index];
+ this._onAnimateCtx = d.connect(this._current, "onAnimate", this, "_onAnimate");
+ this._onEndCtx = d.connect(this._current, "onEnd", this, "_onEnd");
+ this._current.play(0, true);
+ }
+ },
+ play: function(/*int?*/ delay, /*Boolean?*/ gotoStart){
+ if(!this._current){ this._current = this._animations[this._index = 0]; }
+ if(!gotoStart && this._current.status() == "playing"){ return this; }
+ var beforeBegin = d.connect(this._current, "beforeBegin", this, function(){
+ this._fire("beforeBegin");
+ }),
+ onBegin = d.connect(this._current, "onBegin", this, function(arg){
+ this._fire("onBegin", arguments);
+ }),
+ onPlay = d.connect(this._current, "onPlay", this, function(arg){
+ this._fire("onPlay", arguments);
+ d.disconnect(beforeBegin);
+ d.disconnect(onBegin);
+ d.disconnect(onPlay);
+ });
+ if(this._onAnimateCtx){
+ d.disconnect(this._onAnimateCtx);
+ }
+ this._onAnimateCtx = d.connect(this._current, "onAnimate", this, "_onAnimate");
+ if(this._onEndCtx){
+ d.disconnect(this._onEndCtx);
+ }
+ this._onEndCtx = d.connect(this._current, "onEnd", this, "_onEnd");
+ this._current.play.apply(this._current, arguments);
+ return this;
+ },
+ pause: function(){
+ if(this._current){
+ var e = d.connect(this._current, "onPause", this, function(arg){
+ this._fire("onPause", arguments);
+ d.disconnect(e);
+ });
+ this._current.pause();
+ }
+ return this;
+ },
+ gotoPercent: function(/*Decimal*/percent, /*Boolean?*/ andPlay){
+ this.pause();
+ var offset = this.duration * percent;
+ this._current = null;
+ d.some(this._animations, function(a){
+ if(a.duration <= offset){
+ this._current = a;
+ return true;
+ }
+ offset -= a.duration;
+ return false;
+ });
+ if(this._current){
+ this._current.gotoPercent(offset / this._current.duration, andPlay);
+ }
+ return this;
+ },
+ stop: function(/*boolean?*/ gotoEnd){
+ if(this._current){
+ if(gotoEnd){
+ for(; this._index + 1 < this._animations.length; ++this._index){
+ this._animations[this._index].stop(true);
+ }
+ this._current = this._animations[this._index];
+ }
+ var e = d.connect(this._current, "onStop", this, function(arg){
+ this._fire("onStop", arguments);
+ d.disconnect(e);
+ });
+ this._current.stop();
+ }
+ return this;
+ },
+ status: function(){
+ return this._current ? this._current.status() : "stopped";
+ },
+ destroy: function(){
+ if(this._onAnimateCtx){ d.disconnect(this._onAnimateCtx); }
+ if(this._onEndCtx){ d.disconnect(this._onEndCtx); }
+ }
+ });
+ d.extend(_chain, _baseObj);
+
+ dojo.fx.chain = function(/*dojo.Animation[]*/ animations){
+ // summary:
+ // Chain a list of `dojo.Animation`s to run in sequence
+ //
+ // description:
+ // Return a `dojo.Animation` which will play all passed
+ // `dojo.Animation` instances in sequence, firing its own
+ // synthesized events simulating a single animation. (eg:
+ // onEnd of this animation means the end of the chain,
+ // not the individual animations within)
+ //
+ // example:
+ // Once `node` is faded out, fade in `otherNode`
+ // | dojo.fx.chain([
+ // | dojo.fadeIn({ node:node }),
+ // | dojo.fadeOut({ node:otherNode })
+ // | ]).play();
+ //
+ return new _chain(animations) // dojo.Animation
+ };
+
+ var _combine = function(animations){
+ this._animations = animations||[];
+ this._connects = [];
+ this._finished = 0;
+
+ this.duration = 0;
+ d.forEach(animations, function(a){
+ var duration = a.duration;
+ if(a.delay){ duration += a.delay; }
+ if(this.duration < duration){ this.duration = duration; }
+ this._connects.push(d.connect(a, "onEnd", this, "_onEnd"));
+ }, this);
+
+ this._pseudoAnimation = new d.Animation({curve: [0, 1], duration: this.duration});
+ var self = this;
+ d.forEach(["beforeBegin", "onBegin", "onPlay", "onAnimate", "onPause", "onStop", "onEnd"],
+ function(evt){
+ self._connects.push(d.connect(self._pseudoAnimation, evt,
+ function(){ self._fire(evt, arguments); }
+ ));
+ }
+ );
+ };
+ d.extend(_combine, {
+ _doAction: function(action, args){
+ d.forEach(this._animations, function(a){
+ a[action].apply(a, args);
+ });
+ return this;
+ },
+ _onEnd: function(){
+ if(++this._finished > this._animations.length){
+ this._fire("onEnd");
+ }
+ },
+ _call: function(action, args){
+ var t = this._pseudoAnimation;
+ t[action].apply(t, args);
+ },
+ play: function(/*int?*/ delay, /*Boolean?*/ gotoStart){
+ this._finished = 0;
+ this._doAction("play", arguments);
+ this._call("play", arguments);
+ return this;
+ },
+ pause: function(){
+ this._doAction("pause", arguments);
+ this._call("pause", arguments);
+ return this;
+ },
+ gotoPercent: function(/*Decimal*/percent, /*Boolean?*/ andPlay){
+ var ms = this.duration * percent;
+ d.forEach(this._animations, function(a){
+ a.gotoPercent(a.duration < ms ? 1 : (ms / a.duration), andPlay);
+ });
+ this._call("gotoPercent", arguments);
+ return this;
+ },
+ stop: function(/*boolean?*/ gotoEnd){
+ this._doAction("stop", arguments);
+ this._call("stop", arguments);
+ return this;
+ },
+ status: function(){
+ return this._pseudoAnimation.status();
+ },
+ destroy: function(){
+ d.forEach(this._connects, dojo.disconnect);
+ }
+ });
+ d.extend(_combine, _baseObj);
+
+ dojo.fx.combine = function(/*dojo.Animation[]*/ animations){
+ // summary:
+ // Combine a list of `dojo.Animation`s to run in parallel
+ //
+ // description:
+ // Combine an array of `dojo.Animation`s to run in parallel,
+ // providing a new `dojo.Animation` instance encompasing each
+ // animation, firing standard animation events.
+ //
+ // example:
+ // Fade out `node` while fading in `otherNode` simultaneously
+ // | dojo.fx.combine([
+ // | dojo.fadeIn({ node:node }),
+ // | dojo.fadeOut({ node:otherNode })
+ // | ]).play();
+ //
+ // example:
+ // When the longest animation ends, execute a function:
+ // | var anim = dojo.fx.combine([
+ // | dojo.fadeIn({ node: n, duration:700 }),
+ // | dojo.fadeOut({ node: otherNode, duration: 300 })
+ // | ]);
+ // | dojo.connect(anim, "onEnd", function(){
+ // | // overall animation is done.
+ // | });
+ // | anim.play(); // play the animation
+ //
+ return new _combine(animations); // dojo.Animation
+ };
+
+ dojo.fx.wipeIn = function(/*Object*/ args){
+ // summary:
+ // Expand a node to it's natural height.
+ //
+ // description:
+ // Returns an animation that will expand the
+ // node defined in 'args' object from it's current height to
+ // it's natural height (with no scrollbar).
+ // Node must have no margin/border/padding.
+ //
+ // args: Object
+ // A hash-map of standard `dojo.Animation` constructor properties
+ // (such as easing: node: duration: and so on)
+ //
+ // example:
+ // | dojo.fx.wipeIn({
+ // | node:"someId"
+ // | }).play()
+ var node = args.node = d.byId(args.node), s = node.style, o;
+
+ var anim = d.animateProperty(d.mixin({
+ properties: {
+ height: {
+ // wrapped in functions so we wait till the last second to query (in case value has changed)
+ start: function(){
+ // start at current [computed] height, but use 1px rather than 0
+ // because 0 causes IE to display the whole panel
+ o = s.overflow;
+ s.overflow = "hidden";
+ if(s.visibility == "hidden" || s.display == "none"){
+ s.height = "1px";
+ s.display = "";
+ s.visibility = "";
+ return 1;
+ }else{
+ var height = d.style(node, "height");
+ return Math.max(height, 1);
+ }
+ },
+ end: function(){
+ return node.scrollHeight;
+ }
+ }
+ }
+ }, args));
+
+ d.connect(anim, "onEnd", function(){
+ s.height = "auto";
+ s.overflow = o;
+ });
+
+ return anim; // dojo.Animation
+ };
+
+ dojo.fx.wipeOut = function(/*Object*/ args){
+ // summary:
+ // Shrink a node to nothing and hide it.
+ //
+ // description:
+ // Returns an animation that will shrink node defined in "args"
+ // from it's current height to 1px, and then hide it.
+ //
+ // args: Object
+ // A hash-map of standard `dojo.Animation` constructor properties
+ // (such as easing: node: duration: and so on)
+ //
+ // example:
+ // | dojo.fx.wipeOut({ node:"someId" }).play()
+
+ var node = args.node = d.byId(args.node), s = node.style, o;
+
+ var anim = d.animateProperty(d.mixin({
+ properties: {
+ height: {
+ end: 1 // 0 causes IE to display the whole panel
+ }
+ }
+ }, args));
+
+ d.connect(anim, "beforeBegin", function(){
+ o = s.overflow;
+ s.overflow = "hidden";
+ s.display = "";
+ });
+ d.connect(anim, "onEnd", function(){
+ s.overflow = o;
+ s.height = "auto";
+ s.display = "none";
+ });
+
+ return anim; // dojo.Animation
+ };
+
+ dojo.fx.slideTo = function(/*Object*/ args){
+ // summary:
+ // Slide a node to a new top/left position
+ //
+ // description:
+ // Returns an animation that will slide "node"
+ // defined in args Object from its current position to
+ // the position defined by (args.left, args.top).
+ //
+ // args: Object
+ // A hash-map of standard `dojo.Animation` constructor properties
+ // (such as easing: node: duration: and so on). Special args members
+ // are `top` and `left`, which indicate the new position to slide to.
+ //
+ // example:
+ // | dojo.fx.slideTo({ node: node, left:"40", top:"50", units:"px" }).play()
+
+ var node = args.node = d.byId(args.node),
+ top = null, left = null;
+
+ var init = (function(n){
+ return function(){
+ var cs = d.getComputedStyle(n);
+ var pos = cs.position;
+ top = (pos == 'absolute' ? n.offsetTop : parseInt(cs.top) || 0);
+ left = (pos == 'absolute' ? n.offsetLeft : parseInt(cs.left) || 0);
+ if(pos != 'absolute' && pos != 'relative'){
+ var ret = d.position(n, true);
+ top = ret.y;
+ left = ret.x;
+ n.style.position="absolute";
+ n.style.top=top+"px";
+ n.style.left=left+"px";
+ }
+ };
+ })(node);
+ init();
+
+ var anim = d.animateProperty(d.mixin({
+ properties: {
+ top: args.top || 0,
+ left: args.left || 0
+ }
+ }, args));
+ d.connect(anim, "beforeBegin", anim, init);
+
+ return anim; // dojo.Animation
+ };
+
+})();
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app.ListSelector"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.ListSelector"] = true;
+dojo.provide("dojox.mobile.app.ListSelector");
+dojo.experimental("dojox.mobile.app.ListSelector");
+
+
+
+
+dojo.declare("dojox.mobile.app.ListSelector", dojox.mobile.app._Widget, {
+
+ // data: Array
+ // The array of items to display. Each element in the array
+ // should have both a label and value attribute, e.g.
+ // [{label: "Open", value: 1} , {label: "Delete", value: 2}]
+ data: null,
+
+ // controller: Object
+ // The current SceneController widget.
+ controller: null,
+
+ // onChoose: Function
+ // The callback function for when an item is selected
+ onChoose: null,
+
+ destroyOnHide: false,
+
+ _setDataAttr: function(data){
+ this.data = data;
+
+ if(this.data){
+ this.render();
+ }
+ },
+
+ postCreate: function(){
+ dojo.addClass(this.domNode, "listSelector");
+
+ var _this = this;
+
+ this.connect(this.domNode, "onclick", function(event){
+ if(!dojo.hasClass(event.target, "listSelectorRow")){
+ return;
+ }
+
+ if(_this.onChoose){
+ _this.onChoose(_this.data[event.target._idx].value);
+ }
+ _this.hide();
+ });
+
+ this.connect(this.domNode, "onmousedown", function(event){
+ if(!dojo.hasClass(event.target, "listSelectorRow")){
+ return;
+ }
+ dojo.addClass(event.target, "listSelectorRow-selected");
+ });
+
+ this.connect(this.domNode, "onmouseup", function(event){
+ if(!dojo.hasClass(event.target, "listSelectorRow")){
+ return;
+ }
+ dojo.removeClass(event.target, "listSelectorRow-selected");
+ });
+
+ this.connect(this.domNode, "onmouseout", function(event){
+ if(!dojo.hasClass(event.target, "listSelectorRow")){
+ return;
+ }
+ dojo.removeClass(event.target, "listSelectorRow-selected");
+ });
+
+ var viewportSize = this.controller.getWindowSize();
+
+ this.mask = dojo.create("div", {"class": "dialogUnderlayWrapper",
+ innerHTML: "<div class=\"dialogUnderlay\"></div>"
+ }, this.controller.assistant.domNode);
+
+ this.connect(this.mask, "onclick", function(){
+ _this.onChoose && _this.onChoose();
+ _this.hide();
+ });
+ },
+
+ show: function(fromNode){
+
+ // Using dojo.fx here. Must figure out how to do this with CSS animations!!
+ var startPos;
+
+ var windowSize = this.controller.getWindowSize();
+ var fromNodePos;
+ if(fromNode){
+ fromNodePos = dojo._abs(fromNode);
+ startPos = fromNodePos;
+ }else{
+ startPos.x = windowSize.w / 2;
+ startPos.y = 200;
+ }
+ console.log("startPos = ", startPos);
+
+ dojo.style(this.domNode, {
+ opacity: 0,
+ display: "",
+ width: Math.floor(windowSize.w * 0.8) + "px"
+ });
+
+ var maxWidth = 0;
+ dojo.query(">", this.domNode).forEach(function(node){
+ dojo.style(node, {
+ "float": "left"
+ });
+ maxWidth = Math.max(maxWidth, dojo.marginBox(node).w);
+ dojo.style(node, {
+ "float": "none"
+ });
+ });
+ maxWidth = Math.min(maxWidth, Math.round(windowSize.w * 0.8))
+ + dojo.style(this.domNode, "paddingLeft")
+ + dojo.style(this.domNode, "paddingRight")
+ + 1;
+
+ dojo.style(this.domNode, "width", maxWidth + "px");
+ var targetHeight = dojo.marginBox(this.domNode).h;
+
+ var _this = this;
+
+
+ var targetY = fromNodePos ?
+ Math.max(30, fromNodePos.y - targetHeight - 10) :
+ this.getScroll().y + 30;
+
+ console.log("fromNodePos = ", fromNodePos, " targetHeight = ", targetHeight,
+ " targetY = " + targetY, " startPos ", startPos);
+
+
+ var anim1 = dojo.animateProperty({
+ node: this.domNode,
+ duration: 400,
+ properties: {
+ width: {start: 1, end: maxWidth},
+ height: {start: 1, end: targetHeight},
+ top: {start: startPos.y, end: targetY},
+ left: {start: startPos.x, end: (windowSize.w/2 - maxWidth/2)},
+ opacity: {start: 0, end: 1},
+ fontSize: {start: 1}
+ },
+ onEnd: function(){
+ dojo.style(_this.domNode, "width", "inherit");
+ }
+ });
+ var anim2 = dojo.fadeIn({
+ node: this.mask,
+ duration: 400
+ });
+ dojo.fx.combine([anim1, anim2]).play();
+
+ },
+
+ hide: function(){
+ // Using dojo.fx here. Must figure out how to do this with CSS animations!!
+
+ var _this = this;
+
+ var anim1 = dojo.animateProperty({
+ node: this.domNode,
+ duration: 500,
+ properties: {
+ width: {end: 1},
+ height: {end: 1},
+ opacity: {end: 0},
+ fontSize: {end: 1}
+ },
+ onEnd: function(){
+ if(_this.get("destroyOnHide")){
+ _this.destroy();
+ }
+ }
+ });
+
+ var anim2 = dojo.fadeOut({
+ node: this.mask,
+ duration: 400
+ });
+ dojo.fx.combine([anim1, anim2]).play();
+ },
+
+ render: function(){
+ // summary:
+ // Renders
+
+ dojo.empty(this.domNode);
+ dojo.style(this.domNode, "opacity", 0);
+
+ var row;
+
+ for(var i = 0; i < this.data.length; i++){
+ // Create each row and add any custom classes. Also set the _idx property.
+ row = dojo.create("div", {
+ "class": "listSelectorRow " + (this.data[i].className || ""),
+ innerHTML: this.data[i].label
+ }, this.domNode);
+
+ row._idx = i;
+
+ if(i == 0){
+ dojo.addClass(row, "first");
+ }
+ if(i == this.data.length - 1){
+ dojo.addClass(row, "last");
+ }
+
+ }
+ },
+
+
+ destroy: function(){
+ this.inherited(arguments);
+ dojo.destroy(this.mask);
+ }
+
+});
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app._FormWidget"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app._FormWidget"] = true;
+dojo.provide("dojox.mobile.app._FormWidget");
+dojo.experimental("dojox.mobile.app._FormWidget");
+
+
+
+
+
+dojo.declare("dojox.mobile.app._FormWidget", dijit._WidgetBase, {
+ // summary:
+ // Base class for widgets corresponding to native HTML elements such as <checkbox> or <button>,
+ // which can be children of a <form> node or a `dojox.mobile.app.Form` widget.
+ //
+ // description:
+ // Represents a single HTML element.
+ // All these widgets should have these attributes just like native HTML input elements.
+ // You can set them during widget construction or afterwards, via `dijit._WidgetBase.attr`.
+ //
+ // They also share some common methods.
+
+ // name: String
+ // Name used when submitting form; same as "name" attribute or plain HTML elements
+ name: "",
+
+ // alt: String
+ // Corresponds to the native HTML <input> element's attribute.
+ alt: "",
+
+ // value: String
+ // Corresponds to the native HTML <input> element's attribute.
+ value: "",
+
+ // type: String
+ // Corresponds to the native HTML <input> element's attribute.
+ type: "text",
+
+ // disabled: Boolean
+ // Should this widget respond to user input?
+ // In markup, this is specified as "disabled='disabled'", or just "disabled".
+ disabled: false,
+
+ // intermediateChanges: Boolean
+ // Fires onChange for each value change or only on demand
+ intermediateChanges: false,
+
+ // scrollOnFocus: Boolean
+ // On focus, should this widget scroll into view?
+ scrollOnFocus: false,
+
+ // These mixins assume that the focus node is an INPUT, as many but not all _FormWidgets are.
+ attributeMap: dojo.delegate(dijit._WidgetBase.prototype.attributeMap, {
+ value: "focusNode",
+ id: "focusNode",
+ alt: "focusNode",
+ title: "focusNode"
+ }),
+
+ postMixInProperties: function(){
+ // Setup name=foo string to be referenced from the template (but only if a name has been specified)
+ // Unfortunately we can't use attributeMap to set the name due to IE limitations, see #8660
+ // Regarding escaping, see heading "Attribute values" in
+ // http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.3.2
+ this.nameAttrSetting = this.name ? ('name="' + this.name.replace(/'/g, "&quot;") + '"') : '';
+ this.inherited(arguments);
+ },
+
+ postCreate: function(){
+ this.inherited(arguments);
+ this.connect(this.domNode, "onmousedown", "_onMouseDown");
+ },
+
+ _setDisabledAttr: function(/*Boolean*/ value){
+ this.disabled = value;
+ dojo.attr(this.focusNode, 'disabled', value);
+ if(this.valueNode){
+ dojo.attr(this.valueNode, 'disabled', value);
+ }
+ },
+
+ _onFocus: function(e){
+ if(this.scrollOnFocus){
+ dojo.window.scrollIntoView(this.domNode);
+ }
+ this.inherited(arguments);
+ },
+
+ isFocusable: function(){
+ // summary:
+ // Tells if this widget is focusable or not. Used internally by dijit.
+ // tags:
+ // protected
+ return !this.disabled && !this.readOnly
+ && this.focusNode && (dojo.style(this.domNode, "display") != "none");
+ },
+
+ focus: function(){
+ // summary:
+ // Put focus on this widget
+ this.focusNode.focus();
+ },
+
+ compare: function(/*anything*/val1, /*anything*/val2){
+ // summary:
+ // Compare 2 values (as returned by attr('value') for this widget).
+ // tags:
+ // protected
+ if(typeof val1 == "number" && typeof val2 == "number"){
+ return (isNaN(val1) && isNaN(val2)) ? 0 : val1 - val2;
+ }else if(val1 > val2){
+ return 1;
+ }else if(val1 < val2){
+ return -1;
+ }else{
+ return 0;
+ }
+ },
+
+ onChange: function(newValue){
+ // summary:
+ // Callback when this widget's value is changed.
+ // tags:
+ // callback
+ },
+
+ // _onChangeActive: [private] Boolean
+ // Indicates that changes to the value should call onChange() callback.
+ // This is false during widget initialization, to avoid calling onChange()
+ // when the initial value is set.
+ _onChangeActive: false,
+
+ _handleOnChange: function(/*anything*/ newValue, /* Boolean? */ priorityChange){
+ // summary:
+ // Called when the value of the widget is set. Calls onChange() if appropriate
+ // newValue:
+ // the new value
+ // priorityChange:
+ // For a slider, for example, dragging the slider is priorityChange==false,
+ // but on mouse up, it's priorityChange==true. If intermediateChanges==true,
+ // onChange is only called form priorityChange=true events.
+ // tags:
+ // private
+ this._lastValue = newValue;
+ if(this._lastValueReported == undefined && (priorityChange === null || !this._onChangeActive)){
+ // this block executes not for a change, but during initialization,
+ // and is used to store away the original value (or for ToggleButton, the original checked state)
+ this._resetValue = this._lastValueReported = newValue;
+ }
+ if((this.intermediateChanges || priorityChange || priorityChange === undefined) &&
+ ((typeof newValue != typeof this._lastValueReported) ||
+ this.compare(newValue, this._lastValueReported) != 0)){
+ this._lastValueReported = newValue;
+ if(this._onChangeActive){
+ if(this._onChangeHandle){
+ clearTimeout(this._onChangeHandle);
+ }
+ // setTimout allows hidden value processing to run and
+ // also the onChange handler can safely adjust focus, etc
+ this._onChangeHandle = setTimeout(dojo.hitch(this,
+ function(){
+ this._onChangeHandle = null;
+ this.onChange(newValue);
+ }), 0); // try to collapse multiple onChange's fired faster than can be processed
+ }
+ }
+ },
+
+ create: function(){
+ // Overrides _Widget.create()
+ this.inherited(arguments);
+ this._onChangeActive = true;
+ },
+
+ destroy: function(){
+ if(this._onChangeHandle){ // destroy called before last onChange has fired
+ clearTimeout(this._onChangeHandle);
+ this.onChange(this._lastValueReported);
+ }
+ this.inherited(arguments);
+ },
+
+ _onMouseDown: function(e){
+ // If user clicks on the button, even if the mouse is released outside of it,
+ // this button should get focus (to mimics native browser buttons).
+ // This is also needed on chrome because otherwise buttons won't get focus at all,
+ // which leads to bizarre focus restore on Dialog close etc.
+ if(this.isFocusable()){
+ // Set a global event to handle mouseup, so it fires properly
+ // even if the cursor leaves this.domNode before the mouse up event.
+ var mouseUpConnector = this.connect(dojo.body(), "onmouseup", function(){
+ if(this.isFocusable()){
+ this.focus();
+ }
+ this.disconnect(mouseUpConnector);
+ });
+ }
+ },
+
+ selectInputText: function(/*DomNode*/element, /*Number?*/ start, /*Number?*/ stop){
+ // summary:
+ // Select text in the input element argument, from start (default 0), to stop (default end).
+
+ // TODO: use functions in _editor/selection.js?
+ var _window = dojo.global;
+ var _document = dojo.doc;
+ element = dojo.byId(element);
+ if(isNaN(start)){ start = 0; }
+ if(isNaN(stop)){ stop = element.value ? element.value.length : 0; }
+ dijit.focus(element);
+
+ if(_window["getSelection"] && element.setSelectionRange){
+ element.setSelectionRange(start, stop);
+ }
+ }
+});
+
+dojo.declare("dojox.mobile.app._FormValueWidget", dojox.mobile.app._FormWidget,
+{
+ // summary:
+ // Base class for widgets corresponding to native HTML elements such as <input> or <select> that have user changeable values.
+ // description:
+ // Each _FormValueWidget represents a single input value, and has a (possibly hidden) <input> element,
+ // to which it serializes it's input value, so that form submission (either normal submission or via FormBind?)
+ // works as expected.
+
+ // Don't attempt to mixin the 'type', 'name' attributes here programatically -- they must be declared
+ // directly in the template as read by the parser in order to function. IE is known to specifically
+ // require the 'name' attribute at element creation time. See #8484, #8660.
+ // TODO: unclear what that {value: ""} is for; FormWidget.attributeMap copies value to focusNode,
+ // so maybe {value: ""} is so the value *doesn't* get copied to focusNode?
+ // Seems like we really want value removed from attributeMap altogether
+ // (although there's no easy way to do that now)
+
+ // readOnly: Boolean
+ // Should this widget respond to user input?
+ // In markup, this is specified as "readOnly".
+ // Similar to disabled except readOnly form values are submitted.
+ readOnly: false,
+
+ attributeMap: dojo.delegate(dojox.mobile.app._FormWidget.prototype.attributeMap, {
+ value: "",
+ readOnly: "focusNode"
+ }),
+
+ _setReadOnlyAttr: function(/*Boolean*/ value){
+ this.readOnly = value;
+ dojo.attr(this.focusNode, 'readOnly', value);
+ },
+
+ postCreate: function(){
+ this.inherited(arguments);
+
+ // Update our reset value if it hasn't yet been set (because this.set()
+ // is only called when there *is* a value)
+ if(this._resetValue === undefined){
+ this._resetValue = this.value;
+ }
+ },
+
+ _setValueAttr: function(/*anything*/ newValue, /*Boolean, optional*/ priorityChange){
+ // summary:
+ // Hook so attr('value', value) works.
+ // description:
+ // Sets the value of the widget.
+ // If the value has changed, then fire onChange event, unless priorityChange
+ // is specified as null (or false?)
+ this.value = newValue;
+ this._handleOnChange(newValue, priorityChange);
+ },
+
+ _getValueAttr: function(){
+ // summary:
+ // Hook so attr('value') works.
+ return this._lastValue;
+ },
+
+ undo: function(){
+ // summary:
+ // Restore the value to the last value passed to onChange
+ this._setValueAttr(this._lastValueReported, false);
+ },
+
+ reset: function(){
+ // summary:
+ // Reset the widget's value to what it was at initialization time
+ this._hasBeenBlurred = false;
+ this._setValueAttr(this._resetValue, true);
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app.TextBox"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.TextBox"] = true;
+dojo.provide("dojox.mobile.app.TextBox");
+dojo.experimental("dojox.mobile.app.TextBox");
+
+
+
+
+dojo.declare(
+ "dojox.mobile.app.TextBox",
+ dojox.mobile.app._FormValueWidget, {
+
+ // summary:
+ // A base class for textbox form inputs
+
+ // trim: Boolean
+ // Removes leading and trailing whitespace if true. Default is false.
+ trim: false,
+
+ // uppercase: Boolean
+ // Converts all characters to uppercase if true. Default is false.
+ uppercase: false,
+
+ // lowercase: Boolean
+ // Converts all characters to lowercase if true. Default is false.
+ lowercase: false,
+
+ // propercase: Boolean
+ // Converts the first character of each word to uppercase if true.
+ propercase: false,
+
+ // maxLength: String
+ // HTML INPUT tag maxLength declaration.
+ maxLength: "",
+
+ // selectOnClick: [const] Boolean
+ // If true, all text will be selected when focused with mouse
+ selectOnClick: false,
+
+ // placeHolder: String
+ // Defines a hint to help users fill out the input field (as defined in HTML 5).
+ // This should only contain plain text (no html markup).
+ placeHolder: "",
+
+ baseClass: "mblTextBox",
+
+ attributeMap: dojo.delegate(dojox.mobile.app._FormValueWidget.prototype.attributeMap, {
+ maxLength: "focusNode"
+ }),
+
+ buildRendering: function(){
+ var node = this.srcNodeRef;
+
+ // If an input is used as the source node, wrap it in a div
+ if(!node || node.tagName != "INPUT"){
+ node = dojo.create("input", {});
+ }
+
+ dojo.attr(node, {
+ type: "text",
+ value: dojo.attr(node, "value") || "",
+ placeholder: this.placeHolder || null
+ });
+
+ this.domNode = this.textbox = this.focusNode = node;
+ },
+
+ _setPlaceHolderAttr: function(v){
+ this.placeHolder = v;
+ if(this.textbox){
+ dojo.attr(this.textbox, "placeholder", v);
+ }
+ },
+
+
+ _getValueAttr: function(){
+ // summary:
+ // Hook so attr('value') works as we like.
+ // description:
+ // For `dijit.form.TextBox` this basically returns the value of the <input>.
+ //
+ // For `dijit.form.MappedTextBox` subclasses, which have both
+ // a "displayed value" and a separate "submit value",
+ // This treats the "displayed value" as the master value, computing the
+ // submit value from it via this.parse().
+ return this.parse(this.get('displayedValue'), this.constraints);
+ },
+
+ _setValueAttr: function(value, /*Boolean?*/ priorityChange, /*String?*/ formattedValue){
+ // summary:
+ // Hook so attr('value', ...) works.
+ //
+ // description:
+ // Sets the value of the widget to "value" which can be of
+ // any type as determined by the widget.
+ //
+ // value:
+ // The visual element value is also set to a corresponding,
+ // but not necessarily the same, value.
+ //
+ // formattedValue:
+ // If specified, used to set the visual element value,
+ // otherwise a computed visual value is used.
+ //
+ // priorityChange:
+ // If true, an onChange event is fired immediately instead of
+ // waiting for the next blur event.
+
+ var filteredValue;
+ if(value !== undefined){
+ // TODO: this is calling filter() on both the display value and the actual value.
+ // I added a comment to the filter() definition about this, but it should be changed.
+ filteredValue = this.filter(value);
+ if(typeof formattedValue != "string"){
+ if(filteredValue !== null
+ && ((typeof filteredValue != "number") || !isNaN(filteredValue))){
+ formattedValue = this.filter(this.format(filteredValue, this.constraints));
+ }else{ formattedValue = ''; }
+ }
+ }
+ if(formattedValue != null && formattedValue != undefined
+ && ((typeof formattedValue) != "number" || !isNaN(formattedValue))
+ && this.textbox.value != formattedValue){
+ this.textbox.value = formattedValue;
+ }
+
+ this.inherited(arguments, [filteredValue, priorityChange]);
+ },
+
+ // displayedValue: String
+ // For subclasses like ComboBox where the displayed value
+ // (ex: Kentucky) and the serialized value (ex: KY) are different,
+ // this represents the displayed value.
+ //
+ // Setting 'displayedValue' through attr('displayedValue', ...)
+ // updates 'value', and vice-versa. Otherwise 'value' is updated
+ // from 'displayedValue' periodically, like onBlur etc.
+ //
+ // TODO: move declaration to MappedTextBox?
+ // Problem is that ComboBox references displayedValue,
+ // for benefit of FilteringSelect.
+ displayedValue: "",
+
+ _getDisplayedValueAttr: function(){
+ // summary:
+ // Hook so attr('displayedValue') works.
+ // description:
+ // Returns the displayed value (what the user sees on the screen),
+ // after filtering (ie, trimming spaces etc.).
+ //
+ // For some subclasses of TextBox (like ComboBox), the displayed value
+ // is different from the serialized value that's actually
+ // sent to the server (see dijit.form.ValidationTextBox.serialize)
+
+ return this.filter(this.textbox.value);
+ },
+
+ _setDisplayedValueAttr: function(/*String*/value){
+ // summary:
+ // Hook so attr('displayedValue', ...) works.
+ // description:
+ // Sets the value of the visual element to the string "value".
+ // The widget value is also set to a corresponding,
+ // but not necessarily the same, value.
+
+ if(value === null || value === undefined){ value = '' }
+ else if(typeof value != "string"){ value = String(value) }
+ this.textbox.value = value;
+ this._setValueAttr(this.get('value'), undefined, value);
+ },
+
+ format: function(/* String */ value, /* Object */ constraints){
+ // summary:
+ // Replacable function to convert a value to a properly formatted string.
+ // tags:
+ // protected extension
+ return ((value == null || value == undefined) ? "" : (value.toString ? value.toString() : value));
+ },
+
+ parse: function(/* String */ value, /* Object */ constraints){
+ // summary:
+ // Replacable function to convert a formatted string to a value
+ // tags:
+ // protected extension
+
+ return value; // String
+ },
+
+ _refreshState: function(){
+ // summary:
+ // After the user types some characters, etc., this method is
+ // called to check the field for validity etc. The base method
+ // in `dijit.form.TextBox` does nothing, but subclasses override.
+ // tags:
+ // protected
+ },
+
+ _onInput: function(e){
+ if(e && e.type && /key/i.test(e.type) && e.keyCode){
+ switch(e.keyCode){
+ case dojo.keys.SHIFT:
+ case dojo.keys.ALT:
+ case dojo.keys.CTRL:
+ case dojo.keys.TAB:
+ return;
+ }
+ }
+ if(this.intermediateChanges){
+ var _this = this;
+ // the setTimeout allows the key to post to the widget input box
+ setTimeout(function(){ _this._handleOnChange(_this.get('value'), false); }, 0);
+ }
+ this._refreshState();
+ },
+
+ postCreate: function(){
+ // setting the value here is needed since value="" in the template causes "undefined"
+ // and setting in the DOM (instead of the JS object) helps with form reset actions
+
+ this.textbox.setAttribute("value", this.textbox.value); // DOM and JS values shuld be the same
+ this.inherited(arguments);
+ if(dojo.isMoz || dojo.isOpera){
+ this.connect(this.textbox, "oninput", this._onInput);
+ }else{
+ this.connect(this.textbox, "onkeydown", this._onInput);
+ this.connect(this.textbox, "onkeyup", this._onInput);
+ this.connect(this.textbox, "onpaste", this._onInput);
+ this.connect(this.textbox, "oncut", this._onInput);
+ }
+ },
+
+ _blankValue: '', // if the textbox is blank, what value should be reported
+ filter: function(val){
+ // summary:
+ // Auto-corrections (such as trimming) that are applied to textbox
+ // value on blur or form submit.
+ // description:
+ // For MappedTextBox subclasses, this is called twice
+ // - once with the display value
+ // - once the value as set/returned by attr('value', ...)
+ // and attr('value'), ex: a Number for NumberTextBox.
+ //
+ // In the latter case it does corrections like converting null to NaN. In
+ // the former case the NumberTextBox.filter() method calls this.inherited()
+ // to execute standard trimming code in TextBox.filter().
+ //
+ // TODO: break this into two methods in 2.0
+ //
+ // tags:
+ // protected extension
+ if(val === null){ return this._blankValue; }
+ if(typeof val != "string"){ return val; }
+ if(this.trim){
+ val = dojo.trim(val);
+ }
+ if(this.uppercase){
+ val = val.toUpperCase();
+ }
+ if(this.lowercase){
+ val = val.toLowerCase();
+ }
+ if(this.propercase){
+ val = val.replace(/[^\s]+/g, function(word){
+ return word.substring(0,1).toUpperCase() + word.substring(1);
+ });
+ }
+ return val;
+ },
+
+ _setBlurValue: function(){
+ this._setValueAttr(this.get('value'), true);
+ },
+
+ _onBlur: function(e){
+ if(this.disabled){ return; }
+ this._setBlurValue();
+ this.inherited(arguments);
+
+ if(this._selectOnClickHandle){
+ this.disconnect(this._selectOnClickHandle);
+ }
+ if(this.selectOnClick && dojo.isMoz){
+ this.textbox.selectionStart = this.textbox.selectionEnd = undefined; // clear selection so that the next mouse click doesn't reselect
+ }
+
+ },
+
+ _onFocus: function(/*String*/ by){
+ if(this.disabled || this.readOnly){ return; }
+
+ // Select all text on focus via click if nothing already selected.
+ // Since mouse-up will clear the selection need to defer selection until after mouse-up.
+ // Don't do anything on focus by tabbing into the widget since there's no associated mouse-up event.
+ if(this.selectOnClick && by == "mouse"){
+ this._selectOnClickHandle = this.connect(this.domNode, "onmouseup", function(){
+ // Only select all text on first click; otherwise users would have no way to clear
+ // the selection.
+ this.disconnect(this._selectOnClickHandle);
+
+ // Check if the user selected some text manually (mouse-down, mouse-move, mouse-up)
+ // and if not, then select all the text
+ var textIsNotSelected;
+ textIsNotSelected = this.textbox.selectionStart == this.textbox.selectionEnd;
+ if(textIsNotSelected){
+ this.selectInputText(this.textbox);
+ }
+ });
+ }
+
+ this._refreshState();
+ this.inherited(arguments);
+ },
+
+ reset: function(){
+ // Overrides dijit._FormWidget.reset().
+ // Additionally resets the displayed textbox value to ''
+ this.textbox.value = '';
+ this.inherited(arguments);
+ }
+ }
+);
+
+}
+
+if(!dojo._hasResource["dojo.fx.easing"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.fx.easing"] = true;
+dojo.provide("dojo.fx.easing");
+
+
+dojo.getObject("fx.easing", true, dojo);
+
+dojo.fx.easing = {
+ // summary:
+ // Collection of easing functions to use beyond the default
+ // `dojo._defaultEasing` function.
+ //
+ // description:
+ //
+ // Easing functions are used to manipulate the iteration through
+ // an `dojo.Animation`s _Line. _Line being the properties of an Animation,
+ // and the easing function progresses through that Line determing
+ // how quickly (or slowly) it should go. Or more accurately: modify
+ // the value of the _Line based on the percentage of animation completed.
+ //
+ // 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.
+ //
+ // One does not call the easing function directly, it must be passed to
+ // the `easing` property of an animation.
+ //
+ // example:
+ // |
+ // | var anim = dojo.fadeOut({
+ // | node: 'node',
+ // | duration: 2000,
+ // | // note there is no ()
+ // | easing: dojo.fx.easing.quadIn
+ // | }).play();
+ //
+
+ linear: function(/* Decimal? */n){
+ // summary: A linear easing function
+ return n;
+ },
+
+ quadIn: function(/* Decimal? */n){
+ return Math.pow(n, 2);
+ },
+
+ quadOut: function(/* Decimal? */n){
+ return n * (n - 2) * -1;
+ },
+
+ quadInOut: function(/* Decimal? */n){
+ n = n * 2;
+ if(n < 1){ return Math.pow(n, 2) / 2; }
+ return -1 * ((--n) * (n - 2) - 1) / 2;
+ },
+
+ cubicIn: function(/* Decimal? */n){
+ return Math.pow(n, 3);
+ },
+
+ cubicOut: function(/* Decimal? */n){
+ return Math.pow(n - 1, 3) + 1;
+ },
+
+ cubicInOut: function(/* Decimal? */n){
+ n = n * 2;
+ if(n < 1){ return Math.pow(n, 3) / 2; }
+ n -= 2;
+ return (Math.pow(n, 3) + 2) / 2;
+ },
+
+ quartIn: function(/* Decimal? */n){
+ return Math.pow(n, 4);
+ },
+
+ quartOut: function(/* Decimal? */n){
+ return -1 * (Math.pow(n - 1, 4) - 1);
+ },
+
+ quartInOut: function(/* Decimal? */n){
+ n = n * 2;
+ if(n < 1){ return Math.pow(n, 4) / 2; }
+ n -= 2;
+ return -1 / 2 * (Math.pow(n, 4) - 2);
+ },
+
+ quintIn: function(/* Decimal? */n){
+ return Math.pow(n, 5);
+ },
+
+ quintOut: function(/* Decimal? */n){
+ return Math.pow(n - 1, 5) + 1;
+ },
+
+ quintInOut: function(/* Decimal? */n){
+ n = n * 2;
+ if(n < 1){ return Math.pow(n, 5) / 2; };
+ n -= 2;
+ return (Math.pow(n, 5) + 2) / 2;
+ },
+
+ sineIn: function(/* Decimal? */n){
+ return -1 * Math.cos(n * (Math.PI / 2)) + 1;
+ },
+
+ sineOut: function(/* Decimal? */n){
+ return Math.sin(n * (Math.PI / 2));
+ },
+
+ sineInOut: function(/* Decimal? */n){
+ return -1 * (Math.cos(Math.PI * n) - 1) / 2;
+ },
+
+ expoIn: function(/* Decimal? */n){
+ return (n == 0) ? 0 : Math.pow(2, 10 * (n - 1));
+ },
+
+ expoOut: function(/* Decimal? */n){
+ return (n == 1) ? 1 : (-1 * Math.pow(2, -10 * n) + 1);
+ },
+
+ expoInOut: function(/* Decimal? */n){
+ if(n == 0){ return 0; }
+ if(n == 1){ return 1; }
+ n = n * 2;
+ if(n < 1){ return Math.pow(2, 10 * (n - 1)) / 2; }
+ --n;
+ return (-1 * Math.pow(2, -10 * n) + 2) / 2;
+ },
+
+ circIn: function(/* Decimal? */n){
+ return -1 * (Math.sqrt(1 - Math.pow(n, 2)) - 1);
+ },
+
+ circOut: function(/* Decimal? */n){
+ n = n - 1;
+ return Math.sqrt(1 - Math.pow(n, 2));
+ },
+
+ circInOut: function(/* Decimal? */n){
+ n = n * 2;
+ if(n < 1){ return -1 / 2 * (Math.sqrt(1 - Math.pow(n, 2)) - 1); }
+ n -= 2;
+ return 1 / 2 * (Math.sqrt(1 - Math.pow(n, 2)) + 1);
+ },
+
+ backIn: function(/* Decimal? */n){
+ // summary:
+ // An easing function that starts away from the target,
+ // and quickly accelerates towards the end value.
+ //
+ // Use caution when the easing will cause values to become
+ // negative as some properties cannot be set to negative values.
+ var s = 1.70158;
+ return Math.pow(n, 2) * ((s + 1) * n - s);
+ },
+
+ backOut: function(/* Decimal? */n){
+ // summary:
+ // An easing function that pops past the range briefly, and slowly comes back.
+ //
+ // description:
+ // An easing function that pops past the range briefly, and slowly comes back.
+ //
+ // Use caution when the easing will cause values to become negative as some
+ // properties cannot be set to negative values.
+
+ n = n - 1;
+ var s = 1.70158;
+ return Math.pow(n, 2) * ((s + 1) * n + s) + 1;
+ },
+
+ backInOut: function(/* Decimal? */n){
+ // summary:
+ // An easing function combining the effects of `backIn` and `backOut`
+ //
+ // description:
+ // An easing function combining the effects of `backIn` and `backOut`.
+ // Use caution when the easing will cause values to become negative
+ // as some properties cannot be set to negative values.
+ var s = 1.70158 * 1.525;
+ n = n * 2;
+ if(n < 1){ return (Math.pow(n, 2) * ((s + 1) * n - s)) / 2; }
+ n-=2;
+ return (Math.pow(n, 2) * ((s + 1) * n + s) + 2) / 2;
+ },
+
+ elasticIn: function(/* Decimal? */n){
+ // summary:
+ // An easing function the elastically snaps from the start value
+ //
+ // description:
+ // An easing function the elastically snaps from the start value
+ //
+ // Use caution when the elasticity will cause values to become negative
+ // as some properties cannot be set to negative values.
+ if(n == 0 || n == 1){ return n; }
+ var p = .3;
+ var s = p / 4;
+ n = n - 1;
+ return -1 * Math.pow(2, 10 * n) * Math.sin((n - s) * (2 * Math.PI) / p);
+ },
+
+ elasticOut: function(/* Decimal? */n){
+ // summary:
+ // An easing function that elasticly snaps around the target value,
+ // near the end of the Animation
+ //
+ // description:
+ // An easing function that elasticly snaps around the target value,
+ // near the end of the Animation
+ //
+ // Use caution when the elasticity will cause values to become
+ // negative as some properties cannot be set to negative values.
+ if(n==0 || n == 1){ return n; }
+ var p = .3;
+ var s = p / 4;
+ return Math.pow(2, -10 * n) * Math.sin((n - s) * (2 * Math.PI) / p) + 1;
+ },
+
+ elasticInOut: function(/* Decimal? */n){
+ // summary:
+ // An easing function that elasticly snaps around the value, near
+ // the beginning and end of the Animation.
+ //
+ // description:
+ // An easing function that elasticly snaps around the value, near
+ // the beginning and end of the Animation.
+ //
+ // Use caution when the elasticity will cause values to become
+ // negative as some properties cannot be set to negative values.
+ if(n == 0) return 0;
+ n = n * 2;
+ if(n == 2) return 1;
+ var p = .3 * 1.5;
+ var s = p / 4;
+ if(n < 1){
+ n -= 1;
+ return -.5 * (Math.pow(2, 10 * n) * Math.sin((n - s) * (2 * Math.PI) / p));
+ }
+ n -= 1;
+ return .5 * (Math.pow(2, -10 * n) * Math.sin((n - s) * (2 * Math.PI) / p)) + 1;
+ },
+
+ bounceIn: function(/* Decimal? */n){
+ // summary:
+ // An easing function that 'bounces' near the beginning of an Animation
+ return (1 - dojo.fx.easing.bounceOut(1 - n)); // Decimal
+ },
+
+ bounceOut: function(/* Decimal? */n){
+ // summary:
+ // An easing function that 'bounces' near the end of an Animation
+ var s = 7.5625;
+ var p = 2.75;
+ var l;
+ if(n < (1 / p)){
+ l = s * Math.pow(n, 2);
+ }else if(n < (2 / p)){
+ n -= (1.5 / p);
+ l = s * Math.pow(n, 2) + .75;
+ }else if(n < (2.5 / p)){
+ n -= (2.25 / p);
+ l = s * Math.pow(n, 2) + .9375;
+ }else{
+ n -= (2.625 / p);
+ l = s * Math.pow(n, 2) + .984375;
+ }
+ return l;
+ },
+
+ bounceInOut: function(/* Decimal? */n){
+ // summary:
+ // An easing function that 'bounces' at the beginning and end of the Animation
+ if(n < 0.5){ return dojo.fx.easing.bounceIn(n * 2) / 2; }
+ return (dojo.fx.easing.bounceOut(n * 2 - 1) / 2) + 0.5; // Decimal
+ }
+};
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app.ImageView"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.ImageView"] = true;
+dojo.provide("dojox.mobile.app.ImageView");
+dojo.experimental("dojox.mobile.app.ImageView");
+
+
+
+
+dojo.declare("dojox.mobile.app.ImageView", dojox.mobile.app._Widget, {
+
+ // zoom: Number
+ // The current level of zoom. This should not be set manually.
+ zoom: 1,
+
+ // zoomCenterX: Number
+ // The X coordinate in the image where the zoom is focused
+ zoomCenterX: 0,
+
+ // zoomCenterY: Number
+ // The Y coordinate in the image where the zoom is focused
+ zoomCenterY: 0,
+
+ // maxZoom: Number
+ // The highest degree to which an image can be zoomed. For example,
+ // a maxZoom of 5 means that the image will be 5 times larger than normal
+ maxZoom: 5,
+
+ // autoZoomLevel: Number
+ // The degree to which the image is zoomed when auto zoom is invoked.
+ // The higher the number, the more the image is zoomed in.
+ autoZoomLevel: 3,
+
+ // disableAutoZoom: Boolean
+ // Disables auto zoom
+ disableAutoZoom: false,
+
+ // disableSwipe: Boolean
+ // Disables the users ability to swipe from one image to the next.
+ disableSwipe: false,
+
+ // autoZoomEvent: String
+ // Overrides the default event listened to which invokes auto zoom
+ autoZoomEvent: null,
+
+ // _leftImg: Node
+ // The full sized image to the left
+ _leftImg: null,
+
+ // _centerImg: Node
+ // The full sized image in the center
+ _centerImg: null,
+
+ // _rightImg: Node
+ // The full sized image to the right
+ _rightImg: null,
+
+ // _leftImg: Node
+ // The small sized image to the left
+ _leftSmallImg: null,
+
+ // _centerImg: Node
+ // The small sized image in the center
+ _centerSmallImg: null,
+
+ // _rightImg: Node
+ // The small sized image to the right
+ _rightSmallImg: null,
+
+ constructor: function(){
+
+ this.panX = 0;
+ this.panY = 0;
+
+ this.handleLoad = dojo.hitch(this, this.handleLoad);
+ this._updateAnimatedZoom = dojo.hitch(this, this._updateAnimatedZoom);
+ this._updateAnimatedPan = dojo.hitch(this, this._updateAnimatedPan);
+ this._onAnimPanEnd = dojo.hitch(this, this._onAnimPanEnd);
+ },
+
+ buildRendering: function(){
+ this.inherited(arguments);
+
+ this.canvas = dojo.create("canvas", {}, this.domNode);
+
+ dojo.addClass(this.domNode, "mblImageView");
+ },
+
+ postCreate: function(){
+ this.inherited(arguments);
+
+ this.size = dojo.marginBox(this.domNode);
+
+ dojo.style(this.canvas, {
+ width: this.size.w + "px",
+ height: this.size.h + "px"
+ });
+ this.canvas.height = this.size.h;
+ this.canvas.width = this.size.w;
+
+ var _this = this;
+
+ // Listen to the mousedown/touchstart event. Record the position
+ // so we can use it to pan the image.
+ this.connect(this.domNode, "onmousedown", function(event){
+ if(_this.isAnimating()){
+ return;
+ }
+ if(_this.panX){
+ _this.handleDragEnd();
+ }
+
+ _this.downX = event.targetTouches ? event.targetTouches[0].clientX : event.clientX;
+ _this.downY = event.targetTouches ? event.targetTouches[0].clientY : event.clientY;
+ });
+
+ // record the movement of the mouse.
+ this.connect(this.domNode, "onmousemove", function(event){
+ if(_this.isAnimating()){
+ return;
+ }
+ if((!_this.downX && _this.downX !== 0) || (!_this.downY && _this.downY !== 0)){
+ // If the touch didn't begin on this widget, ignore the movement
+ return;
+ }
+
+ if((!_this.disableSwipe && _this.zoom == 1)
+ || (!_this.disableAutoZoom && _this.zoom != 1)){
+ var x = event.targetTouches ?
+ event.targetTouches[0].clientX : event.pageX;
+ var y = event.targetTouches ?
+ event.targetTouches[0].clientY : event.pageY;
+
+ _this.panX = x - _this.downX;
+ _this.panY = y - _this.downY;
+
+ if(_this.zoom == 1){
+ // If not zoomed in, then try to move to the next or prev image
+ // but only if the mouse has moved more than 10 pixels
+ // in the X direction
+ if(Math.abs(_this.panX) > 10){
+ _this.render();
+ }
+ }else{
+ // If zoomed in, pan the image if the mouse has moved more
+ // than 10 pixels in either direction.
+ if(Math.abs(_this.panX) > 10 || Math.abs(_this.panY) > 10){
+ _this.render();
+ }
+ }
+ }
+ });
+
+ this.connect(this.domNode, "onmouseout", function(event){
+ if(!_this.isAnimating() && _this.panX){
+ _this.handleDragEnd();
+ }
+ });
+
+ this.connect(this.domNode, "onmouseover", function(event){
+ _this.downX = _this.downY = null;
+ });
+
+ // Set up AutoZoom, which zooms in a fixed amount when the user taps
+ // a part of the canvas
+ this.connect(this.domNode, "onclick", function(event){
+ if(_this.isAnimating()){
+ return;
+ }
+ if(_this.downX == null || _this.downY == null){
+ return;
+ }
+
+ var x = (event.targetTouches ?
+ event.targetTouches[0].clientX : event.pageX);
+ var y = (event.targetTouches ?
+ event.targetTouches[0].clientY : event.pageY);
+
+ // If the mouse/finger has moved more than 14 pixels from where it
+ // started, do not treat it as a click. It is a drag.
+ if(Math.abs(_this.panX) > 14 || Math.abs(_this.panY) > 14){
+ _this.downX = _this.downY = null;
+ _this.handleDragEnd();
+ return;
+ }
+ _this.downX = _this.downY = null;
+
+ if(!_this.disableAutoZoom){
+
+ if(!_this._centerImg || !_this._centerImg._loaded){
+ // Do nothing until the image is loaded
+ return;
+ }
+ if(_this.zoom != 1){
+ _this.set("animatedZoom", 1);
+ return;
+ }
+
+ var pos = dojo._abs(_this.domNode);
+
+ // Translate the clicked point to a point on the source image
+ var xRatio = _this.size.w / _this._centerImg.width;
+ var yRatio = _this.size.h / _this._centerImg.height;
+
+ // Do an animated zoom to the point which was clicked.
+ _this.zoomTo(
+ ((x - pos.x) / xRatio) - _this.panX,
+ ((y - pos.y) / yRatio) - _this.panY,
+ _this.autoZoomLevel);
+ }
+ });
+
+ // Listen for Flick events
+ dojo.connect(this.domNode, "flick", this, "handleFlick");
+ },
+
+ isAnimating: function(){
+ // summary:
+ // Returns true if an animation is in progress, false otherwise.
+ return this._anim && this._anim.status() == "playing";
+ },
+
+ handleDragEnd: function(){
+ // summary:
+ // Handles the end of a dragging event. If not zoomed in, it
+ // determines if the next or previous image should be transitioned
+ // to.
+ this.downX = this.downY = null;
+ console.log("handleDragEnd");
+
+ if(this.zoom == 1){
+ if(!this.panX){
+ return;
+ }
+
+ var leftLoaded = (this._leftImg && this._leftImg._loaded)
+ || (this._leftSmallImg && this._leftSmallImg._loaded);
+ var rightLoaded = (this._rightImg && this._rightImg._loaded)
+ || (this._rightSmallImg && this._rightSmallImg._loaded);
+
+ // Check if the drag has moved the image more than half its length.
+ // If so, move to either the previous or next image.
+ var doMove =
+ !(Math.abs(this.panX) < this._centerImg._baseWidth / 2) &&
+ (
+ (this.panX > 0 && leftLoaded ? 1 : 0) ||
+ (this.panX < 0 && rightLoaded ? 1 : 0)
+ );
+
+
+ if(!doMove){
+ // If not moving to another image, animate the sliding of the
+ // image back into place.
+ this._animPanTo(0, dojo.fx.easing.expoOut, 700);
+ }else{
+ // Move to another image.
+ this.moveTo(this.panX);
+ }
+ }else{
+ if(!this.panX && !this.panY){
+ return;
+ }
+ // Recenter the zoomed image based on where it was panned to
+ // previously
+ this.zoomCenterX -= (this.panX / this.zoom);
+ this.zoomCenterY -= (this.panY / this.zoom);
+
+ this.panX = this.panY = 0;
+ }
+
+ },
+
+ handleFlick: function(event){
+ // summary:
+ // Handle a flick event.
+ if(this.zoom == 1 && event.duration < 500){
+ // Only handle quick flicks here, less than 0.5 seconds
+
+ // If not zoomed in, then check if we should move to the next photo
+ // or not
+ if(event.direction == "ltr"){
+ this.moveTo(1);
+ }else if(event.direction == "rtl"){
+ this.moveTo(-1);
+ }
+ // If an up or down flick occurs, it means nothing so ignore it
+ this.downX = this.downY = null;
+ }
+ },
+
+ moveTo: function(direction){
+ direction = direction > 0 ? 1 : -1;
+ var toImg;
+
+ if(direction < 1){
+ if(this._rightImg && this._rightImg._loaded){
+ toImg = this._rightImg;
+ }else if(this._rightSmallImg && this._rightSmallImg._loaded){
+ toImg = this._rightSmallImg;
+ }
+ }else{
+ if(this._leftImg && this._leftImg._loaded){
+ toImg = this._leftImg;
+ }else if(this._leftSmallImg && this._leftSmallImg._loaded){
+ toImg = this._leftSmallImg;
+ }
+ }
+
+ this._moveDir = direction;
+ var _this = this;
+
+ if(toImg && toImg._loaded){
+ // If the image is loaded, make a linear animation to show it
+ this._animPanTo(this.size.w * direction, null, 500, function(){
+ _this.panX = 0;
+ _this.panY = 0;
+
+ if(direction < 0){
+ // Moving to show the right image
+ _this._switchImage("left", "right");
+ }else{
+ // Moving to show the left image
+ _this._switchImage("right", "left");
+ }
+
+ _this.render();
+ _this.onChange(direction * -1);
+ });
+
+ }else{
+ // If the next image is not loaded, make an animation to
+ // move the center image to half the width of the widget and back
+ // again
+
+ console.log("moveTo image not loaded!", toImg);
+
+ this._animPanTo(0, dojo.fx.easing.expoOut, 700);
+ }
+ },
+
+ _switchImage: function(toImg, fromImg){
+ var toSmallImgName = "_" + toImg + "SmallImg";
+ var toImgName = "_" + toImg + "Img";
+
+ var fromSmallImgName = "_" + fromImg + "SmallImg";
+ var fromImgName = "_" + fromImg + "Img";
+
+ this[toImgName] = this._centerImg;
+ this[toSmallImgName] = this._centerSmallImg;
+
+ this[toImgName]._type = toImg;
+
+ if(this[toSmallImgName]){
+ this[toSmallImgName]._type = toImg;
+ }
+
+ this._centerImg = this[fromImgName];
+ this._centerSmallImg = this[fromSmallImgName];
+ this._centerImg._type = "center";
+
+ if(this._centerSmallImg){
+ this._centerSmallImg._type = "center";
+ }
+ this[fromImgName] = this[fromSmallImgName] = null;
+ },
+
+ _animPanTo: function(to, easing, duration, callback){
+ this._animCallback = callback;
+ this._anim = new dojo.Animation({
+ curve: [this.panX, to],
+ onAnimate: this._updateAnimatedPan,
+ duration: duration || 500,
+ easing: easing,
+ onEnd: this._onAnimPanEnd
+ });
+
+ this._anim.play();
+ return this._anim;
+ },
+
+ onChange: function(direction){
+ // summary:
+ // Stub function that can be listened to in order to provide
+ // new images when the displayed image changes
+ },
+
+ _updateAnimatedPan: function(amount){
+ this.panX = amount;
+ this.render();
+ },
+
+ _onAnimPanEnd: function(){
+ this.panX = this.panY = 0;
+
+ if(this._animCallback){
+ this._animCallback();
+ }
+ },
+
+ zoomTo: function(centerX, centerY, zoom){
+ this.set("zoomCenterX", centerX);
+ this.set("zoomCenterY", centerY);
+
+ this.set("animatedZoom", zoom);
+ },
+
+ render: function(){
+ var cxt = this.canvas.getContext('2d');
+
+ cxt.clearRect(0, 0, this.canvas.width, this.canvas.height);
+
+ // Render the center image
+ this._renderImg(
+ this._centerSmallImg,
+ this._centerImg,
+ this.zoom == 1 ? (this.panX < 0 ? 1 : this.panX > 0 ? -1 : 0) : 0);
+
+ if(this.zoom == 1 && this.panX != 0){
+ if(this.panX > 0){
+ // Render the left image, showing the right side of it
+ this._renderImg(this._leftSmallImg, this._leftImg, 1);
+ }else{
+ // Render the right image, showing the left side of it
+ this._renderImg(this._rightSmallImg, this._rightImg, -1);
+ }
+ }
+ },
+
+ _renderImg: function(smallImg, largeImg, panDir){
+ // summary:
+ // Renders a single image
+
+
+ // If zoomed, we just display the center img
+ var img = (largeImg && largeImg._loaded) ? largeImg : smallImg;
+
+ if(!img || !img._loaded){
+ // If neither the large or small image is loaded, display nothing
+ return;
+ }
+ var cxt = this.canvas.getContext('2d');
+
+ var baseWidth = img._baseWidth;
+ var baseHeight = img._baseHeight;
+
+ // Calculate the size the image would be if there were no bounds
+ var desiredWidth = baseWidth * this.zoom;
+ var desiredHeight = baseHeight * this.zoom;
+
+ // Calculate the actual size of the viewable image
+ var destWidth = Math.min(this.size.w, desiredWidth);
+ var destHeight = Math.min(this.size.h, desiredHeight);
+
+
+ // Calculate the size of the window on the original image to use
+ var sourceWidth = this.dispWidth = img.width * (destWidth / desiredWidth);
+ var sourceHeight = this.dispHeight = img.height * (destHeight / desiredHeight);
+
+ var zoomCenterX = this.zoomCenterX - (this.panX / this.zoom);
+ var zoomCenterY = this.zoomCenterY - (this.panY / this.zoom);
+
+ // Calculate where the center of the view should be
+ var centerX = Math.floor(Math.max(sourceWidth / 2,
+ Math.min(img.width - sourceWidth / 2, zoomCenterX)));
+ var centerY = Math.floor(Math.max(sourceHeight / 2,
+ Math.min(img.height - sourceHeight / 2, zoomCenterY)));
+
+
+ var sourceX = Math.max(0,
+ Math.round((img.width - sourceWidth)/2 + (centerX - img._centerX)) );
+ var sourceY = Math.max(0,
+ Math.round((img.height - sourceHeight) / 2 + (centerY - img._centerY))
+ );
+
+ var destX = Math.round(Math.max(0, this.canvas.width - destWidth)/2);
+ var destY = Math.round(Math.max(0, this.canvas.height - destHeight)/2);
+
+ var oldDestWidth = destWidth;
+ var oldSourceWidth = sourceWidth;
+
+ if(this.zoom == 1 && panDir && this.panX){
+
+ if(this.panX < 0){
+ if(panDir > 0){
+ // If the touch is moving left, and the right side of the
+ // image should be shown, then reduce the destination width
+ // by the absolute value of panX
+ destWidth -= Math.abs(this.panX);
+ destX = 0;
+ }else if(panDir < 0){
+ // If the touch is moving left, and the left side of the
+ // image should be shown, then set the displayed width
+ // to the absolute value of panX, less some pixels for
+ // a padding between images
+ destWidth = Math.max(1, Math.abs(this.panX) - 5);
+ destX = this.size.w - destWidth;
+ }
+ }else{
+ if(panDir > 0){
+ // If the touch is moving right, and the right side of the
+ // image should be shown, then set the destination width
+ // to the absolute value of the pan, less some pixels for
+ // padding
+ destWidth = Math.max(1, Math.abs(this.panX) - 5);
+ destX = 0;
+ }else if(panDir < 0){
+ // If the touch is moving right, and the left side of the
+ // image should be shown, then reduce the destination width
+ // by the widget width minus the absolute value of panX
+ destWidth -= Math.abs(this.panX);
+ destX = this.size.w - destWidth;
+ }
+ }
+
+ sourceWidth = Math.max(1,
+ Math.floor(sourceWidth * (destWidth / oldDestWidth)));
+
+ if(panDir > 0){
+ // If the right side of the image should be displayed, move
+ // the sourceX to be the width of the image minus the difference
+ // between the original sourceWidth and the new sourceWidth
+ sourceX = (sourceX + oldSourceWidth) - (sourceWidth);
+ }
+ sourceX = Math.floor(sourceX);
+ }
+
+ try{
+
+ // See https://developer.mozilla.org/en/Canvas_tutorial/Using_images
+ cxt.drawImage(
+ img,
+ Math.max(0, sourceX),
+ sourceY,
+ Math.min(oldSourceWidth, sourceWidth),
+ sourceHeight,
+ destX, // Xpos
+ destY, // Ypos
+ Math.min(oldDestWidth, destWidth),
+ destHeight
+ );
+ }catch(e){
+ console.log("Caught Error",e,
+
+ "type=", img._type,
+ "oldDestWidth = ", oldDestWidth,
+ "destWidth", destWidth,
+ "destX", destX
+ , "oldSourceWidth=",oldSourceWidth,
+ "sourceWidth=", sourceWidth,
+ "sourceX = " + sourceX
+ );
+ }
+ },
+
+ _setZoomAttr: function(amount){
+ this.zoom = Math.min(this.maxZoom, Math.max(1, amount));
+
+ if(this.zoom == 1
+ && this._centerImg
+ && this._centerImg._loaded){
+
+ if(!this.isAnimating()){
+ this.zoomCenterX = this._centerImg.width / 2;
+ this.zoomCenterY = this._centerImg.height / 2;
+ }
+ this.panX = this.panY = 0;
+ }
+
+ this.render();
+ },
+
+ _setZoomCenterXAttr: function(value){
+ if(value != this.zoomCenterX){
+ if(this._centerImg && this._centerImg._loaded){
+ value = Math.min(this._centerImg.width, value);
+ }
+ this.zoomCenterX = Math.max(0, Math.round(value));
+ }
+ },
+
+ _setZoomCenterYAttr: function(value){
+ if(value != this.zoomCenterY){
+ if(this._centerImg && this._centerImg._loaded){
+ value = Math.min(this._centerImg.height, value);
+ }
+ this.zoomCenterY = Math.max(0, Math.round(value));
+ }
+ },
+
+ _setZoomCenterAttr: function(value){
+ if(value.x != this.zoomCenterX || value.y != this.zoomCenterY){
+ this.set("zoomCenterX", value.x);
+ this.set("zoomCenterY", value.y);
+ this.render();
+ }
+ },
+
+ _setAnimatedZoomAttr: function(amount){
+ if(this._anim && this._anim.status() == "playing"){
+ return;
+ }
+
+ this._anim = new dojo.Animation({
+ curve: [this.zoom, amount],
+ onAnimate: this._updateAnimatedZoom,
+ onEnd: this._onAnimEnd
+ });
+
+ this._anim.play();
+ },
+
+ _updateAnimatedZoom: function(amount){
+ this._setZoomAttr(amount);
+ },
+
+ _setCenterUrlAttr: function(urlOrObj){
+ this._setImage("center", urlOrObj);
+ },
+ _setLeftUrlAttr: function(urlOrObj){
+ this._setImage("left", urlOrObj);
+ },
+ _setRightUrlAttr: function(urlOrObj){
+ this._setImage("right", urlOrObj);
+ },
+
+ _setImage: function(name, urlOrObj){
+ var smallUrl = null;
+
+ var largeUrl = null;
+
+ if(dojo.isString(urlOrObj)){
+ // If the argument is a string, then just load the large url
+ largeUrl = urlOrObj;
+ }else{
+ largeUrl = urlOrObj.large;
+ smallUrl = urlOrObj.small;
+ }
+
+ if(this["_" + name + "Img"] && this["_" + name + "Img"]._src == largeUrl){
+ // Identical URL, ignore it
+ return;
+ }
+
+ // Just do the large image for now
+ var largeImg = this["_" + name + "Img"] = new Image();
+ largeImg._type = name;
+ largeImg._loaded = false;
+ largeImg._src = largeUrl;
+ largeImg._conn = dojo.connect(largeImg, "onload", this.handleLoad);
+
+ if(smallUrl){
+ // If a url to a small version of the image has been provided,
+ // load that image first.
+ var smallImg = this["_" + name + "SmallImg"] = new Image();
+ smallImg._type = name;
+ smallImg._loaded = false;
+ smallImg._conn = dojo.connect(smallImg, "onload", this.handleLoad);
+ smallImg._isSmall = true;
+ smallImg._src = smallUrl;
+ smallImg.src = smallUrl;
+ }
+
+ // It's important that the large url's src is set after the small image
+ // to ensure it's loaded second.
+ largeImg.src = largeUrl;
+ },
+
+ handleLoad: function(evt){
+ // summary:
+ // Handles the loading of an image, both the large and small
+ // versions. A render is triggered as a result of each image load.
+
+ var img = evt.target;
+ img._loaded = true;
+
+ dojo.disconnect(img._conn);
+
+ var type = img._type;
+
+ switch(type){
+ case "center":
+ this.zoomCenterX = img.width / 2;
+ this.zoomCenterY = img.height / 2;
+ break;
+ }
+
+ var height = img.height;
+ var width = img.width;
+
+ if(width / this.size.w < height / this.size.h){
+ // Fit the height to the height of the canvas
+ img._baseHeight = this.canvas.height;
+ img._baseWidth = width / (height / this.size.h);
+ }else{
+ // Fix the width to the width of the canvas
+ img._baseWidth = this.canvas.width;
+ img._baseHeight = height / (width / this.size.w);
+ }
+ img._centerX = width / 2;
+ img._centerY = height / 2;
+
+ this.render();
+
+ this.onLoad(img._type, img._src, img._isSmall);
+ },
+
+ onLoad: function(type, url, isSmall){
+ // summary:
+ // Dummy function that is called whenever an image loads.
+ // type: String
+ // The position of the image that has loaded, either
+ // "center", "left" or "right"
+ // url: String
+ // The src of the image
+ // isSmall: Boolean
+ // True if it is a small version of the image that has loaded,
+ // false otherwise.
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app.ImageThumbView"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.ImageThumbView"] = true;
+dojo.provide("dojox.mobile.app.ImageThumbView");
+dojo.experimental("dojox.mobile.app.ImageThumbView");
+
+
+
+
+dojo.declare("dojox.mobile.app.ImageThumbView", dijit._WidgetBase, {
+ // summary:
+ // An image thumbnail gallery
+
+ // items: Array
+ // The data items from which the image urls are retrieved.
+ // If an item is a string, it is expected to be a URL. Otherwise
+ // by default it is expected to have a 'url' member. This can
+ // be configured using the 'urlParam' attribute on this widget.
+ items: [],
+
+ // urlParam: String
+ // The paramter name used to retrieve an image url from a JSON object
+ urlParam: "url",
+
+ labelParam: null,
+
+ itemTemplate: '<div class="mblThumbInner">' +
+ '<div class="mblThumbOverlay"></div>' +
+ '<div class="mblThumbMask">' +
+ '<div class="mblThumbSrc" style="background-image:url(${url})"></div>' +
+ '</div>' +
+ '</div>',
+
+ minPadding: 4,
+
+ maxPerRow: 3,
+
+ maxRows: -1,
+
+ baseClass: "mblImageThumbView",
+
+ thumbSize: "medium",
+
+ animationEnabled: true,
+
+ selectedIndex: -1,
+
+ cache: null,
+
+ cacheMustMatch: false,
+
+ clickEvent: "onclick",
+
+ cacheBust: false,
+
+ disableHide: false,
+
+ constructor: function(params, node){
+ },
+
+ postCreate: function(){
+
+ this.inherited(arguments);
+ var _this = this;
+
+ var hoverCls = "mblThumbHover";
+
+ this.addThumb = dojo.hitch(this, this.addThumb);
+ this.handleImgLoad = dojo.hitch(this, this.handleImgLoad);
+ this.hideCached = dojo.hitch(this, this.hideCached);
+
+ this._onLoadImages = {};
+
+ this.cache = [];
+ this.visibleImages = [];
+
+ this._cacheCounter = 0;
+
+ this.connect(this.domNode, this.clickEvent, function(event){
+ var itemNode = _this._getItemNodeFromEvent(event);
+
+ if(itemNode && !itemNode._cached){
+ _this.onSelect(itemNode._item, itemNode._index, _this.items);
+ dojo.query(".selected", this.domNode).removeClass("selected");
+ dojo.addClass(itemNode, "selected");
+ }
+ });
+
+ dojo.addClass(this.domNode, this.thumbSize);
+
+ this.resize();
+ this.render();
+ },
+
+ onSelect: function(item, index, items){
+ // summary:
+ // Dummy function that is triggered when an image is selected.
+ },
+
+ _setAnimationEnabledAttr: function(value){
+ this.animationEnabled = value;
+ dojo[value ? "addClass" : "removeClass"](this.domNode, "animated");
+ },
+
+ _setItemsAttr: function(items){
+ this.items = items || [];
+
+ var urls = {};
+ var i;
+ for(i = 0; i < this.items.length; i++){
+ urls[this.items[i][this.urlParam]] = 1;
+ }
+
+ var clearedUrls = [];
+ for(var url in this._onLoadImages){
+ if(!urls[url] && this._onLoadImages[url]._conn){
+ dojo.disconnect(this._onLoadImages[url]._conn);
+ this._onLoadImages[url].src = null;
+ clearedUrls.push(url);
+ }
+ }
+
+ for(i = 0; i < clearedUrls.length; i++){
+ delete this._onLoadImages[url];
+ }
+
+ this.render();
+ },
+
+ _getItemNode: function(node){
+ while(node && !dojo.hasClass(node, "mblThumb") && node != this.domNode){
+ node = node.parentNode;
+ }
+
+ return (node == this.domNode) ? null : node;
+ },
+
+ _getItemNodeFromEvent: function(event){
+ if(event.touches && event.touches.length > 0){
+ event = event.touches[0];
+ }
+ return this._getItemNode(event.target);
+ },
+
+ resize: function(){
+ this._thumbSize = null;
+
+ this._size = dojo.contentBox(this.domNode);
+
+ this.disableHide = true;
+ this.render();
+ this.disableHide = false;
+ },
+
+ hideCached: function(){
+ // summary:
+ // Hides all cached nodes, so that they're no invisible and overlaying
+ // other screen elements.
+ for(var i = 0; i < this.cache.length; i++){
+ if (this.cache[i]) {
+ dojo.style(this.cache[i], "display", "none");
+ }
+ }
+ },
+
+ render: function(){
+ var i;
+ var url;
+ var item;
+
+ var thumb;
+ while(this.visibleImages && this.visibleImages.length > 0){
+ thumb = this.visibleImages.pop();
+ this.cache.push(thumb);
+
+ if (!this.disableHide) {
+ dojo.addClass(thumb, "hidden");
+ }
+ thumb._cached = true;
+ }
+
+ if(this.cache && this.cache.length > 0){
+ setTimeout(this.hideCached, 1000);
+ }
+
+ if(!this.items || this.items.length == 0){
+ return;
+ }
+
+ for(i = 0; i < this.items.length; i++){
+ item = this.items[i];
+ url = (dojo.isString(item) ? item : item[this.urlParam]);
+
+ this.addThumb(item, url, i);
+
+ if(this.maxRows > 0 && (i + 1) / this.maxPerRow >= this.maxRows){
+ break;
+ }
+ }
+
+ if(!this._thumbSize){
+ return;
+ }
+
+ var column = 0;
+ var row = -1;
+
+ var totalThumbWidth = this._thumbSize.w + (this.padding * 2);
+ var totalThumbHeight = this._thumbSize.h + (this.padding * 2);
+
+ var nodes = this.thumbNodes =
+ dojo.query(".mblThumb", this.domNode);
+
+ var pos = 0;
+ nodes = this.visibleImages;
+ for(i = 0; i < nodes.length; i++){
+ if(nodes[i]._cached){
+ continue;
+ }
+
+ if(pos % this.maxPerRow == 0){
+ row ++;
+ }
+ column = pos % this.maxPerRow;
+
+ this.place(
+ nodes[i],
+ (column * totalThumbWidth) + this.padding, // x position
+ (row * totalThumbHeight) + this.padding // y position
+ );
+
+ if(!nodes[i]._loading){
+ dojo.removeClass(nodes[i], "hidden");
+ }
+
+ if(pos == this.selectedIndex){
+ dojo[pos == this.selectedIndex ? "addClass" : "removeClass"]
+ (nodes[i], "selected");
+ }
+ pos++;
+ }
+
+ var numRows = Math.ceil(pos / this.maxPerRow);
+
+ this._numRows = numRows;
+
+ this.setContainerHeight((numRows * (this._thumbSize.h + this.padding * 2)));
+ },
+
+ setContainerHeight: function(amount){
+ dojo.style(this.domNode, "height", amount + "px");
+ },
+
+ addThumb: function(item, url, index){
+
+ var thumbDiv;
+ var cacheHit = false;
+ if(this.cache.length > 0){
+ // Reuse a previously created node if possible
+ var found = false;
+ // Search for an image with the same url first
+ for(var i = 0; i < this.cache.length; i++){
+ if(this.cache[i]._url == url){
+ thumbDiv = this.cache.splice(i, 1)[0];
+ found = true;
+ break
+ }
+ }
+
+ // if no image with the same url is found, just take the last one
+ if(!thumbDiv && !this.cacheMustMatch){
+ thumbDiv = this.cache.pop();
+ dojo.removeClass(thumbDiv, "selected");
+ } else {
+ cacheHit = true;
+ }
+ }
+
+ if(!thumbDiv){
+
+ // Create a new thumb
+ thumbDiv = dojo.create("div", {
+ "class": "mblThumb hidden",
+ innerHTML: dojo.string.substitute(this.itemTemplate, {
+ url: url
+ }, null, this)
+ }, this.domNode);
+ }
+
+ if(this.labelParam) {
+ var labelNode = dojo.query(".mblThumbLabel", thumbDiv)[0];
+ if(!labelNode) {
+ labelNode = dojo.create("div", {
+ "class": "mblThumbLabel"
+ }, thumbDiv);
+ }
+ labelNode.innerHTML = item[this.labelParam] || "";
+ }
+
+ dojo.style(thumbDiv, "display", "");
+ if (!this.disableHide) {
+ dojo.addClass(thumbDiv, "hidden");
+ }
+
+ if (!cacheHit) {
+ var loader = dojo.create("img", {});
+ loader._thumbDiv = thumbDiv;
+ loader._conn = dojo.connect(loader, "onload", this.handleImgLoad);
+ loader._url = url;
+ thumbDiv._loading = true;
+
+ this._onLoadImages[url] = loader;
+ if (loader) {
+ loader.src = url;
+ }
+ }
+ this.visibleImages.push(thumbDiv);
+
+ thumbDiv._index = index;
+ thumbDiv._item = item;
+ thumbDiv._url = url;
+ thumbDiv._cached = false;
+
+ if(!this._thumbSize){
+ this._thumbSize = dojo.marginBox(thumbDiv);
+
+ if(this._thumbSize.h == 0){
+ this._thumbSize.h = 100;
+ this._thumbSize.w = 100;
+ }
+
+ if(this.labelParam){
+ this._thumbSize.h += 8;
+ }
+
+ this.calcPadding();
+ }
+ },
+
+ handleImgLoad: function(event){
+ var img = event.target;
+ dojo.disconnect(img._conn);
+ dojo.removeClass(img._thumbDiv, "hidden");
+ img._thumbDiv._loading = false;
+ img._conn = null;
+
+ var url = img._url;
+ if(this.cacheBust){
+ url += (url.indexOf("?") > -1 ? "&" : "?")
+ + "cacheBust=" + (new Date()).getTime() + "_" + (this._cacheCounter++);
+ }
+
+ dojo.query(".mblThumbSrc", img._thumbDiv)
+ .style("backgroundImage", "url(" + url + ")");
+
+ delete this._onLoadImages[img._url];
+ },
+
+ calcPadding: function(){
+ var width = this._size.w;
+
+ var thumbWidth = this._thumbSize.w;
+
+ var imgBounds = thumbWidth + this.minPadding;
+
+ this.maxPerRow = Math.floor(width / imgBounds);
+
+ this.padding = Math.floor((width - (thumbWidth * this.maxPerRow)) / (this.maxPerRow * 2));
+ },
+
+ place: function(node, x, y){
+ dojo.style(node, {
+ "-webkit-transform" :"translate(" + x + "px," + y + "px)"
+ });
+ },
+
+ destroy: function(){
+ // Stop the loading of any more images
+
+ var img;
+ var counter = 0;
+ for (var url in this._onLoadImages){
+ img = this._onLoadImages[url];
+ if (img) {
+ img.src = null;
+ counter++;
+ }
+ }
+
+ this.inherited(arguments);
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app._base"] = true;
+dojo.provide("dojox.mobile.app._base");
+dojo.experimental("dojox.mobile.app._base");
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+(function(){
+
+ var stageController;
+ var appInfo;
+
+ var jsDependencies = [
+ "dojox.mobile",
+ "dojox.mobile.parser"
+ ];
+
+ var loadedResources = {};
+ var loadingDependencies;
+
+ var rootNode;
+
+ var sceneResources = [];
+
+ // Load the required resources asynchronously, since not all mobile OSes
+ // support dojo.require and sync XHR
+ function loadResources(resources, callback){
+ // summary:
+ // Loads one or more JavaScript files asynchronously. When complete,
+ // the first scene is pushed onto the stack.
+ // resources:
+ // An array of module names, e.g. 'dojox.mobile.AlertDialog'
+
+ var resource;
+ var url;
+
+ do {
+ resource = resources.pop();
+ if (resource.source) {
+ url = resource.source;
+ }else if (resource.module) {
+ url = dojo.baseUrl + dojo._getModuleSymbols(resource.module).join("/") + '.js';
+ }else {
+ alert("Error: invalid JavaScript resource " + dojo.toJson(resource));
+ return;
+ }
+ }while (resources.length > 0 && loadedResources[url]);
+
+ if(resources.length < 1 && loadedResources[url]){
+ // All resources have already been loaded
+ callback();
+ return;
+ }
+
+ dojo.xhrGet({
+ url: url,
+ sync: false
+ }).addCallbacks(function(text){
+ dojo["eval"](text);
+ loadedResources[url] = true;
+ if(resources.length > 0){
+ loadResources(resources, callback);
+ }else{
+ callback();
+ }
+ },
+ function(){
+ alert("Failed to load resource " + url);
+ });
+ }
+
+ var pushFirstScene = function(){
+ // summary:
+ // Pushes the first scene onto the stack.
+
+ stageController = new dojox.mobile.app.StageController(rootNode);
+ var defaultInfo = {
+ id: "com.test.app",
+ version: "1.0.0",
+ initialScene: "main"
+ };
+
+ // If the application info has been defined, as it should be,
+ // use it.
+ if(dojo.global["appInfo"]){
+ dojo.mixin(defaultInfo, dojo.global["appInfo"]);
+ }
+ appInfo = dojox.mobile.app.info = defaultInfo;
+
+ // Set the document title from the app info title if it exists
+ if(appInfo.title){
+ var titleNode = dojo.query("head title")[0] ||
+ dojo.create("title", {},dojo.query("head")[0]);
+ document.title = appInfo.title;
+ }
+
+ stageController.pushScene(appInfo.initialScene);
+ };
+
+ var initBackButton = function(){
+ var hasNativeBack = false;
+ if(dojo.global.BackButton){
+ // Android phonegap support
+ BackButton.override();
+ dojo.connect(document, 'backKeyDown', function(e) {
+ dojo.publish("/dojox/mobile/app/goback");
+ });
+ hasNativeBack = true;
+ }else if(dojo.global.Mojo){
+ // TODO: add webOS support
+ }
+ if(hasNativeBack){
+ dojo.addClass(dojo.body(), "mblNativeBack");
+ }
+ };
+
+ dojo.mixin(dojox.mobile.app, {
+ init: function(node){
+ // summary:
+ // Initializes the mobile app. Creates the
+
+ rootNode = node || dojo.body();
+ dojox.mobile.app.STAGE_CONTROLLER_ACTIVE = true;
+
+ dojo.subscribe("/dojox/mobile/app/goback", function(){
+ stageController.popScene();
+ });
+
+ dojo.subscribe("/dojox/mobile/app/alert", function(params){
+ dojox.mobile.app.getActiveSceneController().showAlertDialog(params);
+ });
+
+ dojo.subscribe("/dojox/mobile/app/pushScene", function(sceneName, params){
+ stageController.pushScene(sceneName, params || {});
+ });
+
+ // Get the list of files to load per scene/view
+ dojo.xhrGet({
+ url: "view-resources.json",
+ load: function(data){
+ var resources = [];
+
+ if(data){
+ // Should be an array
+ sceneResources = data = dojo.fromJson(data);
+
+ // Get the list of files to load that have no scene
+ // specified, and therefore should be loaded on
+ // startup
+ for(var i = 0; i < data.length; i++){
+ if(!data[i].scene){
+ resources.push(data[i]);
+ }
+ }
+ }
+ if(resources.length > 0){
+ loadResources(resources, pushFirstScene);
+ }else{
+ pushFirstScene();
+ }
+ },
+ error: pushFirstScene
+ });
+
+ initBackButton();
+ },
+
+ getActiveSceneController: function(){
+ // summary:
+ // Gets the controller for the active scene.
+
+ return stageController.getActiveSceneController();
+ },
+
+ getStageController: function(){
+ // summary:
+ // Gets the stage controller.
+ return stageController;
+ },
+
+ loadResources: function(resources, callback){
+ loadResources(resources, callback);
+ },
+
+ loadResourcesForScene: function(sceneName, callback){
+ var resources = [];
+
+ // Get the list of files to load that have no scene
+ // specified, and therefore should be loaded on
+ // startup
+ for(var i = 0; i < sceneResources.length; i++){
+ if(sceneResources[i].scene == sceneName){
+ resources.push(sceneResources[i]);
+ }
+ }
+
+ if(resources.length > 0){
+ loadResources(resources, callback);
+ }else{
+ callback();
+ }
+ },
+
+ resolveTemplate: function(sceneName){
+ // summary:
+ // Given the name of a scene, returns the path to it's template
+ // file. For example, for a scene named 'main', the file
+ // returned is 'app/views/main/main-scene.html'
+ // This function can be overridden if it is desired to have
+ // a different name to file mapping.
+ return "app/views/" + sceneName + "/" + sceneName + "-scene.html";
+ },
+
+ resolveAssistant: function(sceneName){
+ // summary:
+ // Given the name of a scene, returns the path to it's assistant
+ // file. For example, for a scene named 'main', the file
+ // returned is 'app/assistants/main-assistant.js'
+ // This function can be overridden if it is desired to have
+ // a different name to file mapping.
+ return "app/assistants/" + sceneName + "-assistant.js";
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.mobileApp"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobileApp"] = true;
+dojo.provide("dojox.mobileApp");
+
+
+
+}
+
diff --git a/js/dojo-1.6/dojox/mobile/app.xd.js b/js/dojo-1.6/dojox/mobile/app.xd.js
new file mode 100644
index 0000000..9f26ca3
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app.xd.js
@@ -0,0 +1,14 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+/*
+ This is an optimized version of Dojo, built for deployment and not for
+ development. To get sources and documentation, please visit:
+
+ http://dojotoolkit.org
+*/
+
+dojo._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojo.window"],["provide","dijit._base.manager"],["provide","dijit._base.focus"],["provide","dojo.AdapterRegistry"],["provide","dijit._base.place"],["provide","dijit._base.window"],["provide","dijit._base.popup"],["provide","dijit._base.scroll"],["provide","dojo.uacss"],["provide","dijit._base.sniff"],["provide","dijit._base.typematic"],["provide","dijit._base.wai"],["provide","dijit._base"],["provide","dojo.Stateful"],["provide","dijit._WidgetBase"],["provide","dojox.mobile._base"],["provide","dojox.mobile"],["provide","dojox.mobile.parser"],["provide","dojo.parser"],["provide","dojox.mobile.app._event"],["provide","dojox.mobile.app._Widget"],["provide","dojox.mobile.app.SceneController"],["provide","dojox.mobile.app.StageController"],["provide","dojox.mobile.app.SceneAssistant"],["provide","dojox.mobile.app.AlertDialog"],["provide","dojo.string"],["provide","dojox.mobile.app.List"],["provide","dojo.fx.Toggler"],["provide","dojo.fx"],["provide","dojox.mobile.app.ListSelector"],["provide","dojox.mobile.app._FormWidget"],["provide","dojox.mobile.app.TextBox"],["provide","dojo.fx.easing"],["provide","dojox.mobile.app.ImageView"],["provide","dojox.mobile.app.ImageThumbView"],["provide","dojox.mobile.app._base"],["provide","dojox.mobileApp"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojo.window"]){_4._hasResource["dojo.window"]=true;_4.provide("dojo.window");_4.getObject("window",true,_4);_4.window.getBox=function(){var _7=(_4.doc.compatMode=="BackCompat")?_4.body():_4.doc.documentElement;var _8=_4._docScroll();return {w:_7.clientWidth,h:_7.clientHeight,l:_8.x,t:_8.y};};_4.window.get=function(_9){if(_4.isIE&&window!==document.parentWindow){_9.parentWindow.execScript("document._parentWindow = window;","Javascript");var _a=_9._parentWindow;_9._parentWindow=null;return _a;}return _9.parentWindow||_9.defaultView;};_4.window.scrollIntoView=function(_b,_c){try{_b=_4.byId(_b);var _d=_b.ownerDocument||_4.doc,_e=_d.body||_4.body(),_f=_d.documentElement||_e.parentNode,_10=_4.isIE,_11=_4.isWebKit;if((!(_4.isMoz||_10||_11||_4.isOpera)||_b==_e||_b==_f)&&(typeof _b.scrollIntoView!="undefined")){_b.scrollIntoView(false);return;}var _12=_d.compatMode=="BackCompat",_13=_12?_e:_f,_14=_11?_e:_13,_15=_13.clientWidth,_16=_13.clientHeight,rtl=!_4._isBodyLtr(),_17=_c||_4.position(_b),el=_b.parentNode,_18=function(el){return ((_10<=6||(_10&&_12))?false:(_4.style(el,"position").toLowerCase()=="fixed"));};if(_18(_b)){return;}while(el){if(el==_e){el=_14;}var _19=_4.position(el),_1a=_18(el);if(el==_14){_19.w=_15;_19.h=_16;if(_14==_f&&_10&&rtl){_19.x+=_14.offsetWidth-_19.w;}if(_19.x<0||!_10){_19.x=0;}if(_19.y<0||!_10){_19.y=0;}}else{var pb=_4._getPadBorderExtents(el);_19.w-=pb.w;_19.h-=pb.h;_19.x+=pb.l;_19.y+=pb.t;}if(el!=_14){var _1b=el.clientWidth,_1c=_19.w-_1b;if(_1b>0&&_1c>0){_19.w=_1b;if(_10&&rtl){_19.x+=_1c;}}_1b=el.clientHeight;_1c=_19.h-_1b;if(_1b>0&&_1c>0){_19.h=_1b;}}if(_1a){if(_19.y<0){_19.h+=_19.y;_19.y=0;}if(_19.x<0){_19.w+=_19.x;_19.x=0;}if(_19.y+_19.h>_16){_19.h=_16-_19.y;}if(_19.x+_19.w>_15){_19.w=_15-_19.x;}}var l=_17.x-_19.x,t=_17.y-Math.max(_19.y,0),r=l+_17.w-_19.w,bot=t+_17.h-_19.h;if(r*l>0){var s=Math[l<0?"max":"min"](l,r);_17.x+=el.scrollLeft;el.scrollLeft+=(_10>=8&&!_12&&rtl)?-s:s;_17.x-=el.scrollLeft;}if(bot*t>0){_17.y+=el.scrollTop;el.scrollTop+=Math[t<0?"max":"min"](t,bot);_17.y-=el.scrollTop;}el=(el!=_14)&&!_1a&&el.parentNode;}}catch(error){console.error("scrollIntoView: "+error);_b.scrollIntoView(false);}};}if(!_4._hasResource["dijit._base.manager"]){_4._hasResource["dijit._base.manager"]=true;_4.provide("dijit._base.manager");_4.declare("dijit.WidgetSet",null,{constructor:function(){this._hash={};this.length=0;},add:function(_1d){if(this._hash[_1d.id]){throw new Error("Tried to register widget with id=="+_1d.id+" but that id is already registered");}this._hash[_1d.id]=_1d;this.length++;},remove:function(id){if(this._hash[id]){delete this._hash[id];this.length--;}},forEach:function(_1e,_1f){_1f=_1f||_4.global;var i=0,id;for(id in this._hash){_1e.call(_1f,this._hash[id],i++,this._hash);}return this;},filter:function(_20,_21){_21=_21||_4.global;var res=new _5.WidgetSet(),i=0,id;for(id in this._hash){var w=this._hash[id];if(_20.call(_21,w,i++,this._hash)){res.add(w);}}return res;},byId:function(id){return this._hash[id];},byClass:function(cls){var res=new _5.WidgetSet(),id,_22;for(id in this._hash){_22=this._hash[id];if(_22.declaredClass==cls){res.add(_22);}}return res;},toArray:function(){var ar=[];for(var id in this._hash){ar.push(this._hash[id]);}return ar;},map:function(_23,_24){return _4.map(this.toArray(),_23,_24);},every:function(_25,_26){_26=_26||_4.global;var x=0,i;for(i in this._hash){if(!_25.call(_26,this._hash[i],x++,this._hash)){return false;}}return true;},some:function(_27,_28){_28=_28||_4.global;var x=0,i;for(i in this._hash){if(_27.call(_28,this._hash[i],x++,this._hash)){return true;}}return false;}});(function(){_5.registry=new _5.WidgetSet();var _29=_5.registry._hash,_2a=_4.attr,_2b=_4.hasAttr,_2c=_4.style;_5.byId=function(id){return typeof id=="string"?_29[id]:id;};var _2d={};_5.getUniqueId=function(_2e){var id;do{id=_2e+"_"+(_2e in _2d?++_2d[_2e]:_2d[_2e]=0);}while(_29[id]);return _5._scopeName=="dijit"?id:_5._scopeName+"_"+id;};_5.findWidgets=function(_2f){var _30=[];function _31(_32){for(var _33=_32.firstChild;_33;_33=_33.nextSibling){if(_33.nodeType==1){var _34=_33.getAttribute("widgetId");if(_34){var _35=_29[_34];if(_35){_30.push(_35);}}else{_31(_33);}}}};_31(_2f);return _30;};_5._destroyAll=function(){_5._curFocus=null;_5._prevFocus=null;_5._activeStack=[];_4.forEach(_5.findWidgets(_4.body()),function(_36){if(!_36._destroyed){if(_36.destroyRecursive){_36.destroyRecursive();}else{if(_36.destroy){_36.destroy();}}}});};if(_4.isIE){_4.addOnWindowUnload(function(){_5._destroyAll();});}_5.byNode=function(_37){return _29[_37.getAttribute("widgetId")];};_5.getEnclosingWidget=function(_38){while(_38){var id=_38.getAttribute&&_38.getAttribute("widgetId");if(id){return _29[id];}_38=_38.parentNode;}return null;};var _39=(_5._isElementShown=function(_3a){var s=_2c(_3a);return (s.visibility!="hidden")&&(s.visibility!="collapsed")&&(s.display!="none")&&(_2a(_3a,"type")!="hidden");});_5.hasDefaultTabStop=function(_3b){switch(_3b.nodeName.toLowerCase()){case "a":return _2b(_3b,"href");case "area":case "button":case "input":case "object":case "select":case "textarea":return true;case "iframe":var _3c;try{var _3d=_3b.contentDocument;if("designMode" in _3d&&_3d.designMode=="on"){return true;}_3c=_3d.body;}catch(e1){try{_3c=_3b.contentWindow.document.body;}catch(e2){return false;}}return _3c.contentEditable=="true"||(_3c.firstChild&&_3c.firstChild.contentEditable=="true");default:return _3b.contentEditable=="true";}};var _3e=(_5.isTabNavigable=function(_3f){if(_2a(_3f,"disabled")){return false;}else{if(_2b(_3f,"tabIndex")){return _2a(_3f,"tabIndex")>=0;}else{return _5.hasDefaultTabStop(_3f);}}});_5._getTabNavigable=function(_40){var _41,_42,_43,_44,_45,_46,_47={};function _48(_49){return _49&&_49.tagName.toLowerCase()=="input"&&_49.type&&_49.type.toLowerCase()=="radio"&&_49.name&&_49.name.toLowerCase();};var _4a=function(_4b){_4.query("> *",_4b).forEach(function(_4c){if((_4.isIE&&_4c.scopeName!=="HTML")||!_39(_4c)){return;}if(_3e(_4c)){var _4d=_2a(_4c,"tabIndex");if(!_2b(_4c,"tabIndex")||_4d==0){if(!_41){_41=_4c;}_42=_4c;}else{if(_4d>0){if(!_43||_4d<_44){_44=_4d;_43=_4c;}if(!_45||_4d>=_46){_46=_4d;_45=_4c;}}}var rn=_48(_4c);if(_4.attr(_4c,"checked")&&rn){_47[rn]=_4c;}}if(_4c.nodeName.toUpperCase()!="SELECT"){_4a(_4c);}});};if(_39(_40)){_4a(_40);}function rs(_4e){return _47[_48(_4e)]||_4e;};return {first:rs(_41),last:rs(_42),lowest:rs(_43),highest:rs(_45)};};_5.getFirstInTabbingOrder=function(_4f){var _50=_5._getTabNavigable(_4.byId(_4f));return _50.lowest?_50.lowest:_50.first;};_5.getLastInTabbingOrder=function(_51){var _52=_5._getTabNavigable(_4.byId(_51));return _52.last?_52.last:_52.highest;};_5.defaultDuration=_4.config["defaultDuration"]||200;})();}if(!_4._hasResource["dijit._base.focus"]){_4._hasResource["dijit._base.focus"]=true;_4.provide("dijit._base.focus");_4.mixin(_5,{_curFocus:null,_prevFocus:null,isCollapsed:function(){return _5.getBookmark().isCollapsed;},getBookmark:function(){var bm,rg,tg,sel=_4.doc.selection,cf=_5._curFocus;if(_4.global.getSelection){sel=_4.global.getSelection();if(sel){if(sel.isCollapsed){tg=cf?cf.tagName:"";if(tg){tg=tg.toLowerCase();if(tg=="textarea"||(tg=="input"&&(!cf.type||cf.type.toLowerCase()=="text"))){sel={start:cf.selectionStart,end:cf.selectionEnd,node:cf,pRange:true};return {isCollapsed:(sel.end<=sel.start),mark:sel};}}bm={isCollapsed:true};}else{rg=sel.getRangeAt(0);bm={isCollapsed:false,mark:rg.cloneRange()};}}}else{if(sel){tg=cf?cf.tagName:"";tg=tg.toLowerCase();if(cf&&tg&&(tg=="button"||tg=="textarea"||tg=="input")){if(sel.type&&sel.type.toLowerCase()=="none"){return {isCollapsed:true,mark:null};}else{rg=sel.createRange();return {isCollapsed:rg.text&&rg.text.length?false:true,mark:{range:rg,pRange:true}};}}bm={};try{rg=sel.createRange();bm.isCollapsed=!(sel.type=="Text"?rg.htmlText.length:rg.length);}catch(e){bm.isCollapsed=true;return bm;}if(sel.type.toUpperCase()=="CONTROL"){if(rg.length){bm.mark=[];var i=0,len=rg.length;while(i<len){bm.mark.push(rg.item(i++));}}else{bm.isCollapsed=true;bm.mark=null;}}else{bm.mark=rg.getBookmark();}}else{console.warn("No idea how to store the current selection for this browser!");}}return bm;},moveToBookmark:function(_53){var _54=_4.doc,_55=_53.mark;if(_55){if(_4.global.getSelection){var sel=_4.global.getSelection();if(sel&&sel.removeAllRanges){if(_55.pRange){var r=_55;var n=r.node;n.selectionStart=r.start;n.selectionEnd=r.end;}else{sel.removeAllRanges();sel.addRange(_55);}}else{console.warn("No idea how to restore selection for this browser!");}}else{if(_54.selection&&_55){var rg;if(_55.pRange){rg=_55.range;}else{if(_4.isArray(_55)){rg=_54.body.createControlRange();_4.forEach(_55,function(n){rg.addElement(n);});}else{rg=_54.body.createTextRange();rg.moveToBookmark(_55);}}rg.select();}}}},getFocus:function(_56,_57){var _58=!_5._curFocus||(_56&&_4.isDescendant(_5._curFocus,_56.domNode))?_5._prevFocus:_5._curFocus;return {node:_58,bookmark:(_58==_5._curFocus)&&_4.withGlobal(_57||_4.global,_5.getBookmark),openedForWindow:_57};},focus:function(_59){if(!_59){return;}var _5a="node" in _59?_59.node:_59,_5b=_59.bookmark,_5c=_59.openedForWindow,_5d=_5b?_5b.isCollapsed:false;if(_5a){var _5e=(_5a.tagName.toLowerCase()=="iframe")?_5a.contentWindow:_5a;if(_5e&&_5e.focus){try{_5e.focus();}catch(e){}}_5._onFocusNode(_5a);}if(_5b&&_4.withGlobal(_5c||_4.global,_5.isCollapsed)&&!_5d){if(_5c){_5c.focus();}try{_4.withGlobal(_5c||_4.global,_5.moveToBookmark,null,[_5b]);}catch(e2){}}},_activeStack:[],registerIframe:function(_5f){return _5.registerWin(_5f.contentWindow,_5f);},unregisterIframe:function(_60){_5.unregisterWin(_60);},registerWin:function(_61,_62){var _63=function(evt){_5._justMouseDowned=true;setTimeout(function(){_5._justMouseDowned=false;},0);if(_4.isIE&&evt&&evt.srcElement&&evt.srcElement.parentNode==null){return;}_5._onTouchNode(_62||evt.target||evt.srcElement,"mouse");};var doc=_4.isIE?_61.document.documentElement:_61.document;if(doc){if(_4.isIE){_61.document.body.attachEvent("onmousedown",_63);var _64=function(evt){if(evt.srcElement.tagName.toLowerCase()!="#document"&&_5.isTabNavigable(evt.srcElement)){_5._onFocusNode(_62||evt.srcElement);}else{_5._onTouchNode(_62||evt.srcElement);}};doc.attachEvent("onactivate",_64);var _65=function(evt){_5._onBlurNode(_62||evt.srcElement);};doc.attachEvent("ondeactivate",_65);return function(){_61.document.detachEvent("onmousedown",_63);doc.detachEvent("onactivate",_64);doc.detachEvent("ondeactivate",_65);doc=null;};}else{doc.body.addEventListener("mousedown",_63,true);var _66=function(evt){_5._onFocusNode(_62||evt.target);};doc.addEventListener("focus",_66,true);var _67=function(evt){_5._onBlurNode(_62||evt.target);};doc.addEventListener("blur",_67,true);return function(){doc.body.removeEventListener("mousedown",_63,true);doc.removeEventListener("focus",_66,true);doc.removeEventListener("blur",_67,true);doc=null;};}}},unregisterWin:function(_68){_68&&_68();},_onBlurNode:function(_69){_5._prevFocus=_5._curFocus;_5._curFocus=null;if(_5._justMouseDowned){return;}if(_5._clearActiveWidgetsTimer){clearTimeout(_5._clearActiveWidgetsTimer);}_5._clearActiveWidgetsTimer=setTimeout(function(){delete _5._clearActiveWidgetsTimer;_5._setStack([]);_5._prevFocus=null;},100);},_onTouchNode:function(_6a,by){if(_5._clearActiveWidgetsTimer){clearTimeout(_5._clearActiveWidgetsTimer);delete _5._clearActiveWidgetsTimer;}var _6b=[];try{while(_6a){var _6c=_4.attr(_6a,"dijitPopupParent");if(_6c){_6a=_5.byId(_6c).domNode;}else{if(_6a.tagName&&_6a.tagName.toLowerCase()=="body"){if(_6a===_4.body()){break;}_6a=_4.window.get(_6a.ownerDocument).frameElement;}else{var id=_6a.getAttribute&&_6a.getAttribute("widgetId"),_6d=id&&_5.byId(id);if(_6d&&!(by=="mouse"&&_6d.get("disabled"))){_6b.unshift(id);}_6a=_6a.parentNode;}}}}catch(e){}_5._setStack(_6b,by);},_onFocusNode:function(_6e){if(!_6e){return;}if(_6e.nodeType==9){return;}_5._onTouchNode(_6e);if(_6e==_5._curFocus){return;}if(_5._curFocus){_5._prevFocus=_5._curFocus;}_5._curFocus=_6e;_4.publish("focusNode",[_6e]);},_setStack:function(_6f,by){var _70=_5._activeStack;_5._activeStack=_6f;for(var _71=0;_71<Math.min(_70.length,_6f.length);_71++){if(_70[_71]!=_6f[_71]){break;}}var _72;for(var i=_70.length-1;i>=_71;i--){_72=_5.byId(_70[i]);if(_72){_72._focused=false;_72.set("focused",false);_72._hasBeenBlurred=true;if(_72._onBlur){_72._onBlur(by);}_4.publish("widgetBlur",[_72,by]);}}for(i=_71;i<_6f.length;i++){_72=_5.byId(_6f[i]);if(_72){_72._focused=true;_72.set("focused",true);if(_72._onFocus){_72._onFocus(by);}_4.publish("widgetFocus",[_72,by]);}}}});_4.addOnLoad(function(){var _73=_5.registerWin(window);if(_4.isIE){_4.addOnWindowUnload(function(){_5.unregisterWin(_73);_73=null;});}});}if(!_4._hasResource["dojo.AdapterRegistry"]){_4._hasResource["dojo.AdapterRegistry"]=true;_4.provide("dojo.AdapterRegistry");_4.AdapterRegistry=function(_74){this.pairs=[];this.returnWrappers=_74||false;};_4.extend(_4.AdapterRegistry,{register:function(_75,_76,_77,_78,_79){this.pairs[((_79)?"unshift":"push")]([_75,_76,_77,_78]);},match:function(){for(var i=0;i<this.pairs.length;i++){var _7a=this.pairs[i];if(_7a[1].apply(this,arguments)){if((_7a[3])||(this.returnWrappers)){return _7a[2];}else{return _7a[2].apply(this,arguments);}}}throw new Error("No match found");},unregister:function(_7b){for(var i=0;i<this.pairs.length;i++){var _7c=this.pairs[i];if(_7c[0]==_7b){this.pairs.splice(i,1);return true;}}return false;}});}if(!_4._hasResource["dijit._base.place"]){_4._hasResource["dijit._base.place"]=true;_4.provide("dijit._base.place");_5.getViewport=function(){return _4.window.getBox();};_5.placeOnScreen=function(_7d,pos,_7e,_7f){var _80=_4.map(_7e,function(_81){var c={corner:_81,pos:{x:pos.x,y:pos.y}};if(_7f){c.pos.x+=_81.charAt(1)=="L"?_7f.x:-_7f.x;c.pos.y+=_81.charAt(0)=="T"?_7f.y:-_7f.y;}return c;});return _5._place(_7d,_80);};_5._place=function(_82,_83,_84,_85){var _86=_4.window.getBox();if(!_82.parentNode||String(_82.parentNode.tagName).toLowerCase()!="body"){_4.body().appendChild(_82);}var _87=null;_4.some(_83,function(_88){var _89=_88.corner;var pos=_88.pos;var _8a=0;var _8b={w:_89.charAt(1)=="L"?(_86.l+_86.w)-pos.x:pos.x-_86.l,h:_89.charAt(1)=="T"?(_86.t+_86.h)-pos.y:pos.y-_86.t};if(_84){var res=_84(_82,_88.aroundCorner,_89,_8b,_85);_8a=typeof res=="undefined"?0:res;}var _8c=_82.style;var _8d=_8c.display;var _8e=_8c.visibility;_8c.visibility="hidden";_8c.display="";var mb=_4.marginBox(_82);_8c.display=_8d;_8c.visibility=_8e;var _8f=Math.max(_86.l,_89.charAt(1)=="L"?pos.x:(pos.x-mb.w)),_90=Math.max(_86.t,_89.charAt(0)=="T"?pos.y:(pos.y-mb.h)),_91=Math.min(_86.l+_86.w,_89.charAt(1)=="L"?(_8f+mb.w):pos.x),_92=Math.min(_86.t+_86.h,_89.charAt(0)=="T"?(_90+mb.h):pos.y),_93=_91-_8f,_94=_92-_90;_8a+=(mb.w-_93)+(mb.h-_94);if(_87==null||_8a<_87.overflow){_87={corner:_89,aroundCorner:_88.aroundCorner,x:_8f,y:_90,w:_93,h:_94,overflow:_8a,spaceAvailable:_8b};}return !_8a;});if(_87.overflow&&_84){_84(_82,_87.aroundCorner,_87.corner,_87.spaceAvailable,_85);}var l=_4._isBodyLtr(),s=_82.style;s.top=_87.y+"px";s[l?"left":"right"]=(l?_87.x:_86.w-_87.x-_87.w)+"px";return _87;};_5.placeOnScreenAroundNode=function(_95,_96,_97,_98){_96=_4.byId(_96);var _99=_4.position(_96,true);return _5._placeOnScreenAroundRect(_95,_99.x,_99.y,_99.w,_99.h,_97,_98);};_5.placeOnScreenAroundRectangle=function(_9a,_9b,_9c,_9d){return _5._placeOnScreenAroundRect(_9a,_9b.x,_9b.y,_9b.width,_9b.height,_9c,_9d);};_5._placeOnScreenAroundRect=function(_9e,x,y,_9f,_a0,_a1,_a2){var _a3=[];for(var _a4 in _a1){_a3.push({aroundCorner:_a4,corner:_a1[_a4],pos:{x:x+(_a4.charAt(1)=="L"?0:_9f),y:y+(_a4.charAt(0)=="T"?0:_a0)}});}return _5._place(_9e,_a3,_a2,{w:_9f,h:_a0});};_5.placementRegistry=new _4.AdapterRegistry();_5.placementRegistry.register("node",function(n,x){return typeof x=="object"&&typeof x.offsetWidth!="undefined"&&typeof x.offsetHeight!="undefined";},_5.placeOnScreenAroundNode);_5.placementRegistry.register("rect",function(n,x){return typeof x=="object"&&"x" in x&&"y" in x&&"width" in x&&"height" in x;},_5.placeOnScreenAroundRectangle);_5.placeOnScreenAroundElement=function(_a5,_a6,_a7,_a8){return _5.placementRegistry.match.apply(_5.placementRegistry,arguments);};_5.getPopupAroundAlignment=function(_a9,_aa){var _ab={};_4.forEach(_a9,function(pos){switch(pos){case "after":_ab[_aa?"BR":"BL"]=_aa?"BL":"BR";break;case "before":_ab[_aa?"BL":"BR"]=_aa?"BR":"BL";break;case "below-alt":_aa=!_aa;case "below":_ab[_aa?"BL":"BR"]=_aa?"TL":"TR";_ab[_aa?"BR":"BL"]=_aa?"TR":"TL";break;case "above-alt":_aa=!_aa;case "above":default:_ab[_aa?"TL":"TR"]=_aa?"BL":"BR";_ab[_aa?"TR":"TL"]=_aa?"BR":"BL";break;}});return _ab;};}if(!_4._hasResource["dijit._base.window"]){_4._hasResource["dijit._base.window"]=true;_4.provide("dijit._base.window");_5.getDocumentWindow=function(doc){return _4.window.get(doc);};}if(!_4._hasResource["dijit._base.popup"]){_4._hasResource["dijit._base.popup"]=true;_4.provide("dijit._base.popup");_5.popup={_stack:[],_beginZIndex:1000,_idGen:1,_createWrapper:function(_ac){var _ad=_ac.declaredClass?_ac._popupWrapper:(_4.hasClass(_ac.parentNode,"dijitPopup")&&_ac.parentNode),_ae=_ac.domNode||_ac;if(!_ad){_ad=_4.create("div",{"class":"dijitPopup",style:{display:"none"},role:"presentation"},_4.body());_ad.appendChild(_ae);var s=_ae.style;s.display="";s.visibility="";s.position="";s.top="0px";if(_ac.declaredClass){_ac._popupWrapper=_ad;_4.connect(_ac,"destroy",function(){_4.destroy(_ad);delete _ac._popupWrapper;});}}return _ad;},moveOffScreen:function(_af){var _b0=this._createWrapper(_af);_4.style(_b0,{visibility:"hidden",top:"-9999px",display:""});},hide:function(_b1){var _b2=this._createWrapper(_b1);_4.style(_b2,"display","none");},getTopPopup:function(){var _b3=this._stack;for(var pi=_b3.length-1;pi>0&&_b3[pi].parent===_b3[pi-1].widget;pi--){}return _b3[pi];},open:function(_b4){var _b5=this._stack,_b6=_b4.popup,_b7=_b4.orient||((_b4.parent?_b4.parent.isLeftToRight():_4._isBodyLtr())?{"BL":"TL","BR":"TR","TL":"BL","TR":"BR"}:{"BR":"TR","BL":"TL","TR":"BR","TL":"BL"}),_b8=_b4.around,id=(_b4.around&&_b4.around.id)?(_b4.around.id+"_dropdown"):("popup_"+this._idGen++);while(_b5.length&&(!_b4.parent||!_4.isDescendant(_b4.parent.domNode,_b5[_b5.length-1].widget.domNode))){_5.popup.close(_b5[_b5.length-1].widget);}var _b9=this._createWrapper(_b6);_4.attr(_b9,{id:id,style:{zIndex:this._beginZIndex+_b5.length},"class":"dijitPopup "+(_b6.baseClass||_b6["class"]||"").split(" ")[0]+"Popup",dijitPopupParent:_b4.parent?_b4.parent.id:""});if(_4.isIE||_4.isMoz){if(!_b6.bgIframe){_b6.bgIframe=new _5.BackgroundIframe(_b9);}}var _ba=_b8?_5.placeOnScreenAroundElement(_b9,_b8,_b7,_b6.orient?_4.hitch(_b6,"orient"):null):_5.placeOnScreen(_b9,_b4,_b7=="R"?["TR","BR","TL","BL"]:["TL","BL","TR","BR"],_b4.padding);_b9.style.display="";_b9.style.visibility="visible";_b6.domNode.style.visibility="visible";var _bb=[];_bb.push(_4.connect(_b9,"onkeypress",this,function(evt){if(evt.charOrCode==_4.keys.ESCAPE&&_b4.onCancel){_4.stopEvent(evt);_b4.onCancel();}else{if(evt.charOrCode===_4.keys.TAB){_4.stopEvent(evt);var _bc=this.getTopPopup();if(_bc&&_bc.onCancel){_bc.onCancel();}}}}));if(_b6.onCancel){_bb.push(_4.connect(_b6,"onCancel",_b4.onCancel));}_bb.push(_4.connect(_b6,_b6.onExecute?"onExecute":"onChange",this,function(){var _bd=this.getTopPopup();if(_bd&&_bd.onExecute){_bd.onExecute();}}));_b5.push({widget:_b6,parent:_b4.parent,onExecute:_b4.onExecute,onCancel:_b4.onCancel,onClose:_b4.onClose,handlers:_bb});if(_b6.onOpen){_b6.onOpen(_ba);}return _ba;},close:function(_be){var _bf=this._stack;while((_be&&_4.some(_bf,function(_c0){return _c0.widget==_be;}))||(!_be&&_bf.length)){var top=_bf.pop(),_c1=top.widget,_c2=top.onClose;if(_c1.onClose){_c1.onClose();}_4.forEach(top.handlers,_4.disconnect);if(_c1&&_c1.domNode){this.hide(_c1);}if(_c2){_c2();}}}};_5._frames=new function(){var _c3=[];this.pop=function(){var _c4;if(_c3.length){_c4=_c3.pop();_c4.style.display="";}else{if(_4.isIE<9){var _c5=_4.config["dojoBlankHtmlUrl"]||(_4.moduleUrl("dojo","resources/blank.html")+"")||"javascript:\"\"";var _c6="<iframe src='"+_c5+"'"+" style='position: absolute; left: 0px; top: 0px;"+"z-index: -1; filter:Alpha(Opacity=\"0\");'>";_c4=_4.doc.createElement(_c6);}else{_c4=_4.create("iframe");_c4.src="javascript:\"\"";_c4.className="dijitBackgroundIframe";_4.style(_c4,"opacity",0.1);}_c4.tabIndex=-1;_5.setWaiRole(_c4,"presentation");}return _c4;};this.push=function(_c7){_c7.style.display="none";_c3.push(_c7);};}();_5.BackgroundIframe=function(_c8){if(!_c8.id){throw new Error("no id");}if(_4.isIE||_4.isMoz){var _c9=(this.iframe=_5._frames.pop());_c8.appendChild(_c9);if(_4.isIE<7||_4.isQuirks){this.resize(_c8);this._conn=_4.connect(_c8,"onresize",this,function(){this.resize(_c8);});}else{_4.style(_c9,{width:"100%",height:"100%"});}}};_4.extend(_5.BackgroundIframe,{resize:function(_ca){if(this.iframe){_4.style(this.iframe,{width:_ca.offsetWidth+"px",height:_ca.offsetHeight+"px"});}},destroy:function(){if(this._conn){_4.disconnect(this._conn);this._conn=null;}if(this.iframe){_5._frames.push(this.iframe);delete this.iframe;}}});}if(!_4._hasResource["dijit._base.scroll"]){_4._hasResource["dijit._base.scroll"]=true;_4.provide("dijit._base.scroll");_5.scrollIntoView=function(_cb,pos){_4.window.scrollIntoView(_cb,pos);};}if(!_4._hasResource["dojo.uacss"]){_4._hasResource["dojo.uacss"]=true;_4.provide("dojo.uacss");(function(){var d=_4,_cc=d.doc.documentElement,ie=d.isIE,_cd=d.isOpera,maj=Math.floor,ff=d.isFF,_ce=d.boxModel.replace(/-/,""),_cf={dj_ie:ie,dj_ie6:maj(ie)==6,dj_ie7:maj(ie)==7,dj_ie8:maj(ie)==8,dj_ie9:maj(ie)==9,dj_quirks:d.isQuirks,dj_iequirks:ie&&d.isQuirks,dj_opera:_cd,dj_khtml:d.isKhtml,dj_webkit:d.isWebKit,dj_safari:d.isSafari,dj_chrome:d.isChrome,dj_gecko:d.isMozilla,dj_ff3:maj(ff)==3};_cf["dj_"+_ce]=true;var _d0="";for(var clz in _cf){if(_cf[clz]){_d0+=clz+" ";}}_cc.className=d.trim(_cc.className+" "+_d0);_4._loaders.unshift(function(){if(!_4._isBodyLtr()){var _d1="dj_rtl dijitRtl "+_d0.replace(/ /g,"-rtl ");_cc.className=d.trim(_cc.className+" "+_d1);}});})();}if(!_4._hasResource["dijit._base.sniff"]){_4._hasResource["dijit._base.sniff"]=true;_4.provide("dijit._base.sniff");}if(!_4._hasResource["dijit._base.typematic"]){_4._hasResource["dijit._base.typematic"]=true;_4.provide("dijit._base.typematic");_5.typematic={_fireEventAndReload:function(){this._timer=null;this._callback(++this._count,this._node,this._evt);this._currentTimeout=Math.max(this._currentTimeout<0?this._initialDelay:(this._subsequentDelay>1?this._subsequentDelay:Math.round(this._currentTimeout*this._subsequentDelay)),this._minDelay);this._timer=setTimeout(_4.hitch(this,"_fireEventAndReload"),this._currentTimeout);},trigger:function(evt,_d2,_d3,_d4,obj,_d5,_d6,_d7){if(obj!=this._obj){this.stop();this._initialDelay=_d6||500;this._subsequentDelay=_d5||0.9;this._minDelay=_d7||10;this._obj=obj;this._evt=evt;this._node=_d3;this._currentTimeout=-1;this._count=-1;this._callback=_4.hitch(_d2,_d4);this._fireEventAndReload();this._evt=_4.mixin({faux:true},evt);}},stop:function(){if(this._timer){clearTimeout(this._timer);this._timer=null;}if(this._obj){this._callback(-1,this._node,this._evt);this._obj=null;}},addKeyListener:function(_d8,_d9,_da,_db,_dc,_dd,_de){if(_d9.keyCode){_d9.charOrCode=_d9.keyCode;_4.deprecated("keyCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0");}else{if(_d9.charCode){_d9.charOrCode=String.fromCharCode(_d9.charCode);_4.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.","","2.0");}}return [_4.connect(_d8,"onkeypress",this,function(evt){if(evt.charOrCode==_d9.charOrCode&&(_d9.ctrlKey===undefined||_d9.ctrlKey==evt.ctrlKey)&&(_d9.altKey===undefined||_d9.altKey==evt.altKey)&&(_d9.metaKey===undefined||_d9.metaKey==(evt.metaKey||false))&&(_d9.shiftKey===undefined||_d9.shiftKey==evt.shiftKey)){_4.stopEvent(evt);_5.typematic.trigger(evt,_da,_d8,_db,_d9,_dc,_dd,_de);}else{if(_5.typematic._obj==_d9){_5.typematic.stop();}}}),_4.connect(_d8,"onkeyup",this,function(evt){if(_5.typematic._obj==_d9){_5.typematic.stop();}})];},addMouseListener:function(_df,_e0,_e1,_e2,_e3,_e4){var dc=_4.connect;return [dc(_df,"mousedown",this,function(evt){_4.stopEvent(evt);_5.typematic.trigger(evt,_e0,_df,_e1,_df,_e2,_e3,_e4);}),dc(_df,"mouseup",this,function(evt){_4.stopEvent(evt);_5.typematic.stop();}),dc(_df,"mouseout",this,function(evt){_4.stopEvent(evt);_5.typematic.stop();}),dc(_df,"mousemove",this,function(evt){evt.preventDefault();}),dc(_df,"dblclick",this,function(evt){_4.stopEvent(evt);if(_4.isIE){_5.typematic.trigger(evt,_e0,_df,_e1,_df,_e2,_e3,_e4);setTimeout(_4.hitch(this,_5.typematic.stop),50);}})];},addListener:function(_e5,_e6,_e7,_e8,_e9,_ea,_eb,_ec){return this.addKeyListener(_e6,_e7,_e8,_e9,_ea,_eb,_ec).concat(this.addMouseListener(_e5,_e8,_e9,_ea,_eb,_ec));}};}if(!_4._hasResource["dijit._base.wai"]){_4._hasResource["dijit._base.wai"]=true;_4.provide("dijit._base.wai");_5.wai={onload:function(){var div=_4.create("div",{id:"a11yTestNode",style:{cssText:"border: 1px solid;"+"border-color:red green;"+"position: absolute;"+"height: 5px;"+"top: -999px;"+"background-image: url(\""+(_4.config.blankGif||_4.moduleUrl("dojo","resources/blank.gif"))+"\");"}},_4.body());var cs=_4.getComputedStyle(div);if(cs){var _ed=cs.backgroundImage;var _ee=(cs.borderTopColor==cs.borderRightColor)||(_ed!=null&&(_ed=="none"||_ed=="url(invalid-url:)"));_4[_ee?"addClass":"removeClass"](_4.body(),"dijit_a11y");if(_4.isIE){div.outerHTML="";}else{_4.body().removeChild(div);}}}};if(_4.isIE||_4.isMoz){_4._loaders.unshift(_5.wai.onload);}_4.mixin(_5,{hasWaiRole:function(_ef,_f0){var _f1=this.getWaiRole(_ef);return _f0?(_f1.indexOf(_f0)>-1):(_f1.length>0);},getWaiRole:function(_f2){return _4.trim((_4.attr(_f2,"role")||"").replace("wairole:",""));},setWaiRole:function(_f3,_f4){_4.attr(_f3,"role",_f4);},removeWaiRole:function(_f5,_f6){var _f7=_4.attr(_f5,"role");if(!_f7){return;}if(_f6){var t=_4.trim((" "+_f7+" ").replace(" "+_f6+" "," "));_4.attr(_f5,"role",t);}else{_f5.removeAttribute("role");}},hasWaiState:function(_f8,_f9){return _f8.hasAttribute?_f8.hasAttribute("aria-"+_f9):!!_f8.getAttribute("aria-"+_f9);},getWaiState:function(_fa,_fb){return _fa.getAttribute("aria-"+_fb)||"";},setWaiState:function(_fc,_fd,_fe){_fc.setAttribute("aria-"+_fd,_fe);},removeWaiState:function(_ff,_100){_ff.removeAttribute("aria-"+_100);}});}if(!_4._hasResource["dijit._base"]){_4._hasResource["dijit._base"]=true;_4.provide("dijit._base");}if(!_4._hasResource["dojo.Stateful"]){_4._hasResource["dojo.Stateful"]=true;_4.provide("dojo.Stateful");_4.declare("dojo.Stateful",null,{postscript:function(_101){if(_101){_4.mixin(this,_101);}},get:function(name){return this[name];},set:function(name,_102){if(typeof name==="object"){for(var x in name){this.set(x,name[x]);}return this;}var _103=this[name];this[name]=_102;if(this._watchCallbacks){this._watchCallbacks(name,_103,_102);}return this;},watch:function(name,_104){var _105=this._watchCallbacks;if(!_105){var self=this;_105=this._watchCallbacks=function(name,_106,_107,_108){var _109=function(_10a){if(_10a){_10a=_10a.slice();for(var i=0,l=_10a.length;i<l;i++){try{_10a[i].call(self,name,_106,_107);}catch(e){console.error(e);}}}};_109(_105["_"+name]);if(!_108){_109(_105["*"]);}};}if(!_104&&typeof name==="function"){_104=name;name="*";}else{name="_"+name;}var _10b=_105[name];if(typeof _10b!=="object"){_10b=_105[name]=[];}_10b.push(_104);return {unwatch:function(){_10b.splice(_4.indexOf(_10b,_104),1);}};}});}if(!_4._hasResource["dijit._WidgetBase"]){_4._hasResource["dijit._WidgetBase"]=true;_4.provide("dijit._WidgetBase");(function(){_4.declare("dijit._WidgetBase",_4.Stateful,{id:"",lang:"",dir:"","class":"",style:"",title:"",tooltip:"",baseClass:"",srcNodeRef:null,domNode:null,containerNode:null,attributeMap:{id:"",dir:"",lang:"","class":"",style:"",title:""},_blankGif:(_4.config.blankGif||_4.moduleUrl("dojo","resources/blank.gif")).toString(),postscript:function(_10c,_10d){this.create(_10c,_10d);},create:function(_10e,_10f){this.srcNodeRef=_4.byId(_10f);this._connects=[];this._subscribes=[];if(this.srcNodeRef&&(typeof this.srcNodeRef.id=="string")){this.id=this.srcNodeRef.id;}if(_10e){this.params=_10e;_4._mixin(this,_10e);}this.postMixInProperties();if(!this.id){this.id=_5.getUniqueId(this.declaredClass.replace(/\./g,"_"));}_5.registry.add(this);this.buildRendering();if(this.domNode){this._applyAttributes();var _110=this.srcNodeRef;if(_110&&_110.parentNode&&this.domNode!==_110){_110.parentNode.replaceChild(this.domNode,_110);}}if(this.domNode){this.domNode.setAttribute("widgetId",this.id);}this.postCreate();if(this.srcNodeRef&&!this.srcNodeRef.parentNode){delete this.srcNodeRef;}this._created=true;},_applyAttributes:function(){var _111=function(attr,_112){if((_112.params&&attr in _112.params)||_112[attr]){_112.set(attr,_112[attr]);}};for(var attr in this.attributeMap){_111(attr,this);}_4.forEach(this._getSetterAttributes(),function(a){if(!(a in this.attributeMap)){_111(a,this);}},this);},_getSetterAttributes:function(){var ctor=this.constructor;if(!ctor._setterAttrs){var r=(ctor._setterAttrs=[]),_113,_114=ctor.prototype;for(var _115 in _114){if(_4.isFunction(_114[_115])&&(_113=_115.match(/^_set([a-zA-Z]*)Attr$/))&&_113[1]){r.push(_113[1].charAt(0).toLowerCase()+_113[1].substr(1));}}}return ctor._setterAttrs;},postMixInProperties:function(){},buildRendering:function(){if(!this.domNode){this.domNode=this.srcNodeRef||_4.create("div");}if(this.baseClass){var _116=this.baseClass.split(" ");if(!this.isLeftToRight()){_116=_116.concat(_4.map(_116,function(name){return name+"Rtl";}));}_4.addClass(this.domNode,_116);}},postCreate:function(){},startup:function(){this._started=true;},destroyRecursive:function(_117){this._beingDestroyed=true;this.destroyDescendants(_117);this.destroy(_117);},destroy:function(_118){this._beingDestroyed=true;this.uninitialize();var d=_4,dfe=d.forEach,dun=d.unsubscribe;dfe(this._connects,function(_119){dfe(_119,d.disconnect);});dfe(this._subscribes,function(_11a){dun(_11a);});dfe(this._supportingWidgets||[],function(w){if(w.destroyRecursive){w.destroyRecursive();}else{if(w.destroy){w.destroy();}}});this.destroyRendering(_118);_5.registry.remove(this.id);this._destroyed=true;},destroyRendering:function(_11b){if(this.bgIframe){this.bgIframe.destroy(_11b);delete this.bgIframe;}if(this.domNode){if(_11b){_4.removeAttr(this.domNode,"widgetId");}else{_4.destroy(this.domNode);}delete this.domNode;}if(this.srcNodeRef){if(!_11b){_4.destroy(this.srcNodeRef);}delete this.srcNodeRef;}},destroyDescendants:function(_11c){_4.forEach(this.getChildren(),function(_11d){if(_11d.destroyRecursive){_11d.destroyRecursive(_11c);}});},uninitialize:function(){return false;},_setClassAttr:function(_11e){var _11f=this[this.attributeMap["class"]||"domNode"];_4.replaceClass(_11f,_11e,this["class"]);this._set("class",_11e);},_setStyleAttr:function(_120){var _121=this[this.attributeMap.style||"domNode"];if(_4.isObject(_120)){_4.style(_121,_120);}else{if(_121.style.cssText){_121.style.cssText+="; "+_120;}else{_121.style.cssText=_120;}}this._set("style",_120);},_attrToDom:function(attr,_122){var _123=this.attributeMap[attr];_4.forEach(_4.isArray(_123)?_123:[_123],function(_124){var _125=this[_124.node||_124||"domNode"];var type=_124.type||"attribute";switch(type){case "attribute":if(_4.isFunction(_122)){_122=_4.hitch(this,_122);}var _126=_124.attribute?_124.attribute:(/^on[A-Z][a-zA-Z]*$/.test(attr)?attr.toLowerCase():attr);_4.attr(_125,_126,_122);break;case "innerText":_125.innerHTML="";_125.appendChild(_4.doc.createTextNode(_122));break;case "innerHTML":_125.innerHTML=_122;break;case "class":_4.replaceClass(_125,_122,this[attr]);break;}},this);},get:function(name){var _127=this._getAttrNames(name);return this[_127.g]?this[_127.g]():this[name];},set:function(name,_128){if(typeof name==="object"){for(var x in name){this.set(x,name[x]);}return this;}var _129=this._getAttrNames(name);if(this[_129.s]){var _12a=this[_129.s].apply(this,Array.prototype.slice.call(arguments,1));}else{if(name in this.attributeMap){this._attrToDom(name,_128);}this._set(name,_128);}return _12a||this;},_attrPairNames:{},_getAttrNames:function(name){var apn=this._attrPairNames;if(apn[name]){return apn[name];}var uc=name.charAt(0).toUpperCase()+name.substr(1);return (apn[name]={n:name+"Node",s:"_set"+uc+"Attr",g:"_get"+uc+"Attr"});},_set:function(name,_12b){var _12c=this[name];this[name]=_12b;if(this._watchCallbacks&&this._created&&_12b!==_12c){this._watchCallbacks(name,_12c,_12b);}},toString:function(){return "[Widget "+this.declaredClass+", "+(this.id||"NO ID")+"]";},getDescendants:function(){return this.containerNode?_4.query("[widgetId]",this.containerNode).map(_5.byNode):[];},getChildren:function(){return this.containerNode?_5.findWidgets(this.containerNode):[];},connect:function(obj,_12d,_12e){var _12f=[_4._connect(obj,_12d,this,_12e)];this._connects.push(_12f);return _12f;},disconnect:function(_130){for(var i=0;i<this._connects.length;i++){if(this._connects[i]==_130){_4.forEach(_130,_4.disconnect);this._connects.splice(i,1);return;}}},subscribe:function(_131,_132){var _133=_4.subscribe(_131,this,_132);this._subscribes.push(_133);return _133;},unsubscribe:function(_134){for(var i=0;i<this._subscribes.length;i++){if(this._subscribes[i]==_134){_4.unsubscribe(_134);this._subscribes.splice(i,1);return;}}},isLeftToRight:function(){return this.dir?(this.dir=="ltr"):_4._isBodyLtr();},placeAt:function(_135,_136){if(_135.declaredClass&&_135.addChild){_135.addChild(this,_136);}else{_4.place(this.domNode,_135,_136);}return this;}});})();}if(!_4._hasResource["dojox.mobile._base"]){_4._hasResource["dojox.mobile._base"]=true;_4.provide("dojox.mobile._base");_4.isBB=(navigator.userAgent.indexOf("BlackBerry")!=-1)&&!_4.isWebKit;_4.declare("dojox.mobile.View",_5._WidgetBase,{selected:false,keepScrollPos:true,_started:false,constructor:function(_137,node){if(node){_4.byId(node).style.visibility="hidden";}},buildRendering:function(){this.domNode=this.containerNode=this.srcNodeRef||_4.doc.createElement("DIV");this.domNode.className="mblView";this.connect(this.domNode,"webkitAnimationEnd","onAnimationEnd");this.connect(this.domNode,"webkitAnimationStart","onAnimationStart");var id=location.href.match(/#(\w+)([^\w=]|$)/)?RegExp.$1:null;this._visible=this.selected&&!id||this.id==id;if(this.selected){_6.mobile._defaultView=this;}},startup:function(){if(this._started){return;}var _138=this;setTimeout(function(){if(!_138._visible){_138.domNode.style.display="none";}else{_6.mobile.currentView=_138;_138.onStartView();}_138.domNode.style.visibility="visible";},_4.isIE?100:0);this._started=true;},onStartView:function(){},onBeforeTransitionIn:function(_139,dir,_13a,_13b,_13c){},onAfterTransitionIn:function(_13d,dir,_13e,_13f,_140){},onBeforeTransitionOut:function(_141,dir,_142,_143,_144){},onAfterTransitionOut:function(_145,dir,_146,_147,_148){},_saveState:function(_149,dir,_14a,_14b,_14c){this._context=_14b;this._method=_14c;if(_14a=="none"||!_4.isWebKit){_14a=null;}this._moveTo=_149;this._dir=dir;this._transition=_14a;this._arguments=[];var i;for(i=0;i<arguments.length;i++){this._arguments.push(arguments[i]);}this._args=[];if(_14b||_14c){for(i=5;i<arguments.length;i++){this._args.push(arguments[i]);}}},performTransition:function(_14d,dir,_14e,_14f,_150){if(_4.hash){if(typeof (_14d)=="string"&&_14d.charAt(0)=="#"&&!_6.mobile._params){_6.mobile._params=[];for(var i=0;i<arguments.length;i++){_6.mobile._params.push(arguments[i]);}_4.hash(_14d);return;}}this._saveState.apply(this,arguments);var _151;if(_14d){if(typeof (_14d)=="string"){_14d.match(/^#?([^&]+)/);_151=RegExp.$1;}else{_151=_14d;}}else{if(!this._dummyNode){this._dummyNode=_4.doc.createElement("DIV");_4.body().appendChild(this._dummyNode);}_151=this._dummyNode;}var _152=this.domNode;_151=this.toNode=_4.byId(_151);if(!_151){alert("dojox.mobile.View#performTransition: destination view not found: "+_151);}_151.style.visibility="hidden";_151.style.display="";this.onBeforeTransitionOut.apply(this,arguments);var _153=_5.byNode(_151);if(_153){if(this.keepScrollPos&&!_5.getEnclosingWidget(this.domNode.parentNode)){var _154=_4.body().scrollTop||_4.doc.documentElement.scrollTop||_4.global.pageYOffset||0;if(dir==1){_151.style.top="0px";if(_154>1){_152.style.top=-_154+"px";if(_4.config["mblHideAddressBar"]!==false){setTimeout(function(){_4.global.scrollTo(0,1);},0);}}}else{if(_154>1||_151.offsetTop!==0){var _155=-_151.offsetTop;_151.style.top="0px";_152.style.top=_155-_154+"px";if(_4.config["mblHideAddressBar"]!==false&&_155>0){setTimeout(function(){_4.global.scrollTo(0,_155+1);},0);}}}}else{_151.style.top="0px";}_153.onBeforeTransitionIn.apply(_153,arguments);}_151.style.display="none";_151.style.visibility="visible";this._doTransition(_152,_151,_14e,dir);},_doTransition:function(_156,_157,_158,dir){var rev=(dir==-1)?" reverse":"";_157.style.display="";if(!_158||_158=="none"){this.domNode.style.display="none";this.invokeCallback();}else{_4.addClass(_156,_158+" out"+rev);_4.addClass(_157,_158+" in"+rev);}},onAnimationStart:function(e){},onAnimationEnd:function(e){var _159=false;if(_4.hasClass(this.domNode,"out")){_159=true;this.domNode.style.display="none";_4.forEach([this._transition,"in","out","reverse"],function(s){_4.removeClass(this.domNode,s);},this);}if(e.animationName.indexOf("shrink")===0){var li=e.target;li.style.display="none";_4.removeClass(li,"mblCloseContent");}if(_159){this.invokeCallback();}this.domNode&&(this.domNode.className="mblView");},invokeCallback:function(){this.onAfterTransitionOut.apply(this,this._arguments);var _15a=_5.byNode(this.toNode);if(_15a){_15a.onAfterTransitionIn.apply(_15a,this._arguments);}_6.mobile.currentView=_15a;var c=this._context,m=this._method;if(!c&&!m){return;}if(!m){m=c;c=null;}c=c||_4.global;if(typeof (m)=="string"){c[m].apply(c,this._args);}else{m.apply(c,this._args);}},getShowingView:function(){var _15b=this.domNode.parentNode.childNodes;for(var i=0;i<_15b.length;i++){if(_4.hasClass(_15b[i],"mblView")&&_4.style(_15b[i],"display")!="none"){return _5.byNode(_15b[i]);}}},show:function(){var fs=this.getShowingView().domNode.style;var ts=this.domNode.style;fs.display="none";ts.display="";_6.mobile.currentView=this;},addChild:function(_15c){this.containerNode.appendChild(_15c.domNode);}});_4.declare("dojox.mobile.Heading",_5._WidgetBase,{back:"",href:"",moveTo:"",transition:"slide",label:"",iconBase:"",buildRendering:function(){this.domNode=this.containerNode=this.srcNodeRef||_4.doc.createElement("H1");this.domNode.className="mblHeading";this._view=_5.getEnclosingWidget(this.domNode.parentNode);if(this.label){this.domNode.appendChild(document.createTextNode(this.label));}else{this.label="";_4.forEach(this.domNode.childNodes,function(n){if(n.nodeType==3){this.label+=n.nodeValue;}},this);this.label=_4.trim(this.label);}if(this.back){var btn=_4.create("DIV",{className:"mblArrowButton"},this.domNode,"first");var head=_4.create("DIV",{className:"mblArrowButtonHead"},btn);var body=_4.create("DIV",{className:"mblArrowButtonBody mblArrowButtonText"},btn);this._body=body;this._head=head;this._btn=btn;body.innerHTML=this.back;this.connect(body,"onclick","onClick");var neck=_4.create("DIV",{className:"mblArrowButtonNeck"},btn);btn.style.width=body.offsetWidth+head.offsetWidth+"px";this.setLabel(this.label);}},startup:function(){if(this._btn){this._btn.style.width=this._body.offsetWidth+this._head.offsetWidth+"px";}},onClick:function(e){var h1=this.domNode;_4.addClass(h1,"mblArrowButtonSelected");setTimeout(function(){_4.removeClass(h1,"mblArrowButtonSelected");},1000);this.goTo(this.moveTo,this.href);},setLabel:function(_15d){if(_15d!=this.label){this.label=_15d;this.domNode.firstChild.nodeValue=_15d;}},goTo:function(_15e,href){if(!this._view){this._view=_5.byNode(this.domNode.parentNode);}if(!this._view){return;}if(href){this._view.performTransition(null,-1,this.transition,this,function(){location.href=href;});}else{if(_6.mobile.app&&_6.mobile.app.STAGE_CONTROLLER_ACTIVE){_4.publish("/dojox/mobile/app/goback");}else{this._view.performTransition(_15e,-1,this.transition);}}}});_4.declare("dojox.mobile.RoundRect",_5._WidgetBase,{shadow:false,buildRendering:function(){this.domNode=this.containerNode=this.srcNodeRef||_4.doc.createElement("DIV");this.domNode.className=this.shadow?"mblRoundRect mblShadow":"mblRoundRect";}});_4.declare("dojox.mobile.RoundRectCategory",_5._WidgetBase,{label:"",buildRendering:function(){this.domNode=this.containerNode=this.srcNodeRef||_4.doc.createElement("H2");this.domNode.className="mblRoundRectCategory";if(this.label){this.domNode.innerHTML=this.label;}else{this.label=this.domNode.innerHTML;}}});_4.declare("dojox.mobile.EdgeToEdgeCategory",_6.mobile.RoundRectCategory,{buildRendering:function(){this.inherited(arguments);this.domNode.className="mblEdgeToEdgeCategory";}});_4.declare("dojox.mobile.RoundRectList",_5._WidgetBase,{transition:"slide",iconBase:"",iconPos:"",buildRendering:function(){this.domNode=this.containerNode=this.srcNodeRef||_4.doc.createElement("UL");this.domNode.className="mblRoundRectList";},addChild:function(_15f){this.containerNode.appendChild(_15f.domNode);_15f.inheritParams();_15f.setIcon();}});_4.declare("dojox.mobile.EdgeToEdgeList",_6.mobile.RoundRectList,{stateful:false,buildRendering:function(){this.inherited(arguments);this.domNode.className="mblEdgeToEdgeList";}});_4.declare("dojox.mobile.AbstractItem",_5._WidgetBase,{icon:"",iconPos:"",href:"",hrefTarget:"",moveTo:"",scene:"",clickable:false,url:"",transition:"",transitionDir:1,callback:null,sync:true,label:"",toggle:false,_duration:800,inheritParams:function(){var _160=this.getParentWidget();if(_160){if(!this.transition){this.transition=_160.transition;}if(!this.icon){this.icon=_160.iconBase;}if(!this.iconPos){this.iconPos=_160.iconPos;}}},findCurrentView:function(_161){var w;if(_161){w=_5.byId(_161);if(w){return w.getShowingView();}}var n=this.domNode.parentNode;while(true){w=_5.getEnclosingWidget(n);if(!w){return null;}if(w.performTransition){break;}n=w.domNode.parentNode;}return w;},transitionTo:function(_162,href,url,_163){var w=this.findCurrentView(_162);if(!w||_162&&w===_5.byId(_162)){return;}if(href){if(this.hrefTarget){_6.mobile.openWindow(this.href,this.hrefTarget);}else{w.performTransition(null,this.transitionDir,this.transition,this,function(){location.href=href;});}return;}else{if(_163){_4.publish("/dojox/mobile/app/pushScene",[_163]);return;}}if(url){var id;if(_6.mobile._viewMap&&_6.mobile._viewMap[url]){id=_6.mobile._viewMap[url];}else{var text=this._text;if(!text){if(this.sync){text=_4.trim(_4._getText(url));}else{_4["require"]("dojo._base.xhr");var prog=_6.mobile.ProgressIndicator.getInstance();_4.body().appendChild(prog.domNode);prog.start();var xhr=_4.xhrGet({url:url,handleAs:"text"});xhr.addCallback(_4.hitch(this,function(_164,_165){prog.stop();if(_164){this._text=_164;this.transitionTo(_162,href,url,_163);}}));xhr.addErrback(function(_166){prog.stop();alert("Failed to load "+url+"\n"+(_166.description||_166));});return;}}this._text=null;id=this._parse(text);if(!_6.mobile._viewMap){_6.mobile._viewMap=[];}_6.mobile._viewMap[url]=id;}_162=id;}w.performTransition(_162,this.transitionDir,this.transition,this.callback&&this,this.callback);},_parse:function(text){var _167=_4.create("DIV");var view;if(text.charAt(0)=="<"){_167.innerHTML=text;view=_167.firstChild;if(!view&&view.nodeType!=1){alert("dojox.mobile.AbstractItem#transitionTo: invalid view content");return;}view.setAttribute("_started","true");view.style.visibility="hidden";_4.body().appendChild(_167);(_6.mobile.parser||_4.parser).parse(_167);}else{if(text.charAt(0)=="{"){_4.body().appendChild(_167);this._ws=[];view=this._instantiate(eval("("+text+")"),_167);for(var i=0;i<this._ws.length;i++){var w=this._ws[i];w.startup&&!w._started&&(!w.getParent||!w.getParent())&&w.startup();}this._ws=null;}}view.style.display="none";view.style.visibility="visible";var id=view.id;return _4.hash?"#"+id:id;},_instantiate:function(obj,node,_168){var _169;for(var key in obj){if(key.charAt(0)=="@"){continue;}var cls=_4.getObject(key);if(!cls){continue;}var _16a={};var _16b=cls.prototype;var objs=_4.isArray(obj[key])?obj[key]:[obj[key]];for(var i=0;i<objs.length;i++){for(var prop in objs[i]){if(prop.charAt(0)=="@"){var val=objs[i][prop];prop=prop.substring(1);if(typeof _16b[prop]=="string"){_16a[prop]=val;}else{if(typeof _16b[prop]=="number"){_16a[prop]=val-0;}else{if(typeof _16b[prop]=="boolean"){_16a[prop]=(val!="false");}else{if(typeof _16b[prop]=="object"){_16a[prop]=eval("("+val+")");}}}}}}_169=new cls(_16a,node);if(!node){this._ws.push(_169);}if(_168&&_168.addChild){_168.addChild(_169);}this._instantiate(objs[i],null,_169);}}return _169&&_169.domNode;},createDomButton:function(_16c,_16d){var s=_16c.className;if(s.match(/mblDomButton\w+_(\d+)/)){var nDiv=RegExp.$1-0;for(var i=0,p=(_16d||_16c);i<nDiv;i++){p=_4.create("DIV",null,p);}}},select:function(_16e){},defaultClickAction:function(){if(this.toggle){this.select(this.selected);}else{if(!this.selected){this.select();if(!this.selectOne){var _16f=this;setTimeout(function(){_16f.select(true);},this._duration);}if(this.moveTo||this.href||this.url||this.scene){this.transitionTo(this.moveTo,this.href,this.url,this.scene);}}}},getParentWidget:function(){var ref=this.srcNodeRef||this.domNode;return ref&&ref.parentNode?_5.getEnclosingWidget(ref.parentNode):null;}});_4.declare("dojox.mobile.ListItem",_6.mobile.AbstractItem,{rightText:"",btnClass:"",anchorLabel:false,noArrow:false,selected:false,buildRendering:function(){this.inheritParams();var a=this.anchorNode=_4.create("A");a.className="mblListItemAnchor";var box=_4.create("DIV");box.className="mblListItemTextBox";if(this.anchorLabel){box.style.cursor="pointer";}var r=this.srcNodeRef;if(r){for(var i=0,len=r.childNodes.length;i<len;i++){box.appendChild(r.removeChild(r.firstChild));}}if(this.label){box.appendChild(_4.doc.createTextNode(this.label));}a.appendChild(box);if(this.rightText){this._setRightTextAttr(this.rightText);}if(this.moveTo||this.href||this.url||this.clickable){var _170=this.getParentWidget();if(!this.noArrow&&!(_170&&_170.stateful)){var _171=_4.create("DIV");_171.className="mblArrow";a.appendChild(_171);}this.connect(a,"onclick","onClick");}else{if(this.btnClass){var div=this.btnNode=_4.create("DIV");div.className=this.btnClass+" mblRightButton";div.appendChild(_4.create("DIV"));div.appendChild(_4.create("P"));var _172=_4.create("DIV");_172.className="mblRightButtonContainer";_172.appendChild(div);a.appendChild(_172);_4.addClass(a,"mblListItemAnchorHasRightButton");setTimeout(function(){_172.style.width=div.offsetWidth+"px";_172.style.height=div.offsetHeight+"px";if(_4.isIE){a.parentNode.style.height=a.parentNode.offsetHeight+"px";}},0);}}if(this.anchorLabel){box.style.display="inline";}var li=this.domNode=this.containerNode=this.srcNodeRef||_4.doc.createElement("LI");li.className="mblListItem"+(this.selected?" mblItemSelected":"");li.appendChild(a);this.setIcon();},setIcon:function(){if(this.iconNode){return;}var a=this.anchorNode;if(this.icon&&this.icon!="none"){var img=this.iconNode=_4.create("IMG");img.className="mblListItemIcon";img.src=this.icon;this.domNode.insertBefore(img,a);_6.mobile.setupIcon(this.iconNode,this.iconPos);_4.removeClass(a,"mblListItemAnchorNoIcon");}else{_4.addClass(a,"mblListItemAnchorNoIcon");}},onClick:function(e){var a=e.currentTarget;var li=a.parentNode;if(_4.hasClass(li,"mblItemSelected")){return;}if(this.anchorLabel){for(var p=e.target;p.tagName!="LI";p=p.parentNode){if(p.className=="mblListItemTextBox"){_4.addClass(p,"mblListItemTextBoxSelected");setTimeout(function(){_4.removeClass(p,"mblListItemTextBoxSelected");},1000);this.onAnchorLabelClicked(e);return;}}}if(this.getParentWidget().stateful){for(var i=0,c=li.parentNode.childNodes;i<c.length;i++){_4.removeClass(c[i],"mblItemSelected");}}else{setTimeout(function(){_4.removeClass(li,"mblItemSelected");},1000);}_4.addClass(li,"mblItemSelected");this.transitionTo(this.moveTo,this.href,this.url,this.scene);},onAnchorLabelClicked:function(e){},_setRightTextAttr:function(text){this.rightText=text;if(!this._rightTextNode){this._rightTextNode=_4.create("DIV",{className:"mblRightText"},this.anchorNode);}this._rightTextNode.innerHTML=text;}});_4.declare("dojox.mobile.Switch",_5._WidgetBase,{value:"on",leftLabel:"ON",rightLabel:"OFF",_width:53,buildRendering:function(){this.domNode=this.srcNodeRef||_4.doc.createElement("DIV");this.domNode.className="mblSwitch";this.domNode.innerHTML="<div class=\"mblSwitchInner\">"+"<div class=\"mblSwitchBg mblSwitchBgLeft\">"+"<div class=\"mblSwitchText mblSwitchTextLeft\">"+this.leftLabel+"</div>"+"</div>"+"<div class=\"mblSwitchBg mblSwitchBgRight\">"+"<div class=\"mblSwitchText mblSwitchTextRight\">"+this.rightLabel+"</div>"+"</div>"+"<div class=\"mblSwitchKnob\"></div>"+"</div>";var n=this.inner=this.domNode.firstChild;this.left=n.childNodes[0];this.right=n.childNodes[1];this.knob=n.childNodes[2];_4.addClass(this.domNode,(this.value=="on")?"mblSwitchOn":"mblSwitchOff");this[this.value=="off"?"left":"right"].style.display="none";},postCreate:function(){this.connect(this.knob,"onclick","onClick");this.connect(this.knob,"touchstart","onTouchStart");this.connect(this.knob,"mousedown","onTouchStart");},_changeState:function(_173){this.inner.style.left="";_4.addClass(this.domNode,"mblSwitchAnimation");_4.removeClass(this.domNode,(_173=="on")?"mblSwitchOff":"mblSwitchOn");_4.addClass(this.domNode,(_173=="on")?"mblSwitchOn":"mblSwitchOff");var _174=this;setTimeout(function(){_174[_173=="off"?"left":"right"].style.display="none";_4.removeClass(_174.domNode,"mblSwitchAnimation");},300);},onClick:function(e){if(this._moved){return;}this.value=(this.value=="on")?"off":"on";this._changeState(this.value);this.onStateChanged(this.value);},onTouchStart:function(e){this._moved=false;this.innerStartX=this.inner.offsetLeft;if(e.targetTouches){this.touchStartX=e.targetTouches[0].clientX;this._conn1=_4.connect(this.inner,"touchmove",this,"onTouchMove");this._conn2=_4.connect(this.inner,"touchend",this,"onTouchEnd");}this.left.style.display="block";this.right.style.display="block";_4.stopEvent(e);},onTouchMove:function(e){e.preventDefault();var dx;if(e.targetTouches){if(e.targetTouches.length!=1){return false;}dx=e.targetTouches[0].clientX-this.touchStartX;}else{dx=e.clientX-this.touchStartX;}var pos=this.innerStartX+dx;var d=10;if(pos<=-(this._width-d)){pos=-this._width;}if(pos>=-d){pos=0;}this.inner.style.left=pos+"px";this._moved=true;},onTouchEnd:function(e){_4.disconnect(this._conn1);_4.disconnect(this._conn2);if(this.innerStartX==this.inner.offsetLeft){if(_4.isWebKit){var ev=_4.doc.createEvent("MouseEvents");ev.initEvent("click",true,true);this.knob.dispatchEvent(ev);}return;}var _175=(this.inner.offsetLeft<-(this._width/2))?"off":"on";this._changeState(_175);if(_175!=this.value){this.value=_175;this.onStateChanged(this.value);}},onStateChanged:function(_176){}});_4.declare("dojox.mobile.Button",_5._WidgetBase,{btnClass:"mblBlueButton",duration:1000,label:null,buildRendering:function(){this.domNode=this.containerNode=this.srcNodeRef||_4.doc.createElement("BUTTON");this.domNode.className="mblButton "+this.btnClass;if(this.label){this.domNode.innerHTML=this.label;}this.connect(this.domNode,"onclick","onClick");},onClick:function(e){var _177=this.domNode;var c="mblButtonSelected "+this.btnClass+"Selected";_4.addClass(_177,c);setTimeout(function(){_4.removeClass(_177,c);},this.duration);}});_4.declare("dojox.mobile.ToolBarButton",_6.mobile.AbstractItem,{selected:false,_defaultColor:"mblColorDefault",_selColor:"mblColorDefaultSel",buildRendering:function(){this.inheritParams();this.domNode=this.containerNode=this.srcNodeRef||_4.doc.createElement("div");_4.addClass(this.domNode,"mblToolbarButton mblArrowButtonText");var _178;if(this.selected){_178=this._selColor;}else{if(this.domNode.className.indexOf("mblColor")==-1){_178=this._defaultColor;}}_4.addClass(this.domNode,_178);if(this.label){this.domNode.innerHTML=this.label;}else{this.label=this.domNode.innerHTML;}if(this.icon&&this.icon!="none"){var img;if(this.iconPos){var _179=_4.create("DIV",null,this.domNode);img=_4.create("IMG",null,_179);img.style.position="absolute";var arr=this.iconPos.split(/[ ,]/);_4.style(_179,{position:"relative",width:arr[2]+"px",height:arr[3]+"px"});}else{img=_4.create("IMG",null,this.domNode);}img.src=this.icon;_6.mobile.setupIcon(img,this.iconPos);this.iconNode=img;}this.createDomButton(this.domNode);this.connect(this.domNode,"onclick","onClick");},select:function(_17a){_4.toggleClass(this.domNode,this._selColor,!_17a);this.selected=!_17a;},onClick:function(e){this.defaultClickAction();}});_4.declare("dojox.mobile.ProgressIndicator",null,{interval:100,colors:["#C0C0C0","#C0C0C0","#C0C0C0","#C0C0C0","#C0C0C0","#C0C0C0","#B8B9B8","#AEAFAE","#A4A5A4","#9A9A9A","#8E8E8E","#838383"],_bars:[],constructor:function(){this.domNode=_4.create("DIV");this.domNode.className="mblProgContainer";for(var i=0;i<12;i++){var div=_4.create("DIV");div.className="mblProg mblProg"+i;this.domNode.appendChild(div);this._bars.push(div);}},start:function(){var cntr=0;var _17b=this;this.timer=setInterval(function(){cntr--;cntr=cntr<0?11:cntr;var c=_17b.colors;for(var i=0;i<12;i++){var idx=(cntr+i)%12;_17b._bars[i].style.backgroundColor=c[idx];}},this.interval);},stop:function(){if(this.timer){clearInterval(this.timer);}this.timer=null;if(this.domNode.parentNode){this.domNode.parentNode.removeChild(this.domNode);}}});_6.mobile.ProgressIndicator._instance=null;_6.mobile.ProgressIndicator.getInstance=function(){if(!_6.mobile.ProgressIndicator._instance){_6.mobile.ProgressIndicator._instance=new _6.mobile.ProgressIndicator();}return _6.mobile.ProgressIndicator._instance;};_6.mobile.addClass=function(){var _17c=document.getElementsByTagName("link");for(var i=0,len=_17c.length;i<len;i++){if(_17c[i].href.match(/dojox\/mobile\/themes\/(\w+)\//)){_6.mobile.theme=RegExp.$1;_4.addClass(_4.body(),_6.mobile.theme);break;}}};_6.mobile.setupIcon=function(_17d,_17e){if(_17d&&_17e){var arr=_4.map(_17e.split(/[ ,]/),function(item){return item-0;});var t=arr[0];var r=arr[1]+arr[2];var b=arr[0]+arr[3];var l=arr[1];_17d.style.clip="rect("+t+"px "+r+"px "+b+"px "+l+"px)";_17d.style.top=_4.style(_17d,"top")-t+"px";_17d.style.left=_4.style(_17d.parentNode,"paddingLeft")-l+"px";}};_6.mobile.hideAddressBar=function(){_4.body().style.minHeight="1000px";setTimeout(function(){scrollTo(0,1);},100);setTimeout(function(){scrollTo(0,1);},400);setTimeout(function(){scrollTo(0,1);_4.body().style.minHeight=(_4.global.innerHeight||_4.doc.documentElement.clientHeight)+"px";},1000);};_6.mobile.openWindow=function(url,_17f){_4.global.open(url,_17f||"_blank");};_4._loaders.unshift(function(){var _180=_4.body().getElementsByTagName("*");var i,len,s;len=_180.length;for(i=0;i<len;i++){s=_180[i].getAttribute("dojoType");if(s){if(_180[i].parentNode.getAttribute("lazy")=="true"){_180[i].setAttribute("__dojoType",s);_180[i].removeAttribute("dojoType");}}}});_4.addOnLoad(function(){_6.mobile.addClass();if(_4.config["mblApplyPageStyles"]!==false){_4.addClass(_4.doc.documentElement,"mobile");}if(_4.config["mblHideAddressBar"]!==false){_6.mobile.hideAddressBar();if(_4.config["mblAlwaysHideAddressBar"]==true){if(_4.global.onorientationchange!==undefined){_4.connect(_4.global,"onorientationchange",_6.mobile.hideAddressBar);}else{_4.connect(_4.global,"onresize",_6.mobile.hideAddressBar);}}}var _181=_4.body().getElementsByTagName("*");var i,len=_181.length,s;for(i=0;i<len;i++){s=_181[i].getAttribute("__dojoType");if(s){_181[i].setAttribute("dojoType",s);_181[i].removeAttribute("__dojoType");}}if(_4.hash){var _182=function(root){var arr;arr=_5.findWidgets(root);var _183=arr;for(var i=0;i<_183.length;i++){arr=arr.concat(_182(_183[i].containerNode));}return arr;};_4.subscribe("/dojo/hashchange",null,function(_184){var view=_6.mobile.currentView;if(!view){return;}var _185=_6.mobile._params;if(!_185){var _186=_184?_184:_6.mobile._defaultView.id;var _187=_182(view.domNode);var dir=1,_188="slide";for(i=0;i<_187.length;i++){var w=_187[i];if("#"+_186==w.moveTo){_188=w.transition;dir=(w instanceof _6.mobile.Heading)?-1:1;break;}}_185=[_186,dir,_188];}view.performTransition.apply(view,_185);_6.mobile._params=null;});}_4.body().style.visibility="visible";});_5.getEnclosingWidget=function(node){while(node&&node.tagName!=="BODY"){if(node.getAttribute&&node.getAttribute("widgetId")){return _5.registry.byId(node.getAttribute("widgetId"));}node=node._parentNode||node.parentNode;}return null;};}if(!_4._hasResource["dojox.mobile"]){_4._hasResource["dojox.mobile"]=true;_4.provide("dojox.mobile");_4.experimental("dojox.mobile");}if(!_4._hasResource["dojox.mobile.parser"]){_4._hasResource["dojox.mobile.parser"]=true;_4.provide("dojox.mobile.parser");_4.provide("dojo.parser");_6.mobile.parser=new function(){this.instantiate=function(list,_189){var ws=[];if(list){var i,len;len=list.length;for(i=0;i<len;i++){var node=list[i];var cls=_4.getObject(_4.attr(node,"dojoType"));var _18a=cls.prototype;var _18b={};if(_189){for(var name in _189){_18b[name]=_189[name];}}for(var prop in _18a){var val=_4.attr(node,prop);if(!val){continue;}if(typeof _18a[prop]=="string"){_18b[prop]=val;}else{if(typeof _18a[prop]=="number"){_18b[prop]=val-0;}else{if(typeof _18a[prop]=="boolean"){_18b[prop]=(val!="false");}else{if(typeof _18a[prop]=="object"){_18b[prop]=eval("("+val+")");}}}}}_18b["class"]=node.className;_18b["style"]=node.style&&node.style.cssText;ws.push(new cls(_18b,node));}len=ws.length;for(i=0;i<len;i++){var w=ws[i];w.startup&&!w._started&&(!w.getParent||!w.getParent())&&w.startup();}}return ws;};this.parse=function(_18c,_18d){if(!_18c){_18c=_4.body();}else{if(!_18d&&_18c.rootNode){_18c=_18c.rootNode;}}var _18e=_18c.getElementsByTagName("*");var list=[];for(var i=0,len=_18e.length;i<len;i++){if(_18e[i].getAttribute("dojoType")){list.push(_18e[i]);}}return this.instantiate(list,_18d);};}();_4._loaders.unshift(function(){if(_4.config.parseOnLoad){_6.mobile.parser.parse();}});}if(!_4._hasResource["dojox.mobile.app._event"]){_4._hasResource["dojox.mobile.app._event"]=true;_4.provide("dojox.mobile.app._event");_4.experimental("dojox.mobile.app._event.js");_4.mixin(_6.mobile.app,{eventMap:{},connectFlick:function(_18f,_190,_191){var _192;var _193;var _194=false;var _195;var _196;var _197;var _198;var _199;var time;var _19a=_4.connect("onmousedown",_18f,function(_19b){_194=false;_192=_19b.targetTouches?_19b.targetTouches[0].clientX:_19b.clientX;_193=_19b.targetTouches?_19b.targetTouches[0].clientY:_19b.clientY;time=(new Date()).getTime();_197=_4.connect(_18f,"onmousemove",_19c);_198=_4.connect(_18f,"onmouseup",onUp);});var _19c=function(_19d){_4.stopEvent(_19d);_195=_19d.targetTouches?_19d.targetTouches[0].clientX:_19d.clientX;_196=_19d.targetTouches?_19d.targetTouches[0].clientY:_19d.clientY;if(Math.abs(Math.abs(_195)-Math.abs(_192))>15){_194=true;_199=(_195>_192)?"ltr":"rtl";}else{if(Math.abs(Math.abs(_196)-Math.abs(_193))>15){_194=true;_199=(_196>_193)?"ttb":"btt";}}};var onUp=function(_19e){_4.stopEvent(_19e);_197&&_4.disconnect(_197);_198&&_4.disconnect(_198);if(_194){var _19f={target:_18f,direction:_199,duration:(new Date()).getTime()-time};if(_190&&_191){_190[_191](_19f);}else{_191(_19f);}}};}});_6.mobile.app.isIPhone=(_4.isSafari&&(navigator.userAgent.indexOf("iPhone")>-1||navigator.userAgent.indexOf("iPod")>-1));_6.mobile.app.isWebOS=(navigator.userAgent.indexOf("webOS")>-1);_6.mobile.app.isAndroid=(navigator.userAgent.toLowerCase().indexOf("android")>-1);if(_6.mobile.app.isIPhone||_6.mobile.app.isAndroid){_6.mobile.app.eventMap={onmousedown:"ontouchstart",mousedown:"ontouchstart",onmouseup:"ontouchend",mouseup:"ontouchend",onmousemove:"ontouchmove",mousemove:"ontouchmove"};}_4._oldConnect=_4._connect;_4._connect=function(obj,_1a0,_1a1,_1a2,_1a3){_1a0=_6.mobile.app.eventMap[_1a0]||_1a0;if(_1a0=="flick"||_1a0=="onflick"){if(_4.global["Mojo"]){_1a0=Mojo.Event.flick;}else{return _6.mobile.app.connectFlick(obj,_1a1,_1a2);}}return _4._oldConnect(obj,_1a0,_1a1,_1a2,_1a3);};}if(!_4._hasResource["dojox.mobile.app._Widget"]){_4._hasResource["dojox.mobile.app._Widget"]=true;_4.provide("dojox.mobile.app._Widget");_4.experimental("dojox.mobile.app._Widget");_4.declare("dojox.mobile.app._Widget",_5._WidgetBase,{getScroll:function(){return {x:_4.global.scrollX,y:_4.global.scrollY};},connect:function(_1a4,_1a5,fn){if(_1a5.toLowerCase()=="dblclick"||_1a5.toLowerCase()=="ondblclick"){if(_4.global["Mojo"]){return this.connect(_1a4,Mojo.Event.tap,fn);}}return this.inherited(arguments);}});}if(!_4._hasResource["dojox.mobile.app.SceneController"]){_4._hasResource["dojox.mobile.app.SceneController"]=true;_4.provide("dojox.mobile.app.SceneController");_4.experimental("dojox.mobile.app.SceneController");(function(){var app=_6.mobile.app;var _1a6={};_4.declare("dojox.mobile.app.SceneController",_6.mobile.View,{stageController:null,keepScrollPos:false,init:function(_1a7,_1a8){this.sceneName=_1a7;this.params=_1a8;var _1a9=app.resolveTemplate(_1a7);this._deferredInit=new _4.Deferred();if(_1a6[_1a7]){this._setContents(_1a6[_1a7]);}else{_4.xhrGet({url:_1a9,handleAs:"text"}).addCallback(_4.hitch(this,this._setContents));}return this._deferredInit;},_setContents:function(_1aa){_1a6[this.sceneName]=_1aa;this.domNode.innerHTML="<div>"+_1aa+"</div>";var _1ab="";var _1ac=this.sceneName.split("-");for(var i=0;i<_1ac.length;i++){_1ab+=_1ac[i].substring(0,1).toUpperCase()+_1ac[i].substring(1);}_1ab+="Assistant";this.sceneAssistantName=_1ab;var _1ad=this;_6.mobile.app.loadResourcesForScene(this.sceneName,function(){var _1ae;if(typeof (_4.global[_1ab])!="undefined"){_1ad._initAssistant();}else{var _1af=app.resolveAssistant(_1ad.sceneName);_4.xhrGet({url:_1af,handleAs:"text"}).addCallback(function(text){try{_4.eval(text);}catch(e){throw e;}_1ad._initAssistant();});}});},_initAssistant:function(){var cls=_4.getObject(this.sceneAssistantName);if(!cls){throw Error("Unable to resolve scene assistant "+this.sceneAssistantName);}this.assistant=new cls(this.params);this.assistant.controller=this;this.assistant.domNode=this.domNode.firstChild;this.assistant.setup();this._deferredInit.callback();},query:function(_1b0,node){return _4.query(_1b0,node||this.domNode);},parse:function(node){var _1b1=this._widgets=_6.mobile.parser.parse(node||this.domNode,{controller:this});for(var i=0;i<_1b1.length;i++){_1b1[i].set("controller",this);}},getWindowSize:function(){return {w:_4.global.innerWidth,h:_4.global.innerHeight};},showAlertDialog:function(_1b2){var size=_4.marginBox(this.assistant.domNode);var _1b3=new _6.mobile.app.AlertDialog(_4.mixin(_1b2,{controller:this}));this.assistant.domNode.appendChild(_1b3.domNode);_1b3.show();},popupSubMenu:function(info){var _1b4=new _6.mobile.app.ListSelector({controller:this,destroyOnHide:true,onChoose:info.onChoose});this.assistant.domNode.appendChild(_1b4.domNode);_1b4.set("data",info.choices);_1b4.show(info.fromNode);}});})();}if(!_4._hasResource["dojox.mobile.app.StageController"]){_4._hasResource["dojox.mobile.app.StageController"]=true;_4.provide("dojox.mobile.app.StageController");_4.experimental("dojox.mobile.app.StageController");_4.declare("dojox.mobile.app.StageController",null,{scenes:null,effect:"fade",constructor:function(node){this.domNode=node;this.scenes=[];if(_4.config.mobileAnim){this.effect=_4.config.mobileAnim;}},getActiveSceneController:function(){return this.scenes[this.scenes.length-1];},pushScene:function(_1b5,_1b6){if(this._opInProgress){return;}this._opInProgress=true;var node=_4.create("div",{"class":"scene-wrapper",style:{visibility:"hidden"}},this.domNode);var _1b7=new _6.mobile.app.SceneController({},node);if(this.scenes.length>0){this.scenes[this.scenes.length-1].assistant.deactivate();}this.scenes.push(_1b7);var _1b8=this;_4.forEach(this.scenes,this.setZIndex);_1b7.stageController=this;_1b7.init(_1b5,_1b6).addCallback(function(){if(_1b8.scenes.length==1){_1b7.domNode.style.visibility="visible";_1b8.scenes[_1b8.scenes.length-1].assistant.activate(_1b6);_1b8._opInProgress=false;}else{_1b8.scenes[_1b8.scenes.length-2].performTransition(_1b8.scenes[_1b8.scenes.length-1].domNode,1,_1b8.effect,null,function(){_1b8.scenes[_1b8.scenes.length-1].assistant.activate(_1b6);_1b8._opInProgress=false;});}});},setZIndex:function(_1b9,idx){_4.style(_1b9.domNode,"zIndex",idx+1);},popScene:function(data){if(this._opInProgress){return;}var _1ba=this;if(this.scenes.length>1){this._opInProgress=true;this.scenes[_1ba.scenes.length-2].assistant.activate(data);this.scenes[_1ba.scenes.length-1].performTransition(_1ba.scenes[this.scenes.length-2].domNode,-1,this.effect,null,function(){_1ba._destroyScene(_1ba.scenes[_1ba.scenes.length-1]);_1ba.scenes.splice(_1ba.scenes.length-1,1);_1ba._opInProgress=false;});}else{}},popScenesTo:function(_1bb,data){if(this._opInProgress){return;}while(this.scenes.length>2&&this.scenes[this.scenes.length-2].sceneName!=_1bb){this._destroyScene(this.scenes[this.scenes.length-2]);this.scenes.splice(this.scenes.length-2,1);}this.popScene(data);},_destroyScene:function(_1bc){_1bc.assistant.deactivate();_1bc.assistant.destroy();_1bc.destroyRecursive();}});}if(!_4._hasResource["dojox.mobile.app.SceneAssistant"]){_4._hasResource["dojox.mobile.app.SceneAssistant"]=true;_4.provide("dojox.mobile.app.SceneAssistant");_4.experimental("dojox.mobile.app.SceneAssistant");_4.declare("dojox.mobile.app.SceneAssistant",null,{constructor:function(){},setup:function(){},activate:function(_1bd){},deactivate:function(){},destroy:function(){var _1be=_4.query("> [widgetId]",this.containerNode).map(_5.byNode);_4.forEach(_1be,function(_1bf){_1bf.destroyRecursive();});this.disconnect();},connect:function(obj,_1c0,_1c1){if(!this._connects){this._connects=[];}this._connects.push(_4.connect(obj,_1c0,_1c1));},disconnect:function(){_4.forEach(this._connects,_4.disconnect);this._connects=[];}});}if(!_4._hasResource["dojox.mobile.app.AlertDialog"]){_4._hasResource["dojox.mobile.app.AlertDialog"]=true;_4.provide("dojox.mobile.app.AlertDialog");_4.experimental("dojox.mobile.app.AlertDialog");_4.declare("dojox.mobile.app.AlertDialog",_5._WidgetBase,{title:"",text:"",controller:null,buttons:null,defaultButtonLabel:"OK",onChoose:null,constructor:function(){this.onClick=_4.hitch(this,this.onClick);this._handleSelect=_4.hitch(this,this._handleSelect);},buildRendering:function(){this.domNode=_4.create("div",{"class":"alertDialog"});var _1c2=_4.create("div",{"class":"alertDialogBody"},this.domNode);_4.create("div",{"class":"alertTitle",innerHTML:this.title||""},_1c2);_4.create("div",{"class":"alertText",innerHTML:this.text||""},_1c2);var _1c3=_4.create("div",{"class":"alertBtns"},_1c2);if(!this.buttons||this.buttons.length==0){this.buttons=[{label:this.defaultButtonLabel,value:"ok","class":"affirmative"}];}var _1c4=this;_4.forEach(this.buttons,function(_1c5){var btn=new _6.mobile.Button({btnClass:_1c5["class"]||"",label:_1c5.label});btn._dialogValue=_1c5.value;_4.place(btn.domNode,_1c3);_1c4.connect(btn,"onClick",_1c4._handleSelect);});var _1c6=this.controller.getWindowSize();this.mask=_4.create("div",{"class":"dialogUnderlayWrapper",innerHTML:"<div class=\"dialogUnderlay\"></div>",style:{width:_1c6.w+"px",height:_1c6.h+"px"}},this.controller.assistant.domNode);this.connect(this.mask,"onclick",function(){_1c4.onChoose&&_1c4.onChoose();_1c4.hide();});},postCreate:function(){this.subscribe("/dojox/mobile/app/goback",this._handleSelect);},_handleSelect:function(_1c7){var node;if(_1c7&&_1c7.target){node=_1c7.target;while(!_5.byNode(node)){node-node.parentNode;}}if(this.onChoose){this.onChoose(node?_5.byNode(node)._dialogValue:undefined);}this.hide();},show:function(){this._doTransition(1);},hide:function(){this._doTransition(-1);},_doTransition:function(dir){var anim;var h=_4.marginBox(this.domNode.firstChild).h;var _1c8=this.controller.getWindowSize().h;var high=_1c8-h;var low=_1c8;var _1c9=_4.fx.slideTo({node:this.domNode,duration:400,top:{start:dir<0?high:low,end:dir<0?low:high}});var _1ca=_4[dir<0?"fadeOut":"fadeIn"]({node:this.mask,duration:400});var anim=_4.fx.combine([_1c9,_1ca]);var _1cb=this;_4.connect(anim,"onEnd",this,function(){if(dir<0){_1cb.domNode.style.display="none";_4.destroy(_1cb.domNode);_4.destroy(_1cb.mask);}});anim.play();},destroy:function(){this.inherited(arguments);_4.destroy(this.mask);},onClick:function(){}});}if(!_4._hasResource["dojo.string"]){_4._hasResource["dojo.string"]=true;_4.provide("dojo.string");_4.getObject("string",true,_4);_4.string.rep=function(str,num){if(num<=0||!str){return "";}var buf=[];for(;;){if(num&1){buf.push(str);}if(!(num>>=1)){break;}str+=str;}return buf.join("");};_4.string.pad=function(text,size,ch,end){if(!ch){ch="0";}var out=String(text),pad=_4.string.rep(ch,Math.ceil((size-out.length)/ch.length));return end?out+pad:pad+out;};_4.string.substitute=function(_1cc,map,_1cd,_1ce){_1ce=_1ce||_4.global;_1cd=_1cd?_4.hitch(_1ce,_1cd):function(v){return v;};return _1cc.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g,function(_1cf,key,_1d0){var _1d1=_4.getObject(key,false,map);if(_1d0){_1d1=_4.getObject(_1d0,false,_1ce).call(_1ce,_1d1,key);}return _1cd(_1d1,key).toString();});};_4.string.trim=String.prototype.trim?_4.trim:function(str){str=str.replace(/^\s+/,"");for(var i=str.length-1;i>=0;i--){if(/\S/.test(str.charAt(i))){str=str.substring(0,i+1);break;}}return str;};}if(!_4._hasResource["dojox.mobile.app.List"]){_4._hasResource["dojox.mobile.app.List"]=true;_4.provide("dojox.mobile.app.List");_4.experimental("dojox.mobile.app.List");(function(){var _1d2={};_4.declare("dojox.mobile.app.List",_5._WidgetBase,{items:null,itemTemplate:"",emptyTemplate:"",dividerTemplate:"",dividerFunction:null,labelDelete:"Delete",labelCancel:"Cancel",controller:null,autoDelete:true,enableDelete:true,enableHold:true,formatters:null,_templateLoadCount:0,_mouseDownPos:null,baseClass:"list",constructor:function(){this._checkLoadComplete=_4.hitch(this,this._checkLoadComplete);this._replaceToken=_4.hitch(this,this._replaceToken);this._postDeleteAnim=_4.hitch(this,this._postDeleteAnim);},postCreate:function(){var _1d3=this;if(this.emptyTemplate){this._templateLoadCount++;}if(this.itemTemplate){this._templateLoadCount++;}if(this.dividerTemplate){this._templateLoadCount++;}this.connect(this.domNode,"onmousedown",function(_1d4){var _1d5=_1d4;if(_1d4.targetTouches&&_1d4.targetTouches.length>0){_1d5=_1d4.targetTouches[0];}var _1d6=_1d3._getRowNode(_1d4.target);if(_1d6){_1d3._setDataInfo(_1d6,_1d4);_1d3._selectRow(_1d6);_1d3._mouseDownPos={x:_1d5.pageX,y:_1d5.pageY};_1d3._dragThreshold=null;}});this.connect(this.domNode,"onmouseup",function(_1d7){if(_1d7.targetTouches&&_1d7.targetTouches.length>0){_1d7=_1d7.targetTouches[0];}var _1d8=_1d3._getRowNode(_1d7.target);if(_1d8){_1d3._setDataInfo(_1d8,_1d7);if(_1d3._selectedRow){_1d3.onSelect(_1d8._data,_1d8._idx,_1d8);}this._deselectRow();}});if(this.enableDelete){this.connect(this.domNode,"mousemove",function(_1d9){_4.stopEvent(_1d9);if(!_1d3._selectedRow){return;}var _1da=_1d3._getRowNode(_1d9.target);if(_1d3.enableDelete&&_1da&&!_1d3._deleting){_1d3.handleDrag(_1d9);}});}this.connect(this.domNode,"onclick",function(_1db){if(_1db.touches&&_1db.touches.length>0){_1db=_1db.touches[0];}var _1dc=_1d3._getRowNode(_1db.target,true);if(_1dc){_1d3._setDataInfo(_1dc,_1db);}});this.connect(this.domNode,"mouseout",function(_1dd){if(_1dd.touches&&_1dd.touches.length>0){_1dd=_1dd.touches[0];}if(_1dd.target==_1d3._selectedRow){_1d3._deselectRow();}});if(!this.itemTemplate){throw Error("An item template must be provided to "+this.declaredClass);}this._loadTemplate(this.itemTemplate,"itemTemplate",this._checkLoadComplete);if(this.emptyTemplate){this._loadTemplate(this.emptyTemplate,"emptyTemplate",this._checkLoadComplete);}if(this.dividerTemplate){this._loadTemplate(this.dividerTemplate,"dividerTemplate",this._checkLoadComplete);}},handleDrag:function(_1de){var _1df=_1de;if(_1de.targetTouches&&_1de.targetTouches.length>0){_1df=_1de.targetTouches[0];}var diff=_1df.pageX-this._mouseDownPos.x;var _1e0=Math.abs(diff);if(_1e0>10&&!this._dragThreshold){this._dragThreshold=_4.marginBox(this._selectedRow).w*0.6;if(!this.autoDelete){this.createDeleteButtons(this._selectedRow);}}this._selectedRow.style.left=(_1e0>10?diff:0)+"px";if(this._dragThreshold&&this._dragThreshold<_1e0){this.preDelete(diff);}},handleDragCancel:function(){if(this._deleting){return;}_4.removeClass(this._selectedRow,"hold");this._selectedRow.style.left=0;this._mouseDownPos=null;this._dragThreshold=null;this._deleteBtns&&_4.style(this._deleteBtns,"display","none");},preDelete:function(_1e1){var self=this;this._deleting=true;_4.animateProperty({node:this._selectedRow,duration:400,properties:{left:{end:_1e1+((_1e1>0?1:-1)*this._dragThreshold*0.8)}},onEnd:_4.hitch(this,function(){if(this.autoDelete){this.deleteRow(this._selectedRow);}})}).play();},deleteRow:function(row){_4.style(row,{visibility:"hidden",minHeight:"0px"});_4.removeClass(row,"hold");this._deleteAnimConn=this.connect(row,"webkitAnimationEnd",this._postDeleteAnim);_4.addClass(row,"collapsed");},_postDeleteAnim:function(_1e2){if(this._deleteAnimConn){this.disconnect(this._deleteAnimConn);this._deleteAnimConn=null;}var row=this._selectedRow;var _1e3=row.nextSibling;var _1e4=row.previousSibling;if(_1e4&&_1e4._isDivider){if(!_1e3||_1e3._isDivider){_1e4.parentNode.removeChild(_1e4);}}row.parentNode.removeChild(row);this.onDelete(row._data,row._idx,this.items);while(_1e3){if(_1e3._idx){_1e3._idx--;}_1e3=_1e3.nextSibling;}_4.destroy(row);_4.query("> *:not(.buttons)",this.domNode).forEach(this.applyClass);this._deleting=false;this._deselectRow();},createDeleteButtons:function(_1e5){var mb=_4.marginBox(_1e5);var pos=_4._abs(_1e5,true);if(!this._deleteBtns){this._deleteBtns=_4.create("div",{"class":"buttons"},this.domNode);this.buttons=[];this.buttons.push(new _6.mobile.Button({btnClass:"mblRedButton",label:this.labelDelete}));this.buttons.push(new _6.mobile.Button({btnClass:"mblBlueButton",label:this.labelCancel}));_4.place(this.buttons[0].domNode,this._deleteBtns);_4.place(this.buttons[1].domNode,this._deleteBtns);_4.addClass(this.buttons[0].domNode,"deleteBtn");_4.addClass(this.buttons[1].domNode,"cancelBtn");this._handleButtonClick=_4.hitch(this._handleButtonClick);this.connect(this._deleteBtns,"onclick",this._handleButtonClick);}_4.removeClass(this._deleteBtns,"fade out fast");_4.style(this._deleteBtns,{display:"",width:mb.w+"px",height:mb.h+"px",top:(_1e5.offsetTop)+"px",left:"0px"});},onDelete:function(data,_1e6,_1e7){_1e7.splice(_1e6,1);if(_1e7.length<1){this.render();}},cancelDelete:function(){this._deleting=false;this.handleDragCancel();},_handleButtonClick:function(_1e8){if(_1e8.touches&&_1e8.touches.length>0){_1e8=_1e8.touches[0];}var node=_1e8.target;if(_4.hasClass(node,"deleteBtn")){this.deleteRow(this._selectedRow);}else{if(_4.hasClass(node,"cancelBtn")){this.cancelDelete();}else{return;}}_4.addClass(this._deleteBtns,"fade out");},applyClass:function(node,idx,_1e9){_4.removeClass(node,"first last");if(idx==0){_4.addClass(node,"first");}if(idx==_1e9.length-1){_4.addClass(node,"last");}},_setDataInfo:function(_1ea,_1eb){_1eb.item=_1ea._data;_1eb.index=_1ea._idx;},onSelect:function(data,_1ec,_1ed){},_selectRow:function(row){if(this._deleting&&this._selectedRow&&row!=this._selectedRow){this.cancelDelete();}if(!_4.hasClass(row,"row")){return;}if(this.enableHold||this.enableDelete){_4.addClass(row,"hold");}this._selectedRow=row;},_deselectRow:function(){if(!this._selectedRow||this._deleting){return;}this.handleDragCancel();_4.removeClass(this._selectedRow,"hold");this._selectedRow=null;},_getRowNode:function(_1ee,_1ef){while(_1ee&&!_1ee._data&&_1ee!=this.domNode){if(!_1ef&&_4.hasClass(_1ee,"noclick")){return null;}_1ee=_1ee.parentNode;}return _1ee==this.domNode?null:_1ee;},applyTemplate:function(_1f0,data){return _4._toDom(_4.string.substitute(_1f0,data,this._replaceToken,this.formatters||this));},render:function(){_4.query("> *:not(.buttons)",this.domNode).forEach(_4.destroy);if(this.items.length<1&&this.emptyTemplate){_4.place(_4._toDom(this.emptyTemplate),this.domNode,"first");}else{this.domNode.appendChild(this._renderRange(0,this.items.length));}if(_4.hasClass(this.domNode.parentNode,"mblRoundRect")){_4.addClass(this.domNode.parentNode,"mblRoundRectList");}var divs=_4.query("> .row",this.domNode);if(divs.length>0){_4.addClass(divs[0],"first");_4.addClass(divs[divs.length-1],"last");}},_renderRange:function(_1f1,_1f2){var rows=[];var row,i;var frag=document.createDocumentFragment();_1f1=Math.max(0,_1f1);_1f2=Math.min(_1f2,this.items.length);for(i=_1f1;i<_1f2;i++){row=this.applyTemplate(this.itemTemplate,this.items[i]);_4.addClass(row,"row");row._data=this.items[i];row._idx=i;rows.push(row);}if(!this.dividerFunction||!this.dividerTemplate){for(i=_1f1;i<_1f2;i++){rows[i]._data=this.items[i];rows[i]._idx=i;frag.appendChild(rows[i]);}}else{var _1f3=null;var _1f4;var _1f5;for(i=_1f1;i<_1f2;i++){rows[i]._data=this.items[i];rows[i]._idx=i;_1f4=this.dividerFunction(this.items[i]);if(_1f4&&_1f4!=_1f3){_1f5=this.applyTemplate(this.dividerTemplate,{label:_1f4,item:this.items[i]});_1f5._isDivider=true;frag.appendChild(_1f5);_1f3=_1f4;}frag.appendChild(rows[i]);}}return frag;},_replaceToken:function(_1f6,key){if(key.charAt(0)=="!"){_1f6=_4.getObject(key.substr(1),false,_this);}if(typeof _1f6=="undefined"){return "";}if(_1f6==null){return "";}return key.charAt(0)=="!"?_1f6:_1f6.toString().replace(/"/g,"&quot;");},_checkLoadComplete:function(){this._templateLoadCount--;if(this._templateLoadCount<1&&this.get("items")){this.render();}},_loadTemplate:function(url,_1f7,_1f8){if(!url){_1f8();return;}if(_1d2[url]){this.set(_1f7,_1d2[url]);_1f8();}else{var _1f9=this;_4.xhrGet({url:url,sync:false,handleAs:"text",load:function(text){_1d2[url]=_4.trim(text);_1f9.set(_1f7,_1d2[url]);_1f8();}});}},_setFormattersAttr:function(_1fa){this.formatters=_1fa;},_setItemsAttr:function(_1fb){this.items=_1fb||[];if(this._templateLoadCount<1&&_1fb){this.render();}},destroy:function(){if(this.buttons){_4.forEach(this.buttons,function(_1fc){_1fc.destroy();});this.buttons=null;}this.inherited(arguments);}});})();}if(!_4._hasResource["dojo.fx.Toggler"]){_4._hasResource["dojo.fx.Toggler"]=true;_4.provide("dojo.fx.Toggler");_4.declare("dojo.fx.Toggler",null,{node:null,showFunc:_4.fadeIn,hideFunc:_4.fadeOut,showDuration:200,hideDuration:200,constructor:function(args){var _1fd=this;_4.mixin(_1fd,args);_1fd.node=args.node;_1fd._showArgs=_4.mixin({},args);_1fd._showArgs.node=_1fd.node;_1fd._showArgs.duration=_1fd.showDuration;_1fd.showAnim=_1fd.showFunc(_1fd._showArgs);_1fd._hideArgs=_4.mixin({},args);_1fd._hideArgs.node=_1fd.node;_1fd._hideArgs.duration=_1fd.hideDuration;_1fd.hideAnim=_1fd.hideFunc(_1fd._hideArgs);_4.connect(_1fd.showAnim,"beforeBegin",_4.hitch(_1fd.hideAnim,"stop",true));_4.connect(_1fd.hideAnim,"beforeBegin",_4.hitch(_1fd.showAnim,"stop",true));},show:function(_1fe){return this.showAnim.play(_1fe||0);},hide:function(_1ff){return this.hideAnim.play(_1ff||0);}});}if(!_4._hasResource["dojo.fx"]){_4._hasResource["dojo.fx"]=true;_4.provide("dojo.fx");(function(){var d=_4,_200={_fire:function(evt,args){if(this[evt]){this[evt].apply(this,args||[]);}return this;}};var _201=function(_202){this._index=-1;this._animations=_202||[];this._current=this._onAnimateCtx=this._onEndCtx=null;this.duration=0;d.forEach(this._animations,function(a){this.duration+=a.duration;if(a.delay){this.duration+=a.delay;}},this);};d.extend(_201,{_onAnimate:function(){this._fire("onAnimate",arguments);},_onEnd:function(){d.disconnect(this._onAnimateCtx);d.disconnect(this._onEndCtx);this._onAnimateCtx=this._onEndCtx=null;if(this._index+1==this._animations.length){this._fire("onEnd");}else{this._current=this._animations[++this._index];this._onAnimateCtx=d.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd");this._current.play(0,true);}},play:function(_203,_204){if(!this._current){this._current=this._animations[this._index=0];}if(!_204&&this._current.status()=="playing"){return this;}var _205=d.connect(this._current,"beforeBegin",this,function(){this._fire("beforeBegin");}),_206=d.connect(this._current,"onBegin",this,function(arg){this._fire("onBegin",arguments);}),_207=d.connect(this._current,"onPlay",this,function(arg){this._fire("onPlay",arguments);d.disconnect(_205);d.disconnect(_206);d.disconnect(_207);});if(this._onAnimateCtx){d.disconnect(this._onAnimateCtx);}this._onAnimateCtx=d.connect(this._current,"onAnimate",this,"_onAnimate");if(this._onEndCtx){d.disconnect(this._onEndCtx);}this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd");this._current.play.apply(this._current,arguments);return this;},pause:function(){if(this._current){var e=d.connect(this._current,"onPause",this,function(arg){this._fire("onPause",arguments);d.disconnect(e);});this._current.pause();}return this;},gotoPercent:function(_208,_209){this.pause();var _20a=this.duration*_208;this._current=null;d.some(this._animations,function(a){if(a.duration<=_20a){this._current=a;return true;}_20a-=a.duration;return false;});if(this._current){this._current.gotoPercent(_20a/this._current.duration,_209);}return this;},stop:function(_20b){if(this._current){if(_20b){for(;this._index+1<this._animations.length;++this._index){this._animations[this._index].stop(true);}this._current=this._animations[this._index];}var e=d.connect(this._current,"onStop",this,function(arg){this._fire("onStop",arguments);d.disconnect(e);});this._current.stop();}return this;},status:function(){return this._current?this._current.status():"stopped";},destroy:function(){if(this._onAnimateCtx){d.disconnect(this._onAnimateCtx);}if(this._onEndCtx){d.disconnect(this._onEndCtx);}}});d.extend(_201,_200);_4.fx.chain=function(_20c){return new _201(_20c);};var _20d=function(_20e){this._animations=_20e||[];this._connects=[];this._finished=0;this.duration=0;d.forEach(_20e,function(a){var _20f=a.duration;if(a.delay){_20f+=a.delay;}if(this.duration<_20f){this.duration=_20f;}this._connects.push(d.connect(a,"onEnd",this,"_onEnd"));},this);this._pseudoAnimation=new d.Animation({curve:[0,1],duration:this.duration});var self=this;d.forEach(["beforeBegin","onBegin","onPlay","onAnimate","onPause","onStop","onEnd"],function(evt){self._connects.push(d.connect(self._pseudoAnimation,evt,function(){self._fire(evt,arguments);}));});};d.extend(_20d,{_doAction:function(_210,args){d.forEach(this._animations,function(a){a[_210].apply(a,args);});return this;},_onEnd:function(){if(++this._finished>this._animations.length){this._fire("onEnd");}},_call:function(_211,args){var t=this._pseudoAnimation;t[_211].apply(t,args);},play:function(_212,_213){this._finished=0;this._doAction("play",arguments);this._call("play",arguments);return this;},pause:function(){this._doAction("pause",arguments);this._call("pause",arguments);return this;},gotoPercent:function(_214,_215){var ms=this.duration*_214;d.forEach(this._animations,function(a){a.gotoPercent(a.duration<ms?1:(ms/a.duration),_215);});this._call("gotoPercent",arguments);return this;},stop:function(_216){this._doAction("stop",arguments);this._call("stop",arguments);return this;},status:function(){return this._pseudoAnimation.status();},destroy:function(){d.forEach(this._connects,_4.disconnect);}});d.extend(_20d,_200);_4.fx.combine=function(_217){return new _20d(_217);};_4.fx.wipeIn=function(args){var node=args.node=d.byId(args.node),s=node.style,o;var anim=d.animateProperty(d.mixin({properties:{height:{start:function(){o=s.overflow;s.overflow="hidden";if(s.visibility=="hidden"||s.display=="none"){s.height="1px";s.display="";s.visibility="";return 1;}else{var _218=d.style(node,"height");return Math.max(_218,1);}},end:function(){return node.scrollHeight;}}}},args));d.connect(anim,"onEnd",function(){s.height="auto";s.overflow=o;});return anim;};_4.fx.wipeOut=function(args){var node=args.node=d.byId(args.node),s=node.style,o;var anim=d.animateProperty(d.mixin({properties:{height:{end:1}}},args));d.connect(anim,"beforeBegin",function(){o=s.overflow;s.overflow="hidden";s.display="";});d.connect(anim,"onEnd",function(){s.overflow=o;s.height="auto";s.display="none";});return anim;};_4.fx.slideTo=function(args){var node=args.node=d.byId(args.node),top=null,left=null;var init=(function(n){return function(){var cs=d.getComputedStyle(n);var pos=cs.position;top=(pos=="absolute"?n.offsetTop:parseInt(cs.top)||0);left=(pos=="absolute"?n.offsetLeft:parseInt(cs.left)||0);if(pos!="absolute"&&pos!="relative"){var ret=d.position(n,true);top=ret.y;left=ret.x;n.style.position="absolute";n.style.top=top+"px";n.style.left=left+"px";}};})(node);init();var anim=d.animateProperty(d.mixin({properties:{top:args.top||0,left:args.left||0}},args));d.connect(anim,"beforeBegin",anim,init);return anim;};})();}if(!_4._hasResource["dojox.mobile.app.ListSelector"]){_4._hasResource["dojox.mobile.app.ListSelector"]=true;_4.provide("dojox.mobile.app.ListSelector");_4.experimental("dojox.mobile.app.ListSelector");_4.declare("dojox.mobile.app.ListSelector",_6.mobile.app._Widget,{data:null,controller:null,onChoose:null,destroyOnHide:false,_setDataAttr:function(data){this.data=data;if(this.data){this.render();}},postCreate:function(){_4.addClass(this.domNode,"listSelector");var _219=this;this.connect(this.domNode,"onclick",function(_21a){if(!_4.hasClass(_21a.target,"listSelectorRow")){return;}if(_219.onChoose){_219.onChoose(_219.data[_21a.target._idx].value);}_219.hide();});this.connect(this.domNode,"onmousedown",function(_21b){if(!_4.hasClass(_21b.target,"listSelectorRow")){return;}_4.addClass(_21b.target,"listSelectorRow-selected");});this.connect(this.domNode,"onmouseup",function(_21c){if(!_4.hasClass(_21c.target,"listSelectorRow")){return;}_4.removeClass(_21c.target,"listSelectorRow-selected");});this.connect(this.domNode,"onmouseout",function(_21d){if(!_4.hasClass(_21d.target,"listSelectorRow")){return;}_4.removeClass(_21d.target,"listSelectorRow-selected");});var _21e=this.controller.getWindowSize();this.mask=_4.create("div",{"class":"dialogUnderlayWrapper",innerHTML:"<div class=\"dialogUnderlay\"></div>"},this.controller.assistant.domNode);this.connect(this.mask,"onclick",function(){_219.onChoose&&_219.onChoose();_219.hide();});},show:function(_21f){var _220;var _221=this.controller.getWindowSize();var _222;if(_21f){_222=_4._abs(_21f);_220=_222;}else{_220.x=_221.w/2;_220.y=200;}_4.style(this.domNode,{opacity:0,display:"",width:Math.floor(_221.w*0.8)+"px"});var _223=0;_4.query(">",this.domNode).forEach(function(node){_4.style(node,{"float":"left"});_223=Math.max(_223,_4.marginBox(node).w);_4.style(node,{"float":"none"});});_223=Math.min(_223,Math.round(_221.w*0.8))+_4.style(this.domNode,"paddingLeft")+_4.style(this.domNode,"paddingRight")+1;_4.style(this.domNode,"width",_223+"px");var _224=_4.marginBox(this.domNode).h;var _225=this;var _226=_222?Math.max(30,_222.y-_224-10):this.getScroll().y+30;var _227=_4.animateProperty({node:this.domNode,duration:400,properties:{width:{start:1,end:_223},height:{start:1,end:_224},top:{start:_220.y,end:_226},left:{start:_220.x,end:(_221.w/2-_223/2)},opacity:{start:0,end:1},fontSize:{start:1}},onEnd:function(){_4.style(_225.domNode,"width","inherit");}});var _228=_4.fadeIn({node:this.mask,duration:400});_4.fx.combine([_227,_228]).play();},hide:function(){var _229=this;var _22a=_4.animateProperty({node:this.domNode,duration:500,properties:{width:{end:1},height:{end:1},opacity:{end:0},fontSize:{end:1}},onEnd:function(){if(_229.get("destroyOnHide")){_229.destroy();}}});var _22b=_4.fadeOut({node:this.mask,duration:400});_4.fx.combine([_22a,_22b]).play();},render:function(){_4.empty(this.domNode);_4.style(this.domNode,"opacity",0);var row;for(var i=0;i<this.data.length;i++){row=_4.create("div",{"class":"listSelectorRow "+(this.data[i].className||""),innerHTML:this.data[i].label},this.domNode);row._idx=i;if(i==0){_4.addClass(row,"first");}if(i==this.data.length-1){_4.addClass(row,"last");}}},destroy:function(){this.inherited(arguments);_4.destroy(this.mask);}});}if(!_4._hasResource["dojox.mobile.app._FormWidget"]){_4._hasResource["dojox.mobile.app._FormWidget"]=true;_4.provide("dojox.mobile.app._FormWidget");_4.experimental("dojox.mobile.app._FormWidget");_4.declare("dojox.mobile.app._FormWidget",_5._WidgetBase,{name:"",alt:"",value:"",type:"text",disabled:false,intermediateChanges:false,scrollOnFocus:false,attributeMap:_4.delegate(_5._WidgetBase.prototype.attributeMap,{value:"focusNode",id:"focusNode",alt:"focusNode",title:"focusNode"}),postMixInProperties:function(){this.nameAttrSetting=this.name?("name=\""+this.name.replace(/'/g,"&quot;")+"\""):"";this.inherited(arguments);},postCreate:function(){this.inherited(arguments);this.connect(this.domNode,"onmousedown","_onMouseDown");},_setDisabledAttr:function(_22c){this.disabled=_22c;_4.attr(this.focusNode,"disabled",_22c);if(this.valueNode){_4.attr(this.valueNode,"disabled",_22c);}},_onFocus:function(e){if(this.scrollOnFocus){_4.window.scrollIntoView(this.domNode);}this.inherited(arguments);},isFocusable:function(){return !this.disabled&&!this.readOnly&&this.focusNode&&(_4.style(this.domNode,"display")!="none");},focus:function(){this.focusNode.focus();},compare:function(val1,val2){if(typeof val1=="number"&&typeof val2=="number"){return (isNaN(val1)&&isNaN(val2))?0:val1-val2;}else{if(val1>val2){return 1;}else{if(val1<val2){return -1;}else{return 0;}}}},onChange:function(_22d){},_onChangeActive:false,_handleOnChange:function(_22e,_22f){this._lastValue=_22e;if(this._lastValueReported==undefined&&(_22f===null||!this._onChangeActive)){this._resetValue=this._lastValueReported=_22e;}if((this.intermediateChanges||_22f||_22f===undefined)&&((typeof _22e!=typeof this._lastValueReported)||this.compare(_22e,this._lastValueReported)!=0)){this._lastValueReported=_22e;if(this._onChangeActive){if(this._onChangeHandle){clearTimeout(this._onChangeHandle);}this._onChangeHandle=setTimeout(_4.hitch(this,function(){this._onChangeHandle=null;this.onChange(_22e);}),0);}}},create:function(){this.inherited(arguments);this._onChangeActive=true;},destroy:function(){if(this._onChangeHandle){clearTimeout(this._onChangeHandle);this.onChange(this._lastValueReported);}this.inherited(arguments);},_onMouseDown:function(e){if(this.isFocusable()){var _230=this.connect(_4.body(),"onmouseup",function(){if(this.isFocusable()){this.focus();}this.disconnect(_230);});}},selectInputText:function(_231,_232,stop){var _233=_4.global;var _234=_4.doc;_231=_4.byId(_231);if(isNaN(_232)){_232=0;}if(isNaN(stop)){stop=_231.value?_231.value.length:0;}_5.focus(_231);if(_233["getSelection"]&&_231.setSelectionRange){_231.setSelectionRange(_232,stop);}}});_4.declare("dojox.mobile.app._FormValueWidget",_6.mobile.app._FormWidget,{readOnly:false,attributeMap:_4.delegate(_6.mobile.app._FormWidget.prototype.attributeMap,{value:"",readOnly:"focusNode"}),_setReadOnlyAttr:function(_235){this.readOnly=_235;_4.attr(this.focusNode,"readOnly",_235);},postCreate:function(){this.inherited(arguments);if(this._resetValue===undefined){this._resetValue=this.value;}},_setValueAttr:function(_236,_237){this.value=_236;this._handleOnChange(_236,_237);},_getValueAttr:function(){return this._lastValue;},undo:function(){this._setValueAttr(this._lastValueReported,false);},reset:function(){this._hasBeenBlurred=false;this._setValueAttr(this._resetValue,true);}});}if(!_4._hasResource["dojox.mobile.app.TextBox"]){_4._hasResource["dojox.mobile.app.TextBox"]=true;_4.provide("dojox.mobile.app.TextBox");_4.experimental("dojox.mobile.app.TextBox");_4.declare("dojox.mobile.app.TextBox",_6.mobile.app._FormValueWidget,{trim:false,uppercase:false,lowercase:false,propercase:false,maxLength:"",selectOnClick:false,placeHolder:"",baseClass:"mblTextBox",attributeMap:_4.delegate(_6.mobile.app._FormValueWidget.prototype.attributeMap,{maxLength:"focusNode"}),buildRendering:function(){var node=this.srcNodeRef;if(!node||node.tagName!="INPUT"){node=_4.create("input",{});}_4.attr(node,{type:"text",value:_4.attr(node,"value")||"",placeholder:this.placeHolder||null});this.domNode=this.textbox=this.focusNode=node;},_setPlaceHolderAttr:function(v){this.placeHolder=v;if(this.textbox){_4.attr(this.textbox,"placeholder",v);}},_getValueAttr:function(){return this.parse(this.get("displayedValue"),this.constraints);},_setValueAttr:function(_238,_239,_23a){var _23b;if(_238!==undefined){_23b=this.filter(_238);if(typeof _23a!="string"){if(_23b!==null&&((typeof _23b!="number")||!isNaN(_23b))){_23a=this.filter(this.format(_23b,this.constraints));}else{_23a="";}}}if(_23a!=null&&_23a!=undefined&&((typeof _23a)!="number"||!isNaN(_23a))&&this.textbox.value!=_23a){this.textbox.value=_23a;}this.inherited(arguments,[_23b,_239]);},displayedValue:"",_getDisplayedValueAttr:function(){return this.filter(this.textbox.value);},_setDisplayedValueAttr:function(_23c){if(_23c===null||_23c===undefined){_23c="";}else{if(typeof _23c!="string"){_23c=String(_23c);}}this.textbox.value=_23c;this._setValueAttr(this.get("value"),undefined,_23c);},format:function(_23d,_23e){return ((_23d==null||_23d==undefined)?"":(_23d.toString?_23d.toString():_23d));},parse:function(_23f,_240){return _23f;},_refreshState:function(){},_onInput:function(e){if(e&&e.type&&/key/i.test(e.type)&&e.keyCode){switch(e.keyCode){case _4.keys.SHIFT:case _4.keys.ALT:case _4.keys.CTRL:case _4.keys.TAB:return;}}if(this.intermediateChanges){var _241=this;setTimeout(function(){_241._handleOnChange(_241.get("value"),false);},0);}this._refreshState();},postCreate:function(){this.textbox.setAttribute("value",this.textbox.value);this.inherited(arguments);if(_4.isMoz||_4.isOpera){this.connect(this.textbox,"oninput",this._onInput);}else{this.connect(this.textbox,"onkeydown",this._onInput);this.connect(this.textbox,"onkeyup",this._onInput);this.connect(this.textbox,"onpaste",this._onInput);this.connect(this.textbox,"oncut",this._onInput);}},_blankValue:"",filter:function(val){if(val===null){return this._blankValue;}if(typeof val!="string"){return val;}if(this.trim){val=_4.trim(val);}if(this.uppercase){val=val.toUpperCase();}if(this.lowercase){val=val.toLowerCase();}if(this.propercase){val=val.replace(/[^\s]+/g,function(word){return word.substring(0,1).toUpperCase()+word.substring(1);});}return val;},_setBlurValue:function(){this._setValueAttr(this.get("value"),true);},_onBlur:function(e){if(this.disabled){return;}this._setBlurValue();this.inherited(arguments);if(this._selectOnClickHandle){this.disconnect(this._selectOnClickHandle);}if(this.selectOnClick&&_4.isMoz){this.textbox.selectionStart=this.textbox.selectionEnd=undefined;}},_onFocus:function(by){if(this.disabled||this.readOnly){return;}if(this.selectOnClick&&by=="mouse"){this._selectOnClickHandle=this.connect(this.domNode,"onmouseup",function(){this.disconnect(this._selectOnClickHandle);var _242;_242=this.textbox.selectionStart==this.textbox.selectionEnd;if(_242){this.selectInputText(this.textbox);}});}this._refreshState();this.inherited(arguments);},reset:function(){this.textbox.value="";this.inherited(arguments);}});}if(!_4._hasResource["dojo.fx.easing"]){_4._hasResource["dojo.fx.easing"]=true;_4.provide("dojo.fx.easing");_4.getObject("fx.easing",true,_4);_4.fx.easing={linear:function(n){return n;},quadIn:function(n){return Math.pow(n,2);},quadOut:function(n){return n*(n-2)*-1;},quadInOut:function(n){n=n*2;if(n<1){return Math.pow(n,2)/2;}return -1*((--n)*(n-2)-1)/2;},cubicIn:function(n){return Math.pow(n,3);},cubicOut:function(n){return Math.pow(n-1,3)+1;},cubicInOut:function(n){n=n*2;if(n<1){return Math.pow(n,3)/2;}n-=2;return (Math.pow(n,3)+2)/2;},quartIn:function(n){return Math.pow(n,4);},quartOut:function(n){return -1*(Math.pow(n-1,4)-1);},quartInOut:function(n){n=n*2;if(n<1){return Math.pow(n,4)/2;}n-=2;return -1/2*(Math.pow(n,4)-2);},quintIn:function(n){return Math.pow(n,5);},quintOut:function(n){return Math.pow(n-1,5)+1;},quintInOut:function(n){n=n*2;if(n<1){return Math.pow(n,5)/2;}n-=2;return (Math.pow(n,5)+2)/2;},sineIn:function(n){return -1*Math.cos(n*(Math.PI/2))+1;},sineOut:function(n){return Math.sin(n*(Math.PI/2));},sineInOut:function(n){return -1*(Math.cos(Math.PI*n)-1)/2;},expoIn:function(n){return (n==0)?0:Math.pow(2,10*(n-1));},expoOut:function(n){return (n==1)?1:(-1*Math.pow(2,-10*n)+1);},expoInOut:function(n){if(n==0){return 0;}if(n==1){return 1;}n=n*2;if(n<1){return Math.pow(2,10*(n-1))/2;}--n;return (-1*Math.pow(2,-10*n)+2)/2;},circIn:function(n){return -1*(Math.sqrt(1-Math.pow(n,2))-1);},circOut:function(n){n=n-1;return Math.sqrt(1-Math.pow(n,2));},circInOut:function(n){n=n*2;if(n<1){return -1/2*(Math.sqrt(1-Math.pow(n,2))-1);}n-=2;return 1/2*(Math.sqrt(1-Math.pow(n,2))+1);},backIn:function(n){var s=1.70158;return Math.pow(n,2)*((s+1)*n-s);},backOut:function(n){n=n-1;var s=1.70158;return Math.pow(n,2)*((s+1)*n+s)+1;},backInOut:function(n){var s=1.70158*1.525;n=n*2;if(n<1){return (Math.pow(n,2)*((s+1)*n-s))/2;}n-=2;return (Math.pow(n,2)*((s+1)*n+s)+2)/2;},elasticIn:function(n){if(n==0||n==1){return n;}var p=0.3;var s=p/4;n=n-1;return -1*Math.pow(2,10*n)*Math.sin((n-s)*(2*Math.PI)/p);},elasticOut:function(n){if(n==0||n==1){return n;}var p=0.3;var s=p/4;return Math.pow(2,-10*n)*Math.sin((n-s)*(2*Math.PI)/p)+1;},elasticInOut:function(n){if(n==0){return 0;}n=n*2;if(n==2){return 1;}var p=0.3*1.5;var s=p/4;if(n<1){n-=1;return -0.5*(Math.pow(2,10*n)*Math.sin((n-s)*(2*Math.PI)/p));}n-=1;return 0.5*(Math.pow(2,-10*n)*Math.sin((n-s)*(2*Math.PI)/p))+1;},bounceIn:function(n){return (1-_4.fx.easing.bounceOut(1-n));},bounceOut:function(n){var s=7.5625;var p=2.75;var l;if(n<(1/p)){l=s*Math.pow(n,2);}else{if(n<(2/p)){n-=(1.5/p);l=s*Math.pow(n,2)+0.75;}else{if(n<(2.5/p)){n-=(2.25/p);l=s*Math.pow(n,2)+0.9375;}else{n-=(2.625/p);l=s*Math.pow(n,2)+0.984375;}}}return l;},bounceInOut:function(n){if(n<0.5){return _4.fx.easing.bounceIn(n*2)/2;}return (_4.fx.easing.bounceOut(n*2-1)/2)+0.5;}};}if(!_4._hasResource["dojox.mobile.app.ImageView"]){_4._hasResource["dojox.mobile.app.ImageView"]=true;_4.provide("dojox.mobile.app.ImageView");_4.experimental("dojox.mobile.app.ImageView");_4.declare("dojox.mobile.app.ImageView",_6.mobile.app._Widget,{zoom:1,zoomCenterX:0,zoomCenterY:0,maxZoom:5,autoZoomLevel:3,disableAutoZoom:false,disableSwipe:false,autoZoomEvent:null,_leftImg:null,_centerImg:null,_rightImg:null,_leftSmallImg:null,_centerSmallImg:null,_rightSmallImg:null,constructor:function(){this.panX=0;this.panY=0;this.handleLoad=_4.hitch(this,this.handleLoad);this._updateAnimatedZoom=_4.hitch(this,this._updateAnimatedZoom);this._updateAnimatedPan=_4.hitch(this,this._updateAnimatedPan);this._onAnimPanEnd=_4.hitch(this,this._onAnimPanEnd);},buildRendering:function(){this.inherited(arguments);this.canvas=_4.create("canvas",{},this.domNode);_4.addClass(this.domNode,"mblImageView");},postCreate:function(){this.inherited(arguments);this.size=_4.marginBox(this.domNode);_4.style(this.canvas,{width:this.size.w+"px",height:this.size.h+"px"});this.canvas.height=this.size.h;this.canvas.width=this.size.w;var _243=this;this.connect(this.domNode,"onmousedown",function(_244){if(_243.isAnimating()){return;}if(_243.panX){_243.handleDragEnd();}_243.downX=_244.targetTouches?_244.targetTouches[0].clientX:_244.clientX;_243.downY=_244.targetTouches?_244.targetTouches[0].clientY:_244.clientY;});this.connect(this.domNode,"onmousemove",function(_245){if(_243.isAnimating()){return;}if((!_243.downX&&_243.downX!==0)||(!_243.downY&&_243.downY!==0)){return;}if((!_243.disableSwipe&&_243.zoom==1)||(!_243.disableAutoZoom&&_243.zoom!=1)){var x=_245.targetTouches?_245.targetTouches[0].clientX:_245.pageX;var y=_245.targetTouches?_245.targetTouches[0].clientY:_245.pageY;_243.panX=x-_243.downX;_243.panY=y-_243.downY;if(_243.zoom==1){if(Math.abs(_243.panX)>10){_243.render();}}else{if(Math.abs(_243.panX)>10||Math.abs(_243.panY)>10){_243.render();}}}});this.connect(this.domNode,"onmouseout",function(_246){if(!_243.isAnimating()&&_243.panX){_243.handleDragEnd();}});this.connect(this.domNode,"onmouseover",function(_247){_243.downX=_243.downY=null;});this.connect(this.domNode,"onclick",function(_248){if(_243.isAnimating()){return;}if(_243.downX==null||_243.downY==null){return;}var x=(_248.targetTouches?_248.targetTouches[0].clientX:_248.pageX);var y=(_248.targetTouches?_248.targetTouches[0].clientY:_248.pageY);if(Math.abs(_243.panX)>14||Math.abs(_243.panY)>14){_243.downX=_243.downY=null;_243.handleDragEnd();return;}_243.downX=_243.downY=null;if(!_243.disableAutoZoom){if(!_243._centerImg||!_243._centerImg._loaded){return;}if(_243.zoom!=1){_243.set("animatedZoom",1);return;}var pos=_4._abs(_243.domNode);var _249=_243.size.w/_243._centerImg.width;var _24a=_243.size.h/_243._centerImg.height;_243.zoomTo(((x-pos.x)/_249)-_243.panX,((y-pos.y)/_24a)-_243.panY,_243.autoZoomLevel);}});_4.connect(this.domNode,"flick",this,"handleFlick");},isAnimating:function(){return this._anim&&this._anim.status()=="playing";},handleDragEnd:function(){this.downX=this.downY=null;if(this.zoom==1){if(!this.panX){return;}var _24b=(this._leftImg&&this._leftImg._loaded)||(this._leftSmallImg&&this._leftSmallImg._loaded);var _24c=(this._rightImg&&this._rightImg._loaded)||(this._rightSmallImg&&this._rightSmallImg._loaded);var _24d=!(Math.abs(this.panX)<this._centerImg._baseWidth/2)&&((this.panX>0&&_24b?1:0)||(this.panX<0&&_24c?1:0));if(!_24d){this._animPanTo(0,_4.fx.easing.expoOut,700);}else{this.moveTo(this.panX);}}else{if(!this.panX&&!this.panY){return;}this.zoomCenterX-=(this.panX/this.zoom);this.zoomCenterY-=(this.panY/this.zoom);this.panX=this.panY=0;}},handleFlick:function(_24e){if(this.zoom==1&&_24e.duration<500){if(_24e.direction=="ltr"){this.moveTo(1);}else{if(_24e.direction=="rtl"){this.moveTo(-1);}}this.downX=this.downY=null;}},moveTo:function(_24f){_24f=_24f>0?1:-1;var _250;if(_24f<1){if(this._rightImg&&this._rightImg._loaded){_250=this._rightImg;}else{if(this._rightSmallImg&&this._rightSmallImg._loaded){_250=this._rightSmallImg;}}}else{if(this._leftImg&&this._leftImg._loaded){_250=this._leftImg;}else{if(this._leftSmallImg&&this._leftSmallImg._loaded){_250=this._leftSmallImg;}}}this._moveDir=_24f;var _251=this;if(_250&&_250._loaded){this._animPanTo(this.size.w*_24f,null,500,function(){_251.panX=0;_251.panY=0;if(_24f<0){_251._switchImage("left","right");}else{_251._switchImage("right","left");}_251.render();_251.onChange(_24f*-1);});}else{this._animPanTo(0,_4.fx.easing.expoOut,700);}},_switchImage:function(_252,_253){var _254="_"+_252+"SmallImg";var _255="_"+_252+"Img";var _256="_"+_253+"SmallImg";var _257="_"+_253+"Img";this[_255]=this._centerImg;this[_254]=this._centerSmallImg;this[_255]._type=_252;if(this[_254]){this[_254]._type=_252;}this._centerImg=this[_257];this._centerSmallImg=this[_256];this._centerImg._type="center";if(this._centerSmallImg){this._centerSmallImg._type="center";}this[_257]=this[_256]=null;},_animPanTo:function(to,_258,_259,_25a){this._animCallback=_25a;this._anim=new _4.Animation({curve:[this.panX,to],onAnimate:this._updateAnimatedPan,duration:_259||500,easing:_258,onEnd:this._onAnimPanEnd});this._anim.play();return this._anim;},onChange:function(_25b){},_updateAnimatedPan:function(_25c){this.panX=_25c;this.render();},_onAnimPanEnd:function(){this.panX=this.panY=0;if(this._animCallback){this._animCallback();}},zoomTo:function(_25d,_25e,zoom){this.set("zoomCenterX",_25d);this.set("zoomCenterY",_25e);this.set("animatedZoom",zoom);},render:function(){var cxt=this.canvas.getContext("2d");cxt.clearRect(0,0,this.canvas.width,this.canvas.height);this._renderImg(this._centerSmallImg,this._centerImg,this.zoom==1?(this.panX<0?1:this.panX>0?-1:0):0);if(this.zoom==1&&this.panX!=0){if(this.panX>0){this._renderImg(this._leftSmallImg,this._leftImg,1);}else{this._renderImg(this._rightSmallImg,this._rightImg,-1);}}},_renderImg:function(_25f,_260,_261){var img=(_260&&_260._loaded)?_260:_25f;if(!img||!img._loaded){return;}var cxt=this.canvas.getContext("2d");var _262=img._baseWidth;var _263=img._baseHeight;var _264=_262*this.zoom;var _265=_263*this.zoom;var _266=Math.min(this.size.w,_264);var _267=Math.min(this.size.h,_265);var _268=this.dispWidth=img.width*(_266/_264);var _269=this.dispHeight=img.height*(_267/_265);var _26a=this.zoomCenterX-(this.panX/this.zoom);var _26b=this.zoomCenterY-(this.panY/this.zoom);var _26c=Math.floor(Math.max(_268/2,Math.min(img.width-_268/2,_26a)));var _26d=Math.floor(Math.max(_269/2,Math.min(img.height-_269/2,_26b)));var _26e=Math.max(0,Math.round((img.width-_268)/2+(_26c-img._centerX)));var _26f=Math.max(0,Math.round((img.height-_269)/2+(_26d-img._centerY)));var _270=Math.round(Math.max(0,this.canvas.width-_266)/2);var _271=Math.round(Math.max(0,this.canvas.height-_267)/2);var _272=_266;var _273=_268;if(this.zoom==1&&_261&&this.panX){if(this.panX<0){if(_261>0){_266-=Math.abs(this.panX);_270=0;}else{if(_261<0){_266=Math.max(1,Math.abs(this.panX)-5);_270=this.size.w-_266;}}}else{if(_261>0){_266=Math.max(1,Math.abs(this.panX)-5);_270=0;}else{if(_261<0){_266-=Math.abs(this.panX);_270=this.size.w-_266;}}}_268=Math.max(1,Math.floor(_268*(_266/_272)));if(_261>0){_26e=(_26e+_273)-(_268);}_26e=Math.floor(_26e);}try{cxt.drawImage(img,Math.max(0,_26e),_26f,Math.min(_273,_268),_269,_270,_271,Math.min(_272,_266),_267);}catch(e){}},_setZoomAttr:function(_274){this.zoom=Math.min(this.maxZoom,Math.max(1,_274));if(this.zoom==1&&this._centerImg&&this._centerImg._loaded){if(!this.isAnimating()){this.zoomCenterX=this._centerImg.width/2;this.zoomCenterY=this._centerImg.height/2;}this.panX=this.panY=0;}this.render();},_setZoomCenterXAttr:function(_275){if(_275!=this.zoomCenterX){if(this._centerImg&&this._centerImg._loaded){_275=Math.min(this._centerImg.width,_275);}this.zoomCenterX=Math.max(0,Math.round(_275));}},_setZoomCenterYAttr:function(_276){if(_276!=this.zoomCenterY){if(this._centerImg&&this._centerImg._loaded){_276=Math.min(this._centerImg.height,_276);}this.zoomCenterY=Math.max(0,Math.round(_276));}},_setZoomCenterAttr:function(_277){if(_277.x!=this.zoomCenterX||_277.y!=this.zoomCenterY){this.set("zoomCenterX",_277.x);this.set("zoomCenterY",_277.y);this.render();}},_setAnimatedZoomAttr:function(_278){if(this._anim&&this._anim.status()=="playing"){return;}this._anim=new _4.Animation({curve:[this.zoom,_278],onAnimate:this._updateAnimatedZoom,onEnd:this._onAnimEnd});this._anim.play();},_updateAnimatedZoom:function(_279){this._setZoomAttr(_279);},_setCenterUrlAttr:function(_27a){this._setImage("center",_27a);},_setLeftUrlAttr:function(_27b){this._setImage("left",_27b);},_setRightUrlAttr:function(_27c){this._setImage("right",_27c);},_setImage:function(name,_27d){var _27e=null;var _27f=null;if(_4.isString(_27d)){_27f=_27d;}else{_27f=_27d.large;_27e=_27d.small;}if(this["_"+name+"Img"]&&this["_"+name+"Img"]._src==_27f){return;}var _280=this["_"+name+"Img"]=new Image();_280._type=name;_280._loaded=false;_280._src=_27f;_280._conn=_4.connect(_280,"onload",this.handleLoad);if(_27e){var _281=this["_"+name+"SmallImg"]=new Image();_281._type=name;_281._loaded=false;_281._conn=_4.connect(_281,"onload",this.handleLoad);_281._isSmall=true;_281._src=_27e;_281.src=_27e;}_280.src=_27f;},handleLoad:function(evt){var img=evt.target;img._loaded=true;_4.disconnect(img._conn);var type=img._type;switch(type){case "center":this.zoomCenterX=img.width/2;this.zoomCenterY=img.height/2;break;}var _282=img.height;var _283=img.width;if(_283/this.size.w<_282/this.size.h){img._baseHeight=this.canvas.height;img._baseWidth=_283/(_282/this.size.h);}else{img._baseWidth=this.canvas.width;img._baseHeight=_282/(_283/this.size.w);}img._centerX=_283/2;img._centerY=_282/2;this.render();this.onLoad(img._type,img._src,img._isSmall);},onLoad:function(type,url,_284){}});}if(!_4._hasResource["dojox.mobile.app.ImageThumbView"]){_4._hasResource["dojox.mobile.app.ImageThumbView"]=true;_4.provide("dojox.mobile.app.ImageThumbView");_4.experimental("dojox.mobile.app.ImageThumbView");_4.declare("dojox.mobile.app.ImageThumbView",_5._WidgetBase,{items:[],urlParam:"url",labelParam:null,itemTemplate:"<div class=\"mblThumbInner\">"+"<div class=\"mblThumbOverlay\"></div>"+"<div class=\"mblThumbMask\">"+"<div class=\"mblThumbSrc\" style=\"background-image:url(${url})\"></div>"+"</div>"+"</div>",minPadding:4,maxPerRow:3,maxRows:-1,baseClass:"mblImageThumbView",thumbSize:"medium",animationEnabled:true,selectedIndex:-1,cache:null,cacheMustMatch:false,clickEvent:"onclick",cacheBust:false,disableHide:false,constructor:function(_285,node){},postCreate:function(){this.inherited(arguments);var _286=this;var _287="mblThumbHover";this.addThumb=_4.hitch(this,this.addThumb);this.handleImgLoad=_4.hitch(this,this.handleImgLoad);this.hideCached=_4.hitch(this,this.hideCached);this._onLoadImages={};this.cache=[];this.visibleImages=[];this._cacheCounter=0;this.connect(this.domNode,this.clickEvent,function(_288){var _289=_286._getItemNodeFromEvent(_288);if(_289&&!_289._cached){_286.onSelect(_289._item,_289._index,_286.items);_4.query(".selected",this.domNode).removeClass("selected");_4.addClass(_289,"selected");}});_4.addClass(this.domNode,this.thumbSize);this.resize();this.render();},onSelect:function(item,_28a,_28b){},_setAnimationEnabledAttr:function(_28c){this.animationEnabled=_28c;_4[_28c?"addClass":"removeClass"](this.domNode,"animated");},_setItemsAttr:function(_28d){this.items=_28d||[];var urls={};var i;for(i=0;i<this.items.length;i++){urls[this.items[i][this.urlParam]]=1;}var _28e=[];for(var url in this._onLoadImages){if(!urls[url]&&this._onLoadImages[url]._conn){_4.disconnect(this._onLoadImages[url]._conn);this._onLoadImages[url].src=null;_28e.push(url);}}for(i=0;i<_28e.length;i++){delete this._onLoadImages[url];}this.render();},_getItemNode:function(node){while(node&&!_4.hasClass(node,"mblThumb")&&node!=this.domNode){node=node.parentNode;}return (node==this.domNode)?null:node;},_getItemNodeFromEvent:function(_28f){if(_28f.touches&&_28f.touches.length>0){_28f=_28f.touches[0];}return this._getItemNode(_28f.target);},resize:function(){this._thumbSize=null;this._size=_4.contentBox(this.domNode);this.disableHide=true;this.render();this.disableHide=false;},hideCached:function(){for(var i=0;i<this.cache.length;i++){if(this.cache[i]){_4.style(this.cache[i],"display","none");}}},render:function(){var i;var url;var item;var _290;while(this.visibleImages&&this.visibleImages.length>0){_290=this.visibleImages.pop();this.cache.push(_290);if(!this.disableHide){_4.addClass(_290,"hidden");}_290._cached=true;}if(this.cache&&this.cache.length>0){setTimeout(this.hideCached,1000);}if(!this.items||this.items.length==0){return;}for(i=0;i<this.items.length;i++){item=this.items[i];url=(_4.isString(item)?item:item[this.urlParam]);this.addThumb(item,url,i);if(this.maxRows>0&&(i+1)/this.maxPerRow>=this.maxRows){break;}}if(!this._thumbSize){return;}var _291=0;var row=-1;var _292=this._thumbSize.w+(this.padding*2);var _293=this._thumbSize.h+(this.padding*2);var _294=this.thumbNodes=_4.query(".mblThumb",this.domNode);var pos=0;_294=this.visibleImages;for(i=0;i<_294.length;i++){if(_294[i]._cached){continue;}if(pos%this.maxPerRow==0){row++;}_291=pos%this.maxPerRow;this.place(_294[i],(_291*_292)+this.padding,(row*_293)+this.padding);if(!_294[i]._loading){_4.removeClass(_294[i],"hidden");}if(pos==this.selectedIndex){_4[pos==this.selectedIndex?"addClass":"removeClass"](_294[i],"selected");}pos++;}var _295=Math.ceil(pos/this.maxPerRow);this._numRows=_295;this.setContainerHeight((_295*(this._thumbSize.h+this.padding*2)));},setContainerHeight:function(_296){_4.style(this.domNode,"height",_296+"px");},addThumb:function(item,url,_297){var _298;var _299=false;if(this.cache.length>0){var _29a=false;for(var i=0;i<this.cache.length;i++){if(this.cache[i]._url==url){_298=this.cache.splice(i,1)[0];_29a=true;break;}}if(!_298&&!this.cacheMustMatch){_298=this.cache.pop();_4.removeClass(_298,"selected");}else{_299=true;}}if(!_298){_298=_4.create("div",{"class":"mblThumb hidden",innerHTML:_4.string.substitute(this.itemTemplate,{url:url},null,this)},this.domNode);}if(this.labelParam){var _29b=_4.query(".mblThumbLabel",_298)[0];if(!_29b){_29b=_4.create("div",{"class":"mblThumbLabel"},_298);}_29b.innerHTML=item[this.labelParam]||"";}_4.style(_298,"display","");if(!this.disableHide){_4.addClass(_298,"hidden");}if(!_299){var _29c=_4.create("img",{});_29c._thumbDiv=_298;_29c._conn=_4.connect(_29c,"onload",this.handleImgLoad);_29c._url=url;_298._loading=true;this._onLoadImages[url]=_29c;if(_29c){_29c.src=url;}}this.visibleImages.push(_298);_298._index=_297;_298._item=item;_298._url=url;_298._cached=false;if(!this._thumbSize){this._thumbSize=_4.marginBox(_298);if(this._thumbSize.h==0){this._thumbSize.h=100;this._thumbSize.w=100;}if(this.labelParam){this._thumbSize.h+=8;}this.calcPadding();}},handleImgLoad:function(_29d){var img=_29d.target;_4.disconnect(img._conn);_4.removeClass(img._thumbDiv,"hidden");img._thumbDiv._loading=false;img._conn=null;var url=img._url;if(this.cacheBust){url+=(url.indexOf("?")>-1?"&":"?")+"cacheBust="+(new Date()).getTime()+"_"+(this._cacheCounter++);}_4.query(".mblThumbSrc",img._thumbDiv).style("backgroundImage","url("+url+")");delete this._onLoadImages[img._url];},calcPadding:function(){var _29e=this._size.w;var _29f=this._thumbSize.w;var _2a0=_29f+this.minPadding;this.maxPerRow=Math.floor(_29e/_2a0);this.padding=Math.floor((_29e-(_29f*this.maxPerRow))/(this.maxPerRow*2));},place:function(node,x,y){_4.style(node,{"-webkit-transform":"translate("+x+"px,"+y+"px)"});},destroy:function(){var img;var _2a1=0;for(var url in this._onLoadImages){img=this._onLoadImages[url];if(img){img.src=null;_2a1++;}}this.inherited(arguments);}});}if(!_4._hasResource["dojox.mobile.app._base"]){_4._hasResource["dojox.mobile.app._base"]=true;_4.provide("dojox.mobile.app._base");_4.experimental("dojox.mobile.app._base");(function(){var _2a2;var _2a3;var _2a4=["dojox.mobile","dojox.mobile.parser"];var _2a5={};var _2a6;var _2a7;var _2a8=[];function _2a9(_2aa,_2ab){var _2ac;var url;do{_2ac=_2aa.pop();if(_2ac.source){url=_2ac.source;}else{if(_2ac.module){url=_4.baseUrl+_4._getModuleSymbols(_2ac.module).join("/")+".js";}else{alert("Error: invalid JavaScript resource "+_4.toJson(_2ac));return;}}}while(_2aa.length>0&&_2a5[url]);if(_2aa.length<1&&_2a5[url]){_2ab();return;}_4.xhrGet({url:url,sync:false}).addCallbacks(function(text){_4["eval"](text);_2a5[url]=true;if(_2aa.length>0){_2a9(_2aa,_2ab);}else{_2ab();}},function(){alert("Failed to load resource "+url);});};var _2ad=function(){_2a2=new _6.mobile.app.StageController(_2a7);var _2ae={id:"com.test.app",version:"1.0.0",initialScene:"main"};if(_4.global["appInfo"]){_4.mixin(_2ae,_4.global["appInfo"]);}_2a3=_6.mobile.app.info=_2ae;if(_2a3.title){var _2af=_4.query("head title")[0]||_4.create("title",{},_4.query("head")[0]);document.title=_2a3.title;}_2a2.pushScene(_2a3.initialScene);};var _2b0=function(){var _2b1=false;if(_4.global.BackButton){BackButton.override();_4.connect(document,"backKeyDown",function(e){_4.publish("/dojox/mobile/app/goback");});_2b1=true;}else{if(_4.global.Mojo){}}if(_2b1){_4.addClass(_4.body(),"mblNativeBack");}};_4.mixin(_6.mobile.app,{init:function(node){_2a7=node||_4.body();_6.mobile.app.STAGE_CONTROLLER_ACTIVE=true;_4.subscribe("/dojox/mobile/app/goback",function(){_2a2.popScene();});_4.subscribe("/dojox/mobile/app/alert",function(_2b2){_6.mobile.app.getActiveSceneController().showAlertDialog(_2b2);});_4.subscribe("/dojox/mobile/app/pushScene",function(_2b3,_2b4){_2a2.pushScene(_2b3,_2b4||{});});_4.xhrGet({url:"view-resources.json",load:function(data){var _2b5=[];if(data){_2a8=data=_4.fromJson(data);for(var i=0;i<data.length;i++){if(!data[i].scene){_2b5.push(data[i]);}}}if(_2b5.length>0){_2a9(_2b5,_2ad);}else{_2ad();}},error:_2ad});_2b0();},getActiveSceneController:function(){return _2a2.getActiveSceneController();},getStageController:function(){return _2a2;},loadResources:function(_2b6,_2b7){_2a9(_2b6,_2b7);},loadResourcesForScene:function(_2b8,_2b9){var _2ba=[];for(var i=0;i<_2a8.length;i++){if(_2a8[i].scene==_2b8){_2ba.push(_2a8[i]);}}if(_2ba.length>0){_2a9(_2ba,_2b9);}else{_2b9();}},resolveTemplate:function(_2bb){return "app/views/"+_2bb+"/"+_2bb+"-scene.html";},resolveAssistant:function(_2bc){return "app/assistants/"+_2bc+"-assistant.js";}});})();}if(!_4._hasResource["dojox.mobileApp"]){_4._hasResource["dojox.mobileApp"]=true;_4.provide("dojox.mobileApp");}}};});
diff --git a/js/dojo-1.6/dojox/mobile/app.xd.js.uncompressed.js b/js/dojo-1.6/dojox/mobile/app.xd.js.uncompressed.js
new file mode 100644
index 0000000..3b18c71
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app.xd.js.uncompressed.js
@@ -0,0 +1,9318 @@
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojo.window"],
+["provide", "dijit._base.manager"],
+["provide", "dijit._base.focus"],
+["provide", "dojo.AdapterRegistry"],
+["provide", "dijit._base.place"],
+["provide", "dijit._base.window"],
+["provide", "dijit._base.popup"],
+["provide", "dijit._base.scroll"],
+["provide", "dojo.uacss"],
+["provide", "dijit._base.sniff"],
+["provide", "dijit._base.typematic"],
+["provide", "dijit._base.wai"],
+["provide", "dijit._base"],
+["provide", "dojo.Stateful"],
+["provide", "dijit._WidgetBase"],
+["provide", "dojox.mobile._base"],
+["provide", "dojox.mobile"],
+["provide", "dojox.mobile.parser"],
+["provide", "dojo.parser"],
+["provide", "dojox.mobile.app._event"],
+["provide", "dojox.mobile.app._Widget"],
+["provide", "dojox.mobile.app.SceneController"],
+["provide", "dojox.mobile.app.StageController"],
+["provide", "dojox.mobile.app.SceneAssistant"],
+["provide", "dojox.mobile.app.AlertDialog"],
+["provide", "dojo.string"],
+["provide", "dojox.mobile.app.List"],
+["provide", "dojo.fx.Toggler"],
+["provide", "dojo.fx"],
+["provide", "dojox.mobile.app.ListSelector"],
+["provide", "dojox.mobile.app._FormWidget"],
+["provide", "dojox.mobile.app.TextBox"],
+["provide", "dojo.fx.easing"],
+["provide", "dojox.mobile.app.ImageView"],
+["provide", "dojox.mobile.app.ImageThumbView"],
+["provide", "dojox.mobile.app._base"],
+["provide", "dojox.mobileApp"]],
+defineResource: function(dojo, dijit, dojox){/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+/*
+ This is an optimized version of Dojo, built for deployment and not for
+ development. To get sources and documentation, please visit:
+
+ http://dojotoolkit.org
+*/
+
+if(!dojo._hasResource["dojo.window"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.window"] = true;
+dojo.provide("dojo.window");
+
+
+dojo.getObject("window", true, dojo);
+
+dojo.window.getBox = function(){
+ // summary:
+ // Returns the dimensions and scroll position of the viewable area of a browser window
+
+ var scrollRoot = (dojo.doc.compatMode == 'BackCompat') ? dojo.body() : dojo.doc.documentElement;
+
+ // get scroll position
+ var scroll = dojo._docScroll(); // scrollRoot.scrollTop/Left should work
+ return { w: scrollRoot.clientWidth, h: scrollRoot.clientHeight, l: scroll.x, t: scroll.y };
+};
+
+dojo.window.get = function(doc){
+ // summary:
+ // Get window object associated with document doc
+
+ // In some IE versions (at least 6.0), document.parentWindow does not return a
+ // reference to the real window object (maybe a copy), so we must fix it as well
+ // We use IE specific execScript to attach the real window reference to
+ // document._parentWindow for later use
+ if(dojo.isIE && window !== document.parentWindow){
+ /*
+ In IE 6, only the variable "window" can be used to connect events (others
+ may be only copies).
+ */
+ doc.parentWindow.execScript("document._parentWindow = window;", "Javascript");
+ //to prevent memory leak, unset it after use
+ //another possibility is to add an onUnload handler which seems overkill to me (liucougar)
+ var win = doc._parentWindow;
+ doc._parentWindow = null;
+ return win; // Window
+ }
+
+ return doc.parentWindow || doc.defaultView; // Window
+};
+
+dojo.window.scrollIntoView = function(/*DomNode*/ node, /*Object?*/ pos){
+ // summary:
+ // Scroll the passed node into view, if it is not already.
+
+ // don't rely on node.scrollIntoView working just because the function is there
+
+ try{ // catch unexpected/unrecreatable errors (#7808) since we can recover using a semi-acceptable native method
+ node = dojo.byId(node);
+ var doc = node.ownerDocument || dojo.doc,
+ body = doc.body || dojo.body(),
+ html = doc.documentElement || body.parentNode,
+ isIE = dojo.isIE, isWK = dojo.isWebKit;
+ // if an untested browser, then use the native method
+ if((!(dojo.isMoz || isIE || isWK || dojo.isOpera) || node == body || node == html) && (typeof node.scrollIntoView != "undefined")){
+ node.scrollIntoView(false); // short-circuit to native if possible
+ return;
+ }
+ var backCompat = doc.compatMode == 'BackCompat',
+ clientAreaRoot = backCompat? body : html,
+ scrollRoot = isWK ? body : clientAreaRoot,
+ rootWidth = clientAreaRoot.clientWidth,
+ rootHeight = clientAreaRoot.clientHeight,
+ rtl = !dojo._isBodyLtr(),
+ nodePos = pos || dojo.position(node),
+ el = node.parentNode,
+ isFixed = function(el){
+ return ((isIE <= 6 || (isIE && backCompat))? false : (dojo.style(el, 'position').toLowerCase() == "fixed"));
+ };
+ if(isFixed(node)){ return; } // nothing to do
+
+ while(el){
+ if(el == body){ el = scrollRoot; }
+ var elPos = dojo.position(el),
+ fixedPos = isFixed(el);
+
+ if(el == scrollRoot){
+ elPos.w = rootWidth; elPos.h = rootHeight;
+ if(scrollRoot == html && isIE && rtl){ elPos.x += scrollRoot.offsetWidth-elPos.w; } // IE workaround where scrollbar causes negative x
+ if(elPos.x < 0 || !isIE){ elPos.x = 0; } // IE can have values > 0
+ if(elPos.y < 0 || !isIE){ elPos.y = 0; }
+ }else{
+ var pb = dojo._getPadBorderExtents(el);
+ elPos.w -= pb.w; elPos.h -= pb.h; elPos.x += pb.l; elPos.y += pb.t;
+ }
+
+ if(el != scrollRoot){ // body, html sizes already have the scrollbar removed
+ var clientSize = el.clientWidth,
+ scrollBarSize = elPos.w - clientSize;
+ if(clientSize > 0 && scrollBarSize > 0){
+ elPos.w = clientSize;
+ if(isIE && rtl){ elPos.x += scrollBarSize; }
+ }
+ clientSize = el.clientHeight;
+ scrollBarSize = elPos.h - clientSize;
+ if(clientSize > 0 && scrollBarSize > 0){
+ elPos.h = clientSize;
+ }
+ }
+ if(fixedPos){ // bounded by viewport, not parents
+ if(elPos.y < 0){
+ elPos.h += elPos.y; elPos.y = 0;
+ }
+ if(elPos.x < 0){
+ elPos.w += elPos.x; elPos.x = 0;
+ }
+ if(elPos.y + elPos.h > rootHeight){
+ elPos.h = rootHeight - elPos.y;
+ }
+ if(elPos.x + elPos.w > rootWidth){
+ elPos.w = rootWidth - elPos.x;
+ }
+ }
+ // calculate overflow in all 4 directions
+ var l = nodePos.x - elPos.x, // beyond left: < 0
+ t = nodePos.y - Math.max(elPos.y, 0), // beyond top: < 0
+ r = l + nodePos.w - elPos.w, // beyond right: > 0
+ bot = t + nodePos.h - elPos.h; // beyond bottom: > 0
+ if(r * l > 0){
+ var s = Math[l < 0? "max" : "min"](l, r);
+ nodePos.x += el.scrollLeft;
+ el.scrollLeft += (isIE >= 8 && !backCompat && rtl)? -s : s;
+ nodePos.x -= el.scrollLeft;
+ }
+ if(bot * t > 0){
+ nodePos.y += el.scrollTop;
+ el.scrollTop += Math[t < 0? "max" : "min"](t, bot);
+ nodePos.y -= el.scrollTop;
+ }
+ el = (el != scrollRoot) && !fixedPos && el.parentNode;
+ }
+ }catch(error){
+ console.error('scrollIntoView: ' + error);
+ node.scrollIntoView(false);
+ }
+};
+
+}
+
+if(!dojo._hasResource["dijit._base.manager"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.manager"] = true;
+dojo.provide("dijit._base.manager");
+
+
+
+dojo.declare("dijit.WidgetSet", null, {
+ // summary:
+ // A set of widgets indexed by id. A default instance of this class is
+ // available as `dijit.registry`
+ //
+ // example:
+ // Create a small list of widgets:
+ // | var ws = new dijit.WidgetSet();
+ // | ws.add(dijit.byId("one"));
+ // | ws.add(dijit.byId("two"));
+ // | // destroy both:
+ // | ws.forEach(function(w){ w.destroy(); });
+ //
+ // example:
+ // Using dijit.registry:
+ // | dijit.registry.forEach(function(w){ /* do something */ });
+
+ constructor: function(){
+ this._hash = {};
+ this.length = 0;
+ },
+
+ add: function(/*dijit._Widget*/ widget){
+ // summary:
+ // Add a widget to this list. If a duplicate ID is detected, a error is thrown.
+ //
+ // widget: dijit._Widget
+ // Any dijit._Widget subclass.
+ if(this._hash[widget.id]){
+ throw new Error("Tried to register widget with id==" + widget.id + " but that id is already registered");
+ }
+ this._hash[widget.id] = widget;
+ this.length++;
+ },
+
+ remove: function(/*String*/ id){
+ // summary:
+ // Remove a widget from this WidgetSet. Does not destroy the widget; simply
+ // removes the reference.
+ if(this._hash[id]){
+ delete this._hash[id];
+ this.length--;
+ }
+ },
+
+ forEach: function(/*Function*/ func, /* Object? */thisObj){
+ // summary:
+ // Call specified function for each widget in this set.
+ //
+ // func:
+ // A callback function to run for each item. Is passed the widget, the index
+ // in the iteration, and the full hash, similar to `dojo.forEach`.
+ //
+ // thisObj:
+ // An optional scope parameter
+ //
+ // example:
+ // Using the default `dijit.registry` instance:
+ // | dijit.registry.forEach(function(widget){
+ // | console.log(widget.declaredClass);
+ // | });
+ //
+ // returns:
+ // Returns self, in order to allow for further chaining.
+
+ thisObj = thisObj || dojo.global;
+ var i = 0, id;
+ for(id in this._hash){
+ func.call(thisObj, this._hash[id], i++, this._hash);
+ }
+ return this; // dijit.WidgetSet
+ },
+
+ filter: function(/*Function*/ filter, /* Object? */thisObj){
+ // summary:
+ // Filter down this WidgetSet to a smaller new WidgetSet
+ // Works the same as `dojo.filter` and `dojo.NodeList.filter`
+ //
+ // filter:
+ // Callback function to test truthiness. Is passed the widget
+ // reference and the pseudo-index in the object.
+ //
+ // thisObj: Object?
+ // Option scope to use for the filter function.
+ //
+ // example:
+ // Arbitrary: select the odd widgets in this list
+ // | dijit.registry.filter(function(w, i){
+ // | return i % 2 == 0;
+ // | }).forEach(function(w){ /* odd ones */ });
+
+ thisObj = thisObj || dojo.global;
+ var res = new dijit.WidgetSet(), i = 0, id;
+ for(id in this._hash){
+ var w = this._hash[id];
+ if(filter.call(thisObj, w, i++, this._hash)){
+ res.add(w);
+ }
+ }
+ return res; // dijit.WidgetSet
+ },
+
+ byId: function(/*String*/ id){
+ // summary:
+ // Find a widget in this list by it's id.
+ // example:
+ // Test if an id is in a particular WidgetSet
+ // | var ws = new dijit.WidgetSet();
+ // | ws.add(dijit.byId("bar"));
+ // | var t = ws.byId("bar") // returns a widget
+ // | var x = ws.byId("foo"); // returns undefined
+
+ return this._hash[id]; // dijit._Widget
+ },
+
+ byClass: function(/*String*/ cls){
+ // summary:
+ // Reduce this widgetset to a new WidgetSet of a particular `declaredClass`
+ //
+ // cls: String
+ // The Class to scan for. Full dot-notated string.
+ //
+ // example:
+ // Find all `dijit.TitlePane`s in a page:
+ // | dijit.registry.byClass("dijit.TitlePane").forEach(function(tp){ tp.close(); });
+
+ var res = new dijit.WidgetSet(), id, widget;
+ for(id in this._hash){
+ widget = this._hash[id];
+ if(widget.declaredClass == cls){
+ res.add(widget);
+ }
+ }
+ return res; // dijit.WidgetSet
+},
+
+ toArray: function(){
+ // summary:
+ // Convert this WidgetSet into a true Array
+ //
+ // example:
+ // Work with the widget .domNodes in a real Array
+ // | dojo.map(dijit.registry.toArray(), function(w){ return w.domNode; });
+
+ var ar = [];
+ for(var id in this._hash){
+ ar.push(this._hash[id]);
+ }
+ return ar; // dijit._Widget[]
+},
+
+ map: function(/* Function */func, /* Object? */thisObj){
+ // summary:
+ // Create a new Array from this WidgetSet, following the same rules as `dojo.map`
+ // example:
+ // | var nodes = dijit.registry.map(function(w){ return w.domNode; });
+ //
+ // returns:
+ // A new array of the returned values.
+ return dojo.map(this.toArray(), func, thisObj); // Array
+ },
+
+ every: function(func, thisObj){
+ // summary:
+ // A synthetic clone of `dojo.every` acting explicitly on this WidgetSet
+ //
+ // func: Function
+ // A callback function run for every widget in this list. Exits loop
+ // when the first false return is encountered.
+ //
+ // thisObj: Object?
+ // Optional scope parameter to use for the callback
+
+ thisObj = thisObj || dojo.global;
+ var x = 0, i;
+ for(i in this._hash){
+ if(!func.call(thisObj, this._hash[i], x++, this._hash)){
+ return false; // Boolean
+ }
+ }
+ return true; // Boolean
+ },
+
+ some: function(func, thisObj){
+ // summary:
+ // A synthetic clone of `dojo.some` acting explictly on this WidgetSet
+ //
+ // func: Function
+ // A callback function run for every widget in this list. Exits loop
+ // when the first true return is encountered.
+ //
+ // thisObj: Object?
+ // Optional scope parameter to use for the callback
+
+ thisObj = thisObj || dojo.global;
+ var x = 0, i;
+ for(i in this._hash){
+ if(func.call(thisObj, this._hash[i], x++, this._hash)){
+ return true; // Boolean
+ }
+ }
+ return false; // Boolean
+ }
+
+});
+
+(function(){
+
+ /*=====
+ dijit.registry = {
+ // summary:
+ // A list of widgets on a page.
+ // description:
+ // Is an instance of `dijit.WidgetSet`
+ };
+ =====*/
+ dijit.registry = new dijit.WidgetSet();
+
+ var hash = dijit.registry._hash,
+ attr = dojo.attr,
+ hasAttr = dojo.hasAttr,
+ style = dojo.style;
+
+ dijit.byId = function(/*String|dijit._Widget*/ id){
+ // summary:
+ // Returns a widget by it's id, or if passed a widget, no-op (like dojo.byId())
+ return typeof id == "string" ? hash[id] : id; // dijit._Widget
+ };
+
+ var _widgetTypeCtr = {};
+ dijit.getUniqueId = function(/*String*/widgetType){
+ // summary:
+ // Generates a unique id for a given widgetType
+
+ var id;
+ do{
+ id = widgetType + "_" +
+ (widgetType in _widgetTypeCtr ?
+ ++_widgetTypeCtr[widgetType] : _widgetTypeCtr[widgetType] = 0);
+ }while(hash[id]);
+ return dijit._scopeName == "dijit" ? id : dijit._scopeName + "_" + id; // String
+ };
+
+ dijit.findWidgets = function(/*DomNode*/ root){
+ // summary:
+ // Search subtree under root returning widgets found.
+ // Doesn't search for nested widgets (ie, widgets inside other widgets).
+
+ var outAry = [];
+
+ function getChildrenHelper(root){
+ for(var node = root.firstChild; node; node = node.nextSibling){
+ if(node.nodeType == 1){
+ var widgetId = node.getAttribute("widgetId");
+ if(widgetId){
+ var widget = hash[widgetId];
+ if(widget){ // may be null on page w/multiple dojo's loaded
+ outAry.push(widget);
+ }
+ }else{
+ getChildrenHelper(node);
+ }
+ }
+ }
+ }
+
+ getChildrenHelper(root);
+ return outAry;
+ };
+
+ dijit._destroyAll = function(){
+ // summary:
+ // Code to destroy all widgets and do other cleanup on page unload
+
+ // Clean up focus manager lingering references to widgets and nodes
+ dijit._curFocus = null;
+ dijit._prevFocus = null;
+ dijit._activeStack = [];
+
+ // Destroy all the widgets, top down
+ dojo.forEach(dijit.findWidgets(dojo.body()), function(widget){
+ // Avoid double destroy of widgets like Menu that are attached to <body>
+ // even though they are logically children of other widgets.
+ if(!widget._destroyed){
+ if(widget.destroyRecursive){
+ widget.destroyRecursive();
+ }else if(widget.destroy){
+ widget.destroy();
+ }
+ }
+ });
+ };
+
+ if(dojo.isIE){
+ // Only run _destroyAll() for IE because we think it's only necessary in that case,
+ // and because it causes problems on FF. See bug #3531 for details.
+ dojo.addOnWindowUnload(function(){
+ dijit._destroyAll();
+ });
+ }
+
+ dijit.byNode = function(/*DOMNode*/ node){
+ // summary:
+ // Returns the widget corresponding to the given DOMNode
+ return hash[node.getAttribute("widgetId")]; // dijit._Widget
+ };
+
+ dijit.getEnclosingWidget = function(/*DOMNode*/ 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
+ while(node){
+ var id = node.getAttribute && node.getAttribute("widgetId");
+ if(id){
+ return hash[id];
+ }
+ node = node.parentNode;
+ }
+ return null;
+ };
+
+ var shown = (dijit._isElementShown = function(/*Element*/ elem){
+ var s = style(elem);
+ return (s.visibility != "hidden")
+ && (s.visibility != "collapsed")
+ && (s.display != "none")
+ && (attr(elem, "type") != "hidden");
+ });
+
+ dijit.hasDefaultTabStop = function(/*Element*/ elem){
+ // summary:
+ // Tests if element is tab-navigable even without an explicit tabIndex setting
+
+ // No explicit tabIndex setting, need to investigate node type
+ switch(elem.nodeName.toLowerCase()){
+ case "a":
+ // An <a> w/out a tabindex is only navigable if it has an href
+ return hasAttr(elem, "href");
+ case "area":
+ case "button":
+ case "input":
+ case "object":
+ case "select":
+ case "textarea":
+ // These are navigable by default
+ return true;
+ case "iframe":
+ // If it's an editor <iframe> then it's tab navigable.
+ var body;
+ try{
+ // non-IE
+ var contentDocument = elem.contentDocument;
+ if("designMode" in contentDocument && contentDocument.designMode == "on"){
+ return true;
+ }
+ body = contentDocument.body;
+ }catch(e1){
+ // contentWindow.document isn't accessible within IE7/8
+ // if the iframe.src points to a foreign url and this
+ // page contains an element, that could get focus
+ try{
+ body = elem.contentWindow.document.body;
+ }catch(e2){
+ return false;
+ }
+ }
+ return body.contentEditable == 'true' || (body.firstChild && body.firstChild.contentEditable == 'true');
+ default:
+ return elem.contentEditable == 'true';
+ }
+ };
+
+ var isTabNavigable = (dijit.isTabNavigable = function(/*Element*/ elem){
+ // summary:
+ // Tests if an element is tab-navigable
+
+ // TODO: convert (and rename method) to return effective tabIndex; will save time in _getTabNavigable()
+ if(attr(elem, "disabled")){
+ return false;
+ }else if(hasAttr(elem, "tabIndex")){
+ // Explicit tab index setting
+ return attr(elem, "tabIndex") >= 0; // boolean
+ }else{
+ // No explicit tabIndex setting, so depends on node type
+ return dijit.hasDefaultTabStop(elem);
+ }
+ });
+
+ dijit._getTabNavigable = function(/*DOMNode*/ root){
+ // summary:
+ // Finds descendants of the specified root node.
+ //
+ // description:
+ // Finds the following descendants of the specified root node:
+ // * the first tab-navigable element in document order
+ // without a tabIndex or with tabIndex="0"
+ // * the last tab-navigable element in document order
+ // without a tabIndex or with tabIndex="0"
+ // * the first element in document order with the lowest
+ // positive tabIndex value
+ // * the last element in document order with the highest
+ // positive tabIndex value
+ var first, last, lowest, lowestTabindex, highest, highestTabindex, radioSelected = {};
+ function radioName(node) {
+ // If this element is part of a radio button group, return the name for that group.
+ return node && node.tagName.toLowerCase() == "input" &&
+ node.type && node.type.toLowerCase() == "radio" &&
+ node.name && node.name.toLowerCase();
+ }
+ var walkTree = function(/*DOMNode*/parent){
+ dojo.query("> *", parent).forEach(function(child){
+ // Skip hidden elements, and also non-HTML elements (those in custom namespaces) in IE,
+ // since show() invokes getAttribute("type"), which crash on VML nodes in IE.
+ if((dojo.isIE && child.scopeName!=="HTML") || !shown(child)){
+ return;
+ }
+
+ if(isTabNavigable(child)){
+ var tabindex = attr(child, "tabIndex");
+ if(!hasAttr(child, "tabIndex") || tabindex == 0){
+ if(!first){ first = child; }
+ last = child;
+ }else if(tabindex > 0){
+ if(!lowest || tabindex < lowestTabindex){
+ lowestTabindex = tabindex;
+ lowest = child;
+ }
+ if(!highest || tabindex >= highestTabindex){
+ highestTabindex = tabindex;
+ highest = child;
+ }
+ }
+ var rn = radioName(child);
+ if(dojo.attr(child, "checked") && rn) {
+ radioSelected[rn] = child;
+ }
+ }
+ if(child.nodeName.toUpperCase() != 'SELECT'){
+ walkTree(child);
+ }
+ });
+ };
+ if(shown(root)){ walkTree(root) }
+ function rs(node) {
+ // substitute checked radio button for unchecked one, if there is a checked one with the same name.
+ return radioSelected[radioName(node)] || node;
+ }
+ return { first: rs(first), last: rs(last), lowest: rs(lowest), highest: rs(highest) };
+ }
+ dijit.getFirstInTabbingOrder = function(/*String|DOMNode*/ root){
+ // summary:
+ // Finds the descendant of the specified root node
+ // that is first in the tabbing order
+ var elems = dijit._getTabNavigable(dojo.byId(root));
+ return elems.lowest ? elems.lowest : elems.first; // DomNode
+ };
+
+ dijit.getLastInTabbingOrder = function(/*String|DOMNode*/ root){
+ // summary:
+ // Finds the descendant of the specified root node
+ // that is last in the tabbing order
+ var elems = dijit._getTabNavigable(dojo.byId(root));
+ return elems.last ? elems.last : elems.highest; // DomNode
+ };
+
+ /*=====
+ dojo.mixin(dijit, {
+ // defaultDuration: Integer
+ // The default animation speed (in ms) to use for all Dijit
+ // transitional animations, unless otherwise specified
+ // on a per-instance basis. Defaults to 200, overrided by
+ // `djConfig.defaultDuration`
+ defaultDuration: 200
+ });
+ =====*/
+
+ dijit.defaultDuration = dojo.config["defaultDuration"] || 200;
+
+})();
+
+}
+
+if(!dojo._hasResource["dijit._base.focus"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.focus"] = true;
+dojo.provide("dijit._base.focus");
+
+
+
+
+
+// summary:
+// These functions are used to query or set the focus and selection.
+//
+// Also, they trace when widgets become activated/deactivated,
+// so that the widget can fire _onFocus/_onBlur events.
+// "Active" here means something similar to "focused", but
+// "focus" isn't quite the right word because we keep track of
+// a whole stack of "active" widgets. Example: ComboButton --> Menu -->
+// MenuItem. The onBlur event for ComboButton doesn't fire due to focusing
+// on the Menu or a MenuItem, since they are considered part of the
+// ComboButton widget. It only happens when focus is shifted
+// somewhere completely different.
+
+dojo.mixin(dijit, {
+ // _curFocus: DomNode
+ // Currently focused item on screen
+ _curFocus: null,
+
+ // _prevFocus: DomNode
+ // Previously focused item on screen
+ _prevFocus: null,
+
+ isCollapsed: function(){
+ // summary:
+ // Returns true if there is no text selected
+ return dijit.getBookmark().isCollapsed;
+ },
+
+ getBookmark: function(){
+ // summary:
+ // Retrieves a bookmark that can be used with moveToBookmark to return to the same range
+ var bm, rg, tg, sel = dojo.doc.selection, cf = dijit._curFocus;
+
+ if(dojo.global.getSelection){
+ //W3C Range API for selections.
+ sel = dojo.global.getSelection();
+ if(sel){
+ if(sel.isCollapsed){
+ tg = cf? cf.tagName : "";
+ if(tg){
+ //Create a fake rangelike item to restore selections.
+ tg = tg.toLowerCase();
+ if(tg == "textarea" ||
+ (tg == "input" && (!cf.type || cf.type.toLowerCase() == "text"))){
+ sel = {
+ start: cf.selectionStart,
+ end: cf.selectionEnd,
+ node: cf,
+ pRange: true
+ };
+ return {isCollapsed: (sel.end <= sel.start), mark: sel}; //Object.
+ }
+ }
+ bm = {isCollapsed:true};
+ }else{
+ rg = sel.getRangeAt(0);
+ bm = {isCollapsed: false, mark: rg.cloneRange()};
+ }
+ }
+ }else if(sel){
+ // If the current focus was a input of some sort and no selection, don't bother saving
+ // a native bookmark. This is because it causes issues with dialog/page selection restore.
+ // So, we need to create psuedo bookmarks to work with.
+ tg = cf ? cf.tagName : "";
+ tg = tg.toLowerCase();
+ if(cf && tg && (tg == "button" || tg == "textarea" || tg == "input")){
+ if(sel.type && sel.type.toLowerCase() == "none"){
+ return {
+ isCollapsed: true,
+ mark: null
+ }
+ }else{
+ rg = sel.createRange();
+ return {
+ isCollapsed: rg.text && rg.text.length?false:true,
+ mark: {
+ range: rg,
+ pRange: true
+ }
+ };
+ }
+ }
+ bm = {};
+
+ //'IE' way for selections.
+ try{
+ // createRange() throws exception when dojo in iframe
+ //and nothing selected, see #9632
+ rg = sel.createRange();
+ bm.isCollapsed = !(sel.type == 'Text' ? rg.htmlText.length : rg.length);
+ }catch(e){
+ bm.isCollapsed = true;
+ return bm;
+ }
+ if(sel.type.toUpperCase() == 'CONTROL'){
+ if(rg.length){
+ bm.mark=[];
+ var i=0,len=rg.length;
+ while(i<len){
+ bm.mark.push(rg.item(i++));
+ }
+ }else{
+ bm.isCollapsed = true;
+ bm.mark = null;
+ }
+ }else{
+ bm.mark = rg.getBookmark();
+ }
+ }else{
+ console.warn("No idea how to store the current selection for this browser!");
+ }
+ return bm; // Object
+ },
+
+ moveToBookmark: function(/*Object*/bookmark){
+ // summary:
+ // Moves current selection to a bookmark
+ // bookmark:
+ // This should be a returned object from dijit.getBookmark()
+
+ var _doc = dojo.doc,
+ mark = bookmark.mark;
+ if(mark){
+ if(dojo.global.getSelection){
+ //W3C Rangi API (FF, WebKit, Opera, etc)
+ var sel = dojo.global.getSelection();
+ if(sel && sel.removeAllRanges){
+ if(mark.pRange){
+ var r = mark;
+ var n = r.node;
+ n.selectionStart = r.start;
+ n.selectionEnd = r.end;
+ }else{
+ sel.removeAllRanges();
+ sel.addRange(mark);
+ }
+ }else{
+ console.warn("No idea how to restore selection for this browser!");
+ }
+ }else if(_doc.selection && mark){
+ //'IE' way.
+ var rg;
+ if(mark.pRange){
+ rg = mark.range;
+ }else if(dojo.isArray(mark)){
+ rg = _doc.body.createControlRange();
+ //rg.addElement does not have call/apply method, so can not call it directly
+ //rg is not available in "range.addElement(item)", so can't use that either
+ dojo.forEach(mark, function(n){
+ rg.addElement(n);
+ });
+ }else{
+ rg = _doc.body.createTextRange();
+ rg.moveToBookmark(mark);
+ }
+ rg.select();
+ }
+ }
+ },
+
+ getFocus: function(/*Widget?*/ menu, /*Window?*/ openedForWindow){
+ // summary:
+ // Called as getFocus(), this returns an Object showing the current focus
+ // and selected text.
+ //
+ // Called as getFocus(widget), where widget is a (widget representing) a button
+ // that was just pressed, it returns where focus was before that button
+ // was pressed. (Pressing the button may have either shifted focus to the button,
+ // or removed focus altogether.) In this case the selected text is not returned,
+ // since it can't be accurately determined.
+ //
+ // menu: dijit._Widget or {domNode: DomNode} structure
+ // The button that was just pressed. If focus has disappeared or moved
+ // to this button, returns the previous focus. In this case the bookmark
+ // information is already lost, and null is returned.
+ //
+ // openedForWindow:
+ // iframe in which menu was opened
+ //
+ // returns:
+ // A handle to restore focus/selection, to be passed to `dijit.focus`
+ var node = !dijit._curFocus || (menu && dojo.isDescendant(dijit._curFocus, menu.domNode)) ? dijit._prevFocus : dijit._curFocus;
+ return {
+ node: node,
+ bookmark: (node == dijit._curFocus) && dojo.withGlobal(openedForWindow || dojo.global, dijit.getBookmark),
+ openedForWindow: openedForWindow
+ }; // Object
+ },
+
+ focus: function(/*Object || DomNode */ handle){
+ // summary:
+ // Sets the focused node and the selection according to argument.
+ // To set focus to an iframe's content, pass in the iframe itself.
+ // handle:
+ // object returned by get(), or a DomNode
+
+ if(!handle){ return; }
+
+ var node = "node" in handle ? handle.node : handle, // because handle is either DomNode or a composite object
+ bookmark = handle.bookmark,
+ openedForWindow = handle.openedForWindow,
+ collapsed = bookmark ? bookmark.isCollapsed : false;
+
+ // Set the focus
+ // Note that for iframe's we need to use the <iframe> to follow the parentNode chain,
+ // but we need to set focus to iframe.contentWindow
+ if(node){
+ var focusNode = (node.tagName.toLowerCase() == "iframe") ? node.contentWindow : node;
+ if(focusNode && focusNode.focus){
+ try{
+ // Gecko throws sometimes if setting focus is impossible,
+ // node not displayed or something like that
+ focusNode.focus();
+ }catch(e){/*quiet*/}
+ }
+ dijit._onFocusNode(node);
+ }
+
+ // set the selection
+ // do not need to restore if current selection is not empty
+ // (use keyboard to select a menu item) or if previous selection was collapsed
+ // as it may cause focus shift (Esp in IE).
+ if(bookmark && dojo.withGlobal(openedForWindow || dojo.global, dijit.isCollapsed) && !collapsed){
+ if(openedForWindow){
+ openedForWindow.focus();
+ }
+ try{
+ dojo.withGlobal(openedForWindow || dojo.global, dijit.moveToBookmark, null, [bookmark]);
+ }catch(e2){
+ /*squelch IE internal error, see http://trac.dojotoolkit.org/ticket/1984 */
+ }
+ }
+ },
+
+ // _activeStack: dijit._Widget[]
+ // List of currently active widgets (focused widget and it's ancestors)
+ _activeStack: [],
+
+ registerIframe: function(/*DomNode*/ iframe){
+ // summary:
+ // Registers listeners on the specified iframe so that any click
+ // or focus event on that iframe (or anything in it) is reported
+ // as a focus/click event on the <iframe> itself.
+ // description:
+ // Currently only used by editor.
+ // returns:
+ // Handle to pass to unregisterIframe()
+ return dijit.registerWin(iframe.contentWindow, iframe);
+ },
+
+ unregisterIframe: function(/*Object*/ handle){
+ // summary:
+ // Unregisters listeners on the specified iframe created by registerIframe.
+ // After calling be sure to delete or null out the handle itself.
+ // handle:
+ // Handle returned by registerIframe()
+
+ dijit.unregisterWin(handle);
+ },
+
+ registerWin: function(/*Window?*/targetWindow, /*DomNode?*/ effectiveNode){
+ // summary:
+ // Registers listeners on the specified window (either the main
+ // window or an iframe's window) to detect when the user has clicked somewhere
+ // or focused somewhere.
+ // description:
+ // Users should call registerIframe() instead of this method.
+ // targetWindow:
+ // If specified this is the window associated with the iframe,
+ // i.e. iframe.contentWindow.
+ // effectiveNode:
+ // If specified, report any focus events inside targetWindow as
+ // an event on effectiveNode, rather than on evt.target.
+ // returns:
+ // Handle to pass to unregisterWin()
+
+ // TODO: make this function private in 2.0; Editor/users should call registerIframe(),
+
+ var mousedownListener = function(evt){
+ dijit._justMouseDowned = true;
+ setTimeout(function(){ dijit._justMouseDowned = false; }, 0);
+
+ // workaround weird IE bug where the click is on an orphaned node
+ // (first time clicking a Select/DropDownButton inside a TooltipDialog)
+ if(dojo.isIE && evt && evt.srcElement && evt.srcElement.parentNode == null){
+ return;
+ }
+
+ dijit._onTouchNode(effectiveNode || evt.target || evt.srcElement, "mouse");
+ };
+ //dojo.connect(targetWindow, "onscroll", ???);
+
+ // Listen for blur and focus events on targetWindow's document.
+ // IIRC, I'm using attachEvent() rather than dojo.connect() because focus/blur events don't bubble
+ // through dojo.connect(), and also maybe to catch the focus events early, before onfocus handlers
+ // fire.
+ // Connect to <html> (rather than document) on IE to avoid memory leaks, but document on other browsers because
+ // (at least for FF) the focus event doesn't fire on <html> or <body>.
+ var doc = dojo.isIE ? targetWindow.document.documentElement : targetWindow.document;
+ if(doc){
+ if(dojo.isIE){
+ targetWindow.document.body.attachEvent('onmousedown', mousedownListener);
+ var activateListener = function(evt){
+ // IE reports that nodes like <body> have gotten focus, even though they have tabIndex=-1,
+ // Should consider those more like a mouse-click than a focus....
+ if(evt.srcElement.tagName.toLowerCase() != "#document" &&
+ dijit.isTabNavigable(evt.srcElement)){
+ dijit._onFocusNode(effectiveNode || evt.srcElement);
+ }else{
+ dijit._onTouchNode(effectiveNode || evt.srcElement);
+ }
+ };
+ doc.attachEvent('onactivate', activateListener);
+ var deactivateListener = function(evt){
+ dijit._onBlurNode(effectiveNode || evt.srcElement);
+ };
+ doc.attachEvent('ondeactivate', deactivateListener);
+
+ return function(){
+ targetWindow.document.detachEvent('onmousedown', mousedownListener);
+ doc.detachEvent('onactivate', activateListener);
+ doc.detachEvent('ondeactivate', deactivateListener);
+ doc = null; // prevent memory leak (apparent circular reference via closure)
+ };
+ }else{
+ doc.body.addEventListener('mousedown', mousedownListener, true);
+ var focusListener = function(evt){
+ dijit._onFocusNode(effectiveNode || evt.target);
+ };
+ doc.addEventListener('focus', focusListener, true);
+ var blurListener = function(evt){
+ dijit._onBlurNode(effectiveNode || evt.target);
+ };
+ doc.addEventListener('blur', blurListener, true);
+
+ return function(){
+ doc.body.removeEventListener('mousedown', mousedownListener, true);
+ doc.removeEventListener('focus', focusListener, true);
+ doc.removeEventListener('blur', blurListener, true);
+ doc = null; // prevent memory leak (apparent circular reference via closure)
+ };
+ }
+ }
+ },
+
+ unregisterWin: function(/*Handle*/ handle){
+ // summary:
+ // Unregisters listeners on the specified window (either the main
+ // window or an iframe's window) according to handle returned from registerWin().
+ // After calling be sure to delete or null out the handle itself.
+
+ // Currently our handle is actually a function
+ handle && handle();
+ },
+
+ _onBlurNode: function(/*DomNode*/ node){
+ // summary:
+ // Called when focus leaves a node.
+ // Usually ignored, _unless_ it *isn't* follwed by touching another node,
+ // which indicates that we tabbed off the last field on the page,
+ // in which case every widget is marked inactive
+ dijit._prevFocus = dijit._curFocus;
+ dijit._curFocus = null;
+
+ if(dijit._justMouseDowned){
+ // the mouse down caused a new widget to be marked as active; this blur event
+ // is coming late, so ignore it.
+ return;
+ }
+
+ // if the blur event isn't followed by a focus event then mark all widgets as inactive.
+ if(dijit._clearActiveWidgetsTimer){
+ clearTimeout(dijit._clearActiveWidgetsTimer);
+ }
+ dijit._clearActiveWidgetsTimer = setTimeout(function(){
+ delete dijit._clearActiveWidgetsTimer;
+ dijit._setStack([]);
+ dijit._prevFocus = null;
+ }, 100);
+ },
+
+ _onTouchNode: function(/*DomNode*/ node, /*String*/ by){
+ // summary:
+ // Callback when node is focused or mouse-downed
+ // node:
+ // The node that was touched.
+ // by:
+ // "mouse" if the focus/touch was caused by a mouse down event
+
+ // ignore the recent blurNode event
+ if(dijit._clearActiveWidgetsTimer){
+ clearTimeout(dijit._clearActiveWidgetsTimer);
+ delete dijit._clearActiveWidgetsTimer;
+ }
+
+ // compute stack of active widgets (ex: ComboButton --> Menu --> MenuItem)
+ var newStack=[];
+ try{
+ while(node){
+ var popupParent = dojo.attr(node, "dijitPopupParent");
+ if(popupParent){
+ node=dijit.byId(popupParent).domNode;
+ }else if(node.tagName && node.tagName.toLowerCase() == "body"){
+ // is this the root of the document or just the root of an iframe?
+ if(node === dojo.body()){
+ // node is the root of the main document
+ break;
+ }
+ // otherwise, find the iframe this node refers to (can't access it via parentNode,
+ // need to do this trick instead). window.frameElement is supported in IE/FF/Webkit
+ node=dojo.window.get(node.ownerDocument).frameElement;
+ }else{
+ // if this node is the root node of a widget, then add widget id to stack,
+ // except ignore clicks on disabled widgets (actually focusing a disabled widget still works,
+ // to support MenuItem)
+ var id = node.getAttribute && node.getAttribute("widgetId"),
+ widget = id && dijit.byId(id);
+ if(widget && !(by == "mouse" && widget.get("disabled"))){
+ newStack.unshift(id);
+ }
+ node=node.parentNode;
+ }
+ }
+ }catch(e){ /* squelch */ }
+
+ dijit._setStack(newStack, by);
+ },
+
+ _onFocusNode: function(/*DomNode*/ node){
+ // summary:
+ // Callback when node is focused
+
+ if(!node){
+ return;
+ }
+
+ if(node.nodeType == 9){
+ // Ignore focus events on the document itself. This is here so that
+ // (for example) clicking the up/down arrows of a spinner
+ // (which don't get focus) won't cause that widget to blur. (FF issue)
+ return;
+ }
+
+ dijit._onTouchNode(node);
+
+ if(node == dijit._curFocus){ return; }
+ if(dijit._curFocus){
+ dijit._prevFocus = dijit._curFocus;
+ }
+ dijit._curFocus = node;
+ dojo.publish("focusNode", [node]);
+ },
+
+ _setStack: function(/*String[]*/ newStack, /*String*/ by){
+ // summary:
+ // The stack of active widgets has changed. Send out appropriate events and records new stack.
+ // newStack:
+ // array of widget id's, starting from the top (outermost) widget
+ // by:
+ // "mouse" if the focus/touch was caused by a mouse down event
+
+ var oldStack = dijit._activeStack;
+ dijit._activeStack = newStack;
+
+ // compare old stack to new stack to see how many elements they have in common
+ for(var nCommon=0; nCommon<Math.min(oldStack.length, newStack.length); nCommon++){
+ if(oldStack[nCommon] != newStack[nCommon]){
+ break;
+ }
+ }
+
+ var widget;
+ // for all elements that have gone out of focus, send blur event
+ for(var i=oldStack.length-1; i>=nCommon; i--){
+ widget = dijit.byId(oldStack[i]);
+ if(widget){
+ widget._focused = false;
+ widget.set("focused", false);
+ widget._hasBeenBlurred = true;
+ if(widget._onBlur){
+ widget._onBlur(by);
+ }
+ dojo.publish("widgetBlur", [widget, by]);
+ }
+ }
+
+ // for all element that have come into focus, send focus event
+ for(i=nCommon; i<newStack.length; i++){
+ widget = dijit.byId(newStack[i]);
+ if(widget){
+ widget._focused = true;
+ widget.set("focused", true);
+ if(widget._onFocus){
+ widget._onFocus(by);
+ }
+ dojo.publish("widgetFocus", [widget, by]);
+ }
+ }
+ }
+});
+
+// register top window and all the iframes it contains
+dojo.addOnLoad(function(){
+ var handle = dijit.registerWin(window);
+ if(dojo.isIE){
+ dojo.addOnWindowUnload(function(){
+ dijit.unregisterWin(handle);
+ handle = null;
+ })
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojo.AdapterRegistry"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.AdapterRegistry"] = true;
+dojo.provide("dojo.AdapterRegistry");
+
+
+
+dojo.AdapterRegistry = function(/*Boolean?*/ returnWrappers){
+ // summary:
+ // A registry to make contextual calling/searching easier.
+ // description:
+ // Objects of this class keep list of arrays in the form [name, check,
+ // wrap, directReturn] that are used to determine what the contextual
+ // result of a set of checked arguments is. All check/wrap functions
+ // in this registry should be of the same arity.
+ // example:
+ // | // create a new registry
+ // | var reg = new dojo.AdapterRegistry();
+ // | reg.register("handleString",
+ // | dojo.isString,
+ // | function(str){
+ // | // do something with the string here
+ // | }
+ // | );
+ // | reg.register("handleArr",
+ // | dojo.isArray,
+ // | function(arr){
+ // | // do something with the array here
+ // | }
+ // | );
+ // |
+ // | // now we can pass reg.match() *either* an array or a string and
+ // | // the value we pass will get handled by the right function
+ // | reg.match("someValue"); // will call the first function
+ // | reg.match(["someValue"]); // will call the second
+
+ this.pairs = [];
+ this.returnWrappers = returnWrappers || false; // Boolean
+};
+
+dojo.extend(dojo.AdapterRegistry, {
+ register: function(/*String*/ name, /*Function*/ check, /*Function*/ wrap, /*Boolean?*/ directReturn, /*Boolean?*/ override){
+ // summary:
+ // register a check function to determine if the wrap function or
+ // object gets selected
+ // name:
+ // a way to identify this matcher.
+ // check:
+ // a function that arguments are passed to from the adapter's
+ // match() function. The check function should return true if the
+ // given arguments are appropriate for the wrap function.
+ // directReturn:
+ // If directReturn is true, the value passed in for wrap will be
+ // returned instead of being called. Alternately, the
+ // AdapterRegistry can be set globally to "return not call" using
+ // the returnWrappers property. Either way, this behavior allows
+ // the registry to act as a "search" function instead of a
+ // function interception library.
+ // override:
+ // If override is given and true, the check function will be given
+ // highest priority. Otherwise, it will be the lowest priority
+ // adapter.
+ this.pairs[((override) ? "unshift" : "push")]([name, check, wrap, directReturn]);
+ },
+
+ match: function(/* ... */){
+ // summary:
+ // Find an adapter for the given arguments. If no suitable adapter
+ // is found, throws an exception. match() accepts any number of
+ // arguments, all of which are passed to all matching functions
+ // from the registered pairs.
+ for(var i = 0; i < this.pairs.length; i++){
+ var pair = this.pairs[i];
+ if(pair[1].apply(this, arguments)){
+ if((pair[3])||(this.returnWrappers)){
+ return pair[2];
+ }else{
+ return pair[2].apply(this, arguments);
+ }
+ }
+ }
+ throw new Error("No match found");
+ },
+
+ unregister: function(name){
+ // summary: Remove a named adapter from the registry
+
+ // FIXME: this is kind of a dumb way to handle this. On a large
+ // registry this will be slow-ish and we can use the name as a lookup
+ // should we choose to trade memory for speed.
+ for(var i = 0; i < this.pairs.length; i++){
+ var pair = this.pairs[i];
+ if(pair[0] == name){
+ this.pairs.splice(i, 1);
+ return true;
+ }
+ }
+ return false;
+ }
+});
+
+}
+
+if(!dojo._hasResource["dijit._base.place"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.place"] = true;
+dojo.provide("dijit._base.place");
+
+
+
+
+
+dijit.getViewport = function(){
+ // summary:
+ // Returns the dimensions and scroll position of the viewable area of a browser window
+
+ return dojo.window.getBox();
+};
+
+/*=====
+dijit.__Position = function(){
+ // x: Integer
+ // horizontal coordinate in pixels, relative to document body
+ // y: Integer
+ // vertical coordinate in pixels, relative to document body
+
+ thix.x = x;
+ this.y = y;
+}
+=====*/
+
+
+dijit.placeOnScreen = function(
+ /* DomNode */ node,
+ /* dijit.__Position */ pos,
+ /* String[] */ corners,
+ /* dijit.__Position? */ padding){
+ // summary:
+ // Positions one of the node's corners at specified position
+ // such that node is fully visible in viewport.
+ // description:
+ // NOTE: node is assumed to be absolutely or relatively positioned.
+ // pos:
+ // Object like {x: 10, y: 20}
+ // corners:
+ // Array of Strings representing order to try corners in, like ["TR", "BL"].
+ // Possible values are:
+ // * "BL" - bottom left
+ // * "BR" - bottom right
+ // * "TL" - top left
+ // * "TR" - top right
+ // padding:
+ // set padding to put some buffer around the element you want to position.
+ // example:
+ // Try to place node's top right corner at (10,20).
+ // If that makes node go (partially) off screen, then try placing
+ // bottom left corner at (10,20).
+ // | placeOnScreen(node, {x: 10, y: 20}, ["TR", "BL"])
+
+ var choices = dojo.map(corners, function(corner){
+ var c = { corner: corner, pos: {x:pos.x,y:pos.y} };
+ if(padding){
+ c.pos.x += corner.charAt(1) == 'L' ? padding.x : -padding.x;
+ c.pos.y += corner.charAt(0) == 'T' ? padding.y : -padding.y;
+ }
+ return c;
+ });
+
+ return dijit._place(node, choices);
+}
+
+dijit._place = function(/*DomNode*/ node, choices, layoutNode, /*Object*/ aroundNodeCoords){
+ // summary:
+ // Given a list of spots to put node, put it at the first spot where it fits,
+ // of if it doesn't fit anywhere then the place with the least overflow
+ // choices: Array
+ // Array of elements like: {corner: 'TL', pos: {x: 10, y: 20} }
+ // Above example says to put the top-left corner of the node at (10,20)
+ // layoutNode: Function(node, aroundNodeCorner, nodeCorner, size)
+ // for things like tooltip, they are displayed differently (and have different dimensions)
+ // based on their orientation relative to the parent. This adjusts the popup based on orientation.
+ // It also passes in the available size for the popup, which is useful for tooltips to
+ // tell them that their width is limited to a certain amount. layoutNode() may return a value expressing
+ // how much the popup had to be modified to fit into the available space. This is used to determine
+ // what the best placement is.
+ // aroundNodeCoords: Object
+ // Size of aroundNode, ex: {w: 200, h: 50}
+
+ // get {x: 10, y: 10, w: 100, h:100} type obj representing position of
+ // viewport over document
+ var view = dojo.window.getBox();
+
+ // This won't work if the node is inside a <div style="position: relative">,
+ // so reattach it to dojo.doc.body. (Otherwise, the positioning will be wrong
+ // and also it might get cutoff)
+ if(!node.parentNode || String(node.parentNode.tagName).toLowerCase() != "body"){
+ dojo.body().appendChild(node);
+ }
+
+ var best = null;
+ dojo.some(choices, function(choice){
+ var corner = choice.corner;
+ var pos = choice.pos;
+ var overflow = 0;
+
+ // calculate amount of space available given specified position of node
+ var spaceAvailable = {
+ w: corner.charAt(1) == 'L' ? (view.l + view.w) - pos.x : pos.x - view.l,
+ h: corner.charAt(1) == 'T' ? (view.t + view.h) - pos.y : pos.y - view.t
+ };
+
+ // configure node to be displayed in given position relative to button
+ // (need to do this in order to get an accurate size for the node, because
+ // a tooltip's size changes based on position, due to triangle)
+ if(layoutNode){
+ var res = layoutNode(node, choice.aroundCorner, corner, spaceAvailable, aroundNodeCoords);
+ overflow = typeof res == "undefined" ? 0 : res;
+ }
+
+ // get node's size
+ var style = node.style;
+ var oldDisplay = style.display;
+ var oldVis = style.visibility;
+ style.visibility = "hidden";
+ style.display = "";
+ var mb = dojo.marginBox(node);
+ style.display = oldDisplay;
+ style.visibility = oldVis;
+
+ // coordinates and size of node with specified corner placed at pos,
+ // and clipped by viewport
+ var startX = Math.max(view.l, corner.charAt(1) == 'L' ? pos.x : (pos.x - mb.w)),
+ startY = Math.max(view.t, corner.charAt(0) == 'T' ? pos.y : (pos.y - mb.h)),
+ endX = Math.min(view.l + view.w, corner.charAt(1) == 'L' ? (startX + mb.w) : pos.x),
+ endY = Math.min(view.t + view.h, corner.charAt(0) == 'T' ? (startY + mb.h) : pos.y),
+ width = endX - startX,
+ height = endY - startY;
+
+ overflow += (mb.w - width) + (mb.h - height);
+
+ if(best == null || overflow < best.overflow){
+ best = {
+ corner: corner,
+ aroundCorner: choice.aroundCorner,
+ x: startX,
+ y: startY,
+ w: width,
+ h: height,
+ overflow: overflow,
+ spaceAvailable: spaceAvailable
+ };
+ }
+
+ return !overflow;
+ });
+
+ // In case the best position is not the last one we checked, need to call
+ // layoutNode() again.
+ if(best.overflow && layoutNode){
+ layoutNode(node, best.aroundCorner, best.corner, best.spaceAvailable, aroundNodeCoords);
+ }
+
+ // And then position the node. Do this last, after the layoutNode() above
+ // has sized the node, due to browser quirks when the viewport is scrolled
+ // (specifically that a Tooltip will shrink to fit as though the window was
+ // scrolled to the left).
+ //
+ // In RTL mode, set style.right rather than style.left so in the common case,
+ // window resizes move the popup along with the aroundNode.
+ var l = dojo._isBodyLtr(),
+ s = node.style;
+ s.top = best.y + "px";
+ s[l ? "left" : "right"] = (l ? best.x : view.w - best.x - best.w) + "px";
+
+ return best;
+}
+
+dijit.placeOnScreenAroundNode = function(
+ /* DomNode */ node,
+ /* DomNode */ aroundNode,
+ /* Object */ aroundCorners,
+ /* Function? */ layoutNode){
+
+ // summary:
+ // Position node adjacent or kitty-corner to aroundNode
+ // such that it's fully visible in viewport.
+ //
+ // description:
+ // Place node such that corner of node touches a corner of
+ // aroundNode, and that node is fully visible.
+ //
+ // aroundCorners:
+ // Ordered list of pairs of corners to try matching up.
+ // Each pair of corners is represented as a key/value in the hash,
+ // where the key corresponds to the aroundNode's corner, and
+ // the value corresponds to the node's corner:
+ //
+ // | { aroundNodeCorner1: nodeCorner1, aroundNodeCorner2: nodeCorner2, ...}
+ //
+ // The following strings are used to represent the four corners:
+ // * "BL" - bottom left
+ // * "BR" - bottom right
+ // * "TL" - top left
+ // * "TR" - top right
+ //
+ // layoutNode: Function(node, aroundNodeCorner, nodeCorner)
+ // For things like tooltip, they are displayed differently (and have different dimensions)
+ // based on their orientation relative to the parent. This adjusts the popup based on orientation.
+ //
+ // example:
+ // | dijit.placeOnScreenAroundNode(node, aroundNode, {'BL':'TL', 'TR':'BR'});
+ // This will try to position node such that node's top-left corner is at the same position
+ // as the bottom left corner of the aroundNode (ie, put node below
+ // aroundNode, with left edges aligned). If that fails it will try to put
+ // the bottom-right corner of node where the top right corner of aroundNode is
+ // (ie, put node above aroundNode, with right edges aligned)
+ //
+
+ // get coordinates of aroundNode
+ aroundNode = dojo.byId(aroundNode);
+ var aroundNodePos = dojo.position(aroundNode, true);
+
+ // place the node around the calculated rectangle
+ return dijit._placeOnScreenAroundRect(node,
+ aroundNodePos.x, aroundNodePos.y, aroundNodePos.w, aroundNodePos.h, // rectangle
+ aroundCorners, layoutNode);
+};
+
+/*=====
+dijit.__Rectangle = function(){
+ // x: Integer
+ // horizontal offset in pixels, relative to document body
+ // y: Integer
+ // vertical offset in pixels, relative to document body
+ // width: Integer
+ // width in pixels
+ // height: Integer
+ // height in pixels
+
+ this.x = x;
+ this.y = y;
+ this.width = width;
+ this.height = height;
+}
+=====*/
+
+
+dijit.placeOnScreenAroundRectangle = function(
+ /* DomNode */ node,
+ /* dijit.__Rectangle */ aroundRect,
+ /* Object */ aroundCorners,
+ /* Function */ 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.
+
+ return dijit._placeOnScreenAroundRect(node,
+ aroundRect.x, aroundRect.y, aroundRect.width, aroundRect.height, // rectangle
+ aroundCorners, layoutNode);
+};
+
+dijit._placeOnScreenAroundRect = function(
+ /* DomNode */ node,
+ /* Number */ x,
+ /* Number */ y,
+ /* Number */ width,
+ /* Number */ height,
+ /* Object */ aroundCorners,
+ /* Function */ layoutNode){
+
+ // summary:
+ // Like dijit.placeOnScreenAroundNode(), except it accepts coordinates
+ // of a rectangle to place node adjacent to.
+
+ // TODO: combine with placeOnScreenAroundRectangle()
+
+ // Generate list of possible positions for node
+ var choices = [];
+ for(var nodeCorner in aroundCorners){
+ choices.push( {
+ aroundCorner: nodeCorner,
+ corner: aroundCorners[nodeCorner],
+ pos: {
+ x: x + (nodeCorner.charAt(1) == 'L' ? 0 : width),
+ y: y + (nodeCorner.charAt(0) == 'T' ? 0 : height)
+ }
+ });
+ }
+
+ return dijit._place(node, choices, layoutNode, {w: width, h: height});
+};
+
+dijit.placementRegistry= new dojo.AdapterRegistry();
+dijit.placementRegistry.register("node",
+ function(n, x){
+ return typeof x == "object" &&
+ typeof x.offsetWidth != "undefined" && typeof x.offsetHeight != "undefined";
+ },
+ dijit.placeOnScreenAroundNode);
+dijit.placementRegistry.register("rect",
+ function(n, x){
+ return typeof x == "object" &&
+ "x" in x && "y" in x && "width" in x && "height" in x;
+ },
+ dijit.placeOnScreenAroundRectangle);
+
+dijit.placeOnScreenAroundElement = function(
+ /* DomNode */ node,
+ /* Object */ aroundElement,
+ /* Object */ aroundCorners,
+ /* Function */ layoutNode){
+
+ // summary:
+ // Like dijit.placeOnScreenAroundNode(), except it accepts an arbitrary object
+ // for the "around" argument and finds a proper processor to place a node.
+
+ return dijit.placementRegistry.match.apply(dijit.placementRegistry, arguments);
+};
+
+dijit.getPopupAroundAlignment = function(/*Array*/ position, /*Boolean*/ leftToRight){
+ // summary:
+ // 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:
+ //
+ // * before: places drop down to the left of the target node/widget, or to the right in
+ // the case of RTL scripts like Hebrew and Arabic
+ // * after: places drop down to the right of the target node/widget, or to the left in
+ // the case of RTL scripts like Hebrew and Arabic
+ // * above: drop down goes above target node
+ // * below: drop down goes below target node
+ //
+ // 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 = {};
+ dojo.forEach(position, function(pos){
+ switch(pos){
+ case "after":
+ align[leftToRight ? "BR" : "BL"] = leftToRight ? "BL" : "BR";
+ break;
+ case "before":
+ align[leftToRight ? "BL" : "BR"] = leftToRight ? "BR" : "BL";
+ break;
+ case "below-alt":
+ leftToRight = !leftToRight;
+ // fall through
+ case "below":
+ // first try to align left borders, next try to align right borders (or reverse for RTL mode)
+ align[leftToRight ? "BL" : "BR"] = leftToRight ? "TL" : "TR";
+ align[leftToRight ? "BR" : "BL"] = leftToRight ? "TR" : "TL";
+ break;
+ case "above-alt":
+ leftToRight = !leftToRight;
+ // fall through
+ case "above":
+ default:
+ // first try to align left borders, next try to align right borders (or reverse for RTL mode)
+ align[leftToRight ? "TL" : "TR"] = leftToRight ? "BL" : "BR";
+ align[leftToRight ? "TR" : "TL"] = leftToRight ? "BR" : "BL";
+ break;
+ }
+ });
+ return align;
+};
+
+}
+
+if(!dojo._hasResource["dijit._base.window"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.window"] = true;
+dojo.provide("dijit._base.window");
+
+
+
+
+dijit.getDocumentWindow = function(doc){
+ return dojo.window.get(doc);
+};
+
+}
+
+if(!dojo._hasResource["dijit._base.popup"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.popup"] = true;
+dojo.provide("dijit._base.popup");
+
+
+
+
+
+
+/*=====
+dijit.popup.__OpenArgs = function(){
+ // popup: Widget
+ // widget to display
+ // parent: Widget
+ // the button etc. that is displaying this popup
+ // around: DomNode
+ // DOM node (typically a button); place popup relative to this node. (Specify this *or* "x" and "y" parameters.)
+ // x: Integer
+ // Absolute horizontal position (in pixels) to place node at. (Specify this *or* "around" parameter.)
+ // y: Integer
+ // Absolute vertical position (in pixels) to place node at. (Specify this *or* "around" parameter.)
+ // orient: Object|String
+ // When the around parameter is specified, orient should be an
+ // ordered list of tuples of the form (around-node-corner, popup-node-corner).
+ // dijit.popup.open() tries to position the popup according to each tuple in the list, in order,
+ // until the popup appears fully within the viewport.
+ //
+ // The default value is {BL:'TL', TL:'BL'}, which represents a list of two tuples:
+ // 1. (BL, TL)
+ // 2. (TL, BL)
+ // where BL means "bottom left" and "TL" means "top left".
+ // So by default, it first tries putting the popup below the around node, left-aligning them,
+ // and then tries to put it above the around node, still left-aligning them. Note that the
+ // default is horizontally reversed when in RTL mode.
+ //
+ // When an (x,y) position is specified rather than an around node, orient is either
+ // "R" or "L". R (for right) means that it tries to put the popup to the right of the mouse,
+ // specifically positioning the popup's top-right corner at the mouse position, and if that doesn't
+ // fit in the viewport, then it tries, in order, the bottom-right corner, the top left corner,
+ // and the top-right corner.
+ // onCancel: Function
+ // callback when user has canceled the popup by
+ // 1. hitting ESC or
+ // 2. by using the popup widget's proprietary cancel mechanism (like a cancel button in a dialog);
+ // i.e. whenever popupWidget.onCancel() is called, args.onCancel is called
+ // onClose: Function
+ // callback whenever this popup is closed
+ // onExecute: Function
+ // callback when user "executed" on the popup/sub-popup by selecting a menu choice, etc. (top menu only)
+ // padding: dijit.__Position
+ // adding a buffer around the opening position. This is only useful when around is not set.
+ this.popup = popup;
+ this.parent = parent;
+ this.around = around;
+ this.x = x;
+ this.y = y;
+ this.orient = orient;
+ this.onCancel = onCancel;
+ this.onClose = onClose;
+ this.onExecute = onExecute;
+ this.padding = padding;
+}
+=====*/
+
+dijit.popup = {
+ // summary:
+ // This singleton is used to show/hide widgets as popups.
+
+ // _stack: dijit._Widget[]
+ // Stack of currently popped up widgets.
+ // (someone opened _stack[0], and then it opened _stack[1], etc.)
+ _stack: [],
+
+ // _beginZIndex: Number
+ // Z-index of the first popup. (If first popup opens other
+ // popups they get a higher z-index.)
+ _beginZIndex: 1000,
+
+ _idGen: 1,
+
+ _createWrapper: function(/*Widget || DomNode*/ widget){
+ // summary:
+ // Initialization for widgets that will be used as popups.
+ // Puts widget inside a wrapper DIV (if not already in one),
+ // and returns pointer to that wrapper DIV.
+
+ var wrapper = widget.declaredClass ? widget._popupWrapper : (dojo.hasClass(widget.parentNode, "dijitPopup") && widget.parentNode),
+ node = widget.domNode || widget;
+
+ if(!wrapper){
+ // Create wrapper <div> for when this widget [in the future] will be used as a popup.
+ // This is done early because of IE bugs where creating/moving DOM nodes causes focus
+ // to go wonky, see tests/robot/Toolbar.html to reproduce
+ wrapper = dojo.create("div",{
+ "class":"dijitPopup",
+ style:{ display: "none"},
+ role: "presentation"
+ }, dojo.body());
+ wrapper.appendChild(node);
+
+ var s = node.style;
+ s.display = "";
+ s.visibility = "";
+ s.position = "";
+ s.top = "0px";
+
+ if(widget.declaredClass){ // TODO: in 2.0 change signature to always take widget, then remove if()
+ widget._popupWrapper = wrapper;
+ dojo.connect(widget, "destroy", function(){
+ dojo.destroy(wrapper);
+ delete widget._popupWrapper;
+ });
+ }
+ }
+
+ return wrapper;
+ },
+
+ moveOffScreen: function(/*Widget || DomNode*/ widget){
+ // summary:
+ // Moves the popup widget off-screen.
+ // Do not use this method to hide popups when not in use, because
+ // that will create an accessibility issue: the offscreen popup is
+ // still in the tabbing order.
+
+ // Create wrapper if not already there
+ var wrapper = this._createWrapper(widget);
+
+ dojo.style(wrapper, {
+ visibility: "hidden",
+ top: "-9999px", // prevent transient scrollbar causing misalign (#5776), and initial flash in upper left (#10111)
+ display: ""
+ });
+ },
+
+ hide: function(/*dijit._Widget*/ widget){
+ // summary:
+ // Hide this popup widget (until it is ready to be shown).
+ // Initialization for widgets that will be used as popups
+ //
+ // Also puts widget inside a wrapper DIV (if not already in one)
+ //
+ // If popup widget needs to layout it should
+ // do so when it is made visible, and popup._onShow() is called.
+
+ // Create wrapper if not already there
+ var wrapper = this._createWrapper(widget);
+
+ dojo.style(wrapper, "display", "none");
+ },
+
+ getTopPopup: function(){
+ // summary:
+ // Compute the closest ancestor popup that's *not* a child of another popup.
+ // Ex: For a TooltipDialog with a button that spawns a tree of menus, find the popup of the button.
+ var stack = this._stack;
+ for(var pi=stack.length-1; pi > 0 && stack[pi].parent === stack[pi-1].widget; pi--){
+ /* do nothing, just trying to get right value for pi */
+ }
+ return stack[pi];
+ },
+
+ open: function(/*dijit.popup.__OpenArgs*/ args){
+ // summary:
+ // Popup the widget at the specified position
+ //
+ // example:
+ // opening at the mouse position
+ // | dijit.popup.open({popup: menuWidget, x: evt.pageX, y: evt.pageY});
+ //
+ // example:
+ // opening the widget as a dropdown
+ // | dijit.popup.open({parent: this, popup: menuWidget, around: this.domNode, onClose: function(){...}});
+ //
+ // Note that whatever widget called dijit.popup.open() should also listen to its own _onBlur callback
+ // (fired from _base/focus.js) to know that focus has moved somewhere else and thus the popup should be closed.
+
+ var stack = this._stack,
+ widget = args.popup,
+ orient = args.orient || (
+ (args.parent ? args.parent.isLeftToRight() : dojo._isBodyLtr()) ?
+ {'BL':'TL', 'BR':'TR', 'TL':'BL', 'TR':'BR'} :
+ {'BR':'TR', 'BL':'TL', 'TR':'BR', 'TL':'BL'}
+ ),
+ around = args.around,
+ id = (args.around && args.around.id) ? (args.around.id+"_dropdown") : ("popup_"+this._idGen++);
+
+ // If we are opening a new popup that isn't a child of a currently opened popup, then
+ // close currently opened popup(s). This should happen automatically when the old popups
+ // gets the _onBlur() event, except that the _onBlur() event isn't reliable on IE, see [22198].
+ while(stack.length && (!args.parent || !dojo.isDescendant(args.parent.domNode, stack[stack.length-1].widget.domNode))){
+ dijit.popup.close(stack[stack.length-1].widget);
+ }
+
+ // Get pointer to popup wrapper, and create wrapper if it doesn't exist
+ var wrapper = this._createWrapper(widget);
+
+
+ dojo.attr(wrapper, {
+ id: id,
+ style: {
+ zIndex: this._beginZIndex + stack.length
+ },
+ "class": "dijitPopup " + (widget.baseClass || widget["class"] || "").split(" ")[0] +"Popup",
+ dijitPopupParent: args.parent ? args.parent.id : ""
+ });
+
+ if(dojo.isIE || dojo.isMoz){
+ if(!widget.bgIframe){
+ // setting widget.bgIframe triggers cleanup in _Widget.destroy()
+ widget.bgIframe = new dijit.BackgroundIframe(wrapper);
+ }
+ }
+
+ // position the wrapper node and make it visible
+ var best = around ?
+ dijit.placeOnScreenAroundElement(wrapper, around, orient, widget.orient ? dojo.hitch(widget, "orient") : null) :
+ dijit.placeOnScreen(wrapper, args, orient == 'R' ? ['TR','BR','TL','BL'] : ['TL','BL','TR','BR'], args.padding);
+
+ wrapper.style.display = "";
+ wrapper.style.visibility = "visible";
+ widget.domNode.style.visibility = "visible"; // counteract effects from _HasDropDown
+
+ var handlers = [];
+
+ // provide default escape and tab key handling
+ // (this will work for any widget, not just menu)
+ handlers.push(dojo.connect(wrapper, "onkeypress", this, function(evt){
+ if(evt.charOrCode == dojo.keys.ESCAPE && args.onCancel){
+ dojo.stopEvent(evt);
+ args.onCancel();
+ }else if(evt.charOrCode === dojo.keys.TAB){
+ dojo.stopEvent(evt);
+ var topPopup = this.getTopPopup();
+ if(topPopup && topPopup.onCancel){
+ topPopup.onCancel();
+ }
+ }
+ }));
+
+ // watch for cancel/execute events on the popup and notify the caller
+ // (for a menu, "execute" means clicking an item)
+ if(widget.onCancel){
+ handlers.push(dojo.connect(widget, "onCancel", args.onCancel));
+ }
+
+ handlers.push(dojo.connect(widget, widget.onExecute ? "onExecute" : "onChange", this, function(){
+ var topPopup = this.getTopPopup();
+ if(topPopup && topPopup.onExecute){
+ topPopup.onExecute();
+ }
+ }));
+
+ stack.push({
+ widget: widget,
+ parent: args.parent,
+ onExecute: args.onExecute,
+ onCancel: args.onCancel,
+ onClose: args.onClose,
+ handlers: handlers
+ });
+
+ if(widget.onOpen){
+ // TODO: in 2.0 standardize onShow() (used by StackContainer) and onOpen() (used here)
+ widget.onOpen(best);
+ }
+
+ return best;
+ },
+
+ close: function(/*dijit._Widget?*/ popup){
+ // summary:
+ // Close specified popup and any popups that it parented.
+ // If no popup is specified, closes all popups.
+
+ var stack = this._stack;
+
+ // Basically work backwards from the top of the stack closing popups
+ // until we hit the specified popup, but IIRC there was some issue where closing
+ // a popup would cause others to close too. Thus if we are trying to close B in [A,B,C]
+ // closing C might close B indirectly and then the while() condition will run where stack==[A]...
+ // so the while condition is constructed defensively.
+ while((popup && dojo.some(stack, function(elem){return elem.widget == popup;})) ||
+ (!popup && stack.length)){
+ var top = stack.pop(),
+ widget = top.widget,
+ onClose = top.onClose;
+
+ if(widget.onClose){
+ // TODO: in 2.0 standardize onHide() (used by StackContainer) and onClose() (used here)
+ widget.onClose();
+ }
+ dojo.forEach(top.handlers, dojo.disconnect);
+
+ // Hide the widget and it's wrapper unless it has already been destroyed in above onClose() etc.
+ if(widget && widget.domNode){
+ this.hide(widget);
+ }
+
+ if(onClose){
+ onClose();
+ }
+ }
+ }
+};
+
+// TODO: remove dijit._frames, it isn't being used much, since popups never release their
+// iframes (see [22236])
+dijit._frames = new function(){
+ // summary:
+ // cache of iframes
+
+ var queue = [];
+
+ this.pop = function(){
+ var iframe;
+ if(queue.length){
+ iframe = queue.pop();
+ iframe.style.display="";
+ }else{
+ if(dojo.isIE < 9){
+ var burl = dojo.config["dojoBlankHtmlUrl"] || (dojo.moduleUrl("dojo", "resources/blank.html")+"") || "javascript:\"\"";
+ var html="<iframe src='" + burl + "'"
+ + " style='position: absolute; left: 0px; top: 0px;"
+ + "z-index: -1; filter:Alpha(Opacity=\"0\");'>";
+ iframe = dojo.doc.createElement(html);
+ }else{
+ iframe = dojo.create("iframe");
+ iframe.src = 'javascript:""';
+ iframe.className = "dijitBackgroundIframe";
+ dojo.style(iframe, "opacity", 0.1);
+ }
+ iframe.tabIndex = -1; // Magic to prevent iframe from getting focus on tab keypress - as style didn't work.
+ dijit.setWaiRole(iframe,"presentation");
+ }
+ return iframe;
+ };
+
+ this.push = function(iframe){
+ iframe.style.display="none";
+ queue.push(iframe);
+ }
+}();
+
+
+dijit.BackgroundIframe = function(/*DomNode*/ node){
+ // summary:
+ // For IE/FF z-index schenanigans. id attribute is required.
+ //
+ // description:
+ // new dijit.BackgroundIframe(node)
+ // Makes a background iframe as a child of node, that fills
+ // area (and position) of node
+
+ if(!node.id){ throw new Error("no id"); }
+ if(dojo.isIE || dojo.isMoz){
+ var iframe = (this.iframe = dijit._frames.pop());
+ node.appendChild(iframe);
+ if(dojo.isIE<7 || dojo.isQuirks){
+ this.resize(node);
+ this._conn = dojo.connect(node, 'onresize', this, function(){
+ this.resize(node);
+ });
+ }else{
+ dojo.style(iframe, {
+ width: '100%',
+ height: '100%'
+ });
+ }
+ }
+};
+
+dojo.extend(dijit.BackgroundIframe, {
+ resize: function(node){
+ // summary:
+ // Resize the iframe so it's the same size as node.
+ // Needed on IE6 and IE/quirks because height:100% doesn't work right.
+ if(this.iframe){
+ dojo.style(this.iframe, {
+ width: node.offsetWidth + 'px',
+ height: node.offsetHeight + 'px'
+ });
+ }
+ },
+ destroy: function(){
+ // summary:
+ // destroy the iframe
+ if(this._conn){
+ dojo.disconnect(this._conn);
+ this._conn = null;
+ }
+ if(this.iframe){
+ dijit._frames.push(this.iframe);
+ delete this.iframe;
+ }
+ }
+});
+
+}
+
+if(!dojo._hasResource["dijit._base.scroll"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.scroll"] = true;
+dojo.provide("dijit._base.scroll");
+
+
+
+
+dijit.scrollIntoView = function(/*DomNode*/ node, /*Object?*/ pos){
+ // summary:
+ // Scroll the passed node into view, if it is not already.
+ // Deprecated, use `dojo.window.scrollIntoView` instead.
+
+ dojo.window.scrollIntoView(node, pos);
+};
+
+}
+
+if(!dojo._hasResource["dojo.uacss"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.uacss"] = true;
+dojo.provide("dojo.uacss");
+
+
+
+(function(){
+ // summary:
+ // Applies pre-set CSS classes to the top-level HTML node, based on:
+ // - browser (ex: dj_ie)
+ // - browser version (ex: dj_ie6)
+ // - box model (ex: dj_contentBox)
+ // - text direction (ex: dijitRtl)
+ //
+ // In addition, browser, browser version, and box model are
+ // combined with an RTL flag when browser text is RTL. ex: dj_ie-rtl.
+
+ var d = dojo,
+ html = d.doc.documentElement,
+ ie = d.isIE,
+ opera = d.isOpera,
+ maj = Math.floor,
+ ff = d.isFF,
+ boxModel = d.boxModel.replace(/-/,''),
+
+ classes = {
+ dj_ie: ie,
+ dj_ie6: maj(ie) == 6,
+ dj_ie7: maj(ie) == 7,
+ dj_ie8: maj(ie) == 8,
+ dj_ie9: maj(ie) == 9,
+ dj_quirks: d.isQuirks,
+ dj_iequirks: ie && d.isQuirks,
+
+ // NOTE: Opera not supported by dijit
+ dj_opera: opera,
+
+ dj_khtml: d.isKhtml,
+
+ dj_webkit: d.isWebKit,
+ dj_safari: d.isSafari,
+ dj_chrome: d.isChrome,
+
+ dj_gecko: d.isMozilla,
+ dj_ff3: maj(ff) == 3
+ }; // no dojo unsupported browsers
+
+ classes["dj_" + boxModel] = true;
+
+ // apply browser, browser version, and box model class names
+ var classStr = "";
+ for(var clz in classes){
+ if(classes[clz]){
+ classStr += clz + " ";
+ }
+ }
+ html.className = d.trim(html.className + " " + classStr);
+
+ // If RTL mode, then add dj_rtl flag plus repeat existing classes with -rtl extension.
+ // We can't run the code below until the <body> tag has loaded (so we can check for dir=rtl).
+ // Unshift() is to run sniff code before the parser.
+ dojo._loaders.unshift(function(){
+ if(!dojo._isBodyLtr()){
+ var rtlClassStr = "dj_rtl dijitRtl " + classStr.replace(/ /g, "-rtl ")
+ html.className = d.trim(html.className + " " + rtlClassStr);
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dijit._base.sniff"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.sniff"] = true;
+dojo.provide("dijit._base.sniff");
+
+
+
+
+// summary:
+// Applies pre-set CSS classes to the top-level HTML node, see
+// `dojo.uacss` for details.
+//
+// Simply doing a require on this module will
+// establish this CSS. Modified version of Morris' CSS hack.
+
+}
+
+if(!dojo._hasResource["dijit._base.typematic"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.typematic"] = true;
+dojo.provide("dijit._base.typematic");
+
+
+
+dijit.typematic = {
+ // summary:
+ // These functions are used to repetitively call a user specified callback
+ // method when a specific key or mouse click over a specific DOM node is
+ // held down for a specific amount of time.
+ // Only 1 such event is allowed to occur on the browser page at 1 time.
+
+ _fireEventAndReload: function(){
+ this._timer = null;
+ this._callback(++this._count, this._node, this._evt);
+
+ // Schedule next event, timer is at most minDelay (default 10ms) to avoid
+ // browser overload (particularly avoiding starving DOH robot so it never gets to send a mouseup)
+ this._currentTimeout = Math.max(
+ this._currentTimeout < 0 ? this._initialDelay :
+ (this._subsequentDelay > 1 ? this._subsequentDelay : Math.round(this._currentTimeout * this._subsequentDelay)),
+ this._minDelay);
+ this._timer = setTimeout(dojo.hitch(this, "_fireEventAndReload"), this._currentTimeout);
+ },
+
+ trigger: function(/*Event*/ evt, /*Object*/ _this, /*DOMNode*/ node, /*Function*/ callback, /*Object*/ obj, /*Number*/ subsequentDelay, /*Number*/ initialDelay, /*Number?*/ minDelay){
+ // summary:
+ // Start a timed, repeating callback sequence.
+ // If already started, the function call is ignored.
+ // This method is not normally called by the user but can be
+ // when the normal listener code is insufficient.
+ // evt:
+ // key or mouse event object to pass to the user callback
+ // _this:
+ // pointer to the user's widget space.
+ // node:
+ // the DOM node object to pass the the callback function
+ // callback:
+ // function to call until the sequence is stopped called with 3 parameters:
+ // count:
+ // integer representing number of repeated calls (0..n) with -1 indicating the iteration has stopped
+ // node:
+ // the DOM node object passed in
+ // evt:
+ // key or mouse event object
+ // obj:
+ // user space object used to uniquely identify each typematic sequence
+ // subsequentDelay (optional):
+ // if > 1, the number of milliseconds until the 3->n events occur
+ // or else the fractional time multiplier for the next event's delay, default=0.9
+ // initialDelay (optional):
+ // the number of milliseconds until the 2nd event occurs, default=500ms
+ // minDelay (optional):
+ // the maximum delay in milliseconds for event to fire, default=10ms
+ if(obj != this._obj){
+ this.stop();
+ this._initialDelay = initialDelay || 500;
+ this._subsequentDelay = subsequentDelay || 0.90;
+ this._minDelay = minDelay || 10;
+ this._obj = obj;
+ this._evt = evt;
+ this._node = node;
+ this._currentTimeout = -1;
+ this._count = -1;
+ this._callback = dojo.hitch(_this, callback);
+ this._fireEventAndReload();
+ this._evt = dojo.mixin({faux: true}, evt);
+ }
+ },
+
+ stop: function(){
+ // summary:
+ // Stop an ongoing timed, repeating callback sequence.
+ if(this._timer){
+ clearTimeout(this._timer);
+ this._timer = null;
+ }
+ if(this._obj){
+ this._callback(-1, this._node, this._evt);
+ this._obj = null;
+ }
+ },
+
+ addKeyListener: function(/*DOMNode*/ node, /*Object*/ keyObject, /*Object*/ _this, /*Function*/ callback, /*Number*/ subsequentDelay, /*Number*/ initialDelay, /*Number?*/ minDelay){
+ // summary:
+ // Start listening for a specific typematic key.
+ // See also the trigger method for other parameters.
+ // keyObject:
+ // an object defining the key to listen for:
+ // charOrCode:
+ // the printable character (string) or keyCode (number) to listen for.
+ // keyCode:
+ // (deprecated - use charOrCode) the keyCode (number) to listen for (implies charCode = 0).
+ // charCode:
+ // (deprecated - use charOrCode) the charCode (number) to listen for.
+ // ctrlKey:
+ // desired ctrl key state to initiate the callback sequence:
+ // - pressed (true)
+ // - released (false)
+ // - either (unspecified)
+ // altKey:
+ // same as ctrlKey but for the alt key
+ // shiftKey:
+ // same as ctrlKey but for the shift key
+ // returns:
+ // an array of dojo.connect handles
+ if(keyObject.keyCode){
+ keyObject.charOrCode = keyObject.keyCode;
+ dojo.deprecated("keyCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.", "", "2.0");
+ }else if(keyObject.charCode){
+ keyObject.charOrCode = String.fromCharCode(keyObject.charCode);
+ dojo.deprecated("charCode attribute parameter for dijit.typematic.addKeyListener is deprecated. Use charOrCode instead.", "", "2.0");
+ }
+ return [
+ dojo.connect(node, "onkeypress", this, function(evt){
+ if(evt.charOrCode == keyObject.charOrCode &&
+ (keyObject.ctrlKey === undefined || keyObject.ctrlKey == evt.ctrlKey) &&
+ (keyObject.altKey === undefined || keyObject.altKey == evt.altKey) &&
+ (keyObject.metaKey === undefined || keyObject.metaKey == (evt.metaKey || false)) && // IE doesn't even set metaKey
+ (keyObject.shiftKey === undefined || keyObject.shiftKey == evt.shiftKey)){
+ dojo.stopEvent(evt);
+ dijit.typematic.trigger(evt, _this, node, callback, keyObject, subsequentDelay, initialDelay, minDelay);
+ }else if(dijit.typematic._obj == keyObject){
+ dijit.typematic.stop();
+ }
+ }),
+ dojo.connect(node, "onkeyup", this, function(evt){
+ if(dijit.typematic._obj == keyObject){
+ dijit.typematic.stop();
+ }
+ })
+ ];
+ },
+
+ addMouseListener: function(/*DOMNode*/ node, /*Object*/ _this, /*Function*/ callback, /*Number*/ subsequentDelay, /*Number*/ initialDelay, /*Number?*/ minDelay){
+ // summary:
+ // Start listening for a typematic mouse click.
+ // See the trigger method for other parameters.
+ // returns:
+ // an array of dojo.connect handles
+ var dc = dojo.connect;
+ return [
+ dc(node, "mousedown", this, function(evt){
+ dojo.stopEvent(evt);
+ dijit.typematic.trigger(evt, _this, node, callback, node, subsequentDelay, initialDelay, minDelay);
+ }),
+ dc(node, "mouseup", this, function(evt){
+ dojo.stopEvent(evt);
+ dijit.typematic.stop();
+ }),
+ dc(node, "mouseout", this, function(evt){
+ dojo.stopEvent(evt);
+ dijit.typematic.stop();
+ }),
+ dc(node, "mousemove", this, function(evt){
+ evt.preventDefault();
+ }),
+ dc(node, "dblclick", this, function(evt){
+ dojo.stopEvent(evt);
+ if(dojo.isIE){
+ dijit.typematic.trigger(evt, _this, node, callback, node, subsequentDelay, initialDelay, minDelay);
+ setTimeout(dojo.hitch(this, dijit.typematic.stop), 50);
+ }
+ })
+ ];
+ },
+
+ addListener: function(/*Node*/ mouseNode, /*Node*/ keyNode, /*Object*/ keyObject, /*Object*/ _this, /*Function*/ callback, /*Number*/ subsequentDelay, /*Number*/ initialDelay, /*Number?*/ minDelay){
+ // summary:
+ // Start listening for a specific typematic key and mouseclick.
+ // This is a thin wrapper to addKeyListener and addMouseListener.
+ // See the addMouseListener and addKeyListener methods for other parameters.
+ // mouseNode:
+ // the DOM node object to listen on for mouse events.
+ // keyNode:
+ // the DOM node object to listen on for key events.
+ // returns:
+ // an array of dojo.connect handles
+ return this.addKeyListener(keyNode, keyObject, _this, callback, subsequentDelay, initialDelay, minDelay).concat(
+ this.addMouseListener(mouseNode, _this, callback, subsequentDelay, initialDelay, minDelay));
+ }
+};
+
+}
+
+if(!dojo._hasResource["dijit._base.wai"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.wai"] = true;
+dojo.provide("dijit._base.wai");
+
+
+
+dijit.wai = {
+ onload: function(){
+ // summary:
+ // Detects if we are in high-contrast mode or not
+
+ // This must be a named function and not an anonymous
+ // function, so that the widget parsing code can make sure it
+ // registers its onload function after this function.
+ // DO NOT USE "this" within this function.
+
+ // create div for testing if high contrast mode is on or images are turned off
+ var div = dojo.create("div",{
+ id: "a11yTestNode",
+ style:{
+ cssText:'border: 1px solid;'
+ + 'border-color:red green;'
+ + 'position: absolute;'
+ + 'height: 5px;'
+ + 'top: -999px;'
+ + 'background-image: url("' + (dojo.config.blankGif || dojo.moduleUrl("dojo", "resources/blank.gif")) + '");'
+ }
+ }, dojo.body());
+
+ // test it
+ var cs = dojo.getComputedStyle(div);
+ if(cs){
+ var bkImg = cs.backgroundImage;
+ var needsA11y = (cs.borderTopColor == cs.borderRightColor) || (bkImg != null && (bkImg == "none" || bkImg == "url(invalid-url:)" ));
+ dojo[needsA11y ? "addClass" : "removeClass"](dojo.body(), "dijit_a11y");
+ if(dojo.isIE){
+ div.outerHTML = ""; // prevent mixed-content warning, see http://support.microsoft.com/kb/925014
+ }else{
+ dojo.body().removeChild(div);
+ }
+ }
+ }
+};
+
+// Test if computer is in high contrast mode.
+// Make sure the a11y test runs first, before widgets are instantiated.
+if(dojo.isIE || dojo.isMoz){ // NOTE: checking in Safari messes things up
+ dojo._loaders.unshift(dijit.wai.onload);
+}
+
+dojo.mixin(dijit, {
+ hasWaiRole: function(/*Element*/ elem, /*String?*/ role){
+ // summary:
+ // Determines if an element has a particular role.
+ // returns:
+ // True if elem has the specific role attribute and false if not.
+ // For backwards compatibility if role parameter not provided,
+ // returns true if has a role
+ var waiRole = this.getWaiRole(elem);
+ return role ? (waiRole.indexOf(role) > -1) : (waiRole.length > 0);
+ },
+
+ getWaiRole: function(/*Element*/ elem){
+ // summary:
+ // Gets the role for an element (which should be a wai role).
+ // returns:
+ // The role of elem or an empty string if elem
+ // does not have a role.
+ return dojo.trim((dojo.attr(elem, "role") || "").replace("wairole:",""));
+ },
+
+ setWaiRole: function(/*Element*/ elem, /*String*/ role){
+ // summary:
+ // Sets the role on an element.
+ // description:
+ // Replace existing role attribute with new role.
+
+ dojo.attr(elem, "role", role);
+ },
+
+ removeWaiRole: function(/*Element*/ elem, /*String*/ role){
+ // summary:
+ // Removes the specified role from an element.
+ // Removes role attribute if no specific role provided (for backwards compat.)
+
+ var roleValue = dojo.attr(elem, "role");
+ if(!roleValue){ return; }
+ if(role){
+ var t = dojo.trim((" " + roleValue + " ").replace(" " + role + " ", " "));
+ dojo.attr(elem, "role", t);
+ }else{
+ elem.removeAttribute("role");
+ }
+ },
+
+ hasWaiState: function(/*Element*/ elem, /*String*/ state){
+ // summary:
+ // Determines if an element has a given state.
+ // description:
+ // Checks for an attribute called "aria-"+state.
+ // returns:
+ // true if elem has a value for the given state and
+ // false if it does not.
+
+ return elem.hasAttribute ? elem.hasAttribute("aria-"+state) : !!elem.getAttribute("aria-"+state);
+ },
+
+ getWaiState: function(/*Element*/ elem, /*String*/ state){
+ // summary:
+ // Gets the value of a state on an element.
+ // description:
+ // Checks for an attribute called "aria-"+state.
+ // returns:
+ // The value of the requested state on elem
+ // or an empty string if elem has no value for state.
+
+ return elem.getAttribute("aria-"+state) || "";
+ },
+
+ setWaiState: function(/*Element*/ elem, /*String*/ state, /*String*/ value){
+ // summary:
+ // Sets a state on an element.
+ // description:
+ // Sets an attribute called "aria-"+state.
+
+ elem.setAttribute("aria-"+state, value);
+ },
+
+ removeWaiState: function(/*Element*/ elem, /*String*/ state){
+ // summary:
+ // Removes a state from an element.
+ // description:
+ // Sets an attribute called "aria-"+state.
+
+ elem.removeAttribute("aria-"+state);
+ }
+});
+
+}
+
+if(!dojo._hasResource["dijit._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base"] = true;
+dojo.provide("dijit._base");
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
+if(!dojo._hasResource["dojo.Stateful"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.Stateful"] = true;
+dojo.provide("dojo.Stateful");
+
+
+
+dojo.declare("dojo.Stateful", null, {
+ // summary:
+ // Base class for objects that provide named properties with optional getter/setter
+ // control and the ability to watch for property changes
+ // example:
+ // | var obj = new dojo.Stateful();
+ // | obj.watch("foo", function(){
+ // | console.log("foo changed to " + this.get("foo"));
+ // | });
+ // | obj.set("foo","bar");
+ postscript: function(mixin){
+ if(mixin){
+ dojo.mixin(this, mixin);
+ }
+ },
+
+ get: function(/*String*/name){
+ // summary:
+ // Get a property on a Stateful instance.
+ // name:
+ // The property to get.
+ // description:
+ // Get a named property on a Stateful object. The property may
+ // potentially be retrieved via a getter method in subclasses. In the base class
+ // this just retrieves the object's property.
+ // For example:
+ // | stateful = new dojo.Stateful({foo: 3});
+ // | stateful.get("foo") // returns 3
+ // | stateful.foo // returns 3
+
+ return this[name];
+ },
+ set: function(/*String*/name, /*Object*/value){
+ // summary:
+ // Set a property on a Stateful instance
+ // name:
+ // The property to set.
+ // value:
+ // The value to set in the property.
+ // description:
+ // Sets named properties on a stateful object and notifies any watchers of
+ // the property. A programmatic setter may be defined in subclasses.
+ // For example:
+ // | stateful = new dojo.Stateful();
+ // | stateful.watch(function(name, oldValue, value){
+ // | // this will be called on the set below
+ // | }
+ // | stateful.set(foo, 5);
+ //
+ // set() may also be called with a hash of name/value pairs, ex:
+ // | myObj.set({
+ // | foo: "Howdy",
+ // | bar: 3
+ // | })
+ // This is equivalent to calling set(foo, "Howdy") and set(bar, 3)
+ if(typeof name === "object"){
+ for(var x in name){
+ this.set(x, name[x]);
+ }
+ return this;
+ }
+ var oldValue = this[name];
+ this[name] = value;
+ if(this._watchCallbacks){
+ this._watchCallbacks(name, oldValue, value);
+ }
+ return this;
+ },
+ watch: function(/*String?*/name, /*Function*/callback){
+ // summary:
+ // Watches a property for changes
+ // name:
+ // Indicates the property to watch. This is optional (the callback may be the
+ // only parameter), and if omitted, all the properties will be watched
+ // returns:
+ // An object handle for the watch. The unwatch method of this object
+ // can be used to discontinue watching this property:
+ // | var watchHandle = obj.watch("foo", callback);
+ // | watchHandle.unwatch(); // callback won't be called now
+ // callback:
+ // The function to execute when the property changes. This will be called after
+ // the property has been changed. The callback will be called with the |this|
+ // set to the instance, the first argument as the name of the property, the
+ // second argument as the old value and the third argument as the new value.
+
+ var callbacks = this._watchCallbacks;
+ if(!callbacks){
+ var self = this;
+ callbacks = this._watchCallbacks = function(name, oldValue, value, ignoreCatchall){
+ var notify = function(propertyCallbacks){
+ if(propertyCallbacks){
+ propertyCallbacks = propertyCallbacks.slice();
+ for(var i = 0, l = propertyCallbacks.length; i < l; i++){
+ try{
+ propertyCallbacks[i].call(self, name, oldValue, value);
+ }catch(e){
+ console.error(e);
+ }
+ }
+ }
+ };
+ notify(callbacks['_' + name]);
+ if(!ignoreCatchall){
+ notify(callbacks["*"]); // the catch-all
+ }
+ }; // we use a function instead of an object so it will be ignored by JSON conversion
+ }
+ if(!callback && typeof name === "function"){
+ callback = name;
+ name = "*";
+ }else{
+ // prepend with dash to prevent name conflicts with function (like "name" property)
+ name = '_' + name;
+ }
+ var propertyCallbacks = callbacks[name];
+ if(typeof propertyCallbacks !== "object"){
+ propertyCallbacks = callbacks[name] = [];
+ }
+ propertyCallbacks.push(callback);
+ return {
+ unwatch: function(){
+ propertyCallbacks.splice(dojo.indexOf(propertyCallbacks, callback), 1);
+ }
+ };
+ }
+
+});
+
+}
+
+if(!dojo._hasResource["dijit._WidgetBase"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._WidgetBase"] = true;
+dojo.provide("dijit._WidgetBase");
+
+
+
+
+
+(function(){
+
+dojo.declare("dijit._WidgetBase", dojo.Stateful, {
+ // summary:
+ // Future base class for all Dijit widgets.
+ // _Widget extends this class adding support for various features needed by desktop.
+
+ // id: [const] String
+ // A unique, opaque ID string that can be assigned by users or by the
+ // system. If the developer passes an ID which is known not to be
+ // unique, the specified ID is ignored and the system-generated ID is
+ // used instead.
+ id: "",
+
+ // lang: [const] String
+ // Rarely used. Overrides the default Dojo locale used to render this widget,
+ // as defined by the [HTML LANG](http://www.w3.org/TR/html401/struct/dirlang.html#adef-lang) attribute.
+ // Value must be among the list of locales specified during by the Dojo bootstrap,
+ // formatted according to [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt) (like en-us).
+ lang: "",
+
+ // dir: [const] String
+ // Bi-directional support, as defined by the [HTML DIR](http://www.w3.org/TR/html401/struct/dirlang.html#adef-dir)
+ // attribute. Either left-to-right "ltr" or right-to-left "rtl". If undefined, widgets renders in page's
+ // default direction.
+ dir: "",
+
+ // class: String
+ // HTML class attribute
+ "class": "",
+
+ // style: String||Object
+ // HTML style attributes as cssText string or name/value hash
+ style: "",
+
+ // title: String
+ // HTML title attribute.
+ //
+ // For form widgets this specifies a tooltip to display when hovering over
+ // the widget (just like the native HTML title attribute).
+ //
+ // For TitlePane or for when this widget is a child of a TabContainer, AccordionContainer,
+ // etc., it's used to specify the tab label, accordion pane title, etc.
+ title: "",
+
+ // tooltip: String
+ // When this widget's title attribute is used to for a tab label, accordion pane title, etc.,
+ // this specifies the tooltip to appear when the mouse is hovered over that text.
+ tooltip: "",
+
+ // baseClass: [protected] String
+ // Root CSS class of the widget (ex: dijitTextBox), used to construct CSS classes to indicate
+ // widget state.
+ baseClass: "",
+
+ // srcNodeRef: [readonly] DomNode
+ // pointer to original DOM node
+ srcNodeRef: null,
+
+ // domNode: [readonly] DomNode
+ // This is our visible representation of the widget! Other DOM
+ // Nodes may by assigned to other properties, usually through the
+ // template system's dojoAttachPoint syntax, but the domNode
+ // property is the canonical "top level" node in widget UI.
+ domNode: null,
+
+ // containerNode: [readonly] DomNode
+ // Designates where children of the source DOM node will be placed.
+ // "Children" in this case refers to both DOM nodes and widgets.
+ // For example, for myWidget:
+ //
+ // | <div dojoType=myWidget>
+ // | <b> here's a plain DOM node
+ // | <span dojoType=subWidget>and a widget</span>
+ // | <i> and another plain DOM node </i>
+ // | </div>
+ //
+ // containerNode would point to:
+ //
+ // | <b> here's a plain DOM node
+ // | <span dojoType=subWidget>and a widget</span>
+ // | <i> and another plain DOM node </i>
+ //
+ // In templated widgets, "containerNode" is set via a
+ // dojoAttachPoint assignment.
+ //
+ // containerNode must be defined for any widget that accepts innerHTML
+ // (like ContentPane or BorderContainer or even Button), and conversely
+ // is null for widgets that don't, like TextBox.
+ containerNode: null,
+
+/*=====
+ // _started: Boolean
+ // startup() has completed.
+ _started: false,
+=====*/
+
+ // attributeMap: [protected] Object
+ // attributeMap sets up a "binding" between attributes (aka properties)
+ // of the widget and the widget's DOM.
+ // Changes to widget attributes listed in attributeMap will be
+ // reflected into the DOM.
+ //
+ // For example, calling set('title', 'hello')
+ // on a TitlePane will automatically cause the TitlePane's DOM to update
+ // with the new title.
+ //
+ // attributeMap is a hash where the key is an attribute of the widget,
+ // and the value reflects a binding to a:
+ //
+ // - DOM node attribute
+ // | focus: {node: "focusNode", type: "attribute"}
+ // Maps this.focus to this.focusNode.focus
+ //
+ // - DOM node innerHTML
+ // | title: { node: "titleNode", type: "innerHTML" }
+ // Maps this.title to this.titleNode.innerHTML
+ //
+ // - DOM node innerText
+ // | title: { node: "titleNode", type: "innerText" }
+ // Maps this.title to this.titleNode.innerText
+ //
+ // - DOM node CSS class
+ // | myClass: { node: "domNode", type: "class" }
+ // Maps this.myClass to this.domNode.className
+ //
+ // If the value is an array, then each element in the array matches one of the
+ // formats of the above list.
+ //
+ // There are also some shorthands for backwards compatibility:
+ // - string --> { node: string, type: "attribute" }, for example:
+ // | "focusNode" ---> { node: "focusNode", type: "attribute" }
+ // - "" --> { node: "domNode", type: "attribute" }
+ attributeMap: {id:"", dir:"", lang:"", "class":"", style:"", title:""},
+
+ // _blankGif: [protected] String
+ // Path to a blank 1x1 image.
+ // Used by <img> nodes in templates that really get their image via CSS background-image.
+ _blankGif: (dojo.config.blankGif || dojo.moduleUrl("dojo", "resources/blank.gif")).toString(),
+
+ //////////// INITIALIZATION METHODS ///////////////////////////////////////
+
+ postscript: function(/*Object?*/params, /*DomNode|String*/srcNodeRef){
+ // summary:
+ // Kicks off widget instantiation. See create() for details.
+ // tags:
+ // private
+ this.create(params, srcNodeRef);
+ },
+
+ create: function(/*Object?*/params, /*DomNode|String?*/srcNodeRef){
+ // summary:
+ // Kick off the life-cycle of a widget
+ // params:
+ // Hash of initialization parameters for widget, including
+ // scalar values (like title, duration etc.) and functions,
+ // typically callbacks like onClick.
+ // srcNodeRef:
+ // If a srcNodeRef (DOM node) is specified:
+ // - use srcNodeRef.innerHTML as my contents
+ // - if this is a behavioral widget then apply behavior
+ // to that srcNodeRef
+ // - otherwise, replace srcNodeRef with my generated DOM
+ // tree
+ // description:
+ // Create calls a number of widget methods (postMixInProperties, buildRendering, postCreate,
+ // etc.), some of which of you'll want to override. See http://docs.dojocampus.org/dijit/_Widget
+ // for a discussion of the widget creation lifecycle.
+ //
+ // Of course, adventurous developers could override create entirely, but this should
+ // only be done as a last resort.
+ // tags:
+ // private
+
+ // store pointer to original DOM tree
+ this.srcNodeRef = dojo.byId(srcNodeRef);
+
+ // For garbage collection. An array of handles returned by Widget.connect()
+ // Each handle returned from Widget.connect() is an array of handles from dojo.connect()
+ this._connects = [];
+
+ // For garbage collection. An array of handles returned by Widget.subscribe()
+ // The handle returned from Widget.subscribe() is the handle returned from dojo.subscribe()
+ this._subscribes = [];
+
+ // mix in our passed parameters
+ if(this.srcNodeRef && (typeof this.srcNodeRef.id == "string")){ this.id = this.srcNodeRef.id; }
+ if(params){
+ this.params = params;
+ dojo._mixin(this, params);
+ }
+ this.postMixInProperties();
+
+ // generate an id for the widget if one wasn't specified
+ // (be sure to do this before buildRendering() because that function might
+ // expect the id to be there.)
+ if(!this.id){
+ this.id = dijit.getUniqueId(this.declaredClass.replace(/\./g,"_"));
+ }
+ dijit.registry.add(this);
+
+ this.buildRendering();
+
+ if(this.domNode){
+ // Copy attributes listed in attributeMap into the [newly created] DOM for the widget.
+ // Also calls custom setters for all attributes with custom setters.
+ this._applyAttributes();
+
+ // If srcNodeRef was specified, then swap out original srcNode for this widget's DOM tree.
+ // For 2.0, move this after postCreate(). postCreate() shouldn't depend on the
+ // widget being attached to the DOM since it isn't when a widget is created programmatically like
+ // new MyWidget({}). See #11635.
+ var source = this.srcNodeRef;
+ if(source && source.parentNode && this.domNode !== source){
+ source.parentNode.replaceChild(this.domNode, source);
+ }
+ }
+
+ if(this.domNode){
+ // Note: for 2.0 may want to rename widgetId to dojo._scopeName + "_widgetId",
+ // assuming that dojo._scopeName even exists in 2.0
+ this.domNode.setAttribute("widgetId", this.id);
+ }
+ this.postCreate();
+
+ // If srcNodeRef has been processed and removed from the DOM (e.g. TemplatedWidget) then delete it to allow GC.
+ if(this.srcNodeRef && !this.srcNodeRef.parentNode){
+ delete this.srcNodeRef;
+ }
+
+ this._created = true;
+ },
+
+ _applyAttributes: function(){
+ // summary:
+ // Step during widget creation to copy all widget attributes to the
+ // DOM as per attributeMap and _setXXXAttr functions.
+ // description:
+ // Skips over blank/false attribute values, unless they were explicitly specified
+ // as parameters to the widget, since those are the default anyway,
+ // and setting tabIndex="" is different than not setting tabIndex at all.
+ //
+ // It processes the attributes in the attribute map first, and then
+ // it goes through and processes the attributes for the _setXXXAttr
+ // functions that have been specified
+ // tags:
+ // private
+ var condAttrApply = function(attr, scope){
+ if((scope.params && attr in scope.params) || scope[attr]){
+ scope.set(attr, scope[attr]);
+ }
+ };
+
+ // Do the attributes in attributeMap
+ for(var attr in this.attributeMap){
+ condAttrApply(attr, this);
+ }
+
+ // And also any attributes with custom setters
+ dojo.forEach(this._getSetterAttributes(), function(a){
+ if(!(a in this.attributeMap)){
+ condAttrApply(a, this);
+ }
+ }, this);
+ },
+
+ _getSetterAttributes: function(){
+ // summary:
+ // Returns list of attributes with custom setters for this widget
+ var ctor = this.constructor;
+ if(!ctor._setterAttrs){
+ var r = (ctor._setterAttrs = []),
+ attrs,
+ proto = ctor.prototype;
+ for(var fxName in proto){
+ if(dojo.isFunction(proto[fxName]) && (attrs = fxName.match(/^_set([a-zA-Z]*)Attr$/)) && attrs[1]){
+ r.push(attrs[1].charAt(0).toLowerCase() + attrs[1].substr(1));
+ }
+ }
+ }
+ return ctor._setterAttrs; // String[]
+ },
+
+ postMixInProperties: function(){
+ // summary:
+ // Called after the parameters to the widget have been read-in,
+ // but before the widget template is instantiated. Especially
+ // useful to set properties that are referenced in the widget
+ // template.
+ // tags:
+ // protected
+ },
+
+ buildRendering: function(){
+ // summary:
+ // Construct the UI for this widget, setting this.domNode
+ // description:
+ // Most widgets will mixin `dijit._Templated`, which implements this
+ // method.
+ // tags:
+ // protected
+
+ if(!this.domNode){
+ // Create root node if it wasn't created by _Templated
+ this.domNode = this.srcNodeRef || dojo.create('div');
+ }
+
+ // baseClass is a single class name or occasionally a space-separated list of names.
+ // Add those classes to the DOMNode. If RTL mode then also add with Rtl suffix.
+ // TODO: make baseClass custom setter
+ if(this.baseClass){
+ var classes = this.baseClass.split(" ");
+ if(!this.isLeftToRight()){
+ classes = classes.concat( dojo.map(classes, function(name){ return name+"Rtl"; }));
+ }
+ dojo.addClass(this.domNode, classes);
+ }
+ },
+
+ postCreate: function(){
+ // summary:
+ // Processing after the DOM fragment is created
+ // description:
+ // Called after the DOM fragment has been created, but not necessarily
+ // added to the document. Do not include any operations which rely on
+ // node dimensions or placement.
+ // tags:
+ // protected
+ },
+
+ startup: function(){
+ // summary:
+ // Processing after the DOM fragment is added to the document
+ // description:
+ // Called after a widget and its children have been created and added to the page,
+ // and all related widgets have finished their create() cycle, up through postCreate().
+ // This is useful for composite widgets that need to control or layout sub-widgets.
+ // Many layout widgets can use this as a wiring phase.
+ this._started = true;
+ },
+
+ //////////// DESTROY FUNCTIONS ////////////////////////////////
+
+ destroyRecursive: function(/*Boolean?*/ preserveDom){
+ // summary:
+ // Destroy this widget and its descendants
+ // description:
+ // This is the generic "destructor" function that all widget users
+ // should call to cleanly discard with a widget. Once a widget is
+ // destroyed, it is removed from the manager object.
+ // preserveDom:
+ // If true, this method will leave the original DOM structure
+ // alone of descendant Widgets. Note: This will NOT work with
+ // dijit._Templated widgets.
+
+ this._beingDestroyed = true;
+ this.destroyDescendants(preserveDom);
+ this.destroy(preserveDom);
+ },
+
+ destroy: function(/*Boolean*/ preserveDom){
+ // summary:
+ // Destroy this widget, but not its descendants.
+ // This method will, however, destroy internal widgets such as those used within a template.
+ // preserveDom: Boolean
+ // If true, this method will leave the original DOM structure alone.
+ // Note: This will not yet work with _Templated widgets
+
+ this._beingDestroyed = true;
+ this.uninitialize();
+ var d = dojo,
+ dfe = d.forEach,
+ dun = d.unsubscribe;
+ dfe(this._connects, function(array){
+ dfe(array, d.disconnect);
+ });
+ dfe(this._subscribes, function(handle){
+ dun(handle);
+ });
+
+ // destroy widgets created as part of template, etc.
+ dfe(this._supportingWidgets || [], function(w){
+ if(w.destroyRecursive){
+ w.destroyRecursive();
+ }else if(w.destroy){
+ w.destroy();
+ }
+ });
+
+ this.destroyRendering(preserveDom);
+ dijit.registry.remove(this.id);
+ this._destroyed = true;
+ },
+
+ destroyRendering: function(/*Boolean?*/ preserveDom){
+ // summary:
+ // Destroys the DOM nodes associated with this widget
+ // preserveDom:
+ // If true, this method will leave the original DOM structure alone
+ // during tear-down. Note: this will not work with _Templated
+ // widgets yet.
+ // tags:
+ // protected
+
+ if(this.bgIframe){
+ this.bgIframe.destroy(preserveDom);
+ delete this.bgIframe;
+ }
+
+ if(this.domNode){
+ if(preserveDom){
+ dojo.removeAttr(this.domNode, "widgetId");
+ }else{
+ dojo.destroy(this.domNode);
+ }
+ delete this.domNode;
+ }
+
+ if(this.srcNodeRef){
+ if(!preserveDom){
+ dojo.destroy(this.srcNodeRef);
+ }
+ delete this.srcNodeRef;
+ }
+ },
+
+ destroyDescendants: function(/*Boolean?*/ preserveDom){
+ // summary:
+ // Recursively destroy the children of this widget and their
+ // descendants.
+ // preserveDom:
+ // If true, the preserveDom attribute is passed to all descendant
+ // widget's .destroy() method. Not for use with _Templated
+ // widgets.
+
+ // get all direct descendants and destroy them recursively
+ dojo.forEach(this.getChildren(), function(widget){
+ if(widget.destroyRecursive){
+ widget.destroyRecursive(preserveDom);
+ }
+ });
+ },
+
+ uninitialize: function(){
+ // summary:
+ // Stub function. Override to implement custom widget tear-down
+ // behavior.
+ // tags:
+ // protected
+ return false;
+ },
+
+ ////////////////// GET/SET, CUSTOM SETTERS, ETC. ///////////////////
+
+ _setClassAttr: function(/*String*/ value){
+ // summary:
+ // Custom setter for the CSS "class" attribute
+ // tags:
+ // protected
+ var mapNode = this[this.attributeMap["class"] || 'domNode'];
+ dojo.replaceClass(mapNode, value, this["class"]);
+ this._set("class", value);
+ },
+
+ _setStyleAttr: function(/*String||Object*/ value){
+ // summary:
+ // Sets the style attribute of the widget according to value,
+ // which is either a hash like {height: "5px", width: "3px"}
+ // or a plain string
+ // description:
+ // Determines which node to set the style on based on style setting
+ // in attributeMap.
+ // tags:
+ // protected
+
+ var mapNode = this[this.attributeMap.style || 'domNode'];
+
+ // Note: technically we should revert any style setting made in a previous call
+ // to his method, but that's difficult to keep track of.
+
+ if(dojo.isObject(value)){
+ dojo.style(mapNode, value);
+ }else{
+ if(mapNode.style.cssText){
+ mapNode.style.cssText += "; " + value;
+ }else{
+ mapNode.style.cssText = value;
+ }
+ }
+
+ this._set("style", value);
+ },
+
+ _attrToDom: function(/*String*/ attr, /*String*/ value){
+ // summary:
+ // Reflect a widget attribute (title, tabIndex, duration etc.) to
+ // the widget DOM, as specified in attributeMap.
+ // Note some attributes like "type"
+ // cannot be processed this way as they are not mutable.
+ //
+ // tags:
+ // private
+
+ var commands = this.attributeMap[attr];
+ dojo.forEach(dojo.isArray(commands) ? commands : [commands], function(command){
+
+ // Get target node and what we are doing to that node
+ var mapNode = this[command.node || command || "domNode"]; // DOM node
+ var type = command.type || "attribute"; // class, innerHTML, innerText, or attribute
+
+ switch(type){
+ case "attribute":
+ if(dojo.isFunction(value)){ // functions execute in the context of the widget
+ value = dojo.hitch(this, value);
+ }
+
+ // Get the name of the DOM node attribute; usually it's the same
+ // as the name of the attribute in the widget (attr), but can be overridden.
+ // Also maps handler names to lowercase, like onSubmit --> onsubmit
+ var attrName = command.attribute ? command.attribute :
+ (/^on[A-Z][a-zA-Z]*$/.test(attr) ? attr.toLowerCase() : attr);
+
+ dojo.attr(mapNode, attrName, value);
+ break;
+ case "innerText":
+ mapNode.innerHTML = "";
+ mapNode.appendChild(dojo.doc.createTextNode(value));
+ break;
+ case "innerHTML":
+ mapNode.innerHTML = value;
+ break;
+ case "class":
+ dojo.replaceClass(mapNode, value, this[attr]);
+ break;
+ }
+ }, this);
+ },
+
+ get: function(name){
+ // summary:
+ // Get a property from a widget.
+ // name:
+ // The property to get.
+ // description:
+ // Get a named property from a widget. The property may
+ // potentially be retrieved via a getter method. If no getter is defined, this
+ // just retrieves the object's property.
+ // For example, if the widget has a properties "foo"
+ // and "bar" and a method named "_getFooAttr", calling:
+ // | myWidget.get("foo");
+ // would be equivalent to writing:
+ // | widget._getFooAttr();
+ // and:
+ // | myWidget.get("bar");
+ // would be equivalent to writing:
+ // | widget.bar;
+ var names = this._getAttrNames(name);
+ return this[names.g] ? this[names.g]() : this[name];
+ },
+
+ set: function(name, value){
+ // summary:
+ // Set a property on a widget
+ // name:
+ // The property to set.
+ // value:
+ // The value to set in the property.
+ // description:
+ // Sets named properties on a widget which may potentially be handled by a
+ // setter in the widget.
+ // For example, if the widget has a properties "foo"
+ // and "bar" and a method named "_setFooAttr", calling:
+ // | myWidget.set("foo", "Howdy!");
+ // would be equivalent to writing:
+ // | widget._setFooAttr("Howdy!");
+ // and:
+ // | myWidget.set("bar", 3);
+ // would be equivalent to writing:
+ // | widget.bar = 3;
+ //
+ // set() may also be called with a hash of name/value pairs, ex:
+ // | myWidget.set({
+ // | foo: "Howdy",
+ // | bar: 3
+ // | })
+ // This is equivalent to calling set(foo, "Howdy") and set(bar, 3)
+
+ if(typeof name === "object"){
+ for(var x in name){
+ this.set(x, name[x]);
+ }
+ return this;
+ }
+ var names = this._getAttrNames(name);
+ if(this[names.s]){
+ // use the explicit setter
+ var result = this[names.s].apply(this, Array.prototype.slice.call(arguments, 1));
+ }else{
+ // if param is specified as DOM node attribute, copy it
+ if(name in this.attributeMap){
+ this._attrToDom(name, value);
+ }
+ this._set(name, value);
+ }
+ return result || this;
+ },
+
+ _attrPairNames: {}, // shared between all widgets
+ _getAttrNames: function(name){
+ // summary:
+ // Helper function for get() and set().
+ // Caches attribute name values so we don't do the string ops every time.
+ // tags:
+ // private
+
+ var apn = this._attrPairNames;
+ if(apn[name]){ return apn[name]; }
+ var uc = name.charAt(0).toUpperCase() + name.substr(1);
+ return (apn[name] = {
+ n: name+"Node",
+ s: "_set"+uc+"Attr",
+ g: "_get"+uc+"Attr"
+ });
+ },
+
+ _set: function(/*String*/ name, /*anything*/ value){
+ // summary:
+ // Helper function to set new value for specified attribute, and call handlers
+ // registered with watch() if the value has changed.
+ var oldValue = this[name];
+ this[name] = value;
+ if(this._watchCallbacks && this._created && value !== oldValue){
+ this._watchCallbacks(name, oldValue, value);
+ }
+ },
+
+ toString: function(){
+ // summary:
+ // Returns a string that represents the widget
+ // description:
+ // When a widget is cast to a string, this method will be used to generate the
+ // output. Currently, it does not implement any sort of reversible
+ // serialization.
+ return '[Widget ' + this.declaredClass + ', ' + (this.id || 'NO ID') + ']'; // String
+ },
+
+ getDescendants: function(){
+ // summary:
+ // Returns all the widgets contained by this, i.e., all widgets underneath this.containerNode.
+ // This method should generally be avoided as it returns widgets declared in templates, which are
+ // supposed to be internal/hidden, but it's left here for back-compat reasons.
+
+ return this.containerNode ? dojo.query('[widgetId]', this.containerNode).map(dijit.byNode) : []; // dijit._Widget[]
+ },
+
+ getChildren: function(){
+ // summary:
+ // Returns all the widgets contained by this, i.e., all widgets underneath this.containerNode.
+ // Does not return nested widgets, nor widgets that are part of this widget's template.
+ return this.containerNode ? dijit.findWidgets(this.containerNode) : []; // dijit._Widget[]
+ },
+
+ connect: function(
+ /*Object|null*/ obj,
+ /*String|Function*/ event,
+ /*String|Function*/ method){
+ // summary:
+ // Connects specified obj/event to specified method of this object
+ // and registers for disconnect() on widget destroy.
+ // description:
+ // Provide widget-specific analog to dojo.connect, except with the
+ // implicit use of this widget as the target object.
+ // Events connected with `this.connect` are disconnected upon
+ // destruction.
+ // returns:
+ // A handle that can be passed to `disconnect` in order to disconnect before
+ // the widget is destroyed.
+ // example:
+ // | var btn = new dijit.form.Button();
+ // | // when foo.bar() is called, call the listener we're going to
+ // | // provide in the scope of btn
+ // | btn.connect(foo, "bar", function(){
+ // | console.debug(this.toString());
+ // | });
+ // tags:
+ // protected
+
+ var handles = [dojo._connect(obj, event, this, method)];
+ this._connects.push(handles);
+ return handles; // _Widget.Handle
+ },
+
+ disconnect: function(/* _Widget.Handle */ handles){
+ // summary:
+ // Disconnects handle created by `connect`.
+ // Also removes handle from this widget's list of connects.
+ // tags:
+ // protected
+ for(var i=0; i<this._connects.length; i++){
+ if(this._connects[i] == handles){
+ dojo.forEach(handles, dojo.disconnect);
+ this._connects.splice(i, 1);
+ return;
+ }
+ }
+ },
+
+ subscribe: function(
+ /*String*/ topic,
+ /*String|Function*/ method){
+ // summary:
+ // Subscribes to the specified topic and calls the specified method
+ // of this object and registers for unsubscribe() on widget destroy.
+ // description:
+ // Provide widget-specific analog to dojo.subscribe, except with the
+ // implicit use of this widget as the target object.
+ // example:
+ // | var btn = new dijit.form.Button();
+ // | // when /my/topic is published, this button changes its label to
+ // | // be the parameter of the topic.
+ // | btn.subscribe("/my/topic", function(v){
+ // | this.set("label", v);
+ // | });
+ var handle = dojo.subscribe(topic, this, method);
+
+ // return handles for Any widget that may need them
+ this._subscribes.push(handle);
+ return handle;
+ },
+
+ unsubscribe: function(/*Object*/ handle){
+ // summary:
+ // Unsubscribes handle created by this.subscribe.
+ // Also removes handle from this widget's list of subscriptions
+ for(var i=0; i<this._subscribes.length; i++){
+ if(this._subscribes[i] == handle){
+ dojo.unsubscribe(handle);
+ this._subscribes.splice(i, 1);
+ return;
+ }
+ }
+ },
+
+ isLeftToRight: function(){
+ // summary:
+ // Return this widget's explicit or implicit orientation (true for LTR, false for RTL)
+ // tags:
+ // protected
+ return this.dir ? (this.dir == "ltr") : dojo._isBodyLtr(); //Boolean
+ },
+
+ placeAt: function(/* String|DomNode|_Widget */reference, /* String?|Int? */position){
+ // summary:
+ // Place this widget's domNode reference somewhere in the DOM based
+ // on standard dojo.place conventions, or passing a Widget reference that
+ // contains and addChild member.
+ //
+ // description:
+ // A convenience function provided in all _Widgets, providing a simple
+ // shorthand mechanism to put an existing (or newly created) Widget
+ // somewhere in the dom, and allow chaining.
+ //
+ // reference:
+ // The String id of a domNode, a domNode reference, or a reference to a Widget posessing
+ // an addChild method.
+ //
+ // position:
+ // If passed a string or domNode reference, the position argument
+ // accepts a string just as dojo.place does, one of: "first", "last",
+ // "before", or "after".
+ //
+ // If passed a _Widget reference, and that widget reference has an ".addChild" method,
+ // it will be called passing this widget instance into that method, supplying the optional
+ // position index passed.
+ //
+ // returns:
+ // dijit._Widget
+ // Provides a useful return of the newly created dijit._Widget instance so you
+ // can "chain" this function by instantiating, placing, then saving the return value
+ // to a variable.
+ //
+ // example:
+ // | // create a Button with no srcNodeRef, and place it in the body:
+ // | var button = new dijit.form.Button({ label:"click" }).placeAt(dojo.body());
+ // | // now, 'button' is still the widget reference to the newly created button
+ // | dojo.connect(button, "onClick", function(e){ console.log('click'); });
+ //
+ // example:
+ // | // create a button out of a node with id="src" and append it to id="wrapper":
+ // | var button = new dijit.form.Button({},"src").placeAt("wrapper");
+ //
+ // example:
+ // | // place a new button as the first element of some div
+ // | var button = new dijit.form.Button({ label:"click" }).placeAt("wrapper","first");
+ //
+ // example:
+ // | // create a contentpane and add it to a TabContainer
+ // | var tc = dijit.byId("myTabs");
+ // | new dijit.layout.ContentPane({ href:"foo.html", title:"Wow!" }).placeAt(tc)
+
+ if(reference.declaredClass && reference.addChild){
+ reference.addChild(this, position);
+ }else{
+ dojo.place(this.domNode, reference, position);
+ }
+ return this;
+ }
+});
+
+})();
+
+}
+
+if(!dojo._hasResource["dojox.mobile._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile._base"] = true;
+dojo.provide("dojox.mobile._base");
+
+
+dojo.isBB = (navigator.userAgent.indexOf("BlackBerry") != -1) && !dojo.isWebKit;
+
+// summary:
+// Mobile Widgets
+// description:
+// This module provides a number of widgets that can be used to build
+// web-based applications for mobile devices such as iPhone or Android.
+// These widgets work best with webkit-based browsers, such as Safari or
+// Chrome, since webkit-specific CSS3 features are used.
+// However, the widgets should work in a "graceful degradation" manner
+// even on non-CSS3 browsers, such as IE or Firefox. In that case,
+// fancy effects, such as animation, gradient color, or round corner
+// rectangle, may not work, but you can still operate your application.
+//
+// Furthermore, as a separate file, a compatibility module,
+// dojox.mobile.compat, is available that simulates some of CSS3 features
+// used in this module. If you use the compatibility module, fancy visual
+// effects work better even on non-CSS3 browsers.
+//
+// Note that use of dijit._Container, dijit._Contained, dijit._Templated,
+// and dojo.query is intentionally avoided to reduce download code size.
+
+dojo.declare(
+ "dojox.mobile.View",
+ dijit._WidgetBase,
+{
+ // summary:
+ // A widget that represents a view that occupies the full screen
+ // description:
+ // View acts as a container for any HTML and/or widgets. An entire HTML page
+ // can have multiple View widgets and the user can navigate through
+ // the views back and forth without page transitions.
+
+ // selected: Boolean
+ // If true, the view is displayed at startup time.
+ selected: false,
+
+ // keepScrollPos: Boolean
+ // If true, the scroll position is kept between views.
+ keepScrollPos: true,
+
+ _started: false,
+
+ constructor: function(params, node){
+ if(node){
+ dojo.byId(node).style.visibility = "hidden";
+ }
+ },
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("DIV");
+ this.domNode.className = "mblView";
+ this.connect(this.domNode, "webkitAnimationEnd", "onAnimationEnd");
+ this.connect(this.domNode, "webkitAnimationStart", "onAnimationStart");
+ var id = location.href.match(/#(\w+)([^\w=]|$)/) ? RegExp.$1 : null;
+
+ this._visible = this.selected && !id || this.id == id;
+
+ if(this.selected){
+ dojox.mobile._defaultView = this;
+ }
+ },
+
+ startup: function(){
+ if(this._started){ return; }
+ var _this = this;
+ setTimeout(function(){
+ if(!_this._visible){
+ _this.domNode.style.display = "none";
+ }else{
+ dojox.mobile.currentView = _this;
+ _this.onStartView();
+ }
+ _this.domNode.style.visibility = "visible";
+ }, dojo.isIE?100:0); // give IE a little time to complete drawing
+ this._started = true;
+ },
+
+ onStartView: function(){
+ // Stub function to connect to from your application.
+ // Called only when this view is shown at startup time.
+ },
+
+ onBeforeTransitionIn: function(moveTo, dir, transition, context, method){
+ // Stub function to connect to from your application.
+ },
+
+ onAfterTransitionIn: function(moveTo, dir, transition, context, method){
+ // Stub function to connect to from your application.
+ },
+
+ onBeforeTransitionOut: function(moveTo, dir, transition, context, method){
+ // Stub function to connect to from your application.
+ },
+
+ onAfterTransitionOut: function(moveTo, dir, transition, context, method){
+ // Stub function to connect to from your application.
+ },
+
+ _saveState: function(moveTo, dir, transition, context, method){
+ this._context = context;
+ this._method = method;
+ if(transition == "none" || !dojo.isWebKit){
+ transition = null;
+ }
+ this._moveTo = moveTo;
+ this._dir = dir;
+ this._transition = transition;
+ this._arguments = [];
+ var i;
+ for(i = 0; i < arguments.length; i++){
+ this._arguments.push(arguments[i]);
+ }
+ this._args = [];
+ if(context || method){
+ for(i = 5; i < arguments.length; i++){
+ this._args.push(arguments[i]);
+ }
+ }
+ },
+
+ performTransition: function(/*String*/moveTo, /*Number*/dir, /*String*/transition,
+ /*Object|null*/context, /*String|Function*/method /*optional args*/){
+ // summary:
+ // Function to perform the various types of view transitions, such as fade, slide, and flip.
+ // moveTo: String
+ // The destination view id to transition the current view to.
+ // If null, transitions to a blank view.
+ // dir: Number
+ // The transition direction. If 1, transition forward. If -1, transition backward.
+ // For example, the slide transition slides the view from right to left when dir == 1,
+ // and from left to right when dir == -1.
+ // transision: String
+ // The type of transition to perform. "slide", "fade", or "flip"
+ // context: Object
+ // The object that the callback function will receive as "this".
+ // method: String|Function
+ // A callback function that is called when the transition has been finished.
+ // A function reference, or name of a function in context.
+ // tags:
+ // public
+ // example:
+ // Transitions to the blank view, and then opens another page.
+ // | performTransition(null, 1, "slide", null, function(){location.href = href;});
+ if(dojo.hash){
+ if(typeof(moveTo) == "string" && moveTo.charAt(0) == '#' && !dojox.mobile._params){
+ dojox.mobile._params = [];
+ for(var i = 0; i < arguments.length; i++){
+ dojox.mobile._params.push(arguments[i]);
+ }
+ dojo.hash(moveTo);
+ return;
+ }
+ }
+ this._saveState.apply(this, arguments);
+ var toNode;
+ if(moveTo){
+ if(typeof(moveTo) == "string"){
+ // removes a leading hash mark (#) and params if exists
+ // ex. "#bar&myParam=0003" -> "bar"
+ moveTo.match(/^#?([^&]+)/);
+ toNode = RegExp.$1;
+ }else{
+ toNode = moveTo;
+ }
+ }else{
+ if(!this._dummyNode){
+ this._dummyNode = dojo.doc.createElement("DIV");
+ dojo.body().appendChild(this._dummyNode);
+ }
+ toNode = this._dummyNode;
+ }
+ var fromNode = this.domNode;
+ toNode = this.toNode = dojo.byId(toNode);
+ if(!toNode){ alert("dojox.mobile.View#performTransition: destination view not found: "+toNode); }
+ toNode.style.visibility = "hidden";
+ toNode.style.display = "";
+ this.onBeforeTransitionOut.apply(this, arguments);
+ var toWidget = dijit.byNode(toNode);
+ if(toWidget){
+ // perform view transition keeping the scroll position
+ if(this.keepScrollPos && !dijit.getEnclosingWidget(this.domNode.parentNode)){
+ var scrollTop = dojo.body().scrollTop || dojo.doc.documentElement.scrollTop || dojo.global.pageYOffset || 0;
+ if(dir == 1){
+ toNode.style.top = "0px";
+ if(scrollTop > 1){
+ fromNode.style.top = -scrollTop + "px";
+ if(dojo.config["mblHideAddressBar"] !== false){
+ setTimeout(function(){ // iPhone needs setTimeout
+ dojo.global.scrollTo(0, 1);
+ }, 0);
+ }
+ }
+ }else{
+ if(scrollTop > 1 || toNode.offsetTop !== 0){
+ var toTop = -toNode.offsetTop;
+ toNode.style.top = "0px";
+ fromNode.style.top = toTop - scrollTop + "px";
+ if(dojo.config["mblHideAddressBar"] !== false && toTop > 0){
+ setTimeout(function(){ // iPhone needs setTimeout
+ dojo.global.scrollTo(0, toTop + 1);
+ }, 0);
+ }
+ }
+ }
+ }else{
+ toNode.style.top = "0px";
+ }
+ toWidget.onBeforeTransitionIn.apply(toWidget, arguments);
+ }
+ toNode.style.display = "none";
+ toNode.style.visibility = "visible";
+ this._doTransition(fromNode, toNode, transition, dir);
+ },
+
+ _doTransition: function(fromNode, toNode, transition, dir){
+ var rev = (dir == -1) ? " reverse" : "";
+ toNode.style.display = "";
+ if(!transition || transition == "none"){
+ this.domNode.style.display = "none";
+ this.invokeCallback();
+ }else{
+ dojo.addClass(fromNode, transition + " out" + rev);
+ dojo.addClass(toNode, transition + " in" + rev);
+ }
+ },
+
+ onAnimationStart: function(e){
+ },
+
+ onAnimationEnd: function(e){
+ var isOut = false;
+ if(dojo.hasClass(this.domNode, "out")){
+ isOut = true;
+ this.domNode.style.display = "none";
+ dojo.forEach([this._transition,"in","out","reverse"], function(s){
+ dojo.removeClass(this.domNode, s);
+ }, this);
+ }
+ if(e.animationName.indexOf("shrink") === 0){
+ var li = e.target;
+ li.style.display = "none";
+ dojo.removeClass(li, "mblCloseContent");
+ }
+ if(isOut){
+ this.invokeCallback();
+ }
+ // this.domNode may be destroyed as a result of invoking the callback,
+ // so check for that before accessing it.
+ this.domNode && (this.domNode.className = "mblView");
+ },
+
+ invokeCallback: function(){
+ this.onAfterTransitionOut.apply(this, this._arguments);
+ var toWidget = dijit.byNode(this.toNode);
+ if(toWidget){
+ toWidget.onAfterTransitionIn.apply(toWidget, this._arguments);
+ }
+
+ dojox.mobile.currentView = toWidget;
+
+ var c = this._context, m = this._method;
+ if(!c && !m){ return; }
+ if(!m){
+ m = c;
+ c = null;
+ }
+ c = c || dojo.global;
+ if(typeof(m) == "string"){
+ c[m].apply(c, this._args);
+ }else{
+ m.apply(c, this._args);
+ }
+ },
+
+ getShowingView: function(){
+ // summary:
+ // Find the currently showing view from my sibling views.
+ // description:
+ // Note that dojox.mobile.currentView is the last shown view.
+ // If the page consists of a splitter, there are multiple showing views.
+ var nodes = this.domNode.parentNode.childNodes;
+ for(var i = 0; i < nodes.length; i++){
+ if(dojo.hasClass(nodes[i], "mblView") && dojo.style(nodes[i], "display") != "none"){
+ return dijit.byNode(nodes[i]);
+ }
+ }
+ },
+
+ show: function(){
+ // summary:
+ // Shows this view without a transition animation.
+ var fs = this.getShowingView().domNode.style; // from-style
+ var ts = this.domNode.style; // to-style
+ fs.display = "none";
+ ts.display = "";
+ dojox.mobile.currentView = this;
+ },
+
+ addChild: function(widget){
+ this.containerNode.appendChild(widget.domNode);
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.Heading",
+ dijit._WidgetBase,
+{
+ back: "",
+ href: "",
+ moveTo: "",
+ transition: "slide",
+ label: "",
+ iconBase: "",
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("H1");
+ this.domNode.className = "mblHeading";
+ this._view = dijit.getEnclosingWidget(this.domNode.parentNode); // parentNode is null if created programmatically
+ if(this.label){
+ this.domNode.appendChild(document.createTextNode(this.label));
+ }else{
+ this.label = "";
+ dojo.forEach(this.domNode.childNodes, function(n){
+ if(n.nodeType == 3){ this.label += n.nodeValue; }
+ }, this);
+ this.label = dojo.trim(this.label);
+ }
+ if(this.back){
+ var btn = dojo.create("DIV", {className:"mblArrowButton"}, this.domNode, "first");
+ var head = dojo.create("DIV", {className:"mblArrowButtonHead"}, btn);
+ var body = dojo.create("DIV", {className:"mblArrowButtonBody mblArrowButtonText"}, btn);
+
+ this._body = body;
+ this._head = head;
+ this._btn = btn;
+ body.innerHTML = this.back;
+ this.connect(body, "onclick", "onClick");
+ var neck = dojo.create("DIV", {className:"mblArrowButtonNeck"}, btn);
+ btn.style.width = body.offsetWidth + head.offsetWidth + "px";
+ this.setLabel(this.label);
+ }
+ },
+
+ startup: function(){
+ if(this._btn){
+ this._btn.style.width = this._body.offsetWidth + this._head.offsetWidth + "px";
+ }
+ },
+
+ onClick: function(e){
+ var h1 = this.domNode;
+ dojo.addClass(h1, "mblArrowButtonSelected");
+ setTimeout(function(){
+ dojo.removeClass(h1, "mblArrowButtonSelected");
+ }, 1000);
+ this.goTo(this.moveTo, this.href);
+ },
+
+ setLabel: function(label){
+ if(label != this.label){
+ this.label = label;
+ this.domNode.firstChild.nodeValue = label;
+ }
+ },
+
+ goTo: function(moveTo, href){
+ if(!this._view){
+ this._view = dijit.byNode(this.domNode.parentNode);
+ }
+ if(!this._view){ return; }
+ if(href){
+ this._view.performTransition(null, -1, this.transition, this, function(){location.href = href;});
+ }else{
+ if(dojox.mobile.app && dojox.mobile.app.STAGE_CONTROLLER_ACTIVE){
+ // If in a full mobile app, then use its mechanisms to move back a scene
+ dojo.publish("/dojox/mobile/app/goback");
+ }
+ else{
+ this._view.performTransition(moveTo, -1, this.transition);
+ }
+
+ }
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.RoundRect",
+ dijit._WidgetBase,
+{
+ shadow: false,
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("DIV");
+ this.domNode.className = this.shadow ? "mblRoundRect mblShadow" : "mblRoundRect";
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.RoundRectCategory",
+ dijit._WidgetBase,
+{
+ label: "",
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("H2");
+ this.domNode.className = "mblRoundRectCategory";
+ if(this.label){
+ this.domNode.innerHTML = this.label;
+ }else{
+ this.label = this.domNode.innerHTML;
+ }
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.EdgeToEdgeCategory",
+ dojox.mobile.RoundRectCategory,
+{
+ buildRendering: function(){
+ this.inherited(arguments);
+ this.domNode.className = "mblEdgeToEdgeCategory";
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.RoundRectList",
+ dijit._WidgetBase,
+{
+ transition: "slide",
+ iconBase: "",
+ iconPos: "",
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("UL");
+ this.domNode.className = "mblRoundRectList";
+ },
+
+ addChild: function(widget){
+ this.containerNode.appendChild(widget.domNode);
+ widget.inheritParams();
+ widget.setIcon();
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.EdgeToEdgeList",
+ dojox.mobile.RoundRectList,
+{
+ stateful: false, // keep the selection state or not
+ buildRendering: function(){
+ this.inherited(arguments);
+ this.domNode.className = "mblEdgeToEdgeList";
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.AbstractItem",
+ dijit._WidgetBase,
+{
+ icon: "",
+ iconPos: "", // top,left,width,height (ex. "0,0,29,29")
+ href: "",
+ hrefTarget: "",
+ moveTo: "",
+ scene: "",
+ clickable: false,
+ url: "",
+ transition: "",
+ transitionDir: 1,
+ callback: null,
+ sync: true,
+ label: "",
+ toggle: false,
+ _duration: 800, // duration of selection, milliseconds
+
+ inheritParams: function(){
+ var parent = this.getParentWidget();
+ if(parent){
+ if(!this.transition){ this.transition = parent.transition; }
+ if(!this.icon){ this.icon = parent.iconBase; }
+ if(!this.iconPos){ this.iconPos = parent.iconPos; }
+ }
+ },
+
+ findCurrentView: function(moveTo){
+ var w;
+ if(moveTo){
+ w = dijit.byId(moveTo);
+ if(w){ return w.getShowingView(); }
+ }
+ var n = this.domNode.parentNode;
+ while(true){
+ w = dijit.getEnclosingWidget(n);
+ if(!w){ return null; }
+ if(w.performTransition){ break; }
+ n = w.domNode.parentNode;
+ }
+ return w;
+ },
+
+ transitionTo: function(moveTo, href, url, scene){
+ var w = this.findCurrentView(moveTo); // the current view widget
+ if(!w || moveTo && w === dijit.byId(moveTo)){ return; }
+ if(href){
+ if(this.hrefTarget){
+ dojox.mobile.openWindow(this.href, this.hrefTarget);
+ }else{
+ w.performTransition(null, this.transitionDir, this.transition, this, function(){location.href = href;});
+ }
+ return;
+ } else if(scene){
+ dojo.publish("/dojox/mobile/app/pushScene", [scene]);
+ return;
+ }
+ if(url){
+ var id;
+ if(dojox.mobile._viewMap && dojox.mobile._viewMap[url]){
+ // external view has already been loaded
+ id = dojox.mobile._viewMap[url];
+ }else{
+ // get the specified external view and append it to the <body>
+ var text = this._text;
+ if(!text){
+ if(this.sync){
+ text = dojo.trim(dojo._getText(url));
+ }else{
+ dojo["require"]("dojo._base.xhr");
+ var prog = dojox.mobile.ProgressIndicator.getInstance();
+ dojo.body().appendChild(prog.domNode);
+ prog.start();
+ var xhr = dojo.xhrGet({
+ url: url,
+ handleAs: "text"
+ });
+ xhr.addCallback(dojo.hitch(this, function(response, ioArgs){
+ prog.stop();
+ if(response){
+ this._text = response;
+ this.transitionTo(moveTo, href, url, scene);
+ }
+ }));
+ xhr.addErrback(function(error){
+ prog.stop();
+ alert("Failed to load "+url+"\n"+(error.description||error));
+ });
+ return;
+ }
+ }
+ this._text = null;
+ id = this._parse(text);
+ if(!dojox.mobile._viewMap){
+ dojox.mobile._viewMap = [];
+ }
+ dojox.mobile._viewMap[url] = id;
+ }
+ moveTo = id;
+ }
+ w.performTransition(moveTo, this.transitionDir, this.transition, this.callback && this, this.callback);
+ },
+
+ _parse: function(text){
+ var container = dojo.create("DIV");
+ var view;
+ if(text.charAt(0) == "<"){ // html markup
+ container.innerHTML = text;
+ view = container.firstChild; // <div dojoType="dojox.mobile.View">
+ if(!view && view.nodeType != 1){
+ alert("dojox.mobile.AbstractItem#transitionTo: invalid view content");
+ return;
+ }
+ view.setAttribute("_started", "true"); // to avoid startup() is called
+ view.style.visibility = "hidden";
+ dojo.body().appendChild(container);
+ (dojox.mobile.parser || dojo.parser).parse(container);
+ }else if(text.charAt(0) == "{"){ // json
+ dojo.body().appendChild(container);
+ this._ws = [];
+ view = this._instantiate(eval('('+text+')'), container);
+ for(var i = 0; i < this._ws.length; i++){
+ var w = this._ws[i];
+ w.startup && !w._started && (!w.getParent || !w.getParent()) && w.startup();
+ }
+ this._ws = null;
+ }
+ view.style.display = "none";
+ view.style.visibility = "visible";
+ var id = view.id;
+ return dojo.hash ? "#" + id : id;
+ },
+
+ _instantiate: function(/*Object*/obj, /*DomNode*/node, /*Widget*/parent){
+ var widget;
+ for(var key in obj){
+ if(key.charAt(0) == "@"){ continue; }
+ var cls = dojo.getObject(key);
+ if(!cls){ continue; }
+ var params = {};
+ var proto = cls.prototype;
+ var objs = dojo.isArray(obj[key]) ? obj[key] : [obj[key]];
+ for(var i = 0; i < objs.length; i++){
+ for(var prop in objs[i]){
+ if(prop.charAt(0) == "@"){
+ var val = objs[i][prop];
+ prop = prop.substring(1);
+ if(typeof proto[prop] == "string"){
+ params[prop] = val;
+ }else if(typeof proto[prop] == "number"){
+ params[prop] = val - 0;
+ }else if(typeof proto[prop] == "boolean"){
+ params[prop] = (val != "false");
+ }else if(typeof proto[prop] == "object"){
+ params[prop] = eval("(" + val + ")");
+ }
+ }
+ }
+ widget = new cls(params, node);
+ if(!node){ // not to call View's startup()
+ this._ws.push(widget);
+ }
+ if(parent && parent.addChild){
+ parent.addChild(widget);
+ }
+ this._instantiate(objs[i], null, widget);
+ }
+ }
+ return widget && widget.domNode;
+ },
+
+ createDomButton: function(/*DomNode*/refNode, /*DomNode?*/toNode){
+ var s = refNode.className;
+ if(s.match(/mblDomButton\w+_(\d+)/)){
+ var nDiv = RegExp.$1 - 0;
+ for(var i = 0, p = (toNode||refNode); i < nDiv; i++){
+ p = dojo.create("DIV", null, p);
+ }
+ }
+ },
+
+ select: function(/*Boolean?*/deselect){
+ // subclass must implement
+ },
+
+ defaultClickAction: function(){
+ if(this.toggle){
+ this.select(this.selected);
+ }else if(!this.selected){
+ this.select();
+ if(!this.selectOne){
+ var _this = this;
+ setTimeout(function(){
+ _this.select(true);
+ }, this._duration);
+ }
+ if(this.moveTo || this.href || this.url || this.scene){
+ this.transitionTo(this.moveTo, this.href, this.url, this.scene);
+ }
+ }
+ },
+
+ getParentWidget: function(){
+ var ref = this.srcNodeRef || this.domNode;
+ return ref && ref.parentNode ? dijit.getEnclosingWidget(ref.parentNode) : null;
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.ListItem",
+ dojox.mobile.AbstractItem,
+{
+ rightText: "",
+ btnClass: "",
+ anchorLabel: false,
+ noArrow: false,
+ selected: false,
+
+ buildRendering: function(){
+ this.inheritParams();
+ var a = this.anchorNode = dojo.create("A");
+ a.className = "mblListItemAnchor";
+ var box = dojo.create("DIV");
+ box.className = "mblListItemTextBox";
+ if(this.anchorLabel){
+ box.style.cursor = "pointer";
+ }
+ var r = this.srcNodeRef;
+ if(r){
+ for(var i = 0, len = r.childNodes.length; i < len; i++){
+ box.appendChild(r.removeChild(r.firstChild));
+ }
+ }
+ if(this.label){
+ box.appendChild(dojo.doc.createTextNode(this.label));
+ }
+ a.appendChild(box);
+ if(this.rightText){
+ this._setRightTextAttr(this.rightText);
+ }
+
+ if(this.moveTo || this.href || this.url || this.clickable){
+ var parent = this.getParentWidget();
+ if(!this.noArrow && !(parent && parent.stateful)){
+ var arrow = dojo.create("DIV");
+ arrow.className = "mblArrow";
+ a.appendChild(arrow);
+ }
+ this.connect(a, "onclick", "onClick");
+ }else if(this.btnClass){
+ var div = this.btnNode = dojo.create("DIV");
+ div.className = this.btnClass+" mblRightButton";
+ div.appendChild(dojo.create("DIV"));
+ div.appendChild(dojo.create("P"));
+
+ var dummyDiv = dojo.create("DIV");
+ dummyDiv.className = "mblRightButtonContainer";
+ dummyDiv.appendChild(div);
+ a.appendChild(dummyDiv);
+ dojo.addClass(a, "mblListItemAnchorHasRightButton");
+ setTimeout(function(){
+ dummyDiv.style.width = div.offsetWidth + "px";
+ dummyDiv.style.height = div.offsetHeight + "px";
+ if(dojo.isIE){
+ // IE seems to ignore the height of LI without this..
+ a.parentNode.style.height = a.parentNode.offsetHeight + "px";
+ }
+ }, 0);
+ }
+ if(this.anchorLabel){
+ box.style.display = "inline"; // to narrow the text region
+ }
+ var li = this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("LI");
+ li.className = "mblListItem" + (this.selected ? " mblItemSelected" : "");
+ li.appendChild(a);
+ this.setIcon();
+ },
+
+ setIcon: function(){
+ if(this.iconNode){ return; }
+ var a = this.anchorNode;
+ if(this.icon && this.icon != "none"){
+ var img = this.iconNode = dojo.create("IMG");
+ img.className = "mblListItemIcon";
+ img.src = this.icon;
+ this.domNode.insertBefore(img, a);
+ dojox.mobile.setupIcon(this.iconNode, this.iconPos);
+ dojo.removeClass(a, "mblListItemAnchorNoIcon");
+ }else{
+ dojo.addClass(a, "mblListItemAnchorNoIcon");
+ }
+ },
+
+ onClick: function(e){
+ var a = e.currentTarget;
+ var li = a.parentNode;
+ if(dojo.hasClass(li, "mblItemSelected")){ return; } // already selected
+ if(this.anchorLabel){
+ for(var p = e.target; p.tagName != "LI"; p = p.parentNode){
+ if(p.className == "mblListItemTextBox"){
+ dojo.addClass(p, "mblListItemTextBoxSelected");
+ setTimeout(function(){
+ dojo.removeClass(p, "mblListItemTextBoxSelected");
+ }, 1000);
+ this.onAnchorLabelClicked(e);
+ return;
+ }
+ }
+ }
+ if(this.getParentWidget().stateful){
+ for(var i = 0, c = li.parentNode.childNodes; i < c.length; i++){
+ dojo.removeClass(c[i], "mblItemSelected");
+ }
+ }else{
+ setTimeout(function(){
+ dojo.removeClass(li, "mblItemSelected");
+ }, 1000);
+ }
+ dojo.addClass(li, "mblItemSelected");
+ this.transitionTo(this.moveTo, this.href, this.url, this.scene);
+ },
+
+ onAnchorLabelClicked: function(e){
+ },
+
+ _setRightTextAttr: function(/*String*/text){
+ this.rightText = text;
+ if(!this._rightTextNode){
+ this._rightTextNode = dojo.create("DIV", {className:"mblRightText"}, this.anchorNode);
+ }
+ this._rightTextNode.innerHTML = text;
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.Switch",
+ dijit._WidgetBase,
+{
+ value: "on",
+ leftLabel: "ON",
+ rightLabel: "OFF",
+ _width: 53,
+
+ buildRendering: function(){
+ this.domNode = this.srcNodeRef || dojo.doc.createElement("DIV");
+ this.domNode.className = "mblSwitch";
+ this.domNode.innerHTML =
+ '<div class="mblSwitchInner">'
+ + '<div class="mblSwitchBg mblSwitchBgLeft">'
+ + '<div class="mblSwitchText mblSwitchTextLeft">'+this.leftLabel+'</div>'
+ + '</div>'
+ + '<div class="mblSwitchBg mblSwitchBgRight">'
+ + '<div class="mblSwitchText mblSwitchTextRight">'+this.rightLabel+'</div>'
+ + '</div>'
+ + '<div class="mblSwitchKnob"></div>'
+ + '</div>';
+ var n = this.inner = this.domNode.firstChild;
+ this.left = n.childNodes[0];
+ this.right = n.childNodes[1];
+ this.knob = n.childNodes[2];
+
+ dojo.addClass(this.domNode, (this.value == "on") ? "mblSwitchOn" : "mblSwitchOff");
+ this[this.value == "off" ? "left" : "right"].style.display = "none";
+ },
+
+ postCreate: function(){
+ this.connect(this.knob, "onclick", "onClick");
+ this.connect(this.knob, "touchstart", "onTouchStart");
+ this.connect(this.knob, "mousedown", "onTouchStart");
+ },
+
+ _changeState: function(/*String*/state){
+ this.inner.style.left = "";
+ dojo.addClass(this.domNode, "mblSwitchAnimation");
+ dojo.removeClass(this.domNode, (state == "on") ? "mblSwitchOff" : "mblSwitchOn");
+ dojo.addClass(this.domNode, (state == "on") ? "mblSwitchOn" : "mblSwitchOff");
+
+ var _this = this;
+ setTimeout(function(){
+ _this[state == "off" ? "left" : "right"].style.display = "none";
+ dojo.removeClass(_this.domNode, "mblSwitchAnimation");
+ }, 300);
+ },
+
+ onClick: function(e){
+ if(this._moved){ return; }
+ this.value = (this.value == "on") ? "off" : "on";
+ this._changeState(this.value);
+ this.onStateChanged(this.value);
+ },
+
+ onTouchStart: function(e){
+ this._moved = false;
+ this.innerStartX = this.inner.offsetLeft;
+ if(e.targetTouches){
+ this.touchStartX = e.targetTouches[0].clientX;
+ this._conn1 = dojo.connect(this.inner, "touchmove", this, "onTouchMove");
+ this._conn2 = dojo.connect(this.inner, "touchend", this, "onTouchEnd");
+ }
+ this.left.style.display = "block";
+ this.right.style.display = "block";
+ dojo.stopEvent(e);
+ },
+
+ onTouchMove: function(e){
+ e.preventDefault();
+ var dx;
+ if(e.targetTouches){
+ if(e.targetTouches.length != 1){ return false; }
+ dx = e.targetTouches[0].clientX - this.touchStartX;
+ }else{
+ dx = e.clientX - this.touchStartX;
+ }
+ var pos = this.innerStartX + dx;
+ var d = 10;
+ if(pos <= -(this._width-d)){ pos = -this._width; }
+ if(pos >= -d){ pos = 0; }
+ this.inner.style.left = pos + "px";
+ this._moved = true;
+ },
+
+ onTouchEnd: function(e){
+ dojo.disconnect(this._conn1);
+ dojo.disconnect(this._conn2);
+ if(this.innerStartX == this.inner.offsetLeft){
+ if(dojo.isWebKit){
+ var ev = dojo.doc.createEvent("MouseEvents");
+ ev.initEvent("click", true, true);
+ this.knob.dispatchEvent(ev);
+ }
+ return;
+ }
+ var newState = (this.inner.offsetLeft < -(this._width/2)) ? "off" : "on";
+ this._changeState(newState);
+ if(newState != this.value){
+ this.value = newState;
+ this.onStateChanged(this.value);
+ }
+ },
+
+ onStateChanged: function(/*String*/newState){
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.Button",
+ dijit._WidgetBase,
+{
+ btnClass: "mblBlueButton",
+ duration: 1000, // duration of selection, milliseconds
+
+ label: null,
+
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("BUTTON");
+ this.domNode.className = "mblButton "+this.btnClass;
+
+ if(this.label){
+ this.domNode.innerHTML = this.label;
+ }
+
+ this.connect(this.domNode, "onclick", "onClick");
+ },
+
+ onClick: function(e){
+ var button = this.domNode;
+ var c = "mblButtonSelected "+this.btnClass+"Selected";
+ dojo.addClass(button, c);
+ setTimeout(function(){
+ dojo.removeClass(button, c);
+ }, this.duration);
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.ToolBarButton",
+ dojox.mobile.AbstractItem,
+{
+ selected: false,
+ _defaultColor: "mblColorDefault",
+ _selColor: "mblColorDefaultSel",
+
+ buildRendering: function(){
+ this.inheritParams();
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("div");
+ dojo.addClass(this.domNode, "mblToolbarButton mblArrowButtonText");
+ var color;
+ if(this.selected){
+ color = this._selColor;
+ }else if(this.domNode.className.indexOf("mblColor") == -1){
+ color = this._defaultColor;
+ }
+ dojo.addClass(this.domNode, color);
+
+ if(this.label){
+ this.domNode.innerHTML = this.label;
+ }else{
+ this.label = this.domNode.innerHTML;
+ }
+
+ if(this.icon && this.icon != "none"){
+ var img;
+ if(this.iconPos){
+ var iconDiv = dojo.create("DIV", null, this.domNode);
+ img = dojo.create("IMG", null, iconDiv);
+ img.style.position = "absolute";
+ var arr = this.iconPos.split(/[ ,]/);
+ dojo.style(iconDiv, {
+ position: "relative",
+ width: arr[2] + "px",
+ height: arr[3] + "px"
+ });
+ }else{
+ img = dojo.create("IMG", null, this.domNode);
+ }
+ img.src = this.icon;
+ dojox.mobile.setupIcon(img, this.iconPos);
+ this.iconNode = img;
+ }
+ this.createDomButton(this.domNode);
+ this.connect(this.domNode, "onclick", "onClick");
+ },
+
+ select: function(/*Boolean?*/deselect){
+ dojo.toggleClass(this.domNode, this._selColor, !deselect);
+ this.selected = !deselect;
+ },
+
+ onClick: function(e){
+ this.defaultClickAction();
+ }
+});
+
+dojo.declare(
+ "dojox.mobile.ProgressIndicator",
+ null,
+{
+ interval: 100, // milliseconds
+ colors: [
+ "#C0C0C0", "#C0C0C0", "#C0C0C0", "#C0C0C0",
+ "#C0C0C0", "#C0C0C0", "#B8B9B8", "#AEAFAE",
+ "#A4A5A4", "#9A9A9A", "#8E8E8E", "#838383"
+ ],
+
+ _bars: [],
+
+ constructor: function(){
+ this.domNode = dojo.create("DIV");
+ this.domNode.className = "mblProgContainer";
+ for(var i = 0; i < 12; i++){
+ var div = dojo.create("DIV");
+ div.className = "mblProg mblProg"+i;
+ this.domNode.appendChild(div);
+ this._bars.push(div);
+ }
+ },
+
+ start: function(){
+ var cntr = 0;
+ var _this = this;
+ this.timer = setInterval(function(){
+ cntr--;
+ cntr = cntr < 0 ? 11 : cntr;
+ var c = _this.colors;
+ for(var i = 0; i < 12; i++){
+ var idx = (cntr + i) % 12;
+ _this._bars[i].style.backgroundColor = c[idx];
+ }
+ }, this.interval);
+ },
+
+ stop: function(){
+ if(this.timer){
+ clearInterval(this.timer);
+ }
+ this.timer = null;
+ if(this.domNode.parentNode){
+ this.domNode.parentNode.removeChild(this.domNode);
+ }
+ }
+});
+dojox.mobile.ProgressIndicator._instance = null;
+dojox.mobile.ProgressIndicator.getInstance = function(){
+ if(!dojox.mobile.ProgressIndicator._instance){
+ dojox.mobile.ProgressIndicator._instance = new dojox.mobile.ProgressIndicator();
+ }
+ return dojox.mobile.ProgressIndicator._instance;
+};
+
+dojox.mobile.addClass = function(){
+ // summary:
+ // Adds a theme class name to <body>.
+ // description:
+ // Finds the currently applied theme name, such as 'iphone' or 'android'
+ // from link elements, and adds it as a class name for the body element.
+ var elems = document.getElementsByTagName("link");
+ for(var i = 0, len = elems.length; i < len; i++){
+ if(elems[i].href.match(/dojox\/mobile\/themes\/(\w+)\//)){
+ dojox.mobile.theme = RegExp.$1;
+ dojo.addClass(dojo.body(), dojox.mobile.theme);
+ break;
+ }
+ }
+};
+
+dojox.mobile.setupIcon = function(/*DomNode*/iconNode, /*String*/iconPos){
+ if(iconNode && iconPos){
+ var arr = dojo.map(iconPos.split(/[ ,]/),
+ function(item){ return item - 0; });
+ var t = arr[0]; // top
+ var r = arr[1] + arr[2]; // right
+ var b = arr[0] + arr[3]; // bottom
+ var l = arr[1]; // left
+ iconNode.style.clip = "rect("+t+"px "+r+"px "+b+"px "+l+"px)";
+ iconNode.style.top = dojo.style(iconNode, "top") - t + "px";
+ iconNode.style.left = dojo.style(iconNode.parentNode, "paddingLeft") - l + "px";
+ }
+};
+
+dojox.mobile.hideAddressBar = function(){
+ dojo.body().style.minHeight = "1000px"; // to ensure enough height for scrollTo to work
+ setTimeout(function(){ scrollTo(0, 1); }, 100);
+ setTimeout(function(){ scrollTo(0, 1); }, 400);
+ setTimeout(function(){
+ scrollTo(0, 1);
+ // re-define the min-height with the actual height
+ dojo.body().style.minHeight = (dojo.global.innerHeight||dojo.doc.documentElement.clientHeight) + "px";
+ }, 1000);
+};
+
+dojox.mobile.openWindow = function(url, target){
+ dojo.global.open(url, target || "_blank");
+};
+
+dojo._loaders.unshift(function(){
+ // avoid use of dojo.query
+ /*
+ var list = dojo.query('[lazy=true] [dojoType]', null);
+ list.forEach(function(node, index, nodeList){
+ node.setAttribute("__dojoType", node.getAttribute("dojoType"));
+ node.removeAttribute("dojoType");
+ });
+ */
+
+ var nodes = dojo.body().getElementsByTagName("*");
+ var i, len, s;
+ len = nodes.length;
+ for(i = 0; i < len; i++){
+ s = nodes[i].getAttribute("dojoType");
+ if(s){
+ if(nodes[i].parentNode.getAttribute("lazy") == "true"){
+ nodes[i].setAttribute("__dojoType", s);
+ nodes[i].removeAttribute("dojoType");
+ }
+ }
+ }
+});
+
+dojo.addOnLoad(function(){
+ dojox.mobile.addClass();
+ if(dojo.config["mblApplyPageStyles"] !== false){
+ dojo.addClass(dojo.doc.documentElement, "mobile");
+ }
+
+ // You can disable hiding the address bar with the following djConfig.
+ // var djConfig = { mblHideAddressBar: false };
+ if(dojo.config["mblHideAddressBar"] !== false){
+ dojox.mobile.hideAddressBar();
+ if(dojo.config["mblAlwaysHideAddressBar"] == true){
+ if(dojo.global.onorientationchange !== undefined){
+ dojo.connect(dojo.global, "onorientationchange", dojox.mobile.hideAddressBar);
+ }else{
+ dojo.connect(dojo.global, "onresize", dojox.mobile.hideAddressBar);
+ }
+ }
+ }
+
+ // avoid use of dojo.query
+ /*
+ var list = dojo.query('[__dojoType]', null);
+ list.forEach(function(node, index, nodeList){
+ node.setAttribute("dojoType", node.getAttribute("__dojoType"));
+ node.removeAttribute("__dojoType");
+ });
+ */
+
+ var nodes = dojo.body().getElementsByTagName("*");
+ var i, len = nodes.length, s;
+ for(i = 0; i < len; i++){
+ s = nodes[i].getAttribute("__dojoType");
+ if(s){
+ nodes[i].setAttribute("dojoType", s);
+ nodes[i].removeAttribute("__dojoType");
+ }
+ }
+
+ if(dojo.hash){
+ // find widgets under root recursively
+ var findWidgets = function(root){
+ var arr;
+ arr = dijit.findWidgets(root);
+ var widgets = arr;
+ for(var i = 0; i < widgets.length; i++){
+ arr = arr.concat(findWidgets(widgets[i].containerNode));
+ }
+ return arr;
+ };
+ dojo.subscribe("/dojo/hashchange", null, function(value){
+ var view = dojox.mobile.currentView;
+ if(!view){ return; }
+ var params = dojox.mobile._params;
+ if(!params){ // browser back/forward button was pressed
+ var moveTo = value ? value : dojox.mobile._defaultView.id;
+ var widgets = findWidgets(view.domNode);
+ var dir = 1, transition = "slide";
+ for(i = 0; i < widgets.length; i++){
+ var w = widgets[i];
+ if("#"+moveTo == w.moveTo){
+ // found a widget that has the given moveTo
+ transition = w.transition;
+ dir = (w instanceof dojox.mobile.Heading) ? -1 : 1;
+ break;
+ }
+ }
+ params = [ moveTo, dir, transition ];
+ }
+ view.performTransition.apply(view, params);
+ dojox.mobile._params = null;
+ });
+ }
+
+ dojo.body().style.visibility = "visible";
+});
+
+dijit.getEnclosingWidget = function(node){
+ while(node && node.tagName !== "BODY"){
+ if(node.getAttribute && node.getAttribute("widgetId")){
+ return dijit.registry.byId(node.getAttribute("widgetId"));
+ }
+ node = node._parentNode || node.parentNode;
+ }
+ return null;
+};
+
+}
+
+if(!dojo._hasResource["dojox.mobile"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile"] = true;
+dojo.provide("dojox.mobile");
+
+dojo.experimental("dojox.mobile");
+
+
+}
+
+if(!dojo._hasResource["dojox.mobile.parser"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.parser"] = true;
+dojo.provide("dojox.mobile.parser");
+dojo.provide("dojo.parser"); // not to load dojo.parser unexpectedly
+
+dojox.mobile.parser = new function(){
+ this.instantiate = function(list, defaultParams){
+ // summary:
+ // Function for instantiating a list of widget nodes.
+ // list:
+ // The list of DOMNodes to walk and instantiate widgets on.
+ var ws = [];
+ if(list){
+ var i, len;
+ len = list.length;
+ for(i = 0; i < len; i++){
+ var node = list[i];
+ var cls = dojo.getObject(dojo.attr(node, "dojoType"));
+ var proto = cls.prototype;
+ var params = {};
+
+ if(defaultParams){
+ for(var name in defaultParams){
+ params[name] = defaultParams[name];
+ }
+ }
+ for(var prop in proto){
+ var val = dojo.attr(node, prop);
+ if(!val){ continue; }
+ if(typeof proto[prop] == "string"){
+ params[prop] = val;
+ }else if(typeof proto[prop] == "number"){
+ params[prop] = val - 0;
+ }else if(typeof proto[prop] == "boolean"){
+ params[prop] = (val != "false");
+ }else if(typeof proto[prop] == "object"){
+ params[prop] = eval("(" + val + ")");
+ }
+ }
+ params["class"] = node.className;
+ params["style"] = node.style && node.style.cssText;
+ ws.push(new cls(params, node));
+ }
+ len = ws.length;
+ for(i = 0; i < len; i++){
+ var w = ws[i];
+ w.startup && !w._started && (!w.getParent || !w.getParent()) && w.startup();
+ }
+ }
+ return ws;
+ };
+
+ this.parse = function(rootNode, defaultParams){
+ // summary:
+ // Function to handle parsing for widgets in the current document.
+ // It is not as powerful as the full dojo parser, but it will handle basic
+ // use cases fine.
+ // rootNode:
+ // The root node in the document to parse from
+ if(!rootNode){
+ rootNode = dojo.body();
+ }else if(!defaultParams && rootNode.rootNode){
+ // Case where 'rootNode' is really a params object.
+ rootNode = rootNode.rootNode;
+ }
+
+ var nodes = rootNode.getElementsByTagName("*");
+ var list = [];
+ for(var i = 0, len = nodes.length; i < len; i++){
+ if(nodes[i].getAttribute("dojoType")){
+ list.push(nodes[i]);
+ }
+ }
+ return this.instantiate(list, defaultParams);
+ };
+}();
+dojo._loaders.unshift(function(){
+ if(dojo.config.parseOnLoad){
+ dojox.mobile.parser.parse();
+ }
+});
+
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app._event"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app._event"] = true;
+dojo.provide("dojox.mobile.app._event");
+dojo.experimental("dojox.mobile.app._event.js");
+
+dojo.mixin(dojox.mobile.app, {
+ eventMap: {},
+
+ connectFlick: function(target, context, method){
+ // summary:
+ // Listens for a flick event on a DOM node. If the mouse/touch
+ // moves more than 15 pixels in any given direction it is a flick.
+ // The synthetic event fired specifies the direction as
+ // <ul>
+ // <li><b>'ltr'</b> Left To Right</li>
+ // <li><b>'rtl'</b> Right To Left</li>
+ // <li><b>'ttb'</b> Top To Bottom</li>
+ // <li><b>'btt'</b> Bottom To Top</li>
+ // </ul>
+ // target: Node
+ // The DOM node to connect to
+
+ var startX;
+ var startY;
+ var isFlick = false;
+
+ var currentX;
+ var currentY;
+
+ var connMove;
+ var connUp;
+
+ var direction;
+
+ var time;
+
+ // Listen to to the mousedown/touchstart event
+ var connDown = dojo.connect("onmousedown", target, function(event){
+ isFlick = false;
+ startX = event.targetTouches ? event.targetTouches[0].clientX : event.clientX;
+ startY = event.targetTouches ? event.targetTouches[0].clientY : event.clientY;
+
+ time = (new Date()).getTime();
+
+ connMove = dojo.connect(target, "onmousemove", onMove);
+ connUp = dojo.connect(target, "onmouseup", onUp);
+ });
+
+ // The function that handles the mousemove/touchmove event
+ var onMove = function(event){
+ dojo.stopEvent(event);
+
+ currentX = event.targetTouches ? event.targetTouches[0].clientX : event.clientX;
+ currentY = event.targetTouches ? event.targetTouches[0].clientY : event.clientY;
+ if(Math.abs(Math.abs(currentX) - Math.abs(startX)) > 15){
+ isFlick = true;
+
+ direction = (currentX > startX) ? "ltr" : "rtl";
+ }else if(Math.abs(Math.abs(currentY) - Math.abs(startY)) > 15){
+ isFlick = true;
+
+ direction = (currentY > startY) ? "ttb" : "btt";
+ }
+ };
+
+ var onUp = function(event){
+ dojo.stopEvent(event);
+
+ connMove && dojo.disconnect(connMove);
+ connUp && dojo.disconnect(connUp);
+
+ if(isFlick){
+ var flickEvt = {
+ target: target,
+ direction: direction,
+ duration: (new Date()).getTime() - time
+ };
+ if(context && method){
+ context[method](flickEvt);
+ }else{
+ method(flickEvt);
+ }
+ }
+ };
+
+ }
+});
+
+dojox.mobile.app.isIPhone = (dojo.isSafari
+ && (navigator.userAgent.indexOf("iPhone") > -1 ||
+ navigator.userAgent.indexOf("iPod") > -1
+ ));
+dojox.mobile.app.isWebOS = (navigator.userAgent.indexOf("webOS") > -1);
+dojox.mobile.app.isAndroid = (navigator.userAgent.toLowerCase().indexOf("android") > -1);
+
+if(dojox.mobile.app.isIPhone || dojox.mobile.app.isAndroid){
+ // We are touchable.
+ // Override the dojo._connect function to replace mouse events with touch events
+
+ dojox.mobile.app.eventMap = {
+ onmousedown: "ontouchstart",
+ mousedown: "ontouchstart",
+ onmouseup: "ontouchend",
+ mouseup: "ontouchend",
+ onmousemove: "ontouchmove",
+ mousemove: "ontouchmove"
+ };
+
+}
+dojo._oldConnect = dojo._connect;
+dojo._connect = function(obj, event, context, method, dontFix){
+ event = dojox.mobile.app.eventMap[event] || event;
+ if(event == "flick" || event == "onflick"){
+ if(dojo.global["Mojo"]){
+ event = Mojo.Event.flick;
+ }else{
+ return dojox.mobile.app.connectFlick(obj, context, method);
+ }
+ }
+
+ return dojo._oldConnect(obj, event, context, method, dontFix);
+}
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app._Widget"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app._Widget"] = true;
+dojo.provide("dojox.mobile.app._Widget");
+dojo.experimental("dojox.mobile.app._Widget");
+
+
+
+dojo.declare("dojox.mobile.app._Widget", dijit._WidgetBase, {
+ // summary:
+ // The base mobile app widget.
+
+ getScroll: function(){
+ // summary:
+ // Returns the scroll position.
+ return {
+ x: dojo.global.scrollX,
+ y: dojo.global.scrollY
+ };
+ },
+
+ connect: function(target, event, fn){
+ if(event.toLowerCase() == "dblclick"
+ || event.toLowerCase() == "ondblclick"){
+
+ if(dojo.global["Mojo"]){
+ // Handle webOS tap event
+ return this.connect(target, Mojo.Event.tap, fn);
+ }
+ }
+ return this.inherited(arguments);
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app.SceneController"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.SceneController"] = true;
+dojo.provide("dojox.mobile.app.SceneController");
+dojo.experimental("dojox.mobile.app.SceneController");
+
+
+(function(){
+
+ var app = dojox.mobile.app;
+
+ var templates = {};
+
+ dojo.declare("dojox.mobile.app.SceneController", dojox.mobile.View, {
+
+ stageController: null,
+
+ keepScrollPos: false,
+
+ init: function(sceneName, params){
+ // summary:
+ // Initializes the scene by loading the HTML template and code, if it has
+ // not already been loaded
+
+ this.sceneName = sceneName;
+ this.params = params;
+ var templateUrl = app.resolveTemplate(sceneName);
+
+ this._deferredInit = new dojo.Deferred();
+
+ if(templates[sceneName]){
+ // If the template has been cached, do not load it again.
+ this._setContents(templates[sceneName]);
+ }else{
+ // Otherwise load the template
+ dojo.xhrGet({
+ url: templateUrl,
+ handleAs: "text"
+ }).addCallback(dojo.hitch(this, this._setContents));
+ }
+
+ return this._deferredInit;
+ },
+
+ _setContents: function(templateHtml){
+ // summary:
+ // Sets the content of the View, and invokes either the loading or
+ // initialization of the scene assistant.
+ templates[this.sceneName] = templateHtml;
+
+ this.domNode.innerHTML = "<div>" + templateHtml + "</div>";
+
+ var sceneAssistantName = "";
+
+ var nameParts = this.sceneName.split("-");
+
+ for(var i = 0; i < nameParts.length; i++){
+ sceneAssistantName += nameParts[i].substring(0, 1).toUpperCase()
+ + nameParts[i].substring(1);
+ }
+ sceneAssistantName += "Assistant";
+ this.sceneAssistantName = sceneAssistantName;
+
+ var _this = this;
+
+ dojox.mobile.app.loadResourcesForScene(this.sceneName, function(){
+
+ console.log("All resources for ",_this.sceneName," loaded");
+
+ var assistant;
+ if(typeof(dojo.global[sceneAssistantName]) != "undefined"){
+ _this._initAssistant();
+ }else{
+ var assistantUrl = app.resolveAssistant(_this.sceneName);
+
+ dojo.xhrGet({
+ url: assistantUrl,
+ handleAs: "text"
+ }).addCallback(function(text){
+ try{
+ dojo.eval(text);
+ }catch(e){
+ console.log("Error initializing code for scene " + _this.sceneName
+ + '. Please check for syntax errors');
+ throw e;
+ }
+ _this._initAssistant();
+ });
+ }
+ });
+
+ },
+
+ _initAssistant: function(){
+ // summary:
+ // Initializes the scene assistant. At this point, the View is
+ // populated with the HTML template, and the scene assistant type
+ // is declared.
+
+ console.log("Instantiating the scene assistant " + this.sceneAssistantName);
+
+ var cls = dojo.getObject(this.sceneAssistantName);
+
+ if(!cls){
+ throw Error("Unable to resolve scene assistant "
+ + this.sceneAssistantName);
+ }
+
+ this.assistant = new cls(this.params);
+
+ this.assistant.controller = this;
+ this.assistant.domNode = this.domNode.firstChild;
+
+ this.assistant.setup();
+
+ this._deferredInit.callback();
+ },
+
+ query: function(selector, node){
+ // summary:
+ // Queries for DOM nodes within either the node passed in as an argument
+ // or within this view.
+
+ return dojo.query(selector, node || this.domNode)
+ },
+
+ parse: function(node){
+ var widgets = this._widgets =
+ dojox.mobile.parser.parse(node || this.domNode, {
+ controller: this
+ });
+
+ // Tell all widgets what their controller is.
+ for(var i = 0; i < widgets.length; i++){
+ widgets[i].set("controller", this);
+ }
+ },
+
+ getWindowSize: function(){
+ // TODO, this needs cross browser testing
+
+ return {
+ w: dojo.global.innerWidth,
+ h: dojo.global.innerHeight
+ }
+ },
+
+ showAlertDialog: function(props){
+
+ var size = dojo.marginBox(this.assistant.domNode);
+ var dialog = new dojox.mobile.app.AlertDialog(
+ dojo.mixin(props, {controller: this}));
+ this.assistant.domNode.appendChild(dialog.domNode);
+
+ console.log("Appended " , dialog.domNode, " to ", this.assistant.domNode);
+ dialog.show();
+ },
+
+ popupSubMenu: function(info){
+ var widget = new dojox.mobile.app.ListSelector({
+ controller: this,
+ destroyOnHide: true,
+ onChoose: info.onChoose
+ });
+
+ this.assistant.domNode.appendChild(widget.domNode);
+
+ widget.set("data", info.choices);
+ widget.show(info.fromNode);
+ }
+ });
+
+})();
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app.StageController"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.StageController"] = true;
+dojo.provide("dojox.mobile.app.StageController");
+dojo.experimental("dojox.mobile.app.StageController");
+
+
+
+dojo.declare("dojox.mobile.app.StageController", null,{
+
+ // scenes: Array
+ // The list of scenes currently in existance in the app.
+ scenes: null,
+
+ effect: "fade",
+
+ constructor: function(node){
+ this.domNode = node;
+ this.scenes = [];
+
+ if(dojo.config.mobileAnim){
+ this.effect = dojo.config.mobileAnim;
+ }
+ },
+
+ getActiveSceneController: function(){
+ return this.scenes[this.scenes.length - 1];
+ },
+
+ pushScene: function(sceneName, params){
+ if(this._opInProgress){
+ return;
+ }
+ this._opInProgress = true;
+
+ // Push new scenes as the first element on the page.
+ var node = dojo.create("div", {
+ "class": "scene-wrapper",
+ style: {
+ visibility: "hidden"
+ }
+ }, this.domNode);
+
+ var controller = new dojox.mobile.app.SceneController({}, node);
+
+ if(this.scenes.length > 0){
+ this.scenes[this.scenes.length -1].assistant.deactivate();
+ }
+
+ this.scenes.push(controller);
+
+ var _this = this;
+
+ dojo.forEach(this.scenes, this.setZIndex);
+
+ controller.stageController = this;
+
+ controller.init(sceneName, params).addCallback(function(){
+
+ if(_this.scenes.length == 1){
+ controller.domNode.style.visibility = "visible";
+ _this.scenes[_this.scenes.length - 1].assistant.activate(params);
+ _this._opInProgress = false;
+ }else{
+ _this.scenes[_this.scenes.length - 2]
+ .performTransition(
+ _this.scenes[_this.scenes.length - 1].domNode,
+ 1,
+ _this.effect,
+ null,
+ function(){
+ // When the scene is ready, activate it.
+ _this.scenes[_this.scenes.length - 1].assistant.activate(params);
+ _this._opInProgress = false;
+ });
+ }
+ });
+ },
+
+ setZIndex: function(controller, idx){
+ dojo.style(controller.domNode, "zIndex", idx + 1);
+ },
+
+ popScene: function(data){
+ // performTransition: function(/*String*/moveTo, /*Number*/dir, /*String*/transition,
+ // /*Object|null*/context, /*String|Function*/method /*optional args*/){
+ if(this._opInProgress){
+ return;
+ }
+
+ var _this = this;
+ if(this.scenes.length > 1){
+
+ this._opInProgress = true;
+ this.scenes[_this.scenes.length - 2].assistant.activate(data);
+ this.scenes[_this.scenes.length - 1]
+ .performTransition(
+ _this.scenes[this.scenes.length - 2].domNode,
+ -1,
+ this.effect,
+ null,
+ function(){
+ // When the scene is no longer visible, destroy it
+ _this._destroyScene(_this.scenes[_this.scenes.length - 1]);
+ _this.scenes.splice(_this.scenes.length - 1, 1);
+ _this._opInProgress = false;
+ });
+ }else{
+ console.log("cannot pop the scene if there is just one");
+ }
+ },
+
+ popScenesTo: function(sceneName, data){
+ if(this._opInProgress){
+ return;
+ }
+
+ while(this.scenes.length > 2 &&
+ this.scenes[this.scenes.length - 2].sceneName != sceneName){
+ this._destroyScene(this.scenes[this.scenes.length - 2]);
+ this.scenes.splice(this.scenes.length - 2, 1);
+ }
+
+ this.popScene(data);
+ },
+
+ _destroyScene: function(scene){
+ scene.assistant.deactivate();
+ scene.assistant.destroy();
+ scene.destroyRecursive();
+ }
+
+
+});
+
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app.SceneAssistant"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.SceneAssistant"] = true;
+dojo.provide("dojox.mobile.app.SceneAssistant");
+dojo.experimental("dojox.mobile.app.SceneAssistant");
+
+dojo.declare("dojox.mobile.app.SceneAssistant", null, {
+ // summary:
+ // The base class for all scene assistants.
+
+ constructor: function(){
+
+ },
+
+ setup: function(){
+ // summary:
+ // Called to set up the widget. The UI is not visible at this time
+
+ },
+
+ activate: function(params){
+ // summary:
+ // Called each time the scene becomes visible. This can be as a result
+ // of a new scene being created, or a subsequent scene being destroyed
+ // and control transferring back to this scene assistant.
+ // params:
+ // Optional paramters, only passed when a subsequent scene pops itself
+ // off the stack and passes back data.
+ },
+
+ deactivate: function(){
+ // summary:
+ // Called each time the scene becomes invisible. This can be as a result
+ // of it being popped off the stack and destroyed,
+ // or another scene being created and pushed on top of it on the stack
+ },
+
+ destroy: function(){
+
+ var children =
+ dojo.query("> [widgetId]", this.containerNode).map(dijit.byNode);
+ dojo.forEach(children, function(child){ child.destroyRecursive(); });
+
+ this.disconnect();
+ },
+
+ connect: function(obj, method, callback){
+ if(!this._connects){
+ this._connects = [];
+ }
+ this._connects.push(dojo.connect(obj, method, callback));
+ },
+
+ disconnect: function(){
+ dojo.forEach(this._connects, dojo.disconnect);
+ this._connects = [];
+ }
+});
+
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app.AlertDialog"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.AlertDialog"] = true;
+dojo.provide("dojox.mobile.app.AlertDialog");
+dojo.experimental("dojox.mobile.app.AlertDialog");
+
+
+dojo.declare("dojox.mobile.app.AlertDialog", dijit._WidgetBase, {
+
+ // title: String
+ // The title of the AlertDialog
+ title: "",
+
+ // text: String
+ // The text message displayed in the AlertDialog
+ text: "",
+
+ // controller: Object
+ // The SceneController for the currently active scene
+ controller: null,
+
+ // buttons: Array
+ buttons: null,
+
+ defaultButtonLabel: "OK",
+
+ // onChoose: Function
+ // The callback function that is invoked when a button is tapped.
+ // If the dialog is cancelled, no parameter is passed to this function.
+ onChoose: null,
+
+ constructor: function(){
+ this.onClick = dojo.hitch(this, this.onClick);
+ this._handleSelect = dojo.hitch(this, this._handleSelect);
+ },
+
+ buildRendering: function(){
+ this.domNode = dojo.create("div",{
+ "class": "alertDialog"
+ });
+
+ // Create the outer dialog body
+ var dlgBody = dojo.create("div", {"class": "alertDialogBody"}, this.domNode);
+
+ // Create the title
+ dojo.create("div", {"class": "alertTitle", innerHTML: this.title || ""}, dlgBody);
+
+ // Create the text
+ dojo.create("div", {"class": "alertText", innerHTML: this.text || ""}, dlgBody);
+
+ // Create the node that encapsulates all the buttons
+ var btnContainer = dojo.create("div", {"class": "alertBtns"}, dlgBody);
+
+ // If no buttons have been defined, default to a single button saying OK
+ if(!this.buttons || this.buttons.length == 0){
+ this.buttons = [{
+ label: this.defaultButtonLabel,
+ value: "ok",
+ "class": "affirmative"
+ }];
+ }
+
+ var _this = this;
+
+ // Create each of the buttons
+ dojo.forEach(this.buttons, function(btnInfo){
+ var btn = new dojox.mobile.Button({
+ btnClass: btnInfo["class"] || "",
+ label: btnInfo.label
+ });
+ btn._dialogValue = btnInfo.value;
+ dojo.place(btn.domNode, btnContainer);
+ _this.connect(btn, "onClick", _this._handleSelect);
+ });
+
+ var viewportSize = this.controller.getWindowSize();
+
+ // Create the mask that blocks out the rest of the screen
+ this.mask = dojo.create("div", {"class": "dialogUnderlayWrapper",
+ innerHTML: "<div class=\"dialogUnderlay\"></div>",
+ style: {
+ width: viewportSize.w + "px",
+ height: viewportSize.h + "px"
+ }
+ }, this.controller.assistant.domNode);
+
+ this.connect(this.mask, "onclick", function(){
+ _this.onChoose && _this.onChoose();
+ _this.hide();
+ });
+ },
+
+ postCreate: function(){
+ this.subscribe("/dojox/mobile/app/goback", this._handleSelect);
+ },
+
+ _handleSelect: function(event){
+ // summary:
+ // Handle the selection of a value
+ var node;
+ console.log("handleSelect");
+ if(event && event.target){
+ node = event.target;
+
+ // Find the widget that was tapped.
+ while(!dijit.byNode(node)){
+ node - node.parentNode;
+ }
+ }
+
+ // If an onChoose function was provided, tell it what button
+ // value was chosen
+ if(this.onChoose){
+ this.onChoose(node ? dijit.byNode(node)._dialogValue: undefined);
+ }
+ // Hide the dialog
+ this.hide();
+ },
+
+ show: function(){
+ // summary:
+ // Show the dialog
+ this._doTransition(1);
+ },
+
+ hide: function(){
+ // summary:
+ // Hide the dialog
+ this._doTransition(-1);
+ },
+
+ _doTransition: function(dir){
+ // summary:
+ // Either shows or hides the dialog.
+ // dir:
+ // An integer. If positive, the dialog is shown. If negative,
+ // the dialog is hidden.
+
+ // TODO: replace this with CSS transitions
+
+ var anim;
+ var h = dojo.marginBox(this.domNode.firstChild).h;
+
+
+ var bodyHeight = this.controller.getWindowSize().h;
+ console.log("dialog height = " + h, " body height = " + bodyHeight);
+
+ var high = bodyHeight - h;
+ var low = bodyHeight;
+
+ var anim1 = dojo.fx.slideTo({
+ node: this.domNode,
+ duration: 400,
+ top: {start: dir < 0 ? high : low, end: dir < 0 ? low: high}
+ });
+
+ var anim2 = dojo[dir < 0 ? "fadeOut" : "fadeIn"]({
+ node: this.mask,
+ duration: 400
+ });
+
+ var anim = dojo.fx.combine([anim1, anim2]);
+
+ var _this = this;
+
+ dojo.connect(anim, "onEnd", this, function(){
+ if(dir < 0){
+ _this.domNode.style.display = "none";
+ dojo.destroy(_this.domNode);
+ dojo.destroy(_this.mask);
+ }
+ });
+ anim.play();
+ },
+
+ destroy: function(){
+ this.inherited(arguments);
+ dojo.destroy(this.mask);
+ },
+
+
+ onClick: function(){
+
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojo.string"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.string"] = true;
+dojo.provide("dojo.string");
+
+
+dojo.getObject("string", true, dojo);
+
+/*=====
+dojo.string = {
+ // summary: String utilities for Dojo
+};
+=====*/
+
+dojo.string.rep = function(/*String*/str, /*Integer*/num){
+ // summary:
+ // Efficiently replicate a string `n` times.
+ // str:
+ // the string to replicate
+ // num:
+ // number of times to replicate the string
+
+ if(num <= 0 || !str){ return ""; }
+
+ var buf = [];
+ for(;;){
+ if(num & 1){
+ buf.push(str);
+ }
+ if(!(num >>= 1)){ break; }
+ str += str;
+ }
+ return buf.join(""); // String
+};
+
+dojo.string.pad = function(/*String*/text, /*Integer*/size, /*String?*/ch, /*Boolean?*/end){
+ // summary:
+ // Pad a string to guarantee that it is at least `size` length by
+ // filling with the character `ch` at either the start or end of the
+ // string. Pads at the start, by default.
+ // text:
+ // the string to pad
+ // size:
+ // length to provide padding
+ // ch:
+ // character to pad, defaults to '0'
+ // end:
+ // adds padding at the end if true, otherwise pads at start
+ // example:
+ // | // Fill the string to length 10 with "+" characters on the right. Yields "Dojo++++++".
+ // | dojo.string.pad("Dojo", 10, "+", true);
+
+ if(!ch){
+ ch = '0';
+ }
+ var out = String(text),
+ pad = dojo.string.rep(ch, Math.ceil((size - out.length) / ch.length));
+ return end ? out + pad : pad + out; // String
+};
+
+dojo.string.substitute = function( /*String*/ template,
+ /*Object|Array*/map,
+ /*Function?*/ transform,
+ /*Object?*/ thisObject){
+ // summary:
+ // Performs parameterized substitutions on a string. Throws an
+ // exception if any parameter is unmatched.
+ // template:
+ // a string with expressions in the form `${key}` to be replaced or
+ // `${key:format}` which specifies a format function. keys are case-sensitive.
+ // map:
+ // hash to search for substitutions
+ // transform:
+ // a function to process all parameters before substitution takes
+ // place, e.g. mylib.encodeXML
+ // thisObject:
+ // where to look for optional format function; default to the global
+ // namespace
+ // example:
+ // Substitutes two expressions in a string from an Array or Object
+ // | // returns "File 'foo.html' is not found in directory '/temp'."
+ // | // by providing substitution data in an Array
+ // | dojo.string.substitute(
+ // | "File '${0}' is not found in directory '${1}'.",
+ // | ["foo.html","/temp"]
+ // | );
+ // |
+ // | // also returns "File 'foo.html' is not found in directory '/temp'."
+ // | // but provides substitution data in an Object structure. Dotted
+ // | // notation may be used to traverse the structure.
+ // | dojo.string.substitute(
+ // | "File '${name}' is not found in directory '${info.dir}'.",
+ // | { name: "foo.html", info: { dir: "/temp" } }
+ // | );
+ // example:
+ // Use a transform function to modify the values:
+ // | // returns "file 'foo.html' is not found in directory '/temp'."
+ // | dojo.string.substitute(
+ // | "${0} is not found in ${1}.",
+ // | ["foo.html","/temp"],
+ // | function(str){
+ // | // try to figure out the type
+ // | var prefix = (str.charAt(0) == "/") ? "directory": "file";
+ // | return prefix + " '" + str + "'";
+ // | }
+ // | );
+ // example:
+ // Use a formatter
+ // | // returns "thinger -- howdy"
+ // | dojo.string.substitute(
+ // | "${0:postfix}", ["thinger"], null, {
+ // | postfix: function(value, key){
+ // | return value + " -- howdy";
+ // | }
+ // | }
+ // | );
+
+ thisObject = thisObject || dojo.global;
+ transform = transform ?
+ dojo.hitch(thisObject, transform) : function(v){ return v; };
+
+ return template.replace(/\$\{([^\s\:\}]+)(?:\:([^\s\:\}]+))?\}/g,
+ function(match, key, format){
+ var value = dojo.getObject(key, false, map);
+ if(format){
+ value = dojo.getObject(format, false, thisObject).call(thisObject, value, key);
+ }
+ return transform(value, key).toString();
+ }); // String
+};
+
+/*=====
+dojo.string.trim = function(str){
+ // summary:
+ // Trims whitespace from both sides of the string
+ // str: String
+ // String to be trimmed
+ // returns: String
+ // Returns the trimmed string
+ // description:
+ // This version of trim() was taken from [Steven Levithan's blog](http://blog.stevenlevithan.com/archives/faster-trim-javascript).
+ // The short yet performant version of this function is dojo.trim(),
+ // which is part of Dojo base. Uses String.prototype.trim instead, if available.
+ return ""; // String
+}
+=====*/
+
+dojo.string.trim = String.prototype.trim ?
+ dojo.trim : // aliasing to the native function
+ function(str){
+ str = str.replace(/^\s+/, '');
+ for(var i = str.length - 1; i >= 0; i--){
+ if(/\S/.test(str.charAt(i))){
+ str = str.substring(0, i + 1);
+ break;
+ }
+ }
+ return str;
+ };
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app.List"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.List"] = true;
+dojo.provide("dojox.mobile.app.List");
+dojo.experimental("dojox.mobile.app.List");
+
+
+
+
+(function(){
+
+ var templateCache = {};
+
+ dojo.declare("dojox.mobile.app.List", dijit._WidgetBase, {
+ // summary:
+ // A templated list widget. Given a simple array of data objects
+ // and a HTML template, it renders a list of elements, with
+ // support for a swipe delete action. An optional template
+ // can be provided for when the list is empty.
+
+ // items: Array
+ // The array of data items that will be rendered.
+ items: null,
+
+ // itemTemplate: String
+ // The URL to the HTML file containing the markup for each individual
+ // data item.
+ itemTemplate: "",
+
+ // emptyTemplate: String
+ // The URL to the HTML file containing the HTML to display if there
+ // are no data items. This is optional.
+ emptyTemplate: "",
+
+ // dividerTemplate: String
+ // The URL to the HTML file containing the markup for the dividers
+ // between groups of list items
+ dividerTemplate: "",
+
+ // dividerFunction: Function
+ // Function to create divider elements. This should return a divider
+ // value for each item in the list
+ dividerFunction: null,
+
+ // labelDelete: String
+ // The label to display for the Delete button
+ labelDelete: "Delete",
+
+ // labelCancel: String
+ // The label to display for the Cancel button
+ labelCancel: "Cancel",
+
+ // controller: Object
+ //
+ controller: null,
+
+ // autoDelete: Boolean
+ autoDelete: true,
+
+ // enableDelete: Boolean
+ enableDelete: true,
+
+ // enableHold: Boolean
+ enableHold: true,
+
+ // formatters: Object
+ // A name/value map of functions used to format data for display
+ formatters: null,
+
+ // _templateLoadCount: Number
+ // The number of templates remaining to load before the list renders.
+ _templateLoadCount: 0,
+
+ // _mouseDownPos: Object
+ // The coordinates of where a mouseDown event was detected
+ _mouseDownPos: null,
+
+ baseClass: "list",
+
+ constructor: function(){
+ this._checkLoadComplete = dojo.hitch(this, this._checkLoadComplete);
+ this._replaceToken = dojo.hitch(this, this._replaceToken);
+ this._postDeleteAnim = dojo.hitch(this, this._postDeleteAnim);
+ },
+
+ postCreate: function(){
+
+ var _this = this;
+
+ if(this.emptyTemplate){
+ this._templateLoadCount++;
+ }
+ if(this.itemTemplate){
+ this._templateLoadCount++;
+ }
+ if(this.dividerTemplate){
+ this._templateLoadCount++;
+ }
+
+ this.connect(this.domNode, "onmousedown", function(event){
+ var touch = event;
+ if(event.targetTouches && event.targetTouches.length > 0){
+ touch = event.targetTouches[0];
+ }
+
+ // Find the node that was tapped/clicked
+ var rowNode = _this._getRowNode(event.target);
+
+ if(rowNode){
+ // Add the rows data to the event so it can be picked up
+ // by any listeners
+ _this._setDataInfo(rowNode, event);
+
+ // Select and highlight the row
+ _this._selectRow(rowNode);
+
+ // Record the position that was tapped
+ _this._mouseDownPos = {
+ x: touch.pageX,
+ y: touch.pageY
+ };
+ _this._dragThreshold = null;
+ }
+ });
+
+ this.connect(this.domNode, "onmouseup", function(event){
+ // When the mouse/finger comes off the list,
+ // call the onSelect function and deselect the row.
+ if(event.targetTouches && event.targetTouches.length > 0){
+ event = event.targetTouches[0];
+ }
+ var rowNode = _this._getRowNode(event.target);
+
+ if(rowNode){
+
+ _this._setDataInfo(rowNode, event);
+
+ if(_this._selectedRow){
+ _this.onSelect(rowNode._data, rowNode._idx, rowNode);
+ }
+
+ this._deselectRow();
+ }
+ });
+
+ // If swipe-to-delete is enabled, listen for the mouse moving
+ if(this.enableDelete){
+ this.connect(this.domNode, "mousemove", function(event){
+ dojo.stopEvent(event);
+ if(!_this._selectedRow){
+ return;
+ }
+ var rowNode = _this._getRowNode(event.target);
+
+ // Still check for enableDelete in case it's changed after
+ // this listener is added.
+ if(_this.enableDelete && rowNode && !_this._deleting){
+ _this.handleDrag(event);
+ }
+ });
+ }
+
+ // Put the data and index onto each onclick event.
+ this.connect(this.domNode, "onclick", function(event){
+ if(event.touches && event.touches.length > 0){
+ event = event.touches[0];
+ }
+ var rowNode = _this._getRowNode(event.target, true);
+
+ if(rowNode){
+ _this._setDataInfo(rowNode, event);
+ }
+ });
+
+ // If the mouse or finger moves off the selected row,
+ // deselect it.
+ this.connect(this.domNode, "mouseout", function(event){
+ if(event.touches && event.touches.length > 0){
+ event = event.touches[0];
+ }
+ if(event.target == _this._selectedRow){
+ _this._deselectRow();
+ }
+ });
+
+ // If no item template has been provided, it is an error.
+ if(!this.itemTemplate){
+ throw Error("An item template must be provided to " + this.declaredClass);
+ }
+
+ // Load the item template
+ this._loadTemplate(this.itemTemplate, "itemTemplate", this._checkLoadComplete);
+
+ if(this.emptyTemplate){
+ // If the optional empty template has been provided, load it.
+ this._loadTemplate(this.emptyTemplate, "emptyTemplate", this._checkLoadComplete);
+ }
+
+ if(this.dividerTemplate){
+ this._loadTemplate(this.dividerTemplate, "dividerTemplate", this._checkLoadComplete);
+ }
+ },
+
+ handleDrag: function(event){
+ // summary:
+ // Handles rows being swiped for deletion.
+ var touch = event;
+ if(event.targetTouches && event.targetTouches.length > 0){
+ touch = event.targetTouches[0];
+ }
+
+ // Get the distance that the mouse or finger has moved since
+ // beginning the swipe action.
+ var diff = touch.pageX - this._mouseDownPos.x;
+
+ var absDiff = Math.abs(diff);
+ if(absDiff > 10 && !this._dragThreshold){
+ // Make the user drag the row 60% of the width to remove it
+ this._dragThreshold = dojo.marginBox(this._selectedRow).w * 0.6;
+ if(!this.autoDelete){
+ this.createDeleteButtons(this._selectedRow);
+ }
+ }
+
+ this._selectedRow.style.left = (absDiff > 10 ? diff : 0) + "px";
+
+ // If the user has dragged the row more than the threshold, slide
+ // it off the screen in preparation for deletion.
+ if(this._dragThreshold && this._dragThreshold < absDiff){
+ this.preDelete(diff);
+ }
+ },
+
+ handleDragCancel: function(){
+ // summary:
+ // Handle a drag action being cancelled, for whatever reason.
+ // Reset handles, remove CSS classes etc.
+ if(this._deleting){
+ return;
+ }
+ dojo.removeClass(this._selectedRow, "hold");
+ this._selectedRow.style.left = 0;
+ this._mouseDownPos = null;
+ this._dragThreshold = null;
+
+ this._deleteBtns && dojo.style(this._deleteBtns, "display", "none");
+ },
+
+ preDelete: function(currentLeftPos){
+ // summary:
+ // Slides the row offscreen before it is deleted
+
+ // TODO: do this with CSS3!
+ var self = this;
+
+ this._deleting = true;
+
+ dojo.animateProperty({
+ node: this._selectedRow,
+ duration: 400,
+ properties: {
+ left: {
+ end: currentLeftPos +
+ ((currentLeftPos > 0 ? 1 : -1) * this._dragThreshold * 0.8)
+ }
+ },
+ onEnd: dojo.hitch(this, function(){
+ if(this.autoDelete){
+ this.deleteRow(this._selectedRow);
+ }
+ })
+ }).play();
+ },
+
+ deleteRow: function(row){
+
+ // First make the row invisible
+ // Put it back where it came from
+ dojo.style(row, {
+ visibility: "hidden",
+ minHeight: "0px"
+ });
+ dojo.removeClass(row, "hold");
+
+ this._deleteAnimConn =
+ this.connect(row, "webkitAnimationEnd", this._postDeleteAnim);
+
+ dojo.addClass(row, "collapsed");
+ },
+
+ _postDeleteAnim: function(event){
+ // summary:
+ // Completes the deletion of a row.
+
+ if(this._deleteAnimConn){
+ this.disconnect(this._deleteAnimConn);
+ this._deleteAnimConn = null;
+ }
+
+ var row = this._selectedRow;
+ var sibling = row.nextSibling;
+ var prevSibling = row.previousSibling;
+
+ // If the previous node is a divider and either this is
+ // the last element in the list, or the next node is
+ // also a divider, remove the divider for the deleted section.
+ if(prevSibling && prevSibling._isDivider){
+ if(!sibling || sibling._isDivider){
+ prevSibling.parentNode.removeChild(prevSibling);
+ }
+ }
+
+ row.parentNode.removeChild(row);
+ this.onDelete(row._data, row._idx, this.items);
+
+ // Decrement the index of each following row
+ while(sibling){
+ if(sibling._idx){
+ sibling._idx--;
+ }
+ sibling = sibling.nextSibling;
+ }
+
+ dojo.destroy(row);
+
+ // Fix up the 'first' and 'last' CSS classes on the rows
+ dojo.query("> *:not(.buttons)", this.domNode).forEach(this.applyClass);
+
+ this._deleting = false;
+ this._deselectRow();
+ },
+
+ createDeleteButtons: function(aroundNode){
+ // summary:
+ // Creates the two buttons displayed when confirmation is
+ // required before deletion of a row.
+ // aroundNode:
+ // The DOM node of the row about to be deleted.
+ var mb = dojo.marginBox(aroundNode);
+ var pos = dojo._abs(aroundNode, true);
+
+ if(!this._deleteBtns){
+ // Create the delete buttons.
+ this._deleteBtns = dojo.create("div",{
+ "class": "buttons"
+ }, this.domNode);
+
+ this.buttons = [];
+
+ this.buttons.push(new dojox.mobile.Button({
+ btnClass: "mblRedButton",
+ label: this.labelDelete
+ }));
+ this.buttons.push(new dojox.mobile.Button({
+ btnClass: "mblBlueButton",
+ label: this.labelCancel
+ }));
+
+ dojo.place(this.buttons[0].domNode, this._deleteBtns);
+ dojo.place(this.buttons[1].domNode, this._deleteBtns);
+
+ dojo.addClass(this.buttons[0].domNode, "deleteBtn");
+ dojo.addClass(this.buttons[1].domNode, "cancelBtn");
+
+ this._handleButtonClick = dojo.hitch(this._handleButtonClick);
+ this.connect(this._deleteBtns, "onclick", this._handleButtonClick);
+ }
+ dojo.removeClass(this._deleteBtns, "fade out fast");
+ dojo.style(this._deleteBtns, {
+ display: "",
+ width: mb.w + "px",
+ height: mb.h + "px",
+ top: (aroundNode.offsetTop) + "px",
+ left: "0px"
+ });
+ },
+
+ onDelete: function(data, index, array){
+ // summary:
+ // Called when a row is deleted
+ // data:
+ // The data related to the row being deleted
+ // index:
+ // The index of the data in the total array
+ // array:
+ // The array of data used.
+
+ array.splice(index, 1);
+
+ // If the data is empty, rerender in case an emptyTemplate has
+ // been provided
+ if(array.length < 1){
+ this.render();
+ }
+ },
+
+ cancelDelete: function(){
+ // summary:
+ // Cancels the deletion of a row.
+ this._deleting = false;
+ this.handleDragCancel();
+ },
+
+ _handleButtonClick: function(event){
+ // summary:
+ // Handles the click of one of the deletion buttons, either to
+ // delete the row or to cancel the deletion.
+ if(event.touches && event.touches.length > 0){
+ event = event.touches[0];
+ }
+ var node = event.target;
+ if(dojo.hasClass(node, "deleteBtn")){
+ this.deleteRow(this._selectedRow);
+ }else if(dojo.hasClass(node, "cancelBtn")){
+ this.cancelDelete();
+ }else{
+ return;
+ }
+ dojo.addClass(this._deleteBtns, "fade out");
+ },
+
+ applyClass: function(node, idx, array){
+ // summary:
+ // Applies the 'first' and 'last' CSS classes to the relevant
+ // rows.
+
+ dojo.removeClass(node, "first last");
+ if(idx == 0){
+ dojo.addClass(node, "first");
+ }
+ if(idx == array.length - 1){
+ dojo.addClass(node, "last");
+ }
+ },
+
+ _setDataInfo: function(rowNode, event){
+ // summary:
+ // Attaches the data item and index for each row to any event
+ // that occurs on that row.
+ event.item = rowNode._data;
+ event.index = rowNode._idx;
+ },
+
+ onSelect: function(data, index, rowNode){
+ // summary:
+ // Dummy function that is called when a row is tapped
+ },
+
+ _selectRow: function(row){
+ // summary:
+ // Selects a row, applies the relevant CSS classes.
+ if(this._deleting && this._selectedRow && row != this._selectedRow){
+ this.cancelDelete();
+ }
+
+ if(!dojo.hasClass(row, "row")){
+ return;
+ }
+ if(this.enableHold || this.enableDelete){
+ dojo.addClass(row, "hold");
+ }
+ this._selectedRow = row;
+ },
+
+ _deselectRow: function(){
+ // summary:
+ // Deselects a row, and cancels any drag actions that were
+ // occurring.
+ if(!this._selectedRow || this._deleting){
+ return;
+ }
+ this.handleDragCancel();
+ dojo.removeClass(this._selectedRow, "hold");
+ this._selectedRow = null;
+ },
+
+ _getRowNode: function(fromNode, ignoreNoClick){
+ // summary:
+ // Gets the DOM node of the row that is equal to or the parent
+ // of the node passed to this function.
+ while(fromNode && !fromNode._data && fromNode != this.domNode){
+ if(!ignoreNoClick && dojo.hasClass(fromNode, "noclick")){
+ return null;
+ }
+ fromNode = fromNode.parentNode;
+ }
+ return fromNode == this.domNode ? null : fromNode;
+ },
+
+ applyTemplate: function(template, data){
+ return dojo._toDom(dojo.string.substitute(
+ template, data, this._replaceToken, this.formatters || this));
+ },
+
+ render: function(){
+ // summary:
+ // Renders the list.
+
+ // Delete all existing nodes, except the deletion buttons.
+ dojo.query("> *:not(.buttons)", this.domNode).forEach(dojo.destroy);
+
+ // If there is no data, and an empty template has been provided,
+ // render it.
+ if(this.items.length < 1 && this.emptyTemplate){
+ dojo.place(dojo._toDom(this.emptyTemplate), this.domNode, "first");
+ }else{
+ this.domNode.appendChild(this._renderRange(0, this.items.length));
+ }
+ if(dojo.hasClass(this.domNode.parentNode, "mblRoundRect")){
+ dojo.addClass(this.domNode.parentNode, "mblRoundRectList")
+ }
+
+ var divs = dojo.query("> .row", this.domNode);
+ if(divs.length > 0){
+ dojo.addClass(divs[0], "first");
+ dojo.addClass(divs[divs.length - 1], "last");
+ }
+ },
+
+ _renderRange: function(startIdx, endIdx){
+
+ var rows = [];
+ var row, i;
+ var frag = document.createDocumentFragment();
+ startIdx = Math.max(0, startIdx);
+ endIdx = Math.min(endIdx, this.items.length);
+
+ for(i = startIdx; i < endIdx; i++){
+ // Create a document fragment containing the templated row
+ row = this.applyTemplate(this.itemTemplate, this.items[i]);
+ dojo.addClass(row, 'row');
+ row._data = this.items[i];
+ row._idx = i;
+ rows.push(row);
+ }
+ if(!this.dividerFunction || !this.dividerTemplate){
+ for(i = startIdx; i < endIdx; i++){
+ rows[i]._data = this.items[i];
+ rows[i]._idx = i;
+ frag.appendChild(rows[i]);
+ }
+ }else{
+ var prevDividerValue = null;
+ var dividerValue;
+ var divider;
+ for(i = startIdx; i < endIdx; i++){
+ rows[i]._data = this.items[i];
+ rows[i]._idx = i;
+
+ dividerValue = this.dividerFunction(this.items[i]);
+ if(dividerValue && dividerValue != prevDividerValue){
+ divider = this.applyTemplate(this.dividerTemplate, {
+ label: dividerValue,
+ item: this.items[i]
+ });
+ divider._isDivider = true;
+ frag.appendChild(divider);
+ prevDividerValue = dividerValue;
+ }
+ frag.appendChild(rows[i]);
+ }
+ }
+ return frag;
+ },
+
+ _replaceToken: function(value, key){
+ if(key.charAt(0) == '!'){ value = dojo.getObject(key.substr(1), false, _this); }
+ if(typeof value == "undefined"){ return ""; } // a debugging aide
+ if(value == null){ return ""; }
+
+ // Substitution keys beginning with ! will skip the transform step,
+ // in case a user wishes to insert unescaped markup, e.g. ${!foo}
+ return key.charAt(0) == "!" ? value :
+ // Safer substitution, see heading "Attribute values" in
+ // http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.3.2
+ value.toString().replace(/"/g,"&quot;"); //TODO: add &amp? use encodeXML method?
+
+ },
+
+ _checkLoadComplete: function(){
+ // summary:
+ // Checks if all templates have loaded
+ this._templateLoadCount--;
+
+ if(this._templateLoadCount < 1 && this.get("items")){
+ this.render();
+ }
+ },
+
+ _loadTemplate: function(url, thisAttr, callback){
+ // summary:
+ // Loads a template
+ if(!url){
+ callback();
+ return;
+ }
+
+ if(templateCache[url]){
+ this.set(thisAttr, templateCache[url]);
+ callback();
+ }else{
+ var _this = this;
+
+ dojo.xhrGet({
+ url: url,
+ sync: false,
+ handleAs: "text",
+ load: function(text){
+ templateCache[url] = dojo.trim(text);
+ _this.set(thisAttr, templateCache[url]);
+ callback();
+ }
+ });
+ }
+ },
+
+
+ _setFormattersAttr: function(formatters){
+ // summary:
+ // Sets the data items, and causes a rerender of the list
+ this.formatters = formatters;
+ },
+
+ _setItemsAttr: function(items){
+ // summary:
+ // Sets the data items, and causes a rerender of the list
+
+ this.items = items || [];
+
+ if(this._templateLoadCount < 1 && items){
+ this.render();
+ }
+ },
+
+ destroy: function(){
+ if(this.buttons){
+ dojo.forEach(this.buttons, function(button){
+ button.destroy();
+ });
+ this.buttons = null;
+ }
+
+ this.inherited(arguments);
+ }
+
+ });
+
+})();
+
+}
+
+if(!dojo._hasResource["dojo.fx.Toggler"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.fx.Toggler"] = true;
+dojo.provide("dojo.fx.Toggler");
+
+
+
+dojo.declare("dojo.fx.Toggler", null, {
+ // summary:
+ // A simple `dojo.Animation` toggler API.
+ //
+ // description:
+ // class constructor for an animation toggler. It accepts a packed
+ // set of arguments about what type of animation to use in each
+ // direction, duration, etc. All available members are mixed into
+ // these animations from the constructor (for example, `node`,
+ // `showDuration`, `hideDuration`).
+ //
+ // example:
+ // | var t = new dojo.fx.Toggler({
+ // | node: "nodeId",
+ // | showDuration: 500,
+ // | // hideDuration will default to "200"
+ // | showFunc: dojo.fx.wipeIn,
+ // | // hideFunc will default to "fadeOut"
+ // | });
+ // | t.show(100); // delay showing for 100ms
+ // | // ...time passes...
+ // | t.hide();
+
+ // node: DomNode
+ // the node to target for the showing and hiding animations
+ node: null,
+
+ // showFunc: Function
+ // The function that returns the `dojo.Animation` to show the node
+ showFunc: dojo.fadeIn,
+
+ // hideFunc: Function
+ // The function that returns the `dojo.Animation` to hide the node
+ hideFunc: dojo.fadeOut,
+
+ // showDuration:
+ // Time in milliseconds to run the show Animation
+ showDuration: 200,
+
+ // hideDuration:
+ // Time in milliseconds to run the hide Animation
+ hideDuration: 200,
+
+ // FIXME: need a policy for where the toggler should "be" the next
+ // time show/hide are called if we're stopped somewhere in the
+ // middle.
+ // FIXME: also would be nice to specify individual showArgs/hideArgs mixed into
+ // each animation individually.
+ // FIXME: also would be nice to have events from the animations exposed/bridged
+
+ /*=====
+ _showArgs: null,
+ _showAnim: null,
+
+ _hideArgs: null,
+ _hideAnim: null,
+
+ _isShowing: false,
+ _isHiding: false,
+ =====*/
+
+ constructor: function(args){
+ var _t = this;
+
+ dojo.mixin(_t, args);
+ _t.node = args.node;
+ _t._showArgs = dojo.mixin({}, args);
+ _t._showArgs.node = _t.node;
+ _t._showArgs.duration = _t.showDuration;
+ _t.showAnim = _t.showFunc(_t._showArgs);
+
+ _t._hideArgs = dojo.mixin({}, args);
+ _t._hideArgs.node = _t.node;
+ _t._hideArgs.duration = _t.hideDuration;
+ _t.hideAnim = _t.hideFunc(_t._hideArgs);
+
+ dojo.connect(_t.showAnim, "beforeBegin", dojo.hitch(_t.hideAnim, "stop", true));
+ dojo.connect(_t.hideAnim, "beforeBegin", dojo.hitch(_t.showAnim, "stop", true));
+ },
+
+ show: function(delay){
+ // summary: Toggle the node to showing
+ // delay: Integer?
+ // Ammount of time to stall playing the show animation
+ return this.showAnim.play(delay || 0);
+ },
+
+ hide: function(delay){
+ // summary: Toggle the node to hidden
+ // delay: Integer?
+ // Ammount of time to stall playing the hide animation
+ return this.hideAnim.play(delay || 0);
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojo.fx"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.fx"] = true;
+dojo.provide("dojo.fx");
+
+
+
+
+/*=====
+dojo.fx = {
+ // summary: Effects library on top of Base animations
+};
+=====*/
+(function(){
+
+ var d = dojo,
+ _baseObj = {
+ _fire: function(evt, args){
+ if(this[evt]){
+ this[evt].apply(this, args||[]);
+ }
+ return this;
+ }
+ };
+
+ var _chain = function(animations){
+ this._index = -1;
+ this._animations = animations||[];
+ this._current = this._onAnimateCtx = this._onEndCtx = null;
+
+ this.duration = 0;
+ d.forEach(this._animations, function(a){
+ this.duration += a.duration;
+ if(a.delay){ this.duration += a.delay; }
+ }, this);
+ };
+ d.extend(_chain, {
+ _onAnimate: function(){
+ this._fire("onAnimate", arguments);
+ },
+ _onEnd: function(){
+ d.disconnect(this._onAnimateCtx);
+ d.disconnect(this._onEndCtx);
+ this._onAnimateCtx = this._onEndCtx = null;
+ if(this._index + 1 == this._animations.length){
+ this._fire("onEnd");
+ }else{
+ // switch animations
+ this._current = this._animations[++this._index];
+ this._onAnimateCtx = d.connect(this._current, "onAnimate", this, "_onAnimate");
+ this._onEndCtx = d.connect(this._current, "onEnd", this, "_onEnd");
+ this._current.play(0, true);
+ }
+ },
+ play: function(/*int?*/ delay, /*Boolean?*/ gotoStart){
+ if(!this._current){ this._current = this._animations[this._index = 0]; }
+ if(!gotoStart && this._current.status() == "playing"){ return this; }
+ var beforeBegin = d.connect(this._current, "beforeBegin", this, function(){
+ this._fire("beforeBegin");
+ }),
+ onBegin = d.connect(this._current, "onBegin", this, function(arg){
+ this._fire("onBegin", arguments);
+ }),
+ onPlay = d.connect(this._current, "onPlay", this, function(arg){
+ this._fire("onPlay", arguments);
+ d.disconnect(beforeBegin);
+ d.disconnect(onBegin);
+ d.disconnect(onPlay);
+ });
+ if(this._onAnimateCtx){
+ d.disconnect(this._onAnimateCtx);
+ }
+ this._onAnimateCtx = d.connect(this._current, "onAnimate", this, "_onAnimate");
+ if(this._onEndCtx){
+ d.disconnect(this._onEndCtx);
+ }
+ this._onEndCtx = d.connect(this._current, "onEnd", this, "_onEnd");
+ this._current.play.apply(this._current, arguments);
+ return this;
+ },
+ pause: function(){
+ if(this._current){
+ var e = d.connect(this._current, "onPause", this, function(arg){
+ this._fire("onPause", arguments);
+ d.disconnect(e);
+ });
+ this._current.pause();
+ }
+ return this;
+ },
+ gotoPercent: function(/*Decimal*/percent, /*Boolean?*/ andPlay){
+ this.pause();
+ var offset = this.duration * percent;
+ this._current = null;
+ d.some(this._animations, function(a){
+ if(a.duration <= offset){
+ this._current = a;
+ return true;
+ }
+ offset -= a.duration;
+ return false;
+ });
+ if(this._current){
+ this._current.gotoPercent(offset / this._current.duration, andPlay);
+ }
+ return this;
+ },
+ stop: function(/*boolean?*/ gotoEnd){
+ if(this._current){
+ if(gotoEnd){
+ for(; this._index + 1 < this._animations.length; ++this._index){
+ this._animations[this._index].stop(true);
+ }
+ this._current = this._animations[this._index];
+ }
+ var e = d.connect(this._current, "onStop", this, function(arg){
+ this._fire("onStop", arguments);
+ d.disconnect(e);
+ });
+ this._current.stop();
+ }
+ return this;
+ },
+ status: function(){
+ return this._current ? this._current.status() : "stopped";
+ },
+ destroy: function(){
+ if(this._onAnimateCtx){ d.disconnect(this._onAnimateCtx); }
+ if(this._onEndCtx){ d.disconnect(this._onEndCtx); }
+ }
+ });
+ d.extend(_chain, _baseObj);
+
+ dojo.fx.chain = function(/*dojo.Animation[]*/ animations){
+ // summary:
+ // Chain a list of `dojo.Animation`s to run in sequence
+ //
+ // description:
+ // Return a `dojo.Animation` which will play all passed
+ // `dojo.Animation` instances in sequence, firing its own
+ // synthesized events simulating a single animation. (eg:
+ // onEnd of this animation means the end of the chain,
+ // not the individual animations within)
+ //
+ // example:
+ // Once `node` is faded out, fade in `otherNode`
+ // | dojo.fx.chain([
+ // | dojo.fadeIn({ node:node }),
+ // | dojo.fadeOut({ node:otherNode })
+ // | ]).play();
+ //
+ return new _chain(animations) // dojo.Animation
+ };
+
+ var _combine = function(animations){
+ this._animations = animations||[];
+ this._connects = [];
+ this._finished = 0;
+
+ this.duration = 0;
+ d.forEach(animations, function(a){
+ var duration = a.duration;
+ if(a.delay){ duration += a.delay; }
+ if(this.duration < duration){ this.duration = duration; }
+ this._connects.push(d.connect(a, "onEnd", this, "_onEnd"));
+ }, this);
+
+ this._pseudoAnimation = new d.Animation({curve: [0, 1], duration: this.duration});
+ var self = this;
+ d.forEach(["beforeBegin", "onBegin", "onPlay", "onAnimate", "onPause", "onStop", "onEnd"],
+ function(evt){
+ self._connects.push(d.connect(self._pseudoAnimation, evt,
+ function(){ self._fire(evt, arguments); }
+ ));
+ }
+ );
+ };
+ d.extend(_combine, {
+ _doAction: function(action, args){
+ d.forEach(this._animations, function(a){
+ a[action].apply(a, args);
+ });
+ return this;
+ },
+ _onEnd: function(){
+ if(++this._finished > this._animations.length){
+ this._fire("onEnd");
+ }
+ },
+ _call: function(action, args){
+ var t = this._pseudoAnimation;
+ t[action].apply(t, args);
+ },
+ play: function(/*int?*/ delay, /*Boolean?*/ gotoStart){
+ this._finished = 0;
+ this._doAction("play", arguments);
+ this._call("play", arguments);
+ return this;
+ },
+ pause: function(){
+ this._doAction("pause", arguments);
+ this._call("pause", arguments);
+ return this;
+ },
+ gotoPercent: function(/*Decimal*/percent, /*Boolean?*/ andPlay){
+ var ms = this.duration * percent;
+ d.forEach(this._animations, function(a){
+ a.gotoPercent(a.duration < ms ? 1 : (ms / a.duration), andPlay);
+ });
+ this._call("gotoPercent", arguments);
+ return this;
+ },
+ stop: function(/*boolean?*/ gotoEnd){
+ this._doAction("stop", arguments);
+ this._call("stop", arguments);
+ return this;
+ },
+ status: function(){
+ return this._pseudoAnimation.status();
+ },
+ destroy: function(){
+ d.forEach(this._connects, dojo.disconnect);
+ }
+ });
+ d.extend(_combine, _baseObj);
+
+ dojo.fx.combine = function(/*dojo.Animation[]*/ animations){
+ // summary:
+ // Combine a list of `dojo.Animation`s to run in parallel
+ //
+ // description:
+ // Combine an array of `dojo.Animation`s to run in parallel,
+ // providing a new `dojo.Animation` instance encompasing each
+ // animation, firing standard animation events.
+ //
+ // example:
+ // Fade out `node` while fading in `otherNode` simultaneously
+ // | dojo.fx.combine([
+ // | dojo.fadeIn({ node:node }),
+ // | dojo.fadeOut({ node:otherNode })
+ // | ]).play();
+ //
+ // example:
+ // When the longest animation ends, execute a function:
+ // | var anim = dojo.fx.combine([
+ // | dojo.fadeIn({ node: n, duration:700 }),
+ // | dojo.fadeOut({ node: otherNode, duration: 300 })
+ // | ]);
+ // | dojo.connect(anim, "onEnd", function(){
+ // | // overall animation is done.
+ // | });
+ // | anim.play(); // play the animation
+ //
+ return new _combine(animations); // dojo.Animation
+ };
+
+ dojo.fx.wipeIn = function(/*Object*/ args){
+ // summary:
+ // Expand a node to it's natural height.
+ //
+ // description:
+ // Returns an animation that will expand the
+ // node defined in 'args' object from it's current height to
+ // it's natural height (with no scrollbar).
+ // Node must have no margin/border/padding.
+ //
+ // args: Object
+ // A hash-map of standard `dojo.Animation` constructor properties
+ // (such as easing: node: duration: and so on)
+ //
+ // example:
+ // | dojo.fx.wipeIn({
+ // | node:"someId"
+ // | }).play()
+ var node = args.node = d.byId(args.node), s = node.style, o;
+
+ var anim = d.animateProperty(d.mixin({
+ properties: {
+ height: {
+ // wrapped in functions so we wait till the last second to query (in case value has changed)
+ start: function(){
+ // start at current [computed] height, but use 1px rather than 0
+ // because 0 causes IE to display the whole panel
+ o = s.overflow;
+ s.overflow = "hidden";
+ if(s.visibility == "hidden" || s.display == "none"){
+ s.height = "1px";
+ s.display = "";
+ s.visibility = "";
+ return 1;
+ }else{
+ var height = d.style(node, "height");
+ return Math.max(height, 1);
+ }
+ },
+ end: function(){
+ return node.scrollHeight;
+ }
+ }
+ }
+ }, args));
+
+ d.connect(anim, "onEnd", function(){
+ s.height = "auto";
+ s.overflow = o;
+ });
+
+ return anim; // dojo.Animation
+ };
+
+ dojo.fx.wipeOut = function(/*Object*/ args){
+ // summary:
+ // Shrink a node to nothing and hide it.
+ //
+ // description:
+ // Returns an animation that will shrink node defined in "args"
+ // from it's current height to 1px, and then hide it.
+ //
+ // args: Object
+ // A hash-map of standard `dojo.Animation` constructor properties
+ // (such as easing: node: duration: and so on)
+ //
+ // example:
+ // | dojo.fx.wipeOut({ node:"someId" }).play()
+
+ var node = args.node = d.byId(args.node), s = node.style, o;
+
+ var anim = d.animateProperty(d.mixin({
+ properties: {
+ height: {
+ end: 1 // 0 causes IE to display the whole panel
+ }
+ }
+ }, args));
+
+ d.connect(anim, "beforeBegin", function(){
+ o = s.overflow;
+ s.overflow = "hidden";
+ s.display = "";
+ });
+ d.connect(anim, "onEnd", function(){
+ s.overflow = o;
+ s.height = "auto";
+ s.display = "none";
+ });
+
+ return anim; // dojo.Animation
+ };
+
+ dojo.fx.slideTo = function(/*Object*/ args){
+ // summary:
+ // Slide a node to a new top/left position
+ //
+ // description:
+ // Returns an animation that will slide "node"
+ // defined in args Object from its current position to
+ // the position defined by (args.left, args.top).
+ //
+ // args: Object
+ // A hash-map of standard `dojo.Animation` constructor properties
+ // (such as easing: node: duration: and so on). Special args members
+ // are `top` and `left`, which indicate the new position to slide to.
+ //
+ // example:
+ // | dojo.fx.slideTo({ node: node, left:"40", top:"50", units:"px" }).play()
+
+ var node = args.node = d.byId(args.node),
+ top = null, left = null;
+
+ var init = (function(n){
+ return function(){
+ var cs = d.getComputedStyle(n);
+ var pos = cs.position;
+ top = (pos == 'absolute' ? n.offsetTop : parseInt(cs.top) || 0);
+ left = (pos == 'absolute' ? n.offsetLeft : parseInt(cs.left) || 0);
+ if(pos != 'absolute' && pos != 'relative'){
+ var ret = d.position(n, true);
+ top = ret.y;
+ left = ret.x;
+ n.style.position="absolute";
+ n.style.top=top+"px";
+ n.style.left=left+"px";
+ }
+ };
+ })(node);
+ init();
+
+ var anim = d.animateProperty(d.mixin({
+ properties: {
+ top: args.top || 0,
+ left: args.left || 0
+ }
+ }, args));
+ d.connect(anim, "beforeBegin", anim, init);
+
+ return anim; // dojo.Animation
+ };
+
+})();
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app.ListSelector"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.ListSelector"] = true;
+dojo.provide("dojox.mobile.app.ListSelector");
+dojo.experimental("dojox.mobile.app.ListSelector");
+
+
+
+
+dojo.declare("dojox.mobile.app.ListSelector", dojox.mobile.app._Widget, {
+
+ // data: Array
+ // The array of items to display. Each element in the array
+ // should have both a label and value attribute, e.g.
+ // [{label: "Open", value: 1} , {label: "Delete", value: 2}]
+ data: null,
+
+ // controller: Object
+ // The current SceneController widget.
+ controller: null,
+
+ // onChoose: Function
+ // The callback function for when an item is selected
+ onChoose: null,
+
+ destroyOnHide: false,
+
+ _setDataAttr: function(data){
+ this.data = data;
+
+ if(this.data){
+ this.render();
+ }
+ },
+
+ postCreate: function(){
+ dojo.addClass(this.domNode, "listSelector");
+
+ var _this = this;
+
+ this.connect(this.domNode, "onclick", function(event){
+ if(!dojo.hasClass(event.target, "listSelectorRow")){
+ return;
+ }
+
+ if(_this.onChoose){
+ _this.onChoose(_this.data[event.target._idx].value);
+ }
+ _this.hide();
+ });
+
+ this.connect(this.domNode, "onmousedown", function(event){
+ if(!dojo.hasClass(event.target, "listSelectorRow")){
+ return;
+ }
+ dojo.addClass(event.target, "listSelectorRow-selected");
+ });
+
+ this.connect(this.domNode, "onmouseup", function(event){
+ if(!dojo.hasClass(event.target, "listSelectorRow")){
+ return;
+ }
+ dojo.removeClass(event.target, "listSelectorRow-selected");
+ });
+
+ this.connect(this.domNode, "onmouseout", function(event){
+ if(!dojo.hasClass(event.target, "listSelectorRow")){
+ return;
+ }
+ dojo.removeClass(event.target, "listSelectorRow-selected");
+ });
+
+ var viewportSize = this.controller.getWindowSize();
+
+ this.mask = dojo.create("div", {"class": "dialogUnderlayWrapper",
+ innerHTML: "<div class=\"dialogUnderlay\"></div>"
+ }, this.controller.assistant.domNode);
+
+ this.connect(this.mask, "onclick", function(){
+ _this.onChoose && _this.onChoose();
+ _this.hide();
+ });
+ },
+
+ show: function(fromNode){
+
+ // Using dojo.fx here. Must figure out how to do this with CSS animations!!
+ var startPos;
+
+ var windowSize = this.controller.getWindowSize();
+ var fromNodePos;
+ if(fromNode){
+ fromNodePos = dojo._abs(fromNode);
+ startPos = fromNodePos;
+ }else{
+ startPos.x = windowSize.w / 2;
+ startPos.y = 200;
+ }
+ console.log("startPos = ", startPos);
+
+ dojo.style(this.domNode, {
+ opacity: 0,
+ display: "",
+ width: Math.floor(windowSize.w * 0.8) + "px"
+ });
+
+ var maxWidth = 0;
+ dojo.query(">", this.domNode).forEach(function(node){
+ dojo.style(node, {
+ "float": "left"
+ });
+ maxWidth = Math.max(maxWidth, dojo.marginBox(node).w);
+ dojo.style(node, {
+ "float": "none"
+ });
+ });
+ maxWidth = Math.min(maxWidth, Math.round(windowSize.w * 0.8))
+ + dojo.style(this.domNode, "paddingLeft")
+ + dojo.style(this.domNode, "paddingRight")
+ + 1;
+
+ dojo.style(this.domNode, "width", maxWidth + "px");
+ var targetHeight = dojo.marginBox(this.domNode).h;
+
+ var _this = this;
+
+
+ var targetY = fromNodePos ?
+ Math.max(30, fromNodePos.y - targetHeight - 10) :
+ this.getScroll().y + 30;
+
+ console.log("fromNodePos = ", fromNodePos, " targetHeight = ", targetHeight,
+ " targetY = " + targetY, " startPos ", startPos);
+
+
+ var anim1 = dojo.animateProperty({
+ node: this.domNode,
+ duration: 400,
+ properties: {
+ width: {start: 1, end: maxWidth},
+ height: {start: 1, end: targetHeight},
+ top: {start: startPos.y, end: targetY},
+ left: {start: startPos.x, end: (windowSize.w/2 - maxWidth/2)},
+ opacity: {start: 0, end: 1},
+ fontSize: {start: 1}
+ },
+ onEnd: function(){
+ dojo.style(_this.domNode, "width", "inherit");
+ }
+ });
+ var anim2 = dojo.fadeIn({
+ node: this.mask,
+ duration: 400
+ });
+ dojo.fx.combine([anim1, anim2]).play();
+
+ },
+
+ hide: function(){
+ // Using dojo.fx here. Must figure out how to do this with CSS animations!!
+
+ var _this = this;
+
+ var anim1 = dojo.animateProperty({
+ node: this.domNode,
+ duration: 500,
+ properties: {
+ width: {end: 1},
+ height: {end: 1},
+ opacity: {end: 0},
+ fontSize: {end: 1}
+ },
+ onEnd: function(){
+ if(_this.get("destroyOnHide")){
+ _this.destroy();
+ }
+ }
+ });
+
+ var anim2 = dojo.fadeOut({
+ node: this.mask,
+ duration: 400
+ });
+ dojo.fx.combine([anim1, anim2]).play();
+ },
+
+ render: function(){
+ // summary:
+ // Renders
+
+ dojo.empty(this.domNode);
+ dojo.style(this.domNode, "opacity", 0);
+
+ var row;
+
+ for(var i = 0; i < this.data.length; i++){
+ // Create each row and add any custom classes. Also set the _idx property.
+ row = dojo.create("div", {
+ "class": "listSelectorRow " + (this.data[i].className || ""),
+ innerHTML: this.data[i].label
+ }, this.domNode);
+
+ row._idx = i;
+
+ if(i == 0){
+ dojo.addClass(row, "first");
+ }
+ if(i == this.data.length - 1){
+ dojo.addClass(row, "last");
+ }
+
+ }
+ },
+
+
+ destroy: function(){
+ this.inherited(arguments);
+ dojo.destroy(this.mask);
+ }
+
+});
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app._FormWidget"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app._FormWidget"] = true;
+dojo.provide("dojox.mobile.app._FormWidget");
+dojo.experimental("dojox.mobile.app._FormWidget");
+
+
+
+
+
+dojo.declare("dojox.mobile.app._FormWidget", dijit._WidgetBase, {
+ // summary:
+ // Base class for widgets corresponding to native HTML elements such as <checkbox> or <button>,
+ // which can be children of a <form> node or a `dojox.mobile.app.Form` widget.
+ //
+ // description:
+ // Represents a single HTML element.
+ // All these widgets should have these attributes just like native HTML input elements.
+ // You can set them during widget construction or afterwards, via `dijit._WidgetBase.attr`.
+ //
+ // They also share some common methods.
+
+ // name: String
+ // Name used when submitting form; same as "name" attribute or plain HTML elements
+ name: "",
+
+ // alt: String
+ // Corresponds to the native HTML <input> element's attribute.
+ alt: "",
+
+ // value: String
+ // Corresponds to the native HTML <input> element's attribute.
+ value: "",
+
+ // type: String
+ // Corresponds to the native HTML <input> element's attribute.
+ type: "text",
+
+ // disabled: Boolean
+ // Should this widget respond to user input?
+ // In markup, this is specified as "disabled='disabled'", or just "disabled".
+ disabled: false,
+
+ // intermediateChanges: Boolean
+ // Fires onChange for each value change or only on demand
+ intermediateChanges: false,
+
+ // scrollOnFocus: Boolean
+ // On focus, should this widget scroll into view?
+ scrollOnFocus: false,
+
+ // These mixins assume that the focus node is an INPUT, as many but not all _FormWidgets are.
+ attributeMap: dojo.delegate(dijit._WidgetBase.prototype.attributeMap, {
+ value: "focusNode",
+ id: "focusNode",
+ alt: "focusNode",
+ title: "focusNode"
+ }),
+
+ postMixInProperties: function(){
+ // Setup name=foo string to be referenced from the template (but only if a name has been specified)
+ // Unfortunately we can't use attributeMap to set the name due to IE limitations, see #8660
+ // Regarding escaping, see heading "Attribute values" in
+ // http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.3.2
+ this.nameAttrSetting = this.name ? ('name="' + this.name.replace(/'/g, "&quot;") + '"') : '';
+ this.inherited(arguments);
+ },
+
+ postCreate: function(){
+ this.inherited(arguments);
+ this.connect(this.domNode, "onmousedown", "_onMouseDown");
+ },
+
+ _setDisabledAttr: function(/*Boolean*/ value){
+ this.disabled = value;
+ dojo.attr(this.focusNode, 'disabled', value);
+ if(this.valueNode){
+ dojo.attr(this.valueNode, 'disabled', value);
+ }
+ },
+
+ _onFocus: function(e){
+ if(this.scrollOnFocus){
+ dojo.window.scrollIntoView(this.domNode);
+ }
+ this.inherited(arguments);
+ },
+
+ isFocusable: function(){
+ // summary:
+ // Tells if this widget is focusable or not. Used internally by dijit.
+ // tags:
+ // protected
+ return !this.disabled && !this.readOnly
+ && this.focusNode && (dojo.style(this.domNode, "display") != "none");
+ },
+
+ focus: function(){
+ // summary:
+ // Put focus on this widget
+ this.focusNode.focus();
+ },
+
+ compare: function(/*anything*/val1, /*anything*/val2){
+ // summary:
+ // Compare 2 values (as returned by attr('value') for this widget).
+ // tags:
+ // protected
+ if(typeof val1 == "number" && typeof val2 == "number"){
+ return (isNaN(val1) && isNaN(val2)) ? 0 : val1 - val2;
+ }else if(val1 > val2){
+ return 1;
+ }else if(val1 < val2){
+ return -1;
+ }else{
+ return 0;
+ }
+ },
+
+ onChange: function(newValue){
+ // summary:
+ // Callback when this widget's value is changed.
+ // tags:
+ // callback
+ },
+
+ // _onChangeActive: [private] Boolean
+ // Indicates that changes to the value should call onChange() callback.
+ // This is false during widget initialization, to avoid calling onChange()
+ // when the initial value is set.
+ _onChangeActive: false,
+
+ _handleOnChange: function(/*anything*/ newValue, /* Boolean? */ priorityChange){
+ // summary:
+ // Called when the value of the widget is set. Calls onChange() if appropriate
+ // newValue:
+ // the new value
+ // priorityChange:
+ // For a slider, for example, dragging the slider is priorityChange==false,
+ // but on mouse up, it's priorityChange==true. If intermediateChanges==true,
+ // onChange is only called form priorityChange=true events.
+ // tags:
+ // private
+ this._lastValue = newValue;
+ if(this._lastValueReported == undefined && (priorityChange === null || !this._onChangeActive)){
+ // this block executes not for a change, but during initialization,
+ // and is used to store away the original value (or for ToggleButton, the original checked state)
+ this._resetValue = this._lastValueReported = newValue;
+ }
+ if((this.intermediateChanges || priorityChange || priorityChange === undefined) &&
+ ((typeof newValue != typeof this._lastValueReported) ||
+ this.compare(newValue, this._lastValueReported) != 0)){
+ this._lastValueReported = newValue;
+ if(this._onChangeActive){
+ if(this._onChangeHandle){
+ clearTimeout(this._onChangeHandle);
+ }
+ // setTimout allows hidden value processing to run and
+ // also the onChange handler can safely adjust focus, etc
+ this._onChangeHandle = setTimeout(dojo.hitch(this,
+ function(){
+ this._onChangeHandle = null;
+ this.onChange(newValue);
+ }), 0); // try to collapse multiple onChange's fired faster than can be processed
+ }
+ }
+ },
+
+ create: function(){
+ // Overrides _Widget.create()
+ this.inherited(arguments);
+ this._onChangeActive = true;
+ },
+
+ destroy: function(){
+ if(this._onChangeHandle){ // destroy called before last onChange has fired
+ clearTimeout(this._onChangeHandle);
+ this.onChange(this._lastValueReported);
+ }
+ this.inherited(arguments);
+ },
+
+ _onMouseDown: function(e){
+ // If user clicks on the button, even if the mouse is released outside of it,
+ // this button should get focus (to mimics native browser buttons).
+ // This is also needed on chrome because otherwise buttons won't get focus at all,
+ // which leads to bizarre focus restore on Dialog close etc.
+ if(this.isFocusable()){
+ // Set a global event to handle mouseup, so it fires properly
+ // even if the cursor leaves this.domNode before the mouse up event.
+ var mouseUpConnector = this.connect(dojo.body(), "onmouseup", function(){
+ if(this.isFocusable()){
+ this.focus();
+ }
+ this.disconnect(mouseUpConnector);
+ });
+ }
+ },
+
+ selectInputText: function(/*DomNode*/element, /*Number?*/ start, /*Number?*/ stop){
+ // summary:
+ // Select text in the input element argument, from start (default 0), to stop (default end).
+
+ // TODO: use functions in _editor/selection.js?
+ var _window = dojo.global;
+ var _document = dojo.doc;
+ element = dojo.byId(element);
+ if(isNaN(start)){ start = 0; }
+ if(isNaN(stop)){ stop = element.value ? element.value.length : 0; }
+ dijit.focus(element);
+
+ if(_window["getSelection"] && element.setSelectionRange){
+ element.setSelectionRange(start, stop);
+ }
+ }
+});
+
+dojo.declare("dojox.mobile.app._FormValueWidget", dojox.mobile.app._FormWidget,
+{
+ // summary:
+ // Base class for widgets corresponding to native HTML elements such as <input> or <select> that have user changeable values.
+ // description:
+ // Each _FormValueWidget represents a single input value, and has a (possibly hidden) <input> element,
+ // to which it serializes it's input value, so that form submission (either normal submission or via FormBind?)
+ // works as expected.
+
+ // Don't attempt to mixin the 'type', 'name' attributes here programatically -- they must be declared
+ // directly in the template as read by the parser in order to function. IE is known to specifically
+ // require the 'name' attribute at element creation time. See #8484, #8660.
+ // TODO: unclear what that {value: ""} is for; FormWidget.attributeMap copies value to focusNode,
+ // so maybe {value: ""} is so the value *doesn't* get copied to focusNode?
+ // Seems like we really want value removed from attributeMap altogether
+ // (although there's no easy way to do that now)
+
+ // readOnly: Boolean
+ // Should this widget respond to user input?
+ // In markup, this is specified as "readOnly".
+ // Similar to disabled except readOnly form values are submitted.
+ readOnly: false,
+
+ attributeMap: dojo.delegate(dojox.mobile.app._FormWidget.prototype.attributeMap, {
+ value: "",
+ readOnly: "focusNode"
+ }),
+
+ _setReadOnlyAttr: function(/*Boolean*/ value){
+ this.readOnly = value;
+ dojo.attr(this.focusNode, 'readOnly', value);
+ },
+
+ postCreate: function(){
+ this.inherited(arguments);
+
+ // Update our reset value if it hasn't yet been set (because this.set()
+ // is only called when there *is* a value)
+ if(this._resetValue === undefined){
+ this._resetValue = this.value;
+ }
+ },
+
+ _setValueAttr: function(/*anything*/ newValue, /*Boolean, optional*/ priorityChange){
+ // summary:
+ // Hook so attr('value', value) works.
+ // description:
+ // Sets the value of the widget.
+ // If the value has changed, then fire onChange event, unless priorityChange
+ // is specified as null (or false?)
+ this.value = newValue;
+ this._handleOnChange(newValue, priorityChange);
+ },
+
+ _getValueAttr: function(){
+ // summary:
+ // Hook so attr('value') works.
+ return this._lastValue;
+ },
+
+ undo: function(){
+ // summary:
+ // Restore the value to the last value passed to onChange
+ this._setValueAttr(this._lastValueReported, false);
+ },
+
+ reset: function(){
+ // summary:
+ // Reset the widget's value to what it was at initialization time
+ this._hasBeenBlurred = false;
+ this._setValueAttr(this._resetValue, true);
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app.TextBox"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.TextBox"] = true;
+dojo.provide("dojox.mobile.app.TextBox");
+dojo.experimental("dojox.mobile.app.TextBox");
+
+
+
+
+dojo.declare(
+ "dojox.mobile.app.TextBox",
+ dojox.mobile.app._FormValueWidget, {
+
+ // summary:
+ // A base class for textbox form inputs
+
+ // trim: Boolean
+ // Removes leading and trailing whitespace if true. Default is false.
+ trim: false,
+
+ // uppercase: Boolean
+ // Converts all characters to uppercase if true. Default is false.
+ uppercase: false,
+
+ // lowercase: Boolean
+ // Converts all characters to lowercase if true. Default is false.
+ lowercase: false,
+
+ // propercase: Boolean
+ // Converts the first character of each word to uppercase if true.
+ propercase: false,
+
+ // maxLength: String
+ // HTML INPUT tag maxLength declaration.
+ maxLength: "",
+
+ // selectOnClick: [const] Boolean
+ // If true, all text will be selected when focused with mouse
+ selectOnClick: false,
+
+ // placeHolder: String
+ // Defines a hint to help users fill out the input field (as defined in HTML 5).
+ // This should only contain plain text (no html markup).
+ placeHolder: "",
+
+ baseClass: "mblTextBox",
+
+ attributeMap: dojo.delegate(dojox.mobile.app._FormValueWidget.prototype.attributeMap, {
+ maxLength: "focusNode"
+ }),
+
+ buildRendering: function(){
+ var node = this.srcNodeRef;
+
+ // If an input is used as the source node, wrap it in a div
+ if(!node || node.tagName != "INPUT"){
+ node = dojo.create("input", {});
+ }
+
+ dojo.attr(node, {
+ type: "text",
+ value: dojo.attr(node, "value") || "",
+ placeholder: this.placeHolder || null
+ });
+
+ this.domNode = this.textbox = this.focusNode = node;
+ },
+
+ _setPlaceHolderAttr: function(v){
+ this.placeHolder = v;
+ if(this.textbox){
+ dojo.attr(this.textbox, "placeholder", v);
+ }
+ },
+
+
+ _getValueAttr: function(){
+ // summary:
+ // Hook so attr('value') works as we like.
+ // description:
+ // For `dijit.form.TextBox` this basically returns the value of the <input>.
+ //
+ // For `dijit.form.MappedTextBox` subclasses, which have both
+ // a "displayed value" and a separate "submit value",
+ // This treats the "displayed value" as the master value, computing the
+ // submit value from it via this.parse().
+ return this.parse(this.get('displayedValue'), this.constraints);
+ },
+
+ _setValueAttr: function(value, /*Boolean?*/ priorityChange, /*String?*/ formattedValue){
+ // summary:
+ // Hook so attr('value', ...) works.
+ //
+ // description:
+ // Sets the value of the widget to "value" which can be of
+ // any type as determined by the widget.
+ //
+ // value:
+ // The visual element value is also set to a corresponding,
+ // but not necessarily the same, value.
+ //
+ // formattedValue:
+ // If specified, used to set the visual element value,
+ // otherwise a computed visual value is used.
+ //
+ // priorityChange:
+ // If true, an onChange event is fired immediately instead of
+ // waiting for the next blur event.
+
+ var filteredValue;
+ if(value !== undefined){
+ // TODO: this is calling filter() on both the display value and the actual value.
+ // I added a comment to the filter() definition about this, but it should be changed.
+ filteredValue = this.filter(value);
+ if(typeof formattedValue != "string"){
+ if(filteredValue !== null
+ && ((typeof filteredValue != "number") || !isNaN(filteredValue))){
+ formattedValue = this.filter(this.format(filteredValue, this.constraints));
+ }else{ formattedValue = ''; }
+ }
+ }
+ if(formattedValue != null && formattedValue != undefined
+ && ((typeof formattedValue) != "number" || !isNaN(formattedValue))
+ && this.textbox.value != formattedValue){
+ this.textbox.value = formattedValue;
+ }
+
+ this.inherited(arguments, [filteredValue, priorityChange]);
+ },
+
+ // displayedValue: String
+ // For subclasses like ComboBox where the displayed value
+ // (ex: Kentucky) and the serialized value (ex: KY) are different,
+ // this represents the displayed value.
+ //
+ // Setting 'displayedValue' through attr('displayedValue', ...)
+ // updates 'value', and vice-versa. Otherwise 'value' is updated
+ // from 'displayedValue' periodically, like onBlur etc.
+ //
+ // TODO: move declaration to MappedTextBox?
+ // Problem is that ComboBox references displayedValue,
+ // for benefit of FilteringSelect.
+ displayedValue: "",
+
+ _getDisplayedValueAttr: function(){
+ // summary:
+ // Hook so attr('displayedValue') works.
+ // description:
+ // Returns the displayed value (what the user sees on the screen),
+ // after filtering (ie, trimming spaces etc.).
+ //
+ // For some subclasses of TextBox (like ComboBox), the displayed value
+ // is different from the serialized value that's actually
+ // sent to the server (see dijit.form.ValidationTextBox.serialize)
+
+ return this.filter(this.textbox.value);
+ },
+
+ _setDisplayedValueAttr: function(/*String*/value){
+ // summary:
+ // Hook so attr('displayedValue', ...) works.
+ // description:
+ // Sets the value of the visual element to the string "value".
+ // The widget value is also set to a corresponding,
+ // but not necessarily the same, value.
+
+ if(value === null || value === undefined){ value = '' }
+ else if(typeof value != "string"){ value = String(value) }
+ this.textbox.value = value;
+ this._setValueAttr(this.get('value'), undefined, value);
+ },
+
+ format: function(/* String */ value, /* Object */ constraints){
+ // summary:
+ // Replacable function to convert a value to a properly formatted string.
+ // tags:
+ // protected extension
+ return ((value == null || value == undefined) ? "" : (value.toString ? value.toString() : value));
+ },
+
+ parse: function(/* String */ value, /* Object */ constraints){
+ // summary:
+ // Replacable function to convert a formatted string to a value
+ // tags:
+ // protected extension
+
+ return value; // String
+ },
+
+ _refreshState: function(){
+ // summary:
+ // After the user types some characters, etc., this method is
+ // called to check the field for validity etc. The base method
+ // in `dijit.form.TextBox` does nothing, but subclasses override.
+ // tags:
+ // protected
+ },
+
+ _onInput: function(e){
+ if(e && e.type && /key/i.test(e.type) && e.keyCode){
+ switch(e.keyCode){
+ case dojo.keys.SHIFT:
+ case dojo.keys.ALT:
+ case dojo.keys.CTRL:
+ case dojo.keys.TAB:
+ return;
+ }
+ }
+ if(this.intermediateChanges){
+ var _this = this;
+ // the setTimeout allows the key to post to the widget input box
+ setTimeout(function(){ _this._handleOnChange(_this.get('value'), false); }, 0);
+ }
+ this._refreshState();
+ },
+
+ postCreate: function(){
+ // setting the value here is needed since value="" in the template causes "undefined"
+ // and setting in the DOM (instead of the JS object) helps with form reset actions
+
+ this.textbox.setAttribute("value", this.textbox.value); // DOM and JS values shuld be the same
+ this.inherited(arguments);
+ if(dojo.isMoz || dojo.isOpera){
+ this.connect(this.textbox, "oninput", this._onInput);
+ }else{
+ this.connect(this.textbox, "onkeydown", this._onInput);
+ this.connect(this.textbox, "onkeyup", this._onInput);
+ this.connect(this.textbox, "onpaste", this._onInput);
+ this.connect(this.textbox, "oncut", this._onInput);
+ }
+ },
+
+ _blankValue: '', // if the textbox is blank, what value should be reported
+ filter: function(val){
+ // summary:
+ // Auto-corrections (such as trimming) that are applied to textbox
+ // value on blur or form submit.
+ // description:
+ // For MappedTextBox subclasses, this is called twice
+ // - once with the display value
+ // - once the value as set/returned by attr('value', ...)
+ // and attr('value'), ex: a Number for NumberTextBox.
+ //
+ // In the latter case it does corrections like converting null to NaN. In
+ // the former case the NumberTextBox.filter() method calls this.inherited()
+ // to execute standard trimming code in TextBox.filter().
+ //
+ // TODO: break this into two methods in 2.0
+ //
+ // tags:
+ // protected extension
+ if(val === null){ return this._blankValue; }
+ if(typeof val != "string"){ return val; }
+ if(this.trim){
+ val = dojo.trim(val);
+ }
+ if(this.uppercase){
+ val = val.toUpperCase();
+ }
+ if(this.lowercase){
+ val = val.toLowerCase();
+ }
+ if(this.propercase){
+ val = val.replace(/[^\s]+/g, function(word){
+ return word.substring(0,1).toUpperCase() + word.substring(1);
+ });
+ }
+ return val;
+ },
+
+ _setBlurValue: function(){
+ this._setValueAttr(this.get('value'), true);
+ },
+
+ _onBlur: function(e){
+ if(this.disabled){ return; }
+ this._setBlurValue();
+ this.inherited(arguments);
+
+ if(this._selectOnClickHandle){
+ this.disconnect(this._selectOnClickHandle);
+ }
+ if(this.selectOnClick && dojo.isMoz){
+ this.textbox.selectionStart = this.textbox.selectionEnd = undefined; // clear selection so that the next mouse click doesn't reselect
+ }
+
+ },
+
+ _onFocus: function(/*String*/ by){
+ if(this.disabled || this.readOnly){ return; }
+
+ // Select all text on focus via click if nothing already selected.
+ // Since mouse-up will clear the selection need to defer selection until after mouse-up.
+ // Don't do anything on focus by tabbing into the widget since there's no associated mouse-up event.
+ if(this.selectOnClick && by == "mouse"){
+ this._selectOnClickHandle = this.connect(this.domNode, "onmouseup", function(){
+ // Only select all text on first click; otherwise users would have no way to clear
+ // the selection.
+ this.disconnect(this._selectOnClickHandle);
+
+ // Check if the user selected some text manually (mouse-down, mouse-move, mouse-up)
+ // and if not, then select all the text
+ var textIsNotSelected;
+ textIsNotSelected = this.textbox.selectionStart == this.textbox.selectionEnd;
+ if(textIsNotSelected){
+ this.selectInputText(this.textbox);
+ }
+ });
+ }
+
+ this._refreshState();
+ this.inherited(arguments);
+ },
+
+ reset: function(){
+ // Overrides dijit._FormWidget.reset().
+ // Additionally resets the displayed textbox value to ''
+ this.textbox.value = '';
+ this.inherited(arguments);
+ }
+ }
+);
+
+}
+
+if(!dojo._hasResource["dojo.fx.easing"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.fx.easing"] = true;
+dojo.provide("dojo.fx.easing");
+
+
+dojo.getObject("fx.easing", true, dojo);
+
+dojo.fx.easing = {
+ // summary:
+ // Collection of easing functions to use beyond the default
+ // `dojo._defaultEasing` function.
+ //
+ // description:
+ //
+ // Easing functions are used to manipulate the iteration through
+ // an `dojo.Animation`s _Line. _Line being the properties of an Animation,
+ // and the easing function progresses through that Line determing
+ // how quickly (or slowly) it should go. Or more accurately: modify
+ // the value of the _Line based on the percentage of animation completed.
+ //
+ // 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.
+ //
+ // One does not call the easing function directly, it must be passed to
+ // the `easing` property of an animation.
+ //
+ // example:
+ // |
+ // | var anim = dojo.fadeOut({
+ // | node: 'node',
+ // | duration: 2000,
+ // | // note there is no ()
+ // | easing: dojo.fx.easing.quadIn
+ // | }).play();
+ //
+
+ linear: function(/* Decimal? */n){
+ // summary: A linear easing function
+ return n;
+ },
+
+ quadIn: function(/* Decimal? */n){
+ return Math.pow(n, 2);
+ },
+
+ quadOut: function(/* Decimal? */n){
+ return n * (n - 2) * -1;
+ },
+
+ quadInOut: function(/* Decimal? */n){
+ n = n * 2;
+ if(n < 1){ return Math.pow(n, 2) / 2; }
+ return -1 * ((--n) * (n - 2) - 1) / 2;
+ },
+
+ cubicIn: function(/* Decimal? */n){
+ return Math.pow(n, 3);
+ },
+
+ cubicOut: function(/* Decimal? */n){
+ return Math.pow(n - 1, 3) + 1;
+ },
+
+ cubicInOut: function(/* Decimal? */n){
+ n = n * 2;
+ if(n < 1){ return Math.pow(n, 3) / 2; }
+ n -= 2;
+ return (Math.pow(n, 3) + 2) / 2;
+ },
+
+ quartIn: function(/* Decimal? */n){
+ return Math.pow(n, 4);
+ },
+
+ quartOut: function(/* Decimal? */n){
+ return -1 * (Math.pow(n - 1, 4) - 1);
+ },
+
+ quartInOut: function(/* Decimal? */n){
+ n = n * 2;
+ if(n < 1){ return Math.pow(n, 4) / 2; }
+ n -= 2;
+ return -1 / 2 * (Math.pow(n, 4) - 2);
+ },
+
+ quintIn: function(/* Decimal? */n){
+ return Math.pow(n, 5);
+ },
+
+ quintOut: function(/* Decimal? */n){
+ return Math.pow(n - 1, 5) + 1;
+ },
+
+ quintInOut: function(/* Decimal? */n){
+ n = n * 2;
+ if(n < 1){ return Math.pow(n, 5) / 2; };
+ n -= 2;
+ return (Math.pow(n, 5) + 2) / 2;
+ },
+
+ sineIn: function(/* Decimal? */n){
+ return -1 * Math.cos(n * (Math.PI / 2)) + 1;
+ },
+
+ sineOut: function(/* Decimal? */n){
+ return Math.sin(n * (Math.PI / 2));
+ },
+
+ sineInOut: function(/* Decimal? */n){
+ return -1 * (Math.cos(Math.PI * n) - 1) / 2;
+ },
+
+ expoIn: function(/* Decimal? */n){
+ return (n == 0) ? 0 : Math.pow(2, 10 * (n - 1));
+ },
+
+ expoOut: function(/* Decimal? */n){
+ return (n == 1) ? 1 : (-1 * Math.pow(2, -10 * n) + 1);
+ },
+
+ expoInOut: function(/* Decimal? */n){
+ if(n == 0){ return 0; }
+ if(n == 1){ return 1; }
+ n = n * 2;
+ if(n < 1){ return Math.pow(2, 10 * (n - 1)) / 2; }
+ --n;
+ return (-1 * Math.pow(2, -10 * n) + 2) / 2;
+ },
+
+ circIn: function(/* Decimal? */n){
+ return -1 * (Math.sqrt(1 - Math.pow(n, 2)) - 1);
+ },
+
+ circOut: function(/* Decimal? */n){
+ n = n - 1;
+ return Math.sqrt(1 - Math.pow(n, 2));
+ },
+
+ circInOut: function(/* Decimal? */n){
+ n = n * 2;
+ if(n < 1){ return -1 / 2 * (Math.sqrt(1 - Math.pow(n, 2)) - 1); }
+ n -= 2;
+ return 1 / 2 * (Math.sqrt(1 - Math.pow(n, 2)) + 1);
+ },
+
+ backIn: function(/* Decimal? */n){
+ // summary:
+ // An easing function that starts away from the target,
+ // and quickly accelerates towards the end value.
+ //
+ // Use caution when the easing will cause values to become
+ // negative as some properties cannot be set to negative values.
+ var s = 1.70158;
+ return Math.pow(n, 2) * ((s + 1) * n - s);
+ },
+
+ backOut: function(/* Decimal? */n){
+ // summary:
+ // An easing function that pops past the range briefly, and slowly comes back.
+ //
+ // description:
+ // An easing function that pops past the range briefly, and slowly comes back.
+ //
+ // Use caution when the easing will cause values to become negative as some
+ // properties cannot be set to negative values.
+
+ n = n - 1;
+ var s = 1.70158;
+ return Math.pow(n, 2) * ((s + 1) * n + s) + 1;
+ },
+
+ backInOut: function(/* Decimal? */n){
+ // summary:
+ // An easing function combining the effects of `backIn` and `backOut`
+ //
+ // description:
+ // An easing function combining the effects of `backIn` and `backOut`.
+ // Use caution when the easing will cause values to become negative
+ // as some properties cannot be set to negative values.
+ var s = 1.70158 * 1.525;
+ n = n * 2;
+ if(n < 1){ return (Math.pow(n, 2) * ((s + 1) * n - s)) / 2; }
+ n-=2;
+ return (Math.pow(n, 2) * ((s + 1) * n + s) + 2) / 2;
+ },
+
+ elasticIn: function(/* Decimal? */n){
+ // summary:
+ // An easing function the elastically snaps from the start value
+ //
+ // description:
+ // An easing function the elastically snaps from the start value
+ //
+ // Use caution when the elasticity will cause values to become negative
+ // as some properties cannot be set to negative values.
+ if(n == 0 || n == 1){ return n; }
+ var p = .3;
+ var s = p / 4;
+ n = n - 1;
+ return -1 * Math.pow(2, 10 * n) * Math.sin((n - s) * (2 * Math.PI) / p);
+ },
+
+ elasticOut: function(/* Decimal? */n){
+ // summary:
+ // An easing function that elasticly snaps around the target value,
+ // near the end of the Animation
+ //
+ // description:
+ // An easing function that elasticly snaps around the target value,
+ // near the end of the Animation
+ //
+ // Use caution when the elasticity will cause values to become
+ // negative as some properties cannot be set to negative values.
+ if(n==0 || n == 1){ return n; }
+ var p = .3;
+ var s = p / 4;
+ return Math.pow(2, -10 * n) * Math.sin((n - s) * (2 * Math.PI) / p) + 1;
+ },
+
+ elasticInOut: function(/* Decimal? */n){
+ // summary:
+ // An easing function that elasticly snaps around the value, near
+ // the beginning and end of the Animation.
+ //
+ // description:
+ // An easing function that elasticly snaps around the value, near
+ // the beginning and end of the Animation.
+ //
+ // Use caution when the elasticity will cause values to become
+ // negative as some properties cannot be set to negative values.
+ if(n == 0) return 0;
+ n = n * 2;
+ if(n == 2) return 1;
+ var p = .3 * 1.5;
+ var s = p / 4;
+ if(n < 1){
+ n -= 1;
+ return -.5 * (Math.pow(2, 10 * n) * Math.sin((n - s) * (2 * Math.PI) / p));
+ }
+ n -= 1;
+ return .5 * (Math.pow(2, -10 * n) * Math.sin((n - s) * (2 * Math.PI) / p)) + 1;
+ },
+
+ bounceIn: function(/* Decimal? */n){
+ // summary:
+ // An easing function that 'bounces' near the beginning of an Animation
+ return (1 - dojo.fx.easing.bounceOut(1 - n)); // Decimal
+ },
+
+ bounceOut: function(/* Decimal? */n){
+ // summary:
+ // An easing function that 'bounces' near the end of an Animation
+ var s = 7.5625;
+ var p = 2.75;
+ var l;
+ if(n < (1 / p)){
+ l = s * Math.pow(n, 2);
+ }else if(n < (2 / p)){
+ n -= (1.5 / p);
+ l = s * Math.pow(n, 2) + .75;
+ }else if(n < (2.5 / p)){
+ n -= (2.25 / p);
+ l = s * Math.pow(n, 2) + .9375;
+ }else{
+ n -= (2.625 / p);
+ l = s * Math.pow(n, 2) + .984375;
+ }
+ return l;
+ },
+
+ bounceInOut: function(/* Decimal? */n){
+ // summary:
+ // An easing function that 'bounces' at the beginning and end of the Animation
+ if(n < 0.5){ return dojo.fx.easing.bounceIn(n * 2) / 2; }
+ return (dojo.fx.easing.bounceOut(n * 2 - 1) / 2) + 0.5; // Decimal
+ }
+};
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app.ImageView"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.ImageView"] = true;
+dojo.provide("dojox.mobile.app.ImageView");
+dojo.experimental("dojox.mobile.app.ImageView");
+
+
+
+
+dojo.declare("dojox.mobile.app.ImageView", dojox.mobile.app._Widget, {
+
+ // zoom: Number
+ // The current level of zoom. This should not be set manually.
+ zoom: 1,
+
+ // zoomCenterX: Number
+ // The X coordinate in the image where the zoom is focused
+ zoomCenterX: 0,
+
+ // zoomCenterY: Number
+ // The Y coordinate in the image where the zoom is focused
+ zoomCenterY: 0,
+
+ // maxZoom: Number
+ // The highest degree to which an image can be zoomed. For example,
+ // a maxZoom of 5 means that the image will be 5 times larger than normal
+ maxZoom: 5,
+
+ // autoZoomLevel: Number
+ // The degree to which the image is zoomed when auto zoom is invoked.
+ // The higher the number, the more the image is zoomed in.
+ autoZoomLevel: 3,
+
+ // disableAutoZoom: Boolean
+ // Disables auto zoom
+ disableAutoZoom: false,
+
+ // disableSwipe: Boolean
+ // Disables the users ability to swipe from one image to the next.
+ disableSwipe: false,
+
+ // autoZoomEvent: String
+ // Overrides the default event listened to which invokes auto zoom
+ autoZoomEvent: null,
+
+ // _leftImg: Node
+ // The full sized image to the left
+ _leftImg: null,
+
+ // _centerImg: Node
+ // The full sized image in the center
+ _centerImg: null,
+
+ // _rightImg: Node
+ // The full sized image to the right
+ _rightImg: null,
+
+ // _leftImg: Node
+ // The small sized image to the left
+ _leftSmallImg: null,
+
+ // _centerImg: Node
+ // The small sized image in the center
+ _centerSmallImg: null,
+
+ // _rightImg: Node
+ // The small sized image to the right
+ _rightSmallImg: null,
+
+ constructor: function(){
+
+ this.panX = 0;
+ this.panY = 0;
+
+ this.handleLoad = dojo.hitch(this, this.handleLoad);
+ this._updateAnimatedZoom = dojo.hitch(this, this._updateAnimatedZoom);
+ this._updateAnimatedPan = dojo.hitch(this, this._updateAnimatedPan);
+ this._onAnimPanEnd = dojo.hitch(this, this._onAnimPanEnd);
+ },
+
+ buildRendering: function(){
+ this.inherited(arguments);
+
+ this.canvas = dojo.create("canvas", {}, this.domNode);
+
+ dojo.addClass(this.domNode, "mblImageView");
+ },
+
+ postCreate: function(){
+ this.inherited(arguments);
+
+ this.size = dojo.marginBox(this.domNode);
+
+ dojo.style(this.canvas, {
+ width: this.size.w + "px",
+ height: this.size.h + "px"
+ });
+ this.canvas.height = this.size.h;
+ this.canvas.width = this.size.w;
+
+ var _this = this;
+
+ // Listen to the mousedown/touchstart event. Record the position
+ // so we can use it to pan the image.
+ this.connect(this.domNode, "onmousedown", function(event){
+ if(_this.isAnimating()){
+ return;
+ }
+ if(_this.panX){
+ _this.handleDragEnd();
+ }
+
+ _this.downX = event.targetTouches ? event.targetTouches[0].clientX : event.clientX;
+ _this.downY = event.targetTouches ? event.targetTouches[0].clientY : event.clientY;
+ });
+
+ // record the movement of the mouse.
+ this.connect(this.domNode, "onmousemove", function(event){
+ if(_this.isAnimating()){
+ return;
+ }
+ if((!_this.downX && _this.downX !== 0) || (!_this.downY && _this.downY !== 0)){
+ // If the touch didn't begin on this widget, ignore the movement
+ return;
+ }
+
+ if((!_this.disableSwipe && _this.zoom == 1)
+ || (!_this.disableAutoZoom && _this.zoom != 1)){
+ var x = event.targetTouches ?
+ event.targetTouches[0].clientX : event.pageX;
+ var y = event.targetTouches ?
+ event.targetTouches[0].clientY : event.pageY;
+
+ _this.panX = x - _this.downX;
+ _this.panY = y - _this.downY;
+
+ if(_this.zoom == 1){
+ // If not zoomed in, then try to move to the next or prev image
+ // but only if the mouse has moved more than 10 pixels
+ // in the X direction
+ if(Math.abs(_this.panX) > 10){
+ _this.render();
+ }
+ }else{
+ // If zoomed in, pan the image if the mouse has moved more
+ // than 10 pixels in either direction.
+ if(Math.abs(_this.panX) > 10 || Math.abs(_this.panY) > 10){
+ _this.render();
+ }
+ }
+ }
+ });
+
+ this.connect(this.domNode, "onmouseout", function(event){
+ if(!_this.isAnimating() && _this.panX){
+ _this.handleDragEnd();
+ }
+ });
+
+ this.connect(this.domNode, "onmouseover", function(event){
+ _this.downX = _this.downY = null;
+ });
+
+ // Set up AutoZoom, which zooms in a fixed amount when the user taps
+ // a part of the canvas
+ this.connect(this.domNode, "onclick", function(event){
+ if(_this.isAnimating()){
+ return;
+ }
+ if(_this.downX == null || _this.downY == null){
+ return;
+ }
+
+ var x = (event.targetTouches ?
+ event.targetTouches[0].clientX : event.pageX);
+ var y = (event.targetTouches ?
+ event.targetTouches[0].clientY : event.pageY);
+
+ // If the mouse/finger has moved more than 14 pixels from where it
+ // started, do not treat it as a click. It is a drag.
+ if(Math.abs(_this.panX) > 14 || Math.abs(_this.panY) > 14){
+ _this.downX = _this.downY = null;
+ _this.handleDragEnd();
+ return;
+ }
+ _this.downX = _this.downY = null;
+
+ if(!_this.disableAutoZoom){
+
+ if(!_this._centerImg || !_this._centerImg._loaded){
+ // Do nothing until the image is loaded
+ return;
+ }
+ if(_this.zoom != 1){
+ _this.set("animatedZoom", 1);
+ return;
+ }
+
+ var pos = dojo._abs(_this.domNode);
+
+ // Translate the clicked point to a point on the source image
+ var xRatio = _this.size.w / _this._centerImg.width;
+ var yRatio = _this.size.h / _this._centerImg.height;
+
+ // Do an animated zoom to the point which was clicked.
+ _this.zoomTo(
+ ((x - pos.x) / xRatio) - _this.panX,
+ ((y - pos.y) / yRatio) - _this.panY,
+ _this.autoZoomLevel);
+ }
+ });
+
+ // Listen for Flick events
+ dojo.connect(this.domNode, "flick", this, "handleFlick");
+ },
+
+ isAnimating: function(){
+ // summary:
+ // Returns true if an animation is in progress, false otherwise.
+ return this._anim && this._anim.status() == "playing";
+ },
+
+ handleDragEnd: function(){
+ // summary:
+ // Handles the end of a dragging event. If not zoomed in, it
+ // determines if the next or previous image should be transitioned
+ // to.
+ this.downX = this.downY = null;
+ console.log("handleDragEnd");
+
+ if(this.zoom == 1){
+ if(!this.panX){
+ return;
+ }
+
+ var leftLoaded = (this._leftImg && this._leftImg._loaded)
+ || (this._leftSmallImg && this._leftSmallImg._loaded);
+ var rightLoaded = (this._rightImg && this._rightImg._loaded)
+ || (this._rightSmallImg && this._rightSmallImg._loaded);
+
+ // Check if the drag has moved the image more than half its length.
+ // If so, move to either the previous or next image.
+ var doMove =
+ !(Math.abs(this.panX) < this._centerImg._baseWidth / 2) &&
+ (
+ (this.panX > 0 && leftLoaded ? 1 : 0) ||
+ (this.panX < 0 && rightLoaded ? 1 : 0)
+ );
+
+
+ if(!doMove){
+ // If not moving to another image, animate the sliding of the
+ // image back into place.
+ this._animPanTo(0, dojo.fx.easing.expoOut, 700);
+ }else{
+ // Move to another image.
+ this.moveTo(this.panX);
+ }
+ }else{
+ if(!this.panX && !this.panY){
+ return;
+ }
+ // Recenter the zoomed image based on where it was panned to
+ // previously
+ this.zoomCenterX -= (this.panX / this.zoom);
+ this.zoomCenterY -= (this.panY / this.zoom);
+
+ this.panX = this.panY = 0;
+ }
+
+ },
+
+ handleFlick: function(event){
+ // summary:
+ // Handle a flick event.
+ if(this.zoom == 1 && event.duration < 500){
+ // Only handle quick flicks here, less than 0.5 seconds
+
+ // If not zoomed in, then check if we should move to the next photo
+ // or not
+ if(event.direction == "ltr"){
+ this.moveTo(1);
+ }else if(event.direction == "rtl"){
+ this.moveTo(-1);
+ }
+ // If an up or down flick occurs, it means nothing so ignore it
+ this.downX = this.downY = null;
+ }
+ },
+
+ moveTo: function(direction){
+ direction = direction > 0 ? 1 : -1;
+ var toImg;
+
+ if(direction < 1){
+ if(this._rightImg && this._rightImg._loaded){
+ toImg = this._rightImg;
+ }else if(this._rightSmallImg && this._rightSmallImg._loaded){
+ toImg = this._rightSmallImg;
+ }
+ }else{
+ if(this._leftImg && this._leftImg._loaded){
+ toImg = this._leftImg;
+ }else if(this._leftSmallImg && this._leftSmallImg._loaded){
+ toImg = this._leftSmallImg;
+ }
+ }
+
+ this._moveDir = direction;
+ var _this = this;
+
+ if(toImg && toImg._loaded){
+ // If the image is loaded, make a linear animation to show it
+ this._animPanTo(this.size.w * direction, null, 500, function(){
+ _this.panX = 0;
+ _this.panY = 0;
+
+ if(direction < 0){
+ // Moving to show the right image
+ _this._switchImage("left", "right");
+ }else{
+ // Moving to show the left image
+ _this._switchImage("right", "left");
+ }
+
+ _this.render();
+ _this.onChange(direction * -1);
+ });
+
+ }else{
+ // If the next image is not loaded, make an animation to
+ // move the center image to half the width of the widget and back
+ // again
+
+ console.log("moveTo image not loaded!", toImg);
+
+ this._animPanTo(0, dojo.fx.easing.expoOut, 700);
+ }
+ },
+
+ _switchImage: function(toImg, fromImg){
+ var toSmallImgName = "_" + toImg + "SmallImg";
+ var toImgName = "_" + toImg + "Img";
+
+ var fromSmallImgName = "_" + fromImg + "SmallImg";
+ var fromImgName = "_" + fromImg + "Img";
+
+ this[toImgName] = this._centerImg;
+ this[toSmallImgName] = this._centerSmallImg;
+
+ this[toImgName]._type = toImg;
+
+ if(this[toSmallImgName]){
+ this[toSmallImgName]._type = toImg;
+ }
+
+ this._centerImg = this[fromImgName];
+ this._centerSmallImg = this[fromSmallImgName];
+ this._centerImg._type = "center";
+
+ if(this._centerSmallImg){
+ this._centerSmallImg._type = "center";
+ }
+ this[fromImgName] = this[fromSmallImgName] = null;
+ },
+
+ _animPanTo: function(to, easing, duration, callback){
+ this._animCallback = callback;
+ this._anim = new dojo.Animation({
+ curve: [this.panX, to],
+ onAnimate: this._updateAnimatedPan,
+ duration: duration || 500,
+ easing: easing,
+ onEnd: this._onAnimPanEnd
+ });
+
+ this._anim.play();
+ return this._anim;
+ },
+
+ onChange: function(direction){
+ // summary:
+ // Stub function that can be listened to in order to provide
+ // new images when the displayed image changes
+ },
+
+ _updateAnimatedPan: function(amount){
+ this.panX = amount;
+ this.render();
+ },
+
+ _onAnimPanEnd: function(){
+ this.panX = this.panY = 0;
+
+ if(this._animCallback){
+ this._animCallback();
+ }
+ },
+
+ zoomTo: function(centerX, centerY, zoom){
+ this.set("zoomCenterX", centerX);
+ this.set("zoomCenterY", centerY);
+
+ this.set("animatedZoom", zoom);
+ },
+
+ render: function(){
+ var cxt = this.canvas.getContext('2d');
+
+ cxt.clearRect(0, 0, this.canvas.width, this.canvas.height);
+
+ // Render the center image
+ this._renderImg(
+ this._centerSmallImg,
+ this._centerImg,
+ this.zoom == 1 ? (this.panX < 0 ? 1 : this.panX > 0 ? -1 : 0) : 0);
+
+ if(this.zoom == 1 && this.panX != 0){
+ if(this.panX > 0){
+ // Render the left image, showing the right side of it
+ this._renderImg(this._leftSmallImg, this._leftImg, 1);
+ }else{
+ // Render the right image, showing the left side of it
+ this._renderImg(this._rightSmallImg, this._rightImg, -1);
+ }
+ }
+ },
+
+ _renderImg: function(smallImg, largeImg, panDir){
+ // summary:
+ // Renders a single image
+
+
+ // If zoomed, we just display the center img
+ var img = (largeImg && largeImg._loaded) ? largeImg : smallImg;
+
+ if(!img || !img._loaded){
+ // If neither the large or small image is loaded, display nothing
+ return;
+ }
+ var cxt = this.canvas.getContext('2d');
+
+ var baseWidth = img._baseWidth;
+ var baseHeight = img._baseHeight;
+
+ // Calculate the size the image would be if there were no bounds
+ var desiredWidth = baseWidth * this.zoom;
+ var desiredHeight = baseHeight * this.zoom;
+
+ // Calculate the actual size of the viewable image
+ var destWidth = Math.min(this.size.w, desiredWidth);
+ var destHeight = Math.min(this.size.h, desiredHeight);
+
+
+ // Calculate the size of the window on the original image to use
+ var sourceWidth = this.dispWidth = img.width * (destWidth / desiredWidth);
+ var sourceHeight = this.dispHeight = img.height * (destHeight / desiredHeight);
+
+ var zoomCenterX = this.zoomCenterX - (this.panX / this.zoom);
+ var zoomCenterY = this.zoomCenterY - (this.panY / this.zoom);
+
+ // Calculate where the center of the view should be
+ var centerX = Math.floor(Math.max(sourceWidth / 2,
+ Math.min(img.width - sourceWidth / 2, zoomCenterX)));
+ var centerY = Math.floor(Math.max(sourceHeight / 2,
+ Math.min(img.height - sourceHeight / 2, zoomCenterY)));
+
+
+ var sourceX = Math.max(0,
+ Math.round((img.width - sourceWidth)/2 + (centerX - img._centerX)) );
+ var sourceY = Math.max(0,
+ Math.round((img.height - sourceHeight) / 2 + (centerY - img._centerY))
+ );
+
+ var destX = Math.round(Math.max(0, this.canvas.width - destWidth)/2);
+ var destY = Math.round(Math.max(0, this.canvas.height - destHeight)/2);
+
+ var oldDestWidth = destWidth;
+ var oldSourceWidth = sourceWidth;
+
+ if(this.zoom == 1 && panDir && this.panX){
+
+ if(this.panX < 0){
+ if(panDir > 0){
+ // If the touch is moving left, and the right side of the
+ // image should be shown, then reduce the destination width
+ // by the absolute value of panX
+ destWidth -= Math.abs(this.panX);
+ destX = 0;
+ }else if(panDir < 0){
+ // If the touch is moving left, and the left side of the
+ // image should be shown, then set the displayed width
+ // to the absolute value of panX, less some pixels for
+ // a padding between images
+ destWidth = Math.max(1, Math.abs(this.panX) - 5);
+ destX = this.size.w - destWidth;
+ }
+ }else{
+ if(panDir > 0){
+ // If the touch is moving right, and the right side of the
+ // image should be shown, then set the destination width
+ // to the absolute value of the pan, less some pixels for
+ // padding
+ destWidth = Math.max(1, Math.abs(this.panX) - 5);
+ destX = 0;
+ }else if(panDir < 0){
+ // If the touch is moving right, and the left side of the
+ // image should be shown, then reduce the destination width
+ // by the widget width minus the absolute value of panX
+ destWidth -= Math.abs(this.panX);
+ destX = this.size.w - destWidth;
+ }
+ }
+
+ sourceWidth = Math.max(1,
+ Math.floor(sourceWidth * (destWidth / oldDestWidth)));
+
+ if(panDir > 0){
+ // If the right side of the image should be displayed, move
+ // the sourceX to be the width of the image minus the difference
+ // between the original sourceWidth and the new sourceWidth
+ sourceX = (sourceX + oldSourceWidth) - (sourceWidth);
+ }
+ sourceX = Math.floor(sourceX);
+ }
+
+ try{
+
+ // See https://developer.mozilla.org/en/Canvas_tutorial/Using_images
+ cxt.drawImage(
+ img,
+ Math.max(0, sourceX),
+ sourceY,
+ Math.min(oldSourceWidth, sourceWidth),
+ sourceHeight,
+ destX, // Xpos
+ destY, // Ypos
+ Math.min(oldDestWidth, destWidth),
+ destHeight
+ );
+ }catch(e){
+ console.log("Caught Error",e,
+
+ "type=", img._type,
+ "oldDestWidth = ", oldDestWidth,
+ "destWidth", destWidth,
+ "destX", destX
+ , "oldSourceWidth=",oldSourceWidth,
+ "sourceWidth=", sourceWidth,
+ "sourceX = " + sourceX
+ );
+ }
+ },
+
+ _setZoomAttr: function(amount){
+ this.zoom = Math.min(this.maxZoom, Math.max(1, amount));
+
+ if(this.zoom == 1
+ && this._centerImg
+ && this._centerImg._loaded){
+
+ if(!this.isAnimating()){
+ this.zoomCenterX = this._centerImg.width / 2;
+ this.zoomCenterY = this._centerImg.height / 2;
+ }
+ this.panX = this.panY = 0;
+ }
+
+ this.render();
+ },
+
+ _setZoomCenterXAttr: function(value){
+ if(value != this.zoomCenterX){
+ if(this._centerImg && this._centerImg._loaded){
+ value = Math.min(this._centerImg.width, value);
+ }
+ this.zoomCenterX = Math.max(0, Math.round(value));
+ }
+ },
+
+ _setZoomCenterYAttr: function(value){
+ if(value != this.zoomCenterY){
+ if(this._centerImg && this._centerImg._loaded){
+ value = Math.min(this._centerImg.height, value);
+ }
+ this.zoomCenterY = Math.max(0, Math.round(value));
+ }
+ },
+
+ _setZoomCenterAttr: function(value){
+ if(value.x != this.zoomCenterX || value.y != this.zoomCenterY){
+ this.set("zoomCenterX", value.x);
+ this.set("zoomCenterY", value.y);
+ this.render();
+ }
+ },
+
+ _setAnimatedZoomAttr: function(amount){
+ if(this._anim && this._anim.status() == "playing"){
+ return;
+ }
+
+ this._anim = new dojo.Animation({
+ curve: [this.zoom, amount],
+ onAnimate: this._updateAnimatedZoom,
+ onEnd: this._onAnimEnd
+ });
+
+ this._anim.play();
+ },
+
+ _updateAnimatedZoom: function(amount){
+ this._setZoomAttr(amount);
+ },
+
+ _setCenterUrlAttr: function(urlOrObj){
+ this._setImage("center", urlOrObj);
+ },
+ _setLeftUrlAttr: function(urlOrObj){
+ this._setImage("left", urlOrObj);
+ },
+ _setRightUrlAttr: function(urlOrObj){
+ this._setImage("right", urlOrObj);
+ },
+
+ _setImage: function(name, urlOrObj){
+ var smallUrl = null;
+
+ var largeUrl = null;
+
+ if(dojo.isString(urlOrObj)){
+ // If the argument is a string, then just load the large url
+ largeUrl = urlOrObj;
+ }else{
+ largeUrl = urlOrObj.large;
+ smallUrl = urlOrObj.small;
+ }
+
+ if(this["_" + name + "Img"] && this["_" + name + "Img"]._src == largeUrl){
+ // Identical URL, ignore it
+ return;
+ }
+
+ // Just do the large image for now
+ var largeImg = this["_" + name + "Img"] = new Image();
+ largeImg._type = name;
+ largeImg._loaded = false;
+ largeImg._src = largeUrl;
+ largeImg._conn = dojo.connect(largeImg, "onload", this.handleLoad);
+
+ if(smallUrl){
+ // If a url to a small version of the image has been provided,
+ // load that image first.
+ var smallImg = this["_" + name + "SmallImg"] = new Image();
+ smallImg._type = name;
+ smallImg._loaded = false;
+ smallImg._conn = dojo.connect(smallImg, "onload", this.handleLoad);
+ smallImg._isSmall = true;
+ smallImg._src = smallUrl;
+ smallImg.src = smallUrl;
+ }
+
+ // It's important that the large url's src is set after the small image
+ // to ensure it's loaded second.
+ largeImg.src = largeUrl;
+ },
+
+ handleLoad: function(evt){
+ // summary:
+ // Handles the loading of an image, both the large and small
+ // versions. A render is triggered as a result of each image load.
+
+ var img = evt.target;
+ img._loaded = true;
+
+ dojo.disconnect(img._conn);
+
+ var type = img._type;
+
+ switch(type){
+ case "center":
+ this.zoomCenterX = img.width / 2;
+ this.zoomCenterY = img.height / 2;
+ break;
+ }
+
+ var height = img.height;
+ var width = img.width;
+
+ if(width / this.size.w < height / this.size.h){
+ // Fit the height to the height of the canvas
+ img._baseHeight = this.canvas.height;
+ img._baseWidth = width / (height / this.size.h);
+ }else{
+ // Fix the width to the width of the canvas
+ img._baseWidth = this.canvas.width;
+ img._baseHeight = height / (width / this.size.w);
+ }
+ img._centerX = width / 2;
+ img._centerY = height / 2;
+
+ this.render();
+
+ this.onLoad(img._type, img._src, img._isSmall);
+ },
+
+ onLoad: function(type, url, isSmall){
+ // summary:
+ // Dummy function that is called whenever an image loads.
+ // type: String
+ // The position of the image that has loaded, either
+ // "center", "left" or "right"
+ // url: String
+ // The src of the image
+ // isSmall: Boolean
+ // True if it is a small version of the image that has loaded,
+ // false otherwise.
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app.ImageThumbView"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.ImageThumbView"] = true;
+dojo.provide("dojox.mobile.app.ImageThumbView");
+dojo.experimental("dojox.mobile.app.ImageThumbView");
+
+
+
+
+dojo.declare("dojox.mobile.app.ImageThumbView", dijit._WidgetBase, {
+ // summary:
+ // An image thumbnail gallery
+
+ // items: Array
+ // The data items from which the image urls are retrieved.
+ // If an item is a string, it is expected to be a URL. Otherwise
+ // by default it is expected to have a 'url' member. This can
+ // be configured using the 'urlParam' attribute on this widget.
+ items: [],
+
+ // urlParam: String
+ // The paramter name used to retrieve an image url from a JSON object
+ urlParam: "url",
+
+ labelParam: null,
+
+ itemTemplate: '<div class="mblThumbInner">' +
+ '<div class="mblThumbOverlay"></div>' +
+ '<div class="mblThumbMask">' +
+ '<div class="mblThumbSrc" style="background-image:url(${url})"></div>' +
+ '</div>' +
+ '</div>',
+
+ minPadding: 4,
+
+ maxPerRow: 3,
+
+ maxRows: -1,
+
+ baseClass: "mblImageThumbView",
+
+ thumbSize: "medium",
+
+ animationEnabled: true,
+
+ selectedIndex: -1,
+
+ cache: null,
+
+ cacheMustMatch: false,
+
+ clickEvent: "onclick",
+
+ cacheBust: false,
+
+ disableHide: false,
+
+ constructor: function(params, node){
+ },
+
+ postCreate: function(){
+
+ this.inherited(arguments);
+ var _this = this;
+
+ var hoverCls = "mblThumbHover";
+
+ this.addThumb = dojo.hitch(this, this.addThumb);
+ this.handleImgLoad = dojo.hitch(this, this.handleImgLoad);
+ this.hideCached = dojo.hitch(this, this.hideCached);
+
+ this._onLoadImages = {};
+
+ this.cache = [];
+ this.visibleImages = [];
+
+ this._cacheCounter = 0;
+
+ this.connect(this.domNode, this.clickEvent, function(event){
+ var itemNode = _this._getItemNodeFromEvent(event);
+
+ if(itemNode && !itemNode._cached){
+ _this.onSelect(itemNode._item, itemNode._index, _this.items);
+ dojo.query(".selected", this.domNode).removeClass("selected");
+ dojo.addClass(itemNode, "selected");
+ }
+ });
+
+ dojo.addClass(this.domNode, this.thumbSize);
+
+ this.resize();
+ this.render();
+ },
+
+ onSelect: function(item, index, items){
+ // summary:
+ // Dummy function that is triggered when an image is selected.
+ },
+
+ _setAnimationEnabledAttr: function(value){
+ this.animationEnabled = value;
+ dojo[value ? "addClass" : "removeClass"](this.domNode, "animated");
+ },
+
+ _setItemsAttr: function(items){
+ this.items = items || [];
+
+ var urls = {};
+ var i;
+ for(i = 0; i < this.items.length; i++){
+ urls[this.items[i][this.urlParam]] = 1;
+ }
+
+ var clearedUrls = [];
+ for(var url in this._onLoadImages){
+ if(!urls[url] && this._onLoadImages[url]._conn){
+ dojo.disconnect(this._onLoadImages[url]._conn);
+ this._onLoadImages[url].src = null;
+ clearedUrls.push(url);
+ }
+ }
+
+ for(i = 0; i < clearedUrls.length; i++){
+ delete this._onLoadImages[url];
+ }
+
+ this.render();
+ },
+
+ _getItemNode: function(node){
+ while(node && !dojo.hasClass(node, "mblThumb") && node != this.domNode){
+ node = node.parentNode;
+ }
+
+ return (node == this.domNode) ? null : node;
+ },
+
+ _getItemNodeFromEvent: function(event){
+ if(event.touches && event.touches.length > 0){
+ event = event.touches[0];
+ }
+ return this._getItemNode(event.target);
+ },
+
+ resize: function(){
+ this._thumbSize = null;
+
+ this._size = dojo.contentBox(this.domNode);
+
+ this.disableHide = true;
+ this.render();
+ this.disableHide = false;
+ },
+
+ hideCached: function(){
+ // summary:
+ // Hides all cached nodes, so that they're no invisible and overlaying
+ // other screen elements.
+ for(var i = 0; i < this.cache.length; i++){
+ if (this.cache[i]) {
+ dojo.style(this.cache[i], "display", "none");
+ }
+ }
+ },
+
+ render: function(){
+ var i;
+ var url;
+ var item;
+
+ var thumb;
+ while(this.visibleImages && this.visibleImages.length > 0){
+ thumb = this.visibleImages.pop();
+ this.cache.push(thumb);
+
+ if (!this.disableHide) {
+ dojo.addClass(thumb, "hidden");
+ }
+ thumb._cached = true;
+ }
+
+ if(this.cache && this.cache.length > 0){
+ setTimeout(this.hideCached, 1000);
+ }
+
+ if(!this.items || this.items.length == 0){
+ return;
+ }
+
+ for(i = 0; i < this.items.length; i++){
+ item = this.items[i];
+ url = (dojo.isString(item) ? item : item[this.urlParam]);
+
+ this.addThumb(item, url, i);
+
+ if(this.maxRows > 0 && (i + 1) / this.maxPerRow >= this.maxRows){
+ break;
+ }
+ }
+
+ if(!this._thumbSize){
+ return;
+ }
+
+ var column = 0;
+ var row = -1;
+
+ var totalThumbWidth = this._thumbSize.w + (this.padding * 2);
+ var totalThumbHeight = this._thumbSize.h + (this.padding * 2);
+
+ var nodes = this.thumbNodes =
+ dojo.query(".mblThumb", this.domNode);
+
+ var pos = 0;
+ nodes = this.visibleImages;
+ for(i = 0; i < nodes.length; i++){
+ if(nodes[i]._cached){
+ continue;
+ }
+
+ if(pos % this.maxPerRow == 0){
+ row ++;
+ }
+ column = pos % this.maxPerRow;
+
+ this.place(
+ nodes[i],
+ (column * totalThumbWidth) + this.padding, // x position
+ (row * totalThumbHeight) + this.padding // y position
+ );
+
+ if(!nodes[i]._loading){
+ dojo.removeClass(nodes[i], "hidden");
+ }
+
+ if(pos == this.selectedIndex){
+ dojo[pos == this.selectedIndex ? "addClass" : "removeClass"]
+ (nodes[i], "selected");
+ }
+ pos++;
+ }
+
+ var numRows = Math.ceil(pos / this.maxPerRow);
+
+ this._numRows = numRows;
+
+ this.setContainerHeight((numRows * (this._thumbSize.h + this.padding * 2)));
+ },
+
+ setContainerHeight: function(amount){
+ dojo.style(this.domNode, "height", amount + "px");
+ },
+
+ addThumb: function(item, url, index){
+
+ var thumbDiv;
+ var cacheHit = false;
+ if(this.cache.length > 0){
+ // Reuse a previously created node if possible
+ var found = false;
+ // Search for an image with the same url first
+ for(var i = 0; i < this.cache.length; i++){
+ if(this.cache[i]._url == url){
+ thumbDiv = this.cache.splice(i, 1)[0];
+ found = true;
+ break
+ }
+ }
+
+ // if no image with the same url is found, just take the last one
+ if(!thumbDiv && !this.cacheMustMatch){
+ thumbDiv = this.cache.pop();
+ dojo.removeClass(thumbDiv, "selected");
+ } else {
+ cacheHit = true;
+ }
+ }
+
+ if(!thumbDiv){
+
+ // Create a new thumb
+ thumbDiv = dojo.create("div", {
+ "class": "mblThumb hidden",
+ innerHTML: dojo.string.substitute(this.itemTemplate, {
+ url: url
+ }, null, this)
+ }, this.domNode);
+ }
+
+ if(this.labelParam) {
+ var labelNode = dojo.query(".mblThumbLabel", thumbDiv)[0];
+ if(!labelNode) {
+ labelNode = dojo.create("div", {
+ "class": "mblThumbLabel"
+ }, thumbDiv);
+ }
+ labelNode.innerHTML = item[this.labelParam] || "";
+ }
+
+ dojo.style(thumbDiv, "display", "");
+ if (!this.disableHide) {
+ dojo.addClass(thumbDiv, "hidden");
+ }
+
+ if (!cacheHit) {
+ var loader = dojo.create("img", {});
+ loader._thumbDiv = thumbDiv;
+ loader._conn = dojo.connect(loader, "onload", this.handleImgLoad);
+ loader._url = url;
+ thumbDiv._loading = true;
+
+ this._onLoadImages[url] = loader;
+ if (loader) {
+ loader.src = url;
+ }
+ }
+ this.visibleImages.push(thumbDiv);
+
+ thumbDiv._index = index;
+ thumbDiv._item = item;
+ thumbDiv._url = url;
+ thumbDiv._cached = false;
+
+ if(!this._thumbSize){
+ this._thumbSize = dojo.marginBox(thumbDiv);
+
+ if(this._thumbSize.h == 0){
+ this._thumbSize.h = 100;
+ this._thumbSize.w = 100;
+ }
+
+ if(this.labelParam){
+ this._thumbSize.h += 8;
+ }
+
+ this.calcPadding();
+ }
+ },
+
+ handleImgLoad: function(event){
+ var img = event.target;
+ dojo.disconnect(img._conn);
+ dojo.removeClass(img._thumbDiv, "hidden");
+ img._thumbDiv._loading = false;
+ img._conn = null;
+
+ var url = img._url;
+ if(this.cacheBust){
+ url += (url.indexOf("?") > -1 ? "&" : "?")
+ + "cacheBust=" + (new Date()).getTime() + "_" + (this._cacheCounter++);
+ }
+
+ dojo.query(".mblThumbSrc", img._thumbDiv)
+ .style("backgroundImage", "url(" + url + ")");
+
+ delete this._onLoadImages[img._url];
+ },
+
+ calcPadding: function(){
+ var width = this._size.w;
+
+ var thumbWidth = this._thumbSize.w;
+
+ var imgBounds = thumbWidth + this.minPadding;
+
+ this.maxPerRow = Math.floor(width / imgBounds);
+
+ this.padding = Math.floor((width - (thumbWidth * this.maxPerRow)) / (this.maxPerRow * 2));
+ },
+
+ place: function(node, x, y){
+ dojo.style(node, {
+ "-webkit-transform" :"translate(" + x + "px," + y + "px)"
+ });
+ },
+
+ destroy: function(){
+ // Stop the loading of any more images
+
+ var img;
+ var counter = 0;
+ for (var url in this._onLoadImages){
+ img = this._onLoadImages[url];
+ if (img) {
+ img.src = null;
+ counter++;
+ }
+ }
+
+ this.inherited(arguments);
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app._base"] = true;
+dojo.provide("dojox.mobile.app._base");
+dojo.experimental("dojox.mobile.app._base");
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+(function(){
+
+ var stageController;
+ var appInfo;
+
+ var jsDependencies = [
+ "dojox.mobile",
+ "dojox.mobile.parser"
+ ];
+
+ var loadedResources = {};
+ var loadingDependencies;
+
+ var rootNode;
+
+ var sceneResources = [];
+
+ // Load the required resources asynchronously, since not all mobile OSes
+ // support dojo.require and sync XHR
+ function loadResources(resources, callback){
+ // summary:
+ // Loads one or more JavaScript files asynchronously. When complete,
+ // the first scene is pushed onto the stack.
+ // resources:
+ // An array of module names, e.g. 'dojox.mobile.AlertDialog'
+
+ var resource;
+ var url;
+
+ do {
+ resource = resources.pop();
+ if (resource.source) {
+ url = resource.source;
+ }else if (resource.module) {
+ url = dojo.baseUrl + dojo._getModuleSymbols(resource.module).join("/") + '.js';
+ }else {
+ alert("Error: invalid JavaScript resource " + dojo.toJson(resource));
+ return;
+ }
+ }while (resources.length > 0 && loadedResources[url]);
+
+ if(resources.length < 1 && loadedResources[url]){
+ // All resources have already been loaded
+ callback();
+ return;
+ }
+
+ dojo.xhrGet({
+ url: url,
+ sync: false
+ }).addCallbacks(function(text){
+ dojo["eval"](text);
+ loadedResources[url] = true;
+ if(resources.length > 0){
+ loadResources(resources, callback);
+ }else{
+ callback();
+ }
+ },
+ function(){
+ alert("Failed to load resource " + url);
+ });
+ }
+
+ var pushFirstScene = function(){
+ // summary:
+ // Pushes the first scene onto the stack.
+
+ stageController = new dojox.mobile.app.StageController(rootNode);
+ var defaultInfo = {
+ id: "com.test.app",
+ version: "1.0.0",
+ initialScene: "main"
+ };
+
+ // If the application info has been defined, as it should be,
+ // use it.
+ if(dojo.global["appInfo"]){
+ dojo.mixin(defaultInfo, dojo.global["appInfo"]);
+ }
+ appInfo = dojox.mobile.app.info = defaultInfo;
+
+ // Set the document title from the app info title if it exists
+ if(appInfo.title){
+ var titleNode = dojo.query("head title")[0] ||
+ dojo.create("title", {},dojo.query("head")[0]);
+ document.title = appInfo.title;
+ }
+
+ stageController.pushScene(appInfo.initialScene);
+ };
+
+ var initBackButton = function(){
+ var hasNativeBack = false;
+ if(dojo.global.BackButton){
+ // Android phonegap support
+ BackButton.override();
+ dojo.connect(document, 'backKeyDown', function(e) {
+ dojo.publish("/dojox/mobile/app/goback");
+ });
+ hasNativeBack = true;
+ }else if(dojo.global.Mojo){
+ // TODO: add webOS support
+ }
+ if(hasNativeBack){
+ dojo.addClass(dojo.body(), "mblNativeBack");
+ }
+ };
+
+ dojo.mixin(dojox.mobile.app, {
+ init: function(node){
+ // summary:
+ // Initializes the mobile app. Creates the
+
+ rootNode = node || dojo.body();
+ dojox.mobile.app.STAGE_CONTROLLER_ACTIVE = true;
+
+ dojo.subscribe("/dojox/mobile/app/goback", function(){
+ stageController.popScene();
+ });
+
+ dojo.subscribe("/dojox/mobile/app/alert", function(params){
+ dojox.mobile.app.getActiveSceneController().showAlertDialog(params);
+ });
+
+ dojo.subscribe("/dojox/mobile/app/pushScene", function(sceneName, params){
+ stageController.pushScene(sceneName, params || {});
+ });
+
+ // Get the list of files to load per scene/view
+ dojo.xhrGet({
+ url: "view-resources.json",
+ load: function(data){
+ var resources = [];
+
+ if(data){
+ // Should be an array
+ sceneResources = data = dojo.fromJson(data);
+
+ // Get the list of files to load that have no scene
+ // specified, and therefore should be loaded on
+ // startup
+ for(var i = 0; i < data.length; i++){
+ if(!data[i].scene){
+ resources.push(data[i]);
+ }
+ }
+ }
+ if(resources.length > 0){
+ loadResources(resources, pushFirstScene);
+ }else{
+ pushFirstScene();
+ }
+ },
+ error: pushFirstScene
+ });
+
+ initBackButton();
+ },
+
+ getActiveSceneController: function(){
+ // summary:
+ // Gets the controller for the active scene.
+
+ return stageController.getActiveSceneController();
+ },
+
+ getStageController: function(){
+ // summary:
+ // Gets the stage controller.
+ return stageController;
+ },
+
+ loadResources: function(resources, callback){
+ loadResources(resources, callback);
+ },
+
+ loadResourcesForScene: function(sceneName, callback){
+ var resources = [];
+
+ // Get the list of files to load that have no scene
+ // specified, and therefore should be loaded on
+ // startup
+ for(var i = 0; i < sceneResources.length; i++){
+ if(sceneResources[i].scene == sceneName){
+ resources.push(sceneResources[i]);
+ }
+ }
+
+ if(resources.length > 0){
+ loadResources(resources, callback);
+ }else{
+ callback();
+ }
+ },
+
+ resolveTemplate: function(sceneName){
+ // summary:
+ // Given the name of a scene, returns the path to it's template
+ // file. For example, for a scene named 'main', the file
+ // returned is 'app/views/main/main-scene.html'
+ // This function can be overridden if it is desired to have
+ // a different name to file mapping.
+ return "app/views/" + sceneName + "/" + sceneName + "-scene.html";
+ },
+
+ resolveAssistant: function(sceneName){
+ // summary:
+ // Given the name of a scene, returns the path to it's assistant
+ // file. For example, for a scene named 'main', the file
+ // returned is 'app/assistants/main-assistant.js'
+ // This function can be overridden if it is desired to have
+ // a different name to file mapping.
+ return "app/assistants/" + sceneName + "-assistant.js";
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dojox.mobileApp"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobileApp"] = true;
+dojo.provide("dojox.mobileApp");
+
+
+
+}
+
+
+}};});
diff --git a/js/dojo-1.6/dojox/mobile/app/AlertDialog.js b/js/dojo-1.6/dojox/mobile/app/AlertDialog.js
new file mode 100644
index 0000000..c1516cc
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/AlertDialog.js
@@ -0,0 +1,193 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.mobile.app.AlertDialog"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.AlertDialog"] = true;
+dojo.provide("dojox.mobile.app.AlertDialog");
+dojo.experimental("dojox.mobile.app.AlertDialog");
+dojo.require("dijit._WidgetBase");
+
+dojo.declare("dojox.mobile.app.AlertDialog", dijit._WidgetBase, {
+
+ // title: String
+ // The title of the AlertDialog
+ title: "",
+
+ // text: String
+ // The text message displayed in the AlertDialog
+ text: "",
+
+ // controller: Object
+ // The SceneController for the currently active scene
+ controller: null,
+
+ // buttons: Array
+ buttons: null,
+
+ defaultButtonLabel: "OK",
+
+ // onChoose: Function
+ // The callback function that is invoked when a button is tapped.
+ // If the dialog is cancelled, no parameter is passed to this function.
+ onChoose: null,
+
+ constructor: function(){
+ this.onClick = dojo.hitch(this, this.onClick);
+ this._handleSelect = dojo.hitch(this, this._handleSelect);
+ },
+
+ buildRendering: function(){
+ this.domNode = dojo.create("div",{
+ "class": "alertDialog"
+ });
+
+ // Create the outer dialog body
+ var dlgBody = dojo.create("div", {"class": "alertDialogBody"}, this.domNode);
+
+ // Create the title
+ dojo.create("div", {"class": "alertTitle", innerHTML: this.title || ""}, dlgBody);
+
+ // Create the text
+ dojo.create("div", {"class": "alertText", innerHTML: this.text || ""}, dlgBody);
+
+ // Create the node that encapsulates all the buttons
+ var btnContainer = dojo.create("div", {"class": "alertBtns"}, dlgBody);
+
+ // If no buttons have been defined, default to a single button saying OK
+ if(!this.buttons || this.buttons.length == 0){
+ this.buttons = [{
+ label: this.defaultButtonLabel,
+ value: "ok",
+ "class": "affirmative"
+ }];
+ }
+
+ var _this = this;
+
+ // Create each of the buttons
+ dojo.forEach(this.buttons, function(btnInfo){
+ var btn = new dojox.mobile.Button({
+ btnClass: btnInfo["class"] || "",
+ label: btnInfo.label
+ });
+ btn._dialogValue = btnInfo.value;
+ dojo.place(btn.domNode, btnContainer);
+ _this.connect(btn, "onClick", _this._handleSelect);
+ });
+
+ var viewportSize = this.controller.getWindowSize();
+
+ // Create the mask that blocks out the rest of the screen
+ this.mask = dojo.create("div", {"class": "dialogUnderlayWrapper",
+ innerHTML: "<div class=\"dialogUnderlay\"></div>",
+ style: {
+ width: viewportSize.w + "px",
+ height: viewportSize.h + "px"
+ }
+ }, this.controller.assistant.domNode);
+
+ this.connect(this.mask, "onclick", function(){
+ _this.onChoose && _this.onChoose();
+ _this.hide();
+ });
+ },
+
+ postCreate: function(){
+ this.subscribe("/dojox/mobile/app/goback", this._handleSelect);
+ },
+
+ _handleSelect: function(event){
+ // summary:
+ // Handle the selection of a value
+ var node;
+ console.log("handleSelect");
+ if(event && event.target){
+ node = event.target;
+
+ // Find the widget that was tapped.
+ while(!dijit.byNode(node)){
+ node - node.parentNode;
+ }
+ }
+
+ // If an onChoose function was provided, tell it what button
+ // value was chosen
+ if(this.onChoose){
+ this.onChoose(node ? dijit.byNode(node)._dialogValue: undefined);
+ }
+ // Hide the dialog
+ this.hide();
+ },
+
+ show: function(){
+ // summary:
+ // Show the dialog
+ this._doTransition(1);
+ },
+
+ hide: function(){
+ // summary:
+ // Hide the dialog
+ this._doTransition(-1);
+ },
+
+ _doTransition: function(dir){
+ // summary:
+ // Either shows or hides the dialog.
+ // dir:
+ // An integer. If positive, the dialog is shown. If negative,
+ // the dialog is hidden.
+
+ // TODO: replace this with CSS transitions
+
+ var anim;
+ var h = dojo.marginBox(this.domNode.firstChild).h;
+
+
+ var bodyHeight = this.controller.getWindowSize().h;
+ console.log("dialog height = " + h, " body height = " + bodyHeight);
+
+ var high = bodyHeight - h;
+ var low = bodyHeight;
+
+ var anim1 = dojo.fx.slideTo({
+ node: this.domNode,
+ duration: 400,
+ top: {start: dir < 0 ? high : low, end: dir < 0 ? low: high}
+ });
+
+ var anim2 = dojo[dir < 0 ? "fadeOut" : "fadeIn"]({
+ node: this.mask,
+ duration: 400
+ });
+
+ var anim = dojo.fx.combine([anim1, anim2]);
+
+ var _this = this;
+
+ dojo.connect(anim, "onEnd", this, function(){
+ if(dir < 0){
+ _this.domNode.style.display = "none";
+ dojo.destroy(_this.domNode);
+ dojo.destroy(_this.mask);
+ }
+ });
+ anim.play();
+ },
+
+ destroy: function(){
+ this.inherited(arguments);
+ dojo.destroy(this.mask);
+ },
+
+
+ onClick: function(){
+
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/mobile/app/AlertDialog.xd.js b/js/dojo-1.6/dojox/mobile/app/AlertDialog.xd.js
new file mode 100644
index 0000000..4cf183f
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/AlertDialog.xd.js
@@ -0,0 +1,198 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.mobile.app.AlertDialog"],
+["require", "dijit._WidgetBase"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.mobile.app.AlertDialog"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.AlertDialog"] = true;
+dojo.provide("dojox.mobile.app.AlertDialog");
+dojo.experimental("dojox.mobile.app.AlertDialog");
+dojo.require("dijit._WidgetBase");
+
+dojo.declare("dojox.mobile.app.AlertDialog", dijit._WidgetBase, {
+
+ // title: String
+ // The title of the AlertDialog
+ title: "",
+
+ // text: String
+ // The text message displayed in the AlertDialog
+ text: "",
+
+ // controller: Object
+ // The SceneController for the currently active scene
+ controller: null,
+
+ // buttons: Array
+ buttons: null,
+
+ defaultButtonLabel: "OK",
+
+ // onChoose: Function
+ // The callback function that is invoked when a button is tapped.
+ // If the dialog is cancelled, no parameter is passed to this function.
+ onChoose: null,
+
+ constructor: function(){
+ this.onClick = dojo.hitch(this, this.onClick);
+ this._handleSelect = dojo.hitch(this, this._handleSelect);
+ },
+
+ buildRendering: function(){
+ this.domNode = dojo.create("div",{
+ "class": "alertDialog"
+ });
+
+ // Create the outer dialog body
+ var dlgBody = dojo.create("div", {"class": "alertDialogBody"}, this.domNode);
+
+ // Create the title
+ dojo.create("div", {"class": "alertTitle", innerHTML: this.title || ""}, dlgBody);
+
+ // Create the text
+ dojo.create("div", {"class": "alertText", innerHTML: this.text || ""}, dlgBody);
+
+ // Create the node that encapsulates all the buttons
+ var btnContainer = dojo.create("div", {"class": "alertBtns"}, dlgBody);
+
+ // If no buttons have been defined, default to a single button saying OK
+ if(!this.buttons || this.buttons.length == 0){
+ this.buttons = [{
+ label: this.defaultButtonLabel,
+ value: "ok",
+ "class": "affirmative"
+ }];
+ }
+
+ var _this = this;
+
+ // Create each of the buttons
+ dojo.forEach(this.buttons, function(btnInfo){
+ var btn = new dojox.mobile.Button({
+ btnClass: btnInfo["class"] || "",
+ label: btnInfo.label
+ });
+ btn._dialogValue = btnInfo.value;
+ dojo.place(btn.domNode, btnContainer);
+ _this.connect(btn, "onClick", _this._handleSelect);
+ });
+
+ var viewportSize = this.controller.getWindowSize();
+
+ // Create the mask that blocks out the rest of the screen
+ this.mask = dojo.create("div", {"class": "dialogUnderlayWrapper",
+ innerHTML: "<div class=\"dialogUnderlay\"></div>",
+ style: {
+ width: viewportSize.w + "px",
+ height: viewportSize.h + "px"
+ }
+ }, this.controller.assistant.domNode);
+
+ this.connect(this.mask, "onclick", function(){
+ _this.onChoose && _this.onChoose();
+ _this.hide();
+ });
+ },
+
+ postCreate: function(){
+ this.subscribe("/dojox/mobile/app/goback", this._handleSelect);
+ },
+
+ _handleSelect: function(event){
+ // summary:
+ // Handle the selection of a value
+ var node;
+ console.log("handleSelect");
+ if(event && event.target){
+ node = event.target;
+
+ // Find the widget that was tapped.
+ while(!dijit.byNode(node)){
+ node - node.parentNode;
+ }
+ }
+
+ // If an onChoose function was provided, tell it what button
+ // value was chosen
+ if(this.onChoose){
+ this.onChoose(node ? dijit.byNode(node)._dialogValue: undefined);
+ }
+ // Hide the dialog
+ this.hide();
+ },
+
+ show: function(){
+ // summary:
+ // Show the dialog
+ this._doTransition(1);
+ },
+
+ hide: function(){
+ // summary:
+ // Hide the dialog
+ this._doTransition(-1);
+ },
+
+ _doTransition: function(dir){
+ // summary:
+ // Either shows or hides the dialog.
+ // dir:
+ // An integer. If positive, the dialog is shown. If negative,
+ // the dialog is hidden.
+
+ // TODO: replace this with CSS transitions
+
+ var anim;
+ var h = dojo.marginBox(this.domNode.firstChild).h;
+
+
+ var bodyHeight = this.controller.getWindowSize().h;
+ console.log("dialog height = " + h, " body height = " + bodyHeight);
+
+ var high = bodyHeight - h;
+ var low = bodyHeight;
+
+ var anim1 = dojo.fx.slideTo({
+ node: this.domNode,
+ duration: 400,
+ top: {start: dir < 0 ? high : low, end: dir < 0 ? low: high}
+ });
+
+ var anim2 = dojo[dir < 0 ? "fadeOut" : "fadeIn"]({
+ node: this.mask,
+ duration: 400
+ });
+
+ var anim = dojo.fx.combine([anim1, anim2]);
+
+ var _this = this;
+
+ dojo.connect(anim, "onEnd", this, function(){
+ if(dir < 0){
+ _this.domNode.style.display = "none";
+ dojo.destroy(_this.domNode);
+ dojo.destroy(_this.mask);
+ }
+ });
+ anim.play();
+ },
+
+ destroy: function(){
+ this.inherited(arguments);
+ dojo.destroy(this.mask);
+ },
+
+
+ onClick: function(){
+
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/mobile/app/ImageThumbView.js b/js/dojo-1.6/dojox/mobile/app/ImageThumbView.js
new file mode 100644
index 0000000..c80d2b5
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/ImageThumbView.js
@@ -0,0 +1,400 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.mobile.app.ImageThumbView"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.ImageThumbView"] = true;
+dojo.provide("dojox.mobile.app.ImageThumbView");
+dojo.experimental("dojox.mobile.app.ImageThumbView");
+
+dojo.require("dijit._WidgetBase");
+dojo.require("dojo.string");
+
+dojo.declare("dojox.mobile.app.ImageThumbView", dijit._WidgetBase, {
+ // summary:
+ // An image thumbnail gallery
+
+ // items: Array
+ // The data items from which the image urls are retrieved.
+ // If an item is a string, it is expected to be a URL. Otherwise
+ // by default it is expected to have a 'url' member. This can
+ // be configured using the 'urlParam' attribute on this widget.
+ items: [],
+
+ // urlParam: String
+ // The paramter name used to retrieve an image url from a JSON object
+ urlParam: "url",
+
+ labelParam: null,
+
+ itemTemplate: '<div class="mblThumbInner">' +
+ '<div class="mblThumbOverlay"></div>' +
+ '<div class="mblThumbMask">' +
+ '<div class="mblThumbSrc" style="background-image:url(${url})"></div>' +
+ '</div>' +
+ '</div>',
+
+ minPadding: 4,
+
+ maxPerRow: 3,
+
+ maxRows: -1,
+
+ baseClass: "mblImageThumbView",
+
+ thumbSize: "medium",
+
+ animationEnabled: true,
+
+ selectedIndex: -1,
+
+ cache: null,
+
+ cacheMustMatch: false,
+
+ clickEvent: "onclick",
+
+ cacheBust: false,
+
+ disableHide: false,
+
+ constructor: function(params, node){
+ },
+
+ postCreate: function(){
+
+ this.inherited(arguments);
+ var _this = this;
+
+ var hoverCls = "mblThumbHover";
+
+ this.addThumb = dojo.hitch(this, this.addThumb);
+ this.handleImgLoad = dojo.hitch(this, this.handleImgLoad);
+ this.hideCached = dojo.hitch(this, this.hideCached);
+
+ this._onLoadImages = {};
+
+ this.cache = [];
+ this.visibleImages = [];
+
+ this._cacheCounter = 0;
+
+ this.connect(this.domNode, this.clickEvent, function(event){
+ var itemNode = _this._getItemNodeFromEvent(event);
+
+ if(itemNode && !itemNode._cached){
+ _this.onSelect(itemNode._item, itemNode._index, _this.items);
+ dojo.query(".selected", this.domNode).removeClass("selected");
+ dojo.addClass(itemNode, "selected");
+ }
+ });
+
+ dojo.addClass(this.domNode, this.thumbSize);
+
+ this.resize();
+ this.render();
+ },
+
+ onSelect: function(item, index, items){
+ // summary:
+ // Dummy function that is triggered when an image is selected.
+ },
+
+ _setAnimationEnabledAttr: function(value){
+ this.animationEnabled = value;
+ dojo[value ? "addClass" : "removeClass"](this.domNode, "animated");
+ },
+
+ _setItemsAttr: function(items){
+ this.items = items || [];
+
+ var urls = {};
+ var i;
+ for(i = 0; i < this.items.length; i++){
+ urls[this.items[i][this.urlParam]] = 1;
+ }
+
+ var clearedUrls = [];
+ for(var url in this._onLoadImages){
+ if(!urls[url] && this._onLoadImages[url]._conn){
+ dojo.disconnect(this._onLoadImages[url]._conn);
+ this._onLoadImages[url].src = null;
+ clearedUrls.push(url);
+ }
+ }
+
+ for(i = 0; i < clearedUrls.length; i++){
+ delete this._onLoadImages[url];
+ }
+
+ this.render();
+ },
+
+ _getItemNode: function(node){
+ while(node && !dojo.hasClass(node, "mblThumb") && node != this.domNode){
+ node = node.parentNode;
+ }
+
+ return (node == this.domNode) ? null : node;
+ },
+
+ _getItemNodeFromEvent: function(event){
+ if(event.touches && event.touches.length > 0){
+ event = event.touches[0];
+ }
+ return this._getItemNode(event.target);
+ },
+
+ resize: function(){
+ this._thumbSize = null;
+
+ this._size = dojo.contentBox(this.domNode);
+
+ this.disableHide = true;
+ this.render();
+ this.disableHide = false;
+ },
+
+ hideCached: function(){
+ // summary:
+ // Hides all cached nodes, so that they're no invisible and overlaying
+ // other screen elements.
+ for(var i = 0; i < this.cache.length; i++){
+ if (this.cache[i]) {
+ dojo.style(this.cache[i], "display", "none");
+ }
+ }
+ },
+
+ render: function(){
+ var i;
+ var url;
+ var item;
+
+ var thumb;
+ while(this.visibleImages && this.visibleImages.length > 0){
+ thumb = this.visibleImages.pop();
+ this.cache.push(thumb);
+
+ if (!this.disableHide) {
+ dojo.addClass(thumb, "hidden");
+ }
+ thumb._cached = true;
+ }
+
+ if(this.cache && this.cache.length > 0){
+ setTimeout(this.hideCached, 1000);
+ }
+
+ if(!this.items || this.items.length == 0){
+ return;
+ }
+
+ for(i = 0; i < this.items.length; i++){
+ item = this.items[i];
+ url = (dojo.isString(item) ? item : item[this.urlParam]);
+
+ this.addThumb(item, url, i);
+
+ if(this.maxRows > 0 && (i + 1) / this.maxPerRow >= this.maxRows){
+ break;
+ }
+ }
+
+ if(!this._thumbSize){
+ return;
+ }
+
+ var column = 0;
+ var row = -1;
+
+ var totalThumbWidth = this._thumbSize.w + (this.padding * 2);
+ var totalThumbHeight = this._thumbSize.h + (this.padding * 2);
+
+ var nodes = this.thumbNodes =
+ dojo.query(".mblThumb", this.domNode);
+
+ var pos = 0;
+ nodes = this.visibleImages;
+ for(i = 0; i < nodes.length; i++){
+ if(nodes[i]._cached){
+ continue;
+ }
+
+ if(pos % this.maxPerRow == 0){
+ row ++;
+ }
+ column = pos % this.maxPerRow;
+
+ this.place(
+ nodes[i],
+ (column * totalThumbWidth) + this.padding, // x position
+ (row * totalThumbHeight) + this.padding // y position
+ );
+
+ if(!nodes[i]._loading){
+ dojo.removeClass(nodes[i], "hidden");
+ }
+
+ if(pos == this.selectedIndex){
+ dojo[pos == this.selectedIndex ? "addClass" : "removeClass"]
+ (nodes[i], "selected");
+ }
+ pos++;
+ }
+
+ var numRows = Math.ceil(pos / this.maxPerRow);
+
+ this._numRows = numRows;
+
+ this.setContainerHeight((numRows * (this._thumbSize.h + this.padding * 2)));
+ },
+
+ setContainerHeight: function(amount){
+ dojo.style(this.domNode, "height", amount + "px");
+ },
+
+ addThumb: function(item, url, index){
+
+ var thumbDiv;
+ var cacheHit = false;
+ if(this.cache.length > 0){
+ // Reuse a previously created node if possible
+ var found = false;
+ // Search for an image with the same url first
+ for(var i = 0; i < this.cache.length; i++){
+ if(this.cache[i]._url == url){
+ thumbDiv = this.cache.splice(i, 1)[0];
+ found = true;
+ break
+ }
+ }
+
+ // if no image with the same url is found, just take the last one
+ if(!thumbDiv && !this.cacheMustMatch){
+ thumbDiv = this.cache.pop();
+ dojo.removeClass(thumbDiv, "selected");
+ } else {
+ cacheHit = true;
+ }
+ }
+
+ if(!thumbDiv){
+
+ // Create a new thumb
+ thumbDiv = dojo.create("div", {
+ "class": "mblThumb hidden",
+ innerHTML: dojo.string.substitute(this.itemTemplate, {
+ url: url
+ }, null, this)
+ }, this.domNode);
+ }
+
+ if(this.labelParam) {
+ var labelNode = dojo.query(".mblThumbLabel", thumbDiv)[0];
+ if(!labelNode) {
+ labelNode = dojo.create("div", {
+ "class": "mblThumbLabel"
+ }, thumbDiv);
+ }
+ labelNode.innerHTML = item[this.labelParam] || "";
+ }
+
+ dojo.style(thumbDiv, "display", "");
+ if (!this.disableHide) {
+ dojo.addClass(thumbDiv, "hidden");
+ }
+
+ if (!cacheHit) {
+ var loader = dojo.create("img", {});
+ loader._thumbDiv = thumbDiv;
+ loader._conn = dojo.connect(loader, "onload", this.handleImgLoad);
+ loader._url = url;
+ thumbDiv._loading = true;
+
+ this._onLoadImages[url] = loader;
+ if (loader) {
+ loader.src = url;
+ }
+ }
+ this.visibleImages.push(thumbDiv);
+
+ thumbDiv._index = index;
+ thumbDiv._item = item;
+ thumbDiv._url = url;
+ thumbDiv._cached = false;
+
+ if(!this._thumbSize){
+ this._thumbSize = dojo.marginBox(thumbDiv);
+
+ if(this._thumbSize.h == 0){
+ this._thumbSize.h = 100;
+ this._thumbSize.w = 100;
+ }
+
+ if(this.labelParam){
+ this._thumbSize.h += 8;
+ }
+
+ this.calcPadding();
+ }
+ },
+
+ handleImgLoad: function(event){
+ var img = event.target;
+ dojo.disconnect(img._conn);
+ dojo.removeClass(img._thumbDiv, "hidden");
+ img._thumbDiv._loading = false;
+ img._conn = null;
+
+ var url = img._url;
+ if(this.cacheBust){
+ url += (url.indexOf("?") > -1 ? "&" : "?")
+ + "cacheBust=" + (new Date()).getTime() + "_" + (this._cacheCounter++);
+ }
+
+ dojo.query(".mblThumbSrc", img._thumbDiv)
+ .style("backgroundImage", "url(" + url + ")");
+
+ delete this._onLoadImages[img._url];
+ },
+
+ calcPadding: function(){
+ var width = this._size.w;
+
+ var thumbWidth = this._thumbSize.w;
+
+ var imgBounds = thumbWidth + this.minPadding;
+
+ this.maxPerRow = Math.floor(width / imgBounds);
+
+ this.padding = Math.floor((width - (thumbWidth * this.maxPerRow)) / (this.maxPerRow * 2));
+ },
+
+ place: function(node, x, y){
+ dojo.style(node, {
+ "-webkit-transform" :"translate(" + x + "px," + y + "px)"
+ });
+ },
+
+ destroy: function(){
+ // Stop the loading of any more images
+
+ var img;
+ var counter = 0;
+ for (var url in this._onLoadImages){
+ img = this._onLoadImages[url];
+ if (img) {
+ img.src = null;
+ counter++;
+ }
+ }
+
+ this.inherited(arguments);
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/mobile/app/ImageThumbView.xd.js b/js/dojo-1.6/dojox/mobile/app/ImageThumbView.xd.js
new file mode 100644
index 0000000..4553154
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/ImageThumbView.xd.js
@@ -0,0 +1,406 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.mobile.app.ImageThumbView"],
+["require", "dijit._WidgetBase"],
+["require", "dojo.string"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.mobile.app.ImageThumbView"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.ImageThumbView"] = true;
+dojo.provide("dojox.mobile.app.ImageThumbView");
+dojo.experimental("dojox.mobile.app.ImageThumbView");
+
+dojo.require("dijit._WidgetBase");
+dojo.require("dojo.string");
+
+dojo.declare("dojox.mobile.app.ImageThumbView", dijit._WidgetBase, {
+ // summary:
+ // An image thumbnail gallery
+
+ // items: Array
+ // The data items from which the image urls are retrieved.
+ // If an item is a string, it is expected to be a URL. Otherwise
+ // by default it is expected to have a 'url' member. This can
+ // be configured using the 'urlParam' attribute on this widget.
+ items: [],
+
+ // urlParam: String
+ // The paramter name used to retrieve an image url from a JSON object
+ urlParam: "url",
+
+ labelParam: null,
+
+ itemTemplate: '<div class="mblThumbInner">' +
+ '<div class="mblThumbOverlay"></div>' +
+ '<div class="mblThumbMask">' +
+ '<div class="mblThumbSrc" style="background-image:url(${url})"></div>' +
+ '</div>' +
+ '</div>',
+
+ minPadding: 4,
+
+ maxPerRow: 3,
+
+ maxRows: -1,
+
+ baseClass: "mblImageThumbView",
+
+ thumbSize: "medium",
+
+ animationEnabled: true,
+
+ selectedIndex: -1,
+
+ cache: null,
+
+ cacheMustMatch: false,
+
+ clickEvent: "onclick",
+
+ cacheBust: false,
+
+ disableHide: false,
+
+ constructor: function(params, node){
+ },
+
+ postCreate: function(){
+
+ this.inherited(arguments);
+ var _this = this;
+
+ var hoverCls = "mblThumbHover";
+
+ this.addThumb = dojo.hitch(this, this.addThumb);
+ this.handleImgLoad = dojo.hitch(this, this.handleImgLoad);
+ this.hideCached = dojo.hitch(this, this.hideCached);
+
+ this._onLoadImages = {};
+
+ this.cache = [];
+ this.visibleImages = [];
+
+ this._cacheCounter = 0;
+
+ this.connect(this.domNode, this.clickEvent, function(event){
+ var itemNode = _this._getItemNodeFromEvent(event);
+
+ if(itemNode && !itemNode._cached){
+ _this.onSelect(itemNode._item, itemNode._index, _this.items);
+ dojo.query(".selected", this.domNode).removeClass("selected");
+ dojo.addClass(itemNode, "selected");
+ }
+ });
+
+ dojo.addClass(this.domNode, this.thumbSize);
+
+ this.resize();
+ this.render();
+ },
+
+ onSelect: function(item, index, items){
+ // summary:
+ // Dummy function that is triggered when an image is selected.
+ },
+
+ _setAnimationEnabledAttr: function(value){
+ this.animationEnabled = value;
+ dojo[value ? "addClass" : "removeClass"](this.domNode, "animated");
+ },
+
+ _setItemsAttr: function(items){
+ this.items = items || [];
+
+ var urls = {};
+ var i;
+ for(i = 0; i < this.items.length; i++){
+ urls[this.items[i][this.urlParam]] = 1;
+ }
+
+ var clearedUrls = [];
+ for(var url in this._onLoadImages){
+ if(!urls[url] && this._onLoadImages[url]._conn){
+ dojo.disconnect(this._onLoadImages[url]._conn);
+ this._onLoadImages[url].src = null;
+ clearedUrls.push(url);
+ }
+ }
+
+ for(i = 0; i < clearedUrls.length; i++){
+ delete this._onLoadImages[url];
+ }
+
+ this.render();
+ },
+
+ _getItemNode: function(node){
+ while(node && !dojo.hasClass(node, "mblThumb") && node != this.domNode){
+ node = node.parentNode;
+ }
+
+ return (node == this.domNode) ? null : node;
+ },
+
+ _getItemNodeFromEvent: function(event){
+ if(event.touches && event.touches.length > 0){
+ event = event.touches[0];
+ }
+ return this._getItemNode(event.target);
+ },
+
+ resize: function(){
+ this._thumbSize = null;
+
+ this._size = dojo.contentBox(this.domNode);
+
+ this.disableHide = true;
+ this.render();
+ this.disableHide = false;
+ },
+
+ hideCached: function(){
+ // summary:
+ // Hides all cached nodes, so that they're no invisible and overlaying
+ // other screen elements.
+ for(var i = 0; i < this.cache.length; i++){
+ if (this.cache[i]) {
+ dojo.style(this.cache[i], "display", "none");
+ }
+ }
+ },
+
+ render: function(){
+ var i;
+ var url;
+ var item;
+
+ var thumb;
+ while(this.visibleImages && this.visibleImages.length > 0){
+ thumb = this.visibleImages.pop();
+ this.cache.push(thumb);
+
+ if (!this.disableHide) {
+ dojo.addClass(thumb, "hidden");
+ }
+ thumb._cached = true;
+ }
+
+ if(this.cache && this.cache.length > 0){
+ setTimeout(this.hideCached, 1000);
+ }
+
+ if(!this.items || this.items.length == 0){
+ return;
+ }
+
+ for(i = 0; i < this.items.length; i++){
+ item = this.items[i];
+ url = (dojo.isString(item) ? item : item[this.urlParam]);
+
+ this.addThumb(item, url, i);
+
+ if(this.maxRows > 0 && (i + 1) / this.maxPerRow >= this.maxRows){
+ break;
+ }
+ }
+
+ if(!this._thumbSize){
+ return;
+ }
+
+ var column = 0;
+ var row = -1;
+
+ var totalThumbWidth = this._thumbSize.w + (this.padding * 2);
+ var totalThumbHeight = this._thumbSize.h + (this.padding * 2);
+
+ var nodes = this.thumbNodes =
+ dojo.query(".mblThumb", this.domNode);
+
+ var pos = 0;
+ nodes = this.visibleImages;
+ for(i = 0; i < nodes.length; i++){
+ if(nodes[i]._cached){
+ continue;
+ }
+
+ if(pos % this.maxPerRow == 0){
+ row ++;
+ }
+ column = pos % this.maxPerRow;
+
+ this.place(
+ nodes[i],
+ (column * totalThumbWidth) + this.padding, // x position
+ (row * totalThumbHeight) + this.padding // y position
+ );
+
+ if(!nodes[i]._loading){
+ dojo.removeClass(nodes[i], "hidden");
+ }
+
+ if(pos == this.selectedIndex){
+ dojo[pos == this.selectedIndex ? "addClass" : "removeClass"]
+ (nodes[i], "selected");
+ }
+ pos++;
+ }
+
+ var numRows = Math.ceil(pos / this.maxPerRow);
+
+ this._numRows = numRows;
+
+ this.setContainerHeight((numRows * (this._thumbSize.h + this.padding * 2)));
+ },
+
+ setContainerHeight: function(amount){
+ dojo.style(this.domNode, "height", amount + "px");
+ },
+
+ addThumb: function(item, url, index){
+
+ var thumbDiv;
+ var cacheHit = false;
+ if(this.cache.length > 0){
+ // Reuse a previously created node if possible
+ var found = false;
+ // Search for an image with the same url first
+ for(var i = 0; i < this.cache.length; i++){
+ if(this.cache[i]._url == url){
+ thumbDiv = this.cache.splice(i, 1)[0];
+ found = true;
+ break
+ }
+ }
+
+ // if no image with the same url is found, just take the last one
+ if(!thumbDiv && !this.cacheMustMatch){
+ thumbDiv = this.cache.pop();
+ dojo.removeClass(thumbDiv, "selected");
+ } else {
+ cacheHit = true;
+ }
+ }
+
+ if(!thumbDiv){
+
+ // Create a new thumb
+ thumbDiv = dojo.create("div", {
+ "class": "mblThumb hidden",
+ innerHTML: dojo.string.substitute(this.itemTemplate, {
+ url: url
+ }, null, this)
+ }, this.domNode);
+ }
+
+ if(this.labelParam) {
+ var labelNode = dojo.query(".mblThumbLabel", thumbDiv)[0];
+ if(!labelNode) {
+ labelNode = dojo.create("div", {
+ "class": "mblThumbLabel"
+ }, thumbDiv);
+ }
+ labelNode.innerHTML = item[this.labelParam] || "";
+ }
+
+ dojo.style(thumbDiv, "display", "");
+ if (!this.disableHide) {
+ dojo.addClass(thumbDiv, "hidden");
+ }
+
+ if (!cacheHit) {
+ var loader = dojo.create("img", {});
+ loader._thumbDiv = thumbDiv;
+ loader._conn = dojo.connect(loader, "onload", this.handleImgLoad);
+ loader._url = url;
+ thumbDiv._loading = true;
+
+ this._onLoadImages[url] = loader;
+ if (loader) {
+ loader.src = url;
+ }
+ }
+ this.visibleImages.push(thumbDiv);
+
+ thumbDiv._index = index;
+ thumbDiv._item = item;
+ thumbDiv._url = url;
+ thumbDiv._cached = false;
+
+ if(!this._thumbSize){
+ this._thumbSize = dojo.marginBox(thumbDiv);
+
+ if(this._thumbSize.h == 0){
+ this._thumbSize.h = 100;
+ this._thumbSize.w = 100;
+ }
+
+ if(this.labelParam){
+ this._thumbSize.h += 8;
+ }
+
+ this.calcPadding();
+ }
+ },
+
+ handleImgLoad: function(event){
+ var img = event.target;
+ dojo.disconnect(img._conn);
+ dojo.removeClass(img._thumbDiv, "hidden");
+ img._thumbDiv._loading = false;
+ img._conn = null;
+
+ var url = img._url;
+ if(this.cacheBust){
+ url += (url.indexOf("?") > -1 ? "&" : "?")
+ + "cacheBust=" + (new Date()).getTime() + "_" + (this._cacheCounter++);
+ }
+
+ dojo.query(".mblThumbSrc", img._thumbDiv)
+ .style("backgroundImage", "url(" + url + ")");
+
+ delete this._onLoadImages[img._url];
+ },
+
+ calcPadding: function(){
+ var width = this._size.w;
+
+ var thumbWidth = this._thumbSize.w;
+
+ var imgBounds = thumbWidth + this.minPadding;
+
+ this.maxPerRow = Math.floor(width / imgBounds);
+
+ this.padding = Math.floor((width - (thumbWidth * this.maxPerRow)) / (this.maxPerRow * 2));
+ },
+
+ place: function(node, x, y){
+ dojo.style(node, {
+ "-webkit-transform" :"translate(" + x + "px," + y + "px)"
+ });
+ },
+
+ destroy: function(){
+ // Stop the loading of any more images
+
+ var img;
+ var counter = 0;
+ for (var url in this._onLoadImages){
+ img = this._onLoadImages[url];
+ if (img) {
+ img.src = null;
+ counter++;
+ }
+ }
+
+ this.inherited(arguments);
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/mobile/app/ImageView.js b/js/dojo-1.6/dojox/mobile/app/ImageView.js
new file mode 100644
index 0000000..cb77865
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/ImageView.js
@@ -0,0 +1,727 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.mobile.app.ImageView"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.ImageView"] = true;
+dojo.provide("dojox.mobile.app.ImageView");
+dojo.experimental("dojox.mobile.app.ImageView");
+dojo.require("dojox.mobile.app._Widget");
+
+dojo.require("dojo.fx.easing");
+
+dojo.declare("dojox.mobile.app.ImageView", dojox.mobile.app._Widget, {
+
+ // zoom: Number
+ // The current level of zoom. This should not be set manually.
+ zoom: 1,
+
+ // zoomCenterX: Number
+ // The X coordinate in the image where the zoom is focused
+ zoomCenterX: 0,
+
+ // zoomCenterY: Number
+ // The Y coordinate in the image where the zoom is focused
+ zoomCenterY: 0,
+
+ // maxZoom: Number
+ // The highest degree to which an image can be zoomed. For example,
+ // a maxZoom of 5 means that the image will be 5 times larger than normal
+ maxZoom: 5,
+
+ // autoZoomLevel: Number
+ // The degree to which the image is zoomed when auto zoom is invoked.
+ // The higher the number, the more the image is zoomed in.
+ autoZoomLevel: 3,
+
+ // disableAutoZoom: Boolean
+ // Disables auto zoom
+ disableAutoZoom: false,
+
+ // disableSwipe: Boolean
+ // Disables the users ability to swipe from one image to the next.
+ disableSwipe: false,
+
+ // autoZoomEvent: String
+ // Overrides the default event listened to which invokes auto zoom
+ autoZoomEvent: null,
+
+ // _leftImg: Node
+ // The full sized image to the left
+ _leftImg: null,
+
+ // _centerImg: Node
+ // The full sized image in the center
+ _centerImg: null,
+
+ // _rightImg: Node
+ // The full sized image to the right
+ _rightImg: null,
+
+ // _leftImg: Node
+ // The small sized image to the left
+ _leftSmallImg: null,
+
+ // _centerImg: Node
+ // The small sized image in the center
+ _centerSmallImg: null,
+
+ // _rightImg: Node
+ // The small sized image to the right
+ _rightSmallImg: null,
+
+ constructor: function(){
+
+ this.panX = 0;
+ this.panY = 0;
+
+ this.handleLoad = dojo.hitch(this, this.handleLoad);
+ this._updateAnimatedZoom = dojo.hitch(this, this._updateAnimatedZoom);
+ this._updateAnimatedPan = dojo.hitch(this, this._updateAnimatedPan);
+ this._onAnimPanEnd = dojo.hitch(this, this._onAnimPanEnd);
+ },
+
+ buildRendering: function(){
+ this.inherited(arguments);
+
+ this.canvas = dojo.create("canvas", {}, this.domNode);
+
+ dojo.addClass(this.domNode, "mblImageView");
+ },
+
+ postCreate: function(){
+ this.inherited(arguments);
+
+ this.size = dojo.marginBox(this.domNode);
+
+ dojo.style(this.canvas, {
+ width: this.size.w + "px",
+ height: this.size.h + "px"
+ });
+ this.canvas.height = this.size.h;
+ this.canvas.width = this.size.w;
+
+ var _this = this;
+
+ // Listen to the mousedown/touchstart event. Record the position
+ // so we can use it to pan the image.
+ this.connect(this.domNode, "onmousedown", function(event){
+ if(_this.isAnimating()){
+ return;
+ }
+ if(_this.panX){
+ _this.handleDragEnd();
+ }
+
+ _this.downX = event.targetTouches ? event.targetTouches[0].clientX : event.clientX;
+ _this.downY = event.targetTouches ? event.targetTouches[0].clientY : event.clientY;
+ });
+
+ // record the movement of the mouse.
+ this.connect(this.domNode, "onmousemove", function(event){
+ if(_this.isAnimating()){
+ return;
+ }
+ if((!_this.downX && _this.downX !== 0) || (!_this.downY && _this.downY !== 0)){
+ // If the touch didn't begin on this widget, ignore the movement
+ return;
+ }
+
+ if((!_this.disableSwipe && _this.zoom == 1)
+ || (!_this.disableAutoZoom && _this.zoom != 1)){
+ var x = event.targetTouches ?
+ event.targetTouches[0].clientX : event.pageX;
+ var y = event.targetTouches ?
+ event.targetTouches[0].clientY : event.pageY;
+
+ _this.panX = x - _this.downX;
+ _this.panY = y - _this.downY;
+
+ if(_this.zoom == 1){
+ // If not zoomed in, then try to move to the next or prev image
+ // but only if the mouse has moved more than 10 pixels
+ // in the X direction
+ if(Math.abs(_this.panX) > 10){
+ _this.render();
+ }
+ }else{
+ // If zoomed in, pan the image if the mouse has moved more
+ // than 10 pixels in either direction.
+ if(Math.abs(_this.panX) > 10 || Math.abs(_this.panY) > 10){
+ _this.render();
+ }
+ }
+ }
+ });
+
+ this.connect(this.domNode, "onmouseout", function(event){
+ if(!_this.isAnimating() && _this.panX){
+ _this.handleDragEnd();
+ }
+ });
+
+ this.connect(this.domNode, "onmouseover", function(event){
+ _this.downX = _this.downY = null;
+ });
+
+ // Set up AutoZoom, which zooms in a fixed amount when the user taps
+ // a part of the canvas
+ this.connect(this.domNode, "onclick", function(event){
+ if(_this.isAnimating()){
+ return;
+ }
+ if(_this.downX == null || _this.downY == null){
+ return;
+ }
+
+ var x = (event.targetTouches ?
+ event.targetTouches[0].clientX : event.pageX);
+ var y = (event.targetTouches ?
+ event.targetTouches[0].clientY : event.pageY);
+
+ // If the mouse/finger has moved more than 14 pixels from where it
+ // started, do not treat it as a click. It is a drag.
+ if(Math.abs(_this.panX) > 14 || Math.abs(_this.panY) > 14){
+ _this.downX = _this.downY = null;
+ _this.handleDragEnd();
+ return;
+ }
+ _this.downX = _this.downY = null;
+
+ if(!_this.disableAutoZoom){
+
+ if(!_this._centerImg || !_this._centerImg._loaded){
+ // Do nothing until the image is loaded
+ return;
+ }
+ if(_this.zoom != 1){
+ _this.set("animatedZoom", 1);
+ return;
+ }
+
+ var pos = dojo._abs(_this.domNode);
+
+ // Translate the clicked point to a point on the source image
+ var xRatio = _this.size.w / _this._centerImg.width;
+ var yRatio = _this.size.h / _this._centerImg.height;
+
+ // Do an animated zoom to the point which was clicked.
+ _this.zoomTo(
+ ((x - pos.x) / xRatio) - _this.panX,
+ ((y - pos.y) / yRatio) - _this.panY,
+ _this.autoZoomLevel);
+ }
+ });
+
+ // Listen for Flick events
+ dojo.connect(this.domNode, "flick", this, "handleFlick");
+ },
+
+ isAnimating: function(){
+ // summary:
+ // Returns true if an animation is in progress, false otherwise.
+ return this._anim && this._anim.status() == "playing";
+ },
+
+ handleDragEnd: function(){
+ // summary:
+ // Handles the end of a dragging event. If not zoomed in, it
+ // determines if the next or previous image should be transitioned
+ // to.
+ this.downX = this.downY = null;
+ console.log("handleDragEnd");
+
+ if(this.zoom == 1){
+ if(!this.panX){
+ return;
+ }
+
+ var leftLoaded = (this._leftImg && this._leftImg._loaded)
+ || (this._leftSmallImg && this._leftSmallImg._loaded);
+ var rightLoaded = (this._rightImg && this._rightImg._loaded)
+ || (this._rightSmallImg && this._rightSmallImg._loaded);
+
+ // Check if the drag has moved the image more than half its length.
+ // If so, move to either the previous or next image.
+ var doMove =
+ !(Math.abs(this.panX) < this._centerImg._baseWidth / 2) &&
+ (
+ (this.panX > 0 && leftLoaded ? 1 : 0) ||
+ (this.panX < 0 && rightLoaded ? 1 : 0)
+ );
+
+
+ if(!doMove){
+ // If not moving to another image, animate the sliding of the
+ // image back into place.
+ this._animPanTo(0, dojo.fx.easing.expoOut, 700);
+ }else{
+ // Move to another image.
+ this.moveTo(this.panX);
+ }
+ }else{
+ if(!this.panX && !this.panY){
+ return;
+ }
+ // Recenter the zoomed image based on where it was panned to
+ // previously
+ this.zoomCenterX -= (this.panX / this.zoom);
+ this.zoomCenterY -= (this.panY / this.zoom);
+
+ this.panX = this.panY = 0;
+ }
+
+ },
+
+ handleFlick: function(event){
+ // summary:
+ // Handle a flick event.
+ if(this.zoom == 1 && event.duration < 500){
+ // Only handle quick flicks here, less than 0.5 seconds
+
+ // If not zoomed in, then check if we should move to the next photo
+ // or not
+ if(event.direction == "ltr"){
+ this.moveTo(1);
+ }else if(event.direction == "rtl"){
+ this.moveTo(-1);
+ }
+ // If an up or down flick occurs, it means nothing so ignore it
+ this.downX = this.downY = null;
+ }
+ },
+
+ moveTo: function(direction){
+ direction = direction > 0 ? 1 : -1;
+ var toImg;
+
+ if(direction < 1){
+ if(this._rightImg && this._rightImg._loaded){
+ toImg = this._rightImg;
+ }else if(this._rightSmallImg && this._rightSmallImg._loaded){
+ toImg = this._rightSmallImg;
+ }
+ }else{
+ if(this._leftImg && this._leftImg._loaded){
+ toImg = this._leftImg;
+ }else if(this._leftSmallImg && this._leftSmallImg._loaded){
+ toImg = this._leftSmallImg;
+ }
+ }
+
+ this._moveDir = direction;
+ var _this = this;
+
+ if(toImg && toImg._loaded){
+ // If the image is loaded, make a linear animation to show it
+ this._animPanTo(this.size.w * direction, null, 500, function(){
+ _this.panX = 0;
+ _this.panY = 0;
+
+ if(direction < 0){
+ // Moving to show the right image
+ _this._switchImage("left", "right");
+ }else{
+ // Moving to show the left image
+ _this._switchImage("right", "left");
+ }
+
+ _this.render();
+ _this.onChange(direction * -1);
+ });
+
+ }else{
+ // If the next image is not loaded, make an animation to
+ // move the center image to half the width of the widget and back
+ // again
+
+ console.log("moveTo image not loaded!", toImg);
+
+ this._animPanTo(0, dojo.fx.easing.expoOut, 700);
+ }
+ },
+
+ _switchImage: function(toImg, fromImg){
+ var toSmallImgName = "_" + toImg + "SmallImg";
+ var toImgName = "_" + toImg + "Img";
+
+ var fromSmallImgName = "_" + fromImg + "SmallImg";
+ var fromImgName = "_" + fromImg + "Img";
+
+ this[toImgName] = this._centerImg;
+ this[toSmallImgName] = this._centerSmallImg;
+
+ this[toImgName]._type = toImg;
+
+ if(this[toSmallImgName]){
+ this[toSmallImgName]._type = toImg;
+ }
+
+ this._centerImg = this[fromImgName];
+ this._centerSmallImg = this[fromSmallImgName];
+ this._centerImg._type = "center";
+
+ if(this._centerSmallImg){
+ this._centerSmallImg._type = "center";
+ }
+ this[fromImgName] = this[fromSmallImgName] = null;
+ },
+
+ _animPanTo: function(to, easing, duration, callback){
+ this._animCallback = callback;
+ this._anim = new dojo.Animation({
+ curve: [this.panX, to],
+ onAnimate: this._updateAnimatedPan,
+ duration: duration || 500,
+ easing: easing,
+ onEnd: this._onAnimPanEnd
+ });
+
+ this._anim.play();
+ return this._anim;
+ },
+
+ onChange: function(direction){
+ // summary:
+ // Stub function that can be listened to in order to provide
+ // new images when the displayed image changes
+ },
+
+ _updateAnimatedPan: function(amount){
+ this.panX = amount;
+ this.render();
+ },
+
+ _onAnimPanEnd: function(){
+ this.panX = this.panY = 0;
+
+ if(this._animCallback){
+ this._animCallback();
+ }
+ },
+
+ zoomTo: function(centerX, centerY, zoom){
+ this.set("zoomCenterX", centerX);
+ this.set("zoomCenterY", centerY);
+
+ this.set("animatedZoom", zoom);
+ },
+
+ render: function(){
+ var cxt = this.canvas.getContext('2d');
+
+ cxt.clearRect(0, 0, this.canvas.width, this.canvas.height);
+
+ // Render the center image
+ this._renderImg(
+ this._centerSmallImg,
+ this._centerImg,
+ this.zoom == 1 ? (this.panX < 0 ? 1 : this.panX > 0 ? -1 : 0) : 0);
+
+ if(this.zoom == 1 && this.panX != 0){
+ if(this.panX > 0){
+ // Render the left image, showing the right side of it
+ this._renderImg(this._leftSmallImg, this._leftImg, 1);
+ }else{
+ // Render the right image, showing the left side of it
+ this._renderImg(this._rightSmallImg, this._rightImg, -1);
+ }
+ }
+ },
+
+ _renderImg: function(smallImg, largeImg, panDir){
+ // summary:
+ // Renders a single image
+
+
+ // If zoomed, we just display the center img
+ var img = (largeImg && largeImg._loaded) ? largeImg : smallImg;
+
+ if(!img || !img._loaded){
+ // If neither the large or small image is loaded, display nothing
+ return;
+ }
+ var cxt = this.canvas.getContext('2d');
+
+ var baseWidth = img._baseWidth;
+ var baseHeight = img._baseHeight;
+
+ // Calculate the size the image would be if there were no bounds
+ var desiredWidth = baseWidth * this.zoom;
+ var desiredHeight = baseHeight * this.zoom;
+
+ // Calculate the actual size of the viewable image
+ var destWidth = Math.min(this.size.w, desiredWidth);
+ var destHeight = Math.min(this.size.h, desiredHeight);
+
+
+ // Calculate the size of the window on the original image to use
+ var sourceWidth = this.dispWidth = img.width * (destWidth / desiredWidth);
+ var sourceHeight = this.dispHeight = img.height * (destHeight / desiredHeight);
+
+ var zoomCenterX = this.zoomCenterX - (this.panX / this.zoom);
+ var zoomCenterY = this.zoomCenterY - (this.panY / this.zoom);
+
+ // Calculate where the center of the view should be
+ var centerX = Math.floor(Math.max(sourceWidth / 2,
+ Math.min(img.width - sourceWidth / 2, zoomCenterX)));
+ var centerY = Math.floor(Math.max(sourceHeight / 2,
+ Math.min(img.height - sourceHeight / 2, zoomCenterY)));
+
+
+ var sourceX = Math.max(0,
+ Math.round((img.width - sourceWidth)/2 + (centerX - img._centerX)) );
+ var sourceY = Math.max(0,
+ Math.round((img.height - sourceHeight) / 2 + (centerY - img._centerY))
+ );
+
+ var destX = Math.round(Math.max(0, this.canvas.width - destWidth)/2);
+ var destY = Math.round(Math.max(0, this.canvas.height - destHeight)/2);
+
+ var oldDestWidth = destWidth;
+ var oldSourceWidth = sourceWidth;
+
+ if(this.zoom == 1 && panDir && this.panX){
+
+ if(this.panX < 0){
+ if(panDir > 0){
+ // If the touch is moving left, and the right side of the
+ // image should be shown, then reduce the destination width
+ // by the absolute value of panX
+ destWidth -= Math.abs(this.panX);
+ destX = 0;
+ }else if(panDir < 0){
+ // If the touch is moving left, and the left side of the
+ // image should be shown, then set the displayed width
+ // to the absolute value of panX, less some pixels for
+ // a padding between images
+ destWidth = Math.max(1, Math.abs(this.panX) - 5);
+ destX = this.size.w - destWidth;
+ }
+ }else{
+ if(panDir > 0){
+ // If the touch is moving right, and the right side of the
+ // image should be shown, then set the destination width
+ // to the absolute value of the pan, less some pixels for
+ // padding
+ destWidth = Math.max(1, Math.abs(this.panX) - 5);
+ destX = 0;
+ }else if(panDir < 0){
+ // If the touch is moving right, and the left side of the
+ // image should be shown, then reduce the destination width
+ // by the widget width minus the absolute value of panX
+ destWidth -= Math.abs(this.panX);
+ destX = this.size.w - destWidth;
+ }
+ }
+
+ sourceWidth = Math.max(1,
+ Math.floor(sourceWidth * (destWidth / oldDestWidth)));
+
+ if(panDir > 0){
+ // If the right side of the image should be displayed, move
+ // the sourceX to be the width of the image minus the difference
+ // between the original sourceWidth and the new sourceWidth
+ sourceX = (sourceX + oldSourceWidth) - (sourceWidth);
+ }
+ sourceX = Math.floor(sourceX);
+ }
+
+ try{
+
+ // See https://developer.mozilla.org/en/Canvas_tutorial/Using_images
+ cxt.drawImage(
+ img,
+ Math.max(0, sourceX),
+ sourceY,
+ Math.min(oldSourceWidth, sourceWidth),
+ sourceHeight,
+ destX, // Xpos
+ destY, // Ypos
+ Math.min(oldDestWidth, destWidth),
+ destHeight
+ );
+ }catch(e){
+ console.log("Caught Error",e,
+
+ "type=", img._type,
+ "oldDestWidth = ", oldDestWidth,
+ "destWidth", destWidth,
+ "destX", destX
+ , "oldSourceWidth=",oldSourceWidth,
+ "sourceWidth=", sourceWidth,
+ "sourceX = " + sourceX
+ );
+ }
+ },
+
+ _setZoomAttr: function(amount){
+ this.zoom = Math.min(this.maxZoom, Math.max(1, amount));
+
+ if(this.zoom == 1
+ && this._centerImg
+ && this._centerImg._loaded){
+
+ if(!this.isAnimating()){
+ this.zoomCenterX = this._centerImg.width / 2;
+ this.zoomCenterY = this._centerImg.height / 2;
+ }
+ this.panX = this.panY = 0;
+ }
+
+ this.render();
+ },
+
+ _setZoomCenterXAttr: function(value){
+ if(value != this.zoomCenterX){
+ if(this._centerImg && this._centerImg._loaded){
+ value = Math.min(this._centerImg.width, value);
+ }
+ this.zoomCenterX = Math.max(0, Math.round(value));
+ }
+ },
+
+ _setZoomCenterYAttr: function(value){
+ if(value != this.zoomCenterY){
+ if(this._centerImg && this._centerImg._loaded){
+ value = Math.min(this._centerImg.height, value);
+ }
+ this.zoomCenterY = Math.max(0, Math.round(value));
+ }
+ },
+
+ _setZoomCenterAttr: function(value){
+ if(value.x != this.zoomCenterX || value.y != this.zoomCenterY){
+ this.set("zoomCenterX", value.x);
+ this.set("zoomCenterY", value.y);
+ this.render();
+ }
+ },
+
+ _setAnimatedZoomAttr: function(amount){
+ if(this._anim && this._anim.status() == "playing"){
+ return;
+ }
+
+ this._anim = new dojo.Animation({
+ curve: [this.zoom, amount],
+ onAnimate: this._updateAnimatedZoom,
+ onEnd: this._onAnimEnd
+ });
+
+ this._anim.play();
+ },
+
+ _updateAnimatedZoom: function(amount){
+ this._setZoomAttr(amount);
+ },
+
+ _setCenterUrlAttr: function(urlOrObj){
+ this._setImage("center", urlOrObj);
+ },
+ _setLeftUrlAttr: function(urlOrObj){
+ this._setImage("left", urlOrObj);
+ },
+ _setRightUrlAttr: function(urlOrObj){
+ this._setImage("right", urlOrObj);
+ },
+
+ _setImage: function(name, urlOrObj){
+ var smallUrl = null;
+
+ var largeUrl = null;
+
+ if(dojo.isString(urlOrObj)){
+ // If the argument is a string, then just load the large url
+ largeUrl = urlOrObj;
+ }else{
+ largeUrl = urlOrObj.large;
+ smallUrl = urlOrObj.small;
+ }
+
+ if(this["_" + name + "Img"] && this["_" + name + "Img"]._src == largeUrl){
+ // Identical URL, ignore it
+ return;
+ }
+
+ // Just do the large image for now
+ var largeImg = this["_" + name + "Img"] = new Image();
+ largeImg._type = name;
+ largeImg._loaded = false;
+ largeImg._src = largeUrl;
+ largeImg._conn = dojo.connect(largeImg, "onload", this.handleLoad);
+
+ if(smallUrl){
+ // If a url to a small version of the image has been provided,
+ // load that image first.
+ var smallImg = this["_" + name + "SmallImg"] = new Image();
+ smallImg._type = name;
+ smallImg._loaded = false;
+ smallImg._conn = dojo.connect(smallImg, "onload", this.handleLoad);
+ smallImg._isSmall = true;
+ smallImg._src = smallUrl;
+ smallImg.src = smallUrl;
+ }
+
+ // It's important that the large url's src is set after the small image
+ // to ensure it's loaded second.
+ largeImg.src = largeUrl;
+ },
+
+ handleLoad: function(evt){
+ // summary:
+ // Handles the loading of an image, both the large and small
+ // versions. A render is triggered as a result of each image load.
+
+ var img = evt.target;
+ img._loaded = true;
+
+ dojo.disconnect(img._conn);
+
+ var type = img._type;
+
+ switch(type){
+ case "center":
+ this.zoomCenterX = img.width / 2;
+ this.zoomCenterY = img.height / 2;
+ break;
+ }
+
+ var height = img.height;
+ var width = img.width;
+
+ if(width / this.size.w < height / this.size.h){
+ // Fit the height to the height of the canvas
+ img._baseHeight = this.canvas.height;
+ img._baseWidth = width / (height / this.size.h);
+ }else{
+ // Fix the width to the width of the canvas
+ img._baseWidth = this.canvas.width;
+ img._baseHeight = height / (width / this.size.w);
+ }
+ img._centerX = width / 2;
+ img._centerY = height / 2;
+
+ this.render();
+
+ this.onLoad(img._type, img._src, img._isSmall);
+ },
+
+ onLoad: function(type, url, isSmall){
+ // summary:
+ // Dummy function that is called whenever an image loads.
+ // type: String
+ // The position of the image that has loaded, either
+ // "center", "left" or "right"
+ // url: String
+ // The src of the image
+ // isSmall: Boolean
+ // True if it is a small version of the image that has loaded,
+ // false otherwise.
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/mobile/app/ImageView.xd.js b/js/dojo-1.6/dojox/mobile/app/ImageView.xd.js
new file mode 100644
index 0000000..9f4226f
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/ImageView.xd.js
@@ -0,0 +1,733 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.mobile.app.ImageView"],
+["require", "dojox.mobile.app._Widget"],
+["require", "dojo.fx.easing"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.mobile.app.ImageView"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.ImageView"] = true;
+dojo.provide("dojox.mobile.app.ImageView");
+dojo.experimental("dojox.mobile.app.ImageView");
+dojo.require("dojox.mobile.app._Widget");
+
+dojo.require("dojo.fx.easing");
+
+dojo.declare("dojox.mobile.app.ImageView", dojox.mobile.app._Widget, {
+
+ // zoom: Number
+ // The current level of zoom. This should not be set manually.
+ zoom: 1,
+
+ // zoomCenterX: Number
+ // The X coordinate in the image where the zoom is focused
+ zoomCenterX: 0,
+
+ // zoomCenterY: Number
+ // The Y coordinate in the image where the zoom is focused
+ zoomCenterY: 0,
+
+ // maxZoom: Number
+ // The highest degree to which an image can be zoomed. For example,
+ // a maxZoom of 5 means that the image will be 5 times larger than normal
+ maxZoom: 5,
+
+ // autoZoomLevel: Number
+ // The degree to which the image is zoomed when auto zoom is invoked.
+ // The higher the number, the more the image is zoomed in.
+ autoZoomLevel: 3,
+
+ // disableAutoZoom: Boolean
+ // Disables auto zoom
+ disableAutoZoom: false,
+
+ // disableSwipe: Boolean
+ // Disables the users ability to swipe from one image to the next.
+ disableSwipe: false,
+
+ // autoZoomEvent: String
+ // Overrides the default event listened to which invokes auto zoom
+ autoZoomEvent: null,
+
+ // _leftImg: Node
+ // The full sized image to the left
+ _leftImg: null,
+
+ // _centerImg: Node
+ // The full sized image in the center
+ _centerImg: null,
+
+ // _rightImg: Node
+ // The full sized image to the right
+ _rightImg: null,
+
+ // _leftImg: Node
+ // The small sized image to the left
+ _leftSmallImg: null,
+
+ // _centerImg: Node
+ // The small sized image in the center
+ _centerSmallImg: null,
+
+ // _rightImg: Node
+ // The small sized image to the right
+ _rightSmallImg: null,
+
+ constructor: function(){
+
+ this.panX = 0;
+ this.panY = 0;
+
+ this.handleLoad = dojo.hitch(this, this.handleLoad);
+ this._updateAnimatedZoom = dojo.hitch(this, this._updateAnimatedZoom);
+ this._updateAnimatedPan = dojo.hitch(this, this._updateAnimatedPan);
+ this._onAnimPanEnd = dojo.hitch(this, this._onAnimPanEnd);
+ },
+
+ buildRendering: function(){
+ this.inherited(arguments);
+
+ this.canvas = dojo.create("canvas", {}, this.domNode);
+
+ dojo.addClass(this.domNode, "mblImageView");
+ },
+
+ postCreate: function(){
+ this.inherited(arguments);
+
+ this.size = dojo.marginBox(this.domNode);
+
+ dojo.style(this.canvas, {
+ width: this.size.w + "px",
+ height: this.size.h + "px"
+ });
+ this.canvas.height = this.size.h;
+ this.canvas.width = this.size.w;
+
+ var _this = this;
+
+ // Listen to the mousedown/touchstart event. Record the position
+ // so we can use it to pan the image.
+ this.connect(this.domNode, "onmousedown", function(event){
+ if(_this.isAnimating()){
+ return;
+ }
+ if(_this.panX){
+ _this.handleDragEnd();
+ }
+
+ _this.downX = event.targetTouches ? event.targetTouches[0].clientX : event.clientX;
+ _this.downY = event.targetTouches ? event.targetTouches[0].clientY : event.clientY;
+ });
+
+ // record the movement of the mouse.
+ this.connect(this.domNode, "onmousemove", function(event){
+ if(_this.isAnimating()){
+ return;
+ }
+ if((!_this.downX && _this.downX !== 0) || (!_this.downY && _this.downY !== 0)){
+ // If the touch didn't begin on this widget, ignore the movement
+ return;
+ }
+
+ if((!_this.disableSwipe && _this.zoom == 1)
+ || (!_this.disableAutoZoom && _this.zoom != 1)){
+ var x = event.targetTouches ?
+ event.targetTouches[0].clientX : event.pageX;
+ var y = event.targetTouches ?
+ event.targetTouches[0].clientY : event.pageY;
+
+ _this.panX = x - _this.downX;
+ _this.panY = y - _this.downY;
+
+ if(_this.zoom == 1){
+ // If not zoomed in, then try to move to the next or prev image
+ // but only if the mouse has moved more than 10 pixels
+ // in the X direction
+ if(Math.abs(_this.panX) > 10){
+ _this.render();
+ }
+ }else{
+ // If zoomed in, pan the image if the mouse has moved more
+ // than 10 pixels in either direction.
+ if(Math.abs(_this.panX) > 10 || Math.abs(_this.panY) > 10){
+ _this.render();
+ }
+ }
+ }
+ });
+
+ this.connect(this.domNode, "onmouseout", function(event){
+ if(!_this.isAnimating() && _this.panX){
+ _this.handleDragEnd();
+ }
+ });
+
+ this.connect(this.domNode, "onmouseover", function(event){
+ _this.downX = _this.downY = null;
+ });
+
+ // Set up AutoZoom, which zooms in a fixed amount when the user taps
+ // a part of the canvas
+ this.connect(this.domNode, "onclick", function(event){
+ if(_this.isAnimating()){
+ return;
+ }
+ if(_this.downX == null || _this.downY == null){
+ return;
+ }
+
+ var x = (event.targetTouches ?
+ event.targetTouches[0].clientX : event.pageX);
+ var y = (event.targetTouches ?
+ event.targetTouches[0].clientY : event.pageY);
+
+ // If the mouse/finger has moved more than 14 pixels from where it
+ // started, do not treat it as a click. It is a drag.
+ if(Math.abs(_this.panX) > 14 || Math.abs(_this.panY) > 14){
+ _this.downX = _this.downY = null;
+ _this.handleDragEnd();
+ return;
+ }
+ _this.downX = _this.downY = null;
+
+ if(!_this.disableAutoZoom){
+
+ if(!_this._centerImg || !_this._centerImg._loaded){
+ // Do nothing until the image is loaded
+ return;
+ }
+ if(_this.zoom != 1){
+ _this.set("animatedZoom", 1);
+ return;
+ }
+
+ var pos = dojo._abs(_this.domNode);
+
+ // Translate the clicked point to a point on the source image
+ var xRatio = _this.size.w / _this._centerImg.width;
+ var yRatio = _this.size.h / _this._centerImg.height;
+
+ // Do an animated zoom to the point which was clicked.
+ _this.zoomTo(
+ ((x - pos.x) / xRatio) - _this.panX,
+ ((y - pos.y) / yRatio) - _this.panY,
+ _this.autoZoomLevel);
+ }
+ });
+
+ // Listen for Flick events
+ dojo.connect(this.domNode, "flick", this, "handleFlick");
+ },
+
+ isAnimating: function(){
+ // summary:
+ // Returns true if an animation is in progress, false otherwise.
+ return this._anim && this._anim.status() == "playing";
+ },
+
+ handleDragEnd: function(){
+ // summary:
+ // Handles the end of a dragging event. If not zoomed in, it
+ // determines if the next or previous image should be transitioned
+ // to.
+ this.downX = this.downY = null;
+ console.log("handleDragEnd");
+
+ if(this.zoom == 1){
+ if(!this.panX){
+ return;
+ }
+
+ var leftLoaded = (this._leftImg && this._leftImg._loaded)
+ || (this._leftSmallImg && this._leftSmallImg._loaded);
+ var rightLoaded = (this._rightImg && this._rightImg._loaded)
+ || (this._rightSmallImg && this._rightSmallImg._loaded);
+
+ // Check if the drag has moved the image more than half its length.
+ // If so, move to either the previous or next image.
+ var doMove =
+ !(Math.abs(this.panX) < this._centerImg._baseWidth / 2) &&
+ (
+ (this.panX > 0 && leftLoaded ? 1 : 0) ||
+ (this.panX < 0 && rightLoaded ? 1 : 0)
+ );
+
+
+ if(!doMove){
+ // If not moving to another image, animate the sliding of the
+ // image back into place.
+ this._animPanTo(0, dojo.fx.easing.expoOut, 700);
+ }else{
+ // Move to another image.
+ this.moveTo(this.panX);
+ }
+ }else{
+ if(!this.panX && !this.panY){
+ return;
+ }
+ // Recenter the zoomed image based on where it was panned to
+ // previously
+ this.zoomCenterX -= (this.panX / this.zoom);
+ this.zoomCenterY -= (this.panY / this.zoom);
+
+ this.panX = this.panY = 0;
+ }
+
+ },
+
+ handleFlick: function(event){
+ // summary:
+ // Handle a flick event.
+ if(this.zoom == 1 && event.duration < 500){
+ // Only handle quick flicks here, less than 0.5 seconds
+
+ // If not zoomed in, then check if we should move to the next photo
+ // or not
+ if(event.direction == "ltr"){
+ this.moveTo(1);
+ }else if(event.direction == "rtl"){
+ this.moveTo(-1);
+ }
+ // If an up or down flick occurs, it means nothing so ignore it
+ this.downX = this.downY = null;
+ }
+ },
+
+ moveTo: function(direction){
+ direction = direction > 0 ? 1 : -1;
+ var toImg;
+
+ if(direction < 1){
+ if(this._rightImg && this._rightImg._loaded){
+ toImg = this._rightImg;
+ }else if(this._rightSmallImg && this._rightSmallImg._loaded){
+ toImg = this._rightSmallImg;
+ }
+ }else{
+ if(this._leftImg && this._leftImg._loaded){
+ toImg = this._leftImg;
+ }else if(this._leftSmallImg && this._leftSmallImg._loaded){
+ toImg = this._leftSmallImg;
+ }
+ }
+
+ this._moveDir = direction;
+ var _this = this;
+
+ if(toImg && toImg._loaded){
+ // If the image is loaded, make a linear animation to show it
+ this._animPanTo(this.size.w * direction, null, 500, function(){
+ _this.panX = 0;
+ _this.panY = 0;
+
+ if(direction < 0){
+ // Moving to show the right image
+ _this._switchImage("left", "right");
+ }else{
+ // Moving to show the left image
+ _this._switchImage("right", "left");
+ }
+
+ _this.render();
+ _this.onChange(direction * -1);
+ });
+
+ }else{
+ // If the next image is not loaded, make an animation to
+ // move the center image to half the width of the widget and back
+ // again
+
+ console.log("moveTo image not loaded!", toImg);
+
+ this._animPanTo(0, dojo.fx.easing.expoOut, 700);
+ }
+ },
+
+ _switchImage: function(toImg, fromImg){
+ var toSmallImgName = "_" + toImg + "SmallImg";
+ var toImgName = "_" + toImg + "Img";
+
+ var fromSmallImgName = "_" + fromImg + "SmallImg";
+ var fromImgName = "_" + fromImg + "Img";
+
+ this[toImgName] = this._centerImg;
+ this[toSmallImgName] = this._centerSmallImg;
+
+ this[toImgName]._type = toImg;
+
+ if(this[toSmallImgName]){
+ this[toSmallImgName]._type = toImg;
+ }
+
+ this._centerImg = this[fromImgName];
+ this._centerSmallImg = this[fromSmallImgName];
+ this._centerImg._type = "center";
+
+ if(this._centerSmallImg){
+ this._centerSmallImg._type = "center";
+ }
+ this[fromImgName] = this[fromSmallImgName] = null;
+ },
+
+ _animPanTo: function(to, easing, duration, callback){
+ this._animCallback = callback;
+ this._anim = new dojo.Animation({
+ curve: [this.panX, to],
+ onAnimate: this._updateAnimatedPan,
+ duration: duration || 500,
+ easing: easing,
+ onEnd: this._onAnimPanEnd
+ });
+
+ this._anim.play();
+ return this._anim;
+ },
+
+ onChange: function(direction){
+ // summary:
+ // Stub function that can be listened to in order to provide
+ // new images when the displayed image changes
+ },
+
+ _updateAnimatedPan: function(amount){
+ this.panX = amount;
+ this.render();
+ },
+
+ _onAnimPanEnd: function(){
+ this.panX = this.panY = 0;
+
+ if(this._animCallback){
+ this._animCallback();
+ }
+ },
+
+ zoomTo: function(centerX, centerY, zoom){
+ this.set("zoomCenterX", centerX);
+ this.set("zoomCenterY", centerY);
+
+ this.set("animatedZoom", zoom);
+ },
+
+ render: function(){
+ var cxt = this.canvas.getContext('2d');
+
+ cxt.clearRect(0, 0, this.canvas.width, this.canvas.height);
+
+ // Render the center image
+ this._renderImg(
+ this._centerSmallImg,
+ this._centerImg,
+ this.zoom == 1 ? (this.panX < 0 ? 1 : this.panX > 0 ? -1 : 0) : 0);
+
+ if(this.zoom == 1 && this.panX != 0){
+ if(this.panX > 0){
+ // Render the left image, showing the right side of it
+ this._renderImg(this._leftSmallImg, this._leftImg, 1);
+ }else{
+ // Render the right image, showing the left side of it
+ this._renderImg(this._rightSmallImg, this._rightImg, -1);
+ }
+ }
+ },
+
+ _renderImg: function(smallImg, largeImg, panDir){
+ // summary:
+ // Renders a single image
+
+
+ // If zoomed, we just display the center img
+ var img = (largeImg && largeImg._loaded) ? largeImg : smallImg;
+
+ if(!img || !img._loaded){
+ // If neither the large or small image is loaded, display nothing
+ return;
+ }
+ var cxt = this.canvas.getContext('2d');
+
+ var baseWidth = img._baseWidth;
+ var baseHeight = img._baseHeight;
+
+ // Calculate the size the image would be if there were no bounds
+ var desiredWidth = baseWidth * this.zoom;
+ var desiredHeight = baseHeight * this.zoom;
+
+ // Calculate the actual size of the viewable image
+ var destWidth = Math.min(this.size.w, desiredWidth);
+ var destHeight = Math.min(this.size.h, desiredHeight);
+
+
+ // Calculate the size of the window on the original image to use
+ var sourceWidth = this.dispWidth = img.width * (destWidth / desiredWidth);
+ var sourceHeight = this.dispHeight = img.height * (destHeight / desiredHeight);
+
+ var zoomCenterX = this.zoomCenterX - (this.panX / this.zoom);
+ var zoomCenterY = this.zoomCenterY - (this.panY / this.zoom);
+
+ // Calculate where the center of the view should be
+ var centerX = Math.floor(Math.max(sourceWidth / 2,
+ Math.min(img.width - sourceWidth / 2, zoomCenterX)));
+ var centerY = Math.floor(Math.max(sourceHeight / 2,
+ Math.min(img.height - sourceHeight / 2, zoomCenterY)));
+
+
+ var sourceX = Math.max(0,
+ Math.round((img.width - sourceWidth)/2 + (centerX - img._centerX)) );
+ var sourceY = Math.max(0,
+ Math.round((img.height - sourceHeight) / 2 + (centerY - img._centerY))
+ );
+
+ var destX = Math.round(Math.max(0, this.canvas.width - destWidth)/2);
+ var destY = Math.round(Math.max(0, this.canvas.height - destHeight)/2);
+
+ var oldDestWidth = destWidth;
+ var oldSourceWidth = sourceWidth;
+
+ if(this.zoom == 1 && panDir && this.panX){
+
+ if(this.panX < 0){
+ if(panDir > 0){
+ // If the touch is moving left, and the right side of the
+ // image should be shown, then reduce the destination width
+ // by the absolute value of panX
+ destWidth -= Math.abs(this.panX);
+ destX = 0;
+ }else if(panDir < 0){
+ // If the touch is moving left, and the left side of the
+ // image should be shown, then set the displayed width
+ // to the absolute value of panX, less some pixels for
+ // a padding between images
+ destWidth = Math.max(1, Math.abs(this.panX) - 5);
+ destX = this.size.w - destWidth;
+ }
+ }else{
+ if(panDir > 0){
+ // If the touch is moving right, and the right side of the
+ // image should be shown, then set the destination width
+ // to the absolute value of the pan, less some pixels for
+ // padding
+ destWidth = Math.max(1, Math.abs(this.panX) - 5);
+ destX = 0;
+ }else if(panDir < 0){
+ // If the touch is moving right, and the left side of the
+ // image should be shown, then reduce the destination width
+ // by the widget width minus the absolute value of panX
+ destWidth -= Math.abs(this.panX);
+ destX = this.size.w - destWidth;
+ }
+ }
+
+ sourceWidth = Math.max(1,
+ Math.floor(sourceWidth * (destWidth / oldDestWidth)));
+
+ if(panDir > 0){
+ // If the right side of the image should be displayed, move
+ // the sourceX to be the width of the image minus the difference
+ // between the original sourceWidth and the new sourceWidth
+ sourceX = (sourceX + oldSourceWidth) - (sourceWidth);
+ }
+ sourceX = Math.floor(sourceX);
+ }
+
+ try{
+
+ // See https://developer.mozilla.org/en/Canvas_tutorial/Using_images
+ cxt.drawImage(
+ img,
+ Math.max(0, sourceX),
+ sourceY,
+ Math.min(oldSourceWidth, sourceWidth),
+ sourceHeight,
+ destX, // Xpos
+ destY, // Ypos
+ Math.min(oldDestWidth, destWidth),
+ destHeight
+ );
+ }catch(e){
+ console.log("Caught Error",e,
+
+ "type=", img._type,
+ "oldDestWidth = ", oldDestWidth,
+ "destWidth", destWidth,
+ "destX", destX
+ , "oldSourceWidth=",oldSourceWidth,
+ "sourceWidth=", sourceWidth,
+ "sourceX = " + sourceX
+ );
+ }
+ },
+
+ _setZoomAttr: function(amount){
+ this.zoom = Math.min(this.maxZoom, Math.max(1, amount));
+
+ if(this.zoom == 1
+ && this._centerImg
+ && this._centerImg._loaded){
+
+ if(!this.isAnimating()){
+ this.zoomCenterX = this._centerImg.width / 2;
+ this.zoomCenterY = this._centerImg.height / 2;
+ }
+ this.panX = this.panY = 0;
+ }
+
+ this.render();
+ },
+
+ _setZoomCenterXAttr: function(value){
+ if(value != this.zoomCenterX){
+ if(this._centerImg && this._centerImg._loaded){
+ value = Math.min(this._centerImg.width, value);
+ }
+ this.zoomCenterX = Math.max(0, Math.round(value));
+ }
+ },
+
+ _setZoomCenterYAttr: function(value){
+ if(value != this.zoomCenterY){
+ if(this._centerImg && this._centerImg._loaded){
+ value = Math.min(this._centerImg.height, value);
+ }
+ this.zoomCenterY = Math.max(0, Math.round(value));
+ }
+ },
+
+ _setZoomCenterAttr: function(value){
+ if(value.x != this.zoomCenterX || value.y != this.zoomCenterY){
+ this.set("zoomCenterX", value.x);
+ this.set("zoomCenterY", value.y);
+ this.render();
+ }
+ },
+
+ _setAnimatedZoomAttr: function(amount){
+ if(this._anim && this._anim.status() == "playing"){
+ return;
+ }
+
+ this._anim = new dojo.Animation({
+ curve: [this.zoom, amount],
+ onAnimate: this._updateAnimatedZoom,
+ onEnd: this._onAnimEnd
+ });
+
+ this._anim.play();
+ },
+
+ _updateAnimatedZoom: function(amount){
+ this._setZoomAttr(amount);
+ },
+
+ _setCenterUrlAttr: function(urlOrObj){
+ this._setImage("center", urlOrObj);
+ },
+ _setLeftUrlAttr: function(urlOrObj){
+ this._setImage("left", urlOrObj);
+ },
+ _setRightUrlAttr: function(urlOrObj){
+ this._setImage("right", urlOrObj);
+ },
+
+ _setImage: function(name, urlOrObj){
+ var smallUrl = null;
+
+ var largeUrl = null;
+
+ if(dojo.isString(urlOrObj)){
+ // If the argument is a string, then just load the large url
+ largeUrl = urlOrObj;
+ }else{
+ largeUrl = urlOrObj.large;
+ smallUrl = urlOrObj.small;
+ }
+
+ if(this["_" + name + "Img"] && this["_" + name + "Img"]._src == largeUrl){
+ // Identical URL, ignore it
+ return;
+ }
+
+ // Just do the large image for now
+ var largeImg = this["_" + name + "Img"] = new Image();
+ largeImg._type = name;
+ largeImg._loaded = false;
+ largeImg._src = largeUrl;
+ largeImg._conn = dojo.connect(largeImg, "onload", this.handleLoad);
+
+ if(smallUrl){
+ // If a url to a small version of the image has been provided,
+ // load that image first.
+ var smallImg = this["_" + name + "SmallImg"] = new Image();
+ smallImg._type = name;
+ smallImg._loaded = false;
+ smallImg._conn = dojo.connect(smallImg, "onload", this.handleLoad);
+ smallImg._isSmall = true;
+ smallImg._src = smallUrl;
+ smallImg.src = smallUrl;
+ }
+
+ // It's important that the large url's src is set after the small image
+ // to ensure it's loaded second.
+ largeImg.src = largeUrl;
+ },
+
+ handleLoad: function(evt){
+ // summary:
+ // Handles the loading of an image, both the large and small
+ // versions. A render is triggered as a result of each image load.
+
+ var img = evt.target;
+ img._loaded = true;
+
+ dojo.disconnect(img._conn);
+
+ var type = img._type;
+
+ switch(type){
+ case "center":
+ this.zoomCenterX = img.width / 2;
+ this.zoomCenterY = img.height / 2;
+ break;
+ }
+
+ var height = img.height;
+ var width = img.width;
+
+ if(width / this.size.w < height / this.size.h){
+ // Fit the height to the height of the canvas
+ img._baseHeight = this.canvas.height;
+ img._baseWidth = width / (height / this.size.h);
+ }else{
+ // Fix the width to the width of the canvas
+ img._baseWidth = this.canvas.width;
+ img._baseHeight = height / (width / this.size.w);
+ }
+ img._centerX = width / 2;
+ img._centerY = height / 2;
+
+ this.render();
+
+ this.onLoad(img._type, img._src, img._isSmall);
+ },
+
+ onLoad: function(type, url, isSmall){
+ // summary:
+ // Dummy function that is called whenever an image loads.
+ // type: String
+ // The position of the image that has loaded, either
+ // "center", "left" or "right"
+ // url: String
+ // The src of the image
+ // isSmall: Boolean
+ // True if it is a small version of the image that has loaded,
+ // false otherwise.
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/mobile/app/List.js b/js/dojo-1.6/dojox/mobile/app/List.js
new file mode 100644
index 0000000..b2bcc0b
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/List.js
@@ -0,0 +1,656 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.mobile.app.List"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.List"] = true;
+dojo.provide("dojox.mobile.app.List");
+dojo.experimental("dojox.mobile.app.List");
+
+dojo.require("dojo.string");
+dojo.require("dijit._WidgetBase");
+
+(function(){
+
+ var templateCache = {};
+
+ dojo.declare("dojox.mobile.app.List", dijit._WidgetBase, {
+ // summary:
+ // A templated list widget. Given a simple array of data objects
+ // and a HTML template, it renders a list of elements, with
+ // support for a swipe delete action. An optional template
+ // can be provided for when the list is empty.
+
+ // items: Array
+ // The array of data items that will be rendered.
+ items: null,
+
+ // itemTemplate: String
+ // The URL to the HTML file containing the markup for each individual
+ // data item.
+ itemTemplate: "",
+
+ // emptyTemplate: String
+ // The URL to the HTML file containing the HTML to display if there
+ // are no data items. This is optional.
+ emptyTemplate: "",
+
+ // dividerTemplate: String
+ // The URL to the HTML file containing the markup for the dividers
+ // between groups of list items
+ dividerTemplate: "",
+
+ // dividerFunction: Function
+ // Function to create divider elements. This should return a divider
+ // value for each item in the list
+ dividerFunction: null,
+
+ // labelDelete: String
+ // The label to display for the Delete button
+ labelDelete: "Delete",
+
+ // labelCancel: String
+ // The label to display for the Cancel button
+ labelCancel: "Cancel",
+
+ // controller: Object
+ //
+ controller: null,
+
+ // autoDelete: Boolean
+ autoDelete: true,
+
+ // enableDelete: Boolean
+ enableDelete: true,
+
+ // enableHold: Boolean
+ enableHold: true,
+
+ // formatters: Object
+ // A name/value map of functions used to format data for display
+ formatters: null,
+
+ // _templateLoadCount: Number
+ // The number of templates remaining to load before the list renders.
+ _templateLoadCount: 0,
+
+ // _mouseDownPos: Object
+ // The coordinates of where a mouseDown event was detected
+ _mouseDownPos: null,
+
+ baseClass: "list",
+
+ constructor: function(){
+ this._checkLoadComplete = dojo.hitch(this, this._checkLoadComplete);
+ this._replaceToken = dojo.hitch(this, this._replaceToken);
+ this._postDeleteAnim = dojo.hitch(this, this._postDeleteAnim);
+ },
+
+ postCreate: function(){
+
+ var _this = this;
+
+ if(this.emptyTemplate){
+ this._templateLoadCount++;
+ }
+ if(this.itemTemplate){
+ this._templateLoadCount++;
+ }
+ if(this.dividerTemplate){
+ this._templateLoadCount++;
+ }
+
+ this.connect(this.domNode, "onmousedown", function(event){
+ var touch = event;
+ if(event.targetTouches && event.targetTouches.length > 0){
+ touch = event.targetTouches[0];
+ }
+
+ // Find the node that was tapped/clicked
+ var rowNode = _this._getRowNode(event.target);
+
+ if(rowNode){
+ // Add the rows data to the event so it can be picked up
+ // by any listeners
+ _this._setDataInfo(rowNode, event);
+
+ // Select and highlight the row
+ _this._selectRow(rowNode);
+
+ // Record the position that was tapped
+ _this._mouseDownPos = {
+ x: touch.pageX,
+ y: touch.pageY
+ };
+ _this._dragThreshold = null;
+ }
+ });
+
+ this.connect(this.domNode, "onmouseup", function(event){
+ // When the mouse/finger comes off the list,
+ // call the onSelect function and deselect the row.
+ if(event.targetTouches && event.targetTouches.length > 0){
+ event = event.targetTouches[0];
+ }
+ var rowNode = _this._getRowNode(event.target);
+
+ if(rowNode){
+
+ _this._setDataInfo(rowNode, event);
+
+ if(_this._selectedRow){
+ _this.onSelect(rowNode._data, rowNode._idx, rowNode);
+ }
+
+ this._deselectRow();
+ }
+ });
+
+ // If swipe-to-delete is enabled, listen for the mouse moving
+ if(this.enableDelete){
+ this.connect(this.domNode, "mousemove", function(event){
+ dojo.stopEvent(event);
+ if(!_this._selectedRow){
+ return;
+ }
+ var rowNode = _this._getRowNode(event.target);
+
+ // Still check for enableDelete in case it's changed after
+ // this listener is added.
+ if(_this.enableDelete && rowNode && !_this._deleting){
+ _this.handleDrag(event);
+ }
+ });
+ }
+
+ // Put the data and index onto each onclick event.
+ this.connect(this.domNode, "onclick", function(event){
+ if(event.touches && event.touches.length > 0){
+ event = event.touches[0];
+ }
+ var rowNode = _this._getRowNode(event.target, true);
+
+ if(rowNode){
+ _this._setDataInfo(rowNode, event);
+ }
+ });
+
+ // If the mouse or finger moves off the selected row,
+ // deselect it.
+ this.connect(this.domNode, "mouseout", function(event){
+ if(event.touches && event.touches.length > 0){
+ event = event.touches[0];
+ }
+ if(event.target == _this._selectedRow){
+ _this._deselectRow();
+ }
+ });
+
+ // If no item template has been provided, it is an error.
+ if(!this.itemTemplate){
+ throw Error("An item template must be provided to " + this.declaredClass);
+ }
+
+ // Load the item template
+ this._loadTemplate(this.itemTemplate, "itemTemplate", this._checkLoadComplete);
+
+ if(this.emptyTemplate){
+ // If the optional empty template has been provided, load it.
+ this._loadTemplate(this.emptyTemplate, "emptyTemplate", this._checkLoadComplete);
+ }
+
+ if(this.dividerTemplate){
+ this._loadTemplate(this.dividerTemplate, "dividerTemplate", this._checkLoadComplete);
+ }
+ },
+
+ handleDrag: function(event){
+ // summary:
+ // Handles rows being swiped for deletion.
+ var touch = event;
+ if(event.targetTouches && event.targetTouches.length > 0){
+ touch = event.targetTouches[0];
+ }
+
+ // Get the distance that the mouse or finger has moved since
+ // beginning the swipe action.
+ var diff = touch.pageX - this._mouseDownPos.x;
+
+ var absDiff = Math.abs(diff);
+ if(absDiff > 10 && !this._dragThreshold){
+ // Make the user drag the row 60% of the width to remove it
+ this._dragThreshold = dojo.marginBox(this._selectedRow).w * 0.6;
+ if(!this.autoDelete){
+ this.createDeleteButtons(this._selectedRow);
+ }
+ }
+
+ this._selectedRow.style.left = (absDiff > 10 ? diff : 0) + "px";
+
+ // If the user has dragged the row more than the threshold, slide
+ // it off the screen in preparation for deletion.
+ if(this._dragThreshold && this._dragThreshold < absDiff){
+ this.preDelete(diff);
+ }
+ },
+
+ handleDragCancel: function(){
+ // summary:
+ // Handle a drag action being cancelled, for whatever reason.
+ // Reset handles, remove CSS classes etc.
+ if(this._deleting){
+ return;
+ }
+ dojo.removeClass(this._selectedRow, "hold");
+ this._selectedRow.style.left = 0;
+ this._mouseDownPos = null;
+ this._dragThreshold = null;
+
+ this._deleteBtns && dojo.style(this._deleteBtns, "display", "none");
+ },
+
+ preDelete: function(currentLeftPos){
+ // summary:
+ // Slides the row offscreen before it is deleted
+
+ // TODO: do this with CSS3!
+ var self = this;
+
+ this._deleting = true;
+
+ dojo.animateProperty({
+ node: this._selectedRow,
+ duration: 400,
+ properties: {
+ left: {
+ end: currentLeftPos +
+ ((currentLeftPos > 0 ? 1 : -1) * this._dragThreshold * 0.8)
+ }
+ },
+ onEnd: dojo.hitch(this, function(){
+ if(this.autoDelete){
+ this.deleteRow(this._selectedRow);
+ }
+ })
+ }).play();
+ },
+
+ deleteRow: function(row){
+
+ // First make the row invisible
+ // Put it back where it came from
+ dojo.style(row, {
+ visibility: "hidden",
+ minHeight: "0px"
+ });
+ dojo.removeClass(row, "hold");
+
+ this._deleteAnimConn =
+ this.connect(row, "webkitAnimationEnd", this._postDeleteAnim);
+
+ dojo.addClass(row, "collapsed");
+ },
+
+ _postDeleteAnim: function(event){
+ // summary:
+ // Completes the deletion of a row.
+
+ if(this._deleteAnimConn){
+ this.disconnect(this._deleteAnimConn);
+ this._deleteAnimConn = null;
+ }
+
+ var row = this._selectedRow;
+ var sibling = row.nextSibling;
+ var prevSibling = row.previousSibling;
+
+ // If the previous node is a divider and either this is
+ // the last element in the list, or the next node is
+ // also a divider, remove the divider for the deleted section.
+ if(prevSibling && prevSibling._isDivider){
+ if(!sibling || sibling._isDivider){
+ prevSibling.parentNode.removeChild(prevSibling);
+ }
+ }
+
+ row.parentNode.removeChild(row);
+ this.onDelete(row._data, row._idx, this.items);
+
+ // Decrement the index of each following row
+ while(sibling){
+ if(sibling._idx){
+ sibling._idx--;
+ }
+ sibling = sibling.nextSibling;
+ }
+
+ dojo.destroy(row);
+
+ // Fix up the 'first' and 'last' CSS classes on the rows
+ dojo.query("> *:not(.buttons)", this.domNode).forEach(this.applyClass);
+
+ this._deleting = false;
+ this._deselectRow();
+ },
+
+ createDeleteButtons: function(aroundNode){
+ // summary:
+ // Creates the two buttons displayed when confirmation is
+ // required before deletion of a row.
+ // aroundNode:
+ // The DOM node of the row about to be deleted.
+ var mb = dojo.marginBox(aroundNode);
+ var pos = dojo._abs(aroundNode, true);
+
+ if(!this._deleteBtns){
+ // Create the delete buttons.
+ this._deleteBtns = dojo.create("div",{
+ "class": "buttons"
+ }, this.domNode);
+
+ this.buttons = [];
+
+ this.buttons.push(new dojox.mobile.Button({
+ btnClass: "mblRedButton",
+ label: this.labelDelete
+ }));
+ this.buttons.push(new dojox.mobile.Button({
+ btnClass: "mblBlueButton",
+ label: this.labelCancel
+ }));
+
+ dojo.place(this.buttons[0].domNode, this._deleteBtns);
+ dojo.place(this.buttons[1].domNode, this._deleteBtns);
+
+ dojo.addClass(this.buttons[0].domNode, "deleteBtn");
+ dojo.addClass(this.buttons[1].domNode, "cancelBtn");
+
+ this._handleButtonClick = dojo.hitch(this._handleButtonClick);
+ this.connect(this._deleteBtns, "onclick", this._handleButtonClick);
+ }
+ dojo.removeClass(this._deleteBtns, "fade out fast");
+ dojo.style(this._deleteBtns, {
+ display: "",
+ width: mb.w + "px",
+ height: mb.h + "px",
+ top: (aroundNode.offsetTop) + "px",
+ left: "0px"
+ });
+ },
+
+ onDelete: function(data, index, array){
+ // summary:
+ // Called when a row is deleted
+ // data:
+ // The data related to the row being deleted
+ // index:
+ // The index of the data in the total array
+ // array:
+ // The array of data used.
+
+ array.splice(index, 1);
+
+ // If the data is empty, rerender in case an emptyTemplate has
+ // been provided
+ if(array.length < 1){
+ this.render();
+ }
+ },
+
+ cancelDelete: function(){
+ // summary:
+ // Cancels the deletion of a row.
+ this._deleting = false;
+ this.handleDragCancel();
+ },
+
+ _handleButtonClick: function(event){
+ // summary:
+ // Handles the click of one of the deletion buttons, either to
+ // delete the row or to cancel the deletion.
+ if(event.touches && event.touches.length > 0){
+ event = event.touches[0];
+ }
+ var node = event.target;
+ if(dojo.hasClass(node, "deleteBtn")){
+ this.deleteRow(this._selectedRow);
+ }else if(dojo.hasClass(node, "cancelBtn")){
+ this.cancelDelete();
+ }else{
+ return;
+ }
+ dojo.addClass(this._deleteBtns, "fade out");
+ },
+
+ applyClass: function(node, idx, array){
+ // summary:
+ // Applies the 'first' and 'last' CSS classes to the relevant
+ // rows.
+
+ dojo.removeClass(node, "first last");
+ if(idx == 0){
+ dojo.addClass(node, "first");
+ }
+ if(idx == array.length - 1){
+ dojo.addClass(node, "last");
+ }
+ },
+
+ _setDataInfo: function(rowNode, event){
+ // summary:
+ // Attaches the data item and index for each row to any event
+ // that occurs on that row.
+ event.item = rowNode._data;
+ event.index = rowNode._idx;
+ },
+
+ onSelect: function(data, index, rowNode){
+ // summary:
+ // Dummy function that is called when a row is tapped
+ },
+
+ _selectRow: function(row){
+ // summary:
+ // Selects a row, applies the relevant CSS classes.
+ if(this._deleting && this._selectedRow && row != this._selectedRow){
+ this.cancelDelete();
+ }
+
+ if(!dojo.hasClass(row, "row")){
+ return;
+ }
+ if(this.enableHold || this.enableDelete){
+ dojo.addClass(row, "hold");
+ }
+ this._selectedRow = row;
+ },
+
+ _deselectRow: function(){
+ // summary:
+ // Deselects a row, and cancels any drag actions that were
+ // occurring.
+ if(!this._selectedRow || this._deleting){
+ return;
+ }
+ this.handleDragCancel();
+ dojo.removeClass(this._selectedRow, "hold");
+ this._selectedRow = null;
+ },
+
+ _getRowNode: function(fromNode, ignoreNoClick){
+ // summary:
+ // Gets the DOM node of the row that is equal to or the parent
+ // of the node passed to this function.
+ while(fromNode && !fromNode._data && fromNode != this.domNode){
+ if(!ignoreNoClick && dojo.hasClass(fromNode, "noclick")){
+ return null;
+ }
+ fromNode = fromNode.parentNode;
+ }
+ return fromNode == this.domNode ? null : fromNode;
+ },
+
+ applyTemplate: function(template, data){
+ return dojo._toDom(dojo.string.substitute(
+ template, data, this._replaceToken, this.formatters || this));
+ },
+
+ render: function(){
+ // summary:
+ // Renders the list.
+
+ // Delete all existing nodes, except the deletion buttons.
+ dojo.query("> *:not(.buttons)", this.domNode).forEach(dojo.destroy);
+
+ // If there is no data, and an empty template has been provided,
+ // render it.
+ if(this.items.length < 1 && this.emptyTemplate){
+ dojo.place(dojo._toDom(this.emptyTemplate), this.domNode, "first");
+ }else{
+ this.domNode.appendChild(this._renderRange(0, this.items.length));
+ }
+ if(dojo.hasClass(this.domNode.parentNode, "mblRoundRect")){
+ dojo.addClass(this.domNode.parentNode, "mblRoundRectList")
+ }
+
+ var divs = dojo.query("> .row", this.domNode);
+ if(divs.length > 0){
+ dojo.addClass(divs[0], "first");
+ dojo.addClass(divs[divs.length - 1], "last");
+ }
+ },
+
+ _renderRange: function(startIdx, endIdx){
+
+ var rows = [];
+ var row, i;
+ var frag = document.createDocumentFragment();
+ startIdx = Math.max(0, startIdx);
+ endIdx = Math.min(endIdx, this.items.length);
+
+ for(i = startIdx; i < endIdx; i++){
+ // Create a document fragment containing the templated row
+ row = this.applyTemplate(this.itemTemplate, this.items[i]);
+ dojo.addClass(row, 'row');
+ row._data = this.items[i];
+ row._idx = i;
+ rows.push(row);
+ }
+ if(!this.dividerFunction || !this.dividerTemplate){
+ for(i = startIdx; i < endIdx; i++){
+ rows[i]._data = this.items[i];
+ rows[i]._idx = i;
+ frag.appendChild(rows[i]);
+ }
+ }else{
+ var prevDividerValue = null;
+ var dividerValue;
+ var divider;
+ for(i = startIdx; i < endIdx; i++){
+ rows[i]._data = this.items[i];
+ rows[i]._idx = i;
+
+ dividerValue = this.dividerFunction(this.items[i]);
+ if(dividerValue && dividerValue != prevDividerValue){
+ divider = this.applyTemplate(this.dividerTemplate, {
+ label: dividerValue,
+ item: this.items[i]
+ });
+ divider._isDivider = true;
+ frag.appendChild(divider);
+ prevDividerValue = dividerValue;
+ }
+ frag.appendChild(rows[i]);
+ }
+ }
+ return frag;
+ },
+
+ _replaceToken: function(value, key){
+ if(key.charAt(0) == '!'){ value = dojo.getObject(key.substr(1), false, _this); }
+ if(typeof value == "undefined"){ return ""; } // a debugging aide
+ if(value == null){ return ""; }
+
+ // Substitution keys beginning with ! will skip the transform step,
+ // in case a user wishes to insert unescaped markup, e.g. ${!foo}
+ return key.charAt(0) == "!" ? value :
+ // Safer substitution, see heading "Attribute values" in
+ // http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.3.2
+ value.toString().replace(/"/g,"&quot;"); //TODO: add &amp? use encodeXML method?
+
+ },
+
+ _checkLoadComplete: function(){
+ // summary:
+ // Checks if all templates have loaded
+ this._templateLoadCount--;
+
+ if(this._templateLoadCount < 1 && this.get("items")){
+ this.render();
+ }
+ },
+
+ _loadTemplate: function(url, thisAttr, callback){
+ // summary:
+ // Loads a template
+ if(!url){
+ callback();
+ return;
+ }
+
+ if(templateCache[url]){
+ this.set(thisAttr, templateCache[url]);
+ callback();
+ }else{
+ var _this = this;
+
+ dojo.xhrGet({
+ url: url,
+ sync: false,
+ handleAs: "text",
+ load: function(text){
+ templateCache[url] = dojo.trim(text);
+ _this.set(thisAttr, templateCache[url]);
+ callback();
+ }
+ });
+ }
+ },
+
+
+ _setFormattersAttr: function(formatters){
+ // summary:
+ // Sets the data items, and causes a rerender of the list
+ this.formatters = formatters;
+ },
+
+ _setItemsAttr: function(items){
+ // summary:
+ // Sets the data items, and causes a rerender of the list
+
+ this.items = items || [];
+
+ if(this._templateLoadCount < 1 && items){
+ this.render();
+ }
+ },
+
+ destroy: function(){
+ if(this.buttons){
+ dojo.forEach(this.buttons, function(button){
+ button.destroy();
+ });
+ this.buttons = null;
+ }
+
+ this.inherited(arguments);
+ }
+
+ });
+
+})();
+
+}
diff --git a/js/dojo-1.6/dojox/mobile/app/List.xd.js b/js/dojo-1.6/dojox/mobile/app/List.xd.js
new file mode 100644
index 0000000..5b8481c
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/List.xd.js
@@ -0,0 +1,662 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.mobile.app.List"],
+["require", "dojo.string"],
+["require", "dijit._WidgetBase"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.mobile.app.List"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.List"] = true;
+dojo.provide("dojox.mobile.app.List");
+dojo.experimental("dojox.mobile.app.List");
+
+dojo.require("dojo.string");
+dojo.require("dijit._WidgetBase");
+
+(function(){
+
+ var templateCache = {};
+
+ dojo.declare("dojox.mobile.app.List", dijit._WidgetBase, {
+ // summary:
+ // A templated list widget. Given a simple array of data objects
+ // and a HTML template, it renders a list of elements, with
+ // support for a swipe delete action. An optional template
+ // can be provided for when the list is empty.
+
+ // items: Array
+ // The array of data items that will be rendered.
+ items: null,
+
+ // itemTemplate: String
+ // The URL to the HTML file containing the markup for each individual
+ // data item.
+ itemTemplate: "",
+
+ // emptyTemplate: String
+ // The URL to the HTML file containing the HTML to display if there
+ // are no data items. This is optional.
+ emptyTemplate: "",
+
+ // dividerTemplate: String
+ // The URL to the HTML file containing the markup for the dividers
+ // between groups of list items
+ dividerTemplate: "",
+
+ // dividerFunction: Function
+ // Function to create divider elements. This should return a divider
+ // value for each item in the list
+ dividerFunction: null,
+
+ // labelDelete: String
+ // The label to display for the Delete button
+ labelDelete: "Delete",
+
+ // labelCancel: String
+ // The label to display for the Cancel button
+ labelCancel: "Cancel",
+
+ // controller: Object
+ //
+ controller: null,
+
+ // autoDelete: Boolean
+ autoDelete: true,
+
+ // enableDelete: Boolean
+ enableDelete: true,
+
+ // enableHold: Boolean
+ enableHold: true,
+
+ // formatters: Object
+ // A name/value map of functions used to format data for display
+ formatters: null,
+
+ // _templateLoadCount: Number
+ // The number of templates remaining to load before the list renders.
+ _templateLoadCount: 0,
+
+ // _mouseDownPos: Object
+ // The coordinates of where a mouseDown event was detected
+ _mouseDownPos: null,
+
+ baseClass: "list",
+
+ constructor: function(){
+ this._checkLoadComplete = dojo.hitch(this, this._checkLoadComplete);
+ this._replaceToken = dojo.hitch(this, this._replaceToken);
+ this._postDeleteAnim = dojo.hitch(this, this._postDeleteAnim);
+ },
+
+ postCreate: function(){
+
+ var _this = this;
+
+ if(this.emptyTemplate){
+ this._templateLoadCount++;
+ }
+ if(this.itemTemplate){
+ this._templateLoadCount++;
+ }
+ if(this.dividerTemplate){
+ this._templateLoadCount++;
+ }
+
+ this.connect(this.domNode, "onmousedown", function(event){
+ var touch = event;
+ if(event.targetTouches && event.targetTouches.length > 0){
+ touch = event.targetTouches[0];
+ }
+
+ // Find the node that was tapped/clicked
+ var rowNode = _this._getRowNode(event.target);
+
+ if(rowNode){
+ // Add the rows data to the event so it can be picked up
+ // by any listeners
+ _this._setDataInfo(rowNode, event);
+
+ // Select and highlight the row
+ _this._selectRow(rowNode);
+
+ // Record the position that was tapped
+ _this._mouseDownPos = {
+ x: touch.pageX,
+ y: touch.pageY
+ };
+ _this._dragThreshold = null;
+ }
+ });
+
+ this.connect(this.domNode, "onmouseup", function(event){
+ // When the mouse/finger comes off the list,
+ // call the onSelect function and deselect the row.
+ if(event.targetTouches && event.targetTouches.length > 0){
+ event = event.targetTouches[0];
+ }
+ var rowNode = _this._getRowNode(event.target);
+
+ if(rowNode){
+
+ _this._setDataInfo(rowNode, event);
+
+ if(_this._selectedRow){
+ _this.onSelect(rowNode._data, rowNode._idx, rowNode);
+ }
+
+ this._deselectRow();
+ }
+ });
+
+ // If swipe-to-delete is enabled, listen for the mouse moving
+ if(this.enableDelete){
+ this.connect(this.domNode, "mousemove", function(event){
+ dojo.stopEvent(event);
+ if(!_this._selectedRow){
+ return;
+ }
+ var rowNode = _this._getRowNode(event.target);
+
+ // Still check for enableDelete in case it's changed after
+ // this listener is added.
+ if(_this.enableDelete && rowNode && !_this._deleting){
+ _this.handleDrag(event);
+ }
+ });
+ }
+
+ // Put the data and index onto each onclick event.
+ this.connect(this.domNode, "onclick", function(event){
+ if(event.touches && event.touches.length > 0){
+ event = event.touches[0];
+ }
+ var rowNode = _this._getRowNode(event.target, true);
+
+ if(rowNode){
+ _this._setDataInfo(rowNode, event);
+ }
+ });
+
+ // If the mouse or finger moves off the selected row,
+ // deselect it.
+ this.connect(this.domNode, "mouseout", function(event){
+ if(event.touches && event.touches.length > 0){
+ event = event.touches[0];
+ }
+ if(event.target == _this._selectedRow){
+ _this._deselectRow();
+ }
+ });
+
+ // If no item template has been provided, it is an error.
+ if(!this.itemTemplate){
+ throw Error("An item template must be provided to " + this.declaredClass);
+ }
+
+ // Load the item template
+ this._loadTemplate(this.itemTemplate, "itemTemplate", this._checkLoadComplete);
+
+ if(this.emptyTemplate){
+ // If the optional empty template has been provided, load it.
+ this._loadTemplate(this.emptyTemplate, "emptyTemplate", this._checkLoadComplete);
+ }
+
+ if(this.dividerTemplate){
+ this._loadTemplate(this.dividerTemplate, "dividerTemplate", this._checkLoadComplete);
+ }
+ },
+
+ handleDrag: function(event){
+ // summary:
+ // Handles rows being swiped for deletion.
+ var touch = event;
+ if(event.targetTouches && event.targetTouches.length > 0){
+ touch = event.targetTouches[0];
+ }
+
+ // Get the distance that the mouse or finger has moved since
+ // beginning the swipe action.
+ var diff = touch.pageX - this._mouseDownPos.x;
+
+ var absDiff = Math.abs(diff);
+ if(absDiff > 10 && !this._dragThreshold){
+ // Make the user drag the row 60% of the width to remove it
+ this._dragThreshold = dojo.marginBox(this._selectedRow).w * 0.6;
+ if(!this.autoDelete){
+ this.createDeleteButtons(this._selectedRow);
+ }
+ }
+
+ this._selectedRow.style.left = (absDiff > 10 ? diff : 0) + "px";
+
+ // If the user has dragged the row more than the threshold, slide
+ // it off the screen in preparation for deletion.
+ if(this._dragThreshold && this._dragThreshold < absDiff){
+ this.preDelete(diff);
+ }
+ },
+
+ handleDragCancel: function(){
+ // summary:
+ // Handle a drag action being cancelled, for whatever reason.
+ // Reset handles, remove CSS classes etc.
+ if(this._deleting){
+ return;
+ }
+ dojo.removeClass(this._selectedRow, "hold");
+ this._selectedRow.style.left = 0;
+ this._mouseDownPos = null;
+ this._dragThreshold = null;
+
+ this._deleteBtns && dojo.style(this._deleteBtns, "display", "none");
+ },
+
+ preDelete: function(currentLeftPos){
+ // summary:
+ // Slides the row offscreen before it is deleted
+
+ // TODO: do this with CSS3!
+ var self = this;
+
+ this._deleting = true;
+
+ dojo.animateProperty({
+ node: this._selectedRow,
+ duration: 400,
+ properties: {
+ left: {
+ end: currentLeftPos +
+ ((currentLeftPos > 0 ? 1 : -1) * this._dragThreshold * 0.8)
+ }
+ },
+ onEnd: dojo.hitch(this, function(){
+ if(this.autoDelete){
+ this.deleteRow(this._selectedRow);
+ }
+ })
+ }).play();
+ },
+
+ deleteRow: function(row){
+
+ // First make the row invisible
+ // Put it back where it came from
+ dojo.style(row, {
+ visibility: "hidden",
+ minHeight: "0px"
+ });
+ dojo.removeClass(row, "hold");
+
+ this._deleteAnimConn =
+ this.connect(row, "webkitAnimationEnd", this._postDeleteAnim);
+
+ dojo.addClass(row, "collapsed");
+ },
+
+ _postDeleteAnim: function(event){
+ // summary:
+ // Completes the deletion of a row.
+
+ if(this._deleteAnimConn){
+ this.disconnect(this._deleteAnimConn);
+ this._deleteAnimConn = null;
+ }
+
+ var row = this._selectedRow;
+ var sibling = row.nextSibling;
+ var prevSibling = row.previousSibling;
+
+ // If the previous node is a divider and either this is
+ // the last element in the list, or the next node is
+ // also a divider, remove the divider for the deleted section.
+ if(prevSibling && prevSibling._isDivider){
+ if(!sibling || sibling._isDivider){
+ prevSibling.parentNode.removeChild(prevSibling);
+ }
+ }
+
+ row.parentNode.removeChild(row);
+ this.onDelete(row._data, row._idx, this.items);
+
+ // Decrement the index of each following row
+ while(sibling){
+ if(sibling._idx){
+ sibling._idx--;
+ }
+ sibling = sibling.nextSibling;
+ }
+
+ dojo.destroy(row);
+
+ // Fix up the 'first' and 'last' CSS classes on the rows
+ dojo.query("> *:not(.buttons)", this.domNode).forEach(this.applyClass);
+
+ this._deleting = false;
+ this._deselectRow();
+ },
+
+ createDeleteButtons: function(aroundNode){
+ // summary:
+ // Creates the two buttons displayed when confirmation is
+ // required before deletion of a row.
+ // aroundNode:
+ // The DOM node of the row about to be deleted.
+ var mb = dojo.marginBox(aroundNode);
+ var pos = dojo._abs(aroundNode, true);
+
+ if(!this._deleteBtns){
+ // Create the delete buttons.
+ this._deleteBtns = dojo.create("div",{
+ "class": "buttons"
+ }, this.domNode);
+
+ this.buttons = [];
+
+ this.buttons.push(new dojox.mobile.Button({
+ btnClass: "mblRedButton",
+ label: this.labelDelete
+ }));
+ this.buttons.push(new dojox.mobile.Button({
+ btnClass: "mblBlueButton",
+ label: this.labelCancel
+ }));
+
+ dojo.place(this.buttons[0].domNode, this._deleteBtns);
+ dojo.place(this.buttons[1].domNode, this._deleteBtns);
+
+ dojo.addClass(this.buttons[0].domNode, "deleteBtn");
+ dojo.addClass(this.buttons[1].domNode, "cancelBtn");
+
+ this._handleButtonClick = dojo.hitch(this._handleButtonClick);
+ this.connect(this._deleteBtns, "onclick", this._handleButtonClick);
+ }
+ dojo.removeClass(this._deleteBtns, "fade out fast");
+ dojo.style(this._deleteBtns, {
+ display: "",
+ width: mb.w + "px",
+ height: mb.h + "px",
+ top: (aroundNode.offsetTop) + "px",
+ left: "0px"
+ });
+ },
+
+ onDelete: function(data, index, array){
+ // summary:
+ // Called when a row is deleted
+ // data:
+ // The data related to the row being deleted
+ // index:
+ // The index of the data in the total array
+ // array:
+ // The array of data used.
+
+ array.splice(index, 1);
+
+ // If the data is empty, rerender in case an emptyTemplate has
+ // been provided
+ if(array.length < 1){
+ this.render();
+ }
+ },
+
+ cancelDelete: function(){
+ // summary:
+ // Cancels the deletion of a row.
+ this._deleting = false;
+ this.handleDragCancel();
+ },
+
+ _handleButtonClick: function(event){
+ // summary:
+ // Handles the click of one of the deletion buttons, either to
+ // delete the row or to cancel the deletion.
+ if(event.touches && event.touches.length > 0){
+ event = event.touches[0];
+ }
+ var node = event.target;
+ if(dojo.hasClass(node, "deleteBtn")){
+ this.deleteRow(this._selectedRow);
+ }else if(dojo.hasClass(node, "cancelBtn")){
+ this.cancelDelete();
+ }else{
+ return;
+ }
+ dojo.addClass(this._deleteBtns, "fade out");
+ },
+
+ applyClass: function(node, idx, array){
+ // summary:
+ // Applies the 'first' and 'last' CSS classes to the relevant
+ // rows.
+
+ dojo.removeClass(node, "first last");
+ if(idx == 0){
+ dojo.addClass(node, "first");
+ }
+ if(idx == array.length - 1){
+ dojo.addClass(node, "last");
+ }
+ },
+
+ _setDataInfo: function(rowNode, event){
+ // summary:
+ // Attaches the data item and index for each row to any event
+ // that occurs on that row.
+ event.item = rowNode._data;
+ event.index = rowNode._idx;
+ },
+
+ onSelect: function(data, index, rowNode){
+ // summary:
+ // Dummy function that is called when a row is tapped
+ },
+
+ _selectRow: function(row){
+ // summary:
+ // Selects a row, applies the relevant CSS classes.
+ if(this._deleting && this._selectedRow && row != this._selectedRow){
+ this.cancelDelete();
+ }
+
+ if(!dojo.hasClass(row, "row")){
+ return;
+ }
+ if(this.enableHold || this.enableDelete){
+ dojo.addClass(row, "hold");
+ }
+ this._selectedRow = row;
+ },
+
+ _deselectRow: function(){
+ // summary:
+ // Deselects a row, and cancels any drag actions that were
+ // occurring.
+ if(!this._selectedRow || this._deleting){
+ return;
+ }
+ this.handleDragCancel();
+ dojo.removeClass(this._selectedRow, "hold");
+ this._selectedRow = null;
+ },
+
+ _getRowNode: function(fromNode, ignoreNoClick){
+ // summary:
+ // Gets the DOM node of the row that is equal to or the parent
+ // of the node passed to this function.
+ while(fromNode && !fromNode._data && fromNode != this.domNode){
+ if(!ignoreNoClick && dojo.hasClass(fromNode, "noclick")){
+ return null;
+ }
+ fromNode = fromNode.parentNode;
+ }
+ return fromNode == this.domNode ? null : fromNode;
+ },
+
+ applyTemplate: function(template, data){
+ return dojo._toDom(dojo.string.substitute(
+ template, data, this._replaceToken, this.formatters || this));
+ },
+
+ render: function(){
+ // summary:
+ // Renders the list.
+
+ // Delete all existing nodes, except the deletion buttons.
+ dojo.query("> *:not(.buttons)", this.domNode).forEach(dojo.destroy);
+
+ // If there is no data, and an empty template has been provided,
+ // render it.
+ if(this.items.length < 1 && this.emptyTemplate){
+ dojo.place(dojo._toDom(this.emptyTemplate), this.domNode, "first");
+ }else{
+ this.domNode.appendChild(this._renderRange(0, this.items.length));
+ }
+ if(dojo.hasClass(this.domNode.parentNode, "mblRoundRect")){
+ dojo.addClass(this.domNode.parentNode, "mblRoundRectList")
+ }
+
+ var divs = dojo.query("> .row", this.domNode);
+ if(divs.length > 0){
+ dojo.addClass(divs[0], "first");
+ dojo.addClass(divs[divs.length - 1], "last");
+ }
+ },
+
+ _renderRange: function(startIdx, endIdx){
+
+ var rows = [];
+ var row, i;
+ var frag = document.createDocumentFragment();
+ startIdx = Math.max(0, startIdx);
+ endIdx = Math.min(endIdx, this.items.length);
+
+ for(i = startIdx; i < endIdx; i++){
+ // Create a document fragment containing the templated row
+ row = this.applyTemplate(this.itemTemplate, this.items[i]);
+ dojo.addClass(row, 'row');
+ row._data = this.items[i];
+ row._idx = i;
+ rows.push(row);
+ }
+ if(!this.dividerFunction || !this.dividerTemplate){
+ for(i = startIdx; i < endIdx; i++){
+ rows[i]._data = this.items[i];
+ rows[i]._idx = i;
+ frag.appendChild(rows[i]);
+ }
+ }else{
+ var prevDividerValue = null;
+ var dividerValue;
+ var divider;
+ for(i = startIdx; i < endIdx; i++){
+ rows[i]._data = this.items[i];
+ rows[i]._idx = i;
+
+ dividerValue = this.dividerFunction(this.items[i]);
+ if(dividerValue && dividerValue != prevDividerValue){
+ divider = this.applyTemplate(this.dividerTemplate, {
+ label: dividerValue,
+ item: this.items[i]
+ });
+ divider._isDivider = true;
+ frag.appendChild(divider);
+ prevDividerValue = dividerValue;
+ }
+ frag.appendChild(rows[i]);
+ }
+ }
+ return frag;
+ },
+
+ _replaceToken: function(value, key){
+ if(key.charAt(0) == '!'){ value = dojo.getObject(key.substr(1), false, _this); }
+ if(typeof value == "undefined"){ return ""; } // a debugging aide
+ if(value == null){ return ""; }
+
+ // Substitution keys beginning with ! will skip the transform step,
+ // in case a user wishes to insert unescaped markup, e.g. ${!foo}
+ return key.charAt(0) == "!" ? value :
+ // Safer substitution, see heading "Attribute values" in
+ // http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.3.2
+ value.toString().replace(/"/g,"&quot;"); //TODO: add &amp? use encodeXML method?
+
+ },
+
+ _checkLoadComplete: function(){
+ // summary:
+ // Checks if all templates have loaded
+ this._templateLoadCount--;
+
+ if(this._templateLoadCount < 1 && this.get("items")){
+ this.render();
+ }
+ },
+
+ _loadTemplate: function(url, thisAttr, callback){
+ // summary:
+ // Loads a template
+ if(!url){
+ callback();
+ return;
+ }
+
+ if(templateCache[url]){
+ this.set(thisAttr, templateCache[url]);
+ callback();
+ }else{
+ var _this = this;
+
+ dojo.xhrGet({
+ url: url,
+ sync: false,
+ handleAs: "text",
+ load: function(text){
+ templateCache[url] = dojo.trim(text);
+ _this.set(thisAttr, templateCache[url]);
+ callback();
+ }
+ });
+ }
+ },
+
+
+ _setFormattersAttr: function(formatters){
+ // summary:
+ // Sets the data items, and causes a rerender of the list
+ this.formatters = formatters;
+ },
+
+ _setItemsAttr: function(items){
+ // summary:
+ // Sets the data items, and causes a rerender of the list
+
+ this.items = items || [];
+
+ if(this._templateLoadCount < 1 && items){
+ this.render();
+ }
+ },
+
+ destroy: function(){
+ if(this.buttons){
+ dojo.forEach(this.buttons, function(button){
+ button.destroy();
+ });
+ this.buttons = null;
+ }
+
+ this.inherited(arguments);
+ }
+
+ });
+
+})();
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/mobile/app/ListSelector.js b/js/dojo-1.6/dojox/mobile/app/ListSelector.js
new file mode 100644
index 0000000..3b4cd40
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/ListSelector.js
@@ -0,0 +1,229 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.mobile.app.ListSelector"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.ListSelector"] = true;
+dojo.provide("dojox.mobile.app.ListSelector");
+dojo.experimental("dojox.mobile.app.ListSelector");
+
+dojo.require("dojox.mobile.app._Widget");
+dojo.require("dojo.fx");
+
+dojo.declare("dojox.mobile.app.ListSelector", dojox.mobile.app._Widget, {
+
+ // data: Array
+ // The array of items to display. Each element in the array
+ // should have both a label and value attribute, e.g.
+ // [{label: "Open", value: 1} , {label: "Delete", value: 2}]
+ data: null,
+
+ // controller: Object
+ // The current SceneController widget.
+ controller: null,
+
+ // onChoose: Function
+ // The callback function for when an item is selected
+ onChoose: null,
+
+ destroyOnHide: false,
+
+ _setDataAttr: function(data){
+ this.data = data;
+
+ if(this.data){
+ this.render();
+ }
+ },
+
+ postCreate: function(){
+ dojo.addClass(this.domNode, "listSelector");
+
+ var _this = this;
+
+ this.connect(this.domNode, "onclick", function(event){
+ if(!dojo.hasClass(event.target, "listSelectorRow")){
+ return;
+ }
+
+ if(_this.onChoose){
+ _this.onChoose(_this.data[event.target._idx].value);
+ }
+ _this.hide();
+ });
+
+ this.connect(this.domNode, "onmousedown", function(event){
+ if(!dojo.hasClass(event.target, "listSelectorRow")){
+ return;
+ }
+ dojo.addClass(event.target, "listSelectorRow-selected");
+ });
+
+ this.connect(this.domNode, "onmouseup", function(event){
+ if(!dojo.hasClass(event.target, "listSelectorRow")){
+ return;
+ }
+ dojo.removeClass(event.target, "listSelectorRow-selected");
+ });
+
+ this.connect(this.domNode, "onmouseout", function(event){
+ if(!dojo.hasClass(event.target, "listSelectorRow")){
+ return;
+ }
+ dojo.removeClass(event.target, "listSelectorRow-selected");
+ });
+
+ var viewportSize = this.controller.getWindowSize();
+
+ this.mask = dojo.create("div", {"class": "dialogUnderlayWrapper",
+ innerHTML: "<div class=\"dialogUnderlay\"></div>"
+ }, this.controller.assistant.domNode);
+
+ this.connect(this.mask, "onclick", function(){
+ _this.onChoose && _this.onChoose();
+ _this.hide();
+ });
+ },
+
+ show: function(fromNode){
+
+ // Using dojo.fx here. Must figure out how to do this with CSS animations!!
+ var startPos;
+
+ var windowSize = this.controller.getWindowSize();
+ var fromNodePos;
+ if(fromNode){
+ fromNodePos = dojo._abs(fromNode);
+ startPos = fromNodePos;
+ }else{
+ startPos.x = windowSize.w / 2;
+ startPos.y = 200;
+ }
+ console.log("startPos = ", startPos);
+
+ dojo.style(this.domNode, {
+ opacity: 0,
+ display: "",
+ width: Math.floor(windowSize.w * 0.8) + "px"
+ });
+
+ var maxWidth = 0;
+ dojo.query(">", this.domNode).forEach(function(node){
+ dojo.style(node, {
+ "float": "left"
+ });
+ maxWidth = Math.max(maxWidth, dojo.marginBox(node).w);
+ dojo.style(node, {
+ "float": "none"
+ });
+ });
+ maxWidth = Math.min(maxWidth, Math.round(windowSize.w * 0.8))
+ + dojo.style(this.domNode, "paddingLeft")
+ + dojo.style(this.domNode, "paddingRight")
+ + 1;
+
+ dojo.style(this.domNode, "width", maxWidth + "px");
+ var targetHeight = dojo.marginBox(this.domNode).h;
+
+ var _this = this;
+
+
+ var targetY = fromNodePos ?
+ Math.max(30, fromNodePos.y - targetHeight - 10) :
+ this.getScroll().y + 30;
+
+ console.log("fromNodePos = ", fromNodePos, " targetHeight = ", targetHeight,
+ " targetY = " + targetY, " startPos ", startPos);
+
+
+ var anim1 = dojo.animateProperty({
+ node: this.domNode,
+ duration: 400,
+ properties: {
+ width: {start: 1, end: maxWidth},
+ height: {start: 1, end: targetHeight},
+ top: {start: startPos.y, end: targetY},
+ left: {start: startPos.x, end: (windowSize.w/2 - maxWidth/2)},
+ opacity: {start: 0, end: 1},
+ fontSize: {start: 1}
+ },
+ onEnd: function(){
+ dojo.style(_this.domNode, "width", "inherit");
+ }
+ });
+ var anim2 = dojo.fadeIn({
+ node: this.mask,
+ duration: 400
+ });
+ dojo.fx.combine([anim1, anim2]).play();
+
+ },
+
+ hide: function(){
+ // Using dojo.fx here. Must figure out how to do this with CSS animations!!
+
+ var _this = this;
+
+ var anim1 = dojo.animateProperty({
+ node: this.domNode,
+ duration: 500,
+ properties: {
+ width: {end: 1},
+ height: {end: 1},
+ opacity: {end: 0},
+ fontSize: {end: 1}
+ },
+ onEnd: function(){
+ if(_this.get("destroyOnHide")){
+ _this.destroy();
+ }
+ }
+ });
+
+ var anim2 = dojo.fadeOut({
+ node: this.mask,
+ duration: 400
+ });
+ dojo.fx.combine([anim1, anim2]).play();
+ },
+
+ render: function(){
+ // summary:
+ // Renders
+
+ dojo.empty(this.domNode);
+ dojo.style(this.domNode, "opacity", 0);
+
+ var row;
+
+ for(var i = 0; i < this.data.length; i++){
+ // Create each row and add any custom classes. Also set the _idx property.
+ row = dojo.create("div", {
+ "class": "listSelectorRow " + (this.data[i].className || ""),
+ innerHTML: this.data[i].label
+ }, this.domNode);
+
+ row._idx = i;
+
+ if(i == 0){
+ dojo.addClass(row, "first");
+ }
+ if(i == this.data.length - 1){
+ dojo.addClass(row, "last");
+ }
+
+ }
+ },
+
+
+ destroy: function(){
+ this.inherited(arguments);
+ dojo.destroy(this.mask);
+ }
+
+});
+
+}
diff --git a/js/dojo-1.6/dojox/mobile/app/ListSelector.xd.js b/js/dojo-1.6/dojox/mobile/app/ListSelector.xd.js
new file mode 100644
index 0000000..cd8ccd8
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/ListSelector.xd.js
@@ -0,0 +1,235 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.mobile.app.ListSelector"],
+["require", "dojox.mobile.app._Widget"],
+["require", "dojo.fx"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.mobile.app.ListSelector"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.ListSelector"] = true;
+dojo.provide("dojox.mobile.app.ListSelector");
+dojo.experimental("dojox.mobile.app.ListSelector");
+
+dojo.require("dojox.mobile.app._Widget");
+dojo.require("dojo.fx");
+
+dojo.declare("dojox.mobile.app.ListSelector", dojox.mobile.app._Widget, {
+
+ // data: Array
+ // The array of items to display. Each element in the array
+ // should have both a label and value attribute, e.g.
+ // [{label: "Open", value: 1} , {label: "Delete", value: 2}]
+ data: null,
+
+ // controller: Object
+ // The current SceneController widget.
+ controller: null,
+
+ // onChoose: Function
+ // The callback function for when an item is selected
+ onChoose: null,
+
+ destroyOnHide: false,
+
+ _setDataAttr: function(data){
+ this.data = data;
+
+ if(this.data){
+ this.render();
+ }
+ },
+
+ postCreate: function(){
+ dojo.addClass(this.domNode, "listSelector");
+
+ var _this = this;
+
+ this.connect(this.domNode, "onclick", function(event){
+ if(!dojo.hasClass(event.target, "listSelectorRow")){
+ return;
+ }
+
+ if(_this.onChoose){
+ _this.onChoose(_this.data[event.target._idx].value);
+ }
+ _this.hide();
+ });
+
+ this.connect(this.domNode, "onmousedown", function(event){
+ if(!dojo.hasClass(event.target, "listSelectorRow")){
+ return;
+ }
+ dojo.addClass(event.target, "listSelectorRow-selected");
+ });
+
+ this.connect(this.domNode, "onmouseup", function(event){
+ if(!dojo.hasClass(event.target, "listSelectorRow")){
+ return;
+ }
+ dojo.removeClass(event.target, "listSelectorRow-selected");
+ });
+
+ this.connect(this.domNode, "onmouseout", function(event){
+ if(!dojo.hasClass(event.target, "listSelectorRow")){
+ return;
+ }
+ dojo.removeClass(event.target, "listSelectorRow-selected");
+ });
+
+ var viewportSize = this.controller.getWindowSize();
+
+ this.mask = dojo.create("div", {"class": "dialogUnderlayWrapper",
+ innerHTML: "<div class=\"dialogUnderlay\"></div>"
+ }, this.controller.assistant.domNode);
+
+ this.connect(this.mask, "onclick", function(){
+ _this.onChoose && _this.onChoose();
+ _this.hide();
+ });
+ },
+
+ show: function(fromNode){
+
+ // Using dojo.fx here. Must figure out how to do this with CSS animations!!
+ var startPos;
+
+ var windowSize = this.controller.getWindowSize();
+ var fromNodePos;
+ if(fromNode){
+ fromNodePos = dojo._abs(fromNode);
+ startPos = fromNodePos;
+ }else{
+ startPos.x = windowSize.w / 2;
+ startPos.y = 200;
+ }
+ console.log("startPos = ", startPos);
+
+ dojo.style(this.domNode, {
+ opacity: 0,
+ display: "",
+ width: Math.floor(windowSize.w * 0.8) + "px"
+ });
+
+ var maxWidth = 0;
+ dojo.query(">", this.domNode).forEach(function(node){
+ dojo.style(node, {
+ "float": "left"
+ });
+ maxWidth = Math.max(maxWidth, dojo.marginBox(node).w);
+ dojo.style(node, {
+ "float": "none"
+ });
+ });
+ maxWidth = Math.min(maxWidth, Math.round(windowSize.w * 0.8))
+ + dojo.style(this.domNode, "paddingLeft")
+ + dojo.style(this.domNode, "paddingRight")
+ + 1;
+
+ dojo.style(this.domNode, "width", maxWidth + "px");
+ var targetHeight = dojo.marginBox(this.domNode).h;
+
+ var _this = this;
+
+
+ var targetY = fromNodePos ?
+ Math.max(30, fromNodePos.y - targetHeight - 10) :
+ this.getScroll().y + 30;
+
+ console.log("fromNodePos = ", fromNodePos, " targetHeight = ", targetHeight,
+ " targetY = " + targetY, " startPos ", startPos);
+
+
+ var anim1 = dojo.animateProperty({
+ node: this.domNode,
+ duration: 400,
+ properties: {
+ width: {start: 1, end: maxWidth},
+ height: {start: 1, end: targetHeight},
+ top: {start: startPos.y, end: targetY},
+ left: {start: startPos.x, end: (windowSize.w/2 - maxWidth/2)},
+ opacity: {start: 0, end: 1},
+ fontSize: {start: 1}
+ },
+ onEnd: function(){
+ dojo.style(_this.domNode, "width", "inherit");
+ }
+ });
+ var anim2 = dojo.fadeIn({
+ node: this.mask,
+ duration: 400
+ });
+ dojo.fx.combine([anim1, anim2]).play();
+
+ },
+
+ hide: function(){
+ // Using dojo.fx here. Must figure out how to do this with CSS animations!!
+
+ var _this = this;
+
+ var anim1 = dojo.animateProperty({
+ node: this.domNode,
+ duration: 500,
+ properties: {
+ width: {end: 1},
+ height: {end: 1},
+ opacity: {end: 0},
+ fontSize: {end: 1}
+ },
+ onEnd: function(){
+ if(_this.get("destroyOnHide")){
+ _this.destroy();
+ }
+ }
+ });
+
+ var anim2 = dojo.fadeOut({
+ node: this.mask,
+ duration: 400
+ });
+ dojo.fx.combine([anim1, anim2]).play();
+ },
+
+ render: function(){
+ // summary:
+ // Renders
+
+ dojo.empty(this.domNode);
+ dojo.style(this.domNode, "opacity", 0);
+
+ var row;
+
+ for(var i = 0; i < this.data.length; i++){
+ // Create each row and add any custom classes. Also set the _idx property.
+ row = dojo.create("div", {
+ "class": "listSelectorRow " + (this.data[i].className || ""),
+ innerHTML: this.data[i].label
+ }, this.domNode);
+
+ row._idx = i;
+
+ if(i == 0){
+ dojo.addClass(row, "first");
+ }
+ if(i == this.data.length - 1){
+ dojo.addClass(row, "last");
+ }
+
+ }
+ },
+
+
+ destroy: function(){
+ this.inherited(arguments);
+ dojo.destroy(this.mask);
+ }
+
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/mobile/app/SceneAssistant.js b/js/dojo-1.6/dojox/mobile/app/SceneAssistant.js
new file mode 100644
index 0000000..d92767d
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/SceneAssistant.js
@@ -0,0 +1,67 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.mobile.app.SceneAssistant"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.SceneAssistant"] = true;
+dojo.provide("dojox.mobile.app.SceneAssistant");
+dojo.experimental("dojox.mobile.app.SceneAssistant");
+
+dojo.declare("dojox.mobile.app.SceneAssistant", null, {
+ // summary:
+ // The base class for all scene assistants.
+
+ constructor: function(){
+
+ },
+
+ setup: function(){
+ // summary:
+ // Called to set up the widget. The UI is not visible at this time
+
+ },
+
+ activate: function(params){
+ // summary:
+ // Called each time the scene becomes visible. This can be as a result
+ // of a new scene being created, or a subsequent scene being destroyed
+ // and control transferring back to this scene assistant.
+ // params:
+ // Optional paramters, only passed when a subsequent scene pops itself
+ // off the stack and passes back data.
+ },
+
+ deactivate: function(){
+ // summary:
+ // Called each time the scene becomes invisible. This can be as a result
+ // of it being popped off the stack and destroyed,
+ // or another scene being created and pushed on top of it on the stack
+ },
+
+ destroy: function(){
+
+ var children =
+ dojo.query("> [widgetId]", this.containerNode).map(dijit.byNode);
+ dojo.forEach(children, function(child){ child.destroyRecursive(); });
+
+ this.disconnect();
+ },
+
+ connect: function(obj, method, callback){
+ if(!this._connects){
+ this._connects = [];
+ }
+ this._connects.push(dojo.connect(obj, method, callback));
+ },
+
+ disconnect: function(){
+ dojo.forEach(this._connects, dojo.disconnect);
+ this._connects = [];
+ }
+});
+
+
+}
diff --git a/js/dojo-1.6/dojox/mobile/app/SceneAssistant.xd.js b/js/dojo-1.6/dojox/mobile/app/SceneAssistant.xd.js
new file mode 100644
index 0000000..4d62f75
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/SceneAssistant.xd.js
@@ -0,0 +1,71 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.mobile.app.SceneAssistant"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.mobile.app.SceneAssistant"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.SceneAssistant"] = true;
+dojo.provide("dojox.mobile.app.SceneAssistant");
+dojo.experimental("dojox.mobile.app.SceneAssistant");
+
+dojo.declare("dojox.mobile.app.SceneAssistant", null, {
+ // summary:
+ // The base class for all scene assistants.
+
+ constructor: function(){
+
+ },
+
+ setup: function(){
+ // summary:
+ // Called to set up the widget. The UI is not visible at this time
+
+ },
+
+ activate: function(params){
+ // summary:
+ // Called each time the scene becomes visible. This can be as a result
+ // of a new scene being created, or a subsequent scene being destroyed
+ // and control transferring back to this scene assistant.
+ // params:
+ // Optional paramters, only passed when a subsequent scene pops itself
+ // off the stack and passes back data.
+ },
+
+ deactivate: function(){
+ // summary:
+ // Called each time the scene becomes invisible. This can be as a result
+ // of it being popped off the stack and destroyed,
+ // or another scene being created and pushed on top of it on the stack
+ },
+
+ destroy: function(){
+
+ var children =
+ dojo.query("> [widgetId]", this.containerNode).map(dijit.byNode);
+ dojo.forEach(children, function(child){ child.destroyRecursive(); });
+
+ this.disconnect();
+ },
+
+ connect: function(obj, method, callback){
+ if(!this._connects){
+ this._connects = [];
+ }
+ this._connects.push(dojo.connect(obj, method, callback));
+ },
+
+ disconnect: function(){
+ dojo.forEach(this._connects, dojo.disconnect);
+ this._connects = [];
+ }
+});
+
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/mobile/app/SceneController.js b/js/dojo-1.6/dojox/mobile/app/SceneController.js
new file mode 100644
index 0000000..bcf25cd
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/SceneController.js
@@ -0,0 +1,181 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.mobile.app.SceneController"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.SceneController"] = true;
+dojo.provide("dojox.mobile.app.SceneController");
+dojo.experimental("dojox.mobile.app.SceneController");
+dojo.require("dojox.mobile._base");
+
+(function(){
+
+ var app = dojox.mobile.app;
+
+ var templates = {};
+
+ dojo.declare("dojox.mobile.app.SceneController", dojox.mobile.View, {
+
+ stageController: null,
+
+ keepScrollPos: false,
+
+ init: function(sceneName, params){
+ // summary:
+ // Initializes the scene by loading the HTML template and code, if it has
+ // not already been loaded
+
+ this.sceneName = sceneName;
+ this.params = params;
+ var templateUrl = app.resolveTemplate(sceneName);
+
+ this._deferredInit = new dojo.Deferred();
+
+ if(templates[sceneName]){
+ // If the template has been cached, do not load it again.
+ this._setContents(templates[sceneName]);
+ }else{
+ // Otherwise load the template
+ dojo.xhrGet({
+ url: templateUrl,
+ handleAs: "text"
+ }).addCallback(dojo.hitch(this, this._setContents));
+ }
+
+ return this._deferredInit;
+ },
+
+ _setContents: function(templateHtml){
+ // summary:
+ // Sets the content of the View, and invokes either the loading or
+ // initialization of the scene assistant.
+ templates[this.sceneName] = templateHtml;
+
+ this.domNode.innerHTML = "<div>" + templateHtml + "</div>";
+
+ var sceneAssistantName = "";
+
+ var nameParts = this.sceneName.split("-");
+
+ for(var i = 0; i < nameParts.length; i++){
+ sceneAssistantName += nameParts[i].substring(0, 1).toUpperCase()
+ + nameParts[i].substring(1);
+ }
+ sceneAssistantName += "Assistant";
+ this.sceneAssistantName = sceneAssistantName;
+
+ var _this = this;
+
+ dojox.mobile.app.loadResourcesForScene(this.sceneName, function(){
+
+ console.log("All resources for ",_this.sceneName," loaded");
+
+ var assistant;
+ if(typeof(dojo.global[sceneAssistantName]) != "undefined"){
+ _this._initAssistant();
+ }else{
+ var assistantUrl = app.resolveAssistant(_this.sceneName);
+
+ dojo.xhrGet({
+ url: assistantUrl,
+ handleAs: "text"
+ }).addCallback(function(text){
+ try{
+ dojo.eval(text);
+ }catch(e){
+ console.log("Error initializing code for scene " + _this.sceneName
+ + '. Please check for syntax errors');
+ throw e;
+ }
+ _this._initAssistant();
+ });
+ }
+ });
+
+ },
+
+ _initAssistant: function(){
+ // summary:
+ // Initializes the scene assistant. At this point, the View is
+ // populated with the HTML template, and the scene assistant type
+ // is declared.
+
+ console.log("Instantiating the scene assistant " + this.sceneAssistantName);
+
+ var cls = dojo.getObject(this.sceneAssistantName);
+
+ if(!cls){
+ throw Error("Unable to resolve scene assistant "
+ + this.sceneAssistantName);
+ }
+
+ this.assistant = new cls(this.params);
+
+ this.assistant.controller = this;
+ this.assistant.domNode = this.domNode.firstChild;
+
+ this.assistant.setup();
+
+ this._deferredInit.callback();
+ },
+
+ query: function(selector, node){
+ // summary:
+ // Queries for DOM nodes within either the node passed in as an argument
+ // or within this view.
+
+ return dojo.query(selector, node || this.domNode)
+ },
+
+ parse: function(node){
+ var widgets = this._widgets =
+ dojox.mobile.parser.parse(node || this.domNode, {
+ controller: this
+ });
+
+ // Tell all widgets what their controller is.
+ for(var i = 0; i < widgets.length; i++){
+ widgets[i].set("controller", this);
+ }
+ },
+
+ getWindowSize: function(){
+ // TODO, this needs cross browser testing
+
+ return {
+ w: dojo.global.innerWidth,
+ h: dojo.global.innerHeight
+ }
+ },
+
+ showAlertDialog: function(props){
+
+ var size = dojo.marginBox(this.assistant.domNode);
+ var dialog = new dojox.mobile.app.AlertDialog(
+ dojo.mixin(props, {controller: this}));
+ this.assistant.domNode.appendChild(dialog.domNode);
+
+ console.log("Appended " , dialog.domNode, " to ", this.assistant.domNode);
+ dialog.show();
+ },
+
+ popupSubMenu: function(info){
+ var widget = new dojox.mobile.app.ListSelector({
+ controller: this,
+ destroyOnHide: true,
+ onChoose: info.onChoose
+ });
+
+ this.assistant.domNode.appendChild(widget.domNode);
+
+ widget.set("data", info.choices);
+ widget.show(info.fromNode);
+ }
+ });
+
+})();
+
+}
diff --git a/js/dojo-1.6/dojox/mobile/app/SceneController.xd.js b/js/dojo-1.6/dojox/mobile/app/SceneController.xd.js
new file mode 100644
index 0000000..ac36faa
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/SceneController.xd.js
@@ -0,0 +1,186 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.mobile.app.SceneController"],
+["require", "dojox.mobile._base"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.mobile.app.SceneController"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.SceneController"] = true;
+dojo.provide("dojox.mobile.app.SceneController");
+dojo.experimental("dojox.mobile.app.SceneController");
+dojo.require("dojox.mobile._base");
+
+(function(){
+
+ var app = dojox.mobile.app;
+
+ var templates = {};
+
+ dojo.declare("dojox.mobile.app.SceneController", dojox.mobile.View, {
+
+ stageController: null,
+
+ keepScrollPos: false,
+
+ init: function(sceneName, params){
+ // summary:
+ // Initializes the scene by loading the HTML template and code, if it has
+ // not already been loaded
+
+ this.sceneName = sceneName;
+ this.params = params;
+ var templateUrl = app.resolveTemplate(sceneName);
+
+ this._deferredInit = new dojo.Deferred();
+
+ if(templates[sceneName]){
+ // If the template has been cached, do not load it again.
+ this._setContents(templates[sceneName]);
+ }else{
+ // Otherwise load the template
+ dojo.xhrGet({
+ url: templateUrl,
+ handleAs: "text"
+ }).addCallback(dojo.hitch(this, this._setContents));
+ }
+
+ return this._deferredInit;
+ },
+
+ _setContents: function(templateHtml){
+ // summary:
+ // Sets the content of the View, and invokes either the loading or
+ // initialization of the scene assistant.
+ templates[this.sceneName] = templateHtml;
+
+ this.domNode.innerHTML = "<div>" + templateHtml + "</div>";
+
+ var sceneAssistantName = "";
+
+ var nameParts = this.sceneName.split("-");
+
+ for(var i = 0; i < nameParts.length; i++){
+ sceneAssistantName += nameParts[i].substring(0, 1).toUpperCase()
+ + nameParts[i].substring(1);
+ }
+ sceneAssistantName += "Assistant";
+ this.sceneAssistantName = sceneAssistantName;
+
+ var _this = this;
+
+ dojox.mobile.app.loadResourcesForScene(this.sceneName, function(){
+
+ console.log("All resources for ",_this.sceneName," loaded");
+
+ var assistant;
+ if(typeof(dojo.global[sceneAssistantName]) != "undefined"){
+ _this._initAssistant();
+ }else{
+ var assistantUrl = app.resolveAssistant(_this.sceneName);
+
+ dojo.xhrGet({
+ url: assistantUrl,
+ handleAs: "text"
+ }).addCallback(function(text){
+ try{
+ dojo.eval(text);
+ }catch(e){
+ console.log("Error initializing code for scene " + _this.sceneName
+ + '. Please check for syntax errors');
+ throw e;
+ }
+ _this._initAssistant();
+ });
+ }
+ });
+
+ },
+
+ _initAssistant: function(){
+ // summary:
+ // Initializes the scene assistant. At this point, the View is
+ // populated with the HTML template, and the scene assistant type
+ // is declared.
+
+ console.log("Instantiating the scene assistant " + this.sceneAssistantName);
+
+ var cls = dojo.getObject(this.sceneAssistantName);
+
+ if(!cls){
+ throw Error("Unable to resolve scene assistant "
+ + this.sceneAssistantName);
+ }
+
+ this.assistant = new cls(this.params);
+
+ this.assistant.controller = this;
+ this.assistant.domNode = this.domNode.firstChild;
+
+ this.assistant.setup();
+
+ this._deferredInit.callback();
+ },
+
+ query: function(selector, node){
+ // summary:
+ // Queries for DOM nodes within either the node passed in as an argument
+ // or within this view.
+
+ return dojo.query(selector, node || this.domNode)
+ },
+
+ parse: function(node){
+ var widgets = this._widgets =
+ dojox.mobile.parser.parse(node || this.domNode, {
+ controller: this
+ });
+
+ // Tell all widgets what their controller is.
+ for(var i = 0; i < widgets.length; i++){
+ widgets[i].set("controller", this);
+ }
+ },
+
+ getWindowSize: function(){
+ // TODO, this needs cross browser testing
+
+ return {
+ w: dojo.global.innerWidth,
+ h: dojo.global.innerHeight
+ }
+ },
+
+ showAlertDialog: function(props){
+
+ var size = dojo.marginBox(this.assistant.domNode);
+ var dialog = new dojox.mobile.app.AlertDialog(
+ dojo.mixin(props, {controller: this}));
+ this.assistant.domNode.appendChild(dialog.domNode);
+
+ console.log("Appended " , dialog.domNode, " to ", this.assistant.domNode);
+ dialog.show();
+ },
+
+ popupSubMenu: function(info){
+ var widget = new dojox.mobile.app.ListSelector({
+ controller: this,
+ destroyOnHide: true,
+ onChoose: info.onChoose
+ });
+
+ this.assistant.domNode.appendChild(widget.domNode);
+
+ widget.set("data", info.choices);
+ widget.show(info.fromNode);
+ }
+ });
+
+})();
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/mobile/app/StageController.js b/js/dojo-1.6/dojox/mobile/app/StageController.js
new file mode 100644
index 0000000..43c6798
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/StageController.js
@@ -0,0 +1,143 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.mobile.app.StageController"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.StageController"] = true;
+dojo.provide("dojox.mobile.app.StageController");
+dojo.experimental("dojox.mobile.app.StageController");
+
+dojo.require("dojox.mobile.app.SceneController");
+
+dojo.declare("dojox.mobile.app.StageController", null,{
+
+ // scenes: Array
+ // The list of scenes currently in existance in the app.
+ scenes: null,
+
+ effect: "fade",
+
+ constructor: function(node){
+ this.domNode = node;
+ this.scenes = [];
+
+ if(dojo.config.mobileAnim){
+ this.effect = dojo.config.mobileAnim;
+ }
+ },
+
+ getActiveSceneController: function(){
+ return this.scenes[this.scenes.length - 1];
+ },
+
+ pushScene: function(sceneName, params){
+ if(this._opInProgress){
+ return;
+ }
+ this._opInProgress = true;
+
+ // Push new scenes as the first element on the page.
+ var node = dojo.create("div", {
+ "class": "scene-wrapper",
+ style: {
+ visibility: "hidden"
+ }
+ }, this.domNode);
+
+ var controller = new dojox.mobile.app.SceneController({}, node);
+
+ if(this.scenes.length > 0){
+ this.scenes[this.scenes.length -1].assistant.deactivate();
+ }
+
+ this.scenes.push(controller);
+
+ var _this = this;
+
+ dojo.forEach(this.scenes, this.setZIndex);
+
+ controller.stageController = this;
+
+ controller.init(sceneName, params).addCallback(function(){
+
+ if(_this.scenes.length == 1){
+ controller.domNode.style.visibility = "visible";
+ _this.scenes[_this.scenes.length - 1].assistant.activate(params);
+ _this._opInProgress = false;
+ }else{
+ _this.scenes[_this.scenes.length - 2]
+ .performTransition(
+ _this.scenes[_this.scenes.length - 1].domNode,
+ 1,
+ _this.effect,
+ null,
+ function(){
+ // When the scene is ready, activate it.
+ _this.scenes[_this.scenes.length - 1].assistant.activate(params);
+ _this._opInProgress = false;
+ });
+ }
+ });
+ },
+
+ setZIndex: function(controller, idx){
+ dojo.style(controller.domNode, "zIndex", idx + 1);
+ },
+
+ popScene: function(data){
+ // performTransition: function(/*String*/moveTo, /*Number*/dir, /*String*/transition,
+ // /*Object|null*/context, /*String|Function*/method /*optional args*/){
+ if(this._opInProgress){
+ return;
+ }
+
+ var _this = this;
+ if(this.scenes.length > 1){
+
+ this._opInProgress = true;
+ this.scenes[_this.scenes.length - 2].assistant.activate(data);
+ this.scenes[_this.scenes.length - 1]
+ .performTransition(
+ _this.scenes[this.scenes.length - 2].domNode,
+ -1,
+ this.effect,
+ null,
+ function(){
+ // When the scene is no longer visible, destroy it
+ _this._destroyScene(_this.scenes[_this.scenes.length - 1]);
+ _this.scenes.splice(_this.scenes.length - 1, 1);
+ _this._opInProgress = false;
+ });
+ }else{
+ console.log("cannot pop the scene if there is just one");
+ }
+ },
+
+ popScenesTo: function(sceneName, data){
+ if(this._opInProgress){
+ return;
+ }
+
+ while(this.scenes.length > 2 &&
+ this.scenes[this.scenes.length - 2].sceneName != sceneName){
+ this._destroyScene(this.scenes[this.scenes.length - 2]);
+ this.scenes.splice(this.scenes.length - 2, 1);
+ }
+
+ this.popScene(data);
+ },
+
+ _destroyScene: function(scene){
+ scene.assistant.deactivate();
+ scene.assistant.destroy();
+ scene.destroyRecursive();
+ }
+
+
+});
+
+
+}
diff --git a/js/dojo-1.6/dojox/mobile/app/StageController.xd.js b/js/dojo-1.6/dojox/mobile/app/StageController.xd.js
new file mode 100644
index 0000000..5542ab5
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/StageController.xd.js
@@ -0,0 +1,148 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.mobile.app.StageController"],
+["require", "dojox.mobile.app.SceneController"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.mobile.app.StageController"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.StageController"] = true;
+dojo.provide("dojox.mobile.app.StageController");
+dojo.experimental("dojox.mobile.app.StageController");
+
+dojo.require("dojox.mobile.app.SceneController");
+
+dojo.declare("dojox.mobile.app.StageController", null,{
+
+ // scenes: Array
+ // The list of scenes currently in existance in the app.
+ scenes: null,
+
+ effect: "fade",
+
+ constructor: function(node){
+ this.domNode = node;
+ this.scenes = [];
+
+ if(dojo.config.mobileAnim){
+ this.effect = dojo.config.mobileAnim;
+ }
+ },
+
+ getActiveSceneController: function(){
+ return this.scenes[this.scenes.length - 1];
+ },
+
+ pushScene: function(sceneName, params){
+ if(this._opInProgress){
+ return;
+ }
+ this._opInProgress = true;
+
+ // Push new scenes as the first element on the page.
+ var node = dojo.create("div", {
+ "class": "scene-wrapper",
+ style: {
+ visibility: "hidden"
+ }
+ }, this.domNode);
+
+ var controller = new dojox.mobile.app.SceneController({}, node);
+
+ if(this.scenes.length > 0){
+ this.scenes[this.scenes.length -1].assistant.deactivate();
+ }
+
+ this.scenes.push(controller);
+
+ var _this = this;
+
+ dojo.forEach(this.scenes, this.setZIndex);
+
+ controller.stageController = this;
+
+ controller.init(sceneName, params).addCallback(function(){
+
+ if(_this.scenes.length == 1){
+ controller.domNode.style.visibility = "visible";
+ _this.scenes[_this.scenes.length - 1].assistant.activate(params);
+ _this._opInProgress = false;
+ }else{
+ _this.scenes[_this.scenes.length - 2]
+ .performTransition(
+ _this.scenes[_this.scenes.length - 1].domNode,
+ 1,
+ _this.effect,
+ null,
+ function(){
+ // When the scene is ready, activate it.
+ _this.scenes[_this.scenes.length - 1].assistant.activate(params);
+ _this._opInProgress = false;
+ });
+ }
+ });
+ },
+
+ setZIndex: function(controller, idx){
+ dojo.style(controller.domNode, "zIndex", idx + 1);
+ },
+
+ popScene: function(data){
+ // performTransition: function(/*String*/moveTo, /*Number*/dir, /*String*/transition,
+ // /*Object|null*/context, /*String|Function*/method /*optional args*/){
+ if(this._opInProgress){
+ return;
+ }
+
+ var _this = this;
+ if(this.scenes.length > 1){
+
+ this._opInProgress = true;
+ this.scenes[_this.scenes.length - 2].assistant.activate(data);
+ this.scenes[_this.scenes.length - 1]
+ .performTransition(
+ _this.scenes[this.scenes.length - 2].domNode,
+ -1,
+ this.effect,
+ null,
+ function(){
+ // When the scene is no longer visible, destroy it
+ _this._destroyScene(_this.scenes[_this.scenes.length - 1]);
+ _this.scenes.splice(_this.scenes.length - 1, 1);
+ _this._opInProgress = false;
+ });
+ }else{
+ console.log("cannot pop the scene if there is just one");
+ }
+ },
+
+ popScenesTo: function(sceneName, data){
+ if(this._opInProgress){
+ return;
+ }
+
+ while(this.scenes.length > 2 &&
+ this.scenes[this.scenes.length - 2].sceneName != sceneName){
+ this._destroyScene(this.scenes[this.scenes.length - 2]);
+ this.scenes.splice(this.scenes.length - 2, 1);
+ }
+
+ this.popScene(data);
+ },
+
+ _destroyScene: function(scene){
+ scene.assistant.deactivate();
+ scene.assistant.destroy();
+ scene.destroyRecursive();
+ }
+
+
+});
+
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/mobile/app/TextBox.js b/js/dojo-1.6/dojox/mobile/app/TextBox.js
new file mode 100644
index 0000000..409178a
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/TextBox.js
@@ -0,0 +1,330 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.mobile.app.TextBox"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.TextBox"] = true;
+dojo.provide("dojox.mobile.app.TextBox");
+dojo.experimental("dojox.mobile.app.TextBox");
+
+dojo.require("dojox.mobile.app._Widget");
+dojo.require("dojox.mobile.app._FormWidget");
+
+dojo.declare(
+ "dojox.mobile.app.TextBox",
+ dojox.mobile.app._FormValueWidget, {
+
+ // summary:
+ // A base class for textbox form inputs
+
+ // trim: Boolean
+ // Removes leading and trailing whitespace if true. Default is false.
+ trim: false,
+
+ // uppercase: Boolean
+ // Converts all characters to uppercase if true. Default is false.
+ uppercase: false,
+
+ // lowercase: Boolean
+ // Converts all characters to lowercase if true. Default is false.
+ lowercase: false,
+
+ // propercase: Boolean
+ // Converts the first character of each word to uppercase if true.
+ propercase: false,
+
+ // maxLength: String
+ // HTML INPUT tag maxLength declaration.
+ maxLength: "",
+
+ // selectOnClick: [const] Boolean
+ // If true, all text will be selected when focused with mouse
+ selectOnClick: false,
+
+ // placeHolder: String
+ // Defines a hint to help users fill out the input field (as defined in HTML 5).
+ // This should only contain plain text (no html markup).
+ placeHolder: "",
+
+ baseClass: "mblTextBox",
+
+ attributeMap: dojo.delegate(dojox.mobile.app._FormValueWidget.prototype.attributeMap, {
+ maxLength: "focusNode"
+ }),
+
+ buildRendering: function(){
+ var node = this.srcNodeRef;
+
+ // If an input is used as the source node, wrap it in a div
+ if(!node || node.tagName != "INPUT"){
+ node = dojo.create("input", {});
+ }
+
+ dojo.attr(node, {
+ type: "text",
+ value: dojo.attr(node, "value") || "",
+ placeholder: this.placeHolder || null
+ });
+
+ this.domNode = this.textbox = this.focusNode = node;
+ },
+
+ _setPlaceHolderAttr: function(v){
+ this.placeHolder = v;
+ if(this.textbox){
+ dojo.attr(this.textbox, "placeholder", v);
+ }
+ },
+
+
+ _getValueAttr: function(){
+ // summary:
+ // Hook so attr('value') works as we like.
+ // description:
+ // For `dijit.form.TextBox` this basically returns the value of the <input>.
+ //
+ // For `dijit.form.MappedTextBox` subclasses, which have both
+ // a "displayed value" and a separate "submit value",
+ // This treats the "displayed value" as the master value, computing the
+ // submit value from it via this.parse().
+ return this.parse(this.get('displayedValue'), this.constraints);
+ },
+
+ _setValueAttr: function(value, /*Boolean?*/ priorityChange, /*String?*/ formattedValue){
+ // summary:
+ // Hook so attr('value', ...) works.
+ //
+ // description:
+ // Sets the value of the widget to "value" which can be of
+ // any type as determined by the widget.
+ //
+ // value:
+ // The visual element value is also set to a corresponding,
+ // but not necessarily the same, value.
+ //
+ // formattedValue:
+ // If specified, used to set the visual element value,
+ // otherwise a computed visual value is used.
+ //
+ // priorityChange:
+ // If true, an onChange event is fired immediately instead of
+ // waiting for the next blur event.
+
+ var filteredValue;
+ if(value !== undefined){
+ // TODO: this is calling filter() on both the display value and the actual value.
+ // I added a comment to the filter() definition about this, but it should be changed.
+ filteredValue = this.filter(value);
+ if(typeof formattedValue != "string"){
+ if(filteredValue !== null
+ && ((typeof filteredValue != "number") || !isNaN(filteredValue))){
+ formattedValue = this.filter(this.format(filteredValue, this.constraints));
+ }else{ formattedValue = ''; }
+ }
+ }
+ if(formattedValue != null && formattedValue != undefined
+ && ((typeof formattedValue) != "number" || !isNaN(formattedValue))
+ && this.textbox.value != formattedValue){
+ this.textbox.value = formattedValue;
+ }
+
+ this.inherited(arguments, [filteredValue, priorityChange]);
+ },
+
+ // displayedValue: String
+ // For subclasses like ComboBox where the displayed value
+ // (ex: Kentucky) and the serialized value (ex: KY) are different,
+ // this represents the displayed value.
+ //
+ // Setting 'displayedValue' through attr('displayedValue', ...)
+ // updates 'value', and vice-versa. Otherwise 'value' is updated
+ // from 'displayedValue' periodically, like onBlur etc.
+ //
+ // TODO: move declaration to MappedTextBox?
+ // Problem is that ComboBox references displayedValue,
+ // for benefit of FilteringSelect.
+ displayedValue: "",
+
+ _getDisplayedValueAttr: function(){
+ // summary:
+ // Hook so attr('displayedValue') works.
+ // description:
+ // Returns the displayed value (what the user sees on the screen),
+ // after filtering (ie, trimming spaces etc.).
+ //
+ // For some subclasses of TextBox (like ComboBox), the displayed value
+ // is different from the serialized value that's actually
+ // sent to the server (see dijit.form.ValidationTextBox.serialize)
+
+ return this.filter(this.textbox.value);
+ },
+
+ _setDisplayedValueAttr: function(/*String*/value){
+ // summary:
+ // Hook so attr('displayedValue', ...) works.
+ // description:
+ // Sets the value of the visual element to the string "value".
+ // The widget value is also set to a corresponding,
+ // but not necessarily the same, value.
+
+ if(value === null || value === undefined){ value = '' }
+ else if(typeof value != "string"){ value = String(value) }
+ this.textbox.value = value;
+ this._setValueAttr(this.get('value'), undefined, value);
+ },
+
+ format: function(/* String */ value, /* Object */ constraints){
+ // summary:
+ // Replacable function to convert a value to a properly formatted string.
+ // tags:
+ // protected extension
+ return ((value == null || value == undefined) ? "" : (value.toString ? value.toString() : value));
+ },
+
+ parse: function(/* String */ value, /* Object */ constraints){
+ // summary:
+ // Replacable function to convert a formatted string to a value
+ // tags:
+ // protected extension
+
+ return value; // String
+ },
+
+ _refreshState: function(){
+ // summary:
+ // After the user types some characters, etc., this method is
+ // called to check the field for validity etc. The base method
+ // in `dijit.form.TextBox` does nothing, but subclasses override.
+ // tags:
+ // protected
+ },
+
+ _onInput: function(e){
+ if(e && e.type && /key/i.test(e.type) && e.keyCode){
+ switch(e.keyCode){
+ case dojo.keys.SHIFT:
+ case dojo.keys.ALT:
+ case dojo.keys.CTRL:
+ case dojo.keys.TAB:
+ return;
+ }
+ }
+ if(this.intermediateChanges){
+ var _this = this;
+ // the setTimeout allows the key to post to the widget input box
+ setTimeout(function(){ _this._handleOnChange(_this.get('value'), false); }, 0);
+ }
+ this._refreshState();
+ },
+
+ postCreate: function(){
+ // setting the value here is needed since value="" in the template causes "undefined"
+ // and setting in the DOM (instead of the JS object) helps with form reset actions
+
+ this.textbox.setAttribute("value", this.textbox.value); // DOM and JS values shuld be the same
+ this.inherited(arguments);
+ if(dojo.isMoz || dojo.isOpera){
+ this.connect(this.textbox, "oninput", this._onInput);
+ }else{
+ this.connect(this.textbox, "onkeydown", this._onInput);
+ this.connect(this.textbox, "onkeyup", this._onInput);
+ this.connect(this.textbox, "onpaste", this._onInput);
+ this.connect(this.textbox, "oncut", this._onInput);
+ }
+ },
+
+ _blankValue: '', // if the textbox is blank, what value should be reported
+ filter: function(val){
+ // summary:
+ // Auto-corrections (such as trimming) that are applied to textbox
+ // value on blur or form submit.
+ // description:
+ // For MappedTextBox subclasses, this is called twice
+ // - once with the display value
+ // - once the value as set/returned by attr('value', ...)
+ // and attr('value'), ex: a Number for NumberTextBox.
+ //
+ // In the latter case it does corrections like converting null to NaN. In
+ // the former case the NumberTextBox.filter() method calls this.inherited()
+ // to execute standard trimming code in TextBox.filter().
+ //
+ // TODO: break this into two methods in 2.0
+ //
+ // tags:
+ // protected extension
+ if(val === null){ return this._blankValue; }
+ if(typeof val != "string"){ return val; }
+ if(this.trim){
+ val = dojo.trim(val);
+ }
+ if(this.uppercase){
+ val = val.toUpperCase();
+ }
+ if(this.lowercase){
+ val = val.toLowerCase();
+ }
+ if(this.propercase){
+ val = val.replace(/[^\s]+/g, function(word){
+ return word.substring(0,1).toUpperCase() + word.substring(1);
+ });
+ }
+ return val;
+ },
+
+ _setBlurValue: function(){
+ this._setValueAttr(this.get('value'), true);
+ },
+
+ _onBlur: function(e){
+ if(this.disabled){ return; }
+ this._setBlurValue();
+ this.inherited(arguments);
+
+ if(this._selectOnClickHandle){
+ this.disconnect(this._selectOnClickHandle);
+ }
+ if(this.selectOnClick && dojo.isMoz){
+ this.textbox.selectionStart = this.textbox.selectionEnd = undefined; // clear selection so that the next mouse click doesn't reselect
+ }
+
+ },
+
+ _onFocus: function(/*String*/ by){
+ if(this.disabled || this.readOnly){ return; }
+
+ // Select all text on focus via click if nothing already selected.
+ // Since mouse-up will clear the selection need to defer selection until after mouse-up.
+ // Don't do anything on focus by tabbing into the widget since there's no associated mouse-up event.
+ if(this.selectOnClick && by == "mouse"){
+ this._selectOnClickHandle = this.connect(this.domNode, "onmouseup", function(){
+ // Only select all text on first click; otherwise users would have no way to clear
+ // the selection.
+ this.disconnect(this._selectOnClickHandle);
+
+ // Check if the user selected some text manually (mouse-down, mouse-move, mouse-up)
+ // and if not, then select all the text
+ var textIsNotSelected;
+ textIsNotSelected = this.textbox.selectionStart == this.textbox.selectionEnd;
+ if(textIsNotSelected){
+ this.selectInputText(this.textbox);
+ }
+ });
+ }
+
+ this._refreshState();
+ this.inherited(arguments);
+ },
+
+ reset: function(){
+ // Overrides dijit._FormWidget.reset().
+ // Additionally resets the displayed textbox value to ''
+ this.textbox.value = '';
+ this.inherited(arguments);
+ }
+ }
+);
+
+}
diff --git a/js/dojo-1.6/dojox/mobile/app/TextBox.xd.js b/js/dojo-1.6/dojox/mobile/app/TextBox.xd.js
new file mode 100644
index 0000000..ac55c3b
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/TextBox.xd.js
@@ -0,0 +1,336 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.mobile.app.TextBox"],
+["require", "dojox.mobile.app._Widget"],
+["require", "dojox.mobile.app._FormWidget"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.mobile.app.TextBox"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.TextBox"] = true;
+dojo.provide("dojox.mobile.app.TextBox");
+dojo.experimental("dojox.mobile.app.TextBox");
+
+dojo.require("dojox.mobile.app._Widget");
+dojo.require("dojox.mobile.app._FormWidget");
+
+dojo.declare(
+ "dojox.mobile.app.TextBox",
+ dojox.mobile.app._FormValueWidget, {
+
+ // summary:
+ // A base class for textbox form inputs
+
+ // trim: Boolean
+ // Removes leading and trailing whitespace if true. Default is false.
+ trim: false,
+
+ // uppercase: Boolean
+ // Converts all characters to uppercase if true. Default is false.
+ uppercase: false,
+
+ // lowercase: Boolean
+ // Converts all characters to lowercase if true. Default is false.
+ lowercase: false,
+
+ // propercase: Boolean
+ // Converts the first character of each word to uppercase if true.
+ propercase: false,
+
+ // maxLength: String
+ // HTML INPUT tag maxLength declaration.
+ maxLength: "",
+
+ // selectOnClick: [const] Boolean
+ // If true, all text will be selected when focused with mouse
+ selectOnClick: false,
+
+ // placeHolder: String
+ // Defines a hint to help users fill out the input field (as defined in HTML 5).
+ // This should only contain plain text (no html markup).
+ placeHolder: "",
+
+ baseClass: "mblTextBox",
+
+ attributeMap: dojo.delegate(dojox.mobile.app._FormValueWidget.prototype.attributeMap, {
+ maxLength: "focusNode"
+ }),
+
+ buildRendering: function(){
+ var node = this.srcNodeRef;
+
+ // If an input is used as the source node, wrap it in a div
+ if(!node || node.tagName != "INPUT"){
+ node = dojo.create("input", {});
+ }
+
+ dojo.attr(node, {
+ type: "text",
+ value: dojo.attr(node, "value") || "",
+ placeholder: this.placeHolder || null
+ });
+
+ this.domNode = this.textbox = this.focusNode = node;
+ },
+
+ _setPlaceHolderAttr: function(v){
+ this.placeHolder = v;
+ if(this.textbox){
+ dojo.attr(this.textbox, "placeholder", v);
+ }
+ },
+
+
+ _getValueAttr: function(){
+ // summary:
+ // Hook so attr('value') works as we like.
+ // description:
+ // For `dijit.form.TextBox` this basically returns the value of the <input>.
+ //
+ // For `dijit.form.MappedTextBox` subclasses, which have both
+ // a "displayed value" and a separate "submit value",
+ // This treats the "displayed value" as the master value, computing the
+ // submit value from it via this.parse().
+ return this.parse(this.get('displayedValue'), this.constraints);
+ },
+
+ _setValueAttr: function(value, /*Boolean?*/ priorityChange, /*String?*/ formattedValue){
+ // summary:
+ // Hook so attr('value', ...) works.
+ //
+ // description:
+ // Sets the value of the widget to "value" which can be of
+ // any type as determined by the widget.
+ //
+ // value:
+ // The visual element value is also set to a corresponding,
+ // but not necessarily the same, value.
+ //
+ // formattedValue:
+ // If specified, used to set the visual element value,
+ // otherwise a computed visual value is used.
+ //
+ // priorityChange:
+ // If true, an onChange event is fired immediately instead of
+ // waiting for the next blur event.
+
+ var filteredValue;
+ if(value !== undefined){
+ // TODO: this is calling filter() on both the display value and the actual value.
+ // I added a comment to the filter() definition about this, but it should be changed.
+ filteredValue = this.filter(value);
+ if(typeof formattedValue != "string"){
+ if(filteredValue !== null
+ && ((typeof filteredValue != "number") || !isNaN(filteredValue))){
+ formattedValue = this.filter(this.format(filteredValue, this.constraints));
+ }else{ formattedValue = ''; }
+ }
+ }
+ if(formattedValue != null && formattedValue != undefined
+ && ((typeof formattedValue) != "number" || !isNaN(formattedValue))
+ && this.textbox.value != formattedValue){
+ this.textbox.value = formattedValue;
+ }
+
+ this.inherited(arguments, [filteredValue, priorityChange]);
+ },
+
+ // displayedValue: String
+ // For subclasses like ComboBox where the displayed value
+ // (ex: Kentucky) and the serialized value (ex: KY) are different,
+ // this represents the displayed value.
+ //
+ // Setting 'displayedValue' through attr('displayedValue', ...)
+ // updates 'value', and vice-versa. Otherwise 'value' is updated
+ // from 'displayedValue' periodically, like onBlur etc.
+ //
+ // TODO: move declaration to MappedTextBox?
+ // Problem is that ComboBox references displayedValue,
+ // for benefit of FilteringSelect.
+ displayedValue: "",
+
+ _getDisplayedValueAttr: function(){
+ // summary:
+ // Hook so attr('displayedValue') works.
+ // description:
+ // Returns the displayed value (what the user sees on the screen),
+ // after filtering (ie, trimming spaces etc.).
+ //
+ // For some subclasses of TextBox (like ComboBox), the displayed value
+ // is different from the serialized value that's actually
+ // sent to the server (see dijit.form.ValidationTextBox.serialize)
+
+ return this.filter(this.textbox.value);
+ },
+
+ _setDisplayedValueAttr: function(/*String*/value){
+ // summary:
+ // Hook so attr('displayedValue', ...) works.
+ // description:
+ // Sets the value of the visual element to the string "value".
+ // The widget value is also set to a corresponding,
+ // but not necessarily the same, value.
+
+ if(value === null || value === undefined){ value = '' }
+ else if(typeof value != "string"){ value = String(value) }
+ this.textbox.value = value;
+ this._setValueAttr(this.get('value'), undefined, value);
+ },
+
+ format: function(/* String */ value, /* Object */ constraints){
+ // summary:
+ // Replacable function to convert a value to a properly formatted string.
+ // tags:
+ // protected extension
+ return ((value == null || value == undefined) ? "" : (value.toString ? value.toString() : value));
+ },
+
+ parse: function(/* String */ value, /* Object */ constraints){
+ // summary:
+ // Replacable function to convert a formatted string to a value
+ // tags:
+ // protected extension
+
+ return value; // String
+ },
+
+ _refreshState: function(){
+ // summary:
+ // After the user types some characters, etc., this method is
+ // called to check the field for validity etc. The base method
+ // in `dijit.form.TextBox` does nothing, but subclasses override.
+ // tags:
+ // protected
+ },
+
+ _onInput: function(e){
+ if(e && e.type && /key/i.test(e.type) && e.keyCode){
+ switch(e.keyCode){
+ case dojo.keys.SHIFT:
+ case dojo.keys.ALT:
+ case dojo.keys.CTRL:
+ case dojo.keys.TAB:
+ return;
+ }
+ }
+ if(this.intermediateChanges){
+ var _this = this;
+ // the setTimeout allows the key to post to the widget input box
+ setTimeout(function(){ _this._handleOnChange(_this.get('value'), false); }, 0);
+ }
+ this._refreshState();
+ },
+
+ postCreate: function(){
+ // setting the value here is needed since value="" in the template causes "undefined"
+ // and setting in the DOM (instead of the JS object) helps with form reset actions
+
+ this.textbox.setAttribute("value", this.textbox.value); // DOM and JS values shuld be the same
+ this.inherited(arguments);
+ if(dojo.isMoz || dojo.isOpera){
+ this.connect(this.textbox, "oninput", this._onInput);
+ }else{
+ this.connect(this.textbox, "onkeydown", this._onInput);
+ this.connect(this.textbox, "onkeyup", this._onInput);
+ this.connect(this.textbox, "onpaste", this._onInput);
+ this.connect(this.textbox, "oncut", this._onInput);
+ }
+ },
+
+ _blankValue: '', // if the textbox is blank, what value should be reported
+ filter: function(val){
+ // summary:
+ // Auto-corrections (such as trimming) that are applied to textbox
+ // value on blur or form submit.
+ // description:
+ // For MappedTextBox subclasses, this is called twice
+ // - once with the display value
+ // - once the value as set/returned by attr('value', ...)
+ // and attr('value'), ex: a Number for NumberTextBox.
+ //
+ // In the latter case it does corrections like converting null to NaN. In
+ // the former case the NumberTextBox.filter() method calls this.inherited()
+ // to execute standard trimming code in TextBox.filter().
+ //
+ // TODO: break this into two methods in 2.0
+ //
+ // tags:
+ // protected extension
+ if(val === null){ return this._blankValue; }
+ if(typeof val != "string"){ return val; }
+ if(this.trim){
+ val = dojo.trim(val);
+ }
+ if(this.uppercase){
+ val = val.toUpperCase();
+ }
+ if(this.lowercase){
+ val = val.toLowerCase();
+ }
+ if(this.propercase){
+ val = val.replace(/[^\s]+/g, function(word){
+ return word.substring(0,1).toUpperCase() + word.substring(1);
+ });
+ }
+ return val;
+ },
+
+ _setBlurValue: function(){
+ this._setValueAttr(this.get('value'), true);
+ },
+
+ _onBlur: function(e){
+ if(this.disabled){ return; }
+ this._setBlurValue();
+ this.inherited(arguments);
+
+ if(this._selectOnClickHandle){
+ this.disconnect(this._selectOnClickHandle);
+ }
+ if(this.selectOnClick && dojo.isMoz){
+ this.textbox.selectionStart = this.textbox.selectionEnd = undefined; // clear selection so that the next mouse click doesn't reselect
+ }
+
+ },
+
+ _onFocus: function(/*String*/ by){
+ if(this.disabled || this.readOnly){ return; }
+
+ // Select all text on focus via click if nothing already selected.
+ // Since mouse-up will clear the selection need to defer selection until after mouse-up.
+ // Don't do anything on focus by tabbing into the widget since there's no associated mouse-up event.
+ if(this.selectOnClick && by == "mouse"){
+ this._selectOnClickHandle = this.connect(this.domNode, "onmouseup", function(){
+ // Only select all text on first click; otherwise users would have no way to clear
+ // the selection.
+ this.disconnect(this._selectOnClickHandle);
+
+ // Check if the user selected some text manually (mouse-down, mouse-move, mouse-up)
+ // and if not, then select all the text
+ var textIsNotSelected;
+ textIsNotSelected = this.textbox.selectionStart == this.textbox.selectionEnd;
+ if(textIsNotSelected){
+ this.selectInputText(this.textbox);
+ }
+ });
+ }
+
+ this._refreshState();
+ this.inherited(arguments);
+ },
+
+ reset: function(){
+ // Overrides dijit._FormWidget.reset().
+ // Additionally resets the displayed textbox value to ''
+ this.textbox.value = '';
+ this.inherited(arguments);
+ }
+ }
+);
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/mobile/app/_FormWidget.js b/js/dojo-1.6/dojox/mobile/app/_FormWidget.js
new file mode 100644
index 0000000..ccf0091
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/_FormWidget.js
@@ -0,0 +1,298 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.mobile.app._FormWidget"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app._FormWidget"] = true;
+dojo.provide("dojox.mobile.app._FormWidget");
+dojo.experimental("dojox.mobile.app._FormWidget");
+
+dojo.require("dojo.window");
+
+dojo.require("dijit._WidgetBase");
+
+dojo.declare("dojox.mobile.app._FormWidget", dijit._WidgetBase, {
+ // summary:
+ // Base class for widgets corresponding to native HTML elements such as <checkbox> or <button>,
+ // which can be children of a <form> node or a `dojox.mobile.app.Form` widget.
+ //
+ // description:
+ // Represents a single HTML element.
+ // All these widgets should have these attributes just like native HTML input elements.
+ // You can set them during widget construction or afterwards, via `dijit._WidgetBase.attr`.
+ //
+ // They also share some common methods.
+
+ // name: String
+ // Name used when submitting form; same as "name" attribute or plain HTML elements
+ name: "",
+
+ // alt: String
+ // Corresponds to the native HTML <input> element's attribute.
+ alt: "",
+
+ // value: String
+ // Corresponds to the native HTML <input> element's attribute.
+ value: "",
+
+ // type: String
+ // Corresponds to the native HTML <input> element's attribute.
+ type: "text",
+
+ // disabled: Boolean
+ // Should this widget respond to user input?
+ // In markup, this is specified as "disabled='disabled'", or just "disabled".
+ disabled: false,
+
+ // intermediateChanges: Boolean
+ // Fires onChange for each value change or only on demand
+ intermediateChanges: false,
+
+ // scrollOnFocus: Boolean
+ // On focus, should this widget scroll into view?
+ scrollOnFocus: false,
+
+ // These mixins assume that the focus node is an INPUT, as many but not all _FormWidgets are.
+ attributeMap: dojo.delegate(dijit._WidgetBase.prototype.attributeMap, {
+ value: "focusNode",
+ id: "focusNode",
+ alt: "focusNode",
+ title: "focusNode"
+ }),
+
+ postMixInProperties: function(){
+ // Setup name=foo string to be referenced from the template (but only if a name has been specified)
+ // Unfortunately we can't use attributeMap to set the name due to IE limitations, see #8660
+ // Regarding escaping, see heading "Attribute values" in
+ // http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.3.2
+ this.nameAttrSetting = this.name ? ('name="' + this.name.replace(/'/g, "&quot;") + '"') : '';
+ this.inherited(arguments);
+ },
+
+ postCreate: function(){
+ this.inherited(arguments);
+ this.connect(this.domNode, "onmousedown", "_onMouseDown");
+ },
+
+ _setDisabledAttr: function(/*Boolean*/ value){
+ this.disabled = value;
+ dojo.attr(this.focusNode, 'disabled', value);
+ if(this.valueNode){
+ dojo.attr(this.valueNode, 'disabled', value);
+ }
+ },
+
+ _onFocus: function(e){
+ if(this.scrollOnFocus){
+ dojo.window.scrollIntoView(this.domNode);
+ }
+ this.inherited(arguments);
+ },
+
+ isFocusable: function(){
+ // summary:
+ // Tells if this widget is focusable or not. Used internally by dijit.
+ // tags:
+ // protected
+ return !this.disabled && !this.readOnly
+ && this.focusNode && (dojo.style(this.domNode, "display") != "none");
+ },
+
+ focus: function(){
+ // summary:
+ // Put focus on this widget
+ this.focusNode.focus();
+ },
+
+ compare: function(/*anything*/val1, /*anything*/val2){
+ // summary:
+ // Compare 2 values (as returned by attr('value') for this widget).
+ // tags:
+ // protected
+ if(typeof val1 == "number" && typeof val2 == "number"){
+ return (isNaN(val1) && isNaN(val2)) ? 0 : val1 - val2;
+ }else if(val1 > val2){
+ return 1;
+ }else if(val1 < val2){
+ return -1;
+ }else{
+ return 0;
+ }
+ },
+
+ onChange: function(newValue){
+ // summary:
+ // Callback when this widget's value is changed.
+ // tags:
+ // callback
+ },
+
+ // _onChangeActive: [private] Boolean
+ // Indicates that changes to the value should call onChange() callback.
+ // This is false during widget initialization, to avoid calling onChange()
+ // when the initial value is set.
+ _onChangeActive: false,
+
+ _handleOnChange: function(/*anything*/ newValue, /* Boolean? */ priorityChange){
+ // summary:
+ // Called when the value of the widget is set. Calls onChange() if appropriate
+ // newValue:
+ // the new value
+ // priorityChange:
+ // For a slider, for example, dragging the slider is priorityChange==false,
+ // but on mouse up, it's priorityChange==true. If intermediateChanges==true,
+ // onChange is only called form priorityChange=true events.
+ // tags:
+ // private
+ this._lastValue = newValue;
+ if(this._lastValueReported == undefined && (priorityChange === null || !this._onChangeActive)){
+ // this block executes not for a change, but during initialization,
+ // and is used to store away the original value (or for ToggleButton, the original checked state)
+ this._resetValue = this._lastValueReported = newValue;
+ }
+ if((this.intermediateChanges || priorityChange || priorityChange === undefined) &&
+ ((typeof newValue != typeof this._lastValueReported) ||
+ this.compare(newValue, this._lastValueReported) != 0)){
+ this._lastValueReported = newValue;
+ if(this._onChangeActive){
+ if(this._onChangeHandle){
+ clearTimeout(this._onChangeHandle);
+ }
+ // setTimout allows hidden value processing to run and
+ // also the onChange handler can safely adjust focus, etc
+ this._onChangeHandle = setTimeout(dojo.hitch(this,
+ function(){
+ this._onChangeHandle = null;
+ this.onChange(newValue);
+ }), 0); // try to collapse multiple onChange's fired faster than can be processed
+ }
+ }
+ },
+
+ create: function(){
+ // Overrides _Widget.create()
+ this.inherited(arguments);
+ this._onChangeActive = true;
+ },
+
+ destroy: function(){
+ if(this._onChangeHandle){ // destroy called before last onChange has fired
+ clearTimeout(this._onChangeHandle);
+ this.onChange(this._lastValueReported);
+ }
+ this.inherited(arguments);
+ },
+
+ _onMouseDown: function(e){
+ // If user clicks on the button, even if the mouse is released outside of it,
+ // this button should get focus (to mimics native browser buttons).
+ // This is also needed on chrome because otherwise buttons won't get focus at all,
+ // which leads to bizarre focus restore on Dialog close etc.
+ if(this.isFocusable()){
+ // Set a global event to handle mouseup, so it fires properly
+ // even if the cursor leaves this.domNode before the mouse up event.
+ var mouseUpConnector = this.connect(dojo.body(), "onmouseup", function(){
+ if(this.isFocusable()){
+ this.focus();
+ }
+ this.disconnect(mouseUpConnector);
+ });
+ }
+ },
+
+ selectInputText: function(/*DomNode*/element, /*Number?*/ start, /*Number?*/ stop){
+ // summary:
+ // Select text in the input element argument, from start (default 0), to stop (default end).
+
+ // TODO: use functions in _editor/selection.js?
+ var _window = dojo.global;
+ var _document = dojo.doc;
+ element = dojo.byId(element);
+ if(isNaN(start)){ start = 0; }
+ if(isNaN(stop)){ stop = element.value ? element.value.length : 0; }
+ dijit.focus(element);
+
+ if(_window["getSelection"] && element.setSelectionRange){
+ element.setSelectionRange(start, stop);
+ }
+ }
+});
+
+dojo.declare("dojox.mobile.app._FormValueWidget", dojox.mobile.app._FormWidget,
+{
+ // summary:
+ // Base class for widgets corresponding to native HTML elements such as <input> or <select> that have user changeable values.
+ // description:
+ // Each _FormValueWidget represents a single input value, and has a (possibly hidden) <input> element,
+ // to which it serializes it's input value, so that form submission (either normal submission or via FormBind?)
+ // works as expected.
+
+ // Don't attempt to mixin the 'type', 'name' attributes here programatically -- they must be declared
+ // directly in the template as read by the parser in order to function. IE is known to specifically
+ // require the 'name' attribute at element creation time. See #8484, #8660.
+ // TODO: unclear what that {value: ""} is for; FormWidget.attributeMap copies value to focusNode,
+ // so maybe {value: ""} is so the value *doesn't* get copied to focusNode?
+ // Seems like we really want value removed from attributeMap altogether
+ // (although there's no easy way to do that now)
+
+ // readOnly: Boolean
+ // Should this widget respond to user input?
+ // In markup, this is specified as "readOnly".
+ // Similar to disabled except readOnly form values are submitted.
+ readOnly: false,
+
+ attributeMap: dojo.delegate(dojox.mobile.app._FormWidget.prototype.attributeMap, {
+ value: "",
+ readOnly: "focusNode"
+ }),
+
+ _setReadOnlyAttr: function(/*Boolean*/ value){
+ this.readOnly = value;
+ dojo.attr(this.focusNode, 'readOnly', value);
+ },
+
+ postCreate: function(){
+ this.inherited(arguments);
+
+ // Update our reset value if it hasn't yet been set (because this.set()
+ // is only called when there *is* a value)
+ if(this._resetValue === undefined){
+ this._resetValue = this.value;
+ }
+ },
+
+ _setValueAttr: function(/*anything*/ newValue, /*Boolean, optional*/ priorityChange){
+ // summary:
+ // Hook so attr('value', value) works.
+ // description:
+ // Sets the value of the widget.
+ // If the value has changed, then fire onChange event, unless priorityChange
+ // is specified as null (or false?)
+ this.value = newValue;
+ this._handleOnChange(newValue, priorityChange);
+ },
+
+ _getValueAttr: function(){
+ // summary:
+ // Hook so attr('value') works.
+ return this._lastValue;
+ },
+
+ undo: function(){
+ // summary:
+ // Restore the value to the last value passed to onChange
+ this._setValueAttr(this._lastValueReported, false);
+ },
+
+ reset: function(){
+ // summary:
+ // Reset the widget's value to what it was at initialization time
+ this._hasBeenBlurred = false;
+ this._setValueAttr(this._resetValue, true);
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/mobile/app/_FormWidget.xd.js b/js/dojo-1.6/dojox/mobile/app/_FormWidget.xd.js
new file mode 100644
index 0000000..e668725
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/_FormWidget.xd.js
@@ -0,0 +1,304 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.mobile.app._FormWidget"],
+["require", "dojo.window"],
+["require", "dijit._WidgetBase"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.mobile.app._FormWidget"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app._FormWidget"] = true;
+dojo.provide("dojox.mobile.app._FormWidget");
+dojo.experimental("dojox.mobile.app._FormWidget");
+
+dojo.require("dojo.window");
+
+dojo.require("dijit._WidgetBase");
+
+dojo.declare("dojox.mobile.app._FormWidget", dijit._WidgetBase, {
+ // summary:
+ // Base class for widgets corresponding to native HTML elements such as <checkbox> or <button>,
+ // which can be children of a <form> node or a `dojox.mobile.app.Form` widget.
+ //
+ // description:
+ // Represents a single HTML element.
+ // All these widgets should have these attributes just like native HTML input elements.
+ // You can set them during widget construction or afterwards, via `dijit._WidgetBase.attr`.
+ //
+ // They also share some common methods.
+
+ // name: String
+ // Name used when submitting form; same as "name" attribute or plain HTML elements
+ name: "",
+
+ // alt: String
+ // Corresponds to the native HTML <input> element's attribute.
+ alt: "",
+
+ // value: String
+ // Corresponds to the native HTML <input> element's attribute.
+ value: "",
+
+ // type: String
+ // Corresponds to the native HTML <input> element's attribute.
+ type: "text",
+
+ // disabled: Boolean
+ // Should this widget respond to user input?
+ // In markup, this is specified as "disabled='disabled'", or just "disabled".
+ disabled: false,
+
+ // intermediateChanges: Boolean
+ // Fires onChange for each value change or only on demand
+ intermediateChanges: false,
+
+ // scrollOnFocus: Boolean
+ // On focus, should this widget scroll into view?
+ scrollOnFocus: false,
+
+ // These mixins assume that the focus node is an INPUT, as many but not all _FormWidgets are.
+ attributeMap: dojo.delegate(dijit._WidgetBase.prototype.attributeMap, {
+ value: "focusNode",
+ id: "focusNode",
+ alt: "focusNode",
+ title: "focusNode"
+ }),
+
+ postMixInProperties: function(){
+ // Setup name=foo string to be referenced from the template (but only if a name has been specified)
+ // Unfortunately we can't use attributeMap to set the name due to IE limitations, see #8660
+ // Regarding escaping, see heading "Attribute values" in
+ // http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.3.2
+ this.nameAttrSetting = this.name ? ('name="' + this.name.replace(/'/g, "&quot;") + '"') : '';
+ this.inherited(arguments);
+ },
+
+ postCreate: function(){
+ this.inherited(arguments);
+ this.connect(this.domNode, "onmousedown", "_onMouseDown");
+ },
+
+ _setDisabledAttr: function(/*Boolean*/ value){
+ this.disabled = value;
+ dojo.attr(this.focusNode, 'disabled', value);
+ if(this.valueNode){
+ dojo.attr(this.valueNode, 'disabled', value);
+ }
+ },
+
+ _onFocus: function(e){
+ if(this.scrollOnFocus){
+ dojo.window.scrollIntoView(this.domNode);
+ }
+ this.inherited(arguments);
+ },
+
+ isFocusable: function(){
+ // summary:
+ // Tells if this widget is focusable or not. Used internally by dijit.
+ // tags:
+ // protected
+ return !this.disabled && !this.readOnly
+ && this.focusNode && (dojo.style(this.domNode, "display") != "none");
+ },
+
+ focus: function(){
+ // summary:
+ // Put focus on this widget
+ this.focusNode.focus();
+ },
+
+ compare: function(/*anything*/val1, /*anything*/val2){
+ // summary:
+ // Compare 2 values (as returned by attr('value') for this widget).
+ // tags:
+ // protected
+ if(typeof val1 == "number" && typeof val2 == "number"){
+ return (isNaN(val1) && isNaN(val2)) ? 0 : val1 - val2;
+ }else if(val1 > val2){
+ return 1;
+ }else if(val1 < val2){
+ return -1;
+ }else{
+ return 0;
+ }
+ },
+
+ onChange: function(newValue){
+ // summary:
+ // Callback when this widget's value is changed.
+ // tags:
+ // callback
+ },
+
+ // _onChangeActive: [private] Boolean
+ // Indicates that changes to the value should call onChange() callback.
+ // This is false during widget initialization, to avoid calling onChange()
+ // when the initial value is set.
+ _onChangeActive: false,
+
+ _handleOnChange: function(/*anything*/ newValue, /* Boolean? */ priorityChange){
+ // summary:
+ // Called when the value of the widget is set. Calls onChange() if appropriate
+ // newValue:
+ // the new value
+ // priorityChange:
+ // For a slider, for example, dragging the slider is priorityChange==false,
+ // but on mouse up, it's priorityChange==true. If intermediateChanges==true,
+ // onChange is only called form priorityChange=true events.
+ // tags:
+ // private
+ this._lastValue = newValue;
+ if(this._lastValueReported == undefined && (priorityChange === null || !this._onChangeActive)){
+ // this block executes not for a change, but during initialization,
+ // and is used to store away the original value (or for ToggleButton, the original checked state)
+ this._resetValue = this._lastValueReported = newValue;
+ }
+ if((this.intermediateChanges || priorityChange || priorityChange === undefined) &&
+ ((typeof newValue != typeof this._lastValueReported) ||
+ this.compare(newValue, this._lastValueReported) != 0)){
+ this._lastValueReported = newValue;
+ if(this._onChangeActive){
+ if(this._onChangeHandle){
+ clearTimeout(this._onChangeHandle);
+ }
+ // setTimout allows hidden value processing to run and
+ // also the onChange handler can safely adjust focus, etc
+ this._onChangeHandle = setTimeout(dojo.hitch(this,
+ function(){
+ this._onChangeHandle = null;
+ this.onChange(newValue);
+ }), 0); // try to collapse multiple onChange's fired faster than can be processed
+ }
+ }
+ },
+
+ create: function(){
+ // Overrides _Widget.create()
+ this.inherited(arguments);
+ this._onChangeActive = true;
+ },
+
+ destroy: function(){
+ if(this._onChangeHandle){ // destroy called before last onChange has fired
+ clearTimeout(this._onChangeHandle);
+ this.onChange(this._lastValueReported);
+ }
+ this.inherited(arguments);
+ },
+
+ _onMouseDown: function(e){
+ // If user clicks on the button, even if the mouse is released outside of it,
+ // this button should get focus (to mimics native browser buttons).
+ // This is also needed on chrome because otherwise buttons won't get focus at all,
+ // which leads to bizarre focus restore on Dialog close etc.
+ if(this.isFocusable()){
+ // Set a global event to handle mouseup, so it fires properly
+ // even if the cursor leaves this.domNode before the mouse up event.
+ var mouseUpConnector = this.connect(dojo.body(), "onmouseup", function(){
+ if(this.isFocusable()){
+ this.focus();
+ }
+ this.disconnect(mouseUpConnector);
+ });
+ }
+ },
+
+ selectInputText: function(/*DomNode*/element, /*Number?*/ start, /*Number?*/ stop){
+ // summary:
+ // Select text in the input element argument, from start (default 0), to stop (default end).
+
+ // TODO: use functions in _editor/selection.js?
+ var _window = dojo.global;
+ var _document = dojo.doc;
+ element = dojo.byId(element);
+ if(isNaN(start)){ start = 0; }
+ if(isNaN(stop)){ stop = element.value ? element.value.length : 0; }
+ dijit.focus(element);
+
+ if(_window["getSelection"] && element.setSelectionRange){
+ element.setSelectionRange(start, stop);
+ }
+ }
+});
+
+dojo.declare("dojox.mobile.app._FormValueWidget", dojox.mobile.app._FormWidget,
+{
+ // summary:
+ // Base class for widgets corresponding to native HTML elements such as <input> or <select> that have user changeable values.
+ // description:
+ // Each _FormValueWidget represents a single input value, and has a (possibly hidden) <input> element,
+ // to which it serializes it's input value, so that form submission (either normal submission or via FormBind?)
+ // works as expected.
+
+ // Don't attempt to mixin the 'type', 'name' attributes here programatically -- they must be declared
+ // directly in the template as read by the parser in order to function. IE is known to specifically
+ // require the 'name' attribute at element creation time. See #8484, #8660.
+ // TODO: unclear what that {value: ""} is for; FormWidget.attributeMap copies value to focusNode,
+ // so maybe {value: ""} is so the value *doesn't* get copied to focusNode?
+ // Seems like we really want value removed from attributeMap altogether
+ // (although there's no easy way to do that now)
+
+ // readOnly: Boolean
+ // Should this widget respond to user input?
+ // In markup, this is specified as "readOnly".
+ // Similar to disabled except readOnly form values are submitted.
+ readOnly: false,
+
+ attributeMap: dojo.delegate(dojox.mobile.app._FormWidget.prototype.attributeMap, {
+ value: "",
+ readOnly: "focusNode"
+ }),
+
+ _setReadOnlyAttr: function(/*Boolean*/ value){
+ this.readOnly = value;
+ dojo.attr(this.focusNode, 'readOnly', value);
+ },
+
+ postCreate: function(){
+ this.inherited(arguments);
+
+ // Update our reset value if it hasn't yet been set (because this.set()
+ // is only called when there *is* a value)
+ if(this._resetValue === undefined){
+ this._resetValue = this.value;
+ }
+ },
+
+ _setValueAttr: function(/*anything*/ newValue, /*Boolean, optional*/ priorityChange){
+ // summary:
+ // Hook so attr('value', value) works.
+ // description:
+ // Sets the value of the widget.
+ // If the value has changed, then fire onChange event, unless priorityChange
+ // is specified as null (or false?)
+ this.value = newValue;
+ this._handleOnChange(newValue, priorityChange);
+ },
+
+ _getValueAttr: function(){
+ // summary:
+ // Hook so attr('value') works.
+ return this._lastValue;
+ },
+
+ undo: function(){
+ // summary:
+ // Restore the value to the last value passed to onChange
+ this._setValueAttr(this._lastValueReported, false);
+ },
+
+ reset: function(){
+ // summary:
+ // Reset the widget's value to what it was at initialization time
+ this._hasBeenBlurred = false;
+ this._setValueAttr(this._resetValue, true);
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/mobile/app/_Widget.js b/js/dojo-1.6/dojox/mobile/app/_Widget.js
new file mode 100644
index 0000000..27f16e0
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/_Widget.js
@@ -0,0 +1,41 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.mobile.app._Widget"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app._Widget"] = true;
+dojo.provide("dojox.mobile.app._Widget");
+dojo.experimental("dojox.mobile.app._Widget");
+
+dojo.require("dijit._WidgetBase");
+
+dojo.declare("dojox.mobile.app._Widget", dijit._WidgetBase, {
+ // summary:
+ // The base mobile app widget.
+
+ getScroll: function(){
+ // summary:
+ // Returns the scroll position.
+ return {
+ x: dojo.global.scrollX,
+ y: dojo.global.scrollY
+ };
+ },
+
+ connect: function(target, event, fn){
+ if(event.toLowerCase() == "dblclick"
+ || event.toLowerCase() == "ondblclick"){
+
+ if(dojo.global["Mojo"]){
+ // Handle webOS tap event
+ return this.connect(target, Mojo.Event.tap, fn);
+ }
+ }
+ return this.inherited(arguments);
+ }
+});
+
+}
diff --git a/js/dojo-1.6/dojox/mobile/app/_Widget.xd.js b/js/dojo-1.6/dojox/mobile/app/_Widget.xd.js
new file mode 100644
index 0000000..fe33b75
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/_Widget.xd.js
@@ -0,0 +1,46 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.mobile.app._Widget"],
+["require", "dijit._WidgetBase"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.mobile.app._Widget"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app._Widget"] = true;
+dojo.provide("dojox.mobile.app._Widget");
+dojo.experimental("dojox.mobile.app._Widget");
+
+dojo.require("dijit._WidgetBase");
+
+dojo.declare("dojox.mobile.app._Widget", dijit._WidgetBase, {
+ // summary:
+ // The base mobile app widget.
+
+ getScroll: function(){
+ // summary:
+ // Returns the scroll position.
+ return {
+ x: dojo.global.scrollX,
+ y: dojo.global.scrollY
+ };
+ },
+
+ connect: function(target, event, fn){
+ if(event.toLowerCase() == "dblclick"
+ || event.toLowerCase() == "ondblclick"){
+
+ if(dojo.global["Mojo"]){
+ // Handle webOS tap event
+ return this.connect(target, Mojo.Event.tap, fn);
+ }
+ }
+ return this.inherited(arguments);
+ }
+});
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/mobile/app/_base.js b/js/dojo-1.6/dojox/mobile/app/_base.js
new file mode 100644
index 0000000..22eb17a
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/_base.js
@@ -0,0 +1,248 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.mobile.app._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app._base"] = true;
+dojo.provide("dojox.mobile.app._base");
+dojo.experimental("dojox.mobile.app._base");
+
+dojo.require("dijit._base");
+dojo.require("dijit._WidgetBase");
+dojo.require("dojox.mobile");
+dojo.require("dojox.mobile.parser");
+
+dojo.require("dojox.mobile.app._event");
+dojo.require("dojox.mobile.app._Widget");
+dojo.require("dojox.mobile.app.StageController");
+dojo.require("dojox.mobile.app.SceneController");
+dojo.require("dojox.mobile.app.SceneAssistant");
+dojo.require("dojox.mobile.app.AlertDialog");
+dojo.require("dojox.mobile.app.List");
+dojo.require("dojox.mobile.app.ListSelector");
+dojo.require("dojox.mobile.app.TextBox");
+dojo.require("dojox.mobile.app.ImageView");
+dojo.require("dojox.mobile.app.ImageThumbView");
+
+(function(){
+
+ var stageController;
+ var appInfo;
+
+ var jsDependencies = [
+ "dojox.mobile",
+ "dojox.mobile.parser"
+ ];
+
+ var loadedResources = {};
+ var loadingDependencies;
+
+ var rootNode;
+
+ var sceneResources = [];
+
+ // Load the required resources asynchronously, since not all mobile OSes
+ // support dojo.require and sync XHR
+ function loadResources(resources, callback){
+ // summary:
+ // Loads one or more JavaScript files asynchronously. When complete,
+ // the first scene is pushed onto the stack.
+ // resources:
+ // An array of module names, e.g. 'dojox.mobile.AlertDialog'
+
+ var resource;
+ var url;
+
+ do {
+ resource = resources.pop();
+ if (resource.source) {
+ url = resource.source;
+ }else if (resource.module) {
+ url = dojo.baseUrl + dojo._getModuleSymbols(resource.module).join("/") + '.js';
+ }else {
+ alert("Error: invalid JavaScript resource " + dojo.toJson(resource));
+ return;
+ }
+ }while (resources.length > 0 && loadedResources[url]);
+
+ if(resources.length < 1 && loadedResources[url]){
+ // All resources have already been loaded
+ callback();
+ return;
+ }
+
+ dojo.xhrGet({
+ url: url,
+ sync: false
+ }).addCallbacks(function(text){
+ dojo["eval"](text);
+ loadedResources[url] = true;
+ if(resources.length > 0){
+ loadResources(resources, callback);
+ }else{
+ callback();
+ }
+ },
+ function(){
+ alert("Failed to load resource " + url);
+ });
+ }
+
+ var pushFirstScene = function(){
+ // summary:
+ // Pushes the first scene onto the stack.
+
+ stageController = new dojox.mobile.app.StageController(rootNode);
+ var defaultInfo = {
+ id: "com.test.app",
+ version: "1.0.0",
+ initialScene: "main"
+ };
+
+ // If the application info has been defined, as it should be,
+ // use it.
+ if(dojo.global["appInfo"]){
+ dojo.mixin(defaultInfo, dojo.global["appInfo"]);
+ }
+ appInfo = dojox.mobile.app.info = defaultInfo;
+
+ // Set the document title from the app info title if it exists
+ if(appInfo.title){
+ var titleNode = dojo.query("head title")[0] ||
+ dojo.create("title", {},dojo.query("head")[0]);
+ document.title = appInfo.title;
+ }
+
+ stageController.pushScene(appInfo.initialScene);
+ };
+
+ var initBackButton = function(){
+ var hasNativeBack = false;
+ if(dojo.global.BackButton){
+ // Android phonegap support
+ BackButton.override();
+ dojo.connect(document, 'backKeyDown', function(e) {
+ dojo.publish("/dojox/mobile/app/goback");
+ });
+ hasNativeBack = true;
+ }else if(dojo.global.Mojo){
+ // TODO: add webOS support
+ }
+ if(hasNativeBack){
+ dojo.addClass(dojo.body(), "mblNativeBack");
+ }
+ };
+
+ dojo.mixin(dojox.mobile.app, {
+ init: function(node){
+ // summary:
+ // Initializes the mobile app. Creates the
+
+ rootNode = node || dojo.body();
+ dojox.mobile.app.STAGE_CONTROLLER_ACTIVE = true;
+
+ dojo.subscribe("/dojox/mobile/app/goback", function(){
+ stageController.popScene();
+ });
+
+ dojo.subscribe("/dojox/mobile/app/alert", function(params){
+ dojox.mobile.app.getActiveSceneController().showAlertDialog(params);
+ });
+
+ dojo.subscribe("/dojox/mobile/app/pushScene", function(sceneName, params){
+ stageController.pushScene(sceneName, params || {});
+ });
+
+ // Get the list of files to load per scene/view
+ dojo.xhrGet({
+ url: "view-resources.json",
+ load: function(data){
+ var resources = [];
+
+ if(data){
+ // Should be an array
+ sceneResources = data = dojo.fromJson(data);
+
+ // Get the list of files to load that have no scene
+ // specified, and therefore should be loaded on
+ // startup
+ for(var i = 0; i < data.length; i++){
+ if(!data[i].scene){
+ resources.push(data[i]);
+ }
+ }
+ }
+ if(resources.length > 0){
+ loadResources(resources, pushFirstScene);
+ }else{
+ pushFirstScene();
+ }
+ },
+ error: pushFirstScene
+ });
+
+ initBackButton();
+ },
+
+ getActiveSceneController: function(){
+ // summary:
+ // Gets the controller for the active scene.
+
+ return stageController.getActiveSceneController();
+ },
+
+ getStageController: function(){
+ // summary:
+ // Gets the stage controller.
+ return stageController;
+ },
+
+ loadResources: function(resources, callback){
+ loadResources(resources, callback);
+ },
+
+ loadResourcesForScene: function(sceneName, callback){
+ var resources = [];
+
+ // Get the list of files to load that have no scene
+ // specified, and therefore should be loaded on
+ // startup
+ for(var i = 0; i < sceneResources.length; i++){
+ if(sceneResources[i].scene == sceneName){
+ resources.push(sceneResources[i]);
+ }
+ }
+
+ if(resources.length > 0){
+ loadResources(resources, callback);
+ }else{
+ callback();
+ }
+ },
+
+ resolveTemplate: function(sceneName){
+ // summary:
+ // Given the name of a scene, returns the path to it's template
+ // file. For example, for a scene named 'main', the file
+ // returned is 'app/views/main/main-scene.html'
+ // This function can be overridden if it is desired to have
+ // a different name to file mapping.
+ return "app/views/" + sceneName + "/" + sceneName + "-scene.html";
+ },
+
+ resolveAssistant: function(sceneName){
+ // summary:
+ // Given the name of a scene, returns the path to it's assistant
+ // file. For example, for a scene named 'main', the file
+ // returned is 'app/assistants/main-assistant.js'
+ // This function can be overridden if it is desired to have
+ // a different name to file mapping.
+ return "app/assistants/" + sceneName + "-assistant.js";
+ }
+ });
+})();
+
+}
diff --git a/js/dojo-1.6/dojox/mobile/app/_base.xd.js b/js/dojo-1.6/dojox/mobile/app/_base.xd.js
new file mode 100644
index 0000000..36ba440
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/_base.xd.js
@@ -0,0 +1,267 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.mobile.app._base"],
+["require", "dijit._base"],
+["require", "dijit._WidgetBase"],
+["require", "dojox.mobile"],
+["require", "dojox.mobile.parser"],
+["require", "dojox.mobile.app._event"],
+["require", "dojox.mobile.app._Widget"],
+["require", "dojox.mobile.app.StageController"],
+["require", "dojox.mobile.app.SceneController"],
+["require", "dojox.mobile.app.SceneAssistant"],
+["require", "dojox.mobile.app.AlertDialog"],
+["require", "dojox.mobile.app.List"],
+["require", "dojox.mobile.app.ListSelector"],
+["require", "dojox.mobile.app.TextBox"],
+["require", "dojox.mobile.app.ImageView"],
+["require", "dojox.mobile.app.ImageThumbView"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.mobile.app._base"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app._base"] = true;
+dojo.provide("dojox.mobile.app._base");
+dojo.experimental("dojox.mobile.app._base");
+
+dojo.require("dijit._base");
+dojo.require("dijit._WidgetBase");
+dojo.require("dojox.mobile");
+dojo.require("dojox.mobile.parser");
+
+dojo.require("dojox.mobile.app._event");
+dojo.require("dojox.mobile.app._Widget");
+dojo.require("dojox.mobile.app.StageController");
+dojo.require("dojox.mobile.app.SceneController");
+dojo.require("dojox.mobile.app.SceneAssistant");
+dojo.require("dojox.mobile.app.AlertDialog");
+dojo.require("dojox.mobile.app.List");
+dojo.require("dojox.mobile.app.ListSelector");
+dojo.require("dojox.mobile.app.TextBox");
+dojo.require("dojox.mobile.app.ImageView");
+dojo.require("dojox.mobile.app.ImageThumbView");
+
+(function(){
+
+ var stageController;
+ var appInfo;
+
+ var jsDependencies = [
+ "dojox.mobile",
+ "dojox.mobile.parser"
+ ];
+
+ var loadedResources = {};
+ var loadingDependencies;
+
+ var rootNode;
+
+ var sceneResources = [];
+
+ // Load the required resources asynchronously, since not all mobile OSes
+ // support dojo.require and sync XHR
+ function loadResources(resources, callback){
+ // summary:
+ // Loads one or more JavaScript files asynchronously. When complete,
+ // the first scene is pushed onto the stack.
+ // resources:
+ // An array of module names, e.g. 'dojox.mobile.AlertDialog'
+
+ var resource;
+ var url;
+
+ do {
+ resource = resources.pop();
+ if (resource.source) {
+ url = resource.source;
+ }else if (resource.module) {
+ url = dojo.baseUrl + dojo._getModuleSymbols(resource.module).join("/") + '.js';
+ }else {
+ alert("Error: invalid JavaScript resource " + dojo.toJson(resource));
+ return;
+ }
+ }while (resources.length > 0 && loadedResources[url]);
+
+ if(resources.length < 1 && loadedResources[url]){
+ // All resources have already been loaded
+ callback();
+ return;
+ }
+
+ dojo.xhrGet({
+ url: url,
+ sync: false
+ }).addCallbacks(function(text){
+ dojo["eval"](text);
+ loadedResources[url] = true;
+ if(resources.length > 0){
+ loadResources(resources, callback);
+ }else{
+ callback();
+ }
+ },
+ function(){
+ alert("Failed to load resource " + url);
+ });
+ }
+
+ var pushFirstScene = function(){
+ // summary:
+ // Pushes the first scene onto the stack.
+
+ stageController = new dojox.mobile.app.StageController(rootNode);
+ var defaultInfo = {
+ id: "com.test.app",
+ version: "1.0.0",
+ initialScene: "main"
+ };
+
+ // If the application info has been defined, as it should be,
+ // use it.
+ if(dojo.global["appInfo"]){
+ dojo.mixin(defaultInfo, dojo.global["appInfo"]);
+ }
+ appInfo = dojox.mobile.app.info = defaultInfo;
+
+ // Set the document title from the app info title if it exists
+ if(appInfo.title){
+ var titleNode = dojo.query("head title")[0] ||
+ dojo.create("title", {},dojo.query("head")[0]);
+ document.title = appInfo.title;
+ }
+
+ stageController.pushScene(appInfo.initialScene);
+ };
+
+ var initBackButton = function(){
+ var hasNativeBack = false;
+ if(dojo.global.BackButton){
+ // Android phonegap support
+ BackButton.override();
+ dojo.connect(document, 'backKeyDown', function(e) {
+ dojo.publish("/dojox/mobile/app/goback");
+ });
+ hasNativeBack = true;
+ }else if(dojo.global.Mojo){
+ // TODO: add webOS support
+ }
+ if(hasNativeBack){
+ dojo.addClass(dojo.body(), "mblNativeBack");
+ }
+ };
+
+ dojo.mixin(dojox.mobile.app, {
+ init: function(node){
+ // summary:
+ // Initializes the mobile app. Creates the
+
+ rootNode = node || dojo.body();
+ dojox.mobile.app.STAGE_CONTROLLER_ACTIVE = true;
+
+ dojo.subscribe("/dojox/mobile/app/goback", function(){
+ stageController.popScene();
+ });
+
+ dojo.subscribe("/dojox/mobile/app/alert", function(params){
+ dojox.mobile.app.getActiveSceneController().showAlertDialog(params);
+ });
+
+ dojo.subscribe("/dojox/mobile/app/pushScene", function(sceneName, params){
+ stageController.pushScene(sceneName, params || {});
+ });
+
+ // Get the list of files to load per scene/view
+ dojo.xhrGet({
+ url: "view-resources.json",
+ load: function(data){
+ var resources = [];
+
+ if(data){
+ // Should be an array
+ sceneResources = data = dojo.fromJson(data);
+
+ // Get the list of files to load that have no scene
+ // specified, and therefore should be loaded on
+ // startup
+ for(var i = 0; i < data.length; i++){
+ if(!data[i].scene){
+ resources.push(data[i]);
+ }
+ }
+ }
+ if(resources.length > 0){
+ loadResources(resources, pushFirstScene);
+ }else{
+ pushFirstScene();
+ }
+ },
+ error: pushFirstScene
+ });
+
+ initBackButton();
+ },
+
+ getActiveSceneController: function(){
+ // summary:
+ // Gets the controller for the active scene.
+
+ return stageController.getActiveSceneController();
+ },
+
+ getStageController: function(){
+ // summary:
+ // Gets the stage controller.
+ return stageController;
+ },
+
+ loadResources: function(resources, callback){
+ loadResources(resources, callback);
+ },
+
+ loadResourcesForScene: function(sceneName, callback){
+ var resources = [];
+
+ // Get the list of files to load that have no scene
+ // specified, and therefore should be loaded on
+ // startup
+ for(var i = 0; i < sceneResources.length; i++){
+ if(sceneResources[i].scene == sceneName){
+ resources.push(sceneResources[i]);
+ }
+ }
+
+ if(resources.length > 0){
+ loadResources(resources, callback);
+ }else{
+ callback();
+ }
+ },
+
+ resolveTemplate: function(sceneName){
+ // summary:
+ // Given the name of a scene, returns the path to it's template
+ // file. For example, for a scene named 'main', the file
+ // returned is 'app/views/main/main-scene.html'
+ // This function can be overridden if it is desired to have
+ // a different name to file mapping.
+ return "app/views/" + sceneName + "/" + sceneName + "-scene.html";
+ },
+
+ resolveAssistant: function(sceneName){
+ // summary:
+ // Given the name of a scene, returns the path to it's assistant
+ // file. For example, for a scene named 'main', the file
+ // returned is 'app/assistants/main-assistant.js'
+ // This function can be overridden if it is desired to have
+ // a different name to file mapping.
+ return "app/assistants/" + sceneName + "-assistant.js";
+ }
+ });
+})();
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/mobile/app/_event.js b/js/dojo-1.6/dojox/mobile/app/_event.js
new file mode 100644
index 0000000..27f73d1
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/_event.js
@@ -0,0 +1,131 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.mobile.app._event"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app._event"] = true;
+dojo.provide("dojox.mobile.app._event");
+dojo.experimental("dojox.mobile.app._event.js");
+
+dojo.mixin(dojox.mobile.app, {
+ eventMap: {},
+
+ connectFlick: function(target, context, method){
+ // summary:
+ // Listens for a flick event on a DOM node. If the mouse/touch
+ // moves more than 15 pixels in any given direction it is a flick.
+ // The synthetic event fired specifies the direction as
+ // <ul>
+ // <li><b>'ltr'</b> Left To Right</li>
+ // <li><b>'rtl'</b> Right To Left</li>
+ // <li><b>'ttb'</b> Top To Bottom</li>
+ // <li><b>'btt'</b> Bottom To Top</li>
+ // </ul>
+ // target: Node
+ // The DOM node to connect to
+
+ var startX;
+ var startY;
+ var isFlick = false;
+
+ var currentX;
+ var currentY;
+
+ var connMove;
+ var connUp;
+
+ var direction;
+
+ var time;
+
+ // Listen to to the mousedown/touchstart event
+ var connDown = dojo.connect("onmousedown", target, function(event){
+ isFlick = false;
+ startX = event.targetTouches ? event.targetTouches[0].clientX : event.clientX;
+ startY = event.targetTouches ? event.targetTouches[0].clientY : event.clientY;
+
+ time = (new Date()).getTime();
+
+ connMove = dojo.connect(target, "onmousemove", onMove);
+ connUp = dojo.connect(target, "onmouseup", onUp);
+ });
+
+ // The function that handles the mousemove/touchmove event
+ var onMove = function(event){
+ dojo.stopEvent(event);
+
+ currentX = event.targetTouches ? event.targetTouches[0].clientX : event.clientX;
+ currentY = event.targetTouches ? event.targetTouches[0].clientY : event.clientY;
+ if(Math.abs(Math.abs(currentX) - Math.abs(startX)) > 15){
+ isFlick = true;
+
+ direction = (currentX > startX) ? "ltr" : "rtl";
+ }else if(Math.abs(Math.abs(currentY) - Math.abs(startY)) > 15){
+ isFlick = true;
+
+ direction = (currentY > startY) ? "ttb" : "btt";
+ }
+ };
+
+ var onUp = function(event){
+ dojo.stopEvent(event);
+
+ connMove && dojo.disconnect(connMove);
+ connUp && dojo.disconnect(connUp);
+
+ if(isFlick){
+ var flickEvt = {
+ target: target,
+ direction: direction,
+ duration: (new Date()).getTime() - time
+ };
+ if(context && method){
+ context[method](flickEvt);
+ }else{
+ method(flickEvt);
+ }
+ }
+ };
+
+ }
+});
+
+dojox.mobile.app.isIPhone = (dojo.isSafari
+ && (navigator.userAgent.indexOf("iPhone") > -1 ||
+ navigator.userAgent.indexOf("iPod") > -1
+ ));
+dojox.mobile.app.isWebOS = (navigator.userAgent.indexOf("webOS") > -1);
+dojox.mobile.app.isAndroid = (navigator.userAgent.toLowerCase().indexOf("android") > -1);
+
+if(dojox.mobile.app.isIPhone || dojox.mobile.app.isAndroid){
+ // We are touchable.
+ // Override the dojo._connect function to replace mouse events with touch events
+
+ dojox.mobile.app.eventMap = {
+ onmousedown: "ontouchstart",
+ mousedown: "ontouchstart",
+ onmouseup: "ontouchend",
+ mouseup: "ontouchend",
+ onmousemove: "ontouchmove",
+ mousemove: "ontouchmove"
+ };
+
+}
+dojo._oldConnect = dojo._connect;
+dojo._connect = function(obj, event, context, method, dontFix){
+ event = dojox.mobile.app.eventMap[event] || event;
+ if(event == "flick" || event == "onflick"){
+ if(dojo.global["Mojo"]){
+ event = Mojo.Event.flick;
+ }else{
+ return dojox.mobile.app.connectFlick(obj, context, method);
+ }
+ }
+
+ return dojo._oldConnect(obj, event, context, method, dontFix);
+}
+
+}
diff --git a/js/dojo-1.6/dojox/mobile/app/_event.xd.js b/js/dojo-1.6/dojox/mobile/app/_event.xd.js
new file mode 100644
index 0000000..6079ed7
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/_event.xd.js
@@ -0,0 +1,135 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.mobile.app._event"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.mobile.app._event"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app._event"] = true;
+dojo.provide("dojox.mobile.app._event");
+dojo.experimental("dojox.mobile.app._event.js");
+
+dojo.mixin(dojox.mobile.app, {
+ eventMap: {},
+
+ connectFlick: function(target, context, method){
+ // summary:
+ // Listens for a flick event on a DOM node. If the mouse/touch
+ // moves more than 15 pixels in any given direction it is a flick.
+ // The synthetic event fired specifies the direction as
+ // <ul>
+ // <li><b>'ltr'</b> Left To Right</li>
+ // <li><b>'rtl'</b> Right To Left</li>
+ // <li><b>'ttb'</b> Top To Bottom</li>
+ // <li><b>'btt'</b> Bottom To Top</li>
+ // </ul>
+ // target: Node
+ // The DOM node to connect to
+
+ var startX;
+ var startY;
+ var isFlick = false;
+
+ var currentX;
+ var currentY;
+
+ var connMove;
+ var connUp;
+
+ var direction;
+
+ var time;
+
+ // Listen to to the mousedown/touchstart event
+ var connDown = dojo.connect("onmousedown", target, function(event){
+ isFlick = false;
+ startX = event.targetTouches ? event.targetTouches[0].clientX : event.clientX;
+ startY = event.targetTouches ? event.targetTouches[0].clientY : event.clientY;
+
+ time = (new Date()).getTime();
+
+ connMove = dojo.connect(target, "onmousemove", onMove);
+ connUp = dojo.connect(target, "onmouseup", onUp);
+ });
+
+ // The function that handles the mousemove/touchmove event
+ var onMove = function(event){
+ dojo.stopEvent(event);
+
+ currentX = event.targetTouches ? event.targetTouches[0].clientX : event.clientX;
+ currentY = event.targetTouches ? event.targetTouches[0].clientY : event.clientY;
+ if(Math.abs(Math.abs(currentX) - Math.abs(startX)) > 15){
+ isFlick = true;
+
+ direction = (currentX > startX) ? "ltr" : "rtl";
+ }else if(Math.abs(Math.abs(currentY) - Math.abs(startY)) > 15){
+ isFlick = true;
+
+ direction = (currentY > startY) ? "ttb" : "btt";
+ }
+ };
+
+ var onUp = function(event){
+ dojo.stopEvent(event);
+
+ connMove && dojo.disconnect(connMove);
+ connUp && dojo.disconnect(connUp);
+
+ if(isFlick){
+ var flickEvt = {
+ target: target,
+ direction: direction,
+ duration: (new Date()).getTime() - time
+ };
+ if(context && method){
+ context[method](flickEvt);
+ }else{
+ method(flickEvt);
+ }
+ }
+ };
+
+ }
+});
+
+dojox.mobile.app.isIPhone = (dojo.isSafari
+ && (navigator.userAgent.indexOf("iPhone") > -1 ||
+ navigator.userAgent.indexOf("iPod") > -1
+ ));
+dojox.mobile.app.isWebOS = (navigator.userAgent.indexOf("webOS") > -1);
+dojox.mobile.app.isAndroid = (navigator.userAgent.toLowerCase().indexOf("android") > -1);
+
+if(dojox.mobile.app.isIPhone || dojox.mobile.app.isAndroid){
+ // We are touchable.
+ // Override the dojo._connect function to replace mouse events with touch events
+
+ dojox.mobile.app.eventMap = {
+ onmousedown: "ontouchstart",
+ mousedown: "ontouchstart",
+ onmouseup: "ontouchend",
+ mouseup: "ontouchend",
+ onmousemove: "ontouchmove",
+ mousemove: "ontouchmove"
+ };
+
+}
+dojo._oldConnect = dojo._connect;
+dojo._connect = function(obj, event, context, method, dontFix){
+ event = dojox.mobile.app.eventMap[event] || event;
+ if(event == "flick" || event == "onflick"){
+ if(dojo.global["Mojo"]){
+ event = Mojo.Event.flick;
+ }else{
+ return dojox.mobile.app.connectFlick(obj, context, method);
+ }
+ }
+
+ return dojo._oldConnect(obj, event, context, method, dontFix);
+}
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/mobile/app/compat.js b/js/dojo-1.6/dojox/mobile/app/compat.js
new file mode 100644
index 0000000..98507af
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/compat.js
@@ -0,0 +1,14 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+/*
+ This is an optimized version of Dojo, built for deployment and not for
+ development. To get sources and documentation, please visit:
+
+ http://dojotoolkit.org
+*/
+
+if(!dojo._hasResource["dojo.uacss"]){dojo._hasResource["dojo.uacss"]=true;dojo.provide("dojo.uacss");(function(){var d=dojo,_1=d.doc.documentElement,ie=d.isIE,_2=d.isOpera,_3=Math.floor,ff=d.isFF,_4=d.boxModel.replace(/-/,""),_5={dj_ie:ie,dj_ie6:_3(ie)==6,dj_ie7:_3(ie)==7,dj_ie8:_3(ie)==8,dj_ie9:_3(ie)==9,dj_quirks:d.isQuirks,dj_iequirks:ie&&d.isQuirks,dj_opera:_2,dj_khtml:d.isKhtml,dj_webkit:d.isWebKit,dj_safari:d.isSafari,dj_chrome:d.isChrome,dj_gecko:d.isMozilla,dj_ff3:_3(ff)==3};_5["dj_"+_4]=true;var _6="";for(var _7 in _5){if(_5[_7]){_6+=_7+" ";}}_1.className=d.trim(_1.className+" "+_6);dojo._loaders.unshift(function(){if(!dojo._isBodyLtr()){var _8="dj_rtl dijitRtl "+_6.replace(/ /g,"-rtl ");_1.className=d.trim(_1.className+" "+_8);}});})();}if(!dojo._hasResource["dijit._base.sniff"]){dojo._hasResource["dijit._base.sniff"]=true;dojo.provide("dijit._base.sniff");}if(!dojo._hasResource["dojo.fx.Toggler"]){dojo._hasResource["dojo.fx.Toggler"]=true;dojo.provide("dojo.fx.Toggler");dojo.declare("dojo.fx.Toggler",null,{node:null,showFunc:dojo.fadeIn,hideFunc:dojo.fadeOut,showDuration:200,hideDuration:200,constructor:function(_9){var _a=this;dojo.mixin(_a,_9);_a.node=_9.node;_a._showArgs=dojo.mixin({},_9);_a._showArgs.node=_a.node;_a._showArgs.duration=_a.showDuration;_a.showAnim=_a.showFunc(_a._showArgs);_a._hideArgs=dojo.mixin({},_9);_a._hideArgs.node=_a.node;_a._hideArgs.duration=_a.hideDuration;_a.hideAnim=_a.hideFunc(_a._hideArgs);dojo.connect(_a.showAnim,"beforeBegin",dojo.hitch(_a.hideAnim,"stop",true));dojo.connect(_a.hideAnim,"beforeBegin",dojo.hitch(_a.showAnim,"stop",true));},show:function(_b){return this.showAnim.play(_b||0);},hide:function(_c){return this.hideAnim.play(_c||0);}});}if(!dojo._hasResource["dojo.fx"]){dojo._hasResource["dojo.fx"]=true;dojo.provide("dojo.fx");(function(){var d=dojo,_d={_fire:function(_e,_f){if(this[_e]){this[_e].apply(this,_f||[]);}return this;}};var _10=function(_11){this._index=-1;this._animations=_11||[];this._current=this._onAnimateCtx=this._onEndCtx=null;this.duration=0;d.forEach(this._animations,function(a){this.duration+=a.duration;if(a.delay){this.duration+=a.delay;}},this);};d.extend(_10,{_onAnimate:function(){this._fire("onAnimate",arguments);},_onEnd:function(){d.disconnect(this._onAnimateCtx);d.disconnect(this._onEndCtx);this._onAnimateCtx=this._onEndCtx=null;if(this._index+1==this._animations.length){this._fire("onEnd");}else{this._current=this._animations[++this._index];this._onAnimateCtx=d.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd");this._current.play(0,true);}},play:function(_12,_13){if(!this._current){this._current=this._animations[this._index=0];}if(!_13&&this._current.status()=="playing"){return this;}var _14=d.connect(this._current,"beforeBegin",this,function(){this._fire("beforeBegin");}),_15=d.connect(this._current,"onBegin",this,function(arg){this._fire("onBegin",arguments);}),_16=d.connect(this._current,"onPlay",this,function(arg){this._fire("onPlay",arguments);d.disconnect(_14);d.disconnect(_15);d.disconnect(_16);});if(this._onAnimateCtx){d.disconnect(this._onAnimateCtx);}this._onAnimateCtx=d.connect(this._current,"onAnimate",this,"_onAnimate");if(this._onEndCtx){d.disconnect(this._onEndCtx);}this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd");this._current.play.apply(this._current,arguments);return this;},pause:function(){if(this._current){var e=d.connect(this._current,"onPause",this,function(arg){this._fire("onPause",arguments);d.disconnect(e);});this._current.pause();}return this;},gotoPercent:function(_17,_18){this.pause();var _19=this.duration*_17;this._current=null;d.some(this._animations,function(a){if(a.duration<=_19){this._current=a;return true;}_19-=a.duration;return false;});if(this._current){this._current.gotoPercent(_19/this._current.duration,_18);}return this;},stop:function(_1a){if(this._current){if(_1a){for(;this._index+1<this._animations.length;++this._index){this._animations[this._index].stop(true);}this._current=this._animations[this._index];}var e=d.connect(this._current,"onStop",this,function(arg){this._fire("onStop",arguments);d.disconnect(e);});this._current.stop();}return this;},status:function(){return this._current?this._current.status():"stopped";},destroy:function(){if(this._onAnimateCtx){d.disconnect(this._onAnimateCtx);}if(this._onEndCtx){d.disconnect(this._onEndCtx);}}});d.extend(_10,_d);dojo.fx.chain=function(_1b){return new _10(_1b);};var _1c=function(_1d){this._animations=_1d||[];this._connects=[];this._finished=0;this.duration=0;d.forEach(_1d,function(a){var _1e=a.duration;if(a.delay){_1e+=a.delay;}if(this.duration<_1e){this.duration=_1e;}this._connects.push(d.connect(a,"onEnd",this,"_onEnd"));},this);this._pseudoAnimation=new d.Animation({curve:[0,1],duration:this.duration});var _1f=this;d.forEach(["beforeBegin","onBegin","onPlay","onAnimate","onPause","onStop","onEnd"],function(evt){_1f._connects.push(d.connect(_1f._pseudoAnimation,evt,function(){_1f._fire(evt,arguments);}));});};d.extend(_1c,{_doAction:function(_20,_21){d.forEach(this._animations,function(a){a[_20].apply(a,_21);});return this;},_onEnd:function(){if(++this._finished>this._animations.length){this._fire("onEnd");}},_call:function(_22,_23){var t=this._pseudoAnimation;t[_22].apply(t,_23);},play:function(_24,_25){this._finished=0;this._doAction("play",arguments);this._call("play",arguments);return this;},pause:function(){this._doAction("pause",arguments);this._call("pause",arguments);return this;},gotoPercent:function(_26,_27){var ms=this.duration*_26;d.forEach(this._animations,function(a){a.gotoPercent(a.duration<ms?1:(ms/a.duration),_27);});this._call("gotoPercent",arguments);return this;},stop:function(_28){this._doAction("stop",arguments);this._call("stop",arguments);return this;},status:function(){return this._pseudoAnimation.status();},destroy:function(){d.forEach(this._connects,dojo.disconnect);}});d.extend(_1c,_d);dojo.fx.combine=function(_29){return new _1c(_29);};dojo.fx.wipeIn=function(_2a){var _2b=_2a.node=d.byId(_2a.node),s=_2b.style,o;var _2c=d.animateProperty(d.mixin({properties:{height:{start:function(){o=s.overflow;s.overflow="hidden";if(s.visibility=="hidden"||s.display=="none"){s.height="1px";s.display="";s.visibility="";return 1;}else{var _2d=d.style(_2b,"height");return Math.max(_2d,1);}},end:function(){return _2b.scrollHeight;}}}},_2a));d.connect(_2c,"onEnd",function(){s.height="auto";s.overflow=o;});return _2c;};dojo.fx.wipeOut=function(_2e){var _2f=_2e.node=d.byId(_2e.node),s=_2f.style,o;var _30=d.animateProperty(d.mixin({properties:{height:{end:1}}},_2e));d.connect(_30,"beforeBegin",function(){o=s.overflow;s.overflow="hidden";s.display="";});d.connect(_30,"onEnd",function(){s.overflow=o;s.height="auto";s.display="none";});return _30;};dojo.fx.slideTo=function(_31){var _32=_31.node=d.byId(_31.node),top=null,_33=null;var _34=(function(n){return function(){var cs=d.getComputedStyle(n);var pos=cs.position;top=(pos=="absolute"?n.offsetTop:parseInt(cs.top)||0);_33=(pos=="absolute"?n.offsetLeft:parseInt(cs.left)||0);if(pos!="absolute"&&pos!="relative"){var ret=d.position(n,true);top=ret.y;_33=ret.x;n.style.position="absolute";n.style.top=top+"px";n.style.left=_33+"px";}};})(_32);_34();var _35=d.animateProperty(d.mixin({properties:{top:_31.top||0,left:_31.left||0}},_31));d.connect(_35,"beforeBegin",_35,_34);return _35;};})();}if(!dojo._hasResource["dojox.fx.flip"]){dojo._hasResource["dojox.fx.flip"]=true;dojo.provide("dojox.fx.flip");dojo.experimental("dojox.fx.flip");var borderConst="border",widthConst="Width",heightConst="Height",topConst="Top",rightConst="Right",leftConst="Left",bottomConst="Bottom";dojox.fx.flip=function(_36){var _37=dojo.create("div"),_38=_36.node=dojo.byId(_36.node),s=_38.style,_39=null,hs=null,pn=null,_3a=_36.lightColor||"#dddddd",_3b=_36.darkColor||"#555555",_3c=dojo.style(_38,"backgroundColor"),_3d=_36.endColor||_3c,_3e={},_3f=[],_40=_36.duration?_36.duration/2:250,dir=_36.dir||"left",_41=0.9,_42="transparent",_43=_36.whichAnim,_44=_36.axis||"center",_45=_36.depth;var _46=function(_47){return ((new dojo.Color(_47)).toHex()==="#000000")?"#000001":_47;};if(dojo.isIE<7){_3d=_46(_3d);_3a=_46(_3a);_3b=_46(_3b);_3c=_46(_3c);_42="black";_37.style.filter="chroma(color='#000000')";}var _48=(function(n){return function(){var ret=dojo.coords(n,true);_39={top:ret.y,left:ret.x,width:ret.w,height:ret.h};};})(_38);_48();hs={position:"absolute",top:_39["top"]+"px",left:_39["left"]+"px",height:"0",width:"0",zIndex:_36.zIndex||(s.zIndex||0),border:"0 solid "+_42,fontSize:"0",visibility:"hidden"};var _49=[{},{top:_39["top"],left:_39["left"]}];var _4a={left:[leftConst,rightConst,topConst,bottomConst,widthConst,heightConst,"end"+heightConst+"Min",leftConst,"end"+heightConst+"Max"],right:[rightConst,leftConst,topConst,bottomConst,widthConst,heightConst,"end"+heightConst+"Min",leftConst,"end"+heightConst+"Max"],top:[topConst,bottomConst,leftConst,rightConst,heightConst,widthConst,"end"+widthConst+"Min",topConst,"end"+widthConst+"Max"],bottom:[bottomConst,topConst,leftConst,rightConst,heightConst,widthConst,"end"+widthConst+"Min",topConst,"end"+widthConst+"Max"]};pn=_4a[dir];if(typeof _45!="undefined"){_45=Math.max(0,Math.min(1,_45))/2;_41=0.4+(0.5-_45);}else{_41=Math.min(0.9,Math.max(0.4,_39[pn[5].toLowerCase()]/_39[pn[4].toLowerCase()]));}var p0=_49[0];for(var i=4;i<6;i++){if(_44=="center"||_44=="cube"){_39["end"+pn[i]+"Min"]=_39[pn[i].toLowerCase()]*_41;_39["end"+pn[i]+"Max"]=_39[pn[i].toLowerCase()]/_41;}else{if(_44=="shortside"){_39["end"+pn[i]+"Min"]=_39[pn[i].toLowerCase()];_39["end"+pn[i]+"Max"]=_39[pn[i].toLowerCase()]/_41;}else{if(_44=="longside"){_39["end"+pn[i]+"Min"]=_39[pn[i].toLowerCase()]*_41;_39["end"+pn[i]+"Max"]=_39[pn[i].toLowerCase()];}}}}if(_44=="center"){p0[pn[2].toLowerCase()]=_39[pn[2].toLowerCase()]-(_39[pn[8]]-_39[pn[6]])/4;}else{if(_44=="shortside"){p0[pn[2].toLowerCase()]=_39[pn[2].toLowerCase()]-(_39[pn[8]]-_39[pn[6]])/2;}}_3e[pn[5].toLowerCase()]=_39[pn[5].toLowerCase()]+"px";_3e[pn[4].toLowerCase()]="0";_3e[borderConst+pn[1]+widthConst]=_39[pn[4].toLowerCase()]+"px";_3e[borderConst+pn[1]+"Color"]=_3c;p0[borderConst+pn[1]+widthConst]=0;p0[borderConst+pn[1]+"Color"]=_3b;p0[borderConst+pn[2]+widthConst]=p0[borderConst+pn[3]+widthConst]=_44!="cube"?(_39["end"+pn[5]+"Max"]-_39["end"+pn[5]+"Min"])/2:_39[pn[6]]/2;p0[pn[7].toLowerCase()]=_39[pn[7].toLowerCase()]+_39[pn[4].toLowerCase()]/2+(_36.shift||0);p0[pn[5].toLowerCase()]=_39[pn[6]];var p1=_49[1];p1[borderConst+pn[0]+"Color"]={start:_3a,end:_3d};p1[borderConst+pn[0]+widthConst]=_39[pn[4].toLowerCase()];p1[borderConst+pn[2]+widthConst]=0;p1[borderConst+pn[3]+widthConst]=0;p1[pn[5].toLowerCase()]={start:_39[pn[6]],end:_39[pn[5].toLowerCase()]};dojo.mixin(hs,_3e);dojo.style(_37,hs);dojo.body().appendChild(_37);var _4b=function(){dojo.destroy(_37);s.backgroundColor=_3d;s.visibility="visible";};if(_43=="last"){for(i in p0){p0[i]={start:p0[i]};}p0[borderConst+pn[1]+"Color"]={start:_3b,end:_3d};p1=p0;}if(!_43||_43=="first"){_3f.push(dojo.animateProperty({node:_37,duration:_40,properties:p0}));}if(!_43||_43=="last"){_3f.push(dojo.animateProperty({node:_37,duration:_40,properties:p1,onEnd:_4b}));}dojo.connect(_3f[0],"play",function(){_37.style.visibility="visible";s.visibility="hidden";});return dojo.fx.chain(_3f);};dojox.fx.flipCube=function(_4c){var _4d=[],mb=dojo.marginBox(_4c.node),_4e=mb.w/2,_4f=mb.h/2,_50={top:{pName:"height",args:[{whichAnim:"first",dir:"top",shift:-_4f},{whichAnim:"last",dir:"bottom",shift:_4f}]},right:{pName:"width",args:[{whichAnim:"first",dir:"right",shift:_4e},{whichAnim:"last",dir:"left",shift:-_4e}]},bottom:{pName:"height",args:[{whichAnim:"first",dir:"bottom",shift:_4f},{whichAnim:"last",dir:"top",shift:-_4f}]},left:{pName:"width",args:[{whichAnim:"first",dir:"left",shift:-_4e},{whichAnim:"last",dir:"right",shift:_4e}]}};var d=_50[_4c.dir||"left"],p=d.args;_4c.duration=_4c.duration?_4c.duration*2:500;_4c.depth=0.8;_4c.axis="cube";for(var i=p.length-1;i>=0;i--){dojo.mixin(_4c,p[i]);_4d.push(dojox.fx.flip(_4c));}return dojo.fx.combine(_4d);};dojox.fx.flipPage=function(_51){var n=_51.node,_52=dojo.coords(n,true),x=_52.x,y=_52.y,w=_52.w,h=_52.h,_53=dojo.style(n,"backgroundColor"),_54=_51.lightColor||"#dddddd",_55=_51.darkColor,_56=dojo.create("div"),_57=[],hn=[],dir=_51.dir||"right",pn={left:["left","right","x","w"],top:["top","bottom","y","h"],right:["left","left","x","w"],bottom:["top","top","y","h"]},_58={right:[1,-1],left:[-1,1],top:[-1,1],bottom:[1,-1]};dojo.style(_56,{position:"absolute",width:w+"px",height:h+"px",top:y+"px",left:x+"px",visibility:"hidden"});var hs=[];for(var i=0;i<2;i++){var r=i%2,d=r?pn[dir][1]:dir,wa=r?"last":"first",_59=r?_53:_54,_5a=r?_59:_51.startColor||n.style.backgroundColor;hn[i]=dojo.clone(_56);var _5b=function(x){return function(){dojo.destroy(hn[x]);};}(i);dojo.body().appendChild(hn[i]);hs[i]={backgroundColor:r?_5a:_53};hs[i][pn[dir][0]]=_52[pn[dir][2]]+_58[dir][0]*i*_52[pn[dir][3]]+"px";dojo.style(hn[i],hs[i]);_57.push(dojox.fx.flip({node:hn[i],dir:d,axis:"shortside",depth:_51.depth,duration:_51.duration/2,shift:_58[dir][i]*_52[pn[dir][3]]/2,darkColor:_55,lightColor:_54,whichAnim:wa,endColor:_59}));dojo.connect(_57[i],"onEnd",_5b);}return dojo.fx.chain(_57);};dojox.fx.flipGrid=function(_5c){var _5d=_5c.rows||4,_5e=_5c.cols||4,_5f=[],_60=dojo.create("div"),n=_5c.node,_61=dojo.coords(n,true),x=_61.x,y=_61.y,nw=_61.w,nh=_61.h,w=_61.w/_5e,h=_61.h/_5d,_62=[];dojo.style(_60,{position:"absolute",width:w+"px",height:h+"px",backgroundColor:dojo.style(n,"backgroundColor")});for(var i=0;i<_5d;i++){var r=i%2,d=r?"right":"left",_63=r?1:-1;var cn=dojo.clone(n);dojo.style(cn,{position:"absolute",width:nw+"px",height:nh+"px",top:y+"px",left:x+"px",clip:"rect("+i*h+"px,"+nw+"px,"+nh+"px,0)"});dojo.body().appendChild(cn);_5f[i]=[];for(var j=0;j<_5e;j++){var hn=dojo.clone(_60),l=r?j:_5e-(j+1);var _64=function(xn,_65,_66){return function(){if(!(_65%2)){dojo.style(xn,{clip:"rect("+_65*h+"px,"+(nw-(_66+1)*w)+"px,"+((_65+1)*h)+"px,0px)"});}else{dojo.style(xn,{clip:"rect("+_65*h+"px,"+nw+"px,"+((_65+1)*h)+"px,"+((_66+1)*w)+"px)"});}};}(cn,i,j);dojo.body().appendChild(hn);dojo.style(hn,{left:x+l*w+"px",top:y+i*h+"px",visibility:"hidden"});var a=dojox.fx.flipPage({node:hn,dir:d,duration:_5c.duration||900,shift:_63*w/2,depth:0.2,darkColor:_5c.darkColor,lightColor:_5c.lightColor,startColor:_5c.startColor||_5c.node.style.backgroundColor}),_67=function(xn){return function(){dojo.destroy(xn);};}(hn);dojo.connect(a,"play",this,_64);dojo.connect(a,"play",this,_67);_5f[i].push(a);}_62.push(dojo.fx.chain(_5f[i]));}dojo.connect(_62[0],"play",function(){dojo.style(n,{visibility:"hidden"});});return dojo.fx.combine(_62);};}if(!dojo._hasResource["dojox.mobile.compat"]){dojo._hasResource["dojox.mobile.compat"]=true;dojo.provide("dojox.mobile.compat");if(!dojo.isWebKit){dojo.extend(dojox.mobile.View,{_doTransition:function(_68,_69,_6a,dir){var _6b;this.wakeUp(_69);if(!_6a||_6a=="none"){_69.style.display="";_68.style.display="none";_69.style.left="0px";this.invokeCallback();}else{if(_6a=="slide"){var w=_68.offsetWidth;var s1=dojo.fx.slideTo({node:_68,duration:400,left:-w*dir,top:_68.offsetTop});var s2=dojo.fx.slideTo({node:_69,duration:400,left:0});_69.style.position="absolute";_69.style.left=w*dir+"px";_69.style.display="";_6b=dojo.fx.combine([s1,s2]);dojo.connect(_6b,"onEnd",this,function(){_68.style.display="none";_69.style.position="relative";this.invokeCallback();});_6b.play();}else{if(_6a=="flip"){_6b=dojox.fx.flip({node:_68,dir:"right",depth:0.5,duration:400});_69.style.position="absolute";_69.style.left="0px";dojo.connect(_6b,"onEnd",this,function(){_68.style.display="none";_69.style.position="relative";_69.style.display="";this.invokeCallback();});_6b.play();}else{if(_6a=="fade"){_6b=dojo.fx.chain([dojo.fadeOut({node:_68,duration:600}),dojo.fadeIn({node:_69,duration:600})]);_69.style.position="absolute";_69.style.left="0px";_69.style.display="";dojo.style(_69,"opacity",0);dojo.connect(_6b,"onEnd",this,function(){_68.style.display="none";_69.style.position="relative";dojo.style(_68,"opacity",1);this.invokeCallback();});_6b.play();}}}}},wakeUp:function(_6c){if(dojo.isIE&&!_6c._wokeup){_6c._wokeup=true;var _6d=_6c.style.display;_6c.style.display="";var _6e=_6c.getElementsByTagName("*");for(var i=0,len=_6e.length;i<len;i++){var val=_6e[i].style.display;_6e[i].style.display="none";_6e[i].style.display="";_6e[i].style.display=val;}_6c.style.display=_6d;}}});dojo.extend(dojox.mobile.Switch,{buildRendering:function(){this.domNode=this.srcNodeRef||dojo.doc.createElement("DIV");this.domNode.className="mblSwitch";this.domNode.innerHTML="<div class=\"mblSwitchInner\">"+"<div class=\"mblSwitchBg mblSwitchBgLeft\">"+"<div class=\"mblSwitchCorner mblSwitchCorner1T\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner2T\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner3T\"></div>"+"<div class=\"mblSwitchText mblSwitchTextLeft\">"+this.leftLabel+"</div>"+"<div class=\"mblSwitchCorner mblSwitchCorner1B\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner2B\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner3B\"></div>"+"</div>"+"<div class=\"mblSwitchBg mblSwitchBgRight\">"+"<div class=\"mblSwitchCorner mblSwitchCorner1T\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner2T\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner3T\"></div>"+"<div class=\"mblSwitchText mblSwitchTextRight\">"+this.rightLabel+"</div>"+"<div class=\"mblSwitchCorner mblSwitchCorner1B\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner2B\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner3B\"></div>"+"</div>"+"<div class=\"mblSwitchKnobContainer\">"+"<div class=\"mblSwitchCorner mblSwitchCorner1T\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner2T\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner3T\"></div>"+"<div class=\"mblSwitchKnob\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner1B\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner2B\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner3B\"></div>"+"</div>"+"</div>";var n=this.inner=this.domNode.firstChild;this.left=n.childNodes[0];this.right=n.childNodes[1];this.knob=n.childNodes[2];dojo.addClass(this.domNode,(this.value=="on")?"mblSwitchOn":"mblSwitchOff");this[this.value=="off"?"left":"right"].style.display="none";},_changeState:function(_6f){if(!this.inner.parentNode||!this.inner.parentNode.tagName){dojo.addClass(this.domNode,(_6f=="on")?"mblSwitchOn":"mblSwitchOff");return;}var pos;if(this.inner.offsetLeft==0){if(_6f=="on"){return;}pos=-53;}else{if(_6f=="off"){return;}pos=0;}var a=dojo.fx.slideTo({node:this.inner,duration:500,left:pos});var _70=this;dojo.connect(a,"onEnd",function(){_70[_6f=="off"?"left":"right"].style.display="none";});a.play();}});if(dojo.isIE||dojo.isBB){dojo.extend(dojox.mobile.RoundRect,{buildRendering:function(){dojox.mobile.createRoundRect(this);this.domNode.className="mblRoundRect";}});dojox.mobile.RoundRectList._addChild=dojox.mobile.RoundRectList.prototype.addChild;dojo.extend(dojox.mobile.RoundRectList,{buildRendering:function(){dojox.mobile.createRoundRect(this,true);this.domNode.className="mblRoundRectList";},postCreate:function(){this.redrawBorders();},addChild:function(_71){dojox.mobile.RoundRectList._addChild.apply(this,arguments);this.redrawBorders();if(dojox.mobile.applyPngFilter){dojox.mobile.applyPngFilter(_71.domNode);}},redrawBorders:function(){var _72=false;for(var i=this.containerNode.childNodes.length-1;i>=0;i--){var c=this.containerNode.childNodes[i];if(c.tagName=="LI"){c.style.borderBottomStyle=_72?"solid":"none";_72=true;}}}});dojo.extend(dojox.mobile.EdgeToEdgeList,{buildRendering:function(){this.domNode=this.containerNode=this.srcNodeRef||dojo.doc.createElement("UL");this.domNode.className="mblEdgeToEdgeList";}});if(dojox.mobile.IconContainer){dojox.mobile.IconContainer._addChild=dojox.mobile.IconContainer.prototype.addChild;dojo.extend(dojox.mobile.IconContainer,{addChild:function(_73){dojox.mobile.IconContainer._addChild.apply(this,arguments);if(dojox.mobile.applyPngFilter){dojox.mobile.applyPngFilter(_73.domNode);}}});}dojo.mixin(dojox.mobile,{createRoundRect:function(_74,_75){var i;_74.domNode=dojo.doc.createElement("DIV");_74.domNode.style.padding="0px";_74.domNode.style.backgroundColor="transparent";_74.domNode.style.borderStyle="none";_74.containerNode=dojo.doc.createElement(_75?"UL":"DIV");_74.containerNode.className="mblRoundRectContainer";if(_74.srcNodeRef){_74.srcNodeRef.parentNode.replaceChild(_74.domNode,_74.srcNodeRef);for(i=0,len=_74.srcNodeRef.childNodes.length;i<len;i++){_74.containerNode.appendChild(_74.srcNodeRef.removeChild(_74.srcNodeRef.firstChild));}_74.srcNodeRef=null;}_74.domNode.appendChild(_74.containerNode);for(i=0;i<=5;i++){var top=dojo.create("DIV");top.className="mblRoundCorner mblRoundCorner"+i+"T";_74.domNode.insertBefore(top,_74.containerNode);var _76=dojo.create("DIV");_76.className="mblRoundCorner mblRoundCorner"+i+"B";_74.domNode.appendChild(_76);}}});if(dojox.mobile.ScrollableView){dojo.extend(dojox.mobile.ScrollableView,{postCreate:function(){var _77=dojo.create("DIV",{className:"mblDummyForIE",innerHTML:"&nbsp;"},this.containerNode,"first");dojo.style(_77,{position:"relative",marginBottom:"-2px",fontSize:"1px"});}});}}if(dojo.isIE<=6){dojox.mobile.applyPngFilter=function(_78){_78=_78||dojo.body();var _79=_78.getElementsByTagName("IMG");var _7a=dojo.moduleUrl("dojo","resources/blank.gif");for(var i=0,len=_79.length;i<len;i++){var img=_79[i];var w=img.offsetWidth;var h=img.offsetHeight;if(w===0||h===0){if(dojo.style(img,"display")!="none"){continue;}img.style.display="";w=img.offsetWidth;h=img.offsetHeight;img.style.display="none";if(w===0||h===0){continue;}}var src=img.src;if(src.indexOf("resources/blank.gif")!=-1){continue;}img.src=_7a;img.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"')";img.style.width=w+"px";img.style.height=h+"px";}};}dojox.mobile.loadCss=function(_7b){if(!dojo.global._loadedCss){var obj={};dojo.forEach(dojox.mobile.getCssPaths(),function(_7c){obj[_7c]=true;});dojo.global._loadedCss=obj;}if(!dojo.isArray(_7b)){_7b=[_7b];}for(var i=0;i<_7b.length;i++){var _7d=_7b[i];if(!dojo.global._loadedCss[_7d]){dojo.global._loadedCss[_7d]=true;if(dojo.doc.createStyleSheet){setTimeout(function(_7e){return function(){dojo.doc.createStyleSheet(_7e);};}(_7d),0);}else{var _7f=dojo.doc.createElement("link");_7f.href=_7d;_7f.type="text/css";_7f.rel="stylesheet";var _80=dojo.doc.getElementsByTagName("head")[0];_80.appendChild(_7f);}}}};dojox.mobile.getCssPaths=function(){var _81=[];var i,j;var s=dojo.doc.styleSheets;for(i=0;i<s.length;i++){var r=s[i].cssRules||s[i].imports;if(!r){continue;}for(j=0;j<r.length;j++){if(r[j].href){_81.push(r[j].href);}}}var _82=dojo.doc.getElementsByTagName("link");for(i=0,len=_82.length;i<len;i++){if(_82[i].href){_81.push(_82[i].href);}}return _81;};dojox.mobile.loadCompatPattern=/\/themes\/(domButtons|buttons|iphone|android).*\.css$/;dojox.mobile.loadCompatCssFiles=function(){var _83=dojox.mobile.getCssPaths();for(var i=0;i<_83.length;i++){var _84=_83[i];if(_84.match(dojox.mobile.loadCompatPattern)&&_84.indexOf("-compat.css")==-1){var _85=_84.substring(0,_84.length-4)+"-compat.css";dojox.mobile.loadCss(_85);}}};dojox.mobile.hideAddressBar=function(){};dojo.addOnLoad(function(){if(dojo.config["mblLoadCompatCssFiles"]!==false){dojox.mobile.loadCompatCssFiles();}if(dojox.mobile.applyPngFilter){dojox.mobile.applyPngFilter();}});}}if(!dojo._hasResource["dojox.mobile.app.compat"]){dojo._hasResource["dojox.mobile.app.compat"]=true;dojo.provide("dojox.mobile.app.compat");dojo.extend(dojox.mobile.app.AlertDialog,{_doTransition:function(dir){var h=dojo.marginBox(this.domNode.firstChild).h;var _86=this.controller.getWindowSize().h;var _87=_86-h;var low=_86;var _88=dojo.fx.slideTo({node:this.domNode,duration:400,top:{start:dir<0?_87:low,end:dir<0?low:_87}});var _89=dojo[dir<0?"fadeOut":"fadeIn"]({node:this.mask,duration:400});var _8a=dojo.fx.combine([_88,_89]);var _8b=this;dojo.connect(_8a,"onEnd",this,function(){if(dir<0){_8b.domNode.style.display="none";dojo.destroy(_8b.domNode);dojo.destroy(_8b.mask);}});_8a.play();}});dojo.extend(dojox.mobile.app.List,{deleteRow:function(){var row=this._selectedRow;dojo.style(row,{visibility:"hidden",minHeight:"0px"});dojo.removeClass(row,"hold");var _8c=dojo.contentBox(row).h;dojo.animateProperty({node:row,duration:800,properties:{height:{start:_8c,end:1},paddingTop:{end:0},paddingBottom:{end:0}},onEnd:this._postDeleteAnim}).play();}});if(dojox.mobile.app.ImageView&&!dojo.create("canvas").getContext){dojo.extend(dojox.mobile.app.ImageView,{buildRendering:function(){this.domNode.innerHTML="ImageView widget is not supported on this browser."+"Please try again with a modern browser, e.g. "+"Safari, Chrome or Firefox";this.canvas={};},postCreate:function(){}});}if(dojox.mobile.app.ImageThumbView){dojo.extend(dojox.mobile.app.ImageThumbView,{place:function(_8d,x,y){dojo.style(_8d,{top:y+"px",left:x+"px",visibility:"visible"});}});}}
diff --git a/js/dojo-1.6/dojox/mobile/app/compat.js.uncompressed.js b/js/dojo-1.6/dojox/mobile/app/compat.js.uncompressed.js
new file mode 100644
index 0000000..ce3f28a
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/compat.js.uncompressed.js
@@ -0,0 +1,1700 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+/*
+ This is an optimized version of Dojo, built for deployment and not for
+ development. To get sources and documentation, please visit:
+
+ http://dojotoolkit.org
+*/
+
+if(!dojo._hasResource["dojo.uacss"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.uacss"] = true;
+dojo.provide("dojo.uacss");
+
+
+
+(function(){
+ // summary:
+ // Applies pre-set CSS classes to the top-level HTML node, based on:
+ // - browser (ex: dj_ie)
+ // - browser version (ex: dj_ie6)
+ // - box model (ex: dj_contentBox)
+ // - text direction (ex: dijitRtl)
+ //
+ // In addition, browser, browser version, and box model are
+ // combined with an RTL flag when browser text is RTL. ex: dj_ie-rtl.
+
+ var d = dojo,
+ html = d.doc.documentElement,
+ ie = d.isIE,
+ opera = d.isOpera,
+ maj = Math.floor,
+ ff = d.isFF,
+ boxModel = d.boxModel.replace(/-/,''),
+
+ classes = {
+ dj_ie: ie,
+ dj_ie6: maj(ie) == 6,
+ dj_ie7: maj(ie) == 7,
+ dj_ie8: maj(ie) == 8,
+ dj_ie9: maj(ie) == 9,
+ dj_quirks: d.isQuirks,
+ dj_iequirks: ie && d.isQuirks,
+
+ // NOTE: Opera not supported by dijit
+ dj_opera: opera,
+
+ dj_khtml: d.isKhtml,
+
+ dj_webkit: d.isWebKit,
+ dj_safari: d.isSafari,
+ dj_chrome: d.isChrome,
+
+ dj_gecko: d.isMozilla,
+ dj_ff3: maj(ff) == 3
+ }; // no dojo unsupported browsers
+
+ classes["dj_" + boxModel] = true;
+
+ // apply browser, browser version, and box model class names
+ var classStr = "";
+ for(var clz in classes){
+ if(classes[clz]){
+ classStr += clz + " ";
+ }
+ }
+ html.className = d.trim(html.className + " " + classStr);
+
+ // If RTL mode, then add dj_rtl flag plus repeat existing classes with -rtl extension.
+ // We can't run the code below until the <body> tag has loaded (so we can check for dir=rtl).
+ // Unshift() is to run sniff code before the parser.
+ dojo._loaders.unshift(function(){
+ if(!dojo._isBodyLtr()){
+ var rtlClassStr = "dj_rtl dijitRtl " + classStr.replace(/ /g, "-rtl ")
+ html.className = d.trim(html.className + " " + rtlClassStr);
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dijit._base.sniff"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.sniff"] = true;
+dojo.provide("dijit._base.sniff");
+
+
+
+
+// summary:
+// Applies pre-set CSS classes to the top-level HTML node, see
+// `dojo.uacss` for details.
+//
+// Simply doing a require on this module will
+// establish this CSS. Modified version of Morris' CSS hack.
+
+}
+
+if(!dojo._hasResource["dojo.fx.Toggler"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.fx.Toggler"] = true;
+dojo.provide("dojo.fx.Toggler");
+
+
+
+dojo.declare("dojo.fx.Toggler", null, {
+ // summary:
+ // A simple `dojo.Animation` toggler API.
+ //
+ // description:
+ // class constructor for an animation toggler. It accepts a packed
+ // set of arguments about what type of animation to use in each
+ // direction, duration, etc. All available members are mixed into
+ // these animations from the constructor (for example, `node`,
+ // `showDuration`, `hideDuration`).
+ //
+ // example:
+ // | var t = new dojo.fx.Toggler({
+ // | node: "nodeId",
+ // | showDuration: 500,
+ // | // hideDuration will default to "200"
+ // | showFunc: dojo.fx.wipeIn,
+ // | // hideFunc will default to "fadeOut"
+ // | });
+ // | t.show(100); // delay showing for 100ms
+ // | // ...time passes...
+ // | t.hide();
+
+ // node: DomNode
+ // the node to target for the showing and hiding animations
+ node: null,
+
+ // showFunc: Function
+ // The function that returns the `dojo.Animation` to show the node
+ showFunc: dojo.fadeIn,
+
+ // hideFunc: Function
+ // The function that returns the `dojo.Animation` to hide the node
+ hideFunc: dojo.fadeOut,
+
+ // showDuration:
+ // Time in milliseconds to run the show Animation
+ showDuration: 200,
+
+ // hideDuration:
+ // Time in milliseconds to run the hide Animation
+ hideDuration: 200,
+
+ // FIXME: need a policy for where the toggler should "be" the next
+ // time show/hide are called if we're stopped somewhere in the
+ // middle.
+ // FIXME: also would be nice to specify individual showArgs/hideArgs mixed into
+ // each animation individually.
+ // FIXME: also would be nice to have events from the animations exposed/bridged
+
+ /*=====
+ _showArgs: null,
+ _showAnim: null,
+
+ _hideArgs: null,
+ _hideAnim: null,
+
+ _isShowing: false,
+ _isHiding: false,
+ =====*/
+
+ constructor: function(args){
+ var _t = this;
+
+ dojo.mixin(_t, args);
+ _t.node = args.node;
+ _t._showArgs = dojo.mixin({}, args);
+ _t._showArgs.node = _t.node;
+ _t._showArgs.duration = _t.showDuration;
+ _t.showAnim = _t.showFunc(_t._showArgs);
+
+ _t._hideArgs = dojo.mixin({}, args);
+ _t._hideArgs.node = _t.node;
+ _t._hideArgs.duration = _t.hideDuration;
+ _t.hideAnim = _t.hideFunc(_t._hideArgs);
+
+ dojo.connect(_t.showAnim, "beforeBegin", dojo.hitch(_t.hideAnim, "stop", true));
+ dojo.connect(_t.hideAnim, "beforeBegin", dojo.hitch(_t.showAnim, "stop", true));
+ },
+
+ show: function(delay){
+ // summary: Toggle the node to showing
+ // delay: Integer?
+ // Ammount of time to stall playing the show animation
+ return this.showAnim.play(delay || 0);
+ },
+
+ hide: function(delay){
+ // summary: Toggle the node to hidden
+ // delay: Integer?
+ // Ammount of time to stall playing the hide animation
+ return this.hideAnim.play(delay || 0);
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojo.fx"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.fx"] = true;
+dojo.provide("dojo.fx");
+
+
+
+
+/*=====
+dojo.fx = {
+ // summary: Effects library on top of Base animations
+};
+=====*/
+(function(){
+
+ var d = dojo,
+ _baseObj = {
+ _fire: function(evt, args){
+ if(this[evt]){
+ this[evt].apply(this, args||[]);
+ }
+ return this;
+ }
+ };
+
+ var _chain = function(animations){
+ this._index = -1;
+ this._animations = animations||[];
+ this._current = this._onAnimateCtx = this._onEndCtx = null;
+
+ this.duration = 0;
+ d.forEach(this._animations, function(a){
+ this.duration += a.duration;
+ if(a.delay){ this.duration += a.delay; }
+ }, this);
+ };
+ d.extend(_chain, {
+ _onAnimate: function(){
+ this._fire("onAnimate", arguments);
+ },
+ _onEnd: function(){
+ d.disconnect(this._onAnimateCtx);
+ d.disconnect(this._onEndCtx);
+ this._onAnimateCtx = this._onEndCtx = null;
+ if(this._index + 1 == this._animations.length){
+ this._fire("onEnd");
+ }else{
+ // switch animations
+ this._current = this._animations[++this._index];
+ this._onAnimateCtx = d.connect(this._current, "onAnimate", this, "_onAnimate");
+ this._onEndCtx = d.connect(this._current, "onEnd", this, "_onEnd");
+ this._current.play(0, true);
+ }
+ },
+ play: function(/*int?*/ delay, /*Boolean?*/ gotoStart){
+ if(!this._current){ this._current = this._animations[this._index = 0]; }
+ if(!gotoStart && this._current.status() == "playing"){ return this; }
+ var beforeBegin = d.connect(this._current, "beforeBegin", this, function(){
+ this._fire("beforeBegin");
+ }),
+ onBegin = d.connect(this._current, "onBegin", this, function(arg){
+ this._fire("onBegin", arguments);
+ }),
+ onPlay = d.connect(this._current, "onPlay", this, function(arg){
+ this._fire("onPlay", arguments);
+ d.disconnect(beforeBegin);
+ d.disconnect(onBegin);
+ d.disconnect(onPlay);
+ });
+ if(this._onAnimateCtx){
+ d.disconnect(this._onAnimateCtx);
+ }
+ this._onAnimateCtx = d.connect(this._current, "onAnimate", this, "_onAnimate");
+ if(this._onEndCtx){
+ d.disconnect(this._onEndCtx);
+ }
+ this._onEndCtx = d.connect(this._current, "onEnd", this, "_onEnd");
+ this._current.play.apply(this._current, arguments);
+ return this;
+ },
+ pause: function(){
+ if(this._current){
+ var e = d.connect(this._current, "onPause", this, function(arg){
+ this._fire("onPause", arguments);
+ d.disconnect(e);
+ });
+ this._current.pause();
+ }
+ return this;
+ },
+ gotoPercent: function(/*Decimal*/percent, /*Boolean?*/ andPlay){
+ this.pause();
+ var offset = this.duration * percent;
+ this._current = null;
+ d.some(this._animations, function(a){
+ if(a.duration <= offset){
+ this._current = a;
+ return true;
+ }
+ offset -= a.duration;
+ return false;
+ });
+ if(this._current){
+ this._current.gotoPercent(offset / this._current.duration, andPlay);
+ }
+ return this;
+ },
+ stop: function(/*boolean?*/ gotoEnd){
+ if(this._current){
+ if(gotoEnd){
+ for(; this._index + 1 < this._animations.length; ++this._index){
+ this._animations[this._index].stop(true);
+ }
+ this._current = this._animations[this._index];
+ }
+ var e = d.connect(this._current, "onStop", this, function(arg){
+ this._fire("onStop", arguments);
+ d.disconnect(e);
+ });
+ this._current.stop();
+ }
+ return this;
+ },
+ status: function(){
+ return this._current ? this._current.status() : "stopped";
+ },
+ destroy: function(){
+ if(this._onAnimateCtx){ d.disconnect(this._onAnimateCtx); }
+ if(this._onEndCtx){ d.disconnect(this._onEndCtx); }
+ }
+ });
+ d.extend(_chain, _baseObj);
+
+ dojo.fx.chain = function(/*dojo.Animation[]*/ animations){
+ // summary:
+ // Chain a list of `dojo.Animation`s to run in sequence
+ //
+ // description:
+ // Return a `dojo.Animation` which will play all passed
+ // `dojo.Animation` instances in sequence, firing its own
+ // synthesized events simulating a single animation. (eg:
+ // onEnd of this animation means the end of the chain,
+ // not the individual animations within)
+ //
+ // example:
+ // Once `node` is faded out, fade in `otherNode`
+ // | dojo.fx.chain([
+ // | dojo.fadeIn({ node:node }),
+ // | dojo.fadeOut({ node:otherNode })
+ // | ]).play();
+ //
+ return new _chain(animations) // dojo.Animation
+ };
+
+ var _combine = function(animations){
+ this._animations = animations||[];
+ this._connects = [];
+ this._finished = 0;
+
+ this.duration = 0;
+ d.forEach(animations, function(a){
+ var duration = a.duration;
+ if(a.delay){ duration += a.delay; }
+ if(this.duration < duration){ this.duration = duration; }
+ this._connects.push(d.connect(a, "onEnd", this, "_onEnd"));
+ }, this);
+
+ this._pseudoAnimation = new d.Animation({curve: [0, 1], duration: this.duration});
+ var self = this;
+ d.forEach(["beforeBegin", "onBegin", "onPlay", "onAnimate", "onPause", "onStop", "onEnd"],
+ function(evt){
+ self._connects.push(d.connect(self._pseudoAnimation, evt,
+ function(){ self._fire(evt, arguments); }
+ ));
+ }
+ );
+ };
+ d.extend(_combine, {
+ _doAction: function(action, args){
+ d.forEach(this._animations, function(a){
+ a[action].apply(a, args);
+ });
+ return this;
+ },
+ _onEnd: function(){
+ if(++this._finished > this._animations.length){
+ this._fire("onEnd");
+ }
+ },
+ _call: function(action, args){
+ var t = this._pseudoAnimation;
+ t[action].apply(t, args);
+ },
+ play: function(/*int?*/ delay, /*Boolean?*/ gotoStart){
+ this._finished = 0;
+ this._doAction("play", arguments);
+ this._call("play", arguments);
+ return this;
+ },
+ pause: function(){
+ this._doAction("pause", arguments);
+ this._call("pause", arguments);
+ return this;
+ },
+ gotoPercent: function(/*Decimal*/percent, /*Boolean?*/ andPlay){
+ var ms = this.duration * percent;
+ d.forEach(this._animations, function(a){
+ a.gotoPercent(a.duration < ms ? 1 : (ms / a.duration), andPlay);
+ });
+ this._call("gotoPercent", arguments);
+ return this;
+ },
+ stop: function(/*boolean?*/ gotoEnd){
+ this._doAction("stop", arguments);
+ this._call("stop", arguments);
+ return this;
+ },
+ status: function(){
+ return this._pseudoAnimation.status();
+ },
+ destroy: function(){
+ d.forEach(this._connects, dojo.disconnect);
+ }
+ });
+ d.extend(_combine, _baseObj);
+
+ dojo.fx.combine = function(/*dojo.Animation[]*/ animations){
+ // summary:
+ // Combine a list of `dojo.Animation`s to run in parallel
+ //
+ // description:
+ // Combine an array of `dojo.Animation`s to run in parallel,
+ // providing a new `dojo.Animation` instance encompasing each
+ // animation, firing standard animation events.
+ //
+ // example:
+ // Fade out `node` while fading in `otherNode` simultaneously
+ // | dojo.fx.combine([
+ // | dojo.fadeIn({ node:node }),
+ // | dojo.fadeOut({ node:otherNode })
+ // | ]).play();
+ //
+ // example:
+ // When the longest animation ends, execute a function:
+ // | var anim = dojo.fx.combine([
+ // | dojo.fadeIn({ node: n, duration:700 }),
+ // | dojo.fadeOut({ node: otherNode, duration: 300 })
+ // | ]);
+ // | dojo.connect(anim, "onEnd", function(){
+ // | // overall animation is done.
+ // | });
+ // | anim.play(); // play the animation
+ //
+ return new _combine(animations); // dojo.Animation
+ };
+
+ dojo.fx.wipeIn = function(/*Object*/ args){
+ // summary:
+ // Expand a node to it's natural height.
+ //
+ // description:
+ // Returns an animation that will expand the
+ // node defined in 'args' object from it's current height to
+ // it's natural height (with no scrollbar).
+ // Node must have no margin/border/padding.
+ //
+ // args: Object
+ // A hash-map of standard `dojo.Animation` constructor properties
+ // (such as easing: node: duration: and so on)
+ //
+ // example:
+ // | dojo.fx.wipeIn({
+ // | node:"someId"
+ // | }).play()
+ var node = args.node = d.byId(args.node), s = node.style, o;
+
+ var anim = d.animateProperty(d.mixin({
+ properties: {
+ height: {
+ // wrapped in functions so we wait till the last second to query (in case value has changed)
+ start: function(){
+ // start at current [computed] height, but use 1px rather than 0
+ // because 0 causes IE to display the whole panel
+ o = s.overflow;
+ s.overflow = "hidden";
+ if(s.visibility == "hidden" || s.display == "none"){
+ s.height = "1px";
+ s.display = "";
+ s.visibility = "";
+ return 1;
+ }else{
+ var height = d.style(node, "height");
+ return Math.max(height, 1);
+ }
+ },
+ end: function(){
+ return node.scrollHeight;
+ }
+ }
+ }
+ }, args));
+
+ d.connect(anim, "onEnd", function(){
+ s.height = "auto";
+ s.overflow = o;
+ });
+
+ return anim; // dojo.Animation
+ };
+
+ dojo.fx.wipeOut = function(/*Object*/ args){
+ // summary:
+ // Shrink a node to nothing and hide it.
+ //
+ // description:
+ // Returns an animation that will shrink node defined in "args"
+ // from it's current height to 1px, and then hide it.
+ //
+ // args: Object
+ // A hash-map of standard `dojo.Animation` constructor properties
+ // (such as easing: node: duration: and so on)
+ //
+ // example:
+ // | dojo.fx.wipeOut({ node:"someId" }).play()
+
+ var node = args.node = d.byId(args.node), s = node.style, o;
+
+ var anim = d.animateProperty(d.mixin({
+ properties: {
+ height: {
+ end: 1 // 0 causes IE to display the whole panel
+ }
+ }
+ }, args));
+
+ d.connect(anim, "beforeBegin", function(){
+ o = s.overflow;
+ s.overflow = "hidden";
+ s.display = "";
+ });
+ d.connect(anim, "onEnd", function(){
+ s.overflow = o;
+ s.height = "auto";
+ s.display = "none";
+ });
+
+ return anim; // dojo.Animation
+ };
+
+ dojo.fx.slideTo = function(/*Object*/ args){
+ // summary:
+ // Slide a node to a new top/left position
+ //
+ // description:
+ // Returns an animation that will slide "node"
+ // defined in args Object from its current position to
+ // the position defined by (args.left, args.top).
+ //
+ // args: Object
+ // A hash-map of standard `dojo.Animation` constructor properties
+ // (such as easing: node: duration: and so on). Special args members
+ // are `top` and `left`, which indicate the new position to slide to.
+ //
+ // example:
+ // | dojo.fx.slideTo({ node: node, left:"40", top:"50", units:"px" }).play()
+
+ var node = args.node = d.byId(args.node),
+ top = null, left = null;
+
+ var init = (function(n){
+ return function(){
+ var cs = d.getComputedStyle(n);
+ var pos = cs.position;
+ top = (pos == 'absolute' ? n.offsetTop : parseInt(cs.top) || 0);
+ left = (pos == 'absolute' ? n.offsetLeft : parseInt(cs.left) || 0);
+ if(pos != 'absolute' && pos != 'relative'){
+ var ret = d.position(n, true);
+ top = ret.y;
+ left = ret.x;
+ n.style.position="absolute";
+ n.style.top=top+"px";
+ n.style.left=left+"px";
+ }
+ };
+ })(node);
+ init();
+
+ var anim = d.animateProperty(d.mixin({
+ properties: {
+ top: args.top || 0,
+ left: args.left || 0
+ }
+ }, args));
+ d.connect(anim, "beforeBegin", anim, init);
+
+ return anim; // dojo.Animation
+ };
+
+})();
+
+}
+
+if(!dojo._hasResource["dojox.fx.flip"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.fx.flip"] = true;
+dojo.provide("dojox.fx.flip");
+
+
+
+
+ dojo.experimental("dojox.fx.flip");
+ // because ShrinkSafe will eat this up:
+ var borderConst = "border",
+ widthConst = "Width",
+ heightConst = "Height",
+ topConst = "Top",
+ rightConst = "Right",
+ leftConst = "Left",
+ bottomConst = "Bottom"
+ ;
+
+ dojox.fx.flip = function(/*Object*/ args){
+ // summary: Animate a node flipping following a specific direction
+ //
+ // description:
+ // Returns an animation that will flip the
+ // node around a central axis:
+ // if args.dir is "left" or "right" --> y axis
+ // if args.dir is "top" or "bottom" --> x axis
+ //
+ // This effect is obtained using a border distorsion applied to a helper node.
+ //
+ // The user can specify three background colors for the helper node:
+ // darkColor: the darkest color reached during the animation
+ // lightColor: the brightest color
+ // endColor: the final backgroundColor for the node
+ //
+ // depth: Float
+ // 0 <= depth <= 1 overrides the computed "depth"
+ // (0: min distorsion, 1: max distorsion)
+ //
+ // whichAnim: String
+ // "first" : the first half animation
+ // "last" : the second one
+ // "both" (default) : both
+ //
+ // axis: String
+ // "center" (default) : the node is flipped around his center
+ // "shortside" : the node is flipped around his "short" (in perspective) side
+ // "longside" : the node is flipped around his "long" (in perspective) side
+ // "cube" : the node flips around the central axis of the cube
+ //
+ // shift: Integer
+ // node translation, perpendicular to the rotation axis
+ //
+ // example:
+ // | var anim = dojox.fx.flip({
+ // | node: dojo.byId("nodeId"),
+ // | dir: "top",
+ // | darkColor: "#555555",
+ // | lightColor: "#dddddd",
+ // | endColor: "#666666",
+ // | depth: .5,
+ // | shift: 50,
+ // | duration:300
+ // | });
+
+ var helperNode = dojo.create("div"),
+ node = args.node = dojo.byId(args.node),
+ s = node.style,
+ dims = null,
+ hs = null,
+ pn = null,
+ lightColor = args.lightColor || "#dddddd",
+ darkColor = args.darkColor || "#555555",
+ bgColor = dojo.style(node, "backgroundColor"),
+ endColor = args.endColor || bgColor,
+ staticProps = {},
+ anims = [],
+ duration = args.duration ? args.duration / 2 : 250,
+ dir = args.dir || "left",
+ pConst = .9,
+ transparentColor = "transparent",
+ whichAnim = args.whichAnim,
+ axis = args.axis || "center",
+ depth = args.depth
+ ;
+ // IE6 workaround: IE6 doesn't support transparent borders
+ var convertColor = function(color){
+ return ((new dojo.Color(color)).toHex() === "#000000") ? "#000001" : color;
+ };
+
+ if(dojo.isIE < 7){
+ endColor = convertColor(endColor);
+ lightColor = convertColor(lightColor);
+ darkColor = convertColor(darkColor);
+ bgColor = convertColor(bgColor);
+ transparentColor = "black";
+ helperNode.style.filter = "chroma(color='#000000')";
+ }
+
+ var init = (function(n){
+ return function(){
+ var ret = dojo.coords(n, true);
+ dims = {
+ top: ret.y,
+ left: ret.x,
+ width: ret.w,
+ height: ret.h
+ };
+ }
+ })(node);
+ init();
+ // helperNode initialization
+ hs = {
+ position: "absolute",
+ top: dims["top"] + "px",
+ left: dims["left"] + "px",
+ height: "0",
+ width: "0",
+ zIndex: args.zIndex || (s.zIndex || 0),
+ border: "0 solid " + transparentColor,
+ fontSize: "0",
+ visibility: "hidden"
+ };
+ var props = [ {},
+ {
+ top: dims["top"],
+ left: dims["left"]
+ }
+ ];
+ var dynProperties = {
+ left: [leftConst, rightConst, topConst, bottomConst, widthConst, heightConst, "end" + heightConst + "Min", leftConst, "end" + heightConst + "Max"],
+ right: [rightConst, leftConst, topConst, bottomConst, widthConst, heightConst, "end" + heightConst + "Min", leftConst, "end" + heightConst + "Max"],
+ top: [topConst, bottomConst, leftConst, rightConst, heightConst, widthConst, "end" + widthConst + "Min", topConst, "end" + widthConst + "Max"],
+ bottom: [bottomConst, topConst, leftConst, rightConst, heightConst, widthConst, "end" + widthConst + "Min", topConst, "end" + widthConst + "Max"]
+ };
+ // property names
+ pn = dynProperties[dir];
+
+ // .4 <= pConst <= .9
+ if(typeof depth != "undefined"){
+ depth = Math.max(0, Math.min(1, depth)) / 2;
+ pConst = .4 + (.5 - depth);
+ }else{
+ pConst = Math.min(.9, Math.max(.4, dims[pn[5].toLowerCase()] / dims[pn[4].toLowerCase()]));
+ }
+ var p0 = props[0];
+ for(var i = 4; i < 6; i++){
+ if(axis == "center" || axis == "cube"){ // find a better name for "cube"
+ dims["end" + pn[i] + "Min"] = dims[pn[i].toLowerCase()] * pConst;
+ dims["end" + pn[i] + "Max"] = dims[pn[i].toLowerCase()] / pConst;
+ }else if(axis == "shortside"){
+ dims["end" + pn[i] + "Min"] = dims[pn[i].toLowerCase()];
+ dims["end" + pn[i] + "Max"] = dims[pn[i].toLowerCase()] / pConst;
+ }else if(axis == "longside"){
+ dims["end" + pn[i] + "Min"] = dims[pn[i].toLowerCase()] * pConst;
+ dims["end" + pn[i] + "Max"] = dims[pn[i].toLowerCase()];
+ }
+ }
+ if(axis == "center"){
+ p0[pn[2].toLowerCase()] = dims[pn[2].toLowerCase()] - (dims[pn[8]] - dims[pn[6]]) / 4;
+ }else if(axis == "shortside"){
+ p0[pn[2].toLowerCase()] = dims[pn[2].toLowerCase()] - (dims[pn[8]] - dims[pn[6]]) / 2;
+ }
+
+ staticProps[pn[5].toLowerCase()] = dims[pn[5].toLowerCase()] + "px";
+ staticProps[pn[4].toLowerCase()] = "0";
+ staticProps[borderConst + pn[1] + widthConst] = dims[pn[4].toLowerCase()] + "px";
+ staticProps[borderConst + pn[1] + "Color"] = bgColor;
+
+ p0[borderConst + pn[1] + widthConst] = 0;
+ p0[borderConst + pn[1] + "Color"] = darkColor;
+ p0[borderConst + pn[2] + widthConst] = p0[borderConst + pn[3] + widthConst] = axis != "cube"
+ ? (dims["end" + pn[5] + "Max"] - dims["end" + pn[5] + "Min"]) / 2
+ : dims[pn[6]] / 2
+ ;
+ p0[pn[7].toLowerCase()] = dims[pn[7].toLowerCase()] + dims[pn[4].toLowerCase()] / 2 + (args.shift || 0);
+ p0[pn[5].toLowerCase()] = dims[pn[6]];
+
+ var p1 = props[1];
+ p1[borderConst + pn[0] + "Color"] = { start: lightColor, end: endColor };
+ p1[borderConst + pn[0] + widthConst] = dims[pn[4].toLowerCase()];
+ p1[borderConst + pn[2] + widthConst] = 0;
+ p1[borderConst + pn[3] + widthConst] = 0;
+ p1[pn[5].toLowerCase()] = { start: dims[pn[6]], end: dims[pn[5].toLowerCase()] };
+
+ dojo.mixin(hs, staticProps);
+ dojo.style(helperNode, hs);
+ dojo.body().appendChild(helperNode);
+
+ var finalize = function(){
+// helperNode.parentNode.removeChild(helperNode);
+ dojo.destroy(helperNode);
+ // fixes a flicker when the animation ends
+ s.backgroundColor = endColor;
+ s.visibility = "visible";
+ };
+ if(whichAnim == "last"){
+ for(i in p0){
+ p0[i] = { start: p0[i] };
+ }
+ p0[borderConst + pn[1] + "Color"] = { start: darkColor, end: endColor };
+ p1 = p0;
+ }
+ if(!whichAnim || whichAnim == "first"){
+ anims.push(dojo.animateProperty({
+ node: helperNode,
+ duration: duration,
+ properties: p0
+ }));
+ }
+ if(!whichAnim || whichAnim == "last"){
+ anims.push(dojo.animateProperty({
+ node: helperNode,
+ duration: duration,
+ properties: p1,
+ onEnd: finalize
+ }));
+ }
+
+ // hide the original node
+ dojo.connect(anims[0], "play", function(){
+ helperNode.style.visibility = "visible";
+ s.visibility = "hidden";
+ });
+
+ return dojo.fx.chain(anims); // dojo.Animation
+
+ }
+
+ dojox.fx.flipCube = function(/*Object*/ args){
+ // summary: An extension to `dojox.fx.flip` providing a more 3d-like rotation
+ //
+ // description:
+ // An extension to `dojox.fx.flip` providing a more 3d-like rotation.
+ // Behaves the same as `dojox.fx.flip`, using the same attributes and
+ // other standard `dojo.Animation` properties.
+ //
+ // example:
+ // See `dojox.fx.flip`
+ var anims = [],
+ mb = dojo.marginBox(args.node),
+ shiftX = mb.w / 2,
+ shiftY = mb.h / 2,
+ dims = {
+ top: {
+ pName: "height",
+ args:[
+ {
+ whichAnim: "first",
+ dir: "top",
+ shift: -shiftY
+ },
+ {
+ whichAnim: "last",
+ dir: "bottom",
+ shift: shiftY
+ }
+ ]
+ },
+ right: {
+ pName: "width",
+ args:[
+ {
+ whichAnim: "first",
+ dir: "right",
+ shift: shiftX
+ },
+ {
+ whichAnim: "last",
+ dir: "left",
+ shift: -shiftX
+ }
+ ]
+ },
+ bottom: {
+ pName: "height",
+ args:[
+ {
+ whichAnim: "first",
+ dir: "bottom",
+ shift: shiftY
+ },
+ {
+ whichAnim: "last",
+ dir: "top",
+ shift: -shiftY
+ }
+ ]
+ },
+ left: {
+ pName: "width",
+ args:[
+ {
+ whichAnim: "first",
+ dir: "left",
+ shift: -shiftX
+ },
+ {
+ whichAnim: "last",
+ dir: "right",
+ shift: shiftX
+ }
+ ]
+ }
+ }
+ ;
+ var d = dims[args.dir || "left"],
+ p = d.args
+ ;
+ args.duration = args.duration ? args.duration * 2 : 500;
+ args.depth = .8;
+ args.axis = "cube";
+ for(var i = p.length - 1; i >= 0; i--){
+ dojo.mixin(args, p[i]);
+ anims.push(dojox.fx.flip(args));
+ }
+ return dojo.fx.combine(anims);
+ };
+
+ dojox.fx.flipPage = function(/*Object*/ args){
+ // summary: An extension to `dojox.fx.flip` providing a page flip like animation.
+ //
+ // description:
+ // An extension to `dojox.fx.flip` providing a page flip effect.
+ // Behaves the same as `dojox.fx.flip`, using the same attributes and
+ // other standard `dojo.Animation` properties.
+ //
+ // example:
+ // See `dojox.fx.flip`
+ var n = args.node,
+ coords = dojo.coords(n, true),
+ x = coords.x,
+ y = coords.y,
+ w = coords.w,
+ h = coords.h,
+ bgColor = dojo.style(n, "backgroundColor"),
+ lightColor = args.lightColor || "#dddddd",
+ darkColor = args.darkColor,
+ helperNode = dojo.create("div"),
+ anims = [],
+ hn = [],
+ dir = args.dir || "right",
+ pn = {
+ left: ["left", "right", "x", "w"],
+ top: ["top", "bottom", "y", "h"],
+ right: ["left", "left", "x", "w"],
+ bottom: ["top", "top", "y", "h"]
+ },
+ shiftMultiplier = {
+ right: [1, -1],
+ left: [-1, 1],
+ top: [-1, 1],
+ bottom: [1, -1]
+ }
+ ;
+ dojo.style(helperNode, {
+ position: "absolute",
+ width : w + "px",
+ height : h + "px",
+ top : y + "px",
+ left : x + "px",
+ visibility: "hidden"
+ });
+ var hs = [];
+ for(var i = 0; i < 2; i++){
+ var r = i % 2,
+ d = r ? pn[dir][1] : dir,
+ wa = r ? "last" : "first",
+ endColor = r ? bgColor : lightColor,
+ startColor = r ? endColor : args.startColor || n.style.backgroundColor
+ ;
+ hn[i] = dojo.clone(helperNode);
+ var finalize = function(x){
+ return function(){
+ dojo.destroy(hn[x]);
+ }
+ }(i)
+ ;
+ dojo.body().appendChild(hn[i]);
+ hs[i] = {
+ backgroundColor: r ? startColor : bgColor
+ };
+
+ hs[i][pn[dir][0]] = coords[pn[dir][2]] + shiftMultiplier[dir][0] * i * coords[pn[dir][3]] + "px";
+ dojo.style(hn[i], hs[i]);
+ anims.push(dojox.fx.flip({
+ node: hn[i],
+ dir: d,
+ axis: "shortside",
+ depth: args.depth,
+ duration: args.duration / 2,
+ shift: shiftMultiplier[dir][i] * coords[pn[dir][3]] / 2,
+ darkColor: darkColor,
+ lightColor: lightColor,
+ whichAnim: wa,
+ endColor: endColor
+ }));
+ dojo.connect(anims[i], "onEnd", finalize);
+ }
+ return dojo.fx.chain(anims);
+ };
+
+
+ dojox.fx.flipGrid = function(/*Object*/ args){
+ // summary: An extension to `dojox.fx.flip` providing a decomposition in rows * cols flipping elements
+ //
+ // description:
+ // An extension to `dojox.fx.flip` providing a page flip effect.
+ // Behaves the same as `dojox.fx.flip`, using the same attributes and
+ // other standard `dojo.Animation` properties and
+ //
+ // cols: Integer columns
+ // rows: Integer rows
+ //
+ // duration: the single flip duration
+ //
+ // example:
+ // See `dojox.fx.flip`
+ var rows = args.rows || 4,
+ cols = args.cols || 4,
+ anims = [],
+ helperNode = dojo.create("div"),
+ n = args.node,
+ coords = dojo.coords(n, true),
+ x = coords.x,
+ y = coords.y,
+ nw = coords.w,
+ nh = coords.h,
+ w = coords.w / cols,
+ h = coords.h / rows,
+ cAnims = []
+ ;
+ dojo.style(helperNode, {
+ position: "absolute",
+ width: w + "px",
+ height: h + "px",
+ backgroundColor: dojo.style(n, "backgroundColor")
+ });
+ for(var i = 0; i < rows; i++){
+ var r = i % 2,
+ d = r ? "right" : "left",
+ signum = r ? 1 : -1
+ ;
+ // cloning
+ var cn = dojo.clone(n);
+ dojo.style(cn, {
+ position: "absolute",
+ width: nw + "px",
+ height: nh + "px",
+ top: y + "px",
+ left: x + "px",
+ clip: "rect(" + i * h + "px," + nw + "px," + nh + "px,0)"
+ });
+ dojo.body().appendChild(cn);
+ anims[i] = [];
+ for(var j = 0; j < cols; j++){
+ var hn = dojo.clone(helperNode),
+ l = r ? j : cols - (j + 1)
+ ;
+ var adjustClip = function(xn, yCounter, xCounter){
+ return function(){
+ if(!(yCounter % 2)){
+ dojo.style(xn, {
+ clip: "rect(" + yCounter * h + "px," + (nw - (xCounter + 1) * w ) + "px," + ((yCounter + 1) * h) + "px,0px)"
+ });
+ }else{
+ dojo.style(xn, {
+ clip: "rect(" + yCounter * h + "px," + nw + "px," + ((yCounter + 1) * h) + "px," + ((xCounter + 1) * w) + "px)"
+ });
+ }
+ }
+ }(cn, i, j);
+ dojo.body().appendChild(hn);
+ dojo.style(hn, {
+ left: x + l * w + "px",
+ top: y + i * h + "px",
+ visibility: "hidden"
+ });
+ var a = dojox.fx.flipPage({
+ node: hn,
+ dir: d,
+ duration: args.duration || 900,
+ shift: signum * w/2,
+ depth: .2,
+ darkColor: args.darkColor,
+ lightColor: args.lightColor,
+ startColor: args.startColor || args.node.style.backgroundColor
+ }),
+ removeHelper = function(xn){
+ return function(){
+ dojo.destroy(xn);
+ }
+ }(hn)
+ ;
+ dojo.connect(a, "play", this, adjustClip);
+ dojo.connect(a, "play", this, removeHelper);
+ anims[i].push(a);
+ }
+ cAnims.push(dojo.fx.chain(anims[i]));
+
+ }
+ dojo.connect(cAnims[0], "play", function(){
+ dojo.style(n, {visibility: "hidden"});
+ });
+ return dojo.fx.combine(cAnims);
+ };
+
+}
+
+if(!dojo._hasResource["dojox.mobile.compat"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.compat"] = true;
+dojo.provide("dojox.mobile.compat");
+
+
+
+
+
+// summary:
+// CSS3 compatibility module
+// description:
+// This module provides support for some of the CSS3 features to dojox.mobile
+// for non-CSS3 browsers, such as IE or Firefox.
+// If you load this module, it directly replaces some of the methods of
+// dojox.mobile instead of subclassing. This way, html pages remains the same
+// regardless of whether this compatibility module is used or not.
+// Recommended usage is as follows. the code below loads dojox.mobile.compat
+// only when isWebKit is true.
+//
+// dojo.require("dojox.mobile");
+//
+//
+// This module also loads compatibility CSS files, which has -compat.css
+// suffix. You can use either the <link> tag or @import to load theme
+// CSS files. Then, this module searches for the loaded CSS files and loads
+// compatibility CSS files. For example, if you load iphone.css in a page,
+// this module automatically loads iphone-compat.css.
+// If you explicitly load iphone-compat.css with <link> or @import,
+// this module will not load the already loaded file.
+
+if(!dojo.isWebKit){
+
+dojo.extend(dojox.mobile.View, {
+ _doTransition: function(fromNode, toNode, transition, dir){
+ var anim;
+ this.wakeUp(toNode);
+ if(!transition || transition == "none"){
+ toNode.style.display = "";
+ fromNode.style.display = "none";
+ toNode.style.left = "0px";
+ this.invokeCallback();
+ }else if(transition == "slide"){
+ var w = fromNode.offsetWidth;
+ var s1 = dojo.fx.slideTo({
+ node: fromNode,
+ duration: 400,
+ left: -w*dir,
+ top: fromNode.offsetTop
+ });
+ var s2 = dojo.fx.slideTo({
+ node: toNode,
+ duration: 400,
+ left: 0
+ });
+ toNode.style.position = "absolute";
+ toNode.style.left = w*dir + "px";
+ toNode.style.display = "";
+ anim = dojo.fx.combine([s1,s2]);
+ dojo.connect(anim, "onEnd", this, function(){
+ fromNode.style.display = "none";
+ toNode.style.position = "relative";
+ this.invokeCallback();
+ });
+ anim.play();
+ }else if(transition == "flip"){
+ anim = dojox.fx.flip({
+ node: fromNode,
+ dir: "right",
+ depth: 0.5,
+ duration: 400
+ });
+ toNode.style.position = "absolute";
+ toNode.style.left = "0px";
+ dojo.connect(anim, "onEnd", this, function(){
+ fromNode.style.display = "none";
+ toNode.style.position = "relative";
+ toNode.style.display = "";
+ this.invokeCallback();
+ });
+ anim.play();
+ }else if(transition == "fade"){
+ anim = dojo.fx.chain([
+ dojo.fadeOut({
+ node: fromNode,
+ duration: 600
+ }),
+ dojo.fadeIn({
+ node: toNode,
+ duration: 600
+ })
+ ]);
+ toNode.style.position = "absolute";
+ toNode.style.left = "0px";
+ toNode.style.display = "";
+ dojo.style(toNode, "opacity", 0);
+ dojo.connect(anim, "onEnd", this, function(){
+ fromNode.style.display = "none";
+ toNode.style.position = "relative";
+ dojo.style(fromNode, "opacity", 1);
+ this.invokeCallback();
+ });
+ anim.play();
+ }
+ },
+
+ wakeUp: function(node){
+ // summary:
+ // Function to force IE to redraw a node since its layout code tends to misrender
+ // in partial draws.
+ // node:
+ // The node to forcibly redraw.
+ // tags:
+ // public
+ if(dojo.isIE && !node._wokeup){
+ node._wokeup = true;
+ var disp = node.style.display;
+ node.style.display = "";
+ var nodes = node.getElementsByTagName("*");
+ for(var i = 0, len = nodes.length; i < len; i++){
+ var val = nodes[i].style.display;
+ nodes[i].style.display = "none";
+ nodes[i].style.display = "";
+ nodes[i].style.display = val;
+ }
+ node.style.display = disp;
+ }
+ }
+});
+
+dojo.extend(dojox.mobile.Switch, {
+ buildRendering: function(){
+ // summary:
+ // Function to simulate the mobile device style switches on
+ // browsers such as IE and FireFox.
+ // tags:
+ // protected
+ this.domNode = this.srcNodeRef || dojo.doc.createElement("DIV");
+ this.domNode.className = "mblSwitch";
+ this.domNode.innerHTML =
+ '<div class="mblSwitchInner">'
+ + '<div class="mblSwitchBg mblSwitchBgLeft">'
+ + '<div class="mblSwitchCorner mblSwitchCorner1T"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner2T"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner3T"></div>'
+ + '<div class="mblSwitchText mblSwitchTextLeft">'+this.leftLabel+'</div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner1B"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner2B"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner3B"></div>'
+ + '</div>'
+ + '<div class="mblSwitchBg mblSwitchBgRight">'
+ + '<div class="mblSwitchCorner mblSwitchCorner1T"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner2T"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner3T"></div>'
+ + '<div class="mblSwitchText mblSwitchTextRight">'+this.rightLabel+'</div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner1B"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner2B"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner3B"></div>'
+ + '</div>'
+ + '<div class="mblSwitchKnobContainer">'
+ + '<div class="mblSwitchCorner mblSwitchCorner1T"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner2T"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner3T"></div>'
+ + '<div class="mblSwitchKnob"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner1B"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner2B"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner3B"></div>'
+ + '</div>'
+ + '</div>';
+ var n = this.inner = this.domNode.firstChild;
+ this.left = n.childNodes[0];
+ this.right = n.childNodes[1];
+ this.knob = n.childNodes[2];
+
+ dojo.addClass(this.domNode, (this.value == "on") ? "mblSwitchOn" : "mblSwitchOff");
+ this[this.value == "off" ? "left" : "right"].style.display = "none";
+ },
+
+ _changeState: function(/*String*/state){
+ // summary:
+ // Function to toggle the switch state on the switch
+ // state:
+ // Thhe state to toggle, switch 'on' or 'off'
+ // tags:
+ // private
+ if(!this.inner.parentNode || !this.inner.parentNode.tagName){
+ dojo.addClass(this.domNode, (state == "on") ? "mblSwitchOn" : "mblSwitchOff");
+ return;
+ }
+ var pos;
+ if(this.inner.offsetLeft == 0){ // currently ON
+ if(state == "on"){ return; }
+ pos = -53;
+ }else{ // currently OFF
+ if(state == "off"){ return; }
+ pos = 0;
+ }
+
+ var a = dojo.fx.slideTo({
+ node: this.inner,
+ duration: 500,
+ left: pos
+ });
+ var _this = this;
+ dojo.connect(a, "onEnd", function(){
+ _this[state == "off" ? "left" : "right"].style.display = "none";
+ });
+ a.play();
+ }
+});
+
+if(dojo.isIE || dojo.isBB){
+
+dojo.extend(dojox.mobile.RoundRect, {
+ buildRendering: function(){
+ // summary:
+ // Function to simulate the borderRadius appearance on IE, since
+ // IE does not support this CSS style.
+ // tags:
+ // protected
+ dojox.mobile.createRoundRect(this);
+ this.domNode.className = "mblRoundRect";
+ }
+});
+
+dojox.mobile.RoundRectList._addChild = dojox.mobile.RoundRectList.prototype.addChild;
+dojo.extend(dojox.mobile.RoundRectList, {
+ buildRendering: function(){
+ // summary:
+ // Function to simulate the borderRadius appearance on IE, since
+ // IE does not support this CSS style.
+ // tags:
+ // protected
+ dojox.mobile.createRoundRect(this, true);
+ this.domNode.className = "mblRoundRectList";
+ },
+
+ postCreate: function(){
+ this.redrawBorders();
+ },
+
+ addChild: function(widget){
+ dojox.mobile.RoundRectList._addChild.apply(this, arguments);
+ this.redrawBorders();
+ if(dojox.mobile.applyPngFilter){
+ dojox.mobile.applyPngFilter(widget.domNode);
+ }
+ },
+
+ redrawBorders: function(){
+ // summary:
+ // Function to adjust the creation of RoundRectLists on IE.
+ // Removed undesired styles.
+ // tags:
+ // public
+
+ // Remove a border of the last ListItem.
+ // This is for browsers that do not support the last-child CSS pseudo-class.
+
+ var lastChildFound = false;
+ for(var i = this.containerNode.childNodes.length - 1; i >= 0; i--){
+ var c = this.containerNode.childNodes[i];
+ if(c.tagName == "LI"){
+ c.style.borderBottomStyle = lastChildFound ? "solid" : "none";
+ lastChildFound = true;
+ }
+ }
+ }
+});
+
+dojo.extend(dojox.mobile.EdgeToEdgeList, {
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("UL");
+ this.domNode.className = "mblEdgeToEdgeList";
+ }
+});
+
+if(dojox.mobile.IconContainer){
+
+dojox.mobile.IconContainer._addChild = dojox.mobile.IconContainer.prototype.addChild;
+dojo.extend(dojox.mobile.IconContainer, {
+ addChild: function(widget){
+ dojox.mobile.IconContainer._addChild.apply(this, arguments);
+ if(dojox.mobile.applyPngFilter){
+ dojox.mobile.applyPngFilter(widget.domNode);
+ }
+ }
+});
+
+} // if(dojox.mobile.IconContainer)
+
+dojo.mixin(dojox.mobile, {
+ createRoundRect: function(_this, isList){
+ // summary:
+ // Function to adjust the creation of rounded rectangles on IE.
+ // Deals with IE's lack of borderRadius support
+ // tags:
+ // public
+ var i;
+ _this.domNode = dojo.doc.createElement("DIV");
+ _this.domNode.style.padding = "0px";
+ _this.domNode.style.backgroundColor = "transparent";
+ _this.domNode.style.borderStyle = "none";
+ _this.containerNode = dojo.doc.createElement(isList?"UL":"DIV");
+ _this.containerNode.className = "mblRoundRectContainer";
+ if(_this.srcNodeRef){
+ _this.srcNodeRef.parentNode.replaceChild(_this.domNode, _this.srcNodeRef);
+ for(i = 0, len = _this.srcNodeRef.childNodes.length; i < len; i++){
+ _this.containerNode.appendChild(_this.srcNodeRef.removeChild(_this.srcNodeRef.firstChild));
+ }
+ _this.srcNodeRef = null;
+ }
+ _this.domNode.appendChild(_this.containerNode);
+
+ for(i = 0; i <= 5; i++){
+ var top = dojo.create("DIV");
+ top.className = "mblRoundCorner mblRoundCorner"+i+"T";
+ _this.domNode.insertBefore(top, _this.containerNode);
+
+ var bottom = dojo.create("DIV");
+ bottom.className = "mblRoundCorner mblRoundCorner"+i+"B";
+ _this.domNode.appendChild(bottom);
+ }
+ }
+});
+
+if(dojox.mobile.ScrollableView){
+
+dojo.extend(dojox.mobile.ScrollableView, {
+ postCreate: function(){
+ // On IE, margin-top of the first child does not seem to be effective,
+ // probably because padding-top is specified for containerNode
+ // to make room for a fixed header. This dummy node is a workaround for that.
+ var dummy = dojo.create("DIV", {className:"mblDummyForIE", innerHTML:"&nbsp;"}, this.containerNode, "first");
+ dojo.style(dummy, {
+ position: "relative",
+ marginBottom: "-2px",
+ fontSize: "1px"
+ });
+ }
+});
+
+} // if(dojox.mobile.ScrollableView)
+
+} // if(dojo.isIE)
+
+if(dojo.isIE <= 6){
+ dojox.mobile.applyPngFilter = function(root){
+ root = root || dojo.body();
+ var nodes = root.getElementsByTagName("IMG");
+ var blank = dojo.moduleUrl("dojo", "resources/blank.gif");
+ for(var i = 0, len = nodes.length; i < len; i++){
+ var img = nodes[i];
+ var w = img.offsetWidth;
+ var h = img.offsetHeight;
+ if(w === 0 || h === 0){
+ // The reason why the image has no width/height may be because
+ // display is "none". If that is the case, let's change the
+ // display to "" temporarily and see if the image returns them.
+ if(dojo.style(img, "display") != "none"){ continue; }
+ img.style.display = "";
+ w = img.offsetWidth;
+ h = img.offsetHeight;
+ img.style.display = "none";
+ if(w === 0 || h === 0){ continue; }
+ }
+ var src = img.src;
+ if(src.indexOf("resources/blank.gif") != -1){ continue; }
+ img.src = blank;
+ img.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src+"')";
+ img.style.width = w + "px";
+ img.style.height = h + "px";
+ }
+ };
+} // if(dojo.isIE <= 6)
+
+dojox.mobile.loadCss = function(/*String|Array*/files){
+ // summary:
+ // Function to load and register CSS files with the page
+ // files: String|Array
+ // The CSS files to load and register with the page.
+ // tags:
+ // private
+ if(!dojo.global._loadedCss){
+ var obj = {};
+ dojo.forEach(dojox.mobile.getCssPaths(), function(path){
+ obj[path] = true;
+ });
+ dojo.global._loadedCss = obj;
+ }
+ if(!dojo.isArray(files)){ files = [files]; }
+ for(var i = 0; i < files.length; i++){
+ var file = files[i];
+ if(!dojo.global._loadedCss[file]){
+ dojo.global._loadedCss[file] = true;
+ if(dojo.doc.createStyleSheet){
+ // for some reason, IE hangs when you try to load
+ // multiple css files almost at once.
+ setTimeout(function(file){
+ return function(){
+ dojo.doc.createStyleSheet(file);
+ };
+ }(file), 0);
+ }else{
+ var link = dojo.doc.createElement("link");
+ link.href = file;
+ link.type = "text/css";
+ link.rel = "stylesheet";
+ var head = dojo.doc.getElementsByTagName('head')[0];
+ head.appendChild(link);
+ }
+ }
+ }
+};
+
+dojox.mobile.getCssPaths = function(){
+ var paths = [];
+ var i, j;
+
+ // find @import
+ var s = dojo.doc.styleSheets;
+ for(i = 0; i < s.length; i++){
+ var r = s[i].cssRules || s[i].imports;
+ if(!r){ continue; }
+ for(j = 0; j < r.length; j++){
+ if(r[j].href){
+ paths.push(r[j].href);
+ }
+ }
+ }
+
+ // find <link>
+ var elems = dojo.doc.getElementsByTagName("link");
+ for(i = 0, len = elems.length; i < len; i++){
+ if(elems[i].href){
+ paths.push(elems[i].href);
+ }
+ }
+ return paths;
+};
+
+dojox.mobile.loadCompatPattern = /\/themes\/(domButtons|buttons|iphone|android).*\.css$/;
+
+dojox.mobile.loadCompatCssFiles = function(){
+ // summary:
+ // Function to perform page-level adjustments on browsers such as
+ // IE and firefox. It loads compat specific css files into the
+ // page header.
+ var paths = dojox.mobile.getCssPaths();
+ for(var i = 0; i < paths.length; i++){
+ var href = paths[i];
+ if(href.match(dojox.mobile.loadCompatPattern) && href.indexOf("-compat.css") == -1){
+ var compatCss = href.substring(0, href.length-4)+"-compat.css";
+ dojox.mobile.loadCss(compatCss);
+ }
+ }
+};
+
+dojox.mobile.hideAddressBar = function(){
+ // nop
+};
+
+dojo.addOnLoad(function(){
+ if(dojo.config["mblLoadCompatCssFiles"] !== false){
+ dojox.mobile.loadCompatCssFiles();
+ }
+ if(dojox.mobile.applyPngFilter){
+ dojox.mobile.applyPngFilter();
+ }
+});
+
+} // end of if(!dojo.isWebKit){
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app.compat"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.compat"] = true;
+dojo.provide("dojox.mobile.app.compat");
+
+
+// summary:
+// CSS3 compatibility module for apps
+// description:
+// This module provides support for some of the CSS3 features to djMobile
+// for non-CSS3 browsers, such as IE or Firefox.
+// If you load this module, it directly replaces some of the methods of
+// djMobile instead of subclassing. This way, html pages remains the same
+// regardless of whether this compatibility module is used or not.
+// Recommended usage is as follows. the code below loads dojox.mobile.compat
+// only when isWebKit is true.
+//
+// dojo.require("dojox.mobile");
+// dojo.requireIf(!dojo.isWebKit, "dojox.mobile.appCompat");
+
+dojo.extend(dojox.mobile.app.AlertDialog, {
+ _doTransition: function(dir){
+ console.log("in _doTransition and this = ", this);
+
+ var h = dojo.marginBox(this.domNode.firstChild).h;
+
+ var bodyHeight = this.controller.getWindowSize().h;
+
+ var high = bodyHeight - h;
+ var low = bodyHeight;
+
+ var anim1 = dojo.fx.slideTo({
+ node: this.domNode,
+ duration: 400,
+ top: {start: dir < 0 ? high : low, end: dir < 0 ? low: high}
+ });
+
+ var anim2 = dojo[dir < 0 ? "fadeOut" : "fadeIn"]({
+ node: this.mask,
+ duration: 400
+ });
+
+ var anim = dojo.fx.combine([anim1, anim2]);
+
+ var _this = this;
+
+ dojo.connect(anim, "onEnd", this, function(){
+ if(dir < 0){
+ _this.domNode.style.display = "none";
+ dojo.destroy(_this.domNode);
+ dojo.destroy(_this.mask);
+ }
+ });
+ anim.play();
+ }
+});
+
+dojo.extend(dojox.mobile.app.List, {
+ deleteRow: function(){
+ console.log("deleteRow in compat mode", row);
+
+ var row = this._selectedRow;
+ // First make the row invisible
+ // Put it back where it came from
+ dojo.style(row, {
+ visibility: "hidden",
+ minHeight: "0px"
+ });
+ dojo.removeClass(row, "hold");
+
+
+ // Animate reducing it's height to zero, then delete the data from the
+ // array
+ var height = dojo.contentBox(row).h;
+ dojo.animateProperty({
+ node: row,
+ duration: 800,
+ properties: {
+ height: {start: height, end: 1},
+ paddingTop: {end: 0},
+ paddingBottom: {end: 0}
+ },
+ onEnd: this._postDeleteAnim
+ }).play();
+ }
+});
+
+if(dojox.mobile.app.ImageView && !dojo.create("canvas").getContext){
+ dojo.extend(dojox.mobile.app.ImageView, {
+ buildRendering: function(){
+ this.domNode.innerHTML =
+ "ImageView widget is not supported on this browser."
+ + "Please try again with a modern browser, e.g. "
+ + "Safari, Chrome or Firefox";
+ this.canvas = {};
+ },
+
+ postCreate: function(){}
+ });
+}
+
+if(dojox.mobile.app.ImageThumbView){
+ dojo.extend(dojox.mobile.app.ImageThumbView, {
+ place: function(node, x, y){
+ dojo.style(node, {
+ top: y + "px",
+ left: x + "px",
+ visibility: "visible"
+ });
+ }
+ })
+}
+
+}
+
diff --git a/js/dojo-1.6/dojox/mobile/app/compat.xd.js b/js/dojo-1.6/dojox/mobile/app/compat.xd.js
new file mode 100644
index 0000000..60c026b
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/compat.xd.js
@@ -0,0 +1,14 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+/*
+ This is an optimized version of Dojo, built for deployment and not for
+ development. To get sources and documentation, please visit:
+
+ http://dojotoolkit.org
+*/
+
+dojo._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojo.uacss"],["provide","dijit._base.sniff"],["provide","dojo.fx.Toggler"],["provide","dojo.fx"],["provide","dojox.fx.flip"],["provide","dojox.mobile.compat"],["provide","dojox.mobile.app.compat"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojo.uacss"]){_4._hasResource["dojo.uacss"]=true;_4.provide("dojo.uacss");(function(){var d=_4,_7=d.doc.documentElement,ie=d.isIE,_8=d.isOpera,_9=Math.floor,ff=d.isFF,_a=d.boxModel.replace(/-/,""),_b={dj_ie:ie,dj_ie6:_9(ie)==6,dj_ie7:_9(ie)==7,dj_ie8:_9(ie)==8,dj_ie9:_9(ie)==9,dj_quirks:d.isQuirks,dj_iequirks:ie&&d.isQuirks,dj_opera:_8,dj_khtml:d.isKhtml,dj_webkit:d.isWebKit,dj_safari:d.isSafari,dj_chrome:d.isChrome,dj_gecko:d.isMozilla,dj_ff3:_9(ff)==3};_b["dj_"+_a]=true;var _c="";for(var _d in _b){if(_b[_d]){_c+=_d+" ";}}_7.className=d.trim(_7.className+" "+_c);_4._loaders.unshift(function(){if(!_4._isBodyLtr()){var _e="dj_rtl dijitRtl "+_c.replace(/ /g,"-rtl ");_7.className=d.trim(_7.className+" "+_e);}});})();}if(!_4._hasResource["dijit._base.sniff"]){_4._hasResource["dijit._base.sniff"]=true;_4.provide("dijit._base.sniff");}if(!_4._hasResource["dojo.fx.Toggler"]){_4._hasResource["dojo.fx.Toggler"]=true;_4.provide("dojo.fx.Toggler");_4.declare("dojo.fx.Toggler",null,{node:null,showFunc:_4.fadeIn,hideFunc:_4.fadeOut,showDuration:200,hideDuration:200,constructor:function(_f){var _10=this;_4.mixin(_10,_f);_10.node=_f.node;_10._showArgs=_4.mixin({},_f);_10._showArgs.node=_10.node;_10._showArgs.duration=_10.showDuration;_10.showAnim=_10.showFunc(_10._showArgs);_10._hideArgs=_4.mixin({},_f);_10._hideArgs.node=_10.node;_10._hideArgs.duration=_10.hideDuration;_10.hideAnim=_10.hideFunc(_10._hideArgs);_4.connect(_10.showAnim,"beforeBegin",_4.hitch(_10.hideAnim,"stop",true));_4.connect(_10.hideAnim,"beforeBegin",_4.hitch(_10.showAnim,"stop",true));},show:function(_11){return this.showAnim.play(_11||0);},hide:function(_12){return this.hideAnim.play(_12||0);}});}if(!_4._hasResource["dojo.fx"]){_4._hasResource["dojo.fx"]=true;_4.provide("dojo.fx");(function(){var d=_4,_13={_fire:function(evt,_14){if(this[evt]){this[evt].apply(this,_14||[]);}return this;}};var _15=function(_16){this._index=-1;this._animations=_16||[];this._current=this._onAnimateCtx=this._onEndCtx=null;this.duration=0;d.forEach(this._animations,function(a){this.duration+=a.duration;if(a.delay){this.duration+=a.delay;}},this);};d.extend(_15,{_onAnimate:function(){this._fire("onAnimate",arguments);},_onEnd:function(){d.disconnect(this._onAnimateCtx);d.disconnect(this._onEndCtx);this._onAnimateCtx=this._onEndCtx=null;if(this._index+1==this._animations.length){this._fire("onEnd");}else{this._current=this._animations[++this._index];this._onAnimateCtx=d.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd");this._current.play(0,true);}},play:function(_17,_18){if(!this._current){this._current=this._animations[this._index=0];}if(!_18&&this._current.status()=="playing"){return this;}var _19=d.connect(this._current,"beforeBegin",this,function(){this._fire("beforeBegin");}),_1a=d.connect(this._current,"onBegin",this,function(arg){this._fire("onBegin",arguments);}),_1b=d.connect(this._current,"onPlay",this,function(arg){this._fire("onPlay",arguments);d.disconnect(_19);d.disconnect(_1a);d.disconnect(_1b);});if(this._onAnimateCtx){d.disconnect(this._onAnimateCtx);}this._onAnimateCtx=d.connect(this._current,"onAnimate",this,"_onAnimate");if(this._onEndCtx){d.disconnect(this._onEndCtx);}this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd");this._current.play.apply(this._current,arguments);return this;},pause:function(){if(this._current){var e=d.connect(this._current,"onPause",this,function(arg){this._fire("onPause",arguments);d.disconnect(e);});this._current.pause();}return this;},gotoPercent:function(_1c,_1d){this.pause();var _1e=this.duration*_1c;this._current=null;d.some(this._animations,function(a){if(a.duration<=_1e){this._current=a;return true;}_1e-=a.duration;return false;});if(this._current){this._current.gotoPercent(_1e/this._current.duration,_1d);}return this;},stop:function(_1f){if(this._current){if(_1f){for(;this._index+1<this._animations.length;++this._index){this._animations[this._index].stop(true);}this._current=this._animations[this._index];}var e=d.connect(this._current,"onStop",this,function(arg){this._fire("onStop",arguments);d.disconnect(e);});this._current.stop();}return this;},status:function(){return this._current?this._current.status():"stopped";},destroy:function(){if(this._onAnimateCtx){d.disconnect(this._onAnimateCtx);}if(this._onEndCtx){d.disconnect(this._onEndCtx);}}});d.extend(_15,_13);_4.fx.chain=function(_20){return new _15(_20);};var _21=function(_22){this._animations=_22||[];this._connects=[];this._finished=0;this.duration=0;d.forEach(_22,function(a){var _23=a.duration;if(a.delay){_23+=a.delay;}if(this.duration<_23){this.duration=_23;}this._connects.push(d.connect(a,"onEnd",this,"_onEnd"));},this);this._pseudoAnimation=new d.Animation({curve:[0,1],duration:this.duration});var _24=this;d.forEach(["beforeBegin","onBegin","onPlay","onAnimate","onPause","onStop","onEnd"],function(evt){_24._connects.push(d.connect(_24._pseudoAnimation,evt,function(){_24._fire(evt,arguments);}));});};d.extend(_21,{_doAction:function(_25,_26){d.forEach(this._animations,function(a){a[_25].apply(a,_26);});return this;},_onEnd:function(){if(++this._finished>this._animations.length){this._fire("onEnd");}},_call:function(_27,_28){var t=this._pseudoAnimation;t[_27].apply(t,_28);},play:function(_29,_2a){this._finished=0;this._doAction("play",arguments);this._call("play",arguments);return this;},pause:function(){this._doAction("pause",arguments);this._call("pause",arguments);return this;},gotoPercent:function(_2b,_2c){var ms=this.duration*_2b;d.forEach(this._animations,function(a){a.gotoPercent(a.duration<ms?1:(ms/a.duration),_2c);});this._call("gotoPercent",arguments);return this;},stop:function(_2d){this._doAction("stop",arguments);this._call("stop",arguments);return this;},status:function(){return this._pseudoAnimation.status();},destroy:function(){d.forEach(this._connects,_4.disconnect);}});d.extend(_21,_13);_4.fx.combine=function(_2e){return new _21(_2e);};_4.fx.wipeIn=function(_2f){var _30=_2f.node=d.byId(_2f.node),s=_30.style,o;var _31=d.animateProperty(d.mixin({properties:{height:{start:function(){o=s.overflow;s.overflow="hidden";if(s.visibility=="hidden"||s.display=="none"){s.height="1px";s.display="";s.visibility="";return 1;}else{var _32=d.style(_30,"height");return Math.max(_32,1);}},end:function(){return _30.scrollHeight;}}}},_2f));d.connect(_31,"onEnd",function(){s.height="auto";s.overflow=o;});return _31;};_4.fx.wipeOut=function(_33){var _34=_33.node=d.byId(_33.node),s=_34.style,o;var _35=d.animateProperty(d.mixin({properties:{height:{end:1}}},_33));d.connect(_35,"beforeBegin",function(){o=s.overflow;s.overflow="hidden";s.display="";});d.connect(_35,"onEnd",function(){s.overflow=o;s.height="auto";s.display="none";});return _35;};_4.fx.slideTo=function(_36){var _37=_36.node=d.byId(_36.node),top=null,_38=null;var _39=(function(n){return function(){var cs=d.getComputedStyle(n);var pos=cs.position;top=(pos=="absolute"?n.offsetTop:parseInt(cs.top)||0);_38=(pos=="absolute"?n.offsetLeft:parseInt(cs.left)||0);if(pos!="absolute"&&pos!="relative"){var ret=d.position(n,true);top=ret.y;_38=ret.x;n.style.position="absolute";n.style.top=top+"px";n.style.left=_38+"px";}};})(_37);_39();var _3a=d.animateProperty(d.mixin({properties:{top:_36.top||0,left:_36.left||0}},_36));d.connect(_3a,"beforeBegin",_3a,_39);return _3a;};})();}if(!_4._hasResource["dojox.fx.flip"]){_4._hasResource["dojox.fx.flip"]=true;_4.provide("dojox.fx.flip");_4.experimental("dojox.fx.flip");var _3b="border",_3c="Width",_3d="Height",_3e="Top",_3f="Right",_40="Left",_41="Bottom";_6.fx.flip=function(_42){var _43=_4.create("div"),_44=_42.node=_4.byId(_42.node),s=_44.style,_45=null,hs=null,pn=null,_46=_42.lightColor||"#dddddd",_47=_42.darkColor||"#555555",_48=_4.style(_44,"backgroundColor"),_49=_42.endColor||_48,_4a={},_4b=[],_4c=_42.duration?_42.duration/2:250,dir=_42.dir||"left",_4d=0.9,_4e="transparent",_4f=_42.whichAnim,_50=_42.axis||"center",_51=_42.depth;var _52=function(_53){return ((new _4.Color(_53)).toHex()==="#000000")?"#000001":_53;};if(_4.isIE<7){_49=_52(_49);_46=_52(_46);_47=_52(_47);_48=_52(_48);_4e="black";_43.style.filter="chroma(color='#000000')";}var _54=(function(n){return function(){var ret=_4.coords(n,true);_45={top:ret.y,left:ret.x,width:ret.w,height:ret.h};};})(_44);_54();hs={position:"absolute",top:_45["top"]+"px",left:_45["left"]+"px",height:"0",width:"0",zIndex:_42.zIndex||(s.zIndex||0),border:"0 solid "+_4e,fontSize:"0",visibility:"hidden"};var _55=[{},{top:_45["top"],left:_45["left"]}];var _56={left:[_40,_3f,_3e,_41,_3c,_3d,"end"+_3d+"Min",_40,"end"+_3d+"Max"],right:[_3f,_40,_3e,_41,_3c,_3d,"end"+_3d+"Min",_40,"end"+_3d+"Max"],top:[_3e,_41,_40,_3f,_3d,_3c,"end"+_3c+"Min",_3e,"end"+_3c+"Max"],bottom:[_41,_3e,_40,_3f,_3d,_3c,"end"+_3c+"Min",_3e,"end"+_3c+"Max"]};pn=_56[dir];if(typeof _51!="undefined"){_51=Math.max(0,Math.min(1,_51))/2;_4d=0.4+(0.5-_51);}else{_4d=Math.min(0.9,Math.max(0.4,_45[pn[5].toLowerCase()]/_45[pn[4].toLowerCase()]));}var p0=_55[0];for(var i=4;i<6;i++){if(_50=="center"||_50=="cube"){_45["end"+pn[i]+"Min"]=_45[pn[i].toLowerCase()]*_4d;_45["end"+pn[i]+"Max"]=_45[pn[i].toLowerCase()]/_4d;}else{if(_50=="shortside"){_45["end"+pn[i]+"Min"]=_45[pn[i].toLowerCase()];_45["end"+pn[i]+"Max"]=_45[pn[i].toLowerCase()]/_4d;}else{if(_50=="longside"){_45["end"+pn[i]+"Min"]=_45[pn[i].toLowerCase()]*_4d;_45["end"+pn[i]+"Max"]=_45[pn[i].toLowerCase()];}}}}if(_50=="center"){p0[pn[2].toLowerCase()]=_45[pn[2].toLowerCase()]-(_45[pn[8]]-_45[pn[6]])/4;}else{if(_50=="shortside"){p0[pn[2].toLowerCase()]=_45[pn[2].toLowerCase()]-(_45[pn[8]]-_45[pn[6]])/2;}}_4a[pn[5].toLowerCase()]=_45[pn[5].toLowerCase()]+"px";_4a[pn[4].toLowerCase()]="0";_4a[_3b+pn[1]+_3c]=_45[pn[4].toLowerCase()]+"px";_4a[_3b+pn[1]+"Color"]=_48;p0[_3b+pn[1]+_3c]=0;p0[_3b+pn[1]+"Color"]=_47;p0[_3b+pn[2]+_3c]=p0[_3b+pn[3]+_3c]=_50!="cube"?(_45["end"+pn[5]+"Max"]-_45["end"+pn[5]+"Min"])/2:_45[pn[6]]/2;p0[pn[7].toLowerCase()]=_45[pn[7].toLowerCase()]+_45[pn[4].toLowerCase()]/2+(_42.shift||0);p0[pn[5].toLowerCase()]=_45[pn[6]];var p1=_55[1];p1[_3b+pn[0]+"Color"]={start:_46,end:_49};p1[_3b+pn[0]+_3c]=_45[pn[4].toLowerCase()];p1[_3b+pn[2]+_3c]=0;p1[_3b+pn[3]+_3c]=0;p1[pn[5].toLowerCase()]={start:_45[pn[6]],end:_45[pn[5].toLowerCase()]};_4.mixin(hs,_4a);_4.style(_43,hs);_4.body().appendChild(_43);var _57=function(){_4.destroy(_43);s.backgroundColor=_49;s.visibility="visible";};if(_4f=="last"){for(i in p0){p0[i]={start:p0[i]};}p0[_3b+pn[1]+"Color"]={start:_47,end:_49};p1=p0;}if(!_4f||_4f=="first"){_4b.push(_4.animateProperty({node:_43,duration:_4c,properties:p0}));}if(!_4f||_4f=="last"){_4b.push(_4.animateProperty({node:_43,duration:_4c,properties:p1,onEnd:_57}));}_4.connect(_4b[0],"play",function(){_43.style.visibility="visible";s.visibility="hidden";});return _4.fx.chain(_4b);};_6.fx.flipCube=function(_58){var _59=[],mb=_4.marginBox(_58.node),_5a=mb.w/2,_5b=mb.h/2,_5c={top:{pName:"height",args:[{whichAnim:"first",dir:"top",shift:-_5b},{whichAnim:"last",dir:"bottom",shift:_5b}]},right:{pName:"width",args:[{whichAnim:"first",dir:"right",shift:_5a},{whichAnim:"last",dir:"left",shift:-_5a}]},bottom:{pName:"height",args:[{whichAnim:"first",dir:"bottom",shift:_5b},{whichAnim:"last",dir:"top",shift:-_5b}]},left:{pName:"width",args:[{whichAnim:"first",dir:"left",shift:-_5a},{whichAnim:"last",dir:"right",shift:_5a}]}};var d=_5c[_58.dir||"left"],p=d.args;_58.duration=_58.duration?_58.duration*2:500;_58.depth=0.8;_58.axis="cube";for(var i=p.length-1;i>=0;i--){_4.mixin(_58,p[i]);_59.push(_6.fx.flip(_58));}return _4.fx.combine(_59);};_6.fx.flipPage=function(_5d){var n=_5d.node,_5e=_4.coords(n,true),x=_5e.x,y=_5e.y,w=_5e.w,h=_5e.h,_5f=_4.style(n,"backgroundColor"),_60=_5d.lightColor||"#dddddd",_61=_5d.darkColor,_62=_4.create("div"),_63=[],hn=[],dir=_5d.dir||"right",pn={left:["left","right","x","w"],top:["top","bottom","y","h"],right:["left","left","x","w"],bottom:["top","top","y","h"]},_64={right:[1,-1],left:[-1,1],top:[-1,1],bottom:[1,-1]};_4.style(_62,{position:"absolute",width:w+"px",height:h+"px",top:y+"px",left:x+"px",visibility:"hidden"});var hs=[];for(var i=0;i<2;i++){var r=i%2,d=r?pn[dir][1]:dir,wa=r?"last":"first",_65=r?_5f:_60,_66=r?_65:_5d.startColor||n.style.backgroundColor;hn[i]=_4.clone(_62);var _67=function(x){return function(){_4.destroy(hn[x]);};}(i);_4.body().appendChild(hn[i]);hs[i]={backgroundColor:r?_66:_5f};hs[i][pn[dir][0]]=_5e[pn[dir][2]]+_64[dir][0]*i*_5e[pn[dir][3]]+"px";_4.style(hn[i],hs[i]);_63.push(_6.fx.flip({node:hn[i],dir:d,axis:"shortside",depth:_5d.depth,duration:_5d.duration/2,shift:_64[dir][i]*_5e[pn[dir][3]]/2,darkColor:_61,lightColor:_60,whichAnim:wa,endColor:_65}));_4.connect(_63[i],"onEnd",_67);}return _4.fx.chain(_63);};_6.fx.flipGrid=function(_68){var _69=_68.rows||4,_6a=_68.cols||4,_6b=[],_6c=_4.create("div"),n=_68.node,_6d=_4.coords(n,true),x=_6d.x,y=_6d.y,nw=_6d.w,nh=_6d.h,w=_6d.w/_6a,h=_6d.h/_69,_6e=[];_4.style(_6c,{position:"absolute",width:w+"px",height:h+"px",backgroundColor:_4.style(n,"backgroundColor")});for(var i=0;i<_69;i++){var r=i%2,d=r?"right":"left",_6f=r?1:-1;var cn=_4.clone(n);_4.style(cn,{position:"absolute",width:nw+"px",height:nh+"px",top:y+"px",left:x+"px",clip:"rect("+i*h+"px,"+nw+"px,"+nh+"px,0)"});_4.body().appendChild(cn);_6b[i]=[];for(var j=0;j<_6a;j++){var hn=_4.clone(_6c),l=r?j:_6a-(j+1);var _70=function(xn,_71,_72){return function(){if(!(_71%2)){_4.style(xn,{clip:"rect("+_71*h+"px,"+(nw-(_72+1)*w)+"px,"+((_71+1)*h)+"px,0px)"});}else{_4.style(xn,{clip:"rect("+_71*h+"px,"+nw+"px,"+((_71+1)*h)+"px,"+((_72+1)*w)+"px)"});}};}(cn,i,j);_4.body().appendChild(hn);_4.style(hn,{left:x+l*w+"px",top:y+i*h+"px",visibility:"hidden"});var a=_6.fx.flipPage({node:hn,dir:d,duration:_68.duration||900,shift:_6f*w/2,depth:0.2,darkColor:_68.darkColor,lightColor:_68.lightColor,startColor:_68.startColor||_68.node.style.backgroundColor}),_73=function(xn){return function(){_4.destroy(xn);};}(hn);_4.connect(a,"play",this,_70);_4.connect(a,"play",this,_73);_6b[i].push(a);}_6e.push(_4.fx.chain(_6b[i]));}_4.connect(_6e[0],"play",function(){_4.style(n,{visibility:"hidden"});});return _4.fx.combine(_6e);};}if(!_4._hasResource["dojox.mobile.compat"]){_4._hasResource["dojox.mobile.compat"]=true;_4.provide("dojox.mobile.compat");if(!_4.isWebKit){_4.extend(_6.mobile.View,{_doTransition:function(_74,_75,_76,dir){var _77;this.wakeUp(_75);if(!_76||_76=="none"){_75.style.display="";_74.style.display="none";_75.style.left="0px";this.invokeCallback();}else{if(_76=="slide"){var w=_74.offsetWidth;var s1=_4.fx.slideTo({node:_74,duration:400,left:-w*dir,top:_74.offsetTop});var s2=_4.fx.slideTo({node:_75,duration:400,left:0});_75.style.position="absolute";_75.style.left=w*dir+"px";_75.style.display="";_77=_4.fx.combine([s1,s2]);_4.connect(_77,"onEnd",this,function(){_74.style.display="none";_75.style.position="relative";this.invokeCallback();});_77.play();}else{if(_76=="flip"){_77=_6.fx.flip({node:_74,dir:"right",depth:0.5,duration:400});_75.style.position="absolute";_75.style.left="0px";_4.connect(_77,"onEnd",this,function(){_74.style.display="none";_75.style.position="relative";_75.style.display="";this.invokeCallback();});_77.play();}else{if(_76=="fade"){_77=_4.fx.chain([_4.fadeOut({node:_74,duration:600}),_4.fadeIn({node:_75,duration:600})]);_75.style.position="absolute";_75.style.left="0px";_75.style.display="";_4.style(_75,"opacity",0);_4.connect(_77,"onEnd",this,function(){_74.style.display="none";_75.style.position="relative";_4.style(_74,"opacity",1);this.invokeCallback();});_77.play();}}}}},wakeUp:function(_78){if(_4.isIE&&!_78._wokeup){_78._wokeup=true;var _79=_78.style.display;_78.style.display="";var _7a=_78.getElementsByTagName("*");for(var i=0,len=_7a.length;i<len;i++){var val=_7a[i].style.display;_7a[i].style.display="none";_7a[i].style.display="";_7a[i].style.display=val;}_78.style.display=_79;}}});_4.extend(_6.mobile.Switch,{buildRendering:function(){this.domNode=this.srcNodeRef||_4.doc.createElement("DIV");this.domNode.className="mblSwitch";this.domNode.innerHTML="<div class=\"mblSwitchInner\">"+"<div class=\"mblSwitchBg mblSwitchBgLeft\">"+"<div class=\"mblSwitchCorner mblSwitchCorner1T\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner2T\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner3T\"></div>"+"<div class=\"mblSwitchText mblSwitchTextLeft\">"+this.leftLabel+"</div>"+"<div class=\"mblSwitchCorner mblSwitchCorner1B\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner2B\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner3B\"></div>"+"</div>"+"<div class=\"mblSwitchBg mblSwitchBgRight\">"+"<div class=\"mblSwitchCorner mblSwitchCorner1T\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner2T\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner3T\"></div>"+"<div class=\"mblSwitchText mblSwitchTextRight\">"+this.rightLabel+"</div>"+"<div class=\"mblSwitchCorner mblSwitchCorner1B\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner2B\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner3B\"></div>"+"</div>"+"<div class=\"mblSwitchKnobContainer\">"+"<div class=\"mblSwitchCorner mblSwitchCorner1T\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner2T\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner3T\"></div>"+"<div class=\"mblSwitchKnob\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner1B\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner2B\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner3B\"></div>"+"</div>"+"</div>";var n=this.inner=this.domNode.firstChild;this.left=n.childNodes[0];this.right=n.childNodes[1];this.knob=n.childNodes[2];_4.addClass(this.domNode,(this.value=="on")?"mblSwitchOn":"mblSwitchOff");this[this.value=="off"?"left":"right"].style.display="none";},_changeState:function(_7b){if(!this.inner.parentNode||!this.inner.parentNode.tagName){_4.addClass(this.domNode,(_7b=="on")?"mblSwitchOn":"mblSwitchOff");return;}var pos;if(this.inner.offsetLeft==0){if(_7b=="on"){return;}pos=-53;}else{if(_7b=="off"){return;}pos=0;}var a=_4.fx.slideTo({node:this.inner,duration:500,left:pos});var _7c=this;_4.connect(a,"onEnd",function(){_7c[_7b=="off"?"left":"right"].style.display="none";});a.play();}});if(_4.isIE||_4.isBB){_4.extend(_6.mobile.RoundRect,{buildRendering:function(){_6.mobile.createRoundRect(this);this.domNode.className="mblRoundRect";}});_6.mobile.RoundRectList._addChild=_6.mobile.RoundRectList.prototype.addChild;_4.extend(_6.mobile.RoundRectList,{buildRendering:function(){_6.mobile.createRoundRect(this,true);this.domNode.className="mblRoundRectList";},postCreate:function(){this.redrawBorders();},addChild:function(_7d){_6.mobile.RoundRectList._addChild.apply(this,arguments);this.redrawBorders();if(_6.mobile.applyPngFilter){_6.mobile.applyPngFilter(_7d.domNode);}},redrawBorders:function(){var _7e=false;for(var i=this.containerNode.childNodes.length-1;i>=0;i--){var c=this.containerNode.childNodes[i];if(c.tagName=="LI"){c.style.borderBottomStyle=_7e?"solid":"none";_7e=true;}}}});_4.extend(_6.mobile.EdgeToEdgeList,{buildRendering:function(){this.domNode=this.containerNode=this.srcNodeRef||_4.doc.createElement("UL");this.domNode.className="mblEdgeToEdgeList";}});if(_6.mobile.IconContainer){_6.mobile.IconContainer._addChild=_6.mobile.IconContainer.prototype.addChild;_4.extend(_6.mobile.IconContainer,{addChild:function(_7f){_6.mobile.IconContainer._addChild.apply(this,arguments);if(_6.mobile.applyPngFilter){_6.mobile.applyPngFilter(_7f.domNode);}}});}_4.mixin(_6.mobile,{createRoundRect:function(_80,_81){var i;_80.domNode=_4.doc.createElement("DIV");_80.domNode.style.padding="0px";_80.domNode.style.backgroundColor="transparent";_80.domNode.style.borderStyle="none";_80.containerNode=_4.doc.createElement(_81?"UL":"DIV");_80.containerNode.className="mblRoundRectContainer";if(_80.srcNodeRef){_80.srcNodeRef.parentNode.replaceChild(_80.domNode,_80.srcNodeRef);for(i=0,len=_80.srcNodeRef.childNodes.length;i<len;i++){_80.containerNode.appendChild(_80.srcNodeRef.removeChild(_80.srcNodeRef.firstChild));}_80.srcNodeRef=null;}_80.domNode.appendChild(_80.containerNode);for(i=0;i<=5;i++){var top=_4.create("DIV");top.className="mblRoundCorner mblRoundCorner"+i+"T";_80.domNode.insertBefore(top,_80.containerNode);var _82=_4.create("DIV");_82.className="mblRoundCorner mblRoundCorner"+i+"B";_80.domNode.appendChild(_82);}}});if(_6.mobile.ScrollableView){_4.extend(_6.mobile.ScrollableView,{postCreate:function(){var _83=_4.create("DIV",{className:"mblDummyForIE",innerHTML:"&nbsp;"},this.containerNode,"first");_4.style(_83,{position:"relative",marginBottom:"-2px",fontSize:"1px"});}});}}if(_4.isIE<=6){_6.mobile.applyPngFilter=function(_84){_84=_84||_4.body();var _85=_84.getElementsByTagName("IMG");var _86=_4.moduleUrl("dojo","resources/blank.gif");for(var i=0,len=_85.length;i<len;i++){var img=_85[i];var w=img.offsetWidth;var h=img.offsetHeight;if(w===0||h===0){if(_4.style(img,"display")!="none"){continue;}img.style.display="";w=img.offsetWidth;h=img.offsetHeight;img.style.display="none";if(w===0||h===0){continue;}}var src=img.src;if(src.indexOf("resources/blank.gif")!=-1){continue;}img.src=_86;img.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"')";img.style.width=w+"px";img.style.height=h+"px";}};}_6.mobile.loadCss=function(_87){if(!_4.global._loadedCss){var obj={};_4.forEach(_6.mobile.getCssPaths(),function(_88){obj[_88]=true;});_4.global._loadedCss=obj;}if(!_4.isArray(_87)){_87=[_87];}for(var i=0;i<_87.length;i++){var _89=_87[i];if(!_4.global._loadedCss[_89]){_4.global._loadedCss[_89]=true;if(_4.doc.createStyleSheet){setTimeout(function(_8a){return function(){_4.doc.createStyleSheet(_8a);};}(_89),0);}else{var _8b=_4.doc.createElement("link");_8b.href=_89;_8b.type="text/css";_8b.rel="stylesheet";var _8c=_4.doc.getElementsByTagName("head")[0];_8c.appendChild(_8b);}}}};_6.mobile.getCssPaths=function(){var _8d=[];var i,j;var s=_4.doc.styleSheets;for(i=0;i<s.length;i++){var r=s[i].cssRules||s[i].imports;if(!r){continue;}for(j=0;j<r.length;j++){if(r[j].href){_8d.push(r[j].href);}}}var _8e=_4.doc.getElementsByTagName("link");for(i=0,len=_8e.length;i<len;i++){if(_8e[i].href){_8d.push(_8e[i].href);}}return _8d;};_6.mobile.loadCompatPattern=/\/themes\/(domButtons|buttons|iphone|android).*\.css$/;_6.mobile.loadCompatCssFiles=function(){var _8f=_6.mobile.getCssPaths();for(var i=0;i<_8f.length;i++){var _90=_8f[i];if(_90.match(_6.mobile.loadCompatPattern)&&_90.indexOf("-compat.css")==-1){var _91=_90.substring(0,_90.length-4)+"-compat.css";_6.mobile.loadCss(_91);}}};_6.mobile.hideAddressBar=function(){};_4.addOnLoad(function(){if(_4.config["mblLoadCompatCssFiles"]!==false){_6.mobile.loadCompatCssFiles();}if(_6.mobile.applyPngFilter){_6.mobile.applyPngFilter();}});}}if(!_4._hasResource["dojox.mobile.app.compat"]){_4._hasResource["dojox.mobile.app.compat"]=true;_4.provide("dojox.mobile.app.compat");_4.extend(_6.mobile.app.AlertDialog,{_doTransition:function(dir){var h=_4.marginBox(this.domNode.firstChild).h;var _92=this.controller.getWindowSize().h;var _93=_92-h;var low=_92;var _94=_4.fx.slideTo({node:this.domNode,duration:400,top:{start:dir<0?_93:low,end:dir<0?low:_93}});var _95=_4[dir<0?"fadeOut":"fadeIn"]({node:this.mask,duration:400});var _96=_4.fx.combine([_94,_95]);var _97=this;_4.connect(_96,"onEnd",this,function(){if(dir<0){_97.domNode.style.display="none";_4.destroy(_97.domNode);_4.destroy(_97.mask);}});_96.play();}});_4.extend(_6.mobile.app.List,{deleteRow:function(){var row=this._selectedRow;_4.style(row,{visibility:"hidden",minHeight:"0px"});_4.removeClass(row,"hold");var _98=_4.contentBox(row).h;_4.animateProperty({node:row,duration:800,properties:{height:{start:_98,end:1},paddingTop:{end:0},paddingBottom:{end:0}},onEnd:this._postDeleteAnim}).play();}});if(_6.mobile.app.ImageView&&!_4.create("canvas").getContext){_4.extend(_6.mobile.app.ImageView,{buildRendering:function(){this.domNode.innerHTML="ImageView widget is not supported on this browser."+"Please try again with a modern browser, e.g. "+"Safari, Chrome or Firefox";this.canvas={};},postCreate:function(){}});}if(_6.mobile.app.ImageThumbView){_4.extend(_6.mobile.app.ImageThumbView,{place:function(_99,x,y){_4.style(_99,{top:y+"px",left:x+"px",visibility:"visible"});}});}}}};});
diff --git a/js/dojo-1.6/dojox/mobile/app/compat.xd.js.uncompressed.js b/js/dojo-1.6/dojox/mobile/app/compat.xd.js.uncompressed.js
new file mode 100644
index 0000000..81822b7
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/app/compat.xd.js.uncompressed.js
@@ -0,0 +1,1710 @@
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojo.uacss"],
+["provide", "dijit._base.sniff"],
+["provide", "dojo.fx.Toggler"],
+["provide", "dojo.fx"],
+["provide", "dojox.fx.flip"],
+["provide", "dojox.mobile.compat"],
+["provide", "dojox.mobile.app.compat"]],
+defineResource: function(dojo, dijit, dojox){/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+/*
+ This is an optimized version of Dojo, built for deployment and not for
+ development. To get sources and documentation, please visit:
+
+ http://dojotoolkit.org
+*/
+
+if(!dojo._hasResource["dojo.uacss"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.uacss"] = true;
+dojo.provide("dojo.uacss");
+
+
+
+(function(){
+ // summary:
+ // Applies pre-set CSS classes to the top-level HTML node, based on:
+ // - browser (ex: dj_ie)
+ // - browser version (ex: dj_ie6)
+ // - box model (ex: dj_contentBox)
+ // - text direction (ex: dijitRtl)
+ //
+ // In addition, browser, browser version, and box model are
+ // combined with an RTL flag when browser text is RTL. ex: dj_ie-rtl.
+
+ var d = dojo,
+ html = d.doc.documentElement,
+ ie = d.isIE,
+ opera = d.isOpera,
+ maj = Math.floor,
+ ff = d.isFF,
+ boxModel = d.boxModel.replace(/-/,''),
+
+ classes = {
+ dj_ie: ie,
+ dj_ie6: maj(ie) == 6,
+ dj_ie7: maj(ie) == 7,
+ dj_ie8: maj(ie) == 8,
+ dj_ie9: maj(ie) == 9,
+ dj_quirks: d.isQuirks,
+ dj_iequirks: ie && d.isQuirks,
+
+ // NOTE: Opera not supported by dijit
+ dj_opera: opera,
+
+ dj_khtml: d.isKhtml,
+
+ dj_webkit: d.isWebKit,
+ dj_safari: d.isSafari,
+ dj_chrome: d.isChrome,
+
+ dj_gecko: d.isMozilla,
+ dj_ff3: maj(ff) == 3
+ }; // no dojo unsupported browsers
+
+ classes["dj_" + boxModel] = true;
+
+ // apply browser, browser version, and box model class names
+ var classStr = "";
+ for(var clz in classes){
+ if(classes[clz]){
+ classStr += clz + " ";
+ }
+ }
+ html.className = d.trim(html.className + " " + classStr);
+
+ // If RTL mode, then add dj_rtl flag plus repeat existing classes with -rtl extension.
+ // We can't run the code below until the <body> tag has loaded (so we can check for dir=rtl).
+ // Unshift() is to run sniff code before the parser.
+ dojo._loaders.unshift(function(){
+ if(!dojo._isBodyLtr()){
+ var rtlClassStr = "dj_rtl dijitRtl " + classStr.replace(/ /g, "-rtl ")
+ html.className = d.trim(html.className + " " + rtlClassStr);
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dijit._base.sniff"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.sniff"] = true;
+dojo.provide("dijit._base.sniff");
+
+
+
+
+// summary:
+// Applies pre-set CSS classes to the top-level HTML node, see
+// `dojo.uacss` for details.
+//
+// Simply doing a require on this module will
+// establish this CSS. Modified version of Morris' CSS hack.
+
+}
+
+if(!dojo._hasResource["dojo.fx.Toggler"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.fx.Toggler"] = true;
+dojo.provide("dojo.fx.Toggler");
+
+
+
+dojo.declare("dojo.fx.Toggler", null, {
+ // summary:
+ // A simple `dojo.Animation` toggler API.
+ //
+ // description:
+ // class constructor for an animation toggler. It accepts a packed
+ // set of arguments about what type of animation to use in each
+ // direction, duration, etc. All available members are mixed into
+ // these animations from the constructor (for example, `node`,
+ // `showDuration`, `hideDuration`).
+ //
+ // example:
+ // | var t = new dojo.fx.Toggler({
+ // | node: "nodeId",
+ // | showDuration: 500,
+ // | // hideDuration will default to "200"
+ // | showFunc: dojo.fx.wipeIn,
+ // | // hideFunc will default to "fadeOut"
+ // | });
+ // | t.show(100); // delay showing for 100ms
+ // | // ...time passes...
+ // | t.hide();
+
+ // node: DomNode
+ // the node to target for the showing and hiding animations
+ node: null,
+
+ // showFunc: Function
+ // The function that returns the `dojo.Animation` to show the node
+ showFunc: dojo.fadeIn,
+
+ // hideFunc: Function
+ // The function that returns the `dojo.Animation` to hide the node
+ hideFunc: dojo.fadeOut,
+
+ // showDuration:
+ // Time in milliseconds to run the show Animation
+ showDuration: 200,
+
+ // hideDuration:
+ // Time in milliseconds to run the hide Animation
+ hideDuration: 200,
+
+ // FIXME: need a policy for where the toggler should "be" the next
+ // time show/hide are called if we're stopped somewhere in the
+ // middle.
+ // FIXME: also would be nice to specify individual showArgs/hideArgs mixed into
+ // each animation individually.
+ // FIXME: also would be nice to have events from the animations exposed/bridged
+
+ /*=====
+ _showArgs: null,
+ _showAnim: null,
+
+ _hideArgs: null,
+ _hideAnim: null,
+
+ _isShowing: false,
+ _isHiding: false,
+ =====*/
+
+ constructor: function(args){
+ var _t = this;
+
+ dojo.mixin(_t, args);
+ _t.node = args.node;
+ _t._showArgs = dojo.mixin({}, args);
+ _t._showArgs.node = _t.node;
+ _t._showArgs.duration = _t.showDuration;
+ _t.showAnim = _t.showFunc(_t._showArgs);
+
+ _t._hideArgs = dojo.mixin({}, args);
+ _t._hideArgs.node = _t.node;
+ _t._hideArgs.duration = _t.hideDuration;
+ _t.hideAnim = _t.hideFunc(_t._hideArgs);
+
+ dojo.connect(_t.showAnim, "beforeBegin", dojo.hitch(_t.hideAnim, "stop", true));
+ dojo.connect(_t.hideAnim, "beforeBegin", dojo.hitch(_t.showAnim, "stop", true));
+ },
+
+ show: function(delay){
+ // summary: Toggle the node to showing
+ // delay: Integer?
+ // Ammount of time to stall playing the show animation
+ return this.showAnim.play(delay || 0);
+ },
+
+ hide: function(delay){
+ // summary: Toggle the node to hidden
+ // delay: Integer?
+ // Ammount of time to stall playing the hide animation
+ return this.hideAnim.play(delay || 0);
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojo.fx"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.fx"] = true;
+dojo.provide("dojo.fx");
+
+
+
+
+/*=====
+dojo.fx = {
+ // summary: Effects library on top of Base animations
+};
+=====*/
+(function(){
+
+ var d = dojo,
+ _baseObj = {
+ _fire: function(evt, args){
+ if(this[evt]){
+ this[evt].apply(this, args||[]);
+ }
+ return this;
+ }
+ };
+
+ var _chain = function(animations){
+ this._index = -1;
+ this._animations = animations||[];
+ this._current = this._onAnimateCtx = this._onEndCtx = null;
+
+ this.duration = 0;
+ d.forEach(this._animations, function(a){
+ this.duration += a.duration;
+ if(a.delay){ this.duration += a.delay; }
+ }, this);
+ };
+ d.extend(_chain, {
+ _onAnimate: function(){
+ this._fire("onAnimate", arguments);
+ },
+ _onEnd: function(){
+ d.disconnect(this._onAnimateCtx);
+ d.disconnect(this._onEndCtx);
+ this._onAnimateCtx = this._onEndCtx = null;
+ if(this._index + 1 == this._animations.length){
+ this._fire("onEnd");
+ }else{
+ // switch animations
+ this._current = this._animations[++this._index];
+ this._onAnimateCtx = d.connect(this._current, "onAnimate", this, "_onAnimate");
+ this._onEndCtx = d.connect(this._current, "onEnd", this, "_onEnd");
+ this._current.play(0, true);
+ }
+ },
+ play: function(/*int?*/ delay, /*Boolean?*/ gotoStart){
+ if(!this._current){ this._current = this._animations[this._index = 0]; }
+ if(!gotoStart && this._current.status() == "playing"){ return this; }
+ var beforeBegin = d.connect(this._current, "beforeBegin", this, function(){
+ this._fire("beforeBegin");
+ }),
+ onBegin = d.connect(this._current, "onBegin", this, function(arg){
+ this._fire("onBegin", arguments);
+ }),
+ onPlay = d.connect(this._current, "onPlay", this, function(arg){
+ this._fire("onPlay", arguments);
+ d.disconnect(beforeBegin);
+ d.disconnect(onBegin);
+ d.disconnect(onPlay);
+ });
+ if(this._onAnimateCtx){
+ d.disconnect(this._onAnimateCtx);
+ }
+ this._onAnimateCtx = d.connect(this._current, "onAnimate", this, "_onAnimate");
+ if(this._onEndCtx){
+ d.disconnect(this._onEndCtx);
+ }
+ this._onEndCtx = d.connect(this._current, "onEnd", this, "_onEnd");
+ this._current.play.apply(this._current, arguments);
+ return this;
+ },
+ pause: function(){
+ if(this._current){
+ var e = d.connect(this._current, "onPause", this, function(arg){
+ this._fire("onPause", arguments);
+ d.disconnect(e);
+ });
+ this._current.pause();
+ }
+ return this;
+ },
+ gotoPercent: function(/*Decimal*/percent, /*Boolean?*/ andPlay){
+ this.pause();
+ var offset = this.duration * percent;
+ this._current = null;
+ d.some(this._animations, function(a){
+ if(a.duration <= offset){
+ this._current = a;
+ return true;
+ }
+ offset -= a.duration;
+ return false;
+ });
+ if(this._current){
+ this._current.gotoPercent(offset / this._current.duration, andPlay);
+ }
+ return this;
+ },
+ stop: function(/*boolean?*/ gotoEnd){
+ if(this._current){
+ if(gotoEnd){
+ for(; this._index + 1 < this._animations.length; ++this._index){
+ this._animations[this._index].stop(true);
+ }
+ this._current = this._animations[this._index];
+ }
+ var e = d.connect(this._current, "onStop", this, function(arg){
+ this._fire("onStop", arguments);
+ d.disconnect(e);
+ });
+ this._current.stop();
+ }
+ return this;
+ },
+ status: function(){
+ return this._current ? this._current.status() : "stopped";
+ },
+ destroy: function(){
+ if(this._onAnimateCtx){ d.disconnect(this._onAnimateCtx); }
+ if(this._onEndCtx){ d.disconnect(this._onEndCtx); }
+ }
+ });
+ d.extend(_chain, _baseObj);
+
+ dojo.fx.chain = function(/*dojo.Animation[]*/ animations){
+ // summary:
+ // Chain a list of `dojo.Animation`s to run in sequence
+ //
+ // description:
+ // Return a `dojo.Animation` which will play all passed
+ // `dojo.Animation` instances in sequence, firing its own
+ // synthesized events simulating a single animation. (eg:
+ // onEnd of this animation means the end of the chain,
+ // not the individual animations within)
+ //
+ // example:
+ // Once `node` is faded out, fade in `otherNode`
+ // | dojo.fx.chain([
+ // | dojo.fadeIn({ node:node }),
+ // | dojo.fadeOut({ node:otherNode })
+ // | ]).play();
+ //
+ return new _chain(animations) // dojo.Animation
+ };
+
+ var _combine = function(animations){
+ this._animations = animations||[];
+ this._connects = [];
+ this._finished = 0;
+
+ this.duration = 0;
+ d.forEach(animations, function(a){
+ var duration = a.duration;
+ if(a.delay){ duration += a.delay; }
+ if(this.duration < duration){ this.duration = duration; }
+ this._connects.push(d.connect(a, "onEnd", this, "_onEnd"));
+ }, this);
+
+ this._pseudoAnimation = new d.Animation({curve: [0, 1], duration: this.duration});
+ var self = this;
+ d.forEach(["beforeBegin", "onBegin", "onPlay", "onAnimate", "onPause", "onStop", "onEnd"],
+ function(evt){
+ self._connects.push(d.connect(self._pseudoAnimation, evt,
+ function(){ self._fire(evt, arguments); }
+ ));
+ }
+ );
+ };
+ d.extend(_combine, {
+ _doAction: function(action, args){
+ d.forEach(this._animations, function(a){
+ a[action].apply(a, args);
+ });
+ return this;
+ },
+ _onEnd: function(){
+ if(++this._finished > this._animations.length){
+ this._fire("onEnd");
+ }
+ },
+ _call: function(action, args){
+ var t = this._pseudoAnimation;
+ t[action].apply(t, args);
+ },
+ play: function(/*int?*/ delay, /*Boolean?*/ gotoStart){
+ this._finished = 0;
+ this._doAction("play", arguments);
+ this._call("play", arguments);
+ return this;
+ },
+ pause: function(){
+ this._doAction("pause", arguments);
+ this._call("pause", arguments);
+ return this;
+ },
+ gotoPercent: function(/*Decimal*/percent, /*Boolean?*/ andPlay){
+ var ms = this.duration * percent;
+ d.forEach(this._animations, function(a){
+ a.gotoPercent(a.duration < ms ? 1 : (ms / a.duration), andPlay);
+ });
+ this._call("gotoPercent", arguments);
+ return this;
+ },
+ stop: function(/*boolean?*/ gotoEnd){
+ this._doAction("stop", arguments);
+ this._call("stop", arguments);
+ return this;
+ },
+ status: function(){
+ return this._pseudoAnimation.status();
+ },
+ destroy: function(){
+ d.forEach(this._connects, dojo.disconnect);
+ }
+ });
+ d.extend(_combine, _baseObj);
+
+ dojo.fx.combine = function(/*dojo.Animation[]*/ animations){
+ // summary:
+ // Combine a list of `dojo.Animation`s to run in parallel
+ //
+ // description:
+ // Combine an array of `dojo.Animation`s to run in parallel,
+ // providing a new `dojo.Animation` instance encompasing each
+ // animation, firing standard animation events.
+ //
+ // example:
+ // Fade out `node` while fading in `otherNode` simultaneously
+ // | dojo.fx.combine([
+ // | dojo.fadeIn({ node:node }),
+ // | dojo.fadeOut({ node:otherNode })
+ // | ]).play();
+ //
+ // example:
+ // When the longest animation ends, execute a function:
+ // | var anim = dojo.fx.combine([
+ // | dojo.fadeIn({ node: n, duration:700 }),
+ // | dojo.fadeOut({ node: otherNode, duration: 300 })
+ // | ]);
+ // | dojo.connect(anim, "onEnd", function(){
+ // | // overall animation is done.
+ // | });
+ // | anim.play(); // play the animation
+ //
+ return new _combine(animations); // dojo.Animation
+ };
+
+ dojo.fx.wipeIn = function(/*Object*/ args){
+ // summary:
+ // Expand a node to it's natural height.
+ //
+ // description:
+ // Returns an animation that will expand the
+ // node defined in 'args' object from it's current height to
+ // it's natural height (with no scrollbar).
+ // Node must have no margin/border/padding.
+ //
+ // args: Object
+ // A hash-map of standard `dojo.Animation` constructor properties
+ // (such as easing: node: duration: and so on)
+ //
+ // example:
+ // | dojo.fx.wipeIn({
+ // | node:"someId"
+ // | }).play()
+ var node = args.node = d.byId(args.node), s = node.style, o;
+
+ var anim = d.animateProperty(d.mixin({
+ properties: {
+ height: {
+ // wrapped in functions so we wait till the last second to query (in case value has changed)
+ start: function(){
+ // start at current [computed] height, but use 1px rather than 0
+ // because 0 causes IE to display the whole panel
+ o = s.overflow;
+ s.overflow = "hidden";
+ if(s.visibility == "hidden" || s.display == "none"){
+ s.height = "1px";
+ s.display = "";
+ s.visibility = "";
+ return 1;
+ }else{
+ var height = d.style(node, "height");
+ return Math.max(height, 1);
+ }
+ },
+ end: function(){
+ return node.scrollHeight;
+ }
+ }
+ }
+ }, args));
+
+ d.connect(anim, "onEnd", function(){
+ s.height = "auto";
+ s.overflow = o;
+ });
+
+ return anim; // dojo.Animation
+ };
+
+ dojo.fx.wipeOut = function(/*Object*/ args){
+ // summary:
+ // Shrink a node to nothing and hide it.
+ //
+ // description:
+ // Returns an animation that will shrink node defined in "args"
+ // from it's current height to 1px, and then hide it.
+ //
+ // args: Object
+ // A hash-map of standard `dojo.Animation` constructor properties
+ // (such as easing: node: duration: and so on)
+ //
+ // example:
+ // | dojo.fx.wipeOut({ node:"someId" }).play()
+
+ var node = args.node = d.byId(args.node), s = node.style, o;
+
+ var anim = d.animateProperty(d.mixin({
+ properties: {
+ height: {
+ end: 1 // 0 causes IE to display the whole panel
+ }
+ }
+ }, args));
+
+ d.connect(anim, "beforeBegin", function(){
+ o = s.overflow;
+ s.overflow = "hidden";
+ s.display = "";
+ });
+ d.connect(anim, "onEnd", function(){
+ s.overflow = o;
+ s.height = "auto";
+ s.display = "none";
+ });
+
+ return anim; // dojo.Animation
+ };
+
+ dojo.fx.slideTo = function(/*Object*/ args){
+ // summary:
+ // Slide a node to a new top/left position
+ //
+ // description:
+ // Returns an animation that will slide "node"
+ // defined in args Object from its current position to
+ // the position defined by (args.left, args.top).
+ //
+ // args: Object
+ // A hash-map of standard `dojo.Animation` constructor properties
+ // (such as easing: node: duration: and so on). Special args members
+ // are `top` and `left`, which indicate the new position to slide to.
+ //
+ // example:
+ // | dojo.fx.slideTo({ node: node, left:"40", top:"50", units:"px" }).play()
+
+ var node = args.node = d.byId(args.node),
+ top = null, left = null;
+
+ var init = (function(n){
+ return function(){
+ var cs = d.getComputedStyle(n);
+ var pos = cs.position;
+ top = (pos == 'absolute' ? n.offsetTop : parseInt(cs.top) || 0);
+ left = (pos == 'absolute' ? n.offsetLeft : parseInt(cs.left) || 0);
+ if(pos != 'absolute' && pos != 'relative'){
+ var ret = d.position(n, true);
+ top = ret.y;
+ left = ret.x;
+ n.style.position="absolute";
+ n.style.top=top+"px";
+ n.style.left=left+"px";
+ }
+ };
+ })(node);
+ init();
+
+ var anim = d.animateProperty(d.mixin({
+ properties: {
+ top: args.top || 0,
+ left: args.left || 0
+ }
+ }, args));
+ d.connect(anim, "beforeBegin", anim, init);
+
+ return anim; // dojo.Animation
+ };
+
+})();
+
+}
+
+if(!dojo._hasResource["dojox.fx.flip"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.fx.flip"] = true;
+dojo.provide("dojox.fx.flip");
+
+
+
+
+ dojo.experimental("dojox.fx.flip");
+ // because ShrinkSafe will eat this up:
+ var borderConst = "border",
+ widthConst = "Width",
+ heightConst = "Height",
+ topConst = "Top",
+ rightConst = "Right",
+ leftConst = "Left",
+ bottomConst = "Bottom"
+ ;
+
+ dojox.fx.flip = function(/*Object*/ args){
+ // summary: Animate a node flipping following a specific direction
+ //
+ // description:
+ // Returns an animation that will flip the
+ // node around a central axis:
+ // if args.dir is "left" or "right" --> y axis
+ // if args.dir is "top" or "bottom" --> x axis
+ //
+ // This effect is obtained using a border distorsion applied to a helper node.
+ //
+ // The user can specify three background colors for the helper node:
+ // darkColor: the darkest color reached during the animation
+ // lightColor: the brightest color
+ // endColor: the final backgroundColor for the node
+ //
+ // depth: Float
+ // 0 <= depth <= 1 overrides the computed "depth"
+ // (0: min distorsion, 1: max distorsion)
+ //
+ // whichAnim: String
+ // "first" : the first half animation
+ // "last" : the second one
+ // "both" (default) : both
+ //
+ // axis: String
+ // "center" (default) : the node is flipped around his center
+ // "shortside" : the node is flipped around his "short" (in perspective) side
+ // "longside" : the node is flipped around his "long" (in perspective) side
+ // "cube" : the node flips around the central axis of the cube
+ //
+ // shift: Integer
+ // node translation, perpendicular to the rotation axis
+ //
+ // example:
+ // | var anim = dojox.fx.flip({
+ // | node: dojo.byId("nodeId"),
+ // | dir: "top",
+ // | darkColor: "#555555",
+ // | lightColor: "#dddddd",
+ // | endColor: "#666666",
+ // | depth: .5,
+ // | shift: 50,
+ // | duration:300
+ // | });
+
+ var helperNode = dojo.create("div"),
+ node = args.node = dojo.byId(args.node),
+ s = node.style,
+ dims = null,
+ hs = null,
+ pn = null,
+ lightColor = args.lightColor || "#dddddd",
+ darkColor = args.darkColor || "#555555",
+ bgColor = dojo.style(node, "backgroundColor"),
+ endColor = args.endColor || bgColor,
+ staticProps = {},
+ anims = [],
+ duration = args.duration ? args.duration / 2 : 250,
+ dir = args.dir || "left",
+ pConst = .9,
+ transparentColor = "transparent",
+ whichAnim = args.whichAnim,
+ axis = args.axis || "center",
+ depth = args.depth
+ ;
+ // IE6 workaround: IE6 doesn't support transparent borders
+ var convertColor = function(color){
+ return ((new dojo.Color(color)).toHex() === "#000000") ? "#000001" : color;
+ };
+
+ if(dojo.isIE < 7){
+ endColor = convertColor(endColor);
+ lightColor = convertColor(lightColor);
+ darkColor = convertColor(darkColor);
+ bgColor = convertColor(bgColor);
+ transparentColor = "black";
+ helperNode.style.filter = "chroma(color='#000000')";
+ }
+
+ var init = (function(n){
+ return function(){
+ var ret = dojo.coords(n, true);
+ dims = {
+ top: ret.y,
+ left: ret.x,
+ width: ret.w,
+ height: ret.h
+ };
+ }
+ })(node);
+ init();
+ // helperNode initialization
+ hs = {
+ position: "absolute",
+ top: dims["top"] + "px",
+ left: dims["left"] + "px",
+ height: "0",
+ width: "0",
+ zIndex: args.zIndex || (s.zIndex || 0),
+ border: "0 solid " + transparentColor,
+ fontSize: "0",
+ visibility: "hidden"
+ };
+ var props = [ {},
+ {
+ top: dims["top"],
+ left: dims["left"]
+ }
+ ];
+ var dynProperties = {
+ left: [leftConst, rightConst, topConst, bottomConst, widthConst, heightConst, "end" + heightConst + "Min", leftConst, "end" + heightConst + "Max"],
+ right: [rightConst, leftConst, topConst, bottomConst, widthConst, heightConst, "end" + heightConst + "Min", leftConst, "end" + heightConst + "Max"],
+ top: [topConst, bottomConst, leftConst, rightConst, heightConst, widthConst, "end" + widthConst + "Min", topConst, "end" + widthConst + "Max"],
+ bottom: [bottomConst, topConst, leftConst, rightConst, heightConst, widthConst, "end" + widthConst + "Min", topConst, "end" + widthConst + "Max"]
+ };
+ // property names
+ pn = dynProperties[dir];
+
+ // .4 <= pConst <= .9
+ if(typeof depth != "undefined"){
+ depth = Math.max(0, Math.min(1, depth)) / 2;
+ pConst = .4 + (.5 - depth);
+ }else{
+ pConst = Math.min(.9, Math.max(.4, dims[pn[5].toLowerCase()] / dims[pn[4].toLowerCase()]));
+ }
+ var p0 = props[0];
+ for(var i = 4; i < 6; i++){
+ if(axis == "center" || axis == "cube"){ // find a better name for "cube"
+ dims["end" + pn[i] + "Min"] = dims[pn[i].toLowerCase()] * pConst;
+ dims["end" + pn[i] + "Max"] = dims[pn[i].toLowerCase()] / pConst;
+ }else if(axis == "shortside"){
+ dims["end" + pn[i] + "Min"] = dims[pn[i].toLowerCase()];
+ dims["end" + pn[i] + "Max"] = dims[pn[i].toLowerCase()] / pConst;
+ }else if(axis == "longside"){
+ dims["end" + pn[i] + "Min"] = dims[pn[i].toLowerCase()] * pConst;
+ dims["end" + pn[i] + "Max"] = dims[pn[i].toLowerCase()];
+ }
+ }
+ if(axis == "center"){
+ p0[pn[2].toLowerCase()] = dims[pn[2].toLowerCase()] - (dims[pn[8]] - dims[pn[6]]) / 4;
+ }else if(axis == "shortside"){
+ p0[pn[2].toLowerCase()] = dims[pn[2].toLowerCase()] - (dims[pn[8]] - dims[pn[6]]) / 2;
+ }
+
+ staticProps[pn[5].toLowerCase()] = dims[pn[5].toLowerCase()] + "px";
+ staticProps[pn[4].toLowerCase()] = "0";
+ staticProps[borderConst + pn[1] + widthConst] = dims[pn[4].toLowerCase()] + "px";
+ staticProps[borderConst + pn[1] + "Color"] = bgColor;
+
+ p0[borderConst + pn[1] + widthConst] = 0;
+ p0[borderConst + pn[1] + "Color"] = darkColor;
+ p0[borderConst + pn[2] + widthConst] = p0[borderConst + pn[3] + widthConst] = axis != "cube"
+ ? (dims["end" + pn[5] + "Max"] - dims["end" + pn[5] + "Min"]) / 2
+ : dims[pn[6]] / 2
+ ;
+ p0[pn[7].toLowerCase()] = dims[pn[7].toLowerCase()] + dims[pn[4].toLowerCase()] / 2 + (args.shift || 0);
+ p0[pn[5].toLowerCase()] = dims[pn[6]];
+
+ var p1 = props[1];
+ p1[borderConst + pn[0] + "Color"] = { start: lightColor, end: endColor };
+ p1[borderConst + pn[0] + widthConst] = dims[pn[4].toLowerCase()];
+ p1[borderConst + pn[2] + widthConst] = 0;
+ p1[borderConst + pn[3] + widthConst] = 0;
+ p1[pn[5].toLowerCase()] = { start: dims[pn[6]], end: dims[pn[5].toLowerCase()] };
+
+ dojo.mixin(hs, staticProps);
+ dojo.style(helperNode, hs);
+ dojo.body().appendChild(helperNode);
+
+ var finalize = function(){
+// helperNode.parentNode.removeChild(helperNode);
+ dojo.destroy(helperNode);
+ // fixes a flicker when the animation ends
+ s.backgroundColor = endColor;
+ s.visibility = "visible";
+ };
+ if(whichAnim == "last"){
+ for(i in p0){
+ p0[i] = { start: p0[i] };
+ }
+ p0[borderConst + pn[1] + "Color"] = { start: darkColor, end: endColor };
+ p1 = p0;
+ }
+ if(!whichAnim || whichAnim == "first"){
+ anims.push(dojo.animateProperty({
+ node: helperNode,
+ duration: duration,
+ properties: p0
+ }));
+ }
+ if(!whichAnim || whichAnim == "last"){
+ anims.push(dojo.animateProperty({
+ node: helperNode,
+ duration: duration,
+ properties: p1,
+ onEnd: finalize
+ }));
+ }
+
+ // hide the original node
+ dojo.connect(anims[0], "play", function(){
+ helperNode.style.visibility = "visible";
+ s.visibility = "hidden";
+ });
+
+ return dojo.fx.chain(anims); // dojo.Animation
+
+ }
+
+ dojox.fx.flipCube = function(/*Object*/ args){
+ // summary: An extension to `dojox.fx.flip` providing a more 3d-like rotation
+ //
+ // description:
+ // An extension to `dojox.fx.flip` providing a more 3d-like rotation.
+ // Behaves the same as `dojox.fx.flip`, using the same attributes and
+ // other standard `dojo.Animation` properties.
+ //
+ // example:
+ // See `dojox.fx.flip`
+ var anims = [],
+ mb = dojo.marginBox(args.node),
+ shiftX = mb.w / 2,
+ shiftY = mb.h / 2,
+ dims = {
+ top: {
+ pName: "height",
+ args:[
+ {
+ whichAnim: "first",
+ dir: "top",
+ shift: -shiftY
+ },
+ {
+ whichAnim: "last",
+ dir: "bottom",
+ shift: shiftY
+ }
+ ]
+ },
+ right: {
+ pName: "width",
+ args:[
+ {
+ whichAnim: "first",
+ dir: "right",
+ shift: shiftX
+ },
+ {
+ whichAnim: "last",
+ dir: "left",
+ shift: -shiftX
+ }
+ ]
+ },
+ bottom: {
+ pName: "height",
+ args:[
+ {
+ whichAnim: "first",
+ dir: "bottom",
+ shift: shiftY
+ },
+ {
+ whichAnim: "last",
+ dir: "top",
+ shift: -shiftY
+ }
+ ]
+ },
+ left: {
+ pName: "width",
+ args:[
+ {
+ whichAnim: "first",
+ dir: "left",
+ shift: -shiftX
+ },
+ {
+ whichAnim: "last",
+ dir: "right",
+ shift: shiftX
+ }
+ ]
+ }
+ }
+ ;
+ var d = dims[args.dir || "left"],
+ p = d.args
+ ;
+ args.duration = args.duration ? args.duration * 2 : 500;
+ args.depth = .8;
+ args.axis = "cube";
+ for(var i = p.length - 1; i >= 0; i--){
+ dojo.mixin(args, p[i]);
+ anims.push(dojox.fx.flip(args));
+ }
+ return dojo.fx.combine(anims);
+ };
+
+ dojox.fx.flipPage = function(/*Object*/ args){
+ // summary: An extension to `dojox.fx.flip` providing a page flip like animation.
+ //
+ // description:
+ // An extension to `dojox.fx.flip` providing a page flip effect.
+ // Behaves the same as `dojox.fx.flip`, using the same attributes and
+ // other standard `dojo.Animation` properties.
+ //
+ // example:
+ // See `dojox.fx.flip`
+ var n = args.node,
+ coords = dojo.coords(n, true),
+ x = coords.x,
+ y = coords.y,
+ w = coords.w,
+ h = coords.h,
+ bgColor = dojo.style(n, "backgroundColor"),
+ lightColor = args.lightColor || "#dddddd",
+ darkColor = args.darkColor,
+ helperNode = dojo.create("div"),
+ anims = [],
+ hn = [],
+ dir = args.dir || "right",
+ pn = {
+ left: ["left", "right", "x", "w"],
+ top: ["top", "bottom", "y", "h"],
+ right: ["left", "left", "x", "w"],
+ bottom: ["top", "top", "y", "h"]
+ },
+ shiftMultiplier = {
+ right: [1, -1],
+ left: [-1, 1],
+ top: [-1, 1],
+ bottom: [1, -1]
+ }
+ ;
+ dojo.style(helperNode, {
+ position: "absolute",
+ width : w + "px",
+ height : h + "px",
+ top : y + "px",
+ left : x + "px",
+ visibility: "hidden"
+ });
+ var hs = [];
+ for(var i = 0; i < 2; i++){
+ var r = i % 2,
+ d = r ? pn[dir][1] : dir,
+ wa = r ? "last" : "first",
+ endColor = r ? bgColor : lightColor,
+ startColor = r ? endColor : args.startColor || n.style.backgroundColor
+ ;
+ hn[i] = dojo.clone(helperNode);
+ var finalize = function(x){
+ return function(){
+ dojo.destroy(hn[x]);
+ }
+ }(i)
+ ;
+ dojo.body().appendChild(hn[i]);
+ hs[i] = {
+ backgroundColor: r ? startColor : bgColor
+ };
+
+ hs[i][pn[dir][0]] = coords[pn[dir][2]] + shiftMultiplier[dir][0] * i * coords[pn[dir][3]] + "px";
+ dojo.style(hn[i], hs[i]);
+ anims.push(dojox.fx.flip({
+ node: hn[i],
+ dir: d,
+ axis: "shortside",
+ depth: args.depth,
+ duration: args.duration / 2,
+ shift: shiftMultiplier[dir][i] * coords[pn[dir][3]] / 2,
+ darkColor: darkColor,
+ lightColor: lightColor,
+ whichAnim: wa,
+ endColor: endColor
+ }));
+ dojo.connect(anims[i], "onEnd", finalize);
+ }
+ return dojo.fx.chain(anims);
+ };
+
+
+ dojox.fx.flipGrid = function(/*Object*/ args){
+ // summary: An extension to `dojox.fx.flip` providing a decomposition in rows * cols flipping elements
+ //
+ // description:
+ // An extension to `dojox.fx.flip` providing a page flip effect.
+ // Behaves the same as `dojox.fx.flip`, using the same attributes and
+ // other standard `dojo.Animation` properties and
+ //
+ // cols: Integer columns
+ // rows: Integer rows
+ //
+ // duration: the single flip duration
+ //
+ // example:
+ // See `dojox.fx.flip`
+ var rows = args.rows || 4,
+ cols = args.cols || 4,
+ anims = [],
+ helperNode = dojo.create("div"),
+ n = args.node,
+ coords = dojo.coords(n, true),
+ x = coords.x,
+ y = coords.y,
+ nw = coords.w,
+ nh = coords.h,
+ w = coords.w / cols,
+ h = coords.h / rows,
+ cAnims = []
+ ;
+ dojo.style(helperNode, {
+ position: "absolute",
+ width: w + "px",
+ height: h + "px",
+ backgroundColor: dojo.style(n, "backgroundColor")
+ });
+ for(var i = 0; i < rows; i++){
+ var r = i % 2,
+ d = r ? "right" : "left",
+ signum = r ? 1 : -1
+ ;
+ // cloning
+ var cn = dojo.clone(n);
+ dojo.style(cn, {
+ position: "absolute",
+ width: nw + "px",
+ height: nh + "px",
+ top: y + "px",
+ left: x + "px",
+ clip: "rect(" + i * h + "px," + nw + "px," + nh + "px,0)"
+ });
+ dojo.body().appendChild(cn);
+ anims[i] = [];
+ for(var j = 0; j < cols; j++){
+ var hn = dojo.clone(helperNode),
+ l = r ? j : cols - (j + 1)
+ ;
+ var adjustClip = function(xn, yCounter, xCounter){
+ return function(){
+ if(!(yCounter % 2)){
+ dojo.style(xn, {
+ clip: "rect(" + yCounter * h + "px," + (nw - (xCounter + 1) * w ) + "px," + ((yCounter + 1) * h) + "px,0px)"
+ });
+ }else{
+ dojo.style(xn, {
+ clip: "rect(" + yCounter * h + "px," + nw + "px," + ((yCounter + 1) * h) + "px," + ((xCounter + 1) * w) + "px)"
+ });
+ }
+ }
+ }(cn, i, j);
+ dojo.body().appendChild(hn);
+ dojo.style(hn, {
+ left: x + l * w + "px",
+ top: y + i * h + "px",
+ visibility: "hidden"
+ });
+ var a = dojox.fx.flipPage({
+ node: hn,
+ dir: d,
+ duration: args.duration || 900,
+ shift: signum * w/2,
+ depth: .2,
+ darkColor: args.darkColor,
+ lightColor: args.lightColor,
+ startColor: args.startColor || args.node.style.backgroundColor
+ }),
+ removeHelper = function(xn){
+ return function(){
+ dojo.destroy(xn);
+ }
+ }(hn)
+ ;
+ dojo.connect(a, "play", this, adjustClip);
+ dojo.connect(a, "play", this, removeHelper);
+ anims[i].push(a);
+ }
+ cAnims.push(dojo.fx.chain(anims[i]));
+
+ }
+ dojo.connect(cAnims[0], "play", function(){
+ dojo.style(n, {visibility: "hidden"});
+ });
+ return dojo.fx.combine(cAnims);
+ };
+
+}
+
+if(!dojo._hasResource["dojox.mobile.compat"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.compat"] = true;
+dojo.provide("dojox.mobile.compat");
+
+
+
+
+
+// summary:
+// CSS3 compatibility module
+// description:
+// This module provides support for some of the CSS3 features to dojox.mobile
+// for non-CSS3 browsers, such as IE or Firefox.
+// If you load this module, it directly replaces some of the methods of
+// dojox.mobile instead of subclassing. This way, html pages remains the same
+// regardless of whether this compatibility module is used or not.
+// Recommended usage is as follows. the code below loads dojox.mobile.compat
+// only when isWebKit is true.
+//
+// dojo.require("dojox.mobile");
+//
+//
+// This module also loads compatibility CSS files, which has -compat.css
+// suffix. You can use either the <link> tag or @import to load theme
+// CSS files. Then, this module searches for the loaded CSS files and loads
+// compatibility CSS files. For example, if you load iphone.css in a page,
+// this module automatically loads iphone-compat.css.
+// If you explicitly load iphone-compat.css with <link> or @import,
+// this module will not load the already loaded file.
+
+if(!dojo.isWebKit){
+
+dojo.extend(dojox.mobile.View, {
+ _doTransition: function(fromNode, toNode, transition, dir){
+ var anim;
+ this.wakeUp(toNode);
+ if(!transition || transition == "none"){
+ toNode.style.display = "";
+ fromNode.style.display = "none";
+ toNode.style.left = "0px";
+ this.invokeCallback();
+ }else if(transition == "slide"){
+ var w = fromNode.offsetWidth;
+ var s1 = dojo.fx.slideTo({
+ node: fromNode,
+ duration: 400,
+ left: -w*dir,
+ top: fromNode.offsetTop
+ });
+ var s2 = dojo.fx.slideTo({
+ node: toNode,
+ duration: 400,
+ left: 0
+ });
+ toNode.style.position = "absolute";
+ toNode.style.left = w*dir + "px";
+ toNode.style.display = "";
+ anim = dojo.fx.combine([s1,s2]);
+ dojo.connect(anim, "onEnd", this, function(){
+ fromNode.style.display = "none";
+ toNode.style.position = "relative";
+ this.invokeCallback();
+ });
+ anim.play();
+ }else if(transition == "flip"){
+ anim = dojox.fx.flip({
+ node: fromNode,
+ dir: "right",
+ depth: 0.5,
+ duration: 400
+ });
+ toNode.style.position = "absolute";
+ toNode.style.left = "0px";
+ dojo.connect(anim, "onEnd", this, function(){
+ fromNode.style.display = "none";
+ toNode.style.position = "relative";
+ toNode.style.display = "";
+ this.invokeCallback();
+ });
+ anim.play();
+ }else if(transition == "fade"){
+ anim = dojo.fx.chain([
+ dojo.fadeOut({
+ node: fromNode,
+ duration: 600
+ }),
+ dojo.fadeIn({
+ node: toNode,
+ duration: 600
+ })
+ ]);
+ toNode.style.position = "absolute";
+ toNode.style.left = "0px";
+ toNode.style.display = "";
+ dojo.style(toNode, "opacity", 0);
+ dojo.connect(anim, "onEnd", this, function(){
+ fromNode.style.display = "none";
+ toNode.style.position = "relative";
+ dojo.style(fromNode, "opacity", 1);
+ this.invokeCallback();
+ });
+ anim.play();
+ }
+ },
+
+ wakeUp: function(node){
+ // summary:
+ // Function to force IE to redraw a node since its layout code tends to misrender
+ // in partial draws.
+ // node:
+ // The node to forcibly redraw.
+ // tags:
+ // public
+ if(dojo.isIE && !node._wokeup){
+ node._wokeup = true;
+ var disp = node.style.display;
+ node.style.display = "";
+ var nodes = node.getElementsByTagName("*");
+ for(var i = 0, len = nodes.length; i < len; i++){
+ var val = nodes[i].style.display;
+ nodes[i].style.display = "none";
+ nodes[i].style.display = "";
+ nodes[i].style.display = val;
+ }
+ node.style.display = disp;
+ }
+ }
+});
+
+dojo.extend(dojox.mobile.Switch, {
+ buildRendering: function(){
+ // summary:
+ // Function to simulate the mobile device style switches on
+ // browsers such as IE and FireFox.
+ // tags:
+ // protected
+ this.domNode = this.srcNodeRef || dojo.doc.createElement("DIV");
+ this.domNode.className = "mblSwitch";
+ this.domNode.innerHTML =
+ '<div class="mblSwitchInner">'
+ + '<div class="mblSwitchBg mblSwitchBgLeft">'
+ + '<div class="mblSwitchCorner mblSwitchCorner1T"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner2T"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner3T"></div>'
+ + '<div class="mblSwitchText mblSwitchTextLeft">'+this.leftLabel+'</div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner1B"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner2B"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner3B"></div>'
+ + '</div>'
+ + '<div class="mblSwitchBg mblSwitchBgRight">'
+ + '<div class="mblSwitchCorner mblSwitchCorner1T"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner2T"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner3T"></div>'
+ + '<div class="mblSwitchText mblSwitchTextRight">'+this.rightLabel+'</div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner1B"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner2B"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner3B"></div>'
+ + '</div>'
+ + '<div class="mblSwitchKnobContainer">'
+ + '<div class="mblSwitchCorner mblSwitchCorner1T"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner2T"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner3T"></div>'
+ + '<div class="mblSwitchKnob"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner1B"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner2B"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner3B"></div>'
+ + '</div>'
+ + '</div>';
+ var n = this.inner = this.domNode.firstChild;
+ this.left = n.childNodes[0];
+ this.right = n.childNodes[1];
+ this.knob = n.childNodes[2];
+
+ dojo.addClass(this.domNode, (this.value == "on") ? "mblSwitchOn" : "mblSwitchOff");
+ this[this.value == "off" ? "left" : "right"].style.display = "none";
+ },
+
+ _changeState: function(/*String*/state){
+ // summary:
+ // Function to toggle the switch state on the switch
+ // state:
+ // Thhe state to toggle, switch 'on' or 'off'
+ // tags:
+ // private
+ if(!this.inner.parentNode || !this.inner.parentNode.tagName){
+ dojo.addClass(this.domNode, (state == "on") ? "mblSwitchOn" : "mblSwitchOff");
+ return;
+ }
+ var pos;
+ if(this.inner.offsetLeft == 0){ // currently ON
+ if(state == "on"){ return; }
+ pos = -53;
+ }else{ // currently OFF
+ if(state == "off"){ return; }
+ pos = 0;
+ }
+
+ var a = dojo.fx.slideTo({
+ node: this.inner,
+ duration: 500,
+ left: pos
+ });
+ var _this = this;
+ dojo.connect(a, "onEnd", function(){
+ _this[state == "off" ? "left" : "right"].style.display = "none";
+ });
+ a.play();
+ }
+});
+
+if(dojo.isIE || dojo.isBB){
+
+dojo.extend(dojox.mobile.RoundRect, {
+ buildRendering: function(){
+ // summary:
+ // Function to simulate the borderRadius appearance on IE, since
+ // IE does not support this CSS style.
+ // tags:
+ // protected
+ dojox.mobile.createRoundRect(this);
+ this.domNode.className = "mblRoundRect";
+ }
+});
+
+dojox.mobile.RoundRectList._addChild = dojox.mobile.RoundRectList.prototype.addChild;
+dojo.extend(dojox.mobile.RoundRectList, {
+ buildRendering: function(){
+ // summary:
+ // Function to simulate the borderRadius appearance on IE, since
+ // IE does not support this CSS style.
+ // tags:
+ // protected
+ dojox.mobile.createRoundRect(this, true);
+ this.domNode.className = "mblRoundRectList";
+ },
+
+ postCreate: function(){
+ this.redrawBorders();
+ },
+
+ addChild: function(widget){
+ dojox.mobile.RoundRectList._addChild.apply(this, arguments);
+ this.redrawBorders();
+ if(dojox.mobile.applyPngFilter){
+ dojox.mobile.applyPngFilter(widget.domNode);
+ }
+ },
+
+ redrawBorders: function(){
+ // summary:
+ // Function to adjust the creation of RoundRectLists on IE.
+ // Removed undesired styles.
+ // tags:
+ // public
+
+ // Remove a border of the last ListItem.
+ // This is for browsers that do not support the last-child CSS pseudo-class.
+
+ var lastChildFound = false;
+ for(var i = this.containerNode.childNodes.length - 1; i >= 0; i--){
+ var c = this.containerNode.childNodes[i];
+ if(c.tagName == "LI"){
+ c.style.borderBottomStyle = lastChildFound ? "solid" : "none";
+ lastChildFound = true;
+ }
+ }
+ }
+});
+
+dojo.extend(dojox.mobile.EdgeToEdgeList, {
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("UL");
+ this.domNode.className = "mblEdgeToEdgeList";
+ }
+});
+
+if(dojox.mobile.IconContainer){
+
+dojox.mobile.IconContainer._addChild = dojox.mobile.IconContainer.prototype.addChild;
+dojo.extend(dojox.mobile.IconContainer, {
+ addChild: function(widget){
+ dojox.mobile.IconContainer._addChild.apply(this, arguments);
+ if(dojox.mobile.applyPngFilter){
+ dojox.mobile.applyPngFilter(widget.domNode);
+ }
+ }
+});
+
+} // if(dojox.mobile.IconContainer)
+
+dojo.mixin(dojox.mobile, {
+ createRoundRect: function(_this, isList){
+ // summary:
+ // Function to adjust the creation of rounded rectangles on IE.
+ // Deals with IE's lack of borderRadius support
+ // tags:
+ // public
+ var i;
+ _this.domNode = dojo.doc.createElement("DIV");
+ _this.domNode.style.padding = "0px";
+ _this.domNode.style.backgroundColor = "transparent";
+ _this.domNode.style.borderStyle = "none";
+ _this.containerNode = dojo.doc.createElement(isList?"UL":"DIV");
+ _this.containerNode.className = "mblRoundRectContainer";
+ if(_this.srcNodeRef){
+ _this.srcNodeRef.parentNode.replaceChild(_this.domNode, _this.srcNodeRef);
+ for(i = 0, len = _this.srcNodeRef.childNodes.length; i < len; i++){
+ _this.containerNode.appendChild(_this.srcNodeRef.removeChild(_this.srcNodeRef.firstChild));
+ }
+ _this.srcNodeRef = null;
+ }
+ _this.domNode.appendChild(_this.containerNode);
+
+ for(i = 0; i <= 5; i++){
+ var top = dojo.create("DIV");
+ top.className = "mblRoundCorner mblRoundCorner"+i+"T";
+ _this.domNode.insertBefore(top, _this.containerNode);
+
+ var bottom = dojo.create("DIV");
+ bottom.className = "mblRoundCorner mblRoundCorner"+i+"B";
+ _this.domNode.appendChild(bottom);
+ }
+ }
+});
+
+if(dojox.mobile.ScrollableView){
+
+dojo.extend(dojox.mobile.ScrollableView, {
+ postCreate: function(){
+ // On IE, margin-top of the first child does not seem to be effective,
+ // probably because padding-top is specified for containerNode
+ // to make room for a fixed header. This dummy node is a workaround for that.
+ var dummy = dojo.create("DIV", {className:"mblDummyForIE", innerHTML:"&nbsp;"}, this.containerNode, "first");
+ dojo.style(dummy, {
+ position: "relative",
+ marginBottom: "-2px",
+ fontSize: "1px"
+ });
+ }
+});
+
+} // if(dojox.mobile.ScrollableView)
+
+} // if(dojo.isIE)
+
+if(dojo.isIE <= 6){
+ dojox.mobile.applyPngFilter = function(root){
+ root = root || dojo.body();
+ var nodes = root.getElementsByTagName("IMG");
+ var blank = dojo.moduleUrl("dojo", "resources/blank.gif");
+ for(var i = 0, len = nodes.length; i < len; i++){
+ var img = nodes[i];
+ var w = img.offsetWidth;
+ var h = img.offsetHeight;
+ if(w === 0 || h === 0){
+ // The reason why the image has no width/height may be because
+ // display is "none". If that is the case, let's change the
+ // display to "" temporarily and see if the image returns them.
+ if(dojo.style(img, "display") != "none"){ continue; }
+ img.style.display = "";
+ w = img.offsetWidth;
+ h = img.offsetHeight;
+ img.style.display = "none";
+ if(w === 0 || h === 0){ continue; }
+ }
+ var src = img.src;
+ if(src.indexOf("resources/blank.gif") != -1){ continue; }
+ img.src = blank;
+ img.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src+"')";
+ img.style.width = w + "px";
+ img.style.height = h + "px";
+ }
+ };
+} // if(dojo.isIE <= 6)
+
+dojox.mobile.loadCss = function(/*String|Array*/files){
+ // summary:
+ // Function to load and register CSS files with the page
+ // files: String|Array
+ // The CSS files to load and register with the page.
+ // tags:
+ // private
+ if(!dojo.global._loadedCss){
+ var obj = {};
+ dojo.forEach(dojox.mobile.getCssPaths(), function(path){
+ obj[path] = true;
+ });
+ dojo.global._loadedCss = obj;
+ }
+ if(!dojo.isArray(files)){ files = [files]; }
+ for(var i = 0; i < files.length; i++){
+ var file = files[i];
+ if(!dojo.global._loadedCss[file]){
+ dojo.global._loadedCss[file] = true;
+ if(dojo.doc.createStyleSheet){
+ // for some reason, IE hangs when you try to load
+ // multiple css files almost at once.
+ setTimeout(function(file){
+ return function(){
+ dojo.doc.createStyleSheet(file);
+ };
+ }(file), 0);
+ }else{
+ var link = dojo.doc.createElement("link");
+ link.href = file;
+ link.type = "text/css";
+ link.rel = "stylesheet";
+ var head = dojo.doc.getElementsByTagName('head')[0];
+ head.appendChild(link);
+ }
+ }
+ }
+};
+
+dojox.mobile.getCssPaths = function(){
+ var paths = [];
+ var i, j;
+
+ // find @import
+ var s = dojo.doc.styleSheets;
+ for(i = 0; i < s.length; i++){
+ var r = s[i].cssRules || s[i].imports;
+ if(!r){ continue; }
+ for(j = 0; j < r.length; j++){
+ if(r[j].href){
+ paths.push(r[j].href);
+ }
+ }
+ }
+
+ // find <link>
+ var elems = dojo.doc.getElementsByTagName("link");
+ for(i = 0, len = elems.length; i < len; i++){
+ if(elems[i].href){
+ paths.push(elems[i].href);
+ }
+ }
+ return paths;
+};
+
+dojox.mobile.loadCompatPattern = /\/themes\/(domButtons|buttons|iphone|android).*\.css$/;
+
+dojox.mobile.loadCompatCssFiles = function(){
+ // summary:
+ // Function to perform page-level adjustments on browsers such as
+ // IE and firefox. It loads compat specific css files into the
+ // page header.
+ var paths = dojox.mobile.getCssPaths();
+ for(var i = 0; i < paths.length; i++){
+ var href = paths[i];
+ if(href.match(dojox.mobile.loadCompatPattern) && href.indexOf("-compat.css") == -1){
+ var compatCss = href.substring(0, href.length-4)+"-compat.css";
+ dojox.mobile.loadCss(compatCss);
+ }
+ }
+};
+
+dojox.mobile.hideAddressBar = function(){
+ // nop
+};
+
+dojo.addOnLoad(function(){
+ if(dojo.config["mblLoadCompatCssFiles"] !== false){
+ dojox.mobile.loadCompatCssFiles();
+ }
+ if(dojox.mobile.applyPngFilter){
+ dojox.mobile.applyPngFilter();
+ }
+});
+
+} // end of if(!dojo.isWebKit){
+
+}
+
+if(!dojo._hasResource["dojox.mobile.app.compat"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.app.compat"] = true;
+dojo.provide("dojox.mobile.app.compat");
+
+
+// summary:
+// CSS3 compatibility module for apps
+// description:
+// This module provides support for some of the CSS3 features to djMobile
+// for non-CSS3 browsers, such as IE or Firefox.
+// If you load this module, it directly replaces some of the methods of
+// djMobile instead of subclassing. This way, html pages remains the same
+// regardless of whether this compatibility module is used or not.
+// Recommended usage is as follows. the code below loads dojox.mobile.compat
+// only when isWebKit is true.
+//
+// dojo.require("dojox.mobile");
+// dojo.requireIf(!dojo.isWebKit, "dojox.mobile.appCompat");
+
+dojo.extend(dojox.mobile.app.AlertDialog, {
+ _doTransition: function(dir){
+ console.log("in _doTransition and this = ", this);
+
+ var h = dojo.marginBox(this.domNode.firstChild).h;
+
+ var bodyHeight = this.controller.getWindowSize().h;
+
+ var high = bodyHeight - h;
+ var low = bodyHeight;
+
+ var anim1 = dojo.fx.slideTo({
+ node: this.domNode,
+ duration: 400,
+ top: {start: dir < 0 ? high : low, end: dir < 0 ? low: high}
+ });
+
+ var anim2 = dojo[dir < 0 ? "fadeOut" : "fadeIn"]({
+ node: this.mask,
+ duration: 400
+ });
+
+ var anim = dojo.fx.combine([anim1, anim2]);
+
+ var _this = this;
+
+ dojo.connect(anim, "onEnd", this, function(){
+ if(dir < 0){
+ _this.domNode.style.display = "none";
+ dojo.destroy(_this.domNode);
+ dojo.destroy(_this.mask);
+ }
+ });
+ anim.play();
+ }
+});
+
+dojo.extend(dojox.mobile.app.List, {
+ deleteRow: function(){
+ console.log("deleteRow in compat mode", row);
+
+ var row = this._selectedRow;
+ // First make the row invisible
+ // Put it back where it came from
+ dojo.style(row, {
+ visibility: "hidden",
+ minHeight: "0px"
+ });
+ dojo.removeClass(row, "hold");
+
+
+ // Animate reducing it's height to zero, then delete the data from the
+ // array
+ var height = dojo.contentBox(row).h;
+ dojo.animateProperty({
+ node: row,
+ duration: 800,
+ properties: {
+ height: {start: height, end: 1},
+ paddingTop: {end: 0},
+ paddingBottom: {end: 0}
+ },
+ onEnd: this._postDeleteAnim
+ }).play();
+ }
+});
+
+if(dojox.mobile.app.ImageView && !dojo.create("canvas").getContext){
+ dojo.extend(dojox.mobile.app.ImageView, {
+ buildRendering: function(){
+ this.domNode.innerHTML =
+ "ImageView widget is not supported on this browser."
+ + "Please try again with a modern browser, e.g. "
+ + "Safari, Chrome or Firefox";
+ this.canvas = {};
+ },
+
+ postCreate: function(){}
+ });
+}
+
+if(dojox.mobile.app.ImageThumbView){
+ dojo.extend(dojox.mobile.app.ImageThumbView, {
+ place: function(node, x, y){
+ dojo.style(node, {
+ top: y + "px",
+ left: x + "px",
+ visibility: "visible"
+ });
+ }
+ })
+}
+
+}
+
+
+}};});
diff --git a/js/dojo-1.6/dojox/mobile/build/build.bat b/js/dojo-1.6/dojox/mobile/build/build.bat
new file mode 100644
index 0000000..bb52fe2
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/build/build.bat
@@ -0,0 +1,47 @@
+@echo off
+
+rem Build script for dojox.mobile
+rem
+rem Note:
+rem You may need to manually apply the following patch to your build script
+rem in order to completely remove all the unused modules from your build.
+rem The patch disables finding the dojo base modules being used from the
+rem dependent modules with a simple pattern matching, which sometimes
+rem unexpectedly picks up unused modules.
+rem For example, if you see query.js and NodeList.js baked into your build,
+rem while you are not using them, then it is worth trying the patch.
+rem The file to be patched is util/buildscripts/jslib/buildUtil.js.
+rem
+rem --- buildUtil.js-orig
+rem +++ buildUtil.js
+rem @@ -1506,7 +1506,7 @@
+rem var addedResources = {};
+rem - while((matches = buildUtil.baseMappingRegExp.exec(tempContents))){
+rem + while(false&&(matches = buildUtil.baseMappingRegExp.exec(tempContents))){
+rem var baseResource = buildUtil.baseMappings[matches[1]];
+rem //Make sure we do not add the dependency to its source resource.
+
+if "%1"=="separate" goto ok
+if "%1"=="single" goto ok
+echo Usage: build separate^|single [webkit]
+echo separate Create mobile.js that includes only dojox.mobile
+echo single Create a single dojo.js layer that includes dojox.mobile
+echo webkit Enable webkitMobile=true option (Loses PC browser support)
+goto end
+:ok
+
+set optimize=shrinksafe
+set profile=mobile
+set dir=release-mobile-separate
+set webkit=
+if "%1"=="single" set profile=mobile-all
+if "%1"=="single" set dir=release-mobile-single
+if "%2"=="webkit" set webkit=webkitMobile=true
+
+cd ..\..\..\util\buildscripts
+
+call build profile=%profile% action=release customDijitBase=true optimize=%optimize% layerOptimize=%optimize% cssOptimize=comments releaseDir=../../%dir%/ %webkit%
+
+cd ..\..\dojox\mobile\build
+
+:end
diff --git a/js/dojo-1.6/dojox/mobile/build/build.sh b/js/dojo-1.6/dojox/mobile/build/build.sh
new file mode 100644
index 0000000..5f9d958
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/build/build.sh
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+# Build script for dojox.mobile
+#
+# Note:
+# You may need to manually apply the following patch to your build script
+# in order to completely remove all the unused modules from your build.
+# The patch disables finding the dojo base modules being used from the
+# dependent modules with a simple pattern matching, which sometimes
+# unexpectedly picks up unused modules.
+# For example, if you see query.js and NodeList.js baked into your build,
+# while you are not using them, then it is worth trying the patch.
+# The file to be patched is util/buildscripts/jslib/buildUtil.js.
+#
+# --- buildUtil.js-orig
+# +++ buildUtil.js
+# @@ -1506,7 +1506,7 @@
+# var addedResources = {};
+# - while((matches = buildUtil.baseMappingRegExp.exec(tempContents))){
+# + while(false&&(matches = buildUtil.baseMappingRegExp.exec(tempContents))){
+# var baseResource = buildUtil.baseMappings[matches[1]];
+# //Make sure we do not add the dependency to its source resource.
+
+if [ $# -eq 0 ]; then
+ echo 'Usage: build separate|single [webkit]'
+ echo ' separate Create mobile.js that includes only dojox.mobile'
+ echo ' single Create a single dojo.js layer that includes dojox.mobile'
+ echo ' webkit Enable webkitMobile=true option (Loses PC browser support)'
+ exit 1
+fi
+
+optimize=shrinksafe
+profile=mobile
+dir=release-mobile-separate
+webkit=
+if [ "$1" == "single" ]; then
+ profile=mobile-all
+fi
+if [ "$1" == "single" ]; then
+ dir=release-mobile-single
+fi
+if [ "$2" == "webkit" ]; then
+ webkit=webkitMobile=true
+fi
+
+cd ../../../util/buildscripts
+
+./build.sh profile=$profile action=release customDijitBase=true optimize=$optimize layerOptimize=$optimize cssOptimize=comments releaseDir=../../$dir/ $webkit
+
+cd ../../dojox/mobile/build
diff --git a/js/dojo-1.6/dojox/mobile/compat.js b/js/dojo-1.6/dojox/mobile/compat.js
new file mode 100644
index 0000000..31c1564
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/compat.js
@@ -0,0 +1,14 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+/*
+ This is an optimized version of Dojo, built for deployment and not for
+ development. To get sources and documentation, please visit:
+
+ http://dojotoolkit.org
+*/
+
+if(!dojo._hasResource["dojo.uacss"]){dojo._hasResource["dojo.uacss"]=true;dojo.provide("dojo.uacss");(function(){var d=dojo,_1=d.doc.documentElement,ie=d.isIE,_2=d.isOpera,_3=Math.floor,ff=d.isFF,_4=d.boxModel.replace(/-/,""),_5={dj_ie:ie,dj_ie6:_3(ie)==6,dj_ie7:_3(ie)==7,dj_ie8:_3(ie)==8,dj_ie9:_3(ie)==9,dj_quirks:d.isQuirks,dj_iequirks:ie&&d.isQuirks,dj_opera:_2,dj_khtml:d.isKhtml,dj_webkit:d.isWebKit,dj_safari:d.isSafari,dj_chrome:d.isChrome,dj_gecko:d.isMozilla,dj_ff3:_3(ff)==3};_5["dj_"+_4]=true;var _6="";for(var _7 in _5){if(_5[_7]){_6+=_7+" ";}}_1.className=d.trim(_1.className+" "+_6);dojo._loaders.unshift(function(){if(!dojo._isBodyLtr()){var _8="dj_rtl dijitRtl "+_6.replace(/ /g,"-rtl ");_1.className=d.trim(_1.className+" "+_8);}});})();}if(!dojo._hasResource["dijit._base.sniff"]){dojo._hasResource["dijit._base.sniff"]=true;dojo.provide("dijit._base.sniff");}if(!dojo._hasResource["dojo.fx.Toggler"]){dojo._hasResource["dojo.fx.Toggler"]=true;dojo.provide("dojo.fx.Toggler");dojo.declare("dojo.fx.Toggler",null,{node:null,showFunc:dojo.fadeIn,hideFunc:dojo.fadeOut,showDuration:200,hideDuration:200,constructor:function(_9){var _a=this;dojo.mixin(_a,_9);_a.node=_9.node;_a._showArgs=dojo.mixin({},_9);_a._showArgs.node=_a.node;_a._showArgs.duration=_a.showDuration;_a.showAnim=_a.showFunc(_a._showArgs);_a._hideArgs=dojo.mixin({},_9);_a._hideArgs.node=_a.node;_a._hideArgs.duration=_a.hideDuration;_a.hideAnim=_a.hideFunc(_a._hideArgs);dojo.connect(_a.showAnim,"beforeBegin",dojo.hitch(_a.hideAnim,"stop",true));dojo.connect(_a.hideAnim,"beforeBegin",dojo.hitch(_a.showAnim,"stop",true));},show:function(_b){return this.showAnim.play(_b||0);},hide:function(_c){return this.hideAnim.play(_c||0);}});}if(!dojo._hasResource["dojo.fx"]){dojo._hasResource["dojo.fx"]=true;dojo.provide("dojo.fx");(function(){var d=dojo,_d={_fire:function(_e,_f){if(this[_e]){this[_e].apply(this,_f||[]);}return this;}};var _10=function(_11){this._index=-1;this._animations=_11||[];this._current=this._onAnimateCtx=this._onEndCtx=null;this.duration=0;d.forEach(this._animations,function(a){this.duration+=a.duration;if(a.delay){this.duration+=a.delay;}},this);};d.extend(_10,{_onAnimate:function(){this._fire("onAnimate",arguments);},_onEnd:function(){d.disconnect(this._onAnimateCtx);d.disconnect(this._onEndCtx);this._onAnimateCtx=this._onEndCtx=null;if(this._index+1==this._animations.length){this._fire("onEnd");}else{this._current=this._animations[++this._index];this._onAnimateCtx=d.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd");this._current.play(0,true);}},play:function(_12,_13){if(!this._current){this._current=this._animations[this._index=0];}if(!_13&&this._current.status()=="playing"){return this;}var _14=d.connect(this._current,"beforeBegin",this,function(){this._fire("beforeBegin");}),_15=d.connect(this._current,"onBegin",this,function(arg){this._fire("onBegin",arguments);}),_16=d.connect(this._current,"onPlay",this,function(arg){this._fire("onPlay",arguments);d.disconnect(_14);d.disconnect(_15);d.disconnect(_16);});if(this._onAnimateCtx){d.disconnect(this._onAnimateCtx);}this._onAnimateCtx=d.connect(this._current,"onAnimate",this,"_onAnimate");if(this._onEndCtx){d.disconnect(this._onEndCtx);}this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd");this._current.play.apply(this._current,arguments);return this;},pause:function(){if(this._current){var e=d.connect(this._current,"onPause",this,function(arg){this._fire("onPause",arguments);d.disconnect(e);});this._current.pause();}return this;},gotoPercent:function(_17,_18){this.pause();var _19=this.duration*_17;this._current=null;d.some(this._animations,function(a){if(a.duration<=_19){this._current=a;return true;}_19-=a.duration;return false;});if(this._current){this._current.gotoPercent(_19/this._current.duration,_18);}return this;},stop:function(_1a){if(this._current){if(_1a){for(;this._index+1<this._animations.length;++this._index){this._animations[this._index].stop(true);}this._current=this._animations[this._index];}var e=d.connect(this._current,"onStop",this,function(arg){this._fire("onStop",arguments);d.disconnect(e);});this._current.stop();}return this;},status:function(){return this._current?this._current.status():"stopped";},destroy:function(){if(this._onAnimateCtx){d.disconnect(this._onAnimateCtx);}if(this._onEndCtx){d.disconnect(this._onEndCtx);}}});d.extend(_10,_d);dojo.fx.chain=function(_1b){return new _10(_1b);};var _1c=function(_1d){this._animations=_1d||[];this._connects=[];this._finished=0;this.duration=0;d.forEach(_1d,function(a){var _1e=a.duration;if(a.delay){_1e+=a.delay;}if(this.duration<_1e){this.duration=_1e;}this._connects.push(d.connect(a,"onEnd",this,"_onEnd"));},this);this._pseudoAnimation=new d.Animation({curve:[0,1],duration:this.duration});var _1f=this;d.forEach(["beforeBegin","onBegin","onPlay","onAnimate","onPause","onStop","onEnd"],function(evt){_1f._connects.push(d.connect(_1f._pseudoAnimation,evt,function(){_1f._fire(evt,arguments);}));});};d.extend(_1c,{_doAction:function(_20,_21){d.forEach(this._animations,function(a){a[_20].apply(a,_21);});return this;},_onEnd:function(){if(++this._finished>this._animations.length){this._fire("onEnd");}},_call:function(_22,_23){var t=this._pseudoAnimation;t[_22].apply(t,_23);},play:function(_24,_25){this._finished=0;this._doAction("play",arguments);this._call("play",arguments);return this;},pause:function(){this._doAction("pause",arguments);this._call("pause",arguments);return this;},gotoPercent:function(_26,_27){var ms=this.duration*_26;d.forEach(this._animations,function(a){a.gotoPercent(a.duration<ms?1:(ms/a.duration),_27);});this._call("gotoPercent",arguments);return this;},stop:function(_28){this._doAction("stop",arguments);this._call("stop",arguments);return this;},status:function(){return this._pseudoAnimation.status();},destroy:function(){d.forEach(this._connects,dojo.disconnect);}});d.extend(_1c,_d);dojo.fx.combine=function(_29){return new _1c(_29);};dojo.fx.wipeIn=function(_2a){var _2b=_2a.node=d.byId(_2a.node),s=_2b.style,o;var _2c=d.animateProperty(d.mixin({properties:{height:{start:function(){o=s.overflow;s.overflow="hidden";if(s.visibility=="hidden"||s.display=="none"){s.height="1px";s.display="";s.visibility="";return 1;}else{var _2d=d.style(_2b,"height");return Math.max(_2d,1);}},end:function(){return _2b.scrollHeight;}}}},_2a));d.connect(_2c,"onEnd",function(){s.height="auto";s.overflow=o;});return _2c;};dojo.fx.wipeOut=function(_2e){var _2f=_2e.node=d.byId(_2e.node),s=_2f.style,o;var _30=d.animateProperty(d.mixin({properties:{height:{end:1}}},_2e));d.connect(_30,"beforeBegin",function(){o=s.overflow;s.overflow="hidden";s.display="";});d.connect(_30,"onEnd",function(){s.overflow=o;s.height="auto";s.display="none";});return _30;};dojo.fx.slideTo=function(_31){var _32=_31.node=d.byId(_31.node),top=null,_33=null;var _34=(function(n){return function(){var cs=d.getComputedStyle(n);var pos=cs.position;top=(pos=="absolute"?n.offsetTop:parseInt(cs.top)||0);_33=(pos=="absolute"?n.offsetLeft:parseInt(cs.left)||0);if(pos!="absolute"&&pos!="relative"){var ret=d.position(n,true);top=ret.y;_33=ret.x;n.style.position="absolute";n.style.top=top+"px";n.style.left=_33+"px";}};})(_32);_34();var _35=d.animateProperty(d.mixin({properties:{top:_31.top||0,left:_31.left||0}},_31));d.connect(_35,"beforeBegin",_35,_34);return _35;};})();}if(!dojo._hasResource["dojox.fx.flip"]){dojo._hasResource["dojox.fx.flip"]=true;dojo.provide("dojox.fx.flip");dojo.experimental("dojox.fx.flip");var borderConst="border",widthConst="Width",heightConst="Height",topConst="Top",rightConst="Right",leftConst="Left",bottomConst="Bottom";dojox.fx.flip=function(_36){var _37=dojo.create("div"),_38=_36.node=dojo.byId(_36.node),s=_38.style,_39=null,hs=null,pn=null,_3a=_36.lightColor||"#dddddd",_3b=_36.darkColor||"#555555",_3c=dojo.style(_38,"backgroundColor"),_3d=_36.endColor||_3c,_3e={},_3f=[],_40=_36.duration?_36.duration/2:250,dir=_36.dir||"left",_41=0.9,_42="transparent",_43=_36.whichAnim,_44=_36.axis||"center",_45=_36.depth;var _46=function(_47){return ((new dojo.Color(_47)).toHex()==="#000000")?"#000001":_47;};if(dojo.isIE<7){_3d=_46(_3d);_3a=_46(_3a);_3b=_46(_3b);_3c=_46(_3c);_42="black";_37.style.filter="chroma(color='#000000')";}var _48=(function(n){return function(){var ret=dojo.coords(n,true);_39={top:ret.y,left:ret.x,width:ret.w,height:ret.h};};})(_38);_48();hs={position:"absolute",top:_39["top"]+"px",left:_39["left"]+"px",height:"0",width:"0",zIndex:_36.zIndex||(s.zIndex||0),border:"0 solid "+_42,fontSize:"0",visibility:"hidden"};var _49=[{},{top:_39["top"],left:_39["left"]}];var _4a={left:[leftConst,rightConst,topConst,bottomConst,widthConst,heightConst,"end"+heightConst+"Min",leftConst,"end"+heightConst+"Max"],right:[rightConst,leftConst,topConst,bottomConst,widthConst,heightConst,"end"+heightConst+"Min",leftConst,"end"+heightConst+"Max"],top:[topConst,bottomConst,leftConst,rightConst,heightConst,widthConst,"end"+widthConst+"Min",topConst,"end"+widthConst+"Max"],bottom:[bottomConst,topConst,leftConst,rightConst,heightConst,widthConst,"end"+widthConst+"Min",topConst,"end"+widthConst+"Max"]};pn=_4a[dir];if(typeof _45!="undefined"){_45=Math.max(0,Math.min(1,_45))/2;_41=0.4+(0.5-_45);}else{_41=Math.min(0.9,Math.max(0.4,_39[pn[5].toLowerCase()]/_39[pn[4].toLowerCase()]));}var p0=_49[0];for(var i=4;i<6;i++){if(_44=="center"||_44=="cube"){_39["end"+pn[i]+"Min"]=_39[pn[i].toLowerCase()]*_41;_39["end"+pn[i]+"Max"]=_39[pn[i].toLowerCase()]/_41;}else{if(_44=="shortside"){_39["end"+pn[i]+"Min"]=_39[pn[i].toLowerCase()];_39["end"+pn[i]+"Max"]=_39[pn[i].toLowerCase()]/_41;}else{if(_44=="longside"){_39["end"+pn[i]+"Min"]=_39[pn[i].toLowerCase()]*_41;_39["end"+pn[i]+"Max"]=_39[pn[i].toLowerCase()];}}}}if(_44=="center"){p0[pn[2].toLowerCase()]=_39[pn[2].toLowerCase()]-(_39[pn[8]]-_39[pn[6]])/4;}else{if(_44=="shortside"){p0[pn[2].toLowerCase()]=_39[pn[2].toLowerCase()]-(_39[pn[8]]-_39[pn[6]])/2;}}_3e[pn[5].toLowerCase()]=_39[pn[5].toLowerCase()]+"px";_3e[pn[4].toLowerCase()]="0";_3e[borderConst+pn[1]+widthConst]=_39[pn[4].toLowerCase()]+"px";_3e[borderConst+pn[1]+"Color"]=_3c;p0[borderConst+pn[1]+widthConst]=0;p0[borderConst+pn[1]+"Color"]=_3b;p0[borderConst+pn[2]+widthConst]=p0[borderConst+pn[3]+widthConst]=_44!="cube"?(_39["end"+pn[5]+"Max"]-_39["end"+pn[5]+"Min"])/2:_39[pn[6]]/2;p0[pn[7].toLowerCase()]=_39[pn[7].toLowerCase()]+_39[pn[4].toLowerCase()]/2+(_36.shift||0);p0[pn[5].toLowerCase()]=_39[pn[6]];var p1=_49[1];p1[borderConst+pn[0]+"Color"]={start:_3a,end:_3d};p1[borderConst+pn[0]+widthConst]=_39[pn[4].toLowerCase()];p1[borderConst+pn[2]+widthConst]=0;p1[borderConst+pn[3]+widthConst]=0;p1[pn[5].toLowerCase()]={start:_39[pn[6]],end:_39[pn[5].toLowerCase()]};dojo.mixin(hs,_3e);dojo.style(_37,hs);dojo.body().appendChild(_37);var _4b=function(){dojo.destroy(_37);s.backgroundColor=_3d;s.visibility="visible";};if(_43=="last"){for(i in p0){p0[i]={start:p0[i]};}p0[borderConst+pn[1]+"Color"]={start:_3b,end:_3d};p1=p0;}if(!_43||_43=="first"){_3f.push(dojo.animateProperty({node:_37,duration:_40,properties:p0}));}if(!_43||_43=="last"){_3f.push(dojo.animateProperty({node:_37,duration:_40,properties:p1,onEnd:_4b}));}dojo.connect(_3f[0],"play",function(){_37.style.visibility="visible";s.visibility="hidden";});return dojo.fx.chain(_3f);};dojox.fx.flipCube=function(_4c){var _4d=[],mb=dojo.marginBox(_4c.node),_4e=mb.w/2,_4f=mb.h/2,_50={top:{pName:"height",args:[{whichAnim:"first",dir:"top",shift:-_4f},{whichAnim:"last",dir:"bottom",shift:_4f}]},right:{pName:"width",args:[{whichAnim:"first",dir:"right",shift:_4e},{whichAnim:"last",dir:"left",shift:-_4e}]},bottom:{pName:"height",args:[{whichAnim:"first",dir:"bottom",shift:_4f},{whichAnim:"last",dir:"top",shift:-_4f}]},left:{pName:"width",args:[{whichAnim:"first",dir:"left",shift:-_4e},{whichAnim:"last",dir:"right",shift:_4e}]}};var d=_50[_4c.dir||"left"],p=d.args;_4c.duration=_4c.duration?_4c.duration*2:500;_4c.depth=0.8;_4c.axis="cube";for(var i=p.length-1;i>=0;i--){dojo.mixin(_4c,p[i]);_4d.push(dojox.fx.flip(_4c));}return dojo.fx.combine(_4d);};dojox.fx.flipPage=function(_51){var n=_51.node,_52=dojo.coords(n,true),x=_52.x,y=_52.y,w=_52.w,h=_52.h,_53=dojo.style(n,"backgroundColor"),_54=_51.lightColor||"#dddddd",_55=_51.darkColor,_56=dojo.create("div"),_57=[],hn=[],dir=_51.dir||"right",pn={left:["left","right","x","w"],top:["top","bottom","y","h"],right:["left","left","x","w"],bottom:["top","top","y","h"]},_58={right:[1,-1],left:[-1,1],top:[-1,1],bottom:[1,-1]};dojo.style(_56,{position:"absolute",width:w+"px",height:h+"px",top:y+"px",left:x+"px",visibility:"hidden"});var hs=[];for(var i=0;i<2;i++){var r=i%2,d=r?pn[dir][1]:dir,wa=r?"last":"first",_59=r?_53:_54,_5a=r?_59:_51.startColor||n.style.backgroundColor;hn[i]=dojo.clone(_56);var _5b=function(x){return function(){dojo.destroy(hn[x]);};}(i);dojo.body().appendChild(hn[i]);hs[i]={backgroundColor:r?_5a:_53};hs[i][pn[dir][0]]=_52[pn[dir][2]]+_58[dir][0]*i*_52[pn[dir][3]]+"px";dojo.style(hn[i],hs[i]);_57.push(dojox.fx.flip({node:hn[i],dir:d,axis:"shortside",depth:_51.depth,duration:_51.duration/2,shift:_58[dir][i]*_52[pn[dir][3]]/2,darkColor:_55,lightColor:_54,whichAnim:wa,endColor:_59}));dojo.connect(_57[i],"onEnd",_5b);}return dojo.fx.chain(_57);};dojox.fx.flipGrid=function(_5c){var _5d=_5c.rows||4,_5e=_5c.cols||4,_5f=[],_60=dojo.create("div"),n=_5c.node,_61=dojo.coords(n,true),x=_61.x,y=_61.y,nw=_61.w,nh=_61.h,w=_61.w/_5e,h=_61.h/_5d,_62=[];dojo.style(_60,{position:"absolute",width:w+"px",height:h+"px",backgroundColor:dojo.style(n,"backgroundColor")});for(var i=0;i<_5d;i++){var r=i%2,d=r?"right":"left",_63=r?1:-1;var cn=dojo.clone(n);dojo.style(cn,{position:"absolute",width:nw+"px",height:nh+"px",top:y+"px",left:x+"px",clip:"rect("+i*h+"px,"+nw+"px,"+nh+"px,0)"});dojo.body().appendChild(cn);_5f[i]=[];for(var j=0;j<_5e;j++){var hn=dojo.clone(_60),l=r?j:_5e-(j+1);var _64=function(xn,_65,_66){return function(){if(!(_65%2)){dojo.style(xn,{clip:"rect("+_65*h+"px,"+(nw-(_66+1)*w)+"px,"+((_65+1)*h)+"px,0px)"});}else{dojo.style(xn,{clip:"rect("+_65*h+"px,"+nw+"px,"+((_65+1)*h)+"px,"+((_66+1)*w)+"px)"});}};}(cn,i,j);dojo.body().appendChild(hn);dojo.style(hn,{left:x+l*w+"px",top:y+i*h+"px",visibility:"hidden"});var a=dojox.fx.flipPage({node:hn,dir:d,duration:_5c.duration||900,shift:_63*w/2,depth:0.2,darkColor:_5c.darkColor,lightColor:_5c.lightColor,startColor:_5c.startColor||_5c.node.style.backgroundColor}),_67=function(xn){return function(){dojo.destroy(xn);};}(hn);dojo.connect(a,"play",this,_64);dojo.connect(a,"play",this,_67);_5f[i].push(a);}_62.push(dojo.fx.chain(_5f[i]));}dojo.connect(_62[0],"play",function(){dojo.style(n,{visibility:"hidden"});});return dojo.fx.combine(_62);};}if(!dojo._hasResource["dojox.mobile.compat"]){dojo._hasResource["dojox.mobile.compat"]=true;dojo.provide("dojox.mobile.compat");if(!dojo.isWebKit){dojo.extend(dojox.mobile.View,{_doTransition:function(_68,_69,_6a,dir){var _6b;this.wakeUp(_69);if(!_6a||_6a=="none"){_69.style.display="";_68.style.display="none";_69.style.left="0px";this.invokeCallback();}else{if(_6a=="slide"){var w=_68.offsetWidth;var s1=dojo.fx.slideTo({node:_68,duration:400,left:-w*dir,top:_68.offsetTop});var s2=dojo.fx.slideTo({node:_69,duration:400,left:0});_69.style.position="absolute";_69.style.left=w*dir+"px";_69.style.display="";_6b=dojo.fx.combine([s1,s2]);dojo.connect(_6b,"onEnd",this,function(){_68.style.display="none";_69.style.position="relative";this.invokeCallback();});_6b.play();}else{if(_6a=="flip"){_6b=dojox.fx.flip({node:_68,dir:"right",depth:0.5,duration:400});_69.style.position="absolute";_69.style.left="0px";dojo.connect(_6b,"onEnd",this,function(){_68.style.display="none";_69.style.position="relative";_69.style.display="";this.invokeCallback();});_6b.play();}else{if(_6a=="fade"){_6b=dojo.fx.chain([dojo.fadeOut({node:_68,duration:600}),dojo.fadeIn({node:_69,duration:600})]);_69.style.position="absolute";_69.style.left="0px";_69.style.display="";dojo.style(_69,"opacity",0);dojo.connect(_6b,"onEnd",this,function(){_68.style.display="none";_69.style.position="relative";dojo.style(_68,"opacity",1);this.invokeCallback();});_6b.play();}}}}},wakeUp:function(_6c){if(dojo.isIE&&!_6c._wokeup){_6c._wokeup=true;var _6d=_6c.style.display;_6c.style.display="";var _6e=_6c.getElementsByTagName("*");for(var i=0,len=_6e.length;i<len;i++){var val=_6e[i].style.display;_6e[i].style.display="none";_6e[i].style.display="";_6e[i].style.display=val;}_6c.style.display=_6d;}}});dojo.extend(dojox.mobile.Switch,{buildRendering:function(){this.domNode=this.srcNodeRef||dojo.doc.createElement("DIV");this.domNode.className="mblSwitch";this.domNode.innerHTML="<div class=\"mblSwitchInner\">"+"<div class=\"mblSwitchBg mblSwitchBgLeft\">"+"<div class=\"mblSwitchCorner mblSwitchCorner1T\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner2T\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner3T\"></div>"+"<div class=\"mblSwitchText mblSwitchTextLeft\">"+this.leftLabel+"</div>"+"<div class=\"mblSwitchCorner mblSwitchCorner1B\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner2B\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner3B\"></div>"+"</div>"+"<div class=\"mblSwitchBg mblSwitchBgRight\">"+"<div class=\"mblSwitchCorner mblSwitchCorner1T\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner2T\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner3T\"></div>"+"<div class=\"mblSwitchText mblSwitchTextRight\">"+this.rightLabel+"</div>"+"<div class=\"mblSwitchCorner mblSwitchCorner1B\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner2B\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner3B\"></div>"+"</div>"+"<div class=\"mblSwitchKnobContainer\">"+"<div class=\"mblSwitchCorner mblSwitchCorner1T\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner2T\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner3T\"></div>"+"<div class=\"mblSwitchKnob\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner1B\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner2B\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner3B\"></div>"+"</div>"+"</div>";var n=this.inner=this.domNode.firstChild;this.left=n.childNodes[0];this.right=n.childNodes[1];this.knob=n.childNodes[2];dojo.addClass(this.domNode,(this.value=="on")?"mblSwitchOn":"mblSwitchOff");this[this.value=="off"?"left":"right"].style.display="none";},_changeState:function(_6f){if(!this.inner.parentNode||!this.inner.parentNode.tagName){dojo.addClass(this.domNode,(_6f=="on")?"mblSwitchOn":"mblSwitchOff");return;}var pos;if(this.inner.offsetLeft==0){if(_6f=="on"){return;}pos=-53;}else{if(_6f=="off"){return;}pos=0;}var a=dojo.fx.slideTo({node:this.inner,duration:500,left:pos});var _70=this;dojo.connect(a,"onEnd",function(){_70[_6f=="off"?"left":"right"].style.display="none";});a.play();}});if(dojo.isIE||dojo.isBB){dojo.extend(dojox.mobile.RoundRect,{buildRendering:function(){dojox.mobile.createRoundRect(this);this.domNode.className="mblRoundRect";}});dojox.mobile.RoundRectList._addChild=dojox.mobile.RoundRectList.prototype.addChild;dojo.extend(dojox.mobile.RoundRectList,{buildRendering:function(){dojox.mobile.createRoundRect(this,true);this.domNode.className="mblRoundRectList";},postCreate:function(){this.redrawBorders();},addChild:function(_71){dojox.mobile.RoundRectList._addChild.apply(this,arguments);this.redrawBorders();if(dojox.mobile.applyPngFilter){dojox.mobile.applyPngFilter(_71.domNode);}},redrawBorders:function(){var _72=false;for(var i=this.containerNode.childNodes.length-1;i>=0;i--){var c=this.containerNode.childNodes[i];if(c.tagName=="LI"){c.style.borderBottomStyle=_72?"solid":"none";_72=true;}}}});dojo.extend(dojox.mobile.EdgeToEdgeList,{buildRendering:function(){this.domNode=this.containerNode=this.srcNodeRef||dojo.doc.createElement("UL");this.domNode.className="mblEdgeToEdgeList";}});if(dojox.mobile.IconContainer){dojox.mobile.IconContainer._addChild=dojox.mobile.IconContainer.prototype.addChild;dojo.extend(dojox.mobile.IconContainer,{addChild:function(_73){dojox.mobile.IconContainer._addChild.apply(this,arguments);if(dojox.mobile.applyPngFilter){dojox.mobile.applyPngFilter(_73.domNode);}}});}dojo.mixin(dojox.mobile,{createRoundRect:function(_74,_75){var i;_74.domNode=dojo.doc.createElement("DIV");_74.domNode.style.padding="0px";_74.domNode.style.backgroundColor="transparent";_74.domNode.style.borderStyle="none";_74.containerNode=dojo.doc.createElement(_75?"UL":"DIV");_74.containerNode.className="mblRoundRectContainer";if(_74.srcNodeRef){_74.srcNodeRef.parentNode.replaceChild(_74.domNode,_74.srcNodeRef);for(i=0,len=_74.srcNodeRef.childNodes.length;i<len;i++){_74.containerNode.appendChild(_74.srcNodeRef.removeChild(_74.srcNodeRef.firstChild));}_74.srcNodeRef=null;}_74.domNode.appendChild(_74.containerNode);for(i=0;i<=5;i++){var top=dojo.create("DIV");top.className="mblRoundCorner mblRoundCorner"+i+"T";_74.domNode.insertBefore(top,_74.containerNode);var _76=dojo.create("DIV");_76.className="mblRoundCorner mblRoundCorner"+i+"B";_74.domNode.appendChild(_76);}}});if(dojox.mobile.ScrollableView){dojo.extend(dojox.mobile.ScrollableView,{postCreate:function(){var _77=dojo.create("DIV",{className:"mblDummyForIE",innerHTML:"&nbsp;"},this.containerNode,"first");dojo.style(_77,{position:"relative",marginBottom:"-2px",fontSize:"1px"});}});}}if(dojo.isIE<=6){dojox.mobile.applyPngFilter=function(_78){_78=_78||dojo.body();var _79=_78.getElementsByTagName("IMG");var _7a=dojo.moduleUrl("dojo","resources/blank.gif");for(var i=0,len=_79.length;i<len;i++){var img=_79[i];var w=img.offsetWidth;var h=img.offsetHeight;if(w===0||h===0){if(dojo.style(img,"display")!="none"){continue;}img.style.display="";w=img.offsetWidth;h=img.offsetHeight;img.style.display="none";if(w===0||h===0){continue;}}var src=img.src;if(src.indexOf("resources/blank.gif")!=-1){continue;}img.src=_7a;img.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"')";img.style.width=w+"px";img.style.height=h+"px";}};}dojox.mobile.loadCss=function(_7b){if(!dojo.global._loadedCss){var obj={};dojo.forEach(dojox.mobile.getCssPaths(),function(_7c){obj[_7c]=true;});dojo.global._loadedCss=obj;}if(!dojo.isArray(_7b)){_7b=[_7b];}for(var i=0;i<_7b.length;i++){var _7d=_7b[i];if(!dojo.global._loadedCss[_7d]){dojo.global._loadedCss[_7d]=true;if(dojo.doc.createStyleSheet){setTimeout(function(_7e){return function(){dojo.doc.createStyleSheet(_7e);};}(_7d),0);}else{var _7f=dojo.doc.createElement("link");_7f.href=_7d;_7f.type="text/css";_7f.rel="stylesheet";var _80=dojo.doc.getElementsByTagName("head")[0];_80.appendChild(_7f);}}}};dojox.mobile.getCssPaths=function(){var _81=[];var i,j;var s=dojo.doc.styleSheets;for(i=0;i<s.length;i++){var r=s[i].cssRules||s[i].imports;if(!r){continue;}for(j=0;j<r.length;j++){if(r[j].href){_81.push(r[j].href);}}}var _82=dojo.doc.getElementsByTagName("link");for(i=0,len=_82.length;i<len;i++){if(_82[i].href){_81.push(_82[i].href);}}return _81;};dojox.mobile.loadCompatPattern=/\/themes\/(domButtons|buttons|iphone|android).*\.css$/;dojox.mobile.loadCompatCssFiles=function(){var _83=dojox.mobile.getCssPaths();for(var i=0;i<_83.length;i++){var _84=_83[i];if(_84.match(dojox.mobile.loadCompatPattern)&&_84.indexOf("-compat.css")==-1){var _85=_84.substring(0,_84.length-4)+"-compat.css";dojox.mobile.loadCss(_85);}}};dojox.mobile.hideAddressBar=function(){};dojo.addOnLoad(function(){if(dojo.config["mblLoadCompatCssFiles"]!==false){dojox.mobile.loadCompatCssFiles();}if(dojox.mobile.applyPngFilter){dojox.mobile.applyPngFilter();}});}}
diff --git a/js/dojo-1.6/dojox/mobile/compat.js.uncompressed.js b/js/dojo-1.6/dojox/mobile/compat.js.uncompressed.js
new file mode 100644
index 0000000..7bef9d8
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/compat.js.uncompressed.js
@@ -0,0 +1,1586 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+/*
+ This is an optimized version of Dojo, built for deployment and not for
+ development. To get sources and documentation, please visit:
+
+ http://dojotoolkit.org
+*/
+
+if(!dojo._hasResource["dojo.uacss"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.uacss"] = true;
+dojo.provide("dojo.uacss");
+
+
+
+(function(){
+ // summary:
+ // Applies pre-set CSS classes to the top-level HTML node, based on:
+ // - browser (ex: dj_ie)
+ // - browser version (ex: dj_ie6)
+ // - box model (ex: dj_contentBox)
+ // - text direction (ex: dijitRtl)
+ //
+ // In addition, browser, browser version, and box model are
+ // combined with an RTL flag when browser text is RTL. ex: dj_ie-rtl.
+
+ var d = dojo,
+ html = d.doc.documentElement,
+ ie = d.isIE,
+ opera = d.isOpera,
+ maj = Math.floor,
+ ff = d.isFF,
+ boxModel = d.boxModel.replace(/-/,''),
+
+ classes = {
+ dj_ie: ie,
+ dj_ie6: maj(ie) == 6,
+ dj_ie7: maj(ie) == 7,
+ dj_ie8: maj(ie) == 8,
+ dj_ie9: maj(ie) == 9,
+ dj_quirks: d.isQuirks,
+ dj_iequirks: ie && d.isQuirks,
+
+ // NOTE: Opera not supported by dijit
+ dj_opera: opera,
+
+ dj_khtml: d.isKhtml,
+
+ dj_webkit: d.isWebKit,
+ dj_safari: d.isSafari,
+ dj_chrome: d.isChrome,
+
+ dj_gecko: d.isMozilla,
+ dj_ff3: maj(ff) == 3
+ }; // no dojo unsupported browsers
+
+ classes["dj_" + boxModel] = true;
+
+ // apply browser, browser version, and box model class names
+ var classStr = "";
+ for(var clz in classes){
+ if(classes[clz]){
+ classStr += clz + " ";
+ }
+ }
+ html.className = d.trim(html.className + " " + classStr);
+
+ // If RTL mode, then add dj_rtl flag plus repeat existing classes with -rtl extension.
+ // We can't run the code below until the <body> tag has loaded (so we can check for dir=rtl).
+ // Unshift() is to run sniff code before the parser.
+ dojo._loaders.unshift(function(){
+ if(!dojo._isBodyLtr()){
+ var rtlClassStr = "dj_rtl dijitRtl " + classStr.replace(/ /g, "-rtl ")
+ html.className = d.trim(html.className + " " + rtlClassStr);
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dijit._base.sniff"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.sniff"] = true;
+dojo.provide("dijit._base.sniff");
+
+
+
+
+// summary:
+// Applies pre-set CSS classes to the top-level HTML node, see
+// `dojo.uacss` for details.
+//
+// Simply doing a require on this module will
+// establish this CSS. Modified version of Morris' CSS hack.
+
+}
+
+if(!dojo._hasResource["dojo.fx.Toggler"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.fx.Toggler"] = true;
+dojo.provide("dojo.fx.Toggler");
+
+
+
+dojo.declare("dojo.fx.Toggler", null, {
+ // summary:
+ // A simple `dojo.Animation` toggler API.
+ //
+ // description:
+ // class constructor for an animation toggler. It accepts a packed
+ // set of arguments about what type of animation to use in each
+ // direction, duration, etc. All available members are mixed into
+ // these animations from the constructor (for example, `node`,
+ // `showDuration`, `hideDuration`).
+ //
+ // example:
+ // | var t = new dojo.fx.Toggler({
+ // | node: "nodeId",
+ // | showDuration: 500,
+ // | // hideDuration will default to "200"
+ // | showFunc: dojo.fx.wipeIn,
+ // | // hideFunc will default to "fadeOut"
+ // | });
+ // | t.show(100); // delay showing for 100ms
+ // | // ...time passes...
+ // | t.hide();
+
+ // node: DomNode
+ // the node to target for the showing and hiding animations
+ node: null,
+
+ // showFunc: Function
+ // The function that returns the `dojo.Animation` to show the node
+ showFunc: dojo.fadeIn,
+
+ // hideFunc: Function
+ // The function that returns the `dojo.Animation` to hide the node
+ hideFunc: dojo.fadeOut,
+
+ // showDuration:
+ // Time in milliseconds to run the show Animation
+ showDuration: 200,
+
+ // hideDuration:
+ // Time in milliseconds to run the hide Animation
+ hideDuration: 200,
+
+ // FIXME: need a policy for where the toggler should "be" the next
+ // time show/hide are called if we're stopped somewhere in the
+ // middle.
+ // FIXME: also would be nice to specify individual showArgs/hideArgs mixed into
+ // each animation individually.
+ // FIXME: also would be nice to have events from the animations exposed/bridged
+
+ /*=====
+ _showArgs: null,
+ _showAnim: null,
+
+ _hideArgs: null,
+ _hideAnim: null,
+
+ _isShowing: false,
+ _isHiding: false,
+ =====*/
+
+ constructor: function(args){
+ var _t = this;
+
+ dojo.mixin(_t, args);
+ _t.node = args.node;
+ _t._showArgs = dojo.mixin({}, args);
+ _t._showArgs.node = _t.node;
+ _t._showArgs.duration = _t.showDuration;
+ _t.showAnim = _t.showFunc(_t._showArgs);
+
+ _t._hideArgs = dojo.mixin({}, args);
+ _t._hideArgs.node = _t.node;
+ _t._hideArgs.duration = _t.hideDuration;
+ _t.hideAnim = _t.hideFunc(_t._hideArgs);
+
+ dojo.connect(_t.showAnim, "beforeBegin", dojo.hitch(_t.hideAnim, "stop", true));
+ dojo.connect(_t.hideAnim, "beforeBegin", dojo.hitch(_t.showAnim, "stop", true));
+ },
+
+ show: function(delay){
+ // summary: Toggle the node to showing
+ // delay: Integer?
+ // Ammount of time to stall playing the show animation
+ return this.showAnim.play(delay || 0);
+ },
+
+ hide: function(delay){
+ // summary: Toggle the node to hidden
+ // delay: Integer?
+ // Ammount of time to stall playing the hide animation
+ return this.hideAnim.play(delay || 0);
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojo.fx"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.fx"] = true;
+dojo.provide("dojo.fx");
+
+
+
+
+/*=====
+dojo.fx = {
+ // summary: Effects library on top of Base animations
+};
+=====*/
+(function(){
+
+ var d = dojo,
+ _baseObj = {
+ _fire: function(evt, args){
+ if(this[evt]){
+ this[evt].apply(this, args||[]);
+ }
+ return this;
+ }
+ };
+
+ var _chain = function(animations){
+ this._index = -1;
+ this._animations = animations||[];
+ this._current = this._onAnimateCtx = this._onEndCtx = null;
+
+ this.duration = 0;
+ d.forEach(this._animations, function(a){
+ this.duration += a.duration;
+ if(a.delay){ this.duration += a.delay; }
+ }, this);
+ };
+ d.extend(_chain, {
+ _onAnimate: function(){
+ this._fire("onAnimate", arguments);
+ },
+ _onEnd: function(){
+ d.disconnect(this._onAnimateCtx);
+ d.disconnect(this._onEndCtx);
+ this._onAnimateCtx = this._onEndCtx = null;
+ if(this._index + 1 == this._animations.length){
+ this._fire("onEnd");
+ }else{
+ // switch animations
+ this._current = this._animations[++this._index];
+ this._onAnimateCtx = d.connect(this._current, "onAnimate", this, "_onAnimate");
+ this._onEndCtx = d.connect(this._current, "onEnd", this, "_onEnd");
+ this._current.play(0, true);
+ }
+ },
+ play: function(/*int?*/ delay, /*Boolean?*/ gotoStart){
+ if(!this._current){ this._current = this._animations[this._index = 0]; }
+ if(!gotoStart && this._current.status() == "playing"){ return this; }
+ var beforeBegin = d.connect(this._current, "beforeBegin", this, function(){
+ this._fire("beforeBegin");
+ }),
+ onBegin = d.connect(this._current, "onBegin", this, function(arg){
+ this._fire("onBegin", arguments);
+ }),
+ onPlay = d.connect(this._current, "onPlay", this, function(arg){
+ this._fire("onPlay", arguments);
+ d.disconnect(beforeBegin);
+ d.disconnect(onBegin);
+ d.disconnect(onPlay);
+ });
+ if(this._onAnimateCtx){
+ d.disconnect(this._onAnimateCtx);
+ }
+ this._onAnimateCtx = d.connect(this._current, "onAnimate", this, "_onAnimate");
+ if(this._onEndCtx){
+ d.disconnect(this._onEndCtx);
+ }
+ this._onEndCtx = d.connect(this._current, "onEnd", this, "_onEnd");
+ this._current.play.apply(this._current, arguments);
+ return this;
+ },
+ pause: function(){
+ if(this._current){
+ var e = d.connect(this._current, "onPause", this, function(arg){
+ this._fire("onPause", arguments);
+ d.disconnect(e);
+ });
+ this._current.pause();
+ }
+ return this;
+ },
+ gotoPercent: function(/*Decimal*/percent, /*Boolean?*/ andPlay){
+ this.pause();
+ var offset = this.duration * percent;
+ this._current = null;
+ d.some(this._animations, function(a){
+ if(a.duration <= offset){
+ this._current = a;
+ return true;
+ }
+ offset -= a.duration;
+ return false;
+ });
+ if(this._current){
+ this._current.gotoPercent(offset / this._current.duration, andPlay);
+ }
+ return this;
+ },
+ stop: function(/*boolean?*/ gotoEnd){
+ if(this._current){
+ if(gotoEnd){
+ for(; this._index + 1 < this._animations.length; ++this._index){
+ this._animations[this._index].stop(true);
+ }
+ this._current = this._animations[this._index];
+ }
+ var e = d.connect(this._current, "onStop", this, function(arg){
+ this._fire("onStop", arguments);
+ d.disconnect(e);
+ });
+ this._current.stop();
+ }
+ return this;
+ },
+ status: function(){
+ return this._current ? this._current.status() : "stopped";
+ },
+ destroy: function(){
+ if(this._onAnimateCtx){ d.disconnect(this._onAnimateCtx); }
+ if(this._onEndCtx){ d.disconnect(this._onEndCtx); }
+ }
+ });
+ d.extend(_chain, _baseObj);
+
+ dojo.fx.chain = function(/*dojo.Animation[]*/ animations){
+ // summary:
+ // Chain a list of `dojo.Animation`s to run in sequence
+ //
+ // description:
+ // Return a `dojo.Animation` which will play all passed
+ // `dojo.Animation` instances in sequence, firing its own
+ // synthesized events simulating a single animation. (eg:
+ // onEnd of this animation means the end of the chain,
+ // not the individual animations within)
+ //
+ // example:
+ // Once `node` is faded out, fade in `otherNode`
+ // | dojo.fx.chain([
+ // | dojo.fadeIn({ node:node }),
+ // | dojo.fadeOut({ node:otherNode })
+ // | ]).play();
+ //
+ return new _chain(animations) // dojo.Animation
+ };
+
+ var _combine = function(animations){
+ this._animations = animations||[];
+ this._connects = [];
+ this._finished = 0;
+
+ this.duration = 0;
+ d.forEach(animations, function(a){
+ var duration = a.duration;
+ if(a.delay){ duration += a.delay; }
+ if(this.duration < duration){ this.duration = duration; }
+ this._connects.push(d.connect(a, "onEnd", this, "_onEnd"));
+ }, this);
+
+ this._pseudoAnimation = new d.Animation({curve: [0, 1], duration: this.duration});
+ var self = this;
+ d.forEach(["beforeBegin", "onBegin", "onPlay", "onAnimate", "onPause", "onStop", "onEnd"],
+ function(evt){
+ self._connects.push(d.connect(self._pseudoAnimation, evt,
+ function(){ self._fire(evt, arguments); }
+ ));
+ }
+ );
+ };
+ d.extend(_combine, {
+ _doAction: function(action, args){
+ d.forEach(this._animations, function(a){
+ a[action].apply(a, args);
+ });
+ return this;
+ },
+ _onEnd: function(){
+ if(++this._finished > this._animations.length){
+ this._fire("onEnd");
+ }
+ },
+ _call: function(action, args){
+ var t = this._pseudoAnimation;
+ t[action].apply(t, args);
+ },
+ play: function(/*int?*/ delay, /*Boolean?*/ gotoStart){
+ this._finished = 0;
+ this._doAction("play", arguments);
+ this._call("play", arguments);
+ return this;
+ },
+ pause: function(){
+ this._doAction("pause", arguments);
+ this._call("pause", arguments);
+ return this;
+ },
+ gotoPercent: function(/*Decimal*/percent, /*Boolean?*/ andPlay){
+ var ms = this.duration * percent;
+ d.forEach(this._animations, function(a){
+ a.gotoPercent(a.duration < ms ? 1 : (ms / a.duration), andPlay);
+ });
+ this._call("gotoPercent", arguments);
+ return this;
+ },
+ stop: function(/*boolean?*/ gotoEnd){
+ this._doAction("stop", arguments);
+ this._call("stop", arguments);
+ return this;
+ },
+ status: function(){
+ return this._pseudoAnimation.status();
+ },
+ destroy: function(){
+ d.forEach(this._connects, dojo.disconnect);
+ }
+ });
+ d.extend(_combine, _baseObj);
+
+ dojo.fx.combine = function(/*dojo.Animation[]*/ animations){
+ // summary:
+ // Combine a list of `dojo.Animation`s to run in parallel
+ //
+ // description:
+ // Combine an array of `dojo.Animation`s to run in parallel,
+ // providing a new `dojo.Animation` instance encompasing each
+ // animation, firing standard animation events.
+ //
+ // example:
+ // Fade out `node` while fading in `otherNode` simultaneously
+ // | dojo.fx.combine([
+ // | dojo.fadeIn({ node:node }),
+ // | dojo.fadeOut({ node:otherNode })
+ // | ]).play();
+ //
+ // example:
+ // When the longest animation ends, execute a function:
+ // | var anim = dojo.fx.combine([
+ // | dojo.fadeIn({ node: n, duration:700 }),
+ // | dojo.fadeOut({ node: otherNode, duration: 300 })
+ // | ]);
+ // | dojo.connect(anim, "onEnd", function(){
+ // | // overall animation is done.
+ // | });
+ // | anim.play(); // play the animation
+ //
+ return new _combine(animations); // dojo.Animation
+ };
+
+ dojo.fx.wipeIn = function(/*Object*/ args){
+ // summary:
+ // Expand a node to it's natural height.
+ //
+ // description:
+ // Returns an animation that will expand the
+ // node defined in 'args' object from it's current height to
+ // it's natural height (with no scrollbar).
+ // Node must have no margin/border/padding.
+ //
+ // args: Object
+ // A hash-map of standard `dojo.Animation` constructor properties
+ // (such as easing: node: duration: and so on)
+ //
+ // example:
+ // | dojo.fx.wipeIn({
+ // | node:"someId"
+ // | }).play()
+ var node = args.node = d.byId(args.node), s = node.style, o;
+
+ var anim = d.animateProperty(d.mixin({
+ properties: {
+ height: {
+ // wrapped in functions so we wait till the last second to query (in case value has changed)
+ start: function(){
+ // start at current [computed] height, but use 1px rather than 0
+ // because 0 causes IE to display the whole panel
+ o = s.overflow;
+ s.overflow = "hidden";
+ if(s.visibility == "hidden" || s.display == "none"){
+ s.height = "1px";
+ s.display = "";
+ s.visibility = "";
+ return 1;
+ }else{
+ var height = d.style(node, "height");
+ return Math.max(height, 1);
+ }
+ },
+ end: function(){
+ return node.scrollHeight;
+ }
+ }
+ }
+ }, args));
+
+ d.connect(anim, "onEnd", function(){
+ s.height = "auto";
+ s.overflow = o;
+ });
+
+ return anim; // dojo.Animation
+ };
+
+ dojo.fx.wipeOut = function(/*Object*/ args){
+ // summary:
+ // Shrink a node to nothing and hide it.
+ //
+ // description:
+ // Returns an animation that will shrink node defined in "args"
+ // from it's current height to 1px, and then hide it.
+ //
+ // args: Object
+ // A hash-map of standard `dojo.Animation` constructor properties
+ // (such as easing: node: duration: and so on)
+ //
+ // example:
+ // | dojo.fx.wipeOut({ node:"someId" }).play()
+
+ var node = args.node = d.byId(args.node), s = node.style, o;
+
+ var anim = d.animateProperty(d.mixin({
+ properties: {
+ height: {
+ end: 1 // 0 causes IE to display the whole panel
+ }
+ }
+ }, args));
+
+ d.connect(anim, "beforeBegin", function(){
+ o = s.overflow;
+ s.overflow = "hidden";
+ s.display = "";
+ });
+ d.connect(anim, "onEnd", function(){
+ s.overflow = o;
+ s.height = "auto";
+ s.display = "none";
+ });
+
+ return anim; // dojo.Animation
+ };
+
+ dojo.fx.slideTo = function(/*Object*/ args){
+ // summary:
+ // Slide a node to a new top/left position
+ //
+ // description:
+ // Returns an animation that will slide "node"
+ // defined in args Object from its current position to
+ // the position defined by (args.left, args.top).
+ //
+ // args: Object
+ // A hash-map of standard `dojo.Animation` constructor properties
+ // (such as easing: node: duration: and so on). Special args members
+ // are `top` and `left`, which indicate the new position to slide to.
+ //
+ // example:
+ // | dojo.fx.slideTo({ node: node, left:"40", top:"50", units:"px" }).play()
+
+ var node = args.node = d.byId(args.node),
+ top = null, left = null;
+
+ var init = (function(n){
+ return function(){
+ var cs = d.getComputedStyle(n);
+ var pos = cs.position;
+ top = (pos == 'absolute' ? n.offsetTop : parseInt(cs.top) || 0);
+ left = (pos == 'absolute' ? n.offsetLeft : parseInt(cs.left) || 0);
+ if(pos != 'absolute' && pos != 'relative'){
+ var ret = d.position(n, true);
+ top = ret.y;
+ left = ret.x;
+ n.style.position="absolute";
+ n.style.top=top+"px";
+ n.style.left=left+"px";
+ }
+ };
+ })(node);
+ init();
+
+ var anim = d.animateProperty(d.mixin({
+ properties: {
+ top: args.top || 0,
+ left: args.left || 0
+ }
+ }, args));
+ d.connect(anim, "beforeBegin", anim, init);
+
+ return anim; // dojo.Animation
+ };
+
+})();
+
+}
+
+if(!dojo._hasResource["dojox.fx.flip"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.fx.flip"] = true;
+dojo.provide("dojox.fx.flip");
+
+
+
+
+ dojo.experimental("dojox.fx.flip");
+ // because ShrinkSafe will eat this up:
+ var borderConst = "border",
+ widthConst = "Width",
+ heightConst = "Height",
+ topConst = "Top",
+ rightConst = "Right",
+ leftConst = "Left",
+ bottomConst = "Bottom"
+ ;
+
+ dojox.fx.flip = function(/*Object*/ args){
+ // summary: Animate a node flipping following a specific direction
+ //
+ // description:
+ // Returns an animation that will flip the
+ // node around a central axis:
+ // if args.dir is "left" or "right" --> y axis
+ // if args.dir is "top" or "bottom" --> x axis
+ //
+ // This effect is obtained using a border distorsion applied to a helper node.
+ //
+ // The user can specify three background colors for the helper node:
+ // darkColor: the darkest color reached during the animation
+ // lightColor: the brightest color
+ // endColor: the final backgroundColor for the node
+ //
+ // depth: Float
+ // 0 <= depth <= 1 overrides the computed "depth"
+ // (0: min distorsion, 1: max distorsion)
+ //
+ // whichAnim: String
+ // "first" : the first half animation
+ // "last" : the second one
+ // "both" (default) : both
+ //
+ // axis: String
+ // "center" (default) : the node is flipped around his center
+ // "shortside" : the node is flipped around his "short" (in perspective) side
+ // "longside" : the node is flipped around his "long" (in perspective) side
+ // "cube" : the node flips around the central axis of the cube
+ //
+ // shift: Integer
+ // node translation, perpendicular to the rotation axis
+ //
+ // example:
+ // | var anim = dojox.fx.flip({
+ // | node: dojo.byId("nodeId"),
+ // | dir: "top",
+ // | darkColor: "#555555",
+ // | lightColor: "#dddddd",
+ // | endColor: "#666666",
+ // | depth: .5,
+ // | shift: 50,
+ // | duration:300
+ // | });
+
+ var helperNode = dojo.create("div"),
+ node = args.node = dojo.byId(args.node),
+ s = node.style,
+ dims = null,
+ hs = null,
+ pn = null,
+ lightColor = args.lightColor || "#dddddd",
+ darkColor = args.darkColor || "#555555",
+ bgColor = dojo.style(node, "backgroundColor"),
+ endColor = args.endColor || bgColor,
+ staticProps = {},
+ anims = [],
+ duration = args.duration ? args.duration / 2 : 250,
+ dir = args.dir || "left",
+ pConst = .9,
+ transparentColor = "transparent",
+ whichAnim = args.whichAnim,
+ axis = args.axis || "center",
+ depth = args.depth
+ ;
+ // IE6 workaround: IE6 doesn't support transparent borders
+ var convertColor = function(color){
+ return ((new dojo.Color(color)).toHex() === "#000000") ? "#000001" : color;
+ };
+
+ if(dojo.isIE < 7){
+ endColor = convertColor(endColor);
+ lightColor = convertColor(lightColor);
+ darkColor = convertColor(darkColor);
+ bgColor = convertColor(bgColor);
+ transparentColor = "black";
+ helperNode.style.filter = "chroma(color='#000000')";
+ }
+
+ var init = (function(n){
+ return function(){
+ var ret = dojo.coords(n, true);
+ dims = {
+ top: ret.y,
+ left: ret.x,
+ width: ret.w,
+ height: ret.h
+ };
+ }
+ })(node);
+ init();
+ // helperNode initialization
+ hs = {
+ position: "absolute",
+ top: dims["top"] + "px",
+ left: dims["left"] + "px",
+ height: "0",
+ width: "0",
+ zIndex: args.zIndex || (s.zIndex || 0),
+ border: "0 solid " + transparentColor,
+ fontSize: "0",
+ visibility: "hidden"
+ };
+ var props = [ {},
+ {
+ top: dims["top"],
+ left: dims["left"]
+ }
+ ];
+ var dynProperties = {
+ left: [leftConst, rightConst, topConst, bottomConst, widthConst, heightConst, "end" + heightConst + "Min", leftConst, "end" + heightConst + "Max"],
+ right: [rightConst, leftConst, topConst, bottomConst, widthConst, heightConst, "end" + heightConst + "Min", leftConst, "end" + heightConst + "Max"],
+ top: [topConst, bottomConst, leftConst, rightConst, heightConst, widthConst, "end" + widthConst + "Min", topConst, "end" + widthConst + "Max"],
+ bottom: [bottomConst, topConst, leftConst, rightConst, heightConst, widthConst, "end" + widthConst + "Min", topConst, "end" + widthConst + "Max"]
+ };
+ // property names
+ pn = dynProperties[dir];
+
+ // .4 <= pConst <= .9
+ if(typeof depth != "undefined"){
+ depth = Math.max(0, Math.min(1, depth)) / 2;
+ pConst = .4 + (.5 - depth);
+ }else{
+ pConst = Math.min(.9, Math.max(.4, dims[pn[5].toLowerCase()] / dims[pn[4].toLowerCase()]));
+ }
+ var p0 = props[0];
+ for(var i = 4; i < 6; i++){
+ if(axis == "center" || axis == "cube"){ // find a better name for "cube"
+ dims["end" + pn[i] + "Min"] = dims[pn[i].toLowerCase()] * pConst;
+ dims["end" + pn[i] + "Max"] = dims[pn[i].toLowerCase()] / pConst;
+ }else if(axis == "shortside"){
+ dims["end" + pn[i] + "Min"] = dims[pn[i].toLowerCase()];
+ dims["end" + pn[i] + "Max"] = dims[pn[i].toLowerCase()] / pConst;
+ }else if(axis == "longside"){
+ dims["end" + pn[i] + "Min"] = dims[pn[i].toLowerCase()] * pConst;
+ dims["end" + pn[i] + "Max"] = dims[pn[i].toLowerCase()];
+ }
+ }
+ if(axis == "center"){
+ p0[pn[2].toLowerCase()] = dims[pn[2].toLowerCase()] - (dims[pn[8]] - dims[pn[6]]) / 4;
+ }else if(axis == "shortside"){
+ p0[pn[2].toLowerCase()] = dims[pn[2].toLowerCase()] - (dims[pn[8]] - dims[pn[6]]) / 2;
+ }
+
+ staticProps[pn[5].toLowerCase()] = dims[pn[5].toLowerCase()] + "px";
+ staticProps[pn[4].toLowerCase()] = "0";
+ staticProps[borderConst + pn[1] + widthConst] = dims[pn[4].toLowerCase()] + "px";
+ staticProps[borderConst + pn[1] + "Color"] = bgColor;
+
+ p0[borderConst + pn[1] + widthConst] = 0;
+ p0[borderConst + pn[1] + "Color"] = darkColor;
+ p0[borderConst + pn[2] + widthConst] = p0[borderConst + pn[3] + widthConst] = axis != "cube"
+ ? (dims["end" + pn[5] + "Max"] - dims["end" + pn[5] + "Min"]) / 2
+ : dims[pn[6]] / 2
+ ;
+ p0[pn[7].toLowerCase()] = dims[pn[7].toLowerCase()] + dims[pn[4].toLowerCase()] / 2 + (args.shift || 0);
+ p0[pn[5].toLowerCase()] = dims[pn[6]];
+
+ var p1 = props[1];
+ p1[borderConst + pn[0] + "Color"] = { start: lightColor, end: endColor };
+ p1[borderConst + pn[0] + widthConst] = dims[pn[4].toLowerCase()];
+ p1[borderConst + pn[2] + widthConst] = 0;
+ p1[borderConst + pn[3] + widthConst] = 0;
+ p1[pn[5].toLowerCase()] = { start: dims[pn[6]], end: dims[pn[5].toLowerCase()] };
+
+ dojo.mixin(hs, staticProps);
+ dojo.style(helperNode, hs);
+ dojo.body().appendChild(helperNode);
+
+ var finalize = function(){
+// helperNode.parentNode.removeChild(helperNode);
+ dojo.destroy(helperNode);
+ // fixes a flicker when the animation ends
+ s.backgroundColor = endColor;
+ s.visibility = "visible";
+ };
+ if(whichAnim == "last"){
+ for(i in p0){
+ p0[i] = { start: p0[i] };
+ }
+ p0[borderConst + pn[1] + "Color"] = { start: darkColor, end: endColor };
+ p1 = p0;
+ }
+ if(!whichAnim || whichAnim == "first"){
+ anims.push(dojo.animateProperty({
+ node: helperNode,
+ duration: duration,
+ properties: p0
+ }));
+ }
+ if(!whichAnim || whichAnim == "last"){
+ anims.push(dojo.animateProperty({
+ node: helperNode,
+ duration: duration,
+ properties: p1,
+ onEnd: finalize
+ }));
+ }
+
+ // hide the original node
+ dojo.connect(anims[0], "play", function(){
+ helperNode.style.visibility = "visible";
+ s.visibility = "hidden";
+ });
+
+ return dojo.fx.chain(anims); // dojo.Animation
+
+ }
+
+ dojox.fx.flipCube = function(/*Object*/ args){
+ // summary: An extension to `dojox.fx.flip` providing a more 3d-like rotation
+ //
+ // description:
+ // An extension to `dojox.fx.flip` providing a more 3d-like rotation.
+ // Behaves the same as `dojox.fx.flip`, using the same attributes and
+ // other standard `dojo.Animation` properties.
+ //
+ // example:
+ // See `dojox.fx.flip`
+ var anims = [],
+ mb = dojo.marginBox(args.node),
+ shiftX = mb.w / 2,
+ shiftY = mb.h / 2,
+ dims = {
+ top: {
+ pName: "height",
+ args:[
+ {
+ whichAnim: "first",
+ dir: "top",
+ shift: -shiftY
+ },
+ {
+ whichAnim: "last",
+ dir: "bottom",
+ shift: shiftY
+ }
+ ]
+ },
+ right: {
+ pName: "width",
+ args:[
+ {
+ whichAnim: "first",
+ dir: "right",
+ shift: shiftX
+ },
+ {
+ whichAnim: "last",
+ dir: "left",
+ shift: -shiftX
+ }
+ ]
+ },
+ bottom: {
+ pName: "height",
+ args:[
+ {
+ whichAnim: "first",
+ dir: "bottom",
+ shift: shiftY
+ },
+ {
+ whichAnim: "last",
+ dir: "top",
+ shift: -shiftY
+ }
+ ]
+ },
+ left: {
+ pName: "width",
+ args:[
+ {
+ whichAnim: "first",
+ dir: "left",
+ shift: -shiftX
+ },
+ {
+ whichAnim: "last",
+ dir: "right",
+ shift: shiftX
+ }
+ ]
+ }
+ }
+ ;
+ var d = dims[args.dir || "left"],
+ p = d.args
+ ;
+ args.duration = args.duration ? args.duration * 2 : 500;
+ args.depth = .8;
+ args.axis = "cube";
+ for(var i = p.length - 1; i >= 0; i--){
+ dojo.mixin(args, p[i]);
+ anims.push(dojox.fx.flip(args));
+ }
+ return dojo.fx.combine(anims);
+ };
+
+ dojox.fx.flipPage = function(/*Object*/ args){
+ // summary: An extension to `dojox.fx.flip` providing a page flip like animation.
+ //
+ // description:
+ // An extension to `dojox.fx.flip` providing a page flip effect.
+ // Behaves the same as `dojox.fx.flip`, using the same attributes and
+ // other standard `dojo.Animation` properties.
+ //
+ // example:
+ // See `dojox.fx.flip`
+ var n = args.node,
+ coords = dojo.coords(n, true),
+ x = coords.x,
+ y = coords.y,
+ w = coords.w,
+ h = coords.h,
+ bgColor = dojo.style(n, "backgroundColor"),
+ lightColor = args.lightColor || "#dddddd",
+ darkColor = args.darkColor,
+ helperNode = dojo.create("div"),
+ anims = [],
+ hn = [],
+ dir = args.dir || "right",
+ pn = {
+ left: ["left", "right", "x", "w"],
+ top: ["top", "bottom", "y", "h"],
+ right: ["left", "left", "x", "w"],
+ bottom: ["top", "top", "y", "h"]
+ },
+ shiftMultiplier = {
+ right: [1, -1],
+ left: [-1, 1],
+ top: [-1, 1],
+ bottom: [1, -1]
+ }
+ ;
+ dojo.style(helperNode, {
+ position: "absolute",
+ width : w + "px",
+ height : h + "px",
+ top : y + "px",
+ left : x + "px",
+ visibility: "hidden"
+ });
+ var hs = [];
+ for(var i = 0; i < 2; i++){
+ var r = i % 2,
+ d = r ? pn[dir][1] : dir,
+ wa = r ? "last" : "first",
+ endColor = r ? bgColor : lightColor,
+ startColor = r ? endColor : args.startColor || n.style.backgroundColor
+ ;
+ hn[i] = dojo.clone(helperNode);
+ var finalize = function(x){
+ return function(){
+ dojo.destroy(hn[x]);
+ }
+ }(i)
+ ;
+ dojo.body().appendChild(hn[i]);
+ hs[i] = {
+ backgroundColor: r ? startColor : bgColor
+ };
+
+ hs[i][pn[dir][0]] = coords[pn[dir][2]] + shiftMultiplier[dir][0] * i * coords[pn[dir][3]] + "px";
+ dojo.style(hn[i], hs[i]);
+ anims.push(dojox.fx.flip({
+ node: hn[i],
+ dir: d,
+ axis: "shortside",
+ depth: args.depth,
+ duration: args.duration / 2,
+ shift: shiftMultiplier[dir][i] * coords[pn[dir][3]] / 2,
+ darkColor: darkColor,
+ lightColor: lightColor,
+ whichAnim: wa,
+ endColor: endColor
+ }));
+ dojo.connect(anims[i], "onEnd", finalize);
+ }
+ return dojo.fx.chain(anims);
+ };
+
+
+ dojox.fx.flipGrid = function(/*Object*/ args){
+ // summary: An extension to `dojox.fx.flip` providing a decomposition in rows * cols flipping elements
+ //
+ // description:
+ // An extension to `dojox.fx.flip` providing a page flip effect.
+ // Behaves the same as `dojox.fx.flip`, using the same attributes and
+ // other standard `dojo.Animation` properties and
+ //
+ // cols: Integer columns
+ // rows: Integer rows
+ //
+ // duration: the single flip duration
+ //
+ // example:
+ // See `dojox.fx.flip`
+ var rows = args.rows || 4,
+ cols = args.cols || 4,
+ anims = [],
+ helperNode = dojo.create("div"),
+ n = args.node,
+ coords = dojo.coords(n, true),
+ x = coords.x,
+ y = coords.y,
+ nw = coords.w,
+ nh = coords.h,
+ w = coords.w / cols,
+ h = coords.h / rows,
+ cAnims = []
+ ;
+ dojo.style(helperNode, {
+ position: "absolute",
+ width: w + "px",
+ height: h + "px",
+ backgroundColor: dojo.style(n, "backgroundColor")
+ });
+ for(var i = 0; i < rows; i++){
+ var r = i % 2,
+ d = r ? "right" : "left",
+ signum = r ? 1 : -1
+ ;
+ // cloning
+ var cn = dojo.clone(n);
+ dojo.style(cn, {
+ position: "absolute",
+ width: nw + "px",
+ height: nh + "px",
+ top: y + "px",
+ left: x + "px",
+ clip: "rect(" + i * h + "px," + nw + "px," + nh + "px,0)"
+ });
+ dojo.body().appendChild(cn);
+ anims[i] = [];
+ for(var j = 0; j < cols; j++){
+ var hn = dojo.clone(helperNode),
+ l = r ? j : cols - (j + 1)
+ ;
+ var adjustClip = function(xn, yCounter, xCounter){
+ return function(){
+ if(!(yCounter % 2)){
+ dojo.style(xn, {
+ clip: "rect(" + yCounter * h + "px," + (nw - (xCounter + 1) * w ) + "px," + ((yCounter + 1) * h) + "px,0px)"
+ });
+ }else{
+ dojo.style(xn, {
+ clip: "rect(" + yCounter * h + "px," + nw + "px," + ((yCounter + 1) * h) + "px," + ((xCounter + 1) * w) + "px)"
+ });
+ }
+ }
+ }(cn, i, j);
+ dojo.body().appendChild(hn);
+ dojo.style(hn, {
+ left: x + l * w + "px",
+ top: y + i * h + "px",
+ visibility: "hidden"
+ });
+ var a = dojox.fx.flipPage({
+ node: hn,
+ dir: d,
+ duration: args.duration || 900,
+ shift: signum * w/2,
+ depth: .2,
+ darkColor: args.darkColor,
+ lightColor: args.lightColor,
+ startColor: args.startColor || args.node.style.backgroundColor
+ }),
+ removeHelper = function(xn){
+ return function(){
+ dojo.destroy(xn);
+ }
+ }(hn)
+ ;
+ dojo.connect(a, "play", this, adjustClip);
+ dojo.connect(a, "play", this, removeHelper);
+ anims[i].push(a);
+ }
+ cAnims.push(dojo.fx.chain(anims[i]));
+
+ }
+ dojo.connect(cAnims[0], "play", function(){
+ dojo.style(n, {visibility: "hidden"});
+ });
+ return dojo.fx.combine(cAnims);
+ };
+
+}
+
+if(!dojo._hasResource["dojox.mobile.compat"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.compat"] = true;
+dojo.provide("dojox.mobile.compat");
+
+
+
+
+
+// summary:
+// CSS3 compatibility module
+// description:
+// This module provides support for some of the CSS3 features to dojox.mobile
+// for non-CSS3 browsers, such as IE or Firefox.
+// If you load this module, it directly replaces some of the methods of
+// dojox.mobile instead of subclassing. This way, html pages remains the same
+// regardless of whether this compatibility module is used or not.
+// Recommended usage is as follows. the code below loads dojox.mobile.compat
+// only when isWebKit is true.
+//
+// dojo.require("dojox.mobile");
+//
+//
+// This module also loads compatibility CSS files, which has -compat.css
+// suffix. You can use either the <link> tag or @import to load theme
+// CSS files. Then, this module searches for the loaded CSS files and loads
+// compatibility CSS files. For example, if you load iphone.css in a page,
+// this module automatically loads iphone-compat.css.
+// If you explicitly load iphone-compat.css with <link> or @import,
+// this module will not load the already loaded file.
+
+if(!dojo.isWebKit){
+
+dojo.extend(dojox.mobile.View, {
+ _doTransition: function(fromNode, toNode, transition, dir){
+ var anim;
+ this.wakeUp(toNode);
+ if(!transition || transition == "none"){
+ toNode.style.display = "";
+ fromNode.style.display = "none";
+ toNode.style.left = "0px";
+ this.invokeCallback();
+ }else if(transition == "slide"){
+ var w = fromNode.offsetWidth;
+ var s1 = dojo.fx.slideTo({
+ node: fromNode,
+ duration: 400,
+ left: -w*dir,
+ top: fromNode.offsetTop
+ });
+ var s2 = dojo.fx.slideTo({
+ node: toNode,
+ duration: 400,
+ left: 0
+ });
+ toNode.style.position = "absolute";
+ toNode.style.left = w*dir + "px";
+ toNode.style.display = "";
+ anim = dojo.fx.combine([s1,s2]);
+ dojo.connect(anim, "onEnd", this, function(){
+ fromNode.style.display = "none";
+ toNode.style.position = "relative";
+ this.invokeCallback();
+ });
+ anim.play();
+ }else if(transition == "flip"){
+ anim = dojox.fx.flip({
+ node: fromNode,
+ dir: "right",
+ depth: 0.5,
+ duration: 400
+ });
+ toNode.style.position = "absolute";
+ toNode.style.left = "0px";
+ dojo.connect(anim, "onEnd", this, function(){
+ fromNode.style.display = "none";
+ toNode.style.position = "relative";
+ toNode.style.display = "";
+ this.invokeCallback();
+ });
+ anim.play();
+ }else if(transition == "fade"){
+ anim = dojo.fx.chain([
+ dojo.fadeOut({
+ node: fromNode,
+ duration: 600
+ }),
+ dojo.fadeIn({
+ node: toNode,
+ duration: 600
+ })
+ ]);
+ toNode.style.position = "absolute";
+ toNode.style.left = "0px";
+ toNode.style.display = "";
+ dojo.style(toNode, "opacity", 0);
+ dojo.connect(anim, "onEnd", this, function(){
+ fromNode.style.display = "none";
+ toNode.style.position = "relative";
+ dojo.style(fromNode, "opacity", 1);
+ this.invokeCallback();
+ });
+ anim.play();
+ }
+ },
+
+ wakeUp: function(node){
+ // summary:
+ // Function to force IE to redraw a node since its layout code tends to misrender
+ // in partial draws.
+ // node:
+ // The node to forcibly redraw.
+ // tags:
+ // public
+ if(dojo.isIE && !node._wokeup){
+ node._wokeup = true;
+ var disp = node.style.display;
+ node.style.display = "";
+ var nodes = node.getElementsByTagName("*");
+ for(var i = 0, len = nodes.length; i < len; i++){
+ var val = nodes[i].style.display;
+ nodes[i].style.display = "none";
+ nodes[i].style.display = "";
+ nodes[i].style.display = val;
+ }
+ node.style.display = disp;
+ }
+ }
+});
+
+dojo.extend(dojox.mobile.Switch, {
+ buildRendering: function(){
+ // summary:
+ // Function to simulate the mobile device style switches on
+ // browsers such as IE and FireFox.
+ // tags:
+ // protected
+ this.domNode = this.srcNodeRef || dojo.doc.createElement("DIV");
+ this.domNode.className = "mblSwitch";
+ this.domNode.innerHTML =
+ '<div class="mblSwitchInner">'
+ + '<div class="mblSwitchBg mblSwitchBgLeft">'
+ + '<div class="mblSwitchCorner mblSwitchCorner1T"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner2T"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner3T"></div>'
+ + '<div class="mblSwitchText mblSwitchTextLeft">'+this.leftLabel+'</div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner1B"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner2B"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner3B"></div>'
+ + '</div>'
+ + '<div class="mblSwitchBg mblSwitchBgRight">'
+ + '<div class="mblSwitchCorner mblSwitchCorner1T"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner2T"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner3T"></div>'
+ + '<div class="mblSwitchText mblSwitchTextRight">'+this.rightLabel+'</div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner1B"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner2B"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner3B"></div>'
+ + '</div>'
+ + '<div class="mblSwitchKnobContainer">'
+ + '<div class="mblSwitchCorner mblSwitchCorner1T"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner2T"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner3T"></div>'
+ + '<div class="mblSwitchKnob"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner1B"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner2B"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner3B"></div>'
+ + '</div>'
+ + '</div>';
+ var n = this.inner = this.domNode.firstChild;
+ this.left = n.childNodes[0];
+ this.right = n.childNodes[1];
+ this.knob = n.childNodes[2];
+
+ dojo.addClass(this.domNode, (this.value == "on") ? "mblSwitchOn" : "mblSwitchOff");
+ this[this.value == "off" ? "left" : "right"].style.display = "none";
+ },
+
+ _changeState: function(/*String*/state){
+ // summary:
+ // Function to toggle the switch state on the switch
+ // state:
+ // Thhe state to toggle, switch 'on' or 'off'
+ // tags:
+ // private
+ if(!this.inner.parentNode || !this.inner.parentNode.tagName){
+ dojo.addClass(this.domNode, (state == "on") ? "mblSwitchOn" : "mblSwitchOff");
+ return;
+ }
+ var pos;
+ if(this.inner.offsetLeft == 0){ // currently ON
+ if(state == "on"){ return; }
+ pos = -53;
+ }else{ // currently OFF
+ if(state == "off"){ return; }
+ pos = 0;
+ }
+
+ var a = dojo.fx.slideTo({
+ node: this.inner,
+ duration: 500,
+ left: pos
+ });
+ var _this = this;
+ dojo.connect(a, "onEnd", function(){
+ _this[state == "off" ? "left" : "right"].style.display = "none";
+ });
+ a.play();
+ }
+});
+
+if(dojo.isIE || dojo.isBB){
+
+dojo.extend(dojox.mobile.RoundRect, {
+ buildRendering: function(){
+ // summary:
+ // Function to simulate the borderRadius appearance on IE, since
+ // IE does not support this CSS style.
+ // tags:
+ // protected
+ dojox.mobile.createRoundRect(this);
+ this.domNode.className = "mblRoundRect";
+ }
+});
+
+dojox.mobile.RoundRectList._addChild = dojox.mobile.RoundRectList.prototype.addChild;
+dojo.extend(dojox.mobile.RoundRectList, {
+ buildRendering: function(){
+ // summary:
+ // Function to simulate the borderRadius appearance on IE, since
+ // IE does not support this CSS style.
+ // tags:
+ // protected
+ dojox.mobile.createRoundRect(this, true);
+ this.domNode.className = "mblRoundRectList";
+ },
+
+ postCreate: function(){
+ this.redrawBorders();
+ },
+
+ addChild: function(widget){
+ dojox.mobile.RoundRectList._addChild.apply(this, arguments);
+ this.redrawBorders();
+ if(dojox.mobile.applyPngFilter){
+ dojox.mobile.applyPngFilter(widget.domNode);
+ }
+ },
+
+ redrawBorders: function(){
+ // summary:
+ // Function to adjust the creation of RoundRectLists on IE.
+ // Removed undesired styles.
+ // tags:
+ // public
+
+ // Remove a border of the last ListItem.
+ // This is for browsers that do not support the last-child CSS pseudo-class.
+
+ var lastChildFound = false;
+ for(var i = this.containerNode.childNodes.length - 1; i >= 0; i--){
+ var c = this.containerNode.childNodes[i];
+ if(c.tagName == "LI"){
+ c.style.borderBottomStyle = lastChildFound ? "solid" : "none";
+ lastChildFound = true;
+ }
+ }
+ }
+});
+
+dojo.extend(dojox.mobile.EdgeToEdgeList, {
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("UL");
+ this.domNode.className = "mblEdgeToEdgeList";
+ }
+});
+
+if(dojox.mobile.IconContainer){
+
+dojox.mobile.IconContainer._addChild = dojox.mobile.IconContainer.prototype.addChild;
+dojo.extend(dojox.mobile.IconContainer, {
+ addChild: function(widget){
+ dojox.mobile.IconContainer._addChild.apply(this, arguments);
+ if(dojox.mobile.applyPngFilter){
+ dojox.mobile.applyPngFilter(widget.domNode);
+ }
+ }
+});
+
+} // if(dojox.mobile.IconContainer)
+
+dojo.mixin(dojox.mobile, {
+ createRoundRect: function(_this, isList){
+ // summary:
+ // Function to adjust the creation of rounded rectangles on IE.
+ // Deals with IE's lack of borderRadius support
+ // tags:
+ // public
+ var i;
+ _this.domNode = dojo.doc.createElement("DIV");
+ _this.domNode.style.padding = "0px";
+ _this.domNode.style.backgroundColor = "transparent";
+ _this.domNode.style.borderStyle = "none";
+ _this.containerNode = dojo.doc.createElement(isList?"UL":"DIV");
+ _this.containerNode.className = "mblRoundRectContainer";
+ if(_this.srcNodeRef){
+ _this.srcNodeRef.parentNode.replaceChild(_this.domNode, _this.srcNodeRef);
+ for(i = 0, len = _this.srcNodeRef.childNodes.length; i < len; i++){
+ _this.containerNode.appendChild(_this.srcNodeRef.removeChild(_this.srcNodeRef.firstChild));
+ }
+ _this.srcNodeRef = null;
+ }
+ _this.domNode.appendChild(_this.containerNode);
+
+ for(i = 0; i <= 5; i++){
+ var top = dojo.create("DIV");
+ top.className = "mblRoundCorner mblRoundCorner"+i+"T";
+ _this.domNode.insertBefore(top, _this.containerNode);
+
+ var bottom = dojo.create("DIV");
+ bottom.className = "mblRoundCorner mblRoundCorner"+i+"B";
+ _this.domNode.appendChild(bottom);
+ }
+ }
+});
+
+if(dojox.mobile.ScrollableView){
+
+dojo.extend(dojox.mobile.ScrollableView, {
+ postCreate: function(){
+ // On IE, margin-top of the first child does not seem to be effective,
+ // probably because padding-top is specified for containerNode
+ // to make room for a fixed header. This dummy node is a workaround for that.
+ var dummy = dojo.create("DIV", {className:"mblDummyForIE", innerHTML:"&nbsp;"}, this.containerNode, "first");
+ dojo.style(dummy, {
+ position: "relative",
+ marginBottom: "-2px",
+ fontSize: "1px"
+ });
+ }
+});
+
+} // if(dojox.mobile.ScrollableView)
+
+} // if(dojo.isIE)
+
+if(dojo.isIE <= 6){
+ dojox.mobile.applyPngFilter = function(root){
+ root = root || dojo.body();
+ var nodes = root.getElementsByTagName("IMG");
+ var blank = dojo.moduleUrl("dojo", "resources/blank.gif");
+ for(var i = 0, len = nodes.length; i < len; i++){
+ var img = nodes[i];
+ var w = img.offsetWidth;
+ var h = img.offsetHeight;
+ if(w === 0 || h === 0){
+ // The reason why the image has no width/height may be because
+ // display is "none". If that is the case, let's change the
+ // display to "" temporarily and see if the image returns them.
+ if(dojo.style(img, "display") != "none"){ continue; }
+ img.style.display = "";
+ w = img.offsetWidth;
+ h = img.offsetHeight;
+ img.style.display = "none";
+ if(w === 0 || h === 0){ continue; }
+ }
+ var src = img.src;
+ if(src.indexOf("resources/blank.gif") != -1){ continue; }
+ img.src = blank;
+ img.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src+"')";
+ img.style.width = w + "px";
+ img.style.height = h + "px";
+ }
+ };
+} // if(dojo.isIE <= 6)
+
+dojox.mobile.loadCss = function(/*String|Array*/files){
+ // summary:
+ // Function to load and register CSS files with the page
+ // files: String|Array
+ // The CSS files to load and register with the page.
+ // tags:
+ // private
+ if(!dojo.global._loadedCss){
+ var obj = {};
+ dojo.forEach(dojox.mobile.getCssPaths(), function(path){
+ obj[path] = true;
+ });
+ dojo.global._loadedCss = obj;
+ }
+ if(!dojo.isArray(files)){ files = [files]; }
+ for(var i = 0; i < files.length; i++){
+ var file = files[i];
+ if(!dojo.global._loadedCss[file]){
+ dojo.global._loadedCss[file] = true;
+ if(dojo.doc.createStyleSheet){
+ // for some reason, IE hangs when you try to load
+ // multiple css files almost at once.
+ setTimeout(function(file){
+ return function(){
+ dojo.doc.createStyleSheet(file);
+ };
+ }(file), 0);
+ }else{
+ var link = dojo.doc.createElement("link");
+ link.href = file;
+ link.type = "text/css";
+ link.rel = "stylesheet";
+ var head = dojo.doc.getElementsByTagName('head')[0];
+ head.appendChild(link);
+ }
+ }
+ }
+};
+
+dojox.mobile.getCssPaths = function(){
+ var paths = [];
+ var i, j;
+
+ // find @import
+ var s = dojo.doc.styleSheets;
+ for(i = 0; i < s.length; i++){
+ var r = s[i].cssRules || s[i].imports;
+ if(!r){ continue; }
+ for(j = 0; j < r.length; j++){
+ if(r[j].href){
+ paths.push(r[j].href);
+ }
+ }
+ }
+
+ // find <link>
+ var elems = dojo.doc.getElementsByTagName("link");
+ for(i = 0, len = elems.length; i < len; i++){
+ if(elems[i].href){
+ paths.push(elems[i].href);
+ }
+ }
+ return paths;
+};
+
+dojox.mobile.loadCompatPattern = /\/themes\/(domButtons|buttons|iphone|android).*\.css$/;
+
+dojox.mobile.loadCompatCssFiles = function(){
+ // summary:
+ // Function to perform page-level adjustments on browsers such as
+ // IE and firefox. It loads compat specific css files into the
+ // page header.
+ var paths = dojox.mobile.getCssPaths();
+ for(var i = 0; i < paths.length; i++){
+ var href = paths[i];
+ if(href.match(dojox.mobile.loadCompatPattern) && href.indexOf("-compat.css") == -1){
+ var compatCss = href.substring(0, href.length-4)+"-compat.css";
+ dojox.mobile.loadCss(compatCss);
+ }
+ }
+};
+
+dojox.mobile.hideAddressBar = function(){
+ // nop
+};
+
+dojo.addOnLoad(function(){
+ if(dojo.config["mblLoadCompatCssFiles"] !== false){
+ dojox.mobile.loadCompatCssFiles();
+ }
+ if(dojox.mobile.applyPngFilter){
+ dojox.mobile.applyPngFilter();
+ }
+});
+
+} // end of if(!dojo.isWebKit){
+
+}
+
diff --git a/js/dojo-1.6/dojox/mobile/compat.xd.js b/js/dojo-1.6/dojox/mobile/compat.xd.js
new file mode 100644
index 0000000..ed23629
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/compat.xd.js
@@ -0,0 +1,14 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+/*
+ This is an optimized version of Dojo, built for deployment and not for
+ development. To get sources and documentation, please visit:
+
+ http://dojotoolkit.org
+*/
+
+dojo._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojo.uacss"],["provide","dijit._base.sniff"],["provide","dojo.fx.Toggler"],["provide","dojo.fx"],["provide","dojox.fx.flip"],["provide","dojox.mobile.compat"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojo.uacss"]){_4._hasResource["dojo.uacss"]=true;_4.provide("dojo.uacss");(function(){var d=_4,_7=d.doc.documentElement,ie=d.isIE,_8=d.isOpera,_9=Math.floor,ff=d.isFF,_a=d.boxModel.replace(/-/,""),_b={dj_ie:ie,dj_ie6:_9(ie)==6,dj_ie7:_9(ie)==7,dj_ie8:_9(ie)==8,dj_ie9:_9(ie)==9,dj_quirks:d.isQuirks,dj_iequirks:ie&&d.isQuirks,dj_opera:_8,dj_khtml:d.isKhtml,dj_webkit:d.isWebKit,dj_safari:d.isSafari,dj_chrome:d.isChrome,dj_gecko:d.isMozilla,dj_ff3:_9(ff)==3};_b["dj_"+_a]=true;var _c="";for(var _d in _b){if(_b[_d]){_c+=_d+" ";}}_7.className=d.trim(_7.className+" "+_c);_4._loaders.unshift(function(){if(!_4._isBodyLtr()){var _e="dj_rtl dijitRtl "+_c.replace(/ /g,"-rtl ");_7.className=d.trim(_7.className+" "+_e);}});})();}if(!_4._hasResource["dijit._base.sniff"]){_4._hasResource["dijit._base.sniff"]=true;_4.provide("dijit._base.sniff");}if(!_4._hasResource["dojo.fx.Toggler"]){_4._hasResource["dojo.fx.Toggler"]=true;_4.provide("dojo.fx.Toggler");_4.declare("dojo.fx.Toggler",null,{node:null,showFunc:_4.fadeIn,hideFunc:_4.fadeOut,showDuration:200,hideDuration:200,constructor:function(_f){var _10=this;_4.mixin(_10,_f);_10.node=_f.node;_10._showArgs=_4.mixin({},_f);_10._showArgs.node=_10.node;_10._showArgs.duration=_10.showDuration;_10.showAnim=_10.showFunc(_10._showArgs);_10._hideArgs=_4.mixin({},_f);_10._hideArgs.node=_10.node;_10._hideArgs.duration=_10.hideDuration;_10.hideAnim=_10.hideFunc(_10._hideArgs);_4.connect(_10.showAnim,"beforeBegin",_4.hitch(_10.hideAnim,"stop",true));_4.connect(_10.hideAnim,"beforeBegin",_4.hitch(_10.showAnim,"stop",true));},show:function(_11){return this.showAnim.play(_11||0);},hide:function(_12){return this.hideAnim.play(_12||0);}});}if(!_4._hasResource["dojo.fx"]){_4._hasResource["dojo.fx"]=true;_4.provide("dojo.fx");(function(){var d=_4,_13={_fire:function(evt,_14){if(this[evt]){this[evt].apply(this,_14||[]);}return this;}};var _15=function(_16){this._index=-1;this._animations=_16||[];this._current=this._onAnimateCtx=this._onEndCtx=null;this.duration=0;d.forEach(this._animations,function(a){this.duration+=a.duration;if(a.delay){this.duration+=a.delay;}},this);};d.extend(_15,{_onAnimate:function(){this._fire("onAnimate",arguments);},_onEnd:function(){d.disconnect(this._onAnimateCtx);d.disconnect(this._onEndCtx);this._onAnimateCtx=this._onEndCtx=null;if(this._index+1==this._animations.length){this._fire("onEnd");}else{this._current=this._animations[++this._index];this._onAnimateCtx=d.connect(this._current,"onAnimate",this,"_onAnimate");this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd");this._current.play(0,true);}},play:function(_17,_18){if(!this._current){this._current=this._animations[this._index=0];}if(!_18&&this._current.status()=="playing"){return this;}var _19=d.connect(this._current,"beforeBegin",this,function(){this._fire("beforeBegin");}),_1a=d.connect(this._current,"onBegin",this,function(arg){this._fire("onBegin",arguments);}),_1b=d.connect(this._current,"onPlay",this,function(arg){this._fire("onPlay",arguments);d.disconnect(_19);d.disconnect(_1a);d.disconnect(_1b);});if(this._onAnimateCtx){d.disconnect(this._onAnimateCtx);}this._onAnimateCtx=d.connect(this._current,"onAnimate",this,"_onAnimate");if(this._onEndCtx){d.disconnect(this._onEndCtx);}this._onEndCtx=d.connect(this._current,"onEnd",this,"_onEnd");this._current.play.apply(this._current,arguments);return this;},pause:function(){if(this._current){var e=d.connect(this._current,"onPause",this,function(arg){this._fire("onPause",arguments);d.disconnect(e);});this._current.pause();}return this;},gotoPercent:function(_1c,_1d){this.pause();var _1e=this.duration*_1c;this._current=null;d.some(this._animations,function(a){if(a.duration<=_1e){this._current=a;return true;}_1e-=a.duration;return false;});if(this._current){this._current.gotoPercent(_1e/this._current.duration,_1d);}return this;},stop:function(_1f){if(this._current){if(_1f){for(;this._index+1<this._animations.length;++this._index){this._animations[this._index].stop(true);}this._current=this._animations[this._index];}var e=d.connect(this._current,"onStop",this,function(arg){this._fire("onStop",arguments);d.disconnect(e);});this._current.stop();}return this;},status:function(){return this._current?this._current.status():"stopped";},destroy:function(){if(this._onAnimateCtx){d.disconnect(this._onAnimateCtx);}if(this._onEndCtx){d.disconnect(this._onEndCtx);}}});d.extend(_15,_13);_4.fx.chain=function(_20){return new _15(_20);};var _21=function(_22){this._animations=_22||[];this._connects=[];this._finished=0;this.duration=0;d.forEach(_22,function(a){var _23=a.duration;if(a.delay){_23+=a.delay;}if(this.duration<_23){this.duration=_23;}this._connects.push(d.connect(a,"onEnd",this,"_onEnd"));},this);this._pseudoAnimation=new d.Animation({curve:[0,1],duration:this.duration});var _24=this;d.forEach(["beforeBegin","onBegin","onPlay","onAnimate","onPause","onStop","onEnd"],function(evt){_24._connects.push(d.connect(_24._pseudoAnimation,evt,function(){_24._fire(evt,arguments);}));});};d.extend(_21,{_doAction:function(_25,_26){d.forEach(this._animations,function(a){a[_25].apply(a,_26);});return this;},_onEnd:function(){if(++this._finished>this._animations.length){this._fire("onEnd");}},_call:function(_27,_28){var t=this._pseudoAnimation;t[_27].apply(t,_28);},play:function(_29,_2a){this._finished=0;this._doAction("play",arguments);this._call("play",arguments);return this;},pause:function(){this._doAction("pause",arguments);this._call("pause",arguments);return this;},gotoPercent:function(_2b,_2c){var ms=this.duration*_2b;d.forEach(this._animations,function(a){a.gotoPercent(a.duration<ms?1:(ms/a.duration),_2c);});this._call("gotoPercent",arguments);return this;},stop:function(_2d){this._doAction("stop",arguments);this._call("stop",arguments);return this;},status:function(){return this._pseudoAnimation.status();},destroy:function(){d.forEach(this._connects,_4.disconnect);}});d.extend(_21,_13);_4.fx.combine=function(_2e){return new _21(_2e);};_4.fx.wipeIn=function(_2f){var _30=_2f.node=d.byId(_2f.node),s=_30.style,o;var _31=d.animateProperty(d.mixin({properties:{height:{start:function(){o=s.overflow;s.overflow="hidden";if(s.visibility=="hidden"||s.display=="none"){s.height="1px";s.display="";s.visibility="";return 1;}else{var _32=d.style(_30,"height");return Math.max(_32,1);}},end:function(){return _30.scrollHeight;}}}},_2f));d.connect(_31,"onEnd",function(){s.height="auto";s.overflow=o;});return _31;};_4.fx.wipeOut=function(_33){var _34=_33.node=d.byId(_33.node),s=_34.style,o;var _35=d.animateProperty(d.mixin({properties:{height:{end:1}}},_33));d.connect(_35,"beforeBegin",function(){o=s.overflow;s.overflow="hidden";s.display="";});d.connect(_35,"onEnd",function(){s.overflow=o;s.height="auto";s.display="none";});return _35;};_4.fx.slideTo=function(_36){var _37=_36.node=d.byId(_36.node),top=null,_38=null;var _39=(function(n){return function(){var cs=d.getComputedStyle(n);var pos=cs.position;top=(pos=="absolute"?n.offsetTop:parseInt(cs.top)||0);_38=(pos=="absolute"?n.offsetLeft:parseInt(cs.left)||0);if(pos!="absolute"&&pos!="relative"){var ret=d.position(n,true);top=ret.y;_38=ret.x;n.style.position="absolute";n.style.top=top+"px";n.style.left=_38+"px";}};})(_37);_39();var _3a=d.animateProperty(d.mixin({properties:{top:_36.top||0,left:_36.left||0}},_36));d.connect(_3a,"beforeBegin",_3a,_39);return _3a;};})();}if(!_4._hasResource["dojox.fx.flip"]){_4._hasResource["dojox.fx.flip"]=true;_4.provide("dojox.fx.flip");_4.experimental("dojox.fx.flip");var _3b="border",_3c="Width",_3d="Height",_3e="Top",_3f="Right",_40="Left",_41="Bottom";_6.fx.flip=function(_42){var _43=_4.create("div"),_44=_42.node=_4.byId(_42.node),s=_44.style,_45=null,hs=null,pn=null,_46=_42.lightColor||"#dddddd",_47=_42.darkColor||"#555555",_48=_4.style(_44,"backgroundColor"),_49=_42.endColor||_48,_4a={},_4b=[],_4c=_42.duration?_42.duration/2:250,dir=_42.dir||"left",_4d=0.9,_4e="transparent",_4f=_42.whichAnim,_50=_42.axis||"center",_51=_42.depth;var _52=function(_53){return ((new _4.Color(_53)).toHex()==="#000000")?"#000001":_53;};if(_4.isIE<7){_49=_52(_49);_46=_52(_46);_47=_52(_47);_48=_52(_48);_4e="black";_43.style.filter="chroma(color='#000000')";}var _54=(function(n){return function(){var ret=_4.coords(n,true);_45={top:ret.y,left:ret.x,width:ret.w,height:ret.h};};})(_44);_54();hs={position:"absolute",top:_45["top"]+"px",left:_45["left"]+"px",height:"0",width:"0",zIndex:_42.zIndex||(s.zIndex||0),border:"0 solid "+_4e,fontSize:"0",visibility:"hidden"};var _55=[{},{top:_45["top"],left:_45["left"]}];var _56={left:[_40,_3f,_3e,_41,_3c,_3d,"end"+_3d+"Min",_40,"end"+_3d+"Max"],right:[_3f,_40,_3e,_41,_3c,_3d,"end"+_3d+"Min",_40,"end"+_3d+"Max"],top:[_3e,_41,_40,_3f,_3d,_3c,"end"+_3c+"Min",_3e,"end"+_3c+"Max"],bottom:[_41,_3e,_40,_3f,_3d,_3c,"end"+_3c+"Min",_3e,"end"+_3c+"Max"]};pn=_56[dir];if(typeof _51!="undefined"){_51=Math.max(0,Math.min(1,_51))/2;_4d=0.4+(0.5-_51);}else{_4d=Math.min(0.9,Math.max(0.4,_45[pn[5].toLowerCase()]/_45[pn[4].toLowerCase()]));}var p0=_55[0];for(var i=4;i<6;i++){if(_50=="center"||_50=="cube"){_45["end"+pn[i]+"Min"]=_45[pn[i].toLowerCase()]*_4d;_45["end"+pn[i]+"Max"]=_45[pn[i].toLowerCase()]/_4d;}else{if(_50=="shortside"){_45["end"+pn[i]+"Min"]=_45[pn[i].toLowerCase()];_45["end"+pn[i]+"Max"]=_45[pn[i].toLowerCase()]/_4d;}else{if(_50=="longside"){_45["end"+pn[i]+"Min"]=_45[pn[i].toLowerCase()]*_4d;_45["end"+pn[i]+"Max"]=_45[pn[i].toLowerCase()];}}}}if(_50=="center"){p0[pn[2].toLowerCase()]=_45[pn[2].toLowerCase()]-(_45[pn[8]]-_45[pn[6]])/4;}else{if(_50=="shortside"){p0[pn[2].toLowerCase()]=_45[pn[2].toLowerCase()]-(_45[pn[8]]-_45[pn[6]])/2;}}_4a[pn[5].toLowerCase()]=_45[pn[5].toLowerCase()]+"px";_4a[pn[4].toLowerCase()]="0";_4a[_3b+pn[1]+_3c]=_45[pn[4].toLowerCase()]+"px";_4a[_3b+pn[1]+"Color"]=_48;p0[_3b+pn[1]+_3c]=0;p0[_3b+pn[1]+"Color"]=_47;p0[_3b+pn[2]+_3c]=p0[_3b+pn[3]+_3c]=_50!="cube"?(_45["end"+pn[5]+"Max"]-_45["end"+pn[5]+"Min"])/2:_45[pn[6]]/2;p0[pn[7].toLowerCase()]=_45[pn[7].toLowerCase()]+_45[pn[4].toLowerCase()]/2+(_42.shift||0);p0[pn[5].toLowerCase()]=_45[pn[6]];var p1=_55[1];p1[_3b+pn[0]+"Color"]={start:_46,end:_49};p1[_3b+pn[0]+_3c]=_45[pn[4].toLowerCase()];p1[_3b+pn[2]+_3c]=0;p1[_3b+pn[3]+_3c]=0;p1[pn[5].toLowerCase()]={start:_45[pn[6]],end:_45[pn[5].toLowerCase()]};_4.mixin(hs,_4a);_4.style(_43,hs);_4.body().appendChild(_43);var _57=function(){_4.destroy(_43);s.backgroundColor=_49;s.visibility="visible";};if(_4f=="last"){for(i in p0){p0[i]={start:p0[i]};}p0[_3b+pn[1]+"Color"]={start:_47,end:_49};p1=p0;}if(!_4f||_4f=="first"){_4b.push(_4.animateProperty({node:_43,duration:_4c,properties:p0}));}if(!_4f||_4f=="last"){_4b.push(_4.animateProperty({node:_43,duration:_4c,properties:p1,onEnd:_57}));}_4.connect(_4b[0],"play",function(){_43.style.visibility="visible";s.visibility="hidden";});return _4.fx.chain(_4b);};_6.fx.flipCube=function(_58){var _59=[],mb=_4.marginBox(_58.node),_5a=mb.w/2,_5b=mb.h/2,_5c={top:{pName:"height",args:[{whichAnim:"first",dir:"top",shift:-_5b},{whichAnim:"last",dir:"bottom",shift:_5b}]},right:{pName:"width",args:[{whichAnim:"first",dir:"right",shift:_5a},{whichAnim:"last",dir:"left",shift:-_5a}]},bottom:{pName:"height",args:[{whichAnim:"first",dir:"bottom",shift:_5b},{whichAnim:"last",dir:"top",shift:-_5b}]},left:{pName:"width",args:[{whichAnim:"first",dir:"left",shift:-_5a},{whichAnim:"last",dir:"right",shift:_5a}]}};var d=_5c[_58.dir||"left"],p=d.args;_58.duration=_58.duration?_58.duration*2:500;_58.depth=0.8;_58.axis="cube";for(var i=p.length-1;i>=0;i--){_4.mixin(_58,p[i]);_59.push(_6.fx.flip(_58));}return _4.fx.combine(_59);};_6.fx.flipPage=function(_5d){var n=_5d.node,_5e=_4.coords(n,true),x=_5e.x,y=_5e.y,w=_5e.w,h=_5e.h,_5f=_4.style(n,"backgroundColor"),_60=_5d.lightColor||"#dddddd",_61=_5d.darkColor,_62=_4.create("div"),_63=[],hn=[],dir=_5d.dir||"right",pn={left:["left","right","x","w"],top:["top","bottom","y","h"],right:["left","left","x","w"],bottom:["top","top","y","h"]},_64={right:[1,-1],left:[-1,1],top:[-1,1],bottom:[1,-1]};_4.style(_62,{position:"absolute",width:w+"px",height:h+"px",top:y+"px",left:x+"px",visibility:"hidden"});var hs=[];for(var i=0;i<2;i++){var r=i%2,d=r?pn[dir][1]:dir,wa=r?"last":"first",_65=r?_5f:_60,_66=r?_65:_5d.startColor||n.style.backgroundColor;hn[i]=_4.clone(_62);var _67=function(x){return function(){_4.destroy(hn[x]);};}(i);_4.body().appendChild(hn[i]);hs[i]={backgroundColor:r?_66:_5f};hs[i][pn[dir][0]]=_5e[pn[dir][2]]+_64[dir][0]*i*_5e[pn[dir][3]]+"px";_4.style(hn[i],hs[i]);_63.push(_6.fx.flip({node:hn[i],dir:d,axis:"shortside",depth:_5d.depth,duration:_5d.duration/2,shift:_64[dir][i]*_5e[pn[dir][3]]/2,darkColor:_61,lightColor:_60,whichAnim:wa,endColor:_65}));_4.connect(_63[i],"onEnd",_67);}return _4.fx.chain(_63);};_6.fx.flipGrid=function(_68){var _69=_68.rows||4,_6a=_68.cols||4,_6b=[],_6c=_4.create("div"),n=_68.node,_6d=_4.coords(n,true),x=_6d.x,y=_6d.y,nw=_6d.w,nh=_6d.h,w=_6d.w/_6a,h=_6d.h/_69,_6e=[];_4.style(_6c,{position:"absolute",width:w+"px",height:h+"px",backgroundColor:_4.style(n,"backgroundColor")});for(var i=0;i<_69;i++){var r=i%2,d=r?"right":"left",_6f=r?1:-1;var cn=_4.clone(n);_4.style(cn,{position:"absolute",width:nw+"px",height:nh+"px",top:y+"px",left:x+"px",clip:"rect("+i*h+"px,"+nw+"px,"+nh+"px,0)"});_4.body().appendChild(cn);_6b[i]=[];for(var j=0;j<_6a;j++){var hn=_4.clone(_6c),l=r?j:_6a-(j+1);var _70=function(xn,_71,_72){return function(){if(!(_71%2)){_4.style(xn,{clip:"rect("+_71*h+"px,"+(nw-(_72+1)*w)+"px,"+((_71+1)*h)+"px,0px)"});}else{_4.style(xn,{clip:"rect("+_71*h+"px,"+nw+"px,"+((_71+1)*h)+"px,"+((_72+1)*w)+"px)"});}};}(cn,i,j);_4.body().appendChild(hn);_4.style(hn,{left:x+l*w+"px",top:y+i*h+"px",visibility:"hidden"});var a=_6.fx.flipPage({node:hn,dir:d,duration:_68.duration||900,shift:_6f*w/2,depth:0.2,darkColor:_68.darkColor,lightColor:_68.lightColor,startColor:_68.startColor||_68.node.style.backgroundColor}),_73=function(xn){return function(){_4.destroy(xn);};}(hn);_4.connect(a,"play",this,_70);_4.connect(a,"play",this,_73);_6b[i].push(a);}_6e.push(_4.fx.chain(_6b[i]));}_4.connect(_6e[0],"play",function(){_4.style(n,{visibility:"hidden"});});return _4.fx.combine(_6e);};}if(!_4._hasResource["dojox.mobile.compat"]){_4._hasResource["dojox.mobile.compat"]=true;_4.provide("dojox.mobile.compat");if(!_4.isWebKit){_4.extend(_6.mobile.View,{_doTransition:function(_74,_75,_76,dir){var _77;this.wakeUp(_75);if(!_76||_76=="none"){_75.style.display="";_74.style.display="none";_75.style.left="0px";this.invokeCallback();}else{if(_76=="slide"){var w=_74.offsetWidth;var s1=_4.fx.slideTo({node:_74,duration:400,left:-w*dir,top:_74.offsetTop});var s2=_4.fx.slideTo({node:_75,duration:400,left:0});_75.style.position="absolute";_75.style.left=w*dir+"px";_75.style.display="";_77=_4.fx.combine([s1,s2]);_4.connect(_77,"onEnd",this,function(){_74.style.display="none";_75.style.position="relative";this.invokeCallback();});_77.play();}else{if(_76=="flip"){_77=_6.fx.flip({node:_74,dir:"right",depth:0.5,duration:400});_75.style.position="absolute";_75.style.left="0px";_4.connect(_77,"onEnd",this,function(){_74.style.display="none";_75.style.position="relative";_75.style.display="";this.invokeCallback();});_77.play();}else{if(_76=="fade"){_77=_4.fx.chain([_4.fadeOut({node:_74,duration:600}),_4.fadeIn({node:_75,duration:600})]);_75.style.position="absolute";_75.style.left="0px";_75.style.display="";_4.style(_75,"opacity",0);_4.connect(_77,"onEnd",this,function(){_74.style.display="none";_75.style.position="relative";_4.style(_74,"opacity",1);this.invokeCallback();});_77.play();}}}}},wakeUp:function(_78){if(_4.isIE&&!_78._wokeup){_78._wokeup=true;var _79=_78.style.display;_78.style.display="";var _7a=_78.getElementsByTagName("*");for(var i=0,len=_7a.length;i<len;i++){var val=_7a[i].style.display;_7a[i].style.display="none";_7a[i].style.display="";_7a[i].style.display=val;}_78.style.display=_79;}}});_4.extend(_6.mobile.Switch,{buildRendering:function(){this.domNode=this.srcNodeRef||_4.doc.createElement("DIV");this.domNode.className="mblSwitch";this.domNode.innerHTML="<div class=\"mblSwitchInner\">"+"<div class=\"mblSwitchBg mblSwitchBgLeft\">"+"<div class=\"mblSwitchCorner mblSwitchCorner1T\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner2T\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner3T\"></div>"+"<div class=\"mblSwitchText mblSwitchTextLeft\">"+this.leftLabel+"</div>"+"<div class=\"mblSwitchCorner mblSwitchCorner1B\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner2B\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner3B\"></div>"+"</div>"+"<div class=\"mblSwitchBg mblSwitchBgRight\">"+"<div class=\"mblSwitchCorner mblSwitchCorner1T\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner2T\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner3T\"></div>"+"<div class=\"mblSwitchText mblSwitchTextRight\">"+this.rightLabel+"</div>"+"<div class=\"mblSwitchCorner mblSwitchCorner1B\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner2B\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner3B\"></div>"+"</div>"+"<div class=\"mblSwitchKnobContainer\">"+"<div class=\"mblSwitchCorner mblSwitchCorner1T\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner2T\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner3T\"></div>"+"<div class=\"mblSwitchKnob\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner1B\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner2B\"></div>"+"<div class=\"mblSwitchCorner mblSwitchCorner3B\"></div>"+"</div>"+"</div>";var n=this.inner=this.domNode.firstChild;this.left=n.childNodes[0];this.right=n.childNodes[1];this.knob=n.childNodes[2];_4.addClass(this.domNode,(this.value=="on")?"mblSwitchOn":"mblSwitchOff");this[this.value=="off"?"left":"right"].style.display="none";},_changeState:function(_7b){if(!this.inner.parentNode||!this.inner.parentNode.tagName){_4.addClass(this.domNode,(_7b=="on")?"mblSwitchOn":"mblSwitchOff");return;}var pos;if(this.inner.offsetLeft==0){if(_7b=="on"){return;}pos=-53;}else{if(_7b=="off"){return;}pos=0;}var a=_4.fx.slideTo({node:this.inner,duration:500,left:pos});var _7c=this;_4.connect(a,"onEnd",function(){_7c[_7b=="off"?"left":"right"].style.display="none";});a.play();}});if(_4.isIE||_4.isBB){_4.extend(_6.mobile.RoundRect,{buildRendering:function(){_6.mobile.createRoundRect(this);this.domNode.className="mblRoundRect";}});_6.mobile.RoundRectList._addChild=_6.mobile.RoundRectList.prototype.addChild;_4.extend(_6.mobile.RoundRectList,{buildRendering:function(){_6.mobile.createRoundRect(this,true);this.domNode.className="mblRoundRectList";},postCreate:function(){this.redrawBorders();},addChild:function(_7d){_6.mobile.RoundRectList._addChild.apply(this,arguments);this.redrawBorders();if(_6.mobile.applyPngFilter){_6.mobile.applyPngFilter(_7d.domNode);}},redrawBorders:function(){var _7e=false;for(var i=this.containerNode.childNodes.length-1;i>=0;i--){var c=this.containerNode.childNodes[i];if(c.tagName=="LI"){c.style.borderBottomStyle=_7e?"solid":"none";_7e=true;}}}});_4.extend(_6.mobile.EdgeToEdgeList,{buildRendering:function(){this.domNode=this.containerNode=this.srcNodeRef||_4.doc.createElement("UL");this.domNode.className="mblEdgeToEdgeList";}});if(_6.mobile.IconContainer){_6.mobile.IconContainer._addChild=_6.mobile.IconContainer.prototype.addChild;_4.extend(_6.mobile.IconContainer,{addChild:function(_7f){_6.mobile.IconContainer._addChild.apply(this,arguments);if(_6.mobile.applyPngFilter){_6.mobile.applyPngFilter(_7f.domNode);}}});}_4.mixin(_6.mobile,{createRoundRect:function(_80,_81){var i;_80.domNode=_4.doc.createElement("DIV");_80.domNode.style.padding="0px";_80.domNode.style.backgroundColor="transparent";_80.domNode.style.borderStyle="none";_80.containerNode=_4.doc.createElement(_81?"UL":"DIV");_80.containerNode.className="mblRoundRectContainer";if(_80.srcNodeRef){_80.srcNodeRef.parentNode.replaceChild(_80.domNode,_80.srcNodeRef);for(i=0,len=_80.srcNodeRef.childNodes.length;i<len;i++){_80.containerNode.appendChild(_80.srcNodeRef.removeChild(_80.srcNodeRef.firstChild));}_80.srcNodeRef=null;}_80.domNode.appendChild(_80.containerNode);for(i=0;i<=5;i++){var top=_4.create("DIV");top.className="mblRoundCorner mblRoundCorner"+i+"T";_80.domNode.insertBefore(top,_80.containerNode);var _82=_4.create("DIV");_82.className="mblRoundCorner mblRoundCorner"+i+"B";_80.domNode.appendChild(_82);}}});if(_6.mobile.ScrollableView){_4.extend(_6.mobile.ScrollableView,{postCreate:function(){var _83=_4.create("DIV",{className:"mblDummyForIE",innerHTML:"&nbsp;"},this.containerNode,"first");_4.style(_83,{position:"relative",marginBottom:"-2px",fontSize:"1px"});}});}}if(_4.isIE<=6){_6.mobile.applyPngFilter=function(_84){_84=_84||_4.body();var _85=_84.getElementsByTagName("IMG");var _86=_4.moduleUrl("dojo","resources/blank.gif");for(var i=0,len=_85.length;i<len;i++){var img=_85[i];var w=img.offsetWidth;var h=img.offsetHeight;if(w===0||h===0){if(_4.style(img,"display")!="none"){continue;}img.style.display="";w=img.offsetWidth;h=img.offsetHeight;img.style.display="none";if(w===0||h===0){continue;}}var src=img.src;if(src.indexOf("resources/blank.gif")!=-1){continue;}img.src=_86;img.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"')";img.style.width=w+"px";img.style.height=h+"px";}};}_6.mobile.loadCss=function(_87){if(!_4.global._loadedCss){var obj={};_4.forEach(_6.mobile.getCssPaths(),function(_88){obj[_88]=true;});_4.global._loadedCss=obj;}if(!_4.isArray(_87)){_87=[_87];}for(var i=0;i<_87.length;i++){var _89=_87[i];if(!_4.global._loadedCss[_89]){_4.global._loadedCss[_89]=true;if(_4.doc.createStyleSheet){setTimeout(function(_8a){return function(){_4.doc.createStyleSheet(_8a);};}(_89),0);}else{var _8b=_4.doc.createElement("link");_8b.href=_89;_8b.type="text/css";_8b.rel="stylesheet";var _8c=_4.doc.getElementsByTagName("head")[0];_8c.appendChild(_8b);}}}};_6.mobile.getCssPaths=function(){var _8d=[];var i,j;var s=_4.doc.styleSheets;for(i=0;i<s.length;i++){var r=s[i].cssRules||s[i].imports;if(!r){continue;}for(j=0;j<r.length;j++){if(r[j].href){_8d.push(r[j].href);}}}var _8e=_4.doc.getElementsByTagName("link");for(i=0,len=_8e.length;i<len;i++){if(_8e[i].href){_8d.push(_8e[i].href);}}return _8d;};_6.mobile.loadCompatPattern=/\/themes\/(domButtons|buttons|iphone|android).*\.css$/;_6.mobile.loadCompatCssFiles=function(){var _8f=_6.mobile.getCssPaths();for(var i=0;i<_8f.length;i++){var _90=_8f[i];if(_90.match(_6.mobile.loadCompatPattern)&&_90.indexOf("-compat.css")==-1){var _91=_90.substring(0,_90.length-4)+"-compat.css";_6.mobile.loadCss(_91);}}};_6.mobile.hideAddressBar=function(){};_4.addOnLoad(function(){if(_4.config["mblLoadCompatCssFiles"]!==false){_6.mobile.loadCompatCssFiles();}if(_6.mobile.applyPngFilter){_6.mobile.applyPngFilter();}});}}}};});
diff --git a/js/dojo-1.6/dojox/mobile/compat.xd.js.uncompressed.js b/js/dojo-1.6/dojox/mobile/compat.xd.js.uncompressed.js
new file mode 100644
index 0000000..3063a83
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/compat.xd.js.uncompressed.js
@@ -0,0 +1,1595 @@
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojo.uacss"],
+["provide", "dijit._base.sniff"],
+["provide", "dojo.fx.Toggler"],
+["provide", "dojo.fx"],
+["provide", "dojox.fx.flip"],
+["provide", "dojox.mobile.compat"]],
+defineResource: function(dojo, dijit, dojox){/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+/*
+ This is an optimized version of Dojo, built for deployment and not for
+ development. To get sources and documentation, please visit:
+
+ http://dojotoolkit.org
+*/
+
+if(!dojo._hasResource["dojo.uacss"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.uacss"] = true;
+dojo.provide("dojo.uacss");
+
+
+
+(function(){
+ // summary:
+ // Applies pre-set CSS classes to the top-level HTML node, based on:
+ // - browser (ex: dj_ie)
+ // - browser version (ex: dj_ie6)
+ // - box model (ex: dj_contentBox)
+ // - text direction (ex: dijitRtl)
+ //
+ // In addition, browser, browser version, and box model are
+ // combined with an RTL flag when browser text is RTL. ex: dj_ie-rtl.
+
+ var d = dojo,
+ html = d.doc.documentElement,
+ ie = d.isIE,
+ opera = d.isOpera,
+ maj = Math.floor,
+ ff = d.isFF,
+ boxModel = d.boxModel.replace(/-/,''),
+
+ classes = {
+ dj_ie: ie,
+ dj_ie6: maj(ie) == 6,
+ dj_ie7: maj(ie) == 7,
+ dj_ie8: maj(ie) == 8,
+ dj_ie9: maj(ie) == 9,
+ dj_quirks: d.isQuirks,
+ dj_iequirks: ie && d.isQuirks,
+
+ // NOTE: Opera not supported by dijit
+ dj_opera: opera,
+
+ dj_khtml: d.isKhtml,
+
+ dj_webkit: d.isWebKit,
+ dj_safari: d.isSafari,
+ dj_chrome: d.isChrome,
+
+ dj_gecko: d.isMozilla,
+ dj_ff3: maj(ff) == 3
+ }; // no dojo unsupported browsers
+
+ classes["dj_" + boxModel] = true;
+
+ // apply browser, browser version, and box model class names
+ var classStr = "";
+ for(var clz in classes){
+ if(classes[clz]){
+ classStr += clz + " ";
+ }
+ }
+ html.className = d.trim(html.className + " " + classStr);
+
+ // If RTL mode, then add dj_rtl flag plus repeat existing classes with -rtl extension.
+ // We can't run the code below until the <body> tag has loaded (so we can check for dir=rtl).
+ // Unshift() is to run sniff code before the parser.
+ dojo._loaders.unshift(function(){
+ if(!dojo._isBodyLtr()){
+ var rtlClassStr = "dj_rtl dijitRtl " + classStr.replace(/ /g, "-rtl ")
+ html.className = d.trim(html.className + " " + rtlClassStr);
+ }
+ });
+})();
+
+}
+
+if(!dojo._hasResource["dijit._base.sniff"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.sniff"] = true;
+dojo.provide("dijit._base.sniff");
+
+
+
+
+// summary:
+// Applies pre-set CSS classes to the top-level HTML node, see
+// `dojo.uacss` for details.
+//
+// Simply doing a require on this module will
+// establish this CSS. Modified version of Morris' CSS hack.
+
+}
+
+if(!dojo._hasResource["dojo.fx.Toggler"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.fx.Toggler"] = true;
+dojo.provide("dojo.fx.Toggler");
+
+
+
+dojo.declare("dojo.fx.Toggler", null, {
+ // summary:
+ // A simple `dojo.Animation` toggler API.
+ //
+ // description:
+ // class constructor for an animation toggler. It accepts a packed
+ // set of arguments about what type of animation to use in each
+ // direction, duration, etc. All available members are mixed into
+ // these animations from the constructor (for example, `node`,
+ // `showDuration`, `hideDuration`).
+ //
+ // example:
+ // | var t = new dojo.fx.Toggler({
+ // | node: "nodeId",
+ // | showDuration: 500,
+ // | // hideDuration will default to "200"
+ // | showFunc: dojo.fx.wipeIn,
+ // | // hideFunc will default to "fadeOut"
+ // | });
+ // | t.show(100); // delay showing for 100ms
+ // | // ...time passes...
+ // | t.hide();
+
+ // node: DomNode
+ // the node to target for the showing and hiding animations
+ node: null,
+
+ // showFunc: Function
+ // The function that returns the `dojo.Animation` to show the node
+ showFunc: dojo.fadeIn,
+
+ // hideFunc: Function
+ // The function that returns the `dojo.Animation` to hide the node
+ hideFunc: dojo.fadeOut,
+
+ // showDuration:
+ // Time in milliseconds to run the show Animation
+ showDuration: 200,
+
+ // hideDuration:
+ // Time in milliseconds to run the hide Animation
+ hideDuration: 200,
+
+ // FIXME: need a policy for where the toggler should "be" the next
+ // time show/hide are called if we're stopped somewhere in the
+ // middle.
+ // FIXME: also would be nice to specify individual showArgs/hideArgs mixed into
+ // each animation individually.
+ // FIXME: also would be nice to have events from the animations exposed/bridged
+
+ /*=====
+ _showArgs: null,
+ _showAnim: null,
+
+ _hideArgs: null,
+ _hideAnim: null,
+
+ _isShowing: false,
+ _isHiding: false,
+ =====*/
+
+ constructor: function(args){
+ var _t = this;
+
+ dojo.mixin(_t, args);
+ _t.node = args.node;
+ _t._showArgs = dojo.mixin({}, args);
+ _t._showArgs.node = _t.node;
+ _t._showArgs.duration = _t.showDuration;
+ _t.showAnim = _t.showFunc(_t._showArgs);
+
+ _t._hideArgs = dojo.mixin({}, args);
+ _t._hideArgs.node = _t.node;
+ _t._hideArgs.duration = _t.hideDuration;
+ _t.hideAnim = _t.hideFunc(_t._hideArgs);
+
+ dojo.connect(_t.showAnim, "beforeBegin", dojo.hitch(_t.hideAnim, "stop", true));
+ dojo.connect(_t.hideAnim, "beforeBegin", dojo.hitch(_t.showAnim, "stop", true));
+ },
+
+ show: function(delay){
+ // summary: Toggle the node to showing
+ // delay: Integer?
+ // Ammount of time to stall playing the show animation
+ return this.showAnim.play(delay || 0);
+ },
+
+ hide: function(delay){
+ // summary: Toggle the node to hidden
+ // delay: Integer?
+ // Ammount of time to stall playing the hide animation
+ return this.hideAnim.play(delay || 0);
+ }
+});
+
+}
+
+if(!dojo._hasResource["dojo.fx"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojo.fx"] = true;
+dojo.provide("dojo.fx");
+
+
+
+
+/*=====
+dojo.fx = {
+ // summary: Effects library on top of Base animations
+};
+=====*/
+(function(){
+
+ var d = dojo,
+ _baseObj = {
+ _fire: function(evt, args){
+ if(this[evt]){
+ this[evt].apply(this, args||[]);
+ }
+ return this;
+ }
+ };
+
+ var _chain = function(animations){
+ this._index = -1;
+ this._animations = animations||[];
+ this._current = this._onAnimateCtx = this._onEndCtx = null;
+
+ this.duration = 0;
+ d.forEach(this._animations, function(a){
+ this.duration += a.duration;
+ if(a.delay){ this.duration += a.delay; }
+ }, this);
+ };
+ d.extend(_chain, {
+ _onAnimate: function(){
+ this._fire("onAnimate", arguments);
+ },
+ _onEnd: function(){
+ d.disconnect(this._onAnimateCtx);
+ d.disconnect(this._onEndCtx);
+ this._onAnimateCtx = this._onEndCtx = null;
+ if(this._index + 1 == this._animations.length){
+ this._fire("onEnd");
+ }else{
+ // switch animations
+ this._current = this._animations[++this._index];
+ this._onAnimateCtx = d.connect(this._current, "onAnimate", this, "_onAnimate");
+ this._onEndCtx = d.connect(this._current, "onEnd", this, "_onEnd");
+ this._current.play(0, true);
+ }
+ },
+ play: function(/*int?*/ delay, /*Boolean?*/ gotoStart){
+ if(!this._current){ this._current = this._animations[this._index = 0]; }
+ if(!gotoStart && this._current.status() == "playing"){ return this; }
+ var beforeBegin = d.connect(this._current, "beforeBegin", this, function(){
+ this._fire("beforeBegin");
+ }),
+ onBegin = d.connect(this._current, "onBegin", this, function(arg){
+ this._fire("onBegin", arguments);
+ }),
+ onPlay = d.connect(this._current, "onPlay", this, function(arg){
+ this._fire("onPlay", arguments);
+ d.disconnect(beforeBegin);
+ d.disconnect(onBegin);
+ d.disconnect(onPlay);
+ });
+ if(this._onAnimateCtx){
+ d.disconnect(this._onAnimateCtx);
+ }
+ this._onAnimateCtx = d.connect(this._current, "onAnimate", this, "_onAnimate");
+ if(this._onEndCtx){
+ d.disconnect(this._onEndCtx);
+ }
+ this._onEndCtx = d.connect(this._current, "onEnd", this, "_onEnd");
+ this._current.play.apply(this._current, arguments);
+ return this;
+ },
+ pause: function(){
+ if(this._current){
+ var e = d.connect(this._current, "onPause", this, function(arg){
+ this._fire("onPause", arguments);
+ d.disconnect(e);
+ });
+ this._current.pause();
+ }
+ return this;
+ },
+ gotoPercent: function(/*Decimal*/percent, /*Boolean?*/ andPlay){
+ this.pause();
+ var offset = this.duration * percent;
+ this._current = null;
+ d.some(this._animations, function(a){
+ if(a.duration <= offset){
+ this._current = a;
+ return true;
+ }
+ offset -= a.duration;
+ return false;
+ });
+ if(this._current){
+ this._current.gotoPercent(offset / this._current.duration, andPlay);
+ }
+ return this;
+ },
+ stop: function(/*boolean?*/ gotoEnd){
+ if(this._current){
+ if(gotoEnd){
+ for(; this._index + 1 < this._animations.length; ++this._index){
+ this._animations[this._index].stop(true);
+ }
+ this._current = this._animations[this._index];
+ }
+ var e = d.connect(this._current, "onStop", this, function(arg){
+ this._fire("onStop", arguments);
+ d.disconnect(e);
+ });
+ this._current.stop();
+ }
+ return this;
+ },
+ status: function(){
+ return this._current ? this._current.status() : "stopped";
+ },
+ destroy: function(){
+ if(this._onAnimateCtx){ d.disconnect(this._onAnimateCtx); }
+ if(this._onEndCtx){ d.disconnect(this._onEndCtx); }
+ }
+ });
+ d.extend(_chain, _baseObj);
+
+ dojo.fx.chain = function(/*dojo.Animation[]*/ animations){
+ // summary:
+ // Chain a list of `dojo.Animation`s to run in sequence
+ //
+ // description:
+ // Return a `dojo.Animation` which will play all passed
+ // `dojo.Animation` instances in sequence, firing its own
+ // synthesized events simulating a single animation. (eg:
+ // onEnd of this animation means the end of the chain,
+ // not the individual animations within)
+ //
+ // example:
+ // Once `node` is faded out, fade in `otherNode`
+ // | dojo.fx.chain([
+ // | dojo.fadeIn({ node:node }),
+ // | dojo.fadeOut({ node:otherNode })
+ // | ]).play();
+ //
+ return new _chain(animations) // dojo.Animation
+ };
+
+ var _combine = function(animations){
+ this._animations = animations||[];
+ this._connects = [];
+ this._finished = 0;
+
+ this.duration = 0;
+ d.forEach(animations, function(a){
+ var duration = a.duration;
+ if(a.delay){ duration += a.delay; }
+ if(this.duration < duration){ this.duration = duration; }
+ this._connects.push(d.connect(a, "onEnd", this, "_onEnd"));
+ }, this);
+
+ this._pseudoAnimation = new d.Animation({curve: [0, 1], duration: this.duration});
+ var self = this;
+ d.forEach(["beforeBegin", "onBegin", "onPlay", "onAnimate", "onPause", "onStop", "onEnd"],
+ function(evt){
+ self._connects.push(d.connect(self._pseudoAnimation, evt,
+ function(){ self._fire(evt, arguments); }
+ ));
+ }
+ );
+ };
+ d.extend(_combine, {
+ _doAction: function(action, args){
+ d.forEach(this._animations, function(a){
+ a[action].apply(a, args);
+ });
+ return this;
+ },
+ _onEnd: function(){
+ if(++this._finished > this._animations.length){
+ this._fire("onEnd");
+ }
+ },
+ _call: function(action, args){
+ var t = this._pseudoAnimation;
+ t[action].apply(t, args);
+ },
+ play: function(/*int?*/ delay, /*Boolean?*/ gotoStart){
+ this._finished = 0;
+ this._doAction("play", arguments);
+ this._call("play", arguments);
+ return this;
+ },
+ pause: function(){
+ this._doAction("pause", arguments);
+ this._call("pause", arguments);
+ return this;
+ },
+ gotoPercent: function(/*Decimal*/percent, /*Boolean?*/ andPlay){
+ var ms = this.duration * percent;
+ d.forEach(this._animations, function(a){
+ a.gotoPercent(a.duration < ms ? 1 : (ms / a.duration), andPlay);
+ });
+ this._call("gotoPercent", arguments);
+ return this;
+ },
+ stop: function(/*boolean?*/ gotoEnd){
+ this._doAction("stop", arguments);
+ this._call("stop", arguments);
+ return this;
+ },
+ status: function(){
+ return this._pseudoAnimation.status();
+ },
+ destroy: function(){
+ d.forEach(this._connects, dojo.disconnect);
+ }
+ });
+ d.extend(_combine, _baseObj);
+
+ dojo.fx.combine = function(/*dojo.Animation[]*/ animations){
+ // summary:
+ // Combine a list of `dojo.Animation`s to run in parallel
+ //
+ // description:
+ // Combine an array of `dojo.Animation`s to run in parallel,
+ // providing a new `dojo.Animation` instance encompasing each
+ // animation, firing standard animation events.
+ //
+ // example:
+ // Fade out `node` while fading in `otherNode` simultaneously
+ // | dojo.fx.combine([
+ // | dojo.fadeIn({ node:node }),
+ // | dojo.fadeOut({ node:otherNode })
+ // | ]).play();
+ //
+ // example:
+ // When the longest animation ends, execute a function:
+ // | var anim = dojo.fx.combine([
+ // | dojo.fadeIn({ node: n, duration:700 }),
+ // | dojo.fadeOut({ node: otherNode, duration: 300 })
+ // | ]);
+ // | dojo.connect(anim, "onEnd", function(){
+ // | // overall animation is done.
+ // | });
+ // | anim.play(); // play the animation
+ //
+ return new _combine(animations); // dojo.Animation
+ };
+
+ dojo.fx.wipeIn = function(/*Object*/ args){
+ // summary:
+ // Expand a node to it's natural height.
+ //
+ // description:
+ // Returns an animation that will expand the
+ // node defined in 'args' object from it's current height to
+ // it's natural height (with no scrollbar).
+ // Node must have no margin/border/padding.
+ //
+ // args: Object
+ // A hash-map of standard `dojo.Animation` constructor properties
+ // (such as easing: node: duration: and so on)
+ //
+ // example:
+ // | dojo.fx.wipeIn({
+ // | node:"someId"
+ // | }).play()
+ var node = args.node = d.byId(args.node), s = node.style, o;
+
+ var anim = d.animateProperty(d.mixin({
+ properties: {
+ height: {
+ // wrapped in functions so we wait till the last second to query (in case value has changed)
+ start: function(){
+ // start at current [computed] height, but use 1px rather than 0
+ // because 0 causes IE to display the whole panel
+ o = s.overflow;
+ s.overflow = "hidden";
+ if(s.visibility == "hidden" || s.display == "none"){
+ s.height = "1px";
+ s.display = "";
+ s.visibility = "";
+ return 1;
+ }else{
+ var height = d.style(node, "height");
+ return Math.max(height, 1);
+ }
+ },
+ end: function(){
+ return node.scrollHeight;
+ }
+ }
+ }
+ }, args));
+
+ d.connect(anim, "onEnd", function(){
+ s.height = "auto";
+ s.overflow = o;
+ });
+
+ return anim; // dojo.Animation
+ };
+
+ dojo.fx.wipeOut = function(/*Object*/ args){
+ // summary:
+ // Shrink a node to nothing and hide it.
+ //
+ // description:
+ // Returns an animation that will shrink node defined in "args"
+ // from it's current height to 1px, and then hide it.
+ //
+ // args: Object
+ // A hash-map of standard `dojo.Animation` constructor properties
+ // (such as easing: node: duration: and so on)
+ //
+ // example:
+ // | dojo.fx.wipeOut({ node:"someId" }).play()
+
+ var node = args.node = d.byId(args.node), s = node.style, o;
+
+ var anim = d.animateProperty(d.mixin({
+ properties: {
+ height: {
+ end: 1 // 0 causes IE to display the whole panel
+ }
+ }
+ }, args));
+
+ d.connect(anim, "beforeBegin", function(){
+ o = s.overflow;
+ s.overflow = "hidden";
+ s.display = "";
+ });
+ d.connect(anim, "onEnd", function(){
+ s.overflow = o;
+ s.height = "auto";
+ s.display = "none";
+ });
+
+ return anim; // dojo.Animation
+ };
+
+ dojo.fx.slideTo = function(/*Object*/ args){
+ // summary:
+ // Slide a node to a new top/left position
+ //
+ // description:
+ // Returns an animation that will slide "node"
+ // defined in args Object from its current position to
+ // the position defined by (args.left, args.top).
+ //
+ // args: Object
+ // A hash-map of standard `dojo.Animation` constructor properties
+ // (such as easing: node: duration: and so on). Special args members
+ // are `top` and `left`, which indicate the new position to slide to.
+ //
+ // example:
+ // | dojo.fx.slideTo({ node: node, left:"40", top:"50", units:"px" }).play()
+
+ var node = args.node = d.byId(args.node),
+ top = null, left = null;
+
+ var init = (function(n){
+ return function(){
+ var cs = d.getComputedStyle(n);
+ var pos = cs.position;
+ top = (pos == 'absolute' ? n.offsetTop : parseInt(cs.top) || 0);
+ left = (pos == 'absolute' ? n.offsetLeft : parseInt(cs.left) || 0);
+ if(pos != 'absolute' && pos != 'relative'){
+ var ret = d.position(n, true);
+ top = ret.y;
+ left = ret.x;
+ n.style.position="absolute";
+ n.style.top=top+"px";
+ n.style.left=left+"px";
+ }
+ };
+ })(node);
+ init();
+
+ var anim = d.animateProperty(d.mixin({
+ properties: {
+ top: args.top || 0,
+ left: args.left || 0
+ }
+ }, args));
+ d.connect(anim, "beforeBegin", anim, init);
+
+ return anim; // dojo.Animation
+ };
+
+})();
+
+}
+
+if(!dojo._hasResource["dojox.fx.flip"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.fx.flip"] = true;
+dojo.provide("dojox.fx.flip");
+
+
+
+
+ dojo.experimental("dojox.fx.flip");
+ // because ShrinkSafe will eat this up:
+ var borderConst = "border",
+ widthConst = "Width",
+ heightConst = "Height",
+ topConst = "Top",
+ rightConst = "Right",
+ leftConst = "Left",
+ bottomConst = "Bottom"
+ ;
+
+ dojox.fx.flip = function(/*Object*/ args){
+ // summary: Animate a node flipping following a specific direction
+ //
+ // description:
+ // Returns an animation that will flip the
+ // node around a central axis:
+ // if args.dir is "left" or "right" --> y axis
+ // if args.dir is "top" or "bottom" --> x axis
+ //
+ // This effect is obtained using a border distorsion applied to a helper node.
+ //
+ // The user can specify three background colors for the helper node:
+ // darkColor: the darkest color reached during the animation
+ // lightColor: the brightest color
+ // endColor: the final backgroundColor for the node
+ //
+ // depth: Float
+ // 0 <= depth <= 1 overrides the computed "depth"
+ // (0: min distorsion, 1: max distorsion)
+ //
+ // whichAnim: String
+ // "first" : the first half animation
+ // "last" : the second one
+ // "both" (default) : both
+ //
+ // axis: String
+ // "center" (default) : the node is flipped around his center
+ // "shortside" : the node is flipped around his "short" (in perspective) side
+ // "longside" : the node is flipped around his "long" (in perspective) side
+ // "cube" : the node flips around the central axis of the cube
+ //
+ // shift: Integer
+ // node translation, perpendicular to the rotation axis
+ //
+ // example:
+ // | var anim = dojox.fx.flip({
+ // | node: dojo.byId("nodeId"),
+ // | dir: "top",
+ // | darkColor: "#555555",
+ // | lightColor: "#dddddd",
+ // | endColor: "#666666",
+ // | depth: .5,
+ // | shift: 50,
+ // | duration:300
+ // | });
+
+ var helperNode = dojo.create("div"),
+ node = args.node = dojo.byId(args.node),
+ s = node.style,
+ dims = null,
+ hs = null,
+ pn = null,
+ lightColor = args.lightColor || "#dddddd",
+ darkColor = args.darkColor || "#555555",
+ bgColor = dojo.style(node, "backgroundColor"),
+ endColor = args.endColor || bgColor,
+ staticProps = {},
+ anims = [],
+ duration = args.duration ? args.duration / 2 : 250,
+ dir = args.dir || "left",
+ pConst = .9,
+ transparentColor = "transparent",
+ whichAnim = args.whichAnim,
+ axis = args.axis || "center",
+ depth = args.depth
+ ;
+ // IE6 workaround: IE6 doesn't support transparent borders
+ var convertColor = function(color){
+ return ((new dojo.Color(color)).toHex() === "#000000") ? "#000001" : color;
+ };
+
+ if(dojo.isIE < 7){
+ endColor = convertColor(endColor);
+ lightColor = convertColor(lightColor);
+ darkColor = convertColor(darkColor);
+ bgColor = convertColor(bgColor);
+ transparentColor = "black";
+ helperNode.style.filter = "chroma(color='#000000')";
+ }
+
+ var init = (function(n){
+ return function(){
+ var ret = dojo.coords(n, true);
+ dims = {
+ top: ret.y,
+ left: ret.x,
+ width: ret.w,
+ height: ret.h
+ };
+ }
+ })(node);
+ init();
+ // helperNode initialization
+ hs = {
+ position: "absolute",
+ top: dims["top"] + "px",
+ left: dims["left"] + "px",
+ height: "0",
+ width: "0",
+ zIndex: args.zIndex || (s.zIndex || 0),
+ border: "0 solid " + transparentColor,
+ fontSize: "0",
+ visibility: "hidden"
+ };
+ var props = [ {},
+ {
+ top: dims["top"],
+ left: dims["left"]
+ }
+ ];
+ var dynProperties = {
+ left: [leftConst, rightConst, topConst, bottomConst, widthConst, heightConst, "end" + heightConst + "Min", leftConst, "end" + heightConst + "Max"],
+ right: [rightConst, leftConst, topConst, bottomConst, widthConst, heightConst, "end" + heightConst + "Min", leftConst, "end" + heightConst + "Max"],
+ top: [topConst, bottomConst, leftConst, rightConst, heightConst, widthConst, "end" + widthConst + "Min", topConst, "end" + widthConst + "Max"],
+ bottom: [bottomConst, topConst, leftConst, rightConst, heightConst, widthConst, "end" + widthConst + "Min", topConst, "end" + widthConst + "Max"]
+ };
+ // property names
+ pn = dynProperties[dir];
+
+ // .4 <= pConst <= .9
+ if(typeof depth != "undefined"){
+ depth = Math.max(0, Math.min(1, depth)) / 2;
+ pConst = .4 + (.5 - depth);
+ }else{
+ pConst = Math.min(.9, Math.max(.4, dims[pn[5].toLowerCase()] / dims[pn[4].toLowerCase()]));
+ }
+ var p0 = props[0];
+ for(var i = 4; i < 6; i++){
+ if(axis == "center" || axis == "cube"){ // find a better name for "cube"
+ dims["end" + pn[i] + "Min"] = dims[pn[i].toLowerCase()] * pConst;
+ dims["end" + pn[i] + "Max"] = dims[pn[i].toLowerCase()] / pConst;
+ }else if(axis == "shortside"){
+ dims["end" + pn[i] + "Min"] = dims[pn[i].toLowerCase()];
+ dims["end" + pn[i] + "Max"] = dims[pn[i].toLowerCase()] / pConst;
+ }else if(axis == "longside"){
+ dims["end" + pn[i] + "Min"] = dims[pn[i].toLowerCase()] * pConst;
+ dims["end" + pn[i] + "Max"] = dims[pn[i].toLowerCase()];
+ }
+ }
+ if(axis == "center"){
+ p0[pn[2].toLowerCase()] = dims[pn[2].toLowerCase()] - (dims[pn[8]] - dims[pn[6]]) / 4;
+ }else if(axis == "shortside"){
+ p0[pn[2].toLowerCase()] = dims[pn[2].toLowerCase()] - (dims[pn[8]] - dims[pn[6]]) / 2;
+ }
+
+ staticProps[pn[5].toLowerCase()] = dims[pn[5].toLowerCase()] + "px";
+ staticProps[pn[4].toLowerCase()] = "0";
+ staticProps[borderConst + pn[1] + widthConst] = dims[pn[4].toLowerCase()] + "px";
+ staticProps[borderConst + pn[1] + "Color"] = bgColor;
+
+ p0[borderConst + pn[1] + widthConst] = 0;
+ p0[borderConst + pn[1] + "Color"] = darkColor;
+ p0[borderConst + pn[2] + widthConst] = p0[borderConst + pn[3] + widthConst] = axis != "cube"
+ ? (dims["end" + pn[5] + "Max"] - dims["end" + pn[5] + "Min"]) / 2
+ : dims[pn[6]] / 2
+ ;
+ p0[pn[7].toLowerCase()] = dims[pn[7].toLowerCase()] + dims[pn[4].toLowerCase()] / 2 + (args.shift || 0);
+ p0[pn[5].toLowerCase()] = dims[pn[6]];
+
+ var p1 = props[1];
+ p1[borderConst + pn[0] + "Color"] = { start: lightColor, end: endColor };
+ p1[borderConst + pn[0] + widthConst] = dims[pn[4].toLowerCase()];
+ p1[borderConst + pn[2] + widthConst] = 0;
+ p1[borderConst + pn[3] + widthConst] = 0;
+ p1[pn[5].toLowerCase()] = { start: dims[pn[6]], end: dims[pn[5].toLowerCase()] };
+
+ dojo.mixin(hs, staticProps);
+ dojo.style(helperNode, hs);
+ dojo.body().appendChild(helperNode);
+
+ var finalize = function(){
+// helperNode.parentNode.removeChild(helperNode);
+ dojo.destroy(helperNode);
+ // fixes a flicker when the animation ends
+ s.backgroundColor = endColor;
+ s.visibility = "visible";
+ };
+ if(whichAnim == "last"){
+ for(i in p0){
+ p0[i] = { start: p0[i] };
+ }
+ p0[borderConst + pn[1] + "Color"] = { start: darkColor, end: endColor };
+ p1 = p0;
+ }
+ if(!whichAnim || whichAnim == "first"){
+ anims.push(dojo.animateProperty({
+ node: helperNode,
+ duration: duration,
+ properties: p0
+ }));
+ }
+ if(!whichAnim || whichAnim == "last"){
+ anims.push(dojo.animateProperty({
+ node: helperNode,
+ duration: duration,
+ properties: p1,
+ onEnd: finalize
+ }));
+ }
+
+ // hide the original node
+ dojo.connect(anims[0], "play", function(){
+ helperNode.style.visibility = "visible";
+ s.visibility = "hidden";
+ });
+
+ return dojo.fx.chain(anims); // dojo.Animation
+
+ }
+
+ dojox.fx.flipCube = function(/*Object*/ args){
+ // summary: An extension to `dojox.fx.flip` providing a more 3d-like rotation
+ //
+ // description:
+ // An extension to `dojox.fx.flip` providing a more 3d-like rotation.
+ // Behaves the same as `dojox.fx.flip`, using the same attributes and
+ // other standard `dojo.Animation` properties.
+ //
+ // example:
+ // See `dojox.fx.flip`
+ var anims = [],
+ mb = dojo.marginBox(args.node),
+ shiftX = mb.w / 2,
+ shiftY = mb.h / 2,
+ dims = {
+ top: {
+ pName: "height",
+ args:[
+ {
+ whichAnim: "first",
+ dir: "top",
+ shift: -shiftY
+ },
+ {
+ whichAnim: "last",
+ dir: "bottom",
+ shift: shiftY
+ }
+ ]
+ },
+ right: {
+ pName: "width",
+ args:[
+ {
+ whichAnim: "first",
+ dir: "right",
+ shift: shiftX
+ },
+ {
+ whichAnim: "last",
+ dir: "left",
+ shift: -shiftX
+ }
+ ]
+ },
+ bottom: {
+ pName: "height",
+ args:[
+ {
+ whichAnim: "first",
+ dir: "bottom",
+ shift: shiftY
+ },
+ {
+ whichAnim: "last",
+ dir: "top",
+ shift: -shiftY
+ }
+ ]
+ },
+ left: {
+ pName: "width",
+ args:[
+ {
+ whichAnim: "first",
+ dir: "left",
+ shift: -shiftX
+ },
+ {
+ whichAnim: "last",
+ dir: "right",
+ shift: shiftX
+ }
+ ]
+ }
+ }
+ ;
+ var d = dims[args.dir || "left"],
+ p = d.args
+ ;
+ args.duration = args.duration ? args.duration * 2 : 500;
+ args.depth = .8;
+ args.axis = "cube";
+ for(var i = p.length - 1; i >= 0; i--){
+ dojo.mixin(args, p[i]);
+ anims.push(dojox.fx.flip(args));
+ }
+ return dojo.fx.combine(anims);
+ };
+
+ dojox.fx.flipPage = function(/*Object*/ args){
+ // summary: An extension to `dojox.fx.flip` providing a page flip like animation.
+ //
+ // description:
+ // An extension to `dojox.fx.flip` providing a page flip effect.
+ // Behaves the same as `dojox.fx.flip`, using the same attributes and
+ // other standard `dojo.Animation` properties.
+ //
+ // example:
+ // See `dojox.fx.flip`
+ var n = args.node,
+ coords = dojo.coords(n, true),
+ x = coords.x,
+ y = coords.y,
+ w = coords.w,
+ h = coords.h,
+ bgColor = dojo.style(n, "backgroundColor"),
+ lightColor = args.lightColor || "#dddddd",
+ darkColor = args.darkColor,
+ helperNode = dojo.create("div"),
+ anims = [],
+ hn = [],
+ dir = args.dir || "right",
+ pn = {
+ left: ["left", "right", "x", "w"],
+ top: ["top", "bottom", "y", "h"],
+ right: ["left", "left", "x", "w"],
+ bottom: ["top", "top", "y", "h"]
+ },
+ shiftMultiplier = {
+ right: [1, -1],
+ left: [-1, 1],
+ top: [-1, 1],
+ bottom: [1, -1]
+ }
+ ;
+ dojo.style(helperNode, {
+ position: "absolute",
+ width : w + "px",
+ height : h + "px",
+ top : y + "px",
+ left : x + "px",
+ visibility: "hidden"
+ });
+ var hs = [];
+ for(var i = 0; i < 2; i++){
+ var r = i % 2,
+ d = r ? pn[dir][1] : dir,
+ wa = r ? "last" : "first",
+ endColor = r ? bgColor : lightColor,
+ startColor = r ? endColor : args.startColor || n.style.backgroundColor
+ ;
+ hn[i] = dojo.clone(helperNode);
+ var finalize = function(x){
+ return function(){
+ dojo.destroy(hn[x]);
+ }
+ }(i)
+ ;
+ dojo.body().appendChild(hn[i]);
+ hs[i] = {
+ backgroundColor: r ? startColor : bgColor
+ };
+
+ hs[i][pn[dir][0]] = coords[pn[dir][2]] + shiftMultiplier[dir][0] * i * coords[pn[dir][3]] + "px";
+ dojo.style(hn[i], hs[i]);
+ anims.push(dojox.fx.flip({
+ node: hn[i],
+ dir: d,
+ axis: "shortside",
+ depth: args.depth,
+ duration: args.duration / 2,
+ shift: shiftMultiplier[dir][i] * coords[pn[dir][3]] / 2,
+ darkColor: darkColor,
+ lightColor: lightColor,
+ whichAnim: wa,
+ endColor: endColor
+ }));
+ dojo.connect(anims[i], "onEnd", finalize);
+ }
+ return dojo.fx.chain(anims);
+ };
+
+
+ dojox.fx.flipGrid = function(/*Object*/ args){
+ // summary: An extension to `dojox.fx.flip` providing a decomposition in rows * cols flipping elements
+ //
+ // description:
+ // An extension to `dojox.fx.flip` providing a page flip effect.
+ // Behaves the same as `dojox.fx.flip`, using the same attributes and
+ // other standard `dojo.Animation` properties and
+ //
+ // cols: Integer columns
+ // rows: Integer rows
+ //
+ // duration: the single flip duration
+ //
+ // example:
+ // See `dojox.fx.flip`
+ var rows = args.rows || 4,
+ cols = args.cols || 4,
+ anims = [],
+ helperNode = dojo.create("div"),
+ n = args.node,
+ coords = dojo.coords(n, true),
+ x = coords.x,
+ y = coords.y,
+ nw = coords.w,
+ nh = coords.h,
+ w = coords.w / cols,
+ h = coords.h / rows,
+ cAnims = []
+ ;
+ dojo.style(helperNode, {
+ position: "absolute",
+ width: w + "px",
+ height: h + "px",
+ backgroundColor: dojo.style(n, "backgroundColor")
+ });
+ for(var i = 0; i < rows; i++){
+ var r = i % 2,
+ d = r ? "right" : "left",
+ signum = r ? 1 : -1
+ ;
+ // cloning
+ var cn = dojo.clone(n);
+ dojo.style(cn, {
+ position: "absolute",
+ width: nw + "px",
+ height: nh + "px",
+ top: y + "px",
+ left: x + "px",
+ clip: "rect(" + i * h + "px," + nw + "px," + nh + "px,0)"
+ });
+ dojo.body().appendChild(cn);
+ anims[i] = [];
+ for(var j = 0; j < cols; j++){
+ var hn = dojo.clone(helperNode),
+ l = r ? j : cols - (j + 1)
+ ;
+ var adjustClip = function(xn, yCounter, xCounter){
+ return function(){
+ if(!(yCounter % 2)){
+ dojo.style(xn, {
+ clip: "rect(" + yCounter * h + "px," + (nw - (xCounter + 1) * w ) + "px," + ((yCounter + 1) * h) + "px,0px)"
+ });
+ }else{
+ dojo.style(xn, {
+ clip: "rect(" + yCounter * h + "px," + nw + "px," + ((yCounter + 1) * h) + "px," + ((xCounter + 1) * w) + "px)"
+ });
+ }
+ }
+ }(cn, i, j);
+ dojo.body().appendChild(hn);
+ dojo.style(hn, {
+ left: x + l * w + "px",
+ top: y + i * h + "px",
+ visibility: "hidden"
+ });
+ var a = dojox.fx.flipPage({
+ node: hn,
+ dir: d,
+ duration: args.duration || 900,
+ shift: signum * w/2,
+ depth: .2,
+ darkColor: args.darkColor,
+ lightColor: args.lightColor,
+ startColor: args.startColor || args.node.style.backgroundColor
+ }),
+ removeHelper = function(xn){
+ return function(){
+ dojo.destroy(xn);
+ }
+ }(hn)
+ ;
+ dojo.connect(a, "play", this, adjustClip);
+ dojo.connect(a, "play", this, removeHelper);
+ anims[i].push(a);
+ }
+ cAnims.push(dojo.fx.chain(anims[i]));
+
+ }
+ dojo.connect(cAnims[0], "play", function(){
+ dojo.style(n, {visibility: "hidden"});
+ });
+ return dojo.fx.combine(cAnims);
+ };
+
+}
+
+if(!dojo._hasResource["dojox.mobile.compat"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.compat"] = true;
+dojo.provide("dojox.mobile.compat");
+
+
+
+
+
+// summary:
+// CSS3 compatibility module
+// description:
+// This module provides support for some of the CSS3 features to dojox.mobile
+// for non-CSS3 browsers, such as IE or Firefox.
+// If you load this module, it directly replaces some of the methods of
+// dojox.mobile instead of subclassing. This way, html pages remains the same
+// regardless of whether this compatibility module is used or not.
+// Recommended usage is as follows. the code below loads dojox.mobile.compat
+// only when isWebKit is true.
+//
+// dojo.require("dojox.mobile");
+//
+//
+// This module also loads compatibility CSS files, which has -compat.css
+// suffix. You can use either the <link> tag or @import to load theme
+// CSS files. Then, this module searches for the loaded CSS files and loads
+// compatibility CSS files. For example, if you load iphone.css in a page,
+// this module automatically loads iphone-compat.css.
+// If you explicitly load iphone-compat.css with <link> or @import,
+// this module will not load the already loaded file.
+
+if(!dojo.isWebKit){
+
+dojo.extend(dojox.mobile.View, {
+ _doTransition: function(fromNode, toNode, transition, dir){
+ var anim;
+ this.wakeUp(toNode);
+ if(!transition || transition == "none"){
+ toNode.style.display = "";
+ fromNode.style.display = "none";
+ toNode.style.left = "0px";
+ this.invokeCallback();
+ }else if(transition == "slide"){
+ var w = fromNode.offsetWidth;
+ var s1 = dojo.fx.slideTo({
+ node: fromNode,
+ duration: 400,
+ left: -w*dir,
+ top: fromNode.offsetTop
+ });
+ var s2 = dojo.fx.slideTo({
+ node: toNode,
+ duration: 400,
+ left: 0
+ });
+ toNode.style.position = "absolute";
+ toNode.style.left = w*dir + "px";
+ toNode.style.display = "";
+ anim = dojo.fx.combine([s1,s2]);
+ dojo.connect(anim, "onEnd", this, function(){
+ fromNode.style.display = "none";
+ toNode.style.position = "relative";
+ this.invokeCallback();
+ });
+ anim.play();
+ }else if(transition == "flip"){
+ anim = dojox.fx.flip({
+ node: fromNode,
+ dir: "right",
+ depth: 0.5,
+ duration: 400
+ });
+ toNode.style.position = "absolute";
+ toNode.style.left = "0px";
+ dojo.connect(anim, "onEnd", this, function(){
+ fromNode.style.display = "none";
+ toNode.style.position = "relative";
+ toNode.style.display = "";
+ this.invokeCallback();
+ });
+ anim.play();
+ }else if(transition == "fade"){
+ anim = dojo.fx.chain([
+ dojo.fadeOut({
+ node: fromNode,
+ duration: 600
+ }),
+ dojo.fadeIn({
+ node: toNode,
+ duration: 600
+ })
+ ]);
+ toNode.style.position = "absolute";
+ toNode.style.left = "0px";
+ toNode.style.display = "";
+ dojo.style(toNode, "opacity", 0);
+ dojo.connect(anim, "onEnd", this, function(){
+ fromNode.style.display = "none";
+ toNode.style.position = "relative";
+ dojo.style(fromNode, "opacity", 1);
+ this.invokeCallback();
+ });
+ anim.play();
+ }
+ },
+
+ wakeUp: function(node){
+ // summary:
+ // Function to force IE to redraw a node since its layout code tends to misrender
+ // in partial draws.
+ // node:
+ // The node to forcibly redraw.
+ // tags:
+ // public
+ if(dojo.isIE && !node._wokeup){
+ node._wokeup = true;
+ var disp = node.style.display;
+ node.style.display = "";
+ var nodes = node.getElementsByTagName("*");
+ for(var i = 0, len = nodes.length; i < len; i++){
+ var val = nodes[i].style.display;
+ nodes[i].style.display = "none";
+ nodes[i].style.display = "";
+ nodes[i].style.display = val;
+ }
+ node.style.display = disp;
+ }
+ }
+});
+
+dojo.extend(dojox.mobile.Switch, {
+ buildRendering: function(){
+ // summary:
+ // Function to simulate the mobile device style switches on
+ // browsers such as IE and FireFox.
+ // tags:
+ // protected
+ this.domNode = this.srcNodeRef || dojo.doc.createElement("DIV");
+ this.domNode.className = "mblSwitch";
+ this.domNode.innerHTML =
+ '<div class="mblSwitchInner">'
+ + '<div class="mblSwitchBg mblSwitchBgLeft">'
+ + '<div class="mblSwitchCorner mblSwitchCorner1T"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner2T"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner3T"></div>'
+ + '<div class="mblSwitchText mblSwitchTextLeft">'+this.leftLabel+'</div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner1B"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner2B"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner3B"></div>'
+ + '</div>'
+ + '<div class="mblSwitchBg mblSwitchBgRight">'
+ + '<div class="mblSwitchCorner mblSwitchCorner1T"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner2T"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner3T"></div>'
+ + '<div class="mblSwitchText mblSwitchTextRight">'+this.rightLabel+'</div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner1B"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner2B"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner3B"></div>'
+ + '</div>'
+ + '<div class="mblSwitchKnobContainer">'
+ + '<div class="mblSwitchCorner mblSwitchCorner1T"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner2T"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner3T"></div>'
+ + '<div class="mblSwitchKnob"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner1B"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner2B"></div>'
+ + '<div class="mblSwitchCorner mblSwitchCorner3B"></div>'
+ + '</div>'
+ + '</div>';
+ var n = this.inner = this.domNode.firstChild;
+ this.left = n.childNodes[0];
+ this.right = n.childNodes[1];
+ this.knob = n.childNodes[2];
+
+ dojo.addClass(this.domNode, (this.value == "on") ? "mblSwitchOn" : "mblSwitchOff");
+ this[this.value == "off" ? "left" : "right"].style.display = "none";
+ },
+
+ _changeState: function(/*String*/state){
+ // summary:
+ // Function to toggle the switch state on the switch
+ // state:
+ // Thhe state to toggle, switch 'on' or 'off'
+ // tags:
+ // private
+ if(!this.inner.parentNode || !this.inner.parentNode.tagName){
+ dojo.addClass(this.domNode, (state == "on") ? "mblSwitchOn" : "mblSwitchOff");
+ return;
+ }
+ var pos;
+ if(this.inner.offsetLeft == 0){ // currently ON
+ if(state == "on"){ return; }
+ pos = -53;
+ }else{ // currently OFF
+ if(state == "off"){ return; }
+ pos = 0;
+ }
+
+ var a = dojo.fx.slideTo({
+ node: this.inner,
+ duration: 500,
+ left: pos
+ });
+ var _this = this;
+ dojo.connect(a, "onEnd", function(){
+ _this[state == "off" ? "left" : "right"].style.display = "none";
+ });
+ a.play();
+ }
+});
+
+if(dojo.isIE || dojo.isBB){
+
+dojo.extend(dojox.mobile.RoundRect, {
+ buildRendering: function(){
+ // summary:
+ // Function to simulate the borderRadius appearance on IE, since
+ // IE does not support this CSS style.
+ // tags:
+ // protected
+ dojox.mobile.createRoundRect(this);
+ this.domNode.className = "mblRoundRect";
+ }
+});
+
+dojox.mobile.RoundRectList._addChild = dojox.mobile.RoundRectList.prototype.addChild;
+dojo.extend(dojox.mobile.RoundRectList, {
+ buildRendering: function(){
+ // summary:
+ // Function to simulate the borderRadius appearance on IE, since
+ // IE does not support this CSS style.
+ // tags:
+ // protected
+ dojox.mobile.createRoundRect(this, true);
+ this.domNode.className = "mblRoundRectList";
+ },
+
+ postCreate: function(){
+ this.redrawBorders();
+ },
+
+ addChild: function(widget){
+ dojox.mobile.RoundRectList._addChild.apply(this, arguments);
+ this.redrawBorders();
+ if(dojox.mobile.applyPngFilter){
+ dojox.mobile.applyPngFilter(widget.domNode);
+ }
+ },
+
+ redrawBorders: function(){
+ // summary:
+ // Function to adjust the creation of RoundRectLists on IE.
+ // Removed undesired styles.
+ // tags:
+ // public
+
+ // Remove a border of the last ListItem.
+ // This is for browsers that do not support the last-child CSS pseudo-class.
+
+ var lastChildFound = false;
+ for(var i = this.containerNode.childNodes.length - 1; i >= 0; i--){
+ var c = this.containerNode.childNodes[i];
+ if(c.tagName == "LI"){
+ c.style.borderBottomStyle = lastChildFound ? "solid" : "none";
+ lastChildFound = true;
+ }
+ }
+ }
+});
+
+dojo.extend(dojox.mobile.EdgeToEdgeList, {
+ buildRendering: function(){
+ this.domNode = this.containerNode = this.srcNodeRef || dojo.doc.createElement("UL");
+ this.domNode.className = "mblEdgeToEdgeList";
+ }
+});
+
+if(dojox.mobile.IconContainer){
+
+dojox.mobile.IconContainer._addChild = dojox.mobile.IconContainer.prototype.addChild;
+dojo.extend(dojox.mobile.IconContainer, {
+ addChild: function(widget){
+ dojox.mobile.IconContainer._addChild.apply(this, arguments);
+ if(dojox.mobile.applyPngFilter){
+ dojox.mobile.applyPngFilter(widget.domNode);
+ }
+ }
+});
+
+} // if(dojox.mobile.IconContainer)
+
+dojo.mixin(dojox.mobile, {
+ createRoundRect: function(_this, isList){
+ // summary:
+ // Function to adjust the creation of rounded rectangles on IE.
+ // Deals with IE's lack of borderRadius support
+ // tags:
+ // public
+ var i;
+ _this.domNode = dojo.doc.createElement("DIV");
+ _this.domNode.style.padding = "0px";
+ _this.domNode.style.backgroundColor = "transparent";
+ _this.domNode.style.borderStyle = "none";
+ _this.containerNode = dojo.doc.createElement(isList?"UL":"DIV");
+ _this.containerNode.className = "mblRoundRectContainer";
+ if(_this.srcNodeRef){
+ _this.srcNodeRef.parentNode.replaceChild(_this.domNode, _this.srcNodeRef);
+ for(i = 0, len = _this.srcNodeRef.childNodes.length; i < len; i++){
+ _this.containerNode.appendChild(_this.srcNodeRef.removeChild(_this.srcNodeRef.firstChild));
+ }
+ _this.srcNodeRef = null;
+ }
+ _this.domNode.appendChild(_this.containerNode);
+
+ for(i = 0; i <= 5; i++){
+ var top = dojo.create("DIV");
+ top.className = "mblRoundCorner mblRoundCorner"+i+"T";
+ _this.domNode.insertBefore(top, _this.containerNode);
+
+ var bottom = dojo.create("DIV");
+ bottom.className = "mblRoundCorner mblRoundCorner"+i+"B";
+ _this.domNode.appendChild(bottom);
+ }
+ }
+});
+
+if(dojox.mobile.ScrollableView){
+
+dojo.extend(dojox.mobile.ScrollableView, {
+ postCreate: function(){
+ // On IE, margin-top of the first child does not seem to be effective,
+ // probably because padding-top is specified for containerNode
+ // to make room for a fixed header. This dummy node is a workaround for that.
+ var dummy = dojo.create("DIV", {className:"mblDummyForIE", innerHTML:"&nbsp;"}, this.containerNode, "first");
+ dojo.style(dummy, {
+ position: "relative",
+ marginBottom: "-2px",
+ fontSize: "1px"
+ });
+ }
+});
+
+} // if(dojox.mobile.ScrollableView)
+
+} // if(dojo.isIE)
+
+if(dojo.isIE <= 6){
+ dojox.mobile.applyPngFilter = function(root){
+ root = root || dojo.body();
+ var nodes = root.getElementsByTagName("IMG");
+ var blank = dojo.moduleUrl("dojo", "resources/blank.gif");
+ for(var i = 0, len = nodes.length; i < len; i++){
+ var img = nodes[i];
+ var w = img.offsetWidth;
+ var h = img.offsetHeight;
+ if(w === 0 || h === 0){
+ // The reason why the image has no width/height may be because
+ // display is "none". If that is the case, let's change the
+ // display to "" temporarily and see if the image returns them.
+ if(dojo.style(img, "display") != "none"){ continue; }
+ img.style.display = "";
+ w = img.offsetWidth;
+ h = img.offsetHeight;
+ img.style.display = "none";
+ if(w === 0 || h === 0){ continue; }
+ }
+ var src = img.src;
+ if(src.indexOf("resources/blank.gif") != -1){ continue; }
+ img.src = blank;
+ img.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src+"')";
+ img.style.width = w + "px";
+ img.style.height = h + "px";
+ }
+ };
+} // if(dojo.isIE <= 6)
+
+dojox.mobile.loadCss = function(/*String|Array*/files){
+ // summary:
+ // Function to load and register CSS files with the page
+ // files: String|Array
+ // The CSS files to load and register with the page.
+ // tags:
+ // private
+ if(!dojo.global._loadedCss){
+ var obj = {};
+ dojo.forEach(dojox.mobile.getCssPaths(), function(path){
+ obj[path] = true;
+ });
+ dojo.global._loadedCss = obj;
+ }
+ if(!dojo.isArray(files)){ files = [files]; }
+ for(var i = 0; i < files.length; i++){
+ var file = files[i];
+ if(!dojo.global._loadedCss[file]){
+ dojo.global._loadedCss[file] = true;
+ if(dojo.doc.createStyleSheet){
+ // for some reason, IE hangs when you try to load
+ // multiple css files almost at once.
+ setTimeout(function(file){
+ return function(){
+ dojo.doc.createStyleSheet(file);
+ };
+ }(file), 0);
+ }else{
+ var link = dojo.doc.createElement("link");
+ link.href = file;
+ link.type = "text/css";
+ link.rel = "stylesheet";
+ var head = dojo.doc.getElementsByTagName('head')[0];
+ head.appendChild(link);
+ }
+ }
+ }
+};
+
+dojox.mobile.getCssPaths = function(){
+ var paths = [];
+ var i, j;
+
+ // find @import
+ var s = dojo.doc.styleSheets;
+ for(i = 0; i < s.length; i++){
+ var r = s[i].cssRules || s[i].imports;
+ if(!r){ continue; }
+ for(j = 0; j < r.length; j++){
+ if(r[j].href){
+ paths.push(r[j].href);
+ }
+ }
+ }
+
+ // find <link>
+ var elems = dojo.doc.getElementsByTagName("link");
+ for(i = 0, len = elems.length; i < len; i++){
+ if(elems[i].href){
+ paths.push(elems[i].href);
+ }
+ }
+ return paths;
+};
+
+dojox.mobile.loadCompatPattern = /\/themes\/(domButtons|buttons|iphone|android).*\.css$/;
+
+dojox.mobile.loadCompatCssFiles = function(){
+ // summary:
+ // Function to perform page-level adjustments on browsers such as
+ // IE and firefox. It loads compat specific css files into the
+ // page header.
+ var paths = dojox.mobile.getCssPaths();
+ for(var i = 0; i < paths.length; i++){
+ var href = paths[i];
+ if(href.match(dojox.mobile.loadCompatPattern) && href.indexOf("-compat.css") == -1){
+ var compatCss = href.substring(0, href.length-4)+"-compat.css";
+ dojox.mobile.loadCss(compatCss);
+ }
+ }
+};
+
+dojox.mobile.hideAddressBar = function(){
+ // nop
+};
+
+dojo.addOnLoad(function(){
+ if(dojo.config["mblLoadCompatCssFiles"] !== false){
+ dojox.mobile.loadCompatCssFiles();
+ }
+ if(dojox.mobile.applyPngFilter){
+ dojox.mobile.applyPngFilter();
+ }
+});
+
+} // end of if(!dojo.isWebKit){
+
+}
+
+
+}};});
diff --git a/js/dojo-1.6/dojox/mobile/parser.js b/js/dojo-1.6/dojox/mobile/parser.js
new file mode 100644
index 0000000..099aa22
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/parser.js
@@ -0,0 +1,91 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.mobile.parser"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.parser"] = true;
+dojo.provide("dojox.mobile.parser");
+dojo.provide("dojo.parser"); // not to load dojo.parser unexpectedly
+
+dojox.mobile.parser = new function(){
+ this.instantiate = function(list, defaultParams){
+ // summary:
+ // Function for instantiating a list of widget nodes.
+ // list:
+ // The list of DOMNodes to walk and instantiate widgets on.
+ var ws = [];
+ if(list){
+ var i, len;
+ len = list.length;
+ for(i = 0; i < len; i++){
+ var node = list[i];
+ var cls = dojo.getObject(dojo.attr(node, "dojoType"));
+ var proto = cls.prototype;
+ var params = {};
+
+ if(defaultParams){
+ for(var name in defaultParams){
+ params[name] = defaultParams[name];
+ }
+ }
+ for(var prop in proto){
+ var val = dojo.attr(node, prop);
+ if(!val){ continue; }
+ if(typeof proto[prop] == "string"){
+ params[prop] = val;
+ }else if(typeof proto[prop] == "number"){
+ params[prop] = val - 0;
+ }else if(typeof proto[prop] == "boolean"){
+ params[prop] = (val != "false");
+ }else if(typeof proto[prop] == "object"){
+ params[prop] = eval("(" + val + ")");
+ }
+ }
+ params["class"] = node.className;
+ params["style"] = node.style && node.style.cssText;
+ ws.push(new cls(params, node));
+ }
+ len = ws.length;
+ for(i = 0; i < len; i++){
+ var w = ws[i];
+ w.startup && !w._started && (!w.getParent || !w.getParent()) && w.startup();
+ }
+ }
+ return ws;
+ };
+
+ this.parse = function(rootNode, defaultParams){
+ // summary:
+ // Function to handle parsing for widgets in the current document.
+ // It is not as powerful as the full dojo parser, but it will handle basic
+ // use cases fine.
+ // rootNode:
+ // The root node in the document to parse from
+ if(!rootNode){
+ rootNode = dojo.body();
+ }else if(!defaultParams && rootNode.rootNode){
+ // Case where 'rootNode' is really a params object.
+ rootNode = rootNode.rootNode;
+ }
+
+ var nodes = rootNode.getElementsByTagName("*");
+ var list = [];
+ for(var i = 0, len = nodes.length; i < len; i++){
+ if(nodes[i].getAttribute("dojoType")){
+ list.push(nodes[i]);
+ }
+ }
+ return this.instantiate(list, defaultParams);
+ };
+}();
+dojo._loaders.unshift(function(){
+ if(dojo.config.parseOnLoad){
+ dojox.mobile.parser.parse();
+ }
+});
+
+
+}
diff --git a/js/dojo-1.6/dojox/mobile/parser.xd.js b/js/dojo-1.6/dojox/mobile/parser.xd.js
new file mode 100644
index 0000000..699b6c9
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/parser.xd.js
@@ -0,0 +1,96 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.mobile.parser"],
+["provide", "dojo.parser"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.mobile.parser"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.parser"] = true;
+dojo.provide("dojox.mobile.parser");
+dojo.provide("dojo.parser"); // not to load dojo.parser unexpectedly
+
+dojox.mobile.parser = new function(){
+ this.instantiate = function(list, defaultParams){
+ // summary:
+ // Function for instantiating a list of widget nodes.
+ // list:
+ // The list of DOMNodes to walk and instantiate widgets on.
+ var ws = [];
+ if(list){
+ var i, len;
+ len = list.length;
+ for(i = 0; i < len; i++){
+ var node = list[i];
+ var cls = dojo.getObject(dojo.attr(node, "dojoType"));
+ var proto = cls.prototype;
+ var params = {};
+
+ if(defaultParams){
+ for(var name in defaultParams){
+ params[name] = defaultParams[name];
+ }
+ }
+ for(var prop in proto){
+ var val = dojo.attr(node, prop);
+ if(!val){ continue; }
+ if(typeof proto[prop] == "string"){
+ params[prop] = val;
+ }else if(typeof proto[prop] == "number"){
+ params[prop] = val - 0;
+ }else if(typeof proto[prop] == "boolean"){
+ params[prop] = (val != "false");
+ }else if(typeof proto[prop] == "object"){
+ params[prop] = eval("(" + val + ")");
+ }
+ }
+ params["class"] = node.className;
+ params["style"] = node.style && node.style.cssText;
+ ws.push(new cls(params, node));
+ }
+ len = ws.length;
+ for(i = 0; i < len; i++){
+ var w = ws[i];
+ w.startup && !w._started && (!w.getParent || !w.getParent()) && w.startup();
+ }
+ }
+ return ws;
+ };
+
+ this.parse = function(rootNode, defaultParams){
+ // summary:
+ // Function to handle parsing for widgets in the current document.
+ // It is not as powerful as the full dojo parser, but it will handle basic
+ // use cases fine.
+ // rootNode:
+ // The root node in the document to parse from
+ if(!rootNode){
+ rootNode = dojo.body();
+ }else if(!defaultParams && rootNode.rootNode){
+ // Case where 'rootNode' is really a params object.
+ rootNode = rootNode.rootNode;
+ }
+
+ var nodes = rootNode.getElementsByTagName("*");
+ var list = [];
+ for(var i = 0, len = nodes.length; i < len; i++){
+ if(nodes[i].getAttribute("dojoType")){
+ list.push(nodes[i]);
+ }
+ }
+ return this.instantiate(list, defaultParams);
+ };
+}();
+dojo._loaders.unshift(function(){
+ if(dojo.config.parseOnLoad){
+ dojox.mobile.parser.parse();
+ }
+});
+
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/mobile/scrollable.js b/js/dojo-1.6/dojox/mobile/scrollable.js
new file mode 100644
index 0000000..aa2eedd
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/scrollable.js
@@ -0,0 +1,806 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+if(!dojo._hasResource["dojox.mobile.scrollable"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.scrollable"] = true;
+/*=====
+// summary:
+// Utility for enabling touch scrolling capability.
+// description:
+// Mobile WebKit browsers do not allow scrolling inner DIVs. (You need
+// the two-finger operation to scroll them.)
+// That means you cannot have fixed-positioned header/footer bars.
+// To solve this issue, this module disables the browsers default scrolling
+// behavior, and re-builds its own scrolling machinery by handling touch
+// events. In this module, this.domNode has height "100%" and is fixed to
+// the window, and this.containerNode scrolls. If you place a bar outside
+// of this.containerNode, then it will be fixed-positioned while
+// this.containerNode is scrollable.
+//
+// This module has the following features:
+// - Scrolls inner DIVs vertically, horizontally, or both.
+// - Vertical and horizontal scroll bars.
+// - Flashes the scroll bars when a view is shown.
+// - Simulates the flick operation using animation.
+// - Respects header/footer bars if any.
+//
+// dojox.mobile.scrollable is a simple function object, which holds
+// several properties and functions in it. But if you transform it to a
+// dojo class, it can be used as a mix-in class for any custom dojo
+// widgets. dojox.mobile._ScrollableMixin is such a class.
+//
+// Also, it can be used even for non-dojo applications. In such cases,
+// several dojo APIs used in this module, such as dojo.connect,
+// dojo.create, etc., are re-defined so that the code works without dojo.
+// When in dojo, of course those re-defined functions are not necessary.
+// So, they are surrounded by the excludeStart and excludeEnd directives
+// so that they will be excluded from the build.
+//
+// If you use this module for non-dojo application, you need to explicitly
+// assign your outer fixed node and inner scrollable node to this.domNode
+// and this.containerNode respectively.
+//
+// example:
+// Use this module from a non-dojo applicatoin:
+// | function onLoad(){
+// | var scrollable = new dojox.mobile.scrollable();
+// | scrollable.init({
+// | domNode: "outer", // id or node
+// | containerNode: "inner", // id or node
+// | fixedHeaderHeight: document.getElementById("hd1").offsetHeight
+// | });
+// | }
+// | <body onload="onLoad()">
+// | <h1 id="hd1" style="position:absolute;width:100%;z-index:1;">
+// | Fixed Header
+// | </h1>
+// | <div id="outer" style="height:100%;overflow:hidden;">
+// | <div id="inner" style="position:absolute;width:100%;">
+// | ... content ...
+// | </div>
+// | </div>
+// | </body>
+//
+=====*/
+
+if(typeof dojo != "undefined" && dojo.provide){
+ dojo.provide("dojox.mobile.scrollable");
+}else{
+ dojo = {doc:document, global:window, isWebKit:navigator.userAgent.indexOf("WebKit") != -1};
+ dojox = {mobile:{}};
+}
+
+dojox.mobile.scrollable = function(){
+ this.fixedHeaderHeight = 0; // height of a fixed header
+ this.fixedFooterHeight = 0; // height of a fixed footer
+ this.isLocalFooter = false; // footer is view-local (as opposed to application-wide)
+ this.scrollBar = true; // show scroll bar or not
+ this.scrollDir = "v"; // v: vertical, h: horizontal, vh: both, f: flip
+ this.weight = 0.6; // frictional drag
+ this.fadeScrollBar = true;
+ this.disableFlashScrollBar = false;
+
+
+ this.init = function(/*Object?*/params){
+ if (params){
+ for(var p in params){
+ if (params.hasOwnProperty(p)) {
+ this[p] = ((p == "domNode" || p == "containerNode") && typeof params[p] == "string") ?
+ dojo.doc.getElementById(params[p]) : params[p]; // mix-in params
+ }
+ }
+ }
+ this._v = (this.scrollDir.indexOf("v") != -1); // vertical scrolling
+ this._h = (this.scrollDir.indexOf("h") != -1); // horizontal scrolling
+ this._f = (this.scrollDir == "f"); // flipping views
+
+ this._ch = []; // connect handlers
+ this._ch.push(dojo.connect(this.containerNode,
+ dojox.mobile.hasTouch ? "touchstart" : "onmousedown", this, "onTouchStart"));
+ if(dojo.isWebKit){
+ this._ch.push(dojo.connect(this.containerNode, "webkitAnimationEnd", this, "onFlickAnimationEnd"));
+ this._ch.push(dojo.connect(this.containerNode, "webkitAnimationStart", this, "onFlickAnimationStart"));
+ }
+
+ if(dojo.global.onorientationchange !== undefined){
+ this._ch.push(dojo.connect(dojo.global, "onorientationchange", this, "resizeView"));
+ }else{
+ this._ch.push(dojo.connect(dojo.global, "onresize", this, "resizeView"));
+ }
+ this.resizeView();
+ var _this = this;
+ setTimeout(function(){
+ _this.flashScrollBar();
+ }, 600);
+ };
+
+ this.cleanup = function(){
+ for(var i = 0; i < this._ch.length; i++){
+ dojo.disconnect(this._ch[i]);
+ }
+ this._ch = null;
+ };
+
+ this.resizeView = function(e){
+ // moved from init() to support dynamically added fixed bars
+ this._appFooterHeight = (this.fixedFooterHeight && !this.isLocalFooter) ?
+ this.fixedFooterHeight : 0;
+ this.containerNode.style.paddingTop = this.fixedHeaderHeight + "px";
+
+ // has to wait a little for completion of hideAddressBar()
+ var c = 0;
+ var _this = this;
+ var id = setInterval(function() {
+ // adjust the height of this view a couple of times
+ _this.domNode.style.height = (dojo.global.innerHeight||dojo.doc.documentElement.clientHeight) - _this._appFooterHeight + "px";
+ _this.resetScrollBar();
+ if(c++ >= 4) { clearInterval(id); }
+ }, 300);
+ };
+
+ this.onFlickAnimationStart = function(e){
+ dojo.stopEvent(e);
+ };
+
+ this.onFlickAnimationEnd = function(e){
+ if(e && e.srcElement){
+ dojo.stopEvent(e);
+ }
+ this.stopAnimation();
+ if(this._bounce){
+ var _this = this;
+ var bounce = _this._bounce;
+ setTimeout(function(){
+ _this.slideTo(bounce, 0.3, "ease-out");
+ }, 0);
+ _this._bounce = undefined;
+ }else{
+ this.hideScrollBar();
+ this.removeCover();
+ }
+ };
+
+ this.onTouchStart = function(e){
+ if(this._conn && (new Date()).getTime() - this.startTime < 500){
+ return; // ignore successive onTouchStart calls
+ }
+ if(!this._conn){
+ this._conn = [];
+ this._conn.push(dojo.connect(dojo.doc, dojox.mobile.hasTouch ? "touchmove" : "onmousemove", this, "onTouchMove"));
+ this._conn.push(dojo.connect(dojo.doc, dojox.mobile.hasTouch ? "touchend" : "onmouseup", this, "onTouchEnd"));
+ }
+
+ this._aborted = false;
+ if(dojo.hasClass(this.containerNode, "mblScrollableScrollTo2")){
+ this.abort();
+ }
+ this.touchStartX = e.touches ? e.touches[0].pageX : e.clientX;
+ this.touchStartY = e.touches ? e.touches[0].pageY : e.clientY;
+ this.startTime = (new Date()).getTime();
+ this.startPos = this.getPos();
+ this._dim = this.getDim();
+ this._time = [0];
+ this._posX = [this.touchStartX];
+ this._posY = [this.touchStartY];
+
+ if(e.target.nodeType != 1 || (e.target.tagName != "SELECT" && e.target.tagName != "INPUT" && e.target.tagName != "TEXTAREA")){
+ dojo.stopEvent(e);
+ }
+ };
+
+ this.onTouchMove = function(e){
+ var x = e.touches ? e.touches[0].pageX : e.clientX;
+ var y = e.touches ? e.touches[0].pageY : e.clientY;
+ var dx = x - this.touchStartX;
+ var dy = y - this.touchStartY;
+ var to = {x:this.startPos.x + dx, y:this.startPos.y + dy};
+ var dim = this._dim;
+
+ if(this._time.length == 1){ // the first TouchMove after TouchStart
+ this.addCover();
+ this.showScrollBar();
+ }
+
+ var weight = this.weight;
+ if(this._v){
+ if(to.y > 0){ // content is below the screen area
+ to.y = Math.round(to.y * weight);
+ }else if(to.y < -dim.o.h){ // content is above the screen area
+ if(dim.c.h < dim.d.h){ // content is shorter than display
+ to.y = Math.round(to.y * weight);
+ }else{
+ to.y = -dim.o.h - Math.round((-dim.o.h - to.y) * weight);
+ }
+ }
+ }
+ if(this._h || this._f){
+ if(to.x > 0){
+ to.x = Math.round(to.x * weight);
+ }else if(to.x < -dim.o.w){
+ if(dim.c.w < dim.d.w){
+ to.x = Math.round(to.x * weight);
+ }else{
+ to.x = -dim.o.w - Math.round((-dim.o.w - to.x) * weight);
+ }
+ }
+ }
+ this.scrollTo(to);
+
+ var max = 10;
+ var n = this._time.length; // # of samples
+ if(n >= 2){
+ // Check the direction of the finger move.
+ // If the direction has been changed, discard the old data.
+ var d0, d1;
+ if(this._v && !this._h){
+ d0 = this._posY[n - 1] - this._posY[n - 2];
+ d1 = y - this._posY[n - 1];
+ }else if(!this._v && this._h){
+ d0 = this._posX[n - 1] - this._posX[n - 2];
+ d1 = x - this._posX[n - 1];
+ }
+ if(d0 * d1 < 0){ // direction changed
+ // leave only the latest data
+ this._time = [this._time[n - 1]];
+ this._posX = [this._posX[n - 1]];
+ this._posY = [this._posY[n - 1]];
+ n = 1;
+ }
+ }
+ if(n == max){
+ this._time.shift();
+ this._posX.shift();
+ this._posY.shift();
+ }
+ this._time.push((new Date()).getTime() - this.startTime);
+ this._posX.push(x);
+ this._posY.push(y);
+ };
+
+ this.onTouchEnd = function(e){
+ if(!this._conn){ return; } // if we get onTouchEnd without onTouchStart, ignore it.
+ for(var i = 0; i < this._conn.length; i++){
+ dojo.disconnect(this._conn[i]);
+ }
+ this._conn = null;
+
+ var n = this._time.length; // # of samples
+ var clicked = false;
+ if(!this._aborted){
+ if(n <= 1){
+ clicked = true;
+ }else if(n == 2 && Math.abs(this._posY[1] - this._posY[0]) < 4){
+ clicked = true;
+ }
+ }
+ if(clicked){ // clicked, not dragged or flicked
+ this.hideScrollBar();
+ this.removeCover();
+ if(dojox.mobile.hasTouch){
+ var elem = e.target;
+ if(elem.nodeType != 1){
+ elem = elem.parentNode;
+ }
+ var ev = dojo.doc.createEvent("MouseEvents");
+ ev.initEvent("click", true, true);
+ elem.dispatchEvent(ev);
+ }
+ return;
+ }
+ var speed = {x:0, y:0};
+ // if the user holds the mouse or finger more than 0.5 sec, do not move.
+ if(n >= 2 && (new Date()).getTime() - this.startTime - this._time[n - 1] < 500){
+ var dy = this._posY[n - (n > 3 ? 2 : 1)] - this._posY[(n - 6) >= 0 ? n - 6 : 0];
+ var dx = this._posX[n - (n > 3 ? 2 : 1)] - this._posX[(n - 6) >= 0 ? n - 6 : 0];
+ var dt = this._time[n - (n > 3 ? 2 : 1)] - this._time[(n - 6) >= 0 ? n - 6 : 0];
+ speed.y = this.calcSpeed(dy, dt);
+ speed.x = this.calcSpeed(dx, dt);
+ }
+
+ var pos = this.getPos();
+ var to = {}; // destination
+ var dim = this._dim;
+
+ if(this._v){
+ to.y = pos.y + speed.y;
+ }
+ if(this._h || this._f){
+ to.x = pos.x + speed.x;
+ }
+
+ if(this.scrollDir == "v" && dim.c.h <= dim.d.h){ // content is shorter than display
+ this.slideTo({y:0}, 0.3, "ease-out"); // go back to the top
+ return;
+ }else if(this.scrollDir == "h" && dim.c.w <= dim.d.w){ // content is narrower than display
+ this.slideTo({x:0}, 0.3, "ease-out"); // go back to the left
+ return;
+ }else if(this._v && this._h && dim.c.h <= dim.d.h && dim.c.w <= dim.d.w){
+ this.slideTo({x:0, y:0}, 0.3, "ease-out"); // go back to the top-left
+ return;
+ }
+
+ var duration, easing = "ease-out";
+ var bounce = {};
+ if(this._v){
+ if(to.y > 0){ // going down. bounce back to the top.
+ if(pos.y > 0){ // started from below the screen area. return quickly.
+ duration = 0.3;
+ to.y = 0;
+ }else{
+ to.y = Math.min(to.y, 20);
+ easing = "linear";
+ bounce.y = 0;
+ }
+ }else if(-speed.y > dim.o.h - (-pos.y)){ // going up. bounce back to the bottom.
+ if(pos.y < -dim.o.h){ // started from above the screen top. return quickly.
+ duration = 0.3;
+ to.y = dim.c.h <= dim.d.h ? 0 : -dim.o.h; // if shorter, move to 0
+ }else{
+ to.y = Math.max(to.y, -dim.o.h - 20);
+ easing = "linear";
+ bounce.y = -dim.o.h;
+ }
+ }
+ }
+ if(this._h || this._f){
+ if(to.x > 0){ // going right. bounce back to the left.
+ if(pos.x > 0){ // started from right of the screen area. return quickly.
+ duration = 0.3;
+ to.x = 0;
+ }else{
+ to.x = Math.min(to.x, 20);
+ easing = "linear";
+ bounce.x = 0;
+ }
+ }else if(-speed.x > dim.o.w - (-pos.x)){ // going left. bounce back to the right.
+ if(pos.x < -dim.o.w){ // started from left of the screen top. return quickly.
+ duration = 0.3;
+ to.x = dim.c.w <= dim.d.w ? 0 : -dim.o.w; // if narrower, move to 0
+ }else{
+ to.x = Math.max(to.x, -dim.o.w - 20);
+ easing = "linear";
+ bounce.x = -dim.o.w;
+ }
+ }
+ }
+ this._bounce = (bounce.x !== undefined || bounce.y !== undefined) ? bounce : undefined;
+
+ if(duration === undefined){
+ var distance, velocity;
+ if(this._v && this._h){
+ velocity = Math.sqrt(speed.x+speed.x + speed.y*speed.y);
+ distance = Math.sqrt(Math.pow(to.y - pos.y, 2) + Math.pow(to.x - pos.x, 2));
+ }else if(this._v){
+ velocity = speed.y;
+ distance = to.y - pos.y;
+ }else if(this._h){
+ velocity = speed.x;
+ distance = to.x - pos.x;
+ }
+ duration = velocity !== 0 ? Math.abs(distance / velocity) : 0.01; // time = distance / velocity
+ }
+ this.slideTo(to, duration, easing);
+ };
+
+ this.abort = function(){
+ this.scrollTo(this.getPos());
+ this.stopAnimation();
+ this._aborted = true;
+ };
+
+ this.stopAnimation = function(){
+ // stop the currently running animation
+ dojo.removeClass(this.containerNode, "mblScrollableScrollTo2");
+ if(this._scrollBarV){
+ this._scrollBarV.className = "";
+ }
+ if(this._scrollBarH){
+ this._scrollBarH.className = "";
+ }
+ };
+
+ this.calcSpeed = function(/*Number*/d, /*Number*/t){
+ return Math.round(d / t * 100) * 4;
+ };
+
+ this.scrollTo = function(/*Object*/to, /*?Boolean*/doNotMoveScrollBar){ // to: {x, y}
+ var s = this.containerNode.style;
+ if(dojo.isWebKit){
+ s.webkitTransform = this.makeTranslateStr(to);
+ }else{
+ if(this._v){
+ s.top = to.y + "px";
+ }
+ if(this._h || this._f){
+ s.left = to.x + "px";
+ }
+ }
+ if(!doNotMoveScrollBar){
+ this.scrollScrollBarTo(this.calcScrollBarPos(to));
+ }
+ };
+
+ this.slideTo = function(/*Object*/to, /*Number*/duration, /*String*/easing){
+ this._runSlideAnimation(this.getPos(), to, duration, easing, this.containerNode, 2);
+ this.slideScrollBarTo(to, duration, easing);
+ };
+
+ this.makeTranslateStr = function(to){
+ var y = this._v && typeof to.y == "number" ? to.y+"px" : "0px";
+ var x = (this._h||this._f) && typeof to.x == "number" ? to.x+"px" : "0px";
+ return dojox.mobile.hasTranslate3d ?
+ "translate3d("+x+","+y+",0px)" : "translate("+x+","+y+")";
+ };
+
+ this.getPos = function(){
+ // summary:
+ // Get the top position in the midst of animation
+ if(dojo.isWebKit){
+ var m = dojo.doc.defaultView.getComputedStyle(this.containerNode, '')["-webkit-transform"];
+ if(m && m.indexOf("matrix") === 0){
+ var arr = m.split(/[,\s\)]+/);
+ return {y:arr[5] - 0, x:arr[4] - 0};
+ }
+ return {x:0, y:0};
+ }else{
+ return {y:this.containerNode.offsetTop, x:this.containerNode.offsetLeft};
+ }
+ };
+
+ this.getDim = function(){
+ var d = {};
+ // content width/height
+ d.c = {h:this.containerNode.offsetHeight - this.fixedHeaderHeight, w:this.containerNode.offsetWidth};
+
+ // view width/height
+ d.v = {h:this.domNode.offsetHeight + this._appFooterHeight, w:this.domNode.offsetWidth};
+
+ // display width/height
+ d.d = {h:d.v.h - this.fixedHeaderHeight - this.fixedFooterHeight, w:d.v.w};
+
+ // overflowed width/height
+ d.o = {h:d.c.h - d.v.h + this.fixedHeaderHeight + this.fixedFooterHeight, w:d.c.w - d.v.w};
+ return d;
+ };
+
+ this.showScrollBar = function(){
+ if(!this.scrollBar){ return; }
+
+ var dim = this._dim;
+ if(this.scrollDir == "v" && dim.c.h <= dim.d.h){ return; }
+ if(this.scrollDir == "h" && dim.c.w <= dim.d.w){ return; }
+ if(this._v && this._h && dim.c.h <= dim.d.h && dim.c.w <= dim.d.w){ return; }
+
+ var createBar = function(self, dir){
+ var bar = self["_scrollBarNode" + dir];
+ if(!bar){
+ var wrapper = dojo.create("div", null, self.domNode);
+ var props = { position: "absolute", overflow: "hidden" };
+ if(dir == "V"){
+ props.right = "2px";
+ props.width = "5px";
+ }else{
+ props.bottom = (self.isLocalFooter ? self.fixedFooterHeight : 0) + 2 + "px";
+ props.height = "5px";
+ }
+ dojo.style(wrapper, props);
+ wrapper.className = "mblScrollBarWrapper";
+ self["_scrollBarWrapper"+dir] = wrapper;
+
+ bar = dojo.create("div", null, wrapper);
+ dojo.style(bar, {
+ opacity: 0.6,
+ position: "absolute",
+ backgroundColor: "#606060",
+ fontSize: "1px",
+ webkitBorderRadius: "2px",
+ MozBorderRadius: "2px",
+ webkitTransformOrigin: "0 0",
+ zIndex: 2147483647 // max of signed 32-bit integer
+ });
+ dojo.style(bar, dir == "V" ? {width: "5px"} : {height: "5px"});
+ self["_scrollBarNode" + dir] = bar;
+ }
+ return bar;
+ };
+ if(this._v && !this._scrollBarV){
+ this._scrollBarV = createBar(this, "V");
+ }
+ if(this._h && !this._scrollBarH){
+ this._scrollBarH = createBar(this, "H");
+ }
+ this.resetScrollBar();
+ };
+
+ this.hideScrollBar = function(){
+ var fadeRule;
+ if(this.fadeScrollBar && dojo.isWebKit){
+ if(!dojox.mobile._fadeRule){
+ var node = dojo.create("style", null, dojo.doc.getElementsByTagName("head")[0]);
+ node.textContent =
+ ".mblScrollableFadeOutScrollBar{"+
+ " -webkit-animation-duration: 1s;"+
+ " -webkit-animation-name: scrollableViewFadeOutScrollBar;}"+
+ "@-webkit-keyframes scrollableViewFadeOutScrollBar{"+
+ " from { opacity: 0.6; }"+
+ " 50% { opacity: 0.6; }"+
+ " to { opacity: 0; }}";
+ dojox.mobile._fadeRule = node.sheet.cssRules[1];
+ }
+ fadeRule = dojox.mobile._fadeRule;
+ }
+ if(!this.scrollBar){ return; }
+ var f = function(bar){
+ dojo.style(bar, {
+ opacity: 0,
+ webkitAnimationDuration: ""
+ });
+ bar.className = "mblScrollableFadeOutScrollBar";
+ };
+ if(this._scrollBarV){
+ f(this._scrollBarV);
+ this._scrollBarV = null;
+ }
+ if(this._scrollBarH){
+ f(this._scrollBarH);
+ this._scrollBarH = null;
+ }
+ };
+
+ this.calcScrollBarPos = function(/*Object*/to){ // to: {x, y}
+ var pos = {};
+ var dim = this._dim;
+ var f = function(wrapperH, barH, t, d, c){
+ var y = Math.round((d - barH - 8) / (d - c) * t);
+ if(y < -barH + 5){
+ y = -barH + 5;
+ }
+ if(y > wrapperH - 5){
+ y = wrapperH - 5;
+ }
+ return y;
+ };
+ if(typeof to.y == "number" && this._scrollBarV){
+ pos.y = f(this._scrollBarWrapperV.offsetHeight, this._scrollBarV.offsetHeight, to.y, dim.d.h, dim.c.h);
+ }
+ if(typeof to.x == "number" && this._scrollBarH){
+ pos.x = f(this._scrollBarWrapperH.offsetWidth, this._scrollBarH.offsetWidth, to.x, dim.d.w, dim.c.w);
+ }
+ return pos;
+ };
+
+ this.scrollScrollBarTo = function(/*Object*/to){ // to: {x, y}
+ if(!this.scrollBar){ return; }
+ if(this._v && this._scrollBarV && typeof to.y == "number"){
+ if(dojo.isWebKit){
+ this._scrollBarV.style.webkitTransform = this.makeTranslateStr({y:to.y});
+ }else{
+ this._scrollBarV.style.top = to.y + "px";
+ }
+ }
+ if(this._h && this._scrollBarH && typeof to.x == "number"){
+ if(dojo.isWebKit){
+ this._scrollBarH.style.webkitTransform = this.makeTranslateStr({x:to.x});
+ }else{
+ this._scrollBarH.style.left = to.x + "px";
+ }
+ }
+ };
+
+ this.slideScrollBarTo = function(/*Object*/to, /*Number*/duration, /*String*/easing){
+ if(!this.scrollBar){ return; }
+ var fromPos = this.calcScrollBarPos(this.getPos());
+ var toPos = this.calcScrollBarPos(to);
+ if(this._v && this._scrollBarV){
+ this._runSlideAnimation({y:fromPos.y}, {y:toPos.y}, duration, easing, this._scrollBarV, 0);
+ }
+ if(this._h && this._scrollBarH){
+ this._runSlideAnimation({x:fromPos.x}, {x:toPos.x}, duration, easing, this._scrollBarH, 1);
+ }
+ };
+
+ this._runSlideAnimation = function(/*Object*/from, /*Object*/to, /*Number*/duration, /*String*/easing, node, idx){
+ // idx: 0:scrollbarV, 1:scrollbarH, 2:content
+ if(dojo.isWebKit){
+ this.setKeyframes(from, to, idx);
+ dojo.style(node, {
+ webkitAnimationDuration: duration + "s",
+ webkitAnimationTimingFunction: easing
+ });
+ dojo.addClass(node, "mblScrollableScrollTo"+idx);
+ if(idx == 2){
+ this.scrollTo(to, true);
+ }else{
+ this.scrollScrollBarTo(to);
+ }
+ }else if(dojo.fx && dojo.fx.easing){
+ // If you want to support non-webkit browsers,
+ // your application needs to load necessary modules as follows:
+ //
+ // | dojo.require("dojo.fx");
+ // | dojo.require("dojo.fx.easing");
+ //
+ // This module itself does not make dependency on them.
+ var s = dojo.fx.slideTo({
+ node: node,
+ duration: duration*1000,
+ left: to.x,
+ top: to.y,
+ easing: (easing == "ease-out") ? dojo.fx.easing.quadOut : dojo.fx.easing.linear
+ }).play();
+ if(idx == 2){
+ dojo.connect(s, "onEnd", this, "onFlickAnimationEnd");
+ }
+ }else{
+ // directly jump to the destination without animation
+ if(idx == 2){
+ this.scrollTo(to);
+ this.onFlickAnimationEnd();
+ }else{
+ this.scrollScrollBarTo(to);
+ }
+ }
+ };
+
+ this.resetScrollBar = function(){
+ // summary:
+ // Resets the scroll bar length, position, etc.
+ var f = function(wrapper, bar, d, c, hd, v){
+ if(!bar){ return; }
+ var props = {};
+ props[v ? "top" : "left"] = hd + 4 + "px"; // +4 is for top or left margin
+ props[v ? "height" : "width"] = d - 8 + "px";
+ dojo.style(wrapper, props);
+ var l = Math.round(d * d / c); // scroll bar length
+ l = Math.min(Math.max(l - 8, 5), d - 8); // -8 is for margin for both ends
+ bar.style[v ? "height" : "width"] = l + "px";
+ dojo.style(bar, {"opacity": 0.6});
+ };
+ var dim = this.getDim();
+ f(this._scrollBarWrapperV, this._scrollBarV, dim.d.h, dim.c.h, this.fixedHeaderHeight, true);
+ f(this._scrollBarWrapperH, this._scrollBarH, dim.d.w, dim.c.w, 0);
+ this.createMask();
+ };
+
+ this.createMask = function(){
+ // summary:
+ // Creates a mask for a scroll bar edge.
+ // description:
+ // This function creates a mask that hides corners of one scroll
+ // bar edge to make it round edge. The other side of the edge is
+ // always visible and round shaped with the border-radius style.
+ if(!dojo.isWebKit){ return; }
+ var ctx;
+ if(this._scrollBarWrapperV){
+ var h = this._scrollBarWrapperV.offsetHeight;
+ ctx = dojo.doc.getCSSCanvasContext("2d", "scrollBarMaskV", 5, h);
+ ctx.fillStyle = "rgba(0,0,0,0.5)";
+ ctx.fillRect(1, 0, 3, 2);
+ ctx.fillRect(0, 1, 5, 1);
+ ctx.fillRect(0, h - 2, 5, 1);
+ ctx.fillRect(1, h - 1, 3, 2);
+ ctx.fillStyle = "rgb(0,0,0)";
+ ctx.fillRect(0, 2, 5, h - 4);
+ this._scrollBarWrapperV.style.webkitMaskImage = "-webkit-canvas(scrollBarMaskV)";
+ }
+ if(this._scrollBarWrapperH){
+ var w = this._scrollBarWrapperH.offsetWidth;
+ ctx = dojo.doc.getCSSCanvasContext("2d", "scrollBarMaskH", w, 5);
+ ctx.fillStyle = "rgba(0,0,0,0.5)";
+ ctx.fillRect(0, 1, 2, 3);
+ ctx.fillRect(1, 0, 1, 5);
+ ctx.fillRect(w - 2, 0, 1, 5);
+ ctx.fillRect(w - 1, 1, 2, 3);
+ ctx.fillStyle = "rgb(0,0,0)";
+ ctx.fillRect(2, 0, w - 4, 5);
+ this._scrollBarWrapperH.style.webkitMaskImage = "-webkit-canvas(scrollBarMaskH)";
+ }
+ };
+
+ this.flashScrollBar = function(){
+ if(this.disableFlashScrollBar){ return; }
+ this._dim = this.getDim();
+ if(this._dim.d.h <= 0){ return; } // dom is not ready
+ this.showScrollBar();
+ var _this = this;
+ setTimeout(function(){
+ _this.hideScrollBar();
+ }, 300);
+ };
+
+ this.addCover = function(){
+ if(!dojox.mobile.hasTouch && !this.noCover){
+ if(!this._cover){
+ this._cover = dojo.create("div", null, dojo.doc.body);
+ dojo.style(this._cover, {
+ backgroundColor: "#ffff00",
+ opacity: 0,
+ position: "absolute",
+ top: "0px",
+ left: "0px",
+ width: "100%",
+ height: "100%",
+ zIndex: 2147483647 // max of signed 32-bit integer
+ });
+ this._ch.push(dojo.connect(this._cover,
+ dojox.mobile.hasTouch ? "touchstart" : "onmousedown", this, "onTouchEnd"));
+ }else{
+ this._cover.style.display = "";
+ }
+ }
+ this.setSelectable(this.domNode, false);
+ var sel;
+ if(dojo.global.getSelection){
+ sel = dojo.global.getSelection();
+ sel.collapse(dojo.doc.body, 0);
+ }else{
+ sel = dojo.doc.selection.createRange();
+ sel.setEndPoint("EndToStart", sel);
+ sel.select();
+ }
+ };
+
+ this.removeCover = function(){
+ if(!dojox.mobile.hasTouch && this._cover){
+ this._cover.style.display = "none";
+ }
+ this.setSelectable(this.domNode, true);
+ };
+
+ this.setKeyframes = function(/*Object*/from, /*Object*/to, /*Number*/idx){
+ if(!dojox.mobile._rule){
+ dojox.mobile._rule = [];
+ }
+ // idx: 0:scrollbarV, 1:scrollbarH, 2:content
+ if(!dojox.mobile._rule[idx]){
+ var node = dojo.create("style", null, dojo.doc.getElementsByTagName("head")[0]);
+ node.textContent =
+ ".mblScrollableScrollTo"+idx+"{-webkit-animation-name: scrollableViewScroll"+idx+";}"+
+ "@-webkit-keyframes scrollableViewScroll"+idx+"{}";
+ dojox.mobile._rule[idx] = node.sheet.cssRules[1];
+ }
+ var rule = dojox.mobile._rule[idx];
+ if(rule){
+ if(from){
+ rule.deleteRule("from");
+ rule.insertRule("from { -webkit-transform: "+this.makeTranslateStr(from)+"; }");
+ }
+ if(to){
+ if(to.x === undefined){ to.x = from.x; }
+ if(to.y === undefined){ to.y = from.y; }
+ rule.deleteRule("to");
+ rule.insertRule("to { -webkit-transform: "+this.makeTranslateStr(to)+"; }");
+ }
+ }
+ };
+
+ this.setSelectable = function(node, selectable){
+ // dojo.setSelectable has dependency on dojo.query. Re-define our own.
+ node.style.KhtmlUserSelect = selectable ? "auto" : "none";
+ node.style.MozUserSelect = selectable ? "" : "none";
+ node.onselectstart = selectable ? null : function(){return false;};
+ node.unselectable = selectable ? "" : "on";
+ };
+
+};
+
+(function(){
+ // feature detection
+ if(dojo.isWebKit){
+ var elem = dojo.doc.createElement("div");
+ elem.style.webkitTransform = "translate3d(0px,1px,0px)";
+ dojo.doc.documentElement.appendChild(elem);
+ var v = dojo.doc.defaultView.getComputedStyle(elem, '')["-webkit-transform"];
+ dojox.mobile.hasTranslate3d = v && v.indexOf("matrix") === 0;
+ dojo.doc.documentElement.removeChild(elem);
+
+ dojox.mobile.hasTouch = (typeof dojo.doc.documentElement.ontouchstart != "undefined" &&
+ navigator.appVersion.indexOf("Mobile") != -1);
+ }
+})();
+
+}
diff --git a/js/dojo-1.6/dojox/mobile/scrollable.xd.js b/js/dojo-1.6/dojox/mobile/scrollable.xd.js
new file mode 100644
index 0000000..64a17f7
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/scrollable.xd.js
@@ -0,0 +1,810 @@
+/*
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
+ Available via Academic Free License >= 2.1 OR the modified BSD license.
+ see: http://dojotoolkit.org/license for details
+*/
+
+
+dojo._xdResourceLoaded(function(dojo, dijit, dojox){
+return {depends: [["provide", "dojox.mobile.scrollable"]],
+defineResource: function(dojo, dijit, dojox){if(!dojo._hasResource["dojox.mobile.scrollable"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dojox.mobile.scrollable"] = true;
+/*=====
+// summary:
+// Utility for enabling touch scrolling capability.
+// description:
+// Mobile WebKit browsers do not allow scrolling inner DIVs. (You need
+// the two-finger operation to scroll them.)
+// That means you cannot have fixed-positioned header/footer bars.
+// To solve this issue, this module disables the browsers default scrolling
+// behavior, and re-builds its own scrolling machinery by handling touch
+// events. In this module, this.domNode has height "100%" and is fixed to
+// the window, and this.containerNode scrolls. If you place a bar outside
+// of this.containerNode, then it will be fixed-positioned while
+// this.containerNode is scrollable.
+//
+// This module has the following features:
+// - Scrolls inner DIVs vertically, horizontally, or both.
+// - Vertical and horizontal scroll bars.
+// - Flashes the scroll bars when a view is shown.
+// - Simulates the flick operation using animation.
+// - Respects header/footer bars if any.
+//
+// dojox.mobile.scrollable is a simple function object, which holds
+// several properties and functions in it. But if you transform it to a
+// dojo class, it can be used as a mix-in class for any custom dojo
+// widgets. dojox.mobile._ScrollableMixin is such a class.
+//
+// Also, it can be used even for non-dojo applications. In such cases,
+// several dojo APIs used in this module, such as dojo.connect,
+// dojo.create, etc., are re-defined so that the code works without dojo.
+// When in dojo, of course those re-defined functions are not necessary.
+// So, they are surrounded by the excludeStart and excludeEnd directives
+// so that they will be excluded from the build.
+//
+// If you use this module for non-dojo application, you need to explicitly
+// assign your outer fixed node and inner scrollable node to this.domNode
+// and this.containerNode respectively.
+//
+// example:
+// Use this module from a non-dojo applicatoin:
+// | function onLoad(){
+// | var scrollable = new dojox.mobile.scrollable();
+// | scrollable.init({
+// | domNode: "outer", // id or node
+// | containerNode: "inner", // id or node
+// | fixedHeaderHeight: document.getElementById("hd1").offsetHeight
+// | });
+// | }
+// | <body onload="onLoad()">
+// | <h1 id="hd1" style="position:absolute;width:100%;z-index:1;">
+// | Fixed Header
+// | </h1>
+// | <div id="outer" style="height:100%;overflow:hidden;">
+// | <div id="inner" style="position:absolute;width:100%;">
+// | ... content ...
+// | </div>
+// | </div>
+// | </body>
+//
+=====*/
+
+if(typeof dojo != "undefined" && dojo.provide){
+ dojo.provide("dojox.mobile.scrollable");
+}else{
+ dojo = {doc:document, global:window, isWebKit:navigator.userAgent.indexOf("WebKit") != -1};
+ dojox = {mobile:{}};
+}
+
+dojox.mobile.scrollable = function(){
+ this.fixedHeaderHeight = 0; // height of a fixed header
+ this.fixedFooterHeight = 0; // height of a fixed footer
+ this.isLocalFooter = false; // footer is view-local (as opposed to application-wide)
+ this.scrollBar = true; // show scroll bar or not
+ this.scrollDir = "v"; // v: vertical, h: horizontal, vh: both, f: flip
+ this.weight = 0.6; // frictional drag
+ this.fadeScrollBar = true;
+ this.disableFlashScrollBar = false;
+
+
+ this.init = function(/*Object?*/params){
+ if (params){
+ for(var p in params){
+ if (params.hasOwnProperty(p)) {
+ this[p] = ((p == "domNode" || p == "containerNode") && typeof params[p] == "string") ?
+ dojo.doc.getElementById(params[p]) : params[p]; // mix-in params
+ }
+ }
+ }
+ this._v = (this.scrollDir.indexOf("v") != -1); // vertical scrolling
+ this._h = (this.scrollDir.indexOf("h") != -1); // horizontal scrolling
+ this._f = (this.scrollDir == "f"); // flipping views
+
+ this._ch = []; // connect handlers
+ this._ch.push(dojo.connect(this.containerNode,
+ dojox.mobile.hasTouch ? "touchstart" : "onmousedown", this, "onTouchStart"));
+ if(dojo.isWebKit){
+ this._ch.push(dojo.connect(this.containerNode, "webkitAnimationEnd", this, "onFlickAnimationEnd"));
+ this._ch.push(dojo.connect(this.containerNode, "webkitAnimationStart", this, "onFlickAnimationStart"));
+ }
+
+ if(dojo.global.onorientationchange !== undefined){
+ this._ch.push(dojo.connect(dojo.global, "onorientationchange", this, "resizeView"));
+ }else{
+ this._ch.push(dojo.connect(dojo.global, "onresize", this, "resizeView"));
+ }
+ this.resizeView();
+ var _this = this;
+ setTimeout(function(){
+ _this.flashScrollBar();
+ }, 600);
+ };
+
+ this.cleanup = function(){
+ for(var i = 0; i < this._ch.length; i++){
+ dojo.disconnect(this._ch[i]);
+ }
+ this._ch = null;
+ };
+
+ this.resizeView = function(e){
+ // moved from init() to support dynamically added fixed bars
+ this._appFooterHeight = (this.fixedFooterHeight && !this.isLocalFooter) ?
+ this.fixedFooterHeight : 0;
+ this.containerNode.style.paddingTop = this.fixedHeaderHeight + "px";
+
+ // has to wait a little for completion of hideAddressBar()
+ var c = 0;
+ var _this = this;
+ var id = setInterval(function() {
+ // adjust the height of this view a couple of times
+ _this.domNode.style.height = (dojo.global.innerHeight||dojo.doc.documentElement.clientHeight) - _this._appFooterHeight + "px";
+ _this.resetScrollBar();
+ if(c++ >= 4) { clearInterval(id); }
+ }, 300);
+ };
+
+ this.onFlickAnimationStart = function(e){
+ dojo.stopEvent(e);
+ };
+
+ this.onFlickAnimationEnd = function(e){
+ if(e && e.srcElement){
+ dojo.stopEvent(e);
+ }
+ this.stopAnimation();
+ if(this._bounce){
+ var _this = this;
+ var bounce = _this._bounce;
+ setTimeout(function(){
+ _this.slideTo(bounce, 0.3, "ease-out");
+ }, 0);
+ _this._bounce = undefined;
+ }else{
+ this.hideScrollBar();
+ this.removeCover();
+ }
+ };
+
+ this.onTouchStart = function(e){
+ if(this._conn && (new Date()).getTime() - this.startTime < 500){
+ return; // ignore successive onTouchStart calls
+ }
+ if(!this._conn){
+ this._conn = [];
+ this._conn.push(dojo.connect(dojo.doc, dojox.mobile.hasTouch ? "touchmove" : "onmousemove", this, "onTouchMove"));
+ this._conn.push(dojo.connect(dojo.doc, dojox.mobile.hasTouch ? "touchend" : "onmouseup", this, "onTouchEnd"));
+ }
+
+ this._aborted = false;
+ if(dojo.hasClass(this.containerNode, "mblScrollableScrollTo2")){
+ this.abort();
+ }
+ this.touchStartX = e.touches ? e.touches[0].pageX : e.clientX;
+ this.touchStartY = e.touches ? e.touches[0].pageY : e.clientY;
+ this.startTime = (new Date()).getTime();
+ this.startPos = this.getPos();
+ this._dim = this.getDim();
+ this._time = [0];
+ this._posX = [this.touchStartX];
+ this._posY = [this.touchStartY];
+
+ if(e.target.nodeType != 1 || (e.target.tagName != "SELECT" && e.target.tagName != "INPUT" && e.target.tagName != "TEXTAREA")){
+ dojo.stopEvent(e);
+ }
+ };
+
+ this.onTouchMove = function(e){
+ var x = e.touches ? e.touches[0].pageX : e.clientX;
+ var y = e.touches ? e.touches[0].pageY : e.clientY;
+ var dx = x - this.touchStartX;
+ var dy = y - this.touchStartY;
+ var to = {x:this.startPos.x + dx, y:this.startPos.y + dy};
+ var dim = this._dim;
+
+ if(this._time.length == 1){ // the first TouchMove after TouchStart
+ this.addCover();
+ this.showScrollBar();
+ }
+
+ var weight = this.weight;
+ if(this._v){
+ if(to.y > 0){ // content is below the screen area
+ to.y = Math.round(to.y * weight);
+ }else if(to.y < -dim.o.h){ // content is above the screen area
+ if(dim.c.h < dim.d.h){ // content is shorter than display
+ to.y = Math.round(to.y * weight);
+ }else{
+ to.y = -dim.o.h - Math.round((-dim.o.h - to.y) * weight);
+ }
+ }
+ }
+ if(this._h || this._f){
+ if(to.x > 0){
+ to.x = Math.round(to.x * weight);
+ }else if(to.x < -dim.o.w){
+ if(dim.c.w < dim.d.w){
+ to.x = Math.round(to.x * weight);
+ }else{
+ to.x = -dim.o.w - Math.round((-dim.o.w - to.x) * weight);
+ }
+ }
+ }
+ this.scrollTo(to);
+
+ var max = 10;
+ var n = this._time.length; // # of samples
+ if(n >= 2){
+ // Check the direction of the finger move.
+ // If the direction has been changed, discard the old data.
+ var d0, d1;
+ if(this._v && !this._h){
+ d0 = this._posY[n - 1] - this._posY[n - 2];
+ d1 = y - this._posY[n - 1];
+ }else if(!this._v && this._h){
+ d0 = this._posX[n - 1] - this._posX[n - 2];
+ d1 = x - this._posX[n - 1];
+ }
+ if(d0 * d1 < 0){ // direction changed
+ // leave only the latest data
+ this._time = [this._time[n - 1]];
+ this._posX = [this._posX[n - 1]];
+ this._posY = [this._posY[n - 1]];
+ n = 1;
+ }
+ }
+ if(n == max){
+ this._time.shift();
+ this._posX.shift();
+ this._posY.shift();
+ }
+ this._time.push((new Date()).getTime() - this.startTime);
+ this._posX.push(x);
+ this._posY.push(y);
+ };
+
+ this.onTouchEnd = function(e){
+ if(!this._conn){ return; } // if we get onTouchEnd without onTouchStart, ignore it.
+ for(var i = 0; i < this._conn.length; i++){
+ dojo.disconnect(this._conn[i]);
+ }
+ this._conn = null;
+
+ var n = this._time.length; // # of samples
+ var clicked = false;
+ if(!this._aborted){
+ if(n <= 1){
+ clicked = true;
+ }else if(n == 2 && Math.abs(this._posY[1] - this._posY[0]) < 4){
+ clicked = true;
+ }
+ }
+ if(clicked){ // clicked, not dragged or flicked
+ this.hideScrollBar();
+ this.removeCover();
+ if(dojox.mobile.hasTouch){
+ var elem = e.target;
+ if(elem.nodeType != 1){
+ elem = elem.parentNode;
+ }
+ var ev = dojo.doc.createEvent("MouseEvents");
+ ev.initEvent("click", true, true);
+ elem.dispatchEvent(ev);
+ }
+ return;
+ }
+ var speed = {x:0, y:0};
+ // if the user holds the mouse or finger more than 0.5 sec, do not move.
+ if(n >= 2 && (new Date()).getTime() - this.startTime - this._time[n - 1] < 500){
+ var dy = this._posY[n - (n > 3 ? 2 : 1)] - this._posY[(n - 6) >= 0 ? n - 6 : 0];
+ var dx = this._posX[n - (n > 3 ? 2 : 1)] - this._posX[(n - 6) >= 0 ? n - 6 : 0];
+ var dt = this._time[n - (n > 3 ? 2 : 1)] - this._time[(n - 6) >= 0 ? n - 6 : 0];
+ speed.y = this.calcSpeed(dy, dt);
+ speed.x = this.calcSpeed(dx, dt);
+ }
+
+ var pos = this.getPos();
+ var to = {}; // destination
+ var dim = this._dim;
+
+ if(this._v){
+ to.y = pos.y + speed.y;
+ }
+ if(this._h || this._f){
+ to.x = pos.x + speed.x;
+ }
+
+ if(this.scrollDir == "v" && dim.c.h <= dim.d.h){ // content is shorter than display
+ this.slideTo({y:0}, 0.3, "ease-out"); // go back to the top
+ return;
+ }else if(this.scrollDir == "h" && dim.c.w <= dim.d.w){ // content is narrower than display
+ this.slideTo({x:0}, 0.3, "ease-out"); // go back to the left
+ return;
+ }else if(this._v && this._h && dim.c.h <= dim.d.h && dim.c.w <= dim.d.w){
+ this.slideTo({x:0, y:0}, 0.3, "ease-out"); // go back to the top-left
+ return;
+ }
+
+ var duration, easing = "ease-out";
+ var bounce = {};
+ if(this._v){
+ if(to.y > 0){ // going down. bounce back to the top.
+ if(pos.y > 0){ // started from below the screen area. return quickly.
+ duration = 0.3;
+ to.y = 0;
+ }else{
+ to.y = Math.min(to.y, 20);
+ easing = "linear";
+ bounce.y = 0;
+ }
+ }else if(-speed.y > dim.o.h - (-pos.y)){ // going up. bounce back to the bottom.
+ if(pos.y < -dim.o.h){ // started from above the screen top. return quickly.
+ duration = 0.3;
+ to.y = dim.c.h <= dim.d.h ? 0 : -dim.o.h; // if shorter, move to 0
+ }else{
+ to.y = Math.max(to.y, -dim.o.h - 20);
+ easing = "linear";
+ bounce.y = -dim.o.h;
+ }
+ }
+ }
+ if(this._h || this._f){
+ if(to.x > 0){ // going right. bounce back to the left.
+ if(pos.x > 0){ // started from right of the screen area. return quickly.
+ duration = 0.3;
+ to.x = 0;
+ }else{
+ to.x = Math.min(to.x, 20);
+ easing = "linear";
+ bounce.x = 0;
+ }
+ }else if(-speed.x > dim.o.w - (-pos.x)){ // going left. bounce back to the right.
+ if(pos.x < -dim.o.w){ // started from left of the screen top. return quickly.
+ duration = 0.3;
+ to.x = dim.c.w <= dim.d.w ? 0 : -dim.o.w; // if narrower, move to 0
+ }else{
+ to.x = Math.max(to.x, -dim.o.w - 20);
+ easing = "linear";
+ bounce.x = -dim.o.w;
+ }
+ }
+ }
+ this._bounce = (bounce.x !== undefined || bounce.y !== undefined) ? bounce : undefined;
+
+ if(duration === undefined){
+ var distance, velocity;
+ if(this._v && this._h){
+ velocity = Math.sqrt(speed.x+speed.x + speed.y*speed.y);
+ distance = Math.sqrt(Math.pow(to.y - pos.y, 2) + Math.pow(to.x - pos.x, 2));
+ }else if(this._v){
+ velocity = speed.y;
+ distance = to.y - pos.y;
+ }else if(this._h){
+ velocity = speed.x;
+ distance = to.x - pos.x;
+ }
+ duration = velocity !== 0 ? Math.abs(distance / velocity) : 0.01; // time = distance / velocity
+ }
+ this.slideTo(to, duration, easing);
+ };
+
+ this.abort = function(){
+ this.scrollTo(this.getPos());
+ this.stopAnimation();
+ this._aborted = true;
+ };
+
+ this.stopAnimation = function(){
+ // stop the currently running animation
+ dojo.removeClass(this.containerNode, "mblScrollableScrollTo2");
+ if(this._scrollBarV){
+ this._scrollBarV.className = "";
+ }
+ if(this._scrollBarH){
+ this._scrollBarH.className = "";
+ }
+ };
+
+ this.calcSpeed = function(/*Number*/d, /*Number*/t){
+ return Math.round(d / t * 100) * 4;
+ };
+
+ this.scrollTo = function(/*Object*/to, /*?Boolean*/doNotMoveScrollBar){ // to: {x, y}
+ var s = this.containerNode.style;
+ if(dojo.isWebKit){
+ s.webkitTransform = this.makeTranslateStr(to);
+ }else{
+ if(this._v){
+ s.top = to.y + "px";
+ }
+ if(this._h || this._f){
+ s.left = to.x + "px";
+ }
+ }
+ if(!doNotMoveScrollBar){
+ this.scrollScrollBarTo(this.calcScrollBarPos(to));
+ }
+ };
+
+ this.slideTo = function(/*Object*/to, /*Number*/duration, /*String*/easing){
+ this._runSlideAnimation(this.getPos(), to, duration, easing, this.containerNode, 2);
+ this.slideScrollBarTo(to, duration, easing);
+ };
+
+ this.makeTranslateStr = function(to){
+ var y = this._v && typeof to.y == "number" ? to.y+"px" : "0px";
+ var x = (this._h||this._f) && typeof to.x == "number" ? to.x+"px" : "0px";
+ return dojox.mobile.hasTranslate3d ?
+ "translate3d("+x+","+y+",0px)" : "translate("+x+","+y+")";
+ };
+
+ this.getPos = function(){
+ // summary:
+ // Get the top position in the midst of animation
+ if(dojo.isWebKit){
+ var m = dojo.doc.defaultView.getComputedStyle(this.containerNode, '')["-webkit-transform"];
+ if(m && m.indexOf("matrix") === 0){
+ var arr = m.split(/[,\s\)]+/);
+ return {y:arr[5] - 0, x:arr[4] - 0};
+ }
+ return {x:0, y:0};
+ }else{
+ return {y:this.containerNode.offsetTop, x:this.containerNode.offsetLeft};
+ }
+ };
+
+ this.getDim = function(){
+ var d = {};
+ // content width/height
+ d.c = {h:this.containerNode.offsetHeight - this.fixedHeaderHeight, w:this.containerNode.offsetWidth};
+
+ // view width/height
+ d.v = {h:this.domNode.offsetHeight + this._appFooterHeight, w:this.domNode.offsetWidth};
+
+ // display width/height
+ d.d = {h:d.v.h - this.fixedHeaderHeight - this.fixedFooterHeight, w:d.v.w};
+
+ // overflowed width/height
+ d.o = {h:d.c.h - d.v.h + this.fixedHeaderHeight + this.fixedFooterHeight, w:d.c.w - d.v.w};
+ return d;
+ };
+
+ this.showScrollBar = function(){
+ if(!this.scrollBar){ return; }
+
+ var dim = this._dim;
+ if(this.scrollDir == "v" && dim.c.h <= dim.d.h){ return; }
+ if(this.scrollDir == "h" && dim.c.w <= dim.d.w){ return; }
+ if(this._v && this._h && dim.c.h <= dim.d.h && dim.c.w <= dim.d.w){ return; }
+
+ var createBar = function(self, dir){
+ var bar = self["_scrollBarNode" + dir];
+ if(!bar){
+ var wrapper = dojo.create("div", null, self.domNode);
+ var props = { position: "absolute", overflow: "hidden" };
+ if(dir == "V"){
+ props.right = "2px";
+ props.width = "5px";
+ }else{
+ props.bottom = (self.isLocalFooter ? self.fixedFooterHeight : 0) + 2 + "px";
+ props.height = "5px";
+ }
+ dojo.style(wrapper, props);
+ wrapper.className = "mblScrollBarWrapper";
+ self["_scrollBarWrapper"+dir] = wrapper;
+
+ bar = dojo.create("div", null, wrapper);
+ dojo.style(bar, {
+ opacity: 0.6,
+ position: "absolute",
+ backgroundColor: "#606060",
+ fontSize: "1px",
+ webkitBorderRadius: "2px",
+ MozBorderRadius: "2px",
+ webkitTransformOrigin: "0 0",
+ zIndex: 2147483647 // max of signed 32-bit integer
+ });
+ dojo.style(bar, dir == "V" ? {width: "5px"} : {height: "5px"});
+ self["_scrollBarNode" + dir] = bar;
+ }
+ return bar;
+ };
+ if(this._v && !this._scrollBarV){
+ this._scrollBarV = createBar(this, "V");
+ }
+ if(this._h && !this._scrollBarH){
+ this._scrollBarH = createBar(this, "H");
+ }
+ this.resetScrollBar();
+ };
+
+ this.hideScrollBar = function(){
+ var fadeRule;
+ if(this.fadeScrollBar && dojo.isWebKit){
+ if(!dojox.mobile._fadeRule){
+ var node = dojo.create("style", null, dojo.doc.getElementsByTagName("head")[0]);
+ node.textContent =
+ ".mblScrollableFadeOutScrollBar{"+
+ " -webkit-animation-duration: 1s;"+
+ " -webkit-animation-name: scrollableViewFadeOutScrollBar;}"+
+ "@-webkit-keyframes scrollableViewFadeOutScrollBar{"+
+ " from { opacity: 0.6; }"+
+ " 50% { opacity: 0.6; }"+
+ " to { opacity: 0; }}";
+ dojox.mobile._fadeRule = node.sheet.cssRules[1];
+ }
+ fadeRule = dojox.mobile._fadeRule;
+ }
+ if(!this.scrollBar){ return; }
+ var f = function(bar){
+ dojo.style(bar, {
+ opacity: 0,
+ webkitAnimationDuration: ""
+ });
+ bar.className = "mblScrollableFadeOutScrollBar";
+ };
+ if(this._scrollBarV){
+ f(this._scrollBarV);
+ this._scrollBarV = null;
+ }
+ if(this._scrollBarH){
+ f(this._scrollBarH);
+ this._scrollBarH = null;
+ }
+ };
+
+ this.calcScrollBarPos = function(/*Object*/to){ // to: {x, y}
+ var pos = {};
+ var dim = this._dim;
+ var f = function(wrapperH, barH, t, d, c){
+ var y = Math.round((d - barH - 8) / (d - c) * t);
+ if(y < -barH + 5){
+ y = -barH + 5;
+ }
+ if(y > wrapperH - 5){
+ y = wrapperH - 5;
+ }
+ return y;
+ };
+ if(typeof to.y == "number" && this._scrollBarV){
+ pos.y = f(this._scrollBarWrapperV.offsetHeight, this._scrollBarV.offsetHeight, to.y, dim.d.h, dim.c.h);
+ }
+ if(typeof to.x == "number" && this._scrollBarH){
+ pos.x = f(this._scrollBarWrapperH.offsetWidth, this._scrollBarH.offsetWidth, to.x, dim.d.w, dim.c.w);
+ }
+ return pos;
+ };
+
+ this.scrollScrollBarTo = function(/*Object*/to){ // to: {x, y}
+ if(!this.scrollBar){ return; }
+ if(this._v && this._scrollBarV && typeof to.y == "number"){
+ if(dojo.isWebKit){
+ this._scrollBarV.style.webkitTransform = this.makeTranslateStr({y:to.y});
+ }else{
+ this._scrollBarV.style.top = to.y + "px";
+ }
+ }
+ if(this._h && this._scrollBarH && typeof to.x == "number"){
+ if(dojo.isWebKit){
+ this._scrollBarH.style.webkitTransform = this.makeTranslateStr({x:to.x});
+ }else{
+ this._scrollBarH.style.left = to.x + "px";
+ }
+ }
+ };
+
+ this.slideScrollBarTo = function(/*Object*/to, /*Number*/duration, /*String*/easing){
+ if(!this.scrollBar){ return; }
+ var fromPos = this.calcScrollBarPos(this.getPos());
+ var toPos = this.calcScrollBarPos(to);
+ if(this._v && this._scrollBarV){
+ this._runSlideAnimation({y:fromPos.y}, {y:toPos.y}, duration, easing, this._scrollBarV, 0);
+ }
+ if(this._h && this._scrollBarH){
+ this._runSlideAnimation({x:fromPos.x}, {x:toPos.x}, duration, easing, this._scrollBarH, 1);
+ }
+ };
+
+ this._runSlideAnimation = function(/*Object*/from, /*Object*/to, /*Number*/duration, /*String*/easing, node, idx){
+ // idx: 0:scrollbarV, 1:scrollbarH, 2:content
+ if(dojo.isWebKit){
+ this.setKeyframes(from, to, idx);
+ dojo.style(node, {
+ webkitAnimationDuration: duration + "s",
+ webkitAnimationTimingFunction: easing
+ });
+ dojo.addClass(node, "mblScrollableScrollTo"+idx);
+ if(idx == 2){
+ this.scrollTo(to, true);
+ }else{
+ this.scrollScrollBarTo(to);
+ }
+ }else if(dojo.fx && dojo.fx.easing){
+ // If you want to support non-webkit browsers,
+ // your application needs to load necessary modules as follows:
+ //
+ // | dojo.require("dojo.fx");
+ // | dojo.require("dojo.fx.easing");
+ //
+ // This module itself does not make dependency on them.
+ var s = dojo.fx.slideTo({
+ node: node,
+ duration: duration*1000,
+ left: to.x,
+ top: to.y,
+ easing: (easing == "ease-out") ? dojo.fx.easing.quadOut : dojo.fx.easing.linear
+ }).play();
+ if(idx == 2){
+ dojo.connect(s, "onEnd", this, "onFlickAnimationEnd");
+ }
+ }else{
+ // directly jump to the destination without animation
+ if(idx == 2){
+ this.scrollTo(to);
+ this.onFlickAnimationEnd();
+ }else{
+ this.scrollScrollBarTo(to);
+ }
+ }
+ };
+
+ this.resetScrollBar = function(){
+ // summary:
+ // Resets the scroll bar length, position, etc.
+ var f = function(wrapper, bar, d, c, hd, v){
+ if(!bar){ return; }
+ var props = {};
+ props[v ? "top" : "left"] = hd + 4 + "px"; // +4 is for top or left margin
+ props[v ? "height" : "width"] = d - 8 + "px";
+ dojo.style(wrapper, props);
+ var l = Math.round(d * d / c); // scroll bar length
+ l = Math.min(Math.max(l - 8, 5), d - 8); // -8 is for margin for both ends
+ bar.style[v ? "height" : "width"] = l + "px";
+ dojo.style(bar, {"opacity": 0.6});
+ };
+ var dim = this.getDim();
+ f(this._scrollBarWrapperV, this._scrollBarV, dim.d.h, dim.c.h, this.fixedHeaderHeight, true);
+ f(this._scrollBarWrapperH, this._scrollBarH, dim.d.w, dim.c.w, 0);
+ this.createMask();
+ };
+
+ this.createMask = function(){
+ // summary:
+ // Creates a mask for a scroll bar edge.
+ // description:
+ // This function creates a mask that hides corners of one scroll
+ // bar edge to make it round edge. The other side of the edge is
+ // always visible and round shaped with the border-radius style.
+ if(!dojo.isWebKit){ return; }
+ var ctx;
+ if(this._scrollBarWrapperV){
+ var h = this._scrollBarWrapperV.offsetHeight;
+ ctx = dojo.doc.getCSSCanvasContext("2d", "scrollBarMaskV", 5, h);
+ ctx.fillStyle = "rgba(0,0,0,0.5)";
+ ctx.fillRect(1, 0, 3, 2);
+ ctx.fillRect(0, 1, 5, 1);
+ ctx.fillRect(0, h - 2, 5, 1);
+ ctx.fillRect(1, h - 1, 3, 2);
+ ctx.fillStyle = "rgb(0,0,0)";
+ ctx.fillRect(0, 2, 5, h - 4);
+ this._scrollBarWrapperV.style.webkitMaskImage = "-webkit-canvas(scrollBarMaskV)";
+ }
+ if(this._scrollBarWrapperH){
+ var w = this._scrollBarWrapperH.offsetWidth;
+ ctx = dojo.doc.getCSSCanvasContext("2d", "scrollBarMaskH", w, 5);
+ ctx.fillStyle = "rgba(0,0,0,0.5)";
+ ctx.fillRect(0, 1, 2, 3);
+ ctx.fillRect(1, 0, 1, 5);
+ ctx.fillRect(w - 2, 0, 1, 5);
+ ctx.fillRect(w - 1, 1, 2, 3);
+ ctx.fillStyle = "rgb(0,0,0)";
+ ctx.fillRect(2, 0, w - 4, 5);
+ this._scrollBarWrapperH.style.webkitMaskImage = "-webkit-canvas(scrollBarMaskH)";
+ }
+ };
+
+ this.flashScrollBar = function(){
+ if(this.disableFlashScrollBar){ return; }
+ this._dim = this.getDim();
+ if(this._dim.d.h <= 0){ return; } // dom is not ready
+ this.showScrollBar();
+ var _this = this;
+ setTimeout(function(){
+ _this.hideScrollBar();
+ }, 300);
+ };
+
+ this.addCover = function(){
+ if(!dojox.mobile.hasTouch && !this.noCover){
+ if(!this._cover){
+ this._cover = dojo.create("div", null, dojo.doc.body);
+ dojo.style(this._cover, {
+ backgroundColor: "#ffff00",
+ opacity: 0,
+ position: "absolute",
+ top: "0px",
+ left: "0px",
+ width: "100%",
+ height: "100%",
+ zIndex: 2147483647 // max of signed 32-bit integer
+ });
+ this._ch.push(dojo.connect(this._cover,
+ dojox.mobile.hasTouch ? "touchstart" : "onmousedown", this, "onTouchEnd"));
+ }else{
+ this._cover.style.display = "";
+ }
+ }
+ this.setSelectable(this.domNode, false);
+ var sel;
+ if(dojo.global.getSelection){
+ sel = dojo.global.getSelection();
+ sel.collapse(dojo.doc.body, 0);
+ }else{
+ sel = dojo.doc.selection.createRange();
+ sel.setEndPoint("EndToStart", sel);
+ sel.select();
+ }
+ };
+
+ this.removeCover = function(){
+ if(!dojox.mobile.hasTouch && this._cover){
+ this._cover.style.display = "none";
+ }
+ this.setSelectable(this.domNode, true);
+ };
+
+ this.setKeyframes = function(/*Object*/from, /*Object*/to, /*Number*/idx){
+ if(!dojox.mobile._rule){
+ dojox.mobile._rule = [];
+ }
+ // idx: 0:scrollbarV, 1:scrollbarH, 2:content
+ if(!dojox.mobile._rule[idx]){
+ var node = dojo.create("style", null, dojo.doc.getElementsByTagName("head")[0]);
+ node.textContent =
+ ".mblScrollableScrollTo"+idx+"{-webkit-animation-name: scrollableViewScroll"+idx+";}"+
+ "@-webkit-keyframes scrollableViewScroll"+idx+"{}";
+ dojox.mobile._rule[idx] = node.sheet.cssRules[1];
+ }
+ var rule = dojox.mobile._rule[idx];
+ if(rule){
+ if(from){
+ rule.deleteRule("from");
+ rule.insertRule("from { -webkit-transform: "+this.makeTranslateStr(from)+"; }");
+ }
+ if(to){
+ if(to.x === undefined){ to.x = from.x; }
+ if(to.y === undefined){ to.y = from.y; }
+ rule.deleteRule("to");
+ rule.insertRule("to { -webkit-transform: "+this.makeTranslateStr(to)+"; }");
+ }
+ }
+ };
+
+ this.setSelectable = function(node, selectable){
+ // dojo.setSelectable has dependency on dojo.query. Re-define our own.
+ node.style.KhtmlUserSelect = selectable ? "auto" : "none";
+ node.style.MozUserSelect = selectable ? "" : "none";
+ node.onselectstart = selectable ? null : function(){return false;};
+ node.unselectable = selectable ? "" : "on";
+ };
+
+};
+
+(function(){
+ // feature detection
+ if(dojo.isWebKit){
+ var elem = dojo.doc.createElement("div");
+ elem.style.webkitTransform = "translate3d(0px,1px,0px)";
+ dojo.doc.documentElement.appendChild(elem);
+ var v = dojo.doc.defaultView.getComputedStyle(elem, '')["-webkit-transform"];
+ dojox.mobile.hasTranslate3d = v && v.indexOf("matrix") === 0;
+ dojo.doc.documentElement.removeChild(elem);
+
+ dojox.mobile.hasTouch = (typeof dojo.doc.documentElement.ontouchstart != "undefined" &&
+ navigator.appVersion.indexOf("Mobile") != -1);
+ }
+})();
+
+}
+
+}};});
diff --git a/js/dojo-1.6/dojox/mobile/themes/FixedSplitter.css b/js/dojo-1.6/dojox/mobile/themes/FixedSplitter.css
new file mode 100644
index 0000000..6788969
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/FixedSplitter.css
@@ -0,0 +1,22 @@
+.mblFixedSpliter {
+ width: 100%;
+ height: 100%;
+}
+
+.mblFixedSplitterPane {
+ position: absolute;
+ overflow-x: hidden;
+ overflow-y: auto;
+}
+
+.mblFixedSplitterPaneH {
+ position: absolute;
+ height: 100%;
+ top: 0px;
+}
+
+.mblFixedSplitterPaneV {
+ position: absolute;
+ width: 100%;
+ left: 0px;
+}
diff --git a/js/dojo-1.6/dojox/mobile/themes/android/android-app-compat.css b/js/dojo-1.6/dojox/mobile/themes/android/android-app-compat.css
new file mode 100644
index 0000000..dc0a814
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/android/android-app-compat.css
@@ -0,0 +1,24 @@
+/* mbl.widget.Heading */
+@import url("iphone-compat.css");
+
+.alertTitle {
+ background-image: url(compat/heading-bg.png);
+}
+
+.mblImageThumbView .mblThumb {
+ -moz-transition: all 0.5s ease-in-out;
+ -o-transition: all 0.5s ease-in-out;
+}
+
+.mblImageThumbView .mblThumb:hover {
+ -moz-transform: scale(1.2);
+ -moz-transition: all 0.3s ease-in-out;
+ -o-transform: scale(1.2);
+ -o-transition: all 0.3s ease-in-out;
+}
+.mblImageThumbView .mblThumbInner .mblThumbMask .mblThumbSrc {
+ -moz-background-size: 100% 100%;
+ -moz-border-radius: 5px;
+ -o-background-size: 100% 100%;
+ -o-border-radius: 5px;
+} \ No newline at end of file
diff --git a/js/dojo-1.6/dojox/mobile/themes/android/android-app.css b/js/dojo-1.6/dojox/mobile/themes/android/android-app.css
new file mode 100644
index 0000000..77fc6cd
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/android/android-app.css
@@ -0,0 +1,349 @@
+@import url("android.css");
+
+.alertDialog {
+ width: 100%;
+ padding-left: 2px;
+ padding-right: 2px;
+ z-index: 1000;
+}
+
+.alertDialogBody {
+ border: 1px solid #ADAAAD;
+ -webkit-border-radius: 10px;
+ -moz-border-radius: 10px;
+ background-color: white;
+ margin-left: 2px;
+ margin-right: 4px;
+}
+
+.alertTitle {
+ height: 42px;
+ margin: 0px;
+ padding: 0px;
+ background-color: #889BB3;
+ background: -webkit-gradient(linear, left top, left bottom, from(#B0BCCD), to(#6D84A2), color-stop(0.5, #889BB3), color-stop(0.5, #8195AF));
+ border-top: 1px solid #CDD5DF;
+ border-bottom: 1px solid #2D3642;
+ font-family: Helvetica;
+ font-size: 20px;
+ color: white;
+ text-align: center;
+ line-height: 44px;
+ text-shadow: rgba(0,0,0,0.6) 0px -1px 0px;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ text-align: center;
+}
+
+.alertText {
+ text-align: center;
+}
+
+.alertBtns {
+ padding: 5px;
+ text-align: center;
+}
+
+.alertBtns .mblButton {
+ width: 100%;
+ margin-top: 5px;
+}
+
+.alertDialog.out {
+ position: absolute;
+}
+
+.alertDialog.in {
+ position: absolute;
+}
+
+.slidev.out {
+ -webkit-animation-duration: .4s;
+ -webkit-animation-name: slideOut;
+ -webkit-animation-timing-function: linear;
+ -webkit-transform: translateY(-100%);
+}
+.slidev.in {
+ -webkit-animation-duration: .4s;
+ -webkit-animation-name: slideIn;
+ -webkit-animation-timing-function: linear;
+ -webkit-transform: translateY(0px);
+}
+.slidev.out.reverse {
+ -webkit-animation-name: slideOutReverse;
+}
+.slidev.in.reverse {
+ -webkit-animation-name: slideInReverse;
+}
+
+.dialogUnderlayWrapper {
+ position: absolute;
+ left: 0;
+ top: 0;
+ z-index: 998;
+ background: transparent !important;
+ visibility: visible;
+ height: 100%;
+ width: 100%;
+}
+
+.dialogUnderlay {
+ background-color: #eee;
+ opacity: 0.5;
+ width: 100%;
+ height: 100%;
+}
+
+.list .row {
+ padding: 10px;
+ border-bottom: 1px solid #444;
+ position: relative;
+ background-color: black;
+ z-index: 6; /* Must be greater than the .buttons z-index */
+}
+.list .row.mblListItem {
+ padding: 0px;
+}
+
+.list .row.last {
+ border-bottom: none;
+}
+
+.list .row.hold {
+ background-color: #444;
+}
+
+.list .buttons {
+ position: absolute;
+ text-align: center;
+ padding-top: 10px;
+ width: 100%;
+ height: 100%;
+ z-index: 5;
+}
+
+.list .buttons .mblButton {
+}
+
+.list .buttons .deleteBtn {
+ background-color: red;
+
+}
+.list .buttons .cancelBtn {
+ margin-left: 10px;
+ background-color: blue;
+}
+
+.row.collapsed {
+ -webkit-animation-name: collapse-vert;
+ -webkit-animation-duration: 0.5s;
+ -webkit-animation-timing-function: linear;
+}
+
+@-webkit-keyframes collapse-vert {
+ from {
+ height: 100%;
+ padding: 10px;
+ }
+ to {
+ height: 0px;
+ padding: 0px;
+ }
+}
+
+.listSelector {
+ position: absolute;
+ -webkit-border-radius: 10px;
+ -moz-border-radius: 10px;
+ border: 1px solid #666;
+ background-color: #ccc;
+ color: #333;
+ z-index: 1000;
+}
+.listSelectorRow {
+ padding: 10px;
+ border-bottom: 1px solid #666;
+ white-space: nowrap;
+}
+.listSelectorRow-selected {
+ background-color: #666;
+ color: #ccc;
+}
+
+.listSelectorRow.last {
+ border-bottom: none;
+}
+
+.mblImageView, .mblImageView canvas {
+ width: 100%;
+ height: 100%;
+}
+
+.mblPillar {
+ display: none;
+}
+
+/* Form Input Styles */
+
+input {
+ -webkit-text-size-adjust: 140%;
+}
+
+
+/* ImageThumbView styles */
+.mblImageThumbView {
+ position: relative;
+ -webkit-transition-property: height;
+ -webkit-transition-duration: 0.8s;
+ -webkit-transition-delay: 0;
+}
+
+.mblImageThumbView .mblThumb {
+ width: 100px;
+ min-height: 100px;
+ display: inline-block;
+ z-index: 2;
+ position: absolute;
+}
+
+.mblImageThumbView.animated .mblThumb {
+ -webkit-transition-property: -webkit-transform, opacity;
+ -webkit-transition-duration: 1.3s, 1s;
+ -webkit-transition-delay: 0, 0;
+}
+
+.mblImageThumbView .mblThumb.hidden {
+ z-index: 1;
+ opacity: 0;
+}
+.mblImageThumbView .mblThumbInner {
+ width: 102px;
+ height: 102px;
+ position: relative;
+}
+
+.mblImageThumbView .mblThumbOverlay {
+ width: 102px;
+ height: 102px;
+ background: url(images/thumb-overlay.png) center top no-repeat;
+ position: absolute;
+ z-index: 20;
+ overflow: hidden;
+}
+.mblImageThumbView .mblThumb.selected .mblThumbOverlay {
+ background-position: center bottom;
+}
+.mblImageThumbView .mblThumbInner .mblThumbMask {
+ width: 90px;
+ height: 90px;
+ overflow: hidden;
+ padding-left: 6px;
+ padding-top: 5px;
+ z-index: 10;
+}
+.mblImageThumbView .mblThumbInner .mblThumbMask img {
+ left: 0px;
+ top: 0px;
+ width: 90px;
+ height: 90px;
+}
+
+.mblImageThumbView .mblThumbInner .mblThumbMask .mblThumbSrc {
+ left: 6px;
+ top: 5px;
+ background-position: center center;
+ background-repeat: no-repeat;
+ overflow: hidden;
+ position: absolute;
+ -webkit-background-size: 100% 100%;
+ -webkit-border-radius: 5px;
+ width: 90px;
+ height: 90px;
+ z-index: 5;
+}
+
+.mblImageThumbView .mblThumbMask div {
+ left: 0px;
+ top: 0px;
+ width: 90px;
+ height: 90px;
+ background-repeat: no-repeat;
+}
+.mblImageThumbView .mblThumb:hover,
+.mblImageThumbView .mblThumb.selected {
+ -webkit-transform: scale(1.2);
+ transform: scale(1.2);
+}
+
+/* Large Images */
+.mblImageThumbView.large .mblThumb {
+ width: 150px;
+ min-height: 150px;
+}
+
+.mblImageThumbView.large .mblThumbInner{
+ width: 152px;
+ height: 152px;
+}
+
+.mblImageThumbView.large .mblThumbOverlay {
+ background: url(images/thumb-overlay-large.png) center top no-repeat;
+ width: 152px;
+ height: 152px;
+}
+.mblImageThumbView.large .mblThumbInner .mblThumbMask,
+.mblImageThumbView.large .mblThumbInner .mblThumbMask img,
+.mblImageThumbView.large .mblThumbInner .mblThumbMask .mblThumbSrc,
+.mblImageThumbView.large .mblThumbMask div {
+ width: 133px;
+ height: 133px;
+}
+
+.mblImageThumbView.large .mblThumbInner .mblThumbMask .mblThumbSrc {
+ left: 9px;
+ top: 7px;
+}
+/* Small Images */
+.mblImageThumbView.small .mblThumb {
+ width: 75px;
+ min-height: 75px;
+}
+
+.mblImageThumbView.small .mblThumbInner{
+ width: 77px;
+ height: 77px;
+}
+
+.mblImageThumbView.small .mblThumbOverlay {
+ background: url(images/thumb-overlay-small.png) center top no-repeat;
+ width: 77px;
+ height: 77px;
+}
+.mblImageThumbView.small .mblThumbInner .mblThumbMask,
+.mblImageThumbView.small .mblThumbInner .mblThumbMask img,
+.mblImageThumbView.small .mblThumbInner .mblThumbMask .mblThumbSrc,
+.mblImageThumbView.small .mblThumbMask div {
+ width: 70px;
+ height: 70px;
+}
+
+.mblImageThumbView.small .mblThumbInner .mblThumbMask .mblThumbSrc {
+ left: 4px;
+ top: 3px;
+}
+
+.mblImageThumbView .mblThumbLabel {
+ font-size: smaller;
+ overflow: hidden;
+ white-space: nowrap;
+ text-align: center;
+}
+
+/* Back Button */
+.mblNativeBack .mblArrowButtonHead,
+.mblNativeBack .mblArrowButtonBody,
+.mblNativeBack .mblArrowButtonNeck {
+ display: none;
+}
+
diff --git a/js/dojo-1.6/dojox/mobile/themes/android/android-compat.css b/js/dojo-1.6/dojox/mobile/themes/android/android-compat.css
new file mode 100644
index 0000000..a5552b2
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/android/android-compat.css
@@ -0,0 +1,290 @@
+/* mbl.widget.Heading */
+.mblHeading {
+ background-image: url(compat/heading-bg.png);
+}
+
+/* Heading Arrow Button */
+.mblArrowButtonHead {
+ position: absolute;
+ top: 0px;
+ left: 8px;
+ width: 19px;
+ height: 29px;
+ border-style: none;
+ background-image: url(compat/arrow-button-head.png);
+}
+.mblArrowButtonBody {
+ padding: 0px 10px 0px 10px;
+ background-image: url(compat/arrow-button-bg.png);
+}
+
+/* Round Corner */
+.mblRoundCorner {
+ background-color: black;
+ height: 1px;
+ font-size: 1px;
+ overflow: hidden;
+ border-style: solid;
+ border-color: #ADAAAD;
+ border-width: 0px 1px;
+}
+.mblRoundRectContainer {
+ padding: 3px 8px;
+ background-color: black;
+ border-style: solid;
+ border-color: #ADAAAD;
+ border-width: 0px 1px;
+}
+.mblRoundRectList .mblRoundRectContainer {
+ margin: 0px;
+ padding: 0px;
+}
+.mblRoundCorner0T {
+ height: 0px;
+}
+.mblRoundCorner1T {
+ background-color: #ADAAAD;
+ margin: 0px 5px;
+}
+.mblRoundCorner2T {
+ margin: 0px 2px;
+ border-width: 0px 3px;
+}
+.mblRoundCorner3T {
+ margin: 0px 1px;
+ border-width: 0px 2px;
+}
+.mblRoundCorner4T {
+ margin: 0px 1px;
+}
+.mblRoundCorner5T {
+ margin: 0px 1px;
+}
+
+.mblRoundCorner0B {
+ height: 0px;
+}
+.mblRoundCorner1B {
+ margin: 0px 1px;
+}
+.mblRoundCorner2B {
+ margin: 0px 1px;
+}
+.mblRoundCorner3B {
+ margin: 0px 1px;
+ border-width: 0px 2px;
+}
+.mblRoundCorner4B {
+ margin: 0px 2px;
+ border-width: 0px 3px;
+}
+.mblRoundCorner5B {
+ background-color: #ADAAAD;
+ margin: 0px 5px;
+}
+
+/* mbl.widget.ListItem */
+*html li.mblListItem.mblVariableHeight { /* IE6 hack */
+ height: 0;
+}
+
+.mblListItem .mblArrow {
+ border-style: none;
+ width: 9px;
+ height: 13px;
+ background-image: url(compat/gray-arrow.png);
+}
+.mblItemSelected .mblArrow {
+ background-image: url(compat/white-arrow.png);
+}
+
+/* dojox.mobile.TabBarButton */
+.dj_ie6 .mblTabBarButtonDiv, .dj_ie7 .mblTabBarButtonDiv {
+ left: auto;
+}
+
+/* Switch */
+.mblSwitchInner {
+ width: 100px;
+}
+.mblSwitchBg {
+ border: none;
+}
+.mblSwitchBgLeft {
+ width: 89px;
+ background: none;
+}
+.mblSwitchBgRight {
+ width: 89px;
+ left: 58px;
+ background: none;
+}
+.mblSwitchKnobContainer {
+ position: relative;
+ left: 53px;
+ width: 41px;
+ height: 26px;
+}
+.mblSwitchKnob {
+ position: relative;
+ top: 0px;
+ left: 0px;
+ width: auto;
+ height: 21px;
+ background-image: url(compat/switch-knob-bg.png);
+ border-width: 0px 1px;
+ -moz-border-radius: 0px;
+}
+.mblSwitchCorner {
+ position: relative;
+ height: 1px;
+ font-size: 1px;
+ overflow: hidden;
+ border-style: solid;
+ border-color: #878787;
+}
+.mblSwitchCorner1T {
+ background-color: #848684;
+ margin: 0px 1px;
+ border-width: 0px;
+}
+.mblSwitchCorner2T {
+ background-color: #C0C0C0;
+ margin: 0px 0px;
+ border-width: 0px 1px;
+}
+.mblSwitchCorner3T {
+ background-color: #C6C7C6;
+ margin: 0px 0px;
+ border-width: 0px 1px;
+}
+
+.mblSwitchCorner1B {
+ background-color: #FBFBFB;
+ margin: 0px 0px;
+ border-width: 0px 1px;
+}
+.mblSwitchCorner2B {
+ background-color: #FBFBFB;
+ margin: 0px 0px;
+ border-width: 0px 1px;
+}
+.mblSwitchCorner3B {
+ background-color: #878787;
+ margin: 0px 1px;
+ border-width: 0px;
+}
+
+.mblSwitchBgLeft .mblSwitchCorner1T {
+ border-width: 0px 2px;
+ background-color: #00A600;
+}
+.mblSwitchBgLeft .mblSwitchCorner2T {
+ background-color: #00A600;
+}
+.mblSwitchBgLeft .mblSwitchCorner3T {
+ background-color: #00A600;
+}
+
+.mblSwitchBgLeft .mblSwitchCorner1B {
+ background-color: #00D700;
+}
+.mblSwitchBgLeft .mblSwitchCorner2B {
+ background-color: #00D700;
+}
+.mblSwitchBgLeft .mblSwitchCorner3B {
+ background-color: #00D700;
+}
+
+.mblSwitchText {
+ height: 21px;
+ line-height: 21px;
+}
+.mblSwitchTextLeft {
+ background-image: url(compat/switch-green-bg.png);
+ border-left: 1px solid #848684;
+}
+.mblSwitchTextRight {
+ background-image: url(compat/switch-gray-bg.png);
+ left: 35px;
+ border-right: 1px solid #848684;
+}
+
+/* Icon Content Heading */
+.mblIconContentHeading {
+ background-image: url(compat/icon-content-heading-bg.png);
+}
+
+/* dojox.mobile.Button */
+.mblBlueButton {
+ background-image: url(compat/blue-button-bg.png);
+}
+.mblBlueButtonSelected {
+ background-image: url(compat/blue-button-sel-bg.png);
+}
+
+/* Tab Container */
+.mblTabPanelHeader {
+}
+.mblTabButton {
+ background-image: url(compat/tab-button-bg.png);
+}
+.mblTabButtonSelected {
+ background-image: url(compat/tab-sel-button-bg.png);
+}
+*html .mblTabButton { /* IE6 hack */
+ behavior: expression(
+ (function(el){
+ if(!el.previousSibling)
+ el.style.borderWidth = "1px";
+ el.style.behavior = "none";
+ })(this)
+ );
+}
+
+/* Progress Indicator */
+.mblProg {
+ position: absolute;
+ top: 0px;
+ width: 4px;
+ font-size: 1px;
+ height: 36px;
+ overflow: hidden;
+ background-color: #C0C0C0;
+}
+.mblProg0 {
+ left: 0px;
+}
+.mblProg1 {
+ left: 8px;
+}
+.mblProg2 {
+ left: 16px;
+}
+.mblProg3 {
+ left: 24px;
+}
+.mblProg4 {
+ left: 32px;
+}
+.mblProg5 {
+ left: 40px;
+}
+.mblProg6 {
+ left: 48px;
+}
+.mblProg7 {
+ left: 56px;
+}
+.mblProg8 {
+ left: 64px;
+}
+.mblProg9 {
+ left: 72px;
+}
+.mblProg10 {
+ left: 80px;
+}
+.mblProg11 {
+ left: 80px;
+}
diff --git a/js/dojo-1.6/dojox/mobile/themes/android/android.css b/js/dojo-1.6/dojox/mobile/themes/android/android.css
new file mode 100644
index 0000000..59620b0
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/android/android.css
@@ -0,0 +1,840 @@
+body {
+ visibility: hidden;
+}
+
+html.mobile, .mobile body {
+ width: 100%;
+ margin: 0px;
+ padding: 0px;
+}
+.mobile body {
+ overflow-x: hidden;
+ -webkit-text-size-adjust: none;
+ background-color: black;
+ font-family: Helvetica;
+ font-size: 17px;
+}
+
+/* dojox.mobile.View */
+.mblView {
+ position: relative;
+ top: 0px;
+ left: 0px;
+ width: 100%;
+ color: white;
+}
+
+.mblView.out {
+}
+
+.mblView.in {
+ position: absolute;
+}
+
+.slide.out {
+ -webkit-animation-duration: .4s;
+ -webkit-animation-name: slideOut;
+ -webkit-animation-timing-function: linear;
+ -webkit-transform: translateX(-100%);
+}
+.slide.in {
+ -webkit-animation-duration: .4s;
+ -webkit-animation-name: slideIn;
+ -webkit-animation-timing-function: linear;
+ -webkit-transform: translateX(0px);
+}
+.slide.out.reverse {
+ -webkit-animation-name: slideOutReverse;
+}
+.slide.in.reverse {
+ -webkit-animation-name: slideInReverse;
+}
+@-webkit-keyframes slideOut {
+ from { -webkit-transform: translateX(0px); }
+ to { -webkit-transform: translateX(-100%); }
+}
+@-webkit-keyframes slideIn {
+ from { -webkit-transform: translateX(100%); }
+ to { -webkit-transform: translateX(0px); }
+}
+@-webkit-keyframes slideOutReverse {
+ from { -webkit-transform: translateX(0px); }
+ to { -webkit-transform: translateX(100%); }
+}
+@-webkit-keyframes slideInReverse {
+ from { -webkit-transform: translateX(-100%); }
+ to { -webkit-transform: translateX(0px); }
+}
+
+.flip.out {
+ -webkit-animation-duration: .6s;
+ -webkit-animation-name: flipOut;
+ -webkit-animation-timing-function: ease-in;
+ -webkit-transform: rotateY(90deg);
+}
+.flip.in {
+ -webkit-animation-duration: .6s;
+ -webkit-animation-name: flipIn;
+ -webkit-animation-timing-function: ease-out;
+}
+@-webkit-keyframes flipOut {
+ 0% { -webkit-transform: rotateY(0deg) scale(1); }
+ 50% { -webkit-transform: rotateY(90deg) scale(.8); }
+ 100% { -webkit-transform: rotateY(90deg) scale(.8); }
+}
+
+@-webkit-keyframes flipIn {
+ 0% { -webkit-transform: rotateY(90deg) scale(.8); }
+ 50% { -webkit-transform: rotateY(90deg) scale(.8); }
+ 100% { -webkit-transform: rotateY(0deg) scale(1); }
+}
+
+.fade.out {
+ -webkit-animation-duration: 1s;
+ -webkit-animation-name: fadeOut;
+ -webkit-animation-timing-function: ease-in;
+}
+.fade.in {
+ -webkit-animation-duration: 1s;
+ -webkit-animation-name: fadeIn;
+ -webkit-animation-timing-function: ease-out;
+}
+@-webkit-keyframes fadeOut {
+ from { opacity: 1; }
+ to { opacity: 0; }
+}
+
+@-webkit-keyframes fadeIn {
+ from { opacity: 0; }
+ to { opacity: 1; }
+}
+
+/* dojox.mobile.Heading */
+.mblHeading {
+ position: relative;
+ height: 25px;
+ margin: 0px;
+ padding: 0px 0px 0px 4px;
+ background-color: #8C8A8C;
+ background: -webkit-gradient(linear, left top, left bottom, from(#9C9E9C), to(#848284));
+ border-top: 1px solid #CDD5DF;
+ border-bottom: 1px solid #2D3642;
+ font-family: Helvetica;
+ font-size: 14px;
+ color: white;
+ text-align: center;
+ line-height: 23px;
+ text-shadow: rgba(0,0,0,0.6) 0px -1px 0px;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
+
+/* Heading Arrow Button */
+.mblArrowButton {
+ position: relative;
+ float: left;
+ height: 25px;
+ margin-right: 6px;
+}
+.mblArrowButtonHead {
+ position: absolute;
+ top: 5px;
+ left: 9px;
+ width: 19px;
+ height: 16px;
+ border-width: 1px;
+ border-style: solid;
+ border-color: #3F3E3E;
+ -webkit-transform: scale(.8,1) rotate(45deg);
+ background: -webkit-gradient(linear, left top, left bottom, from(#E5E5E5), to(#7F7F7F), color-stop(0.5, #ADADAD), color-stop(0.5, #909090));
+}
+.mblArrowButtonBody {
+ position: absolute;
+ top: 0px;
+ left: 19px;
+ padding: 0px 10px 0px 3px;
+ height: 23px;
+ border-width: 1px 1px 1px 0px;
+ border-style: inset;
+ border-color: #3F3E3E;
+ font-family: Helvetica;
+ font-size: 13px;
+ color: white;
+ line-height: 23px;
+ cursor: pointer;
+ -webkit-border-radius: 5px;
+ background-color: #ADADAD;
+ background: -webkit-gradient(linear, left top, left bottom, from(#E5E5E5), to(#7F7F7F), color-stop(0.5, #ADADAD), color-stop(0.5, #909090));
+ -webkit-tap-highlight-color: transparent;
+}
+.mblArrowButtonNeck {
+ position: absolute;
+ top: 0px;
+ left: 19px;
+ width: 4px;
+ height: 23px;
+ border-width: 1px 0px 1px 0px;
+ border-style: inset;
+ border-color: #3F3E3E;
+ background: -webkit-gradient(linear, left top, left bottom, from(#E5E5E5), to(#7F7F7F), color-stop(0.5, #ADADAD), color-stop(0.5, #909090));
+}
+.mblArrowButtonSelected .mblArrowButtonHead {
+ background: -webkit-gradient(linear, left top, left bottom, from(#AD7500), to(#FFAA00), color-stop(0.06, #FFB200), color-stop(0.5, #FFC700));
+}
+.mblArrowButtonSelected .mblArrowButtonBody, .mblArrowButtonSelected .mblArrowButtonNeck {
+ background-color: #FFC700;
+ background: -webkit-gradient(linear, left top, left bottom, from(#AD7500), to(#FFAA00), color-stop(0.06, #FFB200), color-stop(0.5, #FFC700));
+}
+
+/* ToolBarButton */
+.mblToolbarButton {
+ float: left;
+ position: relative;
+ margin: 0px 3px;
+ padding: 0px 10px;
+ height: 23px;
+ border: 1px inset #3F3E3E;
+ font-family: Helvetica;
+ font-size: 13px;
+ font-weight: bold;
+ color: white;
+ line-height: 23px;
+ text-align: center;
+ cursor: pointer;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ -webkit-tap-highlight-color: transparent;
+}
+
+/* dojox.mobile.TabBar */
+/*TODO: not optimized for android yet*/
+.mblTabBar {
+ position: relative;
+ height: 48px;
+ width: 100%;
+ margin: 0px;
+ padding: 0px;
+ background-color: #000000;
+ background: -webkit-gradient(linear, left top, left bottom, from(#2D2D2D), to(#000000), color-stop(0.5, #141414), color-stop(0.5, #000000));
+ border-top: 1px solid #000000;
+ color: white;
+ text-align: center;
+ overflow: hidden;
+ white-space: nowrap;
+}
+
+.mblTabBar .mblTabBarButton {
+ position: relative;
+ list-style-type: none;
+ float: left;
+}
+
+/* dojox.mobile.TabBarButton */
+.mblTabBarButton {
+}
+.mblTabBarButtonAnchor {
+ display: block;
+ text-decoration: none;
+}
+.mblTabBarButtonDiv {
+ position: relative;
+ height: 34px;
+ width: 29px;
+ left: 50%;
+}
+.mblTabButton .mblTabBarButtonDiv {
+ height: 40px;
+}
+.mblTabBarButtonDivInner {
+ left: -50%;
+}
+.mblTabBarButtonIcon {
+ position: absolute;
+ left: 0px;
+ top: 2px;
+}
+.mblTabBar .mblTabBarButton.mblTabButtonSelected {
+ background-color: #404040;
+ background: -webkit-gradient(linear, left top, left bottom, from(#484848), to(#242424), color-stop(0.5, #353535), color-stop(0.5, #242424));
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+}
+.mblTabBarButtonTextBox {
+ color: #979797;
+ font-family: "Helvetica Neue", Helvetica;
+ font-size: 11px;
+}
+.mblTabButtonSelected .mblTabBarButtonTextBox {
+ color: white;
+}
+
+/* dojox.mobile.RoundRect */
+.mblRoundRect {
+ margin: 7px 9px 16px;
+ padding: 8px;
+ border: 1px solid #ADAAAD;
+ -webkit-border-radius: 8px;
+ -moz-border-radius: 8px;
+ color: white;
+ background-color: black;
+}
+.mblRoundRect.mblShadow {
+ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.5);
+}
+
+/* dojox.mobile.EdgeToEdgeCategory */
+.mblEdgeToEdgeCategory {
+ position: relative;
+ height: 22px;
+ margin: 0px;
+ padding: 0px 10px;
+ border-bottom: 1px solid #393439;
+ background-color: #212021;
+ font-family: Helvetica;
+ font-size: 16px;
+ color: white;
+ line-height: 22px;
+ text-shadow: rgba(0,0,0,0.6) 0px -1px 0px;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
+
+/* dojox.mobile.RoundRectCategory */
+.mblRoundRectCategory {
+ color: white;
+ margin: 18px 0px 0px 20px;
+ font-family: Helvetica;
+ font-size: 16px;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
+
+/* dojox.mobile.RoundRectList */
+.mblRoundRectList {
+ margin: 7px 9px 16px;
+ padding: 0px;
+ border: 1px solid #ADAAAD;
+ -webkit-border-radius: 8px;
+ -moz-border-radius: 8px;
+ background-color: white;
+ position: relative; /* IE needs this */
+}
+
+/* dojox.mobile.EdgeToEdgeList */
+.mblEdgeToEdgeList {
+ padding: 0px;
+ background-color: black;
+ position: relative; /* IE needs this */
+ margin: 0px; /* IE needs this */
+}
+
+/* dojox.mobile.ListItem */
+.mblListItem {
+ list-style-type: none;
+ height: 64px;
+ border-bottom: solid 1px #313431;
+ line-height: 64px;
+ font-size: 21px;
+ position: relative;
+ color: white;
+ background-color: black;
+ padding-left: 7px;
+}
+.mblListItemIcon {
+ position: absolute;
+ top: 18px;
+}
+.mblListItem.mblVariableHeight {
+ line-height: normal;
+ height: auto;
+ padding: 11px 6px 10px 6px;
+}
+.mblItemSelected {
+ background-color: #FFC700;
+ background: -webkit-gradient(linear, left top, left bottom, from(#AD7500), to(#FFAA00), color-stop(0.06, #FFB200), color-stop(0.5, #FFC700));
+}
+.mblListItemTextBox {
+ padding-right: 28px;
+}
+.mblListItemTextBoxSelected {
+ background-color: #048BF4;
+}
+.mblRoundRectList .mblListItem:first-child {
+ -webkit-border-top-left-radius: 8px;
+ -webkit-border-top-right-radius: 8px;
+ -moz-border-radius-topleft: 8px;
+ -moz-border-radius-topright: 8px;
+}
+.mblRoundRectList .mblListItem:last-child {
+ border-bottom-width: 0px;
+ -webkit-border-bottom-left-radius: 8px;
+ -webkit-border-bottom-right-radius: 8px;
+ -moz-border-radius-bottomleft: 8px;
+ -moz-border-radius-bottomright: 8px;
+}
+.mblEdgeToEdgeList .mblListItem:last-child {
+ border-bottom-color: #313431;
+}
+.mblListItem a.mblListItemAnchor {
+ background-position: 14px 17px;
+ display: block;
+ padding-left: 53px;
+ text-decoration: none;
+ -webkit-tap-highlight-color: transparent;
+}
+.mblListItem a.mblListItemAnchorNoIcon {
+ padding-left: 14px;
+}
+.mblItemSelected a.mblListItemAnchor {
+ color: black;
+}
+.mblListItem a.mblListItemAnchorHasRightButton {
+ padding-right: 50px;
+}
+
+.mblListItem .mblArrow {
+ position: absolute;
+ top: 26px;
+ right: 12px;
+ width: 6px;
+ height: 6px;
+ font-size: 1px;
+ -webkit-transform: rotate(45deg);
+ border-width: 3px 3px 0px 0px;
+ border-style: solid;
+ border-color: #808080;
+}
+.mblItemSelected .mblArrow {
+ border-color: white;
+}
+.mblVariableHeight div.mblArrow {
+ top: 50%;
+ margin-top: -4px;
+}
+
+.mblRightText {
+ position: absolute;
+ top: 20px;
+ right: 30px;
+ color: white;
+ line-height: normal;
+}
+.mblListItem .mblRightButtonContainer {
+ position: absolute;
+ top: 50%;
+ right: 12px;
+}
+.mblListItem .mblRightButton {
+ position: absolute;
+ top: -50%;
+}
+.mblListItemSubText {
+ font-size: 14px;
+ color: gray;
+}
+
+/* Switch */
+.mblSwitch {
+ position: relative;
+ width: 94px;
+ height: 27px;
+ overflow: hidden;
+}
+.mblItemSwitch {
+ position: absolute;
+ top: 18px;
+ right: 12px;
+}
+.mblSwitchInner {
+ position: absolute;
+ top: 0px;
+ height: 27px;
+}
+.mblSwitchAnimation .mblSwitchInner {
+ -webkit-transition-property: left;
+ -webkit-transition-duration: .3s;
+}
+.mblSwitchOn .mblSwitchInner {
+ left: 0px;
+}
+.mblSwitchOff .mblSwitchInner {
+ left: -53px;
+}
+.mblSwitchBg {
+ position: absolute;
+ top: 0px;
+ height: 27px;
+ border-width: 1px;
+ border-style: inset;
+ border-color: #9CACC0;
+ font-family: Helvetica;
+ font-size: 16px;
+ font-weight: bold;
+ line-height: 29px;
+ -webkit-border-radius: 2px;
+ -moz-border-radius: 2px;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ -webkit-tap-highlight-color: transparent;
+}
+.mblSwitchBgLeft {
+ left: 0px;
+ width: 94px;
+ color: white;
+ background-color: #00D300;
+ background: -webkit-gradient(linear, left top, left bottom, from(#00A200), to(#00D300), color-stop(0.2, #00BA00), color-stop(0.2, #00BA00));
+}
+.mblSwitchBgRight {
+ left: 53px;
+ width: 94px;
+ color: #7F7F7F;
+ background-color: #EEEEEE;
+ background: -webkit-gradient(linear, left top, left bottom, from(#BDBEBD), to(#F7F3F7));
+}
+.mblSwitchKnob {
+ position: absolute;
+ top: 1px;
+ left: 53px;
+ width: 41px;
+ height: 26px;
+ font-size: 1px;
+ border-width: 1px;
+ border-style: solid;
+ border-color: #EFEFEF #A5A5A5 #969696 #325E9E;
+ line-height: 29px;
+ background-color: #CCCCCC;
+ background: -webkit-gradient(linear, left top, left bottom, from(#9C9A9C), to(#848284));
+ -webkit-border-radius: 2px;
+ -moz-border-radius: 2px;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+}
+.mblSwitchText {
+ position: relative;
+ top: 0px;
+ width: 53px;
+ height: 27px;
+ padding: 0px;
+ text-align: center;
+}
+.mblSwitchTextLeft {
+ left: 0px;
+}
+.mblSwitchTextRight {
+ left: 40px;
+}
+
+/* Icon Container */
+.mblIconContainer {
+ padding: 0px;
+ margin: 20px 0px 0px 10px;
+ padding: 0px 0px 40px 0px;
+}
+.mblIconItem {
+ list-style-type: none;
+ float: left;
+}
+.mblIconItemTerminator {
+ list-style-type: none;
+ height: 20px;
+ clear: both;
+}
+.mblIconItemSub {
+ list-style-type: none;
+ margin-left: -10px;
+ background-color: white;
+ color: black;
+}
+
+.mblIconArea {
+ font-family: Helvetica;
+ font-size: 12px;
+ height: 78px;
+ width: 74px;
+ text-align: center;
+ margin-bottom: 10px;
+ color: white;
+}
+
+.mblIconArea DIV {
+ position: relative;
+ height: 65px;
+}
+
+.mblIconArea IMG {
+ position: absolute;
+ top: 0px;
+ left: 6px;
+}
+
+.mblContent {
+ clear: both;
+ padding-bottom: 20px;
+}
+
+table.mblClose {
+ clear: both;
+ cursor: pointer;
+}
+
+.mblVibrate{
+ position: relative;
+ -webkit-animation-duration: .5s;
+ -webkit-animation-timing-function: ease-in-out;
+ -webkit-animation-iteration-count: 20;
+ -webkit-animation-name: vibrate;
+ -webkit-transform: rotate(0deg);
+}
+@-webkit-keyframes vibrate{
+ 0%{
+ -webkit-transform: rotate(-2deg);
+ bottom: -1px;
+ left: -1px;
+ }
+ 25% {
+ -webkit-transform: rotate(1deg);
+ bottom: 2px;
+ left: 1px;
+ }
+ 50% {
+ -webkit-transform: rotate(-1deg);
+ bottom: -2px;
+ left: -1px;
+ }
+ 75% {
+ -webkit-transform: rotate(2deg);
+ bottom: 2px;
+ left: 1px;
+ }
+ 100% {
+ -webkit-transform: rotate(-2deg);
+ bottom: -1px;
+ left: -1px;
+ }
+}
+
+.mblCloseContent{
+ -webkit-animation-duration: .3s;
+ -webkit-animation-timing-function: ease-in-out;
+ -webkit-animation-name: shrink;
+ -webkit-transform: scale(0.01);
+}
+.mblCloseContent.mblShrink0{
+ -webkit-animation-name: shrink0;
+}
+.mblCloseContent.mblShrink1{
+ -webkit-animation-name: shrink1;
+}
+.mblCloseContent.mblShrink2{
+ -webkit-animation-name: shrink2;
+}
+.mblCloseContent.mblShrink3{
+ -webkit-animation-name: shrink3;
+}
+@-webkit-keyframes shrink{
+ from { -webkit-transform: scale(1); }
+ to { -webkit-transform: scale(0.01); }
+}
+@-webkit-keyframes shrink0{
+ from { -webkit-transform: scale(1); }
+ to { -webkit-transform: translate(-40%,-70%) scale(0.01); }
+}
+@-webkit-keyframes shrink1{
+ from { -webkit-transform: scale(1); }
+ to { -webkit-transform: translate(-14%,-70%) scale(0.01); }
+}
+@-webkit-keyframes shrink2{
+ from { -webkit-transform: scale(1); }
+ to { -webkit-transform: translate(14%,-70%) scale(0.01); }
+}
+@-webkit-keyframes shrink3{
+ from { -webkit-transform: scale(1); }
+ to { -webkit-transform: translate(40%,-70%) scale(0.01); }
+}
+
+/* Icon Content Heading */
+.mblIconContentHeading {
+ position: relative;
+ clear: both;
+ height: 25px;
+ padding-left: 40px;
+ margin-top: 0px;
+ background: -webkit-gradient(linear, left top, left bottom, from(#E0E4E7), to(#B4BEC6), color-stop(0.5, #C4CCD2), color-stop(0.5, #BFC8CE));
+ border-top: 1px solid #F1F3F4;
+ border-bottom: 1px solid #717D85;
+ font-family: Helvetica;
+ font-size: 14px;
+ color: white;
+ line-height: 26px;
+ text-shadow: rgba(0,0,0,0.6) 0px -1px 0px;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
+
+/* dojox.mobile.Button */
+.mblButton {
+ padding: 0px 10px;
+ height: 29px;
+ border-width: 1px 1px 1px 1px;
+ border-style: outset;
+ color: white;
+ font-family: Helvetica;
+ font-size: 13px;
+ line-height: 29px;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ -webkit-tap-highlight-color: transparent;
+}
+.mblBlueButton {
+ border-color: #9CACC0;
+ background-color: #366EDF;
+ background: -webkit-gradient(linear, left top, left bottom, from(#7A9DE9), to(#2362DD), color-stop(0.5, #366EDF), color-stop(0.5, #215FDC));
+ -webkit-tap-highlight-color: transparent;
+}
+.mblBlueButtonSelected {
+ background: -webkit-gradient(linear, left top, left bottom, from(#8EA4C1), to(#4A6C9B), color-stop(0.5, #5877A2), color-stop(0.5, #476999));
+}
+
+/* Tab Container */
+.mblTabContainer {
+}
+
+.mblTabButton {
+ position: relative;
+ float: left;
+ list-style-type: none;
+ width: 78px;
+ text-align: center;
+ height: 61px;
+ margin-right: 2px;
+ border-width: 0px 1px 0px 1px;
+ border-style: solid;
+ border-color: black #182018 black #393C39;
+ font-family: Helvetica;
+ font-size: 13px;
+ color: white;
+ background-color: #212421;
+ background: -webkit-gradient(linear, left top, left bottom, from(#181818), to(#100C10), color-stop(0.1, #313031));
+ -webkit-tap-highlight-color: transparent;
+}
+.mblTabButtonSelected.mblTabButton {
+ background-color: #8C8E8C;
+ background: -webkit-gradient(linear, left top, left bottom, from(#A59EA5), to(#848284));
+}
+.mblTabButtonHighlighted.mblTabButton {
+ background-color: #FFB600;
+ background: -webkit-gradient(linear, left top, left bottom, from(#FFCB00), to(#FF9A00));
+}
+.mblTabButtonImgDiv {
+ position: relative;
+ margin-left: 24px;
+ height: 40px;
+}
+.mblTabButton IMG {
+ position: absolute;
+ left: 0px;
+ margin-top: 8px;
+}
+
+.mblTabPanelHeader {
+ position: relative;
+ height: 64px;
+ margin: 0px;
+ padding: 0px 0px 0px 0px;
+ background-color: #000000;
+ border-top: 1px solid #CDD5DF;
+ border-bottom: 2px solid #949694;
+ font-family: Helvetica;
+ font-size: 20px;
+ color: white;
+ text-align: center;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
+
+.mblTabPanelPane {
+}
+
+.mblTabPane {
+}
+
+/* Progress Indicator */
+.mblProgContainer {
+ position: absolute;
+ width: 36px;
+ height: 36px;
+ top: 180px;
+ left: 50%;
+ margin: -18px 0px 0px -18px;
+}
+.mblProg {
+ position: absolute;
+ left: 0px;
+ top: 0px;
+ width: 11px;
+ font-size: 1px;
+ height: 4px;
+ overflow: hidden;
+ -webkit-transform-origin: 0 2px;
+ background-color: #C0C0C0;
+ -webkit-border-radius: 2px;
+ -moz-border-radius: 2px;
+}
+.mblProg0 {
+ -webkit-transform: translate(18px,10px) rotate(-90deg);
+}
+.mblProg1 {
+ -webkit-transform: translate(22px,11px) rotate(-60deg);
+}
+.mblProg2 {
+ -webkit-transform: translate(25px,14px) rotate(-30deg);
+}
+.mblProg3 {
+ -webkit-transform: translate(26px,18px) rotate(0deg);
+}
+.mblProg4 {
+ -webkit-transform: translate(25px,22px) rotate(30deg);
+}
+.mblProg5 {
+ -webkit-transform: translate(22px,25px) rotate(60deg);
+}
+.mblProg6 {
+ -webkit-transform: translate(18px,26px) rotate(90deg);
+}
+.mblProg7 {
+ -webkit-transform: translate(14px,25px) rotate(120deg);
+}
+.mblProg8 {
+ -webkit-transform: translate(11px,22px) rotate(150deg);
+}
+.mblProg9 {
+ -webkit-transform: translate(10px,18px) rotate(180deg);
+}
+.mblProg10 {
+ -webkit-transform: translate(11px,14px) rotate(210deg);
+}
+.mblProg11 {
+ -webkit-transform: translate(14px,11px) rotate(240deg);
+}
+
+/* Button Colors */
+.mblColorBlue {
+ background-color: #366EDF;
+ background: -webkit-gradient(linear, left top, left bottom, from(#7A9DE9), to(#2362DD), color-stop(0.5, #366EDF), color-stop(0.5, #215FDC));
+}
+
+/* Default Button Colors */
+.mblColorDefault { /* Gray */
+ background-color: #ADADAD;
+ background: -webkit-gradient(linear, left top, left bottom, from(#E5E5E5), to(#7F7F7F), color-stop(0.5, #ADADAD), color-stop(0.5, #909090));
+}
+
+.mblColorDefaultSel { /* Orange */
+ background-color: #FFC700;
+ background: -webkit-gradient(linear, left top, left bottom, from(#AD7500), to(#FFAA00), color-stop(0.06, #FFB200), color-stop(0.5, #FFC700));
+}
diff --git a/js/dojo-1.6/dojox/mobile/themes/android/compat/arrow-button-bg.png b/js/dojo-1.6/dojox/mobile/themes/android/compat/arrow-button-bg.png
new file mode 100644
index 0000000..7ac8061
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/android/compat/arrow-button-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/android/compat/arrow-button-head.png b/js/dojo-1.6/dojox/mobile/themes/android/compat/arrow-button-head.png
new file mode 100644
index 0000000..74ecb76
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/android/compat/arrow-button-head.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/android/compat/blue-button-bg.png b/js/dojo-1.6/dojox/mobile/themes/android/compat/blue-button-bg.png
new file mode 100644
index 0000000..3bd558b
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/android/compat/blue-button-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/android/compat/blue-button-sel-bg.png b/js/dojo-1.6/dojox/mobile/themes/android/compat/blue-button-sel-bg.png
new file mode 100644
index 0000000..6968458
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/android/compat/blue-button-sel-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/android/compat/gray-arrow.png b/js/dojo-1.6/dojox/mobile/themes/android/compat/gray-arrow.png
new file mode 100644
index 0000000..c93d17f
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/android/compat/gray-arrow.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/android/compat/heading-bg.png b/js/dojo-1.6/dojox/mobile/themes/android/compat/heading-bg.png
new file mode 100644
index 0000000..8c3999b
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/android/compat/heading-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/android/compat/icon-content-heading-bg.png b/js/dojo-1.6/dojox/mobile/themes/android/compat/icon-content-heading-bg.png
new file mode 100644
index 0000000..3daa1a8
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/android/compat/icon-content-heading-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/android/compat/switch-blue-bg.png b/js/dojo-1.6/dojox/mobile/themes/android/compat/switch-blue-bg.png
new file mode 100644
index 0000000..78c9647
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/android/compat/switch-blue-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/android/compat/switch-gray-bg.png b/js/dojo-1.6/dojox/mobile/themes/android/compat/switch-gray-bg.png
new file mode 100644
index 0000000..04e884e
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/android/compat/switch-gray-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/android/compat/switch-green-bg.png b/js/dojo-1.6/dojox/mobile/themes/android/compat/switch-green-bg.png
new file mode 100644
index 0000000..182310a
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/android/compat/switch-green-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/android/compat/switch-knob-bg.png b/js/dojo-1.6/dojox/mobile/themes/android/compat/switch-knob-bg.png
new file mode 100644
index 0000000..e2d75fe
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/android/compat/switch-knob-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/android/compat/tab-button-bg.png b/js/dojo-1.6/dojox/mobile/themes/android/compat/tab-button-bg.png
new file mode 100644
index 0000000..548ef73
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/android/compat/tab-button-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/android/compat/tab-orange-button-bg.png b/js/dojo-1.6/dojox/mobile/themes/android/compat/tab-orange-button-bg.png
new file mode 100644
index 0000000..56f555b
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/android/compat/tab-orange-button-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/android/compat/tab-sel-button-bg.png b/js/dojo-1.6/dojox/mobile/themes/android/compat/tab-sel-button-bg.png
new file mode 100644
index 0000000..c454088
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/android/compat/tab-sel-button-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/android/images/thumb-overlay-large.png b/js/dojo-1.6/dojox/mobile/themes/android/images/thumb-overlay-large.png
new file mode 100644
index 0000000..dfac370
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/android/images/thumb-overlay-large.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/android/images/thumb-overlay-small.png b/js/dojo-1.6/dojox/mobile/themes/android/images/thumb-overlay-small.png
new file mode 100644
index 0000000..b6836d9
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/android/images/thumb-overlay-small.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/android/images/thumb-overlay.png b/js/dojo-1.6/dojox/mobile/themes/android/images/thumb-overlay.png
new file mode 100644
index 0000000..b16efec
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/android/images/thumb-overlay.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/buttons-compat.css b/js/dojo-1.6/dojox/mobile/themes/buttons-compat.css
new file mode 100644
index 0000000..0c2a925
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/buttons-compat.css
@@ -0,0 +1,30 @@
+.mblBlueMinusButton {
+ background-image: url(compat/small-blue-button-bg.png);
+}
+.mblDarkBlueMinusButton {
+ background-image: url(compat/small-darkblue-button-bg.png);
+}
+.mblRedMinusButton {
+ background-image: url(compat/small-red-button-bg.png);
+}
+.mblBluePlusButton {
+ background-image: url(compat/small-blue-button-bg.png);
+}
+.mblDarkBluePlusButton {
+ background-image: url(compat/small-darkblue-button-bg.png);
+}
+.mblRedPlusButton {
+ background-image: url(compat/small-red-button-bg.png);
+}
+.mblCheckOnButton {
+ background-image: url(compat/check-on-button.png);
+}
+.mblCheckOnButton DIV, .mblCheckOnButton P {
+ display: none;
+}
+.mblCheckOffButton {
+ background-image: url(compat/check-off-button.png);
+}
+.mblCheckOffButton DIV, .mblCheckOffButton P {
+ display: none;
+}
diff --git a/js/dojo-1.6/dojox/mobile/themes/buttons.css b/js/dojo-1.6/dojox/mobile/themes/buttons.css
new file mode 100644
index 0000000..0bf86ec
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/buttons.css
@@ -0,0 +1,191 @@
+/* Minus Button */
+.mblBlueMinusButton {
+ position: relative;
+ width: 22px;
+ height: 18px;
+ border-width: 1px 1px 1px 0px;
+ border-style: outset;
+ border-color: #6D89C7;
+ color: white;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ background-color: #366EDF;
+ background: -webkit-gradient(linear, left top, left bottom, from(#7A9DE9), to(#2362DD), color-stop(0.5, #366EDF), color-stop(0.5, #215FDC));
+}
+.mblDarkBlueMinusButton {
+ position: relative;
+ width: 22px;
+ height: 18px;
+ border-width: 1px 1px 1px 0px;
+ border-style: outset;
+ border-color: #6D89C7;
+ color: white;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ background-color: #5877A2;
+ background: -webkit-gradient(linear, left top, left bottom, from(#8EA4C1), to(#4A6C9B), color-stop(0.5, #5877A2), color-stop(0.5, #476999));
+}
+.mblRedMinusButton {
+ position: relative;
+ width: 22px;
+ height: 18px;
+ border-width: 1px 1px 1px 0px;
+ border-style: outset;
+ border-color: #cc1122;
+ color: white;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ background-color: #C9404B;
+ background: -webkit-gradient(linear, left top, left bottom, from(#D3656D), to(#BC1320), color-stop(0.5, #C9404B), color-stop(0.5, #BC1421));
+}
+.mblBlueMinusButton DIV, .mblDarkBlueMinusButton DIV, .mblRedMinusButton DIV {
+ position: absolute;
+ top: 7px;
+ left: 7px;
+ width: 8px;
+ height: 2px;
+ margin: 0px;
+ font-size: 1px;
+ background-color: white;
+ border-top: 1px solid #4A5A71;
+}
+
+/* Plus Button */
+.mblBluePlusButton {
+ position: relative;
+ width: 22px;
+ height: 18px;
+ border-width: 1px 1px 1px 0px;
+ border-style: outset;
+ border-color: #6D89C7;
+ color: white;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ background-color: #366EDF;
+ background: -webkit-gradient(linear, left top, left bottom, from(#7A9DE9), to(#2362DD), color-stop(0.5, #366EDF), color-stop(0.5, #215FDC));
+}
+.mblDarkBluePlusButton {
+ position: relative;
+ width: 22px;
+ height: 18px;
+ border-width: 1px 1px 1px 0px;
+ border-style: outset;
+ border-color: #6D89C7;
+ color: white;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ background-color: #5877A2;
+ background: -webkit-gradient(linear, left top, left bottom, from(#8EA4C1), to(#4A6C9B), color-stop(0.5, #5877A2), color-stop(0.5, #476999));
+}
+.mblRedPlusButton {
+ position: relative;
+ width: 22px;
+ height: 18px;
+ border-width: 1px 1px 1px 0px;
+ border-style: outset;
+ border-color: #6D89C7;
+ color: white;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ background-color: #C9404B;
+ background: -webkit-gradient(linear, left top, left bottom, from(#D3656D), to(#BC1320), color-stop(0.5, #C9404B), color-stop(0.5, #BC1421));
+}
+.mblBluePlusButton DIV, .mblDarkBluePlusButton DIV, .mblRedPlusButton DIV {
+ position: absolute;
+ top: 7px;
+ left: 7px;
+ width: 8px;
+ height: 2px;
+ margin: 0px;
+ font-size: 1px;
+ background-color: white;
+ border-top: 1px solid #4A5A71;
+}
+.mblBluePlusButton P, .mblDarkBluePlusButton P, .mblRedPlusButton P {
+ position: absolute;
+ top: 4px;
+ left: 10px;
+ width: 2px;
+ height: 8px;
+ margin: 0px;
+ font-size: 1px;
+ background-color: white;
+}
+
+.mblCheckOnButton {
+ position: relative;
+ width: 30px;
+ height: 30px;
+ border-width: 1px;
+ border-style: outset;
+ border-color: #A5A2A5;
+ color: white;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ background-color: #D6D3D6;
+ background: -webkit-gradient(linear, left top, left bottom, from(#EFF3EF), to(#BDBEBD));
+}
+.mblCheckOnButton DIV {
+ position: absolute;
+ top: 15px;
+ left: 3px;
+ width: 14px;
+ height: 4px;
+ margin: 0px;
+ font-size: 1px;
+ background-color: #00CF00;
+ border-top: 1px solid #4A5A71;
+ -webkit-border-radius: 2px;
+ -webkit-transform: rotate(50deg);
+}
+.mblCheckOnButton P {
+ position: absolute;
+ top: 11px;
+ left: 9px;
+ width: 20px;
+ height: 4px;
+ margin: 0px;
+ font-size: 1px;
+ background-color: #00CF00;
+ border-bottom: 1px solid #4A5A71;
+ -webkit-border-radius: 2px;
+ -webkit-transform: rotate(-50deg);
+}
+
+.mblCheckOffButton {
+ position: relative;
+ width: 30px;
+ height: 30px;
+ border-width: 1px;
+ border-style: outset;
+ border-color: #A5A2A5;
+ color: white;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ background-color: #D6D3D6;
+ background: -webkit-gradient(linear, left top, left bottom, from(#EFF3EF), to(#BDBEBD));
+}
+.mblCheckOffButton DIV {
+ position: absolute;
+ top: 11px;
+ left: 9px;
+ width: 20px;
+ height: 4px;
+ font-size: 1px;
+ background-color: #BDBABD;
+ border-top: 1px solid #8C8E8C;
+ -webkit-border-radius: 2px;
+ -webkit-transform: rotate(-50deg);
+}
+.mblCheckOffButton P {
+ position: absolute;
+ top: 15px;
+ left: 3px;
+ width: 14px;
+ height: 4px;
+ font-size: 1px;
+ background-color: #BDBABD;
+ border-bottom: 1px solid #8C8E8C;
+ -webkit-border-radius: 2px;
+ -webkit-transform: rotate(50deg);
+}
diff --git a/js/dojo-1.6/dojox/mobile/themes/compat/check-off-button.png b/js/dojo-1.6/dojox/mobile/themes/compat/check-off-button.png
new file mode 100644
index 0000000..fa7df3e
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/compat/check-off-button.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/compat/check-on-button.png b/js/dojo-1.6/dojox/mobile/themes/compat/check-on-button.png
new file mode 100644
index 0000000..2cec24f
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/compat/check-on-button.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/compat/small-blue-button-bg.png b/js/dojo-1.6/dojox/mobile/themes/compat/small-blue-button-bg.png
new file mode 100644
index 0000000..8d524b7
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/compat/small-blue-button-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/compat/small-darkblue-button-bg.png b/js/dojo-1.6/dojox/mobile/themes/compat/small-darkblue-button-bg.png
new file mode 100644
index 0000000..f090e1d
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/compat/small-darkblue-button-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/compat/small-red-button-bg.png b/js/dojo-1.6/dojox/mobile/themes/compat/small-red-button-bg.png
new file mode 100644
index 0000000..f28eba3
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/compat/small-red-button-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/domButtons-compat.css b/js/dojo-1.6/dojox/mobile/themes/domButtons-compat.css
new file mode 100644
index 0000000..7eb7954
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/domButtons-compat.css
@@ -0,0 +1,6 @@
+/* DOM Buttons */
+@import url("domButtons/Common-compat.css");
+@import url("domButtons/DomButtonPlus-compat.css");
+@import url("domButtons/DomButtonUpArrow-compat.css");
+@import url("domButtons/DomButtonDownArrow-compat.css");
+@import url("domButtons/DomButtonSearch-compat.css");
diff --git a/js/dojo-1.6/dojox/mobile/themes/domButtons.css b/js/dojo-1.6/dojox/mobile/themes/domButtons.css
new file mode 100644
index 0000000..54469e6
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/domButtons.css
@@ -0,0 +1,6 @@
+/* DOM Buttons */
+@import url("domButtons/Common.css");
+@import url("domButtons/DomButtonPlus.css");
+@import url("domButtons/DomButtonUpArrow.css");
+@import url("domButtons/DomButtonDownArrow.css");
+@import url("domButtons/DomButtonSearch.css");
diff --git a/js/dojo-1.6/dojox/mobile/themes/domButtons/Common-compat.css b/js/dojo-1.6/dojox/mobile/themes/domButtons/Common-compat.css
new file mode 100644
index 0000000..28d561c
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/domButtons/Common-compat.css
@@ -0,0 +1,3 @@
+.mblTabPanelHeader .mblDomButton {
+ background-position: 8px;
+}
diff --git a/js/dojo-1.6/dojox/mobile/themes/domButtons/Common.css b/js/dojo-1.6/dojox/mobile/themes/domButtons/Common.css
new file mode 100644
index 0000000..623b7ff
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/domButtons/Common.css
@@ -0,0 +1,6 @@
+.mblDomButton {
+ width: 11px;
+}
+.mblTabPanelHeader .mblDomButton {
+ width: 43px;
+}
diff --git a/js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonDownArrow-compat.css b/js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonDownArrow-compat.css
new file mode 100644
index 0000000..dfa3bb6
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonDownArrow-compat.css
@@ -0,0 +1,8 @@
+/* === Down Arrow Button ==*/
+.mblDomButtonDownArrow_2 {
+ background-image: url(compat/downarrow-button.png);
+ background-repeat: no-repeat;
+}
+.mblDomButtonDownArrow_2 DIV {
+ display: none;
+}
diff --git a/js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonDownArrow.css b/js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonDownArrow.css
new file mode 100644
index 0000000..0dd359d
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonDownArrow.css
@@ -0,0 +1,21 @@
+/* === Down Arrow Button ==*/
+.mblDomButtonDownArrow_2 DIV {
+ position: absolute;
+ left: 0px;
+ clip: rect(7px 50px 40px 0px);
+}
+.mblDomButtonDownArrow_2 DIV DIV {
+ top: -10px;
+ left: 4px;
+ width: 25px;
+ height: 25px;
+ margin: 0px;
+ font-size: 1px;
+ background-color: white;
+ border-top: 1px solid #4A5A71;
+ -webkit-transform: scaleX(0.6) rotate(45deg);
+ -moz-transform: scaleX(0.6) rotate(45deg);
+}
+.mblTabPanelHeader .mblDomButtonDownArrow_2 DIV DIV {
+ left: 11px;
+}
diff --git a/js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonPlus-compat.css b/js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonPlus-compat.css
new file mode 100644
index 0000000..dc9c61c
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonPlus-compat.css
@@ -0,0 +1,8 @@
+/* === Plus Button ==*/
+.mblDomButtonPlus_2 {
+ background-image: url(compat/plus-button.png);
+ background-repeat: no-repeat;
+}
+.mblDomButtonPlus_2 DIV {
+ display: none;
+}
diff --git a/js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonPlus.css b/js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonPlus.css
new file mode 100644
index 0000000..34e79a6
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonPlus.css
@@ -0,0 +1,18 @@
+/* === Plus Button ==*/
+.mblDomButtonPlus_2 DIV { /* horiz line */
+ position: absolute;
+ top: 11px;
+ left: 9px;
+ width: 13px;
+ height: 3px;
+ margin: 0px;
+ font-size: 1px;
+ background-color: white;
+ border-top: 1px solid #4A5A71;
+}
+.mblDomButtonPlus_2 DIV DIV { /* vert line */
+ top: -6px;
+ left: 5px;
+ width: 3px;
+ height: 13px;
+}
diff --git a/js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonSearch-compat.css b/js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonSearch-compat.css
new file mode 100644
index 0000000..f0f51dc
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonSearch-compat.css
@@ -0,0 +1,12 @@
+/* === Search Button ==*/
+.mblDomButtonSearch_2 {
+ background-image: url(compat/search-button.png);
+ background-repeat: no-repeat;
+}
+.mblDomButtonSearch_2 DIV {
+ display: none;
+}
+
+.dj_ie6 .mblDomButtonSearch_2 {
+ background-image: url(compat/search-button.gif);
+}
diff --git a/js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonSearch.css b/js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonSearch.css
new file mode 100644
index 0000000..477f569
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonSearch.css
@@ -0,0 +1,33 @@
+/* === Search Button ==*/
+.mblDomButtonSearch_2 DIV {
+ position: absolute;
+ top: 5px;
+ left: 6px;
+ width: 10px;
+ height: 10px;
+ margin: 0px;
+ font-size: 1px;
+ border: 2px solid white;
+ -webkit-border-radius: 6px;
+ -moz-border-radius: 6px;
+}
+.mblDomButtonSearch_2 DIV DIV {
+ top: 10px;
+ left: 7px;
+ width: 8px;
+ height: 3px;
+ margin: 0px;
+ font-size: 1px;
+ background-color: white;
+ border: none;
+ -webkit-transform: rotate(45deg);
+ -moz-transform: rotate(45deg);
+ -webkit-border-radius: 0px;
+ -moz-border-radius: 0px;
+}
+.mblTabPanelHeader .mblDomButtonSearch_2 DIV {
+ left: 11px;
+}
+.mblTabPanelHeader .mblDomButtonSearch_2 DIV DIV {
+ left: 7px;
+}
diff --git a/js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonUpArrow-compat.css b/js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonUpArrow-compat.css
new file mode 100644
index 0000000..6cc860a
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonUpArrow-compat.css
@@ -0,0 +1,8 @@
+/* === Up Arrow Button ==*/
+.mblDomButtonUpArrow_2 {
+ background-image: url(compat/uparrow-button.png);
+ background-repeat: no-repeat;
+}
+.mblDomButtonUpArrow_2 DIV {
+ display: none;
+}
diff --git a/js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonUpArrow.css b/js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonUpArrow.css
new file mode 100644
index 0000000..b6298e4
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/domButtons/DomButtonUpArrow.css
@@ -0,0 +1,21 @@
+/* === Up Arrow Button ==*/
+.mblDomButtonUpArrow_2 DIV {
+ position: absolute;
+ left: 0px;
+ clip: rect(0px 30px 20px 0px);
+}
+.mblDomButtonUpArrow_2 DIV DIV {
+ top: 9px;
+ left: 4px;
+ width: 20px;
+ height: 20px;
+ margin: 0px;
+ font-size: 1px;
+ background-color: white;
+ border-top: 1px solid #4A5A71;
+ -webkit-transform: scaleX(0.6) rotate(45deg);
+ -moz-transform: scaleX(0.6) rotate(45deg);
+}
+.mblTabPanelHeader .mblDomButtonUpArrow_2 DIV DIV {
+ left: 11px;
+}
diff --git a/js/dojo-1.6/dojox/mobile/themes/domButtons/compat/downarrow-button.png b/js/dojo-1.6/dojox/mobile/themes/domButtons/compat/downarrow-button.png
new file mode 100644
index 0000000..add30b8
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/domButtons/compat/downarrow-button.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/domButtons/compat/plus-button.png b/js/dojo-1.6/dojox/mobile/themes/domButtons/compat/plus-button.png
new file mode 100644
index 0000000..4b2a010
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/domButtons/compat/plus-button.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/domButtons/compat/search-button.gif b/js/dojo-1.6/dojox/mobile/themes/domButtons/compat/search-button.gif
new file mode 100644
index 0000000..7087ef6
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/domButtons/compat/search-button.gif
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/domButtons/compat/search-button.png b/js/dojo-1.6/dojox/mobile/themes/domButtons/compat/search-button.png
new file mode 100644
index 0000000..ca09ddb
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/domButtons/compat/search-button.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/domButtons/compat/uparrow-button.png b/js/dojo-1.6/dojox/mobile/themes/domButtons/compat/uparrow-button.png
new file mode 100644
index 0000000..78c1331
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/domButtons/compat/uparrow-button.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/iphone/compat/arrow-button-bg.png b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/arrow-button-bg.png
new file mode 100644
index 0000000..5efaa9e
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/arrow-button-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/iphone/compat/arrow-button-head.png b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/arrow-button-head.png
new file mode 100644
index 0000000..85beb43
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/arrow-button-head.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/iphone/compat/blue-button-bg.png b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/blue-button-bg.png
new file mode 100644
index 0000000..3bd558b
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/blue-button-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/iphone/compat/blue-button-sel-bg.png b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/blue-button-sel-bg.png
new file mode 100644
index 0000000..6968458
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/blue-button-sel-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/iphone/compat/edge-categ-bg.png b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/edge-categ-bg.png
new file mode 100644
index 0000000..3a62e14
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/edge-categ-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/iphone/compat/gray-arrow.png b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/gray-arrow.png
new file mode 100644
index 0000000..c93d17f
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/gray-arrow.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/iphone/compat/heading-bg.png b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/heading-bg.png
new file mode 100644
index 0000000..888a92e
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/heading-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/iphone/compat/icon-content-heading-bg.png b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/icon-content-heading-bg.png
new file mode 100644
index 0000000..3daa1a8
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/icon-content-heading-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/iphone/compat/ipad-arrow-button-bg.png b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/ipad-arrow-button-bg.png
new file mode 100644
index 0000000..b2afca9
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/ipad-arrow-button-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/iphone/compat/ipad-arrow-button-head.png b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/ipad-arrow-button-head.png
new file mode 100644
index 0000000..503c685
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/ipad-arrow-button-head.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/iphone/compat/ipad-heading-bg.png b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/ipad-heading-bg.png
new file mode 100644
index 0000000..614bbbd
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/ipad-heading-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/iphone/compat/switch-blue-bg.png b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/switch-blue-bg.png
new file mode 100644
index 0000000..78c9647
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/switch-blue-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/iphone/compat/switch-gray-bg.png b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/switch-gray-bg.png
new file mode 100644
index 0000000..04e884e
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/switch-gray-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/iphone/compat/switch-knob-bg.png b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/switch-knob-bg.png
new file mode 100644
index 0000000..e2d75fe
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/switch-knob-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/iphone/compat/tab-button-bg.png b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/tab-button-bg.png
new file mode 100644
index 0000000..f8d6ef0
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/tab-button-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/iphone/compat/tab-sel-button-bg.png b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/tab-sel-button-bg.png
new file mode 100644
index 0000000..c3b0a33
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/tab-sel-button-bg.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/iphone/compat/white-arrow.png b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/white-arrow.png
new file mode 100644
index 0000000..84e435a
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/iphone/compat/white-arrow.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/iphone/images/thumb-overlay-large.png b/js/dojo-1.6/dojox/mobile/themes/iphone/images/thumb-overlay-large.png
new file mode 100644
index 0000000..dfac370
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/iphone/images/thumb-overlay-large.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/iphone/images/thumb-overlay-small.png b/js/dojo-1.6/dojox/mobile/themes/iphone/images/thumb-overlay-small.png
new file mode 100644
index 0000000..b6836d9
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/iphone/images/thumb-overlay-small.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/iphone/images/thumb-overlay.png b/js/dojo-1.6/dojox/mobile/themes/iphone/images/thumb-overlay.png
new file mode 100644
index 0000000..b16efec
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/iphone/images/thumb-overlay.png
Binary files differ
diff --git a/js/dojo-1.6/dojox/mobile/themes/iphone/ipad-compat.css b/js/dojo-1.6/dojox/mobile/themes/iphone/ipad-compat.css
new file mode 100644
index 0000000..5775d6c
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/iphone/ipad-compat.css
@@ -0,0 +1,12 @@
+/* mbl.widget.Heading */
+.mblHeading {
+ background-image: url(compat/ipad-heading-bg.png);
+}
+
+/* Heading Arrow Button */
+.mblArrowButtonHead {
+ background-image: url(compat/ipad-arrow-button-head.png);
+}
+.mblArrowButtonBody {
+ background-image: url(compat/ipad-arrow-button-bg.png);
+}
diff --git a/js/dojo-1.6/dojox/mobile/themes/iphone/ipad.css b/js/dojo-1.6/dojox/mobile/themes/iphone/ipad.css
new file mode 100644
index 0000000..6e6ad62
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/iphone/ipad.css
@@ -0,0 +1,66 @@
+/* dojox.mobile.View */
+
+/* dojox.mobile.Heading */
+.mblHeading {
+ background-color: #889BB3;
+ background: -webkit-gradient(linear, left top, left bottom, from(#F3F4F6), to(#A7ABB8));
+ border-top: 1px solid #FEFEFE;
+ border-bottom: 1px solid #787E8F;
+ color: #70777F;
+ text-shadow: rgba(256,256,256,0.6) 0px 1px 0px;
+}
+
+/* Heading Arrow Button */
+.mblArrowButtonHead {
+ border-color: #4D4E50;
+ background: -webkit-gradient(linear, left top, right bottom, from(#B1B5BB), to(#6A727D));
+}
+.mblArrowButtonBody {
+ border-color: #C0C0C0;
+ background-color: #5877A2;
+ background: -webkit-gradient(linear, left top, left bottom, from(#B1B5BB), to(#6A727D));
+ -webkit-tap-highlight-color: transparent;
+ text-shadow: rgba(0,0,0,0.6) 0px -1px 0px;
+}
+.mblArrowButtonNeck {
+ border-color: #C0C0C0;
+ background: -webkit-gradient(linear, left top, left bottom, from(#B1B5BB), to(#6A727D));
+}
+.mblArrowButtonSelected .mblArrowButtonHead {
+ background: -webkit-gradient(linear, left top, right bottom, from(#9DA0A3), to(#43484F));
+}
+.mblArrowButtonSelected .mblArrowButtonBody, .mblArrowButtonSelected .mblArrowButtonNeck {
+ background: -webkit-gradient(linear, left top, left bottom, from(#9DA0A3), to(#43484F));
+}
+
+/* dojox.mobile.RoundRect */
+.mblRoundRect {
+ margin: 7px 30px 30px 30px;
+}
+.mblHeading + .mblRoundRect {
+ margin-top: 30px;
+}
+
+/* dojox.mobile.EdgeToEdgeCategory */
+/* dojox.mobile.RoundRectCategory */
+.mblRoundRectCategory {
+ margin: 18px 0px 0px 41px;
+}
+
+/* dojox.mobile.RoundRectList */
+.mblRoundRectList {
+ margin: 7px 30px 30px 30px;
+}
+.mblHeading + .mblRoundRectList {
+ margin-top: 30px;
+}
+
+/* dojox.mobile.EdgeToEdgeList */
+/* dojox.mobile.ListItem */
+/* Switch */
+/* Icon Container */
+/* Icon Content Heading */
+/* dojox.mobile.Button */
+/* Tab Container */
+/* Progress Indicator */
+
diff --git a/js/dojo-1.6/dojox/mobile/themes/iphone/iphone-app-compat.css b/js/dojo-1.6/dojox/mobile/themes/iphone/iphone-app-compat.css
new file mode 100644
index 0000000..dc0a814
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/iphone/iphone-app-compat.css
@@ -0,0 +1,24 @@
+/* mbl.widget.Heading */
+@import url("iphone-compat.css");
+
+.alertTitle {
+ background-image: url(compat/heading-bg.png);
+}
+
+.mblImageThumbView .mblThumb {
+ -moz-transition: all 0.5s ease-in-out;
+ -o-transition: all 0.5s ease-in-out;
+}
+
+.mblImageThumbView .mblThumb:hover {
+ -moz-transform: scale(1.2);
+ -moz-transition: all 0.3s ease-in-out;
+ -o-transform: scale(1.2);
+ -o-transition: all 0.3s ease-in-out;
+}
+.mblImageThumbView .mblThumbInner .mblThumbMask .mblThumbSrc {
+ -moz-background-size: 100% 100%;
+ -moz-border-radius: 5px;
+ -o-background-size: 100% 100%;
+ -o-border-radius: 5px;
+} \ No newline at end of file
diff --git a/js/dojo-1.6/dojox/mobile/themes/iphone/iphone-app.css b/js/dojo-1.6/dojox/mobile/themes/iphone/iphone-app.css
new file mode 100644
index 0000000..3cf25ce
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/iphone/iphone-app.css
@@ -0,0 +1,341 @@
+@import url("iphone.css");
+
+.alertDialog {
+ width: 100%;
+ padding-left: 2px;
+ padding-right: 2px;
+ z-index: 1000;
+}
+
+.alertDialogBody {
+ border: 1px solid #ADAAAD;
+ -webkit-border-radius: 10px;
+ -moz-border-radius: 10px;
+ background-color: white;
+ margin-left: 2px;
+ margin-right: 4px;
+}
+
+.alertTitle {
+ height: 42px;
+ margin: 0px;
+ padding: 0px;
+ background-color: #889BB3;
+ background: -webkit-gradient(linear, left top, left bottom, from(#B0BCCD), to(#6D84A2), color-stop(0.5, #889BB3), color-stop(0.5, #8195AF));
+ border-top: 1px solid #CDD5DF;
+ border-bottom: 1px solid #2D3642;
+ font-family: Helvetica;
+ font-size: 20px;
+ color: white;
+ text-align: center;
+ line-height: 44px;
+ text-shadow: rgba(0,0,0,0.6) 0px -1px 0px;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ text-align: center;
+}
+
+.alertText {
+ text-align: center;
+}
+
+.alertBtns {
+ padding: 5px;
+ text-align: center;
+}
+
+.alertBtns .mblButton {
+ width: 100%;
+ margin-top: 5px;
+}
+
+.alertDialog.out {
+ position: absolute;
+}
+
+.alertDialog.in {
+ position: absolute;
+}
+
+.slidev.out {
+ -webkit-animation-duration: .4s;
+ -webkit-animation-name: slideOut;
+ -webkit-animation-timing-function: linear;
+ -webkit-transform: translateY(-100%);
+}
+.slidev.in {
+ -webkit-animation-duration: .4s;
+ -webkit-animation-name: slideIn;
+ -webkit-animation-timing-function: linear;
+ -webkit-transform: translateY(0px);
+}
+.slidev.out.reverse {
+ -webkit-animation-name: slideOutReverse;
+}
+.slidev.in.reverse {
+ -webkit-animation-name: slideInReverse;
+}
+
+.dialogUnderlayWrapper {
+ position: absolute;
+ left: 0;
+ top: 0;
+ z-index: 998;
+ background: transparent !important;
+ visibility: visible;
+ height: 100%;
+ width: 100%;
+}
+
+.dialogUnderlay {
+ background-color: #eee;
+ opacity: 0.5;
+ width: 100%;
+ height: 100%;
+}
+
+.list .row {
+ padding: 10px;
+ border-bottom: 1px solid #444;
+ position: relative;
+ background-color: white;
+ z-index: 6; /* Must be greater than the .buttons z-index */
+}
+.list .row.mblListItem {
+ padding: 0px;
+}
+
+.list .row.last {
+ border-bottom: none;
+}
+
+.list .row.hold {
+ background-color: #ddd;
+}
+
+.list .buttons {
+ position: absolute;
+ text-align: center;
+ padding-top: 10px;
+ width: 100%;
+ height: 100%;
+ z-index: 5;
+}
+
+.list .buttons .mblButton {
+}
+
+.list .buttons .deleteBtn {
+ background-color: red;
+
+}
+.list .buttons .cancelBtn {
+ margin-left: 10px;
+ background-color: blue;
+}
+
+.row.collapsed {
+ -webkit-animation-name: collapse-vert;
+ -webkit-animation-duration: 0.5s;
+ -webkit-animation-timing-function: linear;
+}
+
+@-webkit-keyframes collapse-vert {
+ from {
+ height: 100%;
+ padding: 10px;
+ }
+ to {
+ height: 0px;
+ padding: 0px;
+ }
+}
+
+.listSelector {
+ position: absolute;
+ -webkit-border-radius: 10px;
+ -moz-border-radius: 10px;
+ border: 1px solid #666;
+ background-color: #ccc;
+ color: #333;
+ z-index: 1000;
+}
+.listSelectorRow {
+ padding: 10px;
+ border-bottom: 1px solid #666;
+ white-space: nowrap;
+}
+.listSelectorRow-selected {
+ background-color: #666;
+ color: #ccc;
+}
+
+.listSelectorRow.last {
+ border-bottom: none;
+}
+
+.mblImageView, .mblImageView canvas {
+ width: 100%;
+ height: 100%;
+}
+
+.mblPillar {
+ display: none;
+}
+
+/* Form Input Styles */
+
+input {
+ -webkit-text-size-adjust: 140%;
+}
+
+
+/* ImageThumbView styles */
+.mblImageThumbView {
+ position: relative;
+ -webkit-transition-property: height;
+ -webkit-transition-duration: 0.8s;
+ -webkit-transition-delay: 0;
+}
+
+.mblImageThumbView .mblThumb {
+ width: 100px;
+ min-height: 100px;
+ display: inline-block;
+ z-index: 2;
+ position: absolute;
+}
+
+.mblImageThumbView.animated .mblThumb {
+ -webkit-transition-property: -webkit-transform, opacity;
+ -webkit-transition-duration: 1.3s, 1s;
+ -webkit-transition-delay: 0, 0;
+}
+
+.mblImageThumbView .mblThumb.hidden {
+ z-index: 1;
+ opacity: 0;
+}
+.mblImageThumbView .mblThumbInner {
+ width: 102px;
+ height: 102px;
+ position: relative;
+}
+
+.mblImageThumbView .mblThumbOverlay {
+ width: 102px;
+ height: 102px;
+ background: url(images/thumb-overlay.png) center top no-repeat;
+ position: absolute;
+ z-index: 20;
+ overflow: hidden;
+}
+.mblImageThumbView .mblThumb.selected .mblThumbOverlay {
+ background-position: center bottom;
+}
+.mblImageThumbView .mblThumbInner .mblThumbMask {
+ width: 90px;
+ height: 90px;
+ overflow: hidden;
+ padding-left: 6px;
+ padding-top: 5px;
+ z-index: 10;
+}
+.mblImageThumbView .mblThumbInner .mblThumbMask img {
+ left: 0px;
+ top: 0px;
+ width: 90px;
+ height: 90px;
+}
+
+.mblImageThumbView .mblThumbInner .mblThumbMask .mblThumbSrc {
+ left: 6px;
+ top: 5px;
+ background-position: center center;
+ background-repeat: no-repeat;
+ overflow: hidden;
+ position: absolute;
+ -webkit-background-size: 100% 100%;
+ -webkit-border-radius: 5px;
+ width: 90px;
+ height: 90px;
+ z-index: 5;
+}
+
+.mblImageThumbView .mblThumbMask div {
+ left: 0px;
+ top: 0px;
+ width: 90px;
+ height: 90px;
+ background-repeat: no-repeat;
+}
+.mblImageThumbView .mblThumb:hover,
+.mblImageThumbView .mblThumb.selected {
+ -webkit-transform: scale(1.2);
+ transform: scale(1.2);
+}
+
+/* Large Images */
+.mblImageThumbView.large .mblThumb {
+ width: 150px;
+ min-height: 150px;
+}
+
+.mblImageThumbView.large .mblThumbInner{
+ width: 152px;
+ height: 152px;
+}
+
+.mblImageThumbView.large .mblThumbOverlay {
+ background: url(images/thumb-overlay-large.png) center top no-repeat;
+ width: 152px;
+ height: 152px;
+}
+.mblImageThumbView.large .mblThumbInner .mblThumbMask,
+.mblImageThumbView.large .mblThumbInner .mblThumbMask img,
+.mblImageThumbView.large .mblThumbInner .mblThumbMask .mblThumbSrc,
+.mblImageThumbView.large .mblThumbMask div {
+ width: 133px;
+ height: 133px;
+}
+
+.mblImageThumbView.large .mblThumbInner .mblThumbMask .mblThumbSrc {
+ left: 9px;
+ top: 7px;
+}
+/* Small Images */
+.mblImageThumbView.small .mblThumb {
+ width: 75px;
+ min-height: 75px;
+}
+
+.mblImageThumbView.small .mblThumbInner{
+ width: 77px;
+ height: 77px;
+}
+
+.mblImageThumbView.small .mblThumbOverlay {
+ background: url(images/thumb-overlay-small.png) center top no-repeat;
+ width: 77px;
+ height: 77px;
+}
+.mblImageThumbView.small .mblThumbInner .mblThumbMask,
+.mblImageThumbView.small .mblThumbInner .mblThumbMask img,
+.mblImageThumbView.small .mblThumbInner .mblThumbMask .mblThumbSrc,
+.mblImageThumbView.small .mblThumbMask div {
+ width: 70px;
+ height: 70px;
+}
+
+.mblImageThumbView.small .mblThumbInner .mblThumbMask .mblThumbSrc {
+ left: 4px;
+ top: 3px;
+}
+
+.mblImageThumbView .mblThumbLabel {
+ font-size: smaller;
+ overflow: hidden;
+ white-space: nowrap;
+ text-align: center;
+} \ No newline at end of file
diff --git a/js/dojo-1.6/dojox/mobile/themes/iphone/iphone-compat.css b/js/dojo-1.6/dojox/mobile/themes/iphone/iphone-compat.css
new file mode 100644
index 0000000..874b489
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/iphone/iphone-compat.css
@@ -0,0 +1,297 @@
+/* mbl.widget.Heading */
+.mblHeading {
+ background-image: url(compat/heading-bg.png);
+}
+
+/* Heading Arrow Button */
+.mblArrowButtonHead {
+ position: absolute;
+ top: 6px;
+ left: 7px;
+ width: 19px;
+ height: 29px;
+ border-style: none;
+ background-image: url(compat/arrow-button-head.png);
+}
+.mblArrowButtonBody {
+ padding: 0px 10px 0px 10px;
+ background-image: url(compat/arrow-button-bg.png);
+}
+
+/* Round Corner */
+.mblRoundCorner {
+ background-color: white;
+ height: 1px;
+ font-size: 1px;
+ overflow: hidden;
+ border-style: solid;
+ border-color: #ADAAAD;
+ border-width: 0px 1px;
+}
+.mblRoundRectContainer {
+ margin: 0px;
+ padding: 0px;
+ background-color: white;
+ border-style: solid;
+ border-color: #ADAAAD;
+ border-width: 0px 1px;
+}
+.mblRoundRect .mblRoundRectContainer {
+ padding: 3px 8px;
+}
+.mblRoundCorner0T {
+ height: 0px;
+}
+.mblRoundCorner1T {
+ background-color: #ADAAAD;
+ margin: 0px 5px;
+}
+.mblRoundCorner2T {
+ margin: 0px 2px;
+ border-width: 0px 3px;
+}
+.mblRoundCorner3T {
+ margin: 0px 1px;
+ border-width: 0px 2px;
+}
+.mblRoundCorner4T {
+ margin: 0px 1px;
+}
+.mblRoundCorner5T {
+ margin: 0px 1px;
+}
+
+.mblRoundCorner0B {
+ height: 0px;
+}
+.mblRoundCorner1B {
+ margin: 0px 1px;
+}
+.mblRoundCorner2B {
+ margin: 0px 1px;
+}
+.mblRoundCorner3B {
+ margin: 0px 1px;
+ border-width: 0px 2px;
+}
+.mblRoundCorner4B {
+ margin: 0px 2px;
+ border-width: 0px 3px;
+}
+.mblRoundCorner5B {
+ background-color: #ADAAAD;
+ margin: 0px 5px;
+}
+
+/* dojox.mobile.EdgeToEdgeCategory */
+.mblEdgeToEdgeCategory {
+ background-image: url(compat/edge-categ-bg.png);
+}
+
+/* mbl.widget.ListItem */
+*html li.mblListItem.mblVariableHeight { /* IE6 hack */
+ height: 0;
+}
+
+.mblListItem .mblArrow {
+ border-style: none;
+ top: 16px;
+ width: 9px;
+ height: 13px;
+ background-image: url(compat/gray-arrow.png);
+}
+.mblItemSelected .mblArrow {
+ background-image: url(compat/white-arrow.png);
+}
+
+/* dojox.mobile.TabBarButton */
+.dj_ie6 .mblTabBarButtonDiv, .dj_ie7 .mblTabBarButtonDiv {
+ left: auto;
+}
+
+/* Switch */
+.mblSwitchInner {
+ width: 100px;
+}
+.mblSwitchBg {
+ border: none;
+}
+.mblSwitchBgLeft {
+ width: 89px;
+ background: none;
+}
+.mblSwitchBgRight {
+ width: 89px;
+ left: 58px;
+ background: none;
+}
+.mblSwitchKnobContainer {
+ position: relative;
+ left: 53px;
+ width: 41px;
+ height: 26px;
+}
+.mblSwitchKnob {
+ position: relative;
+ top: 0px;
+ left: 0px;
+ width: auto;
+ height: 21px;
+ background-image: url(compat/switch-knob-bg.png);
+ border-width: 0px 1px;
+ -moz-border-radius: 0px;
+}
+.mblSwitchCorner {
+ position: relative;
+ height: 1px;
+ font-size: 1px;
+ overflow: hidden;
+ border-style: solid;
+ border-color: #878787;
+}
+.mblSwitchCorner1T {
+ background-color: #848684;
+ margin: 0px 4px;
+ border-width: 0px;
+}
+.mblSwitchCorner2T {
+ background-color: #C0C0C0;
+ margin: 0px 2px;
+ border-width: 0px 2px;
+}
+.mblSwitchCorner3T {
+ background-color: #C6C7C6;
+ margin: 0px 1px;
+ border-width: 0px 1px;
+}
+
+.mblSwitchCorner1B {
+ background-color: #FBFBFB;
+ margin: 0px 1px;
+ border-width: 0px 1px;
+}
+.mblSwitchCorner2B {
+ background-color: #FBFBFB;
+ margin: 0px 2px;
+ border-width: 0px 2px;
+}
+.mblSwitchCorner3B {
+ background-color: #878787;
+ margin: 0px 4px;
+ border-width: 0px;
+}
+
+.mblSwitchBgLeft .mblSwitchCorner1T {
+ border-width: 0px 2px;
+ background-color: #093889;
+}
+.mblSwitchBgLeft .mblSwitchCorner2T {
+ background-color: #285AB2;
+}
+.mblSwitchBgLeft .mblSwitchCorner3T {
+ background-color: #285AB2;
+}
+
+.mblSwitchBgLeft .mblSwitchCorner1B {
+ background-color: #66A1F6;
+}
+.mblSwitchBgLeft .mblSwitchCorner2B {
+ background-color: #66A1F6;
+}
+.mblSwitchBgLeft .mblSwitchCorner3B {
+ background-color: #5289D7;
+}
+
+.mblSwitchText {
+ height: 21px;
+ line-height: 21px;
+}
+.mblSwitchTextLeft {
+ background-image: url(compat/switch-blue-bg.png);
+ border-left: 1px solid #848684;
+}
+.mblSwitchTextRight {
+ background-image: url(compat/switch-gray-bg.png);
+ left: 35px;
+ border-right: 1px solid #848684;
+}
+
+/* Icon Content Heading */
+.mblIconContentHeading {
+ background-image: url(compat/icon-content-heading-bg.png);
+}
+
+/* dojox.mobile.Button */
+.mblBlueButton {
+ background-image: url(compat/blue-button-bg.png);
+}
+.mblBlueButtonSelected {
+ background-image: url(compat/blue-button-sel-bg.png);
+}
+
+/* Tab Container */
+.mblTabPanelHeader {
+ background-image: url(compat/heading-bg.png);
+}
+.mblTabContainer .mblTabButton {
+ background-image: url(compat/tab-button-bg.png);
+}
+.mblTabContainer .mblTabButtonSelected {
+ background-image: url(compat/tab-sel-button-bg.png);
+}
+*html .mblTabButton { /* IE6 hack */
+ behavior: expression(
+ (function(el){
+ if(!el.previousSibling)
+ el.style.borderWidth = "1px";
+ el.style.behavior = "none";
+ })(this)
+ );
+}
+
+/* Progress Indicator */
+.mblProg {
+ position: absolute;
+ top: 0px;
+ width: 4px;
+ font-size: 1px;
+ height: 36px;
+ overflow: hidden;
+ background-color: #C0C0C0;
+}
+.mblProg0 {
+ left: 0px;
+}
+.mblProg1 {
+ left: 8px;
+}
+.mblProg2 {
+ left: 16px;
+}
+.mblProg3 {
+ left: 24px;
+}
+.mblProg4 {
+ left: 32px;
+}
+.mblProg5 {
+ left: 40px;
+}
+.mblProg6 {
+ left: 48px;
+}
+.mblProg7 {
+ left: 56px;
+}
+.mblProg8 {
+ left: 64px;
+}
+.mblProg9 {
+ left: 72px;
+}
+.mblProg10 {
+ left: 80px;
+}
+.mblProg11 {
+ left: 80px;
+}
diff --git a/js/dojo-1.6/dojox/mobile/themes/iphone/iphone.css b/js/dojo-1.6/dojox/mobile/themes/iphone/iphone.css
new file mode 100644
index 0000000..c6b07c5
--- /dev/null
+++ b/js/dojo-1.6/dojox/mobile/themes/iphone/iphone.css
@@ -0,0 +1,858 @@
+body {
+ visibility: hidden;
+}
+
+html.mobile, .mobile body {
+ width: 100%;
+ margin: 0px;
+ padding: 0px;
+}
+.mobile body {
+ overflow-x: hidden;
+ -webkit-text-size-adjust: none;
+ background-color: rgb(197,204,211);
+ font-family: Helvetica;
+ font-size: 17px;
+}
+
+/* dojox.mobile.View */
+.mblView {
+ position: relative;
+ top: 0px;
+ left: 0px;
+ width: 100%;
+}
+
+.mblView.out {
+}
+
+.mblView.in {
+ position: absolute;
+}
+
+.slide.out {
+ -webkit-animation-duration: .4s;
+ -webkit-animation-name: slideOut;
+ -webkit-animation-timing-function: linear;
+ -webkit-transform: translateX(-100%);
+}
+.slide.in {
+ -webkit-animation-duration: .4s;
+ -webkit-animation-name: slideIn;
+ -webkit-animation-timing-function: linear;
+ -webkit-transform: translateX(0px);
+}
+.slide.out.reverse {
+ -webkit-animation-name: slideOutReverse;
+}
+.slide.in.reverse {
+ -webkit-animation-name: slideInReverse;
+}
+@-webkit-keyframes slideOut {
+ from { -webkit-transform: translateX(0px); }
+ to { -webkit-transform: translateX(-100%); }
+}
+@-webkit-keyframes slideIn {
+ from { -webkit-transform: translateX(100%); }
+ to { -webkit-transform: translateX(0px); }
+}
+@-webkit-keyframes slideOutReverse {
+ from { -webkit-transform: translateX(0px); }
+ to { -webkit-transform: translateX(100%); }
+}
+@-webkit-keyframes slideInReverse {
+ from { -webkit-transform: translateX(-100%); }
+ to { -webkit-transform: translateX(0px); }
+}
+
+.flip.out {
+ -webkit-animation-duration: .6s;
+ -webkit-animation-name: flipOut;
+ -webkit-animation-timing-function: ease-in;
+ -webkit-transform: rotateY(90deg);
+}
+.flip.in {
+ -webkit-animation-duration: .6s;
+ -webkit-animation-name: flipIn;
+ -webkit-animation-timing-function: ease-out;
+}
+@-webkit-keyframes flipOut {
+ 0% { -webkit-transform: rotateY(0deg) scale(1); }
+ 50% { -webkit-transform: rotateY(90deg) scale(.8); }
+ 100% { -webkit-transform: rotateY(90deg) scale(.8); }
+}
+
+@-webkit-keyframes flipIn {
+ 0% { -webkit-transform: rotateY(90deg) scale(.8); }
+ 50% { -webkit-transform: rotateY(90deg) scale(.8); }
+ 100% { -webkit-transform: rotateY(0deg) scale(1); }
+}
+
+.fade.out {
+ -webkit-animation-duration: 1s;
+ -webkit-animation-name: fadeOut;
+ -webkit-animation-timing-function: ease-in;
+}
+.fade.out.fast {
+ -webkit-animation-duration: 0.3s;
+}
+.fade.in {
+ -webkit-animation-duration: 1s;
+ -webkit-animation-name: fadeIn;
+ -webkit-animation-timing-function: ease-out;
+}
+@-webkit-keyframes fadeOut {
+ from { opacity: 1; }
+ to { opacity: 0; }
+}
+
+@-webkit-keyframes fadeIn {
+ from { opacity: 0; }
+ to { opacity: 1; }
+}
+
+/* dojox.mobile.Heading */
+.mblHeading {
+ position: relative;
+ height: 42px;
+ margin: 0px;
+ padding: 0px;
+ background-color: #889BB3;
+ background: -webkit-gradient(linear, left top, left bottom, from(#B0BCCD), to(#6D84A2), color-stop(0.5, #889BB3), color-stop(0.5, #8195AF));
+ border-top: 1px solid #CDD5DF;
+ border-bottom: 1px solid #2D3642;
+ font-family: Helvetica;
+ font-size: 20px;
+ color: white;
+ text-align: center;
+ line-height: 44px;
+ text-shadow: rgba(0,0,0,0.6) 0px -1px 0px;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ z-index: 1;
+}
+
+/* Heading Arrow Button */
+.mblArrowButton {
+ position: relative;
+ float: left;
+ height: 42px;
+ margin-right: 6px;
+}
+.mblArrowButtonHead {
+ position: absolute;
+ top: 11px;
+ left: 8px;
+ width: 19px;
+ height: 19px;
+ border-width: 1px;
+ border-style: solid;
+ border-color: #3A4655;
+ -webkit-transform: scale(.8,1) rotate(45deg);
+ background: -webkit-gradient(linear, left top, right bottom, from(#8EA4C1), to(#4A6C9B), color-stop(0.5, #5877A2), color-stop(0.5, #476999));
+}
+.mblArrowButtonBody {
+ position: absolute;
+ top: 6px;
+ left: 19px;
+ padding: 0px 10px 0px 3px;
+ height: 29px;
+ border-width: 1px 1px 1px 0px;
+ border-style: inset;
+ border-color: #9CACC0;
+ font-family: Helvetica;
+ font-size: 13px;
+ color: white;
+ line-height: 29px;
+ cursor: pointer;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ background-color: #5877A2;
+ background: -webkit-gradient(linear, left top, left bottom, from(#8EA4C1), to(#4A6C9B), color-stop(0.5, #5877A2), color-stop(0.5, #476999));
+ -webkit-tap-highlight-color: transparent;
+}
+.mblArrowButtonNeck {
+ position: absolute;
+ top: 6px;
+ left: 19px;
+ width: 4px;
+ height: 29px;
+ border-width: 1px 0px 1px 0px;
+ border-style: inset;
+ border-color: #9CACC0;
+ background: -webkit-gradient(linear, left top, left bottom, from(#8EA4C1), to(#4A6C9B), color-stop(0.5, #5877A2), color-stop(0.5, #476999));
+}
+.mblArrowButtonSelected .mblArrowButtonHead {
+ background: -webkit-gradient(linear, left top, right bottom, from(#7C87A4), to(#263E6C), color-stop(0.5, #394D77), color-stop(0.5, #243B69));
+}
+.mblArrowButtonSelected .mblArrowButtonBody, .mblArrowButtonSelected .mblArrowButtonNeck {
+ background: -webkit-gradient(linear, left top, left bottom, from(#7C87A4), to(#263E6C), color-stop(0.5, #394D77), color-stop(0.5, #243B69));
+}
+
+/* ToolBarButton */
+.mblToolbarButton {
+ float: left;
+ position: relative;
+ margin: 6px;
+ padding: 0px 10px;
+ height: 29px;
+ border: 1px inset #9CACC0;
+ font-family: Helvetica;
+ font-size: 13px;
+ font-weight: bold;
+ color: white;
+ line-height: 29px;
+ text-align: center;
+ cursor: pointer;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ -webkit-tap-highlight-color: transparent;
+}
+
+/* dojox.mobile.TabBar */
+.mblTabBar {
+ position: relative;
+ height: 48px;
+ width: 100%;
+ margin: 0px;
+ padding: 0px;
+ background-color: #000000;
+ background: -webkit-gradient(linear, left top, left bottom, from(#2D2D2D), to(#000000), color-stop(0.5, #141414), color-stop(0.5, #000000));
+ border-top: 1px solid #000000;
+ color: white;
+ text-align: center;
+ overflow: hidden;
+ white-space: nowrap;
+}
+
+.mblTabBar .mblTabBarButton {
+ position: relative;
+ list-style-type: none;
+ float: left;
+}
+
+/* dojox.mobile.TabBarButton */
+.mblTabBarButton {
+}
+.mblTabBarButtonAnchor {
+ display: block;
+ text-decoration: none;
+}
+.mblTabButton .mblTabBarButtonAnchor {
+ height: 28px;
+}
+.mblTabBarButtonDiv {
+ position: relative;
+ height: 34px;
+ width: 29px;
+ left: 50%;
+}
+.mblTabButton .mblTabBarButtonDiv {
+ display: none;
+}
+.mblTabBarButtonDivInner {
+ left: -50%;
+}
+.mblTabBarButtonIcon {
+ position: absolute;
+ left: 0px;
+ top: 2px;
+}
+.mblTabBar .mblTabBarButton.mblTabButtonSelected {
+ background-color: #404040;
+ background: -webkit-gradient(linear, left top, left bottom, from(#484848), to(#242424), color-stop(0.5, #353535), color-stop(0.5, #242424));
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+}
+.mblTabBarButtonTextBox {
+ color: #979797;
+ font-family: "Helvetica Neue", Helvetica;
+ font-size: 11px;
+}
+.mblTabButtonSelected .mblTabBarButtonTextBox {
+ color: white;
+}
+
+/* dojox.mobile.RoundRect */
+.mblRoundRect {
+ margin: 7px 9px 16px 9px;
+ padding: 8px;
+ border: 1px solid #ADAAAD;
+ -webkit-border-radius: 8px;
+ -moz-border-radius: 8px;
+ background-color: white;
+}
+.mblRoundRect.mblShadow {
+ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.5);
+}
+
+/* dojox.mobile.EdgeToEdgeCategory */
+.mblEdgeToEdgeCategory {
+ position: relative;
+ height: 22px;
+ margin: 0px;
+ padding: 0px 10px;
+ border-top: 1px solid #A4B0B9;
+ border-bottom: 1px solid #979DA3;
+ background: -webkit-gradient(linear, left top, left bottom, from(#8F9EA9), to(#B7C0C7));
+ font-family: Helvetica;
+ font-weight: bold;
+ font-size: 16px;
+ color: white;
+ line-height: 22px;
+ text-shadow: rgba(0,0,0,0.6) 0px -1px 0px;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
+
+/* dojox.mobile.RoundRectCategory */
+.mblRoundRectCategory {
+ color: #4C566C;
+ padding: 18px 0px 0px 20px;
+ margin: 0px;
+ text-shadow: rgba(255, 255, 255, 1) 0px 1px 0px;
+ font-family: Helvetica;
+ font-size: 16px;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
+
+/* dojox.mobile.RoundRectList */
+.mblRoundRectList {
+ margin: 7px 9px 16px 9px;
+ padding: 0px;
+ border: 1px solid #ADAAAD;
+ -webkit-border-radius: 8px;
+ -moz-border-radius: 8px;
+ background-color: white;
+ position: relative; /* IE needs this */
+}
+
+/* dojox.mobile.EdgeToEdgeList */
+.mblEdgeToEdgeList {
+ padding: 0px;
+ background-color: white;
+ position: relative; /* IE needs this */
+ margin: 0px; /* IE needs this */
+}
+
+/* dojox.mobile.ListItem */
+.mblListItem {
+ list-style-type: none;
+ height: 43px;
+ border-bottom: 1px solid #ADAAAD;
+ line-height: 43px;
+ font-weight: bold;
+ position: relative;
+ color: black;
+ vertical-align: bottom; /* To avoid IE6 LI bug */
+ padding-left: 8px;
+}
+.mblListItemIcon {
+ position: absolute;
+ top: 7px;
+}
+.mblListItem.mblVariableHeight {
+ line-height: normal;
+ height: auto;
+ padding: 11px 6px 10px 6px;
+}
+.mblItemSelected {
+ background-color: #048BF4;
+ background: -webkit-gradient(linear, left top, left bottom, from(#048BF4), to(#005CE5));
+}
+.mblListItemTextBox {
+ padding-right: 28px;
+}
+.mblListItemTextBoxSelected {
+ background-color: #048BF4;
+}
+.mblRoundRectList .mblListItem:first-child {
+ -webkit-border-top-left-radius: 8px;
+ -webkit-border-top-right-radius: 8px;
+ -moz-border-radius-topleft: 8px;
+ -moz-border-radius-topright: 8px;
+}
+.mblRoundRectList .mblListItem:last-child {
+ border-bottom-width: 0px;
+ -webkit-border-bottom-left-radius: 8px;
+ -webkit-border-bottom-right-radius: 8px;
+ -moz-border-radius-bottomleft: 8px;
+ -moz-border-radius-bottomright: 8px;
+}
+.mblEdgeToEdgeList .mblListItem:last-child {
+ border-bottom-color: #707C84;
+}
+.mblListItem a.mblListItemAnchor {
+ background-position: 9px 7px;
+ display: block;
+ padding-left: 40px;
+ text-decoration: none;
+ -webkit-tap-highlight-color: transparent;
+}
+.mblListItem a.mblListItemAnchorNoIcon {
+ padding-left: 10px;
+}
+.mblItemSelected a.mblListItemAnchor {
+ color: white;
+}
+.mblListItem a.mblListItemAnchorHasRightButton {
+ padding-right: 40px;
+}
+
+.mblListItem .mblArrow {
+ position: absolute;
+ top: 18px;
+ right: 12px;
+ width: 6px;
+ height: 6px;
+ font-size: 1px;
+ -webkit-transform: rotate(45deg);
+ border-width: 3px 3px 0px 0px;
+ border-style: solid;
+ border-color: #808080;
+}
+.mblItemSelected .mblArrow {
+ border-color: white;
+}
+.mblVariableHeight div.mblArrow {
+ top: 50%;
+ margin-top: -4px;
+}
+
+.mblRightText {
+ position: absolute;
+ top: 12px;
+ right: 30px;
+ color: #324F85;
+ line-height: normal;
+}
+.mblListItem .mblRightButtonContainer {
+ position: absolute;
+ top: 50%;
+ right: 12px;
+}
+.mblListItem .mblRightButton {
+ position: absolute;
+ top: -50%;
+}
+
+/* Switch */
+.mblSwitch {
+ position: relative;
+ width: 94px;
+ height: 27px;
+ overflow: hidden;
+}
+.mblItemSwitch {
+ position: absolute;
+ top: 8px;
+ right: 12px;
+}
+.mblSwitchInner {
+ position: absolute;
+ top: 0px;
+ height: 27px;
+}
+.mblSwitchAnimation .mblSwitchInner {
+ -webkit-transition-property: left;
+ -webkit-transition-duration: .3s;
+}
+.mblSwitchOn .mblSwitchInner {
+ left: 0px;
+}
+.mblSwitchOff .mblSwitchInner {
+ left: -53px;
+}
+.mblSwitchBg {
+ position: absolute;
+ top: 0px;
+ height: 27px;
+ border-width: 1px;
+ border-style: inset;
+ border-color: #9CACC0;
+ font-family: Helvetica;
+ font-size: 16px;
+ font-weight: bold;
+ line-height: 29px;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ -webkit-tap-highlight-color: transparent;
+}
+.mblSwitchBgLeft {
+ left: 0px;
+ width: 94px;
+ color: white;
+ background-color: #3F84EB;
+ background: -webkit-gradient(linear, left top, left bottom, from(#2859B1), to(#75ACFB), color-stop(0.5, #3F84EB), color-stop(0.5, #4C8EEE));
+}
+.mblSwitchBgRight {
+ left: 53px;
+ width: 94px;
+ color: #7F7F7F;
+ background-color: #EEEEEE;
+ background: -webkit-gradient(linear, left top, left bottom, from(#CECECE), to(#FDFDFD), color-stop(0.5, #EEEEEE), color-stop(0.5, #F8F8F8));
+}
+.mblSwitchKnob {
+ position: absolute;
+ top: 1px;
+ left: 53px;
+ width: 41px;
+ height: 26px;
+ font-size: 1px;
+ border-width: 1px;
+ border-style: solid;
+ border-color: #EFEFEF #A5A5A5 #969696 #325E9E;
+ line-height: 29px;
+ background-color: #CCCCCC;
+ background: -webkit-gradient(linear, left top, left bottom, from(#CCCCCC), to(#FAFAFA));
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+}
+.mblSwitchText {
+ position: relative;
+ top: 0px;
+ width: 53px;
+ height: 27px;
+ padding: 0px;
+ text-align: center;
+}
+.mblSwitchTextLeft {
+ left: 0px;
+}
+.mblSwitchTextRight {
+ left: 40px;
+}
+
+/* Icon Container */
+.mblIconContainer {
+ padding: 0px;
+ margin: 20px 0px 0px 10px;
+ padding: 0px 0px 40px 0px;
+}
+.mblIconItem {
+ list-style-type: none;
+ float: left;
+}
+.mblIconItemTerminator {
+ list-style-type: none;
+ height: 20px;
+ clear: both;
+}
+.mblIconItemSub {
+ list-style-type: none;
+ margin-left: -10px;
+ background-color: white;
+}
+
+.mblIconArea {
+ font-family: Helvetica;
+ font-size: 12px;
+ height: 78px;
+ width: 74px;
+ text-align: center;
+ margin-bottom: 10px;
+}
+
+.mblIconArea DIV {
+ position: relative;
+ height: 65px;
+}
+
+.mblIconArea IMG {
+ position: absolute;
+ top: 0px;
+ left: 6px;
+}
+
+.mblContent {
+ clear: both;
+ padding-bottom: 20px;
+}
+
+table.mblClose {
+ clear: both;
+ cursor: pointer;
+}
+
+.mblVibrate{
+ position: relative;
+ -webkit-animation-duration: .5s;
+ -webkit-animation-timing-function: ease-in-out;
+ -webkit-animation-iteration-count: 20;
+ -webkit-animation-name: vibrate;
+ -webkit-transform: rotate(0deg);
+}
+@-webkit-keyframes vibrate{
+ 0%{
+ -webkit-transform: rotate(-2deg);
+ bottom: -1px;
+ left: -1px;
+ }
+ 25% {
+ -webkit-transform: rotate(1deg);
+ bottom: 2px;
+ left: 1px;
+ }
+ 50% {
+ -webkit-transform: rotate(-1deg);
+ bottom: -2px;
+ left: -1px;
+ }
+ 75% {
+ -webkit-transform: rotate(2deg);
+ bottom: 2px;
+ left: 1px;
+ }
+ 100% {
+ -webkit-transform: rotate(-2deg);
+ bottom: -1px;
+ left: -1px;
+ }
+}
+
+.mblCloseContent{
+ -webkit-animation-duration: .3s;
+ -webkit-animation-timing-function: ease-in-out;
+ -webkit-animation-name: shrink;
+ -webkit-transform: scale(0.01);
+}
+.mblCloseContent.mblShrink0{
+ -webkit-animation-name: shrink0;
+}
+.mblCloseContent.mblShrink1{
+ -webkit-animation-name: shrink1;
+}
+.mblCloseContent.mblShrink2{
+ -webkit-animation-name: shrink2;
+}
+.mblCloseContent.mblShrink3{
+ -webkit-animation-name: shrink3;
+}
+@-webkit-keyframes shrink{
+ from { -webkit-transform: scale(1); }
+ to { -webkit-transform: scale(0.01); }
+}
+@-webkit-keyframes shrink0{
+ from { -webkit-transform: scale(1); }
+ to { -webkit-transform: translate(-40%,-70%) scale(0.01); }
+}
+@-webkit-keyframes shrink1{
+ from { -webkit-transform: scale(1); }
+ to { -webkit-transform: translate(-14%,-70%) scale(0.01); }
+}
+@-webkit-keyframes shrink2{
+ from { -webkit-transform: scale(1); }
+ to { -webkit-transform: translate(14%,-70%) scale(0.01); }
+}
+@-webkit-keyframes shrink3{
+ from { -webkit-transform: scale(1); }
+ to { -webkit-transform: translate(40%,-70%) scale(0.01); }
+}
+
+/* Icon Content Heading */
+.mblIconContentHeading {
+ position: relative;
+ clear: both;
+ height: 25px;
+ padding-left: 40px;
+ margin-top: 0px;
+ background: -webkit-gradient(linear, left top, left bottom, from(#E0E4E7), to(#B4BEC6), color-stop(0.5, #C4CCD2), color-stop(0.5, #BFC8CE));
+ border-top: 1px solid #F1F3F4;
+ border-bottom: 1px solid #717D85;
+ font-family: Helvetica;
+ font-size: 14px;
+ color: white;
+ line-height: 26px;
+ text-shadow: rgba(0,0,0,0.6) 0px -1px 0px;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
+
+/* dojox.mobile.Button */
+.mblButton {
+ padding: 0px 10px;
+ height: 29px;
+ border-width: 1px 1px 1px 1px;
+ border-style: outset;
+ color: white;
+ font-family: Helvetica;
+ font-size: 13px;
+ line-height: 29px;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ -webkit-tap-highlight-color: transparent;
+}
+.mblBlueButton {
+ border-color: #9CACC0;
+ background-color: #366EDF;
+ background: -webkit-gradient(linear, left top, left bottom, from(#7A9DE9), to(#2362DD), color-stop(0.5, #366EDF), color-stop(0.5, #215FDC));
+ -webkit-tap-highlight-color: transparent;
+}
+.mblBlueButtonSelected {
+ background: -webkit-gradient(linear, left top, left bottom, from(#8EA4C1), to(#4A6C9B), color-stop(0.5, #5877A2), color-stop(0.5, #476999));
+}
+.mblRedButton {
+ border-color: #9CACC0;
+ background-color: #366EDF;
+ background: -webkit-gradient(linear, left top, left bottom, from(#FA9D58), to(#EE4115), color-stop(0.5, #FF4D25), color-stop(0.5, #ED4D15));
+ -webkit-tap-highlight-color: transparent;
+}
+.mblRedButtonSelected {
+ background: -webkit-gradient(linear, left top, left bottom, from(#C1A48E), to(#9B6C4A), color-stop(0.5, #A27758), color-stop(0.5, #996947));
+}
+
+/* Tab Container */
+.mblTabContainer {
+}
+
+.mblTabButton {
+ float: left;
+ position: relative;
+ list-style-type: none;
+ width: 100px;
+ text-align: center;
+ height: 28px;
+ border-width: 1px 1px 1px 0px;
+ border-style: inset;
+ border-color: #9CACC0;
+ border-right-color: #5E708A;
+ font-family: Helvetica;
+ font-size: 13px;
+ color: white;
+ cursor: pointer;
+ line-height: 29px;
+ background: -webkit-gradient(linear, left top, left bottom, from(#ABB9CA), to(#788DA9), color-stop(0.5, #8297AF), color-stop(0.5, #768BA7));
+ -webkit-tap-highlight-color: transparent;
+}
+.mblTabButton:first-child {
+ -webkit-border-top-left-radius: 5px;
+ -webkit-border-bottom-left-radius: 5px;
+ -moz-border-radius-topleft: 5px;
+ -moz-border-radius-bottomleft: 5px;
+ border-left-width: 1px;
+}
+.mblTabButton:last-child {
+ -webkit-border-top-right-radius: 5px;
+ -webkit-border-bottom-right-radius: 5px;
+ -moz-border-radius-topright: 5px;
+ -moz-border-radius-bottomright: 5px;
+ border-right-color: #9CACC0;
+}
+.mblTabPanelHeader .mblTabButton.mblTabButtonSelected {
+ background-color: #5877A2;
+ background: -webkit-gradient(linear, left top, left bottom, from(#8EA4C1), to(#4A6C9B), color-stop(0.5, #5877A2), color-stop(0.5, #476999));
+}
+.mblTabButtonImgDiv {
+ display: none;
+}
+
+.mblTabPanelHeader {
+ position: relative;
+ height: 39px;
+ margin: 0px;
+ padding: 3px 0px 0px 0px;
+ background-color: #889BB3;
+ background: -webkit-gradient(linear, left top, left bottom, from(#B0BCCD), to(#6D84A2), color-stop(0.5, #889BB3), color-stop(0.5, #8195AF));
+ border-top: 1px solid #CDD5DF;
+ border-bottom: 1px solid #2D3642;
+ font-family: Helvetica;
+ font-size: 20px;
+ color: white;
+ text-align: center;
+ line-height: 44px;
+ text-shadow: rgba(0,0,0,0.6) 0px -1px 0px;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
+
+.mblTabPanelPane {
+}
+
+.mblTabPane {
+}
+
+/* Progress Indicator */
+.mblProgContainer {
+ position: absolute;
+ width: 36px;
+ height: 36px;
+ top: 180px;
+ left: 50%;
+ margin: -18px 0px 0px -18px;
+}
+.mblProg {
+ position: absolute;
+ left: 0px;
+ top: 0px;
+ width: 11px;
+ font-size: 1px;
+ height: 4px;
+ overflow: hidden;
+ -webkit-transform-origin: 0 2px;
+ background-color: #C0C0C0;
+ -webkit-border-radius: 2px;
+ -moz-border-radius: 2px;
+}
+.mblProg0 {
+ -webkit-transform: translate(18px,10px) rotate(-90deg);
+}
+.mblProg1 {
+ -webkit-transform: translate(22px,11px) rotate(-60deg);
+}
+.mblProg2 {
+ -webkit-transform: translate(25px,14px) rotate(-30deg);
+}
+.mblProg3 {
+ -webkit-transform: translate(26px,18px) rotate(0deg);
+}
+.mblProg4 {
+ -webkit-transform: translate(25px,22px) rotate(30deg);
+}
+.mblProg5 {
+ -webkit-transform: translate(22px,25px) rotate(60deg);
+}
+.mblProg6 {
+ -webkit-transform: translate(18px,26px) rotate(90deg);
+}
+.mblProg7 {
+ -webkit-transform: translate(14px,25px) rotate(120deg);
+}
+.mblProg8 {
+ -webkit-transform: translate(11px,22px) rotate(150deg);
+}
+.mblProg9 {
+ -webkit-transform: translate(10px,18px) rotate(180deg);
+}
+.mblProg10 {
+ -webkit-transform: translate(11px,14px) rotate(210deg);
+}
+.mblProg11 {
+ -webkit-transform: translate(14px,11px) rotate(240deg);
+}
+
+/* Button Colors */
+.mblColorBlue {
+ background-color: #366EDF;
+ background: -webkit-gradient(linear, left top, left bottom, from(#7A9DE9), to(#2362DD), color-stop(0.5, #366EDF), color-stop(0.5, #215FDC));
+}
+
+/* Default Button Colors */
+.mblColorDefault { /* Dark Blue */
+ background-color: #5877A2;
+ background: -webkit-gradient(linear, left top, left bottom, from(#8EA4C1), to(#4A6C9B), color-stop(0.5, #5877A2), color-stop(0.5, #476999));
+}
+
+.mblColorDefaultSel { /* More Dark Blue */
+ background-color: #394D77;
+ background: -webkit-gradient(linear, left top, left bottom, from(#7C87A4), to(#263E6C), color-stop(0.5, #394D77), color-stop(0.5, #243B69));
+}