Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking versus the main distribution (WIP) #98

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
bc041ec
Updated grunt-contrib-uglify version to deal with build problems
mnyon-grandkru May 26, 2015
cbd8f88
Fixed firechat development for images
mnyon-grandkru May 26, 2015
275ebd2
Customized for current dev environment
mnyon-grandkru May 26, 2015
894e2dd
Switched Chrome out for PhantomTest
mnyon-grandkru Jun 1, 2015
dae31cf
Added Travis file
mnyon-grandkru Jun 1, 2015
ddfdfd8
initial test
mnyon-grandkru Jun 1, 2015
d684a24
Removed Chrome
mnyon-grandkru Jun 1, 2015
0a74603
Removed Travis instructions
mnyon-grandkru Jun 1, 2015
61a0f24
upload image positioned
mnyon-grandkru Jun 3, 2015
7a0327e
WIP
mnyon-grandkru Jun 3, 2015
756c96d
Changing firepano to fix upload problem
mnyon-grandkru Jun 4, 2015
8701512
Upload assets
mnyon-grandkru Jun 4, 2015
d50f5ca
Fixed file paths
mnyon-grandkru Jun 6, 2015
089d966
Enable CI mode
mnyon-grandkru Jun 6, 2015
9ec5d54
CI single run
mnyon-grandkru Jun 6, 2015
a08b819
Adjusted to work with karma test runner
mnyon-grandkru Jun 6, 2015
1d46680
Working Unit Test
mnyon-grandkru Jun 6, 2015
602efe7
Added spinner library
mnyon-grandkru Jun 6, 2015
10d7104
Added Upload File Event
mnyon-grandkru Jun 12, 2015
d035f4b
Upload working better
mnyon-grandkru Jun 12, 2015
338cdfb
Updated version
mnyon-grandkru Jun 15, 2015
87825af
Added distro
mnyon-grandkru Jun 15, 2015
0a68075
Removed distro for better solution
mnyon-grandkru Jun 15, 2015
0a6031a
Added single spec
mnyon-grandkru Jun 15, 2015
8f6ce44
Removed bad spec
mnyon-grandkru Jun 15, 2015
c5c3cc7
Library Initialize spec
mnyon-grandkru Jun 17, 2015
4d015a7
Image inline fixed
mnyon-grandkru Jun 17, 2015
d8f4f56
Fixed licensing
mnyon-grandkru Jun 17, 2015
2569ca7
Updated karma files with proper firechat.js
mnyon-grandkru Jul 4, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: node_js
node_js:
- "0.12"
script: node_modules/karma/bin/karma start karma.conf.js --single-run
before_script:
- npm install
175 changes: 95 additions & 80 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,96 +1,111 @@
module.exports = function(grunt) {

"use strict";
"use strict";

// Initializes the Grunt tasks with the following settings
grunt.initConfig({
// Initializes the Grunt tasks with the following settings
grunt.initConfig({

// A list of files which will be syntax-checked by JSHint.
jshint: {
files: ['src/js/shims.js', 'src/js/firechat.js', 'src/js/firechat-ui.js'],
options: {
regexdash: false
}
},
// A list of files which will be syntax-checked by JSHint.
jshint: {
files: ['src/js/shims.js', 'src/js/firechat.js', 'src/js/firechat-ui.js'],
options: {
regexdash: false
}
},

// Precompile templates and strip whitespace with 'processContent'.
jst: {
compile: {
options: {
path: 'templates',
namespace: 'FirechatDefaultTemplates',
prettify: true,
processContent: function(src) {
return src.replace(/(^\s+|\s+$)/gm, '');
}
// Precompile templates and strip whitespace with 'processContent'.
jst: {
compile: {
options: {
path: 'templates',
namespace: 'FirechatDefaultTemplates',
prettify: true,
processContent: function(src) {
return src.replace(/(^\s+|\s+$)/gm, '');
}
},
files: {
'compiled/templates.js': ['templates/*.html']
}
}
},
files: {
'compiled/templates.js': ['templates/*.html']
}
}
},

// Compile and minify LESS CSS for production.
less: {
development: {
files: {
"dist/firechat.css": "src/less/styles.less"
}
},
production: {
options: {
yuicompress: true
// Compile and minify LESS CSS for production.
less: {
development: {
files: {
"dist/firechat.css": "src/less/styles.less"
}
},
production: {
options: {
yuicompress: true
},
files: {
"dist/firechat.min.css": "src/less/styles.less"
}
}
},
files: {
"dist/firechat.min.css": "src/less/styles.less"
}
}
},

// Concatenate files in a specific order.
concat: {
js: {
src: [
'src/js/libs/underscore-1.7.0.min.js',
'compiled/templates.js',
'src/js/shims.js',
'src/js/firechat.js',
'src/js/firechat-ui.js'
],
dest: 'dist/firechat.js'
}
},
// Concatenate files in a specific order.
concat: {
js: {
src: [
'src/js/libs/underscore-1.7.0.min.js',
'src/js/libs/spin.min.js',
'compiled/templates.js',
'src/js/shims.js',
'src/js/firechat.js',
'src/js/firechat-ui.js',
'src/js/firepano.js',
'src/js/sha256.js'
],
dest: 'dist/firechat.js'
}
},

// Minify concatenated files.
uglify: {
dist: {
src: ['<%= concat.js.dest %>'],
dest: 'dist/firechat.min.js'
}
},
// Minify concatenated files.
uglify: {
dist: {
src: ['<%= concat.js.dest %>'],
dest: 'dist/firechat.min.js'
}
},

// Clean up temporary files.
clean: ['compiled/'],
// Clean up temporary files.
clean: ['compiled/'],

// Tasks to execute upon file change when using `grunt watch`.
watch: {
src: {
files: ['src/**/*.*', 'templates/**/*.*'],
tasks: ['default']
}
}
});
// Tasks to execute upon file change when using `grunt watch`.
watch: {
src: {
files: ['src/**/*.*', 'templates/**/*.*'],
tasks: ['default']
}
},
copy: {
default: {
files: [{
src: 'dist/firechat.js',
dest: 'website/firechat-latest.js'
}, {
src: 'dist/firechat.css',
dest: 'website/firechat-latest.css'
}]
}
}
});

// Load specific plugins, which have been installed and specified in package.json.
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-jst');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
// Load specific plugins, which have been installed and specified in package.json.
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-jst');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');

// Default task operations if simply calling `grunt` without options.
grunt.registerTask('default', ['jshint', 'jst', 'less', 'concat', 'uglify', 'clean']);
// Default task operations if simply calling `grunt` without options.
grunt.registerTask('default', ['jshint', 'jst', 'less', 'concat', 'uglify', 'clean', 'copy']);

};
Binary file added assets/img/file_upload.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 78 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// Karma configuration
// Generated on Mon Jun 01 2015 09:06:11 GMT-0400 (EDT)

module.exports = function(config) {
config.set({

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',


// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine-jquery','jasmine'],


// list of files / patterns to load in the browser
files: [
{pattern: 'website/index.html'},
'https://cdnjs.cloudflare.com/ajax/libs/spin.js/1.2.7/spin.min.js',
'https://cdn.firebase.com/js/client/2.0.2/firebase-debug.js',
'https://cdn.firebase.com/v0/firebase-token-generator.js',
'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.1/js/bootstrap-modal.min.js',
'website/firechat-latest.js',
'spec/**/*spec.js',
// this file only gets watched and is otherwise ignored
],


// list of files to exclude
exclude: [
],


// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
},


// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],


// web server port
port: 9876,


// enable / disable colors in the output (reporters and logs)
colors: true,


// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_DEBUG,


// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,


// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['PhantomJS'],


// Plugins
plugins: [
'karma-phantomjs-launcher',
'karma-jasmine-jquery',
'karma-jasmine'
],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true
});
};
20 changes: 14 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "firechat",
"description": "Realtime open source chat client powered by Firebase",
"version": "0.0.0",
"version": "2.1.0",
"author": "Firebase <[email protected]> (https://www.firebase.com/)",
"homepage": "https://firechat.firebaseapp.com/",
"repository": {
"type": "git",
"url": "https://github.com/firebase/firechat.git"
"url": "https://github.com/trystant/firechat.git"
},
"bugs": {
"url": "https://github.com/firebase/firechat/issues"
Expand All @@ -27,24 +27,32 @@
],
"main": "dist/firechat.js",
"files": [
"dist/**",
"templates",
"LICENSE",
"README.md",
"package.json"
],
"dependencies": {
"firebase": "2.0.x"
"firebase": "2.0.x",
"firebase-token-generator": "^2.0.0"
},
"devDependencies": {
"grunt": "~0.4.0",
"grunt-cli": "^0.1.13",
"grunt-contrib-clean": "~0.4.1",
"grunt-contrib-concat": "~0.1.1",
"grunt-contrib-copy": "^0.8.0",
"grunt-contrib-jshint": "~0.1.0",
"grunt-contrib-jst": "~0.5.0",
"grunt-contrib-less": "~0.5.0",
"grunt-contrib-uglify": "~0.1.0",
"grunt-contrib-watch": "~0.1.4"
"grunt-contrib-uglify": "~0.9.0",
"grunt-contrib-watch": "~0.1.4",
"jasmine-core": "^2.3.4",
"karma": "^0.12.35",
"karma-jasmine": "^0.3.5",
"karma-jasmine-jquery": "^0.1.1",
"karma-phantomjs-launcher": "^0.2.0",
"phantomjs": "^1.9.17"
},
"scripts": {
"test": "gulp test",
Expand Down
3 changes: 3 additions & 0 deletions rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
}
}
},
"pano": {
".read" : true
},
"room-messages": {
"$roomId": {
// A list of messages by room, viewable by anyone for public rooms, or authorized users for private rooms.
Expand Down
21 changes: 21 additions & 0 deletions spec/Firebase-spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
describe('Loaded Libraries', function() {
var createFirebase = {};
beforeEach(function () {
createFirebase = function() {
return new Firebase('https://brilliant-fire-2797.firebaseio.com');
};
});

it('The Firebase library should be loaded without raising an error', function() {
expect(createFirebase).not.toThrow();
});

it('The Firechat library should be loaded without raising an error', function() {
var firechatRef = createFirebase();
var createFirechat = function() {
return new Firechat(firechatRef);
};
expect(createFirechat).not.toThrow();
});
});

Loading