PageSourceSearch

http://mahabadcity.ir//JavaScripts/DouranClientFramework.js

js mahabadcity.ir collected 2026-10-02 23:45:37 UTC 7,126 bytes, 216 lines download raw bytes

1//NOX
2//ADD BY H.NAZARI
3$(document).ready(function () {
4            if ($(location).attr("pathname").length > 1) {
5                var aLang = $(location).attr("pathname").split("/");
6                var bLang = aLang[1].split("-");
7                $("html").attr("lang", bLang[0]);
8            }
9            
10            $(".dp-modules-title-st-btn").click(function (e) {
11                e.preventDefault();
12                var st_list = $(this).parent().children(".dp-modules-title-st-list");
13                var st_dis = st_list.attr("data-display");
14
15                $('.dp-modules-title-st-list').attr("data-display", "close")
16                $('.dp-modules-title-st-list').fadeOut('fast');
17                if (st_dis == "close") {
18                    st_list.fadeIn("fast");
19                    st_list.attr("data-display", "open");
20                }
21                else {
22                    st_list.fadeOut("fast");
23                    st_list.attr("data-display", "close");
24                }
25            });
26
27            //add by h.nazari 
28            // fix datePicker show-hide issue in eform and other modules
29            $(".hasDatepicker").parent().on("click", function (e) {
30                if (e.target.className == "ui-datepicker-trigger") {
31                    console.log('a')
32                    var txt = $(this).find(".hasDatepicker");
33                    var datePicker = $("#ui-datepicker-div");
34                    datePicker.css("top", $(txt).offset().top + $(txt).outerHeight() + "px");
35                    datePicker.show();
36                }
37            });
38            $(".ui-datepicker-trigger").on("click", function () {
39
40                if ($("#ui-datepicker-div").css("display") != "block") {
41                    $("#ui-datepicker-div").show();
42                } else {
43                    $("#ui-datepicker-div").hide();
44                }
45            });
46            $(".ui-state-default").on("click", function (e) {
47                e.stopPropagation();
48                $("#ui-datepicker-div").hide();
49            });
50
51            //end 
52            //Setting localTime&Date
53            var datePanel = $('[id$="DetailsDatePanel"]');
54            for (const element of datePanel) {
55                let unix = $(element).attr('unix');
56                let localDate = new Date(Number(unix)).toLocaleDateString('fa-IR');
57                let localTime = new Date(Number(unix)).toLocaleTimeString('fa-IR', { hour: '2-digit', minute: '2-digit' });
58                $('td', element).html(localDate);
59                $('[id$="DetailsSubmitTime"]', element).html(localTime);
60            }
61        });
62//END
63// Register events to raise after page load complete
64function addLoadEvent(func) {
65  var oldonload = window.onload;
66  if (typeof window.onload != 'function') {
67    window.onload = func;
68  } else {
69    window.onload = function() {
70      if (oldonload) {
71        oldonload();
72      }
73      func();
74    }
75  }
76}
77
78
79// Disable Form Submit on Enter Key Press
80function disableEnterKey(e)
81{
82     var key;     
83     if(window.event)
84          key = window.event.keyCode; //IE
85     else
86          key = e.which; //firefox     
87
88     return (key != 13);
89}
90
91
92//Fire a button based on other control keyPress // KeyPressed_ctrl,
93function DoClickOnKeyPress(ctrl_ToClick,e)
94{
95     var key;     
96     if(window.event)
97          key = window.event.keyCode; //IE
98     else
99          key = e.which; //firefox     
100    if(key == 13)
101    {
102        $('#'+ctrl_ToClick).attr('href')!=null ? window.location=$('#'+ctrl_ToClick).click().attr('href') : $('#'+ctrl_ToClick).click() ;
103    }
104    return true;
105}
106
107 // make the specified div a windowed control in IE6
108 // this masks an iframe (which is a windowed control) onto the div,
109 // turning the div into a windowed control itself
110 function makeWindowed(p_div,fullSize)
111 {
112    var is_ie6 =
113       document.all && 
114       (navigator.userAgent.toLowerCase().indexOf('msie 6.') != -1);
115    var p_div_width='100%',p_div_height='100%';
116    var p_div_left= '0px',p_div_top='0px';
117
118    if (is_ie6)
119    {
120        if(fullSize == true)
121        {
122            p_div_left = "7px";
123            p_div_top = "7px";
124            p_div_width = "95%";
125            p_div_height = "95%";
126        }
127
128       var html =
129          '<iframe style=\'position: absolute; display: block; ' +
130          'z-index: -1; width: ' + p_div_width + '; height: ' + p_div_height + '; top: ' + p_div_top + '; left: ' + p_div_left + ';' +
131          'filter: mask(); background-color: #ffffff; \'></iframe>';
132       if (p_div) p_div.innerHTML += html;
133       // force refresh of div
134       var olddisplay = p_div.style.display;
135       p_div.style.display = 'none';
136       p_div.style.display = olddisplay;
137    };
138 }
139// Reading QueryString in client
140function PageQuery(q) {
141    if(q.length > 1) 
142        this.q = q.substring(1, q.length);
143    else 
144        this.q = null;
145    this.keyValuePairs = new Array();
146    if(q) {
147        for(let i=0; i < this.q.split('&').length; i++) {
148            this.keyValuePairs[i] = this.q.split('&')[i];
149        }
150    }
151    this.getKeyValuePairs = function() { 
152        return this.keyValuePairs; }
153    this.getValue = function(s) {
154        for(const element of this.keyValuePairs) {
155            if(element.split('=')[0] == s)
156                return element.split('=')[1];
157        }
158        return false;
159    }
160    this.getParameters = function() {
161        var a = new Array(this.getLength());
162        for(let j=0; j < this.keyValuePairs.length; j++) {
163            a[j] = this.keyValuePairs[j].split('=')[0];
164        }
165        return a;
166    }
167    this.getLength = function() { 
168        return this.keyValuePairs.length; }
169}
170
171function queryString(key){
172    var page = new PageQuery(window.location.search);
173    try {
174        return decodeURI(page.getValue(key));
175    }
176    catch (err) { }
177    
178}
179
180// find position(left,top) of a control in the page - compatible with all browsers 
181function findPos(obj) {
182    var curleft = curtop = 0;                    
183    if (obj.offsetParent) {
184    do {
185        curleft += obj.offsetLeft;
186        curtop += obj.offsetTop;                    
187        } while (obj = obj.offsetParent);
188    }
189    return [curleft,curtop];
190}
191
192var globalRouter = {};
193var search = window.location.search;
194if (search != undefined && search != '') {
195    if (search.startsWith('?'))
196        search = search.substring(1);
197    var splited = search.split('&');
198    $.each(splited, function (i, s) {
199        var s2 = s.split('=');
200        globalRouter[s2[0]] = s2[1];
201    });
202}
203
204function BuildRoute() {
205    var _q = '?';
206    $.each(Object.keys(globalRouter), function (i, k) {
207        //  console.log('router key', globalRouter[k])
208        if (k != 'moduleId'
209            && globalRouter[k] != undefined)
210            _q += k + '=' + globalRouter[k] + '&';
211    });
212    if (_q.endsWith('&'))
213        _q = _q.substring(0, _q.length - 1);
214    
215    return _q;
216}

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.