define([ 'dojo/_base/lang', 'dojo/_base/array', 'dojo/_base/html', 'dojo/_base/sniff', 'dojo/_base/config', 'dojo/io-query', 'dojo/query', 'dojo/NodeList-traverse', 'dojo/Deferred', 'dojo/promise/all', 'dojo/on', 'dojo/json', 'dojo/cookie', 'dojo/number', 'dojo/date/locale', 'dojo/i18n!dojo/cldr/nls/number', 'dojox/encoding/base64', './shared/utils' ], function(lang, array, html, has, config, ioQuery, query, nlt, Deferred, all, on, json, cookie, dojoNumber, dateLocale, nlsBundle, base64, sharedUtils ) { /* global esriConfig, dojoConfig, ActiveXObject, testLoad */ var mo = {}; nlt = null; lang.mixin(mo, sharedUtils); if (!window.atob) { window.atob = function(b64) { var bytes = base64.decode(b64); var str = ""; for (var i = 0, len = bytes.length; i < len; i++) { str += String.fromCharCode(bytes[i]); } return str; }; } if (!window.btob) { window.btob = function(str) { var bytes = []; for (var i = 0, len = str.length; i < len; i++) { bytes.push(String.charCodeAt(str[i])); } return base64.encode(bytes); }; } var fileAPIJsStatus = 'unload'; // unload, loading, loaded function _loadFileAPIJs(prePath, cb) { prePath = prePath || ""; var loaded = 0, completeCb = function() { loaded++; if (loaded === tests.length) { cb(); } }, tests = [{ test: window.File && window.FileReader && window.FileList && window.Blob || !mo.file.isEnabledFlash(), failure: [ prePath + "libs/polyfills/fileAPI/FileAPI.js" ], callback: function() { completeCb(); } }]; for (var i = 0; i < tests.length; i++) { testLoad(tests[i]); } } //if no beforeId, append to head tag, or insert before the id function loadStyleLink(id, href, beforeId) { var def = new Deferred(), styleNode, styleLinkNode; var hrefPath = require(mo.getRequireConfig()).toUrl(href); //the cache will use the baseUrl + module as the key if(require.cache['url:' + hrefPath]){ //when load css file into index.html as