Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: mjibson/tnm
base: 6279c7d6a6
...
head fork: mjibson/tnm
compare: 41d16f4c75
Checking mergeability… Don't worry, you can still create the pull request.
  • 5 commits
  • 9 files changed
  • 0 commit comments
  • 1 contributor
View
49 static/css/blog.css
@@ -17,17 +17,9 @@
.carousel-caption p{color:#ffffff;}
article,aside,details,figcaption,figure,footer,hgroup,nav,section{display:block;}
header{display:block;}
-[hidden]{display:none;}
html{font-size:100%;overflow-y:scroll;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;min-height:100%;height:100%;}
body{font-size:13px;font-size:13px;line-height:1.231;line-height:1.625em;margin:0;color:#666666;font-family:"Segoe UI",Arial,Helvetica,sans-serif;font-weight:normal;min-height:100%;height:100%;background:url(../images/bg/body.png) scroll repeat top center #e4e4e4;}
-body#tinymce{background:#ffffff;margin:10px;max-width:642px;}
::-moz-selection,::selection{background:#333333;color:#ffffff;text-shadow:none;}
-iframe{max-width:100%;}
-button{color:#666666;font-family:"Segoe UI",Arial,Helvetica,sans-serif;font-weight:normal;font-size:13px;font-size:100%;line-height:1.625em;line-height:normal;margin:0;vertical-align:baseline;cursor:pointer;-webkit-appearance:button;}
-label{color:#666666;font-family:"Segoe UI",Arial,Helvetica,sans-serif;font-weight:normal;font-size:13px;line-height:1.625em;cursor:pointer;margin-left:5px;}
-input{color:#666666;font-family:"Segoe UI",Arial,Helvetica,sans-serif;font-weight:normal;font-size:13px;font-size:100%;line-height:1.625em;line-height:normal;margin:0;vertical-align:baseline;}
-select{color:#666666;font-family:"Segoe UI",Arial,Helvetica,sans-serif;font-weight:normal;font-size:13px;font-size:100%;line-height:1.625em;margin:0;vertical-align:baseline;width:auto;}
-textarea{color:#666666;font-family:"Segoe UI",Arial,Helvetica,sans-serif;font-weight:normal;font-size:13px;font-size:100%;line-height:1.625em;margin:0;vertical-align:baseline;vertical-align:top;overflow:auto;resize:vertical;background:white;border:1px solid #e0e0e0;display:block;margin-top:5px;padding:5px;padding:8px;text-align:left;width:214px;width:90%;}
#body{margin:0 auto;width:980px;}#body h5,#body h6{font-weight:bold;font-weight:normal;color:#555555;line-height:1.05em;margin:10px 0;margin-bottom:10px;font-size:14px;}
#body h1{font-weight:bold;font-weight:normal;font-weight:bold;color:#555555;line-height:1.05em;margin:10px 0;margin:0 0 20px;border-bottom:1px solid #e0e0e0;padding-bottom:10px;text-align:center;font-size:32px;}
#body h2{font-weight:bold;font-weight:normal;font-weight:bold;color:#555555;line-height:1.05em;margin:10px 0;margin:0 0 20px;border-bottom:1px solid #e0e0e0;padding-bottom:10px;text-align:center;font-size:24px;}
@@ -46,13 +38,7 @@ b,strong{font-weight:bold;}
blockquote{color:#555555;font-family:'Georgia','Times New Roman',serif;font-size:17px;font-style:italic;line-height:1.25em;padding:0 5px;margin:1em 0;}blockquote p{margin-bottom:3px;}
blockquote.pull-quote-left{border-left:1px solid #e0e0e0;border-left:none;float:right;float:left;margin:0 0 5px 15px;margin:0 15px 5px 0;padding:12px;width:38%;border-right:1px solid #e0e0e0;}
blockquote.pull-quote-right{border-left:1px solid #e0e0e0;float:right;margin:0 0 5px 15px;padding:12px;width:38%;}
-dfn{font-style:italic;}
hr{border:0;display:block;height:1px;border-top:1px solid #cccccc;margin:1em 0;padding:0;}
-ins{background:#ffff99;color:#000000;text-decoration:none;}
-mark{background:#ffff00;color:#000000;font-style:italic;font-weight:bold;}
-kbd,samp{font-family:monospace, monospace;font-size:12px;}
-q{quotes:none;}
-q:before,q:after{content:"";content:none;}
small{font-size:85%;}
sub{font-size:75%;line-height:0;position:relative;vertical-align:baseline;bottom:-0.25em;}
sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;top:-0.5em;}
@@ -64,41 +50,14 @@ ul{line-height:1.05em;list-style:square;margin:1em 0;padding:0 0 0 40px;}
ol{line-height:1.05em;list-style:square;list-style:decimal;margin:1em 0;padding:0 0 0 40px;}ol ol{list-style:upper-alpha;margin-bottom:0;}ol ol ol{list-style:lower-roman;}ol ol ol ol{list-style:lower-alpha;}
ul ul,ul ol,ol ul{margin-bottom:0;}
li{margin-bottom:8px;}
-.dropdown-menu li>a:hover,.dropdown-menu .active>a,.dropdown-menu .active>a:hover{background:none;}
-.dropdown-menu li{margin:0;}
dd{margin:0 0 0 40px;}
nav ul,nav ol{list-style:none;list-style:none;list-style-image:none;list-style-image:none;margin:0;margin:0;padding:0;padding:0;}
nav li{list-style:none;list-style-image:none;margin:0;padding:0;}
nav .sub-menu{display:none;}
img{border:0;-ms-interpolation-mode:bicubic;vertical-align:middle;}
-button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}
-.field{margin-bottom:20px;}
-.field.submit{margin:0;}
-.error{color:#ef362b;text-transform:none;}
-.required{color:#ef362b;}
table{border-spacing:0;margin-bottom:10px;}
td{vertical-align:top;}
-.screen-reader-text{position:absolute;left:-9000px;}
-.hidden{display:none;}
-.text-l{text-align:left;}
-.text-c{text-align:center;}
-.text-r{text-align:right;}
-.float-l{float:left;}
-.float-r{float:right;}
-.alignleft{float:left;margin:0 1em 1em 0;padding:3px;}
-.alignright{float:left;float:right;margin:0 1em 1em 0;margin:0 0 1em 1em;padding:3px;}
-.aligncenter{display:block;margin:0 auto;}
-.wp-caption{margin-top:0.4em;background:#e7e7e7;margin-bottom:25px;padding:10px 5px;}.wp-caption img{display:block;margin:0 auto;max-width:100%;}
-.wp-caption .wp-caption-text{font-size:14px;line-height:1.45em;margin:5px 12px;}
-.gallery-caption{font-size:14px;}
.clear{clear:both;}
-.columns .half:nth-child(2n),.columns .third:nth-child(3n),.columns .quater:nth-child(4n){margin-right:0 !important;}
-.columns .half{display:inline;float:left;margin-right:4%;width:48%;}
-.columns .third{display:inline;float:left;margin-right:2%;width:32%;}
-.columns .twothirds{display:inline;float:left;margin-right:2%;width:66%;}
-.columns .quater{display:inline;float:left;margin-right:2.5%;width:23%;}
-.columns .last{margin-right:0 !important;}
-#page{min-height:100%;}
#primary{float:right;padding:30px 0 50px 25px;width:690px;position:relative;}
.post>header{margin-bottom:36px;}
.post .entry-date{background:none repeat scroll 0 0 #666666;border-radius:30px 30px 30px 30px;height:60px;position:absolute;right:-19px;top:78px;width:60px;}
@@ -112,9 +71,7 @@ nav.primary li{float:left;}
#endless{margin-top:-10px;}#endless .hentry{background:#ffffff;margin:10px;padding:10px;}#endless .hentry .title a:after{bottom:-11px;content:url(../images/icon/bullet-arrow-right.png);font-size:22px;height:22px;line-height:22px;position:absolute;right:0;font-family:'Oxygen',sans-serif;}
#endless .hentry .feature-image a:hover img{opacity:0.8;}
#endless .hentry .meta{border-top:1px solid #e0e0e0;font-size:12px;padding-top:8px;text-align:right;}
-#endless .hentry .has-thumbnail .meta{position:absolute;}
-#endless-pad{float:right;width:305px;text-align:center;background:#ffffff;margin:10px;padding:10px;-webkit-box-shadow:0 0 2px 0 #b8b8b8;-moz-box-shadow:0 0 2px 0 #b8b8b8;box-shadow:0 0 2px 0 #b8b8b8;}#endless-pad .dropdown-toggle{display:block;float:none;color:#999999;border-radius:0 0 0 0;}#endless-pad .dropdown-toggle .caret{float:right;}
-#endless-pad .dropdown-menu{width:99%;}
+#endless-pad{float:right;width:305px;text-align:center;background:#ffffff;margin:10px;padding:10px;-webkit-box-shadow:0 0 2px 0 #b8b8b8;-moz-box-shadow:0 0 2px 0 #b8b8b8;box-shadow:0 0 2px 0 #b8b8b8;}
#endless-pager{cursor:pointer;display:block;margin:10px;text-shadow:none;background:none repeat scroll 0 0 #666666;color:#b2b2b2;font-family:'Patua One',cursive;border-radius:0 0 0 0;border:none;-webkit-box-shadow:2px 2px 0px 0px rgba(0, 0, 0, 0.3);-moz-box-shadow:2px 2px 0px 0px rgba(0, 0, 0, 0.3);box-shadow:2px 2px 0px 0px rgba(0, 0, 0, 0.3);}
#infscr-loading{position:absolute;margin:10px;bottom:-30px;}
.meta span{padding-left:20px;margin-left:5px;}
@@ -161,9 +118,6 @@ nav.primary li{float:left;}
.widget{border-bottom:1px solid #e0e0e0;padding:20px 20px 20px 40px;position:relative;}.widget .title{border:none;font-size:18px;line-height:0.85em;margin-bottom:20px;padding:0;text-align:left;font-family:'Oxygen',sans-serif;}
.widgets:before{content:url(../images/icon/bullet-grey.png);bottom:-4px;bottom:auto;height:7px;font-size:7px;line-height:7px;left:0;position:absolute;width:7px;z-index:100;top:-4px;}
.widget:before{content:url(../images/icon/bullet-grey.png);bottom:-4px;height:7px;font-size:7px;line-height:7px;left:0;position:absolute;width:7px;z-index:100;}
-.sneek-widget-twitter{padding-right:40px;}.sneek-widget-twitter .tweets{list-style:none;margin:0;}.sneek-widget-twitter .tweets li{border-bottom:1px dotted #e0e0e0;margin-bottom:10px;margin-left:-20px;padding-left:20px;padding-bottom:10px;}
-.sneek-widget-twitter .tweets li.last{border:0;padding:0;margin:0;}
-.sneek-widget-taxonomy{color:#999999;}
#social-networks ul{list-style:none;margin:0;padding:0;text-align:center;}
#social-networks li{display:inline-block;margin:0 1px 3px 0;}
#social-networks a{background:scroll no-repeat center center #666666;display:block;height:34px;width:35px;-webkit-transition:background-color 0.3s ease-in-out;-moz-transition:background-color 0.3s ease-in-out;-ms-transition:background-color 0.3s ease-in-out;-o-transition:background-color 0.3s ease-in-out;transition:background-color 0.3s ease-in-out;}
@@ -179,6 +133,5 @@ nav.primary li{float:left;}
#social-networks .twitter a:hover{background:url(../images/social-icons.png) -35px -34px;}
#social-networks .youtube a{background:url(../images/social-icons.png) -210px 0;}
#social-networks .youtube a:hover{background:url(../images/social-icons.png) -210px -34px;}
-#sneek-widget-credit{padding:20px 20px 20px 40px;}#sneek-widget-credit p{font-size:11px;margin:0;}
.hentry{-webkit-box-shadow:0 0 2px 0 #b8b8b8;-moz-box-shadow:0 0 2px 0 #b8b8b8;box-shadow:0 0 2px 0 #b8b8b8;}
*{-webkit-transition:color 0.1s ease-in-out;-moz-transition:color 0.1s ease-in-out;-ms-transition:color 0.1s ease-in-out;-o-transition:color 0.1s ease-in-out;transition:color 0.1s ease-in-out;}
View
349 static/css/blog.less
@@ -159,10 +159,6 @@ header {
display:block;
}
-[hidden] {
- display:none;
-}
-
html {
font-size:100%;
overflow-y:scroll;
@@ -186,93 +182,12 @@ body {
background:url(../images/bg/body.png) scroll repeat top center #e4e4e4;
}
-body#tinymce {
- background:#ffffff;
- margin:10px;
- max-width:642px;
-}
-
::-moz-selection, ::selection {
background:#333333;
color:#ffffff;
text-shadow:none;
}
-iframe {
- max-width:100%;
-}
-
-button {
- color:#666666;
- font-family:"Segoe UI", Arial, Helvetica, sans-serif;
- font-weight:normal;
- font-size:13px;
- font-size:100%;
- line-height:1.625em;
- line-height:normal;
- margin:0;
- vertical-align:baseline;
- cursor:pointer;
- -webkit-appearance:button;
-}
-
-label {
- color:#666666;
- font-family:"Segoe UI", Arial, Helvetica, sans-serif;
- font-weight:normal;
- font-size:13px;
- line-height:1.625em;
- cursor:pointer;
- margin-left:5px;
-}
-
-input {
- color:#666666;
- font-family:"Segoe UI", Arial, Helvetica, sans-serif;
- font-weight:normal;
- font-size:13px;
- font-size:100%;
- line-height:1.625em;
- line-height:normal;
- margin:0;
- vertical-align:baseline;
-}
-
-select {
- color:#666666;
- font-family:"Segoe UI", Arial, Helvetica, sans-serif;
- font-weight:normal;
- font-size:13px;
- font-size:100%;
- line-height:1.625em;
- margin:0;
- vertical-align:baseline;
- width:auto;
-}
-
-textarea {
- color:#666666;
- font-family:"Segoe UI", Arial, Helvetica, sans-serif;
- font-weight:normal;
- font-size:13px;
- font-size:100%;
- line-height:1.625em;
- margin:0;
- vertical-align:baseline;
- vertical-align:top;
- overflow:auto;
- resize:vertical;
- background:white;
- border:1px solid #e0e0e0;
- display:block;
- margin-top:5px;
- padding:5px;
- padding:8px;
- text-align:left;
- width:214px;
- width:90%;
-}
-
#body {
margin:0 auto;
width:980px;
@@ -435,10 +350,6 @@ blockquote.pull-quote-right {
width:38%;
}
-dfn {
- font-style:italic;
-}
-
hr {
border:0;
display:block;
@@ -448,33 +359,6 @@ hr {
padding:0;
}
-ins {
- background:#ffff99;
- color:#000000;
- text-decoration:none;
-}
-
-mark {
- background:#ffff00;
- color:#000000;
- font-style:italic;
- font-weight:bold;
-}
-
-kbd, samp {
- font-family:monospace, monospace;
- font-size:12px;
-}
-
-q {
- quotes:none;
-}
-
-q:before, q:after {
- content:"";
- content:none;
-}
-
small {
font-size:85%;
}
@@ -500,9 +384,6 @@ a {
text-decoration:none;
}
-a:visited {
-}
-
a:hover {
text-decoration:underline;
outline:0;
@@ -552,17 +433,6 @@ li {
margin-bottom:8px;
}
-.dropdown-menu {
-
- li > a:hover, .active > a, .active > a:hover {
- background:none;
- }
-
- li {
- margin:0;
- }
-}
-
dd {
margin:0 0 0 40px;
}
@@ -598,34 +468,6 @@ img {
vertical-align:middle;
}
-button::-moz-focus-inner, input::-moz-focus-inner {
- border:0;
- padding:0;
-}
-
-.field {
- margin-bottom:20px;
-}
-
-.field.submit {
- margin:0;
-}
-
-.error {
- color:#ef362b;
- text-transform:none;
-}
-
-.required {
- color:#ef362b;
-}
-
-input:focus, textarea:focus, input:valid, textarea:valid {
-}
-
-input:invalid, textarea:invalid {
-}
-
table {
border-spacing:0;
margin-bottom:10px;
@@ -635,124 +477,10 @@ td {
vertical-align:top;
}
-.screen-reader-text {
- position:absolute;
- left:-9000px;
-}
-
-.hidden {
- display:none;
-}
-
-.text-l {
- text-align:left;
-}
-
-.text-c {
- text-align:center;
-}
-
-.text-r {
- text-align:right;
-}
-
-.float-l {
- float:left;
-}
-
-.float-r {
- float:right;
-}
-
-.alignleft {
- float:left;
- margin:0 1em 1em 0;
- padding:3px;
-}
-
-.alignright {
- float:left;
- float:right;
- margin:0 1em 1em 0;
- margin:0 0 1em 1em;
- padding:3px;
-}
-
-.aligncenter {
- display:block;
- margin:0 auto;
-}
-
-.wp-caption {
- margin-top:0.4em;
- background:#e7e7e7;
- margin-bottom:25px;
- padding:10px 5px;
-
- img {
- display:block;
- margin:0 auto;
- max-width:100%;
- }
-
- .wp-caption-text {
- font-size:14px;
- line-height:1.45em;
- margin:5px 12px;
- }
-}
-
-.gallery-caption {
- font-size:14px;
-}
-
.clear {
clear:both;
}
-.columns {
-
- .half:nth-child(2n), .third:nth-child(3n), .quater:nth-child(4n) {
- margin-right:0 !important;
- }
-
- .half {
- display:inline;
- float:left;
- margin-right:4%;
- width:48%;
- }
-
- .third {
- display:inline;
- float:left;
- margin-right:2%;
- width:32%;
- }
-
- .twothirds {
- display:inline;
- float:left;
- margin-right:2%;
- width:66%;
- }
-
- .quater {
- display:inline;
- float:left;
- margin-right:2.5%;
- width:23%;
- }
-
- .last {
- margin-right:0 !important;
- }
-}
-
-#page {
- min-height:100%;
-}
-
#primary {
float:right;
padding:30px 0 50px 25px;
@@ -805,28 +533,9 @@ td {
}
nav.primary {
-
- a:link, a:visited {
- }
-
- .current_page_parent a, .current-menu-item a {
- }
-
li {
float:left;
}
-
- li:first-child {
- }
-
- li:last-child {
- }
-
- a:hover {
- }
-
- a:focus {
- }
}
#title {
@@ -876,10 +585,6 @@ nav.primary {
padding-top:8px;
text-align:right;
}
-
- .has-thumbnail .meta {
- position:absolute;
- }
}
}
@@ -893,21 +598,6 @@ nav.primary {
-webkit-box-shadow:0 0 2px 0 #b8b8b8;
-moz-box-shadow:0 0 2px 0 #b8b8b8;
box-shadow:0 0 2px 0 #b8b8b8;
-
- .dropdown-toggle {
- display:block;
- float:none;
- color:#999999;
- border-radius:0 0 0 0;
-
- .caret {
- float:right;
- }
- }
-
- .dropdown-menu {
- width:99%;
- }
}
#endless-pager {
@@ -1285,36 +975,6 @@ nav.primary {
z-index:100;
}
-.widget:last-child {
-}
-
-.sneek-widget-twitter {
- padding-right:40px;
-
- .tweets {
- list-style:none;
- margin:0;
-
- li {
- border-bottom:1px dotted #e0e0e0;
- margin-bottom:10px;
- margin-left:-20px;
- padding-left:20px;
- padding-bottom:10px;
- }
-
- li.last {
- border:0;
- padding:0;
- margin:0;
- }
- }
-}
-
-.sneek-widget-taxonomy {
- color:#999999;
-}
-
#social-networks {
ul {
list-style:none;
@@ -1389,15 +1049,6 @@ nav.primary {
}
}
-#sneek-widget-credit {
- padding:20px 20px 20px 40px;
-
- p {
- font-size:11px;
- margin:0;
- }
-}
-
.hentry {
-webkit-box-shadow:0 0 2px 0 #b8b8b8;
-moz-box-shadow:0 0 2px 0 #b8b8b8;
View
74 static/js/blog.js
@@ -0,0 +1,74 @@
+jQuery(function($){
+ /* Overlays */
+ $('.hentry .feature-image a').live({
+ mouseenter: function() {
+ $(this).find('.overlay').stop(true,true).fadeIn();
+ },
+ mouseleave: function() {
+ $(this).find('.overlay').stop(true,true).fadeOut();
+ }
+ });
+
+ /* Scroll top link */
+ $(window).scroll(function(){
+ if ($(this).scrollTop() > $('#secondary').outerHeight(true) / 2) {
+ $('.scrollup').fadeIn();
+ } else {
+ $('.scrollup').fadeOut();
+ }
+ });
+
+ $('.scrollup').click(function(){
+ $("html, body").animate({ scrollTop: 0 }, 600);
+ return false;
+ });
+
+ // Slideshow
+ $('.carousel .carousel-inner').each(function(){
+ if( $(this).find('.slide').length == 1 ) {
+ $(this).find('.slide').css('position','static');
+ return;
+ }
+
+ var p = this.parentNode;
+ var Sneek = {"cycle":{"fx":"scrollHorz","speed":1000,"timeout":5500}};
+ var cycle_settings = {
+ fx: Sneek.cycle.fx, // FX for a full list and demo see {@link http://jquery.malsup.com/cycle/browser.html}
+ next: $('.carousel-control.right', p), // Slider nav control, please leave!
+ prev: $('.carousel-control.left', p), // Slider nav control, please leave!
+ timeout: Number(Sneek.cycle.timeout), // Slide timeout
+ speed: Number(Sneek.cycle.speed) // Animation speed
+ }
+
+ // Load slideshow
+ $(this).show().cycle(cycle_settings);
+
+ // Show controls
+ $(this).siblings('.carousel-control').show();
+ });
+
+ var $timeline = $('#endless');
+
+ /* Setup Masonry Plugin */
+ $timeline.imagesLoaded(function(){
+ $timeline.masonry({
+ itemSelector: '.hentry',
+ columnWidth: $('#endless .hentry:first-child').outerWidth(true),
+ cornerStampSelector: ( $('#endless-pad').length == 1 ) ? '#endless-pad' : '',
+ isAnimated: true
+ });
+ })
+
+ $.getJSON('http://api.twitter.com/1/statuses/user_timeline.json?callback=?&include_entities=true&screen_name=thenextmuse&count=5&trim_user=1', function(data) {
+ $.each(data, function(key, val) {
+ var t = val.text;
+ for(var i = 0; i < val.entities.urls.length; i++) {
+ var u = val.entities.urls[i];
+ var link = '<a href="' + u.expanded_url + '">' + u.display_url + '</a>';
+ t = t.replace(u.url, link);
+ }
+
+ $("#tweet-list").append('<li>' + t + '</li>');
+ });
+ });
+});
View
185 static/js/global.js
@@ -1,185 +0,0 @@
-jQuery(function($){
-
- /**
- * Global
- */
- $('.columns .half:nth-child(2n), .columns .third:nth-child(3n), .columns .quater:nth-child(4n)').addClass('last');
-
- /* Menus */
- var $menuToggle = function(){ $(this).children('.sub-menu').stop(true,true).toggle('250'); }
- $('.menu li:has(.sub-menu)').addClass('has-sub-menu').hoverIntent( {
- over: $menuToggle,
- out: $menuToggle,
- timeout: 250
- } );
-
- /* Overlays */
- $('.hentry .feature-image a').live({
- mouseenter: function() {
- $(this).find('.overlay').stop(true,true).fadeIn();
- },
- mouseleave: function() {
- $(this).find('.overlay').stop(true,true).fadeOut();
- }
- });
-
- /* Scroll top link */
- $(window).scroll(function(){
- if ($(this).scrollTop() > $('#secondary').outerHeight(true) / 2) {
- $('.scrollup').fadeIn();
- } else {
- $('.scrollup').fadeOut();
- }
- });
-
- $('.scrollup').click(function(){
- $("html, body").animate({ scrollTop: 0 }, 600);
- return false;
- });
-
-
-
- // Slideshow
- $('.carousel .carousel-inner').each(function(){
-
-
- if( $(this).find('.slide').length == 1 ) {
- $(this).find('.slide').css('position','static');
- return;
- }
-
- var p = this.parentNode;
- var cycle_settings = {
- fx: Sneek.cycle.fx, // FX for a full list and demo see {@link http://jquery.malsup.com/cycle/browser.html}
- next: $('.carousel-control.right', p), // Slider nav control, please leave!
- prev: $('.carousel-control.left', p), // Slider nav control, please leave!
- timeout: Number(Sneek.cycle.timeout), // Slide timeout
- speed: Number(Sneek.cycle.speed) // Animation speed
- }
-
- // Load slideshow
- $(this).show().cycle(cycle_settings);
-
- // Show controls
- $(this).siblings('.carousel-control').show();
-
- });
-
-
- var $timeline = $('#endless');
-
- /* Setup Masonry Plugin */
- $timeline.imagesLoaded(function(){
- $timeline.masonry({
- itemSelector: '.hentry',
- columnWidth: $('#endless .hentry:first-child').outerWidth(true),
- cornerStampSelector: ( $('#endless-pad').length == 1 ) ? '#endless-pad' : '',
- isAnimated: true
- });
- })
-
-
-
-
- /**
- * Contact Form Ajax
- */
- var $contactForm = $('#contact-form');
- var $customer = new Object();
-
- $customer.name = $('#customer-name');
- $customer.email = $('#customer-email');
- $customer.message = $('#customer-message');
- $ajaxLoader = $('#contact-form .ajax-loader');
-
-
- // Add our error spans.
- $contactForm.find('.field label').append('<span class="error">');
-
- $contactForm.submit(function(evt){
- evt.preventDefault();
-
- $is_error = false;
-
- $ajaxLoader.show();
-
- // Clear errors
- $(this).find('input, textarea').removeClass('input-error');
- $(this).find('span.error').text('');
-
- // Message
- if( '' === $customer.message.val() ) {
- $is_error = true;
- $customer.message.addClass('input-error').focus().prev('label').find('span.error').text('A message is required.');
- }
-
- // Email
- if( '' === $customer.email.val() ) {
- $is_error = true;
- $customer.email.addClass('input-error').focus().prev('label').find('span.error').text('A valid email is required.');
- } else if( false == is_valid_email( $customer.email.val() ) ) {
- $is_error = true;
- $customer.email.addClass('input-error').focus().prev('label').find('span.error').text('Invalid email address.');
- }
-
- // Name
- if( '' === $customer.name.val() ) {
- $is_error = true;
- $customer.name.addClass('input-error').focus().prev('label').find('span.error').text('Your name is required.');
- }
-
- // Shall we send?
- if( false === $is_error ) {
-
- var $data = {
- action: 'send_message',
- data: {
- name: $customer.name.val(),
- email: $customer.email.val(),
- message: $customer.message.val()
- }
- }
-
- $.post( ajax_url, $data, function( response ) {
-
- $response = eval( '(' + response + ')' );
-
- if( 'success' == $response.status ) {
- $contactForm.find(':input').not(':button, :submit, :reset, :hidden').val('');
- $contactForm.hide();
- }
-
- $ajaxLoader.hide();
-
- $contactForm.before('<div class="alert alert-' + $response.status + '">' + $response.message + '</div>');
-
- });
- } else {
- $ajaxLoader.hide();
- }
-
-
-
-
- });
-
-
- /**
- * Is this a valid email?
- *
- * @access public
- * @param mixed email
- * @return void
- */
- function is_valid_email( email )
- {
- if( email == undefined )
- return false;
-
- var reg_expr = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
-
- return reg_expr.test( email );
- }
-
-
-});
View
2,258 static/js/jquery.jtweetsanywhere-1.3.1.js
@@ -1,2258 +0,0 @@
-/**
- * jTweetsAnywhere V1.3.1
- * http://thomasbillenstein.com/jTweetsAnywhere/
- *
- * Copyright 2011, Thomas Billenstein
- * Licensed under the MIT license.
- * http://thomasbillenstein.com/jTweetsAnywhere/license.txt
- */
-
-
-/**
- * The code below is used as supplied by Twitter (https://dev.twitter.com/docs/intents)
- *
- * Twitter says:
-
- * "Some sites may prefer to embed the unobtrusive Web Intents pop-up Javascript inline
- * or without a dependency to platform.twitter.com. The snippet below will offer the
- * equivalent functionality without the external dependency."
- */
-(function()
-{
- if (window.__twitterIntentHandler)
- return;
-
- var intentRegex = /twitter\.com(\:\d{2,4})?\/intent\/(\w+)/,
- windowOptions = 'scrollbars=yes,resizable=yes,toolbar=no,location=yes',
- width = 550,
- height = 420,
- winHeight = screen.height,
- winWidth = screen.width;
-
-
- function handleIntent(e)
- {
- e = e || window.event;
-
- var target = e.target || e.srcElement,
- m, left, top;
-
- while (target && target.nodeName.toLowerCase() !== 'a')
- {
- target = target.parentNode;
- }
-
- if (target && target.nodeName.toLowerCase() === 'a' && target.href)
- {
- m = target.href.match(intentRegex);
- if (m)
- {
- left = Math.round((winWidth / 2) - (width / 2));
- top = 0;
-
- if (winHeight > height)
- {
- top = Math.round((winHeight / 2) - (height / 2));
- }
-
- window.open(target.href, 'intent', windowOptions + ',width=' + width + ',height=' + height + ',left=' + left + ',top=' + top);
- e.returnValue = false;
- e.preventDefault && e.preventDefault();
- }
- }
- }
-
- if (document.addEventListener)
- {
- document.addEventListener('click', handleIntent, false);
- }
- else if (document.attachEvent)
- {
- document.attachEvent('onclick', handleIntent);
- }
-
- window.__twitterIntentHandler = true;
-}());
-
-
-/**
- * JTA_I18N is based on SimpleI18N V0.1.0
- *
- * SimpleI18N.js is a tiny library for simple i18n support in Javascript.
- * Currently only translation is supported.
- */
-(function()
-{
- if (window.__JTA_I18N)
- {
- return;
- }
-
- JTA_I18N = function()
- {
- var _resources = {};
-
- function ResourceBundle(locale, resources)
- {
- this.getLocale = function()
- {
- return locale;
- };
-
- this.get = function(key, params)
- {
- return xlate(key, 1, params);
- };
-
- this._ = this.get;
-
- this.nget = function(singular, plural, count, params)
- {
- return count === 1 ? xlate(singular, 1, params) : xlate(plural, count, params);
- };
-
- this.__ = this.nget;
-
- function xlate(key, count, params)
- {
- var resource = getValue(key);
-
- if (count !== 1 && typeof resource === "object")
- {
- resource = evalMulti(key, resource, count);
- }
-
- if (resource && params)
- {
- for (p in params)
- {
- resource = resource.replace(p, getValue(params[p]));
- }
- }
-
- return resource;
- };
-
- function getValue(resource)
- {
- return resources ? (resources[resource] || resource) : resource;
- };
-
- function evalMulti(key, resource, count)
- {
- for (pat in resource)
- {
- var re = /(\d+)\s*-\s*(\d+)/,
- match = re.exec(pat);
-
- if (match)
- {
- var from = match[1];
- var to = match[2];
- if (count >= from && count <= to)
- {
- return resource[pat];
- }
- }
-
- re = /([<>]=?)\s*(\d+)/;
- match = re.exec(pat);
-
- if (match)
- {
- var op = match[1];
- var num = match[2];
- if (op === '>' && count > num)
- {
- return resource[pat];
- }
- else if (op === '>=' && count >= num)
- {
- return resource[pat];
- }
- else if (op === '<' && count < num)
- {
- return resource[pat];
- }
- else if (op === '<=' && count <= num)
- {
- return resource[pat];
- }
- }
-
- re = /\s*,\s*/;
- match = pat.split(re);
-
- if (match)
- {
- for (var i = 0; i < match.length; i++)
- {
- if (count === ~~match[i])
- {
- return resource[pat];
- }
- }
- }
- }
-
- return key;
- }
- };
-
- return {
-
- addResourceBundle: function(project, locale, resources)
- {
- if (!_resources[project])
- {
- _resources[project] = {};
- }
-
- _resources[project][locale] = resources;
- },
-
- getResourceBundle: function(project, locale)
- {
- return new ResourceBundle(locale, _resources[project] ? _resources[project][locale] : null);
- }
- };
- }();
-
- window.__JTA_I18N = true;
-}());
-
-JTA_I18N.addResourceBundle('jTweetsAnywhere', 'en',
-{
- '$$monthNames': [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]
-});
-
-(function($)
-{
- $.fn.jTweetsAnywhere = function(config)
- {
- // setup the default options
- var options = $.extend(
- {
- /**
- * The user's name who's tweet feed or list feed is displayed. This
- * param is also used when a Twitter "Follow Button" is displayed. Usually
- * this param is a string, but can also be an array of strings. If an array
- * is supplied (and the params 'list' and 'searchParams' are null), a
- * combined feed of all users is displayed.
- *
- * Sample: 'tbillenstein' or ['twitterapi', '...', '...']
- */
- username: 'tbillenstein',
-
- /**
- * The name of a user's list where the tweet feed is generated from. The special
- * list name 'favorites' can be used to display a user's favorited tweets.
- */
- list: null,
-
- /**
- * A single search param string or an array of search params, to be used in
- * a Twitter search call. All Twitter Search Params are supported
- * See here for the details:
- * http://apiwiki.twitter.com/Twitter-Search-API-Method%3A-search
- *
- * Sample: 'q=twitter' or ['q=twitter', 'geocode=48.856667,2.350833,30km']
- */
- searchParams: null,
-
- /**
- * The number of tweets shown in the tweet feed. If this param is 0, no feed
- * is displayed. For user or list feeds the maximum count is 20, for search
- * results the maximum count is 100.
- *
- * Unlike in previous releases, since 1.2.0 jTweetsAnywhere is based on a
- * tweets caching algorithm that will always deliver the requested count of
- * tweets accepting that this request can only be fullfilled by calling Twitter
- * more than once.
- *
- * IMPORTANT: Please always keep in mind, that the use of the Twitter API is
- * rate limited. Non-authenticated users are rated IP-based and you have only
- * 150 calls per hour available. Every retrieval of tweets counts and so does
- * for example hovering over a profile image to show the hovercard.
- * jTweetsAnywhere will always check the remaining count of free API calls before
- * actually calling Twitter to avoid black listing your visitor's IP.
- */
- count: 0,
-
- /**
- * A flag (true/false) that specifies whether to display a profile image in
- * tweets. If the param is set to null (the default value), a profile image
- * is displayed only if the feed represents a user's list or the result of a
- * Twitter search.
- *
- * THIS OPTION IS DEPRECATED. You should use showTweetFeed.showProfileImages
- * instead.
- */
- tweetProfileImagePresent: null,
-
- /**
- * Each tweet that is loaded from Twitter will pass the tweetFilter. if
- * the filter returns true, the tweet will be added to the tweets cache
- * otherwise it is ignored. The defaultTweetFilter alsways retruns true
- * but you can supply your own tweet filter to customize the tweet feed.
- */
- tweetFilter: defaultTweetFilter,
-
- /**
- * A flag (true/false) that specifies whether to display a Tweet Feed
- * or an object literal representing the configuration options for the
- * Tweet Feed. This flag works in conjunction with the count parameter:
- * - if count equals 0, no feed is displayed, ignoring showTweetFeed
- * - if count not equals 0 and showTweetFeed equals false, no feed
- * is displayed
- * {
- * autoConformToTwitterStyleguide: false,
- * // Boolean - as the name implies, sets all options to confirm to Twitter's
- * // styleguide regulations. Implies:
- * // showTweetFeed: {
- * // showUserFullNames: null, // null means: if usernames are shown, show
- * // // fullnames too
- * // showTwitterBird: true,
- * // showActionReply: true,
- * // showActionRetweet: true,
- * // showActionFavorite: true
- * // }
- *
- * showTwitterBird: true, // Boolean - show Twitter bird icon beneath the timestamp of a tweet, linking to
- * // the tweeter's MiniProfile Web Intent
- *
- * showTimestamp: true, // A flag (true/false) that specifies whether to display a tweet's timestamp
- * // or an object literal representing the configuration options for the
- * // timestamp.
- * // {
- * // refreshInterval: 0, // Time in seconds to be waited until the
- * // // timestamps of the displayed tweets get refreshed
- * // // 0 means no refreshing.
- * // }
- *
- * showSource: false, // Boolean - Show info about the source of the tweet.
- *
- * showGeoLocation: true, // Boolean - Show geolocation info and link to Google maps.
- *
- * showInReplyTo: true, // Boolean - Show link to the "replied to" tweet (if available).
- *
- * showActionReply: false, // Boolean - Show tweet's 'Reply' action (supplies a link to popup the tweet's
- * // Reply Web Intent)
- *
- * showActionRetweet: false, // Boolean - Show tweet's 'Retweet' action (supplies a link to popup the tweet's
- * // Retweet Web Intent)
- *
- * showActionFavorite: false, // Boolean - Show tweet's 'Favorite' action (supplies a link to popup the tweet's
- * // Favorite Web Intent)
- *
- * showProfileImages: null, // A flag (true/false) that specifies whether to display a profile image in
- * // tweets. If the param is set to null (the default value), a profile image
- * // is displayed only if the feed represents a user's list or the result of a
- * // Twitter search.
- *
- * showUserScreenNames: null, // A flag (true/false/null) that specifies whether to display a username in
- * // tweets. If the param is set to null (the default value), a username
- * // is displayed only if the feed represents a user's list or the result of a
- * // Twitter search.
- *
- * showUserFullNames: false, // A flag (true/false/null) that specifies whether to display a user's full name
- * // in tweets. If the param is set to null, a user's full name
- * // is displayed only if the feed represents a user's list or the result of a
- * // Twitter search.
- *
- * expandHovercards: false, // Boolean - Show Hovercards in expanded mode.
- *
- * includeRetweets: true, // Boolean - Include native retweets in a user's tweet feed
- *
- * paging: // An object literal representing the configuration options for the
- * { // paging support, that specifies how more/earlier tweets can be loaded
- * mode: "none" // by using the supplied UI controls (more/next buttons, scrollbar).
- * }, // Accepted values for mode are: "none" | "more" | "prev-next" | "endless-scroll"
- * // if mode equals "endless-scroll" you have to set the height of the tweet feed
- * // element (.jta-tweet-list) in your CSS to get a scrollbar! You should also set
- * // the "overflow" attribute to "auto".
- *
- * autorefresh: // An object literal representing the configuration options for the
- * { // autorefresh behaviour.
- *
- * // IMPORTANT: Please always keep in mind, that using the Twitter API is rate
- * // limited. Non-authenticated users are rated IP-based and you have only 150
- * // calls per hour available. Every retrieval of tweets counts and so does for
- * // example hovering over a profile image to show the hovercard. jTweetsAnywhere will
- * // always check the remaining count of free API calls before actually calling
- * // Twitter to avoid black listing your visitor's IP.
- *
- * // However - choose your settings wisely to keep your visitors happy. An update
- * // interval of 30 seconds on a feed that is updated averaged once per hour
- * // does not make sense and is a total waste of remaining API calls!
- *
- * mode: "none", // Accepted values for mode are: "none" | "auto-insert" | "trigger-insert"
- * // "none" (the default value) - disables the autorefresh feature
- * // "auto-insert" - automatically insert the new tweets on top of the tweet feed
- * // "trigger-insert" - if new tweets arrived, show or update a button that displays
- * // the number of new tweets. These new tweets are inserted on top of the tweet
- * // feed, if the user clicks on the button.
- *
- * interval: 60, // Time in seconds to be waited until the next request for new tweets. Minimum
- * // value is 30.
- *
- * duration: 3600 // Time in seconds for how long the autorefresh will be active. After
- * // this period of time, autorefreshing will stop. A value of -1 means
- * // autorefresh for ever.
- * }
- * }
- */
- showTweetFeed: true,
-
- /**
- * A flag (true/false) that specifies whether to display a Twitter "Follow
- * Button".
- */
- showFollowButton: false,
-
- /**
- * A flag (true/false) that specifies whether to display a Twitter "Connect
- * Button" or an object literal representing the configuration options for
- * the "Tweet Box".
- * {
- * size: 'medium' // String - The size of the Connect Button. Valid values are: small, medium, large, xlarge
- * }
- */
- showConnectButton: false,
-
- /**
- * A flag (true/false) that specifies whether to display Login Infos.
- */
- showLoginInfo: false,
-
- /**
- * A flag (true/false) that specifies whether to display a Twitter "Tweet
- * Box" or an object literal representing the configuration options for
- * the "Tweet Box".
- * {
- * counter: true, // Boolean - Display a counter in the Tweet Box for counting characters
- * width: 515, // Number - The width of the Tweet Box in pixels
- * height: 65, // Number - The height of the Tweet Box in pixels
- * label: "What's happening?", // String - The text above the Tweet Box, a call to action
- * defaultContent: <none>, // String - Pre-populated text in the Tweet Box. Useful for an @mention, a #hashtag, a link, etc.
- * onTweet: <none> // Function - Specify a listener for when a tweet is sent from the Tweet Box. The listener receives two arguments: a plaintext tweet and an HTML tweet
- * }
- */
- showTweetBox: false,
-
- /**
- * Identifies the locale for I18N support. The default locale is 'en'. To use this option you have to inlude the
- * adequate locale script, jtweetsanywhere-{language}-{version}.js, e.g. jtweetsanywhere-de-1.3.0.js
- */
- locale: 'en',
-
- /**
- * A dataProvider is a function that delivers the "raw" Twitter data in
- * JSON format. ATM internal use only!
- */
- tweetDataProvider:
- defaultTweetDataProvider,
- //mockedTweetDataProvider,
- rateLimitDataProvider:
- defaultRateLimitDataProvider,
- //mockedRateLimitDataProvider,
-
- /**
- * A decorator is a function that is responsible for constructing a certain
- * element of the widget. Most of the decorators return a HTML string.
- * Exceptions are the mainDecorator, which defines the basic sequence of
- * the widget's components, plus the linkDecorator, the usernameDecorator
- * and the hashtagDecorator which return the string that is supplied as a
- * function param, enriched with the HTML tags.
- *
- * For details, see the implementations of the default decorators. Each
- * default decorator can be overwritten by your own implementation.
- */
- mainDecorator: defaultMainDecorator,
-
- tweetFeedDecorator: defaultTweetFeedDecorator,
-
- tweetDecorator: defaultTweetDecorator,
- tweetProfileImageDecorator: defaultTweetProfileImageDecorator,
- tweetBodyDecorator: defaultTweetBodyDecorator,
- tweetUsernameDecorator: defaultTweetUsernameDecorator,
- tweetTextDecorator: defaultTweetTextDecorator,
-
- tweetAttributesDecorator: defaultTweetAttributesDecorator,
- tweetTwitterBirdDecorator: defaultTweetTwitterBirdDecorator,
- tweetTimestampDecorator: defaultTweetTimestampDecorator,
- tweetSourceDecorator: defaultTweetSourceDecorator,
- tweetGeoLocationDecorator: defaultTweetGeoLocationDecorator,
- tweetInReplyToDecorator: defaultTweetInReplyToDecorator,
- tweetRetweeterDecorator: defaultTweetRetweeterDecorator,
-
- tweetActionsDecorator: defaultTweetActionsDecorator,
- tweetActionReplyDecorator: defaultTweetActionReplyDecorator,
- tweetActionRetweetDecorator: defaultTweetActionRetweetDecorator,
- tweetActionFavoriteDecorator: defaultTweetActionFavoriteDecorator,
-
- tweetFeedControlsDecorator: defaultTweetFeedControlsDecorator,
- tweetFeedControlsMoreBtnDecorator: defaultTweetFeedControlsMoreBtnDecorator,
- tweetFeedControlsPrevBtnDecorator: defaultTweetFeedControlsPrevBtnDecorator,
- tweetFeedControlsNextBtnDecorator: defaultTweetFeedControlsNextBtnDecorator,
-
- tweetFeedAutorefreshTriggerDecorator: defaultTweetFeedAutorefreshTriggerDecorator,
- tweetFeedAutorefreshTriggerContentDecorator: defaultTweetFeedAutorefreshTriggerContentDecorator,
-
- connectButtonDecorator: defaultConnectButtonDecorator,
-
- loginInfoDecorator: defaultLoginInfoDecorator,
- loginInfoContentDecorator: defaultLoginInfoContentDecorator,
-
- followButtonDecorator: defaultFollowButtonDecorator,
-
- tweetBoxDecorator: defaultTweetBoxDecorator,
-
- linkDecorator: defaultLinkDecorator,
- usernameDecorator: defaultUsernameDecorator,
- hashtagDecorator: defaultHashtagDecorator,
-
- loadingDecorator: defaultLoadingDecorator,
- errorDecorator: defaultErrorDecorator,
- noDataDecorator: defaultNoDataDecorator,
-
- /**
- * Formatters are currently used for date format processing only.
- *
- * The tweetTimestampFormatter formats the tweet's timestamp to be shown
- * in the tweet attributes section
- *
- * For details, see the implementation of the defaultTweetTimestampFormatter.
- */
- tweetTimestampFormatter : defaultTweetTimestampFormatter,
-
- /**
- * The tweetTimestampTooltipFormatter formats the tweet's timestamp to be shown
- * in the tooltip when hovering over the timestamp link.
- */
- tweetTimestampTooltipFormatter : defaultTweetTimestampTooltipFormatter,
-
- /**
- * A visualizer is a function that is responsible for adding one or more
- * elements to the DOM and thereby making them visible to the user.
- * A visualizer might also be responsible to do the opposite effect:
- * To remove one or more elements from the DOM.
- *
- * The tweetVisualizer gets called each time a tweet element should be
- * appended or prepended to the tweet feed element.
- *
- * For details, see the implementation of the defaultTweetVisualizer.
- *
- * Each default visualizer can be overwritten by your own implementation.
- */
- tweetVisualizer: defaultTweetVisualizer,
-
- /**
- * The loadingIndicatorVisualizer gets called each time data is retrieved
- * from Twitter to visualize the loading indicator. This visualizer is also
- * used to hide the loading indicator.
- *
- * For details, see the implementation of the defaultLoadingIndicatorVisualizer.
- */
- loadingIndicatorVisualizer: defaultLoadingIndicatorVisualizer,
-
- /**
- * The autorefreshTriggerVisualizer will be called if the autorefresh
- * trigger should be visualized or hidden.
- *
- * For details, see the implementation of the autorefreshTriggerVisualizer.
- */
- autorefreshTriggerVisualizer: defaultAutorefreshTriggerVisualizer,
-
- /**
- * An event handler is a function that gets called whenever the event you
- * are interested in, occurs.
- *
- * The onDataRequest event handler will be called immediatly before calling
- * Twitter to retrieve new data and gives you the opportunity to deny
- * the call by returning false from the function.
- *
- * This feature might be used in conjunction with the paging feature,
- * especially when using the "endless-scroll" paging mode, to avoid the
- * exhaustion of remaining Twitter API calls, before the rate limit is
- * reached. The stats parameter contains statistical infos and counters
- * that you can examine to base your decision whether to return true or
- * false.
- */
- onDataRequestHandler: defaultOnDataRequestHandler,
-
- /**
- * The onRateLimitData event handler is called each time
- * jTweetsAnywhere retrieved the rate limit data from Twitter. The actual
- * rate limit data is contained in the stats object.
- */
- onRateLimitDataHandler: defaultOnRateLimitDataHandler,
-
- /**
- * The OnOptionsInitializingHandler event handler is called before initializing
- * the user options
- */
- onOptionsInitializingHandler: defaultOnOptionsInitializingHandler,
-
- _tweetFeedConfig:
- {
- autoConformToTwitterStyleguide: false,
- showTwitterBird: true,
- showTimestamp:
- {
- refreshInterval: 0
- },
- showSource: false,
- showGeoLocation: true,
- showInReplyTo: true,
- showActionReply: false,
- showActionRetweet: false,
- showActionFavorite: false,
- showProfileImages: null,
- showUserScreenNames: null,
- showUserFullNames: false,
- expandHovercards: false,
- includeRetweets: true,
- paging:
- {
- mode: "none",
- _limit: 0,
- _offset: 0
- },
- autorefresh:
- {
- mode: "none",
- interval: 60,
- duration: 3600,
- max: -1,
- _startTime: null,
- _triggerElement: null
- },
- _pageParam: 0,
- _maxId: null,
- _recLevel: 0,
- _noData: false,
- _clearBeforePopulate: false
- },
- _tweetBoxConfig:
- {
- counter: true,
- width: 515,
- height: 65,
- label: null,
- defaultContent: '',
- onTweet: function(textTweet, htmlTweet) {}
- },
- _connectButtonConfig:
- {
- size: "medium"
- },
- _baseSelector: null,
- _baseElement: null,
- _tweetFeedElement: null,
- _tweetFeedControlsElement: null,
- _followButtonElement: null,
- _loginInfoElement: null,
- _connectButtonElement: null,
- _tweetBoxElement: null,
- _loadingIndicatorElement: null,
- _noDataElement: null,
- _tweetsCache: [],
- _autorefreshTweetsCache: [],
- _stats:
- {
- dataRequestCount: 0,
- rateLimitPreventionCount: 0,
- rateLimit:
- {
- remaining_hits: 150,
- hourly_limit: 150
- }
- },
- _resourceBundle: null
- }, config);
-
- // save the plugin's base selector
- options._baseSelector = this.selector;
-
- options.onOptionsInitializingHandler(options);
- setupOptions(options);
-
- // no main decorator? nothing to do!
- if (!options.mainDecorator)
- {
- return;
- }
-
- $.ajaxSetup({ cache: true });
-
- return this.each(function()
- {
- // the DOM element, where to display the widget
- options._baseElement = $(this);
-
- // create the widget's necessary sub DOM elements
- options._tweetFeedElement = options.tweetFeedDecorator ? $(options.tweetFeedDecorator(options)) : null;
- options._tweetFeedControlsElement = options.tweetFeedControlsDecorator ? $(options.tweetFeedControlsDecorator(options)) : null;
- options._followButtonElement = options.followButtonDecorator ? $(options.followButtonDecorator(options)) : null;
- options._tweetBoxElement = options.tweetBoxDecorator ? $(options.tweetBoxDecorator(options)) : null;
- options._connectButtonElement = options.connectButtonDecorator ? $(options.connectButtonDecorator(options)): null;
- options._loginInfoElement = options.loginInfoDecorator ? $(options.loginInfoDecorator(options)) : null;
-
- // add the widget to the DOM
- options.mainDecorator(options);
-
- populateTweetFeed(options);
- populateAnywhereControls(options);
-
- bindEventHandlers(options);
-
- setupAutorefresh(options);
- });
- };
- defaultMainDecorator = function(options)
- {
- // defines the default sequence of the widget's elements
- if (options._tweetFeedElement)
- {
- options._baseElement.append(options._tweetFeedElement);
- }
-
- if (options._tweetFeedControlsElement)
- {
- options._baseElement.append(options._tweetFeedControlsElement);
- }
-
- if (options._connectButtonElement)
- {
- options._baseElement.append(options._connectButtonElement);
- }
-
- if (options._loginInfoElement)
- {
- options._baseElement.append(options._loginInfoElement);
- }
-
- if (options._followButtonElement)
- {
- options._baseElement.append(options._followButtonElement);
- }
-
- if (options._tweetBoxElement)
- {
- options._baseElement.append(options._tweetBoxElement);
- }
- };
- defaultTweetFeedControlsDecorator = function(options)
- {
- // the default tweet feed's paging controls
- var html = '';
-
- if (options._tweetFeedConfig.paging.mode == 'prev-next')
- {
- if (options.tweetFeedControlsPrevBtnDecorator)
- {
- html += options.tweetFeedControlsPrevBtnDecorator(options);
- }
-
- if (options.tweetFeedControlsNextBtnDecorator)
- {
- html += options.tweetFeedControlsNextBtnDecorator(options);
- }
- }
- else if (options._tweetFeedConfig.paging.mode == 'endless-scroll')
- {
- // nothing to do here
- }
- else
- {
- if (options.tweetFeedControlsMoreBtnDecorator)
- {
- html += options.tweetFeedControlsMoreBtnDecorator(options);
- }
- }
-
- return '<div class="jta-tweet-list-controls">' + html + '</div>';
- };
- defaultTweetFeedControlsMoreBtnDecorator = function(options)
- {
- return '<span class="jta-tweet-list-controls-button jta-tweet-list-controls-button-more">' + options._resourceBundle._('More') + '</span>';
- };
- defaultTweetFeedControlsPrevBtnDecorator = function(options)
- {
- return '<span class="jta-tweet-list-controls-button jta-tweet-list-controls-button-prev">' + options._resourceBundle._('Prev') + '</span>';
- };
- defaultTweetFeedControlsNextBtnDecorator = function(options)
- {
- return '<span class="jta-tweet-list-controls-button jta-tweet-list-controls-button-next">' + options._resourceBundle._('Next') + '</span>';
- };
- defaultTweetFeedAutorefreshTriggerDecorator = function(count, options)
- {
- var html = '';
-
- if (options.tweetFeedAutorefreshTriggerContentDecorator)
- {
- html = options.tweetFeedAutorefreshTriggerContentDecorator(count, options);
- }
-
- return '<li class="jta-tweet-list-autorefresh-trigger">' + html + '</li>';
- };
- defaultTweetFeedAutorefreshTriggerContentDecorator = function(count, options)
- {
- var content = options._resourceBundle.__('%count% new tweet', '%count% new tweets', count, { '%count%' : count });
-
- return '<span class="jta-tweet-list-autorefresh-trigger-content">' + content + '</span>';
- };
- defaultTweetFeedDecorator = function(options)
- {
- // the default placeholder for the tweet feed is an unordered list
- return '<ul class="jta-tweet-list"></ul>';
- };
- defaultTweetDecorator = function(tweet, options)
- {
- // the default tweet is made of the optional user's profile image and the
- // tweet body inside a list item element
- var html = '';
-
- if (options._tweetFeedConfig.showProfileImages)
- {
- html += options.tweetProfileImageDecorator(tweet, options);
- }
-
- if (options.tweetBodyDecorator)
- {
- html += options.tweetBodyDecorator(tweet, options);
- }
-
- html += '<div class="jta-clear">&nbsp;</div>';
-
- return '<li class="jta-tweet-list-item">' + html + '</li>';
- };
- defaultTweetProfileImageDecorator = function(tweet, options)
- {
- // if tweet is a native retweet, use the retweet's profile
- var t = tweet.retweeted_status || tweet;
-
- // the default profile image decorator simply adds a link to the user's Twitter profile
- var screenName = getScreenName(tweet);
- var imageUrl = t.user ? t.user.profile_image_url : false || t.profile_image_url;
-
- var html =
- '<a class="jta-tweet-profile-image-link" href="http://twitter.com/' + screenName + '" target="_blank">' +
- '<img src="' + imageUrl + '" alt="' + screenName + '"' +
- (isAnywherePresent() ? '' : (' title="' + screenName + '"')) +
- '/>' +
- '</a>';
-
- return '<div class="jta-tweet-profile-image">' + html + '</div>';
- };
- defaultTweetBodyDecorator = function(tweet, options)
- {
- // the default tweet body contains the tweet text and the tweet's creation date
- var html = '';
-
- if (options.tweetTextDecorator)
- {
- html += options.tweetTextDecorator(tweet, options);
- }
-
- if (options.tweetAttributesDecorator)
- {
- html += options.tweetAttributesDecorator(tweet, options);
- }
-
- if (options.tweetActionsDecorator)
- {
- html += options.tweetActionsDecorator(tweet, options);
- }
-
- return '<div class="jta-tweet-body ' +
- (options._tweetFeedConfig.showProfileImages ? 'jta-tweet-body-list-profile-image-present' : '') + '">' +
- html +
- '</div>';
- };
- defaultTweetTextDecorator = function(tweet, options)
- {
- var tweetText = tweet.text;
-
- // if usernames should be visible and tweet is a native retweet, use
- // the original tweet text
- if (tweet.retweeted_status &&
- (
- options._tweetFeedConfig.showUserScreenNames ||
- options._tweetFeedConfig.showUserScreenNames == null ||
- options._tweetFeedConfig.showUserFullNames ||
- options._tweetFeedConfig.showUserFullNames == null
- )
- )
- {
- tweetText = tweet.retweeted_status.text;
- }
-
- // the default tweet text decorator optionally marks links, @usernames,
- // and #hashtags
- if (options.linkDecorator)
- {
- tweetText = options.linkDecorator(tweetText, options);
- }
-
- if (options.usernameDecorator)
- {
- tweetText = options.usernameDecorator(tweetText, options);
- }
-
- if (options.hashtagDecorator)
- {
- tweetText = options.hashtagDecorator(tweetText, options);
- }
-
- if (options._tweetFeedConfig.showUserScreenNames ||
- options._tweetFeedConfig.showUserFullNames ||
- tweet.retweeted_status &&
- (
- options._tweetFeedConfig.showUserScreenNames == null ||
- options._tweetFeedConfig.showUserFullNames == null
- )
- )
- {
- tweetText = options.tweetUsernameDecorator(tweet, options) + ' ' + tweetText;
- }
-
- return '<span class="jta-tweet-text">' + tweetText + '</span>';
- };
- defaultTweetUsernameDecorator = function(tweet, options)
- {
- // if tweet is a native retweet, use the retweet's profile
- var screenName = getScreenName(tweet);
- var fullName = getFullName(tweet);
-
- var htmlScreenName = null;
- if (screenName && (options._tweetFeedConfig.showUserScreenNames || (options._tweetFeedConfig.showUserScreenNames == null && tweet.retweeted_status)))
- {
- htmlScreenName =
- '<span class="jta-tweet-user-screen-name">' +
- '<a class="jta-tweet-user-screen-name-link" href="http://twitter.com/' + screenName + '" target="_blank">' +
- screenName +
- '</a>' +
- '</span>';
- }
-
- var htmlFullName = null;
- if (fullName && (options._tweetFeedConfig.showUserFullNames || (options._tweetFeedConfig.showUserFullNames == null && tweet.retweeted_status)))
- {
- htmlFullName =
- '<span class="jta-tweet-user-full-name">' +
- (htmlScreenName ? ' ' : '') +
- '<a class="jta-tweet-user-full-name-link" href="http://twitter.com/' + screenName + '" name="' + screenName + '" target="_blank">' +
- fullName +
- '</a>' +
- '</span>';
- }
-
- var html = '';
-
- if (htmlScreenName)
- {
- html += htmlScreenName;
- }
-
- if (htmlFullName)
- {
- if (htmlScreenName)
- {
- html += ' ';
- }
-
- html += htmlFullName;
- }
-
- if (htmlScreenName || htmlFullName)
- {
- html =
- '<span class="jta-tweet-user-name">' +
- (tweet.retweeted_status ? 'RT ' : '') +
- html +
- '</span>';
- }
-
- return html;
- };
- defaultTweetAttributesDecorator = function(tweet, options)
- {
- var html = '';
-
- if (options.tweetTwitterBirdDecorator ||
- options.tweetTimestampDecorator ||
- options.tweetSourceDecorator ||
- options.tweetGeoLocationDecorator ||
- options.tweetInReplyToDecorator ||
- (tweet.retweeted_status && options.tweetRetweeterDecorator)
- )
- {
- html += '<span class="jta-tweet-attributes">';
-
- if (options.tweetTwitterBirdDecorator)
- {
- html += options.tweetTwitterBirdDecorator(tweet, options);
- }
-
- if (options.tweetTimestampDecorator)
- {
- html += options.tweetTimestampDecorator(tweet, options);
- }
-
- if (options.tweetSourceDecorator)
- {
- html += options.tweetSourceDecorator(tweet, options);
- }
-
- if (options.tweetGeoLocationDecorator)
- {
- html += options.tweetGeoLocationDecorator(tweet, options);
- }
-
- if (options.tweetInReplyToDecorator)
- {
- html += options.tweetInReplyToDecorator(tweet, options);
- }
-
- if (tweet.retweeted_status && options.tweetRetweeterDecorator)
- {
- html += options.tweetRetweeterDecorator(tweet, options);
- }
-
- html += '</span>';
- }
-
- return html;
- };
- defaultTweetTimestampDecorator = function(tweet, options)
- {
- // the default tweet timestamp decorator does a little bit of Twitter like formatting.
-
- // if tweet is a native retweet, use the retweet's timestamp
- var tw = tweet.retweeted_status || tweet;
-
- // reformat timestamp from Twitter, so IE is happy
- var createdAt = formatDate(tw.created_at);
-
- // format the timestamp by the tweetTimestampFormatter
- var tweetTimestamp = options.tweetTimestampFormatter(createdAt, options);
- var tweetTimestampTooltip = options.tweetTimestampTooltipFormatter(createdAt);
-
- var html =
- '<span class="jta-tweet-timestamp">' +
- '<a class="jta-tweet-timestamp-link" data-timestamp="' + createdAt +
- '" href="http://twitter.com/' + getScreenName(tweet) + '/status/' + tw.id + '" target="_blank" title="' +
- tweetTimestampTooltip + '">' +
- tweetTimestamp +
- '</a>' +
- '</span>';
-
- return html;
- };
- defaultTweetTwitterBirdDecorator = function(tweet, options)
- {
- var screenName = getScreenName(tweet);
- var intentUrl = 'https://twitter.com/intent/user?screen_name=' + screenName;
- var linkTitle = screenName + ' ' + options._resourceBundle._('on Twitter');
-
- var html =
- '<span class="jta-tweet-twitter-bird">' +
- '<a href="' + intentUrl + '" target="_blank" title="' + linkTitle + '">' +
- '<span class="jta-tweet-twitter-bird-icon">&nbsp;</span>' +
- '</a>' +
- '</span>';
-
- return html;
- };
- defaultTweetTimestampTooltipFormatter = function(timeStamp)
- {
- var d = new Date(timeStamp);
-
- return d.toLocaleString();
- };
- defaultTweetTimestampFormatter = function(timeStamp, options)
- {
- var now = new Date();
-
- var diff = parseInt((now.getTime() - Date.parse(timeStamp)) / 1000);
-
- var tweetTimestamp = '';
- if (diff < 60)
- {
- tweetTimestamp += options._resourceBundle.__('%secs% second ago', '%secs% seconds ago', diff, { '%secs%': diff });
- }
- else if (diff < 3600)
- {
- var t = parseInt((diff + 30) / 60);
- tweetTimestamp += options._resourceBundle.__('%mins% minute ago', '%mins% minutes ago', t, { '%mins%': t });
- }
- else if (diff < 86400)
- {
- var t = parseInt((diff + 1800) / 3600);
- tweetTimestamp += options._resourceBundle.__('%hours% hour ago', '%hours% hours ago', t, { '%hours%': t });
- }
- else
- {
- var d = new Date(timeStamp);
-
- var monthName = options._resourceBundle._('$$monthNames');
- tweetTimestamp += monthName[d.getMonth()] + ' ' + d.getDate();
-
- if (d.getFullYear() < now.getFullYear())
- {
- tweetTimestamp += ', ' + d.getFullYear();
- }
-
- var t = parseInt((diff + 43200) / 86400);
- tweetTimestamp += ' (' + options._resourceBundle.__('%days% day ago', '%days% days ago', t, { '%days%': t }) + ')';
- }
-
- return tweetTimestamp;
- };
- defaultTweetSourceDecorator = function(tweet, options)
- {
- // if tweet is a native retweet, use the retweet's source
- var tw = tweet.retweeted_status || tweet;
-
- var source = tw.source.replace(/\&lt\;/gi,'<').replace(/\&gt\;/gi,'>').replace(/\&quot\;/gi,'"');
- var html =
- '<span class="jta-tweet-source">' +
- ' ' + options._resourceBundle._('via') + ' ' +
- '<span class="jta-tweet-source-link">' +
- source +
- '</span>' +
- '</span>';
-
- return html;
- };
- defaultTweetGeoLocationDecorator = function(tweet, options)
- {
- var html = '';
-
- // if tweet is a native retweet, use the retweet's source
- var tw = tweet.retweeted_status || tweet;
-
- var q = null;
- if (tw.geo && tw.geo.coordinates)
- {
- q = tw.geo.coordinates.join();
- }
- else if (tw.place && tw.place.full_name)
- {
- q = tw.place.full_name;
- }
-
- if (q)
- {
- var location = options._resourceBundle._('here');
- if (tw.place && tw.place.full_name)
- {
- location = tw.place.full_name;
- }
-
- var link = 'http://maps.google.com/maps?q=' + q;
-
- html =
- '<span class="jta-tweet-location">' +
- ' ' + options._resourceBundle._('from') + ' ' +
- '<a class="jta-tweet-location-link" href="' + link + '" target="_blank">' +
- location +
- '</a>' +
- '</span>';
- }
-
- return html;
- };
- defaultTweetInReplyToDecorator = function(tweet, options)
- {
- // if tweet is a native retweet, use the retweet's source
- var tw = tweet.retweeted_status || tweet;
-
- var html = '';
-
- if (tw.in_reply_to_status_id && tw.in_reply_to_screen_name)
- {
- var linkHref = 'http://twitter.com/' + tw.in_reply_to_screen_name + '/status/' + tw.in_reply_to_status_id;
- var linkText = options._resourceBundle._('in reply to') + ' ' + tw.in_reply_to_screen_name;
-
- html =
- '<span class="jta-tweet-inreplyto">' +
- ' ' +
- '<a class="jta-tweet-inreplyto-link" href="' + linkHref + '" target="_blank">' +
- linkText +
- '</a>' +
- '</span>';
- }
-
- return html;
- };
- defaultTweetRetweeterDecorator = function(tweet, options)
- {
- var html = '';
-
- if (tweet.retweeted_status)
- {
- var screenName = getUserScreenName(tweet);
-
- var rtc = (tweet.retweeted_status.retweet_count || 0) - 1;
-
- var link =
- '<a class="jta-tweet-retweeter-link" href="http://twitter.com/' + screenName + '" target="_blank">' +
- screenName +
- '</a>';
-
- var rtcount = options._resourceBundle.__(' and %rtc% other', ' and %rtc% others', rtc, { '%rtc%': rtc });
-
- html =
- '<br/>' +
- '<span class="jta-tweet-retweeter">' +
- options._resourceBundle._('Retweeted by') + ' ' + link +
- (rtc > 0 ? rtcount : '') +
- '</span>';
- }
-
- return html;
- };
- defaultTweetActionsDecorator = function(tweet, options)
- {
- var html = '';
-
- if (options.tweetActionReplyDecorator ||
- options.tweetActionRetweetDecorator ||
- options.tweetActionFavoriteDecorator
- )
- {
- html += '<span class="jta-tweet-actions">';
-
- if (options.tweetActionReplyDecorator)
- {
- html += options.tweetActionReplyDecorator(tweet, options);
- }
-
- if (options.tweetActionRetweetDecorator)
- {
- html += options.tweetActionRetweetDecorator(tweet, options);
- }
-
- if (options.tweetActionFavoriteDecorator)
- {
- html += options.tweetActionFavoriteDecorator(tweet, options);
- }
-
- html += '</span>';
- }
-
- return html;
- };
- defaultTweetActionReplyDecorator = function(tweet, options)
- {
- var intentUrl = 'https://twitter.com/intent/tweet?in_reply_to=' + tweet.id;
- var actionLabel = options._resourceBundle._('Reply');
-
- var html =
- '<span class="jta-tweet-action-reply">' +
- '<a href="' + intentUrl + '">' + actionLabel + '</a>' +
- '</span>';
-
- return html;
- };
- defaultTweetActionRetweetDecorator = function(tweet, options)
- {
- var intentUrl = 'https://twitter.com/intent/retweet?tweet_id=' + tweet.id;
- var actionLabel = options._resourceBundle._('Retweet');
-
- var html =
- '<span class="jta-tweet-action-retweet">' +
- '<a href="' + intentUrl + '">' + actionLabel + '</a>' +
- '</span>';
-
- return html;
- };
- defaultTweetActionFavoriteDecorator = function(tweet, options)
- {
- var intentUrl = 'https://twitter.com/intent/favorite?tweet_id=' + tweet.id;
- var actionLabel = options._resourceBundle._('Favorite');
-
- var html =
- '<span class="jta-tweet-action-favorite">' +
- '<a href="' + intentUrl + '">' + actionLabel + '</a>' +
- '</span>';
-
- return html;
- };
- defaultConnectButtonDecorator = function(options)
- {
- // the default placeholder for the @Anywhere ConnectButton
- return '<div class="jta-connect-button"></div>';
- };
- defaultLoginInfoDecorator = function(options)
- {
- // the default placeholder for the LoginInfo
- return '<div class="jta-login-info"></div>';
- };
- defaultLoginInfoContentDecorator = function(options, T)
- {
- // the default markup of the LoginInfo content: the user's profile image, the
- // user's screen_name and a "button" to sign out
- var html = '';
-
- if (T.isConnected())
- {
- var screenName = T.currentUser.data('screen_name');
- var imageUrl = T.currentUser.data('profile_image_url');
-
- html =
- '<div class="jta-login-info-profile-image">' +
- '<a href="http://twitter.com/' + screenName + '" target="_blank">' +
- '<img src="' + imageUrl + '" alt="' + screenName + '" title="' + screenName + '"/>' +
- '</a>' +
- '</div>' +
- '<div class="jta-login-info-block">' +
- '<div class="jta-login-info-screen-name">' +
- '<a href="http://twitter.com/' + screenName + '" target="_blank">' + screenName + '</a>' +
- '</div>' +
- '<div class="jta-login-info-sign-out">' +
- options._resourceBundle._('Sign out') +
- '</div>' +
- '</div>' +
- '<div class="jta-clear">&nbsp;</div>'
- ;
- }
-
- return html;
- };
- defaultFollowButtonDecorator = function(options)
- {
- // the default placeholder for the @Anywhere FollowButton
- return '<div class="jta-follow-button"></div>';
- };
- defaultTweetBoxDecorator = function(options)
- {
- // the default placeholder for the @Anywhere TweetBox
- return '<div class="jta-tweet-box"></div>';
- };
- defaultLinkDecorator = function(text, options)
- {
- // the regex to markup links
- return text.replace(/((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi,'<a href="$1" class="jta-tweet-a jta-tweet-link" target="_blank" rel="nofollow">$1<\/a>');
- };
- defaultUsernameDecorator = function(text, options)
- {
- // the regex to markup @usernames. if @Anywhere is present the task is left to
- // them
- return isAnywherePresent() ? text : text.replace(/\B@(\w+)/gi,'@<a href="http://twitter.com/$1" class="jta-tweet-a twitter-anywhere-user" target="_blank" rel="nofollow">$1<\/a>');
- };
- defaultHashtagDecorator = function(text, options)
- {
- // the regex to markup #hashtags
- return text.replace(/#([a-zA-Z0-9_]+)/gi,'<a href="http://search.twitter.com/search?q=%23$1" class="jta-tweet-a jta-tweet-hashtag" title="#$1" target="_blank" rel="nofollow">#$1<\/a>');
- };
- defaultLoadingDecorator = function(options)
- {
- // the default loading decorator simply says: loading ...
- return '<li class="jta-loading">' + options._resourceBundle._('loading') + ' ...</li>';
- };
- defaultErrorDecorator = function(errorText, options)
- {
- // the default error decorator shows the error message
- return '<li class="jta-error">' + options._resourceBundle._('ERROR') + ': ' + errorText + '</li>';
- };
- defaultNoDataDecorator = function(options)
- {
- // the default no-data decorator simply says: No more data
- return '<li class="jta-nodata">' + options._resourceBundle._('No more data') + '</li>';
- };
-
- defaultTweetFilter = function(tweet, options)
- {
- return true;
- };
-
- defaultTweetVisualizer = function(tweetFeedElement, tweetElement, inserter, options)
- {
- // insert (append/prepend) the tweetElement to the tweetFeedElement
- tweetFeedElement[inserter](tweetElement);
- };
- defaultLoadingIndicatorVisualizer = function(tweetFeedElement, loadingIndicatorElement, options, callback)
- {
- defaultVisualizer(tweetFeedElement, loadingIndicatorElement, 'append', 'fadeIn', 600, 'fadeOut', 200, callback);
- };
- defaultAutorefreshTriggerVisualizer = function(tweetFeedElement, triggerElement, options, callback)
- {
- defaultVisualizer(tweetFeedElement, triggerElement, 'prepend', 'slideDown', 600, 'fadeOut', 200, callback);
- };
- defaultVisualizer = function(container, element, inserter, effectIn, durationIn, effectOut, durationOut, callback)
- {
- // if param container is null element has to be removed from
- // the DOM, else element has to be inserted in container
-
- // if param callback is not null, the callback function must be called
- // in any case, if the visualizer is done
-
- var cb = function()
- {
- if (callback)
- {
- callback();
- }
- };
-
- if (container)
- {
- element.hide();
- container[inserter](element);
- element[effectIn](durationIn, cb);
- }
- else
- {
- element[effectOut](durationOut, function()
- {
- element.remove();
- cb();
- });
- }
- };
- defaultOnDataRequestHandler = function(stats, options)
- {
- return true;
- };
- defaultOnRateLimitDataHandler = function(stats, options)
- {
- };
- defaultOnOptionsInitializingHandler = function(options)
- {
- };
- updateLoginInfoElement = function(options, T)
- {
- // update the content of the LoginInfo element
- if (options._loginInfoElement && options.loginInfoContentDecorator)
- {
- options._loginInfoElement.children().remove();
- options._loginInfoElement.append(options.loginInfoContentDecorator(options, T));
- $(options._baseSelector + ' .jta-login-info-sign-out').bind('click', function()
- {
- twttr.anywhere.signOut();
- });
- }
- };
- getFeedUrl = function(options, flPaging)
- {
- // create the Twitter API URL based on the configuration options
- var url = ('https:' == document.location.protocol ? 'https:' : 'http:');
-
- if (options.searchParams)
- {
- url += '//search.twitter.com/search.json?' +
- ((options.searchParams instanceof Array) ? options.searchParams.join('&') : options.searchParams) +
- '&rpp=100';
- }
- else if (options.list)
- {
- if ('favorites' == options.list)
- {
- url += '//api.twitter.com/1/favorites/' + options.username + '.json?count=20';
- }
- else
- {
- url += '//api.twitter.com/1/' + options.username + '/lists/' + options.list + '/statuses.json?per_page=20';
- }
- }
- else
- {
- url += '//api.twitter.com/1/statuses/user_timeline.json?screen_name=' + options.username + '&count=20';
- if (options._tweetFeedConfig.includeRetweets)
- url += '&include_rts=true';
- }
-
- if (flPaging)
- {
- url +=
- (options._tweetFeedConfig._maxId ? '&max_id=' + options._tweetFeedConfig._maxId : '') +
- '&page=' + options._tweetFeedConfig._pageParam;
- }
-
- url += '&callback=?';
-
- return url;