templates/default/fulldoc/html/js/app.js in yard-0.6.8 vs templates/default/fulldoc/html/js/app.js in yard-0.7.0
- old
+ new
@@ -21,11 +21,11 @@
$(this).text("(less)");
},
function() {
$(this).prev().hide();
$(this).parent().prev().height(tHeight);
- $(this).text("more...")
+ $(this).text("more...");
});
}
function createFullTreeLinks() {
var tHeight = 0;
@@ -36,11 +36,11 @@
$(this).parent().prev().height($(this).parent().height());
},
function() {
$(this).parent().toggleClass('showAll');
$(this).parent().prev().height(tHeight);
- $(this).text("show all")
+ $(this).text("show all");
});
}
function fixBoxInfoHeights() {
$('dl.box dd.r1, dl.box dd.r2').each(function() {
@@ -91,17 +91,18 @@
function keyboardShortcuts() {
if (window.top.frames.main) return;
$(document).keypress(function(evt) {
if (evt.altKey || evt.ctrlKey || evt.metaKey || evt.shiftKey) return;
- if (typeof evt.orignalTarget !== "undefined" &&
- (evt.originalTarget.nodeName == "INPUT" ||
- evt.originalTarget.nodeName == "TEXTAREA")) return;
+ if (typeof evt.target !== "undefined" &&
+ (evt.target.nodeName == "INPUT" ||
+ evt.target.nodeName == "TEXTAREA")) return;
switch (evt.charCode) {
case 67: case 99: $('#class_list_link').click(); break; // 'c'
case 77: case 109: $('#method_list_link').click(); break; // 'm'
case 70: case 102: $('#file_list_link').click(); break; // 'f'
+ default: break;
}
});
}
function summaryToggle() {
@@ -137,35 +138,36 @@
if (window.location.host != this.host) this.target = '_parent';
});
}
function generateTOC() {
- if ($('#filecontents').length == 0) return;
+ if ($('#filecontents').length === 0) return;
var _toc = $('<ol class="top"></ol>');
var show = false;
var toc = _toc;
var counter = 0;
var tags = ['h2', 'h3', 'h4', 'h5', 'h6'];
+ var i;
if ($('#filecontents h1').length > 1) tags.unshift('h1');
- for (i in tags) { tags[i] = '#filecontents ' + tags[i] }
- var lastTag = parseInt(tags[0][1]);
+ for (i = 0; i < tags.length; i++) { tags[i] = '#filecontents ' + tags[i]; }
+ var lastTag = parseInt(tags[0][1], 10);
$(tags.join(', ')).each(function() {
if (this.id == "filecontents") return;
show = true;
- var thisTag = parseInt(this.tagName[1]);
- if (this.id.length == 0) {
+ var thisTag = parseInt(this.tagName[1], 10);
+ if (this.id.length === 0) {
var proposedId = $(this).text().replace(/[^a-z0-9-]/ig, '_');
- if ($('#' + proposedId).length > 0) proposedId += counter++;
+ if ($('#' + proposedId).length > 0) { proposedId += counter; counter++; }
this.id = proposedId;
}
if (thisTag > lastTag) {
- for (var i = 0; i < thisTag - lastTag; i++) {
+ for (i = 0; i < thisTag - lastTag; i++) {
var tmp = $('<ol/>'); toc.append(tmp); toc = tmp;
}
}
if (thisTag < lastTag) {
- for (var i = 0; i < lastTag - thisTag; i++) toc = toc.parent();
+ for (i = 0; i < lastTag - thisTag; i++) toc = toc.parent();
}
toc.append('<li><a href="#' + this.id + '">' + $(this).text() + '</a></li>');
lastTag = thisTag;
});
if (!show) return;
@@ -183,10 +185,10 @@
});
$('#toc .float_toc').toggle(function() {
$(this).text('float');
$('#toc').toggleClass('nofloat');
}, function() {
- $(this).text('left')
+ $(this).text('left');
$('#toc').toggleClass('nofloat');
});
}
$(framesInit);
\ No newline at end of file