compat.js.uncompressed.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. require({cache:{
  2. 'dojox/main':function(){
  3. define("dojox/main", ["dojo/_base/kernel"], function(dojo) {
  4. // module:
  5. // dojox/main
  6. // summary:
  7. // The dojox package main module; dojox package is somewhat unusual in that the main module currently just provides an empty object.
  8. return dojo.dojox;
  9. });
  10. },
  11. 'dojox/mobile/compat':function(){
  12. define([
  13. "dojo/_base/lang",
  14. "dojo/_base/sniff"
  15. ], function(lang, has){
  16. var dm = lang.getObject("dojox.mobile", true);
  17. if(!has("webkit")){
  18. var s = "dojox/mobile/_compat"; // assign to a variable so as not to be picked up by the build tool
  19. require([s]);
  20. }
  21. return dm;
  22. });
  23. },
  24. 'dijit/main':function(){
  25. define("dijit/main", [
  26. "dojo/_base/kernel"
  27. ], function(dojo){
  28. // module:
  29. // dijit
  30. // summary:
  31. // The dijit package main module
  32. return dojo.dijit;
  33. });
  34. }}});
  35. // wrapped by build app
  36. define("dojox/mobile/app/compat", ["dijit","dojo","dojox","dojo/require!dojox/mobile/compat"], function(dijit,dojo,dojox){
  37. dojo.provide("dojox.mobile.app.compat");
  38. dojo.require("dojox.mobile.compat");
  39. // summary:
  40. // CSS3 compatibility module for apps
  41. // description:
  42. // This module provides support for some of the CSS3 features to djMobile
  43. // for non-CSS3 browsers, such as IE or Firefox.
  44. // If you load this module, it directly replaces some of the methods of
  45. // djMobile instead of subclassing. This way, html pages remains the same
  46. // regardless of whether this compatibility module is used or not.
  47. // Recommended usage is as follows. the code below loads dojox.mobile.compat
  48. // only when isWebKit is true.
  49. //
  50. // dojo.require("dojox.mobile");
  51. // dojo.requireIf(!dojo.isWebKit, "dojox.mobile.appCompat");
  52. dojo.extend(dojox.mobile.app.AlertDialog, {
  53. _doTransition: function(dir){
  54. console.log("in _doTransition and this = ", this);
  55. var h = dojo.marginBox(this.domNode.firstChild).h;
  56. var bodyHeight = this.controller.getWindowSize().h;
  57. var high = bodyHeight - h;
  58. var low = bodyHeight;
  59. var anim1 = dojo.fx.slideTo({
  60. node: this.domNode,
  61. duration: 400,
  62. top: {start: dir < 0 ? high : low, end: dir < 0 ? low: high}
  63. });
  64. var anim2 = dojo[dir < 0 ? "fadeOut" : "fadeIn"]({
  65. node: this.mask,
  66. duration: 400
  67. });
  68. var anim = dojo.fx.combine([anim1, anim2]);
  69. var _this = this;
  70. dojo.connect(anim, "onEnd", this, function(){
  71. if(dir < 0){
  72. _this.domNode.style.display = "none";
  73. dojo.destroy(_this.domNode);
  74. dojo.destroy(_this.mask);
  75. }
  76. });
  77. anim.play();
  78. }
  79. });
  80. dojo.extend(dojox.mobile.app.List, {
  81. deleteRow: function(){
  82. console.log("deleteRow in compat mode", row);
  83. var row = this._selectedRow;
  84. // First make the row invisible
  85. // Put it back where it came from
  86. dojo.style(row, {
  87. visibility: "hidden",
  88. minHeight: "0px"
  89. });
  90. dojo.removeClass(row, "hold");
  91. // Animate reducing it's height to zero, then delete the data from the
  92. // array
  93. var height = dojo.contentBox(row).h;
  94. dojo.animateProperty({
  95. node: row,
  96. duration: 800,
  97. properties: {
  98. height: {start: height, end: 1},
  99. paddingTop: {end: 0},
  100. paddingBottom: {end: 0}
  101. },
  102. onEnd: this._postDeleteAnim
  103. }).play();
  104. }
  105. });
  106. if(dojox.mobile.app.ImageView && !dojo.create("canvas").getContext){
  107. dojo.extend(dojox.mobile.app.ImageView, {
  108. buildRendering: function(){
  109. this.domNode.innerHTML =
  110. "ImageView widget is not supported on this browser."
  111. + "Please try again with a modern browser, e.g. "
  112. + "Safari, Chrome or Firefox";
  113. this.canvas = {};
  114. },
  115. postCreate: function(){}
  116. });
  117. }
  118. if(dojox.mobile.app.ImageThumbView){
  119. dojo.extend(dojox.mobile.app.ImageThumbView, {
  120. place: function(node, x, y){
  121. dojo.style(node, {
  122. top: y + "px",
  123. left: x + "px",
  124. visibility: "visible"
  125. });
  126. }
  127. })
  128. }
  129. });