Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
safer hash reading
  • Loading branch information
mrclay authored and acidvertigo committed Mar 3, 2012
1 parent aeb8a2f commit f0c3714
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions min/builder/_index.js
Expand Up @@ -214,10 +214,19 @@ var MUB = {
if (location.hash) {
// make links out of URIs from bookmarklet
$('#getBm').hide();
$('#bmUris').html('<p><strong>Found by bookmarklet:</strong> /<a href=#>' +
location.hash.substr(1).split(',').join('</a> | /<a href=#>') +
'</a></p>'
);
var i = 0, found = location.hash.substr(1).split(','), l = found.length;
$('#bmUris').html('<p><strong>Found by bookmarklet:</strong> /</p>');
var $p = $('#bmUris p');
for (; i < l; i++) {
$p.append($('<a href=#></a>').text(found[i])[0]);
if (i < (l - 1)) {
$p.append(', /');
}
}
// $('#bmUris').html('<p><strong>Found by bookmarklet:</strong> /<a href=#>' +
// location.hash.substr(1).split(',').join('</a> | /<a href=#>') +
// '</a></p>'
// );
$('#bmUris a').click(function () {
MUB.addButtonClick();
$('#sources li:last input').val(this.innerHTML);
Expand Down

0 comments on commit f0c3714

Please sign in to comment.