Merge commit '2247a361c29df03b137b5bdd7b94a646a6db04d8'
This commit is contained in:
commit
41f1b5c42a
11
.travis.yml
Normal file
11
.travis.yml
Normal file
|
@ -0,0 +1,11 @@
|
|||
language: node_js
|
||||
|
||||
before_script:
|
||||
- npm install -g grunt-cli
|
||||
- npm install -g bower
|
||||
- bower install
|
||||
- npm install
|
||||
|
||||
script:
|
||||
- npm run build
|
||||
- npm test
|
|
@ -2,6 +2,7 @@ gridstack.js
|
|||
============
|
||||
|
||||
[![Build Status](https://travis-ci.org/troolee/gridstack.js.svg?branch=master)](https://travis-ci.org/troolee/gridstack.js)
|
||||
[![Coverage Status](https://coveralls.io/repos/github/troolee/gridstack.js/badge.svg?branch=master)](https://coveralls.io/github/troolee/gridstack.js?branch=master)
|
||||
|
||||
gridstack.js is a jQuery plugin for widget layout. This is drag-and-drop multi-column grid. It allows you to build
|
||||
draggable responsive bootstrap v3 friendly layouts. It also works great with [knockout.js](http://knockoutjs.com), [angular.js](https://angularjs.org) and touch devices.
|
||||
|
|
|
@ -2,73 +2,78 @@
|
|||
// Generated on Thu Feb 18 2016 22:00:23 GMT+0100 (CET)
|
||||
|
||||
module.exports = function(config) {
|
||||
config.set({
|
||||
config.set({
|
||||
|
||||
// base path that will be used to resolve all patterns (eg. files, exclude)
|
||||
basePath: '',
|
||||
// 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'],
|
||||
// frameworks to use
|
||||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
|
||||
frameworks: ['jasmine'],
|
||||
|
||||
|
||||
// list of files / patterns to load in the browser
|
||||
files: [
|
||||
'bower_components/jquery/dist/jquery.min.js',
|
||||
'bower_components/jquery-ui/jquery-ui.min.js',
|
||||
'bower_components/lodash/dist/lodash.min.js',
|
||||
'src/gridstack.js',
|
||||
'spec/*-spec.js'
|
||||
],
|
||||
// list of files / patterns to load in the browser
|
||||
files: [
|
||||
'bower_components/jquery/dist/jquery.min.js',
|
||||
'bower_components/jquery-ui/jquery-ui.min.js',
|
||||
'bower_components/lodash/dist/lodash.min.js',
|
||||
'src/gridstack.js',
|
||||
'spec/*-spec.js'
|
||||
],
|
||||
|
||||
|
||||
// list of files to exclude
|
||||
exclude: [
|
||||
],
|
||||
// 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: {
|
||||
'src/gridstack.js': ['coverage']
|
||||
},
|
||||
// preprocess matching files before serving them to the browser
|
||||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
||||
preprocessors: {
|
||||
'src/gridstack.js': ['coverage']
|
||||
},
|
||||
|
||||
|
||||
// test results reporter to use
|
||||
// possible values: 'dots', 'progress'
|
||||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
||||
reporters: ['progress', 'coverage'],
|
||||
// test results reporter to use
|
||||
// possible values: 'dots', 'progress'
|
||||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
||||
reporters: ['progress', 'coverage', 'coveralls'],
|
||||
|
||||
coverageReporter: {
|
||||
type: 'lcov', // lcov or lcovonly are required for generating lcov.info files
|
||||
dir: 'coverage/'
|
||||
},
|
||||
|
||||
// web server port
|
||||
port: 9876,
|
||||
|
||||
|
||||
// web server port
|
||||
port: 9876,
|
||||
// enable / disable colors in the output (reporters and logs)
|
||||
colors: true,
|
||||
|
||||
|
||||
// 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_INFO,
|
||||
|
||||
|
||||
// level of logging
|
||||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
||||
logLevel: config.LOG_INFO,
|
||||
// enable / disable watching file and executing tests whenever any file changes
|
||||
autoWatch: true,
|
||||
|
||||
|
||||
// enable / disable watching file and executing tests whenever any file changes
|
||||
autoWatch: true,
|
||||
// start these browsers
|
||||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
|
||||
browsers: ['PhantomJS'],
|
||||
|
||||
|
||||
// start these browsers
|
||||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
|
||||
browsers: ['PhantomJS'],
|
||||
// Continuous Integration mode
|
||||
// if true, Karma captures browsers, runs the tests and exits
|
||||
singleRun: true,
|
||||
|
||||
|
||||
// Continuous Integration mode
|
||||
// if true, Karma captures browsers, runs the tests and exits
|
||||
singleRun: false,
|
||||
|
||||
// Concurrency level
|
||||
// how many browser should be started simultaneous
|
||||
concurrency: Infinity
|
||||
})
|
||||
// Concurrency level
|
||||
// how many browser should be started simultaneous
|
||||
concurrency: Infinity
|
||||
});
|
||||
}
|
||||
|
|
12
package.json
12
package.json
|
@ -7,6 +7,10 @@
|
|||
"type": "git",
|
||||
"url": "git+https://github.com/troolee/gridstack.js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "grunt",
|
||||
"test": "karma start karma.conf.js"
|
||||
},
|
||||
"keywords": [
|
||||
"gridstack",
|
||||
"grid",
|
||||
|
@ -21,21 +25,23 @@
|
|||
},
|
||||
"homepage": "http://troolee.github.io/gridstack.js/",
|
||||
"devDependencies": {
|
||||
"coveralls": "^2.11.6",
|
||||
"grunt": "^0.4.5",
|
||||
"grunt-contrib-copy": "^0.8.2",
|
||||
"grunt-contrib-cssmin": "^0.14.0",
|
||||
"grunt-contrib-jshint": "^1.0.0",
|
||||
"grunt-contrib-uglify": "^0.10.1",
|
||||
"grunt-contrib-watch": "^0.6.1",
|
||||
"grunt-doctoc": "^0.1.1",
|
||||
"grunt-jscs": "^2.7.0",
|
||||
"grunt-sass": "^1.1.0",
|
||||
"jasmine-core": "^2.4.1",
|
||||
"karma": "^0.13.21",
|
||||
"karma-coverage": "^0.5.3",
|
||||
"karma-coveralls": "^1.1.2",
|
||||
"karma-jasmine": "^0.3.7",
|
||||
"karma-phantomjs-launcher": "^1.0.0",
|
||||
"phantomjs": "^2.1.3",
|
||||
"phantomjs-prebuilt": "^2.1.4",
|
||||
"grunt-contrib-watch": "^0.6.1",
|
||||
"grunt-jscs": "^2.7.0"
|
||||
"phantomjs-prebuilt": "^2.1.4"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,16 +73,16 @@ describe('gridstack', function() {
|
|||
|
||||
it('should sort ascending without width.', function() {
|
||||
w.width = false;
|
||||
w.nodes = [{x: 7, y: 0}, {x: 4, y: 4}, {x: 9, y: 0}, {x: 0, y: 1}];
|
||||
w.nodes = [{x: 7, y: 0, width: 1}, {x: 4, y: 4, width: 1}, {x: 9, y: 0, width: 1}, {x: 0, y: 1, width: 1}];
|
||||
e.prototype._sortNodes.call(w, 1);
|
||||
expect(w.nodes).toEqual([{x: 0, y: 1}, {x: 7, y: 0}, {x: 4, y: 4}, {x: 9, y: 0}]);
|
||||
expect(w.nodes).toEqual([{x: 7, y: 0, width: 1}, {x: 9, y: 0, width: 1}, {x: 0, y: 1, width: 1}, {x: 4, y: 4, width: 1}]);
|
||||
});
|
||||
|
||||
it('should sort descending without width.', function() {
|
||||
w.width = false;
|
||||
w.nodes = [{x: 7, y: 0}, {x: 4, y: 4}, {x: 9, y: 0}, {x: 0, y: 1}];
|
||||
w.nodes = [{x: 7, y: 0, width: 1}, {x: 4, y: 4, width: 1}, {x: 9, y: 0, width: 1}, {x: 0, y: 1, width: 1}];
|
||||
e.prototype._sortNodes.call(w, -1);
|
||||
expect(w.nodes).toEqual([{x: 9, y: 0}, {x: 4, y: 4}, {x: 7, y: 0}, {x: 0, y: 1}]);
|
||||
expect(w.nodes).toEqual([{x: 4, y: 4, width: 1}, {x: 0, y: 1, width: 1}, {x: 9, y: 0, width: 1}, {x: 7, y: 0, width: 1}]);
|
||||
});
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue