Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add shoelace

add files
  • Loading branch information...
commit af4127e1e798d11042413cc90359ab3f235ce4e9 1 parent 3cf4655
@newdumdum authored
Showing with 7,698 additions and 0 deletions.
  1. BIN  .DS_Store
  2. BIN  class/.DS_Store
  3. BIN  demo/.DS_Store
  4. BIN  demo/core/.DS_Store
  5. BIN  demo/core/tween/.DS_Store
  6. BIN  shoelace/.DS_Store
  7. +11 −0 shoelace/.project
  8. +3 −0  shoelace/build.bat
  9. +16 −0 shoelace/install.js
  10. +1 −0  shoelace/lib/ace.all.js
  11. +509 −0 shoelace/lib/core.js
  12. +920 −0 shoelace/lib/extensions/extension-api-application-test.js
  13. +145 −0 shoelace/lib/extensions/extension-api-application.js
  14. +508 −0 shoelace/lib/storage.js
  15. +82 −0 shoelace/package.js
  16. +4 −0 shoelace/readme.txt
  17. BIN  shoelace/shoelace/.DS_Store
  18. +20 −0 shoelace/shoelace/build.bat
  19. +2 −0  shoelace/shoelace/builddoc.bat
  20. +4 −0 shoelace/shoelace/run-build-test.bat
  21. +63 −0 shoelace/shoelace/src/components/button.js
  22. +7 −0 shoelace/shoelace/src/components/tweenScroll.js
  23. +82 −0 shoelace/shoelace/src/components/widget.js
  24. +84 −0 shoelace/shoelace/src/components/xml.js
  25. +53 −0 shoelace/shoelace/src/getColor.html
  26. +11 −0 shoelace/shoelace/src/modules/area-box.config.js
  27. +177 −0 shoelace/shoelace/src/modules/area-box.js
  28. +7 −0 shoelace/shoelace/src/modules/bar-box.config.js
  29. +125 −0 shoelace/shoelace/src/modules/bar-box.js
  30. +17 −0 shoelace/shoelace/src/modules/channel-box.config.js
  31. +159 −0 shoelace/shoelace/src/modules/channel-box.js
  32. +7 −0 shoelace/shoelace/src/modules/comment-box.config.js
  33. +75 −0 shoelace/shoelace/src/modules/comment-box.js
  34. +12 −0 shoelace/shoelace/src/modules/favorate-box.config.js
  35. +142 −0 shoelace/shoelace/src/modules/favorate-box.js
  36. +57 −0 shoelace/shoelace/src/modules/home-box.config.js
  37. +174 −0 shoelace/shoelace/src/modules/home-box.js
  38. +11 −0 shoelace/shoelace/src/modules/label-box.config.js
  39. +125 −0 shoelace/shoelace/src/modules/label-box.js
  40. +46 −0 shoelace/shoelace/src/modules/localstore-box.config.js
  41. +209 −0 shoelace/shoelace/src/modules/localstore-box.js
  42. +8 −0 shoelace/shoelace/src/modules/main-box.config.js
  43. +161 −0 shoelace/shoelace/src/modules/main-box.js
  44. +6 −0 shoelace/shoelace/src/modules/net-box.config.js
  45. +238 −0 shoelace/shoelace/src/modules/net-box.js
  46. +11 −0 shoelace/shoelace/src/modules/news-box.config.js
  47. +147 −0 shoelace/shoelace/src/modules/news-box.js
  48. +17 −0 shoelace/shoelace/src/modules/now-box.config.js
  49. +403 −0 shoelace/shoelace/src/modules/now-box.js
  50. +11 −0 shoelace/shoelace/src/modules/program-box.config.js
  51. +120 −0 shoelace/shoelace/src/modules/program-box.js
  52. +16 −0 shoelace/shoelace/src/modules/programdetail-box.config.js
  53. +201 −0 shoelace/shoelace/src/modules/programdetail-box.js
  54. +17 −0 shoelace/shoelace/src/modules/search-box.config.js
  55. +166 −0 shoelace/shoelace/src/modules/search-box.js
  56. +44 −0 shoelace/shoelace/src/modules/user-box.config.js
  57. +108 −0 shoelace/shoelace/src/modules/user-box.js
  58. +105 −0 shoelace/shoelace/src/resources/common/styles/extension-logger.css
  59. BIN  shoelace/shoelace/src/resources/themes/default/images/aa.png
  60. BIN  shoelace/shoelace/src/resources/themes/default/images/ipadicon.png
  61. BIN  shoelace/shoelace/src/resources/themes/default/images/rate-star.png
  62. BIN  shoelace/shoelace/src/resources/themes/default/images/retinaicon.png
  63. BIN  shoelace/shoelace/src/resources/themes/default/images/shoelace.png
  64. BIN  shoelace/shoelace/src/resources/themes/default/images/shoelaceIcon.png
  65. BIN  shoelace/shoelace/src/resources/themes/default/images/shoelace_retina.png
  66. +55 −0 shoelace/shoelace/src/resources/themes/default/styles/button.css
  67. +896 −0 shoelace/shoelace/src/resources/themes/default/styles/shoelace.css
  68. +112 −0 shoelace/shoelace/src/resources/themes/default/styles/widget.css
  69. +240 −0 shoelace/shoelace/src/shoelace-debug.html
  70. BIN  shoelace/shoelace/test/.DS_Store
  71. BIN  shoelace/shoelace/test/data/.DS_Store
  72. +120 −0 shoelace/shoelace/test/data/getChannelList/index.xml
  73. BIN  shoelace/shoelace/test/data/getLabelList/.DS_Store
  74. +21 −0 shoelace/shoelace/test/data/getLabelList/index.xml
  75. +43 −0 shoelace/shoelace/test/data/getNewsList/index.xml
  76. +157 −0 shoelace/shoelace/test/data/getProgramComment/index.xml
  77. BIN  shoelace/shoelace/test/data/getProgramList/.DS_Store
  78. +135 −0 shoelace/shoelace/test/data/getProgramList/index.xml
  79. +120 −0 shoelace/shoelace/test/data/searchChannel/index.xml
  80. +35 −0 shoelace/shoelace/test/data/searchProgram/index.xml
  81. +106 −0 shoelace/translate.js
  82. +11 −0 shoelace/web.config
  83. BIN  shoelace/yuicompressor-2.4.6.jar
