├── .gitignore ├── assets ├── images │ ├── tab.png │ ├── icons │ │ ├── alias.png │ │ ├── bug.png │ │ ├── check.png │ │ ├── class.png │ │ ├── date.png │ │ ├── file.png │ │ ├── find.png │ │ ├── fixme.png │ │ ├── list.png │ │ ├── page.png │ │ ├── ruby.png │ │ ├── stat.png │ │ ├── tool.png │ │ ├── zoom.png │ │ ├── bullet.png │ │ ├── loading.gif │ │ ├── method.png │ │ ├── module.png │ │ ├── plugin.png │ │ ├── project.png │ │ ├── attribute.png │ │ ├── constant.png │ │ ├── singleton.png │ │ ├── bullet_minus.png │ │ └── bullet_plus.png │ └── tab_background.gif ├── javascripts │ ├── firebug.js │ ├── jquery.mousewheel.min.js │ ├── keymaster.js │ ├── main.js │ ├── quicksearch.js │ ├── handlebars.helpers.js │ ├── shortcut.js │ ├── handlebars.runtime.js │ ├── jquery.history.js │ ├── rebecca.js │ ├── rundown.js │ └── handlebars.templates.js └── stylesheets │ ├── quicksearch.css │ ├── index.css │ ├── nav.css │ └── rdoc.css ├── source └── templates │ ├── document.handlebars │ ├── title.handlebars │ ├── script.handlebars │ ├── file_stats.handlebars │ ├── footer.handlebars │ ├── method.handlebars │ ├── index.handlebars │ ├── navigation.handlebars │ └── module.handlebars ├── Rulefile ├── index.html ├── README.rdoc └── COPYING.rdoc /.gitignore: -------------------------------------------------------------------------------- 1 | .fire/digest 2 | work 3 | web 4 | -------------------------------------------------------------------------------- /assets/images/tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/tab.png -------------------------------------------------------------------------------- /assets/images/icons/alias.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/icons/alias.png -------------------------------------------------------------------------------- /assets/images/icons/bug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/icons/bug.png -------------------------------------------------------------------------------- /assets/images/icons/check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/icons/check.png -------------------------------------------------------------------------------- /assets/images/icons/class.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/icons/class.png -------------------------------------------------------------------------------- /assets/images/icons/date.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/icons/date.png -------------------------------------------------------------------------------- /assets/images/icons/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/icons/file.png -------------------------------------------------------------------------------- /assets/images/icons/find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/icons/find.png -------------------------------------------------------------------------------- /assets/images/icons/fixme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/icons/fixme.png -------------------------------------------------------------------------------- /assets/images/icons/list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/icons/list.png -------------------------------------------------------------------------------- /assets/images/icons/page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/icons/page.png -------------------------------------------------------------------------------- /assets/images/icons/ruby.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/icons/ruby.png -------------------------------------------------------------------------------- /assets/images/icons/stat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/icons/stat.png -------------------------------------------------------------------------------- /assets/images/icons/tool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/icons/tool.png -------------------------------------------------------------------------------- /assets/images/icons/zoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/icons/zoom.png -------------------------------------------------------------------------------- /assets/images/icons/bullet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/icons/bullet.png -------------------------------------------------------------------------------- /assets/images/icons/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/icons/loading.gif -------------------------------------------------------------------------------- /assets/images/icons/method.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/icons/method.png -------------------------------------------------------------------------------- /assets/images/icons/module.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/icons/module.png -------------------------------------------------------------------------------- /assets/images/icons/plugin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/icons/plugin.png -------------------------------------------------------------------------------- /assets/images/icons/project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/icons/project.png -------------------------------------------------------------------------------- /assets/images/icons/attribute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/icons/attribute.png -------------------------------------------------------------------------------- /assets/images/icons/constant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/icons/constant.png -------------------------------------------------------------------------------- /assets/images/icons/singleton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/icons/singleton.png -------------------------------------------------------------------------------- /assets/images/tab_background.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/tab_background.gif -------------------------------------------------------------------------------- /assets/images/icons/bullet_minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/icons/bullet_minus.png -------------------------------------------------------------------------------- /assets/images/icons/bullet_plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rubyworks/rebecca/master/assets/images/icons/bullet_plus.png -------------------------------------------------------------------------------- /source/templates/document.handlebars: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | {{markup text format}} 5 |
6 | 7 | -------------------------------------------------------------------------------- /source/templates/title.handlebars: -------------------------------------------------------------------------------- 1 | 2 | 3 |

{{title}}

4 |

5 |   6 | README 7 |

8 | 9 | -------------------------------------------------------------------------------- /source/templates/script.handlebars: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | {{> file_stats}} 5 |

{{name}}

