Commit 918103e2 authored by Matija Obreza's avatar Matija Obreza
Browse files

Share on social media <local:linkedin-share

parent 332e70f1
...@@ -641,3 +641,4 @@ statistics.phenotypic.stats-text=Of the {0} accessions, {1} accessions ({2,numbe ...@@ -641,3 +641,4 @@ statistics.phenotypic.stats-text=Of the {0} accessions, {1} accessions ({2,numbe
twitter.tweet-this=Tweet! twitter.tweet-this=Tweet!
twitter.follow-X=Follow @{0} twitter.follow-X=Follow @{0}
linkedin.share-this=Share on LinkedIn
...@@ -637,14 +637,23 @@ $(function() { ...@@ -637,14 +637,23 @@ $(function() {
*/ */
$('.twitter-share-button').click(function(e) { $('.twitter-share-button').click(function(e) {
e.preventDefault(); e.preventDefault();
window.open($(this).attr('href'), 'twitterWindow', 'width=600,height=300,scrollbars=yes,toolbars=no'); window.open($(this).attr('href'), 'shareWindow', 'width=600,height=300,scrollbars=yes,toolbars=no');
}); });
$('.twitter-follow-button').click(function(e) { $('.twitter-follow-button').click(function(e) {
e.preventDefault(); e.preventDefault();
window.open($(this).attr('href'), 'twitterWindow', 'width=600,height=300,scrollbars=yes,toolbars=no'); window.open($(this).attr('href'), 'shareWindow', 'width=600,height=300,scrollbars=yes,toolbars=no');
}); });
/**
* Share on LinkedIn
*/
$('.linkedin-share-button').click(function(e) {
e.preventDefault();
window.open($(this).attr('href'), 'shareWindow', 'width=600,height=300,scrollbars=yes,toolbars=no');
});
// //
// function enableSessionWarning(secondsBeforeExpiry) { // function enableSessionWarning(secondsBeforeExpiry) {
// if ($('#session_expired_popup').length === 0) { // if ($('#session_expired_popup').length === 0) {
......
...@@ -33,9 +33,8 @@ ...@@ -33,9 +33,8 @@
&bull; &bull;
--%> --%>
<%--
<local:tweet text="${activityPost.title}" hashTags="GenesysPGR" /> <local:tweet text="${activityPost.title}" hashTags="GenesysPGR" />
--%> <local:linkedin-share text="${activityPost.title}" summary="${activityPost.body}" />
<%-- <spring:message code="audit.createdBy" arguments="${activityPost.createdBy.name}" /> --%> <%-- <spring:message code="audit.createdBy" arguments="${activityPost.createdBy.name}" /> --%>
<c:if test="${activityPost.lastModifiedBy ne null}"><spring:message code="audit.lastModifiedBy" arguments="${jspHelper.userFullName(activityPost.lastModifiedBy)}" /></c:if> <c:if test="${activityPost.lastModifiedBy ne null}"><spring:message code="audit.lastModifiedBy" arguments="${jspHelper.userFullName(activityPost.lastModifiedBy)}" /></c:if>
......
<%@ tag description="Share on LinkedIn!" pageEncoding="UTF-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ attribute name="url" required="false" type="java.lang.String" description="The url parameter contains an absolute HTTP or HTTPS URL to be shared on Twitter. The shared URL will be shortened by Twitter’s t.co service in a published Tweet. A Twitter Card may be appear for a shared URL." %>
<%@ attribute name="text" required="false" type="java.lang.String" description="A text parameter appears pre-selected in a Tweet composer. The Tweet author may easily remove the text with a single delete action." %>
<%@ attribute name="summary" required="false" type="java.lang.String" description="The url-encoded description that you wish you use" %>
<%@ attribute name="dataSize" required="false" type="java.lang.String" description="regular or large" %>
<%--
https://developer.linkedin.com/docs/share-on-linkedin
--%>
<c:if test="${url eq null}">
<c:set var="url" value="${props.baseUrl}${pageContext.request.getAttribute('javax.servlet.forward.request_uri')}" />
</c:if>
<c:url var="refUrl" value="${url}" />
<c:url var="shareUrl" value="https://www.linkedin.com/shareArticle">
<c:param name="mini" value="true" />
<c:param name="source" value="GenesysPGR" />
<c:param name="url" value="${refUrl}" />
<c:if test="${text != null and text ne ''}">
<c:param name="title" value="${jspHelper.htmlToText(text, 200)}" />
</c:if>
<c:if test="${summary != null and summary ne ''}">
<c:param name="summary" value="${jspHelper.htmlToText(summary, 256)}" />
</c:if>
</c:url>
<a class="linkedin-share-button" target="_blank" href="${shareUrl}" data-size="${dataSize}"><spring:message code="linkedin.share-this" /></a>
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<c:url var="twatUrl" value="https://twitter.com/intent/tweet"> <c:url var="twatUrl" value="https://twitter.com/intent/tweet">
<c:param name="url" value="${refUrl}" /> <c:param name="url" value="${refUrl}" />
<c:if test="${text != null and text ne ''}"> <c:if test="${text != null and text ne ''}">
<c:param name="text" value="${text}" /> <c:param name="text" value="${jspHelper.htmlToText(text, 300)}" />
</c:if> </c:if>
<c:if test="${hashTags != null and hashTags ne ''}"> <c:if test="${hashTags != null and hashTags ne ''}">
<c:param name="hashtags" value="${hashTags}" /> <c:param name="hashtags" value="${hashTags}" />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment