Merge pull request #2647 from kazuihitoshi/master
added search result path to the clipboard button
This commit is contained in:
commit
b212ec43ab
4 changed files with 85 additions and 18 deletions
|
@ -55,24 +55,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">
|
||||
<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
|
||||
|
@ -227,3 +232,4 @@
|
|||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
<script type="text/javascript" src="${fe:url('/js/clipboard.min.js')}"></script>
|
||||
|
|
|
@ -160,3 +160,44 @@ legend{
|
|||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.title-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.clipboard-copy, .clipboard-copy- {
|
||||
margin-left: 5px;
|
||||
cursor: pointer;
|
||||
color:gray;
|
||||
position: relative;
|
||||
}
|
||||
.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 {
|
||||
opacity: 1;
|
||||
}
|
||||
.clipboard-copy-copied::after {
|
||||
content: 'copied!';
|
||||
opacity:1;
|
||||
}
|
||||
.clipboard-copy-copied::before {
|
||||
opacity:1;
|
||||
}
|
||||
|
|
7
src/main/webapp/js/clipboard.min.js
vendored
Normal file
7
src/main/webapp/js/clipboard.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -260,4 +260,17 @@ $(function() {
|
|||
);
|
||||
loadImage(this, $(this).attr("data-src"), IMG_LOADING_MAX);
|
||||
});
|
||||
|
||||
var clipboard = new ClipboardJS('.clipboard-copy');
|
||||
clipboard.on('success', function(e) {
|
||||
e.trigger.classList.remove('clipboard-copy');
|
||||
e.trigger.classList.add('clipboard-copy-');
|
||||
e.trigger.classList.add('clipboard-copy-copied');
|
||||
setTimeout(function(){
|
||||
e.trigger.classList.remove('clipboard-copy-copied');
|
||||
e.trigger.classList.remove('clipboard-copy-');
|
||||
e.trigger.classList.add('clipboard-copy');
|
||||
},1200);
|
||||
e.clearSelection();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue