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

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
leif81 committed Feb 9, 2016
2 parents 6d9a858 + d99ca34 commit ce6759a
Show file tree
Hide file tree
Showing 73 changed files with 8,138 additions and 14,988 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# EditorConfig is awesome: http://EditorConfig.org

root = true

[*]
end_of_line = lf
insert_final_newline = true
indent_style = tab
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
res/notify.m4a binary
res/notify.ogg binary
res/notify.mp3 binary
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,14 @@ example/.htaccess
.idea
.ndproj/Data
.ndproj/Menu.txt
node_modules
node_modules
bower_components
candy.bundle.*
candy.min.*
libs.bundle.*
libs.min.*
.vagrant
*.log
lcov.info
candy.zip
github-credentials.json
12 changes: 0 additions & 12 deletions .gitmodules

This file was deleted.

6 changes: 4 additions & 2 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@
"undef": true,
"unused": true,
"trailing": true,
"maxdepth": 4
}
"maxdepth": 5,
"laxcomma": true,
"browser": true
}
21 changes: 21 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
language: node_js
node_js:
- '0.10'
env:
global:
- SAUCE_USERNAME: candy-chat-ci
- SAUCE_ACCESS_KEY: 6c3e7f58-b230-4b91-8bcb-290cf28c1457
- CANDY_VAGRANT: false
before_script:
- sudo apt-get update
- sudo apt-get install -y nginx
- sudo mkdir -p /usr/share/nginx/html
- sudo cp ${TRAVIS_BUILD_DIR}/devbox/nginx-default.conf /etc/nginx/sites-available/default
- sudo sed --in-place 's|{{ROOT_DIR}}|'"$TRAVIS_BUILD_DIR"'|g' /etc/nginx/sites-available/default
- sudo /etc/init.d/nginx restart
- sudo apt-get install -y naturaldocs
- npm install -g grunt-cli bower
- npm install
- bower install
script:
- grunt ci
32 changes: 21 additions & 11 deletions CONTRIBUTING.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

## Learn & listen

