mirror of
https://github.com/vrana/adminer.git
synced 2025-08-08 15:47:00 +02:00
Make context in qsa() optional
This commit is contained in:
@@ -34,7 +34,7 @@ function bodyLoad(version, maria) {
|
|||||||
jush.custom_links = jushLinks;
|
jush.custom_links = jushLinks;
|
||||||
}
|
}
|
||||||
jush.highlight_tag('code', 0);
|
jush.highlight_tag('code', 0);
|
||||||
var tags = qsa('textarea', document);
|
var tags = qsa('textarea');
|
||||||
for (var i = 0; i < tags.length; i++) {
|
for (var i = 0; i < tags.length; i++) {
|
||||||
if (/(^|\s)jush-/.test(tags[i].className)) {
|
if (/(^|\s)jush-/.test(tags[i].className)) {
|
||||||
var pre = jush.textarea(tags[i]);
|
var pre = jush.textarea(tags[i]);
|
||||||
@@ -75,7 +75,7 @@ function typePassword(el, disable) {
|
|||||||
* @param [HTMLElement]
|
* @param [HTMLElement]
|
||||||
*/
|
*/
|
||||||
function messagesPrint(el) {
|
function messagesPrint(el) {
|
||||||
var els = qsa('.toggle', el || document);
|
var els = qsa('.toggle', el);
|
||||||
for (var i = 0; i < els.length; i++) {
|
for (var i = 0; i < els.length; i++) {
|
||||||
els[i].onclick = partial(toggle, els[i].getAttribute('href').substr(1));
|
els[i].onclick = partial(toggle, els[i].getAttribute('href').substr(1));
|
||||||
}
|
}
|
||||||
|
@@ -14,17 +14,17 @@ function qs(selector, context) {
|
|||||||
* @return HTMLElement
|
* @return HTMLElement
|
||||||
*/
|
*/
|
||||||
function qsl(selector, context) {
|
function qsl(selector, context) {
|
||||||
var els = qsa(selector, context || document);
|
var els = qsa(selector, context);
|
||||||
return els[els.length - 1];
|
return els[els.length - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get all elements by selector
|
/** Get all elements by selector
|
||||||
* @param string
|
* @param string
|
||||||
* @param HTMLElement
|
* @param [HTMLElement] defaults to document
|
||||||
* @return NodeList
|
* @return NodeList
|
||||||
*/
|
*/
|
||||||
function qsa(selector, context) {
|
function qsa(selector, context) {
|
||||||
return context.querySelectorAll(selector);
|
return (context || document).querySelectorAll(selector);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return a function calling fn with the next arguments
|
/** Return a function calling fn with the next arguments
|
||||||
@@ -205,7 +205,7 @@ function formCheck(name) {
|
|||||||
/** Check all rows in <table class="checkable">
|
/** Check all rows in <table class="checkable">
|
||||||
*/
|
*/
|
||||||
function tableCheck() {
|
function tableCheck() {
|
||||||
var inputs = qsa('table.checkable td:first-child input', document);
|
var inputs = qsa('table.checkable td:first-child input');
|
||||||
for (var i=0; i < inputs.length; i++) {
|
for (var i=0; i < inputs.length; i++) {
|
||||||
trCheck(inputs[i]);
|
trCheck(inputs[i]);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user