Permalink
Browse files

Bumped version to 0.0.5c and published.

Signed-off-by: Diwank Singh Tomer <diwank.singh@gmail.com>
  • Loading branch information...
1 parent 091feb4 commit 8222ad1b6ebdabe8b9717af0c96bc7cb6ba19e62 @creatorrr committed Mar 29, 2013
Showing with 72 additions and 38 deletions.
  1. +69 −36 lib/pages.js
  2. +1 −1 lib/routes.js
  3. +2 −1 package.json
View
105 lib/pages.js
@@ -1,71 +1,104 @@
// Generated by CoffeeScript 1.4.0
(function() {
- var compile, name, page, pages;
+ var compile, helpers, name, page, pages;
compile = require('coffeecup').compile;
- pages = {
- home: function() {
+ helpers = {
+ layout: function(partial) {
doctype(5);
return html(function() {
- return body(function() {
- h1(this.title);
- div('#gaga', function() {
- return '';
- });
+ head(function() {
script({
src: '/socket.io/socket.io.js'
});
script({
- src: '/jquery.js'
+ src: '//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'
});
- script({
+ return script({
src: '/jquery.rdio.js'
});
- return coffeescript(function() {
- return $(function() {
- var socket;
- socket = io.connect();
- return socket.on('gaga', function(data) {
- return console.log(data);
- });
+ });
+ return body(function() {
+ return partial();
+ });
+ });
+ }
+ };
+
+ pages = {
+ home: function() {
+ var _this = this;
+ return layout(function() {
+ h1(_this.title);
+ div('#gaga', function() {
+ return '';
+ });
+ return coffeescript(function() {
+ return $(function() {
+ var socket;
+ socket = io.connect();
+ return socket.on('gaga', function(data) {
+ return console.log(data);
});
});
});
});
},
error: function() {
- return body(function() {
- return p(this.message);
+ var _this = this;
+ return layout(function() {
+ return p(_this.message);
});
},
redirect: function() {
- h3(this.message);
- input({
- type: 'hidden',
- id: 'redirect',
- value: this.redirect
- });
- return coffeescript(function() {
- var redirect;
- redirect = function() {
- var url;
- url = (document.getElementById('redirect')).value;
- return window.location.href = url;
- };
- return setTimeout(redirect, 3000);
+ var _this = this;
+ return layout(function() {
+ h3(_this.message);
+ input({
+ type: 'hidden',
+ id: 'redirect',
+ value: _this.redirect
+ });
+ return coffeescript(function() {
+ var redirect;
+ redirect = function() {
+ var url;
+ url = $('#redirect').val();
+ return window.location.href = url;
+ };
+ return setTimeout(redirect, 3000);
+ });
});
},
player: function() {
- return div(function() {
- return this.playbackToken;
+ var _this = this;
+ return layout(function() {
+ div('#rdio', function() {
+ return this.playbackToken;
+ });
+ input({
+ type: 'hidden',
+ id: 'playbackToken',
+ value: _this.playbackToken
+ });
+ return coffeescript(function() {
+ var playbackToken;
+ playbackToken = $('#playbackToken').val();
+ $('#rdio').rdio(playbackToken);
+ return $('#rdio').on('rdio.ready', function(e, user) {
+ return console.log(user);
+ });
+ });
});
}
};
for (name in pages) {
page = pages[name];
- module.exports[name] = compile(page);
+ module.exports[name] = compile(page, {
+ hardcode: helpers
+ });
}
}).call(this);
View
2 lib/routes.js
@@ -53,7 +53,7 @@
res.writeHead(200, {
'Content-Type': 'text/html'
});
- accessToken = robot.brain.get('RdioAccessSecret');
+ accessToken = robot.brain.get('RdioAccessToken');
accessSecret = robot.brain.get("RdioAccessSecret-" + accessToken);
if (!(accessToken && accessSecret)) {
return res.end(pages.redirect({
View
3 package.json
@@ -24,5 +24,6 @@
"author": "creatorrr",
"license": "BSD",
"readmeFilename": "README.md",
- "devDependencies": {}
+ "devDependencies": {},
+ "gitHead": "091feb4de1321049eafe7915d692d5b9022938c8"
}

0 comments on commit 8222ad1

Please sign in to comment.