-
+ B1D705F33297EC5BE97856650570926F221976BCB892D53F15DCD769C1281A45D6FCA1CDDF6BC249FACBE63B0AC5D4AA8A6F82D8165CB0EF9033DBFB1F0A7E15
mp-wp/wp-includes/js/swfupload/plugins/swfupload.documentready.js
(0 . 0)(1 . 102)
116458 /*
116459 DocumentReady Plug-in
116460
116461 This plugin loads SWFUpload as soon as the document is ready. You should not load SWFUpload inside window.onload using this plugin.
116462 You can also chain other functions by calling SWFUpload.DocumentReady(your function).
116463
116464 Warning: Embedded Ads or other scripts that overwrite window.onload or use their own document ready functions may interfer with this plugin. You
116465 should not set window.onload when using this plugin.
116466
116467 Usage Example:
116468
116469 var swfu = new SWFUpload(your settings object);
116470 SWFUpload.DocumentReady(function () { alert('Document Ready!'; });
116471
116472 */
116473
116474 var SWFUpload;
116475 if (typeof(SWFUpload) === "function") {
116476 // Override iniSWFUpload so SWFUpload gets inited when the document is ready rather than immediately
116477 SWFUpload.prototype.initSWFUpload = function (old_initSWFUpload) {
116478 return function (init_settings) {
116479 var self = this;
116480 if (typeof(old_initSWFUpload) === "function") {
116481 SWFUpload.DocumentReady(function () {
116482 old_initSWFUpload.call(self, init_settings);
116483 });
116484 }
116485 }
116486
116487 }(SWFUpload.prototype.initSWFUpload);
116488
116489
116490 // The DocumentReady function adds the passed in function to
116491 // the functions that will be executed when the document is ready/loaded
116492 SWFUpload.DocumentReady = function (fn) {
116493 // Add the function to the chain
116494 SWFUpload.DocumentReady.InternalOnloadChain = function (previous_link_fn) {
116495 return function () {
116496 if (typeof(previous_link_fn) === "function") {
116497 previous_link_fn();
116498 }
116499 fn();
116500 };
116501 }(SWFUpload.DocumentReady.InternalOnloadChain);
116502 };
116503 SWFUpload.DocumentReady.InternalOnloadChain = null;
116504 SWFUpload.DocumentReady.Onload = function () {
116505 // Execute the onload function chain
116506 if (typeof(SWFUpload.DocumentReady.InternalOnloadChain) === "function") {
116507 SWFUpload.DocumentReady.InternalOnloadChain();
116508 }
116509 };
116510 SWFUpload.DocumentReady.SetupComplete = false;
116511
116512
116513 /* ********************************************
116514 This portion of the code gets executed as soon it is loaded.
116515 It binds the proper event for executing JavaScript is
116516 early as possible. This is a per browser function and so
116517 some browser sniffing is used.
116518
116519 This solution still has the "exposed" issue (See the Global Delegation section at http://peter.michaux.ca/article/553 )
116520
116521 Base solution from http://dean.edwards.name/weblog/2006/06/again/ and http://dean.edwards.name/weblog/2005/09/busted/
116522 ******************************************** */
116523 if (!SWFUpload.DocumentReady.SetupComplete) {
116524 // for Internet Explorer (using conditional comments)
116525 /*@cc_on @*/
116526 /*@if (@_win32)
116527 document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
116528 var script = document.getElementById("__ie_onload");
116529 script.onreadystatechange = function() {
116530 if (this.readyState == "complete") {
116531 SWFUpload.DocumentReady.Onload(); // call the onload handler
116532 }
116533 };
116534 SWFUpload.DocumentReady.SetupComplete = true;
116535 /*@end @*/
116536 }
116537
116538 if (!SWFUpload.DocumentReady.SetupComplete && /WebKit/i.test(navigator.userAgent)) { // sniff
116539 var _timer = setInterval(function() {
116540 if (/loaded|complete/.test(document.readyState)) {
116541 clearInterval(_timer);
116542 SWFUpload.DocumentReady.Onload(); // call the onload handler
116543 }
116544 }, 10);
116545 SWFUpload.DocumentReady.SetupComplete = true;
116546 }
116547
116548 /* for Mozilla */
116549 if (!SWFUpload.DocumentReady.SetupComplete && document.addEventListener) {
116550 document.addEventListener("DOMContentLoaded", SWFUpload.DocumentReady.Onload, false);
116551 SWFUpload.DocumentReady.SetupComplete = true;
116552 }
116553
116554 /* for other browsers */
116555 if (!SWFUpload.DocumentReady.SetupComplete) {
116556 window.onload = SWFUpload.DocumentReady.Onload;
116557 SWFUpload.DocumentReady.SetupComplete = true;
116558 }
116559 }