Added coin-viewer

This commit is contained in:
Thomas FORGIONE
2015-07-20 15:48:44 +02:00
parent df2d8b8083
commit 7409133857
7 changed files with 314 additions and 5 deletions

View File

@@ -171,3 +171,29 @@ module.exports.clicker = function(req, res, next) {
});
};
module.exports.viewer = function(req, res, next) {
var scene = req.params.scene;
switch (scene) {
case 'peach': res.locals.scene = "L3D.initPeach"; break;
case 'coolcoolmountain': res.locals.scene = "L3D.initMountain"; break;
case 'whomp': res.locals.scene = "L3D.initWhomp"; break;
case 'bobomb': res.locals.scene = "L3D.initBobomb"; break;
default:
// 404
var err = new Error('Incorrect scene');
err.status = 404;
next(err);
break;
}
res.setHeader('Content-Type', 'text/html');
res.render('prototype_viewer.jade', res.locals, function(err, result) {
res.send(result);
});
};

View File

@@ -8,5 +8,6 @@ module.exports = {
'/prototype/replay_info/:id': 'replay_info',
'/prototype/tutorial': 'tutorial',
'/prototype/sponza': 'sponza',
'/prototype/coin-creator/:scene': 'clicker'
'/prototype/coin-creator/:scene': 'clicker',
'/prototype/coin-viewer/:scene': 'viewer'
};

View File

@@ -7,7 +7,6 @@ block mainjs
script initMainScene = #{scene};
script Recommendation = L3D.ArrowRecommendation;
script(src="/static/js/filesaver.min.js")
script(src="/static/js/coincreator.min.js")
block extrabutton

View File

@@ -0,0 +1,10 @@
extends ./prototype
block title
title #{title} - Prototype
block mainjs
script initMainScene = #{scene};
script Recommendation = L3D.ArrowRecommendation;
script(src="/static/js/coinviewer.min.js")