webapp.html 1.3 KB
<!doctypehtml><title></title><meta content="text/html;charset=utf-8"http-equiv=Content-Type><script src=../internal.js></script><style>.wrapper{width:540px;margin:10px auto}#appShow{border:1px solid #ddd}.errorMsg{font-size:13px;margin:10px;color:#d00}</style><div class=wrapper><div id=appShow></div></div><script>var apikey=editor.options.webAppKey;if(apikey&&24==apikey.length){var baiduApp,searchConfig={container:"appShow",tips:"",search:1,ps:12,suggest:1,limit:0,searchNow:0,apikey:apikey,pager:1,cid:7134562,outputHTML:1};function clickCallback(){baiduApp.addEventListener("getAppHTML",function(a,p){var e="http://app.baidu.com/app/enter?appid="+p.data.app_id+"&tn=app_canvas&app_spce_id=1&apikey="+apikey+"&api_key="+apikey;editor.execCommand("webapp",{url:e,width:p.uniWidth,height:p.uniHeight+60,logo:p.data.app_logo,title:p.data.app_name}),dialog.close()})}var script=document.createElement("script");script.type="text/javascript",script.src="http://app.baidu.com/appweb/api/search?auto=yes&container=container&apikey="+apikey+"&instanceName=baiduApp&callback=clickCallback&config=searchConfig",document.body.appendChild(script)}else $G("appShow").innerHTML="<p class='errorMsg'>"+lang.tip1+"<a title='"+lang.anthorApi+"' href='http://app.baidu.com/static/cms/getapikey.html' target='_blank'>"+lang.applyFor+"</a></p><p class='errorMsg'>"+lang.tip2+"</p>"</script>