aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSébastien SAUVAGE <sebsauvage@sebsauvage.net>2013-02-27 18:24:07 +0100
committerSébastien SAUVAGE <sebsauvage@sebsauvage.net>2013-02-27 18:24:07 +0100
commitb342b2a4c70e4771845a68426ac15639ca74292e (patch)
tree0dd8e4a38599c473c37c4a0de7bc199685aef2b2
parentb2877611c329725a961b24fa18114f2fd41873b6 (diff)
downloadShaarli-b342b2a4c70e4771845a68426ac15639ca74292e.tar.gz
Shaarli-b342b2a4c70e4771845a68426ac15639ca74292e.tar.zst
Shaarli-b342b2a4c70e4771845a68426ac15639ca74292e.zip
After clicking save/cancel on a link, scroll to the link itself.
-rw-r--r--index.php2
-rw-r--r--tpl/linklist.html1
2 files changed, 3 insertions, 0 deletions
diff --git a/index.php b/index.php
index 0590b2f6..1ac5187b 100644
--- a/index.php
+++ b/index.php
@@ -1437,6 +1437,7 @@ function renderPage()
1437 // If we are called from the bookmarklet, we must close the popup: 1437 // If we are called from the bookmarklet, we must close the popup:
1438 if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script language="JavaScript">self.close();</script>'; exit; } 1438 if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script language="JavaScript">self.close();</script>'; exit; }
1439 $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' ); 1439 $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' );
1440 $returnurl .= '#'.smallHash($linkdate); // Scroll to the link which has been edited.
1440 header('Location: '.$returnurl); // After saving the link, redirect to the page the user was on. 1441 header('Location: '.$returnurl); // After saving the link, redirect to the page the user was on.
1441 exit; 1442 exit;
1442 } 1443 }
@@ -1447,6 +1448,7 @@ function renderPage()
1447 // If we are called from the bookmarklet, we must close the popup; 1448 // If we are called from the bookmarklet, we must close the popup;
1448 if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script language="JavaScript">self.close();</script>'; exit; } 1449 if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script language="JavaScript">self.close();</script>'; exit; }
1449 $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' ); 1450 $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' );
1451 $returnurl .= '#'.smallHash($_POST['lf_linkdate']); // Scroll to the link which has been edited.
1450 header('Location: '.$returnurl); // After canceling, redirect to the page the user was on. 1452 header('Location: '.$returnurl); // After canceling, redirect to the page the user was on.
1451 exit; 1453 exit;
1452 } 1454 }
diff --git a/tpl/linklist.html b/tpl/linklist.html
index 267e13bc..45bd478f 100644
--- a/tpl/linklist.html
+++ b/tpl/linklist.html
@@ -30,6 +30,7 @@
30 <ul> 30 <ul>
31 {loop="links"} 31 {loop="links"}
32 <li{if="$value.class"} class="{$value.class}"{/if}> 32 <li{if="$value.class"} class="{$value.class}"{/if}>
33 <a name="{$value.linkdate|smallHash}" id="{$value.linkdate|smallHash}"></a>
33 <div class="thumbnail">{$value.url|thumbnail}</div> 34 <div class="thumbnail">{$value.url|thumbnail}</div>
34 <div class="linkcontainer"> 35 <div class="linkcontainer">
35 {if="isLoggedIn()"} 36 {if="isLoggedIn()"}