From cd635a085736813f30b8d092d0c6c10f16253861 Mon Sep 17 00:00:00 2001 From: Knah Tsaeb Date: Fri, 26 Jun 2015 14:41:36 +0200 Subject: [PATCH] [add] Firefox social API by Marsup https://github.com/shaarli/Shaarli/commit/d33c5d4c3b9c70441391a08e8bcb2a8c639a4635 --- index.php | 5 +++-- tpl/editlink.html | 8 ++++++-- tpl/tools.html | 26 ++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index cc807d0..991e175 100644 --- a/index.php +++ b/index.php @@ -1545,7 +1545,7 @@ function renderPage() pubsubhub(); // If we are called from the bookmarklet, we must close the popup: - if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo ''; exit; } + if (isset($_GET['source']) && ($_GET['source']=='bookmarklet' || $_GET['source']=='firefoxsocialapi')) { echo ''; exit; } $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' ); $returnurl .= '#'.smallHash($linkdate); // Scroll to the link which has been edited. if (strstr($returnurl, "do=addlink")) { $returnurl = '?'; } //if we come from ?do=addlink, set returnurl to homepage instead @@ -1557,7 +1557,7 @@ function renderPage() if (isset($_POST['cancel_edit'])) { // If we are called from the bookmarklet, we must close the popup; - if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo ''; exit; } + if (isset($_GET['source']) && ($_GET['source']=='bookmarklet' || $_GET['source']=='firefoxsocialapi')) { echo ''; exit; } $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' ); $returnurl .= '#'.smallHash($_POST['lf_linkdate']); // Scroll to the link which has been edited. header('Location: '.$returnurl); // After canceling, redirect to the page the user was on. @@ -1659,6 +1659,7 @@ function renderPage() $PAGE->assign('link_is_new',$link_is_new); $PAGE->assign('token',getToken()); // XSRF protection. $PAGE->assign('http_referer',(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '')); + $PAGE->assign('source',(isset($_GET['source']) ? $_GET['source'] : '')); $PAGE->renderPage('editlink'); exit; } diff --git a/tpl/editlink.html b/tpl/editlink.html index 2800bc9..3306b8a 100644 --- a/tpl/editlink.html +++ b/tpl/editlink.html @@ -12,7 +12,9 @@ {elseif condition="$link.description==''"}onload="document.linkform.lf_description.focus();" {else}onload="document.linkform.lf_tags.focus();"{/if} > - {include="page.footer"} + {if="$source !== 'firefoxsocialapi'"} + {include="page.footer"} + {/if} {if="($GLOBALS['config']['OPEN_SHAARLI'] || isLoggedIn()) && empty($GLOBALS['disablejquery'])"} \ No newline at end of file