PageSourceSearch

http://benisuef.gov.eg/New_Portal/Dewan/dewan.js

js benisuef.gov.eg collected 2026-10-02 06:34:54 UTC 13,632 bytes, 371 lines download raw bytes

1var options = $('.year option');
2var uni = $(options[1]).text();
3var items = [];
4items[0] = uni;
5var year, link;
6var loadimg = $('<img src="/New_Portal/images/loading.gif" alt="جارى تحميل الأشهر">');
7var thisDiv;
8var defaultState = 'Dewan',
9    url = location.href,    // the page original url [get the only id query string if more values exists]
10    currentQStr = (url.indexOf('?') !== -1)? url.substring(url.indexOf('?')+1).split('&')[0] : '-1',
11    currentUrl = "";        // used for updating the page history state
12
13// push new history state
14function _pushNewState(qStr) {
15    qStr = 'id='+qStr;
16    // adjust the query string
17    currentUrl = (url.indexOf('?') === -1)? url+'?'+qStr : url.substring(0,url.indexOf('?')+1)+qStr;
18    // push new state [modify the page history]
19    if (currentUrl !== url) {
20        history.pushState({id: qStr.substring(3)},"",currentUrl);
21        // change the url to its new value
22        url = currentUrl;
23    }
24}
25window.onpopstate = function (event) {
26    if (event.state){
27        // get the current projects
28        _getCurrentContent($('#T-'+event.state.id));
29    }
30};
31function _getCurrentContent(curr) {
32    // highlight the label div
33    $('div.labels > div').removeClass('active-label');
34    curr.addClass('active-label');
35    // show hide the selected content
36    $('div.content-div').addClass('hidden');
37    thisDiv = '#' + (curr.attr('id')).substring(2);
38    $(thisDiv).removeClass('hidden');
39}
40$('div.labels').on('click', 'div', function () {
41    // show hide the current content
42    _getCurrentContent($(this));
43    // push new history state
44    _pushNewState(this.id.substring(2));
45});
46// [do this in the first time] to show the Decisions and pass the query string to it
47(function _init() {
48    if (currentQStr !== '-1') {
49        if (currentQStr.indexOf('id') !== -1) {
50            // get the current content based on current url
51            _getCurrentContent($('#T-'+currentQStr.substring(3)));
52        } else {
53            // set the current content to Decisions and pass the m and y parameters to the Decisions iframe
54            $('#Decisions').find('iframe').attr('src','/New_Portal/Dewan/gov-decisions.html?'+currentQStr);
55            _pushNewState('Decisions');
56            _getCurrentContent($('#T-Decisions'));
57        }
58    } else { // to push the default state when no query string is found
59        _pushNewState(defaultState);
60        _getCurrentContent($('#T-'+defaultState));
61    }
62})();
63
64/*-------------  PrevGovernoers---------------------*/
65var Photo	= (function() {
66
67    // list of thumbs
68    var $list		= $('#pe-thumbs'),
69    // list's width and offset left.
70    // this will be used to know the position of the description container
71        listW		= $list.width(),
72        listL		= $list.offset().left,
73    // the images
74        $elems		= $list.find('img'),
75    // the description containers
76        $descrp		= $list.find('div.pe-description'),
77    // maxScale : maximum scale value the image will have
78    // minOpacity / maxOpacity : minimum (set in the CSS) and maximum values for the image's opacity
79        settings	= {
80            maxScale	: 1.3,
81            maxOpacity	: 0.9,
82            minOpacity	: Number( $elems.css('opacity') )
83        },
84        init		= function() {
85
86            // minScale will be set in the CSS
87            settings.minScale = _getScaleVal() || 1;
88            // preload the images (thumbs)
89            _loadImages( function() {
90
91                _calcDescrp();
92                _initEvents();
93
94            });
95
96        },
97    // Get Value of CSS Scale through JavaScript:
98    // http://css-tricks.com/get-value-of-css-rotation-through-javascript/
99        _getScaleVal= function() {
100
101            var st = window.getComputedStyle($elems.get(0), null),
102                tr = st.getPropertyValue("-webkit-transform") ||
103                    st.getPropertyValue("-moz-transform") ||
104                    st.getPropertyValue("-ms-transform") ||
105                    st.getPropertyValue("-o-transform") ||
106                    st.getPropertyValue("transform") ||
107                    "fail...";
108
109            if( tr !== 'none' ) {
110
111                var values = tr.split('(')[1].split(')')[0].split(','),
112                    a = values[0],
113                    b = values[1],
114                    c = values[2],
115                    d = values[3];
116
117                return Math.sqrt( a * a + b * b );
118
119            }
120
121        },
122    // calculates the style values for the description containers,
123    // based on the settings variable
124        _calcDescrp	= function() {
125
126            $descrp.each( function(i) {
127
128                var $el		= $(this),
129                    $img	= $el.prev(),
130                    img_w	= $img.width(),
131                    img_h	= $img.height(),
132                    img_n_w	= settings.maxScale * img_w,
133                    img_n_h	= settings.maxScale * img_h,
134                    space_t = ( img_n_h - img_h ) / 2,
135                    space_l = ( img_n_w - img_w ) / 2;
136
137                $el.data( 'space_l', space_l ).css({
138                    height	: settings.maxScale * $el.height(),
139                    top		: -space_t,
140                    left	: img_n_w - space_l
141                });
142
143            });
144
145        },
146        _initEvents	= function() {
147
148            $elems.on('proximity.Photo', { max: 80, throttle: 10, fireOutOfBounds : true }, function(event, proximity, distance) {
149
150                var $el			= $(this),
151                    $li			= $el.closest('li'),
152                    $desc		= $el.next(),
153                    scaleVal	= proximity * ( settings.maxScale - settings.minScale ) + settings.minScale,
154                    scaleExp	= 'scale(' + scaleVal + ')';
155
156                // change the z-index of the element once it reaches the maximum scale value
157                // also, show the description container
158                if( scaleVal === settings.maxScale ) {
159
160                    $li.css( 'z-index', 1000 );
161
162                    if( $desc.offset().left + $desc.width() > listL + listW ) {
163
164                        $desc.css( 'left', -$desc.width() - $desc.data( 'space_l' ) );
165
166                    }
167
168                    $desc.fadeIn( 800 );
169
170                }
171                else {
172
173                    $li.css( 'z-index', 1 );
174
175                    $desc.stop(true,true).hide();
176
177                }
178
179                $el.css({
180                    '-webkit-transform'	: scaleExp,
181                    '-moz-transform'	: scaleExp,
182                    '-o-transform'		: scaleExp,
183                    '-ms-transform'		: scaleExp,
184                    'transform'			: scaleExp,
185                    'opacity'			: ( proximity * ( settings.maxOpacity - settings.minOpacity ) + settings.minOpacity )
186                });
187
188            });
189
190        },
191        _loadImages	= function( callback ) {
192
193            var loaded 	= 0,
194                total	= $elems.length;
195
196            $elems.each( function(i) {
197
198                var $el = $(this);
199
200                $('<img/>').load( function() {
201
202                    ++loaded;
203                    if( loaded === total )
204                        callback.call();
205
206                }).attr( 'src', $el.attr('src') );
207
208            });
209
210        };
211
212    return {
213        init	: init
214    };
215
216})();
217Photo.init();
218/*-------------  PrevGovernoers---------------------*/
219
220// ----------------------- Old gov Decisions --------------------------
221/*
222for (var i = 2; i < options.length; i++) {
223	if (uni == $(options[i]).text()) continue;
224	uni = $(options[i]).text();
225	items.push(uni);
226};
227
228$.each(items, function(i) {
229    $('#dyears').append($("<option/>", {
230        text: items[i]
231    }));
232});
233
234$('#dyears').on('change',function(){
235	$('#Dec-month').html(loadimg);
236	year = $("#dyears :selected").val();
237	if (year == 0) return;
238	$('#Dec-month').load('http://www.benisuef.gov.eg/New_Portal/Dewan/Gov-Decision-Data.aspx?y=' + year + ' select', function(){						
239		$('#Dec-month').show();
240	});	
241});
242
243$('#btn-show').on('click',function(){
244	link = $("#Dec-month select :selected").val();
245	if (link == 0) return;
246	$("#file-link").attr('src',link);
247});
248*/
249// ----------------------- Old gov Decisions --------------------------
250
251// ------------- Old Code ---------------------------
252/*
253$('#T-Dewan').on('click', function() {
254	$('#Dewan').removeClass('hidden');
255	$('#PreGov').addClass('hidden');
256	$('#Decisions').addClass('hidden');
257	$('#Info').addClass('hidden');
258});
259
260$('#T-PreGov').on('click', function() {
261	$('#PreGov').removeClass('hidden');
262	$('#Dewan').addClass('hidden');
263	$('#Decisions').addClass('hidden');
264	$('#Info').addClass('hidden');
265});
266
267$('#T-Decisions').on('click', function() {
268	$('#Decisions').removeClass('hidden');
269	$('#PreGov').addClass('hidden');
270	$('#Dewan').addClass('hidden');
271	$('#Info').addClass('hidden');
272});
273
274$('#T-Info').on('click', function() {
275	$('#Info').removeClass('hidden');
276	$('#PreGov').addClass('hidden');
277	$('#Decisions').addClass('hidden');
278	$('#Dewan').addClass('hidden');
279});
280
281 var selbox, year ,month, name, path = "http://www.benisuef.gov.eg/New_Portal/Dewan/Decisions/";
282
283 function setOptions(chosen)
284 {
285 selbox = document.getElementById('opttwo');
286
287 selbox.options.length = 0;
288
289 if (chosen == "0")
290 {
291 selbox.options[selbox.options.length] = new Option('','...','0');
292 }
293 if (chosen == "2010")
294 {
295 selbox.options[selbox.options.length] = new Option('اختر الشهر ...','0');
296 selbox.options[selbox.options.length] = new Option('يناير','1');
297 selbox.options[selbox.options.length] = new Option('فبراير','2');
298 selbox.options[selbox.options.length] = new Option('مارس','3');
299 selbox.options[selbox.options.length] = new Option('أبريل','4');
300 selbox.options[selbox.options.length] = new Option('مايو','5');
301 selbox.options[selbox.options.length] = new Option('يونيو','6');
302 selbox.options[selbox.options.length] = new Option('يوليو','7');
303 selbox.options[selbox.options.length] = new Option('أغسطس','8');
304 selbox.options[selbox.options.length] = new Option('سبتمبر','9');
305 selbox.options[selbox.options.length] = new Option('أكتوبر','10');
306 selbox.options[selbox.options.length] = new Option('نوفمبر','11');
307 selbox.options[selbox.options.length] = new Option('ديسمبر','12');
308 }
309 if (chosen == "2011")
310 {
311 selbox.options[selbox.options.length] = new Option('اختر الشهر ...','0');
312 selbox.options[selbox.options.length] = new Option('يناير','1');
313 selbox.options[selbox.options.length] = new Option('فبراير','2');
314 selbox.options[selbox.options.length] = new Option('مارس','3');
315 selbox.options[selbox.options.length] = new Option('أبريل','4');
316 selbox.options[selbox.options.length] = new Option('مايو','5');
317 selbox.options[selbox.options.length] = new Option('يونيو','6');
318 selbox.options[selbox.options.length] = new Option('يوليو','7');
319 selbox.options[selbox.options.length] = new Option('أغسطس','8');
320 selbox.options[selbox.options.length] = new Option('سبتمبر','9');
321 selbox.options[selbox.options.length] = new Option('اكتوبر','10');
322 selbox.options[selbox.options.length] = new Option('نوفمبر','11');
323 selbox.options[selbox.options.length] = new Option('ديسمبر','12');
324 }
325 if (chosen == "2012")
326 {
327 selbox.options[selbox.options.length] = new Option('اختر الشهر ...','0');
328 selbox.options[selbox.options.length] = new Option('يناير','1');
329 selbox.options[selbox.options.length] = new Option('فبراير','2');
330 selbox.options[selbox.options.length] = new Option('مارس','3');
331 selbox.options[selbox.options.length] = new Option('أبريل','4');
332 selbox.options[selbox.options.length] = new Option('مايو','5');
333 selbox.options[selbox.options.length] = new Option('مايو','6');
334 selbox.options[selbox.options.length] = new Option('يوليو','7');
335 selbox.options[selbox.options.length] = new Option('اغسطس','8');
336 selbox.options[selbox.options.length] = new Option('سبتمبر','9');
337 selbox.options[selbox.options.length] = new Option('اكتوبر','10');
338
339
340 }
341 if (chosen == "2013")
342 {
343 selbox.options[selbox.options.length] = new Option('اختر الشهر ...','0');
344 selbox.options[selbox.options.length] = new Option('يناير','1');
345 selbox.options[selbox.options.length] = new Option('فبراير','2');
346 selbox.options[selbox.options.length] = new Option('مارس','3');
347 /*selbox.options[selbox.options.length] = new Option('أبريل','4');
348 selbox.options[selbox.options.length] = new Option('مايو','5');
349 selbox.options[selbox.options.length] = new Option('مايو','6');
350 selbox.options[selbox.options.length] = new Option('يوليو','7');
351 selbox.options[selbox.options.length] = new Option('اغسطس','8');
352 selbox.options[selbox.options.length] = new Option('سبتمبر','9');
353 selbox.options[selbox.options.length] = new Option('اكتوبر','10');
354
355
356 }
357
358
359 }
360
361 function show()
362 {
363 year = document.getElementById('optone');
364 month = document.getElementById('opttwo');
365 name = month.options[month.selectedIndex].value + '-' + year.options[year.selectedIndex].value + '.pdf'
366
367 document.getElementById('files').src = path + name;
368 }
369
370 ------------- Old Code --------------------------- */
371// ------------- Old Code ---------------------------

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.