Skip to content
Snippets Groups Projects
Commit c0e316c7 authored by Kevin Hill's avatar Kevin Hill
Browse files

Merge branch 'master' into 3.1

parents 9de4d605 320d58e7
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -95,7 +95,11 @@
"scripts": {
"test": "phpunit -c phpunit.xml",
"cs": "phpcs --standard=PSR2 src tests",
"cbf" : "phpcbf --standard=PSR2 src tests"
"cbf" : "phpcbf --standard=PSR2 src tests",
"lavajs:release" : "gulp --cwd javascript release && git add javascript/dist/lava.js && git commit -m 'Releasing new build of the lava.js module' && git push",
"lavajs:dev" : "gulp --cwd javascript",
"lavajs:pull" : "git subtree --prefix=javascript pull lavajs master",
"lavajs:push" : "git subtree --prefix=javascript push lavajs master"
},
"minimum-stability": "stable"
}
module.exports = function (config) {
config.set({
basePath: '../javascript',
frameworks: [
'jasmine'
],
files: [
'/dist/lava.min.js',
'/tests/lava.spec.js'
],
singleRun: true,
plugins: [
'karma-jasmine',
'karma-phantomjs-launcher'
],
reporters: [
'dots'
],
port: 9876,
colors: true,
logLevel: config.LOG_ERROR,
autoWatch: false,
browsers: ['PhantomJS']
});
};
module.exports = function(config) {
config.set({
basePath: '../javascript',
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: [
'jasmine',
'detectBrowsers'
],
// list of files / patterns to load in the browser
files: [
'/dist/lava.min.js',
'/tests/lava.spec.js'
],
// 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: {
},
//CI Mode
singleRun: true,
plugins: [
'karma-jasmine',
'karma-detect-browsers',
'karma-ie-launcher',
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-phantomjs-launcher'
],
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: [
'dots'
],
// 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_ERROR,
// 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: ['Chrome'],
customLaunchers: {
IE10: {
base: 'IE',
'x-ua-compatible': 'IE=EmulateIE10',
flags: ['-extoff']
},
IE9: {
base: 'IE',
'x-ua-compatible': 'IE=EmulateIE9',
flags: ['-extoff']
},
IE8: {
base: 'IE',
'x-ua-compatible': 'IE=EmulateIE8',
flags: ['-extoff']
}
},
// detectBrowsers Configuration
detectBrowsers: {
// post processing of browsers list
// here you can edit the list of browsers used by karma
postDetection: function(availableBrowser) {
//Add IE Emulation
var result = availableBrowser;
if (availableBrowser.indexOf('IE')>-1) {
result.push('IE8');
result.push('IE9');
result.push('IE10');
}
//Remove PhantomJS if another browser has been detected
if (availableBrowser.length > 1 && availableBrowser.indexOf('PhantomJS')>-1) {
var i = result.indexOf('PhantomJS');
if (i !== -1) {
result.splice(i, 1);
}
}
return result;
}
}
});
};
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="../vendor/autoload.php"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
syntaxCheck="true"
verbose="true"
colors="true"
>
<testsuites>
<testsuite name="core">
<file>../tests/LavachartsTest.php</file>
<file>../tests/VolcanoTest.php</file>
</testsuite>
<testsuite name="charts">
<directory>../tests/Charts/</directory>
</testsuite>
<testsuite name="configs">
<directory>../tests/Configs/</directory>
</testsuite>
<testsuite name="dashboards">
<directory>../tests/Dashboards/</directory>
</testsuite>
<testsuite name="datatables">
<directory>../tests/DataTables/</directory>
</testsuite>
<testsuite name="javascript">
<directory>../tests/Javascript/</directory>
</testsuite>
<testsuite name="values">
<directory>../tests/Values/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>../src/</directory>
</whitelist>
<blacklist>
<directory>../tests/Examples/</directory>
<directory>../vendor/</directory>
<directory>../src/Laravel/</directory>
<directory>../src/Symfony/</directory>
</blacklist>
</filter>
<listeners>
<listener class="\MyBuilder\PhpunitAccelerator\TestListener" />
<listener class="\Mockery\Adapter\Phpunit\TestListener" />
</listeners>
</phpunit>
This diff is collapsed.
Loading
Loading
@@ -11,8 +11,8 @@
},
"dependencies": {
"custom-error-generator": "^7.0.0",
"document-ready": "^1.0.0",
"lodash": "^4.11.1",
"document-ready": "^1.0.3",
"lodash": "^4.17.4",
"q": "^1.4.1"
},
"devDependencies": {
Loading
Loading
Loading
Loading
@@ -7,6 +7,17 @@
(function(){
"use strict";
 
function addEvent (object, type, callback) {
if (object == null || typeof(object) == 'undefined') return;
if (object.addEventListener) {
object.addEventListener(type, callback, false);
} else if (object.attachEvent) {
object.attachEvent("on" + type, callback);
} else {
object["on"+type] = callback;
}
}
var ready = require('document-ready');
 
this.lava = require('./lava/Lava.js');
Loading
Loading
@@ -15,7 +26,7 @@
/**
* Adding the resize event listener for redrawing charts.
*/
window.addEventListener('resize', window.lava.redrawCharts);
addEvent(window, 'resize', window.lava.redrawHandler);
 
/**
* Let's go!
Loading
Loading
Loading
Loading
@@ -278,13 +278,13 @@ module.exports = (function() {
* This method is attached to the window resize event with a 300ms debounce
* to make the charts responsive to the browser resizing.
*/
Lava.prototype.redrawCharts = function() {
_.debounce(_.bind(function () {
this._forEachRenderable(function (renderable) {
renderable.redraw();
});
}, this), 300);
};
Lava.prototype.redrawHandler = _.debounce(function() {
window.lava._forEachRenderable(function (renderable) {
console.log('redrawing '+renderable.uuid());
renderable.redraw();
});
}, 250);
 
/**
* Create a new Chart.
Loading
Loading
@@ -532,7 +532,7 @@ module.exports = (function() {
language: this._getLocale()
};
 
console.log('google loaded with packages', config.packages);
console.log('google loaded with configuration ', config);
 
google.charts.load('current', config);
 
Loading
Loading
Loading
Loading
@@ -56,7 +56,8 @@ class ChartFactory
'SteppedAreaChart',
'TableChart',
'TimelineChart',
'TreeMapChart'
'TreeMapChart',
'WordTreeChart',
];
 
/**
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment