(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 1.0.0']; helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; var buffer = "", stack1, helper, functionType="function", escapeExpression=this.escapeExpression; buffer += "
\n

\n "; if (helper = helpers.name) { stack1 = helper.call(depth0, {hash:{},data:data}); } else { helper = (depth0 && depth0.name); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } buffer += escapeExpression(stack1) + "\n v"; if (helper = helpers.version) { stack1 = helper.call(depth0, {hash:{},data:data}); } else { helper = (depth0 && depth0.version); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } buffer += escapeExpression(stack1) + "\n
By: " + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0._npmUser)),stack1 == null || stack1 === false ? stack1 : stack1.name)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1)) + "
\n

\n

"; if (helper = helpers.description) { stack1 = helper.call(depth0, {hash:{},data:data}); } else { helper = (depth0 && depth0.description); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } buffer += escapeExpression(stack1) + "

\n
"; return buffer; }); },{"handlebars/runtime":12}],2:[function(require,module,exports){ var $ = require('unopinionate').selector, onClick = require('onclick'), transitionComplete = require('transition-complete'); $(function() { onClick('.entry .name', function() { var $this = $(this), $entry = $this.closest('.entry'); //Close entry if($entry.hasClass('open')) { $entry .height($entry.height()) .removeClass('open'); setTimeout(function() { $entry.css('height', $entry.attr('data-height') + 'px'); }, 0); transitionComplete(function() { $entry.find('.readme').remove(); $entry.css('height', 'auto'); }); } //Open entry else { //Close open entries $('.entry.open').each(function() { var $entry = $(this); $entry .height($entry.height()) .removeClass('open'); setTimeout(function() { $entry.css('height', $entry.attr('data-height') + 'px'); }, 0); transitionComplete(function() { $entry.find('.readme').remove(); $entry.css('height', 'auto'); }); }); //Add the open class $entry.addClass('open'); //Explicitly set heights for transitions var height = $entry.height(); $entry .attr('data-height', height) .css('height', height); //Get the data $.ajax({ url: '/-/readme/'+$entry.attr('data-name')+'/'+$entry.attr('data-version'), dataType: 'text', success: function(html) { var $readme = $("
") .html(html) .appendTo($entry); $entry.height(height + $readme.outerHeight()); transitionComplete(function() { $entry.css('height', 'auto'); }); } }); } }); }); },{"onclick":13,"transition-complete":15,"unopinionate":16}],3:[function(require,module,exports){ var $ = require('unopinionate').selector, onScroll = require('onscroll'); $(function() { var $header = $('header'), $content = $('#content'), bottomOffset = 52; var scrollFunc = function(top) { var limit = $header.outerHeight() - bottomOffset; if(top < 0) { $header.css('top', 0); } else if(top > limit) { $header.css('top', -limit + 'px'); } else { $header.css('top', -top + 'px'); } }; onScroll(scrollFunc); scrollFunc(); $(window).resize(function() { $content.css('margin-top', $header.outerHeight()); }).resize(); }); },{"onscroll":14,"unopinionate":16}],4:[function(require,module,exports){ require('./search'); require('./entry'); require('./header'); },{"./entry":2,"./header":3,"./search":5}],5:[function(require,module,exports){ var $ = require('unopinionate').selector, template = require('../entry.hbs'), onScroll = require('onscroll'); $(function() { 'use strict'; var $form = $('#search-form'), $input = $form.find('input'), $searchResults = $("#search-results"), $body = $('body'), $clear = $form.find('.clear'), request, currentResults; $form.bind('submit keyup', function(e) { e.preventDefault(); var q = $input.val(); $body.addClass('state-search'); //Switch the icons $clear [q ? 'addClass' : 'removeClass']('icon-cancel') [!q ? 'addClass' : 'removeClass']('icon-search'); if(q) { if(request) { request.abort(); } if(!currentResults) { $searchResults.html("Spinner"); } request = $.getJSON('/-/search/' + q, function(results) { currentResults = results; if(results.length) { var html = ''; $.each(results, function(i, entry) { html += template(entry); }); $searchResults.html(html); } else { $searchResults.html("
No Results
"); } }); } else { request.abort(); currentResults = null; $searchResults.html(''); $body.removeClass('state-search'); } }); $clear.click(function(e) { e.preventDefault(); $input.val(''); $form.keyup(); }); }); },{"../entry.hbs":1,"onscroll":14,"unopinionate":16}],6:[function(require,module,exports){ "use strict"; /*globals Handlebars: true */ var base = require("./handlebars/base"); // Each of these augment the Handlebars object. No need to setup here. // (This is done to easily share code between commonjs and browse envs) var SafeString = require("./handlebars/safe-string")["default"]; var Exception = require("./handlebars/exception")["default"]; var Utils = require("./handlebars/utils"); var runtime = require("./handlebars/runtime"); // For compatibility and usage outside of module systems, make the Handlebars object a namespace var create = function() { var hb = new base.HandlebarsEnvironment(); Utils.extend(hb, base); hb.SafeString = SafeString; hb.Exception = Exception; hb.Utils = Utils; hb.VM = runtime; hb.template = function(spec) { return runtime.template(spec, hb); }; return hb; }; var Handlebars = create(); Handlebars.create = create; exports["default"] = Handlebars; },{"./handlebars/base":7,"./handlebars/exception":8,"./handlebars/runtime":9,"./handlebars/safe-string":10,"./handlebars/utils":11}],7:[function(require,module,exports){ "use strict"; var Utils = require("./utils"); var Exception = require("./exception")["default"]; var VERSION = "1.3.0"; exports.VERSION = VERSION;var COMPILER_REVISION = 4; exports.COMPILER_REVISION = COMPILER_REVISION; var REVISION_CHANGES = { 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it 2: '== 1.0.0-rc.3', 3: '== 1.0.0-rc.4', 4: '>= 1.0.0' }; exports.REVISION_CHANGES = REVISION_CHANGES; var isArray = Utils.isArray, isFunction = Utils.isFunction, toString = Utils.toString, objectType = '[object Object]'; function HandlebarsEnvironment(helpers, partials) { this.helpers = helpers || {}; this.partials = partials || {}; registerDefaultHelpers(this); } exports.HandlebarsEnvironment = HandlebarsEnvironment;HandlebarsEnvironment.prototype = { constructor: HandlebarsEnvironment, logger: logger, log: log, registerHelper: function(name, fn, inverse) { if (toString.call(name) === objectType) { if (inverse || fn) { throw new Exception('Arg not supported with multiple helpers'); } Utils.extend(this.helpers, name); } else { if (inverse) { fn.not = inverse; } this.helpers[name] = fn; } }, registerPartial: function(name, str) { if (toString.call(name) === objectType) { Utils.extend(this.partials, name); } else { this.partials[name] = str; } } }; function registerDefaultHelpers(instance) { instance.registerHelper('helperMissing', function(arg) { if(arguments.length === 2) { return undefined; } else { throw new Exception("Missing helper: '" + arg + "'"); } }); instance.registerHelper('blockHelperMissing', function(context, options) { var inverse = options.inverse || function() {}, fn = options.fn; if (isFunction(context)) { context = context.call(this); } if(context === true) { return fn(this); } else if(context === false || context == null) { return inverse(this); } else if (isArray(context)) { if(context.length > 0) { return instance.helpers.each(context, options); } else { return inverse(this); } } else { return fn(context); } }); instance.registerHelper('each', function(context, options) { var fn = options.fn, inverse = options.inverse; var i = 0, ret = "", data; if (isFunction(context)) { context = context.call(this); } if (options.data) { data = createFrame(options.data); } if(context && typeof context === 'object') { if (isArray(context)) { for(var j = context.length; i": ">", '"': """, "'": "'", "`": "`" }; var badChars = /[&<>"'`]/g; var possible = /[&<>"'`]/; function escapeChar(chr) { return escape[chr] || "&"; } function extend(obj, value) { for(var key in value) { if(Object.prototype.hasOwnProperty.call(value, key)) { obj[key] = value[key]; } } } exports.extend = extend;var toString = Object.prototype.toString; exports.toString = toString; // Sourced from lodash // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt var isFunction = function(value) { return typeof value === 'function'; }; // fallback for older versions of Chrome and Safari if (isFunction(/x/)) { isFunction = function(value) { return typeof value === 'function' && toString.call(value) === '[object Function]'; }; } var isFunction; exports.isFunction = isFunction; var isArray = Array.isArray || function(value) { return (value && typeof value === 'object') ? toString.call(value) === '[object Array]' : false; }; exports.isArray = isArray; function escapeExpression(string) { // don't escape SafeStrings, since they're already safe if (string instanceof SafeString) { return string.toString(); } else if (!string && string !== 0) { return ""; } // Force a string conversion as this will be done by the append regardless and // the regex test will do this transparently behind the scenes, causing issues if // an object's to string has escaped characters in it. string = "" + string; if(!possible.test(string)) { return string; } return string.replace(badChars, escapeChar); } exports.escapeExpression = escapeExpression;function isEmpty(value) { if (!value && value !== 0) { return true; } else if (isArray(value) && value.length === 0) { return true; } else { return false; } } exports.isEmpty = isEmpty; },{"./safe-string":10}],12:[function(require,module,exports){ // Create a simple path alias to allow browserify to resolve // the runtime on a supported path. module.exports = require('./dist/cjs/handlebars.runtime'); },{"./dist/cjs/handlebars.runtime":6}],13:[function(require,module,exports){ var $ = require('unopinionate').selector; var $document = $(document), bindings = {}; var click = function(events) { click.bind.apply(click, arguments); return click; }; /*** Configuration Options ***/ click.distanceLimit = 10; click.timeLimit = 140; /*** Useful Properties ***/ click.isTouch = ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch; /*** Cached Functions ***/ var onTouchstart = function(e) { e.stopPropagation(); //Prevents multiple click events from happening click._doAnywheres(e); var $this = $(this), startTime = new Date().getTime(), startPos = click._getPos(e); $this.one('touchend', function(e) { e.preventDefault(); //Prevents click event from firing var time = new Date().getTime() - startTime, endPos = click._getPos(e), distance = Math.sqrt( Math.pow(endPos.x - startPos.x, 2) + Math.pow(endPos.y - startPos.y, 2) ); if(time < click.timeLimit && distance < click.distanceLimit) { //Find the correct callback $.each(bindings, function(selector, callback) { if($this.is(selector)) { callback.apply(e.target, [e]); return false; } }); } }); }; /*** API ***/ click.bind = function(events) { //Argument Surgery if(!$.isPlainObject(events)) { newEvents = {}; newEvents[arguments[0]] = arguments[1]; events = newEvents; } $.each(events, function(selector, callback) { /*** Register Binding ***/ if(typeof bindings[selector] != 'undefined') { click.unbind(selector); //Ensure no duplicates } bindings[selector] = callback; /*** Touch Support ***/ if(click.isTouch) { $document.delegate(selector, 'touchstart', onTouchstart); } /*** Mouse Support ***/ $document.delegate(selector, 'click', function(e) { e.stopPropagation(); //Prevents multiple click events from happening //click._doAnywheres(e); //Do anywheres first to be consistent with touch order callback.apply(this, [e]); }); }); return this; }; click.unbind = function(selector) { $document .undelegate(selector, 'touchstart') .undelegate(selector, 'click'); delete bindings[selector]; return this; }; click.unbindAll = function() { $.each(bindings, function(selector, callback) { $document .undelegate(selector, 'touchstart') .undelegate(selector, 'click'); }); bindings = {}; return this; }; click.trigger = function(selector, e) { e = e || $.Event('click'); if(typeof bindings[selector] != 'undefined') { bindings[selector](e); } else { console.error("No click events bound for selector '"+selector+"'."); } return this; }; click.anywhere = function(callback) { click._anywheres.push(callback); return this; }; /*** Internal (but useful) Methods ***/ click._getPos = function(e) { e = e.originalEvent; if(e.pageX || e.pageY) { return { x: e.pageX, y: e.pageY }; } else if(e.changedTouches) { return { x: e.changedTouches[0].clientX, y: e.changedTouches[0].clientY }; } else { return { x: e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft, y: e.clientY + document.body.scrollTop + document.documentElement.scrollTop }; } }; click._anywheres = []; click._doAnywheres = function(e) { var i = click._anywheres.length; while(i--) { click._anywheres[i](e); } }; $(document).bind('mousedown', click._doAnywheres); module.exports = click; },{"unopinionate":16}],14:[function(require,module,exports){ var $ = require('unopinionate').selector; var bodyScrollers = []; $(function() { var $html = $('html'), $body = $('body'); $(window, document, 'body').bind('scroll touchmove', function() { var top = $html[0].scrollTop || $body[0].scrollTop; for(var i=0; i