diff options
| -rw-r--r-- | public/assets/javascripts/app.js | 13 | ||||
| -rw-r--r-- | server/index.js | 14 | ||||
| -rw-r--r-- | server/lib/auth.js | 2 | ||||
| -rw-r--r-- | server/lib/views.js | 12 | ||||
| -rwxr-xr-x | views/app.ejs (renamed from views/app.html) | 0 | ||||
| -rw-r--r-- | views/edit-profile.ejs | 83 | ||||
| -rw-r--r-- | views/edit-profile.html | 87 | ||||
| -rwxr-xr-x | views/index.ejs (renamed from views/front.html) | 13 | ||||
| -rw-r--r-- | views/partials/footer.ejs | 5 | ||||
| -rw-r--r-- | views/profile.ejs (renamed from views/profile.html) | 15 | ||||
| -rwxr-xr-x | views/signed-out.ejs | 32 | ||||
| -rwxr-xr-x | views/signed-out.html | 30 |
12 files changed, 158 insertions, 148 deletions
diff --git a/public/assets/javascripts/app.js b/public/assets/javascripts/app.js index 65378ee..ba210b8 100644 --- a/public/assets/javascripts/app.js +++ b/public/assets/javascripts/app.js @@ -5,22 +5,23 @@ var is_android = (navigator.userAgent.match(/Android/i)) var is_mobile = is_iphone || is_ipad || is_android; if (is_mobile) { - window.location.href = "mobile.html" + // window.location.href = "mobile.html" } else if ($.browser.msie || ! has3d()) { - window.location.href = "error.html" + // window.location.href = "error.html" } -var scene, - cam, - map; +var scene, cam, map; var viewHeight = window.viewHeight || 150 var app = new function(){} app.init = function () { + app.tube = new Tube () +} +app.launch = function () { var mainbox, coords, box, size, @@ -42,8 +43,6 @@ app.init = function () { cam = scene.camera cam.y = viewHeight - app.tube = new Tube () - if (MX.Map) map = app.map = new MX.Map() movements = app.movements = new MX.Movements(cam, viewHeight) diff --git a/server/index.js b/server/index.js index 1f22d71..0dfb640 100644 --- a/server/index.js +++ b/server/index.js @@ -4,7 +4,12 @@ ejs.open = '[['; ejs.close = ']]'; var config = require('../config.json'), - http = require('http'), + api = require('./lib/api'), + auth = require('./lib/auth'), + middleware = require('./lib/middleware'), + views = require('./lib/views'); + +var http = require('http'), express = require('express'), MongoStore = require('connect-mongo')(express), TwitterStrategy = require('passport-twitter').Strategy, @@ -53,12 +58,13 @@ passport.use(new TwitterStrategy({ consumerKey: process.env.VVALLS_TWITTER_KEY || '0L5blfBIapqhpons8bCXdIoGM', consumerSecret: process.env.VVALLS_TWITTER_SECRET || '5EKW7m7inoODqYSKbp7cadBKFp1FghBl4MBDoXNcUjKtodZfuP', callbackURL: 'http://' + config.host + '/auth/twitter/callback' -}, api.insertUser)); +}, auth.insertUser)); // Essential middleware // app.all('*', middleware.enableCORS); // Initialize views +app.get('/', views.front); app.get('/login', views.login); app.get('/logout', auth.logout); app.get('/auth/twitter', auth.login('twitter')); @@ -66,7 +72,7 @@ app.get('/auth/twitter/callback', auth.loggedIn('twitter')); - +/* io.set('authorization', passportSocketIo.authorize({ cookieParser: express.cookieParser, passport: passport, @@ -91,7 +97,7 @@ function onAuthorizeFail(data, message, error, accept){ // We use this callback to log all of our failed connections. accept(null, false); } - +*/ http.createServer(app).listen(app.get('port'), function () { console.log('Express server listening on port ' + app.get('port')); diff --git a/server/lib/auth.js b/server/lib/auth.js index 93fe223..04ab346 100644 --- a/server/lib/auth.js +++ b/server/lib/auth.js @@ -5,8 +5,6 @@ var passport = require('passport'), config = require('../../config.json'), User = require('./schemas/User'); -var entities = new Entities(); - var auth = { login: function (method) { diff --git a/server/lib/views.js b/server/lib/views.js index 7f3d1a0..ac72def 100644 --- a/server/lib/views.js +++ b/server/lib/views.js @@ -9,3 +9,15 @@ exports.login = function (req, res) { config: config }); }; + +exports.index = function (req, res) { + res.render('index', { + config: config + }) +} + +exports.profile = function (req, res) { + res.render('profile', { + config: config + }) +} diff --git a/views/app.html b/views/app.ejs index c853744..c853744 100755 --- a/views/app.html +++ b/views/app.ejs diff --git a/views/edit-profile.ejs b/views/edit-profile.ejs new file mode 100644 index 0000000..61bb592 --- /dev/null +++ b/views/edit-profile.ejs @@ -0,0 +1,83 @@ +<!doctype html> +<html> +<head> + <title>vvalls</title> + [[ include partials/meta ]] +</head> +<body> +<div class="rapper page"> + <a href="/front.html" class="logo"><img src="assets/img/logo4.svg"></a> + + <div id="form_container"> + + <form enctype="multipart/form-data" method="post"> + + <ul> + <li class="section_break"> + <h3>Edit Profile</h3> + </li> + <li> + <label class="description" for="element_3">Name:</label> + <div> + <input id="element_3_1" name= "element_3_1" class="element text" type="text" maxlength="255" value="Ivan Sidorov"/> + </div> + </li> + <li> + <label class="description" for="element_2">Website:</label> + <div> + <input id="element_2" name="element_2" class="element text medium" type="text" maxlength="255" value="http://"/> + </div> + </li> + <li> + <label class="description" for="element_5">Twitter:</label> + <div> + <input id="element_5" name="element_5" class="element text medium" type="text" maxlength="255" value="@"/> + </div> + </li> + <li> + <label class="description" for="element_4">Facebook:</label> + <div> + <input id="element_4" name="element_4" class="element text medium" type="text" maxlength="255" value="http://"/> + </div> + </li> + <li> + <label class="description" for="element_1">Upload Avatar:</label> + <div> + <input id="element_1" name="element_1" class="element file" type="file"/> + </div> <p class="guidelines" id="guide_1"><small>please choose a picture at least 500px wide</small></p> + </li> + <li class="section_break"> + <h3>Edit Password</h3> + </li> + <li> + <label class="description" for="element_7">Old Password:</label> + <div> + <input id="element_7" name="element_7" class="element text medium" type="password" maxlength="255" value=""/> + </div> + </li> + <li> + <label class="description" for="element_8">New Password:</label> + <div> + <input id="element_8" name="element_8" class="element text medium" type="password" maxlength="255" value=""/> + </div> + </li> + <li> + <label class="description" for="element_9">Again!</label> + <div> + <input id="element_9" name="element_9" class="element text medium" type="password" maxlength="255" value=""/> + </div> + </li> + + <li class="buttons"> + <input id="saveForm" class="button_text" type="submit" name="submit" value="Submit" /> + </li> + </ul> + </form> +</div> + +[[ include partials/footer ]] + +</div> +</body> +[[ include partials/scripts ]] +</html> diff --git a/views/edit-profile.html b/views/edit-profile.html deleted file mode 100644 index 2e50458..0000000 --- a/views/edit-profile.html +++ /dev/null @@ -1,87 +0,0 @@ -<!doctype html> -<html> -<head> - <title>vvalls</title> - [[ include partials/meta ]] -</head> -<body> -<div class="rapper page"> - <a href="/front.html" class="logo"><img src="assets/img/logo4.svg"></a> - - <div id="form_container"> - - <form enctype="multipart/form-data" method="post"> - - <ul> - <li class="section_break"> - <h3>Edit Profile</h3> - </li> - <li id="li_3" > - <label class="description" for="element_3">Name:</label> - <div> - <input id="element_3_1" name= "element_3_1" class="element text" type="text" maxlength="255" value="Ivan Sidorov"/> - </div> - </li> - <li id="li_2" > - <label class="description" for="element_2">Website:</label> - <div> - <input id="element_2" name="element_2" class="element text medium" type="text" maxlength="255" value="http://"/> - </div> - </li> - <li id="li_5" > - <label class="description" for="element_5">Twitter:</label> - <div> - <input id="element_5" name="element_5" class="element text medium" type="text" maxlength="255" value="@"/> - </div> - </li> - <li id="li_4" > - <label class="description" for="element_4">Facebook:</label> - <div> - <input id="element_4" name="element_4" class="element text medium" type="text" maxlength="255" value="http://"/> - </div> - </li> - <li id="li_1" > - <label class="description" for="element_1">Upload Avatar:</label> - <div> - <input id="element_1" name="element_1" class="element file" type="file"/> - </div> <p class="guidelines" id="guide_1"><small>please choose a picture at least 500px wide</small></p> - </li> - <li class="section_break"> - <h3>Edit Password</h3> - </li> - <li id="li_7" > - <label class="description" for="element_7">Old Password:</label> - <div> - <input id="element_7" name="element_7" class="element text medium" type="password" maxlength="255" value=""/> - </div> - </li> - <li id="li_8" > - <label class="description" for="element_8">New Password:</label> - <div> - <input id="element_8" name="element_8" class="element text medium" type="password" maxlength="255" value=""/> - </div> - </li> - <li id="li_9" > - <label class="description" for="element_9">Again!</label> - <div> - <input id="element_9" name="element_9" class="element text medium" type="password" maxlength="255" value=""/> - </div> - </li> - - <li class="buttons"> - <input type="hidden" name="form_id" value="795208" /> - - <input id="saveForm" class="button_text" type="submit" name="submit" value="Submit" /> - </li> - </ul> - </form> -</div> - <div class="footer"> - <a href="">About</a> - <a href="">FAQ</a> - <span>©2014 VVALLS Inc.</span> - </div> -</div> -</body> -[[ include partials/scripts ]] -</html> diff --git a/views/front.html b/views/index.ejs index a959e93..155f2ca 100755 --- a/views/front.html +++ b/views/index.ejs @@ -12,7 +12,7 @@ </head> <body class="loading"> <div class="rapper page"> - <a href="/front.html" class="logo"><img src="assets/img/logo4.svg"></a> + <a href="/" class="logo"><img src="assets/img/logo4.svg"></a> <a href="#" class="signUp topLink">Sign Up</span></a> <a href="#" class="signIn topLink">Sign In</span></a> <table class="demo"> @@ -47,14 +47,9 @@ <a href="#loadmore" class="viewMore">View More</a> - [[ inclue partials/signin ]] - - <div class="footer"> - <a href="">About</a> - <a href="">FAQ</a> - <span>©2014 VVALLS Inc.</span> - </div> - + [[ include partials/signin ]] + [[ include partials/footer ]] + </div> </body> [[ include partials/scripts ]] diff --git a/views/partials/footer.ejs b/views/partials/footer.ejs new file mode 100644 index 0000000..f1bd0a8 --- /dev/null +++ b/views/partials/footer.ejs @@ -0,0 +1,5 @@ +<div class="footer"> + <a href="/about">About</a> + <a href="/faq">FAQ</a> + <span>©2014 VVALLS Inc.</span> +</div> diff --git a/views/profile.html b/views/profile.ejs index b3f5041..2865274 100644 --- a/views/profile.html +++ b/views/profile.ejs @@ -39,25 +39,25 @@ <li class="section_break"> <h3>Edit Room</h3> </li> - <li id="li_3" > + <li> <label class="description" for="element_3">Name:</label> <div> <input id="element_3_1" name= "element_3_1" class="element text" type="text" maxlength="255" value="Idea For Show"/> </div> </li> - <li id="li_2" > + <li> <label class="description" for="element_2">Description:</label> <div> <textarea placeholder="short description"></textarea> </div> </li> - <li id="li_5" > + <li> <label class="description" for="element_5">URL:</label> <div> <input id="element_5" name="element_5" class="element text medium" type="text" maxlength="255" value="http://vvalls.com/t987"/> </div> </li> - <li id="li_4" > + <li> <label class="description" for="element_4">Privacy:</label> <div class="radio-group"> <input id="opt_1" class="radio-group__option" type="radio" name="opt" checked="checked"> @@ -109,11 +109,8 @@ <a href="#loadmore" class="viewMore" id="createProject">create project</a> - <div class="footer"> - <a href="">About</a> - <a href="">FAQ</a> - <span>©2014 VVALLS Inc.</span> - </div> + [[ include partials/footer ]] + </div> diff --git a/views/signed-out.ejs b/views/signed-out.ejs new file mode 100755 index 0000000..3cdd769 --- /dev/null +++ b/views/signed-out.ejs @@ -0,0 +1,32 @@ +<!doctype html> +<html> +<head> + <title>vvalls</title> + [[ include partials/meta ]] +</head> +<body class="loading"> + + <div id="scene"></div> + + <div class="rapper"> + <a href="/front.html" class="logo"><img src="assets/img/logo4.svg"></a> + <a href="#" class="signUp topLink">Sign Up</span></a> + <a href="#" class="signIn topLink">Sign In</span></a> + <div class="aboutRoom vvbox"> + <h1>Roomname, <a href="profilelink">Ivan Sidorov</a></h1> + <h2>Last modified 3/12/14</h2> + <span>Nulla vitae elit libero, a pharetra augue. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</span> + </div> + + <div class="share"> + <h2>Share this on–</h2> + <a href="#">Facebook</a> + <a href="#">Twitter</a> + </div> + </div> + + [[ include partials/signin ]] + +</body> +[[ include partials/scripts ]] +</html> diff --git a/views/signed-out.html b/views/signed-out.html deleted file mode 100755 index aff8e26..0000000 --- a/views/signed-out.html +++ /dev/null @@ -1,30 +0,0 @@ -<!doctype html> -<html> -<head> - <title>vvalls</title> - [[ include partials/meta ]] -</head> -<body class="loading"> -<div id="scene"></div> -<div class="rapper"> - <a href="/front.html" class="logo"><img src="assets/img/logo4.svg"></a> - <a href="#" class="signUp topLink">Sign Up</span></a> - <a href="#" class="signIn topLink">Sign In</span></a> - <div class="aboutRoom vvbox"> - <h1>Roomname, <a href="profilelink">Ivan Sidorov</a></h1> - <h2>Last modified 3/12/14</h2> - <span>Nulla vitae elit libero, a pharetra augue. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</span> - </div> - - <div class="share"> - <h2>Share this on–</h2> - <a href="#">Facebook</a> - <a href="#">Twitter</a> - </div> -</div> - - [[ include partials/signin ]] - -</body> -[[ include partials/scripts ]] -</html> |
