Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ npm-debug.log
# Cache
.sass-cache
css
_css
*.css.map

# IDE's
Expand Down
8 changes: 6 additions & 2 deletions app/grunt-watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});

Expand Down
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
30 changes: 20 additions & 10 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,19 @@ 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
spawn: false,
atBegin: true
}
}
},

sass: {
dev: {
options: {
style: 'expanded'
style: 'expanded',
update: true
},
files: [{
expand: true,
Expand All @@ -63,7 +65,8 @@ module.exports = function Gruntfile(grunt) { // jshint ignore:line
prod: {
options: {
style: 'compressed',
noCache: true
noCache: true,
sourcemap: 'none'
},
files: [{
expand: true,
Expand All @@ -77,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,
Expand Down Expand Up @@ -125,21 +130,28 @@ module.exports = function Gruntfile(grunt) { // jshint ignore:line

imagemin: {
options: {
pngquant: true
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/'
}]
}
},

uglify: {
options: {
sourceMap: true
sourceMap: true,
preserveComments: 'some' // preserve copyright notice and stuff like that
},
dist: {
files: [{
Expand Down Expand Up @@ -308,8 +320,6 @@ module.exports = function Gruntfile(grunt) { // jshint ignore:line

// Watch task.
grunt.registerTask('watcher', [
'sass:dev',
'autoprefixer',
'clean:sass',
'watch'
]);
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@
},
"devDependencies": {
"grunt": "^0.4.5",
"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-imagemin": "^0.7.1",
"grunt-autoprefixer": "^2.0.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",
"grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-sass": "^0.7.2",
"grunt-contrib-uglify": "^0.5.0",
"grunt-contrib-sass": "^0.8.1",
"grunt-contrib-uglify": "^0.6.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"
}
}
32 changes: 24 additions & 8 deletions src/static/js/ui/docs/iframeHeightResizer.js
Original file line number Diff line number Diff line change
@@ -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;
});
3 changes: 1 addition & 2 deletions src/static/scss/common/_colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ $colors:
'off-black' #333,
'black' #202020,
'muted-text' #909090,
'line-on-black' #7d7d7d
;
'line-on-black' #7d7d7d;