Skip to content

Commit 84ac6bf

Browse files
committed
add
1 parent 32241bb commit 84ac6bf

File tree

3,829 files changed

+663636
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,829 files changed

+663636
-0
lines changed

.bowerrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"directory": "assets/vendors"
3+
}

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
logs/*
2+
!.gitkeep
3+
node_modules/
4+
bower_components/
5+
tmp
6+
.DS_Store
7+
.idea
8+
App_Data
9+
bin
10+
obj

.jshintrc

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"globalstrict": true,
3+
"globals": {
4+
"angular": false,
5+
"describe": false,
6+
"it": false,
7+
"expect": false,
8+
"beforeEach": false,
9+
"afterEach": false,
10+
"module": false,
11+
"inject": false
12+
}
13+
}

Gruntfile.js

+145
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
module.exports = function(grunt) {
2+
grunt.initConfig({
3+
pkg: grunt.file.readJSON('package.json'),
4+
uglify: {
5+
options: {
6+
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
7+
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
8+
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>; */\n'
9+
},
10+
my_target: {
11+
files: {
12+
'build/app.js': [
13+
'assets/lib/jquery/jquery-1.11.2.min.js',
14+
'assets/lib/jquery/jquery-ui.js',
15+
'assets/lib/jquery/jquery.cookie.js',
16+
'assets/vendors/jquery-pulsate/jquery.pulsate.custom.js',
17+
'assets/vendors/jquery-slimscroll/jquery.slimscroll.min.js',
18+
//'assets/vendors/icheck/icheck.min.js',
19+
'assets/vendors/bootstrap/js/bootstrap.min.js',
20+
//'assets/vendors/bootstrap-switch/bootstrap-switch.min.js',
21+
'assets/vendors/buttons/js/buttons.js',
22+
'assets/lib/angularjs/1.3.9/ie8/angular.min.js',
23+
24+
//'assets/lib/dhtmlx/v403_pro/codebase/dhtmlx.js',
25+
//'assets/lib/dhtmlx/v412_std/sources/dhtmlxTabbar/codebase/dhtmlxtabbar.js',
26+
//'assets/lib/dhtmlx/dhtmlx.custom.js',
27+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxCommon/codebase/dhtmlxcommon.js',
28+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxCommon/codebase/dhtmlxcore.js',
29+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxCommon/codebase/dhtmlxcontainer.js',
30+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxLayout/codebase/dhtmlxlayout.js',
31+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxAccordion/codebase/dhtmlxaccordion.js',
32+
'assets/lib/dhtmlx/v412_std/sources/dhtmlxTabbar/codebase/dhtmlxtabbar.js',
33+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxTree/codebase/dhtmlxtree.js',
34+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxTree/codebase/ext/dhtmlxtree_json.js',
35+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxToolbar/codebase/dhtmlxtoolbar.js',
36+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxMenu/codebase/dhtmlxmenu.js',
37+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/dhtmlxgrid.js',
38+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_drag.js',
39+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_export.js',
40+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_filter.js',
41+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_nxml.js',
42+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_selection.js',
43+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_srnd.js',
44+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_validation.js',
45+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/excells/dhtmlxgrid_excell_tree.js',
46+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/excells/dhtmlxgrid_excell_link.js',
47+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/excells/dhtmlxgrid_excell_grid.js',
48+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/excells/dhtmlxgrid_excell_dhxcalendar.js',
49+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/excells/dhtmlxgrid_excell_cntr.js',
50+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/excells/dhtmlxgrid_excell_acheck.js',
51+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/excells/dhtmlxgrid_excell_context.js',
52+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_start.js',
53+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_data.js',
54+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_fast.js',
55+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_filter_ext.js',
56+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_form.js',
57+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_group.js',
58+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_hextra.js',
59+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_hmenu.js',
60+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_json.js',
61+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_markers.js',
62+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_math.js',
63+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_mcol.js',
64+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_over.js',
65+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_pgn.js',
66+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_post.js',
67+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_rowspan.js',
68+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_splt.js',
69+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_ssc.js',
70+
'assets/lib/dhtmlx/v403_pro/sources/dhtmlxGrid/codebase/ext/dhtmlxgrid_undo.js',
71+
'assets/lib/dhtmlx/dhtmlx.custom.js',
72+
73+
'assets/lib/requirejs/require.min.js',
74+
'app/main.js'
75+
],
76+
'build/ie.js':['assets/lib/ie/html5shiv/html5shiv.min.js',
77+
'assets/lib/ie/es5-shim/es5-shim.min.js',
78+
'assets/lib/ie/json/json3.min.js',
79+
'assets/lib/ie/respond/respond.min.js',
80+
'assets/lib/ie/ieupdate/ieupdate.js']
81+
}
82+
}
83+
},
84+
cssmin: {
85+
concat: {
86+
options: {
87+
keepBreaks: true, // whether to keep line breaks (default is false)
88+
keepSpecialComments: 0,
89+
// debug: true, // set to true to get minification statistics under 'stats' property (see test/custom-test.js for examples)
90+
noAdvanced: false, //, // set to true to disable advanced optimizations - selector & property merging, reduction, etc.
91+
//relativeTo: 'http://www.baidu.com/', //'http://online-domain-tools.com/',
92+
noRebase:false, // whether to skip URLs rebasing
93+
root: './'
94+
},
95+
nonull: true,
96+
src: [
97+
'assets/css/default/03-scaffolding.css',
98+
'assets/css/default/04-helpers.css',
99+
'assets/vendors/buttons/css/buttons.min.css',
100+
'assets/lib/dhtmlx/v412_std/skins/default/dhtmlx.css',
101+
'app/css/app.css',
102+
'app/css/fix.css',
103+
'assets/css/default/01-icons.css'
104+
],
105+
dest: 'build/app.css'
106+
},
107+
minify: {
108+
options: {},
109+
nonull: true,
110+
src: ['build/app.css'],
111+
dest: 'build/app.css'
112+
}
113+
},
114+
replace: {
115+
another_example: {
116+
src: ['build/app.css'],
117+
overwrite: true, // overwrite matched source files
118+
replacements: [{
119+
from: /\/assets/g,
120+
to: '/assets'
121+
},
122+
{
123+
from:/\/app/g,
124+
to:'/app'
125+
}]
126+
}
127+
},
128+
copy: {
129+
main: {
130+
files: [
131+
//{src: ['assets/lib/dhtmlx/v412_std/codebase/dhtmlx.js'], dest: 'build/dhtmlx.js'},
132+
//{src: ['assets/lib/angularjs/1.3.9/ie8/angular.min.js'], dest: 'build/angular.js'},
133+
//{src: ['assets/lib/jquery/jquery-1.11.2.min.js'],dest:'build/jquery.js'},
134+
{src: ['app/img/logo/chitu-32.png'], dest: 'build/app.png'}
135+
]
136+
}
137+
}
138+
});
139+
140+
grunt.loadNpmTasks('grunt-contrib-uglify');
141+
grunt.loadNpmTasks('grunt-contrib-cssmin');
142+
grunt.loadNpmTasks('grunt-text-replace');
143+
grunt.loadNpmTasks('grunt-contrib-copy');
144+
grunt.registerTask('default', ['uglify','cssmin:concat','replace', 'cssmin:minify','copy']);
145+
};

