diff --git a/lib/GUI/js/entry.js b/lib/GUI/js/entry.js index 75d83b863..afa384bea 100644 --- a/lib/GUI/js/entry.js +++ b/lib/GUI/js/entry.js @@ -52,7 +52,9 @@ $(function() { // Get the data $.ajax({ - url: '-/readme/'+$entry.attr('data-name')+'/'+$entry.attr('data-version'), + url: '-/readme/' + + encodeURIComponent($entry.attr('data-name')) + '/' + + encodeURIComponent($entry.attr('data-version')), dataType: 'text', success: function(html) { var $readme = $("
") diff --git a/lib/static/main.css b/lib/static/main.css index a44cbd56c..39d4d147c 100644 --- a/lib/static/main.css +++ b/lib/static/main.css @@ -7417,4 +7417,4 @@ Original style from softwaremaniacs.org (c) Ivan Sagalaev \n
\n
\n

\n "; + + "\">\n
\n
\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"; + + "\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

\n
\n
\n
\n By: " + + "\n

\n
\n
\n
\n By: " + escapeExpression(((stack1 = ((stack1 = (depth0 && depth0._npmUser)),stack1 == null || stack1 === false ? stack1 : stack1.name)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1)) - + "\n
\n
\n
\n
\n
\n

"; + + "\n

\n
\n
\n
\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
\n
\n\n"; + + "

\n \n \n\n"; return buffer; }); },{"handlebars/runtime":12}],2:[function(require,module,exports){ @@ -314,77 +314,79 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {}; }(jQuery); },{}],3:[function(require,module,exports){ -var $ = require('unopinionate').selector, - onClick = require('onclick'), - transitionComplete = require('transition-complete'); +var $ = require('unopinionate').selector +var onClick = require('onclick') +var transitionComplete = require('transition-complete') $(function() { - onClick('.entry .name', function() { - var $this = $(this), - $entry = $this.closest('.entry'); + onClick('.entry .name', function() { + var $this = $(this) + var $entry = $this.closest('.entry') - //Close entry - if($entry.hasClass('open')) { - $entry - .height($entry.outerHeight()) - .removeClass('open'); + if ($entry.hasClass('open')) { + // Close entry + $entry + .height($entry.outerHeight()) + .removeClass('open') - setTimeout(function() { - $entry.css('height', $entry.attr('data-height') + 'px'); - }, 0); + 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.outerHeight()) - .removeClass('open'); + transitionComplete(function() { + $entry.find('.readme').remove() + $entry.css('height', 'auto') + }) - setTimeout(function() { - $entry.css('height', $entry.attr('data-height') + 'px'); - }, 0); + } else { + // Open entry + $('.entry.open').each(function() { + // Close open entries + var $entry = $(this) + $entry + .height($entry.outerHeight()) + .removeClass('open') - transitionComplete(function() { - $entry.find('.readme').remove(); - $entry.css('height', 'auto'); - }); - }); + setTimeout(function() { + $entry.css('height', $entry.attr('data-height') + 'px') + }, 0) - //Add the open class - $entry.addClass('open'); + transitionComplete(function() { + $entry.find('.readme').remove() + $entry.css('height', 'auto') + }) + }) - //Explicitly set heights for transitions - var height = $entry.outerHeight(); - $entry - .attr('data-height', height) - .css('height', height); + // Add the open class + $entry.addClass('open') - //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); + // Explicitly set heights for transitions + var height = $entry.outerHeight() + $entry + .attr('data-height', height) + .css('height', height) - $entry.height(height + $readme.outerHeight()); + // Get the data + $.ajax({ + url: '-/readme/' + + encodeURIComponent($entry.attr('data-name')) + '/' + + encodeURIComponent($entry.attr('data-version')), + dataType: 'text', + success: function(html) { + var $readme = $("
") + .html(html) + .appendTo($entry) - transitionComplete(function() { - $entry.css('height', 'auto'); - }); - } - }); - } - }); -}); + $entry.height(height + $readme.outerHeight()) + + transitionComplete(function() { + $entry.css('height', 'auto') + }) + } + }) + } + }) +}) },{"onclick":13,"transition-complete":15,"unopinionate":16}],4:[function(require,module,exports){ // twitter bootstrap stuff; @@ -395,93 +397,92 @@ require('./bootstrap-modal') require('./search') require('./entry') +var $ = require('unopinionate').selector $(document).on('click', '.js-userLogoutBtn', function() { - $('#userLogoutForm').submit() - return false + $('#userLogoutForm').submit() + return false }) -},{"./bootstrap-modal":2,"./entry":3,"./search":5}],5:[function(require,module,exports){ -var $ = require('unopinionate').selector, - template = require('../entry.hbs'), - onScroll = require('onscroll'); +},{"./bootstrap-modal":2,"./entry":3,"./search":5,"unopinionate":16}],5:[function(require,module,exports){ +var $ = require('unopinionate').selector +var template = require('../entry.hbs') +var onScroll = require('onscroll') $(function() { - 'use strict'; + ;(function(window, document) { + var $form = $('#search-form') + var $input = $form.find('input') + var $body = $('body') + var $clear = $form.find('.clear') + var $searchResults = $('#search-results') + var $pkgListing = $('#all-packages') + var $searchBtn = $('.js-search-btn') + var request + var currentResults - (function( window, document ) { + var toggle = function(validQuery) { + $searchResults.toggleClass('show', validQuery) + $pkgListing.toggleClass('hide', validQuery) - var $form = $('#search-form'); - var $input = $form.find('input'); - var $body = $('body'); - var $clear = $form.find('.clear'); - var $searchResults = $("#search-results"); - var $pkgListing = $("#all-packages"); - var $searchBtn = $('.js-search-btn'); - var request; - var currentResults; + $searchBtn.find('i').toggleClass('icon-cancel', validQuery) + $searchBtn.find('i').toggleClass('icon-search', !validQuery) + } - var toggle = function( validQuery ) { - $searchResults.toggleClass( 'show', validQuery ); - $pkgListing.toggleClass( 'hide', validQuery ); + $form.bind('submit keyup', function(e) { + var q, qBool + e.preventDefault() - $searchBtn.find('i').toggleClass( 'icon-cancel', validQuery ); - $searchBtn.find('i').toggleClass( 'icon-search', !validQuery ); - }; + q = $input.val() + qBool = (q !== '') - $form.bind('submit keyup', function(e) { - var q, qBool; + toggle(qBool) - e.preventDefault(); + if (!qBool) { + if (request && typeof request.abort === 'function') { + request.abort() + } - q = $input.val(); - qBool = q !== ''; + currentResults = null + $searchResults.html('') + return + } - toggle( qBool ); + if (request && typeof request.abort === 'function') { + request.abort() + } - if( !qBool ) { - if( request && typeof request.abort === 'function' ) { - request.abort(); - } + if (!currentResults) { + $searchResults.html( + "Spinner") + } - currentResults = null; - $searchResults.html(''); - return; - } + request = $.getJSON('-/search/' + q, function( results ) { + currentResults = results - if( request && typeof request.abort === 'function' ) { - request.abort(); - } + if (results.length > 0) { + var html = '' - if( !currentResults ) { - $searchResults.html( "Spinner" ); - } + $.each(results, function(i, entry) { + html += template(entry) + }) - request = $.getJSON('-/search/' + q, function( results ) { - currentResults = results; + $searchResults.html(html) + } else { + $searchResults.html( + "
No Results
") + } + }) + }) - if( results.length > 0 ) { - var html = ''; + $(document).on('click', '.icon-cancel', function(e) { + e.preventDefault() + $input.val('') + $form.keyup() + }) - $.each(results, function( i, entry ) { - html += template( entry ); - }); - - $searchResults.html(html); - } else { - $searchResults.html("
No Results
"); - } - }); - }); - - $( document ).on( 'click', '.icon-cancel', function( e ) { - e.preventDefault(); - $input.val(''); - $form.keyup(); - }); - - })( window, window.document ); -}); + })(window, window.document) +}) },{"../entry.hbs":1,"onscroll":14,"unopinionate":16}],6:[function(require,module,exports){ "use strict";