1
0

First commit of arrow_nav

This commit is contained in:
Jonathan M Tran 2012-02-27 00:25:13 -08:00
parent 0d23d96d92
commit be1fbd11ce
3 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,26 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2011 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class arrow_nav_theme {
function head($theme) {
if($theme->page_subtype == "photo") {
return $theme->script("arrow_nav.js");
}
}
}

View File

@ -0,0 +1,17 @@
$(document).keydown(function(e) {
var url;
if (e.keyCode == 37) {
// Left key pressed
url = $('.g-paginator .g-first a').attr("href");
// Right key pressed
} else if (e.keyCode == 39) {
url = $('.g-paginator .g-text-right a').attr("href");
}
if(url != undefined) {
window.location = url;
}
return false;
});

View File

@ -0,0 +1,3 @@
name = "Arrow Navigation"
description = "Use the left/right arrow keys to go to the previous/next photo"
version = 1