mirror of
https://github.com/rkd77/elinks.git
synced 2025-06-30 22:19:29 -04:00
Cleanup and add gitweb() lambda
It will handle searching and going to the different views (summary, log, tree, etc)
This commit is contained in:
parent
28f615138c
commit
b73cb9d8d0
@ -69,7 +69,7 @@ var dumbprefixes = {
|
|||||||
function expand_dumbprefix(context, current_url)
|
function expand_dumbprefix(context, current_url)
|
||||||
{
|
{
|
||||||
if (dumbprefixes[context.url]) {
|
if (dumbprefixes[context.url]) {
|
||||||
context.url = dumbprefixes[context.url].replace(/%c/, context.current_url)
|
context.url = dumbprefixes[context.url].replace(/%c/, current_url)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,11 +89,23 @@ function gmane (url)
|
|||||||
return "http://search.gmane.org/search.php?query=" + words + "&group=" + group
|
return "http://search.gmane.org/search.php?query=" + words + "&group=" + group
|
||||||
}
|
}
|
||||||
|
|
||||||
// You can write "gg:foo" or "gg foo" to goto URL dialog and it'll ask google
|
function gitweb(base_url)
|
||||||
// for it automagically.
|
{
|
||||||
|
return function (arguments) {
|
||||||
|
var url = base_url
|
||||||
|
var match = arguments.match(/^(search|summary|shortlog|log|commit|commitdiff|tree)(\s(.*))?/)
|
||||||
|
|
||||||
// Note that this is _mostly_ obsoleted by the URI rewrite plugin. (It can't do the
|
if (match[1])
|
||||||
// metas, though.)
|
url += ';a=' + match[1]
|
||||||
|
else
|
||||||
|
url += ';a=summary'
|
||||||
|
|
||||||
|
if (match[1] == 'search' && match[3])
|
||||||
|
url += ';s=' + escape(match[3])
|
||||||
|
|
||||||
|
return url
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function bugzilla (base_url)
|
function bugzilla (base_url)
|
||||||
{
|
{
|
||||||
@ -124,6 +136,7 @@ var smartprefixes = {
|
|||||||
// Whose idea was it to use 'gg' for websearches? -- Miciah
|
// Whose idea was it to use 'gg' for websearches? -- Miciah
|
||||||
//gg = "http://groups.google.com/groups?q=%s",
|
//gg = "http://groups.google.com/groups?q=%s",
|
||||||
gi: "http://images.google.com/images?q=%s",
|
gi: "http://images.google.com/images?q=%s",
|
||||||
|
gitweb: gitweb("http://pasky.or.cz/gitweb.cgi?p=elinks.git"),
|
||||||
gmane: gmane,
|
gmane: gmane,
|
||||||
gn: "http://news.google.com/news?q=%s",
|
gn: "http://news.google.com/news?q=%s",
|
||||||
go: "http://www.google.com/search?q=%s&btnG=Google+Search",
|
go: "http://www.google.com/search?q=%s&btnG=Google+Search",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user