Jelajahi Sumber

added path clipboard copy button to search results

kazui hitoshi 3 tahun lalu
induk
melakukan
316c2c902c
2 mengubah file dengan 53 tambahan dan 87 penghapusan
  1. 28 27
      src/main/webapp/WEB-INF/view/searchResults.jsp
  2. 25 60
      src/main/webapp/css/style.css

+ 28 - 27
src/main/webapp/WEB-INF/view/searchResults.jsp

@@ -39,15 +39,11 @@
 	<ol class="list-unstyled col-md-8">
 		<c:forEach var="doc" varStatus="s" items="${documentItems}">
 			<li id="result${s.index}">
-				<div class="title-container">
-					<h3 class="title text-truncate" style="margin-bottom:0;">
-						<a class="link" href="${doc.url_link}" data-uri="${doc.url_link}"
-							data-id="${doc.doc_id}" data-order="${s.index}">${doc.content_title}</a>
-					</h3>
-					<c:if test="${ fn:substring(doc.url,0,4)=='smb:' }">					
-						<i class="clipboard-copy fa fa-copy" data-clipboard-text="${doc.url_link}"></i>
-					</c:if>	
-				</div>
+				<h3 class="title text-truncate" style="margin-bottom:0;">
+					<a class="link" href="${doc.url_link}" data-uri="${doc.url_link}"
+						data-id="${doc.doc_id}" data-order="${s.index}">${doc.content_title}</a>
+				</h3>									
+				<p>${doc.url}</p>
 				<div class="body">
 					<c:if test="${thumbnailSupport && !empty doc.thumbnail}">
 					<div class="mr-3">
@@ -61,24 +57,29 @@
 					</c:if>
 					<div class="description">${doc.content_description}</div>
 				</div>
-				<div class="site text-truncate">
-					<cite>${f:h(doc.site_path)}</cite>
-					<c:if test="${doc.has_cache=='true'}">
-						<small class="d-none d-lg-inline-block"> <la:link
-								href="/cache/?docId=${doc.doc_id}${appendHighlightParams}"
-								class="cache">
-								<la:message key="labels.search_result_cache" />
-							</la:link>
-						</small>
-					</c:if>
-					<c:if test="${doc.similar_docs_count!=null&&doc.similar_docs_count>1}">
-						<small class="d-none d-lg-inline-block"> <la:link
-								href="/search?q=${f:u(q)}&ex_q=${f:u(queryEntry.value)}&sdh=${f:u(fe:sdh(doc.similar_docs_hash))}${fe:facetQuery()}${fe:geoQuery()}">
-								<la:message key="labels.search_result_similar"
-											arg0="${fe:formatFileSize(doc.similar_docs_count-1)}" />
-							</la:link>
-						</small>
-					</c:if>
+				<div class="site">
+					<div class="title-container" style="overflow:unset;">
+						<cite>${f:h(doc.site_path)}</cite>
+						<i class="clipboard-copy fa fa-copy" data-clipboard-text="${doc.url_link}"></i>
+					</div>
+					<div class="text-truncate">
+						<c:if test="${doc.has_cache=='true'}">
+							<small class="d-none d-lg-inline-block"> <la:link
+									href="/cache/?docId=${doc.doc_id}${appendHighlightParams}"
+									class="cache">
+									<la:message key="labels.search_result_cache" />
+								</la:link>
+							</small>
+						</c:if>
+						<c:if test="${doc.similar_docs_count!=null&&doc.similar_docs_count>1}">
+							<small class="d-none d-lg-inline-block"> <la:link
+									href="/search?q=${f:u(q)}&ex_q=${f:u(queryEntry.value)}&sdh=${f:u(fe:sdh(doc.similar_docs_hash))}${fe:facetQuery()}${fe:geoQuery()}">
+									<la:message key="labels.search_result_similar"
+												arg0="${fe:formatFileSize(doc.similar_docs_count-1)}" />
+								</la:link>
+							</small>
+						</c:if>
+					</div>
 				</div>
 				<div class="more">
 					<a href="#result${s.index}"><la:message

+ 25 - 60
src/main/webapp/css/style.css

@@ -161,42 +161,7 @@ legend{
 	}
 }
 
-.clipboard-copy-button{
-	 cursor: pointer;
-	 color:gray;
-	 text-overflow: unset;
-}
-.clipboard-copy-button::after{
-	 content:'copied!';
-	 font-size:.7em;
-	 border-radius:3px;
-	 padding:5px;margin:5px;
-	 background: gray;
-	 color: white;
-	 opacity: 0;
-}
-.clipboard-copy-copied::after {
-	 opacity: 1;
-}
-
-.clipboard-copy-button{
-	 cursor: pointer;
-	 color:gray;
-	 text-overflow: unset;
-}
-.clipboard-copy-button::after{
-	 content:'copied!';
-	 font-size:.7em;
-	 border-radius:3px;
-	 padding:5px;margin:5px;
-	 background: gray;
-	 color: white;
-	 opacity: 0;
-}
-.clipboard-copy-copied::after {
-	 opacity: 1;
-}
-.title-container{
+.title-container {
 	display: flex;
 	align-items: center;
 }
@@ -206,33 +171,33 @@ legend{
 	color:gray;
 	position: relative;
 }
-.clipboard-copy::after, .clipboard-copy-::after{
-	opacity: 0;
-	position: absolute;
-	left: 50%;
-	transform: translateX(-50%);
-	bottom: -30px;
-	display: inline-block;
-	padding: 5px;
-	white-space: nowrap;
-	font-size: 0.8rem;
-	line-height: 1.3;
-	background:black;
-	color:white;
-	border-radius: 3px;
-	transition: 0.3s ease-in;
-}
-.clipboard-copy:hover:after{
-	content:'smb full path copy';
+.clipboard-copy::after, .clipboard-copy-::after {
+    opacity: 0;
+    position: absolute;
+    left: 50%;
+    transform: translateX(-50%);
+    bottom: 20px;
+    display: inline-block;
+    padding: 5px;
+    white-space: nowrap;
+    font-size: 0.8rem;
+    line-height: 1.3;
+    background:black;
+    color:white;
+    border-radius: 3px;
+    transition: 0.3s ease-in;
+}
+.clipboard-copy:hover:after {
+	content: 'path copy';
 	opacity: 1;
 }
-.clipboard-copy:hover:before{
+.clipboard-copy:hover:before {
 	opacity: 1;
 }
-.clipboard-copy-copied::after{
+.clipboard-copy-copied::after {
 	content: 'copied!';
-	opacity: 1;
+	opacity:1;
+}
+.clipboard-copy-copied::before {
+	opacity:1;
 }
-.clipboard-copy-copied::before{
-	opacity: 1;
-}