-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cordova control, mobile first layout, etc
- Loading branch information
1 parent
ef497be
commit ca253f9
Showing
778 changed files
with
135,263 additions
and
216 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
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,5 +1,7 @@ | ||
{ | ||
"/": { "method": "get", "name": "home", "action": "index" }, | ||
"/user/:user_id": { "method": "get", "name": "user", "action": "edit" }, | ||
"/login": { "method": "get", "name": "login", "action": "index" } | ||
"/login": { "method": "get", "name": "login", "action": "index" }, | ||
"/mobilehome": { "method": "get", "name": "mobilehome", "action": "index" }, | ||
"/mobiletest": { "method": "get", "name": "mobilehome", "action": "test" } | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
/* | ||
Instagram signin code | ||
*/ | ||
|
||
|
||
|
||
|
||
// Endpoint api to make http requests via instagram | ||
var request = require('request'), | ||
miso = require('../../../modules/miso.util.js'), | ||
ig = require('instagram-node').instagram(); | ||
|
||
// "instagram": { | ||
// "clientId": "894a72a48ae849d8ba843720e8240f52", | ||
// "clientSecret": "35548e4fc9784c0cad421539d3fbd1af" | ||
// }, | ||
|
||
|
||
// Every call to `ig.use()` overrides the `client_id/client_secret` | ||
// or `access_token` previously entered if they exist. | ||
// TODO: Grab from serverconfig | ||
|
||
var config = { | ||
client_id: '894a72a48ae849d8ba843720e8240f52', | ||
client_secret: '35548e4fc9784c0cad421539d3fbd1af', | ||
redirect_url: 'http://misojs.com/instagram', | ||
// Go to the following URL to get a code: | ||
// https://api.instagram.com/oauth/authorize/?client_id=894a72a48ae849d8ba843720e8240f52&redirect_uri=http://misojs.com/instagram&response_type=code&scope=basic+public_content+follower_list+comments+relationships+likes | ||
|
||
code: '5de4a03b3d744a1389fb70747ce727d9', | ||
// My access token | ||
access_token: '36445530.894a72a.b5ea511cc2354ccc81068e2b8e2dd884' | ||
}; | ||
|
||
|
||
// https://api.instagram.com/oauth/authorize/?client_id=894a72a48ae849d8ba843720e8240f52&redirect_uri=http://misojs.com/instagram&response_type=code | ||
// yielded: 4706cfa887bd4beda5c97d7700c34c34 | ||
|
||
//ig.use({ access_token: config.access_token}); | ||
ig.use({ | ||
client_id: config.client_id, | ||
client_secret: config.client_secret | ||
}); | ||
|
||
|
||
|
||
// Ref: http://stackoverflow.com/a/30608596 | ||
/* | ||
request.post( | ||
{ | ||
form: { | ||
client_id: config.client_id, | ||
client_secret: config.client_secret, | ||
grant_type: 'authorization_code', | ||
redirect_uri: config.redirect_url, | ||
code: config.code | ||
}, | ||
url: 'https://api.instagram.com/oauth/access_token' | ||
}, | ||
function (err, response, body) { | ||
if (err) { | ||
console.log("error in Post", err) | ||
}else{ | ||
console.log('it worked', JSON.parse(body)) | ||
} | ||
} | ||
); | ||
*/ | ||
|
||
|
||
module.exports = function(utils){ | ||
return { | ||
tag: function(cb, err, args){ | ||
args = args || {}; | ||
//var url = "https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=code"; | ||
// // Add parameters | ||
// url += miso.each(args, function(value, key){ | ||
// return "&" + key + "=" + value; | ||
// }); | ||
|
||
// request(url, function (error, response, body) { | ||
// if (!error && response.statusCode == 200) { | ||
// cb(jsonParser(body)); | ||
// } else { | ||
// err(error); | ||
// } | ||
// }); | ||
|
||
ig.use({ access_token: config.access_token}); | ||
|
||
//console.log('tag', args.tag, config.access_token); | ||
|
||
//ig.tag_search(args.tag, function(err, result, remaining, limit) { | ||
|
||
//ig.tag_media_recent('tag', [options,] function(err, medias, pagination, remaining, limit) {}); | ||
|
||
|
||
ig.tag_media_recent(args.tag, {min_id: 0, max_id: 999999999999}, function(err, medias, pagination, remaining, limit) { | ||
console.log('result', arguments); | ||
cb(medias); | ||
}); | ||
|
||
|
||
} | ||
}; | ||
}; |
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,37 @@ | ||
// Header MVC | ||
var headerMVC = { | ||
models: { | ||
header: function(){ | ||
var me = this; | ||
me.text = m.p("Header"); | ||
me.isMenuShown = m.p(false); | ||
me.toggleMenu = function(){ | ||
me.isMenuShown(!me.isMenuShown()); | ||
var el = document.body; | ||
el.className = ""; | ||
if(me.isMenuShown()) { | ||
el.className = "menu-active"; | ||
} | ||
}; | ||
} | ||
}, | ||
controller: function() { | ||
// Expose the header model | ||
misoGlobal.header = new headerMVC.models.header(); | ||
return {model: misoGlobal.header}; | ||
}, | ||
view: function(ctrl) { | ||
var o = ctrl.model; | ||
with(sugartags){ | ||
return m("div", [ | ||
SPAN({className: "button-back"}, I({className: "fa fa-chevron-left"})), | ||
SPAN(o.text()), | ||
A({href: "#", class: "button-menu", onclick: o.toggleMenu}, | ||
SPAN(I({className: "fa fa-bars"})) | ||
) | ||
]); | ||
} | ||
} | ||
}; | ||
|
||
m.mount(document.getElementsByClassName("miso-header")[0], headerMVC); |
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,47 @@ | ||
// Nav MVC | ||
var navMVC = { | ||
models: { | ||
nav: function(){ | ||
var me = this; | ||
// Access the header model | ||
me.header = misoGlobal.header; | ||
me.items = [ | ||
{href: "/mobilehome", text: "Home", icon: "home"}, | ||
{href: "/mobiletest", text: "Test", icon: "hand-spock-o"} | ||
]; | ||
me.clickLink = function(link){ | ||
return function(e){ | ||
e.preventDefault(); | ||
me.header.toggleMenu(); | ||
m.route(link.href); | ||
} | ||
} | ||
} | ||
}, | ||
controller: function() { | ||
// Expose the model | ||
misoGlobal.nav = new navMVC.models.nav(); | ||
return {model: misoGlobal.nav}; | ||
}, | ||
view: function(ctrl) { | ||
var o = ctrl.model; | ||
with(sugartags){ | ||
return DIV([ | ||
UL( | ||
o.items.map(function(link, idx) { | ||
return LI( | ||
A({href: link.href, class: "nav-link", config: m.route, onclick: o.clickLink(link)}, | ||
SPAN([ | ||
I({className: "fa fa-" + link.icon}), | ||
SPAN(link.text) | ||
]) | ||
) | ||
); | ||
}) | ||
) | ||
]); | ||
} | ||
} | ||
}; | ||
|
||
m.mount(document.getElementsByClassName("miso-nav")[0], navMVC); |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
var m = require('mithril'), | ||
sugartags = require('mithril.sugartags')(m), | ||
authentication = require('../system/api/authentication/api.server.js')(m); | ||
|
||
// The layout is always ONLY rendered server side | ||
module.exports.view = function(ctrl){ | ||
with(sugartags) { | ||
return [ | ||
m.trust("<!DOCTYPE html>"), | ||
HTML([ | ||
HEAD([ | ||
TITLE("Miso app"), | ||
META({name: "viewport", content: "width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"}), | ||
META({charset: "utf-8"}), | ||
LINK({href: '/css/reset.css', rel:'stylesheet'}) | ||
,LINK({href: '/css/layout.css', rel:'stylesheet'}) | ||
,LINK({href: '/css/home.css', rel:'stylesheet'}) | ||
,LINK({href: '/external/font-awesome/css/font-awesome.css', rel:'stylesheet'}) | ||
]), | ||
BODY([ | ||
SECTION({className: "miso-header"}), | ||
SECTION({className: "miso-nav"}), | ||
SECTION({id: ctrl.misoAttachmentNode}, ctrl.content), | ||
SECTION({className: "miso-footer"}), | ||
SCRIPT({src: '/miso.js'}), | ||
(ctrl.reload? SCRIPT({src: '/reload.js'}): "") | ||
]) | ||
]) | ||
]; | ||
} | ||
}; |
Oops, something went wrong.