Browse files

changes to standard AMD format and ensure current examples still work

  • Loading branch information...
1 parent 84332f7 commit 8fcb6054afdb7311318872875a8e3f9883b45d47 @jonlb jonlb committed Mar 24, 2012
Showing with 3,064 additions and 13,683 deletions.
  1. +4 −0 .gitignore
  2. +36 −7 src/Source/base.js
  3. +1 −1 src/Source/config.js
  4. +21 −8 src/Source/global.js
  5. +4 −5 src/Source/jx/adaptor.js
  6. +3 −3 src/Source/jx/adaptor/combo.js
  7. +6 −6 src/Source/jx/adaptor/combo/fill.js
  8. +2 −3 src/Source/jx/adaptor/listview.js
  9. +6 −7 src/Source/jx/adaptor/listview/fill.js
  10. +6 −9 src/Source/jx/adaptor/tree.js
  11. +6 −6 src/Source/jx/adaptor/tree/mptt.js
  12. +6 −8 src/Source/jx/adaptor/tree/object.js
  13. +6 −6 src/Source/jx/adaptor/tree/parent.js
  14. +4 −4 src/Source/jx/button.js
  15. +5 −6 src/Source/jx/button/color.js
  16. +7 −7 src/Source/jx/button/flyout.js
  17. +5 −8 src/Source/jx/button/multi.js
  18. +6 −7 src/Source/jx/button/set.js
  19. +4 −5 src/Source/jx/colorpalette.js
  20. +5 −6 src/Source/jx/compare.js
  21. +8 −9 src/Source/jx/container.js
  22. +4 −4 src/Source/jx/data.js
  23. +6 −6 src/Source/jx/data/parser.js
  24. +6 −7 src/Source/jx/data/parser/json.js
  25. +6 −6 src/Source/jx/data/protocol.js
  26. +6 −7 src/Source/jx/data/protocol/ajax.js
  27. +6 −7 src/Source/jx/data/protocol/local.js
  28. +6 −6 src/Source/jx/data/response.js
  29. +6 −10 src/Source/jx/datepicker.js
  30. +5 −7 src/Source/jx/dialog.js
  31. +6 −8 src/Source/jx/dialog/confirm.js
  32. +6 −8 src/Source/jx/dialog/message.js
  33. +9 −12 src/Source/jx/dialog/prompt.js
  34. +11 −12 src/Source/jx/editor.js
  35. +6 −6 src/Source/jx/editor/selection.js
  36. +18 −11 src/Source/jx/field.js
  37. +6 −7 src/Source/jx/field/button.js
  38. +6 −6 src/Source/jx/field/checkbox.js
  39. +6 −9 src/Source/jx/field/color.js
  40. +6 −9 src/Source/jx/field/combo.js
  41. +8 −11 src/Source/jx/field/combobox.js
  42. +6 −9 src/Source/jx/field/date.js
  43. +6 −6 src/Source/jx/field/display.js
  44. +6 −7 src/Source/jx/field/editor.js
  45. +6 −10 src/Source/jx/field/file.js
  46. +6 −6 src/Source/jx/field/hidden.js
  47. +6 −6 src/Source/jx/field/numberspinner.js
  48. +7 −10 src/Source/jx/field/optiongroup.js
  49. +6 −6 src/Source/jx/field/password.js
  50. +6 −6 src/Source/jx/field/radio.js
  51. +5 −6 src/Source/jx/field/select.js
  52. +6 −7 src/Source/jx/field/spinner.js
  53. +6 −6 src/Source/jx/field/text.js
  54. +6 −6 src/Source/jx/field/textarea.js
  55. +10 −14 src/Source/jx/field/treecombo.js
  56. +9 −9 src/Source/jx/fieldset.js
  57. +19 −13 src/Source/jx/form.js
  58. +5 −6 src/Source/jx/formatter.js
  59. +6 −6 src/Source/jx/formatter/boolean.js
  60. +6 −6 src/Source/jx/formatter/currency.js
  61. +6 −6 src/Source/jx/formatter/date.js
  62. +6 −6 src/Source/jx/formatter/number.js
  63. +6 −6 src/Source/jx/formatter/phone.js
  64. +36 −37 src/Source/jx/formatter/text.js
  65. +6 −6 src/Source/jx/formatter/uri.js
  66. +22 −20 src/Source/jx/grid.js
  67. +8 −12 src/Source/jx/grid/column.js
  68. +6 −9 src/Source/jx/grid/columnmodel.js
  69. +11 −9 src/Source/jx/grid/renderer.js
  70. +5 −7 src/Source/jx/grid/renderer/button.js
  71. +6 −7 src/Source/jx/grid/renderer/checkbox.js
  72. +7 −8 src/Source/jx/grid/renderer/text.js
  73. +6 −8 src/Source/jx/grid/rowModel.js
  74. +85 −0 src/Source/jx/lang.js
  75. +5 −6 src/Source/jx/layout.js
  76. +5 −6 src/Source/jx/layoutmanager.js
  77. +6 −6 src/Source/jx/layoutmanager/anchored.js
  78. +6 −6 src/Source/jx/layoutmanager/columns.js
  79. +6 −6 src/Source/jx/layoutmanager/fill.js
  80. +6 −8 src/Source/jx/layoutmanager/split.js
  81. +4 −6 src/Source/jx/list.js
  82. +5 −6 src/Source/jx/listitem.js
  83. +5 −6 src/Source/jx/listview.js
  84. +5 −7 src/Source/jx/menu.js
  85. +5 −5 src/Source/jx/menu/context.js
  86. +5 −5 src/Source/jx/menu/item.js
  87. +5 −5 src/Source/jx/menu/separator.js
  88. +5 −6 src/Source/jx/menu/submenu.js
  89. +6 −7 src/Source/jx/monthpicker.js
  90. +5 −6 src/Source/jx/notice.js
  91. +10 −10 src/Source/jx/notice/error.js
  92. +11 −10 src/Source/jx/notice/information.js
  93. +10 −10 src/Source/jx/notice/success.js
  94. +10 −14 src/Source/jx/notice/warning.js
  95. +5 −7 src/Source/jx/notifier.js
  96. +6 −7 src/Source/jx/notifier/float.js
  97. +29 −96 src/Source/jx/object.js
  98. +81 −0 src/Source/jx/options.js
  99. +6 −12 src/Source/jx/panel.js
  100. +6 −7 src/Source/jx/panel/dataview.js
  101. +7 −9 src/Source/jx/panel/dataview/group.js
  102. +7 −13 src/Source/jx/panel/fileupload.js
  103. +6 −8 src/Source/jx/panelset.js
  104. +42 −9 src/Source/jx/plugin.js
  105. +4 −2 src/Source/jx/plugin/dataview.js
  106. +5 −8 src/Source/jx/plugin/dataview/groupfolder.js
  107. +3 −2 src/Source/jx/plugin/editor.js
  108. +6 −6 src/Source/jx/plugin/editor/alignment.js
  109. +6 −7 src/Source/jx/plugin/editor/block.js
  110. +5 −6 src/Source/jx/plugin/editor/bold.js
  111. +5 −7 src/Source/jx/plugin/editor/button.js
  112. +5 −8 src/Source/jx/plugin/editor/buttonset.js
  113. +6 −7 src/Source/jx/plugin/editor/customstyles.js
  114. +5 −7 src/Source/jx/plugin/editor/image.js
  115. +5 −6 src/Source/jx/plugin/editor/indent.js
  116. +5 −6 src/Source/jx/plugin/editor/italic.js
  117. +6 −8 src/Source/jx/plugin/editor/link.js
  118. +6 −6 src/Source/jx/plugin/editor/orderedlist.js
  119. +6 −6 src/Source/jx/plugin/editor/outdent.js
  120. +7 −7 src/Source/jx/plugin/editor/redo.js
  121. +6 −7 src/Source/jx/plugin/editor/separator.js
  122. +5 −6 src/Source/jx/plugin/editor/strikethrough.js
  123. +6 −6 src/Source/jx/plugin/editor/toggle.js
  124. +6 −6 src/Source/jx/plugin/editor/underline.js
  125. +6 −6 src/Source/jx/plugin/editor/undo.js
  126. +6 −6 src/Source/jx/plugin/editor/unlink.js
  127. +6 −6 src/Source/jx/plugin/editor/unorderedlist.js
  128. +4 −2 src/Source/jx/plugin/field.js
  129. +6 −7 src/Source/jx/plugin/field/validator.js
  130. +3 −2 src/Source/jx/plugin/form.js
  131. +6 −6 src/Source/jx/plugin/form/InlineErrors.js
  132. +6 −9 src/Source/jx/plugin/form/notifier.js
  133. +6 −8 src/Source/jx/plugin/form/validator.js
  134. +3 −2 src/Source/jx/plugin/grid.js
  135. +6 −7 src/Source/jx/plugin/grid/editor.js
  136. +6 −7 src/Source/jx/plugin/grid/prelighter.js
  137. +6 −7 src/Source/jx/plugin/grid/resize.js
  138. +6 −8 src/Source/jx/plugin/grid/selector.js
  139. +6 −7 src/Source/jx/plugin/grid/sorter.js
  140. +3 −2 src/Source/jx/plugin/panel.js
  141. +4 −2 src/Source/jx/plugin/toolbarcontainer.js
  142. +7 −10 src/Source/jx/plugin/toolbarcontainer/tabMenu.js
  143. +3 −2 src/Source/jx/plugin/tree.js
  144. +5 −8 src/Source/jx/plugin/tree/sorter.js
  145. +5 −6 src/Source/jx/progressbar.js
  146. +5 −7 src/Source/jx/record.js
  147. +5 −7 src/Source/jx/scrollbar.js
  148. +5 −6 src/Source/jx/selection.js
  149. +5 −6 src/Source/jx/slide.js
  150. +5 −6 src/Source/jx/slider.js
  151. +5 −6 src/Source/jx/sort.js
  152. +5 −6 src/Source/jx/sort/heapsort.js
  153. +5 −6 src/Source/jx/sort/mergesort.js
  154. +5 −6 src/Source/jx/sort/nativesort.js
  155. +5 −6 src/Source/jx/sort/quicksort.js
  156. +11 −11 src/Source/jx/splitter.js
  157. +6 −6 src/Source/jx/splitter/snap.js
  158. +5 −5 src/Source/jx/stack.js
  159. +7 −9 src/Source/jx/store.js
  160. +5 −7 src/Source/jx/store/strategy.js
  161. +6 −6 src/Source/jx/store/strategy/full.js
  162. +6 −6 src/Source/jx/store/strategy/paginate.js
  163. +6 −6 src/Source/jx/store/strategy/progressive.js
  164. +6 −7 src/Source/jx/store/strategy/save.js
  165. +8 −8 src/Source/jx/store/strategy/sort.js
  166. +5 −5 src/Source/jx/styles.js
  167. +5 −8 src/Source/jx/tab.js
  168. +6 −10 src/Source/jx/tabbox.js
  169. +5 −7 src/Source/jx/tabset.js
  170. +13 −13 src/Source/jx/toolbar.js
  171. +6 −7 src/Source/jx/toolbar/container.js
  172. +5 −6 src/Source/jx/toolbar/item.js
  173. +6 −9 src/Source/jx/toolbar/paging.js
  174. +5 −6 src/Source/jx/toolbar/separator.js
  175. +5 −6 src/Source/jx/tooltip.js
  176. +14 −10 src/Source/jx/tree.js
  177. +6 −9 src/Source/jx/tree/folder.js
  178. +5 −6 src/Source/jx/tree/item.js
  179. +4 −9 src/Source/jx/widget.js
  180. +4 −6 src/Source/jx/widget/list.js
  181. +3 −1 utils/ndconfig/Menu.txt
  182. +1 −0 www/lib/empty.html
  183. +1 −1 www/reference/examples/forms.html
  184. +5 −3 www/reference/examples/grid.html
  185. +2 −0 www/reference/examples/require/css/prettify.css
  186. 0 www/reference/examples/require/{lib/Source/app.build.js → fiddles/button/demo.css}
  187. 0 www/reference/examples/require/fiddles/button/demo.details
  188. 0 www/reference/examples/require/fiddles/button/demo.html
  189. 0 www/reference/examples/require/fiddles/button/demo.js
  190. +23 −0 www/reference/examples/require/index.html
  191. +61 −0 www/reference/examples/require/js/examples.json
  192. 0 www/reference/examples/require/js/index.js
  193. +1,582 −0 www/reference/examples/require/js/tests.js
  194. BIN www/reference/examples/require/lib/Source/a_pixel.png
  195. +0 −754 www/reference/examples/require/lib/Source/base.js
  196. +0 −22 www/reference/examples/require/lib/Source/config.js
  197. +0 −73 www/reference/examples/require/lib/Source/global.js
  198. +0 −42 www/reference/examples/require/lib/Source/jx.js
  199. +0 −97 www/reference/examples/require/lib/Source/jx/adaptor.js
  200. +0 −30 www/reference/examples/require/lib/Source/jx/adaptor/combo.js
  201. +0 −131 www/reference/examples/require/lib/Source/jx/adaptor/combo/fill.js
  202. +0 −27 www/reference/examples/require/lib/Source/jx/adaptor/listview.js
  203. +0 −122 www/reference/examples/require/lib/Source/jx/adaptor/listview/fill.js
  204. +0 −239 www/reference/examples/require/lib/Source/jx/adaptor/tree.js
  205. +0 −108 www/reference/examples/require/lib/Source/jx/adaptor/tree/mptt.js
  206. +0 −156 www/reference/examples/require/lib/Source/jx/adaptor/tree/object.js
  207. +0 −96 www/reference/examples/require/lib/Source/jx/adaptor/tree/parent.js
  208. +0 −461 www/reference/examples/require/lib/Source/jx/button.js
  209. +0 −237 www/reference/examples/require/lib/Source/jx/button/color.js
  210. +0 −322 www/reference/examples/require/lib/Source/jx/button/flyout.js
  211. +0 −419 www/reference/examples/require/lib/Source/jx/button/multi.js
  212. +0 −163 www/reference/examples/require/lib/Source/jx/button/set.js
  213. +0 −357 www/reference/examples/require/lib/Source/jx/colorpalette.js
  214. +0 −158 www/reference/examples/require/lib/Source/jx/compare.js
  215. +0 −248 www/reference/examples/require/lib/Source/jx/container.js
  216. +0 −25 www/reference/examples/require/lib/Source/jx/data.js
  217. +0 −65 www/reference/examples/require/lib/Source/jx/data/parser.js
  218. +0 −91 www/reference/examples/require/lib/Source/jx/data/parser/json.js
  219. +0 −131 www/reference/examples/require/lib/Source/jx/data/protocol.js
  220. +0 −308 www/reference/examples/require/lib/Source/jx/data/protocol/ajax.js
  221. +0 −120 www/reference/examples/require/lib/Source/jx/data/protocol/local.js
  222. +0 −94 www/reference/examples/require/lib/Source/jx/data/response.js
  223. +0 −256 www/reference/examples/require/lib/Source/jx/datepicker.js
  224. +0 −760 www/reference/examples/require/lib/Source/jx/dialog.js
  225. +0 −162 www/reference/examples/require/lib/Source/jx/dialog/confirm.js
  226. +0 −174 www/reference/examples/require/lib/Source/jx/dialog/message.js
  227. +0 −184 www/reference/examples/require/lib/Source/jx/dialog/prompt.js
  228. +0 −746 www/reference/examples/require/lib/Source/jx/editor.js
  229. +0 −181 www/reference/examples/require/lib/Source/jx/editor/selection.js
  230. +0 −434 www/reference/examples/require/lib/Source/jx/field.js
  231. +0 −110 www/reference/examples/require/lib/Source/jx/field/button.js
  232. +0 −158 www/reference/examples/require/lib/Source/jx/field/checkbox.js
  233. +0 −205 www/reference/examples/require/lib/Source/jx/field/color.js
  234. +0 −279 www/reference/examples/require/lib/Source/jx/field/combo.js
  235. +0 −164 www/reference/examples/require/lib/Source/jx/field/combobox.js
  236. +0 −148 www/reference/examples/require/lib/Source/jx/field/date.js
  237. +0 −56 www/reference/examples/require/lib/Source/jx/field/display.js
  238. +0 −112 www/reference/examples/require/lib/Source/jx/field/editor.js
  239. +0 −482 www/reference/examples/require/lib/Source/jx/field/file.js
  240. +0 −66 www/reference/examples/require/lib/Source/jx/field/hidden.js
  241. +0 −89 www/reference/examples/require/lib/Source/jx/field/numberspinner.js
  242. +0 −136 www/reference/examples/require/lib/Source/jx/field/optiongroup.js
  243. +0 −55 www/reference/examples/require/lib/Source/jx/field/password.js
  244. +0 −152 www/reference/examples/require/lib/Source/jx/field/radio.js
  245. +0 −228 www/reference/examples/require/lib/Source/jx/field/select.js
  246. +0 −94 www/reference/examples/require/lib/Source/jx/field/spinner.js
  247. +0 −101 www/reference/examples/require/lib/Source/jx/field/text.js
  248. +0 −107 www/reference/examples/require/lib/Source/jx/field/textarea.js
  249. +0 −199 www/reference/examples/require/lib/Source/jx/field/treecombo.js
  250. +0 −202 www/reference/examples/require/lib/Source/jx/fieldset.js
  251. +0 −426 www/reference/examples/require/lib/Source/jx/form.js
  252. +0 −54 www/reference/examples/require/lib/Source/jx/formatter.js
  253. +0 −98 www/reference/examples/require/lib/Source/jx/formatter/boolean.js
  254. +0 −95 www/reference/examples/require/lib/Source/jx/formatter/currency.js
  255. +0 −71 www/reference/examples/require/lib/Source/jx/formatter/date.js
  256. +0 −155 www/reference/examples/require/lib/Source/jx/formatter/number.js
  257. +0 −100 www/reference/examples/require/lib/Source/jx/formatter/phone.js
  258. +0 −78 www/reference/examples/require/lib/Source/jx/formatter/text.js
  259. +0 −96 www/reference/examples/require/lib/Source/jx/formatter/uri.js
