Browse Source

预览、上传页面修改

sunyj 9 years ago
parent
commit
a3e5339f66

+ 7 - 6
src/main/webapp/WEB-INF/views/preview.html

@@ -51,12 +51,13 @@ See https://github.com/adobe-type-tools/cmap-resources
 						title="Show Thumbnails" tabindex="2" data-l10n-id="thumbs">
 						<span data-l10n-id="thumbs_label">Thumbnails</span>
 					</button>
-					<button id="viewOutline" class="toolbarButton group"
+					<button id="viewOutline" hidden='true' class="toolbarButton group"
 						title="Show Document Outline" tabindex="3" data-l10n-id="outline">
 						<span data-l10n-id="outline_label">Document Outline</span>
 					</button>
-					<button id="viewAttachments" class="toolbarButton group"
-						title="Show Attachments" tabindex="4" data-l10n-id="attachments">
+					<button id="viewAttachments" hidden='true'
+						class="toolbarButton group" title="Show Attachments" tabindex="4"
+						data-l10n-id="attachments">
 						<span data-l10n-id="attachments_label">Attachments</span>
 					</button>
 				</div>
@@ -184,11 +185,11 @@ See https://github.com/adobe-type-tools/cmap-resources
 					<div id="toolbarViewer">
 						<div id="toolbarViewerLeft">
 							<button id="sidebarToggle" class="toolbarButton"
-								title="Toggle Sidebar" tabindex="11" hidden='true'
+								title="Toggle Sidebar" tabindex="11"
 								data-l10n-id="toggle_sidebar">
 								<span data-l10n-id="toggle_sidebar_label">Toggle Sidebar</span>
 							</button>
-							<div class="toolbarButtonSpacer" hidden='true'></div>
+							<div class="toolbarButtonSpacer"></div>
 							<button id="viewFind" class="toolbarButton group hiddenSmallView"
 								title="Find in Document" tabindex="12" data-l10n-id="findbar">
 								<span data-l10n-id="findbar_label">Find</span>
@@ -528,6 +529,6 @@ See https://github.com/adobe-type-tools/cmap-resources
 <script src="static/js/preview/app.js"></script>
 <script src="static/lib/pdf.js/web/debugger.js"></script>
 <script src="static/lib/pdf.js/web/viewer.js"></script>
-<script src="static/js/endview.js"></script>
+<script src="static/js/preview/endview.js"></script>
 </html>
 

+ 0 - 0
src/main/webapp/resources/js/endview.js → src/main/webapp/resources/js/preview/endview.js


+ 15 - 2
src/main/webapp/resources/js/upload/app.js

@@ -12,7 +12,11 @@ $(':file').change(function() {
 function upload() {
 	// 创建FormData对象,初始化为form表单中的数据
 	var formData = new FormData($('form')[0]);
-	formData.append('userName', 'UAS');
+	var userName = getParameter("userName");
+	if (userName == null || userName == "") {
+		userName = "UAS";
+	}
+	formData.append('userName', userName);
 
 	// 显示进度
 	$('#progressDiv').css("display", "block");
@@ -52,4 +56,13 @@ function progressHandlingFunction(e) {
 				e.loaded + "/" + e.total + " bytes. " + percent.toFixed(2)
 						+ "%");
 	}
-}
+}
+
+// 获取链接参数
+var getParameter = function(key) {
+	var reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)");
+	var r = window.location.search.substr(1).match(reg);
+	if (r != null)
+		return unescape(r[2]);
+	return null;
+};