source: trunk/style/new/global.js

Last change on this file was 639, checked in by chronos, 11 years ago
  • Přidáno: Při úpravě ve formuláři pro typ OneToMany přidána možnost přidat novou vztaženou položku.
  • Přidáno: Možnost předefinovat předvolené hodnoty nových položek formuláře. Použito především pro vztažené položky typu OneToMany.
File size: 2.2 KB
Line 
1
2function openClient(client_type)
3{
4 if(client_type=="java")clientWindow = window.open("http://go.icq.com/icq2go/web.html","ICQ2Go","left=20,top=20,width=156,height=446,toolbar=0,resizable=0");
5 else clientWindow = window.open("http://go.icq.com/icq2go/flicq.html","ICQ2Go","left=20,top=20,width=176,height=441,toolbar=0,resizable=0");
6}
7
8var predchozi = 'first';
9
10function zobraz(idecko)
11{
12 skryj(predchozi);
13 el=document.getElementById(idecko).style;
14 el.display='block';
15 predchozi = idecko;
16}
17
18function skryj(idecko)
19{
20 if(idecko != 'first')
21 {
22 el=document.getElementById(idecko).style;
23 el.display='none';
24 }
25}
26
27function show(what)
28{
29 el = document.getElementById(what).style;
30 el.display = 'block';
31}
32
33function hide(what)
34{
35 el = document.getElementById(what).style;
36 el.display = 'none';
37}
38
39function toggle(what)
40{
41 el = document.getElementById(what).style;
42 if(el.display == 'none') el.display = 'inline';
43 else el.display = 'none';
44}
45
46function confirmAction(theMessage)
47{
48 // TODO: Confirmation is not required in the configuration file
49 // or browser is Opera (crappy js implementation)
50 if (typeof(window.opera) != 'undefined')
51 {
52 return true;
53 }
54
55 var is_confirmed = confirm(theMessage);
56
57 return is_confirmed;
58}
59
60function popupwindow(url, title)
61{
62 var e = document.documentElement;
63 var g = document.getElementsByTagName('body')[0];
64 var w = window.innerWidth || e.clientWidth || g.clientWidth;
65 var h = window.innerHeight|| e.clientHeight|| g.clientHeight;
66 w = (w * 0.9).toFixed();
67 h = (h * 0.6).toFixed();
68 if(w < 640) w = 640;
69 if(h < 480) h = 480;
70 var left = (screen.width / 2) - (w / 2);
71 var top = (screen.height / 2) - (h / 2);
72 return window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
73}
74
75function set_return(id, obj)
76{
77 window.opener.document.getElementById(obj).value = id;
78}
79
80function add_select_item(id, text, obj)
81{
82 var option = window.opener.document.createElement('option')
83 option.value = id;
84 option.innerHTML = text;
85 window.opener.document.getElementById(obj).appendChild(option);
86}
Note: See TracBrowser for help on using the repository browser.