extjs-mvc 0.4.0.b → 0.4.0.d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +6 -9
- data/VERSION +1 -1
- data/bin/extjs-mvc +19 -0
- data/lib/extjs-mvc.rb +13 -67
- data/lib/{js → vendor}/App.js +0 -0
- data/lib/{js → vendor}/MVC.js +0 -0
- data/lib/{js → vendor}/Presenter.js +0 -0
- data/lib/{js → vendor}/README.rdoc +0 -0
- data/lib/{js → vendor}/controller/Controller.js +0 -0
- data/lib/{js → vendor}/controller/CrudController.js +0 -0
- data/lib/{js → vendor}/lib/Array.js +0 -0
- data/lib/{js → vendor}/lib/Booter.js +4 -3
- data/lib/{js → vendor}/lib/ClassManager.js +0 -0
- data/lib/{js → vendor}/lib/ControllerClassManager.js +0 -0
- data/lib/{js → vendor}/lib/Dependencies.js +0 -0
- data/lib/{js → vendor}/lib/DispatchMatcher.js +0 -0
- data/lib/{js → vendor}/lib/Dispatcher.js +0 -0
- data/lib/{js → vendor}/lib/Environment.js +0 -0
- data/lib/{js → vendor}/lib/Inflector.js +17 -0
- data/lib/{js → vendor}/lib/ModelClassManager.js +0 -0
- data/lib/{js → vendor}/lib/Route.js +0 -0
- data/lib/{js → vendor}/lib/Router.js +0 -0
- data/lib/{js → vendor}/lib/String.js +0 -0
- data/lib/{js → vendor}/lib/ViewClassManager.js +0 -0
- data/lib/{js → vendor}/lib/notes.txt +0 -0
- data/lib/{js → vendor}/model/AdapterManager.js +0 -0
- data/lib/{js → vendor}/model/Association.js +0 -0
- data/lib/{js → vendor}/model/Base.js +0 -0
- data/lib/{js → vendor}/model/BelongsToAssociation.js +0 -0
- data/lib/{js → vendor}/model/Cache.js +0 -0
- data/lib/{js → vendor}/model/HasManyAssociation.js +0 -0
- data/lib/{js → vendor}/model/Model.js +0 -0
- data/lib/{js → vendor}/model/UrlBuilder.js +0 -0
- data/lib/{js → vendor}/model/adapters/AbstractAdapter.js +0 -0
- data/lib/{js → vendor}/model/adapters/MemoryAdapter.js +0 -0
- data/lib/{js → vendor}/model/adapters/RESTAdapter.js +0 -0
- data/lib/{js → vendor}/model/adapters/RESTJSONAdapter.js +0 -0
- data/lib/{js → vendor}/model/adapters/notes.txt +0 -0
- data/lib/{js → vendor}/model/associations/Association.js +0 -0
- data/lib/{js → vendor}/model/associations/notes.txt +0 -0
- data/lib/{js → vendor}/model/validations/Errors.js +0 -0
- data/lib/{js → vendor}/model/validations/Plugin.js +0 -0
- data/lib/{js → vendor}/model/validations/Validations.js +0 -0
- data/lib/{js → vendor}/notes/Charts.graffle +0 -0
- data/lib/{js → vendor}/overrides/Ext.Component.js +0 -0
- data/lib/{js → vendor}/overrides/Ext.extend.js +0 -0
- data/lib/{js → vendor}/spec/Array.spec.js +0 -0
- data/lib/{js → vendor}/spec/ExtMVC.spec.js +0 -0
- data/lib/{js → vendor}/spec/Model.spec.js +0 -0
- data/lib/{js → vendor}/spec/OS.spec.js +0 -0
- data/lib/{js → vendor}/spec/Router.spec.js +0 -0
- data/lib/{js → vendor}/spec/SpecHelper.js +0 -0
- data/lib/{js → vendor}/spec/String.spec.js +0 -0
- data/lib/{js → vendor}/spec/model/AbstractAdapter.spec.js +0 -0
- data/lib/{js → vendor}/spec/model/Associations.spec.js +0 -0
- data/lib/{js → vendor}/spec/model/Cache.spec.js +0 -0
- data/lib/{js → vendor}/spec/model/RESTAdapter.spec.js +0 -0
- data/lib/{js → vendor}/spec/model/ValidationErrors.spec.js +0 -0
- data/lib/{js → vendor}/spec/model/Validations.spec.js +0 -0
- data/lib/{js → vendor}/spec/model/ValidationsPlugin.spec.js +0 -0
- data/lib/{js → vendor}/spec/suite.html +0 -0
- data/lib/{js → vendor}/specs-old/JSSpec.css +0 -0
- data/lib/{js → vendor}/specs-old/JSSpec.js +0 -0
- data/lib/{js → vendor}/specs-old/all.html +0 -0
- data/lib/{js → vendor}/specs-old/base.js +0 -0
- data/lib/{js → vendor}/specs-old/controller.js +0 -0
- data/lib/{js → vendor}/specs-old/diff_match_patch.js +0 -0
- data/lib/{js → vendor}/specs-old/model.js +0 -0
- data/lib/{js → vendor}/specs-old/route.js +0 -0
- data/lib/{js → vendor}/specs-old/router.js +0 -0
- data/lib/{js → vendor}/specs-old/string.js +0 -0
- data/lib/{js → vendor}/testrunner/JSpecFormatter.js +0 -0
- data/lib/{js → vendor}/testrunner/TestClient.js +0 -0
- data/lib/{js → vendor}/testrunner/TestGrid.js +0 -0
- data/lib/{js → vendor}/testrunner/TestRunner.js +0 -0
- data/lib/{js → vendor}/testrunner/TestViewport.js +0 -0
- data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/EXAMPLE.html +0 -0
- data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/LICENSE +0 -0
- data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/README.markdown +0 -0
- data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/lib/jquery-1.2.3.js +0 -0
- data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/lib/jquery.fn.js +0 -0
- data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/lib/jquery.print.js +0 -0
- data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/lib/screw.assets.js +0 -0
- data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/lib/screw.behaviors.js +0 -0
- data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/lib/screw.builder.js +0 -0
- data/lib/{js → vendor}/vendor/screw-unit/lib/screw.css +0 -0
- data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/lib/screw.events.js +0 -0
- data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/lib/screw.matchers.js +0 -0
- data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/lib/screw.server.js +0 -0
- data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/spec/behaviors_spec.js +0 -0
- data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/spec/matchers_spec.js +0 -0
- data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/spec/print_spec.js +0 -0
- data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/spec/spec_helper.js +0 -0
- data/lib/{extjs-mvc/generators/templates/app → vendor}/vendor/screw-unit/spec/suite.html +0 -0
- data/lib/{js → vendor}/view/FormWindow.js +0 -0
- data/lib/{js → vendor}/view/HasManyEditorGridPanel.js +0 -0
- data/lib/{js → vendor}/view/scaffold/Edit.js +0 -0
- data/lib/{js → vendor}/view/scaffold/Index.js +0 -0
- data/lib/{js → vendor}/view/scaffold/New.js +0 -0
- data/lib/{js → vendor}/view/scaffold/ScaffoldFormPanel.js +0 -0
- data/lib/{js/build → vendor.yml} +7 -1
- metadata +110 -203
- data/bin/xmvc +0 -13
- data/lib/extjs-mvc/README +0 -20
- data/lib/extjs-mvc/builder.rb +0 -83
- data/lib/extjs-mvc/builders/all_builder.rb +0 -15
- data/lib/extjs-mvc/builders/app_builder.rb +0 -36
- data/lib/extjs-mvc/builders/base.rb +0 -138
- data/lib/extjs-mvc/builders/css_builder.rb +0 -36
- data/lib/extjs-mvc/builders/docs_builder.rb +0 -20
- data/lib/extjs-mvc/builders/mvc_builder.rb +0 -33
- data/lib/extjs-mvc/builders/plugin_builder.rb +0 -53
- data/lib/extjs-mvc/cli.rb +0 -52
- data/lib/extjs-mvc/generator.rb +0 -79
- data/lib/extjs-mvc/generators/app.rb +0 -57
- data/lib/extjs-mvc/generators/base.rb +0 -53
- data/lib/extjs-mvc/generators/controller.rb +0 -41
- data/lib/extjs-mvc/generators/model.rb +0 -41
- data/lib/extjs-mvc/generators/scaffold.rb +0 -17
- data/lib/extjs-mvc/generators/templates/Controller.js +0 -17
- data/lib/extjs-mvc/generators/templates/Model.js +0 -9
- data/lib/extjs-mvc/generators/templates/ModelSpec.js +0 -12
- data/lib/extjs-mvc/generators/templates/View.js +0 -16
- data/lib/extjs-mvc/generators/templates/_Action.js +0 -7
- data/lib/extjs-mvc/generators/templates/app/README.rdoc +0 -152
- data/lib/extjs-mvc/generators/templates/app/app/App.js +0 -64
- data/lib/extjs-mvc/generators/templates/app/app/controllers/ApplicationController.js +0 -10
- data/lib/extjs-mvc/generators/templates/app/app/controllers/HomeController.js +0 -10
- data/lib/extjs-mvc/generators/templates/app/app/views/home/Index.js +0 -17
- data/lib/extjs-mvc/generators/templates/app/app/views/layout/Menu.js +0 -23
- data/lib/extjs-mvc/generators/templates/app/config/application.js +0 -1
- data/lib/extjs-mvc/generators/templates/app/config/boot.js +0 -67
- data/lib/extjs-mvc/generators/templates/app/config/build.xml +0 -77
- data/lib/extjs-mvc/generators/templates/app/config/database.js +0 -4
- data/lib/extjs-mvc/generators/templates/app/config/environment.json +0 -58
- data/lib/extjs-mvc/generators/templates/app/config/environments/development.json +0 -1
- data/lib/extjs-mvc/generators/templates/app/config/environments/production.json +0 -4
- data/lib/extjs-mvc/generators/templates/app/config/routes.js +0 -27
- data/lib/extjs-mvc/generators/templates/app/config/settings.yml +0 -3
- data/lib/extjs-mvc/generators/templates/app/public/index.html +0 -19
- data/lib/extjs-mvc/generators/templates/app/public/stylesheets/ext-mvc-all.css +0 -49
- data/lib/extjs-mvc/generators/templates/app/spec/SpecHelper.js +0 -0
- data/lib/extjs-mvc/generators/templates/app/spec/index.html +0 -66
- data/lib/extjs-mvc/generators/templates/app/vendor/screw-unit/lib/screw.css +0 -90
- data/lib/extjs-mvc/generators/templates/scaffold/ScaffoldController.js +0 -18
- data/lib/extjs-mvc/generators/view.rb +0 -29
- data/lib/extjs-mvc/plugin.rb +0 -105
- data/lib/extjs-mvc/scripts.rb +0 -15
- data/lib/extjs-mvc/settings.rb +0 -75
- data/lib/extjs-mvc/setup.rb +0 -5
- data/lib/extjs-mvc/stats.rb +0 -241
- data/lib/extjs-mvc/test.rb +0 -11
- data/lib/extjs-mvc/testserver.ru +0 -95
- data/lib/extjs-mvc/ui.rb +0 -58
- data/lib/extjs-mvc/update.rb +0 -73
- data/lib/js/vendor/screw-unit/EXAMPLE.html +0 -68
- data/lib/js/vendor/screw-unit/LICENSE +0 -22
- data/lib/js/vendor/screw-unit/README.markdown +0 -307
- data/lib/js/vendor/screw-unit/lib/jquery-1.2.3.js +0 -3408
- data/lib/js/vendor/screw-unit/lib/jquery.fn.js +0 -29
- data/lib/js/vendor/screw-unit/lib/jquery.print.js +0 -108
- data/lib/js/vendor/screw-unit/lib/screw.assets.js +0 -36
- data/lib/js/vendor/screw-unit/lib/screw.behaviors.js +0 -91
- data/lib/js/vendor/screw-unit/lib/screw.builder.js +0 -80
- data/lib/js/vendor/screw-unit/lib/screw.events.js +0 -42
- data/lib/js/vendor/screw-unit/lib/screw.matchers.js +0 -145
- data/lib/js/vendor/screw-unit/lib/screw.server.js +0 -21
- data/lib/js/vendor/screw-unit/spec/behaviors_spec.js +0 -178
- data/lib/js/vendor/screw-unit/spec/matchers_spec.js +0 -237
- data/lib/js/vendor/screw-unit/spec/print_spec.js +0 -119
- data/lib/js/vendor/screw-unit/spec/spec_helper.js +0 -0
- data/lib/js/vendor/screw-unit/spec/suite.html +0 -18
@@ -1,152 +0,0 @@
|
|
1
|
-
= ExtJS MVC Base App
|
2
|
-
|
3
|
-
Ext MVC Application structure for any new MVC application. Structure inspired by Ruby on Rails.
|
4
|
-
|
5
|
-
== Installation
|
6
|
-
|
7
|
-
Clone this as the starting point for your apps. Place your cloned directory somewhere apache can serve it, then head to index.html:
|
8
|
-
|
9
|
-
http://localhost/myDirectory/index.html
|
10
|
-
|
11
|
-
You should see a default application set up and ready to go.
|
12
|
-
|
13
|
-
== Prerequisites
|
14
|
-
|
15
|
-
Most prerequisites are installed for you inside the vendor directory:
|
16
|
-
|
17
|
-
* vendor/ext - contains a copy of ExtJS v2.2.1 (debug version, production copy by defaults comes off the cachefly CDN)
|
18
|
-
* vendor/mvc - contains a copy of the latest stable version of Ext MVC (debug and minified versions)
|
19
|
-
* vendor/screw-unit - contains a copy of ScrewUnit, a BDD testing framework for JavaScipt
|
20
|
-
* vendor/yui-compressor - contains a copy of the YUI compressor, which is used in the automatic build process
|
21
|
-
|
22
|
-
Although is is not strictly a prerequisite, you are *strongly* advised to install Ruby and Rubygems as the scripts below will automate a lot of things
|
23
|
-
for you and save you a lot of time. If you're running OSX you probably already have these, if you're on Windows it's a very simple install process.
|
24
|
-
Take a look at http://rubyonrails.org/download for instructions (just the Ruby and RubyGems sections).
|
25
|
-
|
26
|
-
If you don't intend to use the Ruby automation scripts, you can safely delete the script, vendor/mvc/scripts and vendor/yui-compressor folders.
|
27
|
-
|
28
|
-
== Getting Started
|
29
|
-
|
30
|
-
The only thing you need to change is the namespace your application will be using. Choose a meaningful namespace for your application - e.g. for
|
31
|
-
a blog application you might choose BlogApp, or something similar. All of your code will sit under that namespace, like this:
|
32
|
-
|
33
|
-
* BlogApp.models.Post // reference to a Post model constructor
|
34
|
-
* BlogApp.controllers.IndexController // reference to a controller constructor
|
35
|
-
* BlogApp.views.posts.New // reference to a view constructor, usually an Ext.Panel subclass
|
36
|
-
|
37
|
-
It doesn't matter if you don't know what those do yet, the important thing is that you don't pollute the global namespace. The whole of Ext MVC is
|
38
|
-
build around this idea.
|
39
|
-
|
40
|
-
Once you've chosen your namespace, just run the following command:
|
41
|
-
|
42
|
-
ruby script/setup MyAppNamespace
|
43
|
-
|
44
|
-
This will update all files with the default namespace ('MyApp') with the namespace you specify.
|
45
|
-
|
46
|
-
If you can't run the script, you can easily perform the setup yourself - just change the references from the default 'MyApp' namespace to your own
|
47
|
-
namespace in the following files:
|
48
|
-
|
49
|
-
* app/OS.js
|
50
|
-
* app/controllers/IndexController.js
|
51
|
-
* app/views/index/Index.js
|
52
|
-
* config/initialize.js
|
53
|
-
* config/settings.yml
|
54
|
-
|
55
|
-
Just use a simple find/replace all.
|
56
|
-
|
57
|
-
== Build tools
|
58
|
-
|
59
|
-
You need to ensure you have Ruby installed to use the build tools, and also the rake and hpricot gems (sudo gem install rake hpricot).
|
60
|
-
|
61
|
-
Ext MVC will automatically build (concatenate and minify) your javascript and CSS files. Just run the following command from the base directory:
|
62
|
-
|
63
|
-
ruby script/build all
|
64
|
-
|
65
|
-
This will inspect the javascript and css include tags inside index.html and compress them into a single JS file and a single CSS file. It will minify
|
66
|
-
the javascript if the YUI Compressor is installed in vendor/yui-compressor and create the following files:
|
67
|
-
|
68
|
-
* public/application-all.js
|
69
|
-
* public/application-all-min.js
|
70
|
-
* public/stylesheets/application-all.css
|
71
|
-
|
72
|
-
== Generators:
|
73
|
-
|
74
|
-
Ext MVC comes with some built-in generators to automate some aspects of application development. Run the generators
|
75
|
-
described below from within the main directory of your Ext MVC application.
|
76
|
-
|
77
|
-
Be sure that you have updated your config/settings.yml file before running these, otherwise everything will be namespaced
|
78
|
-
to 'MyApp' (see above).
|
79
|
-
|
80
|
-
=== Model
|
81
|
-
|
82
|
-
ruby script/generate model User first_name:string last_name:string balance:int is_admin:boolean
|
83
|
-
|
84
|
-
Will generate the following files:
|
85
|
-
|
86
|
-
in app/models/User.js:
|
87
|
-
/**
|
88
|
-
* @class MyApp.models.MyModel
|
89
|
-
* @extends ExtMVC.Model
|
90
|
-
*/
|
91
|
-
ExtMVC.Model.define("MyApp.models.User", {
|
92
|
-
modelName: 'user',
|
93
|
-
fields: [
|
94
|
-
{name: 'first_name', type: 'string'},
|
95
|
-
{name: 'last_name', type: 'string'},
|
96
|
-
{name: 'balance', type: 'int'},
|
97
|
-
{name: 'is_admin', type: 'boolean'}
|
98
|
-
]
|
99
|
-
});
|
100
|
-
|
101
|
-
in spec/models/User.spec.js:
|
102
|
-
Screw.Unit(function() {
|
103
|
-
describe("The User class", function() {
|
104
|
-
var user;
|
105
|
-
before(function() {
|
106
|
-
user = new MyApp.models.User({
|
107
|
-
//set fields for this model here
|
108
|
-
});
|
109
|
-
});
|
110
|
-
|
111
|
-
//create your unit tests here
|
112
|
-
});
|
113
|
-
});
|
114
|
-
|
115
|
-
It will also add the following line to your index.html file:
|
116
|
-
|
117
|
-
<script type="text/javascript" src="app/models/User.js"></script>
|
118
|
-
|
119
|
-
And the following to your spec/index.html file:
|
120
|
-
|
121
|
-
<script type="text/javascript" src="../app/models/User.js"></script>
|
122
|
-
<script type="text/javascript" src="models/User.spec.js"></script>
|
123
|
-
|
124
|
-
|
125
|
-
== Deployment
|
126
|
-
|
127
|
-
Once you've built your app, upload only the 'public' folder to your web server. Nothing else is required to run the app.
|
128
|
-
|
129
|
-
== Directory Structure:
|
130
|
-
|
131
|
-
* app - a directory to contain your models, views and controllers
|
132
|
-
* app/controllers - contains all of your controllers
|
133
|
-
* app/models - contains all modesl
|
134
|
-
* app/views - contains all view files, usually in subdirectories (e.g. app/views/users/Index.js)
|
135
|
-
* config - contains application configuration files (see below)
|
136
|
-
* lib - contains any library files which are not suited to being plugins
|
137
|
-
* public - the directory you will set as document root on your web server. Place any public-facing assets in here. Note that all javascript and stylesheet files will be concatenated automatically into here when you deploy, so these can exist outside of this folder. Images and other assets will need to be placed here though.
|
138
|
-
* script - contains scripts to automate site build and minification
|
139
|
-
* spec - a directory to place your unit tests or specs
|
140
|
-
* vendor - holds any third-party code
|
141
|
-
* vendor/ext - contains the required version of ExtJS. ExtJS 2.2 comes pre-installed here, with the Ext adapter.
|
142
|
-
* vendor/mvc - contains the required version of Ext MVC. Most recent stable version installed by default. Obtain latest version from http://github.com/extmvc/extmvc/tree
|
143
|
-
* vendor/plugins - contains any MVC-compatible plugins (such as viewport builders, model extensions etc)
|
144
|
-
|
145
|
-
== Important Files:
|
146
|
-
|
147
|
-
* config/routes.js - set up any Ext.History related routing required (see file for help)
|
148
|
-
* config/initialize.js - any app-wide config code, such as setting up location of s.gif, booting your app, etc
|
149
|
-
* config/database.js - define which data adapter your app uses (RESTful adapter, Gears adapter, your own concoction etc)
|
150
|
-
|
151
|
-
* index.html - Development version of the site, including one file at a time and using ext-all-debug
|
152
|
-
* public/index.html - Production version of the site referencing concatenated and minified files
|
@@ -1,64 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @class MyApp.App
|
3
|
-
* @extends ExtMVC.App
|
4
|
-
* The MyApp application.
|
5
|
-
*/
|
6
|
-
|
7
|
-
ExtMVC.App.define({
|
8
|
-
name : "MyApp",
|
9
|
-
|
10
|
-
/**
|
11
|
-
* Sets up the application's Viewport
|
12
|
-
*/
|
13
|
-
launch: function() {
|
14
|
-
|
15
|
-
Ext.QuickTips.init();
|
16
|
-
|
17
|
-
this.menu = ExtMVC.buildView('layout', 'menu', {
|
18
|
-
region : 'west',
|
19
|
-
split: true,
|
20
|
-
width : 240,
|
21
|
-
listeners: {
|
22
|
-
scope: this,
|
23
|
-
click: function(node) {
|
24
|
-
var attrs = node.attributes;
|
25
|
-
|
26
|
-
if (attrs.controller != undefined) {
|
27
|
-
ExtMVC.dispatch({controller: attrs.controller, action: attrs.action});
|
28
|
-
}
|
29
|
-
}
|
30
|
-
}
|
31
|
-
});
|
32
|
-
|
33
|
-
/**
|
34
|
-
* @property main
|
35
|
-
* @type Ext.Panel
|
36
|
-
* A container into which views are rendered
|
37
|
-
*/
|
38
|
-
this.main = new Ext.TabPanel({
|
39
|
-
region: 'center',
|
40
|
-
border: false,
|
41
|
-
cls : 'mainPanel',
|
42
|
-
activeTab: 0
|
43
|
-
});
|
44
|
-
|
45
|
-
this.viewport = new Ext.Viewport({
|
46
|
-
layout: 'border',
|
47
|
-
items: [{
|
48
|
-
xtype: 'box',
|
49
|
-
region: 'north',
|
50
|
-
height: 30
|
51
|
-
},this.menu, this.main
|
52
|
-
]
|
53
|
-
});
|
54
|
-
|
55
|
-
this.fireEvent('launched');
|
56
|
-
|
57
|
-
ExtMVC.dispatch('home', 'index');
|
58
|
-
|
59
|
-
Ext.get('loading').remove();
|
60
|
-
Ext.get('loading-mask').fadeOut({remove:true});
|
61
|
-
}
|
62
|
-
});
|
63
|
-
|
64
|
-
|
@@ -1,10 +0,0 @@
|
|
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
|
-
});
|
@@ -1,17 +0,0 @@
|
|
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
|
-
});
|
@@ -1,23 +0,0 @@
|
|
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
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
ExtMVC.model.modelNamespace = MyApp.models;
|
@@ -1,67 +0,0 @@
|
|
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
|
-
})();
|
@@ -1,77 +0,0 @@
|
|
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="<i>NOTE: {0}</i>"/>
|
75
|
-
<tag name="demo" title="Demo" format="<a href="{0}">{0}</a>" />
|
76
|
-
</tags>
|
77
|
-
</doc>
|
@@ -1,58 +0,0 @@
|
|
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
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
{}
|
@@ -1,27 +0,0 @@
|
|
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
|
-
};
|
@@ -1,19 +0,0 @@
|
|
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>
|
@@ -1,49 +0,0 @@
|
|
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 */
|
File without changes
|