[![Gitter chat](https://badges.gitter.im/candy-chat.png)](https://gitter.im/candy-chat)

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

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

In case you have any questions, don't hesitate to ask on the [Mailing list](http://groups.google.com/group/candy-chat).

### Running tests

* Tests are run using [Intern](http://theintern.io).
* `grunt` and `grunt watch` will each run unit tests in Chrome on Linux (for fast feedback).
* `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`.
* If you don't want to use the Vagrant box to run Selenium/PhantomJS, set `CANDY_VAGRANT='false'` to run tests.
186 changes: 164 additions & 22 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
'use strict';

var localInternConfig = process.env.CANDY_VAGRANT === 'false' ? 'tests/intern.local' : 'tests/intern.vagrant';

module.exports = function(grunt) {

// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

jshint: {
all: ['Gruntfile.js', './src/**/*.js'],
all: ['Gruntfile.js', './src/**/*.js', './tests/**/*.js'],
options: {
jshintrc: "./.jshintrc",
reporter: require('jshint-stylish')
Expand All @@ -30,8 +31,11 @@ module.exports = function(grunt) {
'src/candy.js', 'src/core.js', 'src/view.js',
'src/util.js', 'src/core/action.js',
'src/core/chatRoom.js', 'src/core/chatRoster.js',
'src/core/chatUser.js', 'src/core/event.js',
'src/view/observer.js', 'src/view/pane.js',
'src/core/chatUser.js', 'src/core/contact.js',
'src/core/event.js', 'src/view/observer.js',
'src/view/pane/chat.js', 'src/view/pane/message.js',
'src/view/pane/privateRoom.js', 'src/view/pane/room.js',
'src/view/pane/roster.js', 'src/view/pane/window.js',
'src/view/template.js', 'src/view/translation.js'
]
},
Expand All @@ -53,14 +57,15 @@ module.exports = function(grunt) {
},
libs: {
files: {
'libs/libs.bundle.js': [
'libs/strophejs/strophe.js',
'libs/strophejs-plugins/muc/strophe.muc.js',
'libs/strophejs-plugins/disco/strophe.disco.js',
'libs/strophejs-plugins/caps/strophe.caps.jsonly.js',
'libs/mustache.js/mustache.js',
'libs/jquery-i18n/jquery.i18n.js',
'libs/dateformat/dateFormat.js'
'libs.bundle.js': [
'bower_components/strophe/strophe.js',
'bower_components/strophejs-plugins/muc/strophe.muc.js',
'bower_components/strophejs-plugins/roster/strophe.roster.js',
'bower_components/strophejs-plugins/disco/strophe.disco.js',
'bower_components/strophejs-plugins/caps/strophe.caps.jsonly.js',
'bower_components/mustache/mustache.js',
'bower_components/jquery-i18n/jquery.i18n.js',
'vendor_libs/dateformat/dateFormat.js'
]
},
options: {
Expand All @@ -73,23 +78,52 @@ module.exports = function(grunt) {
},
'libs-min': {
files: {
'libs/libs.min.js': ['libs/libs.bundle.js']
'libs.min.js': ['libs.bundle.js']
}
}
},
concat: {
css:{
src: [
'bower_components/bootstrap/dist/css/bootstrap.css'
],
dest: 'libs.bundle.css'
}
},
cssmin: {
css:{
src: 'libs.bundle.css',
dest: 'libs.min.css'
}
},
watch: {
clear: {
files: ['src/*.js', 'src/**/*.js', 'tests/**/*.js'],
tasks: ['clear']
},
grunt: {
files: ['Gruntfile.js']
},
bundle: {
files: ['src/*.js', 'src/**/*.js'],
tasks: ['jshint', 'uglify:bundle', 'uglify:min', 'notify:bundle']
files: ['src/**/*.js'],
tasks: ['todo:src', 'jshint', 'uglify:bundle', 'uglify:min', 'notify:bundle', 'intern:unit']
},
libs: {
files: ['libs/*/**/*.js'],
files: ['bower_components/*/**/*.js', 'vendor_libs/*/**/*.js'],
tasks: ['uglify:libs', 'uglify:libs-min', 'notify:libs']
},
tests: {
files: ['tests/candy/unit/**/*.js'],
tasks: ['todo:tests', 'jshint', 'intern:unit']
},
functional_tests: {
files: ['tests/candy/functional/**/*.js'],
tasks: ['todo:tests', 'jshint', 'intern:functional']
}
},
natural_docs: {
all: {
bin: process.env.NATURALDOCS_DIR + '/NaturalDocs',
bin: process.env.NATURALDOCS_DIR ? process.env.NATURALDOCS_DIR + '/NaturalDocs' : 'naturaldocs',
flags: ['-r'],
inputs: ['./src'],
output: './docs',
Expand All @@ -98,7 +132,7 @@ module.exports = function(grunt) {
},
clean: {
bundle: ['./candy.bundle.js', './candy.bundle.map', './candy.min.js'],
libs: ['./libs/libs.bundle.js', './libs/libs.bundle.map', './libs/libs.min.js'],
libs: ['./libs.bundle.js', './libs.bundle.map', './libs.min.js'],
docs: ['./docs']
},
mkdir: {
Expand Down Expand Up @@ -129,21 +163,129 @@ module.exports = function(grunt) {
message: 'JsHint & bundling done'
}
}
}
},
intern: {
all: {
options: {
runType: 'runner',
config: 'tests/intern'
}
},
unit: {
options: {
runType: 'runner',
config: localInternConfig,
functionalSuites: []
}
},
functional: {
options: {
runType: 'runner',
config: localInternConfig,
suites: []
}
}
},
coveralls: {
options: {
force: true // prevent from failing CI build if coveralls is down etc.
},
all: {
src: 'lcov.info',
}
},
todo: {
options: {},
src: ['src/**/*.js'],
tests: ['tests/**/*.js']
},
prompt: {
target: {
options: {
questions: [
{
config: 'github-release.options.release.body',
type: 'input',
message: 'GitHub release body:'
}
]
}
}
},
compress: {
main: {
options: {
archive: 'candy.zip'
},
files: [
{
src: [
'example/**',
'res/**',
'bower.json',
'candy.bundle.js',
'candy.bundle.map',
'candy.min.js',
'candy.min.map',
'CONTRIBUTING.md',
'CREDITS.md',
'libs.bundle.js',
'libs.bundle.map',
'libs.min.js',
'LICENSE',
'package.json',
'README.md',
'res/**',
],
dest: './'
},
]
}
},
'github-release': {
options: {
repository: 'candy-chat/candy',
auth: grunt.file.exists('data.json') ? grunt.file.readJSON('github-credentials.json') : {},
release: {
tag_name: 'v' + grunt.file.readJSON('package.json').version,
name: 'v' + grunt.file.readJSON('package.json').version
}
},
files: {
src: ['candy.zip']
}
},
});

grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-github-releaser');
grunt.loadNpmTasks('grunt-prompt');
grunt.loadNpmTasks('grunt-natural-docs');
grunt.loadNpmTasks('grunt-mkdir');
grunt.loadNpmTasks('grunt-notify');
grunt.loadNpmTasks('grunt-sync-pkg');
grunt.loadNpmTasks('intern');
grunt.loadNpmTasks('grunt-clear');
grunt.loadNpmTasks('grunt-coveralls');
grunt.loadNpmTasks('grunt-todo');

grunt.registerTask('test', ['intern:all']);
grunt.registerTask('ci', ['todo', 'jshint', 'build', 'intern:all', 'coveralls:all', 'docs']);
grunt.registerTask('build', ['uglify:libs', 'uglify:libs-min', 'uglify:bundle', 'uglify:min', 'concat:css', 'cssmin:css']);
grunt.registerTask('default', [
'jshint', 'uglify:libs', 'uglify:libs-min',
'uglify:bundle', 'uglify:min', 'notify:default'
'jshint', 'build', 'notify:default', 'intern:unit'
]);
grunt.registerTask('docs', ['mkdir:docs', 'natural_docs', 'notify:docs']);
};
grunt.registerTask('release', [
'default',
'prompt',
'compress',
'github-release'
]);
};
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Copyright (c) 2011 Amiado Group AG
Copyright (c) 2012-2014 Patrick Stadler & Michael Weibel
Copyright (c) 2015 Adhearsion Foundation Inc <[email protected]>

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:

Expand Down
Loading

0 comments on commit ce6759a

Please sign in to comment.