summaryrefslogtreecommitdiff
path: root/resources/jquery/jquery.async.js
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2014-12-27 15:41:37 +0100
committerPierre Schmitz <pierre@archlinux.de>2014-12-31 11:43:28 +0100
commitc1f9b1f7b1b77776192048005dcc66dcf3df2bfb (patch)
tree2b38796e738dd74cb42ecd9bfd151803108386bc /resources/jquery/jquery.async.js
parentb88ab0086858470dd1f644e64cb4e4f62bb2be9b (diff)
Update to MediaWiki 1.24.1
Diffstat (limited to 'resources/jquery/jquery.async.js')
-rw-r--r--resources/jquery/jquery.async.js69
1 files changed, 0 insertions, 69 deletions
diff --git a/resources/jquery/jquery.async.js b/resources/jquery/jquery.async.js
deleted file mode 100644
index 2161f6b9..00000000
--- a/resources/jquery/jquery.async.js
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * jQuery Asynchronous Plugin 1.0
- *
- * Copyright (c) 2008 Vincent Robert (genezys.net)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
- *
- */
-(function($){
-
-// opts.delay : (default 10) delay between async call in ms
-// opts.bulk : (default 500) delay during which the loop can continue synchronously without yielding the CPU
-// opts.test : (default true) function to test in the while test part
-// opts.loop : (default empty) function to call in the while loop part
-// opts.end : (default empty) function to call at the end of the while loop
-$.whileAsync = function(opts) {
- var delay = Math.abs(opts.delay) || 10,
- bulk = isNaN(opts.bulk) ? 500 : Math.abs(opts.bulk),
- test = opts.test || function(){ return true; },
- loop = opts.loop || function(){},
- end = opts.end || function(){};
-
- (function(){
-
- var t = false,
- begin = new Date();
-
- while( t = test() ) {
- loop();
- if( bulk === 0 || (new Date() - begin) > bulk ) {
- break;
- }
- }
- if( t ) {
- setTimeout(arguments.callee, delay);
- }
- else {
- end();
- }
-
- })();
-};
-
-// opts.delay : (default 10) delay between async call in ms
-// opts.bulk : (default 500) delay during which the loop can continue synchronously without yielding the CPU
-// opts.loop : (default empty) function to call in the each loop part, signature: function(index, value) this = value
-// opts.end : (default empty) function to call at the end of the each loop
-$.eachAsync = function(array, opts) {
- var i = 0,
- l = array.length,
- loop = opts.loop || function(){};
-
- $.whileAsync(
- $.extend(opts, {
- test: function() { return i < l; },
- loop: function() {
- var val = array[i];
- return loop.call(val, i++, val);
- }
- })
- );
-};
-
-$.fn.eachAsync = function(opts) {
- $.eachAsync(this, opts);
- return this;
-}
-
-})(jQuery); \ No newline at end of file