Files
roll20-character-sheets-tester/13th Age Glorantha/Gruntfile.js
T
Seraaron 6b1ee183f1 [13th Age Glorantha] New sheet pull request - by Seraaron (#7526)
* Version 1.9 update

* Readme updated with 1.9 Changelog

* Update README.md

fixed typo

* sheet.json updated with new version number

* Version 1.9.1 (hotfixes)

* Create logo_13G.png

Logo for hosting while testing

* First upload of main content for Glorantha sheet

* Delete logo_13G.png~

* Delete bg_paper.jpg~

* Version 1.0

- Final version, ready for public inspection
- All indended features have been added and are functional
- Read the updated README for more info

* Updated readme

Fixed typo

* Update ChangeLog.md

Fixed typo

* Internal patch (v 1.0.1)

- Fixed Chrome compatibility issues (mostly related to number input widths)
- Fixed a few typos and poor attr_ name choices
- Re-ordered the rules & macros section to be more sensible

* Reverting 'legacy' changes

* Reverting burning wheel edits

* Changed version number
2020-10-19 09:36:36 -04:00

105 lines
3.2 KiB
JavaScript

/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
includereplace: {
development: {
options: {
globals: {
'img_prefix': '../img',
'version': '<%= pkg.version %>'
}
},
files: [
{src: 'src/index.html', dest: 'testbed/index.html'},
{src: 'src/13th_Age_Glorantha.css', dest: 'testbed/13th_Age_Glorantha.css'},
{src: 'src/app.css', dest: 'testbed/app.css'},
{src: 'src/base.css', dest: 'testbed/base.css'},
]
},
production: {
options: {
globals: {
img_prefix: 'https://neovatar.github.io/roll20-character-sheets/13th_Age-neovatar/img',
'version': '<%= pkg.version %>'
}
},
files: [
{src: 'src/13th_Age_Glorantha.html', dest: '13th_Age_Glorantha.html'},
{src: 'src/13th_Age_Glorantha.css', dest: '13th_Age_Glorantha.css'},
{src: 'src/sheet.json', dest: 'sheet.json'}
]
}
},
roll20: {
development:'testbed/13th_Age_Glorantha.css',
production:'13th_Age_Glorantha.css'
},
watch: {
development: {
files: ['src/**/*css', 'src/**/*html'],
tasks: ['default'],
options: {
livereload:35728
},
},
},
connect: {
server: {
options: {
port:9001,
base: '.',
livereload:35728,
}
}
}
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-include-replace');
grunt.registerMultiTask('roll20', function () {
var evil = [
/(\bdata:\b|eval|cookie|\bwindow\b|\bparent\b|\bthis\b)/i, // suspicious javascript-type words
/behaviou?r|expression|moz-binding|@import|@charset|(java|vb)?script|[\<]|\\\w/i,
///[\<>]/, // back slash, html tags,
/[\x7f-\xff]/, // high bytes -- suspect
/[\x00-\x08\x0B\x0C\x0E-\x1F]/, //low bytes -- suspect
/&\#/, // bad charset
];
input = grunt.file.read(this.data);
input = input.replace(/\/\*[^\*]+\*\//g, ""); //remove all css comments
for(var i=0; i < evil.length; i++) {
var res = input.match(evil[i]);
if(res) {
grunt.log.error("Roll20 Check: Potential CSS security violation; character sheet template styling thrown out.");
grunt.log.error(res);
input = "";
}
}
if(input!= "")
grunt.log.ok('Roll20 CSS lint Ok!');
else
grunt.fail.warn("Roll 20 CSS lint failed");
});
// Default task.
grunt.registerTask('default', [
'includereplace:development',
'roll20:development'
]);
grunt.registerTask('build', [
'includereplace:production',
'roll20:production'
]);
grunt.registerTask('serve', [
'default',
'connect:server',
'watch'
]);
};