README.md

+221
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
# dhtmlx_web — angular app for enterprise uac
2+
3+
This project is an application skeleton for a typical [AngularJS](http://angularjs.org/) web app.
4+
You can use it to quickly bootstrap your angular webapp projects and dev environment for these
5+
projects.
6+
7+
The seed contains a sample AngularJS application and is preconfigured to install the Angular
8+
framework and a bunch of development and testing tools for instant web development gratification.
9+
10+
The seed app doesn't do much, just shows how to wire two controllers and views together.
11+
12+
13+
## Getting Started
14+
15+
To get you started you can simply clone the angular-seed repository and install the dependencies:
16+
17+
### Install Dependencies
18+
19+
We have two kinds of dependencies in this project: tools and angular framework code. The tools help
20+
us manage and test the application.
21+
22+
* We get the tools we depend upon via `npm`, the [node package manager][npm].
23+
* We get the angular code via `bower`, a [client-side code package manager][bower].
24+
25+
We have preconfigured `npm` to automatically run `bower` so we can simply do:
26+
27+
```
28+
npm install
29+
```
30+
31+
Behind the scenes this will also call `bower install`. You should find that you have two new
32+
folders in your project.
33+
34+
* `node_modules` - contains the npm packages for the tools we need
35+
* `app/bower_components` - contains the angular framework files
36+
37+
*Note that the `bower_components` folder would normally be installed in the root folder but
38+
angular-seed changes this location through the `.bowerrc` file. Putting it in the app folder makes
39+
it easier to serve the files by a webserver.*
40+
41+
## Directory Layout
42+
43+
44+
## Testing
45+
46+
There are two kinds of tests in the angular-seed application: Unit tests and End to End tests.
47+
48+
### Running Unit Tests
49+
50+
The angular-seed app comes preconfigured with unit tests. These are written in
51+
[Jasmine][jasmine], which we run with the [Karma Test Runner][karma]. We provide a Karma
52+
configuration file to run them.
53+
54+
* the configuration is found at `karma.conf.js`
55+
* the unit tests are found next to the code they are testing and are named as `..._test.js`.
56+
57+
The easiest way to run the unit tests is to use the supplied npm script:
58+
59+
```
60+
npm test
61+
```
62+
63+
This script will start the Karma test runner to execute the unit tests. Moreover, Karma will sit and
64+
watch the source and test files for changes and then re-run the tests whenever any of them change.
65+
This is the recommended strategy; if your unit tests are being run every time you save a file then
66+
you receive instant feedback on any changes that break the expected code functionality.
67+
68+
You can also ask Karma to do a single run of the tests and then exit. This is useful if you want to
69+
check that a particular version of the code is operating as expected. The project contains a
70+
predefined script to do this:
71+
72+
```
73+
npm run test-single-run
74+
```
75+
76+
77+
### End to end testing
78+
79+
The angular-seed app comes with end-to-end tests, again written in [Jasmine][jasmine]. These tests
80+
are run with the [Protractor][protractor] End-to-End test runner. It uses native events and has
81+
special features for Angular applications.
82+
83+
* the configuration is found at `e2e-tests/protractor-conf.js`
84+
* the end-to-end tests are found in `e2e-tests/scenarios.js`
85+
86+
Protractor simulates interaction with our web app and verifies that the application responds
87+
correctly. Therefore, our web server needs to be serving up the application, so that Protractor
88+
can interact with it.
89+
90+
```
91+
npm start
92+
```
93+
94+
In addition, since Protractor is built upon WebDriver we need to install this. The angular-seed
95+
project comes with a predefined script to do this:
96+
97+
```
98+
npm run update-webdriver
99+
```
100+
101+
This will download and install the latest version of the stand-alone WebDriver tool.
102+
103+
Once you have ensured that the development web server hosting our application is up and running
104+
and WebDriver is updated, you can run the end-to-end tests using the supplied npm script:
105+
106+
```
107+
npm run protractor
108+
```
109+
110+
This script will execute the end-to-end tests against the application being hosted on the
111+
development server.
112+
113+
114+
## Updating Angular
115+
116+
Previously we recommended that you merge in changes to angular-seed into your own fork of the project.
117+
Now that the angular framework library code and tools are acquired through package managers (npm and
118+
bower) you can use these tools instead to update the dependencies.
119+
120+
You can update the tool dependencies by running:
121+
122+
```
123+
npm update
124+
```
125+
126+
This will find the latest versions that match the version ranges specified in the `package.json` file.
127+
128+
You can update the Angular dependencies by running:
129+
130+
```
131+
bower update
132+
```
133+
134+
This will find the latest versions that match the version ranges specified in the `bower.json` file.
135+
136+
137+
## Loading Angular Asynchronously
138+
139+
The angular-seed project supports loading the framework and application scripts asynchronously. The
140+
special `index-async.html` is designed to support this style of loading. For it to work you must
141+
inject a piece of Angular JavaScript into the HTML page. The project has a predefined script to help
142+
do this.
143+
144+
```
145+
npm run update-index-async
146+
```
147+
148+
This will copy the contents of the `angular-loader.js` library file into the `index-async.html` page.
149+
You can run this every time you update the version of Angular that you are using.
150+
151+
152+
## Serving the Application Files
153+
154+
While angular is client-side-only technology and it's possible to create angular webapps that
155+
don't require a backend server at all, we recommend serving the project files using a local
156+
webserver during development to avoid issues with security restrictions (sandbox) in browsers. The
157+
sandbox implementation varies between browsers, but quite often prevents things like cookies, xhr,
158+
etc to function properly when an html page is opened via `file://` scheme instead of `http://`.
159+
160+
161+
### Running the App during Development
162+
163+
The angular-seed project comes preconfigured with a local development webserver. It is a node.js
164+
tool called [http-server][http-server]. You can start this webserver with `npm start` but you may choose to
165+
install the tool globally:
166+
167+
```
168+
sudo npm install -g http-server
169+
```
170+
171+
Then you can start your own development web server to serve static files from a folder by
172+
running:
173+
174+
```
175+
http-server -a localhost -p 8000
176+
```
177+
178+
Alternatively, you can choose to configure your own webserver, such as apache or nginx. Just
179+
configure your server to serve the files under the `app/` directory.
180+
181+
182+
### Running the App in Production
183+
184+
This really depends on how complex your app is and the overall infrastructure of your system, but
185+
the general rule is that all you need in production are all the files under the `app/` directory.
186+
Everything else should be omitted.
187+
188+
Angular apps are really just a bunch of static html, css and js files that just need to be hosted
189+
somewhere they can be accessed by browsers.
190+
191+
If your Angular app is talking to the backend server via xhr or other means, you need to figure
192+
out what is the best way to host the static files to comply with the same origin policy if
193+
applicable. Usually this is done by hosting the files by the backend server or through
194+
reverse-proxying the backend server(s) and webserver(s).
195+
196+
197+
## Continuous Integration
198+
199+
### Travis CI
200+
201+
[Travis CI][travis] is a continuous integration service, which can monitor GitHub for new commits
202+
to your repository and execute scripts such as building the app or running tests. The angular-seed
203+
project contains a Travis configuration file, `.travis.yml`, which will cause Travis to run your
204+
tests when you push to GitHub.
205+
206+
You will need to enable the integration between Travis and GitHub. See the Travis website for more
207+
instruction on how to do this.
208+
209+
## Contact
210+
211+
For more information on AngularJS please check out http://angularjs.org/
212+
213+
[git]: http://git-scm.com/
214+
[bower]: http://bower.io
215+
[npm]: https://www.npmjs.org/
216+
[node]: http://nodejs.org
217+
[protractor]: https://github.com/angular/protractor
218+
[jasmine]: http://jasmine.github.io
219+
[karma]: http://karma-runner.github.io
220+
[travis]: https://travis-ci.org/
221+
[http-server]: https://github.com/nodeapps/http-server

0 commit comments

Comments
 (0)