This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.truncateLines = function(options) { | |
options = $.extend($.fn.truncateLines.defaults, options); | |
return this.each(function(index, container) { | |
container = $(container); | |
var containerLineHeight = Math.ceil(parseFloat(container.css('line-height'))); | |
var maxHeight = options.lines * containerLineHeight; | |
var truncated = false; | |
var truncatedText = $.trim(container.text()); | |
var overflowRatio = container.height() / maxHeight; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<button id="tweet_button">Click to Tweet</button> | |
<script type="text/javascript"> | |
{% plugin rawtext tweet_url %} | |
{% plugin rawtext tweet_text %} | |
{% plugin rawtext tweet_hashtags %} | |
var params = {}; | |
{% if tweet_url %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
$(document).ready( function () { | |
var url = encodeURIComponent('https://www.youtube.com/watch?v=ya7OVaIu7Yg'); | |
var title = encodeURIComponent('This is my super awesome title'); | |
var full_url = 'http://www.facebook.com/sharer.php?u=' + url + '&t=' + title; | |
$('#method1').click( function (e) { | |
e.preventDefault(); | |
window.open(full_url); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% plugin rawtext desktop_url %} | |
<script type="text/javascript"> | |
top.location.href="{{ desktop_url }}"; | |
</script> |