UNPKG

can

Version:

MIT-licensed, client-side, JavaScript framework that makes building rich web applications easy.

95 lines (87 loc) 2.43 kB
<html> <head> <style type="text/css"> span.pass {background-color:green} span.fail {background-color:red} </style> </head> <body> <p id="status">running</p> <script type="text/javascript"> //#1,,src,./dojo",src,./dtk-i18n-test (function(){ var hashInfo = location.search.substring(1), options = hashInfo.split(","); async = options[0]=="async" ? true : undefined, locale = options[1], dojoType = options[2], dojoLocation = options[3], i18nTestType = options[4], i18nTestLocation = options[5], testId = "async: " + async + ", locale: " + locale + ", dojo: " + dojoType + ", i18nTest: " + i18nTestType + "(" + hashInfo + ")", testKind = options[6]; document.getElementById("status").innerHTML += hashInfo; function report(result){ require(["doh"], function(doh){ doh.register(testId, function(t){ t.is(result, true); }); doh.run(); }); var text; if(result===true){ text = "<span class='pass'>PASS</span>: " + testId; }else{ text = "<span class='fail'>FAIL</span>: " + testId + "<br>" + result; } document.getElementById("status").innerHTML = text; } dojoConfig = { testConfig:options, async:async, locale:locale, baseUrl:"..", packages:[{ name:"dojo", location:dojoLocation },{ name:"doh", location:"./util/doh" },{ name:"i18nTest", location:i18nTestLocation }], callback:function(){ switch(testKind){ case "legacy": if(/legacy-built/.test(i18nTestType) && /layer/.test(i18nTestType)){ // ensure the 1.7+ i18n plugin is on board before trying to load a legacy-built module as a layer require(["dojo/i18n"], function(){ require(["i18nTest/legacyModule"], function(){ report(i18nTest.legacyModule()); }); }); }else{ require(["i18nTest/legacyModule"], function(){ report(i18nTest.legacyModule()); }); } break; case "amd": require(["i18nTest/amdModule"], function(amdModule){ report(amdModule.result); }); break; } } }; var node = document.createElement("script"); node.type = "text/javascript"; node.charset = "utf-8"; node.src = (/^http/.test(dojoLocation) ? dojoLocation : "../" + dojoLocation) + "/dojo.js"; console.log(node.src); document.getElementsByTagName("head")[0].appendChild(node); })(); </script> </body> </html>