/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
var context = "";
var localeChain = "zh_CN";
var pdfDocs = null;
var pageNums = null;
var cuur_scale = 1;
var url = '';
$("script[sudy-wp-context]").each(function (i) {
context = $(this).attr("sudy-wp-context");
if (context) {
context = "/" + context;
}else{
context="";
}
});
var fls = flashChecker();
if (/Android|Windows Phone|webOS|iPhone|iPod|iPad|BlackBerry/i.test(navigator.userAgent)) {
fls.f = 0;
// localeChain = "en_US";
}
if (fls.f === 0) {
document.write('');
}
$().ready(function () {
$("script[sudy-wp-context]").each(function (i) {
context = $(this).attr("sudy-wp-context");
if (context) {
context = "/" + context;
}else{
context="";
}
});
// document.write("鎮ㄥ畨瑁呬簡flash,褰撳墠flash鐗堟湰涓国 " + fls.v + ".x");
$("a[sudy-wp-player]").each(function (i) {
var _href = $(this).attr("href");
var _sudyvideoplayersrc = $(this).attr("sudy-wp-player");
_href = _href.substring(0, _href.lastIndexOf("/") + 1) + _sudyvideoplayersrc;
if (swfPlayer(_href) !== null) {
var prev = $($(this)).prev("img[src*=icon]");
$($(this)).replaceWith("
");
if (prev) {
prev.remove();
}
} else if (!jsPlayer(_href)) {
$(this).attr("href", _href);
}
});
$(".wp_pdf_player,div[sudyplayer='wp_pdf_player'],img[sudyplayer='wp_pdf_player']").each(function (i) {
if (!$(this).attr("class")) {
$(this).css("width", "100%");
$(this).css("height", "700px");
}
if (!$(this).attr("class")) {
$(this).attr("class", $(this).attr("sudyplayer"));
}
var id = $(this).attr("id");
var swfsrc = $(this).attr("swsrc");
var pdfsrc = $(this).attr("pdfsrc");
var flexpaper = (context?context:"") + "/_js/_portletPlugs/swfPlayer/flexpaper/FlexPaper_flash/FlexPaperViewer";
var uuid = Math.random().toString();
/**
* 濡傛灉鏈湴瀹夎浜唂lash鍒欑敤鍘熸潵鐨勬柟寮忔挱鏀?濡傛灉娌℃湁瀹夎flash鍒欎娇鐢ㄦ柊鐨勬柟寮忔挱鏀
*/
$(this).html('');
if (!document.getElementById("sudy-pdf-canvas"+id) || !document.getElementById("sudy-pdf-canvas"+id).getContext) {
$(this).html("");
if (true) {
new FlexPaperViewer(flexpaper, id, {config: {
SwfFile: escape(swfsrc + "?src=" + pdfsrc + "&t=" + uuid),
Scale: 1.0,
ZoomTransition: "easeOut",
ZoomTime: 0.5,
ZoomInterval: 0.2,
FitPageOnLoad: false,
FitWidthOnLoad: false,
FullScreenAsMaxWindow: false,
ProgressiveLoading: false,
MinZoomSize: 0.2,
MaxZoomSize: 5,
SearchMatchAll: false,
InitViewMode: "Portrait",
PrintPaperAsBitmap: false,
ViewModeToolsVisible: true,
ZoomToolsVisible: true,
NavToolsVisible: true,
CursorToolsVisible: false,
SearchToolsVisible: false,
localeChain: localeChain
}});
}
return;
}
if(true){
var userAgent = navigator.userAgent; //鍙栧緱娴忚鍣ㄧ殑userAgent瀛楃涓
var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //鍒ゆ柇鏄惁IE<11娴忚鍣
if(isIE){
$(this).replaceWith('');
return;
}
$(this).replaceWith('');
return;
}
if(pdfDocs == null){
pdfDocs = new Map();
pageNums = new Map();
}
$(this).html('' +
'
' +
'
' +
'
' +
'

' +
'

' +
'
' +
'
1' +
'
/' +
'
2' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
' +
'
');
url = $(this).attr("pdfsrc");
PDFJS.getDocument(url).then(function (pdfDoc_) {
pdfDocs.set(id,pdfDoc_);
var pdfDoc = pdfDoc_;
var pageNum = pageNums.get(id);
if(!pageNum){
pageNum=1;
}
queueRenderPage(pageNum, -1,id);
var selectTemplate = '';
for (var i = 0; i < pdfDoc.numPages; i++) {
selectTemplate += '