diff --git a/Gruntfile.js b/Gruntfile.js index cd453635..d2461cbf 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -11,6 +11,25 @@ */ module.exports = function(grunt) { + + var piskelScripts = require('./piskel-script-list.js').scripts; + var getGhostConfig = function (delay) { + return { + filesSrc : ['tests/integration/casperjs/*_test.js'], + options : { + args : { + baseUrl : 'http://localhost:' + '<%= connect.www.options.port %>/', + mode : '?debug', + delay : delay + }, + direct : false, + logLevel : 'info', + printCommand : false, + printFilePaths : true + } + }; + }; + grunt.initConfig({ jshint: { /*options: { @@ -38,30 +57,20 @@ module.exports = function(grunt) { www : { options : { base : '.', - port : 4545 + port : 7357 } } }, ghost : { - dist : { - filesSrc : ['tests/integration/casperjs/*_test.js'], - options : { - args : { - baseUrl : 'http://localhost:' + '<%= connect.www.options.port %>/' - }, - direct : false, - logLevel : 'debug', - printCommand : false, - printFilePaths : true - } - } + default : getGhostConfig(3000), + local : getGhostConfig(50) }, concat : { options : { separator : ';', }, dist : { - src : require('./script-load-list.js').scripts, + src : piskelScripts, dest : 'build/piskel-packaged.js', }, }, @@ -93,7 +102,8 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-leading-indent'); grunt.registerTask('lint', ['leadingIndent:jsFiles', 'leadingIndent:cssFiles', 'jshint']); - grunt.registerTask('test', ['leadingIndent:jsFiles', 'leadingIndent:cssFiles', 'jshint', 'connect', 'ghost']); + grunt.registerTask('test', ['leadingIndent:jsFiles', 'leadingIndent:cssFiles', 'jshint', 'connect', 'ghost:default']); + grunt.registerTask('precommit', ['leadingIndent:jsFiles', 'leadingIndent:cssFiles', 'jshint', 'connect', 'ghost:local']); grunt.registerTask('default', ['jshint', 'concat', 'uglify']); }; diff --git a/cheap-partials.js b/cheap-partials.js new file mode 100644 index 00000000..0b4dae45 --- /dev/null +++ b/cheap-partials.js @@ -0,0 +1,7 @@ +// SUPER CHEAP TEMPLATES ! +window._ctl = function (event) { + var iframe=event.target || event.srcElement, div=document.createElement("div"); + div.innerHTML = iframe.contentWindow.document.body.innerHTML; + if (div.children.length == 1) div = div.children[0]; + iframe.parentNode.replaceChild(div, iframe); +}; \ No newline at end of file diff --git a/index.html b/index.html index e453d74c..cbf0d05e 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,6 @@
-