Commit eb622064 authored by Matija Obreza's avatar Matija Obreza
Browse files

<local:tweet and <local:twitter-follow tags

parent 766c3a3c
......@@ -638,3 +638,6 @@ accession.svalbard-data.url-text=View SGSV deposit information for {0}
filter.download-pdci=Download PDCI data
statistics.phenotypic.stats-text=Of the {0} accessions, {1} accessions ({2,number,0.##%}) have at least one additional trait recorded in a dataset available on Genesys (on average {3,number,0.##} traits in {4,number,0.##} datasets).
twitter.tweet-this=Tweet!
twitter.follow-X=Follow @{0}
......@@ -21,7 +21,7 @@ base.cookie-domain=
base.cookie-secure=false
base.cookie-http-only=false
db.url=jdbc:mysql://localhost/genesys5?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
db.url=jdbc:mysql://localhost/genesys20150630?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
db.driverClassName=com.mysql.jdbc.Driver
db.username=root
db.password=
......
......@@ -632,6 +632,19 @@ $(function() {
});
});
/**
* Tweet
*/
$('.twitter-share-button').click(function(e) {
e.preventDefault();
window.open($(this).attr('href'), 'twitterWindow', 'width=600,height=300,scrollbars=yes,toolbars=no');
});
$('.twitter-follow-button').click(function(e) {
e.preventDefault();
window.open($(this).attr('href'), 'twitterWindow', 'width=600,height=300,scrollbars=yes,toolbars=no');
});
//
// function enableSessionWarning(secondsBeforeExpiry) {
// if ($('#session_expired_popup').length === 0) {
......
......@@ -2211,3 +2211,9 @@ table.terms-table td {
font-style: italic;
direction: ltr;
}
.twitter-share-button {
&[data-size=large] {
font-size: large;
}
}
\ No newline at end of file
......@@ -13,6 +13,9 @@
<li><a href="<c:url value="/sel/" />"><spring:message code="menu.my-list" />
<span class="badge" x-size="${selection.size() gt 0 ? selection.size() : '0'}" id="selcounter">${selection.size() gt 0 ? selection.size() : '0'}</span></a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="right"><local:twitter-follow screenName="GenesysPGR" /></li>
</ul>
</div>
</div>
</div>
......@@ -32,6 +32,11 @@
<a href="#" class="comments-num">12</a>
&bull;
--%>
<%--
<local:tweet text="${activityPost.title}" hashTags="GenesysPGR" />
--%>
<%-- <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>
<local:prettyTime date="${activityPost.postDate.time}" locale="${pageContext.response.locale}" />
......
<%@ tag description="Tweet this!" 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="hashTags" required="false" type="java.lang.String" description="Add a comma-separated list of hashtags to a Tweet using the hashtags parameter. Omit a preceding “#” from each hashtag; the Tweet composer will automatically add the proper space-separated hashtag by language." %>
<%@ attribute name="dataSize" required="false" type="java.lang.String" description="regular or large" %>
<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="twatUrl" value="https://twitter.com/intent/tweet">
<c:param name="url" value="${refUrl}" />
<c:if test="${text != null and text ne ''}">
<c:param name="text" value="${text}" />
</c:if>
<c:if test="${hashTags != null and hashTags ne ''}">
<c:param name="hashtags" value="${hashTags}" />
</c:if>
</c:url>
<a class="twitter-share-button" target="_blank" href="${twatUrl}" data-size="${dataSize}"><spring:message code="twitter.tweet-this" /></a>
<%@ tag description="Follow somebody on Twitter" 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="screenName" required="true" type="java.lang.String" description="Follow this Twitter name" %>
<%@ attribute name="dataSize" required="false" type="java.lang.String" description="regular or large" %>
<c:url var="twatUrl" value="https://twitter.com/intent/follow">
<c:param name="screen_name" value="${screenName}" />
</c:url>
<a class="twitter-follow-button" target="_blank" href="${twatUrl}" data-size="${dataSize}"><spring:message code="twitter.follow-X" arguments="${screenName}" /></a>
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