mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 12:02:13 +00:00
51 lines
1.8 KiB
Text
51 lines
1.8 KiB
Text
|
|
doctype html
|
||
|
|
html(ng-app="habitrpg")
|
||
|
|
head
|
||
|
|
title=title
|
||
|
|
link(rel='shortcut icon', href='#{env.getBuildUrl("favicon.ico")}?v=3')
|
||
|
|
|
||
|
|
meta(charset='utf-8')
|
||
|
|
meta(name='viewport', content='width=device-width, initial-scale=1.0')
|
||
|
|
meta(name='apple-mobile-web-app-capable', content='yes')
|
||
|
|
|
||
|
|
script(type='text/javascript').
|
||
|
|
window.env = !{JSON.stringify(env)};
|
||
|
|
|
||
|
|
!= env.getManifestFiles("app")
|
||
|
|
|
||
|
|
script(type='text/javascript').
|
||
|
|
hello.init({
|
||
|
|
facebook : window.env.FACEBOOK_KEY
|
||
|
|
});
|
||
|
|
|
||
|
|
window.habitrpg
|
||
|
|
.controller('StaticAvatarCtrl', ['$scope', '$http', function($scope, $http){
|
||
|
|
$scope.profile = window.env.user;
|
||
|
|
|
||
|
|
$scope.postToWall = function(network, customMessage) {
|
||
|
|
hello(network).login({scope: 'publish'}).then(function (auth) {
|
||
|
|
$http.get('/static/avatar-'+$scope.profile._id+'.png').success(function(r){
|
||
|
|
//TODO experiment with just the page as a link
|
||
|
|
hello(auth.network).api('/me/feed', 'post', {
|
||
|
|
picture: r.file, // also see link, picture, icon //https://developers.facebook.com/docs/graph-api/reference/v2.2/status#publishing
|
||
|
|
message: customMessage || "Check out my HabitRPG progress!"
|
||
|
|
}).then(function (r) {
|
||
|
|
debugger;
|
||
|
|
});
|
||
|
|
})
|
||
|
|
});
|
||
|
|
}
|
||
|
|
}])
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
//webfonts
|
||
|
|
link(href='//fonts.googleapis.com/css?family=Lato:300,400,700,400italic,700italic', rel='stylesheet', type='text/css')
|
||
|
|
|
||
|
|
body(ng-cloak)
|
||
|
|
include ./shared/header/avatar
|
||
|
|
div(ng-controller='StaticAvatarCtrl')
|
||
|
|
+herobox({main:true})
|
||
|
|
button.btn.btn-primary(ng-click='postToWall("facebook", customMessage)') Post to Facebook
|
||
|
|
textarea(placeholder="Check out my HabitRPG progress!",ng-model="customMessage")
|