6 |
7 | {{#if uri}} 8 |
9 | Click here to view source code via repository. 10 |
11 | {{/if}} 12 | {{#if source}} 13 |
14 |   
15 |     {{source}}
16 |   
17 |   
18 | {{/if}} 19 |
20 | 21 | -------------------------------------------------------------------------------- /assets/javascripts/firebug.js: -------------------------------------------------------------------------------- 1 | /* Provide console simulation for firebug-less environments */ 2 | 3 | if (!("console" in window) || !("firebug" in console)) { 4 | var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", 5 | "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; 6 | 7 | window.console = {}; 8 | for (var i = 0; i < names.length; ++i) 9 | window.console[names[i]] = function() {}; 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /assets/stylesheets/quicksearch.css: -------------------------------------------------------------------------------- 1 | .section-header { 2 | margin-bottom: 10px; 3 | margin-top: 0; 4 | padding-top: 0; 5 | } 6 | 7 | fieldset { 8 | border: none; 9 | } 10 | 11 | #classindex-section form { 12 | padding: 0 0 10px 0; 13 | } 14 | 15 | #methodindex-section form { 16 | padding: 0 0 10px 0; 17 | } 18 | 19 | .initially-hidden { 20 | } 21 | 22 | .quicksearch-field { 23 | width: 98%; 24 | /* background: #ddd; */ 25 | border: 1px solid #ccc; 26 | height: 1.5em; 27 | -webkit-border-radius: 4px; 28 | } 29 | 30 | .quicksearch-field:focus { 31 | background: #f1edba; 32 | } 33 | 34 | -------------------------------------------------------------------------------- /source/templates/file_stats.handlebars: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |

File Stats

5 |
6 |
Created
7 |
{{created}}
8 | 9 |
Last Modified
10 |
{{modified}}
11 | 12 | {{#if requires}} 13 |
Requires
14 |
15 |
    16 | {{#requires}} 17 |
  • {{name}}
  • 18 | {{/requires}} 19 |
20 |
21 | {{/if}} 22 |
23 |
24 | 25 | -------------------------------------------------------------------------------- /source/templates/footer.handlebars: -------------------------------------------------------------------------------- 1 |
2 | {{#if Rebecca.debug}} 3 |
4 | [Debug] 5 |
6 | {{/if}} 7 | 8 |
9 | Generated with Shomen 10 | Rebecca 11 | v{{Rebecca.version}} 12 |   13 | 14 | [Validate] 15 | 16 |
17 |

18 |
19 | 20 | -------------------------------------------------------------------------------- /assets/stylesheets/index.css: -------------------------------------------------------------------------------- 1 | #alphabetical-index { 2 | padding: 0 15px; 3 | margin: 0 0 20px 0; 4 | } 5 | 6 | #alphabetical-index h2 { 7 | border-bottom: 1px solid #ccc; 8 | } 9 | 10 | #alphabetical-index div.item { 11 | padding: 0; 12 | padding-left: 24px; 13 | color: #666; 14 | font-size: 14px; 15 | } 16 | 17 | #alphabetical-index div.method { 18 | background: url(../images/icons/method.png) no-repeat left; 19 | } 20 | 21 | #alphabetical-index div.singleton { 22 | background: url(../images/icons/singleton.png) no-repeat left; 23 | } 24 | 25 | #alphabetical-index div.module { 26 | background: url(../images/icons/module.png) no-repeat left; 27 | } 28 | 29 | #alphabetical-index div.class { 30 | background: url(../images/icons/class.png) no-repeat left; 31 | } 32 | 33 | #alphabetical-index div.file { 34 | background: url(../images/icons/file.png) no-repeat left; 35 | } 36 | 37 | -------------------------------------------------------------------------------- /source/templates/method.handlebars: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 |
7 | 8 | {{#interfaces}} 9 | {{signature}} 10 | {{/interfaces}} 11 | click to toggle source 12 |
13 | 14 |
15 | {{#if comment}} 16 | {{markup comment format}} 17 | {{else}} 18 |

19 | {{/if}} 20 | 21 |
22 |
{{source}}
23 |
24 |
25 | 26 | {{#if aliases.length}} 27 |
28 | Also aliased as: 29 | {{#aliases}} 30 | {{name}} 31 | {{/aliases}} 32 |
33 | {{/if}} 34 |
35 | 36 | -------------------------------------------------------------------------------- /source/templates/index.handlebars: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 |

Alphabetical Index

7 | 8 | {{#if documents.length}} 9 |
10 |

Documents

11 |
12 | {{#documents}} 13 |
14 | {{name}} 15 |
16 | {{/documents}} 17 |
18 |
19 | {{/if}} 20 | 21 | 22 |
23 |

Class Index

24 |
25 | {{#modules}} 26 |
27 | {{path}} 28 |
29 | {{/modules}} 30 | 31 |
32 | 33 | 34 |
35 |

Method Index

36 |
37 | {{#methods}} 38 |
39 | {{name}} 40 |
41 | {{/methods}} 42 |
43 |
44 |
45 | 46 | -------------------------------------------------------------------------------- /assets/javascripts/jquery.mousewheel.min.js: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net) 2 | * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 3 | * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. 4 | * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. 5 | * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. 6 | * 7 | * Version: 3.0.2 8 | * 9 | * Requires: 1.2.2+ 10 | */ 11 | (function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(f){var d=[].slice.call(arguments,1),g=0,e=true;f=c.event.fix(f||window.event);f.type="mousewheel";if(f.wheelDelta){g=f.wheelDelta/120}if(f.detail){g=-f.detail/3}d.unshift(f,g);return c.event.handle.apply(this,d)}})(jQuery); -------------------------------------------------------------------------------- /Rulefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | ignore 'web' 4 | 5 | file 'source/**/*' do 6 | run :compile 7 | end 8 | 9 | # 10 | # Run thin server to give site a spin. 11 | # 12 | desc "start thin server" 13 | task "serve" do 14 | sh "thin start -A file" 15 | end 16 | 17 | # 18 | # Compile Handlebar.js templates. 19 | # 20 | desc "compile templates" 21 | task 'compile' do 22 | sh "handlebars source/templates/*.handlebars -f assets/javascripts/handlebars.templates.js" 23 | end 24 | 25 | # 26 | # The publish task uses the detroit-github plugin 27 | # from the Detroit project. 28 | # 29 | desc 'publish website' 30 | task 'web:publish' do 31 | mkdir_p 'web' unless directory?('web') 32 | install 'index.html', 'web/index.html' 33 | install 'doc.json', 'web/doc.json' 34 | sync 'assets', 'web/assets' 35 | 36 | github.publish 37 | end 38 | 39 | # 40 | # 41 | # 42 | desc 'prepare website' 43 | task 'web:prepare' do 44 | github.prepare 45 | end 46 | 47 | # 48 | # 49 | # 50 | def github 51 | @github ||= ( 52 | require 'detroit' 53 | require 'detroit-github' 54 | 55 | Detroit::GitHub.new( 56 | :folder => 'web' 57 | #:sitemap => { 58 | # 'index.html' => 'index.html', 59 | # 'doc.json' => 'doc.json', 60 | # 'assets' => 'assets' 61 | #} 62 | ) 63 | ) 64 | end 65 | 66 | -------------------------------------------------------------------------------- /assets/javascripts/keymaster.js: -------------------------------------------------------------------------------- 1 | // keymaster.js 2 | // (c) 2011 Thomas Fuchs 3 | // keymaster.js may be freely distributed under the MIT license. 4 | (function(a){function m(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,function(){c(window.event)})}function l(a){e=a||"all"}function k(a,b,d){var e,h,i,j;d===undefined&&(d=b,b="all"),a=a.replace(/\s/g,""),e=a.split(","),e[e.length-1]==""&&(e[e.length-2]+=",");for(i=0;i1){h=a.slice(0,a.length-1);for(j=0;j0;for(j in d)if(!d[j]&&h(i.mods,+j)>-1||d[j]&&h(i.mods,+j)==-1)m=!1;(i.mods.length==0&&!d[16]&&!d[18]&&!d[17]&&!d[91]||m)&&i.method(a,i)===!1&&(a.preventDefault?a.preventDefault():a.returnValue=!1,a.stopPropagation&&a.stopPropagation(),a.cancelBubble&&(a.cancelBubble=!0))}}}}function h(a,b){var c=a.length;while(c--)if(a[c]===b)return c;return-1}var b,c={},d={16:!1,18:!1,17:!1,91:!1},e="all",f={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,command:91},g={backspace:8,tab:9,clear:12,enter:13,"return":13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,"delete":46,home:36,end:35,pageup:33,pagedown:34,",":188,".":190,"/":191,"`":192,"-":189,"=":187,";":186,"'":222,"[":219,"]":221,"\\":220};for(b=1;b<20;b++)f["f"+b]=111+b;for(b in f)k[b]=!1;m(document,"keydown",i),m(document,"keyup",j),a.key=k,a.key.setScope=l,typeof module!="undefined"&&(module.exports=key)})(this) -------------------------------------------------------------------------------- /assets/javascripts/main.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Unwrap the first element that matches the given @expr@ from the targets and return them. 3 | */ 4 | $.fn.unwrap = function( expr ) { 5 | return this.each( function() { 6 | $(this).parents( expr ).eq( 0 ).after( this ).remove(); 7 | }); 8 | }; 9 | 10 | 11 | 12 | function toggleDebuggingSection() { 13 | $('.debugging-section').slideToggle(); 14 | }; 15 | 16 | function hookDebuggingToggle() { 17 | $('#debugging-toggle img').click( toggleDebuggingSection ); 18 | }; 19 | 20 | function highlightTarget( anchor ) { 21 | console.debug( "Highlighting target '%s'.", anchor ); 22 | 23 | $("a[name=" + anchor + "]").each( function() { 24 | if ( !$(this).parent().parent().hasClass('target-section') ) { 25 | console.debug( "Wrapping the target-section" ); 26 | $('div.method-detail').unwrap( 'div.target-section' ); 27 | $(this).parent().wrap( '
' ); 28 | } else { 29 | console.debug( "Already wrapped." ); 30 | } 31 | }); 32 | }; 33 | 34 | function highlightLocationTarget() { 35 | console.debug( "Location hash: %s", window.location.hash ); 36 | if ( ! window.location.hash || window.location.hash.length == 0 ) return; 37 | 38 | var anchor = window.location.hash.substring(1); 39 | console.debug( "Found anchor: %s; matching %s", anchor, "a[name=" + anchor + "]" ); 40 | 41 | highlightTarget( anchor ); 42 | }; 43 | 44 | function highlightClickTarget( event ) { 45 | console.debug( "Highlighting click target for event %o", event.target ); 46 | try { 47 | var anchor = $(event.target).attr( 'href' ).substring(1); 48 | console.debug( "Found target anchor: %s", anchor ); 49 | highlightTarget( anchor ); 50 | } catch ( err ) { 51 | console.error( "Exception while highlighting: %o", err ); 52 | }; 53 | }; 54 | 55 | 56 | function toggleReadmeAndIndex(local){ 57 | document.location = local + "/index.html"; 58 | if( $('#readme-section').is(":visible") == true ){ 59 | $('#readme-section').hide(); 60 | $('#index-section').show(); 61 | } else { 62 | $('#index-section').hide(); 63 | $('#readme-section').show(); 64 | } 65 | }; 66 | 67 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | API 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 53 | 54 | 55 | 56 |
57 | 62 | 63 |
64 | 65 |
66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /assets/stylesheets/nav.css: -------------------------------------------------------------------------------- 1 | #nav { 2 | /* position: fixed; 3 | top: 0; 4 | right: 17%; */ 5 | margin: 12px 0; 6 | text-align: left; 7 | border-color: #CCC; 8 | border: 1px solid #CCC; 9 | background-color: #eef; 10 | -moz-box-shadow: -3px 3px 5px rgba(0, 0, 0, 0.2); 11 | -moz-border-radius: 0px 0px 5px 5px; 12 | -webkit-border-radius: 0px 0px 5px 5px; 13 | -webkit-box-shadow: -3px 3px 5px rgba(0, 0, 0, 0.2); 14 | border-radius: 0px 0px 5px 5px; 15 | box-shadow: -3px 3px 5px rgba(0, 0, 0, 0.2); 16 | } 17 | 18 | #nav .button-list { 19 | background: url(../images/tab_background.gif) repeat-x #eef; 20 | border-bottom: 1px solid #999; 21 | color: #555; 22 | padding-left: 1em; 23 | } 24 | 25 | #nav button { 26 | font-size: 0.9em; 27 | background-color: transparent; 28 | border: none; 29 | color: #111144; 30 | padding: 5px 5px; 31 | } 32 | 33 | #nav button:hover, a:hover { 34 | color: #aaa; 35 | } 36 | 37 | #nav a { 38 | font-size: 1em; 39 | padding: 5px 15px; 40 | } 41 | 42 | #nav button.a { 43 | font-size: 1.1em; 44 | padding: 5px 15px; 45 | } 46 | 47 | #nav fieldset { 48 | margin: 0; 49 | padding: 0; 50 | } 51 | 52 | #nav table { 53 | width: 100%; 54 | } 55 | 56 | #nav table td { 57 | vertical-align: top; 58 | } 59 | 60 | #nav table td a { 61 | padding: 5px; 62 | } 63 | 64 | #nav .section { 65 | background: white; 66 | padding: 12px; 67 | border: 1px solid #ccc; 68 | } 69 | 70 | #nav .section h3 { 71 | margin: 0 0 0.4em 0; 72 | } 73 | 74 | #nav .section ul { 75 | font-size: 14px; 76 | list-style: none; 77 | margin: 0; 78 | padding: 0.5em 0.6em 0.5em 0em; 79 | } 80 | 81 | /* #search-section td a { 82 | font-size: 1em; 83 | } 84 | 85 | #search-section td li { 86 | margin: 0.2em; 87 | } 88 | */ 89 | 90 | #nav .section ul a { 91 | font-size: 1em; 92 | font-size: 14px; 93 | padding: 0.1em; 94 | } 95 | 96 | #nav .section li { 97 | padding: 2px 0 2px 2px; 98 | background: url(../images/icons/bullet.png) no-repeat left 4px; 99 | color: #666; 100 | margin: 0.2em; 101 | } 102 | 103 | #nav .section li.method { 104 | padding-left: 20px; 105 | background: url(../images/icons/method.png) no-repeat left 2px; 106 | } 107 | 108 | #nav .section li.singleton { 109 | padding-left: 20px; 110 | background: url(../images/icons/singleton.png) no-repeat left 2px; 111 | } 112 | 113 | #nav .section li.module { 114 | padding-left: 20px; 115 | background: url(../images/icons/module.png) no-repeat left 2px; 116 | } 117 | 118 | #nav .section li.class { 119 | padding-left: 20px; 120 | background: url(../images/icons/class.png) no-repeat left 2px; 121 | } 122 | 123 | #nav .section li.file { 124 | padding-left: 20px; 125 | background: url(../images/icons/file.png) no-repeat left 2px; 126 | } 127 | 128 | -------------------------------------------------------------------------------- /README.rdoc: -------------------------------------------------------------------------------- 1 | = Rebecca 2 | 3 | {Website}[http://rubyworks.github.com/rebecca] | 4 | {Development}[http://github.com/rubyworks/rebecca] 5 | 6 | 7 | == Welcome 8 | 9 | Ah, she will snare you. Her svelt lines, her 10 | Rebecca harnesses the powers of the Shomen standard documentation model, 11 | and is built on a jQuery powerhouse, to deliver a sleek and highly usable 12 | documentation browser. 13 | 14 | 15 | == Features 16 | 17 | * Dropdown search ribbon makes it a snap locate documents, classes and methods. 18 | * Built on JQuery, JQuery Templates and other well supported Javascript tools. 19 | * Easily personalize design to best fit your project. 20 | 21 | 22 | == How To 23 | 24 | Generate a shomen `.json` file for you project to replace. 25 | 26 | $ cd .. 27 | $ shomen rdoc > site/foo-1.0.0.json 28 | 29 | See Shomen project to learn more about this. 30 | 31 | To locally view your documentation, clone this repo to your project's 32 | webite directory (or `gh-pages` branch if you are crazy like that). 33 | 34 | $ cd myproject 35 | $ git clone http://rubyworks.github.com/rebecca.git site 36 | $ cd site 37 | $ rm -rf .git 38 | 39 | By default it will look for `doc.json` so you can link that to 40 | the latest documentation file. 41 | 42 | $ ln -s foo-1.0.0.json doc.json 43 | 44 | Now fire up local directory webserver. The `shomen` command provides 45 | one (must have `sinatra` installed): 46 | 47 | $ shomen server 48 | 49 | You can also view the files directly if your browser supports local 50 | ajax calls (Firefox works. Chrome? Not so much). 51 | 52 | $ firefox index.html 53 | 54 | Now then, customize that template to your little hearts desire! 55 | 56 | To view you documentation remotely, firs publish you Shomen .json 57 | file, presumably to your website, but it can be anywhere on the 58 | internet that will accept loading via ajax. 59 | 60 | Now navigate over to the Rubyfaux site setting the `doc` property 61 | in the URL to the location of the file, e.g. 62 | 63 | http://rubyworks.github.com/rebecca?doc=http://myorg.github.com/myapp/myapp-1.0.0.json 64 | 65 | And there you are. 66 | 67 | Note that if the documented project is large so too will be the Shomen `.json` file. 68 | In which case it take a moment for the browser to load the file. For large projects 69 | as such it is a good idea to divide documentation into a set of smaller files, rather 70 | than one big file. 71 | 72 | 73 | == Legalease 74 | 75 | Copyright (c) 2011 Thomas Sawyer 76 | 77 | Available according to the terms of the *BSD-2-Clause* license. 78 | 79 | External libraries used: 80 | 81 | * {jQuery}[http://jquery.org] 82 | * {Quicksearch}[http://github.com/riklomas/quicksearch] 83 | * {Highlight}[http://github.com/isagalaev/highlight.js] 84 | * {Showdown}[http://github.com/coreyti/showdown] 85 | * {Rundown}[http://github.com/rubyworks/rundown] 86 | * {Keymaster}[http://github.com/madrobby/keymaster] 87 | * {Mousewheel}[http://plugins.jquery.com/project/mousewheel] 88 | 89 | -------------------------------------------------------------------------------- /source/templates/navigation.handlebars: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | README 9 | INDEX 10 | :   11 | 12 |   13 |   14 |   15 | 16 |   17 |   18 |
19 | 20 | 87 | -------------------------------------------------------------------------------- /assets/javascripts/quicksearch.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * JQuery QuickSearch - Hook up a form field to hide non-matching elements. 4 | * 5 | * Copyright 2007,2008 Michael Granger 6 | * 7 | * See COPYING.rdoc for details. 8 | */ 9 | 10 | jQuery.fn.quicksearch = function( target, searchElems, options ) { 11 | // console.debug( "Quicksearch fn" ); 12 | 13 | var settings = { 14 | delay: 250, 15 | clearButton: false, 16 | highlightMatches: false, 17 | focusOnLoad: false, 18 | noSearchResultsIndicator: null 19 | }; 20 | if ( options ) $.extend( settings, options ); 21 | 22 | return jQuery(this).each( function() { 23 | // console.debug( "Creating a new quicksearch on %o for %o", this, searchElems ); 24 | new jQuery.quicksearch( this, searchElems, settings ); 25 | }); 26 | }; 27 | 28 | 29 | jQuery.quicksearch = function( searchBox, searchElems, settings ) { 30 | var timeout; 31 | var boxdiv = $(searchBox).parents('div').eq(0); 32 | 33 | function init() { 34 | setupKeyEventHandlers(); 35 | focusOnLoad(); 36 | }; 37 | 38 | function setupKeyEventHandlers() { 39 | // console.debug( "Hooking up the 'keypress' event to %o", searchBox ); 40 | $(searchBox). 41 | unbind( 'keyup' ). 42 | keyup( function(e) { return onSearchKey( e.keyCode ); }); 43 | $(searchBox). 44 | unbind( 'keypress' ). 45 | keypress( function(e) { 46 | switch( e.which ) { 47 | // Execute the search on Enter, Tab, or Newline 48 | case 9: 49 | case 13: 50 | case 10: 51 | clearTimeout( timeout ); 52 | e.preventDefault(); 53 | doQuickSearch(); 54 | break; 55 | 56 | // Allow backspace 57 | case 8: 58 | return true; 59 | break; 60 | 61 | // Only allow valid search characters 62 | default: 63 | return validQSChar( e.charCode ); 64 | } 65 | }); 66 | }; 67 | 68 | function focusOnLoad() { 69 | if ( !settings.focusOnLoad ) return false; 70 | $(searchBox).focus(); 71 | }; 72 | 73 | function onSearchKey ( code ) { 74 | clearTimeout( timeout ); 75 | // console.debug( "...scheduling search." ); 76 | timeout = setTimeout( doQuickSearch, settings.delay ); 77 | }; 78 | 79 | function validQSChar( code ) { 80 | var c = String.fromCharCode( code ); 81 | return ( 82 | (c == ':') || 83 | (c >= 'a' && c <= 'z') || 84 | (c >= 'A' && c <= 'Z') 85 | ); 86 | }; 87 | 88 | function doQuickSearch() { 89 | var searchText = searchBox.value; 90 | var pat = new RegExp( searchText, "im" ); 91 | var shownCount = 0; 92 | 93 | if ( settings.noSearchResultsIndicator ) { 94 | $('#' + settings.noSearchResultsIndicator).hide(); 95 | } 96 | 97 | // All elements start out hidden 98 | $(searchElems).each( function(index) { 99 | var str = $(this).text(); 100 | 101 | if ( pat.test(str) ) { 102 | shownCount += 1; 103 | $(this).fadeIn(); 104 | } else { 105 | $(this).hide(); 106 | } 107 | }); 108 | 109 | if ( shownCount == 0 && settings.noSearchResultsIndicator ) { 110 | $('#' + settings.noSearchResultsIndicator).slideDown(); 111 | } 112 | }; 113 | 114 | init(); 115 | }; 116 | 117 | 118 | function hookQuickSearch() { 119 | $('.quicksearch-field').each( function() { 120 | var searchElems = $(this).parents('.section').find( 'li' ); 121 | var toggle = $(this).parents('.section').find('h3 .search-toggle'); 122 | // console.debug( "Toggle is: %o", toggle ); 123 | var qsbox = $(this).parents('form').get( 0 ); 124 | 125 | $(this).quicksearch( this, searchElems, { 126 | noSearchResultsIndicator: 'no-class-search-results', 127 | focusOnLoad: false 128 | }); 129 | $(toggle).click( function() { 130 | // console.debug( "Toggling qsbox: %o", qsbox ); 131 | $(qsbox).toggle(); 132 | }); 133 | }); 134 | }; 135 | 136 | -------------------------------------------------------------------------------- /assets/javascripts/handlebars.helpers.js: -------------------------------------------------------------------------------- 1 | // rdoc convertor 2 | var rundown = new Rundown.converter(); /* TODO: support other formats */ 3 | 4 | // 5 | // @todo handle format 6 | // 7 | Handlebars.registerHelper('markup', function(text, format) { 8 | var ret = rundown.makeHtml(text); 9 | return new Handlebars.SafeString(ret); 10 | }); 11 | 12 | 13 | // 14 | // Calcuate the documentation `id` given a `path`. 15 | // 16 | Handlebars.registerHelper('calc_id', function(path) { 17 | return Rebecca.id(path); 18 | }); 19 | 20 | 21 | // 22 | // Calculate the internal href given the documentaiton `id`. 23 | // 24 | Handlebars.registerHelper('calc_href', function(id) { 25 | return Rebecca.href(id); 26 | }); 27 | 28 | // 29 | // @todo Combine with above. 30 | // 31 | Handlebars.registerHelper('calc_method_href', function() { 32 | return Rebecca.method_href(this); 33 | }); 34 | 35 | // 36 | // If they the of documentation object is a `class`, then 37 | // render the given block. 38 | // 39 | Handlebars.registerHelper('if_class', function(options) { 40 | if (this['!'] == 'class') { 41 | return options.fn(this); 42 | } else { 43 | return ''; 44 | }; 45 | }); 46 | 47 | // 48 | // If the `comment` starts with a header, as indicated by a `=` or `#`, 49 | // then do not render the given block. 50 | // 51 | Handlebars.registerHelper('unless_header', function(options) { 52 | if (! /^\s*[=#]/.test(this.comment)) { 53 | return options.fn(this); 54 | } else { 55 | return ''; 56 | }; 57 | }); 58 | 59 | // 60 | // This helper ensures there is a least one class or module for the 61 | // given block to be rendered. 62 | // 63 | Handlebars.registerHelper('if_namespaces', function(options) { 64 | if (this.classes.length > 0 || this.modules.length > 0) { 65 | return options.fn(this); 66 | } else { 67 | return ''; 68 | }; 69 | }); 70 | 71 | // 72 | // Iterate over each `list` entry, looking the item up in documentation, 73 | // and rendering the given block with it. 74 | // 75 | Handlebars.registerHelper('doc', function(list, options) { 76 | var doc; 77 | var out = ''; 78 | 79 | for(var i=0, l=list.length; i 0) { 122 | out = block(meths); 123 | }; 124 | 125 | return out; 126 | }); 127 | 128 | // 129 | // This helper makes sure there are methods with a given scope and visibility. 130 | // If so it renders the given block with the current context. 131 | // It is intended to be used in the context of `methods_categorized`. 132 | // 133 | Handlebars.registerHelper('if_methods_by', function(scope, visibility, options) { 134 | var out = ''; 135 | 136 | if (this[scope][visibility].length > 0) { 137 | out = options.fn(this); 138 | }; 139 | 140 | return out; 141 | }); 142 | 143 | // 144 | // This helper iterates over methods with a given scope and visibility. 145 | // It is intended to be used in the context of `methods_categorized`. 146 | // 147 | Handlebars.registerHelper('methods_by', function(scope, visibility, options) { 148 | var meths = this[scope][visibility]; 149 | var out = ''; 150 | 151 | for(var i=0, l=meths.length; i 2 | 3 |
4 | 5 |
6 | {{#unless_header}} 7 |

{{name}}

8 | {{/unless_header}} 9 | {{markup comment format}} 10 |
11 | 12 | 13 | {{#if_class}} 14 |
15 |

Parent

16 |
    17 | {{#if superclass}} 18 |
  • 19 | 20 | {{superclass}} 21 |
  • 22 | {{/if}} 23 |
24 |
25 | {{/if_class}} 26 | 27 | 28 | {{#if_namespaces}} 29 |
30 |

Namespace

31 | 40 |
41 | {{/if_namespaces}} 42 | 43 | 44 | {{#if includes.length}} 45 |
46 |

Included Modules

47 | 52 |
53 | {{/if}} 54 | 55 | 56 | {{#if extensions.length}} 57 |
58 |

Extension Modules

59 | 64 |
65 | {{/if}} 66 | 67 | 68 | {{#if constants.length}} 69 |
70 |

Constants

71 |
72 | {{#doc constants}} 73 |
{{name}}
74 |
{{comment}}
75 | {{/doc}} 76 |
77 |
78 | {{/if}} 79 | 80 | 81 | {{#if accessors.length}} 82 |
83 |

Attributes

84 | 85 | {{#each accessors}} 86 | {{#reader}} 87 |
88 | 89 |
90 | {{name}} 91 |
92 |
93 |

{{comment}}

94 |
95 |
96 | {{/reader}} 97 | 98 | {{#writer}} 99 |
100 | 101 |
102 | {{name}} 103 |
104 |
105 |

{{comment}}

106 |
107 |
108 | {{/writer}} 109 | {{/each}} 110 |
111 | {{/if}} 112 | 113 | 114 | {{#methods_categorized}} 115 |
116 | {{#if_methods_by "class" "public"}} 117 |
118 |

Public Class Methods

119 | {{#methods_by "class" "public"}} 120 | {{> method}} 121 | {{/methods_by}} 122 |
123 | {{/if_methods_by}} 124 | 125 | {{#if_methods_by "class" "private"}} 126 |
127 |

Private Class Methods

128 | {{#methods_by "class" "private"}} 129 | {{> method}} 130 | {{/methods_by}} 131 |
132 | {{/if_methods_by}} 133 | 134 | {{#if_methods_by "class" "protected"}} 135 |
136 |

Protected Class Methods

137 | {{#methods_by "class" "protected"}} 138 | {{> method}} 139 | {{/methods_by}} 140 |
141 | {{/if_methods_by}} 142 | 143 | {{#if_methods_by "instance" "public"}} 144 |
145 |

Public Instance Methods

146 | {{#methods_by "instance" "public"}} 147 | {{> method}} 148 | {{/methods_by}} 149 |
150 | {{/if_methods_by}} 151 | 152 | {{#if_methods_by "instance" "private"}} 153 |
154 |

Private Instance Methods

155 | {{#methods_by "instance" "private"}} 156 | {{> method}} 157 | {{/methods_by}} 158 |
159 | {{/if_methods_by}} 160 | 161 | {{#if_methods_by "instance" "protected"}} 162 |
163 |

Protected Instance Methods

164 | {{#methods_by "instance" "protected"}} 165 | {{> method}} 166 | {{/methods_by}} 167 |
168 | {{/if_methods_by}} 169 |
170 | {{/methods_categorized}} 171 | 172 | 173 |
174 |

In Files

175 |
176 | 191 |
192 |
193 | 194 |
195 | -------------------------------------------------------------------------------- /assets/javascripts/shortcut.js: -------------------------------------------------------------------------------- 1 | /** 2 | * http://www.openjs.com/scripts/events/keyboard_shortcuts/ 3 | * Version : 2.01.B 4 | * By Binny V A 5 | * License : BSD 6 | */ 7 | shortcut = { 8 | 'all_shortcuts':{},//All the shortcuts are stored in this array 9 | 'add': function(shortcut_combination,callback,opt) { 10 | //Provide a set of default options 11 | var default_options = { 12 | 'type':'keydown', 13 | 'propagate':false, 14 | 'disable_in_input':false, 15 | 'target':document, 16 | 'keycode':false 17 | } 18 | if(!opt) opt = default_options; 19 | else { 20 | for(var dfo in default_options) { 21 | if(typeof opt[dfo] == 'undefined') opt[dfo] = default_options[dfo]; 22 | } 23 | } 24 | 25 | var ele = opt.target; 26 | if(typeof opt.target == 'string') ele = document.getElementById(opt.target); 27 | var ths = this; 28 | shortcut_combination = shortcut_combination.toLowerCase(); 29 | 30 | //The function to be called at keypress 31 | var func = function(e) { 32 | e = e || window.event; 33 | 34 | if(opt['disable_in_input']) { //Don't enable shortcut keys in Input, Textarea fields 35 | var element; 36 | if(e.target) element=e.target; 37 | else if(e.srcElement) element=e.srcElement; 38 | if(element.nodeType==3) element=element.parentNode; 39 | 40 | if(element.tagName == 'INPUT' || element.tagName == 'TEXTAREA') return; 41 | } 42 | 43 | //Find Which key is pressed 44 | if (e.keyCode) code = e.keyCode; 45 | else if (e.which) code = e.which; 46 | var character = String.fromCharCode(code).toLowerCase(); 47 | 48 | if(code == 188) character=","; //If the user presses , when the type is onkeydown 49 | if(code == 190) character="."; //If the user presses , when the type is onkeydown 50 | 51 | var keys = shortcut_combination.split("+"); 52 | //Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked 53 | var kp = 0; 54 | 55 | //Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken 56 | var shift_nums = { 57 | "`":"~", 58 | "1":"!", 59 | "2":"@", 60 | "3":"#", 61 | "4":"$", 62 | "5":"%", 63 | "6":"^", 64 | "7":"&", 65 | "8":"*", 66 | "9":"(", 67 | "0":")", 68 | "-":"_", 69 | "=":"+", 70 | ";":":", 71 | "'":"\"", 72 | ",":"<", 73 | ".":">", 74 | "/":"?", 75 | "\\":"|" 76 | } 77 | //Special Keys - and their codes 78 | var special_keys = { 79 | 'esc':27, 80 | 'escape':27, 81 | 'tab':9, 82 | 'space':32, 83 | 'return':13, 84 | 'enter':13, 85 | 'backspace':8, 86 | 87 | 'scrolllock':145, 88 | 'scroll_lock':145, 89 | 'scroll':145, 90 | 'capslock':20, 91 | 'caps_lock':20, 92 | 'caps':20, 93 | 'numlock':144, 94 | 'num_lock':144, 95 | 'num':144, 96 | 97 | 'pause':19, 98 | 'break':19, 99 | 100 | 'insert':45, 101 | 'home':36, 102 | 'delete':46, 103 | 'end':35, 104 | 105 | 'pageup':33, 106 | 'page_up':33, 107 | 'pu':33, 108 | 109 | 'pagedown':34, 110 | 'page_down':34, 111 | 'pd':34, 112 | 113 | 'left':37, 114 | 'up':38, 115 | 'right':39, 116 | 'down':40, 117 | 118 | 'f1':112, 119 | 'f2':113, 120 | 'f3':114, 121 | 'f4':115, 122 | 'f5':116, 123 | 'f6':117, 124 | 'f7':118, 125 | 'f8':119, 126 | 'f9':120, 127 | 'f10':121, 128 | 'f11':122, 129 | 'f12':123 130 | } 131 | 132 | var modifiers = { 133 | shift: { wanted:false, pressed:false}, 134 | ctrl : { wanted:false, pressed:false}, 135 | alt : { wanted:false, pressed:false}, 136 | meta : { wanted:false, pressed:false} //Meta is Mac specific 137 | }; 138 | 139 | if(e.ctrlKey) modifiers.ctrl.pressed = true; 140 | if(e.shiftKey) modifiers.shift.pressed = true; 141 | if(e.altKey) modifiers.alt.pressed = true; 142 | if(e.metaKey) modifiers.meta.pressed = true; 143 | 144 | for(var i=0; k=keys[i],i 1) { //If it is a special key 161 | if(special_keys[k] == code) kp++; 162 | 163 | } else if(opt['keycode']) { 164 | if(opt['keycode'] == code) kp++; 165 | 166 | } else { //The special keys did not match 167 | if(character == k) kp++; 168 | else { 169 | if(shift_nums[character] && e.shiftKey) { //Stupid Shift key bug created by using lowercase 170 | character = shift_nums[character]; 171 | if(character == k) kp++; 172 | } 173 | } 174 | } 175 | } 176 | 177 | if(kp == keys.length && 178 | modifiers.ctrl.pressed == modifiers.ctrl.wanted && 179 | modifiers.shift.pressed == modifiers.shift.wanted && 180 | modifiers.alt.pressed == modifiers.alt.wanted && 181 | modifiers.meta.pressed == modifiers.meta.wanted) { 182 | callback(e); 183 | 184 | if(!opt['propagate']) { //Stop the event 185 | //e.cancelBubble is supported by IE - this will kill the bubbling process. 186 | e.cancelBubble = true; 187 | e.returnValue = false; 188 | 189 | //e.stopPropagation works in Firefox. 190 | if (e.stopPropagation) { 191 | e.stopPropagation(); 192 | e.preventDefault(); 193 | } 194 | return false; 195 | } 196 | } 197 | } 198 | this.all_shortcuts[shortcut_combination] = { 199 | 'callback':func, 200 | 'target':ele, 201 | 'event': opt['type'] 202 | }; 203 | //Attach the function with the event 204 | if(ele.addEventListener) ele.addEventListener(opt['type'], func, false); 205 | else if(ele.attachEvent) ele.attachEvent('on'+opt['type'], func); 206 | else ele['on'+opt['type']] = func; 207 | }, 208 | 209 | //Remove the shortcut - just specify the shortcut and I will remove the binding 210 | 'remove':function(shortcut_combination) { 211 | shortcut_combination = shortcut_combination.toLowerCase(); 212 | var binding = this.all_shortcuts[shortcut_combination]; 213 | delete(this.all_shortcuts[shortcut_combination]) 214 | if(!binding) return; 215 | var type = binding['event']; 216 | var ele = binding['target']; 217 | var callback = binding['callback']; 218 | 219 | if(ele.detachEvent) ele.detachEvent('on'+type, callback); 220 | else if(ele.removeEventListener) ele.removeEventListener(type, callback, false); 221 | else ele['on'+type] = false; 222 | } 223 | } -------------------------------------------------------------------------------- /assets/javascripts/handlebars.runtime.js: -------------------------------------------------------------------------------- 1 | // lib/handlebars/base.js 2 | var Handlebars = {}; 3 | 4 | Handlebars.VERSION = "1.0.beta.6"; 5 | 6 | Handlebars.helpers = {}; 7 | Handlebars.partials = {}; 8 | 9 | Handlebars.registerHelper = function(name, fn, inverse) { 10 | if(inverse) { fn.not = inverse; } 11 | this.helpers[name] = fn; 12 | }; 13 | 14 | Handlebars.registerPartial = function(name, str) { 15 | this.partials[name] = str; 16 | }; 17 | 18 | Handlebars.registerHelper('helperMissing', function(arg) { 19 | if(arguments.length === 2) { 20 | return undefined; 21 | } else { 22 | throw new Error("Could not find property '" + arg + "'"); 23 | } 24 | }); 25 | 26 | var toString = Object.prototype.toString, functionType = "[object Function]"; 27 | 28 | Handlebars.registerHelper('blockHelperMissing', function(context, options) { 29 | var inverse = options.inverse || function() {}, fn = options.fn; 30 | 31 | 32 | var ret = ""; 33 | var type = toString.call(context); 34 | 35 | if(type === functionType) { context = context.call(this); } 36 | 37 | if(context === true) { 38 | return fn(this); 39 | } else if(context === false || context == null) { 40 | return inverse(this); 41 | } else if(type === "[object Array]") { 42 | if(context.length > 0) { 43 | for(var i=0, j=context.length; i 0) { 60 | for(var i=0, j=context.length; i": ">", 120 | '"': """, 121 | "'": "'", 122 | "`": "`" 123 | }; 124 | 125 | var badChars = /&(?!\w+;)|[<>"'`]/g; 126 | var possible = /[&<>"'`]/; 127 | 128 | var escapeChar = function(chr) { 129 | return escape[chr] || "&"; 130 | }; 131 | 132 | Handlebars.Utils = { 133 | escapeExpression: function(string) { 134 | // don't escape SafeStrings, since they're already safe 135 | if (string instanceof Handlebars.SafeString) { 136 | return string.toString(); 137 | } else if (string == null || string === false) { 138 | return ""; 139 | } 140 | 141 | if(!possible.test(string)) { return string; } 142 | return string.replace(badChars, escapeChar); 143 | }, 144 | 145 | isEmpty: function(value) { 146 | if (typeof value === "undefined") { 147 | return true; 148 | } else if (value === null) { 149 | return true; 150 | } else if (value === false) { 151 | return true; 152 | } else if(Object.prototype.toString.call(value) === "[object Array]" && value.length === 0) { 153 | return true; 154 | } else { 155 | return false; 156 | } 157 | } 158 | }; 159 | })();; 160 | // lib/handlebars/runtime.js 161 | Handlebars.VM = { 162 | template: function(templateSpec) { 163 | // Just add water 164 | var container = { 165 | escapeExpression: Handlebars.Utils.escapeExpression, 166 | invokePartial: Handlebars.VM.invokePartial, 167 | programs: [], 168 | program: function(i, fn, data) { 169 | var programWrapper = this.programs[i]; 170 | if(data) { 171 | return Handlebars.VM.program(fn, data); 172 | } else if(programWrapper) { 173 | return programWrapper; 174 | } else { 175 | programWrapper = this.programs[i] = Handlebars.VM.program(fn); 176 | return programWrapper; 177 | } 178 | }, 179 | programWithDepth: Handlebars.VM.programWithDepth, 180 | noop: Handlebars.VM.noop 181 | }; 182 | 183 | return function(context, options) { 184 | options = options || {}; 185 | return templateSpec.call(container, Handlebars, context, options.helpers, options.partials, options.data); 186 | }; 187 | }, 188 | 189 | programWithDepth: function(fn, data, $depth) { 190 | var args = Array.prototype.slice.call(arguments, 2); 191 | 192 | return function(context, options) { 193 | options = options || {}; 194 | 195 | return fn.apply(this, [context, options.data || data].concat(args)); 196 | }; 197 | }, 198 | program: function(fn, data) { 199 | return function(context, options) { 200 | options = options || {}; 201 | 202 | return fn(context, options.data || data); 203 | }; 204 | }, 205 | noop: function() { return ""; }, 206 | invokePartial: function(partial, name, context, helpers, partials, data) { 207 | options = { helpers: helpers, partials: partials, data: data }; 208 | 209 | if(partial === undefined) { 210 | throw new Handlebars.Exception("The partial " + name + " could not be found"); 211 | } else if(partial instanceof Function) { 212 | return partial(context, options); 213 | } else if (!Handlebars.compile) { 214 | throw new Handlebars.Exception("The partial " + name + " could not be compiled when running in runtime-only mode"); 215 | } else { 216 | partials[name] = Handlebars.compile(partial); 217 | return partials[name](context, options); 218 | } 219 | } 220 | }; 221 | 222 | Handlebars.template = Handlebars.VM.template; 223 | ; 224 | -------------------------------------------------------------------------------- /assets/javascripts/jquery.history.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery history plugin 3 | * 4 | * The MIT License 5 | * 6 | * Copyright (c) 2006-2009 Taku Sano (Mikage Sawatari) 7 | * Copyright (c) 2010 Takayuki Miwa 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy 10 | * of this software and associated documentation files (the "Software"), to deal 11 | * in the Software without restriction, including without limitation the rights 12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | * copies of the Software, and to permit persons to whom the Software is 14 | * furnished to do so, subject to the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included in 17 | * all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | * THE SOFTWARE. 26 | */ 27 | 28 | (function($) { 29 | var locationWrapper = { 30 | put: function(hash, win) { 31 | (win || window).location.hash = this.encoder(hash); 32 | }, 33 | get: function(win) { 34 | var hash = ((win || window).location.hash).replace(/^#/, ''); 35 | try { 36 | return $.browser.mozilla ? hash : decodeURIComponent(hash); 37 | } 38 | catch (error) { 39 | return hash; 40 | } 41 | }, 42 | encoder: encodeURIComponent 43 | }; 44 | 45 | var iframeWrapper = { 46 | id: "__jQuery_history", 47 | init: function() { 48 | var html = '