6758 lines
200 KiB
JavaScript
6758 lines
200 KiB
JavaScript
define('BASE64',function(require, exports, module) {
|
|
|
|
var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""); //索引表
|
|
|
|
/**
|
|
* @author laixiangran@163.com
|
|
* @description 将二进制序列转换为Base64编码
|
|
* @param {String}
|
|
* @return {String}
|
|
*/
|
|
function binToBase64(bitString) {
|
|
var result = "";
|
|
var tail = bitString.length % 6;
|
|
var bitStringTemp1 = bitString.substr(0, bitString.length - tail);
|
|
var bitStringTemp2 = bitString.substr(bitString.length - tail, tail);
|
|
for (var i = 0; i < bitStringTemp1.length; i += 6) {
|
|
var index = parseInt(bitStringTemp1.substr(i, 6), 2);
|
|
result += code[index];
|
|
}
|
|
bitStringTemp2 += new Array(7 - tail).join("0");
|
|
if (tail) {
|
|
result += code[parseInt(bitStringTemp2, 2)];
|
|
result += new Array((6 - tail) / 2 + 1).join("=");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/**
|
|
* @author laixiangran@163.com
|
|
* @description 将base64编码转换为二进制序列
|
|
* @param {String}
|
|
* @return {String}
|
|
*/
|
|
function base64ToBin(str) {
|
|
var bitString = "";
|
|
var tail = 0;
|
|
for (var i = 0; i < str.length; i++) {
|
|
if (str[i] != "=") {
|
|
var decode = code.indexOf(str[i]).toString(2);
|
|
bitString += (new Array(7 - decode.length)).join("0") + decode;
|
|
} else {
|
|
tail++;
|
|
}
|
|
}
|
|
return bitString.substr(0, bitString.length - tail * 2);
|
|
}
|
|
|
|
/**
|
|
* @author laixiangran@163.com
|
|
* @description 将字符转换为二进制序列
|
|
* @param {String} str
|
|
* @return {String}
|
|
*/
|
|
function stringToBin(str) {
|
|
var result = "";
|
|
for (var i = 0; i < str.length; i++) {
|
|
var charCode = str.charCodeAt(i).toString(2);
|
|
result += (new Array(9 - charCode.length).join("0") + charCode);
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/**
|
|
* @author laixiangran@163.com
|
|
* @description 将二进制序列转换为字符串
|
|
* @param {String} Bin
|
|
*/
|
|
function BinToStr(Bin) {
|
|
var result = "";
|
|
for (var i = 0; i < Bin.length; i += 8) {
|
|
result += String.fromCharCode(parseInt(Bin.substr(i, 8), 2));
|
|
}
|
|
return result;
|
|
}
|
|
|
|
exports.decodeBase64 = function(str) {
|
|
return BinToStr(base64ToBin(str));
|
|
}
|
|
exports.encodeBase64 = function(str) {
|
|
return binToBase64(stringToBin(str));
|
|
}
|
|
})
|
|
define('md5',function(require, exports, module) {
|
|
|
|
jQuery = $;
|
|
|
|
/**
|
|
* jQuery MD5 hash algorithm function
|
|
*
|
|
* <code>
|
|
* Calculate the md5 hash of a String
|
|
* String $.md5 ( String str )
|
|
* </code>
|
|
*
|
|
* Calculates the MD5 hash of str using the 禄 RSA Data Security, Inc. MD5 Message-Digest Algorithm, and returns that hash.
|
|
* MD5 (Message-Digest algorithm 5) is a widely-used cryptographic hash function with a 128-bit hash value. MD5 has been employed in a wide variety of security applications, and is also commonly used to check the integrity of data. The generated hash is also non-reversable. Data cannot be retrieved from the message digest, the digest uniquely identifies the data.
|
|
* MD5 was developed by Professor Ronald L. Rivest in 1994. Its 128 bit (16 byte) message digest makes it a faster implementation than SHA-1.
|
|
* This script is used to process a variable length message into a fixed-length output of 128 bits using the MD5 algorithm. It is fully compatible with UTF-8 encoding. It is very useful when u want to transfer encrypted passwords over the internet. If you plan using UTF-8 encoding in your project don't forget to set the page encoding to UTF-8 (Content-Type meta tag).
|
|
* This function orginally get from the WebToolkit and rewrite for using as the jQuery plugin.
|
|
*
|
|
* Example
|
|
* Code
|
|
* <code>
|
|
* $.md5("I'm Persian.");
|
|
* </code>
|
|
* Result
|
|
* <code>
|
|
* "b8c901d0f02223f9761016cfff9d68df"
|
|
* </code>
|
|
*
|
|
* @alias Muhammad Hussein Fattahizadeh < muhammad [AT] semnanweb [DOT] com >
|
|
* @link http://www.semnanweb.com/jquery-plugin/md5.html
|
|
* @see http://www.webtoolkit.info/
|
|
* @license http://www.gnu.org/licenses/gpl.html [GNU General Public License]
|
|
* @param {jQuery} {md5:function(string))
|
|
* @return string
|
|
*/
|
|
(function($){
|
|
var rotateLeft = function(lValue, iShiftBits) {
|
|
return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));
|
|
}
|
|
var addUnsigned = function(lX, lY) {
|
|
var lX4, lY4, lX8, lY8, lResult;
|
|
lX8 = (lX & 0x80000000);
|
|
lY8 = (lY & 0x80000000);
|
|
lX4 = (lX & 0x40000000);
|
|
lY4 = (lY & 0x40000000);
|
|
lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF);
|
|
if (lX4 & lY4) return (lResult ^ 0x80000000 ^ lX8 ^ lY8);
|
|
if (lX4 | lY4) {
|
|
if (lResult & 0x40000000) return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);
|
|
else return (lResult ^ 0x40000000 ^ lX8 ^ lY8);
|
|
} else {
|
|
return (lResult ^ lX8 ^ lY8);
|
|
}
|
|
}
|
|
var F = function(x, y, z) {
|
|
return (x & y) | ((~ x) & z);
|
|
}
|
|
var G = function(x, y, z) {
|
|
return (x & z) | (y & (~ z));
|
|
}
|
|
var H = function(x, y, z) {
|
|
return (x ^ y ^ z);
|
|
}
|
|
var I = function(x, y, z) {
|
|
return (y ^ (x | (~ z)));
|
|
}
|
|
var FF = function(a, b, c, d, x, s, ac) {
|
|
a = addUnsigned(a, addUnsigned(addUnsigned(F(b, c, d), x), ac));
|
|
return addUnsigned(rotateLeft(a, s), b);
|
|
};
|
|
var GG = function(a, b, c, d, x, s, ac) {
|
|
a = addUnsigned(a, addUnsigned(addUnsigned(G(b, c, d), x), ac));
|
|
return addUnsigned(rotateLeft(a, s), b);
|
|
};
|
|
var HH = function(a, b, c, d, x, s, ac) {
|
|
a = addUnsigned(a, addUnsigned(addUnsigned(H(b, c, d), x), ac));
|
|
return addUnsigned(rotateLeft(a, s), b);
|
|
};
|
|
var II = function(a, b, c, d, x, s, ac) {
|
|
a = addUnsigned(a, addUnsigned(addUnsigned(I(b, c, d), x), ac));
|
|
return addUnsigned(rotateLeft(a, s), b);
|
|
};
|
|
var convertToWordArray = function(string) {
|
|
var lWordCount;
|
|
var lMessageLength = string.length;
|
|
var lNumberOfWordsTempOne = lMessageLength + 8;
|
|
var lNumberOfWordsTempTwo = (lNumberOfWordsTempOne - (lNumberOfWordsTempOne % 64)) / 64;
|
|
var lNumberOfWords = (lNumberOfWordsTempTwo + 1) * 16;
|
|
var lWordArray = Array(lNumberOfWords - 1);
|
|
var lBytePosition = 0;
|
|
var lByteCount = 0;
|
|
while (lByteCount < lMessageLength) {
|
|
lWordCount = (lByteCount - (lByteCount % 4)) / 4;
|
|
lBytePosition = (lByteCount % 4) * 8;
|
|
lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount) << lBytePosition));
|
|
lByteCount++;
|
|
}
|
|
lWordCount = (lByteCount - (lByteCount % 4)) / 4;
|
|
lBytePosition = (lByteCount % 4) * 8;
|
|
lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition);
|
|
lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
|
|
lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
|
|
return lWordArray;
|
|
};
|
|
var wordToHex = function(lValue) {
|
|
var WordToHexValue = "", WordToHexValueTemp = "", lByte, lCount;
|
|
for (lCount = 0; lCount <= 3; lCount++) {
|
|
lByte = (lValue >>> (lCount * 8)) & 255;
|
|
WordToHexValueTemp = "0" + lByte.toString(16);
|
|
WordToHexValue = WordToHexValue + WordToHexValueTemp.substr(WordToHexValueTemp.length - 2, 2);
|
|
}
|
|
return WordToHexValue;
|
|
};
|
|
var uTF8Encode = function(string) {
|
|
string = string.replace(/\x0d\x0a/g, "\x0a");
|
|
var output = "";
|
|
for (var n = 0; n < string.length; n++) {
|
|
var c = string.charCodeAt(n);
|
|
if (c < 128) {
|
|
output += String.fromCharCode(c);
|
|
} else if ((c > 127) && (c < 2048)) {
|
|
output += String.fromCharCode((c >> 6) | 192);
|
|
output += String.fromCharCode((c & 63) | 128);
|
|
} else {
|
|
output += String.fromCharCode((c >> 12) | 224);
|
|
output += String.fromCharCode(((c >> 6) & 63) | 128);
|
|
output += String.fromCharCode((c & 63) | 128);
|
|
}
|
|
}
|
|
return output;
|
|
};
|
|
$.extend({
|
|
md5: function(string) {
|
|
var x = Array();
|
|
var k, AA, BB, CC, DD, a, b, c, d;
|
|
var S11=7, S12=12, S13=17, S14=22;
|
|
var S21=5, S22=9 , S23=14, S24=20;
|
|
var S31=4, S32=11, S33=16, S34=23;
|
|
var S41=6, S42=10, S43=15, S44=21;
|
|
string = uTF8Encode(string);
|
|
x = convertToWordArray(string);
|
|
a = 0x67452301; b = 0xEFCDAB89; c = 0x98BADCFE; d = 0x10325476;
|
|
for (k = 0; k < x.length; k += 16) {
|
|
AA = a; BB = b; CC = c; DD = d;
|
|
a = FF(a, b, c, d, x[k+0], S11, 0xD76AA478);
|
|
d = FF(d, a, b, c, x[k+1], S12, 0xE8C7B756);
|
|
c = FF(c, d, a, b, x[k+2], S13, 0x242070DB);
|
|
b = FF(b, c, d, a, x[k+3], S14, 0xC1BDCEEE);
|
|
a = FF(a, b, c, d, x[k+4], S11, 0xF57C0FAF);
|
|
d = FF(d, a, b, c, x[k+5], S12, 0x4787C62A);
|
|
c = FF(c, d, a, b, x[k+6], S13, 0xA8304613);
|
|
b = FF(b, c, d, a, x[k+7], S14, 0xFD469501);
|
|
a = FF(a, b, c, d, x[k+8], S11, 0x698098D8);
|
|
d = FF(d, a, b, c, x[k+9], S12, 0x8B44F7AF);
|
|
c = FF(c, d, a, b, x[k+10], S13, 0xFFFF5BB1);
|
|
b = FF(b, c, d, a, x[k+11], S14, 0x895CD7BE);
|
|
a = FF(a, b, c, d, x[k+12], S11, 0x6B901122);
|
|
d = FF(d, a, b, c, x[k+13], S12, 0xFD987193);
|
|
c = FF(c, d, a, b, x[k+14], S13, 0xA679438E);
|
|
b = FF(b, c, d, a, x[k+15], S14, 0x49B40821);
|
|
a = GG(a, b, c, d, x[k+1], S21, 0xF61E2562);
|
|
d = GG(d, a, b, c, x[k+6], S22, 0xC040B340);
|
|
c = GG(c, d, a, b, x[k+11], S23, 0x265E5A51);
|
|
b = GG(b, c, d, a, x[k+0], S24, 0xE9B6C7AA);
|
|
a = GG(a, b, c, d, x[k+5], S21, 0xD62F105D);
|
|
d = GG(d, a, b, c, x[k+10], S22, 0x2441453);
|
|
c = GG(c, d, a, b, x[k+15], S23, 0xD8A1E681);
|
|
b = GG(b, c, d, a, x[k+4], S24, 0xE7D3FBC8);
|
|
a = GG(a, b, c, d, x[k+9], S21, 0x21E1CDE6);
|
|
d = GG(d, a, b, c, x[k+14], S22, 0xC33707D6);
|
|
c = GG(c, d, a, b, x[k+3], S23, 0xF4D50D87);
|
|
b = GG(b, c, d, a, x[k+8], S24, 0x455A14ED);
|
|
a = GG(a, b, c, d, x[k+13], S21, 0xA9E3E905);
|
|
d = GG(d, a, b, c, x[k+2], S22, 0xFCEFA3F8);
|
|
c = GG(c, d, a, b, x[k+7], S23, 0x676F02D9);
|
|
b = GG(b, c, d, a, x[k+12], S24, 0x8D2A4C8A);
|
|
a = HH(a, b, c, d, x[k+5], S31, 0xFFFA3942);
|
|
d = HH(d, a, b, c, x[k+8], S32, 0x8771F681);
|
|
c = HH(c, d, a, b, x[k+11], S33, 0x6D9D6122);
|
|
b = HH(b, c, d, a, x[k+14], S34, 0xFDE5380C);
|
|
a = HH(a, b, c, d, x[k+1], S31, 0xA4BEEA44);
|
|
d = HH(d, a, b, c, x[k+4], S32, 0x4BDECFA9);
|
|
c = HH(c, d, a, b, x[k+7], S33, 0xF6BB4B60);
|
|
b = HH(b, c, d, a, x[k+10], S34, 0xBEBFBC70);
|
|
a = HH(a, b, c, d, x[k+13], S31, 0x289B7EC6);
|
|
d = HH(d, a, b, c, x[k+0], S32, 0xEAA127FA);
|
|
c = HH(c, d, a, b, x[k+3], S33, 0xD4EF3085);
|
|
b = HH(b, c, d, a, x[k+6], S34, 0x4881D05);
|
|
a = HH(a, b, c, d, x[k+9], S31, 0xD9D4D039);
|
|
d = HH(d, a, b, c, x[k+12], S32, 0xE6DB99E5);
|
|
c = HH(c, d, a, b, x[k+15], S33, 0x1FA27CF8);
|
|
b = HH(b, c, d, a, x[k+2], S34, 0xC4AC5665);
|
|
a = II(a, b, c, d, x[k+0], S41, 0xF4292244);
|
|
d = II(d, a, b, c, x[k+7], S42, 0x432AFF97);
|
|
c = II(c, d, a, b, x[k+14], S43, 0xAB9423A7);
|
|
b = II(b, c, d, a, x[k+5], S44, 0xFC93A039);
|
|
a = II(a, b, c, d, x[k+12], S41, 0x655B59C3);
|
|
d = II(d, a, b, c, x[k+3], S42, 0x8F0CCC92);
|
|
c = II(c, d, a, b, x[k+10], S43, 0xFFEFF47D);
|
|
b = II(b, c, d, a, x[k+1], S44, 0x85845DD1);
|
|
a = II(a, b, c, d, x[k+8], S41, 0x6FA87E4F);
|
|
d = II(d, a, b, c, x[k+15], S42, 0xFE2CE6E0);
|
|
c = II(c, d, a, b, x[k+6], S43, 0xA3014314);
|
|
b = II(b, c, d, a, x[k+13], S44, 0x4E0811A1);
|
|
a = II(a, b, c, d, x[k+4], S41, 0xF7537E82);
|
|
d = II(d, a, b, c, x[k+11], S42, 0xBD3AF235);
|
|
c = II(c, d, a, b, x[k+2], S43, 0x2AD7D2BB);
|
|
b = II(b, c, d, a, x[k+9], S44, 0xEB86D391);
|
|
a = addUnsigned(a, AA);
|
|
b = addUnsigned(b, BB);
|
|
c = addUnsigned(c, CC);
|
|
d = addUnsigned(d, DD);
|
|
}
|
|
var tempValue = wordToHex(a) + wordToHex(b) + wordToHex(c) + wordToHex(d);
|
|
return tempValue.toLowerCase();
|
|
}
|
|
});
|
|
})(jQuery);
|
|
|
|
|
|
})
|
|
define('eventUtil',['logger'],function(require, exports, module) {
|
|
var logger = require('logger');
|
|
|
|
|
|
var indexId = 0;
|
|
|
|
var getNextId = function(){
|
|
return indexId ++;
|
|
}
|
|
|
|
var eventClass = function(){
|
|
var eventArray = [];
|
|
this.addEvent = function(name,fn){
|
|
// logger.debug(['event util addEvent',name,fn]);
|
|
var evt = {
|
|
name:name,
|
|
fn:fn
|
|
};
|
|
eventArray.push(evt);
|
|
}
|
|
this.removeEvent = function(name,fn){
|
|
// logger.debug(['event util removeEvent',name,fn]);
|
|
var newArr = [];
|
|
for(var i in eventArray){
|
|
var e = eventArray[i];
|
|
if(e.name == name && e.fn == fn){
|
|
// logger.debug("event util removeEvent found:"+name);
|
|
}else{
|
|
newArr.push(e);
|
|
}
|
|
}
|
|
eventArray = newArr;
|
|
}
|
|
this.trigerEvent = function(name,data){
|
|
// logger.debug(['event util trigerEvent',name,data]);
|
|
for(var i in eventArray){
|
|
var e = eventArray[i];
|
|
if(e && e.name == name){
|
|
// logger.debug(["event util trigerEvent found:",name,data]);
|
|
e.fn.apply(window,[data]);
|
|
}
|
|
}
|
|
}
|
|
|
|
this.getEvents = function(){
|
|
return eventArray;
|
|
}
|
|
};
|
|
|
|
|
|
|
|
var eventInstances = {};
|
|
|
|
/**
|
|
* 创建一个时间处理器实例,传一个名字,如果name为空则实例一个,如果不为空则返回已有的实例或者新建一个
|
|
* @prama 处理器名字,
|
|
* @return 事件处理实例
|
|
*/
|
|
var careteEventInstance = function(name){
|
|
if(!name){
|
|
|
|
return new eventClass();
|
|
}
|
|
|
|
if(name in eventInstances){
|
|
|
|
return eventInstances[name];
|
|
}
|
|
var instance = new eventClass();
|
|
eventInstances[name] = instance;
|
|
|
|
|
|
return instance;
|
|
}
|
|
|
|
|
|
module.exports = {
|
|
getInstance:careteEventInstance
|
|
};
|
|
|
|
window.eventUtil = module.exports;
|
|
|
|
});
|
|
define('logger',function(require, exports, module) {
|
|
|
|
var logger = function(lv,args){};
|
|
|
|
logger.prototype={
|
|
log:function(){},
|
|
debug:function(){},
|
|
info:function(){},
|
|
warn:function(){},
|
|
error:function(){}
|
|
};
|
|
|
|
var enable = false;
|
|
window.enableLog=function(stat){
|
|
enable = !!stat;
|
|
}
|
|
|
|
|
|
if(location.href.indexOf("debug")!=-1 || (document.referrer||"").indexOf("debug")!=-1 ){
|
|
enable = true;
|
|
}
|
|
|
|
|
|
var loggerName = ["log", "info", "debug", "warn","error"];
|
|
|
|
|
|
|
|
var exp ;
|
|
var console = window.console;
|
|
|
|
if(console && enable){
|
|
exp = console;
|
|
}else{
|
|
exp = new logger();
|
|
}
|
|
|
|
for (var i in loggerName) {
|
|
var n = loggerName[i];
|
|
if(!exp[n]){
|
|
exp[n]=logger.prototype[n];
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 格式化数字,显示未两位数,小于10前面加0
|
|
*/
|
|
var fillLen = function(n){
|
|
if(n<10){
|
|
n = "0"+n;
|
|
}
|
|
return String(n);
|
|
}
|
|
var fillLen3 = function(n){
|
|
if(n <10){
|
|
n = "00"+n;
|
|
}else if(n < 100){
|
|
n = "0"+n;
|
|
}
|
|
return String(n);
|
|
}
|
|
|
|
exp.time = function(){
|
|
var d = new Date();
|
|
var r = d.getFullYear()+"-"+ fillLen(1+d.getMonth())+"-"+fillLen(d.getDate());
|
|
r+=" "+fillLen(d.getHours())+":"+fillLen(d.getMinutes())+":"+fillLen(d.getSeconds())+"."+fillLen3(d.getMilliseconds());
|
|
return r;
|
|
|
|
}
|
|
|
|
module.exports = exp;
|
|
|
|
});
|
|
/*! SWFObject v2.2 <http://code.google.com/p/swfobject/>
|
|
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
|
|
*/
|
|
define('swfobject',function(require, exports, module) {
|
|
var UNDEF = "undefined", OBJECT = "object", SHOCKWAVE_FLASH = "Shockwave Flash", SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash", FLASH_MIME_TYPE = "application/x-shockwave-flash", EXPRESS_INSTALL_ID = "SWFObjectExprInst", ON_READY_STATE_CHANGE = "onreadystatechange", win = window, doc = document, nav = navigator, plugin = false, domLoadFnArr = [ main ], regObjArr = [], objIdArr = [], listenersArr = [], storedAltContent, storedAltContentId, storedCallbackFn, storedCallbackObj, isDomLoaded = false, isExpressInstallActive = false, dynamicStylesheet, dynamicStylesheetMedia, autoHideShow = true, /* Centralized function for browser feature detection
|
|
- User agent string detection is only used when no good alternative is possible
|
|
- Is executed directly for optimal performance
|
|
*/
|
|
ua = function() {
|
|
var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF, u = nav.userAgent.toLowerCase(), p = nav.platform.toLowerCase(), windows = p ? /win/.test(p) : /win/.test(u), mac = p ? /mac/.test(p) : /mac/.test(u), webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
|
|
ie = !+"1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
|
|
playerVersion = [ 0, 0, 0 ], d = null;
|
|
if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
|
|
d = nav.plugins[SHOCKWAVE_FLASH].description;
|
|
if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) {
|
|
// navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
|
|
plugin = true;
|
|
ie = false;
|
|
// cascaded feature detection for Internet Explorer
|
|
d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
|
|
playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
|
|
playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
|
|
playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
|
|
}
|
|
} else if (typeof win.ActiveXObject != UNDEF) {
|
|
try {
|
|
var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
|
|
if (a) {
|
|
// a will return null when ActiveX is disabled
|
|
d = a.GetVariable("$version");
|
|
if (d) {
|
|
ie = true;
|
|
// cascaded feature detection for Internet Explorer
|
|
d = d.split(" ")[1].split(",");
|
|
playerVersion = [ parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10) ];
|
|
}
|
|
}
|
|
} catch (e) {}
|
|
}
|
|
return {
|
|
w3: w3cdom,
|
|
pv: playerVersion,
|
|
wk: webkit,
|
|
ie: ie,
|
|
win: windows,
|
|
mac: mac
|
|
};
|
|
}(), /* Cross-browser onDomLoad
|
|
- Will fire an event as soon as the DOM of a web page is loaded
|
|
- Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
|
|
- Regular onload serves as fallback
|
|
*/
|
|
onDomLoad = function() {
|
|
if (!ua.w3) {
|
|
return;
|
|
}
|
|
if (typeof doc.readyState != UNDEF && doc.readyState == "complete" || typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body)) {
|
|
// function is fired after onload, e.g. when script is inserted dynamically
|
|
callDomLoadFunctions();
|
|
}
|
|
if (!isDomLoaded) {
|
|
if (typeof doc.addEventListener != UNDEF) {
|
|
doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
|
|
}
|
|
if (ua.ie && ua.win) {
|
|
doc.attachEvent(ON_READY_STATE_CHANGE, function() {
|
|
if (doc.readyState == "complete") {
|
|
doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
|
|
callDomLoadFunctions();
|
|
}
|
|
});
|
|
if (win == top) {
|
|
// if not inside an iframe
|
|
(function() {
|
|
if (isDomLoaded) {
|
|
return;
|
|
}
|
|
try {
|
|
doc.documentElement.doScroll("left");
|
|
} catch (e) {
|
|
setTimeout(arguments.callee, 0);
|
|
return;
|
|
}
|
|
callDomLoadFunctions();
|
|
})();
|
|
}
|
|
}
|
|
if (ua.wk) {
|
|
(function() {
|
|
if (isDomLoaded) {
|
|
return;
|
|
}
|
|
if (!/loaded|complete/.test(doc.readyState)) {
|
|
setTimeout(arguments.callee, 0);
|
|
return;
|
|
}
|
|
callDomLoadFunctions();
|
|
})();
|
|
}
|
|
addLoadEvent(callDomLoadFunctions);
|
|
}
|
|
}();
|
|
function callDomLoadFunctions() {
|
|
if (isDomLoaded) {
|
|
return;
|
|
}
|
|
try {
|
|
// test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
|
|
var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
|
|
t.parentNode.removeChild(t);
|
|
} catch (e) {
|
|
return;
|
|
}
|
|
isDomLoaded = true;
|
|
var dl = domLoadFnArr.length;
|
|
for (var i = 0; i < dl; i++) {
|
|
domLoadFnArr[i]();
|
|
}
|
|
}
|
|
function addDomLoadEvent(fn) {
|
|
if (isDomLoaded) {
|
|
fn();
|
|
} else {
|
|
domLoadFnArr[domLoadFnArr.length] = fn;
|
|
}
|
|
}
|
|
/* Cross-browser onload
|
|
- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
|
|
- Will fire an event as soon as a web page including all of its assets are loaded
|
|
*/
|
|
function addLoadEvent(fn) {
|
|
if (typeof win.addEventListener != UNDEF) {
|
|
win.addEventListener("load", fn, false);
|
|
} else if (typeof doc.addEventListener != UNDEF) {
|
|
doc.addEventListener("load", fn, false);
|
|
} else if (typeof win.attachEvent != UNDEF) {
|
|
addListener(win, "onload", fn);
|
|
} else if (typeof win.onload == "function") {
|
|
var fnOld = win.onload;
|
|
win.onload = function() {
|
|
fnOld();
|
|
fn();
|
|
};
|
|
} else {
|
|
win.onload = fn;
|
|
}
|
|
}
|
|
/* Main function
|
|
- Will preferably execute onDomLoad, otherwise onload (as a fallback)
|
|
*/
|
|
function main() {
|
|
if (plugin) {
|
|
testPlayerVersion();
|
|
} else {
|
|
matchVersions();
|
|
}
|
|
}
|
|
/* Detect the Flash Player version for non-Internet Explorer browsers
|
|
- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
|
|
a. Both release and build numbers can be detected
|
|
b. Avoid wrong descriptions by corrupt installers provided by Adobe
|
|
c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
|
|
- Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
|
|
*/
|
|
function testPlayerVersion() {
|
|
var b = doc.getElementsByTagName("body")[0];
|
|
var o = createElement(OBJECT);
|
|
o.setAttribute("type", FLASH_MIME_TYPE);
|
|
var t = b.appendChild(o);
|
|
if (t) {
|
|
var counter = 0;
|
|
(function() {
|
|
if (typeof t.GetVariable != UNDEF) {
|
|
var d = t.GetVariable("$version");
|
|
if (d) {
|
|
d = d.split(" ")[1].split(",");
|
|
ua.pv = [ parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10) ];
|
|
}
|
|
} else if (counter < 10) {
|
|
counter++;
|
|
setTimeout(arguments.callee, 10);
|
|
return;
|
|
}
|
|
b.removeChild(o);
|
|
t = null;
|
|
matchVersions();
|
|
})();
|
|
} else {
|
|
matchVersions();
|
|
}
|
|
}
|
|
/* Perform Flash Player and SWF version matching; static publishing only
|
|
*/
|
|
function matchVersions() {
|
|
var rl = regObjArr.length;
|
|
if (rl > 0) {
|
|
for (var i = 0; i < rl; i++) {
|
|
// for each registered object element
|
|
var id = regObjArr[i].id;
|
|
var cb = regObjArr[i].callbackFn;
|
|
var cbObj = {
|
|
success: false,
|
|
id: id
|
|
};
|
|
if (ua.pv[0] > 0) {
|
|
var obj = getElementById(id);
|
|
if (obj) {
|
|
if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) {
|
|
// Flash Player version >= published SWF version: Houston, we have a match!
|
|
setVisibility(id, true);
|
|
if (cb) {
|
|
cbObj.success = true;
|
|
cbObj.ref = getObjectById(id);
|
|
cb(cbObj);
|
|
}
|
|
} else if (regObjArr[i].expressInstall && canExpressInstall()) {
|
|
// show the Adobe Express Install dialog if set by the web page author and if supported
|
|
var att = {};
|
|
att.data = regObjArr[i].expressInstall;
|
|
att.width = obj.getAttribute("width") || "0";
|
|
att.height = obj.getAttribute("height") || "0";
|
|
if (obj.getAttribute("class")) {
|
|
att.styleclass = obj.getAttribute("class");
|
|
}
|
|
if (obj.getAttribute("align")) {
|
|
att.align = obj.getAttribute("align");
|
|
}
|
|
// parse HTML object param element's name-value pairs
|
|
var par = {};
|
|
var p = obj.getElementsByTagName("param");
|
|
var pl = p.length;
|
|
for (var j = 0; j < pl; j++) {
|
|
if (p[j].getAttribute("name").toLowerCase() != "movie") {
|
|
par[p[j].getAttribute("name")] = p[j].getAttribute("value");
|
|
}
|
|
}
|
|
showExpressInstall(att, par, id, cb);
|
|
} else {
|
|
// Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
|
|
displayAltContent(obj);
|
|
if (cb) {
|
|
cb(cbObj);
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
// if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
|
|
setVisibility(id, true);
|
|
if (cb) {
|
|
var o = getObjectById(id);
|
|
// test whether there is an HTML object element or not
|
|
if (o && typeof o.SetVariable != UNDEF) {
|
|
cbObj.success = true;
|
|
cbObj.ref = o;
|
|
}
|
|
cb(cbObj);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function getObjectById(objectIdStr) {
|
|
var r = null;
|
|
var o = getElementById(objectIdStr);
|
|
if (o && o.nodeName == "OBJECT") {
|
|
if (typeof o.SetVariable != UNDEF) {
|
|
r = o;
|
|
} else {
|
|
var n = o.getElementsByTagName(OBJECT)[0];
|
|
if (n) {
|
|
r = n;
|
|
}
|
|
}
|
|
}
|
|
return r;
|
|
}
|
|
/* Requirements for Adobe Express Install
|
|
- only one instance can be active at a time
|
|
- fp 6.0.65 or higher
|
|
- Win/Mac OS only
|
|
- no Webkit engines older than version 312
|
|
*/
|
|
function canExpressInstall() {
|
|
return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
|
|
}
|
|
/* Show the Adobe Express Install dialog
|
|
- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
|
|
*/
|
|
function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
|
|
isExpressInstallActive = true;
|
|
storedCallbackFn = callbackFn || null;
|
|
storedCallbackObj = {
|
|
success: false,
|
|
id: replaceElemIdStr
|
|
};
|
|
var obj = getElementById(replaceElemIdStr);
|
|
if (obj) {
|
|
if (obj.nodeName == "OBJECT") {
|
|
// static publishing
|
|
storedAltContent = abstractAltContent(obj);
|
|
storedAltContentId = null;
|
|
} else {
|
|
// dynamic publishing
|
|
storedAltContent = obj;
|
|
storedAltContentId = replaceElemIdStr;
|
|
}
|
|
att.id = EXPRESS_INSTALL_ID;
|
|
if (typeof att.width == UNDEF || !/%$/.test(att.width) && parseInt(att.width, 10) < 310) {
|
|
att.width = "310";
|
|
}
|
|
if (typeof att.height == UNDEF || !/%$/.test(att.height) && parseInt(att.height, 10) < 137) {
|
|
att.height = "137";
|
|
}
|
|
doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
|
|
var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn", fv = "MMredirectURL=" + win.location.toString().replace(/&/g, "%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
|
|
if (typeof par.flashvars != UNDEF) {
|
|
par.flashvars += "&" + fv;
|
|
} else {
|
|
par.flashvars = fv;
|
|
}
|
|
// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
|
|
// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
|
|
if (ua.ie && ua.win && obj.readyState != 4) {
|
|
var newObj = createElement("div");
|
|
replaceElemIdStr += "SWFObjectNew";
|
|
newObj.setAttribute("id", replaceElemIdStr);
|
|
obj.parentNode.insertBefore(newObj, obj);
|
|
// insert placeholder div that will be replaced by the object element that loads expressinstall.swf
|
|
obj.style.display = "none";
|
|
(function() {
|
|
if (obj.readyState == 4) {
|
|
obj.parentNode.removeChild(obj);
|
|
} else {
|
|
setTimeout(arguments.callee, 10);
|
|
}
|
|
})();
|
|
}
|
|
createSWF(att, par, replaceElemIdStr);
|
|
}
|
|
}
|
|
/* Functions to abstract and display alternative content
|
|
*/
|
|
function displayAltContent(obj) {
|
|
if (ua.ie && ua.win && obj.readyState != 4) {
|
|
// IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
|
|
// because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
|
|
var el = createElement("div");
|
|
obj.parentNode.insertBefore(el, obj);
|
|
// insert placeholder div that will be replaced by the alternative content
|
|
el.parentNode.replaceChild(abstractAltContent(obj), el);
|
|
obj.style.display = "none";
|
|
(function() {
|
|
if (obj.readyState == 4) {
|
|
obj.parentNode.removeChild(obj);
|
|
} else {
|
|
setTimeout(arguments.callee, 10);
|
|
}
|
|
})();
|
|
} else {
|
|
obj.parentNode.replaceChild(abstractAltContent(obj), obj);
|
|
}
|
|
}
|
|
function abstractAltContent(obj) {
|
|
var ac = createElement("div");
|
|
if (ua.win && ua.ie) {
|
|
ac.innerHTML = obj.innerHTML;
|
|
} else {
|
|
var nestedObj = obj.getElementsByTagName(OBJECT)[0];
|
|
if (nestedObj) {
|
|
var c = nestedObj.childNodes;
|
|
if (c) {
|
|
var cl = c.length;
|
|
for (var i = 0; i < cl; i++) {
|
|
if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
|
|
ac.appendChild(c[i].cloneNode(true));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return ac;
|
|
}
|
|
/* Cross-browser dynamic SWF creation
|
|
*/
|
|
function createSWF(attObj, parObj, id) {
|
|
var r, el = getElementById(id);
|
|
if (ua.wk && ua.wk < 312) {
|
|
return r;
|
|
}
|
|
if (el) {
|
|
if (typeof attObj.id == UNDEF) {
|
|
// if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
|
|
attObj.id = id;
|
|
}
|
|
if (ua.ie && ua.win) {
|
|
// Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
|
|
var att = "";
|
|
for (var i in attObj) {
|
|
if (attObj[i] != Object.prototype[i]) {
|
|
// filter out prototype additions from other potential libraries
|
|
if (i.toLowerCase() == "data") {
|
|
parObj.movie = attObj[i];
|
|
} else if (i.toLowerCase() == "styleclass") {
|
|
// 'class' is an ECMA4 reserved keyword
|
|
att += ' class="' + attObj[i] + '"';
|
|
} else if (i.toLowerCase() != "classid") {
|
|
att += " " + i + '="' + attObj[i] + '"';
|
|
}
|
|
}
|
|
}
|
|
var par = "";
|
|
for (var j in parObj) {
|
|
if (parObj[j] != Object.prototype[j]) {
|
|
// filter out prototype additions from other potential libraries
|
|
par += '<param name="' + j + '" value="' + parObj[j] + '" />';
|
|
}
|
|
}
|
|
el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + ">" + par + "</object>";
|
|
objIdArr[objIdArr.length] = attObj.id;
|
|
// stored to fix object 'leaks' on unload (dynamic publishing only)
|
|
r = getElementById(attObj.id);
|
|
} else {
|
|
// well-behaving browsers
|
|
var o = createElement(OBJECT);
|
|
o.setAttribute("type", FLASH_MIME_TYPE);
|
|
for (var m in attObj) {
|
|
if (attObj[m] != Object.prototype[m]) {
|
|
// filter out prototype additions from other potential libraries
|
|
if (m.toLowerCase() == "styleclass") {
|
|
// 'class' is an ECMA4 reserved keyword
|
|
o.setAttribute("class", attObj[m]);
|
|
} else if (m.toLowerCase() != "classid") {
|
|
// filter out IE specific attribute
|
|
o.setAttribute(m, attObj[m]);
|
|
}
|
|
}
|
|
}
|
|
for (var n in parObj) {
|
|
if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") {
|
|
// filter out prototype additions from other potential libraries and IE specific param element
|
|
createObjParam(o, n, parObj[n]);
|
|
}
|
|
}
|
|
el.parentNode.replaceChild(o, el);
|
|
r = o;
|
|
}
|
|
}
|
|
return r;
|
|
}
|
|
function createObjParam(el, pName, pValue) {
|
|
var p = createElement("param");
|
|
p.setAttribute("name", pName);
|
|
p.setAttribute("value", pValue);
|
|
el.appendChild(p);
|
|
}
|
|
/* Cross-browser SWF removal
|
|
- Especially needed to safely and completely remove a SWF in Internet Explorer
|
|
*/
|
|
function removeSWF(id) {
|
|
var obj = getElementById(id);
|
|
if (obj && obj.nodeName == "OBJECT") {
|
|
if (ua.ie && ua.win) {
|
|
obj.style.display = "none";
|
|
(function() {
|
|
if (obj.readyState == 4) {
|
|
removeObjectInIE(id);
|
|
} else {
|
|
setTimeout(arguments.callee, 10);
|
|
}
|
|
})();
|
|
} else {
|
|
obj.parentNode.removeChild(obj);
|
|
}
|
|
}
|
|
}
|
|
function removeObjectInIE(id) {
|
|
var obj = getElementById(id);
|
|
if (obj) {
|
|
for (var i in obj) {
|
|
if (typeof obj[i] == "function") {
|
|
obj[i] = null;
|
|
}
|
|
}
|
|
obj.parentNode.removeChild(obj);
|
|
}
|
|
}
|
|
/* Functions to optimize JavaScript compression
|
|
*/
|
|
function getElementById(id) {
|
|
var el = null;
|
|
try {
|
|
el = doc.getElementById(id);
|
|
} catch (e) {}
|
|
return el;
|
|
}
|
|
function createElement(el) {
|
|
return doc.createElement(el);
|
|
}
|
|
/* Updated attachEvent function for Internet Explorer
|
|
- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
|
|
*/
|
|
function addListener(target, eventType, fn) {
|
|
target.attachEvent(eventType, fn);
|
|
listenersArr[listenersArr.length] = [ target, eventType, fn ];
|
|
}
|
|
/* Flash Player and SWF content version matching
|
|
*/
|
|
function hasPlayerVersion(rv) {
|
|
var pv = ua.pv, v = rv.split(".");
|
|
v[0] = parseInt(v[0], 10);
|
|
v[1] = parseInt(v[1], 10) || 0;
|
|
// supports short notation, e.g. "9" instead of "9.0.0"
|
|
v[2] = parseInt(v[2], 10) || 0;
|
|
return pv[0] > v[0] || pv[0] == v[0] && pv[1] > v[1] || pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2] ? true : false;
|
|
}
|
|
/* Cross-browser dynamic CSS creation
|
|
- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
|
|
*/
|
|
function createCSS(sel, decl, media, newStyle) {
|
|
if (ua.ie && ua.mac) {
|
|
return;
|
|
}
|
|
var h = doc.getElementsByTagName("head")[0];
|
|
if (!h) {
|
|
return;
|
|
}
|
|
// to also support badly authored HTML pages that lack a head element
|
|
var m = media && typeof media == "string" ? media : "screen";
|
|
if (newStyle) {
|
|
dynamicStylesheet = null;
|
|
dynamicStylesheetMedia = null;
|
|
}
|
|
if (!dynamicStylesheet || dynamicStylesheetMedia != m) {
|
|
// create dynamic stylesheet + get a global reference to it
|
|
var s = createElement("style");
|
|
s.setAttribute("type", "text/css");
|
|
s.setAttribute("media", m);
|
|
dynamicStylesheet = h.appendChild(s);
|
|
if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
|
|
dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
|
|
}
|
|
dynamicStylesheetMedia = m;
|
|
}
|
|
// add style rule
|
|
if (ua.ie && ua.win) {
|
|
if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
|
|
dynamicStylesheet.addRule(sel, decl);
|
|
}
|
|
} else {
|
|
if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
|
|
dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
|
|
}
|
|
}
|
|
}
|
|
function setVisibility(id, isVisible) {
|
|
if (!autoHideShow) {
|
|
return;
|
|
}
|
|
var v = isVisible ? "visible" : "hidden";
|
|
if (isDomLoaded && getElementById(id)) {
|
|
getElementById(id).style.visibility = v;
|
|
} else {
|
|
createCSS("#" + id, "visibility:" + v);
|
|
}
|
|
}
|
|
/* Filter to avoid XSS attacks
|
|
*/
|
|
function urlEncodeIfNecessary(s) {
|
|
var regex = /[\\\"<>\.;]/;
|
|
var hasBadChars = regex.exec(s) != null;
|
|
return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
|
|
}
|
|
/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
|
|
*/
|
|
var cleanup = function() {
|
|
if (ua.ie && ua.win) {
|
|
window.attachEvent("onunload", function() {
|
|
// remove listeners to avoid memory leaks
|
|
var ll = listenersArr.length;
|
|
for (var i = 0; i < ll; i++) {
|
|
listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
|
|
}
|
|
// cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
|
|
var il = objIdArr.length;
|
|
for (var j = 0; j < il; j++) {
|
|
removeSWF(objIdArr[j]);
|
|
}
|
|
// cleanup library's main closures to avoid memory leaks
|
|
for (var k in ua) {
|
|
ua[k] = null;
|
|
}
|
|
ua = null;
|
|
for (var l in swfobject) {
|
|
swfobject[l] = null;
|
|
}
|
|
swfobject = null;
|
|
});
|
|
}
|
|
}();
|
|
var swfobjectOBJ = {
|
|
/* Public API
|
|
- Reference: http://code.google.com/p/swfobject/wiki/documentation
|
|
*/
|
|
registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
|
|
if (ua.w3 && objectIdStr && swfVersionStr) {
|
|
var regObj = {};
|
|
regObj.id = objectIdStr;
|
|
regObj.swfVersion = swfVersionStr;
|
|
regObj.expressInstall = xiSwfUrlStr;
|
|
regObj.callbackFn = callbackFn;
|
|
regObjArr[regObjArr.length] = regObj;
|
|
setVisibility(objectIdStr, false);
|
|
} else if (callbackFn) {
|
|
callbackFn({
|
|
success: false,
|
|
id: objectIdStr
|
|
});
|
|
}
|
|
},
|
|
getObjectById: function(objectIdStr) {
|
|
if (ua.w3) {
|
|
return getObjectById(objectIdStr);
|
|
}
|
|
},
|
|
embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
|
|
var callbackObj = {
|
|
success: false,
|
|
id: replaceElemIdStr
|
|
};
|
|
if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
|
|
setVisibility(replaceElemIdStr, false);
|
|
addDomLoadEvent(function() {
|
|
widthStr += "";
|
|
// auto-convert to string
|
|
heightStr += "";
|
|
var att = {};
|
|
if (attObj && typeof attObj === OBJECT) {
|
|
for (var i in attObj) {
|
|
// copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
|
|
att[i] = attObj[i];
|
|
}
|
|
}
|
|
att.data = swfUrlStr;
|
|
att.width = widthStr;
|
|
att.height = heightStr;
|
|
var par = {};
|
|
if (parObj && typeof parObj === OBJECT) {
|
|
for (var j in parObj) {
|
|
// copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
|
|
par[j] = parObj[j];
|
|
}
|
|
}
|
|
if (flashvarsObj && typeof flashvarsObj === OBJECT) {
|
|
for (var k in flashvarsObj) {
|
|
// copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
|
|
if (typeof par.flashvars != UNDEF) {
|
|
par.flashvars += "&" + k + "=" + flashvarsObj[k];
|
|
} else {
|
|
par.flashvars = k + "=" + flashvarsObj[k];
|
|
}
|
|
}
|
|
}
|
|
if (hasPlayerVersion(swfVersionStr)) {
|
|
// create SWF
|
|
var obj = createSWF(att, par, replaceElemIdStr);
|
|
if (att.id == replaceElemIdStr) {
|
|
setVisibility(replaceElemIdStr, true);
|
|
}
|
|
callbackObj.success = true;
|
|
callbackObj.ref = obj;
|
|
} else if (xiSwfUrlStr && canExpressInstall()) {
|
|
// show Adobe Express Install
|
|
att.data = xiSwfUrlStr;
|
|
showExpressInstall(att, par, replaceElemIdStr, callbackFn);
|
|
return;
|
|
} else {
|
|
// show alternative content
|
|
setVisibility(replaceElemIdStr, true);
|
|
}
|
|
if (callbackFn) {
|
|
callbackFn(callbackObj);
|
|
}
|
|
});
|
|
} else if (callbackFn) {
|
|
callbackFn(callbackObj);
|
|
}
|
|
},
|
|
switchOffAutoHideShow: function() {
|
|
autoHideShow = false;
|
|
},
|
|
ua: ua,
|
|
getFlashPlayerVersion: function() {
|
|
return {
|
|
major: ua.pv[0],
|
|
minor: ua.pv[1],
|
|
release: ua.pv[2]
|
|
};
|
|
},
|
|
hasFlashPlayerVersion: hasPlayerVersion,
|
|
createSWF: function(attObj, parObj, replaceElemIdStr) {
|
|
if (ua.w3) {
|
|
return createSWF(attObj, parObj, replaceElemIdStr);
|
|
} else {
|
|
return undefined;
|
|
}
|
|
},
|
|
showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
|
|
if (ua.w3 && canExpressInstall()) {
|
|
showExpressInstall(att, par, replaceElemIdStr, callbackFn);
|
|
}
|
|
},
|
|
removeSWF: function(objElemIdStr) {
|
|
if (ua.w3) {
|
|
removeSWF(objElemIdStr);
|
|
}
|
|
},
|
|
createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
|
|
if (ua.w3) {
|
|
createCSS(selStr, declStr, mediaStr, newStyleBoolean);
|
|
}
|
|
},
|
|
addDomLoadEvent: addDomLoadEvent,
|
|
addLoadEvent: addLoadEvent,
|
|
getQueryParamValue: function(param) {
|
|
var q = doc.location.search || doc.location.hash;
|
|
if (q) {
|
|
if (/\?/.test(q)) {
|
|
q = q.split("?")[1];
|
|
}
|
|
// strip question mark
|
|
if (param == null) {
|
|
return urlEncodeIfNecessary(q);
|
|
}
|
|
var pairs = q.split("&");
|
|
for (var i = 0; i < pairs.length; i++) {
|
|
if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
|
|
return urlEncodeIfNecessary(pairs[i].substring(pairs[i].indexOf("=") + 1));
|
|
}
|
|
}
|
|
}
|
|
return "";
|
|
},
|
|
// For internal usage only
|
|
expressInstallCallback: function() {
|
|
if (isExpressInstallActive) {
|
|
var obj = getElementById(EXPRESS_INSTALL_ID);
|
|
if (obj && storedAltContent) {
|
|
obj.parentNode.replaceChild(storedAltContent, obj);
|
|
if (storedAltContentId) {
|
|
setVisibility(storedAltContentId, true);
|
|
if (ua.ie && ua.win) {
|
|
storedAltContent.style.display = "block";
|
|
}
|
|
}
|
|
if (storedCallbackFn) {
|
|
storedCallbackFn(storedCallbackObj);
|
|
}
|
|
}
|
|
isExpressInstallActive = false;
|
|
}
|
|
}
|
|
};
|
|
window.swfobject = swfobjectOBJ
|
|
return swfobject;
|
|
});
|
|
|
|
|
|
|
|
define('yyapi',['BASE64'],function (require, exports, module) {
|
|
|
|
var Base64Tool = require('BASE64');
|
|
|
|
var callExternal = window.parent.callExternal || function () { return {} };
|
|
var yy = window.parent.yy || {};
|
|
|
|
var YYUtils = {
|
|
parseChannelInfo: function (result) {
|
|
var channelInfo = {};
|
|
channelInfo.ret = 0;
|
|
channelInfo.longId = result.long_id;
|
|
channelInfo.shortId = result.short_id;
|
|
channelInfo.name = unescape(result.name);
|
|
channelInfo.userCount = result.user_count;
|
|
channelInfo.totalUserCount = result.total_user_count;
|
|
channelInfo.channelType = result.channel_type;
|
|
channelInfo.channelPoints = result.channel_points;
|
|
return channelInfo;
|
|
},
|
|
parseUserInfo: function parseUserInfo(result) {
|
|
var userInfo = {};
|
|
userInfo.ret = 0;
|
|
|
|
if (typeof (result) == "string") {
|
|
result = eval('(' + result + ')');
|
|
}
|
|
else if (result) {
|
|
result.name = unescape(String(result.name))
|
|
result.sign = unescape(String(result.sign))
|
|
|
|
}
|
|
|
|
userInfo.uid = result.uid;
|
|
userInfo.nick = userInfo.name = unescape(result.name);
|
|
userInfo.yyId = userInfo.imId = result.imid;
|
|
userInfo.role = result.role;
|
|
userInfo.points = result.points;
|
|
userInfo.level = result.level;
|
|
userInfo.gender = userInfo.sex = result.sex;
|
|
userInfo.sign = unescape(result.sign);
|
|
userInfo.vip = result.vip;
|
|
userInfo.vipLevel = result.vip_level;
|
|
userInfo.contribution = result.contribution;
|
|
|
|
return userInfo;
|
|
},
|
|
parseImUserInfo: function (result) {
|
|
var userInfo = {};
|
|
userInfo.ret = 0;
|
|
|
|
var retObj = callExternal("IIM_GetIMUserInfoEx", result.uid);
|
|
userInfo.uid = parseInt(result.uid);
|
|
userInfo.nick = userInfo.name = unescape(result.nick_name);
|
|
userInfo.yyId = userInfo.imId = result.imid;
|
|
|
|
userInfo.role = 0;
|
|
userInfo.points = 0;
|
|
userInfo.level = 0;
|
|
userInfo.gender = userInfo.sex = 0;
|
|
userInfo.sign = "";
|
|
userInfo.vip = 0;
|
|
userInfo.vipLevel = 0;
|
|
userInfo.contribution = 0;
|
|
|
|
userInfo.age = retObj.age;
|
|
userInfo.area = retObj.area;
|
|
userInfo.city = retObj.city;
|
|
userInfo.province = retObj.province;
|
|
userInfo.birthday = "";
|
|
|
|
return userInfo;
|
|
}
|
|
};
|
|
var obj =
|
|
{
|
|
tempChannelInfo:null,
|
|
tempSubChannelInfo:null,
|
|
getChannelInfo: function () {
|
|
if(this.tempChannelInfo)
|
|
return this.tempChannelInfo;
|
|
var result = callExternal("IChannel_GetCurrentChannelInfo");
|
|
if (result.ret == 0) {
|
|
this.tempChannelInfo = YYUtils.parseChannelInfo(result);
|
|
return this.tempChannelInfo;
|
|
}
|
|
else {
|
|
return result;
|
|
}
|
|
|
|
},
|
|
getSubChannelInfo: function () {
|
|
if(this.tempSubChannelInfo)
|
|
return this.tempChannelInfo;
|
|
var result = callExternal("IChannel_GetCurrentSubChannelInfo");
|
|
if (result.ret == 0) {
|
|
this.tempSubChannelInfo = YYUtils.parseChannelInfo(result);
|
|
return this.tempSubChannelInfo;
|
|
}
|
|
else {
|
|
return result;
|
|
}
|
|
},
|
|
myUserTemp: null,
|
|
getMyUserInfo: function () {
|
|
if (this.myUserTemp)
|
|
return this.myUserTemp;
|
|
var result = callExternal("IUser_GetCurrnetUserInfo");
|
|
if (result.ret == 0) {
|
|
this.myUserTemp = result = YYUtils.parseUserInfo(result);
|
|
return result;
|
|
}
|
|
else {
|
|
return result;
|
|
}
|
|
},
|
|
usersTemp: [],
|
|
getUserInfo: function(uid) {
|
|
if (this.usersTemp[uid])
|
|
return this.usersTemp[uid];
|
|
var result = callExternal("IUser_GetUserInfo",uid);
|
|
if (result.ret == 0) {
|
|
this.usersTemp[uid] = YYUtils.parseUserInfo(result);
|
|
return result;
|
|
}
|
|
else {
|
|
return result;
|
|
}
|
|
},
|
|
addChatPubMsgListener: function (fn) {
|
|
if (yy.channel && yy.channel.chat)
|
|
yy.channel.chat.addEventListener("YY_CHANNEL_CHAT1", fn);
|
|
},
|
|
addChatFromPubMsgListener: function (fn) {
|
|
if (yy.channel && yy.channel.chat)
|
|
yy.channel.chat.addEventListener("YY_CHANNEL_CHAT_FROM1", fn);
|
|
},
|
|
addRightMenuListener: function (fn) {
|
|
if (yy.channel && yy.channel.userListPopMenu)
|
|
yy.channel.userListPopMenu.addEventListener("YY_POP_MENU_CLICKED", fn);
|
|
},
|
|
addFontInfoListener: function (fn) {
|
|
if (yy.channel)
|
|
yy.channel.addEventListener("YY_CHANNEL_INPUT_FONT_INFO_CHANGED", fn);
|
|
},
|
|
getChannelDetail: function () {
|
|
return this.getSubChannelInfo();
|
|
},
|
|
getFontInfo: function () {
|
|
return callExternal("IChannelWindow_getCurrentFontInfo");
|
|
},
|
|
showSmilebox:function(x,y){
|
|
var str = '{\"FontSetting\": 1, \"VipRightPart\": 1, \"VipFacePage\":1, \"GameSmiliesPage\":1, \"VipMallPage\":1, \"VipMallFaces\":1,\"xPos\":'+ x +',\"yPos\":' + y +'}';
|
|
str = Base64Tool.encodeBase64(str);
|
|
callExternal("IChannelWindow_showChannelSmileWindowWithControl", str);
|
|
},
|
|
addSmileboxListener: function (fn) {
|
|
if (yy.channel && yy.channel)
|
|
yy.channel.addEventListener("YY_CHANNEL_SMILE_SELECTED", fn);
|
|
},
|
|
addSysMessageListener: function (fn) {
|
|
if (yy.channel && yy.channel.chat)
|
|
yy.channel.chat.addEventListener("YY_CHANNEL_SYSTEM_MESSAGE", fn);
|
|
},
|
|
addSysMessageListener2: function (fn) {
|
|
if (yy.channel && yy.channel.chat)
|
|
yy.channel.chat.addEventListener("YY_CHANNEL_SYSTEM_MESSAGE_EX", fn);
|
|
},
|
|
addChannelStartPrivateChatListener: function (fn) {
|
|
if (yy.channel && yy.channel)
|
|
yy.channel.addEventListener("YY_CHANNEL_START_PRIVATE_CHAT", fn);
|
|
},
|
|
gotoChannel : function(sid,subsid){
|
|
callExternal("IChannel_JoinChannel",0,sid,subsid,sid,"");
|
|
},
|
|
getImageInfo : function(imageKey){
|
|
return callExternal("IChannelWindow_getImageInfo", imageKey)
|
|
},
|
|
getClipboardImage : function(){
|
|
return callExternal("IChannelWindow_getClipboardImage")
|
|
},
|
|
openUrl:function(url){
|
|
callExternal("ISecurityInternal_OpenUrl", url);
|
|
},
|
|
showUserMenu:function(uid,userName,userRole){
|
|
var sid = this.getChannelInfo().longId;
|
|
callExternal("IChannelWindow_showChannelUserMenu", uid, sid, userName, userRole);
|
|
},
|
|
send: function (cmd, msg) {
|
|
var res;
|
|
switch (cmd) {
|
|
case "sendMessage":
|
|
res = callExternal("IChannelChatInternal_Chat", msg);
|
|
res.result = res.ret;
|
|
break;
|
|
case "sendPrivateMessage":
|
|
res = callExternal("IChannelChatInternal_ChatTo", parseInt(msg.toUid),msg.msg);
|
|
res.result = res.ret;
|
|
break;
|
|
}
|
|
return res;
|
|
},
|
|
resizeUI : function(){
|
|
var newHeight = $(window).height();
|
|
if (newHeight < 155)
|
|
newHeight = 155;
|
|
|
|
$(".pkChat .chat-cont").css("height", newHeight + "px");
|
|
var chatOprH = $(".chat-opr").height();
|
|
$(".pkChat .private-chat").css("bottom",chatOprH + 2);
|
|
return newHeight;
|
|
},
|
|
//关闭私聊,计算尺寸
|
|
minChatBox:function(){
|
|
var contHeight = this.resizeUI();
|
|
var chatOprH = $(".chat-opr").height();
|
|
$(".private-chat").css("height","0px");
|
|
$(".chat-list").css("height", contHeight- 5 - chatOprH + "px");
|
|
$(".chat-text .slimScrollDiv").css("height", contHeight- 5 - chatOprH + "px");
|
|
|
|
},
|
|
//打开私聊,计算尺寸
|
|
maxChatBox:function(){
|
|
var contHeight = this.resizeUI();
|
|
var chatOprH = $(".chat-opr").height();
|
|
$(".private-chat").css("height","160px");
|
|
var privateHeight = $(".private-chat").height();
|
|
$(".chat-list").css("height", contHeight- privateHeight - chatOprH + "px");
|
|
$(".chat-text .slimScrollDiv").css("height", contHeight- privateHeight - chatOprH + "px");
|
|
},
|
|
isReady: true
|
|
|
|
};
|
|
module.exports = obj;
|
|
});
|
|
define('pubFilter',['yyapi','util'],function(require, exports, module){
|
|
|
|
var yyapi = require('yyapi');
|
|
var util = require('util');
|
|
var expfn = {
|
|
filterAirTicket : function(msg){
|
|
//yy://pd-[sid=2710&subid=999315&type=wonder_channel]
|
|
//yy://pd-[sid=2710&subid=999315&type=wonder_channel]
|
|
var firstIndex = msg.indexOf("yy://pd-");
|
|
var t = this ;
|
|
if(firstIndex >= 0){
|
|
msg = msg.replace(new RegExp("yy://pd-\\[sid=(\\d+)&(amp;)?subid=(\\d+)(&(amp;)?type=wonder_channel)?\\]","gm"),
|
|
'<span class="air-ticket-pd" ><a href="javascript:#;" onclick="window.$gotoChannel(this)" data-sid="$1", data-subid="$3">$1</a></span>' );
|
|
}
|
|
return msg;
|
|
},
|
|
filterAirTicket2 : function(msg){
|
|
//yy://qun-[gaid=14113059&action=add]
|
|
var firstIndex = msg.indexOf("yy://qun-");
|
|
if(firstIndex >= 0){
|
|
msg = msg.replace(new RegExp("yy://qun-\\[gaid=(\\d+)(&(amp;)?action=add)?\\]","gm"),
|
|
'<span class="group-ticket-pd" ><a href=\"yy://qun-[gaid=$1&action=add]\" target="_blank">Y群$1</a></span>' );
|
|
//'<a href=\"yy://qun-[gaid=$1&action=add]\" target="_blank"><font color="#ff0000">[加Y群($1)]</font></a>' );
|
|
}
|
|
return msg;
|
|
|
|
},
|
|
filterCustomImage : function(msg){
|
|
//[Image]4a28fd248c0037aeb15a6dd5a37de713[/Image]
|
|
var exp = new RegExp("\\[Image\\](.+)\\[/Image\\]","gm");
|
|
var imgHolder = '<img data-key="$1" class="pub-custom-img" src="http://vipweb.bs2cdn.yy.com/vipinter_0f0e1b0411b94bf9bdfb41fae0906edb.gif"/>';
|
|
msg = msg.replace(exp,imgHolder);
|
|
return msg;
|
|
},
|
|
filterSysMsg : function(msg){
|
|
msg = msg.replace(/\[\[U\]/gm,"") ;
|
|
msg = msg.replace(/\[\/U\]\]/gm, "") ;
|
|
msg = this.filterAirTicket(msg);
|
|
msg = this.filterAirTicket2(msg);
|
|
//msg = util.html_encode(msg);
|
|
return msg;
|
|
},
|
|
fileterWeiDeng : function(msg,weidengs){
|
|
if(msg && weidengs)
|
|
{
|
|
for(var i = 0; i < weidengs.length; i++)
|
|
{
|
|
var weidengObj = weidengs[i];
|
|
if(weidengObj)
|
|
{
|
|
if(weidengObj.type == 0)
|
|
msg = msg + '<span class="pub-weideng-img vip-jinzuan '+ weidengObj.name +'"></span>';
|
|
else if(weidengObj.type == 1)
|
|
msg = msg + '<span class="pub-weideng-img pk-jinzuan '+ weidengObj.name +'"></span>';
|
|
}
|
|
}
|
|
}
|
|
return msg;
|
|
},
|
|
fileterLianghao : function(lianhao){
|
|
var msg = "";
|
|
if(lianhao && lianhao!="" && lianhao!=0)
|
|
{
|
|
msg = '<img class="lianghao-img" src="http://dl.vip.yy.com/icons/minicard_vip_prettynum_'+lianhao+'.png"/>';
|
|
}
|
|
return msg;
|
|
},
|
|
fileterIdentity : function(identitys){
|
|
var msg = "";
|
|
if(identitys )
|
|
{
|
|
for(var i = 0; i < identitys.length; i++)
|
|
{
|
|
msg += '<img class="identity-img" title="'+identitys[i].desc +'" alt="'+identitys[i].desc +'" src="'+identitys[i].url+'"/>';
|
|
}
|
|
}
|
|
return msg;
|
|
},
|
|
fileterYYLevel: function(yylevel){
|
|
var msg = "";
|
|
if(yylevel < 256)
|
|
return msg;
|
|
if(yylevel >=1 && yylevel<=3 )
|
|
{
|
|
msg += '<span class="jifen-img jifen-1"></span>';
|
|
}
|
|
else if(yylevel >=4 && yylevel<=15 )
|
|
{
|
|
msg += '<span class="jifen-img jifen-2"></span>';
|
|
}
|
|
else if(yylevel >=16 && yylevel<=63 )
|
|
{
|
|
msg += '<span class="jifen-img jifen-3"></span>';
|
|
}
|
|
else if(yylevel >=64 && yylevel<=255 )
|
|
{
|
|
msg += '<span class="jifen-img jifen-4"></span>';
|
|
}
|
|
else if(yylevel >=256 && yylevel<=1023 )
|
|
{
|
|
msg += '<span class="jifen-img jifen-5"></span>';
|
|
}
|
|
else if(yylevel >=1024 )
|
|
{
|
|
msg += '<span class="jifen-img jifen-6"></span>';
|
|
}
|
|
return msg;
|
|
}
|
|
|
|
}
|
|
window.$gotoChannel = function(e){
|
|
var sid = e.getAttribute("data-sid");
|
|
var subid = e.getAttribute("data-subid");
|
|
yyapi.gotoChannel(parseInt(sid),parseInt(subid));
|
|
}
|
|
module.exports= expfn;
|
|
|
|
})
|
|
define('vipface',function(require, exports, module){
|
|
|
|
var faceMap = {};
|
|
|
|
var data ={
|
|
"vip_expression": {
|
|
"version": "20150424",
|
|
"package": {
|
|
"pack": [
|
|
{
|
|
"-id": "1",
|
|
"-name": "2013020101a.7z"
|
|
},
|
|
{
|
|
"-id": "2",
|
|
"-name": "2013020101b.7z"
|
|
},
|
|
{
|
|
"-id": "3",
|
|
"-name": "2013020102.7z"
|
|
},
|
|
{
|
|
"-id": "4",
|
|
"-name": "2013020103.7z"
|
|
},
|
|
{
|
|
"-id": "5",
|
|
"-name": "2013020104.7z"
|
|
},
|
|
{
|
|
"-id": "6",
|
|
"-name": "20130305.7z"
|
|
},
|
|
{
|
|
"-id": "7",
|
|
"-name": "20130321.7z"
|
|
},
|
|
{
|
|
"-id": "8",
|
|
"-name": "20130527.7z"
|
|
},
|
|
{
|
|
"-id": "9",
|
|
"-name": "20130703.7z"
|
|
},
|
|
{
|
|
"-id": "10",
|
|
"-name": "20130729.7z"
|
|
},
|
|
{
|
|
"-id": "11",
|
|
"-name": "20130902.7z"
|
|
},
|
|
{
|
|
"-id": "12",
|
|
"-name": "20131023.7z"
|
|
},
|
|
{
|
|
"-id": "13",
|
|
"-name": "20131129.7z"
|
|
},
|
|
{
|
|
"-id": "14",
|
|
"-name": "20140411.7z"
|
|
},
|
|
{
|
|
"-id": "15",
|
|
"-name": "20140508.7z"
|
|
},
|
|
{
|
|
"-id": "16",
|
|
"-name": "20140604.7z"
|
|
},
|
|
{
|
|
"-id": "17",
|
|
"-name": "20140819.7z"
|
|
},
|
|
{
|
|
"-id": "18",
|
|
"-name": "20140827.7z"
|
|
},
|
|
{
|
|
"-id": "19",
|
|
"-name": "20141020.7z"
|
|
},
|
|
{
|
|
"-id": "20",
|
|
"-name": "20150201.7z"
|
|
},
|
|
{
|
|
"-id": "21",
|
|
"-name": "20150202.7z"
|
|
},
|
|
{
|
|
"-id": "22",
|
|
"-name": "20150203.7z"
|
|
},
|
|
{
|
|
"-id": "23",
|
|
"-name": "20150320.7z"
|
|
},
|
|
{
|
|
"-id": "24",
|
|
"-name": "20150410.7z"
|
|
},
|
|
{
|
|
"-id": "25",
|
|
"-name": "20150420.7z"
|
|
},
|
|
{
|
|
"-id": "26",
|
|
"-name": "20150424.7z"
|
|
}
|
|
]
|
|
},
|
|
"group": [
|
|
{
|
|
"-name": "超级表情",
|
|
"-super": "1",
|
|
"face": [
|
|
{
|
|
"-desc": "不要发广告",
|
|
"-id": "331",
|
|
"-key": "[:331]",
|
|
"-pack": "25"
|
|
},
|
|
{
|
|
"-desc": "丢香皂",
|
|
"-id": "332",
|
|
"-key": "[:332]",
|
|
"-pack": "25"
|
|
},
|
|
{
|
|
"-desc": "刷1314",
|
|
"-id": "333",
|
|
"-key": "[:333]",
|
|
"-pack": "25"
|
|
},
|
|
{
|
|
"-desc": "我知道你在",
|
|
"-id": "334",
|
|
"-key": "[:334]",
|
|
"-pack": "25"
|
|
},
|
|
{
|
|
"-desc": "打酱油",
|
|
"-id": "335",
|
|
"-key": "[:335]",
|
|
"-pack": "25"
|
|
},
|
|
{
|
|
"-desc": "扣1",
|
|
"-id": "336",
|
|
"-key": "[:336]",
|
|
"-pack": "25"
|
|
},
|
|
{
|
|
"-desc": "拿钱砸你",
|
|
"-id": "337",
|
|
"-key": "[:337]",
|
|
"-pack": "25"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"-name": "经典",
|
|
"face": [
|
|
{
|
|
"-id": "001",
|
|
"-key": "[:求包养]",
|
|
"-desc": "求包养",
|
|
"-pack": "1"
|
|
},
|
|
{
|
|
"-id": "002",
|
|
"-key": "[:思索]",
|
|
"-desc": "思索",
|
|
"-pack": "1"
|
|
},
|
|
{
|
|
"-id": "003",
|
|
"-key": "[:眨眼]",
|
|
"-desc": "眨眼",
|
|
"-pack": "1"
|
|
},
|
|
{
|
|
"-id": "004",
|
|
"-key": "[:泪汪汪]",
|
|
"-desc": "泪汪汪",
|
|
"-pack": "1"
|
|
},
|
|
{
|
|
"-id": "005",
|
|
"-key": "[:路过]",
|
|
"-desc": "路过",
|
|
"-pack": "1"
|
|
},
|
|
{
|
|
"-id": "006",
|
|
"-key": "[:囧]",
|
|
"-desc": "囧",
|
|
"-pack": "1"
|
|
},
|
|
{
|
|
"-id": "007",
|
|
"-key": "[:潜水]",
|
|
"-desc": "潜水",
|
|
"-pack": "1"
|
|
},
|
|
{
|
|
"-id": "008",
|
|
"-key": "[:麦霸]",
|
|
"-desc": "麦霸",
|
|
"-pack": "1"
|
|
},
|
|
{
|
|
"-id": "009",
|
|
"-key": "[:汗]",
|
|
"-desc": "汗",
|
|
"-pack": "1"
|
|
},
|
|
{
|
|
"-id": "010",
|
|
"-key": "[:花痴]",
|
|
"-desc": "花痴",
|
|
"-pack": "1"
|
|
},
|
|
{
|
|
"-id": "011",
|
|
"-key": "[:一声令下]",
|
|
"-desc": "一声令下",
|
|
"-pack": "1"
|
|
},
|
|
{
|
|
"-id": "012",
|
|
"-key": "[:大喇叭]",
|
|
"-desc": "大喇叭",
|
|
"-pack": "1"
|
|
},
|
|
{
|
|
"-id": "013",
|
|
"-key": "[:愤青]",
|
|
"-desc": "愤青",
|
|
"-pack": "1"
|
|
},
|
|
{
|
|
"-id": "014",
|
|
"-key": "[:泪奔]",
|
|
"-desc": "泪奔",
|
|
"-pack": "1"
|
|
},
|
|
{
|
|
"-id": "015",
|
|
"-key": "[:送花]",
|
|
"-desc": "送花",
|
|
"-pack": "1"
|
|
},
|
|
{
|
|
"-id": "016",
|
|
"-key": "[:顶]",
|
|
"-desc": "顶",
|
|
"-pack": "1"
|
|
},
|
|
{
|
|
"-id": "017",
|
|
"-key": "[:锻炼身体]",
|
|
"-desc": "锻炼身体",
|
|
"-pack": "1"
|
|
},
|
|
{
|
|
"-id": "018",
|
|
"-key": "[:摇耳朵]",
|
|
"-desc": "摇耳朵",
|
|
"-pack": "1"
|
|
},
|
|
{
|
|
"-id": "019",
|
|
"-key": "[:鼓掌]",
|
|
"-desc": "鼓掌",
|
|
"-pack": "1"
|
|
},
|
|
{
|
|
"-id": "020",
|
|
"-key": "[:拍地]",
|
|
"-desc": "拍地",
|
|
"-pack": "1"
|
|
},
|
|
{
|
|
"-id": "021",
|
|
"-key": "[:惊吓]",
|
|
"-desc": "惊吓",
|
|
"-pack": "1"
|
|
},
|
|
{
|
|
"-id": "043",
|
|
"-key": "[:听音乐]",
|
|
"-desc": "听音乐",
|
|
"-pack": "3"
|
|
},
|
|
{
|
|
"-id": "044",
|
|
"-key": "[:害羞]",
|
|
"-desc": "害羞",
|
|
"-pack": "3"
|
|
},
|
|
{
|
|
"-id": "045",
|
|
"-key": "[:御姐]",
|
|
"-desc": "御姐",
|
|
"-pack": "3"
|
|
},
|
|
{
|
|
"-id": "046",
|
|
"-key": "[:抓狂]",
|
|
"-desc": "抓狂",
|
|
"-pack": "3"
|
|
},
|
|
{
|
|
"-id": "047",
|
|
"-key": "[:鄙视]",
|
|
"-desc": "鄙视",
|
|
"-pack": "3"
|
|
},
|
|
{
|
|
"-id": "048",
|
|
"-key": "[:可爱]",
|
|
"-desc": "可爱",
|
|
"-pack": "3"
|
|
},
|
|
{
|
|
"-id": "049",
|
|
"-key": "[:放风筝]",
|
|
"-desc": "放风筝",
|
|
"-pack": "3"
|
|
},
|
|
{
|
|
"-id": "050",
|
|
"-key": "[:加油]",
|
|
"-desc": "加油",
|
|
"-pack": "3"
|
|
},
|
|
{
|
|
"-desc": "三周年",
|
|
"-id": "268",
|
|
"-key": "[:268]",
|
|
"-pack": "19"
|
|
},
|
|
{
|
|
"-desc": "吃蛋糕",
|
|
"-id": "269",
|
|
"-key": "[:269]",
|
|
"-pack": "19"
|
|
},
|
|
{
|
|
"-desc": "吹蜡烛",
|
|
"-id": "270",
|
|
"-key": "[:270]",
|
|
"-pack": "19"
|
|
},
|
|
{
|
|
"-desc": "打",
|
|
"-id": "182",
|
|
"-key": "[:182]",
|
|
"-pack": "11"
|
|
},
|
|
{
|
|
"-desc": "得瑟",
|
|
"-id": "183",
|
|
"-key": "[:183]",
|
|
"-pack": "11"
|
|
},
|
|
{
|
|
"-desc": "哈哈",
|
|
"-id": "184",
|
|
"-key": "[:184]",
|
|
"-pack": "11"
|
|
},
|
|
{
|
|
"-id": "051",
|
|
"-key": "[:加1]",
|
|
"-desc": "加1",
|
|
"-pack": "3"
|
|
},
|
|
{
|
|
"-id": "052",
|
|
"-key": "[:翻滚]",
|
|
"-desc": "翻滚",
|
|
"-pack": "3"
|
|
},
|
|
{
|
|
"-id": "053",
|
|
"-key": "[:浮云]",
|
|
"-desc": "浮云",
|
|
"-pack": "3"
|
|
},
|
|
{
|
|
"-id": "054",
|
|
"-key": "[:郁闷]",
|
|
"-desc": "郁闷",
|
|
"-pack": "3"
|
|
},
|
|
{
|
|
"-id": "055",
|
|
"-key": "[:逗你玩]",
|
|
"-desc": "逗你玩",
|
|
"-pack": "3"
|
|
},
|
|
{
|
|
"-id": "056",
|
|
"-key": "[:愚人节]",
|
|
"-desc": "愚人节",
|
|
"-pack": "3"
|
|
},
|
|
{
|
|
"-id": "057",
|
|
"-key": "[:拍照]",
|
|
"-desc": "拍照",
|
|
"-pack": "3"
|
|
},
|
|
{
|
|
"-id": "058",
|
|
"-key": "[:双节棍]",
|
|
"-desc": "双节棍",
|
|
"-pack": "3"
|
|
},
|
|
{
|
|
"-id": "059",
|
|
"-key": "[:委屈]",
|
|
"-desc": "委屈",
|
|
"-pack": "3"
|
|
},
|
|
{
|
|
"-id": "060",
|
|
"-key": "[:浇花]",
|
|
"-desc": "浇花",
|
|
"-pack": "3"
|
|
},
|
|
{
|
|
"-id": "061",
|
|
"-key": "[:扑倒]",
|
|
"-desc": "扑倒",
|
|
"-pack": "3"
|
|
},
|
|
{
|
|
"-id": "062",
|
|
"-key": "[:拖走]",
|
|
"-desc": "拖走",
|
|
"-pack": "3"
|
|
},
|
|
{
|
|
"-id": "063",
|
|
"-key": "[:追逐]",
|
|
"-desc": "追逐",
|
|
"-pack": "3"
|
|
},
|
|
{
|
|
"-id": "025",
|
|
"-key": "[:超人会员]",
|
|
"-desc": "超人会员",
|
|
"-pack": "2"
|
|
},
|
|
{
|
|
"-id": "026",
|
|
"-key": "[:吃面条]",
|
|
"-desc": "吃面条",
|
|
"-pack": "2"
|
|
},
|
|
{
|
|
"-id": "027",
|
|
"-key": "[:吹泡泡]",
|
|
"-desc": "吹泡泡",
|
|
"-pack": "2"
|
|
},
|
|
{
|
|
"-id": "028",
|
|
"-key": "[:点头]",
|
|
"-desc": "点头",
|
|
"-pack": "2"
|
|
},
|
|
{
|
|
"-id": "029",
|
|
"-key": "[:堆雪人]",
|
|
"-desc": "堆雪人",
|
|
"-pack": "2"
|
|
},
|
|
{
|
|
"-id": "030",
|
|
"-key": "[:好冷啊]",
|
|
"-desc": "好冷啊",
|
|
"-pack": "2"
|
|
},
|
|
{
|
|
"-id": "031",
|
|
"-key": "[:好爽呀]",
|
|
"-desc": "好爽呀",
|
|
"-pack": "2"
|
|
},
|
|
{
|
|
"-id": "032",
|
|
"-key": "[:剪纸圣诞]",
|
|
"-desc": "剪纸圣诞",
|
|
"-pack": "2"
|
|
},
|
|
{
|
|
"-id": "033",
|
|
"-key": "[:鞠躬]",
|
|
"-desc": "鞠躬",
|
|
"-pack": "2"
|
|
},
|
|
{
|
|
"-id": "034",
|
|
"-key": "[:礼物惊喜]",
|
|
"-desc": "礼物惊喜",
|
|
"-pack": "2"
|
|
},
|
|
{
|
|
"-id": "035",
|
|
"-key": "[:吐舌头]",
|
|
"-desc": "吐舌头",
|
|
"-pack": "2"
|
|
},
|
|
{
|
|
"-id": "036",
|
|
"-key": "[:吐一下就闪]",
|
|
"-desc": "吐一下就闪",
|
|
"-pack": "2"
|
|
},
|
|
{
|
|
"-id": "037",
|
|
"-key": "[:问号]",
|
|
"-desc": "问号",
|
|
"-pack": "2"
|
|
},
|
|
{
|
|
"-id": "038",
|
|
"-key": "[:下雪玩]",
|
|
"-desc": "下雪玩",
|
|
"-pack": "2"
|
|
},
|
|
{
|
|
"-id": "039",
|
|
"-key": "[:学习]",
|
|
"-desc": "学习",
|
|
"-pack": "2"
|
|
},
|
|
{
|
|
"-id": "040",
|
|
"-key": "[:眼泪哇]",
|
|
"-desc": "眼泪哇",
|
|
"-pack": "2"
|
|
},
|
|
{
|
|
"-id": "041",
|
|
"-key": "[:晕晕晕]",
|
|
"-desc": "晕晕晕",
|
|
"-pack": "2"
|
|
},
|
|
{
|
|
"-id": "042",
|
|
"-key": "[:撞墙]",
|
|
"-desc": "撞墙",
|
|
"-pack": "2"
|
|
},
|
|
{
|
|
"-id": "022",
|
|
"-key": "[:hold住哦]",
|
|
"-desc": "hold住哦",
|
|
"-pack": "2"
|
|
},
|
|
{
|
|
"-id": "023",
|
|
"-key": "[:不要不要]",
|
|
"-desc": "不要不要",
|
|
"-pack": "2"
|
|
},
|
|
{
|
|
"-id": "024",
|
|
"-key": "[:唱歌]",
|
|
"-desc": "唱歌",
|
|
"-pack": "2"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"-name": "节日",
|
|
"face": [
|
|
{
|
|
"-id": "118",
|
|
"-key": "[:巧克力]",
|
|
"-desc": "巧克力",
|
|
"-pack": "6"
|
|
},
|
|
{
|
|
"-id": "119",
|
|
"-key": "[:情书]",
|
|
"-desc": "情书",
|
|
"-pack": "6"
|
|
},
|
|
{
|
|
"-id": "120",
|
|
"-key": "[:爱神之箭]",
|
|
"-desc": "爱神之箭",
|
|
"-pack": "6"
|
|
},
|
|
{
|
|
"-id": "121",
|
|
"-key": "[:中箭]",
|
|
"-desc": "中箭",
|
|
"-pack": "6"
|
|
},
|
|
{
|
|
"-id": "122",
|
|
"-key": "[:月亮船]",
|
|
"-desc": "月亮船",
|
|
"-pack": "6"
|
|
},
|
|
{
|
|
"-id": "123",
|
|
"-key": "[:大爱心]",
|
|
"-desc": "大爱心",
|
|
"-pack": "6"
|
|
},
|
|
{
|
|
"-id": "106",
|
|
"-key": "[:发财]",
|
|
"-desc": "发财",
|
|
"-pack": "6"
|
|
},
|
|
{
|
|
"-id": "107",
|
|
"-key": "[:炮竹]",
|
|
"-desc": "炮竹",
|
|
"-pack": "6"
|
|
},
|
|
{
|
|
"-id": "108",
|
|
"-key": "[:雪人]",
|
|
"-desc": "雪人",
|
|
"-pack": "6"
|
|
},
|
|
{
|
|
"-id": "109",
|
|
"-key": "[:发红包]",
|
|
"-desc": "发红包",
|
|
"-pack": "6"
|
|
},
|
|
{
|
|
"-id": "110",
|
|
"-key": "[:金子]",
|
|
"-desc": "金子",
|
|
"-pack": "6"
|
|
},
|
|
{
|
|
"-id": "111",
|
|
"-key": "[:舞狮]",
|
|
"-desc": "舞狮",
|
|
"-pack": "6"
|
|
},
|
|
{
|
|
"-id": "112",
|
|
"-key": "[:铜钱]",
|
|
"-desc": "铜钱",
|
|
"-pack": "6"
|
|
},
|
|
{
|
|
"-id": "113",
|
|
"-key": "[:灯笼]",
|
|
"-desc": "灯笼",
|
|
"-pack": "6"
|
|
},
|
|
{
|
|
"-id": "114",
|
|
"-key": "[:大元宵]",
|
|
"-desc": "大元宵",
|
|
"-pack": "6"
|
|
},
|
|
{
|
|
"-id": "115",
|
|
"-key": "[:烟花]",
|
|
"-desc": "烟花",
|
|
"-pack": "6"
|
|
},
|
|
{
|
|
"-id": "116",
|
|
"-key": "[:碗里来]",
|
|
"-desc": "碗里来",
|
|
"-pack": "6"
|
|
},
|
|
{
|
|
"-id": "117",
|
|
"-key": "[:糖葫芦]",
|
|
"-desc": "糖葫芦",
|
|
"-pack": "6"
|
|
},
|
|
{
|
|
"-desc": "求推倒",
|
|
"-id": "195",
|
|
"-key": "[:195]",
|
|
"-pack": "13"
|
|
},
|
|
{
|
|
"-desc": "强势推倒",
|
|
"-id": "196",
|
|
"-key": "[:196]",
|
|
"-pack": "13"
|
|
},
|
|
{
|
|
"-desc": "吉他",
|
|
"-id": "186",
|
|
"-key": "[:186]",
|
|
"-pack": "12"
|
|
},
|
|
{
|
|
"-desc": "我伙呆",
|
|
"-id": "187",
|
|
"-key": "[:187]",
|
|
"-pack": "12"
|
|
},
|
|
{
|
|
"-desc": "拽头发",
|
|
"-id": "188",
|
|
"-key": "[:188]",
|
|
"-pack": "12"
|
|
},
|
|
{
|
|
"-desc": "指挥",
|
|
"-id": "189",
|
|
"-key": "[:189]",
|
|
"-pack": "12"
|
|
},
|
|
{
|
|
"-desc": "晕菜",
|
|
"-id": "191",
|
|
"-key": "[:191]",
|
|
"-pack": "12"
|
|
},
|
|
{
|
|
"-desc": "棒棒糖",
|
|
"-id": "192",
|
|
"-key": "[:192]",
|
|
"-pack": "12"
|
|
},
|
|
{
|
|
"-desc": "气球",
|
|
"-id": "193",
|
|
"-key": "[:193]",
|
|
"-pack": "12"
|
|
},
|
|
{
|
|
"-desc": "蹦跶",
|
|
"-id": "194",
|
|
"-key": "[:194]",
|
|
"-pack": "12"
|
|
},
|
|
{
|
|
"-desc": "冒个泡",
|
|
"-id": "185",
|
|
"-key": "[:185]",
|
|
"-pack": "12"
|
|
},
|
|
{
|
|
"-desc": "新货求罩",
|
|
"-id": "190",
|
|
"-key": "[:190]",
|
|
"-pack": "12"
|
|
},
|
|
{
|
|
"-desc": "好好听啊",
|
|
"-id": "176",
|
|
"-key": "[:176]",
|
|
"-pack": "10"
|
|
},
|
|
{
|
|
"-desc": "花花在哪里",
|
|
"-id": "177",
|
|
"-key": "[:177]",
|
|
"-pack": "10"
|
|
},
|
|
{
|
|
"-desc": "么一个",
|
|
"-id": "178",
|
|
"-key": "[:178]",
|
|
"-pack": "10"
|
|
},
|
|
{
|
|
"-desc": "一顶再顶",
|
|
"-id": "179",
|
|
"-key": "[:179]",
|
|
"-pack": "10"
|
|
},
|
|
{
|
|
"-desc": "有黑幕",
|
|
"-id": "180",
|
|
"-key": "[:180]",
|
|
"-pack": "10"
|
|
},
|
|
{
|
|
"-desc": "在一起",
|
|
"-id": "181",
|
|
"-key": "[:181]",
|
|
"-pack": "10"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"-name": "热词",
|
|
"face": [
|
|
{
|
|
"-id": "085",
|
|
"-key": "[:霸气]",
|
|
"-desc": "霸气",
|
|
"-pack": "5"
|
|
},
|
|
{
|
|
"-id": "086",
|
|
"-key": "[:包拯]",
|
|
"-desc": "包拯",
|
|
"-pack": "5"
|
|
},
|
|
{
|
|
"-id": "087",
|
|
"-key": "[:草泥马]",
|
|
"-desc": "草泥马",
|
|
"-pack": "5"
|
|
},
|
|
{
|
|
"-id": "088",
|
|
"-key": "[:打飞机]",
|
|
"-desc": "打飞机",
|
|
"-pack": "5"
|
|
},
|
|
{
|
|
"-id": "089",
|
|
"-key": "[:坑爹]",
|
|
"-desc": "坑爹",
|
|
"-pack": "5"
|
|
},
|
|
{
|
|
"-id": "090",
|
|
"-key": "[:屌丝]",
|
|
"-desc": "屌丝",
|
|
"-pack": "5"
|
|
},
|
|
{
|
|
"-id": "091",
|
|
"-key": "[:打酱油]",
|
|
"-desc": "打酱油",
|
|
"-pack": "5"
|
|
},
|
|
{
|
|
"-id": "092",
|
|
"-key": "[:江南style]",
|
|
"-desc": "江南style",
|
|
"-pack": "5"
|
|
},
|
|
{
|
|
"-id": "093",
|
|
"-key": "[:这不科学]",
|
|
"-desc": "这不科学",
|
|
"-pack": "5"
|
|
},
|
|
{
|
|
"-id": "094",
|
|
"-key": "[:好基友]",
|
|
"-desc": "好基友",
|
|
"-pack": "5"
|
|
},
|
|
{
|
|
"-id": "095",
|
|
"-key": "[:求你了]",
|
|
"-desc": "求你了",
|
|
"-pack": "5"
|
|
},
|
|
{
|
|
"-id": "096",
|
|
"-key": "[:求交往]",
|
|
"-desc": "求交往",
|
|
"-pack": "5"
|
|
},
|
|
{
|
|
"-id": "097",
|
|
"-key": "[:二逼]",
|
|
"-desc": "二逼",
|
|
"-pack": "5"
|
|
},
|
|
{
|
|
"-id": "098",
|
|
"-key": "[:忧伤]",
|
|
"-desc": "忧伤",
|
|
"-pack": "5"
|
|
},
|
|
{
|
|
"-id": "099",
|
|
"-key": "[:沙发]",
|
|
"-desc": "沙发",
|
|
"-pack": "5"
|
|
},
|
|
{
|
|
"-id": "100",
|
|
"-key": "[:威武]",
|
|
"-desc": "威武",
|
|
"-pack": "5"
|
|
},
|
|
{
|
|
"-id": "101",
|
|
"-key": "[:躺着中枪]",
|
|
"-desc": "躺着中枪",
|
|
"-pack": "5"
|
|
},
|
|
{
|
|
"-id": "102",
|
|
"-key": "[:膝盖中箭]",
|
|
"-desc": "膝盖中箭",
|
|
"-pack": "5"
|
|
},
|
|
{
|
|
"-id": "103",
|
|
"-key": "[:如厕]",
|
|
"-desc": "如厕",
|
|
"-pack": "5"
|
|
},
|
|
{
|
|
"-id": "104",
|
|
"-key": "[:这个屌]",
|
|
"-desc": "这个屌",
|
|
"-pack": "5"
|
|
},
|
|
{
|
|
"-id": "105",
|
|
"-key": "[:元芳]",
|
|
"-desc": "元芳",
|
|
"-pack": "5"
|
|
},
|
|
{
|
|
"-id": "064",
|
|
"-key": "[:蝙蝠侠]",
|
|
"-desc": "蝙蝠侠",
|
|
"-pack": "4"
|
|
},
|
|
{
|
|
"-id": "065",
|
|
"-key": "[:布欧]",
|
|
"-desc": "布欧",
|
|
"-pack": "4"
|
|
},
|
|
{
|
|
"-id": "066",
|
|
"-key": "[:超级玛丽]",
|
|
"-desc": "超级玛丽",
|
|
"-pack": "4"
|
|
},
|
|
{
|
|
"-id": "067",
|
|
"-key": "[:春丽]",
|
|
"-desc": "春丽",
|
|
"-pack": "4"
|
|
},
|
|
{
|
|
"-id": "068",
|
|
"-key": "[:海绵宝宝]",
|
|
"-desc": "海绵宝宝",
|
|
"-pack": "4"
|
|
},
|
|
{
|
|
"-id": "069",
|
|
"-key": "[:黑猫警长]",
|
|
"-desc": "黑猫警长",
|
|
"-pack": "4"
|
|
},
|
|
{
|
|
"-id": "070",
|
|
"-key": "[:葫芦娃]",
|
|
"-desc": "葫芦娃",
|
|
"-pack": "4"
|
|
},
|
|
{
|
|
"-id": "071",
|
|
"-key": "[:灰太狼]",
|
|
"-desc": "灰太狼",
|
|
"-pack": "4"
|
|
},
|
|
{
|
|
"-id": "072",
|
|
"-key": "[:机器猫]",
|
|
"-desc": "机器猫",
|
|
"-pack": "4"
|
|
},
|
|
{
|
|
"-id": "073",
|
|
"-key": "[:军曹]",
|
|
"-desc": "军曹",
|
|
"-pack": "4"
|
|
},
|
|
{
|
|
"-id": "074",
|
|
"-key": "[:米老鼠]",
|
|
"-desc": "米老鼠",
|
|
"-pack": "4"
|
|
},
|
|
{
|
|
"-id": "075",
|
|
"-key": "[:鸣人]",
|
|
"-desc": "鸣人",
|
|
"-pack": "4"
|
|
},
|
|
{
|
|
"-id": "076",
|
|
"-key": "[:跑跑卡丁]",
|
|
"-desc": "跑跑卡丁",
|
|
"-pack": "4"
|
|
},
|
|
{
|
|
"-id": "077",
|
|
"-key": "[:乔巴]",
|
|
"-desc": "乔巴",
|
|
"-pack": "4"
|
|
},
|
|
{
|
|
"-id": "078",
|
|
"-key": "[:圣诞老人]",
|
|
"-desc": "圣诞老人",
|
|
"-pack": "4"
|
|
},
|
|
{
|
|
"-id": "079",
|
|
"-key": "[:司马懿]",
|
|
"-desc": "司马懿",
|
|
"-pack": "4"
|
|
},
|
|
{
|
|
"-id": "080",
|
|
"-key": "[:柯南]",
|
|
"-desc": "柯南",
|
|
"-pack": "4"
|
|
},
|
|
{
|
|
"-id": "081",
|
|
"-key": "[:咸蛋超人]",
|
|
"-desc": "咸蛋超人",
|
|
"-pack": "4"
|
|
},
|
|
{
|
|
"-id": "082",
|
|
"-key": "[:招财猫]",
|
|
"-desc": "招财猫",
|
|
"-pack": "4"
|
|
},
|
|
{
|
|
"-id": "083",
|
|
"-key": "[:阿童木]",
|
|
"-desc": "阿童木",
|
|
"-pack": "4"
|
|
},
|
|
{
|
|
"-id": "084",
|
|
"-key": "[:喜羊羊]",
|
|
"-desc": "喜羊羊",
|
|
"-pack": "4"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"-name": "手机表情",
|
|
"face": [
|
|
{
|
|
"-desc": "别吃我",
|
|
"-id": "138",
|
|
"-key": "[:别吃我]",
|
|
"-pack": "8"
|
|
},
|
|
{
|
|
"-desc": "纠结死",
|
|
"-id": "143",
|
|
"-key": "[:纠结死]",
|
|
"-pack": "8"
|
|
},
|
|
{
|
|
"-desc": "没睡醒",
|
|
"-id": "147",
|
|
"-key": "[:没睡醒]",
|
|
"-pack": "8"
|
|
},
|
|
{
|
|
"-desc": "热死了",
|
|
"-id": "151",
|
|
"-key": "[:热死了]",
|
|
"-pack": "8"
|
|
},
|
|
{
|
|
"-desc": "听音乐哦",
|
|
"-id": "152",
|
|
"-key": "[:听音乐哦]",
|
|
"-pack": "8"
|
|
},
|
|
{
|
|
"-desc": "好委屈",
|
|
"-id": "153",
|
|
"-key": "[:好委屈]",
|
|
"-pack": "8"
|
|
},
|
|
{
|
|
"-desc": "我要我要",
|
|
"-id": "154",
|
|
"-key": "[:我要我要]",
|
|
"-pack": "8"
|
|
},
|
|
{
|
|
"-desc": "羡慕嫉妒恨",
|
|
"-id": "155",
|
|
"-key": "[:羡慕嫉妒恨]",
|
|
"-pack": "8"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"-name": "暴走YY熊",
|
|
"-new": "1",
|
|
"-tag": "0",
|
|
"-money": "500",
|
|
"-category": "贱",
|
|
"-effective": "30",
|
|
"-tail": "全民表情",
|
|
"-desc": "YY熊暴走,后果很严重,一个不一样的熊。",
|
|
"-thumb": "http://dl.vip.yy.com/facepacket2/1/14.png",
|
|
"-guide": "http://dl.vip.yy.com/facepacket2/2/14.png",
|
|
"-click": "http://vip.yy.com/vip/vmall2/face/pay?id=550012",
|
|
"face": [
|
|
{
|
|
"-desc": "666",
|
|
"-id": "338",
|
|
"-key": "[:338]",
|
|
"-pack": "26"
|
|
},
|
|
{
|
|
"-desc": "作死new",
|
|
"-id": "339",
|
|
"-key": "[:339]",
|
|
"-pack": "26"
|
|
},
|
|
{
|
|
"-desc": "十年戎马心孤独",
|
|
"-id": "340",
|
|
"-key": "[:340]",
|
|
"-pack": "26"
|
|
},
|
|
{
|
|
"-desc": "废了",
|
|
"-id": "341",
|
|
"-key": "[:341]",
|
|
"-pack": "26"
|
|
},
|
|
{
|
|
"-desc": "怂",
|
|
"-id": "342",
|
|
"-key": "[:342]",
|
|
"-pack": "26"
|
|
},
|
|
{
|
|
"-desc": "放肆",
|
|
"-id": "343",
|
|
"-key": "[:343]",
|
|
"-pack": "26"
|
|
},
|
|
{
|
|
"-desc": "点赞",
|
|
"-id": "344",
|
|
"-key": "[:344]",
|
|
"-pack": "26"
|
|
},
|
|
{
|
|
"-desc": "秒懂",
|
|
"-id": "345",
|
|
"-key": "[:345]",
|
|
"-pack": "26"
|
|
},
|
|
{
|
|
"-desc": "高级黑",
|
|
"-id": "346",
|
|
"-key": "[:346]",
|
|
"-pack": "26"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"-name": "蛋壳鸡",
|
|
"-new": "1",
|
|
"-tag": "0",
|
|
"-money": "300",
|
|
"-category": "萌",
|
|
"-effective": "30",
|
|
"-tail": "全民表情",
|
|
"-desc": "对于鸡来说,身材太丰满的一个困扰就是出生之后蛋壳跟着变成裤子了",
|
|
"-thumb": "http://dl.vip.yy.com/facepacket2/1/13.png",
|
|
"-guide": "http://dl.vip.yy.com/facepacket2/2/13.png",
|
|
"-click": "http://vip.yy.com/vip/vmall2/face/pay?id=538864",
|
|
"face": [
|
|
{
|
|
"-desc": "不作不死",
|
|
"-id": "319",
|
|
"-key": "[:319]",
|
|
"-pack": "24"
|
|
},
|
|
{
|
|
"-desc": "兄弟我撑你",
|
|
"-id": "320",
|
|
"-key": "[:320]",
|
|
"-pack": "24"
|
|
},
|
|
{
|
|
"-desc": "发怒",
|
|
"-id": "321",
|
|
"-key": "[:321]",
|
|
"-pack": "24"
|
|
},
|
|
{
|
|
"-desc": "听我说",
|
|
"-id": "322",
|
|
"-key": "[:322]",
|
|
"-pack": "24"
|
|
},
|
|
{
|
|
"-desc": "听音乐",
|
|
"-id": "323",
|
|
"-key": "[:323]",
|
|
"-pack": "24"
|
|
},
|
|
{
|
|
"-desc": "失落",
|
|
"-id": "324",
|
|
"-key": "[:324]",
|
|
"-pack": "24"
|
|
},
|
|
{
|
|
"-desc": "我来也",
|
|
"-id": "325",
|
|
"-key": "[:325]",
|
|
"-pack": "24"
|
|
},
|
|
{
|
|
"-desc": "找我吗",
|
|
"-id": "326",
|
|
"-key": "[:326]",
|
|
"-pack": "24"
|
|
},
|
|
{
|
|
"-desc": "抱抱",
|
|
"-id": "327",
|
|
"-key": "[:327]",
|
|
"-pack": "24"
|
|
},
|
|
{
|
|
"-desc": "笑死人",
|
|
"-id": "328",
|
|
"-key": "[:328]",
|
|
"-pack": "24"
|
|
},
|
|
{
|
|
"-desc": "羞死了",
|
|
"-id": "329",
|
|
"-key": "[:329]",
|
|
"-pack": "24"
|
|
},
|
|
{
|
|
"-desc": "静静看直播",
|
|
"-id": "330",
|
|
"-key": "[:330]",
|
|
"-pack": "24"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"-name": "邪恶小法师",
|
|
"-new": "1",
|
|
"-tag": "0",
|
|
"-money": "300",
|
|
"-category": "呆",
|
|
"-effective": "30",
|
|
"-tail": "全民表情",
|
|
"-desc": "他是官网任务大使的闭关大弟子,有点嫩,有点呆,还有独一无二的超二大招",
|
|
"-thumb": "http://dl.vip.yy.com/facepacket2/1/7.png",
|
|
"-guide": "http://dl.vip.yy.com/facepacket2/2/7.png",
|
|
"-click": "http://vip.yy.com/vip/vmall2/face/pay?id=538296",
|
|
"face": [
|
|
{
|
|
"-desc": "一阵风~",
|
|
"-id": "232",
|
|
"-key": "[:232]",
|
|
"-pack": "17"
|
|
},
|
|
{
|
|
"-desc": "勾引",
|
|
"-id": "233",
|
|
"-key": "[:233]",
|
|
"-pack": "17"
|
|
},
|
|
{
|
|
"-desc": "吓你",
|
|
"-id": "234",
|
|
"-key": "[:234]",
|
|
"-pack": "17"
|
|
},
|
|
{
|
|
"-desc": "呃~",
|
|
"-id": "235",
|
|
"-key": "[:235]",
|
|
"-pack": "17"
|
|
},
|
|
{
|
|
"-desc": "失误",
|
|
"-id": "236",
|
|
"-key": "[:236]",
|
|
"-pack": "17"
|
|
},
|
|
{
|
|
"-desc": "弹吉他",
|
|
"-id": "237",
|
|
"-key": "[:237]",
|
|
"-pack": "17"
|
|
},
|
|
{
|
|
"-desc": "画圈圈~",
|
|
"-id": "238",
|
|
"-key": "[:238]",
|
|
"-pack": "17"
|
|
},
|
|
{
|
|
"-desc": "睡觉",
|
|
"-id": "239",
|
|
"-key": "[:239]",
|
|
"-pack": "17"
|
|
},
|
|
{
|
|
"-desc": "色",
|
|
"-id": "240",
|
|
"-key": "[:240]",
|
|
"-pack": "17"
|
|
},
|
|
{
|
|
"-desc": "路过",
|
|
"-id": "241",
|
|
"-key": "[:241]",
|
|
"-pack": "17"
|
|
},
|
|
{
|
|
"-desc": "逃跑",
|
|
"-id": "242",
|
|
"-key": "[:242]",
|
|
"-pack": "17"
|
|
},
|
|
{
|
|
"-desc": "魔法",
|
|
"-id": "243",
|
|
"-key": "[:243]",
|
|
"-pack": "17"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"-name": "苹果先生",
|
|
"-new": "1",
|
|
"-tag": "0",
|
|
"-money": "300",
|
|
"-category": "贱",
|
|
"-effective": "30",
|
|
"-tail": "全民表情",
|
|
"-desc": "萌贱的苹果先生,总是不自觉的哼起:你是我的,我是你的小啊小苹果~",
|
|
"-thumb": "http://dl.vip.yy.com/facepacket2/1/8.png",
|
|
"-guide": "http://dl.vip.yy.com/facepacket2/2/8.png",
|
|
"-click": "http://vip.yy.com/vip/vmall2/face/pay?id=538298",
|
|
"face": [
|
|
{
|
|
"-desc": "健美",
|
|
"-id": "244",
|
|
"-key": "[:244]",
|
|
"-pack": "17"
|
|
},
|
|
{
|
|
"-desc": "加一~",
|
|
"-id": "245",
|
|
"-key": "[:245]",
|
|
"-pack": "17"
|
|
},
|
|
{
|
|
"-desc": "吓绿了",
|
|
"-id": "246",
|
|
"-key": "[:246]",
|
|
"-pack": "17"
|
|
},
|
|
{
|
|
"-desc": "小苹果",
|
|
"-id": "247",
|
|
"-key": "[:247]",
|
|
"-pack": "17"
|
|
},
|
|
{
|
|
"-desc": "打冷战",
|
|
"-id": "248",
|
|
"-key": "[:248]",
|
|
"-pack": "17"
|
|
},
|
|
{
|
|
"-desc": "撞墙",
|
|
"-id": "249",
|
|
"-key": "[:249]",
|
|
"-pack": "17"
|
|
},
|
|
{
|
|
"-desc": "火火火",
|
|
"-id": "250",
|
|
"-key": "[:250]",
|
|
"-pack": "17"
|
|
},
|
|
{
|
|
"-desc": "紧张",
|
|
"-id": "251",
|
|
"-key": "[:251]",
|
|
"-pack": "17"
|
|
},
|
|
{
|
|
"-desc": "耶",
|
|
"-id": "252",
|
|
"-key": "[:252]",
|
|
"-pack": "17"
|
|
},
|
|
{
|
|
"-desc": "色~",
|
|
"-id": "253",
|
|
"-key": "[:253]",
|
|
"-pack": "17"
|
|
},
|
|
{
|
|
"-desc": "赞",
|
|
"-id": "254",
|
|
"-key": "[:254]",
|
|
"-pack": "17"
|
|
},
|
|
{
|
|
"-desc": "闪亮登场2",
|
|
"-id": "255",
|
|
"-key": "[:255]",
|
|
"-pack": "17"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"-name": "包子表情",
|
|
"-new": "1",
|
|
"-tag": "0",
|
|
"-money": "300",
|
|
"-category": "萌",
|
|
"-effective": "30",
|
|
"-tail": "全民表情",
|
|
"-desc": "我是软绵绵香喷喷的包子,快来把我抱走吧~~~",
|
|
"-thumb": "http://dl.vip.yy.com/facepacket2/1/1.png",
|
|
"-guide": "http://dl.vip.yy.com/facepacket2/2/1.png",
|
|
"-click": "http://vip.yy.com/vip/vmall2/face/pay?id=538286",
|
|
"face": [
|
|
{
|
|
"-desc": "按按我",
|
|
"-id": "136",
|
|
"-key": "[:按按我]",
|
|
"-pack": "8"
|
|
},
|
|
{
|
|
"-desc": "扮严肃",
|
|
"-id": "137",
|
|
"-key": "[:扮严肃]",
|
|
"-pack": "8"
|
|
},
|
|
{
|
|
"-desc": "搓手",
|
|
"-id": "139",
|
|
"-key": "[:搓手]",
|
|
"-pack": "8"
|
|
},
|
|
{
|
|
"-desc": "寒",
|
|
"-id": "140",
|
|
"-key": "[:寒]",
|
|
"-pack": "8"
|
|
},
|
|
{
|
|
"-desc": "好色",
|
|
"-id": "141",
|
|
"-key": "[:好色]",
|
|
"-pack": "8"
|
|
},
|
|
{
|
|
"-desc": "剪刀手",
|
|
"-id": "142",
|
|
"-key": "[:剪刀手]",
|
|
"-pack": "8"
|
|
},
|
|
{
|
|
"-desc": "抠鼻",
|
|
"-id": "144",
|
|
"-key": "[:抠鼻]",
|
|
"-pack": "8"
|
|
},
|
|
{
|
|
"-desc": "泪崩",
|
|
"-id": "145",
|
|
"-key": "[:泪崩]",
|
|
"-pack": "8"
|
|
},
|
|
{
|
|
"-desc": "没钱了",
|
|
"-id": "146",
|
|
"-key": "[:没钱了]",
|
|
"-pack": "8"
|
|
},
|
|
{
|
|
"-desc": "恼火呀",
|
|
"-id": "148",
|
|
"-key": "[:恼火呀]",
|
|
"-pack": "8"
|
|
},
|
|
{
|
|
"-desc": "哦呵呵",
|
|
"-id": "149",
|
|
"-key": "[:哦呵呵]",
|
|
"-pack": "8"
|
|
},
|
|
{
|
|
"-desc": "飘走",
|
|
"-id": "150",
|
|
"-key": "[:飘走]",
|
|
"-pack": "8"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"-name": "y熊表情",
|
|
"-tag": "3",
|
|
"-money": "300",
|
|
"-category": "萌",
|
|
"-effective": "30",
|
|
"-tail": "全民表情",
|
|
"-desc": "我是傲娇的小小Y熊仔,喜欢我么?",
|
|
"-thumb": "http://dl.vip.yy.com/facepacket2/1/10.png",
|
|
"-guide": "http://dl.vip.yy.com/facepacket2/2/10.png",
|
|
"-click": "http://vip.yy.com/vip/redirect?src=diamond.moveface",
|
|
"face": [
|
|
{
|
|
"-desc": "减肥",
|
|
"-id": "207",
|
|
"-key": "[:207]",
|
|
"-pack": "15"
|
|
},
|
|
{
|
|
"-desc": "可怜",
|
|
"-id": "208",
|
|
"-key": "[:208]",
|
|
"-pack": "15"
|
|
},
|
|
{
|
|
"-desc": "听音乐",
|
|
"-id": "209",
|
|
"-key": "[:209]",
|
|
"-pack": "15"
|
|
},
|
|
{
|
|
"-desc": "喝奶",
|
|
"-id": "210",
|
|
"-key": "[:210]",
|
|
"-pack": "15"
|
|
},
|
|
{
|
|
"-desc": "好舒服",
|
|
"-id": "211",
|
|
"-key": "[:211]",
|
|
"-pack": "15"
|
|
},
|
|
{
|
|
"-desc": "恼火",
|
|
"-id": "212",
|
|
"-key": "[:212]",
|
|
"-pack": "15"
|
|
},
|
|
{
|
|
"-desc": "提起来",
|
|
"-id": "213",
|
|
"-key": "[:213]",
|
|
"-pack": "15"
|
|
},
|
|
{
|
|
"-desc": "洗澡",
|
|
"-id": "217",
|
|
"-key": "[:217]",
|
|
"-pack": "15"
|
|
},
|
|
{
|
|
"-desc": "漂亮姐姐",
|
|
"-id": "215",
|
|
"-key": "[:215]",
|
|
"-pack": "15"
|
|
},
|
|
{
|
|
"-desc": "点赞",
|
|
"-id": "216",
|
|
"-key": "[:216]",
|
|
"-pack": "15"
|
|
},
|
|
{
|
|
"-desc": "睡觉",
|
|
"-id": "214",
|
|
"-key": "[:214]",
|
|
"-pack": "15"
|
|
},
|
|
{
|
|
"-desc": "羞羞",
|
|
"-id": "218",
|
|
"-key": "[:218]",
|
|
"-pack": "15"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"-name": "星座表情",
|
|
"-tag": "3",
|
|
"-money": "0",
|
|
"-category": "可爱",
|
|
"-effective": "30",
|
|
"-tail": "会员表情",
|
|
"-desc": "星座物语,只为懂我的你~~~",
|
|
"-thumb": "http://dl.vip.yy.com/facepacket2/1/12.png",
|
|
"-guide": "http://dl.vip.yy.com/facepacket2/2/12.png",
|
|
"-click": "http://vip.yy.com/vip/redirect?src=wcmoveface&type=3",
|
|
"face": [
|
|
{
|
|
"-desc": "双子座-求交往",
|
|
"-id": "256",
|
|
"-key": "[:256]",
|
|
"-pack": "18"
|
|
},
|
|
{
|
|
"-desc": "双鱼座-亲亲",
|
|
"-id": "257",
|
|
"-key": "[:257]",
|
|
"-pack": "18"
|
|
},
|
|
{
|
|
"-desc": "处女座-舍得黑我嘛",
|
|
"-id": "258",
|
|
"-key": "[:258]",
|
|
"-pack": "18"
|
|
},
|
|
{
|
|
"-desc": "天秤座-我要我要",
|
|
"-id": "259",
|
|
"-key": "[:259]",
|
|
"-pack": "18"
|
|
},
|
|
{
|
|
"-desc": "天蝎座-找削啊",
|
|
"-id": "260",
|
|
"-key": "[:260]",
|
|
"-pack": "18"
|
|
},
|
|
{
|
|
"-desc": "射手座-射箭",
|
|
"-id": "261",
|
|
"-key": "[:261]",
|
|
"-pack": "18"
|
|
},
|
|
{
|
|
"-desc": "巨蟹座-吐泡泡",
|
|
"-id": "262",
|
|
"-key": "[:262]",
|
|
"-pack": "18"
|
|
},
|
|
{
|
|
"-desc": "摩羯座-美美哒",
|
|
"-id": "263",
|
|
"-key": "[:263]",
|
|
"-pack": "18"
|
|
},
|
|
{
|
|
"-desc": "水瓶座-好桑心",
|
|
"-id": "264",
|
|
"-key": "[:264]",
|
|
"-pack": "18"
|
|
},
|
|
{
|
|
"-desc": "狮子座-嗨起来",
|
|
"-id": "265",
|
|
"-key": "[:265]",
|
|
"-pack": "18"
|
|
},
|
|
{
|
|
"-desc": "白羊座-觉觉",
|
|
"-id": "266",
|
|
"-key": "[:266]",
|
|
"-pack": "18"
|
|
},
|
|
{
|
|
"-desc": "金牛座-撞飞你",
|
|
"-id": "267",
|
|
"-key": "[:267]",
|
|
"-pack": "18"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"-name": "大兵表情",
|
|
"-tag": "3",
|
|
"-money": "300",
|
|
"-category": "萌",
|
|
"-effective": "30",
|
|
"-tail": "全民表情",
|
|
"-desc": "我是小小大兵,最喜欢每天笑着过!",
|
|
"-thumb": "http://dl.vip.yy.com/facepacket2/1/11.png",
|
|
"-guide": "http://dl.vip.yy.com/facepacket2/2/11.png",
|
|
"-click": "http://vip.yy.com/vip/redirect?src=diamond.moveface",
|
|
"face": [
|
|
{
|
|
"-desc": "出血",
|
|
"-id": "197",
|
|
"-key": "[:197]",
|
|
"-pack": "14"
|
|
},
|
|
{
|
|
"-desc": "咳咳",
|
|
"-id": "198",
|
|
"-key": "[:198]",
|
|
"-pack": "14"
|
|
},
|
|
{
|
|
"-desc": "天真地笑",
|
|
"-id": "199",
|
|
"-key": "[:199]",
|
|
"-pack": "14"
|
|
},
|
|
{
|
|
"-desc": "我哭",
|
|
"-id": "200",
|
|
"-key": "[:200]",
|
|
"-pack": "14"
|
|
},
|
|
{
|
|
"-desc": "打枪",
|
|
"-id": "201",
|
|
"-key": "[:201]",
|
|
"-pack": "14"
|
|
},
|
|
{
|
|
"-desc": "瀑布汗",
|
|
"-id": "203",
|
|
"-key": "[:203]",
|
|
"-pack": "14"
|
|
},
|
|
{
|
|
"-desc": "热死了",
|
|
"-id": "204",
|
|
"-key": "[:204]",
|
|
"-pack": "14"
|
|
},
|
|
{
|
|
"-desc": "飘过",
|
|
"-id": "206",
|
|
"-key": "[:206]",
|
|
"-pack": "14"
|
|
},
|
|
{
|
|
"-desc": "风男",
|
|
"-id": "219",
|
|
"-key": "[:219]",
|
|
"-pack": "15"
|
|
},
|
|
{
|
|
"-desc": "荡秋千",
|
|
"-id": "220",
|
|
"-key": "[:220]",
|
|
"-pack": "15"
|
|
},
|
|
{
|
|
"-desc": "超人",
|
|
"-id": "221",
|
|
"-key": "[:221]",
|
|
"-pack": "15"
|
|
},
|
|
{
|
|
"-desc": "唱歌",
|
|
"-id": "222",
|
|
"-key": "[:222]",
|
|
"-pack": "15"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"-name": "红豆丁",
|
|
"-tag": "3",
|
|
"-money": "0",
|
|
"-category": "呆",
|
|
"-effective": "30",
|
|
"-tail": "会员表情",
|
|
"-desc": "富有爱国情怀、满身正能量的红豆丁,生活中也有不少囧事哦~",
|
|
"-thumb": "http://dl.vip.yy.com/facepacket2/1/4.png",
|
|
"-guide": "http://dl.vip.yy.com/facepacket2/2/4.png",
|
|
"-click": "http://vip.yy.com/vip/redirect?src=wcmoveface&type=3",
|
|
"face": [
|
|
{
|
|
"-desc": "红豆丁贴图",
|
|
"-id": "124",
|
|
"-key": "[:红豆丁贴图]",
|
|
"-pack": "7"
|
|
},
|
|
{
|
|
"-desc": "红豆丁掉坑",
|
|
"-id": "125",
|
|
"-key": "[:红豆丁掉坑]",
|
|
"-pack": "7"
|
|
},
|
|
{
|
|
"-desc": "红豆丁拳击",
|
|
"-id": "126",
|
|
"-key": "[:红豆丁拳击]",
|
|
"-pack": "7"
|
|
},
|
|
{
|
|
"-desc": "红豆丁抽奖",
|
|
"-id": "127",
|
|
"-key": "[:红豆丁抽奖]",
|
|
"-pack": "7"
|
|
},
|
|
{
|
|
"-desc": "红豆丁踢球",
|
|
"-id": "128",
|
|
"-key": "[:红豆丁踢球]",
|
|
"-pack": "7"
|
|
},
|
|
{
|
|
"-desc": "红豆丁中奖",
|
|
"-id": "129",
|
|
"-key": "[:红豆丁中奖]",
|
|
"-pack": "7"
|
|
},
|
|
{
|
|
"-desc": "奋斗青年",
|
|
"-id": "130",
|
|
"-key": "[:奋斗青年]",
|
|
"-pack": "7"
|
|
},
|
|
{
|
|
"-desc": "五四青年",
|
|
"-id": "131",
|
|
"-key": "[:五四青年]",
|
|
"-pack": "7"
|
|
},
|
|
{
|
|
"-desc": "进步青年",
|
|
"-id": "132",
|
|
"-key": "[:进步青年]",
|
|
"-pack": "7"
|
|
},
|
|
{
|
|
"-desc": "献花",
|
|
"-id": "133",
|
|
"-key": "[:献花]",
|
|
"-pack": "7"
|
|
},
|
|
{
|
|
"-desc": "求抱抱",
|
|
"-id": "134",
|
|
"-key": "[:求抱抱]",
|
|
"-pack": "7"
|
|
},
|
|
{
|
|
"-desc": "滚轮",
|
|
"-id": "135",
|
|
"-key": "[:滚轮]",
|
|
"-pack": "7"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"-name": "妖精森林",
|
|
"-tag": "3",
|
|
"-money": "300",
|
|
"-category": "可爱",
|
|
"-effective": "30",
|
|
"-tail": "全民表情",
|
|
"-desc": "小蓝鱼、飞天菇、小青椒,这三个妖精森林中的好朋友,一起来逗乐你啦~",
|
|
"-thumb": "http://dl.vip.yy.com/facepacket2/1/9.png",
|
|
"-guide": "http://dl.vip.yy.com/facepacket2/2/9.png",
|
|
"-click": "http://vip.yy.com/vip/redirect?src=wcmoveface&type=3",
|
|
"face": [
|
|
{
|
|
"-desc": "不敢相信",
|
|
"-id": "271",
|
|
"-key": "[:271]",
|
|
"-pack": "20"
|
|
},
|
|
{
|
|
"-desc": "伤心",
|
|
"-id": "272",
|
|
"-key": "[:272]",
|
|
"-pack": "20"
|
|
},
|
|
{
|
|
"-desc": "做操",
|
|
"-id": "273",
|
|
"-key": "[:273]",
|
|
"-pack": "20"
|
|
},
|
|
{
|
|
"-desc": "做鬼脸",
|
|
"-id": "274",
|
|
"-key": "[:274]",
|
|
"-pack": "20"
|
|
},
|
|
{
|
|
"-desc": "加油",
|
|
"-id": "275",
|
|
"-key": "[:275]",
|
|
"-pack": "20"
|
|
},
|
|
{
|
|
"-desc": "呜呜",
|
|
"-id": "276",
|
|
"-key": "[:276]",
|
|
"-pack": "20"
|
|
},
|
|
{
|
|
"-desc": "大哭",
|
|
"-id": "277",
|
|
"-key": "[:277]",
|
|
"-pack": "20"
|
|
},
|
|
{
|
|
"-desc": "怒",
|
|
"-id": "278",
|
|
"-key": "[:278]",
|
|
"-pack": "20"
|
|
},
|
|
{
|
|
"-desc": "怒爆了",
|
|
"-id": "279",
|
|
"-key": "[:279]",
|
|
"-pack": "20"
|
|
},
|
|
{
|
|
"-desc": "我晕",
|
|
"-id": "280",
|
|
"-key": "[:280]",
|
|
"-pack": "20"
|
|
},
|
|
{
|
|
"-desc": "有主意了",
|
|
"-id": "281",
|
|
"-key": "[:281]",
|
|
"-pack": "20"
|
|
},
|
|
{
|
|
"-desc": "纯洁的微笑",
|
|
"-id": "282",
|
|
"-key": "[:282]",
|
|
"-pack": "20"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"-name": "草泥猪",
|
|
"-new": "1",
|
|
"-tag": "0",
|
|
"-money": "300",
|
|
"-category": "贱",
|
|
"-effective": "30",
|
|
"-tail": "全民表情",
|
|
"-desc": "爱耍贱爱卖萌,时不时发挥点天然呆,这就是草泥猪,快跟它一起嗨起来!",
|
|
"-thumb": "http://dl.vip.yy.com/facepacket2/1/2.png",
|
|
"-guide": "http://dl.vip.yy.com/facepacket2/2/2.png",
|
|
"-click": "http://vip.yy.com/vip/vmall2/face/pay?id=538288",
|
|
"face": [
|
|
{
|
|
"-desc": "举牌",
|
|
"-id": "283",
|
|
"-key": "[:283]",
|
|
"-pack": "21"
|
|
},
|
|
{
|
|
"-desc": "亲亲",
|
|
"-id": "284",
|
|
"-key": "[:284]",
|
|
"-pack": "21"
|
|
},
|
|
{
|
|
"-desc": "便便",
|
|
"-id": "285",
|
|
"-key": "[:285]",
|
|
"-pack": "21"
|
|
},
|
|
{
|
|
"-desc": "吃饭",
|
|
"-id": "286",
|
|
"-key": "[:286]",
|
|
"-pack": "21"
|
|
},
|
|
{
|
|
"-desc": "呵呵",
|
|
"-id": "287",
|
|
"-key": "[:287]",
|
|
"-pack": "21"
|
|
},
|
|
{
|
|
"-desc": "我来了",
|
|
"-id": "288",
|
|
"-key": "[:288]",
|
|
"-pack": "21"
|
|
},
|
|
{
|
|
"-desc": "抽烟",
|
|
"-id": "289",
|
|
"-key": "[:289]",
|
|
"-pack": "21"
|
|
},
|
|
{
|
|
"-desc": "挖鼻屎",
|
|
"-id": "290",
|
|
"-key": "[:290]",
|
|
"-pack": "21"
|
|
},
|
|
{
|
|
"-desc": "晃来晃去",
|
|
"-id": "291",
|
|
"-key": "[:291]",
|
|
"-pack": "21"
|
|
},
|
|
{
|
|
"-desc": "路过",
|
|
"-id": "292",
|
|
"-key": "[:292]",
|
|
"-pack": "21"
|
|
},
|
|
{
|
|
"-desc": "霹雳",
|
|
"-id": "293",
|
|
"-key": "[:293]",
|
|
"-pack": "21"
|
|
},
|
|
{
|
|
"-desc": "鬼脸",
|
|
"-id": "294",
|
|
"-key": "[:294]",
|
|
"-pack": "21"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"-name": "骨头喵",
|
|
"-tag": "0",
|
|
"-money": "300",
|
|
"-new": "1",
|
|
"-category": "萌",
|
|
"-effective": "30",
|
|
"-tail": "全民表情",
|
|
"-desc": "内心善良、有时呆呆的,还超级喜欢骨头,偶尔也发发脾气,这就是可爱的骨头喵哦~",
|
|
"-thumb": "http://dl.vip.yy.com/facepacket2/1/3.png",
|
|
"-guide": "http://dl.vip.yy.com/facepacket2/2/3.png",
|
|
"-click": "http://vip.yy.com/vip/vmall2/face/pay?id=538290",
|
|
"face": [
|
|
{
|
|
"-desc": "再见",
|
|
"-id": "295",
|
|
"-key": "[:295]",
|
|
"-pack": "22"
|
|
},
|
|
{
|
|
"-desc": "喜欢你",
|
|
"-id": "296",
|
|
"-key": "[:296]",
|
|
"-pack": "22"
|
|
},
|
|
{
|
|
"-desc": "心好痛",
|
|
"-id": "297",
|
|
"-key": "[:297]",
|
|
"-pack": "22"
|
|
},
|
|
{
|
|
"-desc": "心情好好",
|
|
"-id": "298",
|
|
"-key": "[:298]",
|
|
"-pack": "22"
|
|
},
|
|
{
|
|
"-desc": "我要嘛",
|
|
"-id": "299",
|
|
"-key": "[:299]",
|
|
"-pack": "22"
|
|
},
|
|
{
|
|
"-desc": "我错了",
|
|
"-id": "300",
|
|
"-key": "[:300]",
|
|
"-pack": "22"
|
|
},
|
|
{
|
|
"-desc": "找死啊",
|
|
"-id": "301",
|
|
"-key": "[:301]",
|
|
"-pack": "22"
|
|
},
|
|
{
|
|
"-desc": "晚安",
|
|
"-id": "302",
|
|
"-key": "[:302]",
|
|
"-pack": "22"
|
|
},
|
|
{
|
|
"-desc": "糗大了",
|
|
"-id": "303",
|
|
"-key": "[:303]",
|
|
"-pack": "22"
|
|
},
|
|
{
|
|
"-desc": "表这样",
|
|
"-id": "304",
|
|
"-key": "[:304]",
|
|
"-pack": "22"
|
|
},
|
|
{
|
|
"-desc": "谁理你",
|
|
"-id": "305",
|
|
"-key": "[:305]",
|
|
"-pack": "22"
|
|
},
|
|
{
|
|
"-desc": "逗你呢",
|
|
"-id": "306",
|
|
"-key": "[:306]",
|
|
"-pack": "22"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"-name": "欢聚怪蜀黍",
|
|
"-tag": "0",
|
|
"-money": "300",
|
|
"-new": "1",
|
|
"-category": "呆",
|
|
"-effective": "30",
|
|
"-tail": "全民表情",
|
|
"-desc": "欢聚大叔虽外表残酷冷峻,但始终藏不住内心逗比的本质呢~",
|
|
"-thumb": "http://dl.vip.yy.com/facepacket2/1/5.png",
|
|
"-guide": "http://dl.vip.yy.com/facepacket2/2/5.png",
|
|
"-click": "http://vip.yy.com/vip/vmall2/face/pay?id=538292",
|
|
"face": [
|
|
{
|
|
"-desc": "么么哒",
|
|
"-id": "307",
|
|
"-key": "[:307]",
|
|
"-pack": "23"
|
|
},
|
|
{
|
|
"-desc": "吐血",
|
|
"-id": "308",
|
|
"-key": "[:308]",
|
|
"-pack": "23"
|
|
},
|
|
{
|
|
"-desc": "呆",
|
|
"-id": "309",
|
|
"-key": "[:309]",
|
|
"-pack": "23"
|
|
},
|
|
{
|
|
"-desc": "大哭",
|
|
"-id": "310",
|
|
"-key": "[:310]",
|
|
"-pack": "23"
|
|
},
|
|
{
|
|
"-desc": "大笑",
|
|
"-id": "311",
|
|
"-key": "[:311]",
|
|
"-pack": "23"
|
|
},
|
|
{
|
|
"-desc": "害羞",
|
|
"-id": "312",
|
|
"-key": "[:312]",
|
|
"-pack": "23"
|
|
},
|
|
{
|
|
"-desc": "怒 ",
|
|
"-id": "313",
|
|
"-key": "[:313]",
|
|
"-pack": "23"
|
|
},
|
|
{
|
|
"-desc": "惊呆",
|
|
"-id": "314",
|
|
"-key": "[:314]",
|
|
"-pack": "23"
|
|
},
|
|
{
|
|
"-desc": "抽烟",
|
|
"-id": "315",
|
|
"-key": "[:315]",
|
|
"-pack": "23"
|
|
},
|
|
{
|
|
"-desc": "美男子",
|
|
"-id": "316",
|
|
"-key": "[:316]",
|
|
"-pack": "23"
|
|
},
|
|
{
|
|
"-desc": "耍帅",
|
|
"-id": "317",
|
|
"-key": "[:317]",
|
|
"-pack": "23"
|
|
},
|
|
{
|
|
"-desc": "郁闷",
|
|
"-id": "318",
|
|
"-key": "[:318]",
|
|
"-pack": "23"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"-name": "世界杯",
|
|
"-tag": "0",
|
|
"-money": "300",
|
|
"-category": "萌",
|
|
"-effective": "30",
|
|
"-tail": "全民表情",
|
|
"-desc": "Y熊化身为足球达人,整个绿茵场等着他来拯救!",
|
|
"-thumb": "http://dl.vip.yy.com/facepacket2/1/6.png",
|
|
"-guide": "http://dl.vip.yy.com/facepacket2/2/6.png",
|
|
"-click": "http://vip.yy.com/vip/vmall2/face/pay?id=538294",
|
|
"face": [
|
|
{
|
|
"-desc": "不是吧",
|
|
"-id": "223",
|
|
"-key": "[:223]",
|
|
"-pack": "16"
|
|
},
|
|
{
|
|
"-desc": "卖萌",
|
|
"-id": "224",
|
|
"-key": "[:224]",
|
|
"-pack": "16"
|
|
},
|
|
{
|
|
"-desc": "呆呆的",
|
|
"-id": "225",
|
|
"-key": "[:225]",
|
|
"-pack": "16"
|
|
},
|
|
{
|
|
"-desc": "大力神杯",
|
|
"-id": "226",
|
|
"-key": "[:226]",
|
|
"-pack": "16"
|
|
},
|
|
{
|
|
"-desc": "好美味",
|
|
"-id": "227",
|
|
"-key": "[:227]",
|
|
"-pack": "16"
|
|
},
|
|
{
|
|
"-desc": "庆祝",
|
|
"-id": "228",
|
|
"-key": "[:228]",
|
|
"-pack": "16"
|
|
},
|
|
{
|
|
"-desc": "快累趴了",
|
|
"-id": "229",
|
|
"-key": "[:229]",
|
|
"-pack": "16"
|
|
},
|
|
{
|
|
"-desc": "赏你红牌",
|
|
"-id": "230",
|
|
"-key": "[:230]",
|
|
"-pack": "16"
|
|
},
|
|
{
|
|
"-desc": "跳个舞",
|
|
"-id": "231",
|
|
"-key": "[:231]",
|
|
"-pack": "16"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
|
|
|
|
// (function(){
|
|
var groups = data.vip_expression.group;
|
|
var i = 0 ,len = groups.length;
|
|
for(;i < len ; i++ ){
|
|
var faces = groups[i].face;
|
|
for(var j = 0; j < faces.length;j++){
|
|
var face = faces[j];
|
|
faceMap[face['-key']] = face;
|
|
}
|
|
}
|
|
// })();
|
|
|
|
var expfn = {
|
|
getFaceByKey:function(key){
|
|
var url = 'http://dl.vip.yy.com/vipface/pngs/';
|
|
var face = faceMap[key];
|
|
if(face){
|
|
return url + face['-id'];
|
|
}
|
|
return null;
|
|
},
|
|
filterVipFace : function(msg,beginPostion){
|
|
beginPostion = beginPostion || 0;
|
|
var t = this,
|
|
matchPrefix = "yy://yyvip-[=",
|
|
matchSuffix = "]",
|
|
regexpPrefix = "yy://yyvip-\\[=",
|
|
regexpSuffix = "\\]",
|
|
minKeyLen = 1,
|
|
maxKeyLen = 25
|
|
|
|
var firstIndex = msg.indexOf(matchPrefix,beginPostion);
|
|
var matchLastIndex = firstIndex+matchPrefix.length;
|
|
|
|
if(firstIndex!=-1 && msg.length>=(matchLastIndex+minKeyLen)){
|
|
var eachMatchLastIndex = matchLastIndex;
|
|
for(var i=minKeyLen;i<maxKeyLen;i++){
|
|
eachMatchLastIndex = matchLastIndex+i;
|
|
if(msg.length<eachMatchLastIndex){
|
|
break;
|
|
}
|
|
var smRp = msg.substr(matchLastIndex,i);
|
|
var smKey = "[:"+smRp+"]";
|
|
var face = faceMap[smKey];
|
|
if(face){
|
|
msg = msg.replace(new RegExp(regexpPrefix+smRp+regexpSuffix,"gm"),
|
|
'<img title="'+face["-desc"]+'" src="'+t.getFaceByKey(smKey)+'" alt="" />' );
|
|
break;
|
|
}
|
|
}
|
|
beginPostion = eachMatchLastIndex-1;
|
|
return t.filterVipFace(msg,beginPostion);
|
|
}
|
|
return msg;
|
|
}
|
|
}
|
|
|
|
module.exports= expfn;
|
|
|
|
})
|
|
|
|
define('chatHistory',['yyapi'],function(require, exports, module) {
|
|
var yyapi = require('yyapi');
|
|
|
|
var queue = [];
|
|
var face = {
|
|
saveHistory : function(item,type){
|
|
while(queue.length>=5){
|
|
queue.shift();
|
|
}
|
|
item.type = type;
|
|
var sid = yyapi.getChannelInfo().longId;
|
|
item.channelId = sid;
|
|
queue.push(item);
|
|
var cookietime = new Date();
|
|
cookietime.setTime(cookietime.getTime() + 1 * 60 * 1000);
|
|
$.cookie("chatPub_history",JSON.stringify(queue),{expires :cookietime});
|
|
},
|
|
readHistory : function(type){
|
|
var sid = yyapi.getChannelInfo().longId;
|
|
var str = $.cookie("chatPub_history");
|
|
var arr = [];
|
|
if(str == undefined)
|
|
return arr;
|
|
var jsonData = JSON.parse(str);
|
|
for(var i = 0; i < jsonData.length; i++)
|
|
{
|
|
var item = jsonData[i];
|
|
if((type == undefined || item.type == type) && item.channelId == sid)
|
|
{
|
|
item.isHistory = true;
|
|
arr.push(item);
|
|
}
|
|
}
|
|
|
|
return arr;
|
|
}
|
|
};
|
|
module.exports = face;
|
|
})
|
|
define('util',function (require, exports, module) {
|
|
|
|
//判断当前日期是否大于某个日期
|
|
// yyyy-MM-dd HH:mm:ss
|
|
var greaterThanTime = function (time) {
|
|
var now = new Date();
|
|
var end = parseDate(time);
|
|
var ret = false;
|
|
if (now.getTime() > end.getTime()) {
|
|
ret = true;
|
|
}
|
|
// logger.debug([formatTime(now),">", formatTime(end),ret]);
|
|
return ret;
|
|
|
|
}
|
|
//跟greaterThanTime恰好相反
|
|
var lessThanTime = function (t) {
|
|
return !greaterThanTime(t);
|
|
}
|
|
//yyyy-MM-dd HH:mm:ss --> Date objet
|
|
var parseDate = function (time) {
|
|
|
|
var t = String(time);
|
|
var year = parseInt(t.substring(0, 4)),
|
|
month = parseInt(t.substring(5, 7)),
|
|
day = parseInt(t.substring(8, 10)),
|
|
hour = parseInt(t.substring(11, 13)),
|
|
min = parseInt(t.substring(14, 16)),
|
|
sec = parseInt(t.substring(17, 19));
|
|
|
|
// logger.debug([year,month,day,hour,min,sec])
|
|
|
|
var end = new Date();
|
|
end.setFullYear(year);
|
|
end.setMonth(month - 1, day);
|
|
end.setHours(hour);
|
|
end.setMinutes(min);
|
|
end.setSeconds(sec);
|
|
end.setMilliseconds(0);
|
|
|
|
return end;
|
|
}
|
|
|
|
var parseXML = function (data) {
|
|
var xml, tmp;
|
|
if (window.DOMParser) { // Standard
|
|
tmp = new DOMParser();
|
|
xml = tmp.parseFromString(data, "text/xml");
|
|
} else { // IE
|
|
xml = new ActiveXObject("Microsoft.XMLDOM");
|
|
xml.async = "false";
|
|
xml.loadXML(data);
|
|
}
|
|
tmp = xml.documentElement;
|
|
if (!tmp || !tmp.nodeName || tmp.nodeName === "parsererror") {
|
|
return null;
|
|
}
|
|
return xml;
|
|
}
|
|
|
|
var xmlToJson = function (obj) {
|
|
if (this == null) return null;
|
|
var retObj = new Object;
|
|
buildObjectNode(retObj,
|
|
/*jQuery*/
|
|
obj);
|
|
return retObj;
|
|
function buildObjectNode(cycleOBJ,
|
|
/*Element*/
|
|
elNode) {
|
|
/*NamedNodeMap*/
|
|
var nodeAttr = elNode.attributes;
|
|
if (nodeAttr != null) {
|
|
if (nodeAttr.length && cycleOBJ == null) cycleOBJ = new Object;
|
|
for (var i = 0; i < nodeAttr.length; i++) {
|
|
cycleOBJ[nodeAttr[i].name] = nodeAttr[i].value;
|
|
}
|
|
}
|
|
var nodeText = "text";
|
|
if (elNode.text == null) nodeText = "textContent";
|
|
/*NodeList*/
|
|
var nodeChilds = elNode.childNodes;
|
|
if (nodeChilds != null) {
|
|
if (nodeChilds.length && cycleOBJ == null) cycleOBJ = new Object;
|
|
for (var i = 0; i < nodeChilds.length; i++) {
|
|
if (nodeChilds[i].tagName != null) {
|
|
if (nodeChilds[i].childNodes[0] != null && nodeChilds[i].childNodes.length <= 1 && (nodeChilds[i].childNodes[0].nodeType == 3 || nodeChilds[i].childNodes[0].nodeType == 4)) {
|
|
if (cycleOBJ[nodeChilds[i].tagName] == null) {
|
|
cycleOBJ[nodeChilds[i].tagName] = nodeChilds[i][nodeText];
|
|
} else {
|
|
if (typeof (cycleOBJ[nodeChilds[i].tagName]) == "object" && cycleOBJ[nodeChilds[i].tagName].length) {
|
|
cycleOBJ[nodeChilds[i].tagName][cycleOBJ[nodeChilds[i].tagName].length] = nodeChilds[i][nodeText];
|
|
} else {
|
|
cycleOBJ[nodeChilds[i].tagName] = [cycleOBJ[nodeChilds[i].tagName]];
|
|
cycleOBJ[nodeChilds[i].tagName][1] = nodeChilds[i][nodeText];
|
|
}
|
|
}
|
|
} else {
|
|
if (nodeChilds[i].childNodes.length) {
|
|
if (cycleOBJ[nodeChilds[i].tagName] == null) {
|
|
cycleOBJ[nodeChilds[i].tagName] = new Object;
|
|
buildObjectNode(cycleOBJ[nodeChilds[i].tagName], nodeChilds[i]);
|
|
} else {
|
|
if (cycleOBJ[nodeChilds[i].tagName].length) {
|
|
cycleOBJ[nodeChilds[i].tagName][cycleOBJ[nodeChilds[i].tagName].length] = new Object;
|
|
buildObjectNode(cycleOBJ[nodeChilds[i].tagName][cycleOBJ[nodeChilds[i].tagName].length - 1], nodeChilds[i]);
|
|
} else {
|
|
cycleOBJ[nodeChilds[i].tagName] = [cycleOBJ[nodeChilds[i].tagName]];
|
|
cycleOBJ[nodeChilds[i].tagName][1] = new Object;
|
|
buildObjectNode(cycleOBJ[nodeChilds[i].tagName][1], nodeChilds[i]);
|
|
}
|
|
}
|
|
} else {
|
|
cycleOBJ[nodeChilds[i].tagName] = nodeChilds[i][nodeText];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
var o = {
|
|
xmlToJson:xmlToJson,
|
|
parseXML: parseXML,
|
|
parseDate: parseDate,
|
|
lessThanTime: lessThanTime,
|
|
greaterThanTime: greaterThanTime,
|
|
/*
|
|
* 获取 url 中指定变量的值
|
|
* @param {[String]} key name [变量名]
|
|
* @param {[String]} url [url地址]
|
|
* */
|
|
getUrlParam: function (name, url) {
|
|
var re = new RegExp("[\\?&#]" + name + "=([^&#]+)", "gi");
|
|
var ma = (url || location.href).match(re);
|
|
var strArr;
|
|
|
|
if (ma && ma.length > 0) {
|
|
strArr = (ma[ma.length - 1]).split("=");
|
|
if (strArr && strArr.length > 1) {
|
|
return strArr[1];
|
|
}
|
|
return ''
|
|
}
|
|
return '';
|
|
},
|
|
now: Date.now || function () { return new Date().getTime(); },
|
|
debounce: function (func, wait, immediate) {
|
|
var timeout, args, context, timestamp, result;
|
|
|
|
var later = function () {
|
|
var last = o.now() - timestamp;
|
|
if (last < wait) {
|
|
timeout = setTimeout(later, wait - last);
|
|
} else {
|
|
timeout = null;
|
|
if (!immediate) {
|
|
result = func.apply(context, args);
|
|
context = args = null;
|
|
}
|
|
}
|
|
};
|
|
return function () {
|
|
context = this;
|
|
args = arguments;
|
|
timestamp = o.now();
|
|
var callNow = immediate && !timeout;
|
|
if (!timeout) {
|
|
timeout = setTimeout(later, wait);
|
|
}
|
|
if (callNow) {
|
|
result = func.apply(context, args);
|
|
context = args = null;
|
|
}
|
|
|
|
return result;
|
|
};
|
|
},
|
|
imageLoad: function (element, options) {
|
|
var imgs = (element instanceof $ ? element : $(element)).find('img');
|
|
|
|
imgs.length && imgs.on('load', function () {
|
|
$.isFunction(options.done) && options.done(this)
|
|
}).one('error', function () {
|
|
$.isFunction(options.fail) && options.fail(this)
|
|
})
|
|
},
|
|
format: function (text, obj) {
|
|
var c = obj || {};
|
|
var b = text;
|
|
for (var a in c) {
|
|
if (c.hasOwnProperty(a)) {
|
|
b = b.replace(new RegExp("\\$\\{" + a + "\\}", "gm"), c[a]);
|
|
}
|
|
}
|
|
return b;
|
|
},
|
|
htmlEscape: function (input) {
|
|
if (typeof (input) !== "string")
|
|
return input;
|
|
var result = [];
|
|
var length = input.length;
|
|
for (var i = 0; i < length; i++) {
|
|
var c = input.charAt(i).toString();
|
|
if (c == '&') {
|
|
result.push("&");
|
|
} else if (c == '\"') {
|
|
result.push(""");
|
|
} else if (c == '<') {
|
|
result.push("<");
|
|
} else if (c == '>') {
|
|
result.push(">");
|
|
} else if (c == '\'') {
|
|
result.push("'");
|
|
} else if (c == '\\') {
|
|
result.push("\");
|
|
} else {
|
|
result.push(c);
|
|
}
|
|
}
|
|
return result.join("");
|
|
},
|
|
JSONString: (window.JSON && JSON.stringify) || function (vContent) {
|
|
if (vContent instanceof Object) {
|
|
var sOutput = "";
|
|
if (vContent.constructor === Array) {
|
|
for (var nId = 0; nId < vContent.length; sOutput += this.JSONString(vContent[nId]) + ",", nId++);
|
|
return "[" + sOutput.substr(0, sOutput.length - 1) + "]";
|
|
}
|
|
if (vContent.toString !== Object.prototype.toString) {
|
|
return "\"" + vContent.toString().replace(/"/g, "\\$&") + "\"";
|
|
}
|
|
for (var sProp in vContent) {
|
|
sOutput += "\"" + sProp.replace(/"/g, "\\$&") + "\":" + this.JSONString(vContent[sProp]) + ",";
|
|
}
|
|
return "{" + sOutput.substr(0, sOutput.length - 1) + "}";
|
|
}
|
|
return typeof vContent === "string" ? "\"" + vContent.replace(/"/g, "\\$&") + "\"" : String(vContent);
|
|
},
|
|
trim : function(str){
|
|
|
|
str = str.replace(/\s+/g,"");
|
|
return str;
|
|
},
|
|
removeHtmlTab :function(tab) {
|
|
return tab;//删除所有HTML标签
|
|
} ,
|
|
html_encode:function(str)
|
|
{
|
|
var s = "";
|
|
if (!str || str.length == 0) return "";
|
|
s = str.replace(/&/g, ">");
|
|
s = s.replace(/</g, "<");
|
|
s = s.replace(/>/g, ">");
|
|
s = s.replace(/ /g, " ");
|
|
s = s.replace(/\'/g, "'");
|
|
s = s.replace(/\"/g, """);
|
|
s = s.replace(/\n/g, "<br>");
|
|
return s;
|
|
}
|
|
};
|
|
|
|
module.exports = o;
|
|
})
|
|
define('chatpublic',['swfobject','logger','eventUtil','md5','yyapi','util'],function (require, exports, module) {
|
|
require('swfobject');
|
|
var logger = require('logger');
|
|
var eventUtil = require('eventUtil');
|
|
var md5 = require('md5');
|
|
var pubEvent = eventUtil.getInstance("pub");
|
|
var yyapi = require('yyapi');
|
|
var util = require('util');
|
|
//公屏组件
|
|
(function ($) {
|
|
$.uiwidget = $.uiwidget || {};
|
|
$.uiwidget.PublicUI = function (target, cfg) {
|
|
this.target = target;
|
|
$.extend(this, cfg);
|
|
this.init();
|
|
};
|
|
|
|
$.uiwidget.PublicUI.prototype = {
|
|
context: null
|
|
, chatInput: null
|
|
, chatInputConifg: null
|
|
, chatList: null
|
|
, listSize: 0
|
|
, maxRow: 100
|
|
, customImageQueue: [] //max size = maxRow * 2
|
|
, msgQueue: []
|
|
, readyFlag: false
|
|
, msgFreshRate: 200//公屏消息刷新频率,单位毫秒
|
|
, noticeHandle: null
|
|
, flowerCfg: { url: 'http://c1.web.yy.com/img/gift/flower24x24.jpg', h: 24, w: 24 }
|
|
, customImageCfg: {
|
|
defaultSrc: 'http://file.do.yy.com/group3/M02/CC/A1/tz0MYFcwQnyABIaOAAAAK7cKkkM864.gif'
|
|
}
|
|
, isOnMouseEnter: false
|
|
|
|
, privateChat: null //私聊DIV容器对象
|
|
, privateChatCfg: null //私聊配置
|
|
|
|
, init: function () {
|
|
var t = this;
|
|
if (!t.context) {
|
|
return;
|
|
}
|
|
t.target.mouseenter(function () {
|
|
t.onMouseenter();
|
|
});
|
|
t.target.mouseleave(function () {
|
|
t.onMouseleave();
|
|
});
|
|
|
|
t.initScrollbar();//初始化滚动条,可自定义
|
|
t.chatList = this.target.find(".chatlist");
|
|
if (t.chatInputConifg) {
|
|
t.chatInputConifg.cfg.context = t.context;
|
|
t.chatInput = $("#" + t.chatInputConifg.id).chatInput(t.chatInputConifg.cfg);
|
|
|
|
t.chatInput.init();//输入框及发送按钮
|
|
t.chatInput.publicUI = t;
|
|
t.chatInput.addMsgSendListener(function () {
|
|
t.scrollbar.scrollToBottom();
|
|
}, t);
|
|
}
|
|
|
|
/*
|
|
t.chatList.on("click",".name",function(){
|
|
var span = this;
|
|
pubEvent.trigerEvent("pubNickClick",{target:span,type:'pubMsg'});
|
|
})
|
|
*/
|
|
|
|
t.chatList.on("mousedown", ".name", function (e) {
|
|
if (3 == e.which) {
|
|
var span = this;
|
|
var uid = $(span).attr("data-uid") || "";
|
|
var nick = $(span).attr("data-nick") || "";
|
|
var role = $(span).attr("data-role") || 0;
|
|
if (uid == "")
|
|
return;
|
|
yyapi.showUserMenu(parseInt(uid), nick, parseInt(role));
|
|
}
|
|
})
|
|
t.chatList.on("mousedown", ".notice-user", function (e) {
|
|
if (3 == e.which) {
|
|
var span = this;
|
|
var uid = $(span).attr("data-uid") || "";
|
|
var nick = $(span).attr("data-nick") || "";
|
|
var role = $(span).attr("data-role") || 0;
|
|
if (uid == "")
|
|
return;
|
|
yyapi.showUserMenu(parseInt(uid), nick, parseInt(role));
|
|
}
|
|
})
|
|
t.chatList.on("dblclick", ".name", function () {
|
|
var span = this;
|
|
var uid = $(span).attr("data-uid") || "";
|
|
if (uid == yyapi.getMyUserInfo().uid)
|
|
return;
|
|
t.privateChat.showInChatBox();
|
|
pubEvent.trigerEvent("pubNickClick", { target: span, type: 'pubMsg' });
|
|
})
|
|
t.chatList.on("click", ".pub-custom-img", function () {
|
|
var img = this;
|
|
t.onCustomImageClick(img);
|
|
})
|
|
|
|
pubEvent.addEvent("increaseZindex", function (opt) {
|
|
if (opt.type == 'opr-box') {
|
|
t.increaseOperationAreaZindex();
|
|
}
|
|
});
|
|
|
|
//私聊
|
|
|
|
if (t.privateChatCfg) {
|
|
t.privateChatCfg.context = t.context;
|
|
t.privateChatCfg.pubicChat = t;
|
|
var privbox = $(t.privateChatCfg.selector);
|
|
if (privbox.length) {
|
|
t.privateChat = privbox.privateUI(t.privateChatCfg);
|
|
t.privateChat.init();
|
|
}
|
|
}
|
|
|
|
t.readyFlag = true;
|
|
//初始化公屏相关(滚动条,显示屏,各种消息、通知,输入框,表情,发送按钮)
|
|
t.start();
|
|
|
|
}
|
|
, startPrivateChatByUid: function (uid) {
|
|
if(!uid)
|
|
return;
|
|
var t = this;
|
|
var chatList = this.target.find(".chatlist");
|
|
var span = chatList.find("span[data-uid='" + uid + "']");
|
|
var nick = "";
|
|
var role = 0;
|
|
var yyno = "";
|
|
if(span.length == 0)
|
|
{
|
|
var user = yyapi.getUserInfo(uid);
|
|
nick = user.name;
|
|
role = user.role;
|
|
yyno = user.imid;
|
|
}
|
|
else
|
|
{
|
|
nick = $(span).text();
|
|
role = $(span).attr('data-role') || "";
|
|
yyno = $(span).attr('data-yyno') || "";
|
|
}
|
|
if (uid == yyapi.getMyUserInfo().uid)
|
|
return;
|
|
t.privateChat.showInChatBox();
|
|
t.privateChat.addUserToList(uid,nick,role,yyno);
|
|
|
|
}
|
|
, start: function () {
|
|
var t = this;
|
|
|
|
var historyData = t.readHistory();
|
|
for(var i = 0; i < historyData.length; i++)
|
|
{
|
|
var item = historyData[i];
|
|
if(item.type == 0)
|
|
{
|
|
t.receiveMessage(item);
|
|
}
|
|
else if(item.type == 1)
|
|
{
|
|
t.informSysMsg(item);
|
|
}
|
|
}
|
|
setInterval(function () {//定时刷新公屏消息
|
|
t.showChatList();
|
|
}, t.msgFreshRate);
|
|
}
|
|
, initScrollbar: function () {
|
|
this.scrollbar.obj = this.target;
|
|
if (this.scrollbar.obj) {
|
|
this.scrollbar.init(this);
|
|
}
|
|
}
|
|
, receiveData: function (obj) {
|
|
this.receiveMessage(obj);
|
|
},
|
|
receiveImageUrl: function (obj) {//接受自定义图片
|
|
var t = this;
|
|
|
|
logger.info(["receiveImageUrl", obj]);
|
|
while (t.customImageQueue.length > t.maxRow * 2) {
|
|
t.customImageQueue.shift();
|
|
}
|
|
var md5 = t.md5(obj.url);
|
|
obj.key = md5;
|
|
t.customImageQueue.push(obj);
|
|
}
|
|
, receivePrivateMessage: function (obj) {
|
|
logger.info(["receivePrivateMessage", obj]);
|
|
var t = this;
|
|
if (t.privateChat && t.privateChat.receMsg) {
|
|
t.privateChat.receMsg(obj);
|
|
}
|
|
}
|
|
, receiveMessage: function (obj) {
|
|
logger.info(["receiveMessage", obj]);
|
|
var t = this;
|
|
if (t.isMyself(obj.fromUser) && !obj.local) {
|
|
//return;
|
|
}
|
|
var msg = "";
|
|
try {
|
|
msg = decodeURI(obj.msg);
|
|
} catch (e) {
|
|
msg = obj.msg;
|
|
}
|
|
if (msg.length > t.chatInput.maxInputSize) {
|
|
return;
|
|
}
|
|
if (t.filterMsg) {
|
|
msg = t.filterMsg(msg);
|
|
}
|
|
msg = t.chatInput.filterContent(msg);
|
|
if (t.filterVipFace) {
|
|
msg = t.filterVipFace(msg);
|
|
}
|
|
if (t.filterAirTicket) {
|
|
msg = t.filterAirTicket(msg);
|
|
}
|
|
if (t.filterAirTicket2) {
|
|
msg = t.filterAirTicket2(msg);
|
|
}
|
|
if (t.filterCustomImage) {
|
|
msg = t.filterCustomImage(msg);
|
|
}
|
|
if (t.fileterWeiDeng) {
|
|
msg = t.fileterWeiDeng(msg,obj.extraInfo.weidengs);
|
|
}
|
|
var mj = _mjManager.getMj(obj.fromUser.role, obj.fromUser.gender);//改成图片或样式
|
|
var yylevel ="";
|
|
if (t.fileterYYLevel) {
|
|
yylevel = t.fileterYYLevel(obj.fromUser.yylevel );
|
|
}
|
|
var lianghao = "";
|
|
if (t.fileterLianghao) {
|
|
lianghao = t.fileterLianghao(obj.extraInfo.lianghao);
|
|
}
|
|
var identity = "";
|
|
if (t.fileterIdentity) {
|
|
identity = t.fileterIdentity(obj.extraInfo.identitys);
|
|
}
|
|
|
|
var yyno = "";
|
|
if (obj.fromUser.yyno) {
|
|
yyno = '<span class="time">('+ obj.fromUser.yyno + ')</span>';
|
|
}
|
|
if(obj.fromUser.role >= 150)//大于等于粉马
|
|
yylevel = "";
|
|
if(obj.fromUser.role < 150)//小于粉马
|
|
mj = "";
|
|
|
|
var time = t.getTimeHTML(obj);
|
|
|
|
var nickName = "" + t.wrapFromUser(obj.fromUser) + yyno + lianghao + time;
|
|
var msgStyle = t.getMessageStyle(obj.fontInfo);
|
|
var content = '<li><p>' + mj + yylevel + identity + nickName + '</p><p class="text-content" style="' + msgStyle + '">' + msg + '</p></li>';
|
|
t.addPubChatMsgQueue(content);
|
|
if (t.saveHistory && obj.isHistory == undefined) {
|
|
t.saveHistory(obj, 0);
|
|
}
|
|
}
|
|
, getMessageStyle: function (obj) {
|
|
if (!obj)
|
|
return;
|
|
var t = this;
|
|
var msgStyle = "";
|
|
//字体
|
|
if ("font_name" in obj) {
|
|
msgStyle += 'font-family:' + obj.font_name + ';';
|
|
}
|
|
//颜色
|
|
if ("color" in obj) {
|
|
if (obj.color > 0) {
|
|
msgStyle += "color:" + t.intColorToHex(obj.color) + ";"
|
|
}
|
|
|
|
}
|
|
|
|
if ("font_size" in obj) {
|
|
|
|
if (obj.font_size > 0) {
|
|
msgStyle += "font-size:" + obj.font_size + "px;";
|
|
}
|
|
|
|
}
|
|
if ("font_weight" in obj) {
|
|
if (obj.font_weight)
|
|
msgStyle += "font-weight:bold;";
|
|
}
|
|
if ("font_italic" in obj) {
|
|
if (obj.font_italic)
|
|
msgStyle += "font-style:italic;";
|
|
}
|
|
if ("font_underline" in obj) {
|
|
if (obj.font_underline)
|
|
msgStyle += "text-decoration:underline;";
|
|
}
|
|
|
|
return msgStyle;
|
|
}
|
|
, informNotify: function (obj) {
|
|
logger.info(["informNotify", obj]);
|
|
var t = this;
|
|
//console.info("cbEventObjs informNotify");
|
|
if (t.isMyself(obj.admin)) {
|
|
if (obj.fromClient) {
|
|
t.setPubNotice(obj);
|
|
}
|
|
} else {
|
|
t.setPubNotice(obj);
|
|
}
|
|
}
|
|
, informSysMsg: function (obj) {
|
|
var t = this;
|
|
t.setPubNotice2(obj);
|
|
}
|
|
, getIncreaseZindex: function () {
|
|
var t = this;
|
|
t.autoZindex = t.autoZindex || 0;
|
|
return ++t.autoZindex;l
|
|
},
|
|
increaseOperationAreaZindex: function () {
|
|
var t = this;
|
|
var box = t.target.parent().parent().find(".opr-box");
|
|
var index = t.getIncreaseZindex();
|
|
box.css("z-index", index);
|
|
}
|
|
,
|
|
onCustomImageClick: function (img) {
|
|
var t = this;
|
|
var target = $(img);
|
|
var key = target.attr("data-key");
|
|
if (key != "true") {
|
|
var it = t.getCustomImageByKey(key);
|
|
target.attr("src", it.imageUrl);
|
|
target.load(function () {
|
|
$(this).attr("data-key", true);
|
|
});
|
|
}
|
|
else {
|
|
var url = target.attr("src");
|
|
window.open(url,"_blank");
|
|
}
|
|
},
|
|
getCustomImageByKey: function (key) {
|
|
var t = this;
|
|
var i = 0, len = t.customImageQueue.length;
|
|
for (; i < len; i++) {
|
|
var it = t.customImageQueue[i];
|
|
if (it.key == key) {
|
|
return it;
|
|
}
|
|
}
|
|
|
|
var res = yyapi.getImageInfo(key);
|
|
if (res.ret == 0) {
|
|
res.key = key;
|
|
t.customImageQueue.push(res);
|
|
}
|
|
return res;
|
|
},
|
|
intColorToHex: function (intColor) {
|
|
var hex = (intColor).toString(16);
|
|
hex = hex.slice(2, hex.length);
|
|
return "#" + hex;
|
|
},
|
|
intColorToHex2: function (intColor) {
|
|
var hex = (intColor).toString(16);
|
|
|
|
//补0
|
|
var fix = "000000";
|
|
hex = fix.slice(0, fix.length - hex.length) + hex;
|
|
//反转成rrggbb
|
|
var rgb = hex.slice(4, 6) + hex.slice(2, 4) + hex.slice(0, 2);
|
|
return "#" + rgb;
|
|
}
|
|
, isMyself: function (user) {
|
|
return user && user.uid == this.context.getMyUserInfo().uid;
|
|
}
|
|
|
|
, addPubChatMsgQueue: function (content) {
|
|
this.msgQueue.push(content);
|
|
}
|
|
, onMouseenter: function () {
|
|
this.isOnMouseEnter = true;
|
|
|
|
}
|
|
|
|
, onMouseleave: function () {
|
|
this.isOnMouseEnter = false;
|
|
}
|
|
|
|
, showChatList: function () {
|
|
var t = this;
|
|
var msgQueue = t.msgQueue;
|
|
if (msgQueue.length > 0) {
|
|
var showMsgArry = msgQueue.splice(0, msgQueue.length);
|
|
t.chatList.append(showMsgArry.join("\n"));
|
|
t.listSize += showMsgArry.length;
|
|
if (t.listSize > t.maxRow) {
|
|
t.chatList.children().each(function () {
|
|
|
|
if (t.listSize > t.maxRow) {
|
|
$(this).remove();
|
|
t.listSize--;
|
|
} else {
|
|
return false;
|
|
}
|
|
});
|
|
}
|
|
t.freshPubScreenScrollbar();
|
|
}
|
|
}
|
|
|
|
, cleanPubScreen: function () {
|
|
this.listSize = 0;
|
|
this.chatList.empty();
|
|
this.freshPubScreenScrollbar();
|
|
}
|
|
|
|
, freshPubScreenScrollbar: function () {
|
|
var t = this;
|
|
t.scrollbar.scrollToBottom();
|
|
}
|
|
|
|
, scrollbar: {
|
|
api: null
|
|
, obj: null
|
|
, config: { scrollbarWidth: 20, mouseWheelSpeed: 20, stickToBottom: true }
|
|
, panne: null
|
|
, init: function (panne) {
|
|
var t = this;
|
|
t.panne = panne;
|
|
if (!t.obj) return;
|
|
$(t.obj).slimscroll({
|
|
color:"#cfcfcf",
|
|
size: '10px',
|
|
distance: "3px",
|
|
start: "bottom",
|
|
alwaysVisible: true
|
|
});
|
|
|
|
}
|
|
, extendsConfig: function (config) {
|
|
var t = this;
|
|
if (config) {
|
|
t.config = $.extend({}, t.config, config);
|
|
}
|
|
}
|
|
, scrollToBottom: function () {
|
|
var t = this;
|
|
|
|
var it2 = setTimeout(function () {
|
|
clearTimeout(it2);
|
|
$(t.obj).slimScroll({ scrollTo: '9999px' });
|
|
}, 200);
|
|
|
|
}
|
|
}
|
|
|
|
,
|
|
//通知处理
|
|
setPubNotice: function (obj) {
|
|
if (!obj) {
|
|
return;
|
|
}
|
|
var t = this;
|
|
var notice = '', noticeType = 1;
|
|
switch (obj.notifyName) {
|
|
//创建频道消息
|
|
case InformEvent.ADD_SUBCHANNEL_INFO:
|
|
if (obj.param.length > 1) {
|
|
notice = "管理员 [" + obj.admin.nickname + "] 创建子频道 [" + obj.param[0].name + "] >> [" + obj.param[1].name + "]。";
|
|
} else {
|
|
notice = "管理员 [" + obj.admin.nickname + "] 创建子频道 [" + obj.param[0].name + "]。";
|
|
}
|
|
break;
|
|
//移除频道消息
|
|
case InformEvent.REMOVE_SUBCHANNEL_INFO:
|
|
if (obj.param.length > 1) {
|
|
notice = "管理员 [" + obj.admin.nickname + "] 删除子频道 [" + obj.param[0].name + "] >> [" + obj.param[1].name + "]。";
|
|
} else {
|
|
notice = "管理员 [" + obj.admin.nickname + "] 删除子频道 [" + obj.param[0].name + "]。";
|
|
}
|
|
break;
|
|
//清空麦序
|
|
case InformEvent.MIC_KICK_ALL_INFO:
|
|
notice = "管理员 [" + obj.admin.nickname + "] 已将麦序清空。";
|
|
break;
|
|
//抱上麦序消息
|
|
case InformEvent.MIC_DRAG_INFO:
|
|
notice = "管理员 [" + obj.admin.nickname + "] 已将 [" + obj.user.nickname + "] 抱上麦序。";
|
|
break;
|
|
//麦序双倍时间消息
|
|
case InformEvent.MIC_DOUBLE_TIME_INFO:
|
|
notice = "管理员 [" + obj.admin.nickname +
|
|
"] 将 [" + obj.user.nickname + "] 的麦序时间增加一倍。";
|
|
break;
|
|
//麦序时间上限
|
|
case InformEvent.MIC_TIME_MAX:
|
|
notice = "管理员 [" + obj.admin.nickname +
|
|
"] 已将 [" + obj.user.nickname + "] 的麦序时间增加至上限 9999 秒。";
|
|
break;
|
|
//离开麦序消息
|
|
case InformEvent.MIC_KICK_INFO:
|
|
notice = "管理员 [" + obj.admin.nickname +
|
|
"] 已将 [" + obj.user.nickname + "] 从麦序移除。";
|
|
break;
|
|
//不允许抢麦
|
|
case InformEvent.MIC_DISABLE_INFO:
|
|
notice = "管理员 [" + obj.admin.nickname +
|
|
"] 将频道设置为禁止抢麦,暂时无法抢麦。";
|
|
break;
|
|
//允许抢麦
|
|
case InformEvent.MIC_ABLE_INFO:
|
|
notice = "管理员 [" + obj.admin.nickname +
|
|
"] 将频道设置为允许抢麦,可以点击抢麦按钮排队发言。";
|
|
break;
|
|
//管理员控麦消息
|
|
case InformEvent.MIC_IS_MUTE_INFO:
|
|
notice = "管理员 [" + obj.admin.nickname + "] 控麦,首位麦序上的人暂时不能说话。";
|
|
break;
|
|
//管理员放麦消息
|
|
case InformEvent.MIC_NOT_MUTE_INFO:
|
|
notice = "管理员 [" + obj.admin.nickname + "] 放麦,首位麦序上的人可以说话了。";
|
|
break;
|
|
//麦序上移消息
|
|
case InformEvent.MIC_UP_MOVE_INFO:
|
|
notice = "管理员 [" + obj.admin.nickname +
|
|
"] 将 [" + obj.user.nickname + "] 的麦序上移。";
|
|
break;
|
|
//麦序下移
|
|
case InformEvent.MIC_DOWN_MOVE_INFO:
|
|
notice = "管理员 [" + obj.admin.nickname +
|
|
"] 将 [" + obj.user.nickname + "] 的麦序下移。";
|
|
break;
|
|
//移到二号麦
|
|
case InformEvent.MIC_SECOND_INFO:
|
|
notice = "管理员 [" + obj.admin.nickname + "] 将 [" +
|
|
obj.user.nickname + "] 的麦序调整为2号麦。";
|
|
break;
|
|
//管理员发起连麦
|
|
case InformEvent.MIC_CONNECT_INFO:
|
|
notice = "管理员 [" + obj.admin.nickname + "] 已将 [" +
|
|
obj.user.nickname + "]加入连麦模式。";
|
|
break;
|
|
//连麦结束
|
|
case InformEvent.MIC_DISCONNECT_INFO:
|
|
notice = " [" + obj.admin.nickname + "] 和 [" +
|
|
obj.user.nickname + "]连麦结束。";
|
|
break;
|
|
//邀请连麦
|
|
case InformEvent.MIC_INVITE_CONNECT_INFO:
|
|
break;
|
|
//加入连麦
|
|
case InformEvent.MIC_JOIN_CONNECT_INFO:
|
|
notice = " [" + obj.admin.nickname + "]加入连麦模式。";
|
|
break;
|
|
//献花通知
|
|
case InformEvent.GIVE_FLOWER_INFO:
|
|
notice = t.flowerNoticeInfo(obj);
|
|
noticeType = 2;
|
|
break;
|
|
case InformEvent.MIC_IS_ME_SEND_FLOWER:
|
|
notice = "鲜花只能送给他人!", false;
|
|
break;
|
|
case InformEvent.MIC_NULL_SEND_FLOWER:
|
|
notice = "对不起,当前麦序为空,不能送出鲜花!";
|
|
break;
|
|
case InformEvent.NOT_MIC_SEND_FLOWER:
|
|
notice = "对不起,您只能在麦序模式下赠送鲜花给1号麦!";
|
|
break;
|
|
//修改权限
|
|
case InformEvent.USER_CAPABILITY_CHANGED_INFO:
|
|
notice = t.userCapalibilityInfo(obj);
|
|
break;
|
|
//角色改变
|
|
case InformEvent.USER_ROLE_CHANGED_INFO:
|
|
notice = t.userRoleChangedInfo(obj);
|
|
break;
|
|
//频道惩罚
|
|
case InformEvent.CHANNEL_PUNISH_INFO:
|
|
notice = t.channelPunishInfo(obj);
|
|
break;
|
|
//接待频道设置
|
|
case InformEvent.ADIMT_SUBCHANNEL_CHANGED_INFO:
|
|
notice = t.adimtSubChannelChange(obj);
|
|
break;
|
|
//取消接待频道
|
|
case InformEvent.CANCEL_ADMIT_CHANNEL:
|
|
notice = t.cancelAdmitChannelInfo(obj);
|
|
break;
|
|
//新加一个消息
|
|
case InformEvent.NORMAL_INFORM_MSG:
|
|
notice = obj.param;
|
|
break;
|
|
// 送礼物
|
|
case InformEvent.GIFT_SEND_INFO:
|
|
notice = t.giftNoticeInfo(obj.data);
|
|
noticeType = 2;
|
|
break;
|
|
}
|
|
|
|
if (notice) {
|
|
if (noticeType == 1) {
|
|
notice = t.normalNoticeInfo(notice);
|
|
}
|
|
t.addPubChatMsgQueue(notice);
|
|
if (t.saveHistory && obj.isHistory == undefined) {
|
|
t.saveHistory(obj, 1);
|
|
}
|
|
if (t.noticeHandle) {
|
|
t.noticeHandle.call(t, obj);
|
|
}
|
|
}
|
|
}
|
|
,
|
|
//通知处理
|
|
setPubNotice2: function (obj) {
|
|
if (!obj) {
|
|
return;
|
|
}
|
|
var t = this;
|
|
var msg = eval('(' + obj.msg + ')'), noticeType = obj.type;
|
|
var notice = "";
|
|
var uid;
|
|
var tcount = 0;
|
|
var fontInfo = {};
|
|
var msgStyle = "";
|
|
if(msg.text){
|
|
|
|
notice = t.filterSysMsg(msg.text);
|
|
}
|
|
else if(msg.YYMessageItem && msg.YYMessageItem.length > 0){
|
|
|
|
var treg=/([0-1]?[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])/g;
|
|
for(var i=0;i < msg.YYMessageItem.length;i++){
|
|
var context = msg.YYMessageItem[i].text;
|
|
notice += context;
|
|
if(msg.YYMessageItem[i].KItemLinkKey == "linKey_User")
|
|
uid = msg.YYMessageItem[i].KItemLinkValue;
|
|
|
|
if(treg.test(context))
|
|
{
|
|
tcount++;
|
|
if(tcount>1)
|
|
notice +="</br>";
|
|
}
|
|
|
|
}
|
|
notice = t.filterSysMsg(notice);
|
|
}
|
|
if(msg.font)
|
|
{
|
|
fontInfo.font_name = msg.font.family;
|
|
fontInfo.font_size = (msg.font.pointSize /72) * 96;
|
|
fontInfo.font_weight = msg.font.bold;
|
|
fontInfo.font_italic = msg.font.italic;
|
|
fontInfo.font_underline = msg.font.underline;
|
|
fontInfo.color = msg.font.rgba;
|
|
msgStyle = t.getMessageStyle(fontInfo);
|
|
|
|
}
|
|
if (notice) {
|
|
notice = '<span style="' + msgStyle + '">' + notice + '</span>';
|
|
notice = t.normalNoticeInfo2(notice,uid);
|
|
t.addPubChatMsgQueue(notice);
|
|
if (t.saveHistory && obj.isHistory == undefined) {
|
|
t.saveHistory(obj, 1);
|
|
}
|
|
if (t.noticeHandle) {
|
|
t.noticeHandle.call(t, obj);
|
|
}
|
|
}
|
|
}
|
|
//一般通知消息
|
|
, normalNoticeInfo2: function (appendText,uid) {
|
|
var content = '';
|
|
if(uid)
|
|
content = '<li class="nt notice-user" data-uid="'+uid+'"><span class="notice"></span>';
|
|
else
|
|
content = '<li class="nt"><span class="notice"></span>';
|
|
content += appendText;
|
|
content += '</li>';
|
|
return content;
|
|
}
|
|
//一般通知消息
|
|
, normalNoticeInfo: function (appendText) {
|
|
var content = '<li class="nt"><span class="notice"></span>';
|
|
content += ' 通知:';
|
|
content += appendText;
|
|
content += '</li>';
|
|
return content;
|
|
}
|
|
,//送花通知
|
|
flowerNoticeInfo: function (vo) {
|
|
if (vo.param.count > 0 && vo.param.count <= 8) {
|
|
var t = this;
|
|
//显示鲜花图片,暂时用文字表示
|
|
var content = t.wrapFromUser(vo.admin) + t.getGiveHTML() + t.wrapToUser(vo.user) + t.getImagesHTML(t.flowerCfg.url, t.flowerCfg.w, t.flowerCfg.h, "鲜花", vo.param.count);
|
|
content = '<li>' + content + '</li>'
|
|
return content;
|
|
}
|
|
return null;
|
|
}
|
|
,//自定义图片
|
|
getCustomImage: function (imgVo) {
|
|
|
|
}
|
|
//送礼物
|
|
,giftNoticeInfo: function (data) {
|
|
var content = [];
|
|
|
|
for (var i = 0; i < data.count; i++) {
|
|
content[i] = '<li class="gift-pub-msg"><em>' + data.sendernickname + '</em>送给' + data.recvernickname + '<img src="' + data.img + '"/><em>' + (i + 1) + '个</em></li>';
|
|
}
|
|
|
|
return content.join('');
|
|
}
|
|
,
|
|
// 用户权限发生变化通知
|
|
userCapalibilityInfo: function (vo) {
|
|
var capabilityVo = vo.param;
|
|
var msg = '';
|
|
switch (capabilityVo.capability) {
|
|
case UserCapability.DISABLE_TEXT:
|
|
//管理员_[%1]_禁止_[%2]_使用文字聊天。
|
|
msg = "管理员 [" + vo.admin.nickname + "] 禁止 [" + vo.user.nickname + "] 使用文字聊天。";
|
|
break;
|
|
case UserCapability.DISABLE_VOICE:
|
|
//管理员_[%1]_禁止_[%2]_使用语音聊天。
|
|
msg = "管理员 [" + vo.admin.nickname + "] 禁止 [" + vo.user.nickname + "] 使用语音聊天。";
|
|
break;
|
|
case UserCapability.ENABLE_TEXT:
|
|
//管理员_[%1]_允许_[%2]_使用文字聊天。
|
|
msg = "管理员 [" + vo.admin.nickname + "] 允许 [" + vo.user.nickname + "] 使用文字聊天。";
|
|
break;
|
|
case UserCapability.ENABLE_VOICE:
|
|
//管理员_[%1]_允许_[%2]_使用语音聊天。
|
|
msg = "管理员 [" + vo.admin.nickname + "] 允许 [" + vo.user.nickname + "] 使用语音聊天。";
|
|
break;
|
|
}
|
|
return msg;
|
|
}
|
|
,
|
|
/**
|
|
* 用户角色发生变化通知
|
|
*/
|
|
userRoleChangedInfo: function (vo) {
|
|
var roleChangedVo = vo.param;
|
|
var time = this.formatCurrentTime();
|
|
var msg = '';
|
|
switch (roleChangedVo.role) {
|
|
//子频道管理员(CA1)
|
|
case UserRole.CMANAGER:
|
|
msg = "[" + vo.user.nickname + "] 的权限被 [" + vo.admin.nickname + "] 从 [" + _mjManager.getMjName(roleChangedVo.oldRole) + "] 变成子频道 [" + roleChangedVo.channel_name + "] 的 [" + _mjManager.getMjName(roleChangedVo.role) + "]。" + time;
|
|
break;
|
|
//二级子频道管理员(CA2)
|
|
case UserRole.SECOND_CMANAGER:
|
|
msg = "[" + vo.user.nickname + "] 的权限被 [" + vo.admin.nickname + "] 从 [" + _mjManager.getMjName(roleChangedVo.oldRole) + "] 变成子频道 [" + roleChangedVo.channel_name + "] 的 [" + _mjManager.getMjName(roleChangedVo.role) + "]。" + time;
|
|
break;
|
|
case UserRole.DELETED:
|
|
break;
|
|
//全频道管理员(MA)
|
|
case UserRole.MANANGER:
|
|
msg = "[" + vo.user.nickname + "] 的权限被 [" + vo.admin.nickname + "] 从 [" + _mjManager.getMjName(roleChangedVo.oldRole) + "] 变成 [" + _mjManager.getMjName(roleChangedVo.role) + "]。" + time;
|
|
break;
|
|
//会员(R)
|
|
case UserRole.MEMBER:
|
|
msg = "[" + vo.user.nickname + "] 的权限被 [" + vo.admin.nickname + "] 从 [" + _mjManager.getMjName(roleChangedVo.oldRole) + "] 变成 [" + _mjManager.getMjName(roleChangedVo.role) + "]。" + time;
|
|
break;
|
|
//游客(U)
|
|
case UserRole.NORMAL:
|
|
if (roleChangedVo.oldRole != UserRole.TMPVIP && roleChangedVo.oldRole != UserRole.VIP) {
|
|
msg = "[" + vo.user.nickname + "] 的权限被 [" + vo.admin.nickname + "] 从 [" + _mjManager.getMjName(roleChangedVo.oldRole) + "] 变成 [" + _mjManager.getMjName(roleChangedVo.role) + "]。" + time;
|
|
}
|
|
//频道所有者(OW)
|
|
case UserRole.OWNER:
|
|
break;
|
|
case UserRole.PMANAGER:
|
|
break;
|
|
//歪歪官方人员
|
|
case UserRole.SA:
|
|
break;
|
|
//临时嘉宾(G)
|
|
case UserRole.TMPVIP:
|
|
break;
|
|
//频道总管理(VP)
|
|
case UserRole.VICE_OWNER:
|
|
msg = "[" + vo.user.nickname + "] 的权限被 [" + vo.admin.nickname + "] 从 [" + _mjManager.getMjName(roleChangedVo.oldRole) + "] 变成 [" + _mjManager.getMjName(roleChangedVo.role) + "]。" + time;
|
|
break;
|
|
//嘉宾(VIP)
|
|
case UserRole.VIP:
|
|
break;
|
|
}
|
|
return msg;
|
|
}
|
|
,
|
|
/**
|
|
* 频道惩罚消息通知
|
|
*/
|
|
channelPunishInfo: function (vo) {
|
|
var punishVo = vo.param;
|
|
var msg = '';
|
|
switch (punishVo.event) {
|
|
case ChannelPunish.BAN_ID:
|
|
msg = "用户 [" + vo.user.nickname + "] 被管理员 [" + vo.admin.nickname + "] 请出 [" + _api.getChannel().getChannelInfoBySid(punishVo.topSid).name + "] 频道,且被封了ID,理由:[" + punishVo.reason + "]。";
|
|
break;
|
|
case ChannelPunish.BAN_IP:
|
|
msg = "用户 [" + vo.user.nickname + "] 被管理员 [" + vo.admin.nickname + "] 请出 [" + _api.getChannel().getChannelInfoBySid(punishVo.topSid).name + "] 频道,且被封了IP,理由:[" + punishVo.reason + "]。";
|
|
break;
|
|
case ChannelPunish.KICK_OUT:
|
|
msg = "用户 [" + vo.user.nickname + "] 被管理员 [" + vo.admin.nickname + "] 请出 [" + _api.getChannel().getChannelInfoBySid(punishVo.topSid).name + "] 频道,理由:[" + punishVo.reason + "]。";
|
|
break;
|
|
case ChannelPunish.KICK_UP:
|
|
msg = "用户 [" + vo.user.nickname + "] 被管理员 [" + vo.admin.nickname + "] 请出 [" + punishVo.channelName + "] 频道,理由:[" + punishVo.reason + "]。";
|
|
break;
|
|
}
|
|
return msg;
|
|
}
|
|
,
|
|
/**
|
|
* 设置接待频道
|
|
*/
|
|
adimtSubChannelChange: function (vo) {
|
|
return "管理员 [" + vo.admin.nickname + "] 已将子频道 [" + vo.param.name + "] 设置为接待频道。";
|
|
},
|
|
|
|
/**
|
|
* 取消接待频道
|
|
*/
|
|
cancelAdmitChannelInfo: function (vo) {
|
|
return "管理员 [" + vo.admin.nickname + "] 已将子频道 [" + vo.param.name + "] 取消接待设置。";
|
|
}
|
|
|
|
, getNickHTML: function (user) {
|
|
var attr = {
|
|
uid: user.uid,
|
|
role: user.role,
|
|
nick: user.nickname,
|
|
yyno : user.yyno
|
|
};
|
|
|
|
if(user.svip >= 100)
|
|
return this.getSpanHTML(user.nickname, 'name yellowname', attr);
|
|
else if(user.purplename)
|
|
return this.getSpanHTML(user.nickname, 'name purplename', attr);
|
|
else if(user.readname)
|
|
return this.getSpanHTML(user.nickname, 'name readname', attr);
|
|
else
|
|
return this.getSpanHTML(user.nickname, 'name', attr);
|
|
}
|
|
, getGiveHTML: function (txt) {
|
|
txt = txt || '送给';
|
|
return this.getSpanHTML(txt, 'give');
|
|
}
|
|
, formatCurrentTime: function () {
|
|
var date = new Date();
|
|
var hours = date.getHours();
|
|
var minutes = date.getMinutes();
|
|
var seconds = date.getSeconds();
|
|
var time = "(" + (hours < 10 ? ("0" + hours) : hours) + ":" + (minutes < 10 ? ("0" + minutes) : minutes) + ":" + (seconds < 10 ? ("0" + seconds) : seconds) + ")";
|
|
return time;
|
|
}
|
|
|
|
, getTimeHTML: function (obj) {
|
|
var timeStr = obj.time;
|
|
if (!timeStr) {
|
|
obj.time = this.formatCurrentTime();
|
|
}
|
|
return this.getSpanHTML(obj.time, 'time');
|
|
}
|
|
|
|
, getSpanHTML: function (content, css, attr) {
|
|
var attrText = '';
|
|
if (attr) {
|
|
for (var key in attr) {
|
|
attrText = attrText + ' data-' + key + '="' + attr[key] + '"';
|
|
}
|
|
}
|
|
return '<span ' + attrText + ' class="' + css + '">' + content + '</span>';
|
|
}
|
|
|
|
, getImagesHTML: function (url, w, h, alt, count) {
|
|
var html = '';
|
|
for (var i = 0; i < count; i++) {
|
|
html += '<img src="' + url + '" alt="' + alt + '" width="' + w + '" height="' + h + '">';
|
|
}
|
|
return html;
|
|
}
|
|
, wrapFromUser: function (user) {
|
|
return this.getNickHTML(user);
|
|
}
|
|
, wrapToUser: function (user) {
|
|
return this.getNickHTML(user);
|
|
},
|
|
md5: function (key) {
|
|
return $.md5(key);
|
|
}
|
|
};
|
|
|
|
//聊天输入及按钮
|
|
$.uiwidget.ChatInput = function (target, cfg) {
|
|
this.target = target;
|
|
$.extend(this, cfg);
|
|
};
|
|
|
|
$.uiwidget.ChatInput.prototype = {
|
|
context: null
|
|
, sendButtonId: ''
|
|
, tipsId: ''
|
|
, contentObj: null//特殊内容,如:表情
|
|
, maxInputSize: 500
|
|
, lastSendTimeSecMil: 0
|
|
, joinRommTime: 0
|
|
, chDetail: null
|
|
, init: function () {
|
|
//console.info("ChatInput init ....");
|
|
var t = this;
|
|
t.joinRommTime = new Date().getTime();
|
|
t.initContent();//初始化输入内容
|
|
t.noticeInit();
|
|
$("#" + t.sendButtonId).click(function () {
|
|
t.sendMessage();
|
|
|
|
});
|
|
t.msgInputKeyDown();
|
|
t.contentObj.addChangeListener(function (data) {
|
|
this.insertAtCursor(data);
|
|
}, t);
|
|
|
|
t.contentObj.addEventListener("beforeShow", function () {
|
|
if (!t.isSendMsg()) {
|
|
return false;
|
|
}
|
|
return true;
|
|
});
|
|
|
|
|
|
$("#pub_msg_input").bind("keydown", function (event) {
|
|
|
|
if (event.keyCode == 86 && event.ctrlKey) {
|
|
var res = yyapi.getClipboardImage();
|
|
var clipboardImageUrl = res.imageUrl;
|
|
if(clipboardImageUrl && clipboardImageUrl!="")
|
|
{
|
|
var imageMd5 = "[Image]" + $.md5(clipboardImageUrl) + "[/Image]";
|
|
t.insertAtCursor(imageMd5);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
, chnageFontInfo: function (data) {
|
|
var t = this;
|
|
var obj = data;
|
|
if (!obj)
|
|
return;
|
|
var target = $("#pub_msg_input");
|
|
//字体
|
|
if ("font_name" in obj) {
|
|
target.css('font-family', obj.font_name);
|
|
}
|
|
//颜色
|
|
if ("color" in obj) {
|
|
//FIXME 取消字体颜
|
|
target.css('color', t.publicUI.intColorToHex(obj.color));
|
|
}
|
|
|
|
if ("font_size" in obj) {
|
|
if (obj.font_size > 0) {
|
|
target.css('font-size', obj.font_size + "px;");
|
|
}
|
|
}
|
|
if ("font_weight" in obj) {
|
|
if (obj.font_weight)
|
|
target.css('font-weight', "bold");
|
|
else
|
|
target.css('font-weight', "normal");
|
|
}
|
|
if ("font_italic" in obj) {
|
|
if (obj.font_italic)
|
|
target.css('font-style', "italic");
|
|
else
|
|
target.css('font-style', "normal");
|
|
}
|
|
if ("font_underline" in obj) {
|
|
if (obj.font_underline)
|
|
target.css('text-decoration', "underline");
|
|
else
|
|
target.css('text-decoration', "none");
|
|
}
|
|
|
|
}
|
|
, initContent: function () {
|
|
if (this.contentObj) {
|
|
this.contentObj.init();//表情
|
|
}
|
|
}
|
|
, filterContent: function (msg) {
|
|
if (this.contentObj) {
|
|
return this.contentObj.filter(msg);//表情
|
|
}
|
|
return msg;
|
|
}
|
|
|
|
, msgInputKeyDown: function () {
|
|
var t = this;
|
|
t.target.bind("keydown", function (event) {
|
|
if (event.keyCode == 13 && event.ctrlKey) {
|
|
t.insertAtCursor("\n");
|
|
return true;
|
|
}
|
|
else if (event.keyCode == 13 && !event.ctrlKey) {
|
|
t.sendMessage();// 往服务器发送信息代码
|
|
return false;
|
|
}
|
|
});
|
|
}
|
|
|
|
, insertAtCursor: function (myValue) {
|
|
var myField = this.target[0];
|
|
//IE support
|
|
if (document.selection) {
|
|
myField.focus();
|
|
sel = document.selection.createRange();
|
|
sel.text = myValue;
|
|
sel.select();
|
|
}
|
|
|
|
else if (myField.selectionStart || myField.selectionStart == '0') {//MOZILLA/NETSCAPE support
|
|
myField.blur()
|
|
var startPos = myField.selectionStart;
|
|
var endPos = myField.selectionEnd;
|
|
var restoreTop = myField.scrollTop;
|
|
myField.value = myField.value.substring(0, startPos) + myValue + myField.value.substring(endPos, myField.value.length);
|
|
if (restoreTop > 0) {
|
|
myField.scrollTop = restoreTop;
|
|
}
|
|
myField.focus();
|
|
myField.selectionStart = startPos + myValue.length;
|
|
myField.selectionEnd = startPos + myValue.length;
|
|
} else {
|
|
myField.value += myValue;
|
|
myField.focus();
|
|
}
|
|
}
|
|
, addMsgSendListener: function (fn, obj) {
|
|
this.addEventListener("sendMessage", fn, obj);
|
|
}
|
|
|
|
, addEventListener: function (evt, fn, obj) {
|
|
var t = this;
|
|
t.target.bind(evt, { fn: fn, obj: obj }, function (e, data) {
|
|
var fn = e.data.fn;
|
|
if (fn) {
|
|
var obj = e.data.obj || t;
|
|
fn.call(obj, data);
|
|
}
|
|
});
|
|
}
|
|
, isSendMsg: function () {
|
|
return true;
|
|
}
|
|
, sendMessage: function () {
|
|
var t = this;
|
|
var msg = t.target.val();
|
|
var isSendMsg = t.isSendMsg();
|
|
|
|
if (t.noticeTimeout) {
|
|
t.noticeClose();
|
|
}
|
|
if (!isSendMsg) {
|
|
return;
|
|
}
|
|
if (!msg || msg == t.defaultText || util.trim(msg)=="") {
|
|
t.noticeMe("请输入要发言的内容!");
|
|
return;
|
|
}
|
|
if (msg.length > t.maxInputSize) {
|
|
//t.noticeMe("输入字数最大不能已超过" + t.maxInputSize);
|
|
//return;
|
|
msg = msg.substring(0,500);
|
|
}
|
|
if (!t.context || !t.context.isReady) {
|
|
return;
|
|
}
|
|
t.chDetail = t.context.getChannelDetail();
|
|
|
|
logger.log(t.chDetail);
|
|
|
|
if (!t.validInput()) {
|
|
return;
|
|
}
|
|
|
|
|
|
|
|
var isPrivMode = false;
|
|
if (t.publicUI.privateChat && t.publicUI.privateChat.isPrivateChatMode() && t.publicUI.privateChat.isExpandPri) {
|
|
isPrivMode = true;
|
|
}
|
|
|
|
|
|
logger.debug(["private chat mode:", isPrivMode]);
|
|
var sendObj;
|
|
var sendRs;
|
|
if (isPrivMode) {
|
|
sendObj = t.publicUI.privateChat.sendPrivReq(msg);
|
|
if (!sendObj) return;
|
|
sendRs = sendObj.result;
|
|
if (sendRs == SendMessageResult.SUCCEESS) {
|
|
t.target.val("");
|
|
}
|
|
} else {
|
|
sendObj = t.sendReq(msg);
|
|
if (!sendObj) return;
|
|
if (sendObj.result == undefined)
|
|
sendObj.result = 0;
|
|
sendRs = sendObj.result;
|
|
if (sendRs == SendMessageResult.SUCCEESS) {
|
|
t.target.val("");
|
|
t.target.trigger("sendMessage", true);
|
|
t.lastSendTimeSecMil = new Date().getTime();
|
|
if (t.sendSucess) {
|
|
t.sendSucess(msg);
|
|
}
|
|
return;
|
|
}
|
|
}
|
|
logger.info("sendRs------>" + sendRs);
|
|
if (sendRs != SendMessageResult.SUCCEESS) {
|
|
t.handleSendResult(sendRs);
|
|
}
|
|
|
|
}
|
|
, sendReq: function (msg) {
|
|
return this.sendYYPubReq(msg);
|
|
}
|
|
, sendYYPubReq: function (msg) {
|
|
return this.context.send('sendMessage', msg);
|
|
}
|
|
, validInput: function () {
|
|
var t = this;
|
|
var chDetail = t.chDetail;
|
|
var limit_intervel = chDetail.text_limit_intervel;
|
|
//var limit_guest_only = chDetail.text_limit_guest_only;
|
|
|
|
if (chDetail.band_phone_limit) {
|
|
t.noticeMe("该页面暂不支持绑定用户手机,无法发言,先送送鲜花给主播吧~");
|
|
return false;
|
|
}
|
|
var is_text_limit = chDetail.is_text_limit;
|
|
if (t.lastSendTimeSecMil > 0 && is_text_limit && limit_intervel > 0) {
|
|
var diff = parseInt((new Date().getTime() - t.lastSendTimeSecMil) / 1000);
|
|
if (diff < limit_intervel) {
|
|
t.noticeMe("管理员限制打字数度,请" + (limit_intervel - diff) + "秒后重试");
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
, handleSendResult: function (sendRs) {
|
|
var t = this;
|
|
var tips = "";
|
|
switch (sendRs) {
|
|
case SendMessageResult.ALL_NO_SEND:
|
|
tips = "管理员禁止所有人打字。";
|
|
break;
|
|
case SendMessageResult.VISITOR_NO_SEND:
|
|
tips = "管理员禁止游客打字。";
|
|
break;
|
|
case SendMessageResult.GUEST_LOGIN_SEND:
|
|
tips = "登录后才可以开麦发言哦。";
|
|
//return t.context.login();
|
|
break;
|
|
case SendMessageResult.GUEST_NEED_WAIT:
|
|
//游客等待时间不足(游客需要加入频道一段时间才能打字,由管理员设定)
|
|
var nowTime = parseInt(new Date().getTime() / 1000);
|
|
var waitTime = nowTime - parseInt(t.joinRommTime / 1000);
|
|
var leaveTime = t.chDetail.guest_wait_time * 60 - waitTime;
|
|
if (leaveTime > 0) {
|
|
tips = "管理员规定了游客发言时间!请" + leaveTime + "秒后发言。";
|
|
}
|
|
break;
|
|
case SendMessageResult.MAX_TEXT_ERROR:
|
|
var _maxTextLength = t.chDetail.guest_max_text;
|
|
tips = "管理员限制游客字数,已超过" + (t.target.val().length - _maxTextLength) + "字。";
|
|
break;
|
|
case SendMessageResult.NO_ALLOW_TEXT:
|
|
tips = "您被管理员禁止打字。";
|
|
break;
|
|
case SendMessageResult.MESSAGE_REPETITION:
|
|
tips = "请不要发送重复信息。";
|
|
break;
|
|
case SendMessageResult.MEMBER_SEND_URL_LIMIT:
|
|
tips = "管理员禁止嘉宾和会员发送URL和飞机票";
|
|
break;
|
|
case SendMessageResult.VISITOR_SEND_URL_LIMIT:
|
|
tips = "管理员禁止游客发送URL和飞机票";
|
|
break;
|
|
case SendMessageResult.VISITOR_SEND_IMAGE_LIMIT:
|
|
tips = "<a href='http://vip.yy.com/vip/introduction?src=channelpic#16'>发图功能暂支持不超过500人在线的子频道</a>";
|
|
break;
|
|
case SendMessageResult.VISITOR_SEND_IMAGE_LIMIT2:
|
|
tips = "<a href='http://vip.yy.com/vip/introduction?src=channelpic#16' target='_blank'>频道会员或YY会员到达VIP1才能发图。>>了解详情</a>";
|
|
break;
|
|
case SendMessageResult.LIMIT_SEND_MESSAGE:
|
|
tips = "当前频道限制了文字聊天";
|
|
break;
|
|
case 15 || 266:
|
|
tips = "为了您的账户安全,请绑定手机后发言。<a href='http://aq.yy.com/welcome.do' target='_blank'>\n<font color='#ff0000'>绑定手机</font></a>";
|
|
break;
|
|
default:
|
|
tips = sendRs + "";
|
|
break;
|
|
}
|
|
if(sendRs == 15 || sendRs == 266)
|
|
t.noticeMe(tips);
|
|
}
|
|
|
|
, noticeMe: function (msg) {
|
|
if (!msg) return;
|
|
var t = this;
|
|
if (t.noticeTimeout) {
|
|
clearTimeout(t.noticeTimeout);
|
|
t.noticeTimeout = null;
|
|
}
|
|
$("#" + t.tipsId + " p").html(msg);
|
|
$("#" + t.tipsId).show();
|
|
t.noticeTimeout = setTimeout(function () { $("#" + t.tipsId).hide(); t.noticeTimeout = null; }, 3000);
|
|
}
|
|
|
|
, noticeClose: function () {
|
|
$("#" + this.tipsId).hide();
|
|
}
|
|
, noticeInit: function () {
|
|
$("#" + this.tipsId + " a").click(function () {
|
|
$(this).parent().hide();
|
|
});
|
|
}
|
|
|
|
};
|
|
|
|
$.uiwidget.SmilerUI = function (target, cfg) {
|
|
this.target = target;
|
|
$.extend(this, cfg);
|
|
};
|
|
|
|
$.uiwidget.SmilerUI.prototype = {
|
|
displayState: null
|
|
, smilarTagMap: {}
|
|
, matchPrefix: "/{"
|
|
, minKeyLen: 2
|
|
, maxKeyLen: 6//最小最大表情字母
|
|
, selectAreaId: ''
|
|
, selectBtId: ''//表情选择按钮
|
|
, init: function () {
|
|
//console.info("SmilerUI init ....");
|
|
var smilerListObj = this.smilerListObj;
|
|
var len = smilerListObj.length;
|
|
var html = '';
|
|
for (var i = 0; i < len; i++) {
|
|
html = '<tr>';
|
|
for (var j = 0; j < smilerListObj[i].length; j++) {
|
|
var item = smilerListObj[i][j];
|
|
html += '<td title="/{' + item.tag + ' ' + item.text + '"><span class="face-icon ' + (item.css || item.tag) + '" tag="' + item.tag + '"></span></td>';
|
|
this.smilarTagMap[item.tag] = item.css || item.tag;
|
|
}
|
|
html += '</tr>';
|
|
this.target.find(" tbody").append(html);
|
|
}
|
|
this.smilePopUp();
|
|
this.smileIdentify(this.target);
|
|
//console.info("SmilerUI end ....");
|
|
}
|
|
, filter: function (msg, beginPostion) {
|
|
beginPostion = beginPostion || 0;
|
|
var t = this;
|
|
var firstIndex = msg.indexOf(t.matchPrefix, beginPostion);
|
|
var matchLastIndex = firstIndex + t.matchPrefix.length;
|
|
|
|
if (firstIndex != -1 && msg.length >= (matchLastIndex + t.minKeyLen)) {//表示必须是满足4个字符:/{XX
|
|
var eachMatchLastIndex = matchLastIndex;
|
|
for (var i = t.minKeyLen; i < t.maxKeyLen; i++) {
|
|
eachMatchLastIndex = matchLastIndex + i;
|
|
if (msg.length < eachMatchLastIndex) {
|
|
break;
|
|
}
|
|
var smRp = msg.substr(matchLastIndex, i);
|
|
if (t.smilarTagMap[smRp]) {
|
|
msg = msg.replace(new RegExp(t.matchPrefix + smRp, "gm"), '<span class="face-icon ' + t.smilarTagMap[smRp] + '"></span>');
|
|
break;
|
|
}
|
|
}
|
|
beginPostion = eachMatchLastIndex - 1;
|
|
return t.filter(msg, beginPostion);
|
|
}
|
|
return msg;
|
|
}
|
|
, isShowPopup: function () {
|
|
return true;
|
|
}
|
|
, smilePopUp: function () {
|
|
var t = this;
|
|
t.displayState = 0;
|
|
|
|
yyapi.addSmileboxListener(function (data) {
|
|
t.renderSmile(data.shortcut);
|
|
});
|
|
|
|
|
|
$("#" + t.selectBtId).click(function (event) {
|
|
|
|
pubEvent.trigerEvent("increaseZindex", { type: 'opr-box' });
|
|
|
|
if (!t.isShowPopup()) {
|
|
return false;
|
|
}
|
|
|
|
if (t.displayState == 0) {
|
|
//console.info("smilePopUp show");
|
|
//var smilebox = t.target;
|
|
//smilebox.show();
|
|
//t.displayState=1;
|
|
//t.tableHover();
|
|
//t.clickHide(smilebox);
|
|
var px = event.screenX - 5;
|
|
var py = event.screenY - 320;
|
|
if (px + 422 > window.screen.width)
|
|
px = window.screen.width - 422;
|
|
yyapi.showSmilebox(px, py);
|
|
}
|
|
else {
|
|
//console.info("hideSmilebox");
|
|
t.hideSmilebox();
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;//停止冒泡
|
|
});
|
|
}
|
|
|
|
, tableHover: function () {
|
|
this.target.find("table td").hover(function () {
|
|
$(this).addClass("on");
|
|
}, function () {
|
|
$(this).removeClass("on");
|
|
});
|
|
}
|
|
|
|
, smileIdentify: function (smilebox) {
|
|
var t = this;
|
|
var smilebox = t.target;
|
|
smilebox.find("table td span").click(function () {
|
|
var tag = $(this).attr("tag");
|
|
t.renderSmile(tag);
|
|
t.hideSmilebox();
|
|
return false;//停止冒泡
|
|
});
|
|
}
|
|
, clickHide: function (smilebox) {
|
|
var t = this;
|
|
$("body").bind("click", { t: t }, t.hideSmilebox);
|
|
}
|
|
, hideSmilebox: function (e) {
|
|
var t = e ? e.data.t : this;
|
|
var smilebox = t.target;
|
|
smilebox.hide();
|
|
t.displayState = 0;
|
|
$("body").unbind("click", t.hideSmilebox);
|
|
}
|
|
, renderSmile: function (tag) {
|
|
//this.inputObj.insertAtCursor('/{'+tag);
|
|
//this.target.trigger("contentChange",this.matchPrefix + tag);
|
|
this.target.trigger("contentChange", tag);
|
|
}
|
|
|
|
, addChangeListener: function (fn, obj) {
|
|
this.addEventListener("contentChange", fn, obj);
|
|
}
|
|
|
|
, addEventListener: function (evt, fn, obj) {
|
|
var t = this;
|
|
t.target.bind(evt, { fn: fn, obj: obj }, function (e, data) {
|
|
var fn = e.data.fn;
|
|
if (fn) {
|
|
var obj = e.data.obj || t;
|
|
return fn.call(obj, data);
|
|
}
|
|
});
|
|
}
|
|
|
|
, smilerListObj: [
|
|
[
|
|
{ tag: "dx", text: "大笑" },
|
|
{ tag: "pz", text: "撇嘴" },
|
|
{ tag: "fn", text: "发怒" },
|
|
{ tag: "tp", text: "调皮" },
|
|
{ tag: "jy", text: "惊讶" },
|
|
{ tag: "ot", text: "呕吐" },
|
|
{ tag: "ng", text: "难过" },
|
|
{ tag: "hk", text: "很酷" },
|
|
{ tag: "kz", text: "口罩" },
|
|
{ tag: "wx", text: "微笑" },
|
|
{ tag: "se", text: "色" },
|
|
{ tag: "tx", text: "偷笑" }
|
|
],
|
|
|
|
[
|
|
{ tag: "lh", text: "流汗" },
|
|
{ tag: "hp", text: "害怕" },
|
|
{ css: "am", tag: "am", text: "傲慢" },
|
|
{ tag: "kun", text: "困" },
|
|
{ tag: "by", text: "白眼" },
|
|
{ tag: "ka", text: "可爱" },
|
|
{ tag: "cy", text: "抽烟" },
|
|
{ tag: "kx", text: "开心" },
|
|
{ tag: "ll", text: "流泪" },
|
|
{ tag: "fd", text: "奋斗" },
|
|
{ tag: "yw", text: "疑问" },
|
|
{ tag: "xu", text: "嘘" }
|
|
],
|
|
|
|
[
|
|
{ tag: "yun", text: "晕" },
|
|
{ tag: "zs", text: "衰" },
|
|
{ tag: "88", css: "bb", text: "拜拜" },
|
|
{ tag: "qd", text: "敲打" },
|
|
{ tag: "kl", text: "骷髅" },
|
|
{ tag: "dy", text: "得意" },
|
|
{ tag: "hx", text: "害羞" },
|
|
{ tag: "bz", text: "闭嘴" },
|
|
{ tag: "yb", text: "拥抱" },
|
|
{ tag: "dai", text: "发呆" },
|
|
{ tag: "sj", text: "睡觉" },
|
|
{ tag: "zt", text: "猪头" }
|
|
],
|
|
|
|
[
|
|
{ tag: "gz", text: "鼓掌" },
|
|
{ tag: "qq", text: "亲亲" },
|
|
{ tag: "kb", text: "抠鼻" },
|
|
{ tag: "wq", text: "委屈" },
|
|
{ tag: "yx", text: "阴险" },
|
|
{ tag: "kel", text: "可怜" },
|
|
{ tag: "bs", text: "鄙视" },
|
|
{ tag: "zk", text: "抓狂" },
|
|
{ tag: "bq", text: "抱拳" },
|
|
{ tag: "ok", text: "OK" },
|
|
{ tag: "zan", text: "赞" },
|
|
{ tag: "ruo", text: "弱" }
|
|
],
|
|
|
|
[
|
|
{ tag: "ws", text: "握手" },
|
|
{ tag: "sl", text: "胜利" },
|
|
{ tag: "mg", text: "玫瑰" },
|
|
{ tag: "kw", text: "枯萎" },
|
|
{ tag: "wen", text: "吻" },
|
|
{ tag: "xd", text: "心动" },
|
|
{ tag: "xs", text: "心碎" },
|
|
{ tag: "lw", text: "礼物" },
|
|
{ tag: "sd", text: "闪电" },
|
|
{ tag: "zd", text: "炸弹" },
|
|
{ tag: "dao", text: "刀子" },
|
|
{ tag: "cc", text: "臭臭" }
|
|
]
|
|
]
|
|
};
|
|
|
|
$.uiwidget.PrivateUI = function (target, cfg) {
|
|
this.target = target;
|
|
$.extend(this, cfg);
|
|
};
|
|
|
|
$.uiwidget.PrivateUI.prototype = {
|
|
context: null,
|
|
pubicChat: null,
|
|
privChatlist: null,
|
|
expandbar: null,
|
|
primsgBtn: null,
|
|
closePriBtn: null,
|
|
userDropdownListObj: null,
|
|
messageTip: null,
|
|
receMesssageState: 0,//0表示没有新消息
|
|
init: function () {
|
|
var t = this;
|
|
logger.debug(['privateUI init', t]);
|
|
|
|
t.privChatlist = t.target.find(".priv-chatlist");
|
|
t.userDropdownListObj = t.target.find(".user-list");
|
|
t.expandbar = t.target.find(".expand-bar");
|
|
t.messageTip = $("#primsg_bt");
|
|
t.primsgBtn = $("#primsg_bt");
|
|
t.closePriBtn = $("#close_pri_bt");
|
|
|
|
t.target.click(function () {
|
|
t.increasePrivChatBoxZindex();
|
|
})
|
|
|
|
t.target.mouseenter(function () {
|
|
t.onMouseenter();
|
|
});
|
|
t.target.mouseleave(function () {
|
|
t.onMouseleave();
|
|
});
|
|
t.expandbar.click(function () {
|
|
//t.expandChatInputBox();
|
|
});
|
|
t.messageTip.click(function () {
|
|
//t.togglePrivChatBox();
|
|
});
|
|
|
|
t.primsgBtn.click(function () {
|
|
t.togglePrivChatBox();
|
|
});
|
|
|
|
t.closePriBtn.click(function () {
|
|
t.togglePrivChatBox();
|
|
});
|
|
|
|
t.privChatlist.on("click", "span.name", function () {
|
|
var span = this;
|
|
pubEvent.trigerEvent("pubNickClick", { target: span, type: 'privMsg' });
|
|
});
|
|
t.privChatlist.on("click", ".pub-custom-img", function () {
|
|
var img = this;
|
|
t.publicChat.onCustomImageClick(img);
|
|
})
|
|
|
|
t.createScrollbar();
|
|
t.createUserList();
|
|
t.expandChatInputBox();
|
|
t.minChatBox();
|
|
t.togglePrivChatBox();
|
|
t.togglePrivChatBox();
|
|
},
|
|
increasePrivChatBoxZindex: function () {
|
|
var t = this;
|
|
var box = t.target;
|
|
var index = t.pubicChat.getIncreaseZindex();
|
|
box.css("z-index", index);
|
|
},
|
|
isExpandPri: false,
|
|
//关闭私聊
|
|
minChatBox: function () {
|
|
var t = this;
|
|
//resize pub
|
|
t.isExpandPri = false;
|
|
t.target.hide();
|
|
yyapi.minChatBox();
|
|
t.pubicChat.scrollbar.scrollToBottom();
|
|
},
|
|
//打开私聊
|
|
maxChatBox: function () {
|
|
var t = this;
|
|
t.isExpandPri = true;
|
|
t.target.show();
|
|
yyapi.maxChatBox();
|
|
t.pubicChat.scrollbar.scrollToBottom();
|
|
},
|
|
createUserList: function () {
|
|
var t = this;
|
|
t.userDropdownListObj.on("click", ".user-val,.dd-status", function () {
|
|
|
|
if ($(this).hasClass("dd-status-close")) {//如果是关闭按钮
|
|
var dd = t.userDropdownListObj.find("li:first");
|
|
t.changeChatTargetUser(dd);
|
|
} else {
|
|
t.toggleUserDropdownBox()
|
|
}
|
|
|
|
t.increasePrivChatBoxZindex();
|
|
|
|
return false;
|
|
});
|
|
t.userDropdownListObj.on("click", "li", function () {
|
|
t.changeChatTargetUser(this);
|
|
});
|
|
pubEvent.addEvent("pubNickClick", function (obj) {
|
|
var span = obj.target;
|
|
var uid = $(span).attr("data-uid") || "",
|
|
yyno = $(span).attr("data-yyno") || "",
|
|
nick = $(span).text(),
|
|
role = $(span).attr('data-role') || "";
|
|
t.addUserToList(uid,nick,role,yyno);
|
|
});
|
|
|
|
},
|
|
changeChatTargetUser: function (target) {
|
|
var t = this,
|
|
li = $(target),
|
|
textbox = t.userDropdownListObj.find(".user-val .tex"),
|
|
ddstatus = t.userDropdownListObj.find(".dd-status");
|
|
|
|
var text = li.text();
|
|
var uid = li.attr("data-uid");
|
|
textbox.text(text).attr({ "data-uid": uid });
|
|
|
|
if (uid) {
|
|
ddstatus.addClass("dd-status-close");
|
|
} else {
|
|
ddstatus.removeClass("dd-status-close");
|
|
}
|
|
|
|
},
|
|
togglePrivChatBox: function () {
|
|
var t = this;
|
|
if (t.target.hasClass("private-chat-min")) {
|
|
t.target.removeClass("private-chat-min");
|
|
t.target.show();
|
|
t.maxChatBox();
|
|
} else {
|
|
t.target.addClass("private-chat-min");
|
|
t.target.hide();
|
|
t.minChatBox();
|
|
}
|
|
|
|
t.receMesssageState = 0;
|
|
t.checkMessageTipStatus();
|
|
t.scrollbar.scrollToBottom();
|
|
},
|
|
showInChatBox: function () {
|
|
var t = this;
|
|
if (t.target.hasClass("private-chat-min")) {
|
|
t.target.removeClass("private-chat-min");
|
|
t.target.show();
|
|
t.maxChatBox();
|
|
}
|
|
|
|
t.receMesssageState = 0;
|
|
t.checkMessageTipStatus();
|
|
t.scrollbar.scrollToBottom();
|
|
},
|
|
isEpandChatInputFLag: false,
|
|
//扩大或缩小输入区域
|
|
expandChatInputBox: function () {
|
|
var t = this;
|
|
if (!t.isEpandChatInputFLag) {
|
|
t.isEpandChatInputFLag = true;
|
|
$(".chat-opr").height(40 * 1.3);
|
|
$("#pub_msg_input").height(16 * 1.5);
|
|
$(".expand-bar").addClass("expand-bar-up");
|
|
$(".chatNotice").css("bottom", 40 * 1.3 + "px");
|
|
t.minChatBox();
|
|
}
|
|
else {
|
|
t.isEpandChatInputFLag = false;
|
|
$(".chat-opr").height(85);
|
|
$("#pub_msg_input").height(70);
|
|
$(".expand-bar").removeClass("expand-bar-up");
|
|
$(".chatNotice").css("bottom", "86px");
|
|
t.minChatBox();
|
|
}
|
|
},
|
|
isChatBoxMinimize: function () {
|
|
var t = this;
|
|
return t.target.hasClass("private-chat-min");
|
|
},
|
|
toggleUserDropdownBox: function () {
|
|
var t = this;
|
|
var dd = t.userDropdownListObj.find(".user-dd");
|
|
if (dd.is(":visible")) {
|
|
t.hideUserDropdownBox({ data: { target: dd } });
|
|
} else {
|
|
t.showUserDropdownBox(dd);
|
|
}
|
|
$(dd).css("top","-" + $(dd).height() + "px");
|
|
},
|
|
showUserDropdownBox: function (dd) {
|
|
var t = this;
|
|
dd.show();
|
|
$("body").on("click", { target: dd }, t.hideUserDropdownBox);
|
|
},
|
|
hideUserDropdownBox: function (e) {
|
|
var t = this;
|
|
var box = e.data.target;
|
|
box.hide();
|
|
$("body").unbind("click", t.hideUserDropdownBox);
|
|
},
|
|
addUserToList: function (uid,nick,role,yyno) {
|
|
var t = this;
|
|
if (uid == yyapi.getMyUserInfo().uid)
|
|
return;
|
|
nick = util.html_encode(nick);
|
|
if(yyno)
|
|
yyno = "(" + yyno +")";
|
|
var li = '<li data-yyno="'+yyno+'" data-uid="' + uid + '" data-nick="" data-role="' + role + '">' + nick + yyno + '</li>';
|
|
|
|
|
|
|
|
var ul = t.userDropdownListObj.find(".user-dd ul");
|
|
var oldli = ul.find("li[data-uid='" + uid + "']");
|
|
if (oldli.length) {
|
|
t.changeChatTargetUser(oldli);
|
|
} else {
|
|
ul.append(li);
|
|
t.changeChatTargetUser(li);
|
|
}
|
|
|
|
if (ul.find("li").length > 10) {
|
|
ul.find("li:eq(1)").remove();
|
|
}
|
|
|
|
|
|
},
|
|
createScrollbar: function () {
|
|
var t = this;
|
|
t.scrollbar.obj = t.target.find(".priv-text");
|
|
t.scrollbar.init(t);
|
|
},
|
|
scrollbar: {
|
|
api: null
|
|
, obj: null
|
|
, config: { autoReinitialise: true, scrollbarWidth: 20, mouseWheelSpeed: 20, stickToBottom: true }
|
|
, panne: null
|
|
, init: function (panne) {
|
|
var t = this;
|
|
t.panne = panne;
|
|
if (!t.obj) return;
|
|
$(t.obj).slimscroll({
|
|
color:"#cfcfcf",
|
|
size: '10px',
|
|
distance : "3px",
|
|
start : "bottom",
|
|
height : "125px",
|
|
alwaysVisible: true
|
|
});
|
|
}
|
|
|
|
, extendsConfig: function (config) {
|
|
var t = this;
|
|
if (config) {
|
|
t.config = $.extend({}, t.config, config);
|
|
}
|
|
}
|
|
, scrollToBottom: function () {
|
|
var t = this;
|
|
|
|
var it2 = setTimeout(function() {
|
|
clearTimeout(it2);
|
|
$(t.obj).slimScroll({ scrollTo: '9999px' });
|
|
}, 200);
|
|
|
|
}
|
|
}
|
|
, onMouseenter: function () {
|
|
this.isOnMouseEnter = true;
|
|
|
|
}
|
|
, onMouseleave: function () {
|
|
this.isOnMouseEnter = false;
|
|
|
|
},
|
|
isPrivateChatMode: function () {
|
|
var t = this;
|
|
var uid = t.getCurrentPrivChatUid();
|
|
return uid != undefined && uid != "";
|
|
},
|
|
getCurrentPrivChatUid: function () {
|
|
var t = this;
|
|
var uid = t.target.find(".user-val .tex").attr("data-uid");
|
|
return uid;
|
|
},
|
|
getCurrentPrivChatNick: function () {
|
|
var t = this;
|
|
var nick = t.target.find(".user-val .tex").text();
|
|
return nick;
|
|
},
|
|
checkMessageTipStatus: function () {
|
|
var t = this;
|
|
if (t.messageTipTimer) {
|
|
clearInterval(t.messageTipTimer);
|
|
}
|
|
if (t.isChatBoxMinimize() && t.receMesssageState == 1) {//最小化
|
|
t.messageTipTimer = setInterval(function () {
|
|
t.messageTip.toggleClass("ico-primsg-ling");
|
|
}, 300);
|
|
} else {
|
|
clearInterval(t.messageTipTimer);
|
|
t.messageTip.removeClass("ico-primsg-ling");
|
|
}
|
|
},
|
|
sendPrivReq: function (msg) {
|
|
var t = this;
|
|
var uid = t.getCurrentPrivChatUid();
|
|
var nick = t.getCurrentPrivChatNick();
|
|
var param = {
|
|
msg: msg,
|
|
toUid: uid,
|
|
toUser: {
|
|
nickname: util.html_encode(nick),
|
|
uid: uid
|
|
},
|
|
fontInfo: t.pubicChat.getFontInfo()
|
|
};
|
|
var res = t.context.send('sendPrivateMessage', param);
|
|
logger.debug(["send priv msg res", res]);
|
|
var sendRs = res.result;
|
|
if (sendRs == SendMessageResult.SUCCEESS)
|
|
t.buildSendPrivReq(param)
|
|
|
|
return res;
|
|
},
|
|
buildSendPrivReq: function (obj) {
|
|
var t = this;
|
|
|
|
var msg = "";
|
|
try {
|
|
msg = decodeURI(obj.msg);
|
|
} catch (e) {
|
|
msg = obj.msg;
|
|
}
|
|
if (t.pubicChat.filterMsg) {
|
|
msg = t.pubicChat.filterMsg(msg);
|
|
}
|
|
msg = t.pubicChat.chatInput.filterContent(msg);
|
|
if (t.pubicChat.filterVipFace) {
|
|
msg = t.pubicChat.filterVipFace(msg);
|
|
}
|
|
if (t.pubicChat.filterAirTicket) {
|
|
msg = t.pubicChat.filterAirTicket(msg);
|
|
}
|
|
if (t.pubicChat.filterAirTicket2) {
|
|
msg = t.pubicChat.filterAirTicket2(msg);
|
|
}
|
|
if (t.pubicChat.filterCustomImage) {
|
|
msg = t.pubicChat.filterCustomImage(msg);
|
|
}
|
|
var time = t.pubicChat.getTimeHTML(obj);
|
|
|
|
var yyno = "";
|
|
if (obj.toUser.yyno) {
|
|
yyno = '<span class="time">('+ obj.toUser.yyno + ')</span>';
|
|
}
|
|
|
|
var nickName = t.pubicChat.wrapFromUser(obj.toUser);
|
|
var msgStyle = t.pubicChat.getMessageStyle(obj.fontInfo);
|
|
var content = '<li><p><span class="prvi-chat-name">你</span> '
|
|
+ '<span class="priv-chat-label">对</span> <span class="prvi-chat-name">'
|
|
+ nickName + yyno + '</span><span class="priv-chat-label"> 说:</span>' + time + '</p>'
|
|
+ '<p class="text-content" style="' + msgStyle + '">' + msg + '</p></li>';
|
|
|
|
|
|
t.privChatlist.append(content);
|
|
|
|
t.scrollbar.scrollToBottom();
|
|
|
|
},
|
|
receMsg: function (obj) {
|
|
var t = this;
|
|
var msg = "";
|
|
try {
|
|
msg = decodeURI(obj.msg);
|
|
} catch (e) {
|
|
msg = obj.msg;
|
|
}
|
|
if (t.pubicChat.filterMsg) {
|
|
msg = t.pubicChat.filterMsg(msg);
|
|
}
|
|
msg = t.pubicChat.chatInput.filterContent(msg);
|
|
if (t.pubicChat.filterVipFace) {
|
|
msg = t.pubicChat.filterVipFace(msg);
|
|
}
|
|
if (t.pubicChat.filterAirTicket) {
|
|
msg = t.pubicChat.filterAirTicket(msg);
|
|
}
|
|
if (t.pubicChat.filterAirTicket2) {
|
|
msg = t.pubicChat.filterAirTicket2(msg);
|
|
}
|
|
var time = t.pubicChat.getTimeHTML(obj);
|
|
var yyno = "";
|
|
if (obj.fromUser.yyno) {
|
|
yyno = '<span class="time">('+ obj.fromUser.yyno + ')</span>';
|
|
}
|
|
var nickName = " " + t.pubicChat.wrapFromUser(obj.fromUser);
|
|
var msgStyle = t.pubicChat.getMessageStyle(obj.fontInfo);
|
|
|
|
var content = '<li><p><span class="prvi-chat-name">'
|
|
+ nickName + yyno + '</span> '
|
|
+ '<span class="priv-chat-label">对</span> <span class="prvi-chat-name">你</span><span class="priv-chat-label"> 说:</span>' + time + '</p>'
|
|
+ '<p class="text-content" style="' + msgStyle + '">' + msg + '</p></li>';
|
|
|
|
|
|
t.privChatlist.append(content);
|
|
|
|
t.receMesssageState = 1;
|
|
|
|
t.checkMessageTipStatus();
|
|
|
|
t.scrollbar.scrollToBottom();
|
|
}
|
|
};
|
|
|
|
$.fn.chatInput = function (cfg) {
|
|
return new $.uiwidget.ChatInput(this, cfg);
|
|
}
|
|
|
|
$.fn.smilerUI = function (cfg) {
|
|
return new $.uiwidget.SmilerUI(this, cfg);
|
|
}
|
|
|
|
$.fn.publicUI = function (cfg) {
|
|
return new $.uiwidget.PublicUI(this, cfg);
|
|
}
|
|
$.fn.privateUI = function (cfg) {
|
|
return new $.uiwidget.PrivateUI(this, cfg);
|
|
}
|
|
})(jQuery);
|
|
|
|
var _mjManager = {
|
|
/**
|
|
* 根据马甲代号和性别取马甲
|
|
*/
|
|
getMj: function (role, sex) {
|
|
sex = sex == 1 ? 'm' : 'f';
|
|
var mjMaxType = '';
|
|
switch (role) {
|
|
case UserRole.VIP:
|
|
mjMaxType = 1;
|
|
break;
|
|
case UserRole.TMPVIP:
|
|
mjMaxType = 2;
|
|
break;
|
|
case UserRole.OWNER:
|
|
mjMaxType = 3;
|
|
break;
|
|
case UserRole.NORMAL:
|
|
mjMaxType = 4;
|
|
break;
|
|
case UserRole.VICE_OWNER:
|
|
mjMaxType = 5;
|
|
break;
|
|
case UserRole.MANANGER:
|
|
mjMaxType = 6;
|
|
break;
|
|
case UserRole.CMANAGER:
|
|
mjMaxType = 7;
|
|
break;
|
|
case UserRole.SECOND_CMANAGER:
|
|
mjMaxType = 8;
|
|
break;
|
|
case UserRole.SA:
|
|
mjMaxType = 9;
|
|
break;
|
|
case UserRole.MEMBER:
|
|
mjMaxType = 10;
|
|
break;
|
|
case UserRole.NUL_ROLE:
|
|
mjMaxType = 11;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
//console.info("role:"+role+",sex:"+sex);
|
|
if (mjMaxType) {
|
|
|
|
return '<span class="mj mj-' + sex + mjMaxType + '"></span>';
|
|
}
|
|
return "";
|
|
},
|
|
/**
|
|
* 根据role获取马甲含义
|
|
*/
|
|
getMjName: function (role) {
|
|
var str = "";
|
|
switch (role) {
|
|
case UserRole.CMANAGER:
|
|
str = "子频道管理员(CA1)";
|
|
break;
|
|
case UserRole.SECOND_CMANAGER:
|
|
str = "子频道管理员(CA2)";
|
|
break;
|
|
case UserRole.MANANGER:
|
|
str = "全频道管理员(MA)";
|
|
break;
|
|
case UserRole.MEMBER:
|
|
str = "会员(R)";
|
|
break;
|
|
case UserRole.NORMAL:
|
|
str = "游客(U)";
|
|
break;
|
|
case UserRole.OWNER:
|
|
str = "频道所有者(OW)";
|
|
break;
|
|
case UserRole.SA:
|
|
str = "歪歪官方人员";
|
|
break;
|
|
case UserRole.TMPVIP:
|
|
str = "临时嘉宾(G)";
|
|
break;
|
|
case UserRole.VICE_OWNER:
|
|
str = "频道总管理(VP)";
|
|
break;
|
|
case UserRole.VIP:
|
|
str = "嘉宾(VIP)";
|
|
break;
|
|
}
|
|
return str;
|
|
}
|
|
};
|
|
|
|
//选择“禁止/允许说话” “禁止/允许打字”时发出
|
|
var UserCapability = {
|
|
ENABLE_TEXT: 0,//允许打字
|
|
DISABLE_TEXT: 1,//禁止打字
|
|
ENABLE_VOICE: 2,//允许说话
|
|
DISABLE_VOICE: 3//禁止说话
|
|
};
|
|
|
|
var ChannelPunish = {
|
|
/// 禁用ID
|
|
BAN_ID: 3,
|
|
/// 禁用IP
|
|
BAN_IP: 4,
|
|
/// 踢出频道
|
|
KICK_OUT: 2,
|
|
/// 踢到上级频道
|
|
KICK_UP: 5
|
|
}
|
|
|
|
//用户角色
|
|
var UserRole = {
|
|
/// CA 子频道管理员
|
|
CMANAGER: 175,
|
|
/// UNUSE 未亡人
|
|
DELETED: 50,
|
|
/// CS 歪歪官方人员 + 全频道管理员
|
|
KEFU: 300,
|
|
/// MAN 全频道管理员
|
|
MANANGER: 200,
|
|
/// R 会员
|
|
MEMBER: 100,
|
|
/// U 游客
|
|
NORMAL: 25,
|
|
/// NULL 出错啦!
|
|
NUL_ROLE: 0,
|
|
/// OW 频道所有者
|
|
OWNER: 255,
|
|
/// PAP 管理员
|
|
PMANAGER: 180,
|
|
/// SA 歪歪官方人员
|
|
SA: 1000,
|
|
/// 二级子频道管理员
|
|
SECOND_CMANAGER: 150,
|
|
/// TMPVIP 临时嘉宾
|
|
TMPVIP: 66,
|
|
/// VO 频道总管理
|
|
VICE_OWNER: 230,
|
|
/// VIP 嘉宾
|
|
VIP: 88,
|
|
/// VISITOR 灰马
|
|
VISITOR: 20
|
|
}
|
|
|
|
//频道通知事件
|
|
var InformEvent = {
|
|
ADD_SUBCHANNEL_INFO: "add_subchannel_info",
|
|
/// 管理员设置接待频道 参数是 ChannelInfo
|
|
ADIMT_SUBCHANNEL_CHANGED_INFO: "admit_subchannel_changed_info",
|
|
/// 是否允许游客抢麦 参数是 ChannelDetailVo
|
|
ALLOW_GUEST_JOIN_MIC: "allow_guest_join_mic",
|
|
/// 是否允许游客说话 参数是 ChannelDetailVo
|
|
ALLOW_GUEST_SPEAK_MIC: "allow_guest_join_mic",
|
|
/// 取消接待频道 参数是 ChannelInfo
|
|
CANCEL_ADMIT_CHANNEL: "cancel_admit_channel",
|
|
//调度通知
|
|
CHANNEL_DRAG_NOTIFY: "channel_drag_notify",
|
|
/// 频道惩罚 (包括踢出子频道,禁ip等) 参数是 ChannelPunish
|
|
CHANNEL_PUNISH_INFO: "channel_punish_info",
|
|
//打字权限改变 (禁止所有人打字,禁止游客打字,允许所有人打字等设置改变)
|
|
CHANNEL_TEXT_LIMIT_CHANGED: "channel_text_limit_changed",
|
|
//默认麦序时间改变
|
|
DEFAULT_MIC_TIME_CHANGED: "default_mic_time_changed",
|
|
/// 鲜花通知 参数是 FlowerInfoVo
|
|
GIVE_FLOWER_INFO: "give_flower_info",
|
|
/// 匿名登陆说话(错误提示)
|
|
GUEST_LOGIN_TALK: "guest_login_talk",
|
|
/// 游客打字的最大长度变化 参数是 ChannelDetailVo
|
|
GUEST_MAX_TEXT_CHANGED: "guest_max_text_changed",
|
|
/// 游客不能输入变化 参数是 ChannelDetailVo
|
|
GUEST_NO_ENTER: "guest_no_enter_changed",
|
|
/// 游客等待时间改变 参数是 ChannelDetailVo
|
|
GUEST_WAIT_TIME: "guest_wait_time_changed",
|
|
/// 是否限制游客改变 参数是 ChannelDetailVo
|
|
IS_GUEST_LIMIT: "guest_limit_changed",
|
|
/// 是否限制打字改变 参数是 ChannelDetailVo
|
|
IS_TEXT_LIMIT: "is_text_limit_changed",
|
|
/// 允许抢麦
|
|
MIC_ABLE_INFO: "mic_able_info",
|
|
/// 管理员发起连麦
|
|
MIC_CONNECT_INFO: "mic_connect_info",
|
|
/// 不允许抢麦
|
|
MIC_DISABLE_INFO: "mic_disable_info",
|
|
/// 连麦结束
|
|
MIC_DISCONNECT_INFO: "mic_disconnect_info",
|
|
/// 麦序双倍时间消息
|
|
MIC_DOUBLE_TIME_INFO: "mic_double_time_info",
|
|
/// 麦序下移
|
|
MIC_DOWN_MOVE_INFO: "mic_down_mute_info",
|
|
/// 抱上麦序消息
|
|
MIC_DRAG_INFO: "mic_drag_info",
|
|
/// 邀请连麦
|
|
MIC_INVITE_CONNECT_INFO: "mic_invite_connect_info",
|
|
/// 麦序上的人是自己
|
|
MIC_IS_ME_SEND_FLOWER: "mic_is_me_send_flower",
|
|
/// 管理员控麦消息
|
|
MIC_IS_MUTE_INFO: "mic_mute_info",
|
|
/// 加入连麦
|
|
MIC_JOIN_CONNECT_INFO: "mic_add_connect_info",
|
|
/// 清空麦序
|
|
MIC_KICK_ALL_INFO: "mic_kick_all_info",
|
|
/// 离开麦序消息
|
|
MIC_KICK_INFO: "mic_kick_info",
|
|
/// 管理员放麦消息
|
|
MIC_NOT_MUTE_INFO: "mic_not_mute_info",
|
|
/// 当前麦序上没人 送花失败
|
|
MIC_NULL_SEND_FLOWER: "mic_null_send_flower",
|
|
/// 移到二号麦
|
|
MIC_SECOND_INFO: "mic_second_info",
|
|
/// 模式切换消息
|
|
MIC_STYLE_CHANGED_INFO: "mic_style_changed_info",
|
|
/// 麦序时间超过9999秒
|
|
MIC_TIME_MAX: "mic_time_max",
|
|
/// 麦序上移消息
|
|
MIC_UP_MOVE_INFO: "mic_up_move_info",
|
|
/// 不是麦序模式送花
|
|
NOT_MIC_SEND_FLOWER: "not_mic_send_flower",
|
|
/// 移除频道消息 参数是 Vector类型元素是ChannelInfo
|
|
REMOVE_SUBCHANNEL_INFO: "remove_subchannel_info",
|
|
/// 被管理员设为按键说话
|
|
SET_KET_TALK_INFO: "set_ket_talk_info",
|
|
/// 麦序模式改变 参数是 ChannelDetailVo
|
|
STYLE_CHANGED: "micqueue_style_changed",
|
|
/// 限制打字是否只对游客有效改变 参数是 ChannelDetailVo
|
|
TEXT_LIMIT_GUEST_ONLY: "text_limit_guest_only_changed",
|
|
/// 限制文字打字时间 参数是 ChannelDetailVo
|
|
TEXT_LIMIT_INTERVEL: "text_limit_internal_changed",
|
|
/// 频道的用户权限改变 参数是 UserCapability
|
|
USER_CAPABILITY_CHANGED_INFO: "channel_user_capability_channge_info",
|
|
/// 用户马甲发生改变
|
|
USER_ROLE_CHANGED_INFO: "user_role_changed_info",
|
|
NORMAL_INFORM_MSG: "normal_inform_msg",
|
|
/// 送礼物的公屏信息
|
|
GIFT_SEND_INFO: "gift_send_info"
|
|
};
|
|
|
|
var SendMessageResult = {
|
|
/// 管理员禁止所有人打字
|
|
ALL_NO_SEND: 6,
|
|
/// 匿名登录发消息
|
|
GUEST_LOGIN_SEND: 1,
|
|
/// 游客等待时间不足(游客需要加入频道一段时间才能打字,由管理员设定)
|
|
GUEST_NEED_WAIT: 7,
|
|
/// 当前频道限制了文字聊天
|
|
LIMIT_SEND_MESSAGE: 4,
|
|
/// 超过最大字数限制
|
|
MAX_TEXT_ERROR: 2,
|
|
/// 管理员禁止嘉宾和会员发送URL和飞机票
|
|
MEMBER_SEND_URL_LIMIT: 11,
|
|
/// 消息内容为空
|
|
MESSAGE_IS_NULL: 9,
|
|
/// 说话内容重复 发送失败
|
|
MESSAGE_REPETITION: 8,
|
|
/// 被管理员禁止打字
|
|
NO_ALLOW_TEXT: 5,
|
|
/// 发送成功
|
|
SUCCEESS: 0,
|
|
/// 当前频道游客不能打字
|
|
VISITOR_NO_SEND: 3,
|
|
/// 管理员禁止游客发送URL和飞机票
|
|
VISITOR_SEND_URL_LIMIT: 10,
|
|
/// 发图功能暂支持不超过500人在线的子频道
|
|
VISITOR_SEND_IMAGE_LIMIT: 18,
|
|
/// 频道会员或YY会员到达VIP1才能发图。>>了解详情
|
|
VISITOR_SEND_IMAGE_LIMIT2: 19
|
|
};
|
|
|
|
|
|
|
|
})
|
|
define('pkroom',['chatpublic','util','chatHistory','vipface','pubFilter','yyapi'],function (require, exports, module) {
|
|
|
|
require('chatpublic');
|
|
var util = require('util');
|
|
var chatHistory = require('chatHistory');
|
|
var vipface = require('vipface');
|
|
var pubFilter = require('pubFilter');
|
|
var yyapi = require('yyapi');
|
|
var $config = {};
|
|
var myFlowerData = {};
|
|
var chatInput;
|
|
var user = { data: {} };
|
|
var sid = yyapi.getChannelInfo().longid;
|
|
var ssid = yyapi.getSubChannelInfo().longid;
|
|
|
|
$config.sid = sid;
|
|
$config.ssid = ssid;
|
|
var fontInfo;
|
|
function initRoom() {
|
|
|
|
yyapi.addChatPubMsgListener(function (msg) {
|
|
user.data = yyapi.getMyUserInfo();
|
|
|
|
msg.json_info = eval('(' + msg.json_info + ')');
|
|
//"{\"user\":{\"nick\":\"只つ对你温柔\",\"gender\":1,\"role_in_channel\":25,\"vip_redname\":true,\"vip_face\":true,\"vip_level\":1,\"lianghao\":14},\"font\":{\"family\":\"SimSun\",\"pointSize\":12,\"bold\":0,\"italic\":0,\"underline\":0,\"rgba\":4278190080}}"
|
|
if(msg.uid == user.data.uid)
|
|
{
|
|
msg.json_info.user.role_in_channel = user.data.role;
|
|
}
|
|
|
|
msg.json_info.user.svip = 0;
|
|
//"<?xml version=\"1.0\"?>\n<msg>\n\t<extra id=\"11\" data=\"\">\n\t\t\n\t\t<prop 4=\"svipLink-1716546477\" 5=\":/theme/vip/nameplate/channel/light/vip/light_vip_lv11.png\" 8=\"\" 100=\"0\" 101=\"3\" 106=\"101\"></prop>\n\t</extra>\n</msg>\n"
|
|
//var aa = "<?xml version=\"1.0\"?>\n<msg>\n\t<extra id=\"11\" data=\"\">\n\t\t\n\t\t<prop 4=\"vippk_1_2_pid_icon\" 5=\"http://vipweb.bs2cdn.yy.com/identity_lv_2.png\" 8=\"\" 100=\"0\" 101=\"102\" 106=\"0\"></prop>\n\t<prop 4=\"svipLink-1716546477\" //5=\":/theme/vip/nameplate/channel/light/vip/light_vip_lv11.png\" 8=\"\" 100=\"0\" 101=\"3\" 106=\"101\"></prop></extra>\n</msg>\n"
|
|
var extra_info = msg.extra_info;
|
|
extra_info = extra_info.replace(/4=/g,"a=")
|
|
extra_info = extra_info.replace(/5=/g,"b=")
|
|
extra_info = extra_info.replace(/8=/g,"c=")
|
|
extra_info = extra_info.replace(/100=/g,"d=")
|
|
extra_info = extra_info.replace(/101=/g,"e=")
|
|
extra_info = extra_info.replace(/106=/g,"f=")
|
|
|
|
var extraInfo = {};
|
|
var weidengs = [];
|
|
var identitys = [];
|
|
var sss2 = $.parseXML( extra_info );
|
|
var sss3 = $( sss2 );
|
|
var sss4 = sss3.find( "msg" );
|
|
var sss5 = sss4.find( "extra" );
|
|
var sss6 = sss5.find("prop");
|
|
sss6.each(function() {
|
|
var field = $(this);
|
|
var e = field.attr("e");//读取节点属性
|
|
if(e == 102)
|
|
{
|
|
var identity = {};
|
|
identity.url = field.attr("b");
|
|
identity.desc = field.attr("c");
|
|
identitys.push(identity);
|
|
}
|
|
else if(e == 3)
|
|
{
|
|
var weideng = {};
|
|
weideng.url = field.attr("b");
|
|
if(weideng.url && weideng.url.indexOf("/vip/light_vip_lv") != -1)
|
|
{
|
|
weideng.name = weideng.url.substring(weideng.url.lastIndexOf("/") + 1,weideng.url.lastIndexOf("."));
|
|
weideng.type = 0;
|
|
msg.json_info.user.svip = 101;
|
|
}
|
|
else if(weideng.url && weideng.url.indexOf("/pk/light_pk_lv") != -1)
|
|
{
|
|
weideng.name = weideng.url.substring(weideng.url.lastIndexOf("/") + 1,weideng.url.lastIndexOf("."));
|
|
weideng.type = 1;
|
|
msg.json_info.user.svip = 101;
|
|
}
|
|
weidengs.push(weideng);
|
|
}
|
|
});
|
|
|
|
extraInfo.weidengs = weidengs;
|
|
extraInfo.identitys = identitys
|
|
extraInfo.lianghao = msg.json_info.user.lianghao;
|
|
msg.extraInfo = extraInfo;
|
|
|
|
var o = {};
|
|
o.font_name = msg.json_info.font.family;
|
|
o.font_size = (msg.json_info.font.pointSize /72) * 96;
|
|
o.font_weight = msg.json_info.font.bold;
|
|
o.font_italic = msg.json_info.font.italic;
|
|
o.font_underline = msg.json_info.font.underline;
|
|
o.color = msg.json_info.font.rgba;
|
|
//if(o.color == 4278190144 || o.color == 4278190080 || o.color == 4281545523 )
|
|
//o.color = 4290822336;
|
|
o.datatype = 1;
|
|
msg.fontInfo = o;
|
|
livePub.chatInputConifg.cfg.receSucess(msg);
|
|
});
|
|
|
|
yyapi.addChatFromPubMsgListener(function (msg) {
|
|
user.data = yyapi.getMyUserInfo();
|
|
if(msg.uid == user.data.uid)
|
|
return;
|
|
msg.json_info = eval('(' + msg.json_info + ')');
|
|
var o = {};
|
|
o.font_name = msg.json_info.font.family;
|
|
o.font_size = (msg.json_info.font.pointSize /72) * 96;
|
|
o.font_weight = msg.json_info.font.bold;
|
|
o.font_italic = msg.json_info.font.italic;
|
|
o.font_underline = msg.json_info.font.underline;
|
|
o.color = msg.json_info.font.rgba;
|
|
//if(o.color == 4278190144 || o.color == 4278190080 || o.color == 4281545523 )
|
|
//o.color = 4290822336;
|
|
o.datatype = 1;
|
|
msg.fontInfo = o;
|
|
|
|
var extraInfo = {};
|
|
var weidengUrls = [];
|
|
extraInfo.weidengUrls = weidengUrls;
|
|
msg.extraInfo = extraInfo;
|
|
|
|
livePub.chatInputConifg.cfg.recePriSucess(msg);
|
|
});
|
|
|
|
yyapi.addRightMenuListener(function (data) {
|
|
|
|
});
|
|
|
|
yyapi.addFontInfoListener(function (data) {
|
|
|
|
var o = {};
|
|
o.font_name = data.family;
|
|
o.font_size = (data.pointSize/72) * 96;
|
|
o.font_weight = data.bold;
|
|
o.font_italic = data.italic;
|
|
o.font_underline = data.underline;
|
|
//if(data.rgba == 4278190144 || data.rgba == 4278190080 || data.rgba == 4281545523 )
|
|
//data.rgba = 4290822336;
|
|
o.color = data.rgba;
|
|
o.datatype = 0;
|
|
fontInfo = o;
|
|
if(chatInput)
|
|
chatInput.chnageFontInfo(fontInfo);
|
|
|
|
});
|
|
|
|
yyapi.addChannelStartPrivateChatListener(function (data) {
|
|
livePub.startPrivateChatByUid(data.uid);
|
|
});
|
|
|
|
yyapi.addSysMessageListener2(function(data){
|
|
livePub.informSysMsg(data);
|
|
});
|
|
|
|
var res = yyapi.getFontInfo();
|
|
|
|
}
|
|
|
|
function initRoomChatPub() {
|
|
|
|
//公屏
|
|
livePub = $("#live_chat_pub").publicUI({
|
|
context: yyapi,
|
|
privateChatCfg: {
|
|
selector: ".private-chat"
|
|
},
|
|
chatInputConifg: {
|
|
id: 'pub_msg_input',
|
|
cfg: {
|
|
contentObj: $("#faceSelArea").smilerUI({
|
|
selectBtId: 'facebtn'
|
|
}) //表情选择按钮
|
|
,
|
|
sendButtonId: 'msg_send_bt',
|
|
tipsId: 'pubNoticMe',
|
|
isSendMsg: function () {
|
|
return yyapi.isReady;
|
|
},
|
|
validInput: function () {
|
|
return true;
|
|
},
|
|
sendSucess: function (msg) {
|
|
user.data = yyapi.getMyUserInfo();
|
|
var obj = {
|
|
msg: msg,
|
|
fromClient: true,
|
|
from: user.data.uid,
|
|
fromUser: {
|
|
role: user.data.role,
|
|
gender: user.data.gender,
|
|
nickname: util.html_encode(user.data.nick),
|
|
uid: user.data.uid
|
|
},
|
|
fontInfo:fontInfo
|
|
}
|
|
obj.local = true;
|
|
return;
|
|
livePub.receiveMessage(obj);
|
|
},
|
|
receSucess: function (data) {
|
|
var obj = {
|
|
msg: data.msg,
|
|
fromClient: true,
|
|
from: data.uid,
|
|
fromUser: {
|
|
role: parseInt(data.json_info.user.role_in_channel),
|
|
gender: parseInt(data.json_info.user.gender),
|
|
nickname: util.html_encode(data.json_info.user.nick),
|
|
uid: data.uid,
|
|
readname : data.json_info.user.vip_redname,
|
|
yyno:data.json_info.user.yyno,
|
|
purplename : data.json_info.user.vip_Purplename,
|
|
viplevel:data.json_info.user.vip_level,
|
|
yylevel : data.json_info.user.yylevel,
|
|
svip:data.json_info.user.svip
|
|
},
|
|
fontInfo : data.fontInfo,
|
|
extraInfo : data.extraInfo
|
|
}
|
|
obj.local = false;
|
|
livePub.receiveData(obj);
|
|
},
|
|
|
|
recePriSucess: function (data) {
|
|
var obj = {
|
|
msg: data.msg,
|
|
fromClient: true,
|
|
from: data.uid,
|
|
fromUser: {
|
|
role: parseInt(data.json_info.user.role_in_channel),
|
|
gender: parseInt(data.json_info.user.gender),
|
|
nickname: util.html_encode(data.json_info.user.nick),
|
|
uid: data.uid,
|
|
yyno:parseInt(data.json_info.user.yyno)
|
|
},
|
|
fontInfo : data.fontInfo
|
|
}
|
|
livePub.receivePrivateMessage(obj);
|
|
},
|
|
sendReq: function (msg) {
|
|
var t = this;
|
|
return t.sendYYPubReq(msg);
|
|
}
|
|
}
|
|
}
|
|
,
|
|
wrapFromUser: function (user) {
|
|
if (this.isMyself(user) && window.loginUserNick) {
|
|
user.nickname = window.loginUserNick;
|
|
return this.getSpanHTML(window.loginUserNick, 'name');
|
|
}
|
|
return this.getNickHTML(user);
|
|
},
|
|
wrapToUser: function (user) {
|
|
if (window.nick) {
|
|
user.nickname = window.nick;
|
|
}
|
|
user.nickname = util.htmlEscape(user.nickname);
|
|
return this.getSpanHTML(user.nickname, 'anchor');
|
|
}
|
|
|
|
,
|
|
filterMsg: function (msg) {
|
|
return util.htmlEscape(msg);
|
|
},
|
|
filterVipFace: function (msg) {
|
|
return vipface.filterVipFace(msg);
|
|
}
|
|
, filterAirTicket: function (msg) {
|
|
return pubFilter.filterAirTicket(msg);
|
|
},filterAirTicket2: function (msg) {
|
|
return pubFilter.filterAirTicket2(msg);
|
|
},
|
|
filterCustomImage: function (msg) {
|
|
return pubFilter.filterCustomImage(msg);
|
|
},
|
|
filterSysMsg: function (msg) {
|
|
return pubFilter.filterSysMsg(msg);
|
|
},
|
|
fileterWeiDeng: function (msg,obj) {
|
|
return pubFilter.fileterWeiDeng(msg,obj);
|
|
},
|
|
fileterLianghao: function (obj) {
|
|
return pubFilter.fileterLianghao(obj);
|
|
},
|
|
fileterIdentity: function (obj) {
|
|
return pubFilter.fileterIdentity(obj);
|
|
},
|
|
fileterYYLevel : function(obj){
|
|
return pubFilter.fileterYYLevel(obj);
|
|
},
|
|
saveHistory: function (item, type) {
|
|
chatHistory.saveHistory(item, type);
|
|
},
|
|
readHistory: function (type) {
|
|
return chatHistory.readHistory(type);
|
|
},
|
|
flowerCfg: {
|
|
url: 'http://res.m.yystatic.com/live/images/room/flower.gif',
|
|
h: 19,
|
|
w: 21
|
|
},
|
|
getFontInfo : function(){
|
|
return fontInfo;
|
|
}
|
|
});
|
|
|
|
chatInput = livePub.chatInput;
|
|
}
|
|
|
|
initRoom();
|
|
initRoomChatPub();
|
|
|
|
$(window).resize(function () {
|
|
resetSize();
|
|
});
|
|
|
|
function resetSize() {
|
|
if(livePub.privateChat.isExpandPri)//打开私聊情况下
|
|
livePub.privateChat.maxChatBox();
|
|
else
|
|
livePub.privateChat.minChatBox();
|
|
}
|
|
|
|
resetSize();
|
|
|
|
});
|