var/www/html/wordpress_bak/wp-includes/js | uid:33
tw-sack.js [X]
/* Simple AJAX Code-Kit (SACK) v1.6.1 */
/* ©2005 Gregory Wild-Smith */
/* www.twilightuniverse.com */
/* Software licenced under a modified X11 licence,
   see documentation or authors website for more details */

function sack(file) {
	this.xmlhttp = null;

	this.resetData = function() {
		this.method = "POST";
  		this.queryStringSeparator = "?";
		this.argumentSeparator = "&";
		this.URLString = "";
		this.encodeURIString = true;
  		this.execute = false;
  		this.element = null;
		this.elementObj = null;
		this.requestFile = file;
		this.vars = new Object();
		this.responseStatus = new Array(2);
  	};

	this.resetFunctions = function() {
  		this.onLoading = function() { };
  		this.onLoaded = function() { };
  		this.onInteractive = function() { };
  		this.onCompletion = function() { };
  		this.onError = function() { };
		this.onFail = function() { };
	};

	this.reset = function() {
		this.resetFunctions();
		this.resetData();
	};

	this.createAJAX = function() {
		try {
			this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e1) {
			try {
				this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e2) {
				this.xmlhttp = null;
			}
		}

		if (! this.xmlhttp) {
			if (typeof XMLHttpRequest != "undefined") {
				this.xmlhttp = new XMLHttpRequest();
			} else {
				this.failed = true;
			}
		}
	};

	this.setVar = function(name, value){
		this.vars[name] = Array(value, false);
	};

	this.encVar = function(name, value, returnvars) {
		if (true == returnvars) {
			return Array(encodeURIComponent(name), encodeURIComponent(value));
		} else {
			this.vars[encodeURIComponent(name)] = Array(encodeURIComponent(value), true);
		}
	}

	this.processURLString = function(string, encode) {
		encoded = encodeURIComponent(this.argumentSeparator);
		regexp = new RegExp(this.argumentSeparator + "|" + encoded);
		varArray = string.split(regexp);
		for (i = 0; i < varArray.length; i++){
			urlVars = varArray[i].split("=");
			if (true == encode){
				this.encVar(urlVars[0], urlVars[1]);
			} else {
				this.setVar(urlVars[0], urlVars[1]);
			}
		}
	}

	this.createURLString = function(urlstring) {
		if (this.encodeURIString && this.URLString.length) {
			this.processURLString(this.URLString, true);
		}

		if (urlstring) {
			if (this.URLString.length) {
				this.URLString += this.argumentSeparator + urlstring;
			} else {
				this.URLString = urlstring;
			}
		}

		// prevents caching of URLString
		this.setVar("rndval", new Date().getTime());

		urlstringtemp = new Array();
		for (key in this.vars) {
			if (false == this.vars[key][1] && true == this.encodeURIString) {
				encoded = this.encVar(key, this.vars[key][0], true);
				delete this.vars[key];
				this.vars[encoded[0]] = Array(encoded[1], true);
				key = encoded[0];
			}

			urlstringtemp[urlstringtemp.length] = key + "=" + this.vars[key][0];
		}
		if (urlstring){
			this.URLString += this.argumentSeparator + urlstringtemp.join(this.argumentSeparator);
		} else {
			this.URLString += urlstringtemp.join(this.argumentSeparator);
		}
	}

	this.runResponse = function() {
		eval(this.response);
	}

	this.runAJAX = function(urlstring) {
		if (this.failed) {
			this.onFail();
		} else {
			this.createURLString(urlstring);
			if (this.element) {
				this.elementObj = document.getElementById(this.element);
			}
			if (this.xmlhttp) {
				var self = this;
				if (this.method == "GET") {
					totalurlstring = this.requestFile + this.queryStringSeparator + this.URLString;
					this.xmlhttp.open(this.method, totalurlstring, true);
				} else {
					this.xmlhttp.open(this.method, this.requestFile, true);
					try {
						this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
					} catch (e) { }
				}

				this.xmlhttp.onreadystatechange = function() {
					switch (self.xmlhttp.readyState) {
						case 1:
							self.onLoading();
							break;
						case 2:
							self.onLoaded();
							break;
						case 3:
							self.onInteractive();
							break;
						case 4:
							self.response = self.xmlhttp.responseText;
							self.responseXML = self.xmlhttp.responseXML;
							self.responseStatus[0] = self.xmlhttp.status;
							self.responseStatus[1] = self.xmlhttp.statusText;

							if (self.execute) {
								self.runResponse();
							}

							if (self.elementObj) {
								elemNodeName = self.elementObj.nodeName;
								elemNodeName.toLowerCase();
								if (elemNodeName == "input"
								|| elemNodeName == "select"
								|| elemNodeName == "option"
								|| elemNodeName == "textarea") {
									self.elementObj.value = self.response;
								} else {
									self.elementObj.innerHTML = self.response;
								}
							}
							if (self.responseStatus[0] == "200") {
								self.onCompletion();
							} else {
								self.onError();
							}

							self.URLString = "";
							break;
					}
				};

				this.xmlhttp.send(this.URLString);
			}
		}
	};

	this.reset();
	this.createAJAX();
}
codemirror/-O R D
crop/-O R D
dist/-O R D
imgareaselect/-O R D
jcrop/-O R D
jquery/-O R D
mediaelement/-O R D
plupload/-O R D
swfupload/-O R D
thickbox/-O R D
tinymce/-O R D
admin-bar.js10.3KV E R D
admin-bar.min.js3.4KV E R D
api-request.js3.2KV E R D
api-request.min.js1023V E R D
autosave.js21.9KV E R D
autosave.min.js5.7KV E R D
backbone.js78.5KV E R D
backbone.min.js23.7KV E R D
clipboard.js26.2KV E R D
clipboard.min.js8.8KV E R D
colorpicker.js28.4KV E R D
colorpicker.min.js16.1KV E R D
comment-reply.js12.2KV E R D
comment-reply.min.js3KV E R D
customize-base.js25.2KV E R D
customize-base.min.js7.7KV E R D
customize-loader.js7.7KV E R D
customize-loader.min.js3.5KV E R D
customize-models.js6.7KV E R D
customize-models.min.js3.6KV E R D
customize-preview-nav-menus.js14.7KV E R D
customize-preview-nav-menus.min.js4.9KV E R D
customize-preview-widgets.js22.7KV E R D
customize-preview-widgets.min.js7.6KV E R D
customize-preview.js27.9KV E R D
customize-preview.min.js10.8KV E R D
customize-selective-refresh.js32.6KV E R D
customize-selective-refresh.min.js10.4KV E R D
customize-views.js5.1KV E R D
customize-views.min.js2.5KV E R D
heartbeat.js23.5KV E R D
heartbeat.min.js5.8KV E R D
hoverintent-js.min.js1.7KV E R D
hoverIntent.js7.1KV E R D
hoverIntent.min.js1.5KV E R D
imagesloaded.min.js5.4KV E R D
json2.js31V E R D
json2.min.js35V E R D
masonry.min.js23.6KV E R D
mce-view.js25.2KV E R D
mce-view.min.js9.5KV E R D
media-audiovideo.js24.2KV E R D
media-audiovideo.min.js11.8KV E R D
media-editor.js28.4KV E R D
media-editor.min.js10.6KV E R D
media-grid.js26.2KV E R D
media-grid.min.js13KV E R D
media-models.js42.6KV E R D
media-models.min.js13KV E R D
media-views.js267KV E R D
media-views.min.js108.2KV E R D
quicktags.js22.1KV E R D
quicktags.min.js10.9KV E R D
shortcode.js10.5KV E R D
shortcode.min.js2.6KV E R D
swfobject.js0V E R D
swfobject.min.js35V E R D
tw-sack.js4.9KV E R D
tw-sack.min.js3.2KV E R D
twemoji.js36.3KV E R D
twemoji.min.js19.4KV E R D
underscore.js67.1KV E R D
underscore.min.js18.5KV E R D
utils.js4.6KV E R D
utils.min.js1.8KV E R D
wp-ajax-response.js3.8KV E R D
wp-ajax-response.min.js2.5KV E R D
wp-api.js45.9KV E R D
wp-api.min.js14.3KV E R D
wp-auth-check.js4.1KV E R D
wp-auth-check.min.js1.6KV E R D
wp-backbone.js14.9KV E R D
wp-backbone.min.js3KV E R D
wp-custom-header.js10.2KV E R D
wp-custom-header.min.js4.3KV E R D
wp-embed-template.js6.6KV E R D
wp-embed-template.min.js3.1KV E R D
wp-embed.js3.1KV E R D
wp-embed.min.js1.2KV E R D
wp-emoji-loader.js12.9KV E R D
wp-emoji-loader.min.js2.8KV E R D
wp-emoji-release.min.js22.2KV E R D
wp-emoji.js8.6KV E R D
wp-emoji.min.js2.8KV E R D
wp-list-revisions.js970V E R D
wp-list-revisions.min.js597V E R D
wp-lists.js24.7KV E R D
wp-lists.min.js7.3KV E R D
wp-pointer.js10KV E R D
wp-pointer.min.js3.5KV E R D
wp-sanitize.js1.3KV E R D
wp-sanitize.min.js444V E R D
wp-util.js4.6KV E R D
wp-util.min.js1.4KV E R D
wpdialog.js569V E R D
wpdialog.min.js281V E R D
wplink.js20.7KV E R D
wplink.min.js11.1KV E R D
zxcvbn-async.js821V E R D
zxcvbn-async.min.js351V E R D
zxcvbn.min.js803KV E R D