1
0
Fork 0
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:
codedread 2017-02-19 09:26:06 -08:00
parent 0061459c95
commit 17404501e5

View file

@ -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>';
};