Sorry, we could not display the entire diff because too many files (511) changed.
View
4 .gitignore
@@ -60,3 +60,7 @@ build.log
.settings.xml
node_modules/build
+
+# /www/reference/eamples/require
+/www/reference/examples/require/lib
+
View
43 src/Source/base.js
@@ -70,22 +70,49 @@ require.onError = function (err) {
* to match the above dependencies.
*
*/
-define('base',function(require, exports, module){
+define('base',['config','require'], function(config, require){
- var base = module.exports,
- config = require('config');
+ var base = {};
if (typeof Jx != 'undefined') {
- exports.global = Jx;
+ base.global = Jx;
//move any global config to the base
- Object.append(base, exports.global);
+ Object.append(base, base.global);
} else if (config !== null && config !== undefined) {
//add in any config passed in
Object.append(base, config);
}
base.version = "3.2-dev";
+
+ /**
+ * Function: base.require
+ * This function should be used within all of Jx code to get modules.
+ * In global mode it simply calls the globall require method. In requirejs
+ * mode it needs to check if the file is defined in requirejs and if so
+ * just return it. If not, it needs to request and then block until it
+ * gets sent back.
+ *
+ * NOTE: perhaps a while (!require.defined(file)) {};
+ *
+ */
+ base.require = function(file){
+ if (require.defined(file)) {
+ while (typeOf(require(file)) !== 'function') {}
+ return require(file);
+ }
+
+ var loaded = false;
+ require([file],function(f){
+ loaded = true;
+ file = f;
+ });
+
+ while (!require.defined(file)) {}
+
+ return file;
+ }
/**
* Function: $jx
* dereferences a DOM Element to a JxLib object if possible and returns
@@ -747,8 +774,10 @@ define('base',function(require, exports, module){
// End Wrapper for document.id
//add all of base's members to the global context
- if (exports.global) {
- Object.append(exports.global, exports);
+ if (base.global) {
+ Object.append(base.global, base);
}
+
+ return base;
});
View
2 src/Source/config.js
@@ -19,4 +19,4 @@ provides: [Config]
* This file is only used when require.js is used. In a full build this file should
* be excluded and the user will need to define any config "normally".
*/
-define('config',[],function(){return null;});
+define('config', function(){return null;});
View
29 src/Source/global.js
@@ -41,14 +41,27 @@ this.require = function(name){
};
var define = this.define = function(id, deps, fn){
- if (typeof deps == 'function') fn = deps;
- var module = {exports: {}};
- var require = function(name){
- name = normalize(name, id);
- return loaded[name];
- };
- fn.call(module.exports, require, module.exports, module);
- loaded[id] = module.exports;
+ if (typeof deps == 'function') {
+ fn = deps;
+ deps = [];
+ }
+ if (loaded.require === undefined || loaded.require === null) {
+ var require = function(name){
+ name = normalize(name, id);
+ return loaded[name];
+ };
+ require.defined = function(name) {
+ return (loaded[name] !== undefined && loaded[name] !== null);
+ }
+ loaded['require'] = require;
+ }
+ //get deps
+ var d = deps.map(function(dep){
+ name = normalize(dep, id);
+ return loaded[name];
+ });
+ var ret = fn.apply(this,d);
+ loaded[id] = ret;
};
define.amd = {};
View
9 src/Source/jx/adaptor.js
@@ -32,12 +32,9 @@ provides: [Jx.Adaptor]
* License: mit-style
*/
-define('jx/adaptor', function(require, exports, module){
+define('jx/adaptor', ['../base','./plugin'], function(base, Plugin){
- var Plugin = require('./plugin'),
- base = require('base');
-
- var adaptor = module.exports = new Class({
+ var adaptor = new Class({
Extends: Plugin,
Family: 'Jx.Adaptor',
@@ -93,5 +90,7 @@ define('jx/adaptor', function(require, exports, module){
if (base.global) {
base.global.Adaptor = adaptor;
}
+
+ return adaptor;
});
View
6 src/Source/jx/adaptor/combo.js
@@ -19,12 +19,12 @@ provides: [Jx.Adaptor.Combo]
* The namespace for all combo adaptors
*/
-define("jx/adaptor/combo", function(require){
-
- var base = require("../../base");
+define("jx/adaptor/combo", ['../../base'], function(base){
//This just needs to set the namespace in the global object
if (base.global) {
base.global.Adaptor.Combo = {};
}
+
+ return {};
});
View
12 src/Source/jx/adaptor/combo/fill.js
@@ -15,12 +15,10 @@ provides: [Jx.Adaptor.Combo.Fill]
...
*/
-define('jx/adaptor/combo/fill', function(require, exports, module){
+define('jx/adaptor/combo/fill', ['../../../base','../../adaptor'],
+ function(base, Adaptor){
- var base = require("../../../base"),
- Adaptor = require("../../adaptor")
-
- var fill = module.exports = new Class({
+ var fill = new Class({
Extends: Adaptor,
Family: 'Jx.Adaptor.Combo.Fill',
@@ -125,7 +123,9 @@ define('jx/adaptor/combo/fill', function(require, exports, module){
});
if (base.global) {
- base.global.Adaptor.Combo.Fill = module.exports;
+ base.global.Adaptor.Combo.Fill = fill;
}
+ return fill;
+
});
View
5 src/Source/jx/adaptor/listview.js
@@ -16,12 +16,11 @@ provides: [Jx.Adaptor.ListView]
...
*/
-define('jx/adaptor/listview',function(require, exports, module){
-
- var base = require("../../base");
+define('jx/adaptor/listview', ['../../base'],function(base){
//This just needs to set the namespace in the global object
if (base.global) {
base.global.Adaptor.ListView = {};
}
+ return {};
});
View
13 src/Source/jx/adaptor/listview/fill.js
@@ -22,13 +22,10 @@ images:
...
*/
-define("jx/adaptor/listview/fill", function(require, exports, module){
+define("jx/adaptor/listview/fill", ['../../../base','../../adaptor','../../listitem'],
+ function(base, Adaptor, ListItem){
- var base = require("../../../base"),
- Adaptor = require("../../adaptor"),
- ListItem = require("../../listitem");
-
- var fill = module.exports = new Class({
+ var fill = new Class({
Extends: Adaptor,
@@ -117,6 +114,8 @@ define("jx/adaptor/listview/fill", function(require, exports, module){
});
if (base.global) {
- base.global.Adaptor.ListView.Fill = module.exports;
+ base.global.Adaptor.ListView.Fill = fill;
}
+
+ return fill;
});
View
15 src/Source/jx/adaptor/tree.js
@@ -27,15 +27,10 @@ provides: [Jx.Adaptor.Tree]
* License: mit-style
*/
-define('jx/adaptor/tree',function(require,exports,module){
+define('jx/adaptor/tree', ['../../base','../adaptor','../tree/folder','../tree/item','../store/strategy/progressive'],
+ function(base, Adaptor, Folder, Item, Progressive){
- var base = require("../../base"),
- Adaptor = require("../adaptor"),
- Folder = require("../tree/folder"),
- Item = require("../tree/item"),
- Progressive = require("../store/strategy/progressive");
-
- var tree = module.exports = new Class({
+ var tree = new Class({
Extends: Jx.Adaptor,
Family: 'Jx.Adaptor.Tree',
@@ -233,7 +228,9 @@ define('jx/adaptor/tree',function(require,exports,module){
});
if (base.global) {
- base.global.Adaptor.Tree = module.exports;
+ base.global.Adaptor.Tree = tree;
}
+ return tree;
+
});
View
12 src/Source/jx/adaptor/tree/mptt.js
@@ -27,12 +27,10 @@ provides: [Jx.Adaptor.Tree.Mptt]
* License: mit-style
*/
-define("jx/adaptor/tree/mptt",function(require, exports, module){
+define("jx/adaptor/tree/mptt", ['../../../base','../tree'],
+ function(base, treeAdaptor){
- var base = require("../../../base");
- treeAdaptor = require("../tree");
-
- var mptt = module.exports = new Class({
+ var mptt = new Class({
Extends: treeAdaptor,
Family: 'Jx.Adaptor.Tree.Mptt',
@@ -102,7 +100,9 @@ define("jx/adaptor/tree/mptt",function(require, exports, module){
});
if (base.global) {
- base.global.Adaptor.Tree.Mptt = module.exports;
+ base.global.Adaptor.Tree.Mptt = mptt;
}
+ return mptt;
+
});
View
14 src/Source/jx/adaptor/tree/object.js
@@ -40,14 +40,10 @@ provides: [Jx.Adaptor.Tree.Object]
* License: mit-style
*/
-define("jx/adaptor/tree/object",function(require, exports, module){
+define("jx/adaptor/tree/object", ['../../../base','../../tree/folder','../../tree/item','../../plugin'],
+ function(base, Folder, Item, Plugin){
- var base = require("../../../base"),
- Folder = require("../../tree/folder"),
- Item = require("../../tree/item"),
- Plugin = require("../../plugin");
-
- var treeObject = module.exports = new Class({
+ var treeObject = new Class({
Extends: Plugin,
Family: 'Jx.Adaptor.Tree.Object',
@@ -150,7 +146,9 @@ define("jx/adaptor/tree/object",function(require, exports, module){
});
if (base.global) {
- base.global.Adaptor.Tree.Object = module.exports;
+ base.global.Adaptor.Tree.Object = treeObject;
}
+ return treeObject;
+
});
View
12 src/Source/jx/adaptor/tree/parent.js
@@ -34,12 +34,10 @@ provides: [Jx.Adaptor.Tree.Parent]
* License: mit-style
*/
-define('jx/adaptor/tree/parent',function(require, exports, module){
+define('jx/adaptor/tree/parent', ['../../../base','../tree'],
+ function(base, treeAdaptor){
- var base = require("../../../base"),
- treeAdaptor = require("../tree");
-
- var parent = module.exports = new Class({
+ var parent = new Class({
Extends: treeAdaptor,
@@ -90,7 +88,9 @@ define('jx/adaptor/tree/parent',function(require, exports, module){
});
if (base.global) {
- base.global.Adaptor.Tree.Parent = module.exports;
+ base.global.Adaptor.Tree.Parent = parent;
}
+ return parent;
+
});
View
8 src/Source/jx/button.js
@@ -87,12 +87,10 @@ images:
* This file is licensed under an MIT style license
*/
-define('jx/button', function(require, exports, module){
+define('jx/button', ['../base','./widget'], function(base, Widget){
- var base = require("../base"),
- Widget = require("./widget");
- var button = module.exports = new Class({
+ var button = new Class({
Extends: Widget,
Family: 'Jx.Button',
@@ -457,5 +455,7 @@ define('jx/button', function(require, exports, module){
if (base.global) {
base.global.Button = button;
}
+
+ return button;
});
View
11 src/Source/jx/button/color.js
@@ -49,13 +49,10 @@ provides: [Jx.Button.Color]
*
* This file is licensed under an MIT style license
*/
-define('jx/button/color', function(require, exports, module){
+define('jx/button/color', ['../../base','./flyout','../colorpalette'],
+ function(base, Flyout, ColorPalette){
- var base = require("../../base"),
- Flyout = require("./flyout"),
- ColorPalette = require("../colorpalette");
-
- var color = module.exports = new Class({
+ var color = new Class({
Extends: Flyout,
Family: 'Jx.Button.Color',
@@ -233,5 +230,7 @@ define('jx/button/color', function(require, exports, module){
if (base.global) {
base.global.Button.Color = color;
}
+
+ return color;
});
View
14 src/Source/jx/button/flyout.js
@@ -74,12 +74,10 @@ images:
*
* This file is licensed under an MIT style license
*/
-define('jx/button/flyout', function(require, exports, module){
-
- var base = require("../../base"),
- Button = require("../button");
-
- var flyout = module.exports = new Class({
+define('jx/button/flyout', ['../../base','../button'],
+ function(base, Button){
+
+ var flyout = new Class({
Extends: Button,
Family: 'Jx.Button.Flyout',
Binds: ['keypressHandler', 'clickHandler'],
@@ -316,7 +314,9 @@ define('jx/button/flyout', function(require, exports, module){
});
if (base.global) {
- base.global.Button.Flyout = module.exports;
+ base.global.Button.Flyout = flyout;
}
+
+ return flyout;
});
View
13 src/Source/jx/button/multi.js
@@ -78,15 +78,10 @@ images:
*
* This file is licensed under an MIT style license
*/
-define('jx/button/multi', function(require, exports, module){
+define('jx/button/multi', ['../../base','../button','./set','../menu','../menu/item'],
+ function(base, Button, Set, Menu, Item){
- var base = require("../../base"),
- Button = require("../button"),
- Set = require("./set"),
- Menu = require("../menu"),
- Item = require("../menu/item");
-
- var multi = module.exports = new Class({
+ var multi = new Class({
Extends: Button,
Family: 'Jx.Button.Multi',
@@ -415,5 +410,7 @@ define('jx/button/multi', function(require, exports, module){
if (base.global) {
base.global.Button.Multi = multi;
}
+
+ return multi;
});
View
13 src/Source/jx/button/set.js
@@ -8,7 +8,7 @@ description: A ButtonSet manages a set of Jx.Button instances by ensuring that o
license: MIT-style license.
requires:
- - Jx.Object
+ - Jx.Button
provides: [Jx.ButtonSet]
@@ -46,13 +46,10 @@ provides: [Jx.ButtonSet]
*
* This file is licensed under an MIT style license
*/
-define('jx/button/set', function(require, exports, module){
+define('jx/button/set', ['../../base','../object','../button'],
+ function(base, jxObject, Button){
- var base = require("../../base"),
- jxObject = require("../object"),
- Button = require("../button");
-
- var set = module.exports = new Class({
+ var set = new Class({
Extends: jxObject,
Family: 'Jx.ButtonSet',
Binds: ['buttonChanged'],
@@ -159,5 +156,7 @@ define('jx/button/set', function(require, exports, module){
if (base.global) {
base.global.ButtonSet = set;
}
+
+ return set;
});
View
9 src/Source/jx/colorpalette.js
@@ -56,12 +56,9 @@ images:
* This file is licensed under an MIT style license
*/
-define('jx/colorpalette', function(require, exports, module){
+define('jx/colorpalette', ['../base','./widget'], function(base, Widget){
- var base = require("../base"),
- Widget = require("./widget");
-
- var colorPalette = module.exports = new Class({
+ var colorPalette = new Class({
Extends: Widget,
Family: 'Jx.ColorPalette',
/**
@@ -354,4 +351,6 @@ define('jx/colorpalette', function(require, exports, module){
base.global.ColorPalette = colorPalette;
}
+ return colorPalette;
+
});
View
11 src/Source/jx/compare.js
@@ -41,12 +41,9 @@ provides: [Jx.Compare]
* This file is licensed under an MIT style license
*/
-define("jx/compare", function(require, exports, module){
+define("jx/compare", ['../base','./object'], function(base, jxObject){
- var base = require("../base"),
- jxObject = require("./object");
-
- var compare = module.exports = new Class({
+ var compare = new Class({
Extends: jxObject,
Family: 'Jx.Compare',
@@ -152,7 +149,9 @@ define("jx/compare", function(require, exports, module){
});
if (base.global) {
- base.global.Compare = module.exports;
+ base.global.Compare = compare;
}
+ return compare;
+
});
View
17 src/Source/jx/container.js
@@ -70,14 +70,10 @@ provides: [Jx.Container]
*
* This file is licensed under an MIT style license
*/
-define("jx/container", function(require, exports, module){
+define("jx/container", ['../base','./widget','./layoutmanager/fill','./layout','require'],
+ function(base, Widget, Fill, Layout, require){
- var base = require("../base"),
- Widget = require("./widget"),
- Fill = require("./layoutmanager/fill"),
- Layout = require("./layout");
-
- var container = module.exports = new Class({
+ var container = new Class({
Extends: Widget,
Family: 'Jx.Container',
@@ -199,8 +195,9 @@ define("jx/container", function(require, exports, module){
//otherwise it's just a name and should be in the proper
//namespace. Create the require path.
klass = klass.replace(".","/");
- file = './' + klass.toLowerCase();
+ file = 'jx/' + klass.toLowerCase();
}
+ //NOTE: top-level require needs to have preloaded all objects/plugins/adaptors
obj = require(file);
} else {
obj = item['class'];
@@ -235,7 +232,9 @@ define("jx/container", function(require, exports, module){
});
if (base.global) {
- base.global.Container = module.exports;
+ base.global.Container = container;
}
+ return container;
+
});
View
8 src/Source/jx/data.js
@@ -15,11 +15,11 @@ provides: [Jx.Data]
...
*/
-define("jx/data",function(require, exports, module){
-
- var base = require("../base");
+define("jx/data", ['../base'], function(base){
if (base.global) {
- base.global.Data = module.exports;
+ base.global.Data = {};
}
+
+ return {};
});
View
12 src/Source/jx/data/parser.js
@@ -28,12 +28,10 @@ provides: [Jx.Data.Parser]
* This file is licensed under an MIT style license
*/
-define("jx/data/parser", function(require, exports, module){
+define("jx/data/parser", ['../../base','../object'],
+ function(base, jxObject){
- var base = require("../../base"),
- jxObject = require("../object");
-
- var parser = module.exports = new Class({
+ var parser = new Class({
Extends: jxObject,
Family: 'Jx.Store.Parser',
@@ -59,7 +57,9 @@ define("jx/data/parser", function(require, exports, module){
});
if (base.global) {
- base.global.Data.Parser = module.exports;
+ base.global.Data.Parser = parser;
}
+ return parser;
+
});
View
13 src/Source/jx/data/parser/json.js
@@ -28,13 +28,10 @@ provides: [Jx.Data.Parser.JSON]
*
* This file is licensed under an MIT style license
*/
-define("jx/data/parser/json", function(require, exports, module){
+define("jx/data/parser/json", ['../../../base','../parser','../../record'],
+ function(base, Parser, Record){
- var base = require("../../../base"),
- Parser = require("../parser"),
- Record = require("../../record");
-
- var json = module.exports = new Class({
+ var json = new Class({
Extends: Parser,
Family: "Jx.data.Parser.JSON",
@@ -85,7 +82,9 @@ define("jx/data/parser/json", function(require, exports, module){
});
if (base.global) {
- base.global.Data.Parser.JSON = module.exports;
+ base.global.Data.Parser.JSON = json;
}
+ return json;
+
});
View
12 src/Source/jx/data/protocol.js
@@ -30,12 +30,10 @@ provides: [Jx.Data.Protocol]
*
* This file is licensed under an MIT style license
*/
-define("jx/data/protocol", function(require, exports, module){
+define("jx/data/protocol", ['../../base','../object'],
+ function(base, jxObject){
- var base = require("../../base"),
- jxObject = require("../object");
-
- var protocol = module.exports = new Class({
+ var protocol = new Class({
Extends: jxObject,
Family: 'Jx.Store.Protocol',
@@ -125,7 +123,9 @@ define("jx/data/protocol", function(require, exports, module){
});
if (base.global) {
- base.global.Data.Protocol = module.exports;
+ base.global.Data.Protocol = protocol;
}
+ return protocol;
+
});
View
13 src/Source/jx/data/protocol/ajax.js
@@ -29,13 +29,10 @@ provides: [Jx.Data.Protocol.Ajax]
*
* This file is licensed under an MIT style license
*/
-define("jx/data/protocol/ajax", function(require, exports, module){
+define("jx/data/protocol/ajax", ['../../../base','../protocol','../response'],
+ function(base, Protocol, Response){
- var base = require("../../../base"),
- Protocol = require("../protocol"),
- Response = require("../response");
-
- var ajax = module.exports = new Class({
+ var ajax = new Class({
Extends: Protocol,
Family: "Jx.Data.Protocol.Ajax",
@@ -302,7 +299,9 @@ define("jx/data/protocol/ajax", function(require, exports, module){
})();
if (base.global) {
- base.global.Data.Protocol.Ajax = module.exports;
+ base.global.Data.Protocol.Ajax = ajax;
}
+ return ajax;
+
});
View
13 src/Source/jx/data/protocol/local.js
@@ -33,13 +33,10 @@ provides: [Jx.Data.Protocol.Local]
*
* This file is licensed under an MIT style license
*/
-define("jx/data/protocol/local", function(require, exports, module){
+define("jx/data/protocol/local", ['../../../base','../protocol','../response'],
+ function(base, Protocol, Response){
- var base = require("../../../base"),
- Protocol = require("../protocol"),
- Response = require("../response");
-
- var local = module.exports = new Class({
+ var local = new Class({
Extends: Protocol,
Family: "Jx.Data.Protocol.Local",
@@ -114,7 +111,9 @@ define("jx/data/protocol/local", function(require, exports, module){
});
if (base.global) {
- base.global.Data.Protocol.Local = module.exports;
+ base.global.Data.Protocol.Local = local;
}
+ return local;
+
});
View
12 src/Source/jx/data/response.js
@@ -28,12 +28,10 @@ provides: [Jx.Data.Response]
*
* This file is licensed under an MIT style license
*/
-define("jx/data/response", function(require, exports, module){
+define("jx/data/response", ['../../base','../object'],
+ function(base, jxObject){
- var base = require("../../base"),
- jxObject = require("../object");
-
- var response = module.exports = new Class({
+ var response = new Class({
Extends: jxObject,
Family: 'Jx.Store.Response',
@@ -88,7 +86,9 @@ define("jx/data/response", function(require, exports, module){
response.FAILURE = 0;
if (base.global) {
- base.global.Data.Response = module.exports;
+ base.global.Data.Response = response;
}
+ return response;
+
});
View
16 src/Source/jx/datepicker.js
@@ -46,16 +46,10 @@ provides: [Jx.DatePicker]
*
* This file is licensed under an MIT style license
*/
-define("jx/datepicker",function(require, exports, module){
+define("jx/datepicker", ['../base','./widget','./button','./monthpicker','./button/flyout','./panel'],
+ function(base, Widget, Button,MonthPicker, Flyout, Panel){
- var base = require("../base"),
- Widget = require("./widget"),
- Button = require("./button"),
- MonthPicker = require("./monthpicker"),
- Flyout = require("./button/flyout"),
- Panel = require("./panel");
-
- var datePicker = module.exports = new Class({
+ var datePicker = new Class({
Extends: Widget,
Family: 'Jx.DatePicker',
pluginNamespace: 'DatePicker',
@@ -250,7 +244,9 @@ define("jx/datepicker",function(require, exports, module){
});
if (base.global) {
- base.global.DatePicker = module.exports;
+ base.global.DatePicker = datePicker;
}
+ return datePicker;
+
});
View
12 src/Source/jx/dialog.js
@@ -70,13 +70,9 @@ images:
*
* This file is licensed under an MIT style license
*/
-define("jx/dialog", function(require, exports, module){
+define("jx/dialog", ['../base','./panel','./stack'], function(base, Panel, Stack){
- var base = require("../base"),
- Panel = require("./panel"),
- Stack = require("./stack");
-
- var dialog = module.exports = new Class({
+ var dialog = new Class({
Extends: Panel,
Family: 'Jx.Dialog',
@@ -753,8 +749,10 @@ define("jx/dialog", function(require, exports, module){
});
if (base.global) {
- base.global.Dialog = module.exports;
+ base.global.Dialog = dialog;
}
+ return dialog;
+
});
View
14 src/Source/jx/dialog/confirm.js
@@ -37,14 +37,10 @@ css:
*
* This file is licensed under an MIT style license
*/
-define("jx/dialog/confirm", function(require, exports, module){
+define("jx/dialog/confirm", ['../../base','../dialog','../toolbar','../button'],
+ function(base, Dialog, Toolbar, Button){
- var base = require("../../base"),
- Dialog = require("../dialog"),
- Toolbar = require("../toolbar"),
- Button = require("../button");
-
- var confirm = module.exports = new Class({
+ var confirm = new Class({
Extends: Dialog,
Family: "Jx.Dialog.Confirm",
@@ -157,6 +153,8 @@ define("jx/dialog/confirm", function(require, exports, module){
});
if (base.global) {
- base.global.Dialog.Confirm = module.exports;
+ base.global.Dialog.Confirm = confirm;
}
+
+ return confirm;
});
View
14 src/Source/jx/dialog/message.js
@@ -36,14 +36,10 @@ css:
*
* This file is licensed under an MIT style license
*/
-define("jx/dialog/message", function(require, exports, module){
+define("jx/dialog/message", ['../../base','../dialog','../toolbar','../button'],
+ function(base, Dialog, Toolbar, Button){
- var base = require("../../base"),
- Dialog = require("../dialog"),
- Toolbar = require("../toolbar"),
- Button = require("../button");
-
- var message = module.exports = new Class({
+ var message = new Class({
Extends: Dialog,
Family: 'Jx.Dialog.Message',
Binds: ['onOk'],
@@ -168,7 +164,9 @@ define("jx/dialog/message", function(require, exports, module){
});
if (base.global) {
- base.global.Dialog.Message = module.exports;
+ base.global.Dialog.Message = message;
}
+ return message;
+
});
View
21 src/Source/jx/dialog/prompt.js
@@ -35,16 +35,11 @@ provides: [Jx.Dialog.Prompt]
*
* This file is licensed under an MIT style license
*/
-define("jx/dialog/prompt", function(require, exports, module){
-
- var base = require("../../base"),
- Dialog = require("../dialog"),
- Toolbar = require("../toolbar"),
- Button = require("../button"),
- TextField = require("../field/text"),
- FieldValidator = require("../plugin/field/validator");
+define("jx/dialog/prompt", ['../../base','../dialog','../toolbar','../button',
+ '../field/text','../plugin/field/validator', '../widget','require'],
+ function(base, Dialog, Toolbar, Button, TextField, FieldValidator, Widget, require){
- var prompt = module.exports = new Class({
+ var prompt = new Class({
Extends: Dialog,
Family: "Jx.Dialog.Prompt",
@@ -114,11 +109,11 @@ define("jx/dialog/prompt", function(require, exports, module){
var t = typeOf(fOpts.type);
if(t === 'string') {
- var f = require("jx/field/"+fOpts.type);
+ var f = require("jx/field/"+fOpts.type.toLowerCase());
if (f) {
this.field = new f(fOpts.options);
}
- }else if(t === 'Jx.Object'){
+ }else if(instanceOf(fOpts.type, Widget)){
this.field = fOpts.type;
}else{
// warning and fallback?
@@ -178,7 +173,9 @@ define("jx/dialog/prompt", function(require, exports, module){
});
if (base.global) {
- base.global.Dialog.Prompt = module.exports;
+ base.global.Dialog.Prompt = prompt;
}
+ return prompt;
+
});
View
23 src/Source/jx/editor.js
@@ -51,16 +51,10 @@ css:
*
* Inspired by (and a great deal of code from) mooEditable
*/
-define("jx/editor", function(require, exports, module){
+define("jx/editor", ['../base','./widget','./toolbar','./layout','./editor/selection','./toolbar/container','require'],
+ function(base, Widget, Toolbar,Layout, EditorSelection, ToolbarContainer,require){
- var base = require("../base"),
- Widget = require("./widget"),
- Toolbar = require("./toolbar"),
- Layout = require("./layout"),
- EditorSelection = null,
- ToolbarContainer = require("./toolbar/container");
-
- var editor = module.exports = new Class({
+ var editor = new Class({
Extends: Widget,
Family: 'Jx.Editor',
@@ -118,8 +112,11 @@ define("jx/editor", function(require, exports, module){
blockEls: /^(H[1-6]|HR|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|CAPTION|BLOCKQUOTE|CENTER|DL|DT|DD)$/i,
init: function () {
- EditorSelection = require("./editor/selection");
-
+ //in global mode, Jx.Editor.Selection wasn't defined when we were.
+ //grab it now...
+ if (EditorSelection === undefined || EditorSelection === null) {
+ EditorSelection = require('jx/editor/selection');
+ }
if (this.options.parent !== null && this.options.parent !== undefined) {
this.options.deferRender = false;
} else {
@@ -740,7 +737,9 @@ define("jx/editor", function(require, exports, module){
});
if (base.global) {
- base.global.Editor = module.exports;
+ base.global.Editor = editor;
}
+ return editor;
+
});
View
12 src/Source/jx/editor/selection.js
@@ -23,12 +23,10 @@ provides: [Jx.Editor.Selection]
* Copyright (c) 2011 by Jonathan Bomgardner
* Licensed under an mit-style license
*/
-define("jx/editor/selection", function(require, exports, module){
+define("jx/editor/selection", ['../../base','../object'],
+ function(base, jxObject){
- var base = require("../../base"),
- jxObject = require("../object");
-
- var selection = module.exports = new Class({
+ var selection = new Class({
Extends: jxObject,
Family: 'Jx.Editor.Selection',
@@ -175,7 +173,9 @@ define("jx/editor/selection", function(require, exports, module){
});
if (base.global) {
- base.global.Editor.Selection = module.exports;
+ base.global.Editor.Selection = selection;
}
+ return selection;
+
});
View
29 src/Source/jx/field.js
@@ -36,14 +36,10 @@ provides: [Jx.Field]
*
* This file is licensed under an MIT style license
*/
-define("jx/field", function(require, exports, module){
+define("jx/field", ['../base','./widget','./form','./fieldset'],
+ function(base, Widget, Form, Fieldset){
- var base = require("../base"),
- Widget = require("./widget"),
- Form = require("./form"),
- Fieldset = null;
-
- var field = module.exports = new Class({
+ var field = new Class({
Extends : Widget,
Family: 'Jx.Field',
@@ -197,7 +193,13 @@ define("jx/field", function(require, exports, module){
},
init: function(){
- Fieldset = require("./fieldset");
+ if (Fieldset === undefined) {
+ Fieldset = require("jx/fieldset");
+ }
+ if (Form === undefined) {
+ Form = require("jx/form");
+ }
+
this.parent();
},
/**
@@ -236,7 +238,9 @@ define("jx/field", function(require, exports, module){
}
if (this.options.value !== undefined && this.options.value !== null) {
- this.field.set('value', this.options.value);
+ //convert value to string because a value of 0 will be displayed as
+ //an empty string.
+ this.field.set('value', this.options.value+'');
}
this.field.set('id', this.id);
@@ -321,7 +325,8 @@ define("jx/field", function(require, exports, module){
*/
setValue : function (v) {
if (!this.options.readonly) {
- this.field.set('value', v);
+ //convert to string when setting.
+ this.field.set('value', v+'');
}
},
@@ -428,7 +433,9 @@ define("jx/field", function(require, exports, module){
});
if (base.global) {
- base.global.Field = module.exports;
+ base.global.Field = field;
}
+ return field;
+
});
View
13 src/Source/jx/field/button.js
@@ -31,13 +31,10 @@ provides: [Jx.Field.Button]
*
* This file is licensed under an MIT style license
*/
-define("jx/field/button", function(require, exports, module){
+define("jx/field/button", ['../../base','../field','../button'],
+ function(base, Field, Button){
- var base = require("../../base"),
- Field = require("../field"),
- Button = require("../button");
-
- var button = module.exports = new Class({
+ var button = new Class({
Extends: Field,
Family: "Jx.Field.Button",
@@ -104,7 +101,9 @@ define("jx/field/button", function(require, exports, module){
});
if (base.global) {
- base.global.Field.Button = module.exports;
+ base.global.Field.Button = button;
}
+ return button;
+
});
View
12 src/Source/jx/field/checkbox.js
@@ -32,12 +32,10 @@ provides: [Jx.Field.Checkbox]
* This file is licensed under an MIT style license
*
*/
-define("jx/field/checkbox", function(require, exports, module){
+define("jx/field/checkbox", ['../../base','../field'],
+ function(base, Field){
- var base = require("../../base"),
- Field = require("../field");
-
- var checkbox = module.exports = new Class({
+ var checkbox = new Class({
Extends : Field,
Family: "Jx.Field.Checkbox",
@@ -152,7 +150,9 @@ define("jx/field/checkbox", function(require, exports, module){
});
if (base.global) {
- base.global.Field.Checkbox = module.exports;
+ base.global.Field.Checkbox = checkbox;
}
+ return checkbox;
+
});
View
15 src/Source/jx/field/color.js
@@ -31,15 +31,10 @@ provides: [Jx.Field.Color]
*
* This file is licensed under an MIT style license
*/
-define("jx/field/color", function(require, exports, module){
+define("jx/field/color", ['../../base','../field','../colorpalette','../button/flyout','../plugin/field/validator'],
+ function(base, Field, ColorPalette, Flyout, Validator){
- var base = require("../../base"),
- Field = require("../field"),
- ColorPalette = require("../colorpalette"),
- Flyout = require("../button/flyout"),
- Validator = require("../plugin/field/validator");
-
- var color = module.exports = new Class({
+ var color = new Class({
Extends: Field,
Family: "Jx.Field.Color",
Binds: ['changed','hide','keyup','changeText'],
@@ -199,7 +194,9 @@ define("jx/field/color", function(require, exports, module){
});
if (base.global) {
- base.global.Field.Color = module.exports;
+ base.global.Field.Color = color;
}
+ return color;
+
});
View
15 src/Source/jx/field/combo.js
@@ -37,15 +37,10 @@ provides: [Jx.Field.Combo]
*
* This file is licensed under an MIT style license
*/
-define("jx/field/combo", function(require, exports, module){
-
- var base = require("../../base"),
- Field = require("../field")
- Button = require("../button"),
- ButtonSet = require("../button/set"),
- Menu = require("../menu");
+define("jx/field/combo", ['../../base','../field','../button','../button/set','../menu'],
+ function(base, Field, Button, ButtonSet, Menu){
- var combo = module.exports = new Class({
+ var combo = new Class({
Extends: Field,
Family: 'Jx.Field.Combo',
pluginNamespace: 'Combo',
@@ -273,7 +268,9 @@ define("jx/field/combo", function(require, exports, module){
});
if (base.global) {
- base.global.Field.Combo = module.exports;
+ base.global.Field.Combo = combo;
}
+ return combo;
+
});
View
19 src/Source/jx/field/combobox.js
@@ -46,16 +46,11 @@ provides: [Jx.Field.ComboBox]
*
* This file is licensed under an MIT style license
*/
-define("jx/field/combobox", function(require, exports, module){
-
- var base = require("../../base"),
- Field = require("../field"),
- ListView = require("../listview"),
- Fill = require("../adaptor/listview/fill"),
- Flyout = require("../button/flyout"),
- Pager = require("../toolbar/pager");
-
- var comboBox = module.exports = new Class({
+define("jx/field/combobox", ['../../base','../field','../listview','../adaptor/listview/fill',
+ '../button/flyout','../toolbar/pager'],
+ function(base, Field, ListView, Fill, Flyout, Pager){
+
+ var comboBox = new Class({
Extends: Field,
Family: 'Jx.Field.Combo',
@@ -158,7 +153,9 @@ define("jx/field/combobox", function(require, exports, module){
});
if (base.global) {
- base.global.Field.ComboBox = module.exports;
+ base.global.Field.ComboBox = comboBox;
}
+ return comboBox;
+
});
View
15 src/Source/jx/field/date.js
@@ -45,15 +45,10 @@ provides: [Jx.Field.Date]
*
* This file is licensed under an MIT style license
*/
-define("jx/field/date", function(require, exports, module){
+define("jx/field/date", ['../../base','../field','../formatter/date','../button/flyout','../datepicker'],
+ function(base, Field, DateFormatter, Flyout, DatePicker){
- var base = require("../../base"),
- Field = require("../field"),
- DateFormatter = require("../formatter/date"),
- Flyout = require("../button/flyout"),
- DatePicker = require("../datepicker");
-
- var date = module.exports = new Class({
+ var date = new Class({
Extends: Field,
Family: 'Jx.Field.Date',
@@ -142,7 +137,9 @@ define("jx/field/date", function(require, exports, module){
});
if (base.global) {
- base.global.Field.Date = module.exports;
+ base.global.Field.Date = date;
}
+ return date;
+
});
View
12 src/Source/jx/field/display.js
@@ -17,12 +17,10 @@ provides: [Jx.Field.Display]
/**
* Class: Jx.Field.Display
**/
-define("jx/field/display", function(require, exports, module){
+define("jx/field/display", ['../../base','../field'],
+ function(base, Field){
- var base = require("../../base"),
- Field = require("../field");
-
- var display = module.exports = new Class({
+ var display = new Class({
Extends: Field,
options: {
template: '<span class="jxInputContainer"><label class="jxInputLabel" ></label><span class="jxInputTag"></span></span>'
@@ -50,7 +48,9 @@ define("jx/field/display", function(require, exports, module){
});
if (base.global) {
- base.global.Field.Display = module.exports;
+ base.global.Field.Display = display;
}
+ return display;
+
});
View
13 src/Source/jx/field/editor.js
@@ -20,13 +20,10 @@ css:
...
*/
-define("jx/field/editor", function(require, exports, module){
+define("jx/field/editor", ['../../base','../field','../editor'],
+ function(base, Field, Editor){
- var base = require("../../base"),
- Field = require("../field"),
- Editor = require("../editor");
-
- var editor = module.exports = new Class({
+ var editor = new Class({
Extends: Field,
Family: 'Jx.Field.Editor',
@@ -106,7 +103,9 @@ define("jx/field/editor", function(require, exports, module){
});
if (base.global) {
- base.global.Field.Editor = module.exports;
+ base.global.Field.Editor = editor;
}
+ return editor;
+
});
View
16 src/Source/jx/field/file.js
@@ -47,16 +47,10 @@ css:
*
* This file is licensed under an MIT style license
*/
-define("jx/field/file", function(require, exports, module){
-
- var base = require("../../base"),
- Field = require("../field"),
- Text = require("./text"),
- Button = require("../button"),
- Form = require("../form"),
- Hidden = require("./hidden");
+define("jx/field/file", ['../../base','../field