Skip to content

Commit cd134c6

Browse files
author
Matt Karl
committed
TemplateModule validation against user selection
* Simplified the default template * Task Runner CSS tweaks
1 parent b23113e commit cd134c6

File tree

17 files changed

+267
-231
lines changed

17 files changed

+267
-231
lines changed

deploy/assets/html/tasks.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
<div id="task_item_<%=tasks[i].name%>" class="tasks-item row JS-Task-Toggle-Info" title="<%=tasks[i].info%>">
44
<div class="tasks-actions btn-group pull-right">
55
<button
6-
class="btn btn-default run JS-Task-Run"
6+
class="btn btn-sm btn-default run JS-Task-Run"
77
data-task-name="<%=tasks[i].name%>"
88
title="Run">
99
<span class="play glyphicon glyphicon-play"></span>
1010
<span class="stop glyphicon glyphicon-stop"></span>
1111
</button>
1212
<button
13-
class="btn btn-default terminal JS-Task-Terminal"
13+
class="btn btn-sm btn-default terminal JS-Task-Terminal"
1414
data-task-name="<%=tasks[i].name%>"
1515
title="Terminal"><span class="glyphicon glyphicon-align-left"></span>
1616
</button>

deploy/assets/templates/default/bower.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
"name": "_className_",
33
"version": "_version_",
44
"dependencies": {
5-
"normalize-less": "*",
6-
"springroll": "*"
5+
"normalize-less": "*"
76
},
87
"ignore": [
98
".gitignore",

deploy/assets/templates/default/deploy/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<body>
1414
<div id="content">
1515
<div id="container">
16+
<div id="framerate"></div>
1617
<canvas id="stage" width="_width_" height="_height_"></canvas>
1718
</div>
1819
<script src="assets/js/libraries.js"></script>

deploy/assets/templates/default/springroll-template.json

Lines changed: 56 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,22 @@
66
"gitignore" : ".gitignore",
77
"bowerrc" : ".bowerrc"
88
},
9-
"modules": {
10-
"springroll.Core": {
9+
"required": ["springroll.Core"],
10+
"modules": [
11+
{
12+
"id": "springroll.Core",
1113
"name": "SpringRoll Core",
12-
"main": "components/springroll/core.min.js",
13-
"mainDebug": "components/springroll/core.js",
14-
"required": true,
14+
"main": "components/springroll/dist/core.min.js",
15+
"mainDebug": "components/springroll/dist/core.js",
1516
"bower": {
1617
"springroll": "*"
1718
},
18-
"libraries": "components/preloadjs/lib/preload.min.js",
19-
"librariesDebug": "components/preloadjs/lib/preload.combined.js"
19+
"libraries": "components/preloadjs/lib/preloadjs.min.js",
20+
"librariesDebug": "components/preloadjs/lib/preloadjs.combined.js"
2021
},
21-
"springroll.CreateJSDisplay": {
22-
"name": "CreateJS Display Module",
22+
{
23+
"id": "springroll.CreateJSDisplay",
24+
"name": "CreateJS Display",
2325
"main": "components/springroll/dist/modules/display-createjs.min.js",
2426
"mainDebug": "components/springroll/dist/modules/display-createjs.js",
2527
"bower": {
@@ -36,27 +38,35 @@
3638
"components/easeljs/lib/easeljs.combined.js",
3739
"components/easeljs/lib/movieclip.combined.js"
3840
],
39-
"depends": "springroll.Core"
41+
"depends": ["springroll.Core"],
42+
"display": "springroll.createjs.CreateJSDisplay"
4043
},
41-
"springroll.PixiDisplay": {
42-
"name": "Pixi.js Display Module",
44+
{
45+
"id": "springroll.PixiDisplay",
46+
"name": "Pixi.js Display",
4347
"main": "components/springroll/dist/modules/display-pixi.min.js",
4448
"mainDebug": "components/springroll/dist/modules/display-pixi.js",
4549
"bower": {
4650
"pixi.js":"https://github.com/SpringRoll/pixi.js.git"
4751
},
4852
"libraries": "components/pixi.js/bin/pixi.js",
4953
"librariesDebug": "components/pixi.js/bin/pixi.dev.js",
50-
"depends": "springroll.Core"
54+
"depends": ["springroll.Core"],
55+
"display": "springroll.pixi.PixiDisplay",
56+
"default": false
5157
},
52-
"springroll.NativeDisplay": {
53-
"name": "Native Display Module",
58+
{
59+
"id": "springroll.NativeDisplay",
60+
"name": "Native Display",
5461
"main": "components/springroll/dist/modules/display-native.min.js",
5562
"mainDebug": "components/springroll/dist/modules/display-native.js",
56-
"depends": "springroll.Core"
63+
"depends": ["springroll.Core"],
64+
"display": "springroll.native.NativeDisplay",
65+
"default": false
5766
},
58-
"springroll.Sound": {
59-
"name": "Sound Module",
67+
{
68+
"id": "springroll.Sound",
69+
"name": "Sound",
6070
"bower": {
6171
"soundjs": "https://github.com/SpringRoll/SoundJS.git"
6272
},
@@ -73,49 +83,56 @@
7383
"librariesCopy": {
7484
"components/soundjs/lib/FlashAudioPlugin.swf": "deploy/assets/swfs/"
7585
},
76-
"depends": "springroll.Core"
86+
"depends": ["springroll.Core"]
7787
},
78-
"springroll.Interface": {
79-
"name": "Interface Module",
88+
{
89+
"id": "springroll.Interface",
90+
"name": "Interface",
8091
"main": "components/springroll/dist/modules/interface.min.js",
8192
"mainDebug": "components/springroll/dist/modules/interface.js",
8293
"depends": [
8394
"springroll.Core",
84-
"springroll.CreateJSDisplay|springroll.PixiDisplay"
85-
]
95+
["springroll.CreateJSDisplay", "springroll.PixiDisplay"]
96+
]
8697
},
87-
"springroll.Captions": {
88-
"name": "Captions Module",
98+
{
99+
"id": "springroll.Captions",
100+
"name": "Captions",
89101
"main": "components/springroll/dist/modules/captions.min.js",
90102
"mainDebug": "components/springroll/dist/modules/captions.js",
91-
"depends": "springroll.Core"
103+
"depends": ["springroll.Core"]
92104
},
93-
"springroll.Game": {
94-
"name": "Game Module",
105+
{
106+
"id": "springroll.Game",
107+
"name": "Game",
95108
"main": "components/springroll/dist/modules/game.min.js",
96109
"mainDebug": "components/springroll/dist/modules/game.js",
97110
"depends": [
98111
"springroll.Sound",
99112
"springroll.Core",
100-
"springroll.CreateJSDisplay|springroll.PixiDisplay"
113+
["springroll.CreateJSDisplay","springroll.PixiDisplay"]
101114
]
102115
},
103-
"springroll.Tasks": {
104-
"name": "Tasks Module",
116+
{
117+
"id": "springroll.Tasks",
118+
"name": "Tasks",
105119
"main": "components/springroll/dist/modules/tasks.min.js",
106120
"mainDebug": "components/springroll/dist/modules/tasks.js",
107-
"depends": "springroll.Core"
121+
"depends": ["springroll.Core"]
108122
},
109-
"springroll.Translate": {
110-
"name": "Translate Module",
123+
{
124+
"id": "springroll.Translate",
125+
"name": "Translate",
111126
"main": "components/springroll/dist/modules/translate.min.js",
112127
"mainDebug": "components/springroll/dist/modules/translate.js",
113-
"depends": "springroll.Core"
128+
"depends": ["springroll.Core"]
114129
},
115-
"springroll.Worker": {
116-
"name": "Worker Module",
130+
{
131+
"id": "springroll.Worker",
132+
"name": "Worker",
117133
"main": "components/springroll/dist/modules/worker.min.js",
118-
"mainDebug": "components/springroll/dist/modules/worker.js"
134+
"mainDebug": "components/springroll/dist/modules/worker.js",
135+
"default": false
119136
}
120-
}
137+
]
121138
}

deploy/assets/templates/default/springroll.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,14 @@
44
"version": "_version_",
55
"main": [
66
"src/_namespace_/_className_.js",
7-
"src/main.js",
8-
"src/main.less"
7+
"src/_namespace_/_className_.less"
98
],
109
"libraries": [
1110
"components/normalize-less/normalize.less",
12-
"components/preloadjs/lib/preloadjs.min.js",
1311
"_libraries_"
1412
],
1513
"librariesDebug": [
1614
"components/normalize-less/normalize.less",
17-
"components/preloadjs/lib/preloadjs.combined.js",
1815
"_librariesDebug_"
1916
]
2017
}

deploy/assets/templates/default/src/_namespace_/_className_.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,26 @@
88
* @class _className_
99
* @extends springroll.Application
1010
*/
11-
var _className_ = function(options)
11+
var _className_ = function()
1212
{
13-
Application.call(this, options);
13+
Application.call(this, {
14+
resizeElement: window,
15+
canvasId: "stage",
16+
display: _displayClass_,
17+
framerate: "framerate",
18+
debug: DEBUG,
19+
cacheBust: DEBUG,
20+
parseQueryString: DEBUG,
21+
displayOptions: {
22+
clearView: true,
23+
}
24+
});
1425
};
1526

1627
// Extend the base game class
17-
var p = _className_.prototype = Object.create(Application.prototype);
28+
var p = extend(_className_, Application);
1829

19-
// Assign to namespace
20-
namespace('_namespace_')._className_ = _className_;
30+
// Create instance
31+
window.app = new _className_();
2132

2233
}());

deploy/assets/templates/default/src/main.js

Lines changed: 0 additions & 33 deletions
This file was deleted.

deploy/new.html

Lines changed: 1 addition & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -101,66 +101,11 @@ <h1>Create New Project</h1>
101101
<label>
102102
<input type="checkbox" class="module" checked="checked">
103103
<span class="name"></span>
104+
<span class="id"></span>
104105
</label>
105106
</div>
106107
</script>
107108
</div>
108-
<!-- <div class="form-group">
109-
<label for="output" class="col-sm-2 col-xs-4 control-label">Renderer</label>
110-
<div class="col-sm-10 col-xs-8">
111-
112-
<input type="checkbox" class="hidden module" checked disabled value="components/springroll/dist/core">
113-
114-
<div class="btn-group" data-toggle="buttons">
115-
<label class="btn btn-default active">
116-
<input type="checkbox" class="module display" value="components/springroll/dist/modules/display-createjs" checked="checked" data-bower='{"easeljs": "https://github.com/SpringRoll/EaselJS.git","tweenjs": "https://github.com/SpringRoll/TweenJS.git"}' data-libraries='["components/tweenjs/lib/tweenjs.min.js","components/easeljs/lib/easeljs.min.js", "components/easeljs/lib/movieclip.min.js"]' data-libraries-debug='["components/tweenjs/lib/tweenjs.combined.js", "components/easeljs/lib/easeljs.combined.js", "components/easeljs/lib/movieclip.combined.js"]' data-display-class="springroll.createjs.CreateJSDisplay">
117-
<span class="glyphicon glyphicon-check on"></span>
118-
<span class="glyphicon glyphicon-unchecked off"></span>
119-
CreateJS
120-
</label>
121-
<label class="btn btn-default">
122-
<input type="checkbox" class="module display" value="components/springroll/dist/modules/display-pixi" data-bower='{"pixi.js":"https://github.com/SpringRoll/pixi.js.git"}' data-libraries='["components/pixi.js/bin/pixi.js"]' data-libraries-debug='["components/pixi.js/bin/pixi.dev.js"]' data-display-class="springroll.pixi.PixiDisplay">
123-
<span class="glyphicon glyphicon-check on"></span>
124-
<span class="glyphicon glyphicon-unchecked off"></span>
125-
Pixi.js
126-
</label>
127-
<label class="btn btn-default">
128-
<input type="checkbox" id="native" class="module display" value="components/springroll/dist/modules/display-native" data-display-class="springroll.native.NativeDisplay">
129-
<span class="glyphicon glyphicon-check on"></span>
130-
<span class="glyphicon glyphicon-unchecked off"></span>
131-
Native
132-
</label>
133-
</div>
134-
</div>
135-
</div>
136-
<div class="form-group">
137-
<label class="col-sm-2 col-xs-4 control-label">Modules</label>
138-
<div class="col-sm-5 col-xs-4">
139-
<div class="checkbox optional">
140-
<label><input type="checkbox" class="module" value="components/springroll/dist/modules/captions" checked="checked"> Captions Module</label>
141-
</div>
142-
<div class="checkbox optional no-native">
143-
<label><input type="checkbox" class="module" value="components/springroll/dist/modules/game" checked="checked"> Game Module</label>
144-
</div>
145-
<div class="checkbox optional no-native">
146-
<label><input type="checkbox" class="module" value="components/springroll/dist/modules/interface" checked="checked"> Interface Module</label>
147-
</div>
148-
<div class="checkbox optional">
149-
<label><input type="checkbox" class="module" value="components/springroll/dist/modules/sound" checked="checked" data-bower='{"soundjs":"https://github.com/SpringRoll/SoundJS.git"}' data-libraries='["components/soundjs/lib/soundjs.min.js","components/soundjs/lib/flashaudioplugin.min.js"]' data-libraries-debug='["components/soundjs/lib/soundjs.min.js","components/soundjs/lib/flashaudioplugin.combined.js"]'> Sound Module</label>
150-
</div>
151-
</div>
152-
<div class="col-sm-5 col-xs-4">
153-
<div class="checkbox optional">
154-
<label><input type="checkbox" class="module" value="components/springroll/dist/modules/tasks" checked="checked"> Tasks Module</label>
155-
</div>
156-
<div class="checkbox optional">
157-
<label><input type="checkbox" class="module" value="components/springroll/dist/modules/translate" checked="checked" data-bower='{"jquery":"*"}' data-libraries='["components/jquery/dist/jquery.min.js"]' data-libraries-debug='["components/jquery/dist/jquery.js"]'> Translate Module</label>
158-
</div>
159-
<div class="checkbox optional">
160-
<label><input type="checkbox" class="module" value="components/springroll/dist/modules/worker" checked="checked"> Worker Module</label>
161-
</div>
162-
</div>
163-
</div> -->
164109
</div>
165110
<div class="modal-footer">
166111
<button type="button" class="btn btn-default" id="closeButton">Close</button>

deploy/tasks.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ <h1>Task Runner</h1>
1515
<div id="tasks"></div>
1616
<div class="status">
1717
<div class="state spinner loading">Waiting for tasks, hold on.</div>
18-
<div class="state spinner installing">Installing plugins, this may take a few minutes.</div>
18+
<div class="state spinner installing">Installing plugins.<br>This may take a few minutes.</div>
1919
<div class="state failed">
2020
<span class="glyphicon glyphicon-exclamation-sign"></span>
2121
<span id="failedMessage"></span><br>

0 commit comments

Comments
 (0)