diff options
author | Lauri Ojansivu <x@xet7.org> | 2019-04-20 15:18:33 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2019-04-20 15:18:33 +0300 |
commit | 73e265d8fd050ae3daa67472b4465a5c49d68910 (patch) | |
tree | 677b233934a43d8f873e24c794ce289d85e3a9b7 /packages/markdown/marked/test/browser/test.js | |
parent | 6117097a93bfb11c8bd4c87a23c44a50e22ceb87 (diff) | |
download | wekan-73e265d8fd050ae3daa67472b4465a5c49d68910.tar.gz wekan-73e265d8fd050ae3daa67472b4465a5c49d68910.tar.bz2 wekan-73e265d8fd050ae3daa67472b4465a5c49d68910.zip |
Include to Wekan packages directory contents, so that meteor command would build all directly.
This also simplifies build scripts.
Thanks to xet7 !
Diffstat (limited to 'packages/markdown/marked/test/browser/test.js')
-rw-r--r-- | packages/markdown/marked/test/browser/test.js | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/packages/markdown/marked/test/browser/test.js b/packages/markdown/marked/test/browser/test.js new file mode 100644 index 00000000..59917dd4 --- /dev/null +++ b/packages/markdown/marked/test/browser/test.js @@ -0,0 +1,66 @@ + +;(function() { + var console = {}, + files = __TESTS__; // eslint-disable-line no-undef + + console.log = function(text) { + var args = Array.prototype.slice.call(arguments, 1), + i = 0; + + text = text.replace(/%\w/g, function() { + return args[i++] || ''; + }); + + if (window.console) window.console.log(text); + document.body.innerHTML += '<pre>' + escape(text) + '</pre>'; + }; + + if (!Object.keys) { + Object.keys = function(obj) { + var out = [], + key; + + for (key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + out.push(key); + } + } + + return out; + }; + } + + if (!Array.prototype.forEach) { + // eslint-disable-next-line no-extend-native + Array.prototype.forEach = function(callback, context) { + for (var i = 0; i < this.length; i++) { + callback.call(context || null, this[i], i, this); + } + }; + } + + if (!String.prototype.trim) { + // eslint-disable-next-line no-extend-native + String.prototype.trim = function() { + return this.replace(/^\s+|\s+$/g, ''); + }; + } + + // eslint-disable-next-line no-unused-vars + function load() { + return files; + } + + function escape(html, encode) { + return html + .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') + .replace(/</g, '<') + .replace(/>/g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); + } + + __LIBS__; // eslint-disable-line no-undef, no-unused-expressions + + (__MAIN__)(); // eslint-disable-line no-undef +}).call(this); |