'
].join(''));
var t = null;
$('.ez-btn').hover(function(){
$('.ez-panel').css({
top: ($('.ez-btn').offset().top) + 'px',
left: ($('.ez-btn').offset().left+70) + 'px'
}).show();
}, function(){
if (t) window.clearTimeout(t);
t = window.setTimeout(function(){
$('.ez-panel').hide();
}, 10*1000);
});
$('.ez-btn').click(function(){
prePrint();
});
$('body').mousedown(function(e){
if (e.button==2){
imgHandle();
}
return true;
});
}
//main function
function prePrint(){
$('.ez-panel').remove();
$('.moreBtn').click();
$(".aside").remove();
$("#doc #hd").remove();
$(".crubms-wrap").remove();
$(".user-bar").remove();
$("#doc-header").remove();
$(".reader-tools-bar-wrap").remove();
$(".fix-searchbar-wrap").remove();
$("#bottom-doc-list-8").remove();
$(".ft").remove();
$("#ft").remove();
$("#docBubble").remove();
$('.hd').remove();
$('.wk-other-new-cntent').remove();
$('#html-reader-go-more').remove();
$('.new-wm').remove();
$('#bottom-download').remove();
$('#pay-page').remove();
$('.banner-wrap').remove();
$('#next_doc_box').remove();
$('.high-quality-doc').remove();
$('.new-ico-wkmember-free-doc').remove();
$('.doc-tag-pay-normal').remove();
$('.doc-tag-professional').remove();
$('.doc-tag-pay-discount').remove();
$('.doc-tag-ticket').remove();
$('#activity-tg').remove();
$("body").attr("margin", "auto");
$(".bd").attr("style", "height:1262.879px");
$('.reader-page').css({border: 0});
$('.doc_bottom_wrap').remove();
jQuery.fn.extend({remove: function(){return false;}});
var _h = document.body.scrollHeight, _tmp=0;
var _t = window.setInterval(function(){$(window).scrollTop(_tmp);_tmp=_tmp+700;_h = document.body.scrollHeight;if (_tmp>_h) {window.clearInterval(_t);doPrint();}}, 300);
}
/**
* 图片处理,将 div background img 处理成 img 标签,利用 img clip:rect style 来处理图片
* 暂时未找到 img clip:rect 的规律
* //FIXME
*/
function imgHandle(){
$('div.reader-pic-item').each(function(i, item){
var _style = $(item)[0].style;
var _imgUrl = _style.backgroundImage.substring(5, _style.backgroundImage.length-2);
var imgPanel = '

';
$(item)[0].style.backgroundImage = null;
var p = document.createElement('p');
$($(item)[0].attributes).each(function(i, attr){
$(p).attr(attr.nodeName, attr.nodeValue);
});
$(p).append(imgPanel);
$(item).parent().html(p);
});
}
/**
* 调用浏览器打印
*/
function doPrint() {
imgHandle();
window.setTimeout(function(){window.print();}, 3000);
}
})();