PageSourceSearch

https://altahreernews.com/wp-content/themes/expnews/js/plugins.js

js altahreernews.com collected 2026-10-02 21:20:08 UTC 6,713 bytes, 180 lines download raw bytes

1/**
2 * Cookie plugin
3 *
4 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
5 * Dual licensed under the MIT and GPL licenses:
6 * http://www.opensource.org/licenses/mit-license.php
7 * http://www.gnu.org/licenses/gpl.html
8 *
9 */
10 
11/**
12 * Create a cookie with the given name and value and other optional parameters.
13 *
14 * @example $.cookie('the_cookie', 'the_value');
15 * @desc Set the value of a cookie.
16 * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
17 * @desc Create a cookie with all available options.
18 * @example $.cookie('the_cookie', 'the_value');
19 * @desc Create a session cookie.
20 * @example $.cookie('the_cookie', null);
21 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
22 *       used when the cookie was set.
23 *
24 * @param String name The name of the cookie.
25 * @param String value The value of the cookie.
26 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
27 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
28 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
29 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
30 *                             when the the browser exits.
31 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
32 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
33 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
34 *                        require a secure protocol (like HTTPS).
35 * @type undefined
36 *
37 * @name $.cookie
38 * @cat Plugins/Cookie
39 * @author Klaus Hartl/[email protected]
40 */
41 
42/**
43 * Get the value of a cookie with the given name.
44 *
45 * @example $.cookie('the_cookie');
46 * @desc Get the value of a cookie.
47 *
48 * @param String name The name of the cookie.
49 * @return The value of the cookie.
50 * @type String
51 *
52 * @name $.cookie
53 * @cat Plugins/Cookie
54 * @author Klaus Hartl/[email protected]
55 */
56jQuery.cookie=function(e,t,n){if(typeof t!="undefined"){n=n||{};if(t===null){t="";n.expires=-1}var r="";if(n.expires&&(typeof n.expires=="number"||n.expires.toUTCString)){var i;if(typeof n.expires=="number"){i=new Date;i.setTime(i.getTime()+n.expires*24*60*60*1e3)}else{i=n.expires}r="; expires="+i.toUTCString()}var s=n.path?"; path="+n.path:"";var o=n.domain?"; domain="+n.domain:"";var u=n.secure?"; secure":"";document.cookie=[e,"=",encodeURIComponent(t),r,s,o,u].join("")}else{var a=null;if(document.cookie&&document.cookie!=""){var f=document.cookie.split(";");for(var l=0;l<f.length;l++){var c=jQuery.trim(f[l]);if(c.substring(0,e.length+1)==e+"="){a=decodeURIComponent(c.substring(e.length+1));break}}}return a}}
57
58/*!
59 * jQuery imagesLoaded plugin v2.1.1
60 * http://github.com/desandro/imagesloaded
61 *
62 * MIT License. by Paul Irish et al.
63 */
64
65/*jshint curly: true, eqeqeq: true, noempty: true, strict: true, undef: true, browser: true */
66/*global jQuery: false */
67;(function($, undefined) {
68	'use strict';
69	// expnews image data-uri bypasses webkit log warning (thx doug jones)
70	var EXPNEWS = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==';
71
72	$.fn.imagesLoaded = function( callback ) {
73		var $this = this,
74			deferred = $.isFunction($.Deferred) ? $.Deferred() : 0,
75			hasNotify = $.isFunction(deferred.notify),
76			$images = $this.find('img').add( $this.filter('img') ),
77			loaded = [],
78			proper = [],
79			broken = [];
80
81		// Register deferred callbacks
82		if ($.isPlainObject(callback)) {
83			$.each(callback, function (key, value) {
84				if (key === 'callback') {
85					callback = value;
86				} else if (deferred) {
87					deferred[key](value);
88				}
89			});
90		}
91
92		function doneLoading() {
93			var $proper = $(proper),
94				$broken = $(broken);
95
96			if ( deferred ) {
97				if ( broken.length ) {
98					deferred.reject( $images, $proper, $broken );
99				} else {
100					deferred.resolve( $images );
101				}
102			}
103
104			if ( $.isFunction( callback ) ) {
105				callback.call( $this, $images, $proper, $broken );
106			}
107		}
108
109		function imgLoadedHandler( event ) {
110			imgLoaded( event.target, event.type === 'error' );
111		}
112
113		function imgLoaded( img, isBroken ) {
114			// don't proceed if EXPNEWS image, or image is already loaded
115			if ( img.src === EXPNEWS || $.inArray( img, loaded ) !== -1 ) {
116				return;
117			}
118
119			// store element in loaded images array
120			loaded.push( img );
121
122			// keep track of broken and properly loaded images
123			if ( isBroken ) {
124				broken.push( img );
125			} else {
126				proper.push( img );
127			}
128
129			// cache image and its state for future calls
130			$.data( img, 'imagesLoaded', { isBroken: isBroken, src: img.src } );
131
132			// trigger deferred progress method if present
133			if ( hasNotify ) {
134				deferred.notifyWith( $(img), [ isBroken, $images, $(proper), $(broken) ] );
135			}
136
137			// call doneLoading and clean listeners if all images are loaded
138			if ( $images.length === loaded.length ) {
139				setTimeout( doneLoading );
140				$images.unbind( '.imagesLoaded', imgLoadedHandler );
141			}
142		}
143
144		// if no images, trigger immediately
145		if ( !$images.length ) {
146			doneLoading();
147		} else {
148			$images.bind( 'load.imagesLoaded error.imagesLoaded', imgLoadedHandler )
149			.each( function( i, el ) {
150				var src = el.src;
151
152				// find out if this image has been already checked for status
153				// if it was, and src has not changed, call imgLoaded on it
154				var cached = $.data( el, 'imagesLoaded' );
155				if ( cached && cached.src === src ) {
156					imgLoaded( el, cached.isBroken );
157					return;
158				}
159
160				// if complete is true and browser supports natural sizes, try
161				// to check for image status manually
162				if ( el.complete && el.naturalWidth !== undefined ) {
163					imgLoaded( el, el.naturalWidth === 0 || el.naturalHeight === 0 );
164					return;
165				}
166
167				// cached images don't fire load sometimes, so we reset src, but only when
168				// dealing with IE, or image is complete (loaded) and failed manual check
169				// webkit hack from http://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f
170				if ( el.readyState || el.complete ) {
171					el.src = EXPNEWS;
172					el.src = src;
173				}
174			});
175		}
176
177		return deferred ? deferred.promise( $this ) : $this;
178	};
179
180})(jQuery);

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.