* Remove un-used function and prevent jQuery confusion

This commit is contained in:
ryanbrandenburg 2015-11-18 10:27:21 -08:00
parent da7fe362c9
commit c49547245b
3 changed files with 16 additions and 33 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
(function (window, undefined) { (function (window, undefined) {
"use strict"; "use strict";
function $(selector, element) { function ns(selector, element) {
return new NodeCollection(selector, element); return new NodeCollection(selector, element);
} }
@ -16,10 +16,6 @@
for (var i = 0, l = nodeList.length; i < l; i++) { for (var i = 0, l = nodeList.length; i < l; i++) {
this.items.push(nodeList.item(i)); this.items.push(nodeList.item(i));
} }
} else if (selector.tagName) {
this.items.push(selector);
} else if (selector.splice) {
this.items = this.items.concat(selector);
} }
} }
@ -35,10 +31,10 @@
var children = []; var children = [];
this.each(function (el) { this.each(function (el) {
children = children.concat($(selector, el).items); children = children.concat(ns(selector, el).items);
}); });
return $(children); return ns(children);
}, },
hide: function () { hide: function () {
@ -101,19 +97,6 @@
return this; return this;
}, },
toggleClass: function (className) {
this.each(function (el) {
var classNames = el.className.split(" ");
if (classNames.indexOf(className) >= 0) {
$(el).removeClass(className);
} else {
$(el).addClass(className);
}
});
return this;
},
attr: function (name) { attr: function (name) {
if (this.items.length === 0) { if (this.items.length === 0) {
return null; return null;
@ -154,22 +137,22 @@
}; };
function frame(el) { function frame(el) {
$(el).children(".source .collapsible").toggle(); ns(el).children(".source .collapsible").toggle();
} }
function tab(el) { function tab(el) {
var unselected = $("#header .selected").removeClass("selected").attr("id"); var unselected = ns("#header .selected").removeClass("selected").attr("id");
var selected = $(el).addClass("selected").attr("id"); var selected = ns(el).addClass("selected").attr("id");
$("#" + unselected + "page").hide(); ns("#" + unselected + "page").hide();
$("#" + selected + "page").show(); ns("#" + selected + "page").show();
} }
$(".collapsible").hide(); ns(".collapsible").hide();
$(".page").hide(); ns(".page").hide();
$("#stackpage").show(); ns("#stackpage").show();
$("#rawExceptionButton").click(function (event) { ns("#rawExceptionButton").click(function (event) {
var div = document.getElementById('rawException'); var div = document.getElementById('rawException');
div.style.display = 'inline-block'; div.style.display = 'inline-block';
div.scrollIntoView(true); div.scrollIntoView(true);
@ -179,7 +162,7 @@
return false; return false;
}); });
$(".frame") ns(".frame")
.click(function () { .click(function () {
frame(this); frame(this);
}) })
@ -189,7 +172,7 @@
} }
}); });
$("#header li") ns("#header li")
.click(function () { .click(function () {
tab(this); tab(this);
}) })