forked from techatspree/ResponsiveLime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.js
executable file
·83 lines (73 loc) · 3.48 KB
/
template.js
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
/*
* LimeSurvey
* Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz
* All rights reserved.
* License: GNU/GPL License v2 or later, see LICENSE.php
* LimeSurvey is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*
*
* Description: Javascript file for templates. Put JS-functions for your template here.
*
*
* $Id:$
*/
/*
* The function focusFirst puts the Focus on the first non-hidden element in the Survey.
*
* Normally this is the first input field (the first answer).
*/
function focusFirst(Event)
{
$('#limesurvey :input:visible:enabled:first').focus();
}
/*
* The focusFirst function is added to the eventlistener, when the page is loaded.
*
* This can be used to start other functions on pageload as well. Just put it inside the 'ready' function block
*/
/* Uncomment below if you want to use the focusFirst function */
/*
$(document).ready(function(){
focusFirst();
});
*/
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])
if ((version >= 5.5) && (version<7) && (document.body.filters))
{
for(var i=0; i<document.images.length; i++)
{
var img = document.images[i]
var imgName = img.src.toUpperCase()
if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
{
var imgID = (img.id) ? "id='" + img.id + "' " : "";
var imgClass = (img.className) ? "class='" + img.className + "' " : "";
var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
var imgStyle = "display:inline-block;" + img.style.cssText;
if (img.align == "left") imgStyle = "float:left;" + imgStyle;
if (img.align == "right") imgStyle = "float:right;" + imgStyle;
if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
var strNewHTML = "<span " + imgID + imgClass + imgTitle
+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
+ "(src='" + img.src + "', sizingMethod='scale');\"></span>"
img.outerHTML = strNewHTML
i = i-1
}
}
}
}
$(document).ready(function(){
$('input[type="submit"], input[type="button"]').removeClass("ui-button ui-widget ui-state-default ui-corner-all");
$('input[type="submit"], input[type="button"]').addClass("button secondary tiny");
/*$("#progressbar").removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all");
$("#progressbar").addClass("progress");
$("#progressbar>div").removeClass("ui-progressbar-value ui-widget-header ui-corner-left").addClass("meter");*/
});