rdoc-generator-fivefish 0.0.1.pre.40 → 0.0.1.pre.42

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,266 +1 @@
1
- /* ===================================================
2
- * bootstrap-transition.js v2.0.2
3
- * http://twitter.github.com/bootstrap/javascript.html#transitions
4
- * ===================================================
5
- * Copyright 2012 Twitter, Inc.
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
18
- * ========================================================== */
19
- !function(a) {
20
- a(function() {
21
- "use strict", a.support.transition = function() {
22
- var b = document.body || document.documentElement, c = b.style, d = c.transition !== undefined || c.WebkitTransition !== undefined || c.MozTransition !== undefined || c.MsTransition !== undefined || c.OTransition !== undefined;
23
- return d && {
24
- end: function() {
25
- var b = "TransitionEnd";
26
- return a.browser.webkit ? b = "webkitTransitionEnd" : a.browser.mozilla ? b = "transitionend" : a.browser.opera && (b = "oTransitionEnd"), b;
27
- }()
28
- };
29
- }();
30
- });
31
- }(window.jQuery), !function(a) {
32
- function c() {
33
- var b = this, c = setTimeout(function() {
34
- b.$element.off(a.support.transition.end), d.call(b);
35
- }, 500);
36
- this.$element.one(a.support.transition.end, function() {
37
- clearTimeout(c), d.call(b);
38
- });
39
- }
40
- function d(a) {
41
- this.$element.hide().trigger("hidden"), e.call(this);
42
- }
43
- function e(b) {
44
- var c = this, d = this.$element.hasClass("fade") ? "fade" : "";
45
- if (this.isShown && this.options.backdrop) {
46
- var e = a.support.transition && d;
47
- this.$backdrop = a('<div class="modal-backdrop ' + d + '" />').appendTo(document.body), this.options.backdrop != "static" && this.$backdrop.click(a.proxy(this.hide, this)), e && this.$backdrop[0].offsetWidth, this.$backdrop.addClass("in"), e ? this.$backdrop.one(a.support.transition.end, b) : b();
48
- } else !this.isShown && this.$backdrop ? (this.$backdrop.removeClass("in"), a.support.transition && this.$element.hasClass("fade") ? this.$backdrop.one(a.support.transition.end, a.proxy(f, this)) : f.call(this)) : b && b();
49
- }
50
- function f() {
51
- this.$backdrop.remove(), this.$backdrop = null;
52
- }
53
- function g() {
54
- var b = this;
55
- this.isShown && this.options.keyboard ? a(document).on("keyup.dismiss.modal", function(a) {
56
- a.which == 27 && b.hide();
57
- }) : this.isShown || a(document).off("keyup.dismiss.modal");
58
- }
59
- "use strict";
60
- var b = function(b, c) {
61
- this.options = c, this.$element = a(b).delegate('[data-dismiss="modal"]', "click.dismiss.modal", a.proxy(this.hide, this));
62
- };
63
- b.prototype = {
64
- constructor: b,
65
- toggle: function() {
66
- return this[this.isShown ? "hide" : "show"]();
67
- },
68
- show: function() {
69
- var b = this;
70
- if (this.isShown) return;
71
- a("body").addClass("modal-open"), this.isShown = !0, this.$element.trigger("show"), g.call(this), e.call(this, function() {
72
- var c = a.support.transition && b.$element.hasClass("fade");
73
- !b.$element.parent().length && b.$element.appendTo(document.body), b.$element.show(), c && b.$element[0].offsetWidth, b.$element.addClass("in"), c ? b.$element.one(a.support.transition.end, function() {
74
- b.$element.trigger("shown");
75
- }) : b.$element.trigger("shown");
76
- });
77
- },
78
- hide: function(b) {
79
- b && b.preventDefault();
80
- if (!this.isShown) return;
81
- var e = this;
82
- this.isShown = !1, a("body").removeClass("modal-open"), g.call(this), this.$element.trigger("hide").removeClass("in"), a.support.transition && this.$element.hasClass("fade") ? c.call(this) : d.call(this);
83
- }
84
- }, a.fn.modal = function(c) {
85
- return this.each(function() {
86
- var d = a(this), e = d.data("modal"), f = a.extend({}, a.fn.modal.defaults, d.data(), typeof c == "object" && c);
87
- e || d.data("modal", e = new b(this, f)), typeof c == "string" ? e[c]() : f.show && e.show();
88
- });
89
- }, a.fn.modal.defaults = {
90
- backdrop: !0,
91
- keyboard: !0,
92
- show: !0
93
- }, a.fn.modal.Constructor = b, a(function() {
94
- a("body").on("click.modal.data-api", '[data-toggle="modal"]', function(b) {
95
- var c = a(this), d, e = a(c.attr("data-target") || (d = c.attr("href")) && d.replace(/.*(?=#[^\s]+$)/, "")), f = e.data("modal") ? "toggle" : a.extend({}, e.data(), c.data());
96
- b.preventDefault(), e.modal(f);
97
- });
98
- });
99
- }(window.jQuery), !function(a) {
100
- "use strict";
101
- var b = function(a, b) {
102
- this.init("tooltip", a, b);
103
- };
104
- b.prototype = {
105
- constructor: b,
106
- init: function(b, c, d) {
107
- var e, f;
108
- this.type = b, this.$element = a(c), this.options = this.getOptions(d), this.enabled = !0, this.options.trigger != "manual" && (e = this.options.trigger == "hover" ? "mouseenter" : "focus", f = this.options.trigger == "hover" ? "mouseleave" : "blur", this.$element.on(e, this.options.selector, a.proxy(this.enter, this)), this.$element.on(f, this.options.selector, a.proxy(this.leave, this))), this.options.selector ? this._options = a.extend({}, this.options, {
109
- trigger: "manual",
110
- selector: ""
111
- }) : this.fixTitle();
112
- },
113
- getOptions: function(b) {
114
- return b = a.extend({}, a.fn[this.type].defaults, b, this.$element.data()), b.delay && typeof b.delay == "number" && (b.delay = {
115
- show: b.delay,
116
- hide: b.delay
117
- }), b;
118
- },
119
- enter: function(b) {
120
- var c = a(b.currentTarget)[this.type](this._options).data(this.type);
121
- !c.options.delay || !c.options.delay.show ? c.show() : (c.hoverState = "in", setTimeout(function() {
122
- c.hoverState == "in" && c.show();
123
- }, c.options.delay.show));
124
- },
125
- leave: function(b) {
126
- var c = a(b.currentTarget)[this.type](this._options).data(this.type);
127
- !c.options.delay || !c.options.delay.hide ? c.hide() : (c.hoverState = "out", setTimeout(function() {
128
- c.hoverState == "out" && c.hide();
129
- }, c.options.delay.hide));
130
- },
131
- show: function() {
132
- var a, b, c, d, e, f, g;
133
- if (this.hasContent() && this.enabled) {
134
- a = this.tip(), this.setContent(), this.options.animation && a.addClass("fade"), f = typeof this.options.placement == "function" ? this.options.placement.call(this, a[0], this.$element[0]) : this.options.placement, b = /in/.test(f), a.remove().css({
135
- top: 0,
136
- left: 0,
137
- display: "block"
138
- }).appendTo(b ? this.$element : document.body), c = this.getPosition(b), d = a[0].offsetWidth, e = a[0].offsetHeight;
139
- switch (b ? f.split(" ")[1] : f) {
140
- case "bottom":
141
- g = {
142
- top: c.top + c.height,
143
- left: c.left + c.width / 2 - d / 2
144
- };
145
- break;
146
- case "top":
147
- g = {
148
- top: c.top - e,
149
- left: c.left + c.width / 2 - d / 2
150
- };
151
- break;
152
- case "left":
153
- g = {
154
- top: c.top + c.height / 2 - e / 2,
155
- left: c.left - d
156
- };
157
- break;
158
- case "right":
159
- g = {
160
- top: c.top + c.height / 2 - e / 2,
161
- left: c.left + c.width
162
- };
163
- }
164
- a.css(g).addClass(f).addClass("in");
165
- }
166
- },
167
- setContent: function() {
168
- var a = this.tip();
169
- a.find(".tooltip-inner").html(this.getTitle()), a.removeClass("fade in top bottom left right");
170
- },
171
- hide: function() {
172
- function d() {
173
- var b = setTimeout(function() {
174
- c.off(a.support.transition.end).remove();
175
- }, 500);
176
- c.one(a.support.transition.end, function() {
177
- clearTimeout(b), c.remove();
178
- });
179
- }
180
- var b = this, c = this.tip();
181
- c.removeClass("in"), a.support.transition && this.$tip.hasClass("fade") ? d() : c.remove();
182
- },
183
- fixTitle: function() {
184
- var a = this.$element;
185
- (a.attr("title") || typeof a.attr("data-original-title") != "string") && a.attr("data-original-title", a.attr("title") || "").removeAttr("title");
186
- },
187
- hasContent: function() {
188
- return this.getTitle();
189
- },
190
- getPosition: function(b) {
191
- return a.extend({}, b ? {
192
- top: 0,
193
- left: 0
194
- } : this.$element.offset(), {
195
- width: this.$element[0].offsetWidth,
196
- height: this.$element[0].offsetHeight
197
- });
198
- },
199
- getTitle: function() {
200
- var a, b = this.$element, c = this.options;
201
- return a = b.attr("data-original-title") || (typeof c.title == "function" ? c.title.call(b[0]) : c.title), a = (a || "").toString().replace(/(^\s*|\s*$)/, ""), a;
202
- },
203
- tip: function() {
204
- return this.$tip = this.$tip || a(this.options.template);
205
- },
206
- validate: function() {
207
- this.$element[0].parentNode || (this.hide(), this.$element = null, this.options = null);
208
- },
209
- enable: function() {
210
- this.enabled = !0;
211
- },
212
- disable: function() {
213
- this.enabled = !1;
214
- },
215
- toggleEnabled: function() {
216
- this.enabled = !this.enabled;
217
- },
218
- toggle: function() {
219
- this[this.tip().hasClass("in") ? "hide" : "show"]();
220
- }
221
- }, a.fn.tooltip = function(c) {
222
- return this.each(function() {
223
- var d = a(this), e = d.data("tooltip"), f = typeof c == "object" && c;
224
- e || d.data("tooltip", e = new b(this, f)), typeof c == "string" && e[c]();
225
- });
226
- }, a.fn.tooltip.Constructor = b, a.fn.tooltip.defaults = {
227
- animation: !0,
228
- delay: 0,
229
- selector: !1,
230
- placement: "top",
231
- trigger: "hover",
232
- title: "",
233
- template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
234
- };
235
- }(window.jQuery), !function(a) {
236
- "use strict";
237
- var b = function(a, b) {
238
- this.init("popover", a, b);
239
- };
240
- b.prototype = a.extend({}, a.fn.tooltip.Constructor.prototype, {
241
- constructor: b,
242
- setContent: function() {
243
- var b = this.tip(), c = this.getTitle(), d = this.getContent();
244
- b.find(".popover-title")[a.type(c) == "object" ? "append" : "html"](c), b.find(".popover-content > *")[a.type(d) == "object" ? "append" : "html"](d), b.removeClass("fade top bottom left right in");
245
- },
246
- hasContent: function() {
247
- return this.getTitle() || this.getContent();
248
- },
249
- getContent: function() {
250
- var a, b = this.$element, c = this.options;
251
- return a = b.attr("data-content") || (typeof c.content == "function" ? c.content.call(b[0]) : c.content), a = a.toString().replace(/(^\s*|\s*$)/, ""), a;
252
- },
253
- tip: function() {
254
- return this.$tip || (this.$tip = a(this.options.template)), this.$tip;
255
- }
256
- }), a.fn.popover = function(c) {
257
- return this.each(function() {
258
- var d = a(this), e = d.data("popover"), f = typeof c == "object" && c;
259
- e || d.data("popover", e = new b(this, f)), typeof c == "string" && e[c]();
260
- });
261
- }, a.fn.popover.Constructor = b, a.fn.popover.defaults = a.extend({}, a.fn.tooltip.defaults, {
262
- placement: "right",
263
- content: "",
264
- template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
265
- });
266
- }(window.jQuery);;
1
+ ;
@@ -8,40 +8,7 @@
8
8
  * Dual licensed under the MIT or GPL Version 2 licenses
9
9
  *
10
10
  */
11
- jQuery && function(a) {
12
- function b(b) {
13
- var d = a(this), e = a(a(this).attr("data-dropdown")), f = d.hasClass("dropdown-open");
14
- b.preventDefault(), b.stopPropagation(), c();
15
- if (f || d.hasClass("dropdown-disabled")) return;
16
- e.css({
17
- left: e.hasClass("anchor-right") ? d.offset().left - (e.outerWidth() - d.outerWidth()) : d.offset().left,
18
- top: d.offset().top + d.outerHeight()
19
- }).show(), d.addClass("dropdown-open");
20
- }
21
- function c(b) {
22
- var c = b ? a(b.target).parents().andSelf() : null;
23
- if (c && c.is(".dropdown-menu") && !c.is("A")) return;
24
- a("BODY").find(".dropdown-menu").hide().end().find("[data-dropdown]").removeClass("dropdown-open");
25
- }
26
- a.extend(a.fn, {
27
- dropdown: function(b, d) {
28
- switch (b) {
29
- case "hide":
30
- return c(), a(this);
31
- case "attach":
32
- return a(this).attr("data-dropdown", d);
33
- case "detach":
34
- return c(), a(this).removeAttr("data-dropdown");
35
- case "disable":
36
- return a(this).addClass("dropdown-disabled");
37
- case "enable":
38
- return c(), a(this).removeClass("dropdown-disabled");
39
- }
40
- }
41
- }), a(function() {
42
- a("BODY").on("click.dropdown", "[data-dropdown]", b), a("HTML").on("click.dropdown", c);
43
- });
44
- }(jQuery);;
11
+ jQuery&&function(a){function b(b){var d=a(this),e=a(a(this).attr("data-dropdown")),f=d.hasClass("dropdown-open");b.preventDefault(),b.stopPropagation(),c();if(f||d.hasClass("dropdown-disabled"))return;e.css({left:e.hasClass("anchor-right")?d.offset().left-(e.outerWidth()-d.outerWidth()):d.offset().left,top:d.offset().top+d.outerHeight()}).show(),d.addClass("dropdown-open")}function c(b){var c=b?a(b.target).parents().andSelf():null;if(c&&c.is(".dropdown-menu")&&!c.is("A"))return;a("BODY").find(".dropdown-menu").hide().end().find("[data-dropdown]").removeClass("dropdown-open")}a.extend(a.fn,{dropdown:function(b,d){switch(b){case"hide":return c(),a(this);case"attach":return a(this).attr("data-dropdown",d);case"detach":return c(),a(this).removeAttr("data-dropdown");case"disable":return a(this).addClass("dropdown-disabled");case"enable":return c(),a(this).removeClass("dropdown-disabled")}}}),a(function(){a("BODY").on("click.dropdown","[data-dropdown]",b),a("HTML").on("click.dropdown",c)})}(jQuery);
45
12
  /*
46
13
  * jQuery Hotkeys Plugin
47
14
  * Copyright 2010, John Resig
@@ -53,99 +20,7 @@ jQuery && function(a) {
53
20
  * Original idea by:
54
21
  * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/
55
22
  */
56
- (function(a) {
57
- function b(b) {
58
- if (typeof b.data != "string") return;
59
- var c = b.handler, d = b.data.toLowerCase().split(" ");
60
- b.handler = function(b) {
61
- if (!(this === b.target || !/textarea|select/i.test(b.target.nodeName) && b.target.type !== "text")) return;
62
- var e = b.type !== "keypress" && a.hotkeys.specialKeys[b.which], f = String.fromCharCode(b.which).toLowerCase(), g, h = "", i = {};
63
- b.altKey && e !== "alt" && (h += "alt+"), b.ctrlKey && e !== "ctrl" && (h += "ctrl+"), b.metaKey && !b.ctrlKey && e !== "meta" && (h += "meta+"), b.shiftKey && e !== "shift" && (h += "shift+"), e ? i[h + e] = !0 : (i[h + f] = !0, i[h + a.hotkeys.shiftNums[f]] = !0, h === "shift+" && (i[a.hotkeys.shiftNums[f]] = !0));
64
- for (var j = 0, k = d.length; j < k; j++) if (i[d[j]]) return c.apply(this, arguments);
65
- };
66
- }
67
- a.hotkeys = {
68
- version: "0.8",
69
- specialKeys: {
70
- 8: "backspace",
71
- 9: "tab",
72
- 13: "return",
73
- 16: "shift",
74
- 17: "ctrl",
75
- 18: "alt",
76
- 19: "pause",
77
- 20: "capslock",
78
- 27: "esc",
79
- 32: "space",
80
- 33: "pageup",
81
- 34: "pagedown",
82
- 35: "end",
83
- 36: "home",
84
- 37: "left",
85
- 38: "up",
86
- 39: "right",
87
- 40: "down",
88
- 45: "insert",
89
- 46: "del",
90
- 96: "0",
91
- 97: "1",
92
- 98: "2",
93
- 99: "3",
94
- 100: "4",
95
- 101: "5",
96
- 102: "6",
97
- 103: "7",
98
- 104: "8",
99
- 105: "9",
100
- 106: "*",
101
- 107: "+",
102
- 109: "-",
103
- 110: ".",
104
- 111: "/",
105
- 112: "f1",
106
- 113: "f2",
107
- 114: "f3",
108
- 115: "f4",
109
- 116: "f5",
110
- 117: "f6",
111
- 118: "f7",
112
- 119: "f8",
113
- 120: "f9",
114
- 121: "f10",
115
- 122: "f11",
116
- 123: "f12",
117
- 144: "numlock",
118
- 145: "scroll",
119
- 191: "/",
120
- 224: "meta"
121
- },
122
- shiftNums: {
123
- "`": "~",
124
- "1": "!",
125
- "2": "@",
126
- "3": "#",
127
- "4": "$",
128
- "5": "%",
129
- "6": "^",
130
- "7": "&",
131
- "8": "*",
132
- "9": "(",
133
- "0": ")",
134
- "-": "_",
135
- "=": "+",
136
- ";": ": ",
137
- "'": '"',
138
- ",": "<",
139
- ".": ">",
140
- "/": "?",
141
- "\\": "|"
142
- }
143
- }, a.each([ "keydown", "keyup", "keypress" ], function() {
144
- a.event.special[this] = {
145
- add: b
146
- };
147
- });
148
- })(jQuery);;
23
+ (function(a){function b(b){if(typeof b.data!="string")return;var c=b.handler,d=b.data.toLowerCase().split(" ");b.handler=function(b){if(!(this===b.target||!/textarea|select/i.test(b.target.nodeName)&&b.target.type!=="text"))return;var e=b.type!=="keypress"&&a.hotkeys.specialKeys[b.which],f=String.fromCharCode(b.which).toLowerCase(),g,h="",i={};b.altKey&&e!=="alt"&&(h+="alt+"),b.ctrlKey&&e!=="ctrl"&&(h+="ctrl+"),b.metaKey&&!b.ctrlKey&&e!=="meta"&&(h+="meta+"),b.shiftKey&&e!=="shift"&&(h+="shift+"),e?i[h+e]=!0:(i[h+f]=!0,i[h+a.hotkeys.shiftNums[f]]=!0,h==="shift+"&&(i[a.hotkeys.shiftNums[f]]=!0));for(var j=0,k=d.length;j<k;j++)if(i[d[j]])return c.apply(this,arguments)}}a.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}},a.each(["keydown","keyup","keypress"],function(){a.event.special[this]={add:b}})})(jQuery);
149
24
  /**
150
25
  * Fivefish Javascript
151
26
  * $Id$
@@ -160,148 +35,4 @@ jQuery && function(a) {
160
35
  * @version $Rev$
161
36
  * @requires bootstrap.modal.js
162
37
  */
163
- function initFivefish() {
164
- console.debug("Loaded. Waiting for DOM to be ready."), $(document).ready(onReady);
165
- }
166
-
167
- function hookTooltips() {
168
- $("header.hero-unit h1").popover({
169
- placement: "right"
170
- });
171
- }
172
-
173
- function hookKeyboardShortcuts() {
174
- $.each(keyboardShortcuts, function(a, b) {
175
- console.debug("Registering shortcut: %s -> %o", a, b), $("body").bind("keyup", a, b);
176
- });
177
- }
178
-
179
- function hookSourceToggles() {
180
- $("div.method header i").click(function(a) {
181
- var b = a.target, c = $(b).parents("div").get(0), d = $(c).find("div.method-source-code");
182
- console.debug("Toggling: %o", d), d.fadeToggle();
183
- });
184
- }
185
-
186
- function doIncrementalSearch() {}
187
-
188
- function hookSearchOverlay() {
189
- console.debug("Setting up searchbox"), $("#incremental-search").searchbox(SearchIndex), $("#search-button").click(function() {
190
- $("#incremental-search").searchbox("show");
191
- });
192
- }
193
-
194
- function onReady() {
195
- console.debug("Ready!"), hookTooltips(), hookKeyboardShortcuts(), hookSourceToggles(), hookSearchOverlay();
196
- }
197
-
198
- (function(a) {
199
- "use strict";
200
- var b = function(a, b, c) {
201
- this.init(a, b, c);
202
- };
203
- b.prototype = a.extend({}, a.fn.modal.Constructor.prototype, {
204
- constructor: b,
205
- searchTimeout: null,
206
- data: [],
207
- relPrefix: ".",
208
- init: function(b, c, d) {
209
- this.$element = a(b), this.$input = this.$element.find(".search-input"), this.$meth_list = this.$element.find(".method-search-results dl"), this.$mod_list = this.$element.find(".module-search-results dl"), this.$file_list = this.$element.find(".file-search-results dl"), this.options = d, this.data = c, this.relPrefix = a("link[rel=prefix]").attr("href"), this.$element.on("shown", a.proxy(this.shown, this)).on("hide", a.proxy(this.hided, this)).on("search", a.proxy(this.startSearch, this)).on("clear", a.proxy(this.clearSearch, this));
210
- },
211
- shown: function() {
212
- console.debug("Listening for keyboard input."), a(document).on("keypress", a.proxy(this.keypress, this)).on("keyup", a.proxy(this.keyup, this)), (a.browser.webkit || a.browser.msie) && a(document).on("keydown", a.proxy(this.keypress, this));
213
- },
214
- hided: function(b) {
215
- console.debug("Done listening for keyboard input."), a(document).off("keypress keyup keydown");
216
- },
217
- keyup: function(a) {
218
- var b = a.which, c = a.shiftKey;
219
- console.debug("Keycode: %d, shifted: %o", b, c);
220
- if (a.ctrlKey) switch (b) {
221
- case 85:
222
- this.$element.trigger("clear");
223
- } else if (b >= 65 && b <= 90 || b == 32 || b >= 48 && b <= 57) {
224
- var d = String.fromCharCode(b);
225
- c || (d = d.toLowerCase()), this.$input.append(d), this.$element.trigger("search");
226
- } else switch (b) {
227
- case 27:
228
- this.hide();
229
- break;
230
- case 8:
231
- this.$input.html(this.$input.html().slice(0, -1)), this.$element.trigger("search");
232
- }
233
- a.stopPropagation(), a.preventDefault();
234
- },
235
- keypress: function(a) {
236
- console.debug("Keypress event: %o", a);
237
- },
238
- clearSearch: function() {
239
- console.debug("Clearing the search input."), this.$input.html(""), this.$element.trigger("search");
240
- },
241
- startSearch: function(a) {
242
- var b = this;
243
- this.searchTimeout && (console.debug("Interrupting a previous search."), clearTimeout(this.searchTimeout)), console.debug("Scheduling a search..."), this.searchTimeout = setTimeout(function() {
244
- b.search();
245
- }, 500);
246
- },
247
- search: function() {
248
- var b = this.$input.html();
249
- console.debug("Searching for: '%s'!", b);
250
- if (b == "") this.displayMatches(this.data); else {
251
- var c = new RegExp(b, "i");
252
- console.debug(" pattern is: %s", c);
253
- var d = a.grep(this.data, function(a) {
254
- return console.debug(" testing: %s", a.name), c.test(a.name);
255
- });
256
- this.displayMatches(d, c);
257
- }
258
- },
259
- displayMatches: function(b, c) {
260
- var d = 0, e = 0, f = 0, g = 5, h, i = this;
261
- this.$element.find(".search-results dl").empty(), console.debug("Sorting %d matching items...", b.length), a.each(b, function(b, j) {
262
- h = null;
263
- switch (j.type) {
264
- case "anymethod":
265
- d < g && (console.debug(" adding method '%s'", j.name), h = i.$meth_list, d++);
266
- break;
267
- case "normalclass":
268
- case "normalmodule":
269
- e < g && (console.debug(" adding mod '%s'", j.name), h = i.$mod_list, e++);
270
- break;
271
- case "toplevel":
272
- f < g && (console.debug(" adding file '%s'", j.name), h = i.$file_list, f++);
273
- break;
274
- default:
275
- console.debug("ignoring unknown item '%s'", j.type);
276
- }
277
- if (h) {
278
- var k;
279
- c ? k = j.name.replace(c, '<span class="highlight">$&</span>') : k = j.name, a("<a>").attr("href", i.relPrefix + "/" + j.link).html(k).wrap("<dt>").appendTo(h), a("<dd>").html(j.snippet).appendTo(h);
280
- } else console.debug(" no more room for %s '%s'", j.type, j.name);
281
- });
282
- },
283
- blur: function(a) {
284
- var b = this;
285
- setTimeout(function() {
286
- b.hide();
287
- }, 150);
288
- },
289
- click: function(a) {
290
- a.stopPropagation(), a.preventDefault(), this.select();
291
- }
292
- }), a.fn.searchbox = function(c, d) {
293
- return this.each(function() {
294
- var e = a(this), f = e.data("searchbox"), g = typeof c == "object" ? c : [], h = a.extend({}, a.fn.modal.defaults, e.data(), typeof d == "object" && d);
295
- f || (console.debug("Creating a new searchbox for data: %s", typeof g), f = new b(this, g, h), e.data("searchbox", f)), typeof c == "string" && f[c]();
296
- });
297
- }, a.fn.searchbox.Constructor = b, a.fn.searchbox.defaults = a.extend({}, a.fn.modal.defaults);
298
- })(window.jQuery);
299
-
300
- var keyboardShortcuts = {
301
- "/": function(a) {
302
- $("#incremental-search").searchbox("show");
303
- },
304
- "shift+/": function(a) {
305
- $("#shortcut-help").modal();
306
- }
307
- };;
38
+ function initFivefish(){console.debug("Loaded. Waiting for DOM to be ready."),$(document).ready(onReady)}function hookTooltips(){$("header.hero-unit h1").popover({placement:"right"})}function hookKeyboardShortcuts(){$.each(keyboardShortcuts,function(a,b){console.debug("Registering shortcut: %s -> %o",a,b),$("body").bind("keyup",a,b)})}function hookSourceToggles(){$("div.method header i").click(function(a){var b=a.target,c=$(b).parents("div").get(0),d=$(c).find("div.method-source-code");console.debug("Toggling: %o",d),d.fadeToggle()})}function doIncrementalSearch(){}function hookSearchOverlay(){console.debug("Setting up searchbox"),$("#incremental-search").searchbox(SearchIndex),$("#search-button").click(function(){$("#incremental-search").searchbox("show")})}function onReady(){console.debug("Ready!"),hookTooltips(),hookKeyboardShortcuts(),hookSourceToggles(),hookSearchOverlay()}(function(a){"use strict";var b=function(a,b,c){this.init(a,b,c)};b.prototype=a.extend({},a.fn.modal.Constructor.prototype,{constructor:b,searchTimeout:null,data:[],relPrefix:".",init:function(b,c,d){this.$element=a(b),this.$input=this.$element.find(".search-input"),this.$meth_list=this.$element.find(".method-search-results dl"),this.$mod_list=this.$element.find(".module-search-results dl"),this.$file_list=this.$element.find(".file-search-results dl"),this.options=d,this.data=c,this.relPrefix=a("link[rel=prefix]").attr("href"),this.$element.on("shown",a.proxy(this.shown,this)).on("hide",a.proxy(this.hided,this)).on("search",a.proxy(this.startSearch,this)).on("clear",a.proxy(this.clearSearch,this))},shown:function(){console.debug("Listening for keyboard input."),a(document).on("keypress",a.proxy(this.keypress,this)).on("keyup",a.proxy(this.keyup,this)),(a.browser.webkit||a.browser.msie)&&a(document).on("keydown",a.proxy(this.keypress,this))},hided:function(b){console.debug("Done listening for keyboard input."),a(document).off("keypress keyup keydown")},keyup:function(a){var b=a.which,c=a.shiftKey;console.debug("Keycode: %d, shifted: %o",b,c);if(a.ctrlKey)switch(b){case 85:this.$element.trigger("clear")}else if(b>=65&&b<=90||b==32||b>=48&&b<=57){var d=String.fromCharCode(b);c||(d=d.toLowerCase()),this.$input.append(d),this.$element.trigger("search")}else switch(b){case 27:this.hide();break;case 8:this.$input.html(this.$input.html().slice(0,-1)),this.$element.trigger("search")}a.stopPropagation(),a.preventDefault()},keypress:function(a){console.debug("Keypress event: %o",a)},clearSearch:function(){console.debug("Clearing the search input."),this.$input.html(""),this.$element.trigger("search")},startSearch:function(a){var b=this;this.searchTimeout&&(console.debug("Interrupting a previous search."),clearTimeout(this.searchTimeout)),console.debug("Scheduling a search..."),this.searchTimeout=setTimeout(function(){b.search()},500)},search:function(){var b=this.$input.html();console.debug("Searching for: '%s'!",b);if(b=="")this.displayMatches(this.data);else{var c=new RegExp(b,"i");console.debug(" pattern is: %s",c);var d=a.grep(this.data,function(a){return console.debug(" testing: %s",a.name),c.test(a.name)});this.displayMatches(d,c)}},displayMatches:function(b,c){var d=0,e=0,f=0,g=5,h,i=this;this.$element.find(".search-results dl").empty(),console.debug("Sorting %d matching items...",b.length),a.each(b,function(b,j){h=null;switch(j.type){case"anymethod":d<g&&(console.debug(" adding method '%s'",j.name),h=i.$meth_list,d++);break;case"normalclass":case"normalmodule":e<g&&(console.debug(" adding mod '%s'",j.name),h=i.$mod_list,e++);break;case"toplevel":f<g&&(console.debug(" adding file '%s'",j.name),h=i.$file_list,f++);break;default:console.debug("ignoring unknown item '%s'",j.type)}if(h){var k;c?k=j.name.replace(c,'<span class="highlight">$&</span>'):k=j.name,a("<a>").attr("href",i.relPrefix+"/"+j.link).html(k).wrap("<dt>").appendTo(h),a("<dd>").html(j.snippet).appendTo(h)}else console.debug(" no more room for %s '%s'",j.type,j.name)})},blur:function(a){var b=this;setTimeout(function(){b.hide()},150)},click:function(a){a.stopPropagation(),a.preventDefault(),this.select()}}),a.fn.searchbox=function(c,d){return this.each(function(){var e=a(this),f=e.data("searchbox"),g=typeof c=="object"?c:[],h=a.extend({},a.fn.modal.defaults,e.data(),typeof d=="object"&&d);f||(console.debug("Creating a new searchbox for data: %s",typeof g),f=new b(this,g,h),e.data("searchbox",f)),typeof c=="string"&&f[c]()})},a.fn.searchbox.Constructor=b,a.fn.searchbox.defaults=a.extend({},a.fn.modal.defaults)})(window.jQuery);var keyboardShortcuts={"/":function(a){$("#incremental-search").searchbox("show")},"shift+/":function(a){$("#shortcut-help").modal()}};