PageSourceSearch

https://membership.crnasia.com/Resource/Javascript/uiframework.js

js crnasia.com collected 2026-10-03 22:33:01 UTC 18,509 bytes, 546 lines download raw bytes

1$(function () {
2
3    //$("#UIFrameworkPanel").mCustomScrollbar({
4    //    axis: "y",
5    //    theme: "minimal-dark"
6    //});
7    setInterval(
8        function () {
9          var $window = $(window);
10
11          if (uiFrameWork.WindowWidth !== $window.width() || uiFrameWork.WindowHeight !== $window.height())
12          {
13              uiFrameWork.WindowWidth = $window.width();
14              uiFrameWork.WindowHeight = $window.height();
15              uiFrameWork.SetDisplay();
16
17              if (uiFrameWork.ResizeCompleteEvent !== null) {
18                  uiFrameWork.ResizeCompleteEvent.call();
19              }
20
21              uiFrameWork.GeneralResize();
22              //var elm=$("#PopupPanelHelp");
23
24              //if (elm.is(':visible') || elm.css('visibility') !== 'hidden') {
25              //    var w = elm.width();
26              //    var h = elm.height();
27              //    var offset =elm.offset();
28
29              //    if (offset.top < 0) {
30              //        if (h < $window.height()) {
31              //            h = ($window.height() / 2) - (h / 2);
32              //            elm.css("top", h + "px");
33              //        }
34              //    }
35
36              //    if (offset.left < 0) {
37              //        w = ($window.width() / 2) - (w / 2);
38              //        elm.css("left", w + "px");
39              //    }
40
41              //}
42          }
43      },
44      1000
45    );
46});
47
48var uiFrameWork = new UIFramework();
49
50function UIFramework() {
51    this.LeftSize = 300;
52    this.LeftState = 0;
53    this.LeftType = 0;
54    this.LeftID = 0;
55    this.RightSize = 250;
56    this.RightState = 0;
57    this.RightType = 0;
58    this.RightID = 0;
59    this.ClosedSize = 12;
60    this.IconSize = 12;
61    this.RollSize = 150;
62    this.WorkSize = 0;
63    this.WorkLeftHoverState = 1;
64    this.WorkRightHoverState = 1;
65    this.Width = 0;
66    this.RollState = 1;
67    this.RollSpeed = 1;
68    this.FirstLoad = true;
69    this.WindowWidth = -1;
70    this.WindowHeight = -1;
71
72    this.SetDisplay = function (settings) {
73        if (settings !== undefined) {
74            if (settings !== "") {
75                this.LeftSize = settings.LeftSize;
76                this.LeftType = settings.LeftType;
77                this.LeftID = settings.LeftID;
78                this.RightSize = settings.RightSize;
79                this.RightType = settings.RightType;
80                this.RightID = settings.RightID;
81            }
82            if (this.LeftType ===1) {
83                base.LeftState = 1;
84            }
85
86            if (this.RightType === 1) {
87                base.RightState = 1;
88            }
89        }
90
91        setDisplay();
92    };
93
94    this.Resize = function (element, tag) {
95        resize(element, tag);
96    };
97
98    this.GeneralResize = function () {
99        generalResize();
100    };
101
102    this.ResizeCompleteEvent = null;
103
104    this.LeftShow = function () {
105        leftShow();
106    };
107
108    this.LeftHide = function () {
109        leftHide();
110    };
111
112    this.LeftCompleteHandler = function () {
113        leftCompleteHandler();
114    };
115
116    this.RightShow = function () {
117        rightShow();
118    };
119
120    this.RightHide = function () {
121        rightHide();
122    };
123
124    this.RightCompleteHandler = function () {
125        rightCompleteHandler();
126    };
127
128    var base = this;
129
130    var resize = function (element, tag) {
131        if (tag === undefined || tag === null || tag === "") {
132            var $window = $(window);
133
134            tag = ".uiframeworkresizescreen";
135
136            if (element === undefined || element === null || element === "") {
137                $(tag).each(function (index, obj) {
138                    var item = $(obj);
139                    var itemW = parseInt(item.data("uiframeworkwidth"));
140                    var itemH = parseInt(item.data("uiframeworkheight"));
141
142                    if (itemW) {
143                        item.width($window.width() - itemW);
144                        item.css({ left: (itemW / 2) });
145                    }
146                    else {
147                        item.width($window.width() - 50);
148                        item.css({ left: 25 });
149                    }
150
151                    if (itemH) {
152                        item.height($window.height() - itemH);
153                        item.css({ top: (itemH / 2) });
154                    }
155                    else {
156                        item.height($window.height() - 50);
157                        item.css({ top: 25 });
158                    }
159                });
160            } else {
161                $(element).find(tag).each(function (index, obj) {
162                    var item = $(obj);
163                    var itemW = parseInt(item.data("uiframeworkwidth"));
164                    var itemH = parseInt(item.data("uiframeworkheight"));
165
166                    if (itemW) {
167                        item.width($window.width() - itemW);
168                    }
169                    else {
170                        item.width($window.width() - 50);
171                    }
172
173
174                    if (itemH) {
175                        item.height($window.height() - itemH);
176                    }
177                    else {
178                        item.height($window.height() - 50);
179                    }
180                });
181            }
182        }
183
184        tag = ".uiframeworkresize";
185
186        if (element === undefined || element === null || element === "") {
187            $(tag).each(function (index, obj) {
188                var item = $(obj);
189                var autoA = new Array();
190                var sizeA = new Array();
191                var grid = parseInt(item.data("uiframeworkgrid"));
192                var size = 0;
193
194                if (grid) {
195                    for (var i = 0; i < grid; i++) {
196                        var v = parseInt(
197                          item.find(".gridcol" + i + ":first").data("uigridwidth")
198                        );
199
200                        if (v) {
201                            sizeA.push({ index: i, value: v });
202                            size += v;
203                        } else {
204                            autoA.push(i);
205                        }
206                    }
207
208                    var w = item.width() - size;
209                    w = w / autoA.length;
210                    w = w - 4;
211
212                    if (w < 1) {
213                        w = 1;
214                    }
215
216                    for (i = 0; i < autoA.length; i++) {
217                        item.find(".gridcol" + autoA[i]).css("width", w + "px");
218                    }
219                    for (i = 0; i < sizeA.length; i++) {
220                        item
221                          .find(".gridcol" + sizeA[i].index)
222                          .css("width", sizeA[i].value + "px");
223                    }
224                }
225                else
226                {
227                    var itemW = parseInt(item.data("uiframeworkwidth"));
228
229                    if (itemW) {
230                        item.width(item.parent().width() - itemW);
231                    }
232
233                    var itemH = parseInt(item.data("uiframeworkheight"));
234
235                    if (itemH) {
236                        item.height(item.parent().height() - itemH);
237                    }
238
239                    var itemWID = item.data("uiframeworkwidthid");
240                    if (itemWID != undefined && itemWID != "") {
241                        item.width(item.parent().width() - $("#" + itemHID).width());
242                    }
243
244                    var itemHID = item.data("uiframeworkheightid");
245                    if (itemHID != undefined && itemHID != "") {
246                        item.height(item.parent().height() - $("#" + itemHID).height());
247                    }                    
248                }
249            });
250        }
251        else
252        {
253            $(element).find(tag).each(function (index, obj) {
254                var item = $(obj);
255                var grid = parseInt(item.data("uiframeworkgrid"));
256
257                if (grid) {
258                    for (var i = 0; i < grid; i++) {
259                        var v = parseInt(
260                          item.find(".gridcol" + i + ":first").data("uigridwidth")
261                        );
262
263                        if (v) {
264                            sizeA.push({ index: i, value: v });
265                            size += v;
266                        } else {
267                            autoA.push(i);
268                        }
269                    }
270
271                    var w = item.width() - size;
272                    w = w / autoA.length;
273                    w = w - 4;
274                    if (w < 1) {
275                        w = 1;
276                    }
277
278                    for (i = 0; i < autoA.length; i++) {
279                        item.find(".gridcol" + autoA[i]).css("width", w + "px");
280                    }
281                    for (i = 0; i < sizeA.length; i++) {
282                        item
283                          .find(".gridcol" + sizeA[i].index)
284                          .css("width", sizeA[i].value + "px");
285                    }
286                }
287                else
288                {
289                    var itemW = parseInt(item.data("uiframeworkwidth"));
290
291                    if (itemW) {
292                        item.width(item.parent().width() - itemW);
293                    }
294
295                    var itemH = parseInt(item.data("uiframeworkheight"));
296
297                    if (itemH) {
298                        item.height(item.parent().height() - itemH);
299                    }
300
301                    var itemWID = item.data("uiframeworkwidthid");
302                    if (itemWID != undefined && itemWID != "") {
303                        item.width(item.parent().width() - $("#" + itemHID).width());
304                    }
305
306                    var itemHID = item.data("uiframeworkheightid");
307                    if (itemHID != undefined && itemHID != "") {
308                        item.height(item.parent().height() - $("#" + itemHID).height());
309                    }
310
311
312                }
313            });
314        }
315    };
316
317    var generalResize = function () {
318        var items = $(":data(CalendarStrip)");
319
320        for (var i = 0; i < items.length; i++) {
321            if ($(items[i]).is(":hiddenByParent") === false) {
322                $(items[i]).data("CalendarStrip").refresh();
323            }
324        }
325
326        items = $(":data(NumericStrip)");
327        for (i = 0; i < items.length; i++) {
328            if ($(items[i]).is(":hiddenByParent") === false) {
329                $(items[i]).data("NumericStrip").refresh();
330            }
331        }
332
333        items = $(":data(JQPlot)");
334        for (i = 0; i < items.length; i++) {
335            if ($(items[i]).is(":hiddenByParent") === false) {
336                $(items[i]).data("JQPlot").replot();
337            }
338        }
339    };
340
341    var setDisplay = function () {
342        var viewHeight = $(window).height() - 90;
343        $(".widgetcolumncontainermax").height(viewHeight);
344
345        base.Resize();
346        base.Width = $("#UIFrameworkContentArea").width() - 1;
347
348        if (base.LeftState === 1 && base.RightState === 1) {
349            //left and right panels open
350            $("#UIFrameworkPanelMid").css({
351                width: base.Width - base.LeftSize - base.RightSize + "px"
352            });
353
354            $("#UIFrameworkPanelLeft").css({ width: base.LeftSize + "px" });
355            $("#UIFrameworkPanelContentLeft").css({
356                width: base.LeftSize - base.IconSize + "px"
357            });
358            $("#UIFrameworkPanelContentLeft").show();
359            $("#UIFrameworkPanelLeftBox").show();
360            $("#UIFrameworkPanelLeftClosedBox").hide();
361
362            $("#UIFrameworkPanelRight").css({ width: base.RightSize + "px" });
363            $("#UIFrameworkPanelContentRight").css({
364                width: base.RightSize - base.IconSize + "px"
365            });
366            $("#UIFrameworkPanelContentRight").show();
367            $("#UIFrameworkPanelRightBox").show();
368            $("#UIFrameworkPanelRightClosedBox").hide();
369        } else if (base.LeftState === 1) {
370            //left panel open
371            $("#UIFrameworkPanelMid").css({
372                width: base.Width - base.LeftSize - base.ClosedSize + "px"
373            });
374
375            $("#UIFrameworkPanelLeft").css({ width: base.LeftSize + "px" });
376            $("#UIFrameworkPanelContentLeft").css({
377                width: base.LeftSize - base.IconSize + "px"
378            });
379            $("#UIFrameworkPanelContentLeft").show();
380            $("#UIFrameworkPanelLeftBox").show();
381            $("#UIFrameworkPanelLeftClosedBox").hide();
382
383            $("#UIFrameworkPanelContentRight").hide();
384            $("#UIFrameworkPanelRight").css({ width: base.ClosedSize + "px" });
385            $("#UIFrameworkPanelRightBox").hide();
386            $("#UIFrameworkPanelRightClosedBox").show();
387        } else if (base.RightState === 1) {
388            //right panel open
389            $("#UIFrameworkPanelMid").css({
390                width: base.Width - base.RightSize - base.ClosedSize + "px"
391            });
392            $("#UIFrameworkPanelRight").css({ width: base.RightSize + "px" });
393            $("#UIFrameworkPanelContentRight").css({
394                width: base.RightSize - base.IconSize + "px"
395            });
396            $("#UIFrameworkPanelContentRight").show();
397            $("#UIFrameworkPanelRightBox").show();
398            $("#UIFrameworkPanelRightClosedBox").hide();
399
400            $("#UIFrameworkPanelLeft").css({ width: base.ClosedSize + "px" });
401            $("#UIFrameworkPanelContentLeft").hide();
402            $("#UIFrameworkPanelLeftBox").hide();
403            $("#UIFrameworkPanelLeftClosedBox").show();
404        } else {
405            //no panels open
406            $("#UIFrameworkPanelMid").css({
407                width: base.Width - base.ClosedSize * 2 + "px"
408            });
409
410            $("#UIFrameworkPanelLeft").css({ width: base.ClosedSize + "px" });
411            $("#UIFrameworkPanelRight").css({ width: base.ClosedSize + "px" });
412            $("#UIFrameworkPanelContentRight").hide();
413            $("#UIFrameworkPanelContentLeft").hide();
414            $("#UIFrameworkPanelRightBox").hide();
415            $("#UIFrameworkPanelLeftBox").hide();
416            $("#UIFrameworkPanelRightClosedBox").show();
417            $("#UIFrameworkPanelLeftClosedBox").show();
418        }
419
420        base.Resize();
421    };
422
423    /*---------------------------------------*/
424    var leftShow = function () {
425        if (base.LeftState === 1 || base.LeftHoverState === 2) {
426            return;
427        }
428
429        base.LeftHoverState = 2;
430
431        if (base.RightState === 1) {
432            TweenMax.to($("#UIFrameworkPanelLeft"), 0.2, {
433                width: base.LeftSize + "px",
434                ease: Power2.easeOut
435            });
436            TweenMax.to($("#UIFrameworkPanelMid"), 0.2, {
437                width: base.Width - base.LeftSize - base.RightSize + "px",
438                ease: Power2.easeOut,
439                onComplete: base.LeftCompleteHandler
440            });
441        } else {
442            TweenMax.to($("#UIFrameworkPanelLeft"), 0.2, {
443                width: base.LeftSize + "px",
444                ease: Power2.easeOut
445            });
446            TweenMax.to($("#UIFrameworkPanelMid"), 0.2, {
447                width: base.Width - base.LeftSize - base.ClosedSize + "px",
448                ease: Power2.easeOut,
449                onComplete: base.LeftCompleteHandler
450            });
451        }
452    };
453
454    var leftHide = function () {
455        if (base.LeftState !== 1) {
456            return;
457        }
458
459        base.LeftHoverState = 1;
460        base.LeftState = 0;
461        base.SetDisplay();
462    };
463
464    var leftCompleteHandler = function () {
465        base.LeftHoverState = 1;
466        base.LeftState = 1;
467        $("#UIFrameworkPanelContentLeft").css({
468            width: base.LeftSize - base.IconSize + "px"
469        });
470        $("#UIFrameworkPanelContentLeft").show();
471        $("#UIFrameworkPanelLeftBox").show();
472        $("#UIFrameworkPanelLeftClosedBox").hide();
473        base.Resize();
474    };
475
476    /*---------------------------------------*/
477    var rightShow = function () {
478        if (base.RightState === 1 || base.RightHoverState === 2) {
479            return;
480        }
481
482        base.RightHoverState = 2;
483
484        if (base.LeftState === 1) {
485            TweenMax.to($("#UIFrameworkPanelRight"), 0.2, {
486                width: base.RightSize + "px",
487                ease: Power2.easeOut
488            });
489            TweenMax.to($("#UIFrameworkPanelMid"), 0.2, {
490                width: base.Width - base.RightSize - base.LeftSize + "px",
491                ease: Power2.easeOut,
492                onComplete: base.RightCompleteHandler
493            });
494        } else {
495            TweenMax.to($("#UIFrameworkPanelRight"), 0.2, {
496                width: base.RightSize + "px",
497                ease: Power2.easeOut
498            });
499            TweenMax.to($("#UIFrameworkPanelMid"), 0.2, {
500                width: base.Width - base.RightSize - base.ClosedSize + "px",
501                ease: Power2.easeOut,
502                onComplete: base.RightCompleteHandler
503            });
504        }
505    };
506
507    var rightCompleteHandler = function () {
508        base.RightHoverState = 1;
509        base.RightState = 1;
510        $("#UIFrameworkPanelContentRight").css({
511            width: base.RightSize - base.IconSize + "px"
512        });
513        $("#UIFrameworkPanelContentRight").show();
514        $("#UIFrameworkPanelRightBox").show();
515        $("#UIFrameworkPanelRightClosedBox").hide();
516        base.Resize();
517    };
518
519    var rightHide = function () {
520        if (base.RightState !== 1) {
521            return;
522        }
523
524        base.RightState = 0;
525        base.RightHoverState = 1;
526        base.SetDisplay();
527    };
528}
529
530function UIFrameworkRightShow() {
531    uiFrameWork.RightShow();
532}
533
534function UIFrameworkRightHide() {
535    uiFrameWork.RightHide();
536}
537
538function UIFrameworkLeftShow() {
539    uiFrameWork.LeftShow();
540}
541
542function UIFrameworkLeftHide() {
543    uiFrameWork.LeftHide();
544}
545
546/*---------------------------------------*/

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.