From 4efb29394fcb99a77eea708e51c7dbc04aca0f94 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Thu, 22 Sep 2011 04:41:40 -0500 Subject: improved github configuration raketask --- Rakefile | 47 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/Rakefile b/Rakefile index 1b5d993a..05749208 100644 --- a/Rakefile +++ b/Rakefile @@ -274,25 +274,54 @@ task :set_root_dir, :dir do |t, args| end end -desc "Setup _deploy folder and deploy branch" -task :config_deploy, :branch do |t, args| - puts "!! Please provide a deploy branch, eg. rake init_deploy[gh-pages] !!" unless args.branch - puts "## Creating a clean #{args.branch} branch in ./#{deploy_dir} for Github pages deployment" +desc "Set up _deploy folder and deploy branch for Github Pages deployment" +task :setup_github do + repo_url = get_stdin("Enter the read/write url for your repository: ") + user = repo_url.match(/:([^\/]+)/)[1] + branch = (repo_url.match(/\/\w+.github.com/).nil?) ? 'gh-pages' : 'master' + project = (branch == 'gh-pages') ? repo_url.match(/\/([^\.]+)/)[1] : '' + unless `git remote -v`.match(/origin.+?octopress.git/).nil? + # If octopress is still the origin remote (from cloning) rename it to octopress + system "git remote rename origin octopress" + if branch == 'master' + # If this is a user/organization pages repository, add the correct origin remote + # and checkout the source branch for committing changes to the blog source. + system "git remote add origin #{repo_url}" + puts "Added remote #{repo_url} as origin" + system "git config branch.master.remote origin" + puts "Set origin as default remote" + system "git branch -m master source" + puts "Master branch renamed to 'source' for committing your blog source files" + else + unless !public_dir.match("#{project}").nil? + system "rake set_root_dir[#{project}]" + end + end + end + url = "http://#{user}.github.com" + url += "/#{project}" unless project == '' + jekyll_config = IO.read('_config.yml') + jekyll_config.sub!(/^url:.*$/, "url: #{url}") + File.open('_config.yml', 'w') do |f| + f.write jekyll_config + end + rm_rf deploy_dir + mkdir deploy_dir cd "#{deploy_dir}" do - system "git symbolic-ref HEAD refs/heads/#{args.branch}" - system "rm .git/index" - system "git clean -fdx" + system "git init" system "echo 'My Octopress Page is coming soon …' > index.html" system "git add ." system "git commit -m \"Octopress init\"" + system "git branch -m gh-pages" unless branch == 'master' + system "git remote add origin #{repo_url}" rakefile = IO.read(__FILE__) - rakefile.sub!(/deploy_branch(\s*)=(\s*)(["'])[\w-]*["']/, "deploy_branch\\1=\\2\\3#{args.branch}\\3") + rakefile.sub!(/deploy_branch(\s*)=(\s*)(["'])[\w-]*["']/, "deploy_branch\\1=\\2\\3#{branch}\\3") rakefile.sub!(/deploy_default(\s*)=(\s*)(["'])[\w-]*["']/, "deploy_default\\1=\\2\\3push\\3") File.open(__FILE__, 'w') do |f| f.write rakefile end end - puts "## Deployment configured. Now you can deploy to the #{args.branch} branch with `rake deploy` ##" + puts "\n---\n## Now you can deploy to #{url} with `rake deploy` ##" end def ok_failed(condition) -- cgit v1.2.1 From fcb730b5bf6c76f8f36512461181df4f537cc16a Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Thu, 22 Sep 2011 04:43:09 -0500 Subject: Restored copying public into _deploy. fixes #169 --- Rakefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Rakefile b/Rakefile index 05749208..4fcafbd5 100644 --- a/Rakefile +++ b/Rakefile @@ -227,6 +227,7 @@ multitask :push do (Dir["#{deploy_dir}/*"]).each { |f| rm_rf(f) } Rake::Task[:copydot].invoke(public_dir, deploy_dir) puts "\n## copying #{public_dir} to #{deploy_dir}" + system "cp -R #{public_dir}/* #{deploy_dir}" cd "#{deploy_dir}" do system "git add ." system "git add -u" -- cgit v1.2.1 From 4d491494049dcea091cee8b06943ac8a7d3ad34b Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Thu, 22 Sep 2011 04:45:44 -0500 Subject: renamed github pages configuration task --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 4fcafbd5..df19b9d4 100644 --- a/Rakefile +++ b/Rakefile @@ -276,7 +276,7 @@ task :set_root_dir, :dir do |t, args| end desc "Set up _deploy folder and deploy branch for Github Pages deployment" -task :setup_github do +task :setup_github_pages do repo_url = get_stdin("Enter the read/write url for your repository: ") user = repo_url.match(/:([^\/]+)/)[1] branch = (repo_url.match(/\/\w+.github.com/).nil?) ? 'gh-pages' : 'master' -- cgit v1.2.1 From 7cac353428e8773456b7253273acb6cd3afeae65 Mon Sep 17 00:00:00 2001 From: Felipe Cypriano Date: Thu, 22 Sep 2011 15:59:52 -0300 Subject: Add .rbenv-version file to simplify the installation using rbenv --- .rbenv-version | 1 + 1 file changed, 1 insertion(+) create mode 100644 .rbenv-version diff --git a/.rbenv-version b/.rbenv-version new file mode 100644 index 00000000..0a95b9f5 --- /dev/null +++ b/.rbenv-version @@ -0,0 +1 @@ +1.9.2-p290 -- cgit v1.2.1 From aa1abd0827e764da84b3c6c8e96bbd89d1f59d34 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Thu, 22 Sep 2011 16:16:54 -0500 Subject: now Github pages :push task forces --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index df19b9d4..eb91e37f 100644 --- a/Rakefile +++ b/Rakefile @@ -235,7 +235,7 @@ multitask :push do message = "Site updated at #{Time.now.utc}" system "git commit -m \"#{message}\"" puts "\n## Pushing generated #{deploy_dir} website" - system "git push origin #{deploy_branch}" + system "git push origin #{deploy_branch} --force" puts "\n## Github Pages deploy complete" end end -- cgit v1.2.1 From dc81c879b0ef7d73f34028cf9af7c0b6a8410bdc Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Thu, 22 Sep 2011 18:09:03 -0500 Subject: added slugignore to help with heroku deployment --- .slugignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .slugignore diff --git a/.slugignore b/.slugignore new file mode 100644 index 00000000..0a41d013 --- /dev/null +++ b/.slugignore @@ -0,0 +1,3 @@ +plugins +sass +source -- cgit v1.2.1 From 2f60361a7b2c6300c1bca883f722aedc01ae9408 Mon Sep 17 00:00:00 2001 From: Frederic Hemberger Date: Sat, 24 Sep 2011 12:43:44 +0200 Subject: Fixes child selector for param[name=movie], #168 --- .themes/classic/source/javascripts/octopress.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.themes/classic/source/javascripts/octopress.js b/.themes/classic/source/javascripts/octopress.js index a23ab502..1b1f90fc 100644 --- a/.themes/classic/source/javascripts/octopress.js +++ b/.themes/classic/source/javascripts/octopress.js @@ -89,7 +89,7 @@ function flashVideoFallback(){ function wrapFlashVideos() { $('object').each(function(object) { object = $(object); - if (object.children('param[name=movie]')) { + if ( $('param[name=movie]', object).length ) { var wrapper = object.before('
').previous(); $(wrapper).children().append(object); } -- cgit v1.2.1 From 9ef928588b32b055cf7f846b47ce0da36ef8af3c Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Sun, 25 Sep 2011 09:14:50 -0500 Subject: mobile nav javascript updated to still work with role='main-navigation' since changes affecting custom partials don't get updated with the standard update script --- .themes/classic/source/javascripts/octopress.js | 1 + 1 file changed, 1 insertion(+) diff --git a/.themes/classic/source/javascripts/octopress.js b/.themes/classic/source/javascripts/octopress.js index a23ab502..d6cf4d91 100644 --- a/.themes/classic/source/javascripts/octopress.js +++ b/.themes/classic/source/javascripts/octopress.js @@ -1,6 +1,7 @@ function getNav() { var mobileNav = $('nav[role=navigation] fieldset[role=search]').after('
').next().append(''); mobileNav.children('select').append(''); + $('ul[role=main-navigation]').addClass('main-navigation'); $('ul.main-navigation a').each(function(link) { mobileNav.children('select').append(''); }); -- cgit v1.2.1 From a4177e1471a649c51ddb6def3aa6be0352056d4a Mon Sep 17 00:00:00 2001 From: Manu Date: Mon, 26 Sep 2011 00:13:42 +0300 Subject: Changed it so the ssh port is configurable as well. (As I ran into the same issue already described at https://github.com/imathis/octopress/issues/30 ) --- Rakefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index eb91e37f..a74d51b1 100644 --- a/Rakefile +++ b/Rakefile @@ -5,6 +5,7 @@ require "stringex" ## -- Rsync Deploy config -- ## # Be sure your public key is listed in your server's ~/.ssh/authorized_keys file ssh_user = "user@domain.com" +ssh_port = "22" document_root = "~/website.com/" deploy_default = "rsync" @@ -218,7 +219,7 @@ end desc "Deploy website via rsync" task :rsync do puts "## Deploying website via Rsync" - ok_failed system("rsync -avz --delete #{public_dir}/ #{ssh_user}:#{document_root}") + ok_failed system("rsync -avze 'ssh -p {ssh_port}' --delete #{public_dir}/ #{ssh_user}:#{document_root}") end desc "deploy public directory to github pages" -- cgit v1.2.1 From af1f2af48f4e6cc49b9c619654e5038f2353955f Mon Sep 17 00:00:00 2001 From: Manu Date: Mon, 26 Sep 2011 00:16:15 +0300 Subject: Typo. --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index a74d51b1..20c618e0 100644 --- a/Rakefile +++ b/Rakefile @@ -219,7 +219,7 @@ end desc "Deploy website via rsync" task :rsync do puts "## Deploying website via Rsync" - ok_failed system("rsync -avze 'ssh -p {ssh_port}' --delete #{public_dir}/ #{ssh_user}:#{document_root}") + ok_failed system("rsync -avze 'ssh -p #{ssh_port}' --delete #{public_dir}/ #{ssh_user}:#{document_root}") end desc "deploy public directory to github pages" -- cgit v1.2.1 From eade4fc0d50e333a905945237a05dd7aaa644026 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Sun, 25 Sep 2011 21:30:55 -0500 Subject: now layouts or pages can specify "sidebar: collapse" in the yaml front matter for an always collapsed sidebar --- .themes/classic/source/_layouts/default.html | 2 +- .themes/classic/source/javascripts/octopress.js | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.themes/classic/source/_layouts/default.html b/.themes/classic/source/_layouts/default.html index 17c4e664..0b1fc3a9 100644 --- a/.themes/classic/source/_layouts/default.html +++ b/.themes/classic/source/_layouts/default.html @@ -1,6 +1,6 @@ {% capture root_url %}{{ site.root | strip_slash }}{% endcapture %} {% include head.html %} - +
{% include header.html %}
diff --git a/.themes/classic/source/javascripts/octopress.js b/.themes/classic/source/javascripts/octopress.js index 29df1981..fc679f11 100644 --- a/.themes/classic/source/javascripts/octopress.js +++ b/.themes/classic/source/javascripts/octopress.js @@ -11,15 +11,17 @@ function getNav() { } function addSidebarToggler() { - $('#content').append(''); - $('.toggle-sidebar').bind('click', function(e) { - e.preventDefault(); - if ($('body').hasClass('collapse-sidebar')) { - $('body').removeClass('collapse-sidebar'); - } else { - $('body').addClass('collapse-sidebar'); - } - }); + if(!$('body').hasClass('sidebar-footer')) { + $('#content').append(''); + $('.toggle-sidebar').bind('click', function(e) { + e.preventDefault(); + if ($('body').hasClass('collapse-sidebar')) { + $('body').removeClass('collapse-sidebar'); + } else { + $('body').addClass('collapse-sidebar'); + } + }); + } var sections = $('aside.sidebar > section'); if (sections.length > 1) { sections.each(function(section, index){ -- cgit v1.2.1 From d1e5c45e79cce76d12c854677848cd29b56f79a4 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Sun, 25 Sep 2011 21:29:53 -0500 Subject: Ender.js is now loaded locally instead of hotlinking --- .themes/classic/source/_includes/head.html | 2 +- .themes/classic/source/javascripts/ender.js | 38 ++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/.themes/classic/source/_includes/head.html b/.themes/classic/source/_includes/head.html index 16beda39..fd7e2365 100644 --- a/.themes/classic/source/_includes/head.html +++ b/.themes/classic/source/_includes/head.html @@ -21,7 +21,7 @@ - + {% include custom/head.html %} diff --git a/.themes/classic/source/javascripts/ender.js b/.themes/classic/source/javascripts/ender.js index 9958885a..c5c7c2c0 100644 --- a/.themes/classic/source/javascripts/ender.js +++ b/.themes/classic/source/javascripts/ender.js @@ -1,2 +1,38 @@ -eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('!5(O){5 2j(o,42){F(u k Y 42){k!=\'28\'&&k!=\'4T\'&&(o[k]=42[k])}7 o}5 2P(s,r){u R;B(X.4E&&N s==\'1p\'||s.4R||s.E&&\'3g\'Y s||s==1O){R=X.4E(s,r);R.H=s}1h{R=5F(s.E)?s:[s]}7 2j(R,2P)}5 X(s,r){7 2P(s,r)}2j(X,{4T:\'0.2.0\',X:5(o,4Z){2j(4Z?2P:X,o)}});2j(2P,{6E:5(D,1Z){F(u i=0,l=8.E;i.+?<\\\\/"+t+">","g"));K(5Y,5(m){m=m.1g(/<(.+)>(.+?)<\\/\\1>/,\'$2\');u 4l=I.3e(t);4l.2m(I.7Y(m));6.2m(4l)})}1h{6.4j=G}u 4Q=6.4y;6=6.1C;R.13(6);1d(6=6.25){(6.1j==1)&&R.13(6)}7 R}():4k(G)?[G.66(19)]:[]};U.I=5(){u w=W.6s,h=W.6v,4s=8.63();7{1N:65.62(w,4s.1N),1I:65.62(h,4s.1I)}};U.1C=5(6){F(u c=6.4y,i=0,j=(c&&c.E)||0,e;i\\{\\}\\$\\*\\^\'"]*\\])/,5X=/([.*+?\\^=!:${}()|\\[\\]\\/\\\\])/g,4W=/^([a-6J-9]+)?(?:([\\.\\#]+[\\w\\-\\.#]+)?)/,3y=/\\[([\\w\\-]+)(?:([\\|\\^\\$\\*\\~]?\\=)[\'"]?([ \\w\\-\\/\\?\\&\\=\\:\\.\\(\\)\\!,@#%<>\\{\\}\\$\\*\\^]+)["\']?)?\\]/,6g=1a 1E(4W.6l+\'(\'+3y.6l+\')?\');5 1R(Q){r=[];F(i=0,3W=Q.E;i<3W;i++){r[i]=Q[i]}7 r}u 2o=5(){8.c={}};2o.2g={g:5(k){7 8.c[k]||1w},s:5(k,v){8.c[k]=v;7 v}};u 30=1a 2o(),4i=1a 2o(),1x=1a 2o(),3Q=1a 2o();5 q(2n){7 2n.1c(6g)}5 3H(6y,1n,2Z,4t,4n,60,1l){u m,c,k;B(1n&&8.3T.6f()!==1n){7 1i}B(2Z&&(m=2Z.1c(2i))&&m[1]!==8.2i){7 1i}B(2Z&&(3x=2Z.1c(6j))){F(i=3x.E;i--;){c=3x[i].3u(1);B(!(30.g(c)||30.s(c,1a 1E(\'(^|\\\\s+)\'+c+\'(\\\\s+|$)\'))).12(8.1q)){7 1i}}}B(4t&&!1l){o=8.6T;F(k Y o){B(6O.2g.1T.11(o,k)&&(o[k].73||k)==4n){7 8}}}B(4t&&!5W(60,8.1S(4n)||\'\',1l)){7 1i}7 8}5 64(1s){u r=[],4B=1s.81(),4G=q(4B),1n=4G[1]||\'*\',i,l,R,V=1s.E&&(m=1s[0].1c(4a))?I.47(m[1]):I;B(!V){7 r}R=V.3o(1n);F(i=0,l=R.E;i]+)/.exec(a),d=c.createElement(b&&k[b[1].toLowerCase()]||"div"),e=[];d.innerHTML=a;var f=d.childNodes;d=d.firstChild,e.push(d);while(d=d.nextSibling)d.nodeType==1&&e.push(d);return e}():A(a)?[a.cloneNode(!0)]:[]},N.doc=function(){var a=this.viewport();return{width:Math.max(c.body.scrollWidth,d.scrollWidth,a.width),height:Math.max(c.body.scrollHeight,d.scrollHeight,a.height)}},N.firstChild=function(a){for(var b=a.childNodes,c=0,d=b&&b.length||0,e;c])\s*/g,B=/[\s\>\+\~]/,C=/(?![\s\w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^'"]*\]|[\s\w\+\-]*\))/,D=/([.*+?\^=!:${}()|\[\]\/\\])/g,E=/^([a-z0-9]+)?(?:([\.\#]+[\w\-\.#]+)?)/,F=/\[([\w\-]+)(?:([\|\^\$\*\~]?\=)['"]?([ \w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^]+)["']?)?\]/,G=/:([\w\-]+)(\(['"]?([\s\w\+\-]+)['"]?\))?/,H=new RegExp("("+B.source+")"+C.source,"g"),I=new RegExp(B.source+C.source),J=new RegExp(E.source+"("+F.source+")?"+"("+G.source+")?"),K={" ":function(a){return a&&a!==t&&a.parentNode},">":function(a,b){return a&&a.parentNode==b.parentNode&&a.parentNode},"~":function(a){return a&&a.previousSibling},"+":function(a,b,c,d){if(!a)return!1;c=R(a),d=R(b);return c&&d&&c==d&&c}};L.prototype={g:function(a){return this.c[a]||undefined},s:function(a,b){this.c[a]=b;return b}};var M=new L,N=new L,O=new L,P=new L,ba="compareDocumentPosition"in t?function(a,b){return(b.compareDocumentPosition(a)&16)==16}:"contains"in t?function(a,c){c=c==b||c==window?t:c;return c!==a&&c.contains(a)}:function(a,b){while(a=a.parentNode)if(a===b)return 1;return 0},bb=function(){if(!b.querySelector||!b.querySelectorAll)return!1;try{return b.querySelectorAll(":nth-of-type(1)").length>0}catch(a){return!1}}(),bc=bb?function(a,c){return b.getElementsByClassName&&(h=a.match(x))?Q(c.getElementsByClassName(h[1])):Q(c.querySelectorAll(a))}:function(a,c){a=a.replace(A,"$1");var d=[],f,i,j=[],l;if(h=a.match(z)){r=c.getElementsByTagName(h[1]||"*"),k=M.g(h[2])||M.s(h[2],new RegExp("(^|\\s+)"+h[2]+"(\\s+|$)"));for(l=0,g=r.length,e=0;l]+)/.exec(b)[1],f=(c||a).createElement(e[d]||"div"),g=[];f.innerHTML=b;var h=f.childNodes;f=f.firstChild,g.push(f);while(f=f.nextSibling)f.nodeType==1&&g.push(f);return g}var c=require("qwery"),d="table",e={thead:d,tbody:d,tfoot:d,tr:"tbody",th:"tr",td:"tr",fieldset:"form",option:"select"};b._select=function(a,b){return/^\s* Date: Mon, 26 Sep 2011 11:00:35 +0200 Subject: Makes img tag more flexible, adds support for relative paths. Includes pull request #145, fixes #161 --- plugins/image_tag.rb | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/plugins/image_tag.rb b/plugins/image_tag.rb index 25a38df5..92e21765 100644 --- a/plugins/image_tag.rb +++ b/plugins/image_tag.rb @@ -1,46 +1,47 @@ # Title: Simple Image tag for Jekyll -# Author: Brandon Mathis http://brandonmathis.com -# Description: Easily output images with optional class names and title/alt attributes +# Authors: Brandon Mathis http://brandonmathis.com +# Felix Schäfer, Frederic Hemberger +# Description: Easily output images with optional class names, width, height, title and alt attributes # -# Syntax {% image [class name(s)] url [title text] %} +# Syntax {% img [class name(s)] [http[s]:/]/path/to/image [width [height]] [title text | "title text" ["alt text"]] %} # -# Example: -# {% ima left half http://site.com/images/ninja.png Ninja Attack! %} +# Examples: +# {% img /images/ninja.png Ninja Attack! %} +# {% img left half http://site.com/images/ninja.png Ninja Attack! %} +# {% img left half http://site.com/images/ninja.png 150 150 "Ninja Attack!" "Ninja in attack posture" %} # # Output: -# Ninja Attack! +# +# Ninja Attack! +# Ninja in attack posture # module Jekyll class ImageTag < Liquid::Tag @img = nil - @title = nil - @class = '' - @width = '' - @height = '' def initialize(tag_name, markup, tokens) - if markup =~ /(\S.*\s+)?(https?:\/\/|\/)(\S+)(\s+\d+\s+\d+)?(\s+.+)?/i - @class = $1 || '' - @img = $2 + $3 - if $5 - @title = $5.strip - end - if $4 =~ /\s*(\d+)\s+(\d+)/ - @width = $1 - @height = $2 + attributes = ['class', 'src', 'width', 'height', 'title'] + + if markup =~ /(?\S.*\s+)?(?(?:https?:\/\/|\/|\S+\/)\S+)(?:\s+(?\d+))?(?:\s+(?\d+))?(?\s+.+)?/i + @img = attributes.reduce({}) { |img, attr| img[attr] = $~[attr].strip if $~[attr]; img } + if @img['title'] =~ /(?:"|')([^"']+)?(?:"|')\s+(?:"|')([^"']+)?(?:"|')/ + @img['title'] = $1 + @img['alt'] = $2 + else + @img['alt'] = @img['title'].gsub!(/"/, '') end + @img['class'].gsub!(/"/, '') end super end def render(context) - output = super if @img - "<img class='#{@class}' src='#{@img}' width='#{@width}' height='#{@height}' alt='#{@title}' title='#{@title}'>" + "<img #{@img.collect {|k,v| "#{k}=\"#{v}\"" if v}.join(" ")}>" else - "Error processing input, expected syntax: {% img [class name(s)] /url/to/image [width height] [title text] %}" + "Error processing input, expected syntax: {% img [class name(s)] [http[s]:/]/path/to/image [width [height]] [title text | \"title text\" [\"alt text\"]] %}" end end end -- cgit v1.2.1 From 9bd572ffdc907301691e5ff5a62d68ecfa883229 Mon Sep 17 00:00:00 2001 From: Frederic Hemberger <mail@frederic-hemberger.de> Date: Mon, 26 Sep 2011 11:51:44 +0200 Subject: Adds jsFiddle plugin --- plugins/jsfiddle.rb | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 plugins/jsfiddle.rb diff --git a/plugins/jsfiddle.rb b/plugins/jsfiddle.rb new file mode 100644 index 00000000..3ae173eb --- /dev/null +++ b/plugins/jsfiddle.rb @@ -0,0 +1,40 @@ +# Title: jsFiddle tag for Jekyll +# Author: Brian Arnold (@brianarn) +# Description: +# Given a jsFiddle shortcode, outputs the jsFiddle iframe code. +# Using 'default' will preserve defaults as specified by jsFiddle. +# +# Syntax: {% jsfiddle shorttag [tabs] [skin] [height] [width] %} +# +# Examples: +# +# Input: {% jsfiddle ccWP7 %} +# Output: <iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/ccWP7/embedded/js,resources,html,css,result/light/"></iframe> +# +# Input: {% jsfiddle ccWP7 js,html,result %} +# Output: <iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/ccWP7/embedded/js,html,result/light/"></iframe> +# + +module Jekyll + class JsFiddle < Liquid::Tag + def initialize(tag_name, markup, tokens) + if /(?<fiddle>\w+)(?:\s+(?<sequence>[\w,]+))?(?:\s+(?<skin>\w+))?(?:\s+(?<height>\w+))?(?:\s+(?<width>\w+))?/ =~ markup + @fiddle = fiddle + @sequence = (sequence unless sequence == 'default') || 'js,resources,html,css,result' + @skin = (skin unless skin == 'default') || 'light' + @width = width || '100%' + @height = height || '300px' + end + end + + def render(context) + if @fiddle + "<iframe style=\"width: #{@width}; height: #{@height}\" src=\"http://jsfiddle.net/#{@fiddle}/embedded/#{@sequence}/#{@skin}/\"></iframe>" + else + "Error processing input, expected syntax: {% jsfiddle shorttag [tabs] [skin] [height] [width] %}" + end + end + end +end + +Liquid::Template.register_tag('jsfiddle', Jekyll::JsFiddle) \ No newline at end of file -- cgit v1.2.1 From 19a646b5e9e5f294896afc7552a4941933b8fb22 Mon Sep 17 00:00:00 2001 From: Frederic Hemberger <mail@frederic-hemberger.de> Date: Mon, 26 Sep 2011 11:54:45 +0200 Subject: Escapes double quotes in img tag --- plugins/image_tag.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/image_tag.rb b/plugins/image_tag.rb index 92e21765..20595cb9 100644 --- a/plugins/image_tag.rb +++ b/plugins/image_tag.rb @@ -26,11 +26,11 @@ module Jekyll if markup =~ /(?<class>\S.*\s+)?(?<src>(?:https?:\/\/|\/|\S+\/)\S+)(?:\s+(?<width>\d+))?(?:\s+(?<height>\d+))?(?<title>\s+.+)?/i @img = attributes.reduce({}) { |img, attr| img[attr] = $~[attr].strip if $~[attr]; img } - if @img['title'] =~ /(?:"|')([^"']+)?(?:"|')\s+(?:"|')([^"']+)?(?:"|')/ - @img['title'] = $1 - @img['alt'] = $2 + if /(?:"|')(?<title>[^"']+)?(?:"|')\s+(?:"|')(?<alt>[^"']+)?(?:"|')/ =~ @img['title'] + @img['title'] = title + @img['alt'] = alt else - @img['alt'] = @img['title'].gsub!(/"/, '') + @img['alt'] = @img['title'].gsub!(/"/, '"') end @img['class'].gsub!(/"/, '') end -- cgit v1.2.1 From 167db49940a7c7c8269232600c12ae6757ac4080 Mon Sep 17 00:00:00 2001 From: Frederic Hemberger <mail@frederic-hemberger.de> Date: Mon, 26 Sep 2011 13:53:12 +0200 Subject: Refactores twitter widget - Order of code: Define functions first before using them - Fixed issues found by jsHint (http://jshint.com) - Switched to Twitter's current API url - Expand shortened urls, fixes #165 --- .themes/classic/source/javascripts/twitter.js | 113 ++++++++++++-------------- 1 file changed, 54 insertions(+), 59 deletions(-) diff --git a/.themes/classic/source/javascripts/twitter.js b/.themes/classic/source/javascripts/twitter.js index a4e85557..ea1580e4 100644 --- a/.themes/classic/source/javascripts/twitter.js +++ b/.themes/classic/source/javascripts/twitter.js @@ -1,43 +1,5 @@ // JSON-P Twitter fetcher for Octopress // (c) Brandon Mathis // MIT Lisence -function getTwitterFeed(user, count, replies) { - var feed = new jXHR(); - - feed.onerror = function (msg,url) { - $('#tweets li.loading').addClass('error').text("Twitter's busted"); - } - feed.onreadystatechange = function(data){ - if (feed.readyState === 4) { - var tweets = new Array(); - var i = 0; - for (i in data){ - if(tweets.length < count){ - if(replies || data[i].in_reply_to_user_id == null){ - tweets.push(data[i]); - } - } - } - showTwitterFeed(tweets, user); - } - }; - feed.open("GET","http://twitter.com/statuses/user_timeline/"+user+".json?trim_user=true&count="+(parseInt(count)+60)+"&callback=?"); - feed.send(); -} - -function showTwitterFeed(tweets, twitter_user){ - var timeline = document.getElementById('tweets'); - timeline.innerHTML=''; - for (t in tweets){ - timeline.innerHTML+='<li>'+'<p>'+'<a href="http://twitter.com/'+twitter_user+'/status/'+tweets[t].id_str+'">'+prettyDate(tweets[t].created_at)+'</a>'+linkifyTweet(tweets[t].text.replace(/\n/g, '<br>'))+'</p>'+'</li>'; - } -} -function linkifyTweet(text){ - return text.replace(/(https?:\/\/)([\w\-:;?&=+.%#\/]+)/gi, '<a href="$1$2">$2</a>') - .replace(/(^|\W)@(\w+)/g, '$1<a href="http://twitter.com/$2">@$2</a>') - .replace(/(^|\W)#(\w+)/g, '$1<a href="http://search.twitter.com/search?q=%23$2">#$2</a>'); -} - - // jXHR.js (JSON-P XHR) | v0.1 (c) Kyle Simpson | MIT License | http://mulletxhr.com/ // uncompressed version available in source/javascripts/libs/jXHR.js @@ -45,38 +7,71 @@ function linkifyTweet(text){ /* Sky Slavin, Ludopoli. MIT license. * based on JavaScript Pretty Date * Copyright (c) 2008 John Resig (jquery.com) * Licensed under the MIT license. */ - function prettyDate(time) { - if (navigator.appName == 'Microsoft Internet Explorer') { + if (navigator.appName === 'Microsoft Internet Explorer') { return "<span>∞</span>"; // because IE date parsing isn't fun. - }; + } - var say = {}; - say.just_now = " now", - say.minute_ago = "1m", - say.minutes_ago = "m", - say.hour_ago = "1h", - say.hours_ago = "h", - say.yesterday = "1d", - say.days_ago = "d", - say.weeks_ago = "w" + var say = { + just_now: " now", + minute_ago: "1m", + minutes_ago: "m", + hour_ago: "1h", + hours_ago: "h", + yesterday: "1d", + days_ago: "d", + weeks_ago: "w" + }; - var current_date = new Date(); - current_date_time = current_date.getTime(); - current_date_full = current_date_time + (1 * 60000); - var date = new Date(time); - var diff = ((current_date_full - date.getTime()) / 1000); - var day_diff = Math.floor(diff / 86400); + var current_date = new Date(), + current_date_time = current_date.getTime(), + current_date_full = current_date_time + (1 * 60000), + date = new Date(time), + diff = ((current_date_full - date.getTime()) / 1000), + day_diff = Math.floor(diff / 86400); - if (isNaN(day_diff) || day_diff < 0) return "<span>∞</span>"; + if (isNaN(day_diff) || day_diff < 0) { return "<span>∞</span>"; } - return day_diff == 0 && ( + return day_diff === 0 && ( diff < 60 && say.just_now || diff < 120 && say.minute_ago || diff < 3600 && Math.floor(diff / 60) + say.minutes_ago || diff < 7200 && say.hour_ago || diff < 86400 && Math.floor(diff / 3600) + say.hours_ago) || - day_diff == 1 && say.yesterday || + day_diff === 1 && say.yesterday || day_diff < 7 && day_diff + say.days_ago || day_diff > 7 && Math.ceil(day_diff / 7) + say.weeks_ago; } + +function linkifyTweet(text, url) { + for (var u in url) { + var shortUrl = new RegExp(url[u].url, 'g'); + text = text.replace(shortUrl, '<a href="' + url[u].expanded_url + '">' + url[u].expanded_url.replace(/https?:\/\//, '') + '</a>'); + } + return text.replace(/(^|\W)@(\w+)/g, '$1<a href="http://twitter.com/$2">@$2</a>') + .replace(/(^|\W)#(\w+)/g, '$1<a href="http://search.twitter.com/search?q=%23$2">#$2</a>'); +} + +function showTwitterFeed(tweets, twitter_user) { + var timeline = document.getElementById('tweets'), + content = ''; + + for (var t in tweets) { + content += '<li>'+'<p>'+'<a href="http://twitter.com/'+twitter_user+'/status/'+tweets[t].id_str+'">'+prettyDate(tweets[t].created_at)+'</a>'+linkifyTweet(tweets[t].text.replace(/\n/g, '<br>'), tweets[t].entities.urls)+'</p>'+'</li>'; + } + timeline.innerHTML = content; +} + +function getTwitterFeed(user, count, replies) { + var feed = new jXHR(); + feed.onerror = function (msg,url) { + $('#tweets li.loading').addClass('error').text("Twitter's busted"); + }; + feed.onreadystatechange = function(data){ + if (feed.readyState === 4) { showTwitterFeed(data, user); } + }; + + // Documentation: https://dev.twitter.com/docs/api/1/get/statuses/user_timeline + feed.open("GET","http://api.twitter.com/1/statuses/user_timeline/" + user + ".json?trim_user=true&count=" + (parseInt(count, 10)) + "&include_entities=1&exclude_replies=" + (replies ? "0" : "1") + "&callback=?"); + feed.send(); +} \ No newline at end of file -- cgit v1.2.1 From 40a7809d654b91fd6cf5cba6a4102b1067bb33f8 Mon Sep 17 00:00:00 2001 From: Frederic Hemberger <mail@frederic-hemberger.de> Date: Mon, 26 Sep 2011 14:19:47 +0200 Subject: Fixes delicious integration #179 --- .themes/classic/source/_includes/asides/delicious.html | 5 +++-- .themes/classic/source/javascripts/octopress.js | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.themes/classic/source/_includes/asides/delicious.html b/.themes/classic/source/_includes/asides/delicious.html index 560e4afa..8c75b822 100644 --- a/.themes/classic/source/_includes/asides/delicious.html +++ b/.themes/classic/source/_includes/asides/delicious.html @@ -1,7 +1,8 @@ {% if site.delicious_user %} <section> <h1>On Delicious</h1> - <script type="text/javascript" src="http://feeds.delicious.com/v2/js/{{ site.delicious_user }}?title=&count={{ site.delicious_count }}&sort=date&extended"></script> + <div id="delicious"></div> + <script type="text/javascript" src="http://feeds.delicious.com/v1/json/{{ site.delicious_user }}?count={{ site.delicious_count }}&sort=date&callback=renderDeliciousLinks"></script> <p><a href="http://delicious.com/{{ site.delicious_user }}">My Delicious Bookmarks »</a></p> </section> -{% endif %} +{% endif %} \ No newline at end of file diff --git a/.themes/classic/source/javascripts/octopress.js b/.themes/classic/source/javascripts/octopress.js index fc679f11..35174fd8 100644 --- a/.themes/classic/source/javascripts/octopress.js +++ b/.themes/classic/source/javascripts/octopress.js @@ -104,6 +104,15 @@ function wrapFlashVideos() { }); } +function renderDeliciousLinks(items) { + var output = "<ul>"; + for (var i=0,l=items.length; i<l; i++) { + output += '<li><a href="' + items[i].u + '" title="Tags: ' + items[i].t.join(', ') + '">' + items[i].d + '</a></li>'; + } + output += "</ul>"; + $('#delicious').html(output); +} + $.domReady(function() { testFeatures(); wrapFlashVideos(); -- cgit v1.2.1 From 569717abdc90c5f4cca81d9785b143a8d2b6a67b Mon Sep 17 00:00:00 2001 From: Frederic Hemberger <mail@frederic-hemberger.de> Date: Mon, 26 Sep 2011 14:37:01 +0200 Subject: jsHint'ed github.js --- .themes/classic/source/javascripts/github.js | 70 +++++++++++++--------------- 1 file changed, 33 insertions(+), 37 deletions(-) diff --git a/.themes/classic/source/javascripts/github.js b/.themes/classic/source/javascripts/github.js index 623d493f..01877435 100644 --- a/.themes/classic/source/javascripts/github.js +++ b/.themes/classic/source/javascripts/github.js @@ -1,43 +1,39 @@ -github = (function(){ - function render(target, repos){ - var i = 0, fragment = '', t = $(target)[0]; +var github = (function(){ + function render(target, repos){ + var i = 0, fragment = '', t = $(target)[0]; - for(i = 0; i < repos.length; i++) - fragment += '<li><a href="'+repos[i].url+'">'+repos[i].name+'</a><p>'+repos[i].description+'</p></li>'; - - t.innerHTML = fragment; + for(i = 0; i < repos.length; i++) { + fragment += '<li><a href="'+repos[i].url+'">'+repos[i].name+'</a><p>'+repos[i].description+'</p></li>'; } - return { - showRepos: function(options){ - var feed = new jXHR(); - feed.onerror = function (msg,url) { - $(options.target + ' li.loading').addClass('error').text("Error loading feed"); - } - feed.onreadystatechange = function(data){ - if (feed.readyState === 4) { - var repos = []; - var i; - for (i = 0; i < data.repositories.length; i++){ - if (options.skip_forks && data.repositories[i].fork) - continue; - repos.push(data.repositories[i]); - } - repos.sort(function(a, b){ - var a = new Date(a.pushed_at), - b = new Date(b.pushed_at); - - if (a.valueOf() == b.valueOf()) return 0; - return a.valueOf() > b.valueOf() ? -1 : 1; - }); + t.innerHTML = fragment; + } + return { + showRepos: function(options){ + var feed = new jXHR(); + feed.onerror = function (msg,url) { + $(options.target + ' li.loading').addClass('error').text("Error loading feed"); + }; + feed.onreadystatechange = function(data) { + if (feed.readyState === 4) { + var repos = []; + for (var i = 0; i < data.repositories.length; i++){ + if (options.skip_forks && data.repositories[i].fork) { continue; } + repos.push(data.repositories[i]); + } + repos.sort(function(a, b) { + var aDate = new Date(a.pushed_at).valueOf(), + bDate = new Date(b.pushed_at).valueOf(); - if (options.count) - repos.splice(options.count); + if (aDate === bDate) { return 0; } + return aDate > bDate ? -1 : 1; + }); - render(options.target, repos) - } - }; - feed.open("GET","http://github.com/api/v2/json/repos/show/"+options.user+"?callback=?"); - feed.send(); + if (options.count) { repos.splice(options.count); } + render(options.target, repos); } - }; + }; + feed.open("GET","http://github.com/api/v2/json/repos/show/"+options.user+"?callback=?"); + feed.send(); + } + }; })(); \ No newline at end of file -- cgit v1.2.1 From ab62bb93558db7a422ee9c1b87e1b524b57dc5a4 Mon Sep 17 00:00:00 2001 From: Frederic Hemberger <mail@frederic-hemberger.de> Date: Mon, 26 Sep 2011 14:41:39 +0200 Subject: jsHint'ed octopress.js --- .themes/classic/source/javascripts/octopress.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.themes/classic/source/javascripts/octopress.js b/.themes/classic/source/javascripts/octopress.js index 35174fd8..c369625e 100644 --- a/.themes/classic/source/javascripts/octopress.js +++ b/.themes/classic/source/javascripts/octopress.js @@ -6,7 +6,7 @@ function getNav() { mobileNav.children('select').append('<option value="'+link.href+'">• '+link.text+'</option>'); }); mobileNav.children('select').bind('change', function(event) { - if (event.target.value) window.location.href = event.target.value; + if (event.target.value) { window.location.href = event.target.value; } }); } @@ -52,7 +52,7 @@ function testFeatures() { } function addCodeLineNumbers() { - if (navigator.appName == 'Microsoft Internet Explorer') { return; } + if (navigator.appName === 'Microsoft Internet Explorer') { return; } $('div.gist-highlight').each(function(code) { var tableStart = '<table><tbody><tr><td class="gutter">', lineNumbers = '<pre class="line-numbers">', @@ -72,7 +72,7 @@ function flashVideoFallback(){ flashplayerskin = "/assets/jwplayer/glow/glow.xml"; $('video').each(function(video){ video = $(video); - if (!Modernizr.video.h264 && swfobject.getFlashPlayerVersion() || window.location.hash.indexOf("flash-test") != -1){ + if (!Modernizr.video.h264 && swfobject.getFlashPlayerVersion() || window.location.hash.indexOf("flash-test") !== -1){ video.children('source[src$=mp4]').first().map(function(source){ var src = $(source).attr('src'), id = 'video_'+Math.round(1 + Math.random()*(100000)), -- cgit v1.2.1 From fdf6af1d25ddc991c96dc3b4df5f7e913adcd7ef Mon Sep 17 00:00:00 2001 From: Frederic Hemberger <mail@frederic-hemberger.de> Date: Mon, 26 Sep 2011 15:58:14 +0200 Subject: Fixes img tag properties --- plugins/image_tag.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/image_tag.rb b/plugins/image_tag.rb index 20595cb9..45670007 100644 --- a/plugins/image_tag.rb +++ b/plugins/image_tag.rb @@ -30,9 +30,9 @@ module Jekyll @img['title'] = title @img['alt'] = alt else - @img['alt'] = @img['title'].gsub!(/"/, '"') + @img['alt'] = @img['title'].gsub!(/"/, '"') if @img['title'] end - @img['class'].gsub!(/"/, '') + @img['class'].gsub!(/"/, '') if @img['class'] end super end -- cgit v1.2.1 From 7a7825f6679ec91df7df3993f58238e021f82675 Mon Sep 17 00:00:00 2001 From: Brandon Mathis <brandon@imathis.com> Date: Mon, 26 Sep 2011 09:11:14 -0500 Subject: collapse sidebar is now possible site-wide --- .themes/classic/source/_layouts/default.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.themes/classic/source/_layouts/default.html b/.themes/classic/source/_layouts/default.html index 0b1fc3a9..f670e1c9 100644 --- a/.themes/classic/source/_layouts/default.html +++ b/.themes/classic/source/_layouts/default.html @@ -1,6 +1,6 @@ {% capture root_url %}{{ site.root | strip_slash }}{% endcapture %} {% include head.html %} -<body {% if page.body_id %} id="{{ page.body_id }}" {% endif %} {% if page.sidebar == false %} class="no-sidebar" {% endif %} {% if page.sidebar == 'collapse' %} class="collapse-sidebar sidebar-footer" {% endif %}> +<body {% if page.body_id %} id="{{ page.body_id }}" {% endif %} {% if page.sidebar == false %} class="no-sidebar" {% endif %} {% if page.sidebar == 'collapse' or site.sidebar == 'collapse' %} class="collapse-sidebar sidebar-footer" {% endif %}> <header role="banner">{% include header.html %}</header> <nav role="navigation">{% include navigation.html %}</nav> <div id="main"> -- cgit v1.2.1 From 04586299b178840ddb64268e925de6d8aadf16cb Mon Sep 17 00:00:00 2001 From: Brandon Mathis <brandon@imathis.com> Date: Tue, 27 Sep 2011 00:57:45 -0500 Subject: fixed github line numbering issue, fixed a few bugs in code block styling --- .themes/classic/sass/partials/_syntax.scss | 31 ++++++++++++++----------- .themes/classic/source/javascripts/octopress.js | 2 +- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.themes/classic/sass/partials/_syntax.scss b/.themes/classic/sass/partials/_syntax.scss index 713d46e5..2ae61643 100644 --- a/.themes/classic/sass/partials/_syntax.scss +++ b/.themes/classic/sass/partials/_syntax.scss @@ -1,4 +1,5 @@ .highlight, html .gist .gist-file .gist-syntax .gist-highlight { + table td.code { width: 100%; } .line-numbers { text-align: right; font-size: 13px; @@ -85,19 +86,21 @@ h3.filename { + pre { @include border-top-radius(0px); } } -p code, -li code { - @extend .mono; - display: inline-block; - white-space: no-wrap; - background: #fff; - font-size: .8em; - line-height: 1.5em; - color: #555; - border: 1px solid #ddd; - @include border-radius(.4em); - padding: 0 .3em; - margin: -1px 0; +p, li { + code { + @extend .mono; + display: inline-block; + white-space: no-wrap; + background: #fff; + font-size: .8em; + line-height: 1.5em; + color: #555; + border: 1px solid #ddd; + @include border-radius(.4em); + padding: 0 .3em; + margin: -1px 0; + } + pre code { font-size: 1em !important; background: none; border: none; } } .pre-code { @@ -216,6 +219,7 @@ figure.code { margin-bottom: 0; } } + .code-title { text-align: center; font-size: 13px; @@ -243,3 +247,4 @@ figure.code { text-shadow: #cbcccc 0 1px 0; padding-left: 3em; } + diff --git a/.themes/classic/source/javascripts/octopress.js b/.themes/classic/source/javascripts/octopress.js index c369625e..f6259f63 100644 --- a/.themes/classic/source/javascripts/octopress.js +++ b/.themes/classic/source/javascripts/octopress.js @@ -58,7 +58,7 @@ function addCodeLineNumbers() { lineNumbers = '<pre class="line-numbers">', tableMiddle = '</pre></td><td class="code">', tableEnd = '</td></tr></tbody></table>', - count = $('span.line', code).length; + count = $('.line', code).length; for (var i=1;i<=count; i++) { lineNumbers += '<span class="line-number">'+i+'</span>\n'; } -- cgit v1.2.1 From 347c95489463047f5282cad0aa0377394797556c Mon Sep 17 00:00:00 2001 From: Brandon Mathis <brandon@imathis.com> Date: Tue, 27 Sep 2011 23:50:08 -0500 Subject: updated added reqwest to ender.js, fixed twitter.js url expansion bug --- .themes/classic/source/javascripts/ender.js | 17 ++++++++---- .themes/classic/source/javascripts/twitter.js | 39 +++++++++++++-------------- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/.themes/classic/source/javascripts/ender.js b/.themes/classic/source/javascripts/ender.js index c5c7c2c0..1add349c 100644 --- a/.themes/classic/source/javascripts/ender.js +++ b/.themes/classic/source/javascripts/ender.js @@ -1,7 +1,7 @@ /*! * ============================================================= * Ender: open module JavaScript framework (https://ender.no.de) - * Build: ender build jeesh --output jeesh + * Build: ender build jeesh reqwest * ============================================================= */ @@ -12,7 +12,14 @@ * http://ender.no.de * License MIT */ -!function(a){function h(a,b){return g(a,b)}function g(a,b,c){h._select&&(typeof a=="string"||a.nodeName||a.length&&"item"in a||a==window)?(c=h._select(a,b),c.selector=a):c=isFinite(a.length)?a:[a];return f(c,g)}function f(a,b){for(var c in b)c!="noConflict"&&c!="_VERSION"&&(a[c]=b[c]);return a}function e(a,c){return b[a]=c}function d(a){var c=b[a]||window[a];if(!c)throw new Error("Requested module '"+a+"' has not been defined.");return c}a.global=a;var b={},c=a.$;a.provide=e,a.require=d,f(h,{_VERSION:"0.3.4",fn:a.$&&a.$.fn||{},ender:function(a,b){f(b?g:h,a)},_select:function(a,b){return(b||document).querySelectorAll(a)}}),f(g,{forEach:function(a,b,c){for(c=0,l=this.length;c<l;++c)c in this&&a.call(b||this[c],this[c],c,this);return this},$:h}),h.noConflict=function(){a.$=c;return this},typeof module!="undefined"&&module.exports&&(module.exports=h),a.ender=a.$=a.ender||h}(this),!function(){var a={exports:{}},b=a.exports; +!function(a){function d(a){var c=b[a]||window[a];if(!c)throw new Error("Requested module '"+a+"' has not been defined.");return c}function e(a,c){return b[a]=c}function f(a,b){for(var c in b)c!="noConflict"&&c!="_VERSION"&&(a[c]=b[c]);return a}function g(a,b,c){return h._select&&(typeof a=="string"||a.nodeName||a.length&&"item"in a||a==window)?(c=h._select(a,b),c.selector=a):c=isFinite(a.length)?a:[a],f(c,g)}function h(a,b){return g(a,b)}a.global=a;var b={},c=a.$;a.provide=e,a.require=d,f(h,{_VERSION:"0.3.4",fn:a.$&&a.$.fn||{},ender:function(a,b){f(b?g:h,a)},_select:function(a,b){return(b||document).querySelectorAll(a)}}),f(g,{forEach:function(a,b,c){for(c=0,l=this.length;c<l;++c)c in this&&a.call(b||this[c],this[c],c,this);return this},$:h}),h.noConflict=function(){return a.$=c,this},typeof module!="undefined"&&module.exports&&(module.exports=h),a.ender=a.$=a.ender||h}(this),!function(){var module={exports:{}},exports=module.exports; +/*! + * Reqwest! A general purpose XHR connection manager + * (c) Dustin Diaz 2011 + * https://github.com/ded/reqwest + * license MIT + */ +!function(a,b){typeof define=="function"?define(b):typeof module!="undefined"?module.exports=b():this[a]=b()}("reqwest",function(){function handleReadyState(a,b,c){return function(){a&&a[readyState]==4&&(twoHundo.test(a.status)?b(a):c(a))}}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest"),c[contentType]=c[contentType]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d])}function getCallbackName(a,b){var c=a.jsonpCallback||"callback";if(a.url.slice(-(c.length+2))==c+"=?"){var d="reqwest_"+b;return a.url=a.url.substr(0,a.url.length-1)+d,d}var e=new RegExp(c+"=([\\w]+)");return a.url.match(e)[1]}function generalCallback(a){lastValue=a}function getRequest(a,b,c){if(a.type!="jsonp"){var g=xhr(),h=(a.method||"GET").toUpperCase(),i=typeof a=="string"?a:a.url,j=a.processData!==!1&&a.data&&typeof a.data!="string"?reqwest.toQueryString(a.data):a.data||null;return h=="GET"&&j&&j!==""&&(i+=(/\?/.test(i)?"&":"?")+j)&&(j=null),g.open(h,i,!0),setHeaders(g,a),g.onreadystatechange=handleReadyState(g,b,c),a.before&&a.before(g),g.send(j),g}var d=doc.createElement("script"),e=0,f=uniqid++;win[getCallbackName(a,f)]=generalCallback,d.type="text/javascript",d.src=a.url,d.async=!0,typeof d.onreadystatechange!="undefined"&&(d.event="onclick",d.htmlFor=d.id="_reqwest_"+f),d.onload=d.onreadystatechange=function(){if(d[readyState]&&d[readyState]!=="complete"&&d[readyState]!=="loaded"||e)return!1;d.onload=d.onreadystatechange=null,d.onclick&&d.onclick(),a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(d),e=1},head.appendChild(d)}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function setType(a){return/\.json$/.test(a)?"json":/\.jsonp$/.test(a)?"jsonp":/\.js$/.test(a)?"js":/\.html?$/.test(a)?"html":/\.xml$/.test(a)?"xml":"js"}function init(o,fn){function complete(a){o.timeout&&clearTimeout(self.timeout),self.timeout=null,o.complete&&o.complete(a)}function success(resp){var r=resp.responseText;if(r)switch(type){case"json":try{resp=win.JSON?win.JSON.parse(r):eval("("+r+")")}catch(err){return error(resp,"Could not parse JSON in response",err)}break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function error(a,b,c){o.error&&o.error(a,b,c),complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort()},o.timeout)),this.request=getRequest(o,success,error)}function reqwest(a,b){return new Reqwest(a,b)}function normalize(a){return a?a.replace(/\r?\n/g,"\r\n"):""}function serial(a,b){var c=a.name,d=a.tagName.toLowerCase(),e;if(a.disabled||!c)return;switch(d){case"input":if(!/reset|button|image|file/i.test(a.type)){var f=/checkbox/i.test(a.type),g=/radio/i.test(a.type),h=a.value;(!f&&!g||a.checked)&&b(c,normalize(f&&h===""?"on":h))}break;case"textarea":b(c,normalize(a.value));break;case"select":if(a.type.toLowerCase()==="select-one")e=a.selectedIndex<0?null:a.options[a.selectedIndex],e&&!e.disabled&&b(c,normalize(e.value||e.text));else for(var i=0;a.length&&i<a.length;i++)e=a.options[i],e.selected&&!e.disabled&&b(c,normalize(e.value||e.text))}}function eachFormElement(){var a=this,b=function(b,c){for(var d=0;d<c.length;d++){var e=b[byTag](c[d]);for(var f=0;f<e.length;f++)serial(e[f],a)}};for(var c=0;c<arguments.length;c++){var d=arguments[c];/input|select|textarea/i.test(d.tagName)&&serial(d,a),b(d,["input","select","textarea"])}}function serializeQueryString(){return reqwest.toQueryString(reqwest.serializeArray.apply(null,arguments))}function serializeHash(){var a={};return eachFormElement.apply(function(b,c){b in a?(a[b]&&!isArray(a[b])&&(a[b]=[a[b]]),a[b].push(c)):a[b]=c},arguments),a}var context=this,win=window,doc=document,old=context.reqwest,twoHundo=/^20\d$/,byTag="getElementsByTagName",readyState="readyState",contentType="Content-Type",head=doc[byTag]("head")[0],uniqid=0,lastValue,xhr="XMLHttpRequest"in win?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")};Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}};var isArray=typeof Array.isArray=="function"?Array.isArray:function(a){return Object.prototype.toString.call(a)=="[object Array]"};return reqwest.serializeArray=function(){var a=[];return eachFormElement.apply(function(b,c){a.push({name:b,value:c})},arguments),a},reqwest.serialize=function(){if(arguments.length===0)return"";var a,b,c=Array.prototype.slice.call(arguments,0);return a=c.pop(),a&&a.nodeType&&c.push(a)&&(a=null),a&&(a=a.type),a=="map"?b=serializeHash:a=="array"?b=reqwest.serializeArray:b=serializeQueryString,b.apply(null,c)},reqwest.toQueryString=function(a){var b="",c,d=encodeURIComponent,e=function(a,c){b+=d(a)+"="+d(c)+"&"};if(isArray(a))for(c=0;a&&c<a.length;c++)e(a[c].name,a[c].value);else for(var f in a){if(!Object.hasOwnProperty.call(a,f))continue;var g=a[f];if(isArray(g))for(c=0;c<g.length;c++)e(f,g[c]);else e(f,a[f])}return b.replace(/&$/,"").replace(/%20/g,"+")},reqwest.noConflict=function(){return context.reqwest=old,this},reqwest}),provide("reqwest",module.exports),!function(a){var b=require("reqwest"),c=function(a){return function(){var c=(this&&this.length>0?this:[]).concat(Array.prototype.slice.call(arguments,0));return b[a].apply(null,c)}},d=c("serialize"),e=c("serializeArray");a.ender({ajax:b,serialize:d,serializeArray:e,toQueryString:b.toQueryString}),a.ender({serialize:d,serializeArray:e},!0)}(ender)}(),!function(){var a={exports:{}},b=a.exports; /*! * bean.js - copyright Jacob Thornton 2011 * https://github.com/fat/bean @@ -22,17 +29,17 @@ * dperini: https://github.com/dperini/nwevents * the entire mootools team: github.com/mootools/mootools-core */ -!function(b){function G(a){var b=a.relatedTarget;return b?b!=this&&b.prefix!="xul"&&!/document/.test(this.toString())&&!q(this,b):b===null}var c=1,d={},e={},f=/over|out/,g=/[^\.]*(?=\..*)\.|.*/,h=/\..*/,i="addEventListener",j="attachEvent",k="removeEventListener",l="detachEvent",m=b.document||{},n=m.documentElement||{},o=n[i],p=o?i:j,q=function(a,b){var c=b.parentNode;while(c!==null){if(c==a)return!0;c=c.parentNode}},r=function(a,b){return a.__uid=b&&b+"::"+c++||a.__uid||c++},s=function(a){var b=r(a);return d[b]=d[b]||{}},t=o?function(a,b,c,d){a[d?i:k](b,c,!1)}:function(a,b,c,d,e){e&&d&&(a["_on"+e]=a["_on"+e]||0),a[d?j:l]("on"+b,c)},u=function(a,c,d){return function(e){e=E(e||((this.ownerDocument||this.document||this).parentWindow||b).event);return c.apply(a,[e].concat(d))}},v=function(a,b,c,d,e){return function(f){(d?d.apply(this,arguments):o?!0:f&&f.propertyName=="_on"+c||!f)&&b.apply(a,Array.prototype.slice.call(arguments,f?0:1).concat(e))}},w=function(a,b,c,d){var f=b.replace(h,""),i=s(a),j=i[f]||(i[f]={}),k=c,l=r(c,b.replace(g,""));if(j[l])return a;var m=H[f];m&&(c=m.condition?v(a,c,f,m.condition):c,f=m.base||f);var n=F[f];c=n?u(a,c,d):v(a,c,f,!1,d),n=o||n;if(f=="unload"){var q=c;c=function(){x(a,f,c)&&q()}}a[p]&&t(a,n?f:"propertychange",c,!0,!n&&f),j[l]=c,c.__uid=l,c.__originalFn=k;return f=="unload"?a:e[r(a)]=a},x=function(a,b,c){function l(b){c=j[k][b];if(!!c){delete j[k][b];if(a[p]){k=H[k]?H[k].base:k;var d=o||F[k];t(a,d?k:"propertychange",c,!1,!d&&k)}}}var d,e,f,i,j=s(a),k=b.replace(h,"");if(!j||!j[k])return a;e=b.replace(g,""),f=e?e.split("."):[c.__uid],l(e);for(i=f.length;i--;l(f[i]));return a},y=function(a,b,c){return function(d){var e=typeof a=="string"?c(a,this):a;for(var f=d.target;f&&f!=this;f=f.parentNode)for(var g=e.length;g--;)if(e[g]==f)return b.apply(f,arguments)}},z=function(a,b,c,d,e){if(typeof b=="object"&&!c)for(var f in b)b.hasOwnProperty(f)&&z(a,f,b[f]);else{var g=typeof c=="string",h=(g?c:b).split(" ");c=g?y(b,d,e):c;for(var i=h.length;i--;)w(a,h[i],c,Array.prototype.slice.call(arguments,g?4:3))}return a},A=function(a,b,c){var d,e,f,i,j,k=typeof b=="string",l=k&&b.replace(g,""),l=l&&l.split("."),m=x,n=s(a);if(k&&/\s/.test(b)){b=b.split(" "),j=b.length-1;while(A(a,b[j])&&j--);return a}i=k?b.replace(h,""):b;if(!n||l||k&&!n[i]){for(d in n)if(n.hasOwnProperty(d))for(j in n[d])for(e=l.length;e--;)n[d].hasOwnProperty(j)&&(new RegExp("^"+l[e]+"::\\d*(\\..*)?$")).test(j)&&m(a,[d,j].join("."));return a}if(typeof c=="function")m(a,i,c);else if(l)m(a,b);else{m=i?m:A,f=k&&i,i=i?c||n[i]||i:n;for(d in i)i.hasOwnProperty(d)&&(m(a,f||d,i[d]),delete i[d])}return a},B=function(a,b,c){var d,e,f,i,j=b.split(" ");for(f=j.length;f--;){b=j[f].replace(h,"");var k=F[b],l=j[f].replace(g,""),m=s(a)[b];if(l){l=l.split(".");for(e=l.length;e--;)for(i in m)m.hasOwnProperty(i)&&(new RegExp("^"+l[e]+"::\\d*(\\..*)?$")).test(i)&&m[i].apply(a,[!1].concat(c))}else if(!c&&a[p])C(k,b,a);else for(e in m)m.hasOwnProperty(e)&&m[e].apply(a,[!1].concat(c))}return a},C=o?function(a,c,d){evt=document.createEvent(a?"HTMLEvents":"UIEvents"),evt[a?"initEvent":"initUIEvent"](c,!0,!0,b,1),d.dispatchEvent(evt)}:function(a,b,c){a?c.fireEvent("on"+b,document.createEventObject()):c["_on"+b]++},D=function(a,b,c){var d=s(b),e,f,g=r(a);e=c?d[c]:d;for(f in e)e.hasOwnProperty(f)&&(c?z:D)(a,c||b,c?e[f].__originalFn:f);return a},E=function(a){var b={};if(!a)return b;var c=a.type,d=a.target||a.srcElement;b.preventDefault=E.preventDefault(a),b.stopPropagation=E.stopPropagation(a),b.target=d&&d.nodeType==3?d.parentNode:d;if(~c.indexOf("key"))b.keyCode=a.which||a.keyCode;else if(/click|mouse|menu/i.test(c)){b.rightClick=a.which==3||a.button==2,b.pos={x:0,y:0};if(a.pageX||a.pageY)b.clientX=a.pageX,b.clientY=a.pageY;else if(a.clientX||a.clientY)b.clientX=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,b.clientY=a.clientY+document.body.scrollTop+document.documentElement.scrollTop;f.test(c)&&(b.relatedTarget=a.relatedTarget||a[(c=="mouseover"?"from":"to")+"Element"])}for(var e in a)e in b||(b[e]=a[e]);return b};E.preventDefault=function(a){return function(){a.preventDefault?a.preventDefault():a.returnValue=!1}},E.stopPropagation=function(a){return function(){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}};var F={click:1,dblclick:1,mouseup:1,mousedown:1,contextmenu:1,mousewheel:1,DOMMouseScroll:1,mouseover:1,mouseout:1,mousemove:1,selectstart:1,selectend:1,keydown:1,keypress:1,keyup:1,orientationchange:1,touchstart:1,touchmove:1,touchend:1,touchcancel:1,gesturestart:1,gesturechange:1,gestureend:1,focus:1,blur:1,change:1,reset:1,select:1,submit:1,load:1,unload:1,beforeunload:1,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1},H={mouseenter:{base:"mouseover",condition:G},mouseleave:{base:"mouseout",condition:G},mousewheel:{base:/Firefox/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel"}},I={add:z,remove:A,clone:D,fire:B},J=function(a){var b=A(a).__uid;b&&(delete e[b],delete d[b])};b[j]&&z(b,"unload",function(){for(var a in e)e.hasOwnProperty(a)&&J(e[a]);b.CollectGarbage&&CollectGarbage()});var K=b.bean;I.noConflict=function(){b.bean=K;return this},typeof a!="undefined"&&a.exports?a.exports=I:b.bean=I}(this),provide("bean",a.exports),!function(a){var b=require("bean"),c=function(c,d,e){var f=d?[d]:[];return function(){for(var e,g=0,h=this.length;g<h;g++)e=[this[g]].concat(f,Array.prototype.slice.call(arguments,0)),e.length==4&&e.push(a),!arguments.length&&c=="add"&&d&&(c="fire"),b[c].apply(this,e);return this}},d=c("add"),e=c("remove"),f=c("fire"),g={on:d,addListener:d,bind:d,listen:d,delegate:d,unbind:e,unlisten:e,removeListener:e,undelegate:e,emit:f,trigger:f,cloneEvents:c("clone"),hover:function(a,c,d){for(d=this.length;d--;)b.add.call(this,this[d],"mouseenter",a),b.add.call(this,this[d],"mouseleave",c);return this}},h,i=["blur","change","click","dblclick","error","focus","focusin","focusout","keydown","keypress","keyup","load","mousedown","mouseenter","mouseleave","mouseout","mouseover","mouseup","mousemove","resize","scroll","select","submit","unload"];for(h=i.length;h--;)g[i[h]]=c("add",i[h]);a.ender(g,!0)}(ender)}(),!function(){var a={exports:{}},b=a.exports; +!function(b,c){typeof define=="function"?define(c):typeof a!="undefined"?a.exports=c():this[b]=c()}("bean",function(){function F(a){var b=a.relatedTarget;return b?b!=this&&b.prefix!="xul"&&!/document/.test(this.toString())&&!p(this,b):b===null}var a=window,b=1,c={},d={},e=/over|out/,f=/[^\.]*(?=\..*)\.|.*/,g=/\..*/,h="addEventListener",i="attachEvent",j="removeEventListener",k="detachEvent",l=document||{},m=l.documentElement||{},n=m[h],o=n?h:i,p=function(a,b){var c=b.parentNode;while(c!==null){if(c==a)return!0;c=c.parentNode}},q=function(a,c){return a.__uid=c&&c+"::"+b++||a.__uid||b++},r=function(a){var b=q(a);return c[b]=c[b]||{}},s=n?function(a,b,c,d){a[d?h:j](b,c,!1)}:function(a,b,c,d,e){e&&d&&a["_on"+e]===null&&(a["_on"+e]=0),a[d?i:k]("on"+b,c)},t=function(b,c,d){return function(e){return e=D(e||((this.ownerDocument||this.document||this).parentWindow||a).event),c.apply(b,[e].concat(d))}},u=function(b,c,d,e,f){return function(g){if(e?e.apply(this,arguments):n?!0:g&&g.propertyName=="_on"+d||!g)g=g?D(g||((this.ownerDocument||this.document||this).parentWindow||a).event):null,c.apply(b,Array.prototype.slice.call(arguments,g?0:1).concat(f))}},v=function(a,b,c,e){var h=b.replace(g,""),i=r(a),j=i[h]||(i[h]={}),k=c,l=q(c,b.replace(f,""));if(j[l])return a;var m=G[h];m&&(c=m.condition?u(a,c,h,m.condition):c,h=m.base||h);var p=E[h];c=p?t(a,c,e):u(a,c,h,!1,e),p=n||p;if(h=="unload"){var v=c;c=function(){w(a,h,c)&&v()}}return a[o]&&s(a,p?h:"propertychange",c,!0,!p&&h),j[l]=c,c.__uid=l,c.__originalFn=k,h=="unload"?a:d[q(a)]=a},w=function(a,b,c){function l(b){c=j[k][b];if(!c)return;delete j[k][b];if(a[o]){k=G[k]?G[k].base:k;var d=n||E[k];s(a,d?k:"propertychange",c,!1,!d&&k)}}var d,e,h,i,j=r(a),k=b.replace(g,"");if(!j||!j[k])return a;e=b.replace(f,""),h=e?e.split("."):[c.__uid],l(e);for(i=h.length;i--;l(h[i]));return a},x=function(a,b,c){return function(d){var e=typeof a=="string"?c(a,this):a;for(var f=d.target;f&&f!=this;f=f.parentNode)for(var g=e.length;g--;)if(e[g]==f)return b.apply(f,arguments)}},y=function(a,b,c,d,e){if(typeof b=="object"&&!c)for(var f in b)b.hasOwnProperty(f)&&y(a,f,b[f]);else{var g=typeof c=="string",h=(g?c:b).split(" ");c=g?x(b,d,e):c;for(var i=h.length;i--;)v(a,h[i],c,Array.prototype.slice.call(arguments,g?4:3))}return a},z=function(a,b,c){var d,e,h,i,j,k=typeof b=="string",l=k&&b.replace(f,""),m=w,n=r(a);l=l&&l.split(".");if(k&&/\s/.test(b)){b=b.split(" "),j=b.length-1;while(z(a,b[j])&&j--);return a}i=k?b.replace(g,""):b;if(!n||l||k&&!n[i]){for(d in n)if(n.hasOwnProperty(d))for(j in n[d])for(e=l.length;e--;)n[d].hasOwnProperty(j)&&(new RegExp("^"+l[e]+"::\\d*(\\..*)?$")).test(j)&&m(a,[d,j].join("."));return a}if(typeof c=="function")m(a,i,c);else if(l)m(a,b);else{m=i?m:z,h=k&&i,i=i?c||n[i]||i:n;for(d in i)i.hasOwnProperty(d)&&(m(a,h||d,i[d]),delete i[d])}return a},A=function(a,b,c){var d,e,h,i,j=b.split(" ");for(h=j.length;h--;){b=j[h].replace(g,"");var k=E[b],l=j[h].replace(f,""),m=r(a)[b];if(l){l=l.split(".");for(e=l.length;e--;)for(i in m)m.hasOwnProperty(i)&&(new RegExp("^"+l[e]+"::\\d*(\\..*)?$")).test(i)&&m[i].apply(a,[!1].concat(c))}else if(!c&&a[o])B(k,b,a);else for(e in m)m.hasOwnProperty(e)&&m[e].apply(a,[!1].concat(c))}return a},B=n?function(b,c,d){evt=document.createEvent(b?"HTMLEvents":"UIEvents"),evt[b?"initEvent":"initUIEvent"](c,!0,!0,a,1),d.dispatchEvent(evt)}:function(a,b,c){a?c.fireEvent("on"+b,document.createEventObject()):c["_on"+b]++},C=function(a,b,c){var d=r(b),e,f,g=q(a);e=c?d[c]:d;for(f in e)e.hasOwnProperty(f)&&(c?y:C)(a,c||b,c?e[f].__originalFn:f);return a},D=function(a){var b={};if(!a)return b;var c=a.type,d=a.target||a.srcElement;b.preventDefault=D.preventDefault(a),b.stopPropagation=D.stopPropagation(a),b.target=d&&d.nodeType==3?d.parentNode:d;if(~c.indexOf("key"))b.keyCode=a.which||a.keyCode;else if(/click|mouse|menu/i.test(c)){b.rightClick=a.which==3||a.button==2,b.pos={x:0,y:0};if(a.pageX||a.pageY)b.clientX=a.pageX,b.clientY=a.pageY;else if(a.clientX||a.clientY)b.clientX=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,b.clientY=a.clientY+document.body.scrollTop+document.documentElement.scrollTop;e.test(c)&&(b.relatedTarget=a.relatedTarget||a[(c=="mouseover"?"from":"to")+"Element"])}for(var f in a)f in b||(b[f]=a[f]);return b};D.preventDefault=function(a){return function(){a.preventDefault?a.preventDefault():a.returnValue=!1}},D.stopPropagation=function(a){return function(){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}};var E={click:1,dblclick:1,mouseup:1,mousedown:1,contextmenu:1,mousewheel:1,DOMMouseScroll:1,mouseover:1,mouseout:1,mousemove:1,selectstart:1,selectend:1,keydown:1,keypress:1,keyup:1,orientationchange:1,touchstart:1,touchmove:1,touchend:1,touchcancel:1,gesturestart:1,gesturechange:1,gestureend:1,focus:1,blur:1,change:1,reset:1,select:1,submit:1,load:1,unload:1,beforeunload:1,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1},G={mouseenter:{base:"mouseover",condition:F},mouseleave:{base:"mouseout",condition:F},mousewheel:{base:/Firefox/.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel"}},H={add:y,remove:z,clone:C,fire:A},I=function(a){var b=z(a).__uid;b&&(delete d[b],delete c[b])};return a[i]&&y(a,"unload",function(){for(var b in d)d.hasOwnProperty(b)&&I(d[b]);a.CollectGarbage&&CollectGarbage()}),H.noConflict=function(){return context.bean=old,this},H}),provide("bean",a.exports),!function(a){var b=require("bean"),c=function(c,d,e){var f=d?[d]:[];return function(){for(var e,g=0,h=this.length;g<h;g++)e=[this[g]].concat(f,Array.prototype.slice.call(arguments,0)),e.length==4&&e.push(a),!arguments.length&&c=="add"&&d&&(c="fire"),b[c].apply(this,e);return this}},d=c("add"),e=c("remove"),f=c("fire"),g={on:d,addListener:d,bind:d,listen:d,delegate:d,unbind:e,unlisten:e,removeListener:e,undelegate:e,emit:f,trigger:f,cloneEvents:c("clone"),hover:function(a,c,d){for(d=this.length;d--;)b.add.call(this,this[d],"mouseenter",a),b.add.call(this,this[d],"mouseleave",c);return this}},h,i=["blur","change","click","dblclick","error","focus","focusin","focusout","keydown","keypress","keyup","load","mousedown","mouseenter","mouseleave","mouseout","mouseover","mouseup","mousemove","resize","scroll","select","submit","unload"];for(h=i.length;h--;)g[i[h]]=c("add",i[h]);a.ender(g,!0)}(ender)}(),!function(){var a={exports:{}},b=a.exports; /*! * Bonzo: DOM Utility (c) Dustin Diaz 2011 * https://github.com/ded/bonzo * License MIT */ -!function(b,c){typeof define=="function"?define(c):typeof a!="undefined"?a.exports=c():this[b]=c()}("bonzo",function(){function N(a,b){return new I(a,b)}function M(){return{x:b.pageXOffset||d.scrollLeft,y:b.pageYOffset||d.scrollTop}}function L(a){return a===b||/^(?:body|html)$/i.test(a.tagName)}function K(a,c,d){var e=this[0];if(a==null&&c==null)return(L(e)?M():{x:e.scrollLeft,y:e.scrollTop})[d];L(e)?b.scrollTo(a,c):(a!=null&&(e.scrollLeft=a),c!=null&&(e.scrollTop=c));return this}function J(a){return typeof a=="string"?N.create(a):A(a)?[a]:a}function I(a){this.length=0;if(a){a=typeof a!="string"&&!a.nodeType&&typeof a.length!="undefined"?a:[a],this.length=a.length;for(var b=0;b<a.length;b++)this[b]=a[b]}}function H(a,b){a.className=w(a.className.replace(x(b)," "))}function G(a,b){a.className=w(a.className+" "+b)}function F(a,b){return x(b).test(a.className)}function E(a,b,c){var d=N(a),e=d.css("position"),f=d.offset(),g="relative",h=e==g,i=[parseInt(d.css("left"),10),parseInt(d.css("top"),10)];e=="static"&&(d.css("position",g),e=g),isNaN(i[0])&&(i[0]=h?0:a.offsetLeft),isNaN(i[1])&&(i[1]=h?0:a.offsetTop),b!=null&&(a.style.left=b-f.left+i[0]+q),c!=null&&(a.style.top=c-f.top+i[1]+q)}function D(a,b,c){var d=0,g=b||this,h=[],i=f&&typeof a=="string"&&a.charAt(0)!="<"?function(b){return(b=f(a))&&(b.selected=1)&&b}():a;y(J(i),function(a){y(g,function(b){var f=!b[e]||b[e]&&!b[e][e]?function(){var a=b.cloneNode(!0);g.$&&g.cloneEvents&&g.$(a).cloneEvents(b);return a}():b;c(a,f),h[d]=f,d++})},this),y(h,function(a,b){g[b]=a}),g.length=d;return g}function B(a,b,c,d){for(d=0,j=a.length;d<j;++d)if(b.call(c,a[d],d,a))return!0;return!1}function A(a){return a&&a.nodeName&&a.nodeType==1}function z(a){return a.replace(/-(.)/g,function(a,b){return b.toUpperCase()})}function y(a,b,c){for(var d=0,e=a.length;d<e;d++)b.call(c||a[d],a[d],d,a);return a}function x(a){return new RegExp("(^|\\s+)"+a+"(\\s+|$)")}var a=this,b=window,c=b.document,d=c.documentElement,e="parentNode",f=null,g=/^checked|value|selected$/,h=/select|fieldset|table|tbody|tfoot|td|tr|colgroup/i,i="table",k={thead:i,tbody:i,tfoot:i,tr:"tbody",th:"tr",td:"tr",fieldset:"form",option:"select"},l=/^checked|selected$/,m=/msie/i.test(navigator.userAgent),n=[],o=0,p=/^-?[\d\.]+$/,q="px",r="setAttribute",s="getAttribute",t=/(^\s*|\s*$)/g,u={lineHeight:1,zoom:1,zIndex:1,opacity:1},v=function(){var a=["webkitTransform","MozTransform","OTransform","msTransform","Transform"],b;for(b=0;b<a.length;b++)if(a[b]in c.createElement("a").style)return a[b]}(),w=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(t,"")},C=c.defaultView&&c.defaultView.getComputedStyle?function(a,b){b=b=="transform"?v:b,b=b=="transform-origin"?v+"Origin":b;var d=null;b=="float"&&(b="cssFloat");var e=c.defaultView.getComputedStyle(a,"");e&&(d=e[z(b)]);return a.style[b]||d}:m&&d.currentStyle?function(a,b){b=z(b),b=b=="float"?"styleFloat":b;if(b=="opacity"){var c=100;try{c=a.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(d){try{c=a.filters("alpha").opacity}catch(e){}}return c/100}var f=a.currentStyle?a.currentStyle[b]:null;return a.style[b]||f}:function(a,b){return a.style[z(b)]};I.prototype={get:function(a){return this[a]},each:function(a,b){return y(this,a,b)},map:function(a,b){var c=[],d,e;for(e=0;e<this.length;e++)d=a.call(this,this[e],e),b?b(d)&&c.push(d):c.push(d);return c},first:function(){return N(this[0])},last:function(){return N(this[this.length-1])},html:function(a,b){function f(b){while(b.firstChild)b.removeChild(b.firstChild);y(J(a),function(a){b.appendChild(a)})}var c=b?d.textContent===null?"innerText":"textContent":"innerHTML",e;return typeof a!="undefined"?this.each(function(b){(e=b.tagName.match(h))?f(b,e[0]):b[c]=a}):this[0]?this[0][c]:""},text:function(a){return this.html(a,1)},addClass:function(a){return this.each(function(b){F(b,a)||G(b,a)})},removeClass:function(a){return this.each(function(b){F(b,a)&&H(b,a)})},hasClass:function(a){return B(this,function(b){return F(b,a)})},toggleClass:function(a,b){return this.each(function(c){typeof b!="undefined"?b?G(c,a):H(c,a):F(c,a)?H(c,a):G(c,a)})},show:function(a){return this.each(function(b){b.style.display=a||""})},hide:function(a){return this.each(function(a){a.style.display="none"})},append:function(a){return this.each(function(b){y(J(a),function(a){b.appendChild(a)})})},prepend:function(a){return this.each(function(b){var c=b.firstChild;y(J(a),function(a){b.insertBefore(a,c)})})},appendTo:function(a,b){return D.call(this,a,b,function(a,b){a.appendChild(b)})},prependTo:function(a,b){return D.call(this,a,b,function(a,b){a.insertBefore(b,a.firstChild)})},next:function(){return this.related("nextSibling")},previous:function(){return this.related("previousSibling")},related:function(a){return this.map(function(b){b=b[a];while(b&&b.nodeType!==1)b=b[a];return b||0},function(a){return a})},before:function(a){return this.each(function(b){y(N.create(a),function(a){b[e].insertBefore(a,b)})})},after:function(a){return this.each(function(b){y(N.create(a),function(a){b[e].insertBefore(a,b.nextSibling)})})},insertBefore:function(a,b){return D.call(this,a,b,function(a,b){a[e].insertBefore(b,a)})},insertAfter:function(a,b){return D.call(this,a,b,function(a,b){var c=a.nextSibling;c?a[e].insertBefore(b,c):a[e].appendChild(b)})},css:function(a,d,e){function g(a,b,c){for(var d in f)f.hasOwnProperty(d)&&(c=f[d],(b=z(d))&&p.test(c)&&!(b in u)&&(c+=q),b=b=="transform"?v:b,b=b=="transformOrigin"?v+"Origin":b,a.style[b]=c)}if(d===undefined&&typeof a=="string"){d=this[0];if(!d)return null;if(d==c||d==b){e=d==c?N.doc():N.viewport();return a=="width"?e.width:a=="height"?e.height:""}return C(d,a)}var f=a;typeof a=="string"&&(f={},f[a]=d),m&&f.opacity&&(f.filter="alpha(opacity="+f.opacity*100+")",f.zoom=a.zoom||1,delete f.opacity);if(d=f["float"])m?f.styleFloat=d:f.cssFloat=d,delete f["float"];return this.each(g)},offset:function(a,b){if(typeof a=="number"||typeof b=="number")return this.each(function(c){E(c,a,b)});var c=this[0],d=c.offsetWidth,e=c.offsetHeight,f=c.offsetTop,g=c.offsetLeft;while(c=c.offsetParent)f=f+c.offsetTop,g=g+c.offsetLeft;return{top:f,left:g,height:e,width:d}},attr:function(a,b){var c=this[0];if(typeof a=="string"||a instanceof String)return typeof b=="undefined"?g.test(a)?l.test(a)&&typeof c[a]=="string"?!0:c[a]:c[s](a):this.each(function(c){g.test(a)?c[a]=b:c[r](a,b)});for(var d in a)a.hasOwnProperty(d)&&this.attr(d,a[d]);return this},val:function(a){return typeof a=="string"?this.attr("value",a):this[0].value},removeAttr:function(a){return this.each(function(b){l.test(a)?b[a]=!1:b.removeAttribute(a)})},data:function(a,b){var c=this[0];if(typeof b=="undefined"){c[s]("data-node-uid")||c[r]("data-node-uid",++o);var d=c[s]("data-node-uid");n[d]||(n[d]={});return n[d][a]}return this.each(function(c){c[s]("data-node-uid")||c[r]("data-node-uid",++o);var d=c[s]("data-node-uid"),e=n[d]||(n[d]={});e[a]=b})},remove:function(){return this.each(function(a){a[e]&&a[e].removeChild(a)})},empty:function(){return this.each(function(a){while(a.firstChild)a.removeChild(a.firstChild)})},detach:function(){return this.map(function(a){return a[e].removeChild(a)})},scrollTop:function(a){return K.call(this,null,a,"y")},scrollLeft:function(a){return K.call(this,a,null,"x")},toggle:function(a){this.each(function(a){a.style.display=a.offsetWidth||a.offsetHeight?"none":"block"}),a&&a();return this}},N.setQueryEngine=function(a){f=a,delete N.setQueryEngine},N.aug=function(a,b){for(var c in a)a.hasOwnProperty(c)&&((b||I.prototype)[c]=a[c])},N.create=function(a){return typeof a=="string"?function(){var b=/^<([^\s>]+)/.exec(a),d=c.createElement(b&&k[b[1].toLowerCase()]||"div"),e=[];d.innerHTML=a;var f=d.childNodes;d=d.firstChild,e.push(d);while(d=d.nextSibling)d.nodeType==1&&e.push(d);return e}():A(a)?[a.cloneNode(!0)]:[]},N.doc=function(){var a=this.viewport();return{width:Math.max(c.body.scrollWidth,d.scrollWidth,a.width),height:Math.max(c.body.scrollHeight,d.scrollHeight,a.height)}},N.firstChild=function(a){for(var b=a.childNodes,c=0,d=b&&b.length||0,e;c<d;c++)b[c].nodeType===1&&(e=b[d=c]);return e},N.viewport=function(){return{width:m?d.clientWidth:self.innerWidth,height:m?d.clientHeight:self.innerHeight}},N.isAncestor="compareDocumentPosition"in d?function(a,b){return(a.compareDocumentPosition(b)&16)==16}:"contains"in d?function(a,b){return a!==b&&a.contains(b)}:function(a,b){while(b=b[e])if(b===a)return!0;return!1};var O=a.bonzo;N.noConflict=function(){a.bonzo=O;return this};return N}),provide("bonzo",a.exports),!function(a){function e(a,b,c){return a?b.css(c,a):function(a){a=parseInt(b.css(c),10);return isNaN(a)?b[0]["offset"+c.replace(/^\w/,function(a){return a.toUpperCase()})]:a}()}function d(a){var b=[],c,d;label:for(c=0;c<a.length;c++){for(d=0;d<b.length;d++)if(b[d]==a[c])continue label;b[b.length]=a[c]}return b}function c(a,b){for(var c=0;c<a.length;c++)if(a[c]===b)return c;return-1}var b=require("bonzo");b.setQueryEngine(a),a.ender(b),a.ender(b(),!0),a.ender({create:function(c){return a(b.create(c))}}),a.id=function(b){return a([document.getElementById(b)])},a.ender({parents:function(b,e){var f=a(b),g,h,i,j=[];for(g=0,h=this.length;g<h;g++){i=this[g];while(i=i.parentNode)if(c(f,i)!==-1){j.push(i);if(e)break}}return a(d(j))},closest:function(a){return this.parents(a,!0)},first:function(){return a(this[0])},last:function(){return a(this[this.length-1])},next:function(){return a(b(this).next())},previous:function(){return a(b(this).previous())},appendTo:function(a){return b(this.selector).appendTo(a,this)},prependTo:function(a){return b(this.selector).prependTo(a,this)},insertAfter:function(a){return b(this.selector).insertAfter(a,this)},insertBefore:function(a){return b(this.selector).insertBefore(a,this)},siblings:function(){var b,c,d,e=[];for(b=0,c=this.length;b<c;b++){d=this[b];while(d=d.previousSibling)d.nodeType==1&&e.push(d);d=this[b];while(d=d.nextSibling)d.nodeType==1&&e.push(d)}return a(e)},children:function(){var c,e,f=[];for(c=0,l=this.length;c<l;c++){if(!(e=b.firstChild(this[c])))continue;f.push(e);while(e=e.nextSibling)e.nodeType==1&&f.push(e)}return a(d(f))},height:function(a){return e(a,this,"height")},width:function(a){return e(a,this,"width")}},!0)}(ender)}(),!function(){var a={exports:{}},b=a.exports;!function(b,c){typeof define=="function"?define(c):typeof a!="undefined"?a.exports=c():this[b]=this.domReady=c()}("domready",function(a){function l(a){k=1;while(a=b.shift())a()}var b=[],c,d=!1,e=document,f=e.documentElement,g=f.doScroll,h="DOMContentLoaded",i="addEventListener",j="onreadystatechange",k=/^loade|c/.test(e.readyState);e[i]&&e[i](h,c=function(){e.removeEventListener(h,c,d),l()},d),g&&e.attachEvent(j,c=function(){/^c/.test(e.readyState)&&(e.detachEvent(j,c),l())});return a=g?function(c){self!=top?k?c():b.push(c):function(){try{f.doScroll("left")}catch(b){return setTimeout(function(){a(c)},50)}c()}()}:function(a){k?a():b.push(a)}}),provide("domready",a.exports),!function(a){var b=require("domready");a.ender({domReady:b}),a.ender({ready:function(a){b(a);return this}},!0)}(ender)}(),!function(){var a={exports:{}},b=a.exports; +!function(b,c){typeof define=="function"?define(c):typeof a!="undefined"?a.exports=c():this[b]=c()}("bonzo",function(){function x(a){return new RegExp("(^|\\s+)"+a+"(\\s+|$)")}function y(a,b,c){for(var d=0,e=a.length;d<e;d++)b.call(c||a[d],a[d],d,a);return a}function z(a){return a.replace(/-(.)/g,function(a,b){return b.toUpperCase()})}function A(a){return a&&a.nodeName&&a.nodeType==1}function B(a,b,c,d){for(d=0,j=a.length;d<j;++d)if(b.call(c,a[d],d,a))return!0;return!1}function D(a,b,c){var d=0,g=b||this,h=[],i=f&&typeof a=="string"&&a.charAt(0)!="<"?f(a):a;return y(J(i),function(a){y(g,function(b){var f=!b[e]||b[e]&&!b[e][e]?function(){var a=b.cloneNode(!0);return g.$&&g.cloneEvents&&g.$(a).cloneEvents(b),a}():b;c(a,f),h[d]=f,d++})},this),y(h,function(a,b){g[b]=a}),g.length=d,g}function E(a,b,c){var d=N(a),e=d.css("position"),f=d.offset(),g="relative",h=e==g,i=[parseInt(d.css("left"),10),parseInt(d.css("top"),10)];e=="static"&&(d.css("position",g),e=g),isNaN(i[0])&&(i[0]=h?0:a.offsetLeft),isNaN(i[1])&&(i[1]=h?0:a.offsetTop),b!=null&&(a.style.left=b-f.left+i[0]+q),c!=null&&(a.style.top=c-f.top+i[1]+q)}function F(a,b){return x(b).test(a.className)}function G(a,b){a.className=w(a.className+" "+b)}function H(a,b){a.className=w(a.className.replace(x(b)," "))}function I(a){this.length=0;if(a){a=typeof a!="string"&&!a.nodeType&&typeof a.length!="undefined"?a:[a],this.length=a.length;for(var b=0;b<a.length;b++)this[b]=a[b]}}function J(a){return typeof a=="string"?N.create(a):A(a)?[a]:a}function K(a,c,d){var e=this[0];return a==null&&c==null?(L(e)?M():{x:e.scrollLeft,y:e.scrollTop})[d]:(L(e)?b.scrollTo(a,c):(a!=null&&(e.scrollLeft=a),c!=null&&(e.scrollTop=c)),this)}function L(a){return a===b||/^(?:body|html)$/i.test(a.tagName)}function M(){return{x:b.pageXOffset||d.scrollLeft,y:b.pageYOffset||d.scrollTop}}function N(a,b){return new I(a,b)}var a=this,b=window,c=b.document,d=c.documentElement,e="parentNode",f=null,g=/^checked|value|selected$/,h=/select|fieldset|table|tbody|tfoot|td|tr|colgroup/i,i="table",k={thead:i,tbody:i,tfoot:i,tr:"tbody",th:"tr",td:"tr",fieldset:"form",option:"select"},l=/^checked|selected$/,m=/msie/i.test(navigator.userAgent),n=[],o=0,p=/^-?[\d\.]+$/,q="px",r="setAttribute",s="getAttribute",t=/(^\s*|\s*$)/g,u={lineHeight:1,zoom:1,zIndex:1,opacity:1},v=function(){var a=["webkitTransform","MozTransform","OTransform","msTransform","Transform"],b;for(b=0;b<a.length;b++)if(a[b]in c.createElement("a").style)return a[b]}(),w=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(t,"")},C=c.defaultView&&c.defaultView.getComputedStyle?function(a,b){b=b=="transform"?v:b,b=b=="transform-origin"?v+"Origin":b;var d=null;b=="float"&&(b="cssFloat");var e=c.defaultView.getComputedStyle(a,"");return e&&(d=e[z(b)]),a.style[b]||d}:m&&d.currentStyle?function(a,b){b=z(b),b=b=="float"?"styleFloat":b;if(b=="opacity"){var c=100;try{c=a.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(d){try{c=a.filters("alpha").opacity}catch(e){}}return c/100}var f=a.currentStyle?a.currentStyle[b]:null;return a.style[b]||f}:function(a,b){return a.style[z(b)]};I.prototype={get:function(a){return this[a]},each:function(a,b){return y(this,a,b)},map:function(a,b){var c=[],d,e;for(e=0;e<this.length;e++)d=a.call(this,this[e],e),b?b(d)&&c.push(d):c.push(d);return c},first:function(){return N(this[0])},last:function(){return N(this[this.length-1])},html:function(a,b){function f(b){while(b.firstChild)b.removeChild(b.firstChild);y(J(a),function(a){b.appendChild(a)})}var c=b?d.textContent===null?"innerText":"textContent":"innerHTML",e;return typeof a!="undefined"?this.each(function(b){(e=b.tagName.match(h))?f(b,e[0]):b[c]=a}):this[0]?this[0][c]:""},text:function(a){return this.html(a,1)},addClass:function(a){return this.each(function(b){F(b,a)||G(b,a)})},removeClass:function(a){return this.each(function(b){F(b,a)&&H(b,a)})},hasClass:function(a){return B(this,function(b){return F(b,a)})},toggleClass:function(a,b){return this.each(function(c){typeof b!="undefined"?b?G(c,a):H(c,a):F(c,a)?H(c,a):G(c,a)})},show:function(a){return this.each(function(b){b.style.display=a||""})},hide:function(a){return this.each(function(a){a.style.display="none"})},append:function(a){return this.each(function(b){y(J(a),function(a){b.appendChild(a)})})},prepend:function(a){return this.each(function(b){var c=b.firstChild;y(J(a),function(a){b.insertBefore(a,c)})})},appendTo:function(a,b){return D.call(this,a,b,function(a,b){a.appendChild(b)})},prependTo:function(a,b){return D.call(this,a,b,function(a,b){a.insertBefore(b,a.firstChild)})},next:function(){return this.related("nextSibling")},previous:function(){return this.related("previousSibling")},related:function(a){return this.map(function(b){b=b[a];while(b&&b.nodeType!==1)b=b[a];return b||0},function(a){return a})},before:function(a){return this.each(function(b){y(N.create(a),function(a){b[e].insertBefore(a,b)})})},after:function(a){return this.each(function(b){y(N.create(a),function(a){b[e].insertBefore(a,b.nextSibling)})})},insertBefore:function(a,b){return D.call(this,a,b,function(a,b){a[e].insertBefore(b,a)})},insertAfter:function(a,b){return D.call(this,a,b,function(a,b){var c=a.nextSibling;c?a[e].insertBefore(b,c):a[e].appendChild(b)})},replaceWith:function(a){return this.each(function(b){b.parentNode.replaceChild(N.create(a)[0],b)})},css:function(a,d,e){function g(a,b,c){for(var d in f)f.hasOwnProperty(d)&&(c=f[d],(b=z(d))&&p.test(c)&&!(b in u)&&(c+=q),b=b=="transform"?v:b,b=b=="transformOrigin"?v+"Origin":b,a.style[b]=c)}if(d===undefined&&typeof a=="string")return d=this[0],d?d==c||d==b?(e=d==c?N.doc():N.viewport(),a=="width"?e.width:a=="height"?e.height:""):C(d,a):null;var f=a;typeof a=="string"&&(f={},f[a]=d),m&&f.opacity&&(f.filter="alpha(opacity="+f.opacity*100+")",f.zoom=a.zoom||1,delete f.opacity);if(d=f["float"])m?f.styleFloat=d:f.cssFloat=d,delete f["float"];return this.each(g)},offset:function(a,b){if(typeof a=="number"||typeof b=="number")return this.each(function(c){E(c,a,b)});var c=this[0],d=c.offsetWidth,e=c.offsetHeight,f=c.offsetTop,g=c.offsetLeft;while(c=c.offsetParent)f+=c.offsetTop,g+=c.offsetLeft;return{top:f,left:g,height:e,width:d}},attr:function(a,b){var c=this[0];if(typeof a=="string"||a instanceof String)return typeof b=="undefined"?g.test(a)?l.test(a)&&typeof c[a]=="string"?!0:c[a]:c[s](a):this.each(function(c){g.test(a)?c[a]=b:c[r](a,b)});for(var d in a)a.hasOwnProperty(d)&&this.attr(d,a[d]);return this},val:function(a){return typeof a=="string"?this.attr("value",a):this[0].value},removeAttr:function(a){return this.each(function(b){l.test(a)?b[a]=!1:b.removeAttribute(a)})},data:function(a,b){var c=this[0];if(typeof b=="undefined"){c[s]("data-node-uid")||c[r]("data-node-uid",++o);var d=c[s]("data-node-uid");return n[d]||(n[d]={}),n[d][a]}return this.each(function(c){c[s]("data-node-uid")||c[r]("data-node-uid",++o);var d=c[s]("data-node-uid"),e=n[d]||(n[d]={});e[a]=b})},remove:function(){return this.each(function(a){a[e]&&a[e].removeChild(a)})},empty:function(){return this.each(function(a){while(a.firstChild)a.removeChild(a.firstChild)})},detach:function(){return this.map(function(a){return a[e].removeChild(a)})},scrollTop:function(a){return K.call(this,null,a,"y")},scrollLeft:function(a){return K.call(this,a,null,"x")},toggle:function(a){return this.each(function(a){a.style.display=a.offsetWidth||a.offsetHeight?"none":"block"}),a&&a(),this}},N.setQueryEngine=function(a){f=a,delete N.setQueryEngine},N.aug=function(a,b){for(var c in a)a.hasOwnProperty(c)&&((b||I.prototype)[c]=a[c])},N.create=function(a){return typeof a=="string"?function(){var b=/^<([^\s>]+)/.exec(a),d=c.createElement(b&&k[b[1].toLowerCase()]||"div"),e=[];d.innerHTML=a;var f=d.childNodes;d=d.firstChild,e.push(d);while(d=d.nextSibling)d.nodeType==1&&e.push(d);return e}():A(a)?[a.cloneNode(!0)]:[]},N.doc=function(){var a=this.viewport();return{width:Math.max(c.body.scrollWidth,d.scrollWidth,a.width),height:Math.max(c.body.scrollHeight,d.scrollHeight,a.height)}},N.firstChild=function(a){for(var b=a.childNodes,c=0,d=b&&b.length||0,e;c<d;c++)b[c].nodeType===1&&(e=b[d=c]);return e},N.viewport=function(){return{width:m?d.clientWidth:self.innerWidth,height:m?d.clientHeight:self.innerHeight}},N.isAncestor="compareDocumentPosition"in d?function(a,b){return(a.compareDocumentPosition(b)&16)==16}:"contains"in d?function(a,b){return a!==b&&a.contains(b)}:function(a,b){while(b=b[e])if(b===a)return!0;return!1};var O=a.bonzo;return N.noConflict=function(){return a.bonzo=O,this},N}),provide("bonzo",a.exports),!function(a){function c(a,b){for(var c=0;c<a.length;c++)if(a[c]===b)return c;return-1}function d(a){var b=[],c,d;e:for(c=0;c<a.length;c++){for(d=0;d<b.length;d++)if(b[d]==a[c])continue e;b[b.length]=a[c]}return b}function e(a,b,c){return a?b.css(c,a):function(a){return a=parseInt(b.css(c),10),isNaN(a)?b[0]["offset"+c.replace(/^\w/,function(a){return a.toUpperCase()})]:a}()}var b=require("bonzo");b.setQueryEngine(a),a.ender(b),a.ender(b(),!0),a.ender({create:function(c){return a(b.create(c))}}),a.id=function(b){return a([document.getElementById(b)])},a.ender({parents:function(b,e){var f=a(b),g,h,i,j=[];for(g=0,h=this.length;g<h;g++){i=this[g];while(i=i.parentNode)if(~c(f,i)){j.push(i);if(e)break}}return a(d(j))},closest:function(a){return this.parents(a,!0)},first:function(){return a(this[0])},last:function(){return a(this[this.length-1])},next:function(){return a(b(this).next())},previous:function(){return a(b(this).previous())},appendTo:function(a){return b(this.selector).appendTo(a,this)},prependTo:function(a){return b(this.selector).prependTo(a,this)},insertAfter:function(a){return b(this.selector).insertAfter(a,this)},insertBefore:function(a){return b(this.selector).insertBefore(a,this)},siblings:function(){var b,c,d,e=[];for(b=0,c=this.length;b<c;b++){d=this[b];while(d=d.previousSibling)d.nodeType==1&&e.push(d);d=this[b];while(d=d.nextSibling)d.nodeType==1&&e.push(d)}return a(e)},children:function(){var c,e,f=[];for(c=0,l=this.length;c<l;c++){if(!(e=b.firstChild(this[c])))continue;f.push(e);while(e=e.nextSibling)e.nodeType==1&&f.push(e)}return a(d(f))},height:function(a){return e(a,this,"height")},width:function(a){return e(a,this,"width")}},!0)}(ender)}(),!function(){var a={exports:{}},b=a.exports;!function(b,c){typeof define=="function"?define(c):typeof a!="undefined"?a.exports=c():this[b]=this.domReady=c()}("domready",function(a){function l(a){k=1;while(a=b.shift())a()}var b=[],c,d=!1,e=document,f=e.documentElement,g=f.doScroll,h="DOMContentLoaded",i="addEventListener",j="onreadystatechange",k=/^loade|c/.test(e.readyState);return e[i]&&e[i](h,c=function(){e.removeEventListener(h,c,d),l()},d),g&&e.attachEvent(j,c=function(){/^c/.test(e.readyState)&&(e.detachEvent(j,c),l())}),a=g?function(c){self!=top?k?c():b.push(c):function(){try{f.doScroll("left")}catch(b){return setTimeout(function(){a(c)},50)}c()}()}:function(a){k?a():b.push(a)}}),provide("domready",a.exports),!function(a){var b=require("domready");a.ender({domReady:b}),a.ender({ready:function(a){return b(a),this}},!0)}(ender)}(),!function(){var a={exports:{}},b=a.exports; /*! * Qwery - A Blazing Fast query selector engine * https://github.com/ded/qwery * copyright Dustin Diaz & Jacob Thornton 2011 * MIT License */ -!function(b,c){typeof define=="function"?define(c):typeof a!="undefined"?a.exports=c():this[b]=c()}("qwery",function(){function _(a,c){var d=$(c);return!d||!a?[]:a===window||X(a)?!c||a!==window&&X(d)&&ba(a,d)?[a]:[]:a&&Z(a)?Q(a):(h=a.match(w))?(m=b.getElementById(h[1]))?[m]:[]:(h=a.match(y))?Q(d.getElementsByTagName(h[1])):bc(a,d)}function $(a){return a?typeof a=="string"?_(a)[0]:Z(a)?a[0]:a:b}function Z(a){return typeof a=="object"&&isFinite(a.length)}function Y(a){var b=[],c,d;label:for(c=0;c<a.length;c++){for(d=0;d<b.length;d++)if(b[d]==a[c])continue label;b[b.length]=a[c]}return b}function X(a){return a&&a.nodeType&&(a.nodeType==1||a.nodeType==9)}function W(a){var c=[],d=[],e,f=0,g,h,i,j,k,l,m,n,p,q,r,s=P.g(a)||P.s(a,a.split(I)),t=a.match(H),u;s=s.slice(0);if(!s.length)return c;k=s.pop(),n=s.length&&(i=s[s.length-1].match(w))?b.getElementById(i[1]):b;if(!n)return c;p=S(k),m=t&&/^[+~]$/.test(t[t.length-1])?function(a){while(n=n.nextSibling)n.nodeType==1&&(p[1]?p[1]==n.tagName.toLowerCase():1)&&a.push(n);return a}([]):n.getElementsByTagName(p[1]||"*");for(e=0,h=m.length;e<h;e++)if(q=T.apply(m[e],p))c[f++]=q;if(!s.length)return c;for(f=0,h=c.length,g=0;f<h;f++){j=c[f];for(e=s.length;e--;)while(j=K[t[e]](j,c[f]))if(o=T.apply(j,S(s[e])))break;o&&(d[g++]=c[f])}return d}function V(a,b,c){switch(a){case"=":return b==c;case"^=":return b.match(O.g("^="+c)||O.s("^="+c,new RegExp("^"+U(c))));case"$=":return b.match(O.g("$="+c)||O.s("$="+c,new RegExp(U(c)+"$")));case"*=":return b.match(O.g(c)||O.s(c,new RegExp(U(c))));case"~=":return b.match(O.g("~="+c)||O.s("~="+c,new RegExp("(?:^|\\s+)"+U(c)+"(?:\\s+|$)")));case"|=":return b.match(O.g("|="+c)||O.s("|="+c,new RegExp("^"+U(c)+"(-|$)")))}return 0}function U(a){return N.g(a)||N.s(a,a.replace(D,"\\$1"))}function T(a,b,c,e,f,g,h,j,k,l,m){var n,o,q;if(b&&this.tagName.toLowerCase()!==b)return!1;if(c&&(n=c.match(u))&&n[1]!==this.id)return!1;if(c&&(p=c.match(v)))for(d=p.length;d--;){o=p[d].slice(1);if(!(M.g(o)||M.s(o,new RegExp("(^|\\s+)"+o+"(\\s+|$)"))).test(this.className))return!1}if(k&&_.pseudos[k]&&!_.pseudos[k](this,m))return!1;if(e&&!h){i=this.attributes;for(q in i)if(Object.prototype.hasOwnProperty.call(i,q)&&(i[q].name||q)==f)return this}return e&&!V(g,this.getAttribute(f)||"",h)?!1:this}function S(a){return a.match(J)}function R(a){while(a=a.previousSibling)if(a.nodeType==1)break;return a}function Q(a){k=[];for(d=0,g=a.length;d<g;d++)Z(a[d])?k=k.concat(a[d]):k.push(a[d]);return k}function L(){this.c={}}var a=this,b=document,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t=b.documentElement,u=/#([\w\-]+)/,v=/\.[\w\-]+/g,w=/^#([\w\-]+$)/,x=/^\.([\w\-]+)$/,y=/^([\w\-]+)$/,z=/^([\w]+)?\.([\w\-]+)$/,A=/\s*([\s\+\~>])\s*/g,B=/[\s\>\+\~]/,C=/(?![\s\w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^'"]*\]|[\s\w\+\-]*\))/,D=/([.*+?\^=!:${}()|\[\]\/\\])/g,E=/^([a-z0-9]+)?(?:([\.\#]+[\w\-\.#]+)?)/,F=/\[([\w\-]+)(?:([\|\^\$\*\~]?\=)['"]?([ \w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^]+)["']?)?\]/,G=/:([\w\-]+)(\(['"]?([\s\w\+\-]+)['"]?\))?/,H=new RegExp("("+B.source+")"+C.source,"g"),I=new RegExp(B.source+C.source),J=new RegExp(E.source+"("+F.source+")?"+"("+G.source+")?"),K={" ":function(a){return a&&a!==t&&a.parentNode},">":function(a,b){return a&&a.parentNode==b.parentNode&&a.parentNode},"~":function(a){return a&&a.previousSibling},"+":function(a,b,c,d){if(!a)return!1;c=R(a),d=R(b);return c&&d&&c==d&&c}};L.prototype={g:function(a){return this.c[a]||undefined},s:function(a,b){this.c[a]=b;return b}};var M=new L,N=new L,O=new L,P=new L,ba="compareDocumentPosition"in t?function(a,b){return(b.compareDocumentPosition(a)&16)==16}:"contains"in t?function(a,c){c=c==b||c==window?t:c;return c!==a&&c.contains(a)}:function(a,b){while(a=a.parentNode)if(a===b)return 1;return 0},bb=function(){if(!b.querySelector||!b.querySelectorAll)return!1;try{return b.querySelectorAll(":nth-of-type(1)").length>0}catch(a){return!1}}(),bc=bb?function(a,c){return b.getElementsByClassName&&(h=a.match(x))?Q(c.getElementsByClassName(h[1])):Q(c.querySelectorAll(a))}:function(a,c){a=a.replace(A,"$1");var d=[],f,i,j=[],l;if(h=a.match(z)){r=c.getElementsByTagName(h[1]||"*"),k=M.g(h[2])||M.s(h[2],new RegExp("(^|\\s+)"+h[2]+"(\\s+|$)"));for(l=0,g=r.length,e=0;l<g;l++)k.test(r[l].className)&&(d[e++]=r[l]);return d}for(l=0,r=a.split(","),g=r.length;l<g;l++)j[l]=W(r[l]);for(l=0,g=j.length;l<g&&(i=j[l]);l++){var m=i;if(c!==b){m=[];for(e=0,h=i.length;e<h&&(f=i[e]);e++)ba(f,c)&&m.push(f)}d=d.concat(m)}return Y(d)};_.uniq=Y,_.pseudos={};var bd=a.qwery;_.noConflict=function(){a.qwery=bd;return this};return _}),provide("qwery",a.exports),!function(a,b){function f(b,c){var d=/^<([^\s>]+)/.exec(b)[1],f=(c||a).createElement(e[d]||"div"),g=[];f.innerHTML=b;var h=f.childNodes;f=f.firstChild,g.push(f);while(f=f.nextSibling)f.nodeType==1&&g.push(f);return g}var c=require("qwery"),d="table",e={thead:d,tbody:d,tfoot:d,tr:"tbody",th:"tr",td:"tr",fieldset:"form",option:"select"};b._select=function(a,b){return/^\s*</.test(a)?f(a,b):c(a,b)},b.pseudos=c.pseudos,b.ender({find:function(a){var d=[],e,f,g,h,i;for(e=0,f=this.length;e<f;e++){i=c(a,this[e]);for(g=0,h=i.length;g<h;g++)d.push(i[g])}return b(c.uniq(d))},and:function(a){var c=b(a);for(var d=this.length,e=0,f=this.length+c.length;d<f;d++,e++)this[d]=c[e];return this}},!0)}(document,ender)}() +!function(b,c){typeof define=="function"?define(c):typeof a!="undefined"?a.exports=c():this[b]=c()}("qwery",function(){function M(){this.c={}}function R(a){l=[];for(e=0,h=a.length;e<h;e++)$(a[e])?l=l.concat(a[e]):l.push(a[e]);return l}function S(a){while(a=a.previousSibling)if(a.nodeType==1)break;return a}function T(a){return a.match(K)}function U(a,b,c,d,f,g,h,i,k,l,m){var n,o,p;if(b&&this.tagName.toLowerCase()!==b)return!1;if(c&&(n=c.match(v))&&n[1]!==this.id)return!1;if(c&&(q=c.match(w)))for(e=q.length;e--;){o=q[e].slice(1);if(!(N.g(o)||N.s(o,new RegExp("(^|\\s+)"+o+"(\\s+|$)"))).test(this.className))return!1}if(k&&ba.pseudos[k]&&!ba.pseudos[k](this,m))return!1;if(d&&!h){j=this.attributes;for(p in j)if(Object.prototype.hasOwnProperty.call(j,p)&&(j[p].name||p)==f)return this}return d&&!W(g,this.getAttribute(f)||"",h)?!1:this}function V(a){return O.g(a)||O.s(a,a.replace(E,"\\$1"))}function W(a,b,c){switch(a){case"=":return b==c;case"^=":return b.match(P.g("^="+c)||P.s("^="+c,new RegExp("^"+V(c))));case"$=":return b.match(P.g("$="+c)||P.s("$="+c,new RegExp(V(c)+"$")));case"*=":return b.match(P.g(c)||P.s(c,new RegExp(V(c))));case"~=":return b.match(P.g("~="+c)||P.s("~="+c,new RegExp("(?:^|\\s+)"+V(c)+"(?:\\s+|$)")));case"|=":return b.match(P.g("|="+c)||P.s("|="+c,new RegExp("^"+V(c)+"(-|$)")))}return 0}function X(a){var c=[],d=[],e,f=0,g,h,i,j,k,l,m,n,o,q,r,s=Q.g(a)||Q.s(a,a.split(J)),t=a.match(I),u;s=s.slice(0);if(!s.length)return c;k=s.pop(),n=s.length&&(i=s[s.length-1].match(x))?b.getElementById(i[1]):b;if(!n)return c;o=T(k),m=t&&/^[+~]$/.test(t[t.length-1])?function(a){while(n=n.nextSibling)n.nodeType==1&&(o[1]?o[1]==n.tagName.toLowerCase():1)&&a.push(n);return a}([]):n.getElementsByTagName(o[1]||"*");for(e=0,h=m.length;e<h;e++)if(q=U.apply(m[e],o))c[f++]=q;if(!s.length)return c;for(f=0,h=c.length,g=0;f<h;f++){j=c[f];for(e=s.length;e--;)while(j=L[t[e]](j,c[f]))if(p=U.apply(j,T(s[e])))break;p&&(d[g++]=c[f])}return d}function Y(a){return a&&a.nodeType&&(a.nodeType==1||a.nodeType==9)}function Z(a){var b=[],c,d;e:for(c=0;c<a.length;c++){for(d=0;d<b.length;d++)if(b[d]==a[c])continue e;b[b.length]=a[c]}return b}function $(a){return typeof a=="object"&&isFinite(a.length)}function _(a){return a?typeof a=="string"?ba(a)[0]:$(a)?a[0]:a:b}function ba(a,c){var d=_(c);return!d||!a?[]:a===window||Y(a)?!c||a!==window&&Y(d)&&bb(a,d)?[a]:[]:a&&$(a)?R(a):(i=a.match(x))?(n=b.getElementById(i[1]))?[n]:[]:(i=a.match(z))?R(d.getElementsByTagName(i[1])):bd(a,d)}var a=this,b=document,c=a.qwery,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u=b.documentElement,v=/#([\w\-]+)/,w=/\.[\w\-]+/g,x=/^#([\w\-]+$)/,y=/^\.([\w\-]+)$/,z=/^([\w\-]+)$/,A=/^([\w]+)?\.([\w\-]+)$/,B=/\s*([\s\+\~>])\s*/g,C=/[\s\>\+\~]/,D=/(?![\s\w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^'"]*\]|[\s\w\+\-]*\))/,E=/([.*+?\^=!:${}()|\[\]\/\\])/g,F=/^([a-z0-9]+)?(?:([\.\#]+[\w\-\.#]+)?)/,G=/\[([\w\-]+)(?:([\|\^\$\*\~]?\=)['"]?([ \w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^]+)["']?)?\]/,H=/:([\w\-]+)(\(['"]?([\s\w\+\-]+)['"]?\))?/,I=new RegExp("("+C.source+")"+D.source,"g"),J=new RegExp(C.source+D.source),K=new RegExp(F.source+"("+G.source+")?"+"("+H.source+")?"),L={" ":function(a){return a&&a!==u&&a.parentNode},">":function(a,b){return a&&a.parentNode==b.parentNode&&a.parentNode},"~":function(a){return a&&a.previousSibling},"+":function(a,b,c,d){return a?(c=S(a),d=S(b),c&&d&&c==d&&c):!1}};M.prototype={g:function(a){return this.c[a]||undefined},s:function(a,b){return this.c[a]=b,b}};var N=new M,O=new M,P=new M,Q=new M,bb="compareDocumentPosition"in u?function(a,b){return(b.compareDocumentPosition(a)&16)==16}:"contains"in u?function(a,c){return c=c==b||c==window?u:c,c!==a&&c.contains(a)}:function(a,b){while(a=a.parentNode)if(a===b)return 1;return 0},bc=function(){if(!b.querySelector||!b.querySelectorAll)return!1;try{return b.querySelectorAll(":nth-of-type(1)").length}catch(a){return!1}}(),bd=bc?function(a,c){return b.getElementsByClassName&&(i=a.match(y))?R(c.getElementsByClassName(i[1])):R(c.querySelectorAll(a))}:function(a,c){a=a.replace(B,"$1");var d=[],e,g,j=[],k;if(i=a.match(A)){s=c.getElementsByTagName(i[1]||"*"),l=N.g(i[2])||N.s(i[2],new RegExp("(^|\\s+)"+i[2]+"(\\s+|$)"));for(k=0,h=s.length,f=0;k<h;k++)l.test(s[k].className)&&(d[f++]=s[k]);return d}for(k=0,s=a.split(","),h=s.length;k<h;k++)j[k]=X(s[k]);for(k=0,h=j.length;k<h&&(g=j[k]);k++){var m=g;if(c!==b){m=[];for(f=0,i=g.length;f<i&&(e=g[f]);f++)bb(e,c)&&m.push(e)}d=d.concat(m)}return Z(d)};return ba.uniq=Z,ba.pseudos={},ba.noConflict=function(){return a.qwery=c,this},ba}),provide("qwery",a.exports),!function(a,b){function f(b,c){var d=/^\s*<([^\s>]+)\s*/.exec(b)[1],f=(c||a).createElement(e[d]||"div"),g=[];f.innerHTML=b;var h=f.childNodes;f=f.firstChild,f.nodeType==1&&g.push(f);while(f=f.nextSibling)f.nodeType==1&&g.push(f);return g}var c=require("qwery"),d="table",e={thead:d,tbody:d,tfoot:d,tr:"tbody",th:"tr",td:"tr",fieldset:"form",option:"select"};b._select=function(a,b){return/^\s*</.test(a)?f(a,b):c(a,b)},b.pseudos=c.pseudos,b.ender({find:function(a){var d=[],e,f,g,h,i;for(e=0,f=this.length;e<f;e++){i=c(a,this[e]);for(g=0,h=i.length;g<h;g++)d.push(i[g])}return b(c.uniq(d))},and:function(a){var c=b(a);for(var d=this.length,e=0,f=this.length+c.length;d<f;d++,e++)this[d]=c[e];return this}},!0)}(document,ender)}() \ No newline at end of file diff --git a/.themes/classic/source/javascripts/twitter.js b/.themes/classic/source/javascripts/twitter.js index ea1580e4..5b6b1240 100644 --- a/.themes/classic/source/javascripts/twitter.js +++ b/.themes/classic/source/javascripts/twitter.js @@ -1,11 +1,6 @@ // JSON-P Twitter fetcher for Octopress // (c) Brandon Mathis // MIT Lisence -// jXHR.js (JSON-P XHR) | v0.1 (c) Kyle Simpson | MIT License | http://mulletxhr.com/ -// uncompressed version available in source/javascripts/libs/jXHR.js -(function(c){var b=c.setTimeout,d=c.document,a=0;c.jXHR=function(){var e,g,n,h,m=null;function l(){try{h.parentNode.removeChild(h)}catch(o){}}function k(){g=false;e="";l();h=null;i(0)}function f(p){try{m.onerror.call(m,p,e)}catch(o){throw new Error(p)}}function j(){if((this.readyState&&this.readyState!=="complete"&&this.readyState!=="loaded")||g){return}this.onload=this.onreadystatechange=null;g=true;if(m.readyState!==4){f("Script failed to load ["+e+"].")}l()}function i(o,p){p=p||[];m.readyState=o;if(typeof m.onreadystatechange==="function"){m.onreadystatechange.apply(m,p)}}m={onerror:null,onreadystatechange:null,readyState:0,open:function(p,o){k();internal_callback="cb"+(a++);(function(q){c.jXHR[q]=function(){try{i.call(m,4,arguments)}catch(r){m.readyState=-1;f("Script failed to run ["+e+"].")}c.jXHR[q]=null}})(internal_callback);e=o.replace(/=\?/,"=jXHR."+internal_callback);i(1)},send:function(){b(function(){h=d.createElement("script");h.setAttribute("type","text/javascript");h.onload=h.onreadystatechange=function(){j.call(h)};h.setAttribute("src",e);d.getElementsByTagName("head")[0].appendChild(h)},0);i(2)},setRequestHeader:function(){},getResponseHeader:function(){return""},getAllResponseHeaders:function(){return[]}};k();return m}})(window); - - /* Sky Slavin, Ludopoli. MIT license. * based on JavaScript Pretty Date * Copyright (c) 2008 John Resig (jquery.com) * Licensed under the MIT license. */ function prettyDate(time) { if (navigator.appName === 'Microsoft Internet Explorer') { @@ -44,12 +39,20 @@ function prettyDate(time) { } function linkifyTweet(text, url) { + // Linkify urls, usernames, hashtags + text = text.replace(/(https?:\/\/)([\w\-:;?&=+.%#\/]+)/gi, '<a href="$1$2">$2</a>') + .replace(/(^|\W)@(\w+)/g, '$1<a href="http://twitter.com/$2">@$2</a>') + .replace(/(^|\W)#(\w+)/g, '$1<a href="http://search.twitter.com/search?q=%23$2">#$2</a>'); + + // Use twitter's api to replace t.co shortened urls with expanded ones. for (var u in url) { - var shortUrl = new RegExp(url[u].url, 'g'); - text = text.replace(shortUrl, '<a href="' + url[u].expanded_url + '">' + url[u].expanded_url.replace(/https?:\/\//, '') + '</a>'); + if(url[u].expanded_url != null){ + var shortUrl = new RegExp( url[u].url.replace(/https?:\/\//, ''), 'g'); + text = text.replace(shortUrl, url[u].display_url); + console.log(text); + } } - return text.replace(/(^|\W)@(\w+)/g, '$1<a href="http://twitter.com/$2">@$2</a>') - .replace(/(^|\W)#(\w+)/g, '$1<a href="http://search.twitter.com/search?q=%23$2">#$2</a>'); + return text } function showTwitterFeed(tweets, twitter_user) { @@ -63,15 +66,11 @@ function showTwitterFeed(tweets, twitter_user) { } function getTwitterFeed(user, count, replies) { - var feed = new jXHR(); - feed.onerror = function (msg,url) { - $('#tweets li.loading').addClass('error').text("Twitter's busted"); - }; - feed.onreadystatechange = function(data){ - if (feed.readyState === 4) { showTwitterFeed(data, user); } - }; + $.ajax({ + url: "http://api.twitter.com/1/statuses/user_timeline/" + user + ".json?trim_user=true&count=" + (parseInt(count, 10)) + "&include_entities=1&exclude_replies=" + (replies ? "0" : "1") + "&callback=?" + , type: 'jsonp' + , error: function (err) { $('#tweets li.loading').addClass('error').text("Twitter's busted"); } + , success: function(data) { showTwitterFeed(data, user); } + }) +} - // Documentation: https://dev.twitter.com/docs/api/1/get/statuses/user_timeline - feed.open("GET","http://api.twitter.com/1/statuses/user_timeline/" + user + ".json?trim_user=true&count=" + (parseInt(count, 10)) + "&include_entities=1&exclude_replies=" + (replies ? "0" : "1") + "&callback=?"); - feed.send(); -} \ No newline at end of file -- cgit v1.2.1 From 9730e241b16b7e1b283f163bc38929ff76864014 Mon Sep 17 00:00:00 2001 From: Brandon Mathis <brandon@imathis.com> Date: Wed, 28 Sep 2011 00:08:11 -0500 Subject: added node_modules to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index b379087f..68a68305 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ source.old source/_stash source/stylesheets/screen.css vendor +node_modules -- cgit v1.2.1 From 9cf956cc96d0a337562a46bb1e695c4da31c88c4 Mon Sep 17 00:00:00 2001 From: Brandon Mathis <brandon@imathis.com> Date: Wed, 28 Sep 2011 00:53:31 -0500 Subject: added buffer for mentions in twitter stream --- .themes/classic/source/javascripts/twitter.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.themes/classic/source/javascripts/twitter.js b/.themes/classic/source/javascripts/twitter.js index 5b6b1240..b6fb0d87 100644 --- a/.themes/classic/source/javascripts/twitter.js +++ b/.themes/classic/source/javascripts/twitter.js @@ -49,7 +49,6 @@ function linkifyTweet(text, url) { if(url[u].expanded_url != null){ var shortUrl = new RegExp( url[u].url.replace(/https?:\/\//, ''), 'g'); text = text.replace(shortUrl, url[u].display_url); - console.log(text); } } return text @@ -66,11 +65,11 @@ function showTwitterFeed(tweets, twitter_user) { } function getTwitterFeed(user, count, replies) { + count = parseInt(count, 10); $.ajax({ - url: "http://api.twitter.com/1/statuses/user_timeline/" + user + ".json?trim_user=true&count=" + (parseInt(count, 10)) + "&include_entities=1&exclude_replies=" + (replies ? "0" : "1") + "&callback=?" + url: "http://api.twitter.com/1/statuses/user_timeline/" + user + ".json?trim_user=true&count=" + (count + 20) + "&include_entities=1&exclude_replies=" + (replies ? "0" : "1") + "&callback=?" , type: 'jsonp' , error: function (err) { $('#tweets li.loading').addClass('error').text("Twitter's busted"); } - , success: function(data) { showTwitterFeed(data, user); } + , success: function(data) { showTwitterFeed(data.slice(0, count), user); } }) } - -- cgit v1.2.1