View
BIN  .DS_Store
Binary file not shown
View
BIN  class/.DS_Store
Binary file not shown
View
BIN  demo/.DS_Store
Binary file not shown
View
BIN  demo/core/.DS_Store
Binary file not shown
View
BIN  demo/core/tween/.DS_Store
Binary file not shown
View
BIN  shoelace/.DS_Store
Binary file not shown
View
11 shoelace/.project
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>shoelace</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
View
3  shoelace/build.bat
@@ -0,0 +1,3 @@
+pushd shoelace
+call build.bat %1
+popd
View
16 shoelace/install.js
@@ -0,0 +1,16 @@
+(function () {
+ var console = {
+ log: function (info) {
+ WScript.StdOut.WriteLine(info);
+ }
+ };
+
+ var shell = new ActiveXObject("WScript.Shell");
+ var installDir = shell.RegRead("HKEY_LOCAL_MACHINE\\SOFTWARE\\Baidu\\BaiduBrowser\\installDir");
+ function process(sourceDir) {
+ if (!sourceDir) return;
+ shell.Run(['cmd /c xcopy "', sourceDir,'\\*.*" "', installDir, '\\resource\\extension" /e/r/y/i'].join(""), 5, true); // 执行并等待
+ }
+
+ if (installDir) process(WScript.Arguments(0)); else console.log("没有安装百度浏览器。");
+})();
View
1  shoelace/lib/ace.all.js
@@ -0,0 +1 @@
+var ace=(function(){var baidu=baidu||{version:"1-3-2"};baidu.guid="$BAIDU$";window[baidu.guid]=window[baidu.guid]||{};baidu.browser=baidu.browser||{};baidu.browser.isGecko=/gecko/i.test(navigator.userAgent)&&!/like gecko/i.test(navigator.userAgent);baidu.browser.isStrict=document.compatMode=="CSS1Compat";if((/(\d+\.\d)(\.\d)?\s+safari/i.test(navigator.userAgent)&&!/chrome/i.test(navigator.userAgent))){baidu.browser.safari=parseFloat(RegExp["\x241"])}if(/opera\/(\d+\.\d)/i.test(navigator.userAgent)){baidu.browser.opera=parseFloat(RegExp["\x241"])}if(/chrome\/(\d+\.\d)/i.test(navigator.userAgent)){baidu.browser.chrome=parseFloat(RegExp["\x241"])}if(/msie (\d+\.\d)/i.test(navigator.userAgent)){baidu.ie=baidu.browser.ie=document.documentMode||parseFloat(RegExp["\x241"])}try{if(/(\d+\.\d)/.test(external.max_version)){baidu.browser.maxthon=parseFloat(RegExp["\x241"])}}catch(e){}baidu.browser.isWebkit=/webkit/i.test(navigator.userAgent);if(/firefox\/(\d+\.\d)/i.test(navigator.userAgent)){baidu.browser.firefox=parseFloat(RegExp["\x241"])}baidu.number=baidu.number||{};baidu.number.pad=function(H,I){var G="",J=(H<0),F=String(Math.abs(H));if(F.length<I){G=(new Array(I-F.length+1)).join("0")}return(J?"-":"")+G+F};baidu.number.comma=function(D,C){if(!C||C<1){C=3}D=String(D).split(".");D[0]=D[0].replace(new RegExp("(\\d)(?=(\\d{"+C+"})+$)","ig"),"$1,");return D.join(".")};baidu.url=baidu.url||{};baidu.url.escapeSymbol=function(B){return String(B).replace(/\%/g,"%25").replace(/&/g,"%26").replace(/\+/g,"%2B").replace(/\ /g,"%20").replace(/\//g,"%2F").replace(/\#/g,"%23").replace(/\=/g,"%3D")};baidu.string=baidu.string||{};baidu.string.escapeReg=function(B){return String(B).replace(new RegExp("([.*+?^=!:\x24{}()|[\\]/\\\\])","g"),"\\\x241")};baidu.url.getQueryValue=function(H,G){var F=new RegExp("(^|&|\\?|#)"+baidu.string.escapeReg(G)+"=([^&]*)(&|\x24)","");var E=H.match(F);if(E){return E[2]}return null};baidu.url.jsonToQuery=function(K,L){var N=[],H=0,M,I,J;L=L||function(A){return baidu.url.escapeSymbol(A)};for(M in K){if(K.hasOwnProperty(M)){I=K[M];if(Object.prototype.toString.call(I)=="[object Array]"){J=I.length;while(J--){N[H++]=M+"="+L(I[J],M)}}else{N[H++]=M+"="+L(I,M)}}}return N.join("&")};baidu.url.queryToJson=function(N){var S=N.substr(N.indexOf("?")+1),L=S.split("&"),T=L.length,O={},K=0,Q,R,P,M;for(;K<T;K++){M=L[K].split("=");Q=M[0];R=M[1];P=O[Q];if("undefined"==typeof P){O[Q]=R}else{if(Object.prototype.toString.call(P)=="[object Array]"){P.push(R)}else{O[Q]=[P,R]}}}return O};baidu.cookie=baidu.cookie||{};baidu.cookie._isValidKey=function(B){return(new RegExp('^[^\\x00-\\x20\\x7f\\(\\)<>@,;:\\\\\\"\\[\\]\\?=\\{\\}\\/\\u0080-\\uffff]+\x24')).test(B)};baidu.cookie.setRaw=function(G,F,H){if(!baidu.cookie._isValidKey(G)){return }H=H||{};var E=H.expires;if("number"==typeof H.expires){E=new Date();E.setTime(E.getTime()+H.expires)}document.cookie=G+"="+F+(H.path?"; path="+H.path:"")+(E?"; expires="+E.toGMTString():"")+(H.domain?"; domain="+H.domain:"")+(H.secure?"; secure":"")};baidu.cookie.getRaw=function(F){if(baidu.cookie._isValidKey(F)){var E=new RegExp("(^| )"+F+"=([^;]*)(;|\x24)"),D=E.exec(document.cookie);if(D){return D[2]||null}}return null};baidu.cookie.get=function(C){var D=baidu.cookie.getRaw(C);if("string"==typeof D){D=decodeURIComponent(D);return D}return null};baidu.cookie.set=function(F,E,D){baidu.cookie.setRaw(F,encodeURIComponent(E),D)};baidu.cookie.remove=function(D,C){C=C||{};C.expires=new Date(0);baidu.cookie.setRaw(D,"",C)};baidu.json=baidu.json||{};baidu.json.parse=window.JSON&&window.JSON.parse?window.JSON.parse:function(B){if(!/^[\],:{}\s]*$/.test(B.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){return null}return(new Function("return "+B))()};baidu.json.stringify=(function(){var J={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function F(A){if(/["\\\x00-\x1f]/.test(A)){A=A.replace(/["\\\x00-\x1f]/g,function(C){var B=J[C];if(B){return B}B=C.charCodeAt();return"\\u00"+Math.floor(B/16).toString(16)+(B%16).toString(16)})}return'"'+A+'"'}function H(A){var E=["["],D=A.length,L,C,B;for(C=0;C<D;C++){B=A[C];switch(typeof B){case"undefined":case"function":case"unknown":break;default:if(L){E.push(",")}E.push(baidu.json.stringify(B));L=1}}E.push("]");return E.join("")}function I(A){return A<10?"0"+A:A}function G(A){return'"'+A.getFullYear()+"-"+I(A.getMonth()+1)+"-"+I(A.getDate())+"T"+I(A.getHours())+":"+I(A.getMinutes())+":"+I(A.getSeconds())+'"'}return function(A){switch(typeof A){case"undefined":return"undefined";case"number":return isFinite(A)?String(A):"null";case"string":return F(A);case"boolean":return String(A);default:if(A===null){return"null"}else{if(A instanceof Array){return H(A)}else{if(A instanceof Date){return G(A)}else{var D=["{"],B=baidu.json.stringify,E,C;for(key in A){if(A.hasOwnProperty(key)){C=A[key];switch(typeof C){case"undefined":case"unknown":case"function":break;default:if(E){D.push(",")}E=1;D.push(B(key)+":"+B(C))}}}D.push("}");return D.join("")}}}}}})();baidu.json.encode=function(B){return baidu.json.stringify(B)};baidu.json.decode=function(B){return baidu.json.parse(B)};baidu.date=baidu.date||{};baidu.date.format=function(N,S){if("string"!=typeof S){return N.toString()}function K(A,B){S=S.replace(A,B)}var M=baidu.number.pad,R=N.getFullYear(),T=N.getMonth()+1,O=N.getDate(),Q=N.getHours(),L=N.getMinutes(),P=N.getSeconds();K(/yyyy/g,M(R,4));K(/yy/g,M(R.toString().slice(2),2));K(/MM/g,M(T,2));K(/M/g,T);K(/dd/g,M(O,2));K(/d/g,O);K(/HH/g,M(Q,2));K(/H/g,Q);K(/hh/g,M(Q%12,2));K(/h/g,Q%12);K(/mm/g,M(L,2));K(/m/g,L);K(/ss/g,M(P,2));K(/s/g,P);return S};baidu.date.parse=function(I){var F=new RegExp("^\\d+(\\-|\\/)\\d+(\\-|\\/)\\d+\x24");if("string"==typeof I){if(F.test(I)||isNaN(Date.parse(I))){var G=I.split(/ |T/),J=G.length>1?G[1].split(/[^\d]/):[0,0,0],H=G[0].split(/[^\d]/);return new Date(H[0]-0,H[1]-1,H[2]-0,J[0]-0,J[1]-0,J[2]-0)}else{return new Date(I)}}return new Date()};baidu.dom=baidu.dom||{};baidu.dom._styleFilter=baidu.dom._styleFilter||[];baidu.dom._styleFilter[baidu.dom._styleFilter.length]={get:function(I,H){if(/color/i.test(I)&&H.indexOf("rgb(")!=-1){var G=H.split(",");H="#";for(var J=0,F;F=G[J];J++){F=parseInt(F.replace(/[^\d]/gi,""),10).toString(16);H+=F.length==1?"0"+F:F}H=H.toUpperCase()}return H}};baidu.dom._styleFilter.filter=function(L,I,H){for(var G=0,J=baidu.dom._styleFilter,K;K=J[G];G++){if(K=K[H]){I=K(L,I)}}return I};baidu.dom._styleFilter[baidu.dom._styleFilter.length]={set:function(C,D){if(D.constructor==Number&&!/zIndex|fontWeight|opacity|zoom|lineHeight/i.test(C)){D=D+"px"}return D}};baidu.dom._styleFixer=baidu.dom._styleFixer||{};baidu.dom._styleFixer.display=baidu.browser.ie&&baidu.browser.ie<8?{set:function(C,D){C=C.style;if(D=="inline-block"){C.display="inline";C.zoom=1}else{C.display=D}}}:baidu.browser.firefox&&baidu.browser.firefox<3?{set:function(C,D){C.style.display=D=="inline-block"?"-moz-inline-box":D}}:null;baidu.dom._styleFixer["float"]=baidu.browser.ie?"styleFloat":"cssFloat";baidu.dom._styleFixer.opacity=baidu.browser.ie?{get:function(C){var D=C.style.filter;return D&&D.indexOf("opacity=")>=0?(parseFloat(D.match(/opacity=([^)]*)/)[1])/100)+"":"1"},set:function(D,E){var F=D.style;F.filter=(F.filter||"").replace(/alpha\([^\)]*\)/gi,"")+(E==1?"":"alpha(opacity="+E*100+")");F.zoom=1}}:null;baidu.dom._styleFixer.textOverflow=(function(){var H={};function E(B){var A=B.length;if(A>0){A=B[A-1];B.length--}else{A=null}return A}function G(B,A){B[baidu.browser.firefox?"textContent":"innerText"]=A}function F(W,a,C){var Y=baidu.browser.ie?W.currentStyle||W.style:getComputedStyle(W,null),D=Y.fontWeight,T="font-family:"+Y.fontFamily+";font-size:"+Y.fontSize+";word-spacing:"+Y.wordSpacing+";font-weight:"+((parseInt(D)||0)==401?700:D)+";font-style:"+Y.fontStyle+";font-variant:"+Y.fontVariant,f=H[T];if(!f){Y=W.appendChild(document.createElement("div"));Y.style.cssText="float:left;"+T;f=H[T]=[];for(var V=0;V<256;V++){V==32?(Y.innerHTML="&nbsp;"):G(Y,String.fromCharCode(V));f[V]=Y.offsetWidth}G(Y,"\u4e00");f[256]=Y.offsetWidth;G(Y,"\u4e00\u4e00");f[257]=Y.offsetWidth-f[256]*2;f[258]=f[".".charCodeAt(0)]*3+f[257]*3;W.removeChild(Y)}for(var X=W.firstChild,U=f[256],c=f[257],d=f[258],A=[],C=C?d:0;X;X=X.nextSibling){if(a<C){W.removeChild(X)}else{if(X.nodeType==3){for(var V=0,B=X.nodeValue,Z=B.length;V<Z;V++){Y=B.charCodeAt(V);A[A.length]=[a,X,V];a-=(V?c:0)+(Y<256?f[Y]:U);if(a<C){break}}}else{Y=X.tagName;if(Y=="IMG"||Y=="TABLE"){Y=X;X=X.previousSibling;W.removeChild(Y)}else{A[A.length]=[a,X];a-=X.offsetWidth}}}}if(a<C){while(Y=E(A)){a=Y[0];X=Y[1];Y=Y[2];if(X.nodeType==3){if(a>=d){X.nodeValue=X.nodeValue.substring(0,Y)+"...";return true}else{if(!Y){W.removeChild(X)}}}else{if(F(X,a,true)){return true}else{W.removeChild(X)}}}W.innerHTML=""}}return{get:function(B,A){var C=baidu.browser;return(C.opera?A.OTextOverflow:C.firefox?B._baiduOverflow:A.textOverflow)||"clip"},set:function(D,B){var J=baidu.browser;if(D.tagName=="TD"||D.tagName=="TH"||J.firefox){D._baiduHTML&&(D.innerHTML=D._baiduHTML);if(B=="ellipsis"){D._baiduHTML=D.innerHTML;var A=document.createElement("div"),C=D.appendChild(A).offsetWidth;D.removeChild(A);F(D,C)}else{D._baiduHTML=""}}A=D.style;J.opera?(A.OTextOverflow=B):J.firefox?(D._baiduOverflow=B):(A.textOverflow=B)}}})();baidu.dom.g=function(B){if("string"==typeof B||B instanceof String){return document.getElementById(B)}else{if(B&&B.nodeName&&(B.nodeType==1||B.nodeType==9)){return B}}return null};baidu.g=baidu.G=baidu.dom.g;baidu.dom._NAME_ATTRS=(function(){var B={cellpadding:"cellPadding",cellspacing:"cellSpacing",colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",usemap:"useMap",frameborder:"frameBorder"};if(baidu.browser.ie<8){B["for"]="htmlFor";B["class"]="className"}else{B.htmlFor="for";B.className="class"}return B})();baidu.dom.setAttr=function(F,D,E){F=baidu.dom.g(F);if("style"==D){F.style.cssText=E}else{D=baidu.dom._NAME_ATTRS[D]||D;F.setAttribute(D,E)}return F};baidu.setAttr=baidu.dom.setAttr;baidu.dom.setAttrs=function(E,D){E=baidu.dom.g(E);for(var F in D){baidu.dom.setAttr(E,F,D[F])}return E};baidu.setAttrs=baidu.dom.setAttrs;baidu.dom.getAttr=function(D,C){D=baidu.dom.g(D);if("style"==C){return D.style.cssText}C=baidu.dom._NAME_ATTRS[C]||C;return D.getAttribute(C)};baidu.getAttr=baidu.dom.getAttr;baidu.dom._matchNode=function(E,G,F){E=baidu.dom.g(E);for(var H=E[F];H;H=H[G]){if(H.nodeType==1){return H}}return null};baidu.dom.prev=function(B){return baidu.dom._matchNode(B,"previousSibling","previousSibling")};(function(){var B=new RegExp("(^[\\s\\t\\xa0\\u3000]+)|([\\u3000\\xa0\\s\\t]+\x24)","g");baidu.string.trim=function(A){return String(A).replace(B,"")}})();baidu.trim=baidu.string.trim;baidu.dom.addClass=function(C,D){C=baidu.dom.g(C);C.className+=" "+D;return C};baidu.addClass=baidu.dom.addClass;baidu.dom.hasClass=function(G,F){G=baidu.dom.g(G);var H=baidu.string.trim(F).split(/\s+/),E=H.length;F=G.className.split(/\s+/).join(" ");while(E--){if(!(new RegExp("(^| )"+H[E]+"( |\x24)")).test(F)){return false}}return true};baidu.dom.contains=function(D,F){var E=baidu.dom.g;D=E(D);F=E(F);return D.contains?D!=F&&D.contains(F):!!(D.compareDocumentPosition(F)&16)};baidu.dom.getDocument=function(B){B=baidu.dom.g(B);return B.nodeType==9?B:B.ownerDocument||B.document};baidu.dom.removeClass=function(J,I){J=baidu.dom.g(J);var L=J.className.split(/\s+/).sort(),H=I.split(/\s+/).sort(),K=L.length,G=H.length;for(;K&&G;){if(L[K-1]==H[G-1]){L.splice(--K,1)}else{if(L[K-1]<H[G-1]){G--}else{K--}}}J.className=L.join(" ");return J};baidu.removeClass=baidu.dom.removeClass;baidu.dom.children=function(F){F=baidu.dom.g(F);for(var D=[],E=F.firstChild;E;E=E.nextSibling){if(E.nodeType==1){D.push(E)}}return D};baidu.string.toCamelCase=function(B){if(B.indexOf("-")<0&&B.indexOf("_")<0){return B}return B.replace(/[-_][^-_]/g,function(A){return A.charAt(1).toUpperCase()})};baidu.dom.setStyle=function(I,J,H){var G=baidu.dom,F;I=G.g(I);J=baidu.string.toCamelCase(J);if(F=G._styleFilter){H=F.filter(J,H,"set")}F=G._styleFixer[J];(F&&F.set)?F.set(I,H):(I.style[F||J]=H);return I};baidu.setStyle=baidu.dom.setStyle;baidu.dom.setStyles=function(F,E){F=baidu.dom.g(F);for(var D in E){baidu.dom.setStyle(F,D,E[D])}return F};baidu.setStyles=baidu.dom.setStyles;baidu.dom.q=function(O,R,L){var N=[],J=baidu.string.trim,P,Q,M,K;if(!(O=J(O))){return null}if("undefined"==typeof R){R=document}else{R=baidu.dom.g(R);if(!R){return N}}L&&(L=J(L).toUpperCase());if(R.getElementsByClassName){M=R.getElementsByClassName(O);P=M.length;for(Q=0;Q<P;Q++){K=M[Q];if(L&&K.tagName!=L){continue}N[N.length]=K}}else{O=new RegExp("(^|\\s)"+baidu.string.escapeReg(O)+"(\\s|\x24)");M=L?R.getElementsByTagName(L):(R.all||R.getElementsByTagName("*"));P=M.length;for(Q=0;Q<P;Q++){K=M[Q];O.test(K.className)&&(N[N.length]=K)}}return N};baidu.q=baidu.Q=baidu.dom.q;baidu.dom.getStyle=function(K,L){var H=baidu.dom;K=H.g(K);L=baidu.string.toCamelCase(L);var I=K.style[L];if(!I){var G=H._styleFixer[L],J=K.currentStyle||(baidu.browser.ie?K.style:getComputedStyle(K,null));if("string"==typeof G){I=J[G]}else{if(G&&G.get){I=G.get(K,J)}else{I=J[L]}}}if(G=H._styleFilter){I=G.filter(L,I,"get")}return I};baidu.getStyle=baidu.dom.getStyle;baidu.dom.getPosition=function(O){var T=baidu.dom.getDocument(O),Y=baidu.browser,W=baidu.dom.getStyle;O=baidu.dom.g(O);var Z=Y.isGecko>0&&T.getBoxObjectFor&&W(O,"position")=="absolute"&&(O.style.top===""||O.style.left==="");var V={left:0,top:0};var X=(Y.ie&&!Y.isStrict)?T.body:T.documentElement;if(O==X){return V}var S=null;var N,U,P,R;if(O.getBoundingClientRect){N=O.getBoundingClientRect();V.left=Math.floor(N.left)+Math.max(T.documentElement.scrollLeft,T.body.scrollLeft);V.top=Math.floor(N.top)+Math.max(T.documentElement.scrollTop,T.body.scrollTop);V.left-=T.documentElement.clientLeft;V.top-=T.documentElement.clientTop;U=T.body;P=parseInt(W(U,"borderLeftWidth"));R=parseInt(W(U,"borderTopWidth"));if(Y.ie&&!Y.isStrict){V.left-=isNaN(P)?2:P;V.top-=isNaN(R)?2:R}}else{if(T.getBoxObjectFor&&!Z){N=T.getBoxObjectFor(O);var Q=T.getBoxObjectFor(X);V.left=N.screenX-Q.screenX;V.top=N.screenY-Q.screenY}else{S=O;do{V.left+=S.offsetLeft;V.top+=S.offsetTop;if(Y.isWebkit>0&&W(S,"position")=="fixed"){V.left+=T.body.scrollLeft;V.top+=T.body.scrollTop;break}S=S.offsetParent}while(S&&S!=O);if(Y.opera>0||(Y.isWebkit>0&&W(O,"position")=="absolute")){V.top-=T.body.offsetTop}S=O.offsetParent;while(S&&S!=T.body){V.left-=S.scrollLeft;if(!b.opera||S.tagName!="TR"){V.top-=S.scrollTop}S=S.offsetParent}}}return V};baidu.dom.intersect=function(J,K){var L=baidu.dom.g,M=baidu.dom.getPosition,I=Math.max,O=Math.min;J=L(J);K=L(K);var N=M(J),P=M(K);return I(N.left,P.left)<=O(N.left+J.offsetWidth,P.left+K.offsetWidth)&&I(N.top,P.top)<=O(N.top+J.offsetHeight,P.top+K.offsetHeight)};baidu.dom.last=function(B){return baidu.dom._matchNode(B,"previousSibling","lastChild")};baidu.dom.ready=function(){var I=false,G=false,H=[];function F(){if(!I){I=true;for(var A=0,B=H.length;A<B;A++){H[A]()}}}function J(){if(G){return }G=true;var A=document,C=window,D=baidu.browser.opera;if(A.addEventListener&&!D){A.addEventListener("DOMContentLoaded",D?function(){if(I){return }for(var E=0;E<A.styleSheets.length;E++){if(A.styleSheets[E].disabled){setTimeout(arguments.callee,0);return }}F()}:F,false)}else{if(baidu.browser.ie&&C==top){(function(){if(I){return }try{A.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return }F()})()}else{if(baidu.browser.safari){var B;(function(){if(I){return }if(A.readyState!="loaded"&&A.readyState!="complete"){setTimeout(arguments.callee,0);return }if(B===undefined){B=0;var P=A.getElementsByTagName("style");var N=A.getElementsByTagName("link");if(P){B+=P.length}if(N){for(var E=0,O=N.length;E<O;E++){if(N[E].getAttribute("rel")=="stylesheet"){B++}}}}if(A.styleSheets.length!=B){setTimeout(arguments.callee,0);return }F()})()}}}C.attachEvent?C.attachEvent("onload",F):C.addEventListener("load",F,false)}return function(A){J();I?A():(H[H.length]=A)}}();baidu.dom.getAncestorByTag=function(D,C){D=baidu.dom.g(D);C=C.toUpperCase();while((D=D.parentNode)&&D.nodeType==1){if(D.tagName==C){return D}}return null};baidu.dom.getWindow=function(C){C=baidu.dom.g(C);var D=baidu.dom.getDocument(C);return D.parentWindow||D.defaultView||null};baidu.dom.getAncestorBy=function(C,D){C=baidu.dom.g(C);while((C=C.parentNode)&&C.nodeType==1){if(D(C)){return C}}return null};baidu.dom.hide=function(B){B=baidu.dom.g(B);B.style.display="none";return B};baidu.hide=baidu.dom.hide;baidu.dom.next=function(B){return baidu.dom._matchNode(B,"nextSibling","nextSibling")};baidu.dom.show=function(B){B=baidu.dom.g(B);B.style.display="";return B};baidu.show=baidu.dom.show;baidu.dom.toggle=function(B){B=baidu.dom.g(B);B.style.display=B.style.display=="none"?"":"none";return B};baidu.dom._g=function(B){if("string"==typeof B||B instanceof String){return document.getElementById(B)}return B};baidu._g=baidu.dom._g;baidu.dom.insertAfter=function(F,G){var H,E;H=baidu.dom._g;F=H(F);G=H(G);E=G.parentNode;if(E){E.insertBefore(F,G.nextSibling)}return F};baidu.dom.first=function(B){return baidu.dom._matchNode(B,"nextSibling","firstChild")};baidu.dom.insertBefore=function(F,G){var H,E;H=baidu.dom._g;F=H(F);G=H(G);E=G.parentNode;if(E){E.insertBefore(F,G)}return F};baidu.dom.insertHTML=function(K,H,L){K=baidu.dom.g(K);if(K.insertAdjacentHTML){K.insertAdjacentHTML(H,L)}else{var N=K.ownerDocument.createRange();N.setStartBefore(K);var M=N.createContextualFragment(L),I=K.parentNode,J;switch(H.toUpperCase()){case"BEFOREBEGIN":I.insertBefore(M,K);break;case"AFTERBEGIN":K.insertBefore(M,K.firstChild);break;case"BEFOREEND":K.appendChild(M);break;case"AFTEREND":(J=K.nextSibling)?I.insertBefore(M,J):I.appendChild(M)}}return K};baidu.insertHTML=baidu.dom.insertHTML;baidu.dom.remove=function(C){C=baidu.dom._g(C);var D=C.parentNode;D&&D.removeChild(C)};baidu.dom.getAncestorByClass=function(C,D){C=baidu.dom.g(C);D=new RegExp("(^|\\s)"+baidu.string.trim(D)+"(\\s|\x24)");while((C=C.parentNode)&&C.nodeType==1){if(D.test(C.className)){return C}}return null};baidu.lang=baidu.lang||{};window[baidu.guid]._instances=window[baidu.guid]._instances||{};baidu.lang.instance=function(B){return window[baidu.guid]._instances[B]||null};baidu.lang.isNumber=function(B){return"[object Number]"==Object.prototype.toString.call(B)};baidu.lang.guid=function(){return"TANGRAM__"+(window[baidu.guid]._counter++).toString(36)};window[baidu.guid]._counter=window[baidu.guid]._counter||1;baidu.lang.Class=function(B){this.guid=B||baidu.lang.guid();window[baidu.guid]._instances[this.guid]=this};window[baidu.guid]._instances=window[baidu.guid]._instances||{};baidu.lang.Class.prototype.dispose=function(){delete window[baidu.guid]._instances[this.guid];for(var B in this){if(typeof this[B]!="function"){delete this[B]}}this.disposed=true};baidu.lang.Class.prototype.toString=function(){return"[object "+(this._className||"Object")+"]"};baidu.lang.inherits=function(I,K,L){var M,J,H=I.prototype,N=new Function();N.prototype=K.prototype;J=I.prototype=new N();for(M in H){J[M]=H[M]}I.prototype.constructor=I;I.superClass=K.prototype;if("string"==typeof L){J._className=L}};baidu.inherits=baidu.lang.inherits;baidu.lang.isElement=function(B){return !!(B&&B.nodeName&&B.nodeType==1)};baidu.lang.module=function(name,module,owner){var packages=name.split("."),len=packages.length-1,packageName,i=0;if(!owner){try{if(!(new RegExp("^[a-zA-Z_\x24][a-zA-Z0-9_\x24]*\x24")).test(packages[0])){throw""}owner=eval(packages[0]);i=1}catch(e){owner=window}}for(;i<len;i++){packageName=packages[i];if(!owner[packageName]){owner[packageName]={}}owner=owner[packageName]}if(!owner[packages[len]]){owner[packages[len]]=module}};baidu.lang.decontrol=function(D){var C=window[baidu.guid];C._instances&&(delete C._instances[D])};baidu.lang.isArray=function(B){return"[object Array]"==Object.prototype.toString.call(B)};baidu.lang.Event=function(C,D){this.type=C;this.returnValue=true;this.target=D||null;this.currentTarget=null};baidu.lang.Class.prototype.addEventListener=function(H,I,J){if(typeof I!="function"){return }!this.__listeners&&(this.__listeners={});var F=this.__listeners,G;if(typeof J=="string"&&J){if(/[^\w\-]/.test(J)){throw ("nonstandard key:"+J)}else{I.hashCode=J;G=J}}H.indexOf("on")!=0&&(H="on"+H);typeof F[H]!="object"&&(F[H]={});G=G||baidu.lang.guid();I.hashCode=G;F[H][G]=I};baidu.lang.Class.prototype.removeEventListener=function(E,F){if(typeof F=="function"){F=F.hashCode}else{if(typeof F!="string"){return }}!this.__listeners&&(this.__listeners={});E.indexOf("on")!=0&&(E="on"+E);var D=this.__listeners;if(!D[E]){return }D[E][F]&&delete D[E][F]};baidu.lang.Class.prototype.dispatchEvent=function(H,F){if("string"==typeof H){H=new baidu.lang.Event(H)}!this.__listeners&&(this.__listeners={});F=F||{};for(var I in F){H[I]=F[I]}var I,J=this.__listeners,G=H.type;H.target=H.target||this;H.currentTarget=this;G.indexOf("on")!=0&&(G="on"+G);typeof this[G]=="function"&&this[G].apply(this,arguments);if(typeof J[G]=="object"){for(I in J[G]){J[G][I].apply(this,arguments)}}return H.returnValue};baidu.lang.isObject=function(B){return"function"==typeof B||!!(B&&"object"==typeof B)};baidu.isObject=baidu.lang.isObject;baidu.lang.isString=function(B){return"[object String]"==Object.prototype.toString.call(B)};baidu.isString=baidu.lang.isString;baidu.event=baidu.event||{};baidu.event.getPageX=function(F){var D=F.pageX,E=document;if(!D&&D!==0){D=(F.clientX||0)+(E.documentElement.scrollLeft||E.body.scrollLeft)}return D};baidu.event.getPageY=function(F){var D=F.pageY,E=document;if(!D&&D!==0){D=(F.clientY||0)+(E.documentElement.scrollTop||E.body.scrollTop)}return D};baidu.event.stopPropagation=function(B){if(B.stopPropagation){B.stopPropagation()}else{B.cancelBubble=true}};baidu.event.preventDefault=function(B){if(B.preventDefault){B.preventDefault()}else{B.returnValue=false}};baidu.event.stop=function(C){var D=baidu.event;D.stopPropagation(C);D.preventDefault(C)};baidu.event.getTarget=function(B){return B.target||B.srcElement};baidu.event.EventArg=function(I,G){G=G||window;I=I||G.event;var H=G.document;this.target=I.target||I.srcElement;this.keyCode=I.which||I.keyCode;for(var F in I){var J=I[F];if("function"!=typeof J){this[F]=J}}if(!this.pageX&&this.pageX!==0){this.pageX=(I.clientX||0)+(H.documentElement.scrollLeft||H.body.scrollLeft);this.pageY=(I.clientY||0)+(H.documentElement.scrollTop||H.body.scrollTop)}this._event=I};baidu.event.EventArg.prototype.preventDefault=function(){if(this._event.preventDefault){this._event.preventDefault()}else{this._event.returnValue=false}return this};baidu.event.EventArg.prototype.stopPropagation=function(){if(this._event.stopPropagation){this._event.stopPropagation()}else{this._event.cancelBubble=true}return this};baidu.event.EventArg.prototype.stop=function(){return this.stopPropagation().preventDefault()};baidu.event._unload=function(){var I=baidu.event._listeners,F=I.length,J=!!window.removeEventListener,G,H;while(F--){G=I[F];if(G[1]=="unload"){continue}H=G[0];if(H.removeEventListener){H.removeEventListener(G[1],G[3],false)}else{if(H.detachEvent){H.detachEvent("on"+G[1],G[3])}}}if(J){window.removeEventListener("unload",baidu.event._unload,false)}else{window.detachEvent("onunload",baidu.event._unload)}};if(window.attachEvent){window.attachEvent("onunload",baidu.event._unload)}else{window.addEventListener("unload",baidu.event._unload,false)}baidu.event._listeners=baidu.event._listeners||[];baidu.event.on=function(P,M,K){M=M.replace(/^on/i,"").toLowerCase();P=baidu.dom._g(P);var L=function(A){K.call(P,A)},I=baidu.event._listeners,N=baidu.event._eventFilter,J,O=M;if(N&&N[M]){J=N[M](P,M,L);O=J.type;L=J.listener}if(P.addEventListener){P.addEventListener(O,L,false)}else{if(P.attachEvent){P.attachEvent("on"+O,L)}}I[I.length]=[P,M,K,L,O];return P};baidu.on=baidu.event.on;baidu.event.get=function(C,D){return new baidu.event.EventArg(C,D)};baidu.event.un=function(K,Q,L){K=baidu.dom._g(K);Q=Q.replace(/^on/i,"");var N=baidu.event._listeners,J=N.length,R=!L,O,P,M;while(J--){O=N[J];if(O[1]===Q&&O[0]===K&&(R||O[2]===L)){P=O[4];M=O[3];if(K.removeEventListener){K.removeEventListener(P,M,false)}else{if(K.detachEvent){K.detachEvent("on"+P,M)}}N.splice(J,1)}}return K};baidu.un=baidu.event.un;baidu.event.getKeyCode=function(B){return B.which||B.keyCode};baidu.ajax=baidu.ajax||{};baidu.ajax.request=function(P,T){function Y(){if(U.readyState==4){try{var A=U.status}catch(B){f("failure");return }f(A);if((A>=200&&A<300)||A==304||A==1223){f("success")}else{f("failure")}window.setTimeout(function(){U.onreadystatechange=new Function();if(c){U=null}},0)}}function Q(){if(window.ActiveXObject){try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(A){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(A){}}}if(window.XMLHttpRequest){return new XMLHttpRequest()}}function f(B){B="on"+B;var C=R[B],A=baidu.ajax[B];if(C){if(B!="onsuccess"){C(U)}else{C(U,U.responseText)}}else{if(A){if(B=="onsuccess"){return }A(U)}}}T=T||{};var Z=T.data||"",c=!(T.async===false),a=T.username||"",V=T.password||"",S=(T.method||"GET").toUpperCase(),d=T.headers||{},R={},W,U;for(W in T){R[W]=T[W]}d["X-Request-By"]="baidu.ajax";try{U=Q();if(S=="GET"){P+=(P.indexOf("?")>=0?"&":"?");if(Z){P+=Z+"&";Z=null}if(T.noCache){P+="b"+(new Date()).getTime()+"=1"}}if(a){U.open(S,P,c,a,V)}else{U.open(S,P,c)}if(c){U.onreadystatechange=Y}if(S=="POST"){U.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}for(W in d){if(d.hasOwnProperty(W)){U.setRequestHeader(W,d[W])}}f("beforerequest");U.send(Z);if(!c){Y()}}catch(X){f("failure")}return U};baidu.ajax.post=function(F,E,D){return baidu.ajax.request(F,{onsuccess:D,method:"POST",data:E})};baidu.ajax.get=function(D,C){return baidu.ajax.request(D,{onsuccess:C})};baidu.ajax.form=function(n,l){l=l||{};var i=n.elements,Z=i.length,m=n.getAttribute("method"),j=n.getAttribute("action"),T=l.replacer||function(A,B){return A},W={},U=[],c,X,V,a,k,h,g,d,f;function Y(B,A){U.push(B+"="+A)}for(c in l){if(l.hasOwnProperty(c)){W[c]=l[c]}}for(c=0;c<Z;c++){X=i[c];a=X.name;if(!X.disabled&&a){V=X.type;k=X.value;switch(V){case"radio":case"checkbox":if(!X.checked){break}case"textarea":case"text":case"password":case"hidden":case"select-one":Y(a,T(k,a));break;case"select-multiple":h=X.options;d=h.length;for(g=0;g<d;g++){f=h[g];if(f.selected){Y(a,T(f.value,a))}}break}}}W.data=U.join("&");W.method=n.getAttribute("method")||"POST";return baidu.ajax.request(j,W)};baidu.sio=baidu.sio||{};baidu.sio._removeScriptTag=function(D){if(D.clearAttributes){D.clearAttributes()}else{for(var C in D){if(D.hasOwnProperty(C)){delete D[C]}}}if(D&&D.parentNode){D.parentNode.removeChild(D)}D=null};baidu.sio.callByBrowser=function(L,I,M){M=M||{};var K=document.createElement("SCRIPT"),N=0,H,J=M.charset;K.onload=K.onreadystatechange=function(){if(N){return }var A=K.readyState;if("undefined"==typeof A||A=="loaded"||A=="complete"){N=1;try{("function"==typeof I)&&I()}finally{baidu.sio._removeScriptTag(K)}}};K.setAttribute("type","text/javascript");J&&K.setAttribute("charset",J);K.setAttribute("src",L);document.getElementsByTagName("head")[0].appendChild(K)};baidu.sio.callByServer=function(N,P,O){O=O||{};var S=document.createElement("SCRIPT"),T="bd__cbs__",K=typeof P,Q,R,M=O.charset,L=O.queryField||"callback";if("string"==K){Q=P}else{if("function"==K){while(1){Q=T+Math.floor(Math.random()*2147483648).toString(36);if(!window[Q]){window[Q]=function(){try{P.apply(window,arguments)}finally{baidu.sio._removeScriptTag(S);window[Q]=null}};break}}}}if("string"==typeof Q){N=N.replace((new RegExp("(\\?|&)callback=[^&]*")),"\x241"+L+"="+Q);if(N.search(new RegExp("(\\?|&)"+L+"=/"))<0){N+=(N.indexOf("?")<0?"?":"&")+L+"="+Q}}S.setAttribute("type","text/javascript");M&&S.setAttribute("charset",M);S.setAttribute("src",N);document.getElementsByTagName("head")[0].appendChild(S)};baidu.swf=baidu.swf||{};baidu.swf.version=(function(){var H=navigator;if(H.plugins&&H.mimeTypes.length){var K=H.plugins["Shockwave Flash"];if(K&&K.description){return K.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s)+r/,".")+".0"}}else{if(window.ActiveXObject&&!window.opera){for(var L=10;L>=2;L--){try{var I=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+L);if(I){var G=I.GetVariable("$version");return G.replace(/WIN/g,"").replace(/,/g,".")}}catch(J){}}}}})();baidu.swf.createHTML=function(U){U=U||{};var c=baidu.swf.version,f=U.ver||"6.0.0",g,Q,h,R,d,V,T={};for(R in U){T[R]=U[R]}U=T;if(c){c=c.split(".");f=f.split(".");for(h=0;h<3;h++){g=parseInt(c[h],10);Q=parseInt(f[h],10);if(Q<g){break}else{if(Q>g){return""}}}}else{return""}var Z=U.vars,a=["classid","codebase","id","width","height","align"];U.align=U.align||"middle";U.classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000";U.codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0";U.movie=U.url||"";delete U.vars;delete U.url;if("string"==typeof Z){U.flashvars=Z}else{var X=[];for(R in Z){V=Z[R];if(V){X.push(R+"="+encodeURIComponent(V))}}U.flashvars=X.join("&")}var Y=["<object "];for(h=0,d=a.length;h<d;h++){V=a[h];Y.push(" ",V,'="',U[V],'"')}Y.push(">");var S={wmode:1,scale:1,quality:1,play:1,loop:1,menu:1,salign:1,bgcolor:1,base:1,allowscriptaccess:1,allownetworking:1,allowfullscreen:1,seamlesstabbing:1,devicefont:1,swliveconnect:1,flashvars:1,movie:1};for(R in U){V=U[R];R=R.toLowerCase();if(S[R]&&V){Y.push('<param name="'+R+'" value="'+V+'" />')}}U.src=U.movie;U.name=U.id;delete U.id;delete U.movie;delete U.classid;delete U.codebase;U.type="application/x-shockwave-flash";U.pluginspage="http://www.macromedia.com/go/getflashplayer";Y.push("<embed");var W;for(R in U){V=U[R];if(V){if((new RegExp("^salign\x24","i")).test(R)){W=V;continue}Y.push(" ",R,'="',V,'"')}}if(W){Y.push(' salign="',W,'"')}Y.push("></embed></object>");return Y.join("")};baidu.array=baidu.array||{};baidu.array.remove=function(G,F){var E=G.length,H=F;if("function"!=typeof F){H=function(A){return F===A}}while(E--){if(true===H.call(G,G[E],E)){G.splice(E,1)}}return G};baidu.lang.isFunction=function(B){return"[object Function]"==Object.prototype.toString.call(B)};baidu.lang.toArray=function(F){if(F===null||F===undefined){return[]}if(baidu.lang.isArray(F)){return F}if(typeof F.length!=="number"||typeof F==="string"||baidu.lang.isFunction(F)){return[F]}if(F.item){var D=F.length,E=new Array(D);while(D--){E[D]=F[D]}return E}return[].slice.call(F)};baidu.swf.getMovie=function(E){var D=document[E],F;return baidu.browser.ie==9?D&&D.length?(F=baidu.array.remove(baidu.lang.toArray(D),function(A){return A.tagName.toLowerCase()!="embed"})).length==1?F[0]:F:D:D||window[E]};baidu.swf.create=function(D,E){D=D||{};var F=baidu.swf.createHTML(D)||D.errorMessage||"";if(E&&"string"==typeof E){E=document.getElementById(E)}if(E){E.innerHTML=F}else{document.write(F)}};baidu.object=baidu.object||{};baidu.object.extend=function(E,D){for(var F in D){if(D.hasOwnProperty(F)){E[F]=D[F]}}return E};baidu.extend=baidu.object.extend;baidu.object.each=function(G,I){var J,F,H;if("function"==typeof I){for(F in G){if(G.hasOwnProperty(F)){H=G[F];J=I.call(G,H,F);if(J===false){break}}}}return G};baidu.object.keys=function(F){var E=[],G=0,H;for(H in F){if(F.hasOwnProperty(H)){E[G++]=H}}return E};baidu.object.values=function(F){var E=[],G=0,H;for(H in F){if(F.hasOwnProperty(H)){E[G++]=F[H]}}return E};baidu.object.clone=(function(B){return function(A){var I=A,H,J;if(!A||A instanceof Number||A instanceof String||A instanceof Boolean){return I}else{if(A instanceof Array){I=[];var G=0;for(H=0,J=A.length;H<J;H++){I[G++]=baidu.object.clone(A[H])}}else{if("object"==typeof A){if(B[Object.prototype.toString.call(A)]){return I}I={};for(H in A){if(A.hasOwnProperty(H)){I[H]=baidu.object.clone(A[H])}}}}}return I}})({"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1});baidu.string.getByteLength=function(B){return String(B).replace(/[^\x00-\xff]/g,"ci").length};baidu.string.decodeHTML=function(C){var D=String(C).replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&");return D.replace(/&#([\d]+);/g,function(A,B){return String.fromCharCode(parseInt(B,10))})};baidu.decodeHTML=baidu.string.decodeHTML;baidu.string.format=function(G,E){G=String(G);var H=Array.prototype.slice.call(arguments,1),F=Object.prototype.toString;if(H.length){H=H.length==1?(E!==null&&(/\[object Array\]|\[object Object\]/.test(F.call(E)))?E:H):H;return G.replace(/#\{(.+?)\}/g,function(C,A){var B=H[A];if("[object Function]"==F.call(B)){B=B(A)}return("undefined"==typeof B?"":B)})}return G};baidu.format=baidu.string.format;baidu.string.wbr=function(B){return String(B).replace(/(?:<[^>]+>)|(?:&#?[0-9a-z]{2,6};)|(.{1})/gi,"$&<wbr>").replace(/><wbr>/g,">")};baidu.string.subByte=function(D,C){D=String(D);if(C<0||baidu.string.getByteLength(D)<=C){return D}D=D.substr(0,C).replace(/([^\x00-\xff])/g,"\x241 ").substr(0,C).replace(/[^\x00-\xff]$/,"").replace(/([^\x00-\xff]) /g,"\x241");return D};baidu.string.toHalfWidth=function(B){return String(B).replace(/[\uFF01-\uFF5E]/g,function(A){return String.fromCharCode(A.charCodeAt(0)-65248)}).replace(/\u3000/g," ")};baidu.string.encodeHTML=function(B){return String(B).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")};baidu.encodeHTML=baidu.string.encodeHTML;baidu.page=baidu.page||{};baidu.page.getHeight=function(){var F=document,E=F.body,G=F.documentElement,H=F.compatMode=="BackCompat"?E:F.documentElement;return Math.max(G.scrollHeight,E.scrollHeight,H.clientHeight)};baidu.page.loadCssFile=function(D){var C=document.createElement("link");C.setAttribute("rel","stylesheet");C.setAttribute("type","text/css");C.setAttribute("href",D);document.getElementsByTagName("head")[0].appendChild(C)};baidu.page.getScrollLeft=function(){var B=document;return window.pageXOffset||B.documentElement.scrollLeft||B.body.scrollLeft};baidu.page.getViewWidth=function(){var D=document,C=D.compatMode=="BackCompat"?D.body:D.documentElement;return C.clientWidth};baidu.page.loadJsFile=function(D){var C=document.createElement("script");C.setAttribute("type","text/javascript");C.setAttribute("src",D);C.setAttribute("defer","defer");document.getElementsByTagName("head")[0].appendChild(C)};baidu.page.getWidth=function(){var F=document,E=F.body,G=F.documentElement,H=F.compatMode=="BackCompat"?E:F.documentElement;return Math.max(G.scrollWidth,E.scrollWidth,H.clientWidth)};baidu.page.getScrollTop=function(){var B=document;return window.pageYOffset||B.documentElement.scrollTop||B.body.scrollTop};baidu.page.getViewHeight=function(){var D=document,C=D.compatMode=="BackCompat"?D.body:D.documentElement;return C.clientHeight};baidu.array.filter=function(I,K){var M=[],N=0,H=I.length,J,L;if("function"==typeof K){for(L=0;L<H;L++){J=I[L];if(true===K.call(I,J,L)){M[N++]=J}}}return M};baidu.array.unique=function(I,H){var L=I.length,G=I.slice(0),J,K;if("function"!=typeof H){H=function(A,B){return A===B}}while(--L>0){K=G[L];J=L;while(J--){if(H(K,G[J])){G.splice(L,1);break}}}return G};baidu.array.indexOf=function(H,G,J){var F=H.length,I=G;J=Number(J)||0;J=J<0?Math.ceil(J):Math.floor(J);J=Math.min(Math.max(J,0),F);if("function"!=typeof G){I=function(A){return G===A}}for(;J<F;J++){if(true===I.call(H,H[J],J)){return J}}return -1};baidu.array.each=function(H,J){var K,I,L,G=H.length;if("function"==typeof J){for(L=0;L<G;L++){I=H[L];K=J.call(H,I,L);if(K===false){break}}}return H};baidu.each=baidu.array.each;baidu.array.find=function(G,I){var H,J,F=G.length;if("function"==typeof I){for(J=0;J<F;J++){H=G[J];if(true===I.call(G,H,J)){return H}}}return null};baidu.array.lastIndexOf=function(G,F){var E=G.length,H=F;if("function"!=typeof F){H=function(A){return F===A}}while(E--){if(true===H.call(G,G[E],E)){return E}}return -1};baidu.array.removeAt=function(D,C){return D.splice(C,1)[0]};baidu.lang.createClass=function(L,P){P=P||{};var M=P.superClass||baidu.lang.Class;var N=function(){if(M!=baidu.lang.Class){M.apply(this,arguments)}else{M.call(this)}L.apply(this,arguments)};N.options=P.options||{};var J=function(){},K=L.prototype;J.prototype=M.prototype;var C=N.prototype=new J();for(var O in K){C[O]=K[O]}typeof P.className=="string"&&(C._className=P.className);C.constructor=K.constructor;N.extend=function(A){for(var B in A){N.prototype[B]=A[B]}return N};return N};baidu.lang.createSingle=function(F){var E=new baidu.lang.Class();for(var D in F){E[D]=F[D]}return E};baidu.string.filterFormat=function(G,E){var H=Array.prototype.slice.call(arguments,1),F=Object.prototype.toString;if(H.length){H=H.length==1?(E!==null&&(/\[object Array\]|\[object Object\]/.test(F.call(E)))?E:H):H;return G.replace(/#\{(.+?)\}/g,function(M,C){var A,D,L,N,B;if(!H){return""}A=C.split("|");D=H[A[0]];if("[object Function]"==F.call(D)){D=D(A[0])}for(L=1,N=A.length;L<N;++L){B=baidu.string.filterFormat[A[L]];if("[object Function]"==F.call(B)){D=B(D)}}return(("undefined"==typeof D||D===null)?"":D)})}return G};baidu.string.filterFormat.escapeJs=function(G){if(!G||"string"!=typeof G){return G}var H,F,J,I=[];for(H=0,F=G.length;H<F;++H){J=G.charCodeAt(H);if(J>255){I.push(G.charAt(H))}else{I.push("\\x"+J.toString(16))}}return I.join("")};baidu.string.filterFormat.js=baidu.string.filterFormat.escapeJs;baidu.string.filterFormat.escapeString=function(B){if(!B||"string"!=typeof B){return B}return B.replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;").replace(/>/g,"&#62;").replace(/\\/g,"&#92;").replace(/\//g,"&#47;").replace(/`/g,"&#96;")};baidu.string.filterFormat.e=baidu.string.filterFormat.escapeString;baidu.string.filterFormat.toInt=function(B){return parseInt(B,10)||0};baidu.string.filterFormat.i=baidu.string.filterFormat.toInt;(function(){baidu.page.getMousePosition=function(){return{x:baidu.page.getScrollLeft()+B.x,y:baidu.page.getScrollTop()+B.y}};var B={x:0,y:0};baidu.event.on(document,"onmousemove",function(A){A=window.event||A;B.x=A.clientX;B.y=A.clientY})})();(function(){var T,U,M,N,O,R,X,Q;baidu.dom.drag=function(A,B){if(!(T=baidu.dom.g(A))){return false}U=baidu.object.extend({autoStop:true,capture:false,interval:20},B);R=parseInt(baidu.dom.getStyle(T,"top"))||0;X=parseInt(baidu.dom.getStyle(T,"left"))||0;setTimeout(function(){var C=baidu.page.getMousePosition();M=C.x;N=C.y;clearTimeout(O);O=setInterval(P,U.interval)},1);U.autoStop&&baidu.event.on(document,"mouseup",S);baidu.event.on(document.body,"selectstart",W);if(U.capture&&T.setCapture){T.setCapture()}else{if(U.capture&&window.captureEvents){window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP)}}Q=document.body.style.MozUserSelect;document.body.style.MozUserSelect="none";typeof U.ondragstart=="function"&&U.ondragstart(T,U);return{stop:S,dispose:S,update:V}};function V(A){baidu.extend(U,A)}function S(){clearTimeout(O);if(U.capture&&T.releaseCapture){T.releaseCapture()}else{if(U.capture&&window.releaseEvents){window.releaseEvents(Event.MOUSEMOVE|Event.MOUSEUP)}}document.body.style.MozUserSelect=Q;baidu.event.un(document.body,"selectstart",W);baidu.event.un(document,"mouseup",S);typeof U.ondragend=="function"&&U.ondragend(T,U)}function P(A){var E=U.range,B=baidu.page.getMousePosition(),D=X+B.x-M,C=R+B.y-N;if(typeof E=="object"&&E&&E.length==4){D=Math.max(E[3],D);D=Math.min(E[1]-T.offsetWidth,D);C=Math.max(E[0],C);C=Math.min(E[2]-T.offsetHeight,C)}T.style.top=C+"px";T.style.left=D+"px";typeof U.ondrag=="function"&&U.ondrag(T,U)}function W(A){return baidu.event.preventDefault(A,false)}})();baidu.dom.draggable=function(M,O){O=baidu.object.extend({toggle:function(){return true}},O||{});O.autoStop=true;M=baidu.dom.g(M);O.handler=O.handler||M;var N,Q=["ondragstart","ondrag","ondragend"],L=Q.length-1,K,P,S={dispose:function(){P&&P.dispose();baidu.event.un(O.handler,"onmousedown",R);baidu.lang.Class.prototype.dispose.call(S)}},T=this;if(N=baidu.dom.ddManager){for(;L>=0;L--){K=Q[L];O[K]=(function(B){var A=O[B];return function(){baidu.lang.isFunction(A)&&A.apply(T,arguments);N.dispatchEvent(B,{DOM:M})}})(K)}}if(M&&baidu.dom.getStyle(M,"position")!="static"){function R(){if(typeof O.toggle=="function"&&!O.toggle()){return }P=baidu.dom.drag(M,O);S.stop=P.stop;S.update=P.update}baidu.event.on(O.handler,"onmousedown",R)}return{cancel:function(){S.dispose()}}};(function(){var V=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,c=0,Q=Object.prototype.toString,W=false,d=true;[0,0].sort(function(){d=false;return 0});var S=function(E,L,B,A){B=B||[];L=L||document;var P=L;if(L.nodeType!==1&&L.nodeType!==9){return[]}if(!E||typeof E!=="string"){return B}var D=[],I,N,H,J,F=true,G=S.isXML(L),i=E,O,K,M,C;do{V.exec("");I=V.exec(i);if(I){i=I[3];D.push(I[1]);if(I[2]){J=I[3];break}}}while(I);if(D.length>1&&a.exec(E)){if(D.length===2&&h.relative[D[0]]){N=f(D[0]+D[1],L)}else{N=h.relative[D[0]]?[L]:S(D.shift(),L);while(D.length){E=D.shift();if(h.relative[E]){E+=D.shift()}N=f(E,N)}}}else{if(!A&&D.length>1&&L.nodeType===9&&!G&&h.match.ID.test(D[0])&&!h.match.ID.test(D[D.length-1])){O=S.find(D.shift(),L,G);L=O.expr?S.filter(O.expr,O.set)[0]:O.set[0]}if(L){O=A?{expr:D.pop(),set:T(A)}:S.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&L.parentNode?L.parentNode:L,G);N=O.expr?S.filter(O.expr,O.set):O.set;if(D.length>0){H=T(N)}else{F=false}while(D.length){K=D.pop();M=K;if(!h.relative[K]){K=""}else{M=D.pop()}if(M==null){M=L}h.relative[K](H,M,G)}}else{H=D=[]}}if(!H){H=N}if(!H){S.error(K||E)}if(Q.call(H)==="[object Array]"){if(!F){B.push.apply(B,H)}else{if(L&&L.nodeType===1){for(C=0;H[C]!=null;C++){if(H[C]&&(H[C]===true||H[C].nodeType===1&&S.contains(L,H[C]))){B.push(N[C])}}}else{for(C=0;H[C]!=null;C++){if(H[C]&&H[C].nodeType===1){B.push(N[C])}}}}}else{T(H,B)}if(J){S(J,P,B,A);S.uniqueSort(B)}return B};S.uniqueSort=function(A){if(R){W=d;A.sort(R);if(W){for(var B=1;B<A.length;B++){if(A[B]===A[B-1]){A.splice(B--,1)}}}}return A};S.matches=function(B,A){return S(B,null,null,A)};S.find=function(B,I,A){var C;if(!B){return[]}for(var F=0,G=h.order.length;F<G;F++){var D=h.order[F],E;if((E=h.leftMatch[D].exec(B))){var H=E[1];E.splice(1,1);if(H.substr(H.length-1)!=="\\"){E[1]=(E[1]||"").replace(/\\/g,"");C=h.find[D](E,I,A);if(C!=null){B=B.replace(h.match[D],"");break}}}}if(!C){C=I.getElementsByTagName("*")}return{set:C,expr:B}};S.filter=function(P,i,M,F){var H=P,I=[],B=i,D,L,C=i&&i[0]&&S.isXML(i[0]);while(P&&i.length){for(var A in h.filter){if((D=h.leftMatch[A].exec(P))!=null&&D[2]){var J=h.filter[A],K,N,G=D[1];L=false;D.splice(1,1);if(G.substr(G.length-1)==="\\"){continue}if(B===I){I=[]}if(h.preFilter[A]){D=h.preFilter[A](D,B,M,I,F,C);if(!D){L=K=true}else{if(D===true){continue}}}if(D){for(var E=0;(N=B[E])!=null;E++){if(N){K=J(N,D,E,B);var O=F^!!K;if(M&&K!=null){if(O){L=true}else{B[E]=false}}else{if(O){I.push(N);L=true}}}}}if(K!==undefined){if(!M){B=I}P=P.replace(h.match[A],"");if(!L){return[]}break}}}if(P===H){if(L==null){S.error(P)}else{break}}H=P}return B};S.error=function(A){throw"Syntax error, unrecognized expression: "+A};var h=S.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(A){return A.getAttribute("href")}},relative:{"+":function(A,F){var D=typeof F==="string",B=D&&!/\W/.test(F),H=D&&!B;if(B){F=F.toLowerCase()}for(var E=0,G=A.length,C;E<G;E++){if((C=A[E])){while((C=C.previousSibling)&&C.nodeType!==1){}A[E]=H||C&&C.nodeName.toLowerCase()===F?C||false:C===F}}if(H){S.filter(F,A,true)}},">":function(A,F){var C=typeof F==="string",B,E=0,G=A.length;if(C&&!/\W/.test(F)){F=F.toLowerCase();for(;E<G;E++){B=A[E];if(B){var D=B.parentNode;A[E]=D.nodeName.toLowerCase()===F?D:false}}}else{for(;E<G;E++){B=A[E];if(B){A[E]=C?B.parentNode:B.parentNode===F}}if(C){S.filter(F,A,true)}}},"":function(C,E,A){var D=c++,F=U,B;if(typeof E==="string"&&!/\W/.test(E)){E=E.toLowerCase();B=E;F=X}F("parentNode",E,D,C,B,A)},"~":function(C,E,A){var D=c++,F=U,B;if(typeof E==="string"&&!/\W/.test(E)){E=E.toLowerCase();B=E;F=X}F("previousSibling",E,D,C,B,A)}},find:{ID:function(C,B,A){if(typeof B.getElementById!=="undefined"&&!A){var D=B.getElementById(C[1]);return D?[D]:[]}},NAME:function(D,A){if(typeof A.getElementsByName!=="undefined"){var E=[],B=A.getElementsByName(D[1]);for(var C=0,F=B.length;C<F;C++){if(B[C].getAttribute("name")===D[1]){E.push(B[C])}}return E.length===0?null:E}},TAG:function(B,A){return A.getElementsByTagName(B[1])}},preFilter:{CLASS:function(D,F,E,G,A,H){D=" "+D[1].replace(/\\/g,"")+" ";if(H){return D}for(var C=0,B;(B=F[C])!=null;C++){if(B){if(A^(B.className&&(" "+B.className+" ").replace(/[\t\n]/g," ").indexOf(D)>=0)){if(!E){G.push(B)}}else{if(E){F[C]=false}}}}return false},ID:function(A){return A[1].replace(/\\/g,"")},TAG:function(A,B){return A[1].toLowerCase()},CHILD:function(B){if(B[1]==="nth"){var A=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(B[2]==="even"&&"2n"||B[2]==="odd"&&"2n+1"||!/\D/.test(B[2])&&"0n+"+B[2]||B[2]);B[2]=(A[1]+(A[2]||1))-0;B[3]=A[3]-0}B[0]=c++;return B},ATTR:function(C,F,E,G,B,A){var D=C[1].replace(/\\/g,"");if(!A&&h.attrMap[D]){C[1]=h.attrMap[D]}if(C[2]==="~="){C[4]=" "+C[4]+" "}return C},PSEUDO:function(B,E,D,F,A){if(B[1]==="not"){if((V.exec(B[3])||"").length>1||/^\w/.test(B[3])){B[3]=S(B[3],null,null,E)}else{var C=S.filter(B[3],E,D,true^A);if(!D){F.push.apply(F,C)}return false}}else{if(h.match.POS.test(B[0])||h.match.CHILD.test(B[0])){return true}}return B},POS:function(A){A.unshift(true);return A}},filters:{enabled:function(A){return A.disabled===false&&A.type!=="hidden"},disabled:function(A){return A.disabled===true},checked:function(A){return A.checked===true},selected:function(A){A.parentNode.selectedIndex;return A.selected===true},parent:function(A){return !!A.firstChild},empty:function(A){return !A.firstChild},has:function(A,B,C){return !!S(C[3],A).length},header:function(A){return(/h\d/i).test(A.nodeName)},text:function(A){return"text"===A.type},radio:function(A){return"radio"===A.type},checkbox:function(A){return"checkbox"===A.type},file:function(A){return"file"===A.type},password:function(A){return"password"===A.type},submit:function(A){return"submit"===A.type},image:function(A){return"image"===A.type},reset:function(A){return"reset"===A.type},button:function(A){return"button"===A.type||A.nodeName.toLowerCase()==="button"},input:function(A){return(/input|select|textarea|button/i).test(A.nodeName)}},setFilters:{first:function(A,B){return B===0},last:function(B,C,D,A){return C===A.length-1},even:function(A,B){return B%2===0},odd:function(A,B){return B%2===1},lt:function(A,B,C){return B<C[3]-0},gt:function(A,B,C){return B>C[3]-0},nth:function(A,B,C){return C[3]-0===B},eq:function(A,B,C){return C[3]-0===B}},filter:{PSEUDO:function(G,B,C,A){var I=B[1],H=h.filters[I];if(H){return H(G,C,B,A)}else{if(I==="contains"){return(G.textContent||G.innerText||S.getText([G])||"").indexOf(B[3])>=0}else{if(I==="not"){var F=B[3];for(var D=0,E=F.length;D<E;D++){if(F[D]===G){return false}}return true}else{S.error("Syntax error, unrecognized expression: "+I)}}}},CHILD:function(J,G){var D=G[1],I=J;switch(D){case"only":case"first":while((I=I.previousSibling)){if(I.nodeType===1){return false}}if(D==="first"){return true}I=J;case"last":while((I=I.nextSibling)){if(I.nodeType===1){return false}}return true;case"nth":var H=G[2],A=G[3];if(H===1&&A===0){return true}var E=G[0],B=J.parentNode;if(B&&(B.sizcache!==E||!J.nodeIndex)){var F=0;for(I=B.firstChild;I;I=I.nextSibling){if(I.nodeType===1){I.nodeIndex=++F}}B.sizcache=E}var C=J.nodeIndex-A;if(H===0){return C===0}else{return(C%H===0&&C/H>=0)}}},ID:function(A,B){return A.nodeType===1&&A.getAttribute("id")===B},TAG:function(A,B){return(B==="*"&&A.nodeType===1)||A.nodeName.toLowerCase()===B},CLASS:function(A,B){return(" "+(A.className||A.getAttribute("class"))+" ").indexOf(B)>-1},ATTR:function(B,D){var E=D[1],G=h.attrHandle[E]?h.attrHandle[E](B):B[E]!=null?B[E]:B.getAttribute(E),A=G+"",C=D[2],F=D[4];return G==null?C==="!=":C==="="?A===F:C==="*="?A.indexOf(F)>=0:C==="~="?(" "+A+" ").indexOf(F)>=0:!F?A&&G!==false:C==="!="?A!==F:C==="^="?A.indexOf(F)===0:C==="$="?A.substr(A.length-F.length)===F:C==="|="?A===F||A.substr(0,F.length+1)===F+"-":false},POS:function(B,E,D,A){var F=E[2],C=h.setFilters[F];if(C){return C(B,D,E,A)}}}};var a=h.match.POS,g=function(A,B){return"\\"+(B-0+1)};for(var Y in h.match){h.match[Y]=new RegExp(h.match[Y].source+(/(?![^\[]*\])(?![^\(]*\))/.source));h.leftMatch[Y]=new RegExp(/(^(?:.|\r|\n)*?)/.source+h.match[Y].source.replace(/\\(\d+)/g,g))}var T=function(A,B){A=Array.prototype.slice.call(A,0);if(B){B.push.apply(B,A);return B}return A};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(Z){T=function(A,B){var D=B||[],C=0;if(Q.call(A)==="[object Array]"){Array.prototype.push.apply(D,A)}else{if(typeof A.length==="number"){for(var E=A.length;C<E;C++){D.push(A[C])}}else{for(;A[C];C++){D.push(A[C])}}}return D}}var R;if(document.documentElement.compareDocumentPosition){R=function(B,C){if(!B.compareDocumentPosition||!C.compareDocumentPosition){if(B==C){W=true}return B.compareDocumentPosition?-1:1}var A=B.compareDocumentPosition(C)&4?-1:B===C?0:1;if(A===0){W=true}return A}}else{if("sourceIndex" in document.documentElement){R=function(B,C){if(!B.sourceIndex||!C.sourceIndex){if(B==C){W=true}return B.sourceIndex?-1:1}var A=B.sourceIndex-C.sourceIndex;if(A===0){W=true}return A}}else{if(document.createRange){R=function(B,D){if(!B.ownerDocument||!D.ownerDocument){if(B==D){W=true}return B.ownerDocument?-1:1}var C=B.ownerDocument.createRange(),E=D.ownerDocument.createRange();C.setStart(B,0);C.setEnd(B,0);E.setStart(D,0);E.setEnd(D,0);var A=C.compareBoundaryPoints(Range.START_TO_END,E);if(A===0){W=true}return A}}}}S.getText=function(D){var C="",A;for(var B=0;D[B];B++){A=D[B];if(A.nodeType===3||A.nodeType===4){C+=A.nodeValue}else{if(A.nodeType!==8){C+=S.getText(A.childNodes)}}}return C};(function(){var B=document.createElement("div"),A="script"+(new Date()).getTime();B.innerHTML="<a name='"+A+"'/>";var C=document.documentElement;C.insertBefore(B,C.firstChild);if(document.getElementById(A)){h.find.ID=function(F,E,D){if(typeof E.getElementById!=="undefined"&&!D){var G=E.getElementById(F[1]);return G?G.id===F[1]||typeof G.getAttributeNode!=="undefined"&&G.getAttributeNode("id").nodeValue===F[1]?[G]:undefined:[]}};h.filter.ID=function(D,F){var E=typeof D.getAttributeNode!=="undefined"&&D.getAttributeNode("id");return D.nodeType===1&&E&&E.nodeValue===F}}C.removeChild(B);C=B=null})();(function(){var A=document.createElement("div");A.appendChild(document.createComment(""));if(A.getElementsByTagName("*").length>0){h.find.TAG=function(F,B){var C=B.getElementsByTagName(F[1]);if(F[1]==="*"){var D=[];for(var E=0;C[E];E++){if(C[E].nodeType===1){D.push(C[E])}}C=D}return C}}A.innerHTML="<a href='#'></a>";if(A.firstChild&&typeof A.firstChild.getAttribute!=="undefined"&&A.firstChild.getAttribute("href")!=="#"){h.attrHandle.href=function(B){return B.getAttribute("href",2)}}A=null})();if(document.querySelectorAll){(function(){var C=S,A=document.createElement("div");A.innerHTML="<p class='TEST'></p>";if(A.querySelectorAll&&A.querySelectorAll(".TEST").length===0){return }S=function(D,E,G,F){E=E||document;if(!F&&E.nodeType===9&&!S.isXML(E)){try{return T(E.querySelectorAll(D),G)}catch(H){}}return C(D,E,G,F)};for(var B in C){S[B]=C[B]}A=null})()}(function(){var A=document.createElement("div");A.innerHTML="<div class='test e'></div><div class='test'></div>";if(!A.getElementsByClassName||A.getElementsByClassName("e").length===0){return }A.lastChild.className="e";if(A.getElementsByClassName("e").length===1){return }h.order.splice(1,0,"CLASS");h.find.CLASS=function(D,C,B){if(typeof C.getElementsByClassName!=="undefined"&&!B){return C.getElementsByClassName(D[1])}};A=null})();function X(I,D,E,A,C,B){for(var G=0,H=A.length;G<H;G++){var J=A[G];if(J){J=J[I];var F=false;while(J){if(J.sizcache===E){F=A[J.sizset];break}if(J.nodeType===1&&!B){J.sizcache=E;J.sizset=G}if(J.nodeName.toLowerCase()===D){F=J;break}J=J[I]}A[G]=F}}}function U(I,D,E,A,C,B){for(var G=0,H=A.length;G<H;G++){var J=A[G];if(J){J=J[I];var F=false;while(J){if(J.sizcache===E){F=A[J.sizset];break}if(J.nodeType===1){if(!B){J.sizcache=E;J.sizset=G}if(typeof D!=="string"){if(J===D){F=true;break}}else{if(S.filter(D,[J]).length>0){F=J;break}}}J=J[I]}A[G]=F}}}S.contains=document.compareDocumentPosition?function(A,B){return !!(A.compareDocumentPosition(B)&16)}:function(A,B){return A!==B&&(A.contains?A.contains(B):true)};S.isXML=function(B){var A=(B?B.ownerDocument||B:0).documentElement;return A?A.nodeName!=="HTML":false};var f=function(G,H){var D=[],C="",B,E=H.nodeType?[H]:H;while((B=h.match.PSEUDO.exec(G))){C+=B[0];G=G.replace(h.match.PSEUDO,"")}G=h.relative[G]?G+"*":G;for(var A=0,F=E.length;A<F;A++){S(G,E[A],D)}return S.filter(C,D)};baidu.dom.query=S})();baidu.page.createStyleSheet=function(G){var H=G||{},J=H.document||document,K;if(baidu.browser.ie){if(!H.url){H.url=""}return J.createStyleSheet(H.url,H.index)}else{K="<style type='text/css'></style>";H.url&&(K="<link type='text/css' rel='stylesheet' href='"+H.url+"'/>");baidu.dom.insertHTML(J.getElementsByTagName("HEAD")[0],"beforeEnd",K);if(H.url){return null}var L=J.styleSheets[J.styleSheets.length-1],I=L.rules||L.cssRules;return{self:L,rules:L.rules||L.cssRules,addRule:function(C,A,B){if(L.addRule){return L.addRule(C,A,B)}else{if(L.insertRule){isNaN(B)&&(B=I.length);return L.insertRule(C+"{"+A+"}",B)}}},removeRule:function(A){if(L.removeRule){L.removeRule(A)}else{if(L.deleteRule){isNaN(A)&&(A=0);L.deleteRule(A)}}}}}};baidu.dom.create=function(F,D){D=D||{};var E=document.createElement(F);return baidu.dom.setAttrs(E,D)};baidu.dom.empty=function(B){B=baidu.dom.g(B);while(B.firstChild){B.removeChild(B.firstChild)}return B};baidu.dom.getText=function(H){var J="",G,I=0,F;H=baidu._g(H);if(H.nodeType===3||H.nodeType===4){J+=H.nodeValue}else{if(H.nodeType!==8){G=H.childNodes;for(F=G.length;I<F;I++){J+=baidu.dom.getText(G[I])}}}return J};baidu.dom.hasAttr=function(E,F){E=baidu.g(E);var D=E.attributes.getNamedItem(F);return !!(D&&D.specified)};baidu.dom.toggleClass=function(C,D){if(baidu.dom.hasClass(C,D)){baidu.dom.removeClass(C,D)}else{baidu.dom.addClass(C,D)}};baidu.fn=baidu.fn||{};baidu.fn.multize=function(E,D){var F=function(){var A=arguments[0],K=D?F:E,M=[],B=[].slice.call(arguments,0),L=0,N,C;if(A instanceof Array){for(N=A.length;L<N;L++){B[0]=A[L];C=K.apply(this,B);M.push(C)}return M}else{return E.apply(this,arguments)}};return F};baidu.fn.methodize=function(D,C){if(C){return function(){return D.apply(null,[this[C]].concat([].slice.call(arguments)))}}return function(){return D.apply(null,[this].concat([].slice.call(arguments)))}};(function(){var L=baidu.lang.isArray,H=baidu.lang.isElement,K=function(A){var B=this;B._dom=[];if(L(A)){baidu.each(A,function(C,D){B._dom[D]=C})}else{B._dom[0]=A}},I=K.prototype={};I.each=function(A){baidu.object.each(this._dom,function(B){A.call(this,(new K(B)))})};baidu.each(("addClass draggable empty hide show insertAfter insertBefore insertHTML removeClass setAttr setAttrs setStyle setStyles show toggleClass toggle children next first getAncestorByClass getAncestorBy getAncestorByTag getDocument getParent getWindow last next prev contains getAttr getPosition getStyle g q query hasClass intersect remove droppable removeStyle getText hasAttr").split(" "),function(A){I[A]=I[A.replace(/^get[A-Z]/g,J)]=G(baidu.dom[A])});baidu.each(("on un").split(" "),function(A){I[A]=G(baidu.event[A])});baidu.each(("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error").split(" "),function(A){I[A]=function(B){return this.on(A,B)}});baidu.e=baidu.element=function(A){return new K(baidu._g(A))};baidu.element.extend=function(A){baidu.object.each(A,function(B,C){I[C]=G(B)})};function G(A){return function(){var B=baidu.fn.methodize(baidu.fn.multize(A),"_dom").apply(this,arguments);return(H(B)||(L(B)&&H(B[0])))?new K(B):B}}function J(A){return A.charAt(3).toLowerCase()}})();baidu.dom.ddManager=baidu.lang.createSingle({_targetsDroppingOver:{}});baidu.dom.droppable=function(J,L){L=L||{};var K=baidu.dom.ddManager,H=baidu.dom.g(J),I=function(A){var B=K._targetsDroppingOver;if(baidu.dom.intersect(H,A.DOM)){if(!B[H]){(typeof L.ondropover=="function")&&L.ondropover.call(H,A.DOM);K.dispatchEvent("ondropover",{trigger:A.DOM,reciever:H});B[H]=true}}else{if(B[H]){(typeof L.ondropout=="function")&&L.ondropout.call(H,A.DOM);K.dispatchEvent("ondropout",{trigger:A.DOM,reciever:H})}delete B[H]}},G=function(A){if(baidu.dom.intersect(H,A.DOM)){typeof L.ondrop=="function"&&L.ondrop.call(H,A.DOM);K.dispatchEvent("ondrop",{trigger:A.DOM,reciever:H})}delete K._targetsDroppingOver[H]};K.addEventListener("ondrag",I);K.addEventListener("ondragend",G);return{cancel:function(){K.removeEventListener("ondrag",I);K.removeEventListener("ondragend",G)}}};baidu.dom.removeStyle=function(){var F=document.createElement("DIV"),D,E=baidu.dom._g;if(F.style.removeProperty){D=function(A,B){return E(A).style.removeProperty(B)}}else{if(F.style.removeAttribute){D=function(A,B){return E(A).style.removeAttribute(baidu.string.toCamelCase(B))}}}F=null;return D}();baidu.lang.Class.prototype.addEventListeners=function(I,H){if(typeof H=="undefined"){for(var J in I){this.addEventListener(J,I[J])}}else{I=I.split(",");var J=0,F=I.length,G;for(;J<F;J++){this.addEventListener(baidu.trim(I[J]),H)}}};baidu.array.hash=function(I,L){var H={},J=L&&L.length,K=0,G=I.length;for(;K<G;K++){H[I[K]]=(J&&J>K)?L[K]:true}return H};baidu.fn.bind=function(D,E){var F=arguments.length>2?[].slice.call(arguments,2):null;return function(){var A=baidu.lang.isString(D)?E[D]:D,B=(F)?F.concat([].slice.call(arguments,0)):arguments;return A.apply(E||A,B)}};baidu.lang.isBoolean=function(B){return typeof B==="boolean"};baidu.lang.isDate=function(B){return{}.toString.call(B)==="[object Date]"&&B.toString()!=="Invalid Date"&&!isNaN(B)};baidu.event._eventFilter=baidu.event._eventFilter||{};baidu.event._eventFilter.mouseenter=window.attachEvent?null:function(H,G,F){function E(A){var C=A.relatedTarget,B=A.currentTarget;if(C.prefix=="xul"){return }while(C&&C!==B){C=C.parentNode}if(C!==B){return F.call(B,A)}}return{type:"mouseover",listener:E}};baidu.event._eventFilter.mouseleave=window.attachEvent?null:function(E,H,F){function G(A){var C=A.relatedTarget,B=A.currentTarget;if(C.prefix=="xul"){return }while(C&&C!==B){C=C.parentNode}if(C!==B){return F.call(B,A)}}return{type:"mouseout",listener:G}};(function(){var Q={keydown:1,keyup:1,keypress:1},O={click:1,dblclick:1,mousedown:1,mousemove:1,mouseup:1,mouseover:1,mouseout:1},T={abort:1,blur:1,change:1,error:1,focus:1,load:1,reset:1,resize:1,scroll:1,select:1,submit:1,unload:1},V={scroll:1,resize:1,reset:1,submit:1,change:1,select:1,error:1,abort:1},R={KeyEvents:["bubbles","cancelable","view","ctrlKey","altKey","shiftKey","metaKey","keyCode","charCode"],MouseEvents:["bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget"],HTMLEvents:["bubbles","cancelable"],UIEvents:["bubbles","cancelable","view","detail"],Events:["bubbles","cancelable"]};baidu.object.extend(V,Q);baidu.object.extend(V,O);function M(B,D){var E=0,A=B.length,C={};for(;E<A;E++){C[B[E]]=D[B[E]];delete D[B[E]]}return C}function L(D,E,A){A=baidu.object.extend({},A);var C=baidu.object.values(M(R[E],A)),B=document.createEvent(E);C.unshift(D);if("KeyEvents"==E){B.initKeyEvent.apply(B,C)}else{if("MouseEvents"==E){B.initMouseEvent.apply(B,C)}else{if("UIEvents"==E){B.initUIEvent.apply(B,C)}else{B.initEvent.apply(B,C)}}}baidu.object.extend(B,A);return B}function N(A){var B;if(document.createEventObject){B=document.createEventObject();baidu.object.extend(B,A)}return B}function U(C,A){A=M(R.KeyEvents,A);var B;if(document.createEvent){try{B=L(C,"KeyEvents",A)}catch(D){try{B=L(C,"Events",A)}catch(E){B=L(C,"UIEvents",A)}}}else{A.keyCode=A.charCode>0?A.charCode:A.keyCode;B=N(A)}return B}function P(C,A){A=M(R.MouseEvents,A);var B;if(document.createEvent){B=L(C,"MouseEvents",A);if(A.relatedTarget&&!B.relatedTarget){if("mouseout"==C.toLowerCase()){B.toElement=A.relatedTarget}else{if("mouseover"==C.toLowerCase()){B.fromElement=A.relatedTarget}}}}else{A.button=A.button==0?1:A.button==1?4:baidu.lang.isNumber(A.button)?A.button:0;B=N(A)}return B}function S(D,A){A.bubbles=V.hasOwnProperty(D);A=M(R.HTMLEvents,A);var B;if(document.createEvent){try{B=L(D,"HTMLEvents",A)}catch(C){try{B=L(D,"UIEvents",A)}catch(E){B=L(D,"Events",A)}}}else{B=N(A)}return B}baidu.event.fire=function(D,C,A){var B;C=C.replace(/^on/i,"");D=baidu.dom._g(D);A=baidu.object.extend({bubbles:true,cancelable:true,view:window,detail:1,screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:false,altKey:false,shiftKey:false,metaKey:false,keyCode:0,charCode:0,button:0,relatedTarget:null},A);if(Q.hasOwnProperty(C)){B=U(C,A)}else{if(O.hasOwnProperty(C)){B=P(C,A)}else{if(T.hasOwnProperty(C)){B=S(C,A)}}}if(B){if(D.dispatchEvent){D.dispatchEvent(B)}else{if(D.fireEvent){D.fireEvent("on"+C,B)}}}}})();baidu.event.once=function(E,H,G){E=baidu.dom._g(E);function F(A){G.call(E,A);baidu.event.un(E,H,F)}baidu.event.on(E,H,F);return E};(function(){var E=/^\#[\da-f]{6}$/i,F=/^rgb\((\d+), (\d+), (\d+)\)$/,D={black:"#000000",silver:"#c0c0c0",gray:"#808080",white:"#ffffff",maroon:"#800000",red:"#ff0000",purple:"#800080",fuchsia:"#ff00ff",green:"#008000",lime:"#00ff00",olive:"#808000",yellow:"#ffff0",navy:"#000080",blue:"#0000ff",teal:"#008080",aqua:"#00ffff"};baidu.string.formatColor=function(K){if(E.test(K)){return K}else{if(F.test(K)){for(var A,B=1,K="#";B<4;B++){A=parseInt(RegExp["\x24"+B]).toString(16);K+=("00"+A).substr(A.length)}return K}else{if(/^\#[\da-f]{3}$/.test(K)){var C=K.charAt(1),J=K.charAt(2),L=K.charAt(3);return"#"+C+C+J+J+L+L}else{if(D[K]){return D[K]}}}}return""}})();baidu.ui=baidu.ui||{};baidu.ui.Base={id:"",getId:function(A){var C=this,B;B="tangram-"+C.uiType+"--"+(C.id?C.id:C.guid);return A?B+"-"+A:B},getClass:function(B){var D=this,C=D.classPrefix,A=D.skin;if(B){C+="-"+B;A+="-"+B}if(D.skin){C+=" "+A}return C},getMain:function(){return baidu.g(this.mainId)},getBody:function(){return baidu.g(this.getId())},uiType:"",addons:[],getCallRef:function(){return"window['$BAIDU$']._instances['"+this.guid+"']"},getCallString:function(D){var C=0,B=Array.prototype.slice.call(arguments,1),A=B.length;for(;C<A;C++){if(typeof B[C]=="string"){B[C]="'"+B[C]+"'"}}return this.getCallRef()+"."+D+"("+B.join(",")+");"},renderMain:function(B){var D=this,C=0,A;if(D.getMain()){return }B=baidu.g(B);if(!B){B=document.createElement("div");document.body.appendChild(B);B.style.position="absolute";B.className=D.getClass("main")}if(!B.id){B.id=D.getId("main")}D.mainId=B.id;B.setAttribute("data-guid",D.guid);return B},dispose:function(){this.dispatchEvent("dispose");baidu.lang.Class.prototype.dispose.call(this)}};baidu.ui.Base.getParent=function(){return this._parent||null};baidu.ui.Base.setParent=function(B){var C=this,A=C._parent;A&&A.dispatchEvent("removechild");if(B.dispatchEvent("appendchild",{child:C})){C._parent=B}};baidu.ui.create=function(F,A){var C=A.parent,B=A.element,E=A.autoRender;A.autoRender=A.parent=A.element=null;var D=new F(A);if(C&&D.setParent){D.setParent(C)}if(E&&D.render){D.render(B)}return D};baidu.ui.createUI=function(E,J){J=J||{};var H=J.superClass||baidu.lang.Class,A=H==baidu.lang.Class?1:0,F,D,I=function(C){var K=this;C=C||{};H.call(K,!A?C:(C.guid||""));baidu.object.extend(K,I.options);baidu.object.extend(K,C);K.classPrefix=K.classPrefix||"tangram-"+K.uiType.toLowerCase();for(F in baidu.ui.behavior){if(typeof K[F]!="undefined"){baidu.object.extend(K,baidu.ui.behavior[F]);baidu.ui.behavior[F].call(K)}}E.apply(K,arguments);for(F=0,D=I.addons.length;F<D;F++){I.addons[F](K)}},B=function(){};B.prototype=H.prototype;var G=I.prototype=new B();for(F in baidu.ui.Base){G[F]=baidu.ui.Base[F]}I.extend=function(K){for(F in K){I.prototype[F]=K[F]}var C=K.uiType,L=C?baidu.ui[C]:"";if(L){L.create=function(M){return baidu.ui.create(L[C.charAt(0).toUpperCase()+C.slice(1)],M)}}return I};I.addons=[];I.register=function(C){if(typeof C=="function"){I.addons.push(C)}};I.options={};return I};baidu.ui.behavior=baidu.ui.behavior||{};(function(){var A=baidu.ui.behavior.draggable=function(){this.addEventListener("onload",function(){var B=this;B.dragUpdate()});this.addEventListener("ondispose",function(){var B=this;baidu.un(B.dragHandler,"mousedown",B._dragFn);B.dragHandler=B._lastDragHandler=null})};A.dragUpdate=function(B){var C=this;B=B||{};if(!C.draggable){return }if(C.dragHandler!=C._lastDragHandler&&C._dragFn){baidu.event.un(C._lastDragHandler,"onmousedown",C._dragFn)}baidu.object.extend(C,B);C._dragOption={ondragstart:function(){C.dispatchEvent("ondragstart")},ondrag:function(){C.dispatchEvent("ondrag")},ondragend:function(){C.dispatchEvent("ondragend")},autoStop:true};C._dragOption.range=C.dragRange||[];C._dragOption.handler=C._lastDragHandler=C.dragHandler||C.getMain();if(C.dragHandler){baidu.event.on(C.dragHandler,"onmousedown",C._dragFn=function(){baidu.dom.drag(C.dragTarget||C.getMain(),C._dragOption)})}}})();var ace=baidu;ace.VERSION="%#VERSION#%";(function(){if(!ace||!ace.ui||ace.ui.Easing){return }var A={Linear:function(C,B,E,D){return E*C/D+B},Quad:{easeIn:function(C,B,E,D){return E*(C/=D)*C+B},easeOut:function(C,B,E,D){return -E*(C/=D)*(C-2)+B},easeInOut:function(C,B,E,D){if((C/=D/2)<1){return E/2*C*C+B}return -E/2*((--C)*(C-2)-1)+B}},Cubic:{easeIn:function(C,B,E,D){return E*(C/=D)*C*C+B},easeOut:function(C,B,E,D){return E*((C=C/D-1)*C*C+1)+B},easeInOut:function(C,B,E,D){if((C/=D/2)<1){return E/2*C*C*C+B}return E/2*((C-=2)*C*C+2)+B}},Quart:{easeIn:function(C,B,E,D){return E*(C/=D)*C*C*C+B},easeOut:function(C,B,E,D){return -E*((C=C/D-1)*C*C*C-1)+B},easeInOut:function(C,B,E,D){if((C/=D/2)<1){return E/2*C*C*C*C+B}return -E/2*((C-=2)*C*C*C-2)+B}},Quint:{easeIn:function(C,B,E,D){return E*(C/=D)*C*C*C*C+B},easeOut:function(C,B,E,D){return E*((C=C/D-1)*C*C*C*C+1)+B},easeInOut:function(C,B,E,D){if((C/=D/2)<1){return E/2*C*C*C*C*C+B}return E/2*((C-=2)*C*C*C*C+2)+B}},Sine:{easeIn:function(C,B,E,D){return -E*Math.cos(C/D*(Math.PI/2))+E+B},easeOut:function(C,B,E,D){return E*Math.sin(C/D*(Math.PI/2))+B},easeInOut:function(C,B,E,D){return -E/2*(Math.cos(Math.PI*C/D)-1)+B}},Expo:{easeIn:function(C,B,E,D){return(C==0)?B:E*Math.pow(2,10*(C/D-1))+B},easeOut:function(C,B,E,D){return(C==D)?B+E:E*(-Math.pow(2,-10*C/D)+1)+B},easeInOut:function(C,B,E,D){if(C==0){return B}if(C==D){return B+E}if((C/=D/2)<1){return E/2*Math.pow(2,10*(C-1))+B}return E/2*(-Math.pow(2,-10*--C)+2)+B}},Circ:{easeIn:function(C,B,E,D){return -E*(Math.sqrt(1-(C/=D)*C)-1)+B},easeOut:function(C,B,E,D){return E*Math.sqrt(1-(C=C/D-1)*C)+B},easeInOut:function(C,B,E,D){if((C/=D/2)<1){return -E/2*(Math.sqrt(1-C*C)-1)+B}return E/2*(Math.sqrt(1-(C-=2)*C)+1)+B}},Elastic:{easeIn:function(D,B,H,G,C,F){if(D==0){return B}if((D/=G)==1){return B+H}if(!F){F=G*0.3}if(!C||C<Math.abs(H)){C=H;var E=F/4}else{var E=F/(2*Math.PI)*Math.asin(H/C)}return -(C*Math.pow(2,10*(D-=1))*Math.sin((D*G-E)*(2*Math.PI)/F))+B},easeOut:function(D,B,H,G,C,F){if(D==0){return B}if((D/=G)==1){return B+H}if(!F){F=G*0.3}if(!C||C<Math.abs(H)){C=H;var E=F/4}else{var E=F/(2*Math.PI)*Math.asin(H/C)}return(C*Math.pow(2,-10*D)*Math.sin((D*G-E)*(2*Math.PI)/F)+H+B)},easeInOut:function(D,B,H,G,C,F){if(D==0){return B}if((D/=G/2)==2){return B+H}if(!F){F=G*(0.3*1.5)}if(!C||C<Math.abs(H)){C=H;var E=F/4}else{var E=F/(2*Math.PI)*Math.asin(H/C)}if(D<1){return -0.5*(C*Math.pow(2,10*(D-=1))*Math.sin((D*G-E)*(2*Math.PI)/F))+B}return C*Math.pow(2,-10*(D-=1))*Math.sin((D*G-E)*(2*Math.PI)/F)*0.5+H+B}},Back:{easeIn:function(C,B,F,E,D){if(D==undefined){D=1.70158}return F*(C/=E)*C*((D+1)*C-D)+B},easeOut:function(C,B,F,E,D){if(D==undefined){D=1.70158}return F*((C=C/E-1)*C*((D+1)*C+D)+1)+B},easeInOut:function(C,B,F,E,D){if(D==undefined){D=1.70158}if((C/=E/2)<1){return F/2*(C*C*(((D*=(1.525))+1)*C-D))+B}return F/2*((C-=2)*C*(((D*=(1.525))+1)*C+D)+2)+B}},Bounce:{easeIn:function(C,B,E,D){return E-A.Bounce.easeOut(D-C,0,E,D)+B},easeOut:function(C,B,E,D){if((C/=D)<(1/2.75)){return E*(7.5625*C*C)+B}else{if(C<(2/2.75)){return E*(7.5625*(C-=(1.5/2.75))*C+0.75)+B}else{if(C<(2.5/2.75)){return E*(7.5625*(C-=(2.25/2.75))*C+0.9375)+B}else{return E*(7.5625*(C-=(2.625/2.75))*C+0.984375)+B}}}},easeInOut:function(C,B,E,D){if(C<D/2){return A.Bounce.easeIn(C*2,0,E,D)*0.5+B}else{return A.Bounce.easeOut(C*2-D,0,E,D)*0.5+E*0.5+B}}}};ace.ui.Easing=A})();(function(){if(!ace||!ace.ui||ace.ui.Tween){return }var A=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame;var B=ace.lang.createClass(function(E,D,F,C,I,G,H){this._node=E;this._propertyName=D;this._startValue=F;this._endValue=C;this._easing=I||ace.ui.Easing.Linear;this._duration=G<0.01?0.01:G;this._callback=H;this._pixelDictionary=["width","height","left","top","right","bottom","padding","padding-left","padding-top","padding-bottom","padding-right","margin","margin-left","margin-top","margin-bottom","margin-right","font-size","background-position","line-height","border-width","border-left-width","border-top-width","border-right-width","border-bottom-width"];this._runInterval=null;this._timeLine=A?20:10;this._needPixel=[];this._isIE=ace.browser.ie;this._stopRequest=true;this._colorReg=/color|background-color|border-color/i;this._colorList=[];this._okList=[];if(this._checkParams()){this._run()}else{}}).extend({_checkParams:function(){var E=this._node!=null&&this._node.getAttribute!=null&&this._propertyName!=null;if(!E){return false}var D=(this._propertyName instanceof Array)&&(this._startValue instanceof Array)&&(this._endValue instanceof Array);if(!D){this._propertyName=[this._propertyName];this._startValue=[this._startValue];this._endValue=[this._endValue]}var J=false;var C=this._propertyName.length==this._startValue.length&&this._startValue.length==this._endValue.length;if(C){var H=false;for(var I=0,F=this._propertyName.length;I<F;I++){var K=this._checkValueParams(this._propertyName[I],this._startValue[I],this._endValue[I]);if(!K){H=true}this._needPixel[I]=this._getIndex(this._pixelDictionary,this._propertyName[I])!=-1;var G=this._colorReg.test(this._propertyName[I]);this._colorList[I]={isColor:G,startValue:G?this._getColor(this._startValue[I]):null,endValue:G?this._getColor(this._endValue[I]):null}}J=!H&&!isNaN(this._duration)}else{J=false}return J},_checkValueParams:function(F,E,C){var D=false;if(F.indexOf("color")!=-1){var G=/(^\s*)|(\s*$)/g;D=!!E&&E.replace(G,"")!=""&&!!C&&C.replace(G,"")!=""}else{D=!isNaN(E)&&!isNaN(C)}return D},_getIndex:function(C,E){for(var D=0;D<C.length;D++){if(C[D]==E){return D}}return -1},_getValue:function(D,C){return this._needPixel[C]?D+"px":D},_run:function(){A?this._startAnimationFrame():this._startNormalInterval()},_getColor:function(J){J=J.replace(/(^\s*)|(\s*$)/g,"");var H=/^\s*rgb\s*\(\s*\d{1,3}\s*\,\s*\d{1,3}\s*\,\s*\d{1,3}\s*\)\s*$/i;var F=/^\s*\#[a-zA-Z0-9]{3}\s*$/;var E=/^\s*\#[a-zA-Z0-9]{6}\s*$/;var D=[];if(H.test(J)){nStr=J.split("(")[1].split(")")[0].split(",");for(var G=0;G<nStr.length;G++){D.push(nStr[G]/1)}return D}if(E.test(J)){var C=J.replace("#","").match(/(\w|\d){2}/g);for(var G=0;G<C.length;G++){D.push(Number("0x"+C[G]).toString(10)/1)}return D}if(F.test(J)){var I=J.replace("#","").split("");for(var G=0;G<I.length;G++){D.push(Number("0x"+(I[G]+I[G])).toString(10)/1)}return D}return null},_rgbToColor:function(G,F,C){var E=G.toString(16);var D=F.toString(16);var H=F.toString(16);if(E.length<2){E="0"+E}if(D.length<2){D="0"+D}if(H.length<2){H="0"+H}return"#"+E+D+H},_startNormalInterval:function(){var C=this,D=0;this._runInterval=window.setInterval(function(){if(!C._node){C._stop();return }C._getSetValue(D,false);if(D>=C._duration*1000){window.clearInterval(C._runInterval);C._runInterval=null;C._getSetValue(null,true);C._callback&&C._callback();C._clear()}D+=C._timeLine},this._timeLine)},_startAnimationFrame:function(){this._stopRequest=false;var D=this,E=0;function C(){if(!D._node||D._stopRequest){D._stop();return }D._getSetValue(E,false);if(E>=D._duration*1000){D._getSetValue(null,true);D._callback&&D._callback();D._clear();return }E+=D._timeLine;A(C)}A(C)},_getSetValue:function(H,F){var R=this,Q=[];for(var M=0,E=R._propertyName.length;M<E;M++){var J;if(R._colorList[M].isColor){var C=R._colorList[M].startValue[0],I=R._colorList[M].startValue[1],G=R._colorList[M].startValue[2],D=R._colorList[M].endValue[0],N=R._colorList[M].endValue[1],L=R._colorList[M].endValue[2];var K,P,O;if(F){K=D;P=N;O=L}else{K=Math.ceil(R._easing(H,C,D-C,R._duration*1000));P=Math.ceil(R._easing(H,I,N-I,R._duration*1000));O=Math.ceil(R._easing(H,G,L-G,R._duration*1000))}J="rgb("+K+", "+P+", "+O+")"}else{if(F){J=R._endValue[M]}else{J=Math.ceil(R._easing(H,R._startValue[M],R._endValue[M]-R._startValue[M],R._duration*1000))}}Q.push({propertyName:R._propertyName[M],curValue:J,isColor:R._colorList[M].isColor})}R._setValue(Q)},_setValue:function(F){var E={},I=false;for(var H=0,C=F.length;H<C;H++){var D=F[H].propertyName,J=F[H].curValue,G=F[H].isColor;if(D=="opacity"){J=J/100}if(D=="scrollLeft"||D=="scrollTop"){this._node[D]=this._getValue(J,H)}else{E[D]=G?J:this._getValue(J,H);if(this._isIE&&D=="opacity"){E.filter="Alpha(opacity="+J*100+")"}I=true}}if(I){ace.setStyles(this._node,E)}},_stop:function(){this._stopRequest=true;if(this._runInterval){window.clearInterval(this._runInterval);this._runInterval=null}this._clear()},_clear:function(){this._node=null},clear:function(){this._clear()},stop:function(){this._stop()}});ace.ui.Tween=B})();return ace})();
View
509 shoelace/lib/core.js
@@ -0,0 +1,509 @@
+/**
+ * @author 王集鹄(wangjihu),李学健(lixuejian)
+ * @fileoverview 内核 注册模块、事件管理、类库引用
+ * @version 1.0.2
+ */
+/**
+ * 应用程序命名空间
+ * @class
+ * @static
+ */
+var application = application || {};
+/**
+ * 应用程序类命名空间
+ * @class
+ * @static
+ */
+application.Classes = application.Classes || {};
+/**
+ * 内核命名空间
+ * @class
+ * @static
+ */
+application.Core = (function(){
+
+ /**
+ * @static {Object} listeners 监听事件集合
+ * @static {Object} config 配置项
+ * @static {Object} loggers 日志记录
+ * @static {Object} eventCaches 事件缓存,在程序没有启动之前缓存notify触发的事件,程序启动之后触发
+ * @static {Object} lib 基础库,tangram(http://tangram.baidu.com/)
+ * @static {Boolean} active 程序是否启动
+ */
+ var listeners = {}, configs = {}, loggers = {}, eventCaches = [], lib = window.ace || window.baidu, active;
+
+ /**
+ * 空函数
+ */
+ function emptyFunction(){
+ }
+
+ /**
+ * 日志类
+ */
+ function Logger(id){
+ var self = this;
+ /**
+ * 输出格式化函数
+ * @param {String} msg 消息体
+ */
+ this.format = function(msg){
+ return format("(#{0}) #{1}", [self.id, msg]);
+ };
+ /**
+ * 日志级别
+ */
+ this.level = 0;
+ this.id = id;
+ }
+
+ /**
+ * 获取日志类
+ */
+ Logger.prototype._getLogger = function(){
+ return Logger
+ };
+
+ /**
+ * 设置日志级别
+ * @param {Integer} level 日志级别
+ */
+ Logger.prototype.setLevel = function(level){
+ this.level = level;
+ return this;
+ };
+
+ /**
+ * 日志级别 warn警告 fatal失效
+ */
+ Logger.LOG_LEVELS = ["debug", "log", "info", "warn", "error", "fatal", "logg", "reflect"];
+ var i = Logger.LOG_LEVELS.length;
+ while (i--) {
+ Logger.prototype[Logger.LOG_LEVELS[i]] = emptyFunction;
+ }
+
+ /**
+ * 日志记录
+ */
+ var logger = getLogger("Core");
+
+ /**
+ * 获取日志管理器
+ * @param {String} id 日志标识
+ */
+ function getLogger(id){
+ if (!loggers[id]) {
+ loggers[id] = new Logger();
+ }
+ return loggers[id];
+ }
+
+ /**
+ * 格式化函数
+ * @param {String} template 模板
+ * @param {Object} json 数据项
+ */
+ function format(template, json){
+ return template.replace(/#\{(.*?)\}/g, function(all, key){
+ return json && (key in json) ? json[key] : "";
+ });
+ }
+
+ /**
+ * 获取基类库
+ */
+ function getLib(){
+ return lib;
+ }
+
+ /**
+ * 沙盒集合
+ */
+ var sandboxs = {
+ /**
+ * 模块的沙箱
+ * @param {String} id 模块ID
+ */
+ "module": function(id){
+ return {
+ getReflect: function(obj){
+ if (!obj) { //invalid
+ logger.info('object is not valid.');
+ }
+ if(typeof(obj)=='string'){
+ logger.info(obj);
+ }
+ var c = '';
+ if (obj && obj.tagName != '' && !obj.target) { //dom
+ c = obj.innerHTML.replace(/>/gi, '>\n');
+ logger.info(c);
+ }
+ else {
+ for (var a in obj) { //json
+ c += a + ' ---------------------------------------------- ' + obj[a] + '\n';
+ };
+ logger.info(String(obj) + '\n' + c);
+ }
+ },
+ getLib: getLib,
+ getLogger: function(){
+ return getLogger(id);
+ },
+ getConfig: function(_id){
+ return getConfig(_id || id);
+ },
+ getExtension: getExtension,
+ on: on,
+ un: un,
+ notify: notify
+ }
+ },
+
+ /**
+ * 插件的沙箱
+ * @param {String} id 插件ID
+ */
+ "plugin": function(id){
+ return {
+ getLib: getLib,
+ getLogger: function(){
+ return getLogger(id);
+ },
+ getConfig: function(_id){
+ return getConfig(_id || id);
+ },
+ getExtension: getExtension
+ }
+ },
+
+ /**
+ * 扩展的沙箱
+ * @param {String} id 扩展ID
+ */
+ "extension": function(id){
+ return {
+ getLib: getLib,
+ getLogger: function(){
+ return getLogger(id);
+ },
+ getConfig: function(_id){
+ return getConfig(_id || id);
+ },
+ getExtension: getExtension
+ }
+ }
+ };
+
+ /**
+ * @static controls 元件集合
+ */
+ var controls = {
+ "module": {},
+ "plugin": {},
+ "extension": {}
+ };
+
+ /**
+ * 注册监听
+ * @param {String|Array} event 事件名
+ * @param {Function} handler 处理方法
+ */
+ function on(event, handler){
+
+ if (!event) {
+ logger.fatal("on(!, ?) 'event' Parameters can't for empty.");
+ return;
+ }
+
+ if (typeof handler != "function") {
+ logger.fatal(format("on('#{0}', !) 'handler' Parameters must be function types.", [event]));
+ return;
+ }
+
+ if (event instanceof Array) {
+ var i = event.length;
+ while (i--) {
+ on(event[i], handler);
+ }
+ return;
+ }
+
+ listeners[event] = listeners[event] || [];
+ listeners[event].unshift(handler); // 向前添加
+ }
+
+ /**
+ * 注销监听
+ * @param {String|Array} event
+ * @param {Object} handler
+ */
+ function un(event, handler){
+
+ if (!event) {
+ logger.fatal("un(!,?) 'event' Parameters can't for empty.");
+ return;
+ }
+
+ if (typeof handler != "function") {
+ logger.fatal(format("un('#{0}', !) 'handler' Parameters must be function types.", [event]));
+ return;
+ }
+
+ if (event instanceof Array) {
+ var i = event.length;
+ while (i--) {
+ un(event[i], handler);
+ }
+ return;
+ }
+
+ var listener = listeners[event], i;
+ if (!listener) return;
+ i = listener.length;
+ while (i--) {
+ if (listener[i] === handler) {
+ listener.splice(i, 1);
+ }
+ }
+ }
+
+ /**
+ * 触发事件
+ * @param {String} event 取消事件
+ * @param {Object} data 事件参数
+ */
+ function notify(event, data, synchronous){
+
+ if (!active) { // 程序未启动,先做缓存
+ eventCaches.push([event, data]);
+ return;
+ }
+
+ var listener = listeners[event], i;
+ if (!listener) return;
+
+ i = listener.length;
+ if(!synchronous)
+ while (i--) {
+ setTimeout((function(handler){ // 这里采用非堵塞方式,跳出堆栈
+ return function(){ // 使用闭包,避免嵌套调用使变量改变
+ try {
+ handler(data, event);
+ } catch (ex) {
+ logger.error(format("event:#{0} message:#{1}", [event, ex.message]));
+ }
+ };
+ })(listener[i]), 0);
+ }
+ else
+ while (i--) {
+ (function(handler){
+ return function(){ // 使用闭包,避免嵌套调用使变量改变
+ try {
+ handler(data, event);
+ } catch (ex) {
+ logger.error(format("event:#{0} message:#{1}", [event, ex.message]));
+ }
+ };
+ })(listener[i])();
+ }
+ }
+
+ /**
+ * 注册元件(模块|扩展|插件)
+ * @param {String} type 元件类型
+ * @param {String} id 标识
+ * @param {Function} creator 构造器
+ */
+ function register(type, id, creator){
+
+ if (!id) {
+ logger.fatal(format("register('#{0}', !, ?) 'id' Parameters must be exists.", [type]));
+ return;
+ }
+
+ if (typeof creator != 'function') {
+ logger.fatal(format("register('#{0}', '#{1}', !) 'creator' Parameters must be function types.", [type, id]));
+ return;
+ }
+
+ if (controls[type][id]) {
+ logger.fatal(format("register('#{0}', '#{1}', ?) #{0} '#{1}' was already exists.", [type, id]));
+ return;
+ }
+
+ logger.log(format("Register #{0} '#{1}'.", [type, id]));
+
+ return controls[type][id] = {
+ creator: creator,
+ instance: null
+ };
+ }
+
+ /**
+ * 启动元件
+ * @param {String} type 元件类型
+ * @param {String} id 模块标识
+ */
+ function start(type, id){
+ var data = controls[type][id];
+ if (!data || data.instance) return;
+ data.instance = data.creator(sandboxs[type](id));
+ if (data.instance.init) data.instance.init();
+ }
+
+ /**
+ * 停用元件
+ * @param {String} type 元件类型
+ * @param {String} id 模块标识
+ */
+ function stop(type, id){
+ var data = controls[type][id];
+ if (!data || !data.instance) return;
+ if (data.instance.destroy) data.instance.destroy();
+ data.instance = null;
+ }
+
+ /**
+ * 启用所有注册的元件
+ */
+ function startAll(){
+ if (active) {
+ logger.fatal('startAll() Program has begun.');
+ return;
+ }
+ var id, item;
+ for (id in controls["plugin"]) { // 先启动插件
+ start("plugin", id);
+ }
+ for (id in controls["module"]) { // 启动模块
+ start("module", id);
+ }
+ active = true;
+ notify("Core-StartAll", {});
+ while (item = eventCaches.shift()) { // 处理缓存的事件
+ notify(item[0], item[1]);
+ }
+ logger.info("Start all modules ... done!");
+ }
+
+ /**
+ * 获取扩展
+ * @param {String} id 扩展标识
+ */
+ function getExtension(id){
+ var extension = controls["extension"][id];
+ if (extension) {
+ return extension.instance;
+ }
+ logger.fatal(format("getExtension(!) Extension '#{0}' is missing.", [id]));
+ }
+
+ /**
+ * 获取模块的配置信息
+ * @param {String} id 模块标识
+ */
+ function getConfig(id){
+ var config = configs[id];
+ if (config) {
+ return config;
+ }
+ logger.warn(format("Config '#{0}' not found.", [id]));
+ }
+
+ /**
+ * 获取日志器
+ * @param {String} id 日志标识
+ */
+ function getLogger(id){
+ if (!loggers[id]) {
+ loggers[id] = new Logger(id);
+ }
+ return loggers[id];
+ }
+
+ // 内核启动
+ lib.on(window, 'load', function(){
+ /*debug start*/
+ var tpls = document.getElementsByTagName("tpl");
+ for (var i=0;i<tpls.length;i++){
+ var tpl = tpls[i];
+ var template;
+ var src = lib.dom.getAttr(tpl,"src");
+ if (src){
+ lib.ajax.request(src,{
+ async:false,
+ onsuccess:function(xhr,r){
+ template = r;
+ }
+ });
+ }
+ else{
+ template = tpl.innerHTML;
+ }
+ var script = document.createElement("script");
+ script.setAttribute("type","text/template");
+ script.id = tpl.id;
+ script.innerHTML = template;
+ lib.dom.insertAfter(script,tpl);
+ lib.dom.remove(tpl);
+ }
+ /*debug end*/
+ startAll();
+ });
+
+ return {
+ /**
+ * 注册模块
+ * @param {String} id 模块标识
+ * @param {Function} creator 构造器
+ */
+ registerModule: function(id, creator){
+ register("module", id, creator);
+ if (active) start("module", id);
+ },
+
+ /**
+ * 注册扩展
+ * @param {String} id 扩展标识
+ * @param {Function} creator 构造器
+ */
+ registerExtension: function(id, creator){
+ register("extension", id, creator);
+ start("extension", id); // 扩展立即启动
+ },
+
+ /**
+ * 注册模块
+ * @param {String} id 模块标识
+ * @param {Function} creator 构造器
+ */
+ registerPlugin: function(id, creator){
+ register("plugin", id, creator);
+ if (active) start("plugin", id);
+ },
+
+ /**
+ * 注册配置文件
+ * @param {String} id 配置文件标识,如果为空表示根级修改
+ * @param {Object} config 配置项
+ */
+ addConfig: function(id, config){
+ config = config || {};
+ var c, p;
+ if (id) {
+ if (configs[id]) { // 配置项已经存在
+ logger.warn(format("Config '#{0}' was already exists.", [id]));
+ }
+ c = configs[id] = configs[id] || {};
+ for (p in config) {
+ c[p] = config[p];
+ }
+ } else {
+ for (p in config) {
+ configs[p] = config[p];
+ }
+ }
+ }
+ };
+})();
View
920 shoelace/lib/extensions/extension-api-application-test.js
@@ -0,0 +1,920 @@
+/**
+ * @author ShiChunhua
+ */
+application.Core.registerExtension("ExApplicationAPI", function(sandbox) {
+ var uid = 0, lib = sandbox.getLib();
+
+ return {
+ /**
+ * 搜索安装的应用
+ * @param {Object} details
+ * @param {Object} callback
+ * http://fe.baidu.com/doc/a/boss/api/application.text#Search
+ */
+ search : function(query, callback) {
+ //bdbrowser.application.search(query, callback);
+ var list = [{
+ "id" : "1",
+ "name" : "百度一下",
+ "digest" : "百度是全球最大的中文搜索引擎。百度一下,你就知道",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/9718ed79b77e569fd5066013adb983ca.png",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://www.baidu.com"
+ }, {
+ "id" : "2",
+ "name" : "我的上网主页",
+ "digest" : "hao123网址之家——最专业权威的上网导航。及时收录包括音乐、视频、小说、游戏等热门分类的优秀网站,与搜索完美结合,提供最简单便捷的网上导航服务,是数千万网民的上网主页。精彩网络生活,从hao123开始。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/ee901031539644c59cfd5eb3f6467ff6.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://hao123.com"
+ }, {
+ "id" : "8",
+ "name" : "百度文库",
+ "digest" : "在线互动式文档分享平台,在这里,您可以和千万网友分享自己手中的文档,全文阅读其他用户的文档,同时,也可以利用分享文档获取的积分下载文档",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/201108181355320664.png",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://wenku.baidu.com"
+ }, {
+ "id" : "100050",
+ "name" : "PPTV直播",
+ "digest" : "PPTV网络电视是PPLive旗下媒体,一款全球安装量最大的网络电视,支持对海量高清影视内容的“直播+点播”功能。",
+ "image" : "http://apps.bdimg.com/store/static/kvt/66ba4e39ccda5d26955e627f9e3ca802.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=100050"
+ }, {
+ "id" : "100996",
+ "name" : "黄金矿工",
+ "digest" : "经典的黄金矿工小游戏。",
+ "image" : "http://apps.bdimg.com/store/static/kvt/0ac85eca2ab05a65952e7a13062b643e.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=100996"
+ }, {
+ "id" : "100998",
+ "name" : "合金弹头无敌版",
+ "digest" : "精彩的合金弹头游戏,让我们继续战斗!",
+ "image" : "http://apps.bdimg.com/store/static/kvt/5bc91cb5ad2729e5cd2b8c05ea2724e1.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=100998"
+ }, {
+ "id" : "101016",
+ "name" : "魂斗罗双打",
+ "digest" : "经典的魂斗罗游戏",
+ "image" : "http://apps.bdimg.com/store/static/kvt/4a5bd6644fb76418439118d4fe9e575b.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=101016"
+ }, {
+ "id" : "101138",
+ "name" : "姓名测试打分",
+ "digest" : "全面测试分析名字得出文化印象、五行、生肖、五格评分",
+ "image" : "http://apps.bdimg.com/store/static/kvt/c13580e8d9d9d9f590cc636e95fd94af.gif",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=101138"
+ }, {
+ "id" : "101283",
+ "name" : "身份证号码查询",
+ "digest" : "根据身份证号码查询所属的地区、出生日期、性别等资料",
+ "image" : "http://apps.bdimg.com/store/static/kvt/da21da795b6cd07ca9b63d96a4bf3706.gif",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=101283"
+ }, {
+ "id" : "101371",
+ "name" : "中国象棋",
+ "digest" : "中国象棋 小游戏,棋力不错哦,来挑战电脑吧",
+ "image" : "http://apps.bdimg.com/store/static/kvt/659bb56f3b719de7a47dd523941644e6.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=101371"
+ }, {
+ "id" : "101447",
+ "name" : "Fiano在线钢琴",
+ "digest" : "和idreampiano3.0兼容的在线钢琴",
+ "image" : "http://apps.bdimg.com/store/static/kvt/49ecfda8dd0433acb3625b5870886a96.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=101447"
+ }, {
+ "id" : "101689",
+ "name" : "QQ空间",
+ "digest" : "QQ空间(Qzone)是腾讯公司于2005年开发出来的一个个性空间,具有博客(blog)的功能,自问世以来受到众多人的喜爱。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/e28c9d7a38d9b795841e8e81b6bb93a8.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://qzone.qq.com"
+ }, {
+ "id" : "101690",
+ "name" : "hao123电视导航",
+ "digest" : "最新,最好看的高清电视剧排行榜。韩剧、偶像剧、香港TVB电视剧、日剧高清在线观看,尽在hao123电视剧排行榜。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/aa44298c172b2919a0131a63569a81a9.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://tv.hao123.com"
+ }, {
+ "id" : "101691",
+ "name" : "东方财富网",
+ "digest" : "东方财富网,中国最具影响力的互联网财经媒体,提供全方位的综合财经新闻和金融市场资讯,覆盖股票、财经、证券、金融、港股、行情、基金、债券、期货、外汇、保险、银行、博客、股吧、论坛",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/4c27660c7a49ac070107b21959aa1daf.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://eastmoney.com"
+ }, {
+ "id" : "101692",
+ "name" : "起点中文小说网",
+ "digest" : "小说阅读,精彩小说尽在起点小说。起点小说提供玄幻小说,武侠小说,原创小说,穿越小说,网游小说,都市小说,言情小说,历史小说,军事小说,网游小说,科幻小说,恐怖小说,首发小说最新章节免费小说阅读,精彩尽在起点小说!热门小说:斗破苍穹,天珠变,吞噬星空,异世药神,凡人修仙传。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/565fb30ffb26e7c6614009409bae0824.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://qidian.com"
+ }, {
+ "id" : "101693",
+ "name" : "人人网",
+ "digest" : "人人网校内是一个真实的社交网络,联络你和你周围的朋友。加入人人网校内你可以:联络朋友,了解他们的最新动态;和朋友分享相片、音乐和电影;找到老同学,结识新朋友;用照片和日志记录生活,展示自我。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/01d07f401ed956522198c9d9de32dec2.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://renren.com"
+ }, {
+ "id" : "101695",
+ "name" : "淘宝网",
+ "digest" : "淘宝网-亚洲最大、最安全的网上交易平台,提供各类服饰、美容、家居、数码、话费/点卡充值…8亿优质特价商品,同时提供担保交易(先收货后付款)、先行赔付、假一赔三、七天无理由退换货、数码免费维修等安全交易保障服务,让你全面安心享受网上购物乐趣!",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/b634a5fb6b3629f601fb9372b8fe486e.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://taobao.com"
+ }, {
+ "id" : "101696",
+ "name" : "天涯社区",
+ "digest" : "天涯社区,以“全球最具影响力的论坛”闻名于世,并提供博客、相册、个人空间等服务。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/07188f39930311386cedd16dad5ac9b0.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://tianya.cn"
+ }, {
+ "id" : "101697",
+ "name" : "4399小游戏",
+ "digest" : "4399是中国最大的小游戏专业网站,免费为你提供各种小游戏,包括双人小游戏,最新小游戏,动作小游戏,小游戏大全,冒险小游戏,过关游戏,赛尔号小游戏,地下城DNF游戏,赛车游戏,拳皇游戏,战斗机游戏等等。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/d1d5ed731f12d22cb9bf297b22ac86d4.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://4399.com"
+ }, {
+ "id" : "101699",
+ "name" : "一听音乐网",
+ "digest" : "一听音乐网是中国最大的在线音乐网站,提供免费歌曲在线试听、下载。一听音乐网拥有庞大、完整的曲库,歌曲更新迅速,试听流畅,口碑极佳。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/96ec5c60a01099a2d5ea4739ebca7f65.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://1ting.com"
+ }, {
+ "id" : "101700",
+ "name" : "优酷",
+ "digest" : "优酷-中国第一视频网站,提供视频播放,视频发布,视频搜索-视频服务平台,提供视频播放,视频发布,视频搜索,视频分享-优酷视频。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/8a9446f8dd0934f7aa3195444d065812.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://www.youku.com"
+ }, {
+ "id" : "101701",
+ "name" : "新浪微博",
+ "digest" : "新浪微博是一个由新浪网推出,提供微型博客服务的类Twitter网站。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/8fbd3faf3d7cc79adccf266502819263.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://weibo.com"
+ }, {
+ "id" : "101705",
+ "name" : "奇艺高清影视",
+ "digest" : "“奇艺高清影视”是百度旗下视频网站“奇艺”(www.qiyi.com) 提供的一款免费高清视频在线观看应用。内容丰富多元,节目持续更新,内容播放清晰流畅,操作界面简单友好,真正为用户带来“悦享品质”的观映体验。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/201108121634430428.png",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://www.qiyi.com/mini/baidu.html"
+ }, {
+ "id" : "101707",
+ "name" : "58同城",
+ "digest" : "58同城北京分类信息网,为你提供房产、车辆、招工、兼职、黄页等海量北京分类信息,满足您不同的北京免费发布信息需求。北京58同城,最好的北京分类信息网。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/218b0f755b7dc3170198f21a5ece0866.png",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://58.com"
+ }, {
+ "id" : "101710",
+ "name" : "新华网",
+ "digest" : "新华网由中华人民共和国官方通讯社新华社主办,为中国最重要的官方网站之一。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/3458fa0cd2f16d8842b4258cd91b00b1.png",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xinhuanet.com"
+ }, {
+ "id" : "101718",
+ "name" : "联合早报网",
+ "digest" : "联合早报网是海外最重要的权威新闻网站,以第三只眼看大中华,客观新闻和深度评析是众多亚太区读者的最爱。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/default_app_icon.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://zaobao.com"
+ }, {
+ "id" : "101734",
+ "name" : "网易新闻",
+ "digest" : "新闻,新闻中心,包含有时政新闻,国内新闻,国际新闻,社会新闻,时事评论,新闻图片,新闻专题,新闻论坛,军事,历史,的专业时事报道门户网站。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/c217f285eb067061e31b6769db7672f4.png",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://news.163.com"
+ }, {
+ "id" : "101735",
+ "name" : "凤凰资讯",
+ "digest" : "凤凰网资讯、凤凰网新闻24小时提供大陆、台湾、香港、国际重大新闻资讯,每天发布财经、房产、汽车、军事、历史、文化、教育、娱乐、时尚、亲子等数万条新闻。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/c23cb91e28540bf120c96780829055cc.png",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://news.ifeng.com"
+ }, {
+ "id" : "101736",
+ "name" : "新浪新闻",
+ "digest" : "新浪网新闻中心是新浪网最重要的频道之一,24小时滚动报道国内、国际及社会新闻。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/xinlangxinwen.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://news.sina.com.cn"
+ }, {
+ "id" : "101737",
+ "name" : "搜狐新闻",
+ "digest" : "搜狐,中国最大的门户网站,是中国一家领先的门户网站,搜狐新闻已成为主流人群获取资讯的最大的平台。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/201108091046200135.png",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://news.sohu.com"
+ }, {
+ "id" : "101755",
+ "name" : "开心网",
+ "digest" : "开心网是一个在线社区,通过它您可以与朋友、同学、同事、家人保持更紧密的联系,及时了解他们的动态;与他们分享你的照片、心情、快乐。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/9d4d7b96c5e975714bd57f88712f8883.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://kaixin001.com"
+ }, {
+ "id" : "101762",
+ "name" : "腾讯微博",
+ "digest" : "腾讯微博是一个由腾讯推出,提供微型博客服务的类Twitter网站。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/d755e8b0877e9426e7a1d6f4b2ce38d8.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://t.qq.com"
+ }, {
+ "id" : "101773",
+ "name" : "西祠胡同",
+ "digest" : "西祠胡同始建于1998年,是华语地区第一个大型综合社区网站,经多年积累和发展,西祠已成为最重要的华人社区门户网站。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/201108221711300585.png",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xici.net"
+ }, {
+ "id" : "101779",
+ "name" : "豆瓣",
+ "digest" : "提供图书、电影、音乐唱片的推荐、评论和价格比较,以及城市独特的文化生活。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/201108181703330811.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://douban.com"
+ }, {
+ "id" : "101791",
+ "name" : "百度MP3",
+ "digest" : "在百度MP3,您可以便捷地找到最新、最热的歌曲,更有丰富、权威的音乐排行榜,指引华语音乐的流行方向。音乐掌门人是强大的音乐分享平台,用户可以发布个性专辑,分享音乐体验。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/201107191701090058.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://mp3.baidu.com"
+ }, {
+ "id" : "101798",
+ "name" : "音悦台",
+ "digest" : "音悦台是国内最大的高清MV音乐分享平台,也是国内最大的音乐MV视频媒体平台;提供最新、最快、最高清的MV视频资讯,并提供不同格式的高清MV下载,只为让好歌与你随身而行。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/c88c00b289ff14ebbaa8ee3baf84c3b3.png",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://yinyuetai.com"
+ }, {
+ "id" : "101808",
+ "name" : "土豆网",
+ "digest" : "土豆网是你会喜欢的个人视频网站,免费无限空间,上传你的视频,观看和搜索海量视频节目,收藏你喜欢的视频,订阅你关注的播客,简单方便地分享给你的朋友们。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/59fe03504516bcc90ed2ca5106dc2375.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://tudou.com"
+ }, {
+ "id" : "101809",
+ "name" : "酷6网",
+ "digest" : "酷6网是国内最大的视频分享网站,也是中国最大的视频媒体平台,免费提供视频播客、视频分享、视频搜索等服务,可在线观看最新、最热的视频,凭借内容最全、速度最快、视觉最好三大特色,在国内网络视频领域独树一帜。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/03f06bdedeb28fa4701c31411e1ed99d.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://ku6.com"
+ }, {
+ "id" : "101810",
+ "name" : "迅雷看看",
+ "digest" : "中国第一高清影视视频门户,提供电影、电视剧、综艺、动漫、新片、大片免费超清在线点播、下载,中国最大最全的正版影视发行平台。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/ff80e56e5eaf564ee089d2e53b1d1830.png",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xunlei.com"
+ }, {
+ "id" : "101811",
+ "name" : "56我乐",
+ "digest" : "56.com拥有数量巨大的原创视频库、及完整影视库,从观看视频、上传视频、到分享视频都拥有极佳的用户体验。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/ac631771572fb418312ba7a0e5aa9d4a.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://56.com"
+ }, {
+ "id" : "101812",
+ "name" : "中国网络电视台",
+ "digest" : "中国网络电视台(英文简称CNTV),是中国国家网络电视播出机构,是以视听互动为核心、融网络特色与电视特色于一体的全球化、多语种、多终端的公共服务平台。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/9b3635fab755eb914a7b70659d1b61f8.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://cntv.cn"
+ }, {
+ "id" : "101859",
+ "name" : "携程旅行网",
+ "digest" : "携程旅行网是中国领先的在线旅行服务公司,向超过1400万会员提供集酒店预订、机票预订、度假预订、商旅管理、特惠商户及旅游资讯在内的全方位旅行服务。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/5546f56f131e75da4469b4038f4db9c3.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://ctrip.com"
+ }, {
+ "id" : "101860",
+ "name" : "去哪儿旅游搜索",
+ "digest" : "去哪儿(Qunar.com)提供机票,特价机票,打折机票的购买全攻略,99元春秋航空特惠折扣机票,百元南航、海航惊喜特价机票任您挑选,国航、深航1折特价机票和折扣机票一网打尽,更多打折机票尽在Qunar.com。同时搜索携程,艺龙等上百家旅游预订网站机票报价和航空公司直销机票价格,为您找到最实惠的特价机票信息,是你找到特价机票和机票预定的最佳途径,45天机票价格趋势图和特价机票邮件预约是您出行好助手",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/d94083f7ee28e50a074fdbc45bd5fc7c.png",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://qunar.com"
+ }, {
+ "id" : "101870",
+ "name" : "搜房房地产",
+ "digest" : "搜房房地产网是中国最大的房地产家居网络平台,提供全面及时的房地产新闻资讯内容,为所有楼盘提供网上浏览、业主论坛和社区网站,房地产精英人物个人主页,是国内房地产媒体及业内外网友公认的全球最大的房地产网络平台,搜房引擎给网友提供房地产网站中速度快捷内容全面的智能搜索。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/7a29bf4dd3545ee9d76e54acd7f79b55.png",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://soufun.com"
+ }, {
+ "id" : "101872",
+ "name" : "赶集网",
+ "digest" : "赶集网是中国最大最全的分类信息网站,提供免费发布信息,查阅信息服务。寻找最新最全的房屋出租、二手房、二手车、二手物品交易、求职招聘等生活信息,请到赶集网ganji.com",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/default_app_icon.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://ganji.com"
+ }, {
+ "id" : "101877",
+ "name" : "汽车之家",
+ "digest" : "汽车之家为您提供最新汽车报价,汽车图片,汽车价格大全,最精彩的汽车新闻、行情、评测、导购内容,是提供信息最快最全的中国汽车网站。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/6fa6c81295937f7a7078ddeee4bd5c2a.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://autohome.com.cn"
+ }, {
+ "id" : "101885",
+ "name" : "驾校一点通",
+ "digest" : "驾校一点通官方网站:全国驾校查询,直观对比驾校的服务、学车价格,位置等。驾校一点通还提供汽车陪练、驾校一点通模拟考试,驾驶员模拟考试,学车视频等。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/fbc83679ce2795293a7efd6665ad60a8.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://jxedt.com"
+ }, {
+ "id" : "101919",
+ "name" : "美食天下",
+ "digest" : "美食天下,美食中国,中国美食门户,家常菜谱美食博客最具人气美食网站",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/4e7e751a0dde56df939349793d38546f.png",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://meishichina.com"
+ }, {
+ "id" : "101924",
+ "name" : "大众点评网",
+ "digest" : "中国城市消费指南餐馆美食、购物、休闲娱乐、生活服务、活动优惠打折信息。大众点评网是中国第一家也是领先的web2.0式的本地搜索门户。商户的信息和评价全部由会员共同管理和维护。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/2dfce9cd191df068348fadb2e72b4943.png",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://dianping.com"
+ }, {
+ "id" : "101972",
+ "name" : "当当网",
+ "digest" : "全球领先的综合性网上购物中心。超过100万种商品在线热销!图书、音像、母婴、美妆、家居、数码3C、服装、鞋包等几十大类,正品行货",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/79d8b66ef52446f2337e97c2d15873e9.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://dangdang.com"
+ }, {
+ "id" : "101973",
+ "name" : "京东网上商城",
+ "digest" : "京东商城-专业的数码网上购物商城,产品包括数码、家电、手机、电脑配件、网络产品等数万种商品直销,便捷,诚信的服务,为您提供愉悦的网上商城购物体验!",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/dc33eb3e23ea3ab9a78818e9aa2b146e.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://360buy.com"
+ }, {
+ "id" : "101974",
+ "name" : "卓越亚马逊",
+ "digest" : "中国最大最全的网上综合商城,卓越亚马逊,天天低价,正品保证,货到付款,免运费.销售150多万种图书,音像产品,以及28大类超过100万种百货类商品,包括IT数码、手机、家电、鞋靴服装、个护化妆、玩具、钟表首饰、家居、母婴、食品、办公用品等。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/e50f77c343f8672db0dcff3e3f2052f8.png",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://amazon.cn"
+ }, {
+ "id" : "101976",
+ "name" : "VANCL凡客诚品",
+ "digest" : "VANCL凡客诚品,互联网快时尚品牌。根植互联网,全球时尚潮流,国际一线品质,平民价位。在线销售男装、女装、童装、鞋、家居、配饰等。送货上门、货到付款,无条件退换货。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/201108181702210540.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://vancl.com"
+ }, {
+ "id" : "101977",
+ "name" : "乐淘网上鞋城",
+ "digest" : "乐淘是中国最大的网上正品鞋城,目前鞋子有超过105个著名品牌,10171多款运动鞋、皮鞋。天天有特价,全场免运费,退换货免运费,24小时在线客服,让您放心买到便宜鞋子!",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/201108111445020003.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://letao.com"
+ }, {
+ "id" : "101978",
+ "name" : "1号店",
+ "digest" : "1号店网上超市(yihaodian.com):用鼠标逛超市,不用排队,方便实惠送上门,网上购物新生活。www.yihaodian.com",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/default_app_icon.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://yihaodian.com"
+ }, {
+ "id" : "101983",
+ "name" : "拉手网",
+ "digest" : "拉手网北京站-北京超人气团购网站。北京团购北京团购北京团购网,为您精选北京的餐厅、酒吧、KTV、SPA、美发店、摄影、瑜伽馆等特色商家,享受超低折扣,比优惠更优惠。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/d385454a56a61818d1bdc47296b9d868.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://lashou.com"
+ }, {
+ "id" : "101993",
+ "name" : "聚美优品",
+ "digest" : "聚美优品(原团美网)是中国最大的女性团购网站,也是最专业的化妆品团购和护肤品团购网站。聚美优品给您每天带来超值的化妆品和护肤品,并且保证正品、假一赔三、三十天无条件退货。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/default_app_icon.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://jumei.com"
+ }, {
+ "id" : "102005",
+ "name" : "55BBS",
+ "digest" : "55BBS--生活消费门户我爱打折55bbs,最具人气的生活消费信息分享社区,拥有购物、美食、女人、婚嫁等一切与生活消费相关的优惠折扣资讯及详尽即时的消费体验",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/eef80d0b8042da1747ceadd9ef9e50ef.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://55bbs.com"
+ }, {
+ "id" : "102016",
+ "name" : "小说阅读网",
+ "digest" : "《小说阅读网》提供原创穿越小说、言情小说、青春校园小说、玄幻武侠、灵异推理、历史军事、游戏竞技等小说在线阅读和小说下载。页面简洁,无眩杂广告。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/666821e4659814f8cd2ead910eb762b4.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://readnovel.com"
+ }, {
+ "id" : "102019",
+ "name" : "纵横中文网",
+ "digest" : "纵横中文网是北京完美时空旗下文学网站,拥有纵横中文、纵横动漫等优质品牌资源。纵横中文网提供玄幻奇幻小说,武侠小说,网游小说,都市言情小说,历史军事小说在线阅读,首发最新章节。我们坚决抵制成人小说、情色小说、黄色小说等成人文学和色情小说。纵横动漫是中国最好的原创漫画平台,致力于激励中国原创漫画,为中国漫画读者、作者提供优质的漫画内容、和更广阔的机遇及展现空间,我们坚决抵制色情动漫,黄色动漫",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/default_app_icon.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://zongheng.com"
+ }, {
+ "id" : "102110",
+ "name" : "世纪佳缘交友",
+ "digest" : "爱情不能靠等待,婚姻不能靠凑合!上世纪佳缘交友网邂逅只属于您的那份爱!现在搜索会员让您轻松找到满意的婚恋对象",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/2260a8d79dbfe3179cf8e350b5546852.png",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://jiayuan.com"
+ }, {
+ "id" : "102138",
+ "name" : "hao123电影导航",
+ "digest" : "最新,最好看的高清电影排行榜,高清电影在线观看,尽在hao123电影排行榜。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/039ac0b98040c88183e86ee628596f55.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://movie.hao123.com/"
+ }, {
+ "id" : "102141",
+ "name" : "百度团购",
+ "digest" : "全国团购网址导航大全,汇聚北京、上海、广州、天津、杭州等各地城市的精品团购,包括拉手、美团、糯米、QQ团购等多个大型知名团购网站。每天关注一下,惊喜不断,实惠连连。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/0b01758cfeff122796901cb35a9c96be.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://tuan.baidu.com"
+ }, {
+ "id" : "102143",
+ "name" : "豆瓣FM",
+ "digest" : "豆瓣FM是你专属的个性化音乐收听工具。 它简单方便,打开就能收听。在收听过程中,你可以用“红心”、“垃圾桶”或者“跳过” 告诉豆瓣FM你的喜好。豆瓣FM将根据你的操作和反馈,从海量曲库中自动发现并播出符合你音乐口味的歌曲。 豆瓣FM,让你和喜欢的音乐不期而遇。",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/e89b0d8205b7f6f2e1092ca094dc6e3f.png",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://douban.fm"
+ }, {
+ "id" : "102150",
+ "name" : "经典超级玛丽",
+ "digest" : "经典超级玛丽!不用多说了,快來回味经典吧!",
+ "image" : "http://apps.bdimg.com/store/static/kvt/5ee1a2e79752daeb15822368a08bc038.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=104316"
+ }, {
+ "id" : "102153",
+ "name" : "飞天忍者猫",
+ "digest" : "联众flash小游戏",
+ "image" : "http://apps.bdimg.com/store/static/kvt/4da8a25a448b8a7d518613168f1d057e.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=104217"
+ }, {
+ "id" : "102157",
+ "name" : "水果连连看",
+ "digest" : "连连看系列中的精品,一起来玩4399水果连连看吧",
+ "image" : "http://apps.bdimg.com/store/static/kvt/6256d93ba248e77a50a90b1ac2faf487.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=100909"
+ }, {
+ "id" : "102252",
+ "name" : "大鱼吃小鱼2中文版",
+ "digest" : "大鱼吃小鱼2中文版一款经典的小游戏",
+ "image" : "http://apps.bdimg.com/store/static/kvt/8cec6a2dcfc78d843237a92dd9de97ee.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=113108"
+ }, {
+ "id" : "102356",
+ "name" : "海绵宝宝赛车",
+ "digest" : "海绵宝宝赛车小游戏",
+ "image" : "http://apps.bdimg.com/store/static/kvt/62ff4c3e13d50ddddc5fa430af2a2242.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=103587"
+ }, {
+ "id" : "106886",
+ "name" : "JJ斗地主",
+ "digest" : "JJ斗地主-最专业的棋牌比赛平台-超快赛体验",
+ "image" : "http://apps.bdimg.com/store/static/kvt/0fe569e2e2a26b3bb7f1973499f1202b.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=101612"
+ }, {
+ "id" : "106887",
+ "name" : "弹弹堂",
+ "digest" : "一款无需下载的Q版射击类竞技网页游戏",
+ "image" : "http://apps.bdimg.com/store/static/kvt/7f097ff684c3db471ccdc808590f0b5b.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=100007"
+ }, {
+ "id" : "106892",
+ "name" : "联众麻将",
+ "digest" : "联众世界,网络棋牌文化发源地",
+ "image" : "http://apps.bdimg.com/store/static/kvt/9a29ca865ee8f31f9079265e3f739267.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=104307"
+ }, {
+ "id" : "107388",
+ "name" : "酷我电台",
+ "digest" : "还在为找歌烦恼?想听好歌?打开酷我电台,立即拥有。",
+ "image" : "http://apps.bdimg.com/store/static/kvt/ec5b2e0d3710b1415645cd0d0ffb9a21.gif",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=105493"
+ }, {
+ "id" : "107397",
+ "name" : "经典老歌",
+ "digest" : "经典老歌电台",
+ "image" : "http://apps.bdimg.com/store/static/kvt/a0940fd93f3528e01162c568167c7694.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=127680"
+ }, {
+ "id" : "107400",
+ "name" : "dj舞曲",
+ "digest" : "dj舞曲电台",
+ "image" : "http://apps.bdimg.com/store/static/kvt/5ea4edc1c9c4350ea8441999391e445e.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=127672"
+ }, {
+ "id" : "107581",
+ "name" : "微软必应词典",
+ "digest" : "具备词条对比、长句翻译、视频朗读、智能建议等功能。",
+ "image" : "http://apps.bdimg.com/store/static/kvt/fdcd91159ce71f5cbbddaa14d1e85d1e.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=108646"
+ }, {
+ "id" : "107582",
+ "name" : "礼拜六万年历",
+ "digest" : "提供阴阳历、节日节气、黄道吉日、放假安排等信息。",
+ "image" : "http://apps.bdimg.com/store/static/kvt/d5af27925aa84c113aff2ecf553098d1.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=104736"
+ }, {
+ "id" : "107583",
+ "name" : "快递查询",
+ "digest" : "提供一站式的快递查询,和免费快递查询接口(API)",
+ "image" : "http://apps.bdimg.com/store/static/kvt/6fa4c5027ce68db227e960a2ea73d427.gif",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=101074"
+ }, {
+ "id" : "107584",
+ "name" : "微博在线群发",
+ "digest" : "这是一个由百度官方提供的方便实用的群发微博应用",
+ "image" : "http://apps.bdimg.com/store/static/kvt/e853f38855d5b3acab9043869bcd7602.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=109681"
+ }, {
+ "id" : "107585",
+ "name" : "科学计算器",
+ "digest" : "操作便捷,运算准确的科学计算器,满足不同的计算需求",
+ "image" : "http://apps.bdimg.com/store/static/kvt/cc8da1caf6a986125bae44613bfb2d2d.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=116526"
+ }, {
+ "id" : "107872",
+ "name" : "qq个性网名",
+ "digest" : "精彩个性的网名,展现个性的你!欢迎投稿",
+ "image" : "http://apps.bdimg.com/store/static/kvt/0d3835f755cc3263d6c8b7bcc1f7aa85.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=116325"
+ }, {
+ "id" : "107874",
+ "name" : "火星文输入法",
+ "digest" : "火星文转换器提供火星文、繁体字等即时转换。",
+ "image" : "http://apps.bdimg.com/store/static/kvt/4daff405b61b6b33215285f2c76173c2.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=105535"
+ }, {
+ "id" : "107981",
+ "name" : "个性签名",
+ "digest" : "最给力最流行的QQ个性签名以及情侣、伤感等各类签名",
+ "image" : "http://apps.bdimg.com/store/static/kvt/79097c762db2c5eb03866e4798e02d9d.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=111575"
+ }, {
+ "id" : "108540",
+ "name" : "永生",
+ "digest" : "梦入神机继《阳神》之后,又一震撼力作。",
+ "image" : "http://apps.bdimg.com/store/static/kvt/eddf33eb5b5a1188406ab8a576bcf808.gif",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=101893"
+ }, {
+ "id" : "108542",
+ "name" : "天才医生",
+ "digest" : "纵横中文网都市娱乐小说",
+ "image" : "http://apps.bdimg.com/store/static/kvt/1954ac6a5d39a03793ee7f7a974c3086.gif",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=105329"
+ }, {
+ "id" : "109193",
+ "name" : "创业邦",
+ "digest" : "创业邦",
+ "image" : "http://apps.bdimg.com/store/static/kvt/72874d54b1541905dfdc5c33f2b57955.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=109379"
+ }, {
+ "id" : "109209",
+ "name" : "家饰",
+ "digest" : "点击“全屏阅读原版杂志”后,即可全屏浏览杂志",
+ "image" : "http://apps.bdimg.com/store/static/kvt/61f02b0c91194ab57c7e3b15bc7012db.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=105371"
+ }, {
+ "id" : "114755",
+ "name" : "百度有啊票务",
+ "digest" : "全国最大票务平台!提供众多大型独家活动演出门票!",
+ "image" : "http://apps.bdimg.com/store/static/kvt/c022d9ced6e392e14fc744c49b6cb078.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://xapp.baidu.com/bapps/sandbox/app.html?appid=104548"
+ }, {
+ "id" : "121590",
+ "name" : "太平洋电脑网",
+ "digest" : "国内首家以专业电脑市场联盟为基础的大型IT资讯网站,为国内IT企业与终端用户提供全面、权威、专业的IT资讯服务",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/201109080959410879.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://www.pconline.com.cn/"
+ }, {
+ "id" : "121591",
+ "name" : "猫扑",
+ "digest" : "猫扑网是中国互联网流行文化发源地,以猫扑大杂烩、猫扑贴贴等互动产品为核心",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/201109081001090065.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://www.mop.com/"
+ }, {
+ "id" : "121592",
+ "name" : "ting!",
+ "digest" : "全正版音乐资源、简单流畅的听歌体验、懂你的音乐推荐、炙手可热的音乐人、志同道合的音乐知己,尽在全新的社交音乐媒体ting!",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/201109081002500340.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://ting.baidu.com/"
+ }, {
+ "id" : "121593",
+ "name" : "中国广播网在线收听",
+ "digest" : "一网听天下,全国电台在线收听",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/201109081004030512.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://live.cnr.cn/"
+ }, {
+ "id" : "121594",
+ "name" : "金鹰网",
+ "digest" : "湖南卫视新媒体金鹰网作为湖南卫视官方网站,向网民提供独家的湖南卫视视频点播(电视剧、栏目视频),湖南卫视频道直播,栏目资讯,娱乐资讯,明星访谈等服务",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/201109081005230691.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://www.hunantv.com/"
+ }, {
+ "id" : "121595",
+ "name" : "米尔军情网",
+ "digest" : "米尔网是中国军事、军事新闻、军事图片门户网站,关注军事、中国航母、歼20,提供军事信息、军事论坛、军事模型服务",
+ "image" : "http://xapp.baidu.com/browsericon/xstart_browser/upload/img_new/201109081007390439.jpg",
+ "type" : "web",
+ "message" : 0,
+ "href" : "http://www.junshijia.com/"
+ }, {
+ "id" : "-1000",
+ "name" : "浏览器宝库",
+ "digest" : "百度浏览器应用商店。",
+ "image" : "http://liulanqi.baidu.com/wallpaperM1/icon/llqbk.png",
+ "type" : "web",
+ "message" : 0,
+ "href" : "bdbrowser://store",
+ "ext" : {
+ "manifest" : {
+ "removable" : false
+ }
+ }
+ }, {
+ "id" : "-1002",
+ "name" : "应用快递",
+ "digest" : "百度浏览器精选应用。",
+ "image" : "http://liulanqi.baidu.com/wallpaperM1/icon/competitiveAppIcon.png",
+ "type" : "web",
+ "message" : 0,
+ "href" : "",
+ "ext" : {
+ "manifest" : {
+ "removable" : false,
+ "onlyDock" : true,
+ "sendHandler" : "openCompetitive",
+ "contextMenu" : false,
+ "draggable" : false
+ }
+ }
+ }];
+ callback && callback(list);
+ },
+ /**
+ * 通过一个id获得一个应用信息
+ * @param {Object} details
+ * @param {Object} callback
+ */
+ getAppById: function() {
+ return {};
+ },
+ /**
+ * 添加一个应用
+ * @param {ApplicationItem} details
+ * @param {Function} callback
+ * http://fe.baidu.com/doc/a/boss/api/application.text#Create
+ */
+ create : function(details, callback) {
+ //bdbrowser.application.create(details, callback);
+ },
+ /**
+ * 更新一个应用
+ * @param {ApplicationItem} details
+ * @param {Function} callback
+ * http://fe.baidu.com/doc/a/boss/api/application.text#Create
+ */
+ update : function(details, callback) {
+ //bdbrowser.application.create(details, callback);
+ },
+ /**
+ * 移除一个应用
+ * @param {Object} details
+ * @param {Object} callback
+ * http:http://fe.baidu.com/doc/a/boss/api/application.text#Remove
+ */
+ remove : function(details, callback) {
+ //bdbrowser.application.remove(details, callback);
+ },
+ /**
+ * 调用添加收藏的对话框
+ * @param {Object} details
+ * @param {Object} callback
+ * http://fe.baidu.com/doc/a/boss/api/application.text#search
+ */
+ checkInstalled : function(details, callback) {
+ //bdbrowser.application.checkInstalled(details, callback);
+ callback && callback();
+ },
+ /**
+ * 添加应用和删除应用时触发事件
+ */
+ addListener : function(event, callback) {
+ switch (String(event).toLocaleLowerCase()) {
+ case "created":
+ //bdbrowser.application.onCreated.addListener(callback);
+ break;
+ case "removed":
+ //bdbrowser.application.onRemoved.addListener(callback);
+ break;
+ case "opened":
+ //bdbrowser.application.onOpen.addListener(callback);
+ break;
+ case "closed":
+ //bdbrowser.application.onClose.addListener(callback);
+ break;
+ case "sync":
+ //bdbrowser.application.onSync.addListener(callback);
+ break;
+ case "flushapp":
+ //bdbrowser.application.onFlushApp.addListener(callback);
+ break;
+ }
+ },
+ /**
+ * 在新TAB或新窗口中打开页面
+ * @param {Object} info
+ * @param {Function} callback
+ */
+ openPage : function(info, callback) {
+ //bdbrowser.global.openPage(info, callback);
+ window.open(info.url);
+ },
+ /**
+ * 打开应用
+ * @param {Object} info
+ * @param {Function} callback
+ * http://fe.baidu.com/doc/a/boss/api/application.text#openApp
+ */
+ openApp : function(info, callback) {
+ //bdbrowser.application.openApp(info, callback);
+ window.open(info.appInfo.href);
+ },
+ /**
+ * 关闭应用
+ * @param {Object} info
+ * @param {Function} callback
+ * http://fe.baidu.com/doc/a/boss/api/application.text#closeApp
+ */
+ closeApp : function(info, callback) {
+ //bdbrowser.application.closeApp(info, callback);
+ },
+ /**
+ * 聚焦桌面选项卡(tab)
+ */
+ openAppPage : function(callback) {
+ //bdbrowser.global.openAppPage(callback);
+ callback && callback();
+ },
+ /**
+ * 数据统计
+ * @param {Object} params
+ * @param {Object} callback
+ */
+ report : function(params, callback) {
+ //bdbrowser.global.report(params, callback);
+ callback && callback();
+ },
+
+ getSyncInfo: function(params, callback){
+ callback && callback();
+ }
+ }
+});
View
145 shoelace/lib/extensions/extension-api-application.js
@@ -0,0 +1,145 @@
+/**
+ * @author lixuejian
+ */
+application.Core.registerExtension("ExApplicationAPI", function(sandbox) {
+ return {
+ /**
+ * 添加一个应用
+ * @param {ApplicationItem} details
+ * @param {Function} callback
+ * http://fe.baidu.com/doc/a/boss/api/application.text#Create
+ */
+ create: function(details, callback) {
+ bdbrowser.application.create(details, callback);
+ },
+ /**
+ * 更新一个应用
+ * @param {ApplicationItem} details
+ * @param {Function} callback
+ * http://fe.baidu.com/doc/a/boss/api/application.text#update
+ */
+ update: function(details, callback) {
+ bdbrowser.application.update(details, callback);
+ },
+ /**
+ * 移除一个应用
+ * @param {Object} details
+ * @param {Object} callback
+ * http:http://fe.baidu.com/doc/a/boss/api/application.text#Remove
+ */
+ remove: function(details, callback) {
+ bdbrowser.application.remove(details, callback);
+ },
+ /**
+ * 搜索安装的应用
+ * @param {Object} details
+ * @param {Object} callback
+ * http://fe.baidu.com/doc/a/boss/api/application.text#Search
+ */
+ search: function(details, callback) {
+ bdbrowser.application.search(details, callback);
+ },
+ /**
+ * 调用添加收藏的对话框
+ * @param {Object} details
+ * @param {Object} callback
+ * http://fe.baidu.com/doc/a/boss/api/application.text#search
+ */
+ checkInstalled: function(details, callback) {
+ bdbrowser.application.checkInstalled(details, callback);
+ },
+ /**
+ * 添加应用和删除应用时触发事件
+ */
+ addListener: function(event, callback) {
+ switch (String(event).toLocaleLowerCase()) {
+ case "created":
+ bdbrowser.application.onCreated.addListener(callback);
+ break;
+ case "removed":
+ bdbrowser.application.onRemoved.addListener(callback);
+ break;
+ case "opened":
+ bdbrowser.application.onOpen.addListener(callback);
+ break;
+ case "closed":
+ bdbrowser.application.onClose.addListener(callback);
+ break;
+ case "sync":
+ bdbrowser.application.onSync.addListener(callback);
+ break;
+ case "flushapp":
+ bdbrowser.application.onFlushApp.addListener(callback);
+ break;
+ }
+ },
+ /**
+ * 在新TAB或新窗口中打开页面
+ * @param {Object} info
+ * @param {Function} callback
+ */
+ openPage: function(info, callback) {
+ bdbrowser.global.openPage(info, callback);
+ },
+ /**
+ * 打开应用
+ * @param {Object} info
+ * @param {Function} callback
+ * http://fe.baidu.com/doc/a/boss/api/application.text#openApp
+ */
+ openApp: function(info, callback) {
+ bdbrowser.application.openApp(info, callback);
+ },
+ /**
+ * 关闭应用
+ * @param {Object} info
+ * @param {Function} callback
+ * http://fe.baidu.com/doc/a/boss/api/application.text#closeApp
+ */
+ closeApp: function(info, callback) {
+ bdbrowser.application.closeApp(info, callback);
+ },
+ /**
+ * logo闪烁
+ * @param {Object} params
+ * @param {Object} callback
+ */
+ alert: function(params, callback) {
+ bdbrowser.application.alert(params, callback);
+ },
+
+ /**
+ * 聚焦桌面选项卡(tab)
+ */
+ openAppPage: function(callback){
+ bdbrowser.global.openAppPage(callback);
+ },
+
+ /**
+ * 数据统计
+ * @param {Object} params
+ * @param {Object} callback
+ */
+ report: function(params, callback) {
+ bdbrowser.global.report(params, callback);
+ },
+
+ /**
+ * 获取同步状态信息
+ * @param {Object} params
+ * @param {Object} callback
+ */
+ getSyncInfo: function(params, callback){
+ bdbrowser.application.getSyncInfo(params, callback);
+ },
+
+ /**
+ * 获取单一id对应的app信息
+ * @param {Object} params
+ * @param {Object} callback
+ */
+ getAppById: function(params, callback){
+ bdbrowser.application.getAppById(params, callback);
+ },
+ };
+});
View
508 shoelace/lib/storage.js
@@ -0,0 +1,508 @@
+/**
+ * storage 跨浏览器本地存储,基于key-value
+ * 主要接口: set/get/remove
+ *
+ *
+**/
+(function(){
+
+ var _storage;
+
+ // escape spaces in name,单下划线替换为双下划线,空格替换为_s
+ var esc = function(str){
+ return 'PS' + str.replace(/_/g, '__').replace(/ /g, '_s');
+ };
+
+ /**
+ * 一些配置项
+ */
+ var Config = {
+
+ // Backend search order.
+ // TODO: flash, gears, whatwg_db, air, globalStorage, silverlight,去掉cookie
+ searchList: [
+ 'userData',
+ 'localStorage',
+ 'cookie'
+ ],
+
+ // list of backend methods
+ // TODO: clear method
+ methods: [
+ 'init',
+ 'get',
+ 'set',
+ 'remove'
+ ],
+
+ // set,get,remove操作结果状态标识
+ status: {
+ "SUCCESS": 0,
+ "FAILURE": 1,
+ "OVERFLOW": 2,
+ "FATAL":3
+ },
+
+ // 保存参数设置
+ option: {}
+ };
+
+ /**
+ * 内建支持的后端
+ * 目前包括:localStorage,userData,cookie
+ *
+ */
+ var Backends = {
+
+ /* HTML5标准 Firefox3.5+, Chrome4+, Safari4+(win)
+ * (src: http://www.whatwg.org/specs/web-apps/current-work/#the-localstorage)
+ * 永远不会过期
+ * 每个域名和子域名有他们自己独立的本地存储区域。主域可以访问子域的存储区域,子域也可以访问父域的存储区域。
+ *
+ */
+ localStorage: {
+ // (unknown?)
+ size: 10 * 1024 * 1024,
+
+ test: function() {
+ return window.localStorage ? true : false;
+ },
+
+ methods: {
+ init: function(){
+ this.store = window.localStorage;
+ },
+
+ expand: function(key){
+ return esc(this.name) + esc(key);
+ },
+
+ set: function(key, val, fn, option){
+ var status = Config.status.SUCCESS;
+ key = this.expand(key);
+
+ var value;
+ if(option && option.expires){
+ value = option.expires + "|" + val;
+ }else{
+ value = "0|" + val;
+ };
+
+ try{
+ this.store.setItem(key, value);
+ }catch(ex){
+ status = Config.status.OVERFLOW;
+ webim.Logger.report({error:1, storageError:1, method:"set", storage: "localStorage", e: ace.json.encode(ex), key:key, valueLength: val ? val.length : 0, username: username, guid:guid});
+ };
+
+ if(fn){
+ fn.call(this, status, val);
+ };
+ },
+
+ get: function(key, fn){
+
+ var status = Config.status.SUCCESS;
+ key = this.expand(key);
+
+ try{
+ var value = this.store.getItem(key);
+ if (value == null) { // key不存在时返回null
+ status = Config.status.FAILURE;
+ }
+ else {
+
+ // 判断是否过期,过期返回null
+ var pos = value.indexOf("|");
+ var exp = value.substring(0, pos);
+ var now = (new Date()).getTime();
+
+ if (exp > now || exp == "0") {
+ value = value.substring(pos + 1, value.length);
+ }
+ else {
+ value = null;
+ this.store.removeItem(key); // 过期时,再次读取删除key
+ status = Config.status.FAILURE;
+ };
+ }
+ }catch(ex){
+ status = Config.status.FATAL;
+ webim.Logger.report({error:1, storageError:1, method:"get", storage: "localStorage", e: ace.json.encode(ex), key:key, username: username, guid:guid});
+ };
+
+ if(fn){
+ fn.call(this, status, value);
+ };
+ },
+
+ remove: function(key, fn){
+ var status = Config.status.SUCCESS;
+ var value = null;
+ key = this.expand(key);
+
+ try{
+ var val = this.store.getItem(key);
+ var pos = val.indexOf("|");
+ value = val.substring(pos+1, val.length);
+ if(val == null){ // 若key不存在则返回失败状态
+ status = Config.status.FAILURE;
+ }else{
+ this.store.removeItem(key);
+ };
+ }catch(ex){
+ status = Config.status.FATAL;
+ webim.Logger.report({error:1, storageError:1, method:"remove", storage: "localStorage", e: ace.json.encode(ex), key: key, username: username, guid:guid});
+ };
+
+ if(fn){
+ fn.call(this, status, value);
+ };
+ }
+ }
+ },
+
+ /**
+ * IE5+
+ * 受限站点,单个网页可存储64K,整个域可存储640K。
+ * Expires这个属性是用来设置userdata的超时时间的。Userdata的超时设置是针对一个文件的,一旦过期,整个文件都过期了,不能单独设置每个属性的过期时间。
+ * userData被人为删除,此时执行getAttribute()、setAttribute()会报错:“Error:数据无效"。
+ * 如果在一个浏览器进程中重复删除、写入userdata数据,userdata空间将很快被撑满,因为每次删除都是逻辑删除,等到浏览器进程结束后才会真正执行删除操作。
+ *
+ *
+ */
+ userData: {
+ size: 64 * 1024,
+
+ test: function(){
+ return window.ActiveXObject ? true : false;
+ },
+
+ methods: {
+ /**
+ * 不兼容页面无body的情况,需要body加载完成调用
+ *
+ *
+ */
+ init: function(){
+ var prefix = '_storage_data_';
+ var id = prefix + esc(this.name);
+ this.el = document.createElement('div');
+ this.el.id = id;
+ this.el.style.display = 'none';
+ this.el.addBehavior('#default#userData');
+// document.body.appendChild(this.el);
+ document.body.insertBefore(this.el, document.body.firstChild);
+
+ var me = this;
+ ace.on(window, "unload", function(){
+ me.el = null;
+ });
+
+// var filename = new Date().getTime() + "";
+// this.el.load(filename);
+// alert("load: "+ filename+"\ncaller:"+this.init.caller);
+ },
+
+ expand: function(key){
+ return esc(this.name) + esc(key);
+ },
+
+ /**
+ * setAttribute(key)
+ * 利用key生成文件名,一个文件存储一个key
+ *
+ */
+ set: function(key, val, fn, option){
+ key = this.expand(key);
+ var status = Config.status.SUCCESS;
+
+ try{
+ var value;
+ // 添加过期时间
+ if(option && option.expires){
+ this.el.expires = (new Date(option.expires + 8 * 60 * 60 * 1000)).toUTCString();
+ value = option.expires + "|" + val;
+ }else{
+ value = "0|" + val;
+ };
+
+ this.el.setAttribute(key, value);
+ this.el.save(key);
+ }catch(ex){
+ status = Config.status.OVERFLOW; // 存储时抛出异常认为是溢出
+ webim.Logger.report({error:1, storageError:1, method:"set", storage: "userData", e: ace.json.encode(ex), key: key, valueLength: val ? val.length : 0, username: username, guid:guid});
+ val = null;
+
+ };
+
+ if(fn){
+ fn.call(this, status, val);
+ };
+ },
+
+ /**
+ * getAttribute(key)
+ * 利用key生成文件名,一个文件存储一个key
+ *
+ */
+ get: function(key, fn){
+ key = this.expand(key);
+ var status = Config.status.SUCCESS;
+ try {
+ this.el.load(key);
+
+ var value = this.el.getAttribute(key); // 若过期则返回null
+
+ if(value){
+ var pos = value.indexOf("|");
+ var exp = value.substring(0, pos);
+ var now = (new Date()).getTime();
+
+ if(exp > now || exp == "0"){
+ value = value.substring(pos+1, value.length);
+ }else{
+ value = null;
+ status = Config.status.FAILURE;
+ };
+ };
+
+ if(value == null){
+ status = Config.status.FAILURE;
+ this.remove(key);
+ };
+
+ }catch(ex){
+ status = Config.status.FATAL;
+ webim.Logger.report({error:1, storageError:1, method:"get", storage: "userData", e: ace.json.encode(ex), key: key, username: username, guid:guid});
+ }
+
+
+
+ if(fn){
+ fn.call(this, status, value);
+ };
+ },
+
+ /**
+ * 通过设过期时间删除,需要关闭浏览器才能真正删除
+ * 如果手动删除XML文件,则用过的key不能再用,否则会出错
+ * removeAttribute方法好像不是很管用
+ */
+ remove: function(key, fn){
+ key = this.expand(key);
+ var status = Config.status.SUCCESS;
+ var val = null;
+
+ try{
+ this.el.load(key);
+ val = this.el.getAttribute(key);
+
+ if(val == null){
+ status = Config.status.FAILURE;
+ }else{
+ var pos = val.indexOf("|");
+ val = val.substring(pos+1, val.length);
+ this.el.expires = new Date(315532799000).toUTCString(); // 315532799000 是格林威治时间1979年12月31日23时59分59秒。这是删除UserData的最靠前的一个有效expires时间了,再往前一毫秒,expires = new Date(315532798999).toUTCString(); 就删不掉userdata了,可以认为是IE的一个bug。
+ this.el.removeAttribute(key);
+ this.el.save(key);
+ };
+ }catch(ex){
+ status = Config.status.FAILURE;
+ webim.Logger.report({error:1, storageError:1, method:"remove", storage: "userData", e: ace.json.encode(ex), key: key, username: username, guid:guid});
+ };
+
+ if(fn){
+ fn.call(this, status, val);
+ };
+ }
+ }
+ },
+
+ // cookie backend
+ // TODO: 加上设置项
+ cookie: {
+ size: 4 * 1024,
+
+ test: function(){
+ return true;
+ },
+
+ methods: {
+ expand: function(key){
+ return this.name + key;
+ },
+
+ get: function(key, fn){
+ var status = Config.status.SUCCESS;
+ key = this.expand(key);
+ var val = ace.cookie.get(key);
+ if(val == null){
+ status = Config.status.FAILURE;
+ };
+ if(fn){
+ fn.call(this, status, val);
+ };
+ },
+
+ set: function(key, val, fn, option){
+ var status = Config.status.SUCCESS;
+ key = this.expand(key);
+
+ // expires参数类型转换
+ if(option && option.expires){
+ option.expires = new Date(expires);
+ };
+ ace.cookie.set(key, val, option);
+ if(fn){
+ fn.call(this, status, val);
+ };
+ },
+
+ remove: function(key, fn){
+ var status = Config.status.SUCCESS;
+ key = this.expand(key);
+ var val = ace.cookie.get(key);
+ ace.cookie.remove(key);
+ if(val == null){
+ status = Config.status.FAILURE;
+ };
+ if(fn){
+ fn.call(this, status, val);
+ };
+ }
+ }
+ }
+ };
+
+ /**
+ * 初始化Storage
+ * 主要工作,确定一种后端,根据搜索列表或用户指定,加载会默认调用,实例化时会再次调用。
+ *
+ */
+ var init = function(){
+ var empty = function(){};
+
+ // 重置 type 和 size
+ result.type = <