Skip to content

Commit

Permalink
Basic level reader
Browse files Browse the repository at this point in the history
  • Loading branch information
kristoffer-tvera committed Apr 14, 2018
1 parent f903497 commit 05faf2e
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@
/node_modules/*
/css/*.css
css/

js/site\.js

js/site\.min\.js
5 changes: 5 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
"kind": "build",
"isDefault": true
}
},
{
"type": "grunt",
"task": "js_compile",
"problemMatcher": []
}
]
}
12 changes: 12 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ module.exports = function (grunt) {
dist: {
// the files to concatenate
src: [
"js/main.js",
"js/plugins.js",
"js/partial/one.js",
"js/partial/two.js",
],
Expand Down Expand Up @@ -128,6 +130,14 @@ module.exports = function (grunt) {
interrupt: false,
spawn: false,
},
},
js: {
files: ['js/**/*'],
tasks: ['js_compile'],
options: {
interrupt: false,
spawn: false,
},
}
},

Expand All @@ -140,6 +150,7 @@ module.exports = function (grunt) {
},
monitor: {
tasks: ["sass_compile", "watch:sass",
"js_compile", "watch:js",
"notify:watching", 'server']
},
},
Expand Down Expand Up @@ -205,6 +216,7 @@ module.exports = function (grunt) {
]
);

grunt.registerTask('js_compile', ['concat:dist', 'uglify:dist']);
grunt.registerTask('sass_compile', ['sass:expanded', 'sass:min', 'notify:sass_compile']);
grunt.registerTask('server', ['browserSync', 'notify:server']);
grunt.registerTask('monitor', ["concurrent:monitor"]);
Expand Down
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
</div>
</nav>
<p>Hi memesters</p>
<textarea name="debug" id="levelDropZone" cols="30" rows="60" style="height:20rem"></textarea>
<input type="submit" id="levelParseStart">
<i class="material-icons">add</i>
<script src="js/vendor/modernizr-3.5.0.min.js"></script>
<script src="js/vendor/materialize.min.js"></script>
Expand Down
7 changes: 7 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var level;
document.getElementById('levelParseStart').addEventListener('click', function (e) {
level = JSON.parse(
document.getElementById('levelDropZone').value
);
console.log(level);
})
1 change: 0 additions & 1 deletion js/partial/one.js
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
console.log('one');
1 change: 0 additions & 1 deletion js/partial/two.js
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
console.log('two');
5 changes: 3 additions & 2 deletions js/plugins.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

// Avoid `console` errors in browsers that lack a console.
(function() {
(function () {
var method;
var noop = function () {};
var noop = function () { };
var methods = [
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
Expand Down
1 change: 0 additions & 1 deletion js/site.js

This file was deleted.

1 change: 0 additions & 1 deletion js/site.min.js

This file was deleted.

0 comments on commit 05faf2e

Please sign in to comment.