-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShurHotKey.dev.js
More file actions
83 lines (81 loc) · 3.72 KB
/
Copy pathShurHotKey.dev.js
File metadata and controls
83 lines (81 loc) · 3.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// ==UserScript==
// @name ShurHotKey
// @version 0.7
// @description navegación rápida entre subforos y post con más de una página
// @author Karucida
// @include http://www.forocoches.com/foro/*
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js
// @grant none
// @downloadURL https://raw.githubusercontent.com/Karucida/ShurHotKey/master/ShurHotKey.min.user.js
// @updateURL https://raw.githubusercontent.com/Karucida/ShurHotKey/master/ShurHotKey.meta.js
// ==/UserScript==
$(document).ready(function () {
var urls = [];
urls['general'] = "http://www.forocoches.com/foro/forumdisplay.php?f=2";
urls['informatica'] = "http://www.forocoches.com/foro/forumdisplay.php?f=17";
urls['fotografia'] = "http://www.forocoches.com/foro/forumdisplay.php?f=82";
urls['empleo'] = "http://www.forocoches.com/foro/forumdisplay.php?f=23";
urls['taxis'] = "http://www.forocoches.com/foro/forumdisplay.php?f=64";
urls['viajes'] = "http://www.forocoches.com/foro/forumdisplay.php?f=27";
urls['kdd'] = "http://www.forocoches.com/foro/forumdisplay.php?f=15";
$(document).keydown(function () {
if (!$("textarea").is(":focus")) {
if ($("a[rel='next']").text() == ">>" || $("a[rel='prev']").text() == "<<") {
//39 -> NEXT
if (event.which == 39) {
if ($("a[rel='next']").text() == ">>") {
location.href = $("a[rel='next']").prop("href");
} else {
if ($("a[rel=start]").text() == "« Primer« Primer")
location.href = $("a[rel='start']").prop("href");
else
location.href = $("a[title^='Mostrar Resultados del 1']").prop("href");
}
}
//37 <- BACK
if (event.which == 37) {
if ($("a[rel='prev']").text() == "<<") {
location.href = $("a[rel='prev']").prop("href");
} else {
if ($("a[title^=Última]").text() == "Último »Último »")
location.href = $("a[title^=Última]").prop("href");
else
location.href = $("a[title^='Mostrar']:last").prop("href");
}
}
}
}
if (event.altKey) {
switch (event.which) {
case 71:
//71 g GENERAL "http://www.forocoches.com/foro/forumdisplay.php?f=2"
location.href = urls['general'];
break;
case 73:
//73 i INFORMATICA "http://www.forocoches.com/foro/forumdisplay.php?f=17"
location.href = urls['informatica'];
break;
case 70:
//70 f FOTOGRAFIA "http://www.forocoches.com/foro/forumdisplay.php?f=82"
location.href = urls['fotografia'];
break;
case 66:
//66 b EMPLEO "http://www.forocoches.com/foro/forumdisplay.php?f=23"
location.href = urls['empleo'];
break;
case 84:
//84 t TAXIS "http://www.forocoches.com/foro/forumdisplay.php?f=64"
location.href = urls['taxis'];
break;
case 86:
//86 v VIAJES "http://www.forocoches.com/foro/forumdisplay.php?f=27"
location.href = urls['viajes'];
break;
case 81:
//81 q QUEDADAS "http://www.forocoches.com/foro/forumdisplay.php?f=15"
location.href = urls['kdd'];
break;
}
}
});
});