summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/favorite-js.php33
-rw-r--r--views/favorite-popup.php50
-rw-r--r--views/layout.php6
-rw-r--r--views/partials/fb-script.php20
-rw-r--r--views/privacy.php4
-rw-r--r--views/settings.php79
6 files changed, 5 insertions, 187 deletions
diff --git a/views/favorite-js.php b/views/favorite-js.php
deleted file mode 100644
index 4ce6dba..0000000
--- a/views/favorite-js.php
+++ /dev/null
@@ -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();
diff --git a/views/favorite-popup.php b/views/favorite-popup.php
deleted file mode 100644
index fecc780..0000000
--- a/views/favorite-popup.php
+++ /dev/null
@@ -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) ?>&amp;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> \ No newline at end of file
diff --git a/views/layout.php b/views/layout.php
index f953dc2..9fad319 100644
--- a/views/layout.php
+++ b/views/layout.php
@@ -40,12 +40,6 @@
</head>
<body role="document">
-<?php
-if(property_exists($this, 'include_facebook')) {
- # echo partial('partials/fb-script');
-}
-?>
-
<script type="text/javascript">
var _gaq = _gaq || [];
diff --git a/views/partials/fb-script.php b/views/partials/fb-script.php
deleted file mode 100644
index ce5b96a..0000000
--- a/views/partials/fb-script.php
+++ /dev/null
@@ -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> \ No newline at end of file
diff --git a/views/privacy.php b/views/privacy.php
index acdf235..40ce393 100644
--- a/views/privacy.php
+++ b/views/privacy.php
@@ -3,10 +3,10 @@
<h2>Privacy Policy</h2>
- <p>Quill enables you to post text, bookmarks and likes to your own wbesite</p>
+ <p>Quill enables you to post text, bookmarks, likes, and other kinds of posts to your own wbesite</p>
<p>Quill does not store your posts itself, but does cache the last response from your website and provides it to you for debugging purposes.</p>
- <p>If you connect Quill to your Facebook or Twitter account, Quill can post to those sites on your behalf. Quill will never post anything to your accounts without an explicit action on your part.</p>
+ <p>If you connect Quill to your Twitter account, Quill can favorite tweets on your behalf when you favorite a Twitter URL. Quill will never post anything to your accounts without an explicit action on your part.</p>
</div>
diff --git a/views/settings.php b/views/settings.php
index 831528d..46df0bf 100644
--- a/views/settings.php
+++ b/views/settings.php
@@ -4,68 +4,16 @@
<h2>Signed In As</h2>
<code><?= session('me') ?></code>
- <!--
- <h3>Facebook</h3>
- <input type="button" id="facebook-button" value="Checking" class="btn">
- -->
+ <h3>Access Token</h3>
+ <input type="text" class="form-control" readonly="readonly" value="<?= $this->user->micropub_access_token ?>">
<h3>Twitter</h3>
+ <p>Connecting a Twitter account will automatically "favorite" tweets on Twitter when you favorite a Twitter URL in Quill.</p>
<input type="button" id="twitter-button" value="Checking" class="btn">
- <h3>Instagram</h3>
- <input type="button" id="instagram-button" value="Checking" class="btn">
-
</div>
<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;
-
- save_facebook_token(response.authResponse.accessToken);
-
- } 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");
-
- $("#facebook-button").val("Sign In").addClass("btn-warning");
-
- } else {
- // the user isn't logged in to Facebook.
- console.log("User isn't logged in");
-
- $("#facebook-button").val("Sign In").addClass("btn-warning");
- }
- });
-};
-window.quillHandleFbLogin = function(response) {
- save_facebook_token(response.authResponse.accessToken);
-};
-
-function save_facebook_token(token) {
- console.log("Authed with token: " + token);
- $.post('/auth/facebook', {
- fb_token: token
- }, function(data){
- $("#facebook-button").val("Connected").addClass("btn-success");
- });
-}
-*/
-
$(function(){
- /*
- $("#facebook-button").click(function(){
- FB.login(window.quillHandleFbLogin, {scope:'publish_actions,user_likes'});
- });
- */
$.getJSON("/auth/twitter", function(data){
// Check if we're already authorized with twitter
@@ -88,26 +36,5 @@ $(function(){
}
});
- $.getJSON("/auth/instagram", function(data){
- // Check if we're already authorized with Instagram
- if(data && data.result == 'ok') {
- $("#instagram-button").val("Connected").addClass("btn-success");
- } else if(data && data.url) {
- $("#instagram-button").val("Sign In").data("url", data.url).addClass("btn-warning");
- } else {
- $("#instagram-button").val("Error").addClass("btn-danger");
- }
- });
-
- $("#instagram-button").click(function(){
- if($(this).data('url')) {
- window.location = $(this).data('url');
- } else {
- $.getJSON("/auth/instagram", {login: 1}, function(data){
- window.location = data.url;
- });
- }
- });
-
});
</script>