From b5916b6c04cd7428cd188ed56545dbf985b6c18c Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Thu, 25 Oct 2012 22:24:54 +0200 Subject: mise en place du routage --- app/views/javascript/main.phtml | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'app/views/javascript/main.phtml') diff --git a/app/views/javascript/main.phtml b/app/views/javascript/main.phtml index 641bfa00c..7d077d93f 100644 --- a/app/views/javascript/main.phtml +++ b/app/views/javascript/main.phtml @@ -146,6 +146,14 @@ $(document).ready (function () { slide (last_active, old_active); } }); + shortcut.add("shift+", function () { + old_active = $(".post.flux.active"); + first = $(".post.flux:first"); + + if (first[0] instanceof HTMLDivElement) { + slide (first, old_active); + } + }); shortcut.add("", function () { old_active = $(".post.flux.active"); first_active = $(".post.flux:first"); @@ -157,20 +165,28 @@ $(document).ready (function () { slide (first_active, old_active); } }); + shortcut.add("shift+", function () { + old_active = $(".post.flux.active"); + last = $(".post.flux:last"); + + if (last[0] instanceof HTMLDivElement) { + slide (last, old_active); + } + }); shortcut.add("", function () { url = $(".pager-next a").attr ("href"); - if (url === undefined) { - url = $(".pager-first a").attr ("href"); - } - + redirect (url); + }); + shortcut.add("shift+", function () { + url = $(".pager-last a").attr ("href"); redirect (url); }); shortcut.add("", function () { url = $(".pager-previous a").attr ("href"); - if (url === undefined) { - url = $(".pager-last a").attr ("href"); - } - + redirect (url); + }); + shortcut.add("shift+", function () { + url = $(".pager-first a").attr ("href"); redirect (url); }); shortcut.add("", function () { -- cgit v1.2.3