Skip to content
This repository was archived by the owner on Nov 21, 2024. It is now read-only.

Commit ce6759a

Browse files
committed
Merge branch 'master' into patch-1
2 parents 6d9a858 + d99ca34 commit ce6759a

Some content is hidden

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

73 files changed

+8138
-14988
lines changed

Diff for: .editorconfig

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
root = true
4+
5+
[*]
6+
end_of_line = lf
7+
insert_final_newline = true
8+
indent_style = tab
9+
indent_size = 4
10+
charset = utf-8
11+
trim_trailing_whitespace = true

Diff for: .gitattributes

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
res/notify.m4a binary
2+
res/notify.ogg binary
3+
res/notify.mp3 binary

Diff for: .gitignore

+11-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,14 @@ example/.htaccess
55
.idea
66
.ndproj/Data
77
.ndproj/Menu.txt
8-
node_modules
8+
node_modules
9+
bower_components
10+
candy.bundle.*
11+
candy.min.*
12+
libs.bundle.*
13+
libs.min.*
14+
.vagrant
15+
*.log
16+
lcov.info
17+
candy.zip
18+
github-credentials.json

Diff for: .gitmodules

-12
This file was deleted.

Diff for: .jshintrc

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@
88
"undef": true,
99
"unused": true,
1010
"trailing": true,
11-
"maxdepth": 4
12-
}
11+
"maxdepth": 5,
12+
"laxcomma": true,
13+
"browser": true
14+
}

Diff for: .travis.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
language: node_js
2+
node_js:
3+
- '0.10'
4+
env:
5+
global:
6+
- SAUCE_USERNAME: candy-chat-ci
7+
- SAUCE_ACCESS_KEY: 6c3e7f58-b230-4b91-8bcb-290cf28c1457
8+
- CANDY_VAGRANT: false
9+
before_script:
10+
- sudo apt-get update
11+
- sudo apt-get install -y nginx
12+
- sudo mkdir -p /usr/share/nginx/html
13+
- sudo cp ${TRAVIS_BUILD_DIR}/devbox/nginx-default.conf /etc/nginx/sites-available/default
14+
- sudo sed --in-place 's|{{ROOT_DIR}}|'"$TRAVIS_BUILD_DIR"'|g' /etc/nginx/sites-available/default
15+
- sudo /etc/init.d/nginx restart
16+
- sudo apt-get install -y naturaldocs
17+
- npm install -g grunt-cli bower
18+
- npm install
19+
- bower install
20+
script:
21+
- grunt ci

Diff for: CONTRIBUTING.md

100644100755
+21-11
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
## Learn & listen
99

