1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
interface_js.php
См. документацию.
1function SectionSH(id, action, prefix)
2{
3 var section = document.getElementById(id);
4 if ((action != 'show') && (action != 'hide'))
5 action = section.style.display != 'none' ? 'hide' : 'show';
6 var arCookie = new Array();
7 var arCookie_ = new Array();
8 var strCookie = "";
9 var tmp = "";
10 var all_checkbox = document.getElementById(prefix+'_all_checkbox');
11 var c_name = '<?=COption::GetOptionString("main", "cookie_name", "BITRIX_SM")."_FORUM_FILTER"?>';
12 if (document.cookie.length>0)
13 {
14 c_start=document.cookie.indexOf(c_name + "=");
15 if (c_start!=-1)
16 {
17 c_start=c_start + c_name.length+1
18 c_end=document.cookie.indexOf(";",c_start)
19 if (c_end==-1)
20 c_end=document.cookie.length
21 strCookie = unescape(document.cookie.substring(c_start,c_end))
22 }
23 }
24 if (strCookie.length > 0)
25 {
26 arCookie_ = strCookie.split('/');
27 for (var ii=0; ii<arCookie_.length; ii++)
28 {
29 tmp = arCookie_[ii].split('-');
30 if (tmp.length > 0)
31 arCookie[tmp[0]] = tmp[1];
32 }
33 }
34
35 arCookie[id] = (action != 'show' ? 'N':'Y');
36
37 strCookie = "";
38 arCookie_ = Array();
39 for (var key in arCookie)
40 {
41 if (arCookie[key] == 'Y')
42 arCookie_.push(key+'-'+arCookie[key]);
43 }
44
45 if (arCookie_.length > 0)
46 document.cookie = c_name+'='+arCookie_.join('/')+'; expires=Thu, 31 Dec 2030 23:59:59 GMT; path=/;';
47 else
48 document.cookie = c_name+"=Y; expires=Sun, 31 Dec 2000 23:59:59 GMT; path=/;";
49
50 if (action != 'show')
51 {
52 section.style.display = 'none';
53 document.getElementById(id+'_checkbox').checked = false;
54 all_checkbox.checked = false;
55 }
56 else
57 {
58 try{
59 section.style.display = 'table-row';
60 }
61 catch(e){
62 section.style.display = 'block';
63 }
64 document.getElementById(id+'_checkbox').checked = true;
65 }
66}
67
68function SectionGA(id, checkbox_ga)
69{
70 var action = 'show';
71 if (checkbox_ga.checked != true)
72 action = 'hide';
73 table = document.getElementById(id+'_table');
74
75 for(var i=1; i<table.rows.length; i++)
76 {
77 if (table.rows[i].id.substring(0, id.length) == id)
78 {
79 SectionSH(table.rows[i].id, action, id);
80 }
81 }
82}
83
84/************************************************/
85var jsUtils =
86{
87 arEvents: Array(),
88
89 addEvent: function(el, evname, func, capture)
90 {
91 if(el.attachEvent) // IE
92 el.attachEvent("on" + evname, func);
93 else if(el.addEventListener) // Gecko / W3C
94 el.addEventListener(evname, func, false);
95 else
96 el["on" + evname] = func;
97 this.arEvents[this.arEvents.length] = {'element': el, 'event': evname, 'fn': func};
98 },
99
100 removeEvent: function(el, evname, func)
101 {
102 if(el.detachEvent) // IE
103 el.detachEvent("on" + evname, func);
104 else if(el.removeEventListener) // Gecko / W3C
105 el.removeEventListener(evname, func, false);
106 else
107 el["on" + evname] = null;
108 },
109
110 removeAllEvents: function(el)
111 {
112 for(var i in this.arEvents)
113 {
114 if(this.arEvents[i] && (el==false || el==this.arEvents[i].element))
115 {
116 jsUtils.removeEvent(this.arEvents[i].element, this.arEvents[i].event, this.arEvents[i].fn);
117 this.arEvents[i] = null;
118 }
119 }
120 if(el==false)
121 this.arEvents.length = 0;
122 },
123
124 GetRealPos: function(el)
125 {
126 if(!el || !el.offsetParent)
127 return false;
128 var res=Array();
129 res["left"] = el.offsetLeft;
130 res["top"] = el.offsetTop;
131 var objParent = el.offsetParent;
132 while(objParent && objParent.tagName != "BODY")
133 {
134 res["left"] += objParent.offsetLeft;
135 res["top"] += objParent.offsetTop;
136 objParent = objParent.offsetParent;
137 }
138 res["right"]=res["left"] + el.offsetWidth;
139 res["bottom"]=res["top"] + el.offsetHeight;
140
141 return res;
142 },
143
144 FindChildObject: function(obj, tag_name, class_name)
145 {
146 if(!obj)
147 return null;
148 var tag = tag_name.toUpperCase();
149 var cl = (class_name? class_name.toLowerCase() : null);
150 var n = obj.childNodes.length;
151 for(var j=0; j<n; j++)
152 {
153 var child = obj.childNodes[j];
154 if(child.tagName && child.tagName.toUpperCase() == tag)
155 if(!class_name || child.className.toLowerCase() == cl)
156 return child;
157 }
158 return null;
159 },
160
161 FindNextSibling: function(obj, tag_name)
162 {
163 if(!obj)
164 return null;
165 var o = obj;
166 var tag = tag_name.toUpperCase();
167 while(o.nextSibling)
168 {
169 var sibling = o.nextSibling;
170 if(sibling.tagName && sibling.tagName.toUpperCase() == tag)
171 return sibling;
172 o = sibling;
173 }
174 return null;
175 },
176
177 FindPreviousSibling: function(obj, tag_name)
178 {
179 if(!obj)
180 return null;
181 var o = obj;
182 var tag = tag_name.toUpperCase();
183 while(o.previousSibling)
184 {
185 var sibling = o.previousSibling;
186 if(sibling.tagName && sibling.tagName.toUpperCase() == tag)
187 return sibling;
188 o = sibling;
189 }
190 return null;
191 },
192
193 FindParentObject: function(obj, tag_name)
194 {
195 if(!obj)
196 return null;
197 var o = obj;
198 var tag = tag_name.toUpperCase();
199 while(o.parentNode)
200 {
201 var parent = o.parentNode;
202 if(parent.tagName && parent.tagName.toUpperCase() == tag)
203 return parent;
204 o = parent;
205 }
206 return null;
207 },
208
209 IsIE: function()
210 {
211 return (document.attachEvent && !this.IsOpera());
212 },
213
214 IsOpera: function()
215 {
216 return (navigator.userAgent.toLowerCase().indexOf('opera') != -1);
217 },
218
219 ToggleDiv: function(div)
220 {
221 var style = document.getElementById(div).style;
222 if(style.display!="none")
223 style.display = "none";
224 else
225 style.display = "block";
226 return (style.display != "none");
227 },
228
229 urlencode: function(s)
230 {
231 return escape(s).replace(new RegExp('\\+','g'), '%2B');
232 },
233
234 OpenWindow: function(url, width, height)
235 {
236 var w = screen.width, h = screen.height;
237 if(this.IsOpera())
238 {
239 w = document.body.offsetWidth;
240 h = document.body.offsetHeight;
241 }
242 window.open(url, '', 'status=no,scrollbars=yes,resizable=yes,width='+width+',height='+height+',top='+Math.floor((h - height)/2-14)+',left='+Math.floor((w - width)/2-5));
243 },
244
245 SetPageTitle: function(s)
246 {
247 document.title = BX("FORUMJS_TITLE")+s;
248 var h1 = document.getElementsByTagName("H1");
249 if(h1)
250 h1[0].innerHTML = s;
251 },
252
253 LoadPageToDiv: function(url, div_id)
254 {
255 var div = document.getElementById(div_id);
256 if(!div)
257 return;
258 CHttpRequest.Action = function(result)
259 {
260 CloseWaitWindow();
261 document.getElementById(div_id).innerHTML = result;
262 }
263 ShowWaitWindow();
264 CHttpRequest.Send(url);
265 },
266
267 trim: function(s)
268 {
269 var r, re;
270 re = /^[ \r\n]+/g;
271 r = s.replace(re, "");
272 re = /[ \r\n]+$/g;
273 r = r.replace(re, "");
274 return r;
275 },
276
277 Redirect: function(args, url)
278 {
279 var e = null, bShift = false;
280 if(args.length > 0)
281 e = args[0];
282 if(!e)
283 e = window.event;
284 if(e)
285 bShift = e.shiftKey;
286
287 if(bShift)
288 window.open(url);
289 else
290 {
291 ShowWaitWindow();
292 window.location=url;
293 }
294 },
295
296 False: function(){return false;},
297
298 AlignToPos: function(pos, w, h)
299 {
300 var x = pos["left"], y = pos["bottom"];
301
302 var body = document.body;
303 if((body.clientWidth + body.scrollLeft) - (pos["left"] + w) < 0)
304 {
305 if(pos["right"] - w >= 0 )
306 x = pos["right"] - w;
307 else
308 x = body.scrollLeft;
309 }
310
311 if((body.clientHeight + body.scrollTop) - (pos["bottom"] + h) < 0)
312 {
313 if(pos["top"] - h >= 0)
314 y = pos["top"] - h;
315 else
316 y = body.scrollTop;
317 }
318
319 return {'left':x, 'top':y};
320 }
321}
322
323/************************************************/
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346function ForumPopupMenu(id)
347{
348 var _this = this;
349 this.menu_id = id;
350 this.controlDiv = null;
351 this.dxShadow = 5
352 this.OnClose = null;
353
354 this.Show = function(div, left, top)
355 {
356 var zIndex = parseInt(div.style.zIndex);
357 if(zIndex <= 0 || isNaN(zIndex))
358 zIndex = 100;
359 div.style.zIndex = zIndex;
360 div.style.left = left + "px";
361 div.style.top = top + "px";
362
363 if(jsUtils.IsIE())
364 {
365 var frame = document.getElementById(div.id+"_frame");
366 if(!frame)
367 {
368 frame = document.createElement("IFRAME");
369 frame.src = "javascript:''";
370 frame.id = div.id+"_frame";
371 frame.style.position = 'absolute';
372 frame.style.zIndex = zIndex-1;
373 document.body.appendChild(frame);
374 }
375 frame.style.width = div.offsetWidth + "px";
376 frame.style.height = div.offsetHeight + "px";
377 frame.style.left = div.style.left;
378 frame.style.top = div.style.top;
379 frame.style.visibility = 'visible';
380 }
381 }
382
383 this.PopupShow = function(pos)
384 {
385 var div = document.getElementById(this.menu_id);
386 if(!div)
387 return;
388
389 setTimeout(function(){jsUtils.addEvent(document, "click", _this.CheckClick)}, 10);
390 jsUtils.addEvent(document, "keypress", _this.OnKeyPress);
391
392 var w = div.offsetWidth;
393 var h = div.offsetHeight;
394 pos = jsUtils.AlignToPos(pos, w, h);
395
396 div.style.width = w + 'px';
397 div.style.visibility = 'visible';
398
399 this.Show(div, pos["left"], pos["top"]);
400
401 div.ondrag = jsUtils.False;
402 div.onselectstart = jsUtils.False;
403 div.style.MozUserSelect = 'none';
404 }
405
406 this.PopupHide = function()
407 {
408 var div = document.getElementById(this.menu_id);
409 if(div)
410 {
411 var frame = document.getElementById(div.id+"_frame");
412 if(frame)
413 frame.style.visibility = 'hidden';
414
415 div.style.visibility = 'hidden';
416 }
417
418 if(this.OnClose)
419 this.OnClose();
420
421 this.controlDiv = null;
422 jsUtils.removeEvent(document, "click", _this.CheckClick);
423 jsUtils.removeEvent(document, "keypress", _this.OnKeyPress);
424 }
425
426 this.CheckClick = function(e)
427 {
428 var div = document.getElementById(_this.menu_id);
429 if(!div)
430 return;
431
432 if (div.style.visibility != 'visible')
433 return;
434
435 var x = e.clientX + document.body.scrollLeft;
436 var y = e.clientY + document.body.scrollTop;
437
438 /*menu region*/
439 var posLeft = parseInt(div.style.left);
440 var posTop = parseInt(div.style.top);
441 var posRight = posLeft + div.offsetWidth;
442 var posBottom = posTop + div.offsetHeight;
443 if(x >= posLeft && x <= posRight && y >= posTop && y <= posBottom)
444 return;
445
446 if(_this.controlDiv)
447 {
448 var pos = jsUtils.GetRealPos(_this.controlDiv);
449 if(x >= pos['left'] && x <= pos['right'] && y >= pos['top'] && y <= pos['bottom'])
450 return;
451 }
452 _this.PopupHide();
453 }
454
455 this.OnKeyPress = function(e)
456 {
457 if(!e) e = window.event
458 if(!e) return;
459 if(e.keyCode == 27)
460 _this.PopupHide();
461 },
462
463 this.IsVisible = function()
464 {
465 return (document.getElementById(this.menu_id).style.visibility != 'hidden');
466 }
467
468 this.ShowMenu = function(control)
469 {
470 if(this.controlDiv == control)
471 this.PopupHide();
472 else
473 {
474 this.PopupHide();
475
476 control.className += '-hover';
477
478 var pos = jsUtils.GetRealPos(control);
479
480 pos["bottom"]+=2;
481
482/* if(!jsUtils.IsIE())
483 {
484 pos["top"] += document.body.scrollTop;
485 alert('document.body.scrollTop = '+document.body.scrollTop);
486
487 pos["bottom"] += document.body.scrollTop;
488 pos["left"] += document.body.scrollLeft;
489 pos["right"] += document.body.scrollLeft;
490 }
491*/
492 this.controlDiv = control;
493 this.OnClose = function()
494 {
495 control.className = control.className.replace(/\-hover/ig, "");
496 }
497 this.PopupShow(pos);
498 }
499 }
500}
hidden PROPERTY[<?=$propertyIndex?>][CODE]<?=htmlspecialcharsEx( $propertyCode)?> height
Определения file_new.php:759
bx popup label bx width30 PAGE_NEW_MENU_NAME text width
Определения file_new.php:677
bx_acc_lim_group_list limitGroupList[] multiple<?=$group[ 'ID']?> ID selected margin top
Определения file_new.php:657
hidden mSiteList<?=htmlspecialcharsbx(serialize( $siteList))?><?=htmlspecialcharsbx( $siteList[ $j]["ID"])?> _Propery<? if(((COption::GetOptionString( $module_id, "different_set", "N")=="Y") &&( $j !=0))||(COption::GetOptionString( $module_id, "different_set", "N")=="N")) echo "display: none;"?> top adm detail content cell l top adm detail content cell r heading center center ID left
Определения options.php:768
IsIE()
Определения tools.php:4103
font style
Определения invoice.php:442