OSDN Git Service

Add files via upload
[idb/iDB.git.git] / inc / javascript.php
1 <?php
2 /*
3     This program is free software; you can redistribute it and/or modify
4     it under the terms of the Revised BSD License.
5
6     This program is distributed in the hope that it will be useful,
7     but WITHOUT ANY WARRANTY; without even the implied warranty of
8     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
9     Revised BSD License for more details.
10
11     Copyright 2004-2019 iDB Support - https://idb.osdn.jp/support/category.php?act=view&id=1
12     Copyright 2004-2019 Game Maker 2k - https://idb.osdn.jp/support/category.php?act=view&id=2
13
14     $FileInfo: javascript.php - Last Update: 5/31/2021 SVN 931 - Author: cooldude2k $
15 */
16 header("Content-Language: en");
17 header("Vary: Accept");
18 ?>
19 function getid(id) {
20 var itm;
21 itm = document.getElementById(id);
22 return itm; }
23
24 function toggletag(id) {
25 var itm;
26 itm = document.getElementById(id);
27 if (itm.style.display == "none") {
28 itm.style.display = ""; }
29 else {
30 itm.style.display = "none"; } }
31
32 function bgchange(id,color) {
33 var itm;
34 itm = document.getElementById(id);
35 itm.style.backgroundColor = ''+color+''; }
36
37 function innerchange(tag,text1,text2) {
38 var usrname;
39 usrname = document.getElementsByTagName(tag);
40 for (var i = 0; i < usrname.length; i++) {
41 if(usrname[i].innerHTML==text1) {
42 usrname[i].innerHTML = text2; } } }
43
44 function addsmiley(id,code) {
45 var itm;
46 itm = document.getElementById(id);
47 var pretext = itm.value;
48 itm.value = pretext + code; }
49
50 function GetUserTimeZone() {
51     if (!Intl || !Intl.DateTimeFormat().resolvedOptions().timeZone) {
52         throw 'Time zones are not available in this environment';
53     }
54
55     try {
56         tzname = Intl.DateTimeFormat().resolvedOptions().timeZone;
57     }
58     catch (ex) {
59         tzname = false;
60         return false;
61     }
62     if(tzname!=false)
63     {
64     document.getElementById("YourOffSet").value = tzname;
65     return true;
66     }
67 }
68
69 <?php gzip_page($Settings['use_gzip']); ?>