mirror of
https://github.com/codedread/bitjs
synced 2025-10-05 18:34:17 +02:00
Move querySelector shortcut into muther namespace and touchup license boilerplate
This commit is contained in:
parent
0061459c95
commit
17404501e5
1 changed files with 6 additions and 5 deletions
11
muther.js
11
muther.js
|
@ -1,17 +1,18 @@
|
|||
/**
|
||||
* Mini Unit Test Harness
|
||||
* Copyright(c) 2014, Google Inc.
|
||||
* Minimal Unit Test Harness
|
||||
*
|
||||
* A really tiny unit test harness.
|
||||
* Licensed under the MIT License
|
||||
*
|
||||
* Copyright(c) 2014, Google Inc.
|
||||
*/
|
||||
var muther = muther || {};
|
||||
|
||||
var $ = function(s) { return document.querySelector(s) || {}; }
|
||||
muther.$ = function(s) { return document.querySelector(s) || {}; }
|
||||
muther.assert = function(cond, err) { if (!cond) { throw err; } };
|
||||
muther.assertEquals = function(a, b, err) { muther.assert(a === b, err); };
|
||||
|
||||
muther.set_ = function(id, style, innerHTML) {
|
||||
$('#' + id).innerHTML = '';
|
||||
muther.$('#' + id).innerHTML = '';
|
||||
document.body.innerHTML += '<div id="' + id + '" style="' + style + '">' + innerHTML + '</div>';
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue