forked from llaske/sugarizer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Grunt minify task, adapt some source code to support minify
- Loading branch information
llaske
committed
Oct 18, 2016
1 parent
89b1ba4
commit 7905031
Showing
33 changed files
with
333 additions
and
373 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
module.exports = function(grunt) { | ||
|
||
// Project configuration. | ||
grunt.initConfig({ | ||
uglify: { | ||
options: { | ||
banner: '/*! Sugarizer <%= grunt.template.today("yyyy-mm-dd") %> */\n' | ||
}, | ||
dynamic_mappings: { | ||
expand: true, | ||
src: [ | ||
'lib/*.js', | ||
'js/*.js', | ||
'activities/Abecedarium.Activity/**/*.js', | ||
'activities/Calculate.Activity/**/*.js', | ||
'activities/ChatPrototype.Activity/**/*.js', | ||
'activities/Clock.Activity/**/*.js', | ||
'activities/Cordova.Activity/**/*.js', | ||
'activities/Etoys.Activity/**/*.js', | ||
'activities/FoodChain.Activity/**/*.js', | ||
'activities/Gears.Activity/js/*.js', // TODO: lib/gearsketch dont work | ||
'activities/GetThingsDone.Activity/**/*.js', | ||
'activities/Gridpaint.Activity/**/*.js', | ||
'activities/LabyrinthJS.Activity/**/*.js', | ||
'activities/LastOneLoses.Activity/**/*.js', | ||
'activities/Markdown.Activity/**/*.js', | ||
'activities/MazeWeb.Activity/**/*.js', | ||
'activities/MediaViewer.Activity/**/*.js', | ||
'activities/Memorize.Activity/**/*.js', | ||
'activities/Moon.Activity/**/*.js', | ||
'activities/Paint.Activity/**/*.js', | ||
'activities/PhysicsJS.Activity/**/*.js', | ||
'activities/Record.Activity/lib/*.js', // TODO: js/recordrtc.js don't work | ||
'activities/SharedNotes.Activity/**/*.js', | ||
'activities/Speak.Activity/**/*.js', | ||
'activities/Stopwatch.Activity/**/*.js', | ||
'activities/TamTamMicro.Activity/**/*.js', | ||
'activities/TankOp.Activity/**/*.js', | ||
'activities/TurtleBlocksJS.Activity/**/*.js', | ||
'activities/VideoViewer.Activity/**/*.js', | ||
'activities/WelcomeWeb.Activity/**/*.js' | ||
], | ||
dest: 'build/' | ||
} | ||
} | ||
}); | ||
|
||
// Load the plugin that provides the "uglify" task. | ||
grunt.loadNpmTasks('grunt-contrib-uglify'); | ||
|
||
// Default task(s). | ||
grunt.registerTask('default', ['uglify']); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
| ||
|
||
define(function (require) { | ||
Abcd.activity = require("sugar-web/activity/activity"); | ||
define(["sugar-web/activity/activity"], function (activity) { | ||
Abcd.activity = activity; | ||
app = null; | ||
|
||
// Manipulate the DOM only when it is ready. | ||
require(['domReady!'], function (doc) { | ||
// Manipulate the DOM only when it is ready. | ||
require(['domReady!'], function (doc) { | ||
// Initialize the activity | ||
Abcd.activity.setup(); | ||
|
||
// Create sound component | ||
Abcd.sound = new Abcd.Audio(); | ||
Abcd.sound.renderInto(document.getElementById("header")); | ||
|
||
// Create and display first screen | ||
app = new Abcd.App().renderInto(document.getElementById("body")); | ||
|
||
// Load context | ||
Abcd.loadContext(function() { | ||
app.restartLastGame(); | ||
}); | ||
}); | ||
|
||
// Stop sound at end of game to sanitize media environment, specifically on Android | ||
document.getElementById("stop-button").addEventListener('click', function (event) { | ||
// Stop sound at end of game to sanitize media environment, specifically on Android | ||
document.getElementById("stop-button").addEventListener('click', function (event) { | ||
Abcd.sound.pause(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
define(function (require) { | ||
var activity = require("sugar-web/activity/activity"); | ||
define(["sugar-web/activity/activity"], function (activity) { | ||
|
||
// Manipulate the DOM only when it is ready. | ||
require(['domReady!'], function (doc) { | ||
// Manipulate the DOM only when it is ready. | ||
require(['domReady!'], function (doc) { | ||
|
||
// Initialize the activity. | ||
activity.setup(); | ||
// Initialize the activity. | ||
activity.setup(); | ||
|
||
}); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.