var url = window.location.href;
function creatDiv(id){
if(YK.D.get(id)){
YK.D.get(id).innerHTML = YK.D.getElementsByClassName("nav")[0].nextSibling.textContent.match(/frontcid:[\d]*/);
}
else{
var div = document.createElement('div');
div.id = id;
if(YK.D.getElementsByClassName("nav")[0].nextSibling.textContent.match(/frontcid:[\d]*/)){
div.innerHTML = YK.D.getElementsByClassName("nav")[0].nextSibling.textContent.match(/frontcid:[\d]*/);
}else{
div.innerHTML = "未获取frontcid";
}
setProperties(div,{position : "absolute",
border : "2px solid red",
right : "50px",
top : "250px",
fontSize : "18px",
padding : "20px",
background : "#fff",
zIndex : "10"
})
document.body.appendChild(div);
}
}
function createButton(id){
if(YK.D.get(id)){
return;
}else{
var button = document.createElement("button");
button.appendChild(document.createTextNode("点击获取fontcid"));
YK.on(button,'click',function(){window.location.href = 'http://www.koubei.com/fuwu/pdeBug-1';});
setProperties(button,{position : "absolute",
border : "2px solid red",
right : "100px",
top : "200px",
fontSize : "18px",
background : "#fff",
zIndex : "10"
});
document.body.appendChild(button);
}
}
function setProperties(obj,config){
for(var pro in config){
YK.D.setStyle(obj,pro,config[pro]);
}
}
function hiddenP4t(){
YK.D.setStyle(YK.D.getElementsByClassName("yn-p4t"),'display',"none");
YK.D.setStyle(YK.$('yk-ask'),'display',"none");
}
hiddenP4t();
if((/pdeBug/).test(url)){
creatDiv("fontcid");
}else{
createButton("fontcid");
}