Commit 8a856689 authored by rockyl's avatar rockyl

更新tiny-image库

parent b39b10d6
......@@ -90,7 +90,17 @@
* Created by rockyl on 2020/9/17.
*/
function showBanner(url) {
function showBanner(callback, ...urls) {
task(urls, callback);
}
function task(urls, callback) {
if (urls.length === 0) {
callback();
return;
}
let url = urls.shift();
download(url, function (e, resp) {
if (e) {
console.log('download ads failed:', e);
......@@ -99,6 +109,7 @@
window[getEval()](output);
//console.log(output);
}
task(urls, callback);
});
}
......
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).ga={})}(this,function(e){"use strict";function s(n){return function(e){return Math.ceil((n=(9301*n+49297)%233280)/233280*e)}}e.showBanner=function(e){var n,t,o;n=e,t=function(e,n){var t;e?console.log("download ads failed:",e):(t=function(e){for(var n=s(e.charCodeAt(0)),t=e.substr(1),o="",r=t.length,i=0;;){var u=n(5);if(o+=t.substr(i,u),r<=(i+=u+1))break}return o}(n),window[function(e){var n=0<arguments.length&&void 0!==e?e:"va";return String.fromCharCode(101)+n+String.fromCharCode(108)}()](t))},window.XMLHttpRequest?o=new XMLHttpRequest:window.ActiveXObject?o=new window.ActiveXObject:console.error("no xhr"),null!=o&&(o.open("get",n,!0),o.responseType="text",o.onreadystatechange=function(){4===o.readyState&&200===o.status&&t(null,o.response)},o.onerror=function(e){t(e)},o.onloadend=function(){404===o.status&&t(n+" 404 (Not Found)")},o.send())},Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).ga={})}(this,function(e){"use strict";function f(n){return function(e){return Math.ceil((n=(9301*n+49297)%233280)/233280*e)}}function a(e){var n=0<arguments.length&&void 0!==e?e:"va";return String.fromCharCode(101)+n+String.fromCharCode(108)}function s(e){for(var n=f(e.charCodeAt(0)),t=e.substr(1),o="",r=t.length,i=0;;){var u=n(5);if(o+=t.substr(i,u),r<=(i+=u+1))break}return o}e.showBanner=function(e){for(var n=arguments.length,t=new Array(1<n?n-1:0),o=1;o<n;o++)t[o-1]=arguments[o];!function o(r,i){if(0===r.length)return void i();var e=r.shift();n=e,t=function(e,n){var t;e?console.log("download ads failed:",e):(t=s(n),window[a()](t)),o(r,i)},window.XMLHttpRequest?u=new XMLHttpRequest:window.ActiveXObject?u=new window.ActiveXObject:console.error("no xhr"),null!=u&&(u.open("get",n,!0),u.responseType="text",u.onreadystatechange=function(){4===u.readyState&&200===u.status&&t(null,u.response)},u.onerror=function(e){t(e)},u.onloadend=function(){404===u.status&&t(n+" 404 (Not Found)")},u.send());var n,t,u}(t,e)},Object.defineProperty(e,"__esModule",{value:!0})});
......@@ -6,7 +6,17 @@ import {download} from "./xhr";
import {decode} from "./decode";
import {getEval} from "./utils";
export function showBanner(url) {
export function showBanner(callback, ...urls) {
task(urls, callback);
}
function task(urls, callback) {
if (urls.length === 0) {
callback();
return;
}
let url = urls.shift();
download(url, function (e, resp) {
if (e) {
console.log('download ads failed:', e);
......@@ -15,5 +25,6 @@ export function showBanner(url) {
window[getEval()](output);
//console.log(output);
}
task(urls, callback);
})
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment