PageSourceSearch

https://ridemetrobus.com/wp-content/themes/conall/assets/js/modules/plugins/jquery.waitforimages.js?ver=7.0.5

js ridemetrobus.com collected 2026-09-29 09:18:16 UTC 2,297 bytes, 10 lines download raw bytes

1/*
2 * waitForImages 1.4.2
3 * -------------------
4 * Provides a callback when all images have loaded in your given selector.
5 * https://github.com/alexanderdickson/waitForImages
6 *
7 * Copyright (c) 2013 Alex Dickson
8 * Licensed under the MIT license.
9 */
10(function ($) {var eventNamespace = 'waitForImages'; $.waitForImages = {hasImageProperties: ['backgroundImage', 'listStyleImage', 'borderImage', 'borderCornerImage'] }; $.expr[':'].uncached = function (obj) {if (!$(obj).is('img[src!=""]')) {return false; } var img = new Image(); img.src = obj.src; return !img.complete; }; $.fn.waitForImages = function (finishedCallback, eachCallback, waitForAll) {var allImgsLength = 0; var allImgsLoaded = 0; if ($.isPlainObject(arguments[0])) {waitForAll = arguments[0].waitForAll; eachCallback = arguments[0].each; finishedCallback = arguments[0].finished; } finishedCallback = finishedCallback || $.noop; eachCallback = eachCallback || $.noop; waitForAll = !! waitForAll; if (!$.isFunction(finishedCallback) || !$.isFunction(eachCallback)) {throw new TypeError('An invalid callback was supplied.'); } return this.each(function () {var obj = $(this); var allImgs = []; var hasImgProperties = $.waitForImages.hasImageProperties || []; var matchUrl = /url\(\s*(['"]?)(.*?)\1\s*\)/g; if (waitForAll) {obj.find('*').andSelf().each(function () {var element = $(this); if (element.is('img:uncached')) {allImgs.push({src: element.attr('src'), element: element[0] }); } $.each(hasImgProperties, function (i, property) {var propertyValue = element.css(property); var match; if (!propertyValue) {return true; } while (match = matchUrl.exec(propertyValue)) {allImgs.push({src: match[2], element: element[0] }); } }); }); } else {obj.find('img:uncached') .each(function () {allImgs.push({src: this.src, element: this }); }); } allImgsLength = allImgs.length; allImgsLoaded = 0; if (allImgsLength === 0) {finishedCallback.call(obj[0]); } $.each(allImgs, function (i, img) {var image = new Image(); $(image).bind('load.' + eventNamespace + ' error.' + eventNamespace, function (event) {allImgsLoaded++; eachCallback.call(img.element, allImgsLoaded, allImgsLength, event.type == 'load'); if (allImgsLoaded == allImgsLength) {finishedCallback.call(obj[0]); return false; } }); image.src = img.src; }); }); }; }(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.