Aaron Parecki
8 years ago
No known key found for this signature in database
GPG Key ID: 276C2817346D6056
9 changed files with 11 additions and 316 deletions
-
61controllers/auth.php
-
70controllers/controllers.php
-
4lib/config.template.php
-
33views/favorite-js.php
-
50views/favorite-popup.php
-
6views/layout.php
-
20views/partials/fb-script.php
-
4views/privacy.php
-
79views/settings.php
@ -1,33 +0,0 @@ |
|||||
|
|
||||
console.log("Favoriting URL: <?= $this->url ?>"); |
|
||||
|
|
||||
var css = document.createElement('link'); |
|
||||
css.rel="stylesheet"; |
|
||||
css.type="text/css"; |
|
||||
css.href="<?= Config::$base_url ?>css/favorite.css"; |
|
||||
document.body.appendChild(css); |
|
||||
|
|
||||
function show_star() { |
|
||||
var star = document.createElement('img'); |
|
||||
star.id="quill-star"; |
|
||||
star.src="<?= Config::$base_url ?>images/<?= $this->like_url ? 'star' : 'red-x' ?>.svg"; |
|
||||
star.onload=function() { |
|
||||
setTimeout(function(){ |
|
||||
|
|
||||
document.getElementById('quill-star').classList.add('hidden'); |
|
||||
var el = document.getElementById('quill-star'); |
|
||||
el.parentNode.removeChild(el); |
|
||||
if(typeof favorite_finished == "function") { |
|
||||
favorite_finished(); |
|
||||
} else { |
|
||||
// For now, redirect the user to the URL of their favorite so they can see it posted.
|
|
||||
// Might want to change this later.
|
|
||||
window.location = "<?= $this->like_url ?>"; |
|
||||
} |
|
||||
|
|
||||
}, 1200); |
|
||||
} |
|
||||
document.body.appendChild(star); |
|
||||
} |
|
||||
|
|
||||
show_star(); |
|
@ -1,50 +0,0 @@ |
|||||
<!doctype html> |
|
||||
<html lang="en"> |
|
||||
<head> |
|
||||
<title>Favoriting</title> |
|
||||
</head> |
|
||||
<body> |
|
||||
<script> |
|
||||
function favorite_finished() { |
|
||||
self.close(); |
|
||||
} |
|
||||
</script> |
|
||||
<script src="/favorite.js?url=<?= urlencode($this->url) ?>&token=<?= $this->token ?>"></script> |
|
||||
|
|
||||
<?php /* |
|
||||
<script> |
|
||||
window.quillFbInit = function() { |
|
||||
FB.getLoginStatus(function(response) { |
|
||||
|
|
||||
if (response.status === 'connected') { |
|
||||
// the user is logged in and has authenticated your
|
|
||||
// app, and response.authResponse supplies
|
|
||||
// the user's ID, a valid access token, a signed
|
|
||||
// request, and the time the access token
|
|
||||
// and signed request each expire
|
|
||||
var uid = response.authResponse.userID; |
|
||||
var accessToken = response.authResponse.accessToken; |
|
||||
console.log(accessToken); |
|
||||
|
|
||||
FB.api("/<?= $this->facebook_id ?>/likes", "post", function(response){ |
|
||||
console.log(response); |
|
||||
show_star(); |
|
||||
}); |
|
||||
|
|
||||
} else if (response.status === 'not_authorized') { |
|
||||
// the user is logged in to Facebook,
|
|
||||
// but has not authenticated your app
|
|
||||
console.log("Logged in but not authorized"); |
|
||||
} else { |
|
||||
// the user isn't logged in to Facebook.
|
|
||||
console.log("User isn't logged in"); |
|
||||
} |
|
||||
}); |
|
||||
}; |
|
||||
</script> |
|
||||
<?= partial('partials/fb-script') ?>
|
|
||||
*/ ?>
|
|
||||
|
|
||||
|
|
||||
</body> |
|
||||
</html> |
|
@ -1,20 +0,0 @@ |
|||||
<script> |
|
||||
window.fbAsyncInit = function() { |
|
||||
FB.init({ |
|
||||
appId : '<?= Config::$fbClientID ?>', |
|
||||
xfbml : true, |
|
||||
version : 'v2.2' |
|
||||
}); |
|
||||
if(window.quillFbInit) { |
|
||||
window.quillFbInit(); |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
(function(d, s, id){ |
|
||||
var js, fjs = d.getElementsByTagName(s)[0]; |
|
||||
if (d.getElementById(id)) {return;} |
|
||||
js = d.createElement(s); js.id = id; |
|
||||
js.src = "//connect.facebook.net/en_US/sdk.js"; |
|
||||
fjs.parentNode.insertBefore(js, fjs); |
|
||||
}(document, 'script', 'facebook-jssdk')); |
|
||||
</script> |
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue