View | Details | Raw Unified | Return to bug 4238
Collapse All | Expand All

(-)a/C4/Auth.pm (+1 lines)
Lines 439-444 sub get_template_and_user { Link Here
439
            suggestion                => "" . C4::Context->preference("suggestion"),
439
            suggestion                => "" . C4::Context->preference("suggestion"),
440
            virtualshelves            => "" . C4::Context->preference("virtualshelves"),
440
            virtualshelves            => "" . C4::Context->preference("virtualshelves"),
441
            OPACSerialIssueDisplayCount => C4::Context->preference("OPACSerialIssueDisplayCount"),
441
            OPACSerialIssueDisplayCount => C4::Context->preference("OPACSerialIssueDisplayCount"),
442
            ResetOpacInactivityTimeout => C4::Context->preference("ResetOpacInactivityTimeout"),
442
            OpacAddMastheadLibraryPulldown => C4::Context->preference("OpacAddMastheadLibraryPulldown"),
443
            OpacAddMastheadLibraryPulldown => C4::Context->preference("OpacAddMastheadLibraryPulldown"),
443
            OPACXSLTDetailsDisplay           => C4::Context->preference("OPACXSLTDetailsDisplay"),
444
            OPACXSLTDetailsDisplay           => C4::Context->preference("OPACXSLTDetailsDisplay"),
444
            OPACXSLTResultsDisplay           => C4::Context->preference("OPACXSLTResultsDisplay"),
445
            OPACXSLTResultsDisplay           => C4::Context->preference("OPACXSLTResultsDisplay"),
(-)a/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc (+14 lines)
Lines 84-86 Link Here
84
        <script type="text/javascript" language="javascript" src="<!-- TMPL_VAR NAME="themelang" -->/js/googleindictransliteration.js"></script>
84
        <script type="text/javascript" language="javascript" src="<!-- TMPL_VAR NAME="themelang" -->/js/googleindictransliteration.js"></script>
85
<!-- /TMPL_IF -->
85
<!-- /TMPL_IF -->
86
86
87
<!-- TMPL_IF NAME="ResetOpacInactivityTimeout" -->
88
<script type="text/javascript" language="javascript" src="<!-- TMPL_VAR NAME="themelang" -->/js/screensaver.js"></script>
89
<script type="text/javascript">
90
window.onload=function (){
91
	var ss = new ScreenSaver( <!-- TMPL_VAR NAME="ResetOpacInactivityTimeout" --> * 1000);
92
93
	ss.onstart = function () {
94
		document.location = '/cgi-bin/koha/opac-main.pl?logout.x=1';
95
                updateBasket(0,null);
96
                delCookie("bib_list");
97
	};
98
}
99
</script>
100
<!-- /TMPL_IF -->
(-)a/koha-tmpl/opac-tmpl/prog/en/js/screensaver.js (-1 / +60 lines)
Line 0 Link Here
0
- 
1
/*
2
Copyright (c) 2007, Andreas Blixt, http://blixt.org/. All rights reserved.
3
Code licensed under the MIT License:
4
http://www.opensource.org/licenses/mit-license.php
5
*/
6
7
// waitTime is in milliseconds.
8
var ScreenSaver = function (waitTime) {
9
	this.lastActivity = new Date().getTime();
10
	this.waitTime = waitTime;
11
12
	var $this = this;
13
	this._timer = setInterval(function () { $this._checkTime.call($this) }, 1000);
14
	document.onmousemove = function () { $this._mouseHandler.call($this) };
15
};
16
17
ScreenSaver.prototype = {
18
	_timer: null,
19
20
	lastActivity: 0,
21
	started: false,
22
	waitTime: 0,
23
24
	onstart: function () {},
25
	onend: function () {},
26
27
	dispose: function () {
28
		if (this._timer) clearInterval(this._timer);
29
		document.onmousemove = null;
30
	},
31
32
	_checkTime: function () {
33
		if (!this.started && new Date().getTime() - this.lastActivity >= this.waitTime) {
34
			this.started = true;
35
			this.onstart();
36
		}
37
	},
38
39
	_mouseHandler: function () {
40
		this.lastActivity = new Date().getTime();
41
		if (this.started) {
42
			this.started = false;
43
			this.onend();
44
		}
45
	}
46
};
47
48
/*********** Begin Example ***********
49
50
var ss = new ScreenSaver(5000);
51
52
ss.onstart = function () {
53
	document.getElementsByTagName("body")[0].style.backgroundColor = "#000";
54
};
55
56
ss.onend = function () {
57
	document.getElementsByTagName("body")[0].style.backgroundColor = "#fff";
58
};
59
60
************* End Example *************/

Return to bug 4238