PHPIndex

This page lists files in the current directory. You can view content, get download/execute commands for Wget, Curl, or PowerShell, or filter the list using wildcards (e.g., `*.sh`).

build
web
add.js
wget 'https://sme10.lists2.roe3.org/kodbox/plugins/pdfjs/static/pdfjs/add.js'
View Content
/**
 * kod处理;
 * https://github.com/mozilla/pdf.js

 * 图片显示模糊,问题修复:https://github.com/mozilla/pdf.js/pull/13698/files
 * 版本更新:(v2.10.377->v2.5.207):v2.5.207以上在钉钉中显示乱码
 * 版本更新:v5.3.31,修复pdf放大模糊问题
 */
var pdfLoaded = function(){
	// console.log(33313,fileName,PDFViewerApplication,PDFViewerApplication.eventBus);
	var isLoad = false;
	// PDFViewerApplication.preferences.set('disableAutoFetch',true);// 关闭全部下载,按需加载文件;
	PDFViewerApplication.eventBus.on('pagerender',function(){
		if(isLoad) return;
		isLoad = true;
		document.title = fileName;
		setTimeout(function(){document.title = fileName;},100);
		
		// 自适应界面; bug: 缩放后文字选中异常;
		if($.isWindowTouch() && $.isWindowSmall() && _.get(PDFViewerApplication, 'pdfViewer._setScale')){
			PDFViewerApplication.pdfViewer._setScale("page-fit"); // 全屏;
		}
	});
	// 监听错误信息
	if (!$('#errorMessage').length) {
		$('<div id="errorMessage" class="hidden"></div>').appendTo('#viewerContainer');
	}
	PDFViewerApplication.eventBus.on('documenterror', function (event) {
		$('#errorMessage').text('PDF Error: ' + event.message).removeClass('hidden');
	});
	PDFViewerApplication.eventBus.on('documentloaded', function () {
		$('#errorMessage').text('').addClass('hidden');
	});
}

$(document).ready(function (){
	$('#editorStampButton').parent().hide();	// 编辑或添加图像
	$('.hiddenMediumView,.visibleMediumView #secondaryPrint,.visibleMediumView #secondaryDownload').hide();
	var checkTimer = setInterval(function(){
		if(!window.PDFViewerApplication || !PDFViewerApplication.eventBus) return;

		clearInterval(checkTimer);
		pdfLoaded();
		searchAuto();
		setTimeout(function(){
			if(canDownload == '1'){
				$('.hiddenMediumView,.visibleMediumView #secondaryPrint,.visibleMediumView #secondaryDownload').show();
				return;
			}
			PDFViewerApplication.supportsPrinting = false;	// 无效
			PDFViewerApplication.download = function(){};
			window.print = function(){};
			$('.hiddenMediumView,.visibleMediumView #secondaryPrint,.visibleMediumView #secondaryDownload').remove();
			$('.pdfViewer').addClass('no-select');
		},500);
	},50);
	
	var searchAuto = function(){
		var args = $.getUrlParam('args') || '';
		args = jsonDecode(urlDecode(args));
		if(!args || typeof(args) != 'object' || !args.search) return;
		
		$("#viewFindButton").trigger('click');
		$("#findInput").val(args.search);
		$('[for="findHighlightAll"]').trigger('click');
		setTimeout(function(){$("#findInput").focus();},500);
	}
	
	var changeFullscreen = function(change){
		var doc = document.documentElement;
		var isFullScreen = document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen || document.msFullscreenElement;
		var exitFullscreen = document.exitFullscreen || document.msExitFullscreen || document.mozCancelFullScreen || document.webkitCancelFullScreen;
		var startFullscreen = doc.requestFullscreen || doc.mozRequestFullScreen || doc.webkitRequestFullscreen || doc.msRequestFullscreen;
		if(!exitFullscreen) return;
		if(change === true){!isFullScreen && startFullscreen.apply(doc,[]);}else{isFullScreen && exitFullscreen.apply(document,[]);}
	}
	$('<div class="exit-fullscreen">Esc</div>').appendTo('#viewerContainer');
	$('.exit-fullscreen').bind('click', function(){
		changeFullscreen(false);
	});
	$(document).bind('keyup',function(e){
		if(e.key == "Escape"){changeFullscreen(false);}
	});
});
style.css
wget 'https://sme10.lists2.roe3.org/kodbox/plugins/pdfjs/static/pdfjs/style.css'
View Content
body{background: #eeeef4;}
.pdfViewer .page{
	border: none;
	background: none;
	/* box-shadow: 0 1px 10px rgba(0,0,0,0.1); */
	box-shadow: 0 2px 8px rgba(0,0,0,0.05);
	margin: 10px auto;
	border-radius: 2px;
	overflow: hidden;
}
.pdfViewer.no-select * {
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

.exit-fullscreen{
	position: fixed;top: 10px;right: 10px;z-index: 9999;opacity:0.3;
    width: 50px;height: 50px;line-height: 50px;font-weight: 800;
    cursor: pointer;border-radius: 4px;display:none;
    background:rgba(150,150,150,0.5);color: #fff;
    text-align:center;transition: all 0.2s;
}
.exit-fullscreen:hover{opacity: 0.8;cursor: pointer;}
.pdfPresentationMode .exit-fullscreen{display:block;}


.toolbarButton,.toggleButton.toolbarLabel,.toolbarButton.labeled{cursor: pointer;}
.toolbarButton.labeled{font-size:13px;}
.toolbarField{padding: 3px 6px;font-size: 13px !important;}
.dropdownToolbarButton > select{height: 26px;border-radius: 3px;}
.toolbarButtonWithContainer .menuContainer{overflow-x:hidden;}
.toolbarButtonWithContainer .menuContainer .toolbarButton{margin:0 4px;}

:root{
	--main-color:#555;
	--button-hover-color:#99999920;
	--doorhanger-hover-color:#444;
	--toggled-btn-bg-color:#99999940;
	--toggled-btn-color:#333;
	
	--toolbar-bg-color:#fcfdfe;
	--toolbar-border-color:#99999910;
	--toolbar-box-shadow:none;
	--toolbar-border-bottom:0.6px solid #00000030;
	--dropdown-btn-bg-color:var(--button-hover-color);
}
#viewerContainer #errorMessage {
	background: none repeat scroll 0 0 rgba(255, 85, 85, 1);
    color: rgba(255, 255, 255, 1);
    left: 0;
    position: absolute;
    right: 0;
    z-index: 1000;
    padding: 3px;
    font-size: 0.8em;
    text-align: center;
    top: 5px;
}