From 566aedd95b19e627b2d24745ed6df5fd88470886 Mon Sep 17 00:00:00 2001 From: awolkers Date: Tue, 16 Dec 2014 13:40:39 +0100 Subject: [PATCH 01/13] updated vender js versions --- bower.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index 6e2cd42..f0c21a5 100644 --- a/bower.json +++ b/bower.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "dependencies": { - "conditioner": "~1.0.0", - "requirejs": "~2.1.11" + "conditioner": "~1.0.1", + "requirejs": "~2.1.15" } } From 56e42b173276c991d4c18da9324d2bb99ea4f28a Mon Sep 17 00:00:00 2001 From: awolkers Date: Wed, 17 Dec 2014 11:58:26 +0100 Subject: [PATCH 02/13] updated grunt-scss-lint, grunt-ftp-deploy tasks --- package.json | 4 ++-- src/static/scss/common/_colors.scss | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 1866654..fc1e4da 100644 --- a/package.json +++ b/package.json @@ -45,8 +45,8 @@ "grunt-contrib-uglify": "^0.5.0", "grunt-contrib-watch": "^0.6.1", "grunt-csso": "^0.6.2", - "grunt-ftp-deploy": "^0.1.1", + "grunt-ftp-deploy": "^0.1.9", "grunt-httpcopy": "^0.3.0", - "grunt-scss-lint": "^0.1.11" + "grunt-scss-lint": "^0.3.4" } } diff --git a/src/static/scss/common/_colors.scss b/src/static/scss/common/_colors.scss index 8b46026..60e373a 100644 --- a/src/static/scss/common/_colors.scss +++ b/src/static/scss/common/_colors.scss @@ -16,5 +16,4 @@ $colors: 'off-black' #333, 'black' #202020, 'muted-text' #909090, - 'line-on-black' #7d7d7d -; + 'line-on-black' #7d7d7d; From 3facccd3c375f6c971c3d2e1e5d760a08e6f0375 Mon Sep 17 00:00:00 2001 From: awolkers Date: Wed, 17 Dec 2014 13:08:40 +0100 Subject: [PATCH 03/13] updated grunt-contrib-watch task --- app/grunt-watcher.js | 8 ++++++-- gruntfile.js | 6 ++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/grunt-watcher.js b/app/grunt-watcher.js index 0255d5c..cf671c0 100644 --- a/app/grunt-watcher.js +++ b/app/grunt-watcher.js @@ -13,16 +13,20 @@ module.exports = gruntWatcher; function gruntWatcher() { // Start grunt watcher (which in turn starts sass watcher and autoprefixer) - var sassProcess = exec('grunt watcher', function(err, stdout, stderr) { + var gruntProcess = exec('grunt watcher', function(err, stdout, stderr) { if (err) { console.log(ansi.red[0], err, stderr, ansi.red[1]); } console.log(stdout); }); + // Output data + gruntProcess.stdout.pipe(process.stdout); + gruntProcess.stderr.pipe(process.stderr); + // Exit watcher when node.js is getting killed process.on('SIGINT', function() { - sassProcess.kill(); + gruntProcess.kill(); process.exit(); }); diff --git a/gruntfile.js b/gruntfile.js index 00bdcfc..54eaa72 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -42,7 +42,8 @@ module.exports = function Gruntfile(grunt) { // jshint ignore:line files: ['src/static/scss/**/*.scss'], tasks: ['sass:dev', 'autoprefixer', 'clean:sass'], options: { - spawn: false + spawn: false, + atBegin: true } } }, @@ -308,9 +309,6 @@ module.exports = function Gruntfile(grunt) { // jshint ignore:line // Watch task. grunt.registerTask('watcher', [ - 'sass:dev', - 'autoprefixer', - 'clean:sass', 'watch' ]); From 3308fc3178a7751162cc0f77c37977eb7bbd5140 Mon Sep 17 00:00:00 2001 From: awolkers Date: Wed, 17 Dec 2014 13:32:34 +0100 Subject: [PATCH 04/13] updated grunt-contrib-uglify uglifier will now preserve all comments that start with a bang (!) or include a closure compiler style directive --- gruntfile.js | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gruntfile.js b/gruntfile.js index 54eaa72..9916c16 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -140,7 +140,8 @@ module.exports = function Gruntfile(grunt) { // jshint ignore:line uglify: { options: { - sourceMap: true + sourceMap: true, + preserveComments: 'some' // preserve copyright notice and stuff like that }, dist: { files: [{ diff --git a/package.json b/package.json index fc1e4da..ecd0f1e 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "grunt-contrib-imagemin": "^0.7.1", "grunt-contrib-jshint": "^0.10.0", "grunt-contrib-sass": "^0.7.2", - "grunt-contrib-uglify": "^0.5.0", + "grunt-contrib-uglify": "^0.6.0", "grunt-contrib-watch": "^0.6.1", "grunt-csso": "^0.6.2", "grunt-ftp-deploy": "^0.1.9", From 585f9c620827803cc01b1d2b3c15f2ee5a2b83e5 Mon Sep 17 00:00:00 2001 From: awolkers Date: Wed, 17 Dec 2014 13:57:08 +0100 Subject: [PATCH 05/13] updated grunt-contrib-sass - don't generate sourcemaps for prod task - only process updated files for dev --- gruntfile.js | 6 ++++-- package.json | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gruntfile.js b/gruntfile.js index 9916c16..b5f322e 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -51,7 +51,8 @@ module.exports = function Gruntfile(grunt) { // jshint ignore:line sass: { dev: { options: { - style: 'expanded' + style: 'expanded', + update: true }, files: [{ expand: true, @@ -64,7 +65,8 @@ module.exports = function Gruntfile(grunt) { // jshint ignore:line prod: { options: { style: 'compressed', - noCache: true + noCache: true, + sourcemap: 'none' }, files: [{ expand: true, diff --git a/package.json b/package.json index ecd0f1e..1f5a1f3 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "grunt-contrib-copy": "^0.5.0", "grunt-contrib-imagemin": "^0.7.1", "grunt-contrib-jshint": "^0.10.0", - "grunt-contrib-sass": "^0.7.2", + "grunt-contrib-sass": "^0.8.1", "grunt-contrib-uglify": "^0.6.0", "grunt-contrib-watch": "^0.6.1", "grunt-csso": "^0.6.2", From 4ad3bc080428f51a577798b365d10056bc07c073 Mon Sep 17 00:00:00 2001 From: awolkers Date: Wed, 17 Dec 2014 14:16:29 +0100 Subject: [PATCH 06/13] updated grunt-contrib-imagemin - added minification of svg files --- gruntfile.js | 9 +++++++-- package.json | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gruntfile.js b/gruntfile.js index b5f322e..89c0aaf 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -128,13 +128,18 @@ module.exports = function Gruntfile(grunt) { // jshint ignore:line imagemin: { options: { - pngquant: true + optimizationLevel: 7, + svgoPlugins: [ + { removeViewBox: false }, // don't remove the viewbox atribute from the SVG + { removeUselessStrokeAndFill: false }, // don't remove Useless Strokes and Fills + { removeEmptyAttrs: false } // don't remove Empty Attributes from the SVG] + ] }, dist: { files: [{ expand: true, cwd: 'src/static/img/', - src: ['**/*.{png,jpg,gif}'], + src: ['**/*.{png,jpg,gif,svg}'], dest: 'build/static/img/' }] } diff --git a/package.json b/package.json index 1f5a1f3..56de1af 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "grunt-contrib-clean": "^0.5.0", "grunt-contrib-compress": "^0.9.1", "grunt-contrib-copy": "^0.5.0", - "grunt-contrib-imagemin": "^0.7.1", + "grunt-contrib-imagemin": "^0.9.2", "grunt-contrib-jshint": "^0.10.0", "grunt-contrib-sass": "^0.8.1", "grunt-contrib-uglify": "^0.6.0", From 4df85579751962a73fa752285f1f6aa73907612e Mon Sep 17 00:00:00 2001 From: awolkers Date: Wed, 17 Dec 2014 14:17:31 +0100 Subject: [PATCH 07/13] updated grunt-contrib-copy --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 56de1af..98dfa5f 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "grunt-autoprefixer": "^0.8.0", "grunt-contrib-clean": "^0.5.0", "grunt-contrib-compress": "^0.9.1", - "grunt-contrib-copy": "^0.5.0", + "grunt-contrib-copy": "^0.7.0", "grunt-contrib-imagemin": "^0.9.2", "grunt-contrib-jshint": "^0.10.0", "grunt-contrib-sass": "^0.8.1", From c218f65363eb585dab44cfa3ddf04cbe7d5d2825 Mon Sep 17 00:00:00 2001 From: awolkers Date: Wed, 17 Dec 2014 14:20:45 +0100 Subject: [PATCH 08/13] updated grunt-contrib-compress --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 98dfa5f..1dd9729 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "grunt": "^0.4.5", "grunt-autoprefixer": "^0.8.0", "grunt-contrib-clean": "^0.5.0", - "grunt-contrib-compress": "^0.9.1", + "grunt-contrib-compress": "^0.12.0", "grunt-contrib-copy": "^0.7.0", "grunt-contrib-imagemin": "^0.9.2", "grunt-contrib-jshint": "^0.10.0", From 3b5d79be2608d81fe169dd02c05be40e7d0dad18 Mon Sep 17 00:00:00 2001 From: awolkers Date: Wed, 17 Dec 2014 14:22:29 +0100 Subject: [PATCH 09/13] updated grunt-contrib-clean --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1dd9729..1552674 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "devDependencies": { "grunt": "^0.4.5", "grunt-autoprefixer": "^0.8.0", - "grunt-contrib-clean": "^0.5.0", + "grunt-contrib-clean": "^0.6.0", "grunt-contrib-compress": "^0.12.0", "grunt-contrib-copy": "^0.7.0", "grunt-contrib-imagemin": "^0.9.2", From f0e435d414171433b5afe5f2d06093d914fcf9e3 Mon Sep 17 00:00:00 2001 From: awolkers Date: Wed, 17 Dec 2014 14:58:27 +0100 Subject: [PATCH 10/13] updated grunt-autoprefixer - sourcemap will be updated if available - do not indent prefixes --- gruntfile.js | 4 +++- package.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gruntfile.js b/gruntfile.js index 89c0aaf..6ce8dd5 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -80,7 +80,9 @@ module.exports = function Gruntfile(grunt) { // jshint ignore:line autoprefixer: { options: { - browsers: config.server.sassBrowsers + browsers: config.server.sassBrowsers, + map: true, + cascade: false }, dist: { expand: true, diff --git a/package.json b/package.json index 1552674..4b1dc3f 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ }, "devDependencies": { "grunt": "^0.4.5", - "grunt-autoprefixer": "^0.8.0", + "grunt-autoprefixer": "^2.0.0", "grunt-contrib-clean": "^0.6.0", "grunt-contrib-compress": "^0.12.0", "grunt-contrib-copy": "^0.7.0", From 4ec1b08a2e862ffe53cf90ca95731ee3f085bdec Mon Sep 17 00:00:00 2001 From: awolkers Date: Wed, 17 Dec 2014 15:03:49 +0100 Subject: [PATCH 11/13] sass will now only process files that are changed instead of all files --- .gitignore | 1 + gruntfile.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 79daa31..4c7eb55 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ npm-debug.log # Cache .sass-cache css +_css *.css.map # IDE's diff --git a/gruntfile.js b/gruntfile.js index 6ce8dd5..6aea1a4 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -40,7 +40,7 @@ module.exports = function Gruntfile(grunt) { // jshint ignore:line watch: { scss: { files: ['src/static/scss/**/*.scss'], - tasks: ['sass:dev', 'autoprefixer', 'clean:sass'], + tasks: ['sass:dev', 'autoprefixer'], options: { spawn: false, atBegin: true @@ -319,6 +319,7 @@ module.exports = function Gruntfile(grunt) { // jshint ignore:line // Watch task. grunt.registerTask('watcher', [ + 'clean:sass', 'watch' ]); From 171c490408083eafd3c10ea2d382b9774583268f Mon Sep 17 00:00:00 2001 From: awolkers Date: Thu, 18 Dec 2014 11:52:39 +0100 Subject: [PATCH 12/13] updated grunt-contrib-imagemin - pngquant: true added again --- gruntfile.js | 1 + 1 file changed, 1 insertion(+) diff --git a/gruntfile.js b/gruntfile.js index 6aea1a4..3d77944 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -130,6 +130,7 @@ module.exports = function Gruntfile(grunt) { // jshint ignore:line imagemin: { options: { + pngquant: true, optimizationLevel: 7, svgoPlugins: [ { removeViewBox: false }, // don't remove the viewbox atribute from the SVG From 281556b679a3f9eb17defd0e74cea7e9bb649e7f Mon Sep 17 00:00:00 2001 From: Bran van der Meer Date: Thu, 19 Feb 2015 13:02:15 +0100 Subject: [PATCH 13/13] Fixed a bug in the js/docs/iframeHeightResizer --- src/static/js/ui/docs/iframeHeightResizer.js | 32 +++++++++++++++----- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/src/static/js/ui/docs/iframeHeightResizer.js b/src/static/js/ui/docs/iframeHeightResizer.js index fa28fcf..89001c0 100644 --- a/src/static/js/ui/docs/iframeHeightResizer.js +++ b/src/static/js/ui/docs/iframeHeightResizer.js @@ -1,20 +1,36 @@ // // Module: Quick Reference Card // -define(function iframeHeightResizer() { +define(function() { 'use strict'; - function resizeIframeHeight(iframe) { - iframe.style.height = iframe.contentDocument.body.scrollHeight + 10 + 'px'; + /** + * @constructor + */ + function iframeHeightResizer(elem) { + this.iframe = elem; + this.bindOnLoad(); + this.onLoad(); } - return function(iframe) { - - iframe.contentWindow.addEventListener('load', resizeIframeHeight); + /** + * Bind events + */ + iframeHeightResizer.prototype.bindOnLoad = function() { + document.addEventListener('readystatechange', this.onLoad.bind(this)); + }; - // Load event already fired? Run now + /** + * Event handler + */ + iframeHeightResizer.prototype.onLoad = function() { if (document.readyState === 'complete') { - resizeIframeHeight(iframe); + this.iframe.style.height = this.iframe.contentDocument.body.scrollHeight + 10 + 'px'; } }; + + /** + * Expose constructor + */ + return iframeHeightResizer; });