10+
[![Gitter chat](https://badges.gitter.im/candy-chat.png)](https://gitter.im/candy-chat)
11+
1012
* [Mailing list](http://groups.google.com/group/candy-chat)
1113
* yes, non-gmail users can signup as well
1214
* [FAQ](https://github.com/candy-chat/candy/wiki/Frequently-Asked-Questions)
@@ -21,9 +23,8 @@ A few hopefully helpful hints to contributing to Candy
2123
#### Using vagrant
2224
1. [Fork](https://help.github.com/articles/fork-a-repo) Candy
2325
2. [Install Vagrant](http://vagrantup.com/)
24-
3. Follow instructions [for Candy Vagrant](https://github.com/candy-chat/vagrant)
25-
4. Change the remote in the `candy` and `candy-plugins` repos: `git remote set-url origin git://github.com/YOURNAME/candy` (or candy-plugins)
26-
5. Create a branch based on the `dev` branch (`git checkout -B my-awesome-feature`)
26+
3. Run `vagrant up`.
27+
5. Create a branch based on the `master` branch (`git checkout -B my-awesome-feature`)
2728
6. Run `grunt watch` to automatically run jshint (syntax checker) and the build of `candy.bundle.js` and `candy.min.js` while developing.
2829
7. Make your changes, fix eventual *jshint* errors & push them back to your fork
2930
8. Create a [pull request](https://help.github.com/articles/using-pull-requests)
@@ -34,13 +35,22 @@ Please note that you should have a working XMPP server to test your changes (the
3435

3536
1. [Fork](https://help.github.com/articles/fork-a-repo) Candy
3637
2. Clone your fork
37-
2. Checkout out `dev` branch (`git checkout dev`) & Update git submodules `git submodule update --init`
38-
3. Install [Node.js](http://nodejs.org/)
39-
4. Install [Grunt](http://gruntjs.com/) (`npm install -g grunt-cli`)
40-
5. Install npm dependencies (`npm install` in candy root directory)
41-
6. Create a branch based on the `dev` branch (`git checkout -B my-awesome-feature`)
42-
7. Run `grunt watch` to automatically run jshint (syntax checker) and the build of `candy.bundle.js` and `candy.min.js` while developing.
43-
8. Make your changes, fix eventual *jshint* errors & push them back to your fork
44-
9. Create a [pull request](https://help.github.com/articles/using-pull-requests)
38+
3. Checkout out `master` branch (`git checkout master`)
39+
4. Install [Node.js](http://nodejs.org/)
40+
5. Install [Grunt](http://gruntjs.com/) (`npm install -g grunt-cli`)
41+
6. Install [Bower](http://bower.io/) (`npm install -g bower`)
42+
7. Install npm dependencies (`npm install` in candy root directory)
43+
8. Install bower dependencies (`bower install` in candy root directory)
44+
9. Create a branch based on the `master` branch (`git checkout -B my-awesome-feature`)
45+
10. Run `grunt watch` to automatically run jshint (syntax checker) and the build of `candy.bundle.js` and `candy.min.js` while developing.
46+
11. Make your changes, fix eventual *jshint* errors & push them back to your fork
47+
12. Create a [pull request](https://help.github.com/articles/using-pull-requests)
4548

4649
In case you have any questions, don't hesitate to ask on the [Mailing list](http://groups.google.com/group/candy-chat).
50+
51+
### Running tests
52+
53+
* Tests are run using [Intern](http://theintern.io).
54+
* `grunt` and `grunt watch` will each run unit tests in Chrome on Linux (for fast feedback).
55+
* `grunt test` will run both unit and integration tests in a variety of environments. Tests are run using Selenium Standalone and Phantom.JS while developing, and on Sauce Labs in CI or using `grunt test`.
56+
* If you don't want to use the Vagrant box to run Selenium/PhantomJS, set `CANDY_VAGRANT='false'` to run tests.

Diff for: Gruntfile.js

+164-22
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
'use strict';
22

3+
var localInternConfig = process.env.CANDY_VAGRANT === 'false' ? 'tests/intern.local' : 'tests/intern.vagrant';
4+
35
module.exports = function(grunt) {
46

57
// Project configuration.
68
grunt.initConfig({
79
pkg: grunt.file.readJSON('package.json'),
8-
910
jshint: {
10-
all: ['Gruntfile.js', './src/**/*.js'],
11+
all: ['Gruntfile.js', './src/**/*.js', './tests/**/*.js'],
1112
options: {
1213
jshintrc: "./.jshintrc",
1314
reporter: require('jshint-stylish')
@@ -30,8 +31,11 @@ module.exports = function(grunt) {
3031
'src/candy.js', 'src/core.js', 'src/view.js',
3132
'src/util.js', 'src/core/action.js',
3233
'src/core/chatRoom.js', 'src/core/chatRoster.js',
33-
'src/core/chatUser.js', 'src/core/event.js',
34-
'src/view/observer.js', 'src/view/pane.js',
34+
'src/core/chatUser.js', 'src/core/contact.js',
35+
'src/core/event.js', 'src/view/observer.js',
36+
'src/view/pane/chat.js', 'src/view/pane/message.js',
37+
'src/view/pane/privateRoom.js', 'src/view/pane/room.js',
38+
'src/view/pane/roster.js', 'src/view/pane/window.js',
3539
'src/view/template.js', 'src/view/translation.js'
3640
]
3741
},
@@ -53,14 +57,15 @@ module.exports = function(grunt) {
5357
},
5458
libs: {
5559
files: {
56-
'libs/libs.bundle.js': [
57-
'libs/strophejs/strophe.js',
58-
'libs/strophejs-plugins/muc/strophe.muc.js',
59-
'libs/strophejs-plugins/disco/strophe.disco.js',
60-
'libs/strophejs-plugins/caps/strophe.caps.jsonly.js',
61-
'libs/mustache.js/mustache.js',
62-
'libs/jquery-i18n/jquery.i18n.js',
63-
'libs/dateformat/dateFormat.js'
60+
'libs.bundle.js': [
61+
'bower_components/strophe/strophe.js',
62+
'bower_components/strophejs-plugins/muc/strophe.muc.js',
63+
'bower_components/strophejs-plugins/roster/strophe.roster.js',
64+
'bower_components/strophejs-plugins/disco/strophe.disco.js',
65+
'bower_components/strophejs-plugins/caps/strophe.caps.jsonly.js',
66+
'bower_components/mustache/mustache.js',
67+
'bower_components/jquery-i18n/jquery.i18n.js',
68+
'vendor_libs/dateformat/dateFormat.js'
6469
]
6570
},
6671
options: {
@@ -73,23 +78,52 @@ module.exports = function(grunt) {
7378
},
7479
'libs-min': {
7580
files: {
76-
'libs/libs.min.js': ['libs/libs.bundle.js']
81+
'libs.min.js': ['libs.bundle.js']
7782
}
7883
}
7984
},
85+
concat: {
86+
css:{
87+
src: [
88+
'bower_components/bootstrap/dist/css/bootstrap.css'
89+
],
90+
dest: 'libs.bundle.css'
91+
}
92+
},
93+
cssmin: {
94+
css:{
95+
src: 'libs.bundle.css',
96+
dest: 'libs.min.css'
97+
}
98+
},
8099
watch: {
100+
clear: {
101+
files: ['src/*.js', 'src/**/*.js', 'tests/**/*.js'],
102+
tasks: ['clear']
103+
},
104+
grunt: {
105+
files: ['Gruntfile.js']
106+
},
81107
bundle: {
82-
files: ['src/*.js', 'src/**/*.js'],
83-
tasks: ['jshint', 'uglify:bundle', 'uglify:min', 'notify:bundle']
108+
files: ['src/**/*.js'],
109+
tasks: ['todo:src', 'jshint', 'uglify:bundle', 'uglify:min', 'notify:bundle', 'intern:unit']
84110
},
85111
libs: {
86-
files: ['libs/*/**/*.js'],
112+
files: ['bower_components/*/**/*.js', 'vendor_libs/*/**/*.js'],
87113
tasks: ['uglify:libs', 'uglify:libs-min', 'notify:libs']
114+
},
115+
tests: {
116+
files: ['tests/candy/unit/**/*.js'],
117+
tasks: ['todo:tests', 'jshint', 'intern:unit']
118+
},
119+
functional_tests: {
120+
files: ['tests/candy/functional/**/*.js'],
121+
tasks: ['todo:tests', 'jshint', 'intern:functional']
88122
}
89123
},
90124
natural_docs: {
91125
all: {
92-
bin: process.env.NATURALDOCS_DIR + '/NaturalDocs',
126+
bin: process.env.NATURALDOCS_DIR ? process.env.NATURALDOCS_DIR + '/NaturalDocs' : 'naturaldocs',
93127
flags: ['-r'],
94128
inputs: ['./src'],
95129
output: './docs',
@@ -98,7 +132,7 @@ module.exports = function(grunt) {
98132
},
99133
clean: {
100134
bundle: ['./candy.bundle.js', './candy.bundle.map', './candy.min.js'],
101-
libs: ['./libs/libs.bundle.js', './libs/libs.bundle.map', './libs/libs.min.js'],
135+
libs: ['./libs.bundle.js', './libs.bundle.map', './libs.min.js'],
102136
docs: ['./docs']
103137
},
104138
mkdir: {
@@ -129,21 +163,129 @@ module.exports = function(grunt) {
129163
message: 'JsHint & bundling done'
130164
}
131165
}
132-
}
166+
},
167+
intern: {
168+
all: {
169+
options: {
170+
runType: 'runner',
171+
config: 'tests/intern'
172+
}
173+
},
174+
unit: {
175+
options: {
176+
runType: 'runner',
177+
config: localInternConfig,
178+
functionalSuites: []
179+
}
180+
},
181+
functional: {
182+
options: {
183+
runType: 'runner',
184+
config: localInternConfig,
185+
suites: []
186+
}
187+
}
188+
},
189+
coveralls: {
190+
options: {
191+
force: true // prevent from failing CI build if coveralls is down etc.
192+
},
193+
all: {
194+
src: 'lcov.info',
195+
}
196+
},
197+
todo: {
198+
options: {},
199+
src: ['src/**/*.js'],
200+
tests: ['tests/**/*.js']
201+
},
202+
prompt: {
203+
target: {
204+
options: {
205+
questions: [
206+
{
207+
config: 'github-release.options.release.body',
208+
type: 'input',
209+
message: 'GitHub release body:'
210+
}
211+
]
212+
}
213+
}
214+
},
215+
compress: {
216+
main: {
217+
options: {
218+
archive: 'candy.zip'
219+
},
220+
files: [
221+
{
222+
src: [
223+
'example/**',
224+
'res/**',
225+
'bower.json',
226+
'candy.bundle.js',
227+
'candy.bundle.map',
228+
'candy.min.js',
229+
'candy.min.map',
230+
'CONTRIBUTING.md',
231+
'CREDITS.md',
232+
'libs.bundle.js',
233+
'libs.bundle.map',
234+
'libs.min.js',
235+
'LICENSE',
236+
'package.json',
237+
'README.md',
238+
'res/**',
239+
],
240+
dest: './'
241+
},
242+
]
243+
}
244+
},
245+
'github-release': {
246+
options: {
247+
repository: 'candy-chat/candy',
248+
auth: grunt.file.exists('data.json') ? grunt.file.readJSON('github-credentials.json') : {},
249+
release: {
250+
tag_name: 'v' + grunt.file.readJSON('package.json').version,
251+
name: 'v' + grunt.file.readJSON('package.json').version
252+
}
253+
},
254+
files: {
255+
src: ['candy.zip']
256+
}
257+
},
133258
});
134259

135260
grunt.loadNpmTasks('grunt-contrib-jshint');
136261
grunt.loadNpmTasks('grunt-contrib-uglify');
137262
grunt.loadNpmTasks('grunt-contrib-watch');
138263
grunt.loadNpmTasks('grunt-contrib-clean');
264+
grunt.loadNpmTasks('grunt-contrib-compress');
265+
grunt.loadNpmTasks('grunt-contrib-concat');
266+
grunt.loadNpmTasks('grunt-contrib-cssmin');
267+
grunt.loadNpmTasks('grunt-github-releaser');
268+
grunt.loadNpmTasks('grunt-prompt');
139269
grunt.loadNpmTasks('grunt-natural-docs');
140270
grunt.loadNpmTasks('grunt-mkdir');
141271
grunt.loadNpmTasks('grunt-notify');
142272
grunt.loadNpmTasks('grunt-sync-pkg');
273+
grunt.loadNpmTasks('intern');
274+
grunt.loadNpmTasks('grunt-clear');
275+
grunt.loadNpmTasks('grunt-coveralls');
276+
grunt.loadNpmTasks('grunt-todo');
143277

278+
grunt.registerTask('test', ['intern:all']);
279+
grunt.registerTask('ci', ['todo', 'jshint', 'build', 'intern:all', 'coveralls:all', 'docs']);
280+
grunt.registerTask('build', ['uglify:libs', 'uglify:libs-min', 'uglify:bundle', 'uglify:min', 'concat:css', 'cssmin:css']);
144281
grunt.registerTask('default', [
145-
'jshint', 'uglify:libs', 'uglify:libs-min',
146-
'uglify:bundle', 'uglify:min', 'notify:default'
282+
'jshint', 'build', 'notify:default', 'intern:unit'
147283
]);
148284
grunt.registerTask('docs', ['mkdir:docs', 'natural_docs', 'notify:docs']);
149-
};
285+
grunt.registerTask('release', [
286+
'default',
287+
'prompt',
288+
'compress',
289+
'github-release'
290+
]);
291+
};

Diff for: LICENSE

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Copyright (c) 2011 Amiado Group AG
22
Copyright (c) 2012-2014 Patrick Stadler & Michael Weibel
3+
Copyright (c) 2015 Adhearsion Foundation Inc <[email protected]>
34

45
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
56

0 commit comments

Comments
 (0)