Commit d7a60daf authored by Kjetil Thuen's avatar Kjetil Thuen

Initial commit. Simple skeleton

parents
*.sublime-*
*_template.js
.*.swp
.*.swo
.settings-*
coverage.html
bower_components
node_modules
tags
www/js/
www/css/
www/images
www/favicon.ico
tmp
buildtmp
jslint.xml
xunit.xml
/*global module, require */
module.exports = function(grunt) {
// Load libs
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-jslint');
grunt.loadNpmTasks('grunt-bump');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-connect-proxy');
grunt.loadNpmTasks('grunt-notify');
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-extend');
// Setup
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
extend: {
options: {
defaults: {
restServerURL: "/touch/skole/restdata",
debug: true,
clearTextCache: true,
nonETagCacheTimeoutInDays: 1
}
},
production: {
options: {
defaults: {
restServerURL: "/touch/skole/restdata",
debug: false,
clearTextCache: false,
nonETagCacheTimeoutInDays: 14
}
},
files: {
'tmp/config/settings.json': ['.settings-overrides.json']
}
},
development: {
files: {
'tmp/config/settings.json': ['.settings-overrides.json']
}
}
},
copy: {
settings: {
cwd: 'tmp/config/',
expand: true,
src: ['**/*.json'],
dest: 'www/js/config/'
},
},
sass: {
dist: {
options: {
includePaths: ['src/styles/']
},
files: {
'www/css/main.css': 'src/styles/main.scss'
}
}
},
jshint: {
files: [
'gruntfile.js',
'src/**/*.js',
'test/**/*.js'
],
options: {
globals: {
console: true
},
undef: true,
//unused: true
}
},
jslint: {
default: {
src: [
'src/**/*.js',
'test/**/*.js'
]
},
ci: {
src: [
'src/**/*.js',
'test/**/*.js'
],
options: {
failOnError: false,
checkstyle: 'jslint.xml',
}
}
},
clean: {
build: ['buildtmp', 'tmp', 'www/css', 'www/js', 'www/images', 'jslint.xml', 'xunit.xml']
},
bump: {
options: {
files: ['package.json', 'bower.json'],
pushTo: 'origin',
commitFiles: ['package.json', 'bower.json']
}
},
watch: {
//Install browser extension to get watch to trigger automatic
//browser reload: http://goo.gl/o7SBk
options: {
livereload: true
},
scripts: {
files: ['src/**/*.js', 'bower.json'],
tasks: ['default'],
options: {
atBegin: true
}
},
stylesheets: {
files: ['src/styles/**'],
tasks: ['sass']
},
tests: {
files: ['test/**'],
tasks: ['test']
},
files: {
files: ['www/index.html'],
//Just reload in browser
}
},
connect: {
server: {
options: {
port: 9001,
base: 'www',
middleware: function (connect, options) {
var config = [
// Serve static files.
connect.static(options.base),
// Make empty directories browsable.
connect.directory(options.base)
];
proxy = require('grunt-connect-proxy/lib/utils').proxyRequest;
config.unshift(proxy);
return config;
}
}
},
test: {
options: {
port: 9002,
base: '.'
}
},
proxies: [
//Proxy urls starting with /touch to nesstar-dev to prevent
//same-origin problems when talking to rest server.
{
context: '/touch',
host: 'nesstar-dev.nsd.uib.no',
port: 80,
https: false,
changeOrigin: false,
xforward: false
}
]
}
});
grunt.registerTask('lint', [
'jslint:default'
]);
grunt.registerTask('build', [
'sass',
'copy'
]);
grunt.registerTask('server', [
'configureProxies',
'connect:server',
'watch'
]);
grunt.registerTask('default', [
'extend:development',
'build',
'lint'
]);
};
{
"name": "Timebars",
"version": "0.0.1",
"description": "Animated barcharts",
"devDependencies": {
"grunt": "0.4.x",
"grunt-contrib-copy": "0.4.x",
"grunt-bower-task": "0.3.x",
"grunt-contrib-jshint": "0.6.x",
"grunt-jslint": "1.0.x",
"grunt-contrib-clean": "0.5.x",
"grunt-bump": "~0.0.0",
"grunt-contrib-watch": "0.5.x",
"grunt-contrib-connect": "0.3.x",
"grunt-notify": "0.2.x",
"grunt-sass": "0.6.0",
"grunt-connect-proxy": "~0.1.6",
"grunt-extend": "~0.4.2"
}
}
<!DOCTYPE html>
<html>
<head>
<title>NSD Touch</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.0/css/font-awesome.min.css" rel="stylesheet">
<link href="css/main.css" rel="stylesheet">
<script data-main="js/app/index.js" src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.8/require.min.js"></script>
</head>
<body>
<nav id="header" class="navbar navbar-default navbar-fixed-top" role="navigation"></nav>
<section id="content">
<div id="chart"></div>
</section>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment