Permalink
Browse files

Bug with slideshow St. Louis

  • Loading branch information...
1 parent 7db6236 commit 76913e85ca45e2ed5be84f3e53703e9a4c551f83 @vinch vinch committed Nov 8, 2011
Showing with 8 additions and 4 deletions.
  1. +1 −0 slideshow/js/script.js
  2. +1 −1 slideshow/test.html
  3. +6 −3 utils.js
View
@@ -284,6 +284,7 @@ function getStoryElementHTML(element) {
layout += template + '</div>';
break;
+ case 'facebook':
case 'other':
var timestamp = Date.parse(element.posted_at)/1000;
var template = '<div class="quote"><p>' + element.data.quote.text + '</p><aside><div class="username_container"><div class="username"><a href="' + element.permalink + '" target="_blank">' + element.attribution.name + '</a></div></div>';
View
@@ -59,7 +59,7 @@
var storify = new Storify();
STORIFY_PERMALINK = getQueryVariable('url') || 'http://storify.com/storify/testimonials';
</script>
- <script type="text/javascript" src="http://static.storify.com/js/utils.js"></script>
+ <script type="text/javascript" src="../utils.js"></script>
<script type="text/javascript" src="js/plugins.js"></script>
<script type="text/javascript" src="js/script.js"></script>
View
@@ -91,9 +91,12 @@
result = result.replace(commentsAndPhpTags, '').replace(tags, function($0, $1){
if ($0.toLowerCase().substring(0,2) == '<a'){
- var href=$0.match(/href=[\'"]?([^\'" >]+)/i)[1];
- $0 = $0.indexOf(' ') > -1 ? $0.substr(0,$0.indexOf(' '))+'>' : $0;
- $0 = $0.substring(0, $0.length-1) + ' href="' + href + '">';
+ var match = $0.match(/href=[\'"]?([^\'" >]+)/i);
+ if (match) {
+ var href= match[1];
+ $0 = $0.indexOf(' ') > -1 ? $0.substr(0,$0.indexOf(' '))+'>' : $0;
+ $0 = $0.substring(0, $0.length-1) + ' href="' + href + '">';
+ }
} else {
$0 = $0.indexOf(' ') > -1 ? $0.substr(0,$0.indexOf(' '))+'>' : $0;
}

0 comments on commit 76913e8

Please sign in to comment.