aboutsummaryrefslogtreecommitdiffstats
path: root/mod/photos.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-03-19 01:20:53 -0700
committerfriendica <info@friendica.com>2012-03-19 01:20:53 -0700
commitcf2edb5b9ad5f9bad1fa94ad577f1ab8a664e8e6 (patch)
tree895cf3e1b507d51d26f6db5a0161fc40402426bc /mod/photos.php
parent283bc51acf479eebd54145eb639c681980f6717b (diff)
downloadvolse-hubzilla-cf2edb5b9ad5f9bad1fa94ad577f1ab8a664e8e6.tar.gz
volse-hubzilla-cf2edb5b9ad5f9bad1fa94ad577f1ab8a664e8e6.tar.bz2
volse-hubzilla-cf2edb5b9ad5f9bad1fa94ad577f1ab8a664e8e6.zip
ctrl + left|right cursor keys to prev/next photos
Diffstat (limited to 'mod/photos.php')
-rwxr-xr-xmod/photos.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/mod/photos.php b/mod/photos.php
index 4406780d3..b294f0a66 100755
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -1069,7 +1069,7 @@ function photos_content(&$a) {
if($can_post && ($ph[0]['uid'] == $owner_uid)) {
$tools = array(
'edit' => array($a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $datum . (($cmd === 'edit') ? '' : '/edit'), (($cmd === 'edit') ? t('View photo') : t('Edit photo'))),
- 'profile'=>array($a->get_baseurl() . '/profile_photo/use/'.$ph[0]['resource-id'] . '?form_security_token=' . get_form_security_token('profile_photo'), t('Use as profile photo')),
+ 'profile'=>array($a->get_baseurl() . '/profile_photo/use/'.$ph[0]['resource-id'], t('Use as profile photo')),
);
// lock
@@ -1081,6 +1081,17 @@ function photos_content(&$a) {
}
+ if(! $cmd !== 'edit') {
+ $a->page['htmlhead'] .= '<script>
+ $(document).keydown(function(event) {' . "\n";
+
+ if($prevlink)
+ $a->page['htmlhead'] .= 'if(event.ctrlKey && event.keyCode == 37) { event.preventDefault(); window.location.href = \'' . $prevlink . '\'; }' . "\n";
+ if($nextlink)
+ $a->page['htmlhead'] .= 'if(event.ctrlKey && event.keyCode == 39) { event.preventDefault(); window.location.href = \'' . $nextlink . '\'; }' . "\n";
+ $a->page['htmlhead'] .= '});</script>';
+ }
+
if($prevlink)
$prevlink = array($prevlink, '<div class="icon prev"></div>') ;