extjs-mvc 0.3.10 → 0.4.0.a

Sign up to get free protection for your applications and to get access to all the features.
Files changed (204) hide show
  1. data/LICENSE +1 -1
  2. data/README.rdoc +5 -173
  3. data/Rakefile +18 -20
  4. data/VERSION +1 -1
  5. data/bin/xmvc +13 -0
  6. data/lib/extjs-mvc/README +20 -0
  7. data/lib/extjs-mvc/builder.rb +83 -0
  8. data/lib/extjs-mvc/builders/all_builder.rb +15 -0
  9. data/lib/extjs-mvc/builders/app_builder.rb +36 -0
  10. data/lib/extjs-mvc/builders/base.rb +138 -0
  11. data/lib/extjs-mvc/builders/css_builder.rb +36 -0
  12. data/lib/extjs-mvc/builders/docs_builder.rb +20 -0
  13. data/lib/extjs-mvc/builders/mvc_builder.rb +33 -0
  14. data/lib/extjs-mvc/builders/plugin_builder.rb +53 -0
  15. data/lib/extjs-mvc/cli.rb +52 -0
  16. data/lib/extjs-mvc/generator.rb +79 -0
  17. data/lib/extjs-mvc/generators/app.rb +57 -0
  18. data/lib/extjs-mvc/generators/base.rb +53 -0
  19. data/lib/extjs-mvc/generators/controller.rb +41 -0
  20. data/lib/extjs-mvc/generators/model.rb +41 -0
  21. data/lib/extjs-mvc/generators/scaffold.rb +17 -0
  22. data/lib/extjs-mvc/generators/templates/Controller.js +17 -0
  23. data/lib/extjs-mvc/generators/templates/Model.js +9 -0
  24. data/lib/extjs-mvc/generators/templates/ModelSpec.js +12 -0
  25. data/lib/extjs-mvc/generators/templates/View.js +16 -0
  26. data/lib/extjs-mvc/generators/templates/_Action.js +7 -0
  27. data/lib/extjs-mvc/generators/templates/app/README.rdoc +152 -0
  28. data/lib/extjs-mvc/generators/templates/app/app/App.js +64 -0
  29. data/lib/extjs-mvc/generators/templates/app/app/controllers/ApplicationController.js +10 -0
  30. data/lib/extjs-mvc/generators/templates/app/app/controllers/HomeController.js +10 -0
  31. data/lib/extjs-mvc/generators/templates/app/app/views/home/Index.js +17 -0
  32. data/lib/extjs-mvc/generators/templates/app/app/views/layout/Menu.js +23 -0
  33. data/lib/extjs-mvc/generators/templates/app/config/application.js +1 -0
  34. data/lib/extjs-mvc/generators/templates/app/config/boot.js +67 -0
  35. data/lib/extjs-mvc/generators/templates/app/config/build.xml +77 -0
  36. data/lib/extjs-mvc/generators/templates/app/config/database.js +4 -0
  37. data/lib/extjs-mvc/generators/templates/app/config/environment.json +58 -0
  38. data/lib/extjs-mvc/generators/templates/app/config/environments/development.json +1 -0
  39. data/lib/extjs-mvc/generators/templates/app/config/environments/production.json +4 -0
  40. data/lib/extjs-mvc/generators/templates/app/config/routes.js +27 -0
  41. data/lib/extjs-mvc/generators/templates/app/config/settings.yml +3 -0
  42. data/lib/extjs-mvc/generators/templates/app/public/index.html +19 -0
  43. data/lib/extjs-mvc/generators/templates/app/public/stylesheets/ext-mvc-all.css +49 -0
  44. data/{test/active_record_test.rb → lib/extjs-mvc/generators/templates/app/spec/SpecHelper.js} +0 -0
  45. data/lib/extjs-mvc/generators/templates/app/spec/index.html +66 -0
  46. data/lib/extjs-mvc/generators/templates/app/vendor/screw-unit/EXAMPLE.html +68 -0
  47. data/lib/extjs-mvc/generators/templates/app/vendor/screw-unit/LICENSE +22 -0
  48. data/lib/extjs-mvc/generators/templates/app/vendor/screw-unit/README.markdown +307 -0
  49. data/lib/extjs-mvc/generators/templates/app/vendor/screw-unit/lib/jquery-1.2.3.js +3408 -0
  50. data/lib/extjs-mvc/generators/templates/app/vendor/screw-unit/lib/jquery.fn.js +29 -0
  51. data/lib/extjs-mvc/generators/templates/app/vendor/screw-unit/lib/jquery.print.js +108 -0
  52. data/lib/extjs-mvc/generators/templates/app/vendor/screw-unit/lib/screw.assets.js +36 -0
  53. data/lib/extjs-mvc/generators/templates/app/vendor/screw-unit/lib/screw.behaviors.js +91 -0
  54. data/lib/extjs-mvc/generators/templates/app/vendor/screw-unit/lib/screw.builder.js +80 -0
  55. data/lib/extjs-mvc/generators/templates/app/vendor/screw-unit/lib/screw.css +90 -0
  56. data/lib/extjs-mvc/generators/templates/app/vendor/screw-unit/lib/screw.events.js +42 -0
  57. data/lib/extjs-mvc/generators/templates/app/vendor/screw-unit/lib/screw.matchers.js +145 -0
  58. data/lib/extjs-mvc/generators/templates/app/vendor/screw-unit/lib/screw.server.js +21 -0
  59. data/lib/extjs-mvc/generators/templates/app/vendor/screw-unit/spec/behaviors_spec.js +178 -0
  60. data/lib/extjs-mvc/generators/templates/app/vendor/screw-unit/spec/matchers_spec.js +237 -0
  61. data/lib/extjs-mvc/generators/templates/app/vendor/screw-unit/spec/print_spec.js +119 -0
  62. data/{test/controller_test.rb → lib/extjs-mvc/generators/templates/app/vendor/screw-unit/spec/spec_helper.js} +0 -0
  63. data/lib/extjs-mvc/generators/templates/app/vendor/screw-unit/spec/suite.html +18 -0
  64. data/lib/extjs-mvc/generators/templates/scaffold/ScaffoldController.js +18 -0
  65. data/lib/extjs-mvc/generators/view.rb +29 -0
  66. data/lib/extjs-mvc/plugin.rb +105 -0
  67. data/lib/extjs-mvc/scripts.rb +15 -0
  68. data/lib/extjs-mvc/settings.rb +75 -0
  69. data/lib/extjs-mvc/setup.rb +5 -0
  70. data/lib/extjs-mvc/stats.rb +241 -0
  71. data/lib/extjs-mvc/test.rb +11 -0
  72. data/lib/extjs-mvc/testserver.ru +95 -0
  73. data/lib/extjs-mvc/ui.rb +58 -0
  74. data/lib/extjs-mvc/update.rb +73 -0
  75. data/lib/extjs-mvc.rb +70 -32
  76. data/lib/js/App.js +219 -0
  77. data/lib/js/MVC.js +260 -0
  78. data/lib/js/Presenter.js +52 -0
  79. data/lib/js/README.rdoc +69 -0
  80. data/lib/js/build +21 -0
  81. data/lib/js/controller/Controller.js +278 -0
  82. data/lib/js/controller/CrudController.js +460 -0
  83. data/lib/js/lib/Array.js +26 -0
  84. data/lib/js/lib/Booter.js +415 -0
  85. data/lib/js/lib/ClassManager.js +191 -0
  86. data/lib/js/lib/ControllerClassManager.js +95 -0
  87. data/lib/js/lib/Dependencies.js +44 -0
  88. data/lib/js/lib/DispatchMatcher.js +98 -0
  89. data/lib/js/lib/Dispatcher.js +129 -0
  90. data/lib/js/lib/Environment.js +43 -0
  91. data/lib/js/lib/Inflector.js +138 -0
  92. data/lib/js/lib/ModelClassManager.js +19 -0
  93. data/lib/js/lib/Route.js +139 -0
  94. data/lib/js/lib/Router.js +282 -0
  95. data/lib/js/lib/String.js +94 -0
  96. data/lib/js/lib/ViewClassManager.js +229 -0
  97. data/lib/js/lib/notes.txt +32 -0
  98. data/lib/js/model/AdapterManager.js +30 -0
  99. data/lib/js/model/Association.js +26 -0
  100. data/lib/js/model/Base.js +63 -0
  101. data/lib/js/model/BelongsToAssociation.js +116 -0
  102. data/lib/js/model/Cache.js +131 -0
  103. data/lib/js/model/HasManyAssociation.js +160 -0
  104. data/lib/js/model/Model.js +331 -0
  105. data/lib/js/model/UrlBuilder.js +106 -0
  106. data/lib/js/model/adapters/AbstractAdapter.js +296 -0
  107. data/lib/js/model/adapters/MemoryAdapter.js +103 -0
  108. data/lib/js/model/adapters/RESTAdapter.js +345 -0
  109. data/lib/js/model/adapters/RESTJSONAdapter.js +68 -0
  110. data/lib/js/model/adapters/notes.txt +42 -0
  111. data/lib/js/model/associations/Association.js +192 -0
  112. data/lib/js/model/associations/notes.txt +87 -0
  113. data/lib/js/model/validations/Errors.js +136 -0
  114. data/lib/js/model/validations/Plugin.js +139 -0
  115. data/lib/js/model/validations/Validations.js +276 -0
  116. data/lib/js/notes/Charts.graffle +0 -0
  117. data/lib/js/overrides/Ext.Component.js +21 -0
  118. data/lib/js/overrides/Ext.extend.js +142 -0
  119. data/lib/js/spec/Array.spec.js +15 -0
  120. data/lib/js/spec/ExtMVC.spec.js +65 -0
  121. data/lib/js/spec/Model.spec.js +370 -0
  122. data/lib/js/spec/OS.spec.js +83 -0
  123. data/lib/js/spec/Router.spec.js +99 -0
  124. data/lib/js/spec/SpecHelper.js +106 -0
  125. data/lib/js/spec/String.spec.js +83 -0
  126. data/lib/js/spec/model/AbstractAdapter.spec.js +49 -0
  127. data/lib/js/spec/model/Associations.spec.js +99 -0
  128. data/lib/js/spec/model/Cache.spec.js +5 -0
  129. data/lib/js/spec/model/RESTAdapter.spec.js +19 -0
  130. data/lib/js/spec/model/ValidationErrors.spec.js +64 -0
  131. data/lib/js/spec/model/Validations.spec.js +166 -0
  132. data/lib/js/spec/model/ValidationsPlugin.spec.js +108 -0
  133. data/lib/js/spec/suite.html +60 -0
  134. data/lib/js/specs-old/JSSpec.css +216 -0
  135. data/lib/js/specs-old/JSSpec.js +1512 -0
  136. data/lib/js/specs-old/all.html +66 -0
  137. data/lib/js/specs-old/base.js +14 -0
  138. data/lib/js/specs-old/controller.js +17 -0
  139. data/lib/js/specs-old/diff_match_patch.js +1 -0
  140. data/lib/js/specs-old/model.js +70 -0
  141. data/lib/js/specs-old/route.js +38 -0
  142. data/lib/js/specs-old/router.js +59 -0
  143. data/lib/js/specs-old/string.js +22 -0
  144. data/lib/js/testrunner/JSpecFormatter.js +111 -0
  145. data/lib/js/testrunner/TestClient.js +181 -0
  146. data/lib/js/testrunner/TestGrid.js +351 -0
  147. data/lib/js/testrunner/TestRunner.js +110 -0
  148. data/lib/js/testrunner/TestViewport.js +94 -0
  149. data/lib/js/vendor/screw-unit/EXAMPLE.html +68 -0
  150. data/lib/js/vendor/screw-unit/LICENSE +22 -0
  151. data/lib/js/vendor/screw-unit/README.markdown +307 -0
  152. data/lib/js/vendor/screw-unit/lib/jquery-1.2.3.js +3408 -0
  153. data/lib/js/vendor/screw-unit/lib/jquery.fn.js +29 -0
  154. data/lib/js/vendor/screw-unit/lib/jquery.print.js +108 -0
  155. data/lib/js/vendor/screw-unit/lib/screw.assets.js +36 -0
  156. data/lib/js/vendor/screw-unit/lib/screw.behaviors.js +91 -0
  157. data/lib/js/vendor/screw-unit/lib/screw.builder.js +80 -0
  158. data/lib/js/vendor/screw-unit/lib/screw.css +91 -0
  159. data/lib/js/vendor/screw-unit/lib/screw.events.js +42 -0
  160. data/lib/js/vendor/screw-unit/lib/screw.matchers.js +145 -0
  161. data/lib/js/vendor/screw-unit/lib/screw.server.js +21 -0
  162. data/lib/js/vendor/screw-unit/spec/behaviors_spec.js +178 -0
  163. data/lib/js/vendor/screw-unit/spec/matchers_spec.js +237 -0
  164. data/lib/js/vendor/screw-unit/spec/print_spec.js +119 -0
  165. data/{test/data_mapper_test.rb → lib/js/vendor/screw-unit/spec/spec_helper.js} +0 -0
  166. data/lib/js/vendor/screw-unit/spec/suite.html +18 -0
  167. data/lib/js/view/FormWindow.js +184 -0
  168. data/lib/js/view/HasManyEditorGridPanel.js +211 -0
  169. data/lib/js/view/scaffold/Edit.js +46 -0
  170. data/lib/js/view/scaffold/Index.js +561 -0
  171. data/lib/js/view/scaffold/New.js +20 -0
  172. data/lib/js/view/scaffold/ScaffoldFormPanel.js +255 -0
  173. data/test/helper.rb +10 -0
  174. data/test/test_extjs-mvc-gem.rb +7 -0
  175. metadata +232 -56
  176. data/README +0 -12
  177. data/lib/controller/controller.rb +0 -28
  178. data/lib/core_ext/array/extract_options.rb +0 -15
  179. data/lib/extjs/component.rb +0 -71
  180. data/lib/extjs/data/store.rb +0 -131
  181. data/lib/helpers/component.rb +0 -37
  182. data/lib/helpers/store.rb +0 -7
  183. data/lib/model/active_record.rb +0 -89
  184. data/lib/model/base.rb +0 -370
  185. data/lib/model/data_mapper.rb +0 -66
  186. data/lib/model/mongo_mapper.rb +0 -64
  187. data/lib/test/macros.rb +0 -20
  188. data/test/app/config/application.rb +0 -70
  189. data/test/app/config/database.yml +0 -3
  190. data/test/app/db/schema.rb +0 -75
  191. data/test/app/models/active_record/address.rb +0 -4
  192. data/test/app/models/active_record/data_type.rb +0 -3
  193. data/test/app/models/active_record/group.rb +0 -4
  194. data/test/app/models/active_record/house.rb +0 -4
  195. data/test/app/models/active_record/location.rb +0 -5
  196. data/test/app/models/active_record/person.rb +0 -4
  197. data/test/app/models/active_record/user.rb +0 -6
  198. data/test/app/models/active_record/user_group.rb +0 -4
  199. data/test/component_test.rb +0 -15
  200. data/test/debug.log +0 -2969
  201. data/test/model_test.rb +0 -526
  202. data/test/mongo_mapper_test.rb +0 -0
  203. data/test/store_test.rb +0 -0
  204. data/test/test_helper.rb +0 -32
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @class MyApp.controllers.ApplicationController
3
+ * @extends ExtMVC.controller.CrudController
4
+ * Shared application-wide controller. Place any application-specific code here that needs
5
+ * to be shared amongst other application controllers, and make the other controllers in the
6
+ * application extend this one
7
+ */
8
+ ExtMVC.registerController("application", {
9
+ extend: "controller"
10
+ });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @class MyApp.controllers.IndexController
3
+ * @extends MyApp.controllers.ApplicationController
4
+ * Default root controller
5
+ */
6
+ ExtMVC.registerController("home", {
7
+ index: function() {
8
+ this.render('index');
9
+ }
10
+ });
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @class MyApp.views.home.Index
3
+ * @extends Ext.Panel
4
+ * Default Welcome to Ext MVC Panel - replace this with your own thing
5
+ */
6
+ ExtMVC.registerView('home', 'index', {
7
+ xtype: 'panel',
8
+
9
+ initComponent: function() {
10
+ Ext.applyIf(this, {
11
+ title: "Welcome to Ext MVC",
12
+ html: "This is the default template, which is found in app/views/home/Index.js. This is being displayed because your config/routes.js file has a map.root setting telling it to use the Index view of the HomeController"
13
+ });
14
+
15
+ Ext.Panel.prototype.initComponent.apply(this, arguments);
16
+ }
17
+ });
@@ -0,0 +1,23 @@
1
+ ExtMVC.registerView('layout', 'menu', {
2
+ xtype : 'treepanel',
3
+ title : 'Menu',
4
+ collapsible: true,
5
+
6
+ constructor: function(config) {
7
+ config = config || {};
8
+
9
+ Ext.applyIf(config, {
10
+ root: {
11
+ text : 'Menu',
12
+ id : 'menu',
13
+ nodeType: 'async',
14
+ expanded: true,
15
+ children: [
16
+
17
+ ]
18
+ }
19
+ });
20
+
21
+ Ext.tree.TreePanel.prototype.constructor.call(this, config);
22
+ }
23
+ });
@@ -0,0 +1 @@
1
+ ExtMVC.model.modelNamespace = MyApp.models;
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Boots up the Ext MVC application in the current environment. The environment defaults to 'production',
3
+ * override by setting ?environment=someEnvironment to the end of the url. Default installed environments
4
+ * are 'development' and 'test'
5
+ */
6
+ (function() {
7
+ /**
8
+ * @private
9
+ * Inspects document.location and returns an object containing all of the url params
10
+ * @return {Object} The url params
11
+ */
12
+ var parseLocationParams = function() {
13
+ var args = window.location.search.split("?")[1],
14
+ //set default params
15
+ params = {
16
+ environment: 'production'
17
+ };
18
+
19
+ /**
20
+ * Read config data from url parameters
21
+ */
22
+ if (args != undefined) {
23
+ var argPairs = args.split("&");
24
+
25
+ for (var i=0; i < argPairs.length; i++) {
26
+ var splits = argPairs[i].split("="),
27
+ key = splits[0],
28
+ value = splits[1];
29
+
30
+ params[key] = value;
31
+ };
32
+ }
33
+
34
+ return params;
35
+ };
36
+
37
+ var params = parseLocationParams(),
38
+ environment = params.environment;
39
+
40
+ var fileOrders = {
41
+ production : [
42
+ 'http://extjs.cachefly.net/ext-3.1.1/adapter/ext/ext-base.js',
43
+ 'http://extjs.cachefly.net/ext-3.1.1/ext-all.js',
44
+ '/public/mvc/mvc-all.js',
45
+ '/public/app/app-all.js'
46
+ ],
47
+ development: [
48
+ 'http://extjs.cachefly.net/ext-3.1.1/adapter/ext/ext-base.js',
49
+ 'http://extjs.cachefly.net/ext-3.1.1/ext-all-debug.js',
50
+ '/public/mvc/mvc-all-debug.js',
51
+ '/public/app/app-all-debug.js'
52
+ ],
53
+ test : [
54
+ 'http://extjs.cachefly.net/ext-3.1.1/adapter/ext/ext-base.js',
55
+ 'http://extjs.cachefly.net/ext-3.1.1/ext-all-debug.js',
56
+ '/public/mvc/mvc-all.js',
57
+ '/public/app/app-all.js',
58
+ '../vendor/jspec/lib/jspec.js',
59
+ '../spec/TestHelper.js'
60
+ ]
61
+ };
62
+
63
+ var filesToLoad = fileOrders[environment];
64
+ for (var i=0; i < filesToLoad.length; i++) {
65
+ document.write('<script type="text/javascript" src="' + filesToLoad[i] + '"></script>');
66
+ };
67
+ })();
@@ -0,0 +1,77 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <doc>
3
+
4
+ <!--
5
+
6
+ Source section (required)
7
+
8
+ Use <source> to specify directory with JavaScript source files to be
9
+ processed or just one JS file. Directories are processed recursively.
10
+
11
+ Attributes:
12
+
13
+ src: (required) - source directory name or file name
14
+ match: (optional) - wildcard for the files. Default: "*.js"
15
+ skipHidden: (optional) - True to skip processing files and
16
+ directories with hidden attribute.
17
+ Default: true.
18
+
19
+
20
+
21
+ Custom tags section(optional)
22
+
23
+ Tags to be added to the list of custom tags, for every
24
+ "documantable item" i.e. class, cfg, property, event.
25
+ Custom tag list is accessible in XSLT-template and has two
26
+ properties: title and value.
27
+
28
+ name: (required) tag name. ex: "author" => "@author"
29
+ title: (optional) title of custom tag
30
+ format: (optional) pattern string used for formatting value
31
+
32
+ Usage example:
33
+
34
+ XML: <tag name="author" title="Author"/>
35
+ JS: /**
36
+ * @class MyClass
37
+ * @author I'm the
38
+ * author
39
+ */
40
+
41
+ XSLT:
42
+ <xsl:if test="customTags">
43
+ <b><xsl:value-of select="customTags/title"/></b> :
44
+ <xsl:value-of select="customTags/value"/>
45
+ </xsl:if>
46
+
47
+ Resulting HTML:
48
+ <b>Author</b>:I'm the author
49
+
50
+ -->
51
+
52
+ <sources>
53
+ <source src="../app" match="*.js"/>
54
+ <source src="../lib" match="*.js"/>
55
+ <source src="../config" match="*.js"/>
56
+
57
+ <source src="../vendor/mvc" match="MVC.js"/>
58
+ <source src="../vendor/mvc" match="App.js"/>
59
+ <source src="../vendor/mvc/lib" match="*.js"/>
60
+ <source src="../vendor/mvc/controller" match="*.js"/>
61
+ <source src="../vendor/mvc/model" match="Model.js"/>
62
+ <source src="../vendor/mvc/model" match="Base.js"/>
63
+ <source src="../vendor/mvc/model/adapters" match="*.js"/>
64
+ <source src="../vendor/mvc/model/associations" match="*.js"/>
65
+ <source src="../vendor/mvc/model/validations" match="*.js"/>
66
+ <source src="../vendor/mvc/view/scaffold" match="*.js"/>
67
+ <source src="../vendor/plugins" match="*.js"/>
68
+
69
+ <!--<source src="ext" match="Ext*.js"/>-->
70
+ </sources>
71
+ <tags>
72
+ <tag name="author" title="Author"/>
73
+ <tag name="version" title="Version"/>
74
+ <tag name="note" format="&lt;i&gt;NOTE: {0}&lt;/i&gt;"/>
75
+ <tag name="demo" title="Demo" format="&lt;a href=&quot;{0}&quot;&gt;{0}&lt;/a&gt;" />
76
+ </tags>
77
+ </doc>
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Defines which database adapter to use in development, production and test
3
+ */
4
+
@@ -0,0 +1,58 @@
1
+ /**
2
+ * This is the main environment file, which defines the files the comprise your application, and other settings.
3
+ * To add new files to your application, simply add them to the object in the appropriate place (see the inline comments for details)
4
+ */
5
+ {
6
+
7
+ /**
8
+ * Directory paths.
9
+ */
10
+ "pluginsDir" : '../vendor/plugins',
11
+ "libDir" : '../lib',
12
+ "configDir" : '../config',
13
+ "overridesDir": '../config/overrides',
14
+ "appDir" : '../app',
15
+ "vendor" : ['mvc'],
16
+ "mvcFilename" : 'ext-mvc-all-min',
17
+
18
+ /**
19
+ * Use config/application for general framework configuration
20
+ */
21
+ "config" : ['app/App', 'config/application', 'config/routes'],
22
+
23
+ /**
24
+ * All stylesheets to be loaded. These are all taken to be relative to the public/stylesheets directory, and the .css is
25
+ * automatically appended
26
+ */
27
+ "stylesheets": [
28
+ 'http://extjs.cachefly.net/ext-3.1.1/resources/css/ext-all.css'
29
+ ],
30
+
31
+ //Overrides to include. These files should be located in the config/overrides directory
32
+ "overrides": [
33
+
34
+ ],
35
+
36
+ //Plugins to include. Each will load vendor/plugins/SomePlugin/SomePlugin-all.js
37
+ "plugins": [
38
+
39
+ ],
40
+
41
+ //All of the models in this application, found in the app/models folder
42
+ "models": [
43
+
44
+ ],
45
+
46
+ //All of the controllers in this application, found in the app/controllers folder
47
+ "controllers" : [
48
+ "application", "home"
49
+ ],
50
+
51
+ //All of the views in this application, as an object with the subfolder inside app/views as the key, and an array of filenames as the value.
52
+ //e.g.: views: {"index": ["Index", "MyView"]} will load /app/views/index/Index.js and app/views/index/MyView.js
53
+ "views": [
54
+ {"layout": ["Menu"]},
55
+ {"home" : ["Index"]}
56
+ ]
57
+ }
58
+
@@ -0,0 +1,4 @@
1
+ {
2
+ "stylesheets": ["application-all"],
3
+ "scripts" : []
4
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Defines all routes required for this application
3
+ */
4
+ ExtMVC.router.Router.defineRoutes = function(map) {
5
+ /**
6
+ * Sets up REST-like urls for a given model or models:
7
+ *
8
+ * map.resources('users');
9
+ *
10
+ * Is equivalent to:
11
+ * map.connect("users", {controller: 'users', action: 'index'}); // #users
12
+ * map.connect("users/new", {controller: 'users', action: 'new' }); // #users/new
13
+ * map.connect("users/:id/edit/", {controller: 'users', action: 'edit' }); // #users/1/edit
14
+ * map.connect("users/:id", {controller: 'users', action: 'show' }); // #users/1
15
+ *
16
+ * You can pass more than one model to a map.resources call, e.g.:
17
+ *
18
+ * map.resources('users', 'comments', 'pages', 'products');
19
+ */
20
+
21
+ //set up default routes
22
+ map.connect(":controller/:action");
23
+ map.connect(":controller/:action/:id");
24
+
25
+ //if no url, should a default
26
+ map.root({controller: 'home', action: 'index'});
27
+ };
@@ -0,0 +1,3 @@
1
+ # General settings used by ruby scripts
2
+ environment:
3
+ namespace: MyApp
@@ -0,0 +1,19 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html>
4
+ <head>
5
+ <meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
6
+ <link href='stylesheets/ext-all.css' rel='stylesheet' type='text/css' />
7
+ <link href='stylesheets/ext-mvc-all.css' rel='stylesheet' type='text/css' />
8
+ <title>Ext MVC Application</title>
9
+ </head>
10
+ <body>
11
+ <div id="loading-mask"></div>
12
+ <div id="loading">
13
+ <div class="loading-indicator">
14
+ Loading...
15
+ </div>
16
+ </div>
17
+ <script type="text/javascript" src="/config/boot.js"></script>
18
+ </body>
19
+ </html>
@@ -0,0 +1,49 @@
1
+ /** Loading mask */
2
+ #loading-mask {
3
+ position: absolute;
4
+ left: 0;
5
+ top: 0;
6
+ width: 100%;
7
+ height: 100%;
8
+ z-index: 21000; /* Normal loading masks are 20001 */
9
+ background-color: white;
10
+ }
11
+
12
+ #loading {
13
+ position: absolute;
14
+ left: 50%;
15
+ top: 50%;
16
+ padding: 2px;
17
+ z-index: 21001;
18
+ height: auto;
19
+ margin: -35px 0 0 -30px;
20
+ }
21
+
22
+ #loading .loading-indicator {
23
+ background: url(http://extjs.com/deploy/dev/docs/resources/extanim32.gif) no-repeat;
24
+ color: #555;
25
+ font: bold 13px tahoma,arial,helvetica;
26
+ padding: 8px 42px;
27
+ margin: 0;
28
+ text-align: center;
29
+ height: auto;
30
+ }
31
+
32
+ /* End Loading Mask */
33
+
34
+ /* Test Runner app - Move this somewhere else */
35
+
36
+ .x-grid3-row.pass {
37
+ background-color: #6FFF75;
38
+ }
39
+
40
+ .x-grid3-row.fail {
41
+ background-color: #FF6F6F;
42
+ }
43
+
44
+ .x-grid3-row.fail td {
45
+ /* background-color: red;*/
46
+ color: #fff;
47
+ }
48
+
49
+ /* End Test Runner app */
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+
4
+ <html>
5
+ <head>
6
+ <link type="text/css" rel="stylesheet" href="../vendor/screw-unit/lib/screw.css" />
7
+ <title>Application Specs</title>
8
+ </head>
9
+ <body>
10
+ <div id="dom_test" style="position: absolute; left: -9999"></div>
11
+
12
+ <!-- Library code (not directly part of the app) -->
13
+ <div id="libs">
14
+ <!-- Screw Unit -->
15
+ <script type="text/javascript" src="../vendor/screw-unit/lib/jquery-1.2.3.js"></script>
16
+ <script type="text/javascript" src="../vendor/screw-unit/lib/jquery.fn.js"></script>
17
+ <script type="text/javascript" src="../vendor/screw-unit/lib/jquery.print.js"></script>
18
+ <script type="text/javascript" src="../vendor/screw-unit/lib/screw.builder.js"></script>
19
+ <script type="text/javascript" src="../vendor/screw-unit/lib/screw.matchers.js"></script>
20
+ <script type="text/javascript" src="../vendor/screw-unit/lib/screw.events.js"></script>
21
+ <script type="text/javascript" src="../vendor/screw-unit/lib/screw.behaviors.js"></script>
22
+
23
+ <!-- Ext JS - using debug while in test mode -->
24
+ <script type="text/javascript" src="../vendor/ext/adapter/ext/ext-base.js"></script>
25
+ <script type="text/javascript" src="../vendor/ext/ext-all-debug.js"></script>
26
+
27
+ <!-- Ext MVC -->
28
+ <script type="text/javascript" src="../vendor/mvc/ext-mvc-all.js"></script>
29
+ </div>
30
+
31
+ <!-- Application Files - include any model, controller and view files you need to test here -->
32
+ <div id="app">
33
+ <script type="text/javascript" src="../app/OS.js"></script>
34
+
35
+ <div class="models">
36
+
37
+ </div>
38
+
39
+ <div class="controllers">
40
+
41
+ </div>
42
+
43
+ <div class="views">
44
+
45
+ </div>
46
+ </div>
47
+
48
+ <!-- Specs -->
49
+ <div id="specs">
50
+ <script type="text/javascript" src="SpecHelper.js"></script>
51
+
52
+ <div class="models">
53
+
54
+ </div>
55
+
56
+ <div class="controllers">
57
+
58
+ </div>
59
+
60
+ <div class="views">
61
+
62
+ </div>
63
+ </div>
64
+
65
+ </body>
66
+ </html>
@@ -0,0 +1,68 @@
1
+ <html>
2
+ <!--
3
+ This file is a fully-functioning example test case. Try opening this file in Firefox, Safari,
4
+ or Internet Explorer to see what a running test looks like.
5
+ This file demonstrates the the components involved in writing a simple test, such as:
6
+ * The necessary HTML to run a test (with the required <script> and <link rel="stylesheet"> tags),
7
+ * A "custom matcher" (i.e., a custom assertion) to make your tests more readable,
8
+ * And, a simple test with the necessary boiler-plate code to get you up and running.
9
+ Typically, these components are separated out into multiple files. To see what a more typical suite
10
+ of tests look like, look at the larger example in the examples/ directory.
11
+ -->
12
+ <head>
13
+ <!-- These are all of the necessary javascript and css files required to run your tests -->
14
+ <script src="lib/jquery-1.2.3.js"></script>
15
+ <script src="lib/jquery.fn.js"></script>
16
+ <script src="lib/jquery.print.js"></script>
17
+ <script src="lib/screw.builder.js"></script>
18
+ <script src="lib/screw.matchers.js"></script>
19
+ <script src="lib/screw.events.js"></script>
20
+ <script src="lib/screw.behaviors.js"></script>
21
+ <link rel="stylesheet" href="lib/screw.css">
22
+
23
+ <script type="text/javascript">
24
+ // Here is the system under test (SUT)--that is, your application code that you would like
25
+ // to test.
26
+ function foo() {
27
+ return 2;
28
+ }
29
+ </script>
30
+
31
+ <script type="text/javascript">
32
+ // Here is a Custom Matcher. A custom matcher is a custom assertion,
33
+ // tailored to your application; these help to make your tests more readable.
34
+ Screw.Matchers["be_even"] = {
35
+ match: function(expected, actual) {
36
+ return actual % 2 == 0;
37
+ },
38
+ failure_message: function(expected, actual, not) {
39
+ return 'expected ' + $.print(actual) + (not ? ' not' : '') + ' to be even';
40
+ }
41
+ }
42
+ </script>
43
+
44
+ <script type="text/javascript">
45
+ // Here is a sample test. Note that all tests are wrapped in
46
+ // "Screw.Unit(function() { ... })".
47
+ Screw.Unit(function() {
48
+ // Tests are organized into 'describes' and 'its', following the style of RSpec.
49
+ describe("foo", function() {
50
+ it("returns 2", function() {
51
+ // 'equal' is one among many matchers provided with the Screw.Unit distribution. It
52
+ // is smart enough to compare arrays, objects, and primitives.
53
+ expect(foo()).to(equal, 2);
54
+ });
55
+ });
56
+
57
+ describe("an undefined variable", function() {
58
+ // Here is a use of the custom matcher defined above.
59
+ it("is not defined", function() {
60
+ expect(2).to(be_even);
61
+ expect(3).to_not(be_even);
62
+ });
63
+ });
64
+ });
65
+ </script>
66
+ </head>
67
+ <body></body>
68
+ </html>
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2008 Nick Kallen
2
+
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.