CoreFiles by mySites.guru
swfupload.graceful_degradation.js63 lines, 2,523 bytes, from wordpress-2.5-RC1.zip
Raw History Compare with 2.3.2-RC1
md5
c47842876b724ba4a76eb043d4783aca
sha1
aeea1fad759e1921fb0eb5ba1b61099f27036b8c
sha256
f22c370415e0423e1ebec7623af158859a5fc993d301052d8497ab6056e30f99
/* 
	SWFUpload Graceful Degradation Plug-in

	This plugin allows SWFUpload to display only if it is loaded successfully.  Otherwise a default form is left displayed.
	
	Usage:
	
	To use this plugin create two HTML containers. Each should have an ID defined.  One container should hold the SWFUpload UI.  The other should hold the degraded UI.
	
	The SWFUpload container should have its CSS "display" property set to "none".
	
	If SWFUpload loads successfully the SWFUpload container will be displayed ("display" set to "block") and the
	degraded container will be hidden ("display" set to "none").
	
	Use the settings "swfupload_element_id" and "degraded_element_id" to indicate your container IDs.  The default values are "swfupload_container" and "degraded_container".
	
*/

var SWFUpload;
if (typeof(SWFUpload) === "function") {
	SWFUpload.gracefulDegradation = {};
	SWFUpload.prototype.initSettings = function (old_initSettings) {
		return function (init_settings) {
			if (typeof(old_initSettings) === "function") {
				old_initSettings.call(this, init_settings);
			}
			
			this.addSetting("swfupload_element_id",		  		init_settings.swfupload_element_id,				"swfupload_container");
			this.addSetting("degraded_element_id",		  		init_settings.degraded_element_id,				"degraded_container");
			this.addSetting("user_swfUploadLoaded_handler",		init_settings.swfupload_loaded_handler,			SWFUpload.swfUploadLoaded);

			this.swfUploadLoaded_handler = SWFUpload.gracefulDegradation.swfUploadLoaded;
		};
	}(SWFUpload.prototype.initSettings);

	SWFUpload.gracefulDegradation.swfUploadLoaded = function () {
		var swfupload_container_id, swfupload_container, degraded_container_id, degraded_container, user_swfUploadLoaded_handler;
		try {
			swfupload_element_id = this.getSetting("swfupload_element_id");
			degraded_element_id = this.getSetting("degraded_element_id");
			
			// Show the UI container
			swfupload_container = document.getElementById(swfupload_element_id);
			if (swfupload_container !== null) {
				swfupload_container.style.display = "block";

				// Now take care of hiding the degraded UI
				degraded_container = document.getElementById(degraded_element_id);
				if (degraded_container !== null) {
					degraded_container.style.display = "none";
				}
			}
		} catch (ex) {
			this.debug(ex);
		}
		
		user_swfUploadLoaded_handler = this.getSetting("user_swfUploadLoaded_handler");
		if (typeof(user_swfUploadLoaded_handler) === "function") {
			user_swfUploadLoaded_handler.apply(this);
		}
	};

}

No other release has this exact content. See every version of this file.