1// All material copyright ESRI, All Rights Reserved, unless otherwise specified. 2// See http://gisservices.cityofmesquite.com/portal/jsapi/jsapi/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details. 3�/////////////////////////////////////////////////////////////////////////// 4// Copyright © Esri. All Rights Reserved. 5// 6// Licensed under the Apache License Version 2.0 (the "License"); 7// you may not use this file except in compliance with the License. 8// You may obtain a copy of the License at 9// 10// http://www.apache.org/licenses/LICENSE-2.0 11// 12// Unless required by applicable law or agreed to in writing, software 13// distributed under the License is distributed on an "AS IS" BASIS, 14// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15// See the License for the specific language governing permissions and 16// limitations under the License. 17/////////////////////////////////////////////////////////////////////////// 18 19var dojoConfig, jimuConfig; 20 21/*global weinreUrl, loadResources, _loadPolyfills, loadingCallback, debug, allCookies */ 22 23var ie = (function() { 24 25 var undef, 26 v = 3, 27 div = document.createElement('div'), 28 all = div.getElementsByTagName('i'); 29 30 div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->'; 31 while(all[0]){ 32 div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->'; 33 } 34 return v > 4 ? v : undef; 35}()); 36 37(function(argument) { 38 if (ie < 8){ 39 var mainLoading = document.getElementById('main-loading'); 40 var appLoading = document.getElementById('app-loading'); 41 var ieNotes = document.getElementById('ie-note'); 42 appLoading.style.display = 'none'; 43 ieNotes.style.display = 'block'; 44 mainLoading.style.backgroundColor = "#fff"; 45 return; 46 } 47 48 //handle edit=true parameter 49 if(!window.isXT && window.location.pathname.indexOf('/apps/webappviewer') > -1 && 50 window.queryObject.edit === 'true' && window.queryObject.appid){ 51 window.location.href = window.location.href.replace('webappviewer', 'webappbuilder'); 52 return; 53 } 54 55 var resources = []; 56 if (debug) { 57 resources.push(weinreUrl); 58 } 59 60 if (!window.apiUrl) { 61 console.error('no apiUrl.'); 62 } else if (!window.path) { 63 console.error('no path.'); 64 } else { 65 if(window.location.protocol === 'https:'){ 66 var reg = /^http:\/\//i; 67 if(reg.test(window.apiUrl)){ 68 window.apiUrl = window.apiUrl.replace(reg, 'https://'); 69 } 70 if(reg.test(window.path)){ 71 window.path = window.path.replace(reg, 'https://'); 72 } 73 } 74 75 /*jshint unused:false*/ 76 var hasOptions = {'extend-esri': 1}; 77 if(!window.isMobileUa){ 78 hasOptions['esri-featurelayer-webgl'] = 1; //enable webgl 79 } 80 dojoConfig = { 81 parseOnLoad: false, 82 async: true, 83 tlmSiblingOfDojo: false, 84 has: hasOptions 85 }; 86 87 setLocale(); 88 89 if(window.isRTL){ 90 dojoConfig.has['dojo-bidi'] = true; 91 } 92 93 resources = resources.concat([ 94 window.apiUrl + 'dojo/resources/dojo.css', 95 window.apiUrl + 'dijit/themes/claro/claro.css', 96 window.apiUrl + 'esri/css/esri.css', 97 // window.apiUrl + 'dojox/layout/resources/ResizeHandle.css', 98 window.path + 'jimu.js/css/jimu-theme.css' 99 //window.path + 'libs/caja-html-sanitizer-minified.js' 100 //window.path + 'libs/moment/twix.js', 101 //window.path + 'libs/Sortable.js', 102 // window.path + 'libs/cropperjs/cropperjs.js', 103 // window.path + 'libs/cropperjs/cropper.css', 104 // //because we have jimu/dijit/GridLayout dijit, so we import this css here 105 // window.path + 'libs/goldenlayout/goldenlayout-base.css', 106 // window.path + 'libs/goldenlayout/goldenlayout-light-theme.css' 107 ]); 108 109 if (window.apiUrl.substr(window.apiUrl.length - 'arcgis-js-api/'.length, 110 'arcgis-js-api/'.length) === 'arcgis-js-api/') { 111 //after build, we put js api here 112 //user can also download release api package and put here 113 dojoConfig.baseUrl = window.path; 114 dojoConfig.packages = [{ 115 name: "dojo", 116 location: window.apiUrl + "dojo" 117 }, { 118 name: "dijit", 119 location: window.apiUrl + "dijit" 120 }, { 121 name: "dojox", 122 location: window.apiUrl + "dojox" 123 }, { 124 name: "put-selector", 125 location: window.apiUrl + "put-selector" 126 }, { 127 name: "xstyle",
128 location: window.apiUrl + "xstyle" 129 }, { 130 name: "dgrid", 131 location: window.apiUrl + "dgrid" 132 }, { 133 name: "dgrid1", 134 location: window.apiUrl + "dgrid1" 135 }, { 136 name: "dstore", 137 location: window.apiUrl + "dstore" 138 }, { 139 name: "moment", 140 location: window.apiUrl + "moment" 141 }, { 142 name: "esri", 143 location: window.apiUrl + "esri" 144 }, { 145 name: "widgets", 146 location: "widgets" 147 }, { 148 name: "jimu", 149 location: "jimu.js" 150 }, { 151 name: "themes", 152 location: "themes" 153 }, { 154 name: "libs", 155 location: "libs" 156 }, { 157 name: "dynamic-modules", 158 location: "dynamic-modules" 159 }]; 160 161 resources.push(window.apiUrl + '/dojo/dojo.js'); 162 } else { 163 dojoConfig.baseUrl = window.apiUrl + 'dojo'; 164 dojoConfig.packages = [{ 165 name: "widgets", 166 location: window.path + "widgets" 167 }, { 168 name: "jimu", 169 location: window.path + "jimu.js" 170 }, { 171 name: "themes", 172 location: window.path + "themes" 173 }, { 174 name: "libs", 175 location: window.path + "libs" 176 }, { 177 name: "dynamic-modules", 178 location: window.path + "dynamic-modules" 179 }, { 180 name: "configs", 181 location: window.path + "configs" 182 }]; 183 184 resources.push(window.apiUrl + 'init.js'); 185 } 186 187 jimuConfig = { 188 loadingId: 'main-loading', 189 mainPageId: 'main-page', 190 layoutId: 'jimu-layout-manager', 191 mapId: 'map' 192 }; 193 jimuConfig.lazyLoadCss = [ 194 // 'xstyle/css!' + window.apiUrl + 'dojo/resources/dojo.css', 195 // 'xstyle/css!' + window.apiUrl + 'dijit/themes/claro/claro.css', 196 // 'xstyle/css!' + window.apiUrl + 'esri/css/esri.css', 197 'xstyle/css!' + window.apiUrl + 'dojox/layout/resources/ResizeHandle.css' 198 //'xstyle/css!' + window.path + 'jimu.js/css/jimu-theme.css' 199 ]; 200 201 loadResources(resources, null, function(url, loaded) { 202 if (typeof loadingCallback === 'function') { 203 loadingCallback(url, loaded, resources.length); 204 } 205 }, function() { 206 continueLoad(); 207 208 function continueLoad(){ 209 if(typeof require === 'undefined'){ 210 if (window.console){ 211 console.log('Waiting for API loaded.'); 212 } 213 setTimeout(continueLoad, 50); 214 return; 215 } 216 217 _loadPolyfills("", function() { 218 window.appInfo.appPath = window.path; 219 window.avoidRequireCache(require); 220 require(['dojo/aspect', 'dojo/request/util'], function(aspect, requestUtil) { 221 window.avoidRequestCache(aspect, requestUtil); 222 223 require(['jimu/main'/*, 'libs/main'*/], function(jimuMain) { 224 //loadingCallback('jimu', resources.length + 1, resources.length); 225 window.showWarningForLimitedBrowser(window.jimuNls); 226 jimuMain.initApp(); 227 }); 228 }); 229 }); 230 } 231 }); 232 } 233 234 function setLocale(){ 235 if(window.queryObject.locale){ 236 var locale = window.queryObject.locale.toLowerCase(); 237 dojoConfig.locale = ['hi'].indexOf(locale) >= 0 ? 'en' : locale; 238 window._setRTL(dojoConfig.locale); 239 return; 240 } 241 242 if(window.queryObject.mode){ 243 if(allCookies.wab_locale){ 244 dojoConfig.locale = allCookies.wab_locale; 245 } 246 }else{ 247 if(allCookies.wab_app_locale){ 248 dojoConfig.locale = allCookies.wab_app_locale; 249 } 250 } 251 252 253 if(!dojoConfig.locale){ 254 dojoConfig.locale = navigator.language ? navigator.language : navigator.userLanguage; 255 } 256 257 dojoConfig.locale = dojoConfig.locale.toLowerCase(); 258 dojoConfig.locale = ['hi'].indexOf(dojoConfig.locale) >= 0 ? 'en' : dojoConfig.locale; 259 window._setRTL(dojoConfig.locale); 260 } 261})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.