'+$weisiteLa.JiaZaiZhong+'
'+$weisiteLa.HuaDongYanZheng+'
';
var bo = document.getElementsByTagName('body');
appendHTML(bo[0],html);
},
_currentUrl:function(){
var list = document.getElementsByTagName('script');
for (var i in list) {
var d=list[i];
if(d.src.indexOf('tn_code')!==-1){//js文件名一定要带这个字符
var arr = d.src.split('tn_code');
return arr[0];
}
}
},
refresh:function(){
var isSupportWebp = !![].map && document.createElement('canvas').toDataURL('image/webp').indexOf('data:image/webp') == 0;
var _this = this;
tncode._err_c = 0;
tncode._is_draw_bg = false;
tncode._result = false;
tncode._img_loaded = false;
var obj = document.getElementByClassName('tncode_canvas_bg');
obj.style.display="none";
obj = document.getElementByClassName('tncode_canvas_mark');
obj.style.display="none";
tncode._img = new Image();
var timestamp = Date.parse(new Date());
var img_url = "/dom/verify_check.php?username="+user_name+"×tamp"+timestamp+"&ajax=1&t="+Math.random();
// var img_url = tncode._currentUrl()+"tncode.php?t="+Math.random();
if(!isSupportWebp){//浏览器不支持webp
img_url+="&nowebp=1";
}
tncode._img.src = img_url;
tncode._img.onload = function(){
tncode._draw_fullbg();
var canvas_mark = document.getElementByClassName('tncode_canvas_mark');
var ctx_mark = canvas_mark.getContext('2d');
//清理画布
ctx_mark.clearRect(0,0,canvas_mark.width,canvas_mark.height);
tncode._img_loaded = true;
obj = document.getElementByClassName('tncode_canvas_bg');
obj.style.display="";
obj = document.getElementByClassName('tncode_canvas_mark');
obj.style.display="";
};
//alert("Hong Kong ForHarvest Technology and Culture Development Co. Limited".length);
obj = document.getElementByClassName('slide_block');
obj.style.cssText = "transform: translate(0px, 0px)";
obj = document.getElementByClassName('slide_block_text');
obj.style.display="block";
},
init:function(classObj,type,j){
var _this = this;
_check_type = type;
if(!tncode._img){
tncode._html();
var obj = document.getElementByClassName('slide_block');
tncode._bind(obj,'mousedown',_this._block_start_move);
tncode._bind(document,'mousemove',_this._block_on_move);
tncode._bind(document,'mouseup',_this._block_on_end);
tncode._bind(obj,'touchstart',_this._block_start_move);
tncode._bind(document,'touchmove',_this._block_on_move);
tncode._bind(document,'touchend',_this._block_on_end);
var obj = document.getElementByClassName('tncode_close');
tncode._bind(obj,'touchstart', function(){
_this.hide((j && j.hideFun && j.hideFun))
});
tncode._bind(obj,'click', function(){
_this.hide((j && j.hideFun && j.hideFun));
});
var obj = document.getElementByClassName('tncode_refresh');
tncode._bind(obj,'touchstart',_this.refresh);
tncode._bind(obj,'click',_this.refresh);
var objs = document.getElementByClassName(classObj);
_this.show();
// for (var i in objs) {
// var o = objs[i];
// //o.innerHTML = '拖动按钮进行验证';
// // tncode._bind(o,'touchstart',_this.show);
// _this.show();
// // tncode._bind(o,'click',_this.show);
// }
}
},
result:function(){
return tncode._result;
},
onsuccess:function(fn){
tncode._onsuccess = fn;
}
};
var $TN = tncode;
var _old_onload = window.onload;
window.onload = function(){
if(typeof _old_onload == 'function'){
_old_onload();
}
// tncode.init(tncode_class);
};