aboutsummaryrefslogtreecommitdiffstats
path: root/gitweb/static/js/javascript-detection.js
blob: fa2596f77c645b87e79aceb242d6074d6b2764ea (plain) (blame)
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
// Copyright (C) 2007, Fredrik Kuivinen <frekui@gmail.com>
//               2007, Petr Baudis <pasky@suse.cz>
//          2008-2011, Jakub Narebski <jnareb@gmail.com>

/**
 * @fileOverview Detect if JavaScript is enabled, and pass it to server-side
 * @license GPLv2 or later
 */


/* ============================================================ */
/* Manipulating links */

/**
 * used to check if link has 'js' query parameter already (at end),
 * and other reasons to not add 'js=1' param at the end of link
 * @constant
 */
var jsExceptionsRe = /[;?]js=[01](#.*)?$/;

/**
 * Add '?js=1' or ';js=1' to the end of every link in the document
 * that doesn't have 'js' query parameter set already.
 *
 * Links with 'js=1' lead to JavaScript version of given action, if it
 * exists (currently there is only 'blame_incremental' for 'blame')
 *
 * To be used as `window.onload` handler
 *
 * @globals jsExceptionsRe
 */
function fixLinks() {
	var allLinks = document.getElementsByTagName("a") || document.links;
	for (var i = 0, len = allLinks.length; i < len; i++) {
		var link = allLinks[i];
		if (!jsExceptionsRe.test(link)) {
			link.href = link.href.replace(/(#|$)/,
				(link.href.indexOf('?') === -1 ? '?' : ';') + 'js=1$1');
		}
	}
}

/* end of javascript-detection.js */
d>-4/+4 2010-12-08Do not link with -lcrypto under NO_OPENSSLJunio C Hamano1-0/+4 2010-12-07git-rm.txt: Fix quotingMichael J Gruber1-6/+6 2010-12-03Git 1.7.3.3v1.7.3.3Junio C Hamano2-3/+11 2010-12-03CodingGuidelines: mention whitespace preferences for shell scriptsGiuseppe Bilotta1-0/+4 2010-12-03Documentation: do not misinterpret pull refspec as bold textJonathan Nieder1-2/+2 2010-12-03git-pull.txt: Mention branch.autosetuprebaseJari Aalto1-2/+3 2010-12-02Git 1.7.0.8v1.7.0.8Junio C Hamano3-2/+12 2010-12-02Documentation: Fix mark-up of lines with more than one tildeJunio C Hamano2-2/+2 2010-12-01add: introduce add.ignoreerrors synonym for add.ignore-errorsJonathan Nieder2-2/+7 2010-12-01bash: Match lightweight tags in promptknittl1-1/+1 2010-12-01git-commit.txt: (synopsis): move -i and -o before "--"Jari Aalto1-2/+2 2010-11-29rebase: only show stat if configured to trueMartin von Zweigbergk1-1/+2 2010-11-29entry.c: remove "checkout-index" from error messagesNguyễn Thái Ngọc Duy1-8/+8 2010-11-26http-fetch: rework url handlingTay Ray Chuan1-11/+5 2010-11-26http-push: add trailing slash at arg-parse time, instead of later onTay Ray Chuan1-13/+2 2010-11-26http-push: check path length before using itTay Ray Chuan1-2/+10 2010-11-26http-push: Normalise directory names when pushing to some WebDAV serversTay Ray Chuan1-0/+4 2010-11-26http-backend: use end_url_with_slash()Tay Ray Chuan1-3/+1 2010-11-26url: add str wrapper for end_url_with_slash()Tay Ray Chuan2-0/+8 2010-11-26shift end_url_with_slash() from http.[ch] to url.[ch]Tay Ray Chuan5-9/+12 2010-11-26t5550-http-fetch: add test for http-fetchTay Ray Chuan1-1/+13 2010-11-26t5550-http-fetch: add missing '&&'Tay Ray Chuan1-1/+1 2010-11-24imap-send: link against libcrypto for HMAC and othersDiego Elio Pettenò1-1/+1 2010-11-24git-send-email.perl: Deduplicate "to:" and "cc:" entries with namesJoe Perches1-1/+1 2010-11-23reflogs: clear flags properly in corner caseJeff King3-2/+37 2010-11-23rebase --abort: do not update branch refMartin von Zweigbergk2-9/+22 2010-11-23mingw: do not set errno to 0 on successErik Faye-Lund1-1/+3 2010-11-17clean: remove redundant variable baselenNguyễn Thái Ngọc Duy1-2/+2 2010-11-17Documentation/git-pull: clarify configurationMartin von Zweigbergk1-6/+8 2010-11-17Document that rev-list --graph triggers parent rewriting.Yann Dirson1-0/+2 2010-11-17Fix username and password extraction from HTTP URLsGabriel Corona2-2/+12 2010-11-17t5550: test HTTP authentication and userinfo decodingGabriel Corona4-0/+40 2010-11-17log.decorate: accept 0/1 bool valuesJeff King2-2/+23 2010-11-16clean: avoid quoting twiceNguyễn Thái Ngọc Duy1-2/+2