-
Notifications
You must be signed in to change notification settings - Fork 6
/
javascripts.js
executable file
·101 lines (91 loc) · 4.34 KB
/
javascripts.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<script type="text/javascript">
/*
+--------------------------------------------------------------------------+
| phpMyBackupPro |
+--------------------------------------------------------------------------+
| Copyright (c) 2004-2015 by Dirk Randhahn |
| http://www.phpMyBackupPro.net |
| Version information can be found in definitions.php. |
| |
| This program is free software; you can redistribute it and/or |
| modify it under the terms of the GNU General Public License |
| as published by the Free Software Foundation; either version 2 |
| of the License, or (at your option) any later version. |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
| |
| You should have received a copy of the GNU General Public License |
| along with this program; if not, write to the Free Software |
| Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.|
+--------------------------------------------------------------------------+
*/
// pops up a window showing the file 'path', having 'title' as window title
function popUp(path,title,confirmation,question) {
var popwin;
var input=true;
if (confirmation) input=confirm(question);
if (input) {
if (title!="view") {
// small window
leftval=(screen.width)?(screen.width-400)/2:100;
topval=(screen.height)?(screen.height-500)/2:100;
popwin=window.open(path, title, "width=400,height=500,top=" + topval + ",left=" + leftval + ",toolbar=0,scrollbars=1,directories=no,location=0,statusbar=0,menubar=0,resizable=0");
} else {
// big window
leftval=(screen.width)?(screen.width-750)/2:100;
topval=(screen.height)?(screen.height-750)/2:100;
popwin=window.open(path, title, "width=750,height=750,top=" + topval + ",left=" + leftval + ",toolbar=0,scrollbars=1,directories=no,location=0,statusbar=0,menubar=0,resizable=1");
}
popwin.focus();
}
}
// selects all entries in the selectbox 'select_name' in the form 'form_name'
function setSelect(form_name, select_name) {
var select_field=document.forms[form_name].elements[select_name];
for (var i=0; i < select_field.length; i++) select_field.options[i].selected=true;
return true;
}
// opens a dialog box with 'title' as title
// when user clicks ok, he will be forwarded to file 'path'
function confirmClick(title,path) {
var input=confirm(title);
if (input) window.location.href=path;
}
// changes the color of table row 'tr'
function changeColor(row, new_color) {
var cells=null;
var i=null;
// go sure that row is available
if (typeof(row.style)=='undefined') return false;
// trie to get all fields of current row
if (typeof(document.getElementsByTagName)!='undefined') {
cells=row.getElementsByTagName('td');
} else if (typeof(row.cells)!='undefined') {
cells=row.cells;
} else {
return false;
}
// change border color
if (typeof(cells[0].style.setAttribute)!='undefined') {
for (i=0; i<cells.length; i++) cells[i].style.setAttribute('borderColor',new_color,false);
} else if (typeof(cells[0].style.borderColor)!='undefined') {
for (i=0; i<cells.length; i++) cells[i].style.borderColor=new_color;
} else {
return false;
}
return true;
}
// changes the visibility attribute of an element to visible
function showElement(id)
{
var element = document.getElementById(id);
element.style.display = 'block';
}
// show ff add on internet explorers
window.onload = function() {
if(document.defaultCharset) showElement('ffadd');
}
</script>