waja revised this gist 13 years ago. Go to revision
2 files changed, 2 insertions, 2 deletions
after_footer.html
| @@ -7,5 +7,5 @@ | |||
| 7 | 7 | jQuery.noConflict(); // ender.js conflicts with jQuery | |
| 8 | 8 | </script> | |
| 9 | 9 | <!-- Load Fancybox --> | |
| 10 | - | <script src="http://api.u9d.org/javascript/fancybox/latest/source/jquery.fancybox.pack.js" type="text/javascript"></script> | |
| 10 | + | <script src="https://raw.github.com/fancyapps/fancyBox/master/source/jquery.fancybox.pack.js" type="text/javascript"></script> | |
| 11 | 11 | <script src="{{ root_url }}/javascripts/fancybox-integration.js" type="text/javascript"></script> | |
head.html
| @@ -1,2 +1,2 @@ | |||
| 1 | 1 | <!-- fancybox stylesheet --> | |
| 2 | - | <link href="http://api.u9d.org/javascript/fancybox/latest/source/jquery.fancybox.css" media="screen, projection" rel="stylesheet" type="text/css"> | |
| 2 | + | <link href="https://raw.github.com/fancyapps/fancyBox/master/source/jquery.fancybox.css" media="screen, projection" rel="stylesheet" type="text/css"> | |
waja revised this gist 13 years ago. Go to revision
1 file changed, 1 insertion, 1 deletion
after_footer.html
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | Add content to be output at the bottom of each page. (You might use this for analytics scripts, for example) | |
| 3 | 3 | {% endcomment %} | |
| 4 | 4 | <!-- Load jQuery --> | |
| 5 | - | <script src="http://api.u9d.org/javascript/jquery/jquery.min.js" type="text/javascript"></script> | |
| 5 | + | <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script> | |
| 6 | 6 | <script type="text/javascript"> | |
| 7 | 7 | jQuery.noConflict(); // ender.js conflicts with jQuery | |
| 8 | 8 | </script> | |
waja revised this gist 13 years ago. Go to revision
3 files changed, 63 insertions
after_footer.html(file created)
| @@ -0,0 +1,11 @@ | |||
| 1 | + | {% comment %} | |
| 2 | + | Add content to be output at the bottom of each page. (You might use this for analytics scripts, for example) | |
| 3 | + | {% endcomment %} | |
| 4 | + | <!-- Load jQuery --> | |
| 5 | + | <script src="http://api.u9d.org/javascript/jquery/jquery.min.js" type="text/javascript"></script> | |
| 6 | + | <script type="text/javascript"> | |
| 7 | + | jQuery.noConflict(); // ender.js conflicts with jQuery | |
| 8 | + | </script> | |
| 9 | + | <!-- Load Fancybox --> | |
| 10 | + | <script src="http://api.u9d.org/javascript/fancybox/latest/source/jquery.fancybox.pack.js" type="text/javascript"></script> | |
| 11 | + | <script src="{{ root_url }}/javascripts/fancybox-integration.js" type="text/javascript"></script> | |
fancybox-integration.js(file created)
| @@ -0,0 +1,50 @@ | |||
| 1 | + | // taken from https://raw.github.com/ervwalter/octopress-ewal/5dd64d3b52f183e18e1bb035ee288b09ac70c554/source/javascripts/slash.js | |
| 2 | + | ||
| 3 | + | (function($){ | |
| 4 | + | // Open external links in new window | |
| 5 | + | var externalLinks = function(){ | |
| 6 | + | var host = location.host; | |
| 7 | + | ||
| 8 | + | $('body').on('click', 'a', function(e){ | |
| 9 | + | var href = this.href, | |
| 10 | + | link = href.replace(/https?:\/\/([^\/]+)(.*)/, '$1'); | |
| 11 | + | ||
| 12 | + | if (link != '' && link != host && !$(this).hasClass('fancybox')){ | |
| 13 | + | window.open(href); | |
| 14 | + | e.preventDefault(); | |
| 15 | + | } | |
| 16 | + | }); | |
| 17 | + | }; | |
| 18 | + | ||
| 19 | + | // Append caption after pictures | |
| 20 | + | var appendCaption = function(){ | |
| 21 | + | $('.entry-content').each(function(i){ | |
| 22 | + | var _i = i; | |
| 23 | + | $(this).find('img').each(function(){ | |
| 24 | + | var alt = this.alt; | |
| 25 | + | ||
| 26 | + | if (alt != ''){ | |
| 27 | + | $(this).after('<span class="caption">'+alt+'</span>'); | |
| 28 | + | } | |
| 29 | + | ||
| 30 | + | $(this).wrap('<a href="'+this.src+'" title="'+alt+'" class="fancybox" rel="gallery'+_i+'" />'); | |
| 31 | + | }); | |
| 32 | + | }); | |
| 33 | + | }; | |
| 34 | + | ||
| 35 | + | $('.entry-content').each(function(i){ | |
| 36 | + | var _i = i; | |
| 37 | + | $(this).find('img.fancybox').each(function(){ | |
| 38 | + | var img = $(this); | |
| 39 | + | var title = img.attr("title"); | |
| 40 | + | var classes = img.attr("class"); | |
| 41 | + | img.removeAttr("class"); | |
| 42 | + | img.wrap('<a href="'+this.src+'" class="' + classes + '" rel="gallery'+_i+'" />'); | |
| 43 | + | if (title != "") | |
| 44 | + | { | |
| 45 | + | img.parent().attr("title", title); | |
| 46 | + | } | |
| 47 | + | }); | |
| 48 | + | }); | |
| 49 | + | $('.fancybox').fancybox(); | |
| 50 | + | })(jQuery); | |
head.html(file created)
| @@ -0,0 +1,2 @@ | |||
| 1 | + | <!-- fancybox stylesheet --> | |
| 2 | + | <link href="http://api.u9d.org/javascript/fancybox/latest/source/jquery.fancybox.css" media="screen, projection" rel="stylesheet" type="text/css"> | |