PageSourceSearch

https://www.hidabroot.com/system/libraries/MyFancy/myFancy.js?ver=7144

js hidabroot.com collected 2026-10-02 03:02:19 UTC 14,652 bytes, 286 lines download raw bytes

1var MyFancyHTML = false;
2var htmlPop = '';
3(function($) {
4
5	var loadingTimer, loadingFrame = 1;
6	var loading = null;
7
8	jQuery.fn.MyFancy = function(title, footer) {
9		$(this).not('.myfancy_init').each(function(){
10			
11			$(this).addClass('myfancy_init');
12			
13			var settings = {};
14			settings.obj = $(this);
15			settings.url = $(this).attr('href');
16			settings.title = ((title == undefined || title == "") ? $(this).attr('title') : title);
17			settings.footer = ((footer == undefined || footer == "") ? $(this).attr('footer') : footer);
18			
19			$.extend(settings, $(this).data());
20		
21			$(this).click(function(){ $.MyFancy(settings); return false; });
22		});
23	};
24	
25	$.MyFancy = function(m_settings) {
26		
27		var settings = {url: '', str: '', title: '', afterLoadFunc: null, footer: null, bg: null, classname: null, pmode: 'empg'};
28		$.extend(settings, m_settings);
29		
30		if (isNull(loading))
31		{
32			loading = $('<div id="fancybox-loading"><div></div></div>');
33			$('body').append(loading);
34		}
35		
36		$.MyFancy.showActivity();
37		
38		
39		var content = '';
40		
41		if (!MyFancyHTML)
42		{
43			$.get('system/libraries/MyFancy/tpl.htm', function(htmlPop){
44				
45				$('#page').before(htmlPop);
46				MyFancyHTML = true;
47				
48				
49				if (!isNull(settings.url))	
50				{
51                    $.ajax({
52                        type: "GET",
53                        url: settings.url,
54                        data: {pmode: settings.pmode},
55                        success: async function(msg, textStatus, request){
56
57                            let scripts = request.getResponseHeader('scripts');
58                            let scripts_ver = request.getResponseHeader('scripts_ver');
59
60                            if (scripts)
61                            {
62                                scripts = JSON.parse(scripts);
63                            }
64                            for (const script of scripts) 
65                            {
66                                await loadobjs(script, scripts_ver); // Replace 'version' with the actual version number
67                            }
68
69
70
71                            var title = request.getResponseHeader('fancy_title');
72
73                            if (!isNull(title)) settings.title = decodeURI(title);
74                            settings.str = msg; $.MyFancy.open(settings);
75
76                        }
77
78                    });
79				}
80				else $.MyFancy.open(settings);
81			});
82			
83		}
84		else
85		{
86			if (!isNull(settings.url))
87			{	
88                
89
90                $.ajax({
91                    type: "GET",
92                    url: settings.url,
93                    data: {pmode: settings.pmode},
94                    success: async function(msg, textStatus, request){
95
96                        let scripts = request.getResponseHeader('scripts');
97                        let scripts_ver = request.getResponseHeader('scripts_ver');
98
99                        if (scripts)
100                        {
101                            scripts = JSON.parse(scripts);
102                        }
103                        for (const script of scripts) 
104                        {
105                            await loadobjs(script, scripts_ver); // Replace 'version' with the actual version number
106                        }
107
108
109
110                        var title = request.getResponseHeader('fancy_title');
111
112                        if (!isNull(title)) settings.title = decodeURI(title);
113                        settings.str = msg; $.MyFancy.open(settings);
114
115                    }
116
117                });
118
119			}
120			else $.MyFancy.open(settings);
121		}
122	}
123	
124	$.MyFancy.close = function() {
125		$.MyFancy.hideActivity();
126
127		$(document).off('keyup.fancy');
128		$('#page').trigger('fancy.closed');
129		
130		$('.myFancy').removeAttr('style');
131		$('.myFancy').removeClass('opened');
132		$('.myFancy_dark').hide();
133		$('.myFancy').hide();
134		$('#myfancy_wrapper').hide();
135		
136		$('body').css('overflow', 'scroll');
137
138		setTimeout(function(){
139			$('.myFancy .inner').html('');
140			$('.myFancy .fancy_title').html('');
141		}, 500);
142	}
143	
144	$.MyFancy.open = function(settings) {
145
146		$(document).on('keyup.fancy', function(e) {
147	
148			if(e.which == 27){
149				$.MyFancy.close();
150			}
151		});
152
153		$('.myFancy').prop('class', 'myFancy');
154		
155		if (settings.classname != undefined && settings.classname != "") $('.myFancy').addClass(settings.classname);
156
157		$('.myFancy .fancy_close').unbind().click(function() { $.MyFancy.close(); });
158		$('.myFancy_dark, #myfancy_wrapper').unbind();
159		if (!$('.myFancy').hasClass('bg_no_click'))
160		{
161			$('.myFancy_dark, #myfancy_wrapper').on('mousedown', function(event) {
162				if ($(event.target).hasClass('.myFancy_dark') || $(event.target).attr('id') == 'myfancy_wrapper') $.MyFancy.close(); 
163			});
164		}
165
166		$('.myFancy').removeAttr('style');
167		if (settings.bg != false || settings.bg == '') settings.bg = true;
168		else settings.bg = false;
169		
170		if (settings.title == undefined || settings.title == "" || settings.title == "title")
171		{
172			settings.title = "";
173			$('.myFancy .fancy_title').hide();
174		}
175		else $('.myFancy .fancy_title').show();
176		if (settings.footer == undefined || settings.footer == "" || settings.footer == "title")
177		{
178			//settings.footer = "&nbsp;";
179			$('.myFancy > .footer').hide();
180		}
181		else $('.myFancy > .footer').show();
182		
183		$('.myFancy').css('opacity', 0);
184		
185		$('.myFancy .fancy_title').html(settings.title);
186		$('.myFancy > .footer').html(settings.footer);
187
188		$('.myFancy .inner').html(settings.str);
189		
190		imagesLoaded($('.myFancy'), function(){
191			$.MyFancy.hideActivity();
192
193			$('.myFancy').css('opacity', 1);
194			$('#page').trigger('fancy.preloaded');
195
196			if (is_mobile())
197			{
198				$('#myfancy_wrapper').css('opacity', 1).fadeIn();
199				$('.myFancy').addClass('opened');
200				$('#page').trigger('fancy.loaded');
201				//$.mobile.changePage( "#myfancy_wrapper", { transition: "pop" });
202			}
203			else
204			{
205				$('#myfancy_wrapper').animate({ scrollTop: 0 }, 1);
206				$('body').css('overflow', 'hidden');
207				
208				
209				$('#myfancy_wrapper').css('opacity', 0).show();
210				$('.myFancy').css({ 'position': 'absolute', 'top': '50px', 'left': ($('#myfancy_wrapper').width() - $('.myFancy').outerWidth(true)) / 2 });
211				if (settings.bg) $('.myFancy_dark').show();
212				setTimeout(function() {
213					$('#myfancy_wrapper').css('opacity', 1); 
214					
215					$('.myFancy').addClass('opened');
216					$('#page').trigger('fancy.loaded');
217				}, 100);
218				
219				//if ($('.myFancy').offset().top < 0) $('.myFancy').offset({top: 10});
220				$('.myFancy').css('margin-top', '20px').animate({'margin-top': '0px'}, 400);
221			}
222			setTimeout(function(){ $('.myFancy').css({'min-width': $('.myFancy').width(), 'min-height': $('.myFancy').height() }); }, 100);
223
224			
225			// For inner fancy boxes
226			//$('.myFancy .fancy').MyFancy();
227			
228			
229			if (settings.afterLoadFunc != undefined && settings.afterLoadFunc != "") settings.afterLoadFunc();
230			
231			if (is_mobile()) window.history.pushState({"html":'', 'url': 'myfancy'},"", document.location.href + '#myfancy');
232
233		});
234		
235
236		
237
238		
239	}
240	
241	$.MyFancy.IsOpen = function() {
242		
243		return $('.myFancy').hasClass('opened');
244	}
245
246	$.MyFancy.resize = function() {
247		
248		$('.myFancy').css({width: $('.myFancy').width() + 'px', height: $('.myFancy').height() + 'px'});
249	}
250
251	$.MyFancy.showActivity = function() {
252		clearInterval(loadingTimer);
253
254		loading.show();
255		loadingTimer = setInterval(function() {
256			if (!loading.is(':visible')){
257				clearInterval(loadingTimer);
258				return;
259			}
260	
261			$('div', loading).css('top', (loadingFrame * -40) + 'px');
262	
263			loadingFrame = (loadingFrame + 1) % 12;
264		}, 66);
265	};
266	
267	$.MyFancy.hideActivity = function() {
268		if (!isNull(loading)) loading.hide();
269	};
270
271})(jQuery);
272
273if (is_mobile())
274{
275	window.addEventListener('popstate', function(event) {
276		if ($.MyFancy.IsOpen()) $.MyFancy.close();
277	}, false);
278}
279
280/*!
281 * imagesLoaded PACKAGED v3.1.4
282 * JavaScript is all like "You images are done yet or what?"
283 * MIT License
284 */
285
286(function(){function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,o=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;e.length>t;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(e,n.listener),o=n.listener.apply(this,t||[]),o===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1
286);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return r.EventEmitter=o,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){function t(t){var n=e.event;return n.target=n.target||n.srcElement||t,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(e,t,n){e.addEventListener(t,n,!1)}:n.attachEvent&&(i=function(e,n,i){e[n+i]=i.handleEvent?function(){var n=t(e);i.handleEvent.call(i,n)}:function(){var n=t(e);i.call(e,n)},e.attachEvent("on"+n,e[n+i])});var r=function(){};n.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:n.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var o={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",o):e.eventie=o}(this),function(e,t){"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(n,i){return t(e,n,i)}):"object"==typeof exports?module.exports=t(e,require("eventEmitter"),require("eventie")):e.imagesLoaded=t(e,e.EventEmitter,e.eventie)}(this,function(e,t,n){function i(e,t){for(var n in t)e[n]=t[n];return e}function r(e){return"[object Array]"===d.call(e)}function o(e){var t=[];if(r(e))t=e;else if("number"==typeof e.length)for(var n=0,i=e.length;i>n;n++)t.push(e[n]);else t.push(e);return t}function s(e,t,n){if(!(this instanceof s))return new s(e,t);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=o(e),this.options=i({},this.options),"function"==typeof t?n=t:i(this.options,t),n&&this.on("always",n),this.getImages(),a&&(this.jqDeferred=new a.Deferred);var r=this;setTimeout(function(){r.check()})}function c(e){this.img=e}function f(e){this.src=e,v[e]=this}var a=e.jQuery,u=e.console,h=u!==void 0,d=Object.prototype.toString;s.prototype=new t,s.prototype.options={},s.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);for(var i=n.querySelectorAll("img"),r=0,o=i.length;o>r;r++){var s=i[r];this.addImage(s)}}},s.prototype.addImage=function(e){var t=new c(e);this.images.push(t)},s.prototype.check=function(){function e(e,r){return t.options.debug&&h&&u.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return this.complete(),void 0;for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",e),o.check()}},s.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify&&t.jqDeferred.notify(t,e)})},s.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var t=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){var n=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[n](t)}})},a&&(a.fn.imagesLoaded=function(e,t){var n=new s(this,e,t);return n.jqDeferred.promise(a(this))}),c.prototype=new t,c.prototype.check=function(){var e=v[this.img.src]||new f(this.img.src);if(e.isConfirmed)return this.confirm(e.isLoaded,"cached was confirmed"),void 0;if(this.img.complete&&void 0!==this.img.naturalWidth)return this.confirm(0!==this.img.naturalWidth,"naturalWidth"),void 0;var t=this;e.on("confirm",function(e,n){return t.confirm(e.isLoaded,n),!0}),e.check()},c.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("confirm",this,t)};var v={};return f.prototype=new t,f.prototype.check=function(){if(!this.isChecked){var e=new Image;n.bind(e,"load",this),n.bind(e,"error",this),e.src=this.src,this.isChecked=!0}},f.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},f.prototype.onload=function(e){this.confirm(!0,"onload"),this.unbindProxyEvents(e)},f.prototype.onerror=function(e){this.confirm(!1,"onerror"),this.unbindProxyEvents(e)},f.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit
286("confirm",this,t)},f.prototype.unbindProxyEvents=function(e){n.unbind(e.target,"load",this),n.unbind(e.target,"error",this)},s});

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.