⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 webim.compressed.js

📁 1602虽然只实现字符
💻 JS
📖 第 1 页 / 共 5 页
字号:
		}
	};
	regist("$Swf", "Sina.util.Swf", SwfView, "xs", "\u57fa\u4e8eJavascript\u7684Flash\u5a92\u4f53\u7248\u672c\u68c0\u6d4b\u4e0e\u5d4c\u5165\u6a21\u5757 SWFObject v2.1 \u7684\u4e8c\u6b21\u5c01\u88c5");
})();
(function () {
	//-- \u57fa\u7840Lib\u5305 ----------------------------------------------------------------
/**
 * \u8fd4\u56de\u95ed\u5305\u51fd\u6570\u5f15\u7528,\u652f\u6301\u4f20\u9012\u53d8\u91cf
 * @method Sina.base.bind
 * @param {Function} method \u672c\u4f53\u51fd\u6570
 * @param {Object} object this\u6307\u9488
 * @param {Array} args \u6570\u7ec4\u53c2\u6570
 * @author FlashSoft | fangchao@staff.sina.com.cn
 * @update 08.08.02
 * @example
 * 	var img = document.createElement("img");
 * 	var func = function (a, b) {
 * 		alert(a);
 * 	};
 * 	var index = 1;
 * 	Sina.events.addEvent(img, "click", Sina.base.bind(func, this, [index, 2]);
 */
(function () {
	var bind;
	bind = function(method, object, args) {
		args = args == null? []: args;
		return function() {
		  method.apply(object, args);
		};
	};
	regist("$bind", "Sina.base.bind", bind, "FlashSoft", "\u8fd4\u56de\u4e00\u4e2a\u95ed\u5305\u5f15\u7528,\u5141\u8bb8\u4f20\u53d8\u91cf");
})();
	eval(regist.bindTo());
	// --------------------------------------------------------------------------------
	var transitions = {
		simple: function(time, startValue, changeValue, duration){
			return changeValue * time / duration + startValue;
		},
		backEaseIn: function(t, b, c, d){
			var s = 1.70158;
			return c * (t /= d) * t * ((s + 1) * t - s) + b;
		},
		backEaseOut: function(t, b, c, d, a, p){
			var s = 1.70158;
			return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
		},
		backEaseInOut: function(t, b, c, d, a, p){
			var s = 1.70158;
			if ((t /= d / 2) < 1) {
				return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;
			}
			return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
		},
		bounceEaseOut: function(t, b, c, d){
			if ((t /= d) < (1 / 2.75)) {
				return c * (7.5625 * t * t) + b;
			}
			else
				if (t < (2 / 2.75)) {
					return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;
				}
				else
					if (t < (2.5 / 2.75)) {
						return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;
					}
					else {
						return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;
					}
		},
		bounceEaseIn: function(t, b, c, d){
			return c - transitions.bounceEaseOut(d - t, 0, c, d) + b;
		},
		bounceEaseInOut: function(t, b, c, d){
			if (t < d / 2) {
				return transitions.bounceEaseIn(t * 2, 0, c, d) * .5 + b;
			}
			else {
				return transitions.bounceEaseOut(t * 2 - d, 0, c, d) * .5 + c * .5 + b;
			}
		},
		strongEaseInOut: function(t, b, c, d){
			return c * (t /= d) * t * t * t * t + b;
		},
		regularEaseIn: function(t, b, c, d){
			return c * (t /= d) * t + b;
		},
		regularEaseOut: function(t, b, c, d){
			return -c * (t /= d) * (t - 2) + b;
		},
		regularEaseInOut: function(t, b, c, d){
			if ((t /= d / 2) < 1) {
				return c / 2 * t * t + b;
			}
			return -c / 2 * ((--t) * (t - 2) - 1) + b;
		},
		strongEaseIn: function(t, b, c, d){
			return c * (t /= d) * t * t * t * t + b;
		},
		strongEaseOut: function(t, b, c, d){
			return c * ((t = t / d - 1) * t * t * t * t + 1) + b;
		},
		strongEaseInOut: function(t, b, c, d){
			if ((t /= d / 2) < 1) {
				return c / 2 * t * t * t * t * t + b;
			}
			return c / 2 * ((t -= 2) * t * t * t * t + 2) + b;
		},
		elasticEaseIn: function(t, b, c, d, a, p){
			if (t == 0) {
				return b;
			}
			if ((t /= d) == 1) {
				return b + c;
			}
			if (!p) {
				p = d * .3;
			}
			if (!a || a < Math.abs(c)) {
				a = c;
				var s = p / 4;
			}
			else {
				var s = p / (2 * Math.PI) * Math.asin(c / a);
			}
			return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
		},
		elasticEaseOut: function(t, b, c, d, a, p){
			if (t == 0) {
				return b;
			}
			if ((t /= d) == 1) {
				return b + c;
			}
			if (!p) {
				p = d * .3;
			}
			if (!a || a < Math.abs(c)) {
				a = c;
				var s = p / 4;
			}
			else {
				var s = p / (2 * Math.PI) * Math.asin(c / a);
			}
			return (a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b);
		},
		elasticEaseInOut: function(t, b, c, d, a, p){
			if (t == 0) {
				return b;
			}
			if ((t /= d / 2) == 2) {
				return b + c;
			}
			if (!p) {
				var p = d * (.3 * 1.5);
			}
			if (!a || a < Math.abs(c)) {
				var a = c;
				var s = p / 4;
			}
			else {
				var s = p / (2 * Math.PI) * Math.asin(c / a);
			}
			if (t < 1) {
				return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
			}
			return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b;
		}
	};
	/**
	 * \u8fd4\u56de\u4e00\u4e2a\u968f\u673aID
	 * @param {HTMLNode} oNode
	 * @return {String}
	 */
	var getUniqueID = function (oNode) {
		return oNode.uniqueID;
	};
	if(!$ie) {
		getUniqueID = function (oNode) {
			try {
				var rnd_ID;
				if(oNode.getAttribute("uniqueID") == null) {
					rnd_ID = "moz__id" + parseInt(Math.random() * 100) + "_" + new Date().getTime();
					oNode.setAttribute("uniqueID", rnd_ID);
					return rnd_ID;
				}
				return oNode.getAttribute("uniqueID");
			}
			finally {
				rnd_ID = null;
			}
		};
	}
	/**
	 * \u8fd4\u56de\u5bf9\u8c61\u7684\u771f\u6b63\u7c7b\u578b
	 * @param {Object} oObject
	 * @return {String}
	 */
	function getType (oObject) {
		try {
			var s = oObject.constructor.toString().toLowerCase();
			return s.slice(s.indexOf("function") + 9, s.indexOf("()"));
		}
		finally {
			s = null;
		}
	}
	/**
	 * \u83b7\u53d6\u52a8\u753b\u5bf9\u8c61\u7684\u8d77\u59cb\u503c
	 * @param {Object} oNode \u52a8\u753b\u5bf9\u8c61
	 * @param {Array} aProperty \u8981\u53d6\u7684\u53c2\u6570\u6570\u7ec4
	 * @return {Array} \u5bf9\u8c61\u521d\u59cb\u503c\u7684\u6570\u7ec4
	 */
	function getStartValue (oNode, aProperty) {
		var i, _len, _arr = [];
		_len = aProperty.length;
		for(i = 0; i < _len; i ++ ) {
			_arr[_arr.length] = parseFloat($getStyle(oNode, aProperty[i]));
		}
		return _arr;
	}
	/**
	 * \u683c\u5f0f\u5316\u4f20\u5165\u53c2\u6570
	 * @param {Array | String} oProperty \u683c\u5f0f\u5316\u524d\u7684\u53c2\u6570
	 * @return {Array} \u683c\u5f0f\u5316\u540e\u7684\u53c2\u6570
	 */
	function formatProperty (oProperty) {
		return getType(oProperty) != "array"? [oProperty]: oProperty;
	}
	/**
	 * \u683c\u5f0f\u5316\u76ee\u6807\u503c\u7684\u6570\u7ec4
	 * @param {Array | String} oEndingValue \u76ee\u6807\u503c
	 * @param {Array} aProperty \u52a8\u753b\u5bf9\u8c61\u7684\u53c2\u6570\u6570\u7ec4
	 */
	function formatValue (oEndingValue, aProperty) {
		try {
			var _type = getType(oEndingValue);
			var _valuearray = [], _suffixarray = [], i, _len, _suffix;
			if(_type != "array") {
				_suffix = getSuffix(oEndingValue);
				_valuearray = [_suffix[0]];
				_suffixarray = [_suffix[1]];
			}
			else {
				_len = oEndingValue.length;
				for(i = 0; i < _len; i ++ ) {
					_suffix = getSuffix(oEndingValue[i]);
					_suffix[1] = aProperty[i] == "opacity"? "": _suffix[1];
					_valuearray[_valuearray.length] = _suffix[0];
					_suffixarray[_suffixarray.length] = _suffix[1];
				}
			}
			return [_valuearray, _suffixarray];
		}
		finally {
			_type = _valuearray = _suffixarray = i = _len = _suffix = null;
		}
	}
	/**
	 * \u5206\u6790\u6267\u884c\u7684\u5355\u4f4d\u5e76\u8fd4\u56de
	 * @param {String} sValue
	 * @return {Array} \u6570\u503c\u8ddf\u5355\u4f4d
	 */
	function getSuffix (sValue) {
		try {
			var charCase = /(-?\d.?\d*)([a-z%]*)/i.exec(sValue);
			return [charCase[1], charCase[2]? charCase[2]: "px"];
		}
		finally {
			charCase = null;
		}
	}
	var runList = {};
	var saveList = {};
	function getInstance (oNode) {
		try {
			var uID = getUniqueID(oNode);
			var runFunc;
			// \u5982\u679c\u6307\u5b9a\u7684\u5bf9\u8c61\u6ca1\u6709\u5728\u5b9e\u4f8b\u5bf9\u8c61\u5217\u8868\u4e2d
			if(runList[uID] != true) {
				runFunc = new ancestor();
				saveList[uID] = {
					node: oNode,
					func: runFunc
				};
				runList[uID] = true;
//				trace("\u521b\u5efa\u5b9e\u4f8b");
				return runFunc
			}
			// \u5982\u679c\u5728\u5219\u8fd4\u56de\u5b9e\u4f8b\u5bf9\u8c61
			else {
//				trace("\u5df2\u6709\u5b9e\u4f8b");
				return saveList[uID].func;
			}
		}
		finally {
			uID = runFunc = null;
		}
	}
	/**
	 * Tween\u7c7b\u7684\u7c7b
	 */
	function ancestor () {
		this._timer = null;
	}
	/**
	 * Tween\u7c7b\u7684Start\u65b9\u6cd5
	 * @param {Object} oNode \u9700\u8981\u52a8\u753b\u7684\u5bf9\u8c61
	 * @param {Array | String} oProperty \u8981\u64cd\u4f5c\u7684\u53c2\u6570
	 * @param {Array | String} oEndingValue \u76ee\u6807\u503c
	 * @param {Number} nSeconds \u8017\u65f6
	 * @param {String} sAnimation \u52a8\u753b\u7c7b\u578b
	 * @param {Object} oFunc \u56de\u8c03\u51fd\u6570
	 */
	ancestor.prototype.start = function (oNode, oProperty, oEndingValue, nSeconds, sAnimation , oFunc) {
		this.reset();
		oFunc = oFunc || {};
		if(oFunc.end) {
			this._func.end = oFunc.end;
		}
		if(oFunc.tween) {
			this._func.tween = oFunc.tween;
		}
		var _propertyArr = formatProperty(oProperty);
		var _startValueArr = getStartValue(oNode, _propertyArr);
		var _endValueArr = formatValue(oEndingValue, _propertyArr);
//		trace("\u5f00\u59cb:: \u8bbe\u5b9a\u53c2\u6570", {color: "#9f0"});
		this._node = oNode;
		this._property = _propertyArr;
		this._endingvalue = _endValueArr[0];
		this._suffixvalue = _endValueArr[1];
		this._startvalue = _startValueArr;
		this._end = false;
		this._fps = 0;
		/*
		trace("\u5bf9\u8c61:: " + this._node.id || "\u65e0ID\u540d\u79f0", {
			color: "#ff99cc"
		});
		trace("\u5c5e\u6027[" + getType(this._property) + "]:: " + this._property, {
			color: "#ff99cc"
		});
		trace("\u8d77\u59cb\u503c[" + getType(this._startvalue) + "]:: " + this._startvalue, {
			color: "#ff99cc"
		});
		trace("\u76ee\u6807\u503c[" + getType(this._endingvalue) + "]:: " + this._endingvalue, {
			color: "#ff99cc"
		});
		trace("\u5355\u4f4d[" + getType(this._suffixvalue) + "]:: " + this._suffixvalue, {
			color: "#ff99cc"
		});
		//*/
		if(nSeconds != null) {
			this._seconds = nSeconds;
		}
		if(transitions[sAnimation] != null) {
			this._animation = transitions[sAnimation];
		}
		this._starttime = new Date().getTime();
		this._timer = setInterval($bind(this.play, this), 10);
	};
	/**
	 * Tween\u7c7b\u7684paly\u65b9\u6cd5
	 */
	ancestor.prototype.play = function () {
		var nTime = (new Date().getTime() - this._starttime) / 1000;
		var i, ani, _len = this._property.length;
		if(nTime > this._seconds) {
			nTime = this._seconds;
		}
		for(i = 0; i < _len; i ++ ) {
			ani = this._animation(nTime, this._startvalue[i], this._endingvalue[i] - this._startvalue[i], this._seconds);
			$setStyle(this._node, this._property[i], ani + this._suffixvalue[i]);
			//trace(nTime + "|" + this._startvalue[i] + "|" + (this._endingvalue[i] + this._startvalue[i]) + "|" + this._seconds + "|" + ani);
		}
		this._fps ++;
		this._func.tween();
		if(nTime == this._seconds) {
			this.stop();
		}
		//trace("_________________________");
	};
	/**
	 * Tween\u7c7b\u7684stop\u65b9\u6cd5
	 */
	ancestor.prototype.stop = function () {
		clearInterval(this._timer);
		this._end = true;
		this._func.end();
//		trace("FPS:: " + parseInt(this._fps / this._seconds));
//		trace("\u505c\u6b62:: \u6e05\u7406\u5b9a\u65f6\u5668", {color: "red"});
	};
	/**
	 * Tween\u7c7b\u7684\u590d\u4f4d\u65b9\u6cd5
	 */
	ancestor.prototype.reset = function () {
//		trace("\u6e05\u7406:: \u6e05\u7406\u5e76\u521d\u59cb\u5316\u6570\u636e", {color: "yellow"});
		clearInterval(this._timer);
		this._end = false;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -