├── README.md ├── app ├── Main.js ├── application-base-js │ ├── .npmignore │ ├── ApplicationBase.js │ ├── README.MD │ ├── declareDecorator.js │ ├── license.txt │ ├── package.json │ └── support │ │ ├── domHelper.js │ │ ├── itemUtils.js │ │ └── urlUtils.js ├── base │ ├── Color.js │ ├── ParamValidator.js │ ├── Styleset.js │ ├── baselayouts.js │ ├── basethemes.js │ ├── message.js │ ├── padding.js │ ├── selectors.js │ └── styles.js ├── calcite-maps │ ├── css │ │ ├── calcite-maps-arcgis-4.x.min-v0.10.css │ │ └── calcite-maps-bootstrap.min-v0.10.css │ ├── fonts │ │ ├── avenir-next │ │ │ ├── Avenir_Next_W00_400.eot │ │ │ ├── Avenir_Next_W00_400.svg │ │ │ ├── Avenir_Next_W00_400.ttf │ │ │ ├── Avenir_Next_W00_400.woff │ │ │ ├── Avenir_Next_W00_400.woff2 │ │ │ ├── Avenir_Next_W00_600.eot │ │ │ ├── Avenir_Next_W00_600.svg │ │ │ ├── Avenir_Next_W00_600.ttf │ │ │ ├── Avenir_Next_W00_600.woff │ │ │ ├── Avenir_Next_W00_600.woff2 │ │ │ ├── Avenir_Next_W00_Italic_400.eot │ │ │ ├── Avenir_Next_W00_Italic_400.svg │ │ │ ├── Avenir_Next_W00_Italic_400.ttf │ │ │ ├── Avenir_Next_W00_Italic_400.woff │ │ │ ├── Avenir_Next_W00_Italic_400.woff2 │ │ │ ├── Avenir_Next_W00_Italic_600.eot │ │ │ ├── Avenir_Next_W00_Italic_600.svg │ │ │ ├── Avenir_Next_W00_Italic_600.ttf │ │ │ ├── Avenir_Next_W00_Italic_600.woff │ │ │ └── Avenir_Next_W00_Italic_600.woff2 │ │ ├── bootstrap │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ └── calcite │ │ │ ├── _calcite-ui.scss │ │ │ ├── calcite-ui.css │ │ │ ├── calcite-ui.eot │ │ │ ├── calcite-ui.ttf │ │ │ └── calcite-ui.woff │ ├── js │ │ └── dojo │ │ │ ├── calcitemaps-arcgis-support-v0.10.js │ │ │ └── calcitemaps-v0.10.js │ └── vendor │ │ └── dojo-bootstrap │ │ ├── Affix.js │ │ ├── Alert.js │ │ ├── Button.js │ │ ├── Carousel.js │ │ ├── Collapse.js │ │ ├── Datepicker.js │ │ ├── Dropdown.js │ │ ├── Marquee.js │ │ ├── Modal.js │ │ ├── Popover.js │ │ ├── Scrollspy.js │ │ ├── Support.js │ │ ├── Tab.js │ │ ├── Tooltip.js │ │ ├── Typeahead.js │ │ ├── assets │ │ ├── datepicker.css │ │ ├── datepicker.less │ │ ├── marquee.css │ │ └── marquee.less │ │ ├── bootstrap.profile.js │ │ ├── bower.json │ │ └── package.json ├── dojo.js ├── init.js ├── nls │ ├── ar │ │ └── resources.js │ ├── bs │ │ └── resources.js │ ├── ca │ │ └── resources.js │ ├── cs │ │ └── resources.js │ ├── da │ │ └── resources.js │ ├── de │ │ └── resources.js │ ├── el │ │ └── resources.js │ ├── es │ │ └── resources.js │ ├── et │ │ └── resources.js │ ├── fi │ │ └── resources.js │ ├── fr │ │ └── resources.js │ ├── he │ │ └── resources.js │ ├── hi │ │ └── resources.js │ ├── hr │ │ └── resources.js │ ├── hu │ │ └── resources.js │ ├── id │ │ └── resources.js │ ├── it │ │ └── resources.js │ ├── ja │ │ └── resources.js │ ├── ko │ │ └── resources.js │ ├── lt │ │ └── resources.js │ ├── lv │ │ └── resources.js │ ├── nb │ │ └── resources.js │ ├── nl │ │ └── resources.js │ ├── pl │ │ └── resources.js │ ├── pt-br │ │ └── resources.js │ ├── pt-pt │ │ └── resources.js │ ├── resources.js │ ├── ro │ │ └── resources.js │ ├── ru │ │ └── resources.js │ ├── sl │ │ └── resources.js │ ├── sr │ │ └── resources.js │ ├── sv │ │ └── resources.js │ ├── th │ │ └── resources.js │ ├── tr │ │ └── resources.js │ ├── vi │ │ └── resources.js │ ├── zh-cn │ │ └── resources.js │ ├── zh-hk │ │ └── resources.js │ └── zh-tw │ │ └── resources.js ├── symbols │ └── marker.png ├── ui │ ├── AppHtml.js │ ├── AppStyler.js │ └── HtmlTemplate.js ├── view │ ├── ViewManager.js │ └── widgetslayout.js └── widgets │ ├── FindPlaces.js │ ├── MapCoords.js │ ├── Share.js │ └── WidgetsExt.js ├── assets ├── bookmark.png ├── favicon.ico ├── loader-ie9.gif ├── loading.gif ├── loadingSmall.gif ├── search-symbol-32.svg └── thumb.png ├── config ├── appParams.json ├── application.json └── applicationBase.json ├── example-1.png ├── example-2.png ├── example-3.png ├── example-4.png ├── index.html ├── license.txt ├── resources ├── configPanelWebmap.json └── configPanelWebscene.json └── styles └── main.css /app/application-base-js/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | tsrules 3 | .editorconfig 4 | .gitattributes 5 | .gitignore 6 | .jsbeautifyrc 7 | tsconfig.json 8 | tslint.json 9 | web.config 10 | -------------------------------------------------------------------------------- /app/application-base-js/declareDecorator.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", "dojo/_base/declare"], function (require, exports, declare) { 2 | "use strict"; 3 | Object.defineProperty(exports, "__esModule", { value: true }); 4 | /** 5 | * A decorator that converts a TypeScript class into a declare constructor. 6 | * This allows declare constructors to be defined as classes, which nicely 7 | * hides away the `declare([], {})` boilerplate. 8 | */ 9 | function default_1() { 10 | var mixins = []; 11 | for (var _i = 0; _i < arguments.length; _i++) { 12 | mixins[_i] = arguments[_i]; 13 | } 14 | return function (target) { 15 | return declare(mixins, target.prototype); 16 | }; 17 | } 18 | exports.default = default_1; 19 | }); 20 | -------------------------------------------------------------------------------- /app/application-base-js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "@esri/application-base-js@^0.0.2", 3 | "_id": "@esri/application-base-js@0.0.2", 4 | "_inBundle": false, 5 | "_integrity": "sha1-oyPGQeSFVf8wIfC5a23MBd7a7Os=", 6 | "_location": "/@esri/application-base-js", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "@esri/application-base-js@^0.0.2", 12 | "name": "@esri/application-base-js", 13 | "escapedName": "@esri%2fapplication-base-js", 14 | "scope": "@esri", 15 | "rawSpec": "^0.0.2", 16 | "saveSpec": null, 17 | "fetchSpec": "^0.0.2" 18 | }, 19 | "_requiredBy": [ 20 | "#DEV:/" 21 | ], 22 | "_resolved": "https://registry.npmjs.org/@esri/application-base-js/-/application-base-js-0.0.2.tgz", 23 | "_shasum": "a323c641e48555ff3021f0b96b6dcc05dedaeceb", 24 | "_spec": "@esri/application-base-js@^0.0.2", 25 | "_where": "/Users/allan/GitHub/configurable-app-examples-4x-js", 26 | "author": { 27 | "name": "Matt Driscoll", 28 | "email": "mdriscoll@esri.com" 29 | }, 30 | "bugs": { 31 | "url": "https://github.com/Esri/application-base-js/issues" 32 | }, 33 | "bundleDependencies": false, 34 | "dependencies": {}, 35 | "deprecated": false, 36 | "description": "A core class for creating a configurable application using JavaScript/TypeScript", 37 | "devDependencies": { 38 | "@types/arcgis-js-api": "^4.5.0", 39 | "dojo-typings": "^1.11.9", 40 | "dts-generator": "^2.1.0", 41 | "tslint": "^5.7.0", 42 | "typescript": "^2.5.3" 43 | }, 44 | "homepage": "https://github.com/Esri/application-base-js", 45 | "keywords": [ 46 | "Esri", 47 | "esrijs", 48 | "ArcGIS", 49 | "gis", 50 | "JavaScript", 51 | "TypeScript" 52 | ], 53 | "license": "SEE LICENSE IN license.txt", 54 | "main": "ApplicationBase.js", 55 | "name": "@esri/application-base-js", 56 | "repository": { 57 | "type": "git", 58 | "url": "git+https://github.com/Esri/application-base-js.git" 59 | }, 60 | "scripts": { 61 | "build": "dts-generator --name ApplicationBase --project ./ --out index.d.ts", 62 | "start": "npm run build; npm run watch -s", 63 | "watch": "tsc --watch" 64 | }, 65 | "version": "0.0.2" 66 | } 67 | -------------------------------------------------------------------------------- /app/application-base-js/support/domHelper.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2017 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | 6 | you may not use this file except in compliance with the License. 7 | 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 | 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | 18 | See the License for the specific language governing permissions and 19 | 20 | limitations under the License.​ 21 | */ 22 | define(["require", "exports"], function (require, exports) { 23 | "use strict"; 24 | Object.defineProperty(exports, "__esModule", { value: true }); 25 | function setPageLocale(locale) { 26 | document.documentElement.lang = locale; 27 | } 28 | exports.setPageLocale = setPageLocale; 29 | function setPageDirection(direction) { 30 | var dirNode = document.getElementsByTagName("html")[0]; 31 | dirNode.setAttribute("dir", direction); 32 | } 33 | exports.setPageDirection = setPageDirection; 34 | function setPageTitle(title) { 35 | document.title = title; 36 | } 37 | exports.setPageTitle = setPageTitle; 38 | }); 39 | -------------------------------------------------------------------------------- /app/application-base-js/support/itemUtils.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2017 Esri 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | 6 | you may not use this file except in compliance with the License. 7 | 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 | 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | 16 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | 18 | See the License for the specific language governing permissions and 19 | 20 | limitations under the License.​ 21 | */ 22 | var __assign = (this && this.__assign) || Object.assign || function(t) { 23 | for (var s, i = 1, n = arguments.length; i < n; i++) { 24 | s = arguments[i]; 25 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) 26 | t[p] = s[p]; 27 | } 28 | return t; 29 | }; 30 | define(["require", "exports", "esri/core/requireUtils", "esri/core/promiseUtils", "esri/core/watchUtils", "./urlUtils"], function (require, exports, requireUtils, promiseUtils, watchUtils, urlUtils_1) { 31 | "use strict"; 32 | Object.defineProperty(exports, "__esModule", { value: true }); 33 | //-------------------------------------------------------------------------- 34 | // 35 | // Public Methods 36 | // 37 | //-------------------------------------------------------------------------- 38 | function getConfigViewProperties(config) { 39 | var center = config.center, components = config.components, extent = config.extent, level = config.level, viewpoint = config.viewpoint; 40 | var ui = components 41 | ? { ui: { components: urlUtils_1.parseViewComponents(components) } } 42 | : null; 43 | var cameraProps = viewpoint ? { camera: urlUtils_1.parseViewpoint(viewpoint) } : null; 44 | var centerProps = center ? { center: urlUtils_1.parseCenter(center) } : null; 45 | var zoomProps = level ? { zoom: urlUtils_1.parseLevel(level) } : null; 46 | var extentProps = extent ? { extent: urlUtils_1.parseExtent(extent) } : null; 47 | return __assign({}, ui, cameraProps, centerProps, zoomProps, extentProps); 48 | } 49 | exports.getConfigViewProperties = getConfigViewProperties; 50 | function createView(properties) { 51 | var map = properties.map; 52 | if (!map) { 53 | return promiseUtils.reject("properties does not contain a \"map\""); 54 | } 55 | var isWebMap = map.declaredClass === "esri.WebMap"; 56 | var isWebScene = map.declaredClass === "esri.WebScene"; 57 | if (!isWebMap && !isWebScene) { 58 | return promiseUtils.reject("map is not a \"WebMap\" or \"WebScene\""); 59 | } 60 | var viewTypePath = isWebMap ? "esri/views/MapView" : "esri/views/SceneView"; 61 | return requireUtils.when(require, viewTypePath).then(function (ViewType) { 62 | return new ViewType(properties); 63 | }); 64 | } 65 | exports.createView = createView; 66 | function createMapFromItem(options) { 67 | var item = options.item, appProxies = options.appProxies; 68 | var isWebMap = item.type === "Web Map"; 69 | var isWebScene = item.type === "Web Scene"; 70 | if (!isWebMap && !isWebScene) { 71 | return promiseUtils.reject(); 72 | } 73 | return isWebMap 74 | ? createWebMapFromItem(options) 75 | : createWebSceneFromItem(options); 76 | } 77 | exports.createMapFromItem = createMapFromItem; 78 | function createWebMapFromItem(options) { 79 | var item = options.item, appProxies = options.appProxies; 80 | return requireUtils.when(require, "esri/WebMap").then(function (WebMap) { 81 | var wm = new WebMap({ 82 | portalItem: item 83 | }); 84 | return wm.load().then(function () { 85 | return _updateProxiedLayers(wm, appProxies); 86 | }); 87 | }); 88 | } 89 | exports.createWebMapFromItem = createWebMapFromItem; 90 | function createWebSceneFromItem(options) { 91 | var item = options.item, appProxies = options.appProxies; 92 | return requireUtils.when(require, "esri/WebScene").then(function (WebScene) { 93 | var ws = new WebScene({ 94 | portalItem: item 95 | }); 96 | return ws.load().then(function () { 97 | return _updateProxiedLayers(ws, appProxies); 98 | }); 99 | }); 100 | } 101 | exports.createWebSceneFromItem = createWebSceneFromItem; 102 | function getItemTitle(item) { 103 | if (item && item.title) { 104 | return item.title; 105 | } 106 | } 107 | exports.getItemTitle = getItemTitle; 108 | function goToMarker(marker, view) { 109 | if (!marker || !view) { 110 | return promiseUtils.resolve(); 111 | } 112 | return urlUtils_1.parseMarker(marker).then(function (graphic) { 113 | view.graphics.add(graphic); 114 | var view2 = view; // todo: Typings will be fixed in next release. 115 | return view2.goTo(graphic); 116 | }); 117 | } 118 | exports.goToMarker = goToMarker; 119 | function findQuery(query, view) { 120 | // ?find=redlands, ca 121 | if (!query || !view) { 122 | return promiseUtils.resolve(); 123 | } 124 | return requireUtils 125 | .when(require, "esri/widgets/Search/SearchViewModel") 126 | .then(function (SearchViewModel) { 127 | var searchVM = new SearchViewModel({ 128 | view: view 129 | }); 130 | return searchVM.search(query).then(function (result) { 131 | watchUtils.whenFalseOnce(view, "popup.visible", function () { 132 | return searchVM.destroy(); 133 | }); 134 | return result; 135 | }); 136 | }); 137 | } 138 | exports.findQuery = findQuery; 139 | //-------------------------------------------------------------------------- 140 | // 141 | // Private Methods 142 | // 143 | //-------------------------------------------------------------------------- 144 | function _updateProxiedLayers(webItem, appProxies) { 145 | if (!appProxies) { 146 | return webItem; 147 | } 148 | appProxies.forEach(function (proxy) { 149 | webItem.layers.forEach(function (layer) { 150 | if (layer.url === proxy.sourceUrl) { 151 | layer.url = proxy.proxyUrl; 152 | } 153 | }); 154 | }); 155 | return webItem; 156 | } 157 | }); 158 | -------------------------------------------------------------------------------- /app/base/Color.js: -------------------------------------------------------------------------------- 1 | /* 2 | | Copyright 2016 Esri 3 | | 4 | | Licensed under the Apache License, Version 2.0 (the "License"); 5 | | you may not use this file except in compliance with the License. 6 | | You may obtain a copy of the License at 7 | | 8 | | http://www.apache.org/licenses/LICENSE-2.0 9 | | 10 | | Unless required by applicable law or agreed to in writing, software 11 | | distributed under the License is distributed on an "AS IS" BASIS, 12 | | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | | See the License for the specific language governing permissions and 14 | | limitations under the License. 15 | */ 16 | define([ 17 | "application/base/styles", 18 | 19 | "dojo/query", 20 | "dojo/dom-construct", 21 | "dojo/_base/Color", 22 | "dojo/_base/declare" 23 | ], 24 | function( 25 | CALCITE_STYLES, 26 | query, domConstruct, Color, declare) { 27 | 28 | return declare(null, { 29 | 30 | //-------------------------------------------------------------------------- 31 | // 32 | // Lifecycle 33 | // 34 | //-------------------------------------------------------------------------- 35 | 36 | constructor: function () {}, 37 | 38 | //-------------------------------------------------------------------------- 39 | // 40 | // Public Members 41 | // 42 | //-------------------------------------------------------------------------- 43 | 44 | getRgba: function(bgColor, opacity) { 45 | var rgba; 46 | // rgb 47 | if (bgColor && typeof bgColor === "string") { 48 | // Handle transparent bg color 49 | var trans = bgColor.toLowerCase().replace(/\s+/g, ''); 50 | if (trans === "transparent" || trans === "rgba(0,0,0,0") { 51 | rgba = "rgba(0, 0, 0, 0)"; 52 | } else { //rgb, rgba or #xxx 53 | var c = Color.fromString(bgColor); 54 | if (c && (bgColor.indexOf("#") > -1 || bgColor.indexOf("rgb") > -1 || bgColor.indexOf("rgba") > -1)) { 55 | rgba = c.toString(); 56 | } else { // calcite style 57 | var bgColorStyle = "calcite-bgcolor-" + bgColor; 58 | rgba = this.getRgbaColorFromStyle(bgColorStyle); 59 | if (rgba === "rgba(0, 0, 0, 0)") { 60 | rgba = null; // invalid calcite color 61 | } 62 | } 63 | // Apply opacity 64 | if (rgba) { 65 | var cRgba = new Color(rgba); 66 | if (opacity) { 67 | var val = parseFloat(opacity); 68 | if (!isNaN(val)) { 69 | cRgba.a = val; 70 | } 71 | } 72 | rgba = cRgba.toCss(true); 73 | } 74 | } 75 | } 76 | return rgba; 77 | }, 78 | 79 | getRgbaColorFromStyle: function(calciteBgColorStyle) { 80 | var div = domConstruct.create("div", { id: "calcitecolor", class: calciteBgColorStyle }, document.body ); 81 | var rgba = query(div).style("background-color")[0]; 82 | domConstruct.destroy(div); 83 | return rgba; 84 | }, 85 | 86 | getTextStyleFromRgba: function(rgba) { 87 | var textStyle; 88 | if (rgba) { 89 | var c = Color.fromString(rgba); 90 | if (c) { 91 | var hsl = this._rgb2hsl(c.r, c.g, c.b); 92 | // Get the best complimentary text color 93 | if (hsl.l < 0.55) { 94 | textStyle = CALCITE_STYLES.textLight; 95 | } else { 96 | textStyle = CALCITE_STYLES.textDark; 97 | } 98 | } 99 | } 100 | return textStyle; 101 | }, 102 | 103 | getTextStyle: function(textColor) { 104 | var textStyle; 105 | if (textColor === "light") { 106 | textStyle = CALCITE_STYLES.textLight; 107 | } else if (textColor === "dark") { 108 | textStyle = CALCITE_STYLES.textDark; 109 | } 110 | return textStyle; 111 | }, 112 | 113 | //-------------------------------------------------------------------------- 114 | // 115 | // Private Methods 116 | // 117 | //-------------------------------------------------------------------------- 118 | 119 | _rgb2hsv: function() { 120 | var rr, gg, bb, 121 | r = arguments[0] / 255, 122 | g = arguments[1] / 255, 123 | b = arguments[2] / 255, 124 | h, s, 125 | v = Math.max(r, g, b), 126 | diff = v - Math.min(r, g, b), 127 | diffc = function(c){ 128 | return (v - c) / 6 / diff + 1 / 2; 129 | }; 130 | 131 | if (diff == 0) { 132 | h = s = 0; 133 | } else { 134 | s = diff / v; 135 | rr = diffc(r); 136 | gg = diffc(g); 137 | bb = diffc(b); 138 | 139 | if (r === v) { 140 | h = bb - gg; 141 | }else if (g === v) { 142 | h = (1 / 3) + rr - bb; 143 | }else if (b === v) { 144 | h = (2 / 3) + gg - rr; 145 | } 146 | if (h < 0) { 147 | h += 1; 148 | }else if (h > 1) { 149 | h -= 1; 150 | } 151 | } 152 | return { 153 | h: Math.round(h * 360), 154 | s: Math.round(s * 100), 155 | v: Math.round(v * 100) 156 | }; 157 | }, 158 | 159 | _rgb2hsl: function(r, g, b) { 160 | r /= 255, g /= 255, b /= 255; 161 | var max = Math.max(r, g, b), min = Math.min(r, g, b); 162 | var h, s, l = (max + min) / 2; 163 | 164 | if(max == min){ 165 | h = s = 0; // achromatic 166 | }else{ 167 | var d = max - min; 168 | s = l > 0.5 ? d / (2 - max - min) : d / (max + min); 169 | switch(max){ 170 | case r: h = (g - b) / d + (g < b ? 6 : 0); break; 171 | case g: h = (b - r) / d + 2; break; 172 | case b: h = (r - g) / d + 4; break; 173 | } 174 | h /= 6; 175 | } 176 | return { 177 | h: h, 178 | s: s, 179 | l: l 180 | }; 181 | } 182 | 183 | }); 184 | }); -------------------------------------------------------------------------------- /app/base/ParamValidator.js: -------------------------------------------------------------------------------- 1 | /* 2 | | Copyright 2016 Esri 3 | | 4 | | Licensed under the Apache License, Version 2.0 (the "License"); 5 | | you may not use this file except in compliance with the License. 6 | | You may obtain a copy of the License at 7 | | 8 | | http://www.apache.org/licenses/LICENSE-2.0 9 | | 10 | | Unless required by applicable law or agreed to in writing, software 11 | | distributed under the License is distributed on an "AS IS" BASIS, 12 | | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | | See the License for the specific language governing permissions and 14 | | limitations under the License. 15 | */ 16 | define([ 17 | "dojo/text!config/appParams.json", 18 | "dojo/_base/declare" 19 | ], function ( 20 | AppParamsJSON, 21 | declare 22 | ) { 23 | 24 | return declare(null, { 25 | 26 | //-------------------------------------------------------------------------- 27 | // 28 | // Lifecycle 29 | // 30 | //-------------------------------------------------------------------------- 31 | 32 | constructor: function () { 33 | 34 | this._defaultParams = JSON.parse(AppParamsJSON); 35 | 36 | }, 37 | 38 | //-------------------------------------------------------------------------- 39 | // 40 | // Variables 41 | // 42 | //-------------------------------------------------------------------------- 43 | 44 | _params: null, 45 | 46 | _outParam: { 47 | valid: false, 48 | default: null 49 | }, 50 | 51 | //-------------------------------------------------------------------------- 52 | // 53 | // Public Functions 54 | // 55 | //-------------------------------------------------------------------------- 56 | 57 | getValidParams: function(paramsIn) { 58 | var validatedParams = {}; 59 | var invalidParams = ""; 60 | for (var param in paramsIn) { 61 | if (!paramsIn.hasOwnProperty(param)) continue; 62 | var val = paramsIn[param]; 63 | if (this._isValidParamValue(param,val)) { 64 | validatedParams[param] = val; 65 | } else { 66 | //console.warn("Styler - Unrecognized parameter or value: " + param + "=" + val) // TODO 67 | invalidParams = invalidParams + param + "=" + val + " "; 68 | } 69 | } 70 | 71 | // Remove params not needed - TODO 72 | //this._trimParams(validatedParams); 73 | 74 | return { validParams: validatedParams, 75 | invalidParams: invalidParams 76 | }; 77 | }, 78 | 79 | //-------------------------------------------------------------------------- 80 | // 81 | // Private Functions 82 | // 83 | //-------------------------------------------------------------------------- 84 | 85 | _trimParams: function(validParams) { 86 | // Scale and Zoom, just need one 87 | if (validParams.hasOwnProperty("scale") && validParams.hasOwnProperty("zoom")) { 88 | delete validParams["zoom"]; 89 | } 90 | // Rotation, remove if "0" 91 | if (validParams.hasOwnProperty("rotation") && validParams["rotation"] === "0") { 92 | delete validParams["rotation"]; 93 | } 94 | }, 95 | 96 | _isValidParamValue: function(param,value) { 97 | var valid = false; 98 | if (this._isValidParam(param)) { 99 | if (this._isValidValue(param,value)) { 100 | valid = true; 101 | } 102 | } 103 | return valid; 104 | }, 105 | 106 | _isValidParam: function(param) { 107 | return this._defaultParams.hasOwnProperty(param); 108 | }, 109 | 110 | _isValidValue: function(param,val) { 111 | var valid = false; 112 | var validParam = this._defaultParams[param]; 113 | switch (validParam.type) { 114 | case "boolean": 115 | valid = this._isValidTypeBoolean(val); // no need to get vals 116 | break; 117 | case "float": 118 | valid = this._isValidTypeFloat(val, validParam.values); 119 | break; 120 | case "integer": 121 | valid = this._isValidTypeInteger(val, validParam.values); 122 | break; 123 | case "value": 124 | valid = this._isValidTypeValue(val, validParam.values); 125 | break; 126 | case "string": 127 | valid = true; // All null or strings are valid 128 | break; 129 | } 130 | return valid; 131 | }, 132 | 133 | _isValidTypeBoolean: function(val) { 134 | if (val === true || val === "true" || val === false || val === "false") { 135 | return true; 136 | } else { 137 | return false; 138 | } 139 | }, 140 | 141 | _isValidTypeInteger: function(val, values) { 142 | var v = parseInt(val); 143 | if (v !== NaN && v >= values[0] && v <= values[1]) { 144 | return true; 145 | } else { 146 | return false; 147 | } 148 | }, 149 | 150 | _isValidTypeFloat: function(val, values) { 151 | var v = parseFloat(val); 152 | if (v !== NaN && v >= values[0] && v <= values[1]) { 153 | return true; 154 | } else { 155 | return false; 156 | } 157 | }, 158 | 159 | _isValidTypeValue: function(val, values) { 160 | if (val && values.indexOf(val) > -1) { 161 | return true; 162 | } else { 163 | return false; 164 | } 165 | } 166 | 167 | }) 168 | }); 169 | 170 | 171 | 172 | 173 | 174 | -------------------------------------------------------------------------------- /app/base/Styleset.js: -------------------------------------------------------------------------------- 1 | /* 2 | | Copyright 2016 Esri 3 | | 4 | | Licensed under the Apache License, Version 2.0 (the "License"); 5 | | you may not use this file except in compliance with the License. 6 | | You may obtain a copy of the License at 7 | | 8 | | http://www.apache.org/licenses/LICENSE-2.0 9 | | 10 | | Unless required by applicable law or agreed to in writing, software 11 | | distributed under the License is distributed on an "AS IS" BASIS, 12 | | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | | See the License for the specific language governing permissions and 14 | | limitations under the License. 15 | */ 16 | define([ 17 | "application/base/styles" 18 | ], function (CALCITE_STYLES) { 19 | 20 | var lightSet = function light() { 21 | this.bgStyle = CALCITE_STYLES.bgLight; 22 | this.textStyle = CALCITE_STYLES.textDark; 23 | this.bgRgbColor = null; 24 | }; 25 | 26 | var darkSet = function dark() { 27 | this.bgStyle = CALCITE_STYLES.bgDark; 28 | this.textStyle = CALCITE_STYLES.textLight; 29 | this.bgRgbColor = null; 30 | }; 31 | 32 | var customSet = function dark() { 33 | this.bgStyle = CALCITE_STYLES.bgCustom; 34 | this.textStyle = CALCITE_STYLES.darkLight; 35 | this.bgRgbColor = "rgba(255,255,255,1)"; 36 | }; 37 | 38 | var CALCITE_STYLE_SET = function CALCITE_STYLE_SET() { 39 | this.getLight = function() { 40 | return new lightSet(); 41 | }; 42 | this.getDark = function() { 43 | return new darkSet(); 44 | }; 45 | this.getCustom = function() { 46 | return new customSet(); 47 | }; 48 | } 49 | 50 | return CALCITE_STYLE_SET; 51 | }); -------------------------------------------------------------------------------- /app/base/baselayouts.js: -------------------------------------------------------------------------------- 1 | /* 2 | | Copyright 2016 Esri 3 | | 4 | | Licensed under the Apache License, Version 2.0 (the "License"); 5 | | you may not use this file except in compliance with the License. 6 | | You may obtain a copy of the License at 7 | | 8 | | http://www.apache.org/licenses/LICENSE-2.0 9 | | 10 | | Unless required by applicable law or agreed to in writing, software 11 | | distributed under the License is distributed on an "AS IS" BASIS, 12 | | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | | See the License for the specific language governing permissions and 14 | | limitations under the License. 15 | */ 16 | define([ 17 | "application/base/styles", 18 | "application/base/padding", 19 | ], function (STYLES, PADDING) { 20 | 21 | var BASELAYOUTS = { 22 | topSmall: { 23 | name: "top-small", 24 | theme: STYLES.layoutThemeSmall, 25 | navbar: { 26 | position: STYLES.navPositionTop, 27 | margin: "", 28 | fixedPosition: STYLES.navFixedTop, 29 | }, 30 | panels: STYLES.panelsRight, 31 | padding: PADDING.topSmall 32 | }, 33 | top: { 34 | name: "top", 35 | theme: "", 36 | navbar: { 37 | position: STYLES.navPositionTop, 38 | margin: "", 39 | fixedPosition: STYLES.navFixedTop, 40 | }, 41 | panels: STYLES.panelsRight, 42 | padding: PADDING.topMedium 43 | }, 44 | topMargin: { 45 | name: "top-margin", 46 | theme: "", 47 | navbar: { 48 | position: STYLES.navPositionTop, 49 | margin: STYLES.navMarginTop, 50 | fixedPosition: STYLES.navFixedTop, 51 | }, 52 | panels: STYLES.panelsRight, 53 | padding: PADDING.topMediumMargin 54 | }, 55 | topLarge: { 56 | name: "top-large", 57 | theme: STYLES.layoutThemeLarge, 58 | navbar: { 59 | position: STYLES.navPositionTop, 60 | margin: "", 61 | fixedPosition: STYLES.navFixedTop, 62 | }, 63 | panels: STYLES.panelsRight, 64 | padding: PADDING.topLarge 65 | }, 66 | bottomSmall: { 67 | name: "bottom-small", 68 | theme: STYLES.layoutThemeSmall, 69 | navbar: { 70 | position: STYLES.navPositionBottom, 71 | margin: "", 72 | fixedPosition: STYLES.navFixedBottom, 73 | }, 74 | panels: STYLES.panelsRight, 75 | padding: PADDING.bottomSmall 76 | }, 77 | bottom: { 78 | name: "bottom", 79 | theme: "", 80 | navbar: { 81 | position: STYLES.navPositionBottom, 82 | margin: "", 83 | fixedPosition: STYLES.navFixedBottom, 84 | }, 85 | panels: STYLES.panelsRight, 86 | padding: PADDING.bottomMedium 87 | }, 88 | bottomMargin: { 89 | name: "bottom-margin", 90 | theme: "", 91 | navbar: { 92 | position: STYLES.navPositionBottom, 93 | margin: STYLES.navMarginBottom, 94 | fixedPosition: STYLES.navFixedBottom, 95 | }, 96 | panels: STYLES.panelsRight, 97 | padding: PADDING.bottomMediumMargin 98 | }, 99 | bottomLarge: { 100 | name: "bottom-large", 101 | theme: STYLES.layoutThemeLarge, 102 | navbar: { 103 | position: STYLES.navPositionBottom, 104 | margin: "", 105 | fixedPosition: STYLES.navFixedBottom, 106 | }, 107 | panels: STYLES.panelsRight, 108 | padding: PADDING.bottomLarge 109 | } 110 | } 111 | 112 | return BASELAYOUTS; 113 | }); -------------------------------------------------------------------------------- /app/base/basethemes.js: -------------------------------------------------------------------------------- 1 | /* 2 | | Copyright 2016 Esri 3 | | 4 | | Licensed under the Apache License, Version 2.0 (the "License"); 5 | | you may not use this file except in compliance with the License. 6 | | You may obtain a copy of the License at 7 | | 8 | | http://www.apache.org/licenses/LICENSE-2.0 9 | | 10 | | Unless required by applicable law or agreed to in writing, software 11 | | distributed under the License is distributed on an "AS IS" BASIS, 12 | | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | | See the License for the specific language governing permissions and 14 | | limitations under the License. 15 | */ 16 | define([ 17 | "application/base/Styleset" 18 | ], function (StyleSet) { 19 | 20 | var styleset = new StyleSet(); 21 | 22 | var BASETHEMES = { 23 | 24 | type: { 25 | LIGHT: "light", 26 | DARK: "dark", 27 | CUSTOM: "custom" 28 | }, 29 | light: { 30 | type: "light", 31 | navbar: styleset.getLight(), 32 | dropdown: styleset.getLight(), 33 | panel: styleset.getLight() 34 | }, 35 | dark: { 36 | type: "dark", 37 | navbar: styleset.getDark(), 38 | dropdown: styleset.getDark(), 39 | panel: styleset.getDark() 40 | }, 41 | custom: { 42 | type: "custom", 43 | navbar: styleset.getCustom(), 44 | dropdown: styleset.getLight(), 45 | panel: styleset.getCustom() 46 | } 47 | } 48 | 49 | return BASETHEMES; 50 | }); 51 | -------------------------------------------------------------------------------- /app/base/message.js: -------------------------------------------------------------------------------- 1 | /* 2 | | Copyright 2016 Esri 3 | | 4 | | Licensed under the Apache License, Version 2.0 (the "License"); 5 | | you may not use this file except in compliance with the License. 6 | | You may obtain a copy of the License at 7 | | 8 | | http://www.apache.org/licenses/LICENSE-2.0 9 | | 10 | | Unless required by applicable law or agreed to in writing, software 11 | | distributed under the License is distributed on an "AS IS" BASIS, 12 | | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | | See the License for the specific language governing permissions and 14 | | limitations under the License. 15 | */ 16 | define([ 17 | "dojo/dom", 18 | "dojo/dom-class", 19 | "dojo/query" 20 | ], function ( 21 | dom, domClass, query) { 22 | 23 | var CSS = { 24 | loading: "boilerplate--loading", 25 | error: "boilerplate--error", 26 | errorIcon: "esri-icon-notice-round" 27 | }; 28 | 29 | var Type = { 30 | error: "Error:", 31 | warning: "Warning:", 32 | attention: "Attention:", 33 | snap: "Aw, Snap!" 34 | }; 35 | 36 | var _getMessage = function(error) { 37 | var userMsg; 38 | if (error.userMsg) { 39 | userMsg = error.userMsg + " " + error.message + "."; 40 | } else { 41 | userMsg = error.message + "."; 42 | } 43 | return userMsg; 44 | } 45 | 46 | var Message = { 47 | show: function(errType, error, log, showMessages, clear) { 48 | errType = errType || Message.type.error; 49 | error = error || new Error("Styler error"); 50 | var userMsg = Message.getMessage(error); 51 | // Hide loading 52 | domClass.remove(document.body, CSS.loading); 53 | // Show window 54 | if (showMessages) { 55 | var node = query(".calcite-alert .alert-message")[0]; 56 | if (node) { 57 | // Accumulate all error messages 58 | if (node.innerHTML && !clear) { 59 | node.innerHTML = node.innerHTML + "
" + errType + " " + userMsg + ""; 60 | } else { 61 | node.innerHTML = "" + errType + " " + userMsg + ""; 62 | } 63 | query(".calcite-alert").removeClass("hidden"); 64 | query(".calcite-alert .close").on("click", function(){ 65 | query(".calcite-alert").addClass("hidden"); 66 | if (node) { 67 | node.innerHTML = null; 68 | } 69 | }); 70 | } 71 | } 72 | if (log) { 73 | console.error(userMsg + " " + error.name); 74 | } 75 | return error; 76 | }, 77 | hide: function() { 78 | var node = dom.byId("calciteErrorMessage"); 79 | if (node) { 80 | query(".calcite-alert").addClass("hidden"); 81 | } 82 | }, 83 | log: function(errType, error) { 84 | var userMsg = Message.getMessage(errType, error); 85 | console.error(userMsg + " " + error.name); 86 | }, 87 | removeLoading: function() { 88 | domClass.remove(document.body, CSS.loading); 89 | } 90 | } 91 | 92 | Message.CSS = CSS; 93 | Message.type = Type; 94 | Message.getMessage = _getMessage; 95 | 96 | return Message; 97 | }); -------------------------------------------------------------------------------- /app/base/padding.js: -------------------------------------------------------------------------------- 1 | /* 2 | | Copyright 2016 Esri 3 | | 4 | | Licensed under the Apache License, Version 2.0 (the "License"); 5 | | you may not use this file except in compliance with the License. 6 | | You may obtain a copy of the License at 7 | | 8 | | http://www.apache.org/licenses/LICENSE-2.0 9 | | 10 | | Unless required by applicable law or agreed to in writing, software 11 | | distributed under the License is distributed on an "AS IS" BASIS, 12 | | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | | See the License for the specific language governing permissions and 14 | | limitations under the License. 15 | */ 16 | define([], function () { 17 | 18 | var PADDING = { 19 | topSmall: { 20 | viewPadding: { top: 40 , bottom: 0 }, 21 | uiPadding: { top: 15, bottom: 30 }, 22 | hidden: { top: 0 , bottom: 0 } 23 | }, 24 | topSmallMargin: { 25 | viewPadding: { top: 50 , bottom: 0 }, 26 | uiPadding: { top: 15, bottom: 30 }, 27 | hidden: { top: 0 , bottom: 0 } 28 | }, 29 | topMedium: { // Default 30 | viewPadding: { top: 50 , bottom: 0 }, 31 | uiPadding: { top: 15, bottom: 30 }, 32 | hidden: { top: 0 , bottom: 0 } 33 | }, 34 | topMediumMargin: { 35 | viewPadding: { top: 65 , bottom: 0 }, 36 | uiPadding: { top: 15, bottom: 30 }, 37 | hidden: { top: 0 , bottom: 0 } 38 | }, 39 | topLarge: { 40 | viewPadding: { top: 60 , bottom: 0 }, 41 | uiPadding: { top: 15, bottom: 30 }, 42 | hidden: { top: 0 , bottom: 0 } 43 | }, 44 | topLargeMargin: { 45 | viewPadding: { top: 75 , bottom: 0 }, 46 | uiPadding: { top: 15, bottom: 30 }, 47 | hidden: { top: 0 , bottom: 0 } 48 | }, 49 | bottomSmall: { 50 | viewPadding: { top: 0 , bottom: 40 }, 51 | uiPadding: { top: 30, bottom: 15 }, 52 | hidden: { top: 0 , bottom: 0 } 53 | }, 54 | bottomSmallMargin: { 55 | viewPadding: { top: 0 , bottom: 40 }, 56 | uiPadding: { top: 15, bottom: 30 }, 57 | hidden: { top: 0 , bottom: 0 } 58 | }, 59 | bottomMedium: { 60 | viewPadding: { top: 0 , bottom: 50 }, 61 | uiPadding: { top: 30, bottom: 15 }, 62 | hidden: { top: 0 , bottom: 0 } 63 | }, 64 | bottomMediumMargin: { 65 | viewPadding: { top: 0 , bottom: 65 }, 66 | uiPadding: { top: 30, bottom: 15 }, 67 | hidden: { top: 0 , bottom: 0 } 68 | }, 69 | bottomLarge: { 70 | viewPadding: { top: 0, bottom: 60 }, 71 | uiPadding: { top: 30, bottom: 15 }, 72 | hidden: { top: 0 , bottom: 0 } 73 | }, 74 | bottomLargeMargin: { 75 | viewPadding: { top: 0 , bottom: 75 }, 76 | uiPadding: { top: 30, bottom: 15 }, 77 | hidden: { top: 0 , bottom: 0 } 78 | } 79 | } 80 | 81 | return PADDING; 82 | }); -------------------------------------------------------------------------------- /app/base/selectors.js: -------------------------------------------------------------------------------- 1 | /* 2 | | Copyright 2016 Esri 3 | | 4 | | Licensed under the Apache License, Version 2.0 (the "License"); 5 | | you may not use this file except in compliance with the License. 6 | | You may obtain a copy of the License at 7 | | 8 | | http://www.apache.org/licenses/LICENSE-2.0 9 | | 10 | | Unless required by applicable law or agreed to in writing, software 11 | | distributed under the License is distributed on an "AS IS" BASIS, 12 | | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | | See the License for the specific language governing permissions and 14 | | limitations under the License. 15 | */ 16 | define([], function () { 17 | 18 | // CALCITE_SELECTORS.mapContainer 19 | // CALCITE_SELECTORS.panels 20 | // CALCITE_SELECTORS.title 21 | 22 | var CALCITE_SELECTORS = { 23 | body: document.body, 24 | mapContainer: ".calcite-map", 25 | navbar: ".calcite-navbar", 26 | title: ".calcite-title", 27 | mainTitle: ".calcite-title-main", 28 | subTitle: ".calcite-title-sub", 29 | titleDivider: ".calcite-title-divider", 30 | dropdown: ".calcite-dropdown", 31 | dropdownToggle: ".calcite-dropdown-toggle", 32 | dropdownMenu: ".calcite-dropdown .dropdown-menu", 33 | dropdownMenuTitle: ".calcite-dropdown-toggle > span", 34 | menuAbout: "#menuAbout", 35 | menuLegend: "#menuLegend", 36 | menuLayers: "#menuLayers", 37 | menuBasemaps: "#menuBasemaps", 38 | menuSlides: "#menuSlides", 39 | menuPrint: "#menuPrint", 40 | menuShare: "#menuShare", 41 | menuToggleNav: "#menuToggleNav", 42 | widgetSearchContainer: ".calcite-navbar-search", 43 | widgetlegendContainer: ".calcite-panel-legend", 44 | panels: ".calcite-panels", 45 | panelsPanel: ".calcite-panels .panel", 46 | panelBody: ".panel-body", 47 | panelTitle: ".panel-label", 48 | panelAbout: "#panelAbout", 49 | panelLegend: "#panelLegend", 50 | panelLayers: "#panelLayers", 51 | panelBasemaps: "#panelBasemaps", 52 | panelSlides: "#panelSlides", 53 | panelPrint: "#panelPrint", 54 | panelShare: "#panelShare", 55 | carouselSlides: "#carouselSlides" 56 | 57 | } 58 | 59 | return CALCITE_SELECTORS; 60 | }); -------------------------------------------------------------------------------- /app/base/styles.js: -------------------------------------------------------------------------------- 1 | /* 2 | | Copyright 2016 Esri 3 | | 4 | | Licensed under the Apache License, Version 2.0 (the "License"); 5 | | you may not use this file except in compliance with the License. 6 | | You may obtain a copy of the License at 7 | | 8 | | http://www.apache.org/licenses/LICENSE-2.0 9 | | 10 | | Unless required by applicable law or agreed to in writing, software 11 | | distributed under the License is distributed on an "AS IS" BASIS, 12 | | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | | See the License for the specific language governing permissions and 14 | | limitations under the License. 15 | */ 16 | define([], function () { 17 | 18 | // CALCITE_STYLES.THEME.bgLight 19 | // CALCITE_STYLES.THEME.WIDGETS.dark 20 | // CALCITE_STYLES.LAYOUT.THEME.small 21 | // CALCITE_STYLES.LAYOUT.NAV.POSITION.top 22 | // CALCITE_STYLES.LAYOUT.PANELS.left 23 | 24 | var CALCITE_STYLES = { 25 | calciteMaps: "calcite-maps", 26 | bgLight: "calcite-bg-light", // default 27 | bgDark: "calcite-bg-dark", 28 | bgCustom: "calcite-bg-custom", 29 | textLight: "calcite-text-light", 30 | textDark: "calcite-text-dark", // default 31 | widgetsDark: "calcite-widgets-dark", 32 | widgetsLight: "", // default 33 | menuDrawer: "calcite-menu-drawer", 34 | rgbaDefault: "", // default (no bg color), // TODO 35 | null: "", // TODO 36 | layoutThemeSmall: "calcite-layout-small-title", 37 | layoutThemeLarge: "calcite-layout-large-title", 38 | layoutThemeInlineRight: "calcite-layout-inline-right", 39 | layoutThemeInlineLeft: "calcite-layout-inline-left", 40 | navPositionTop: "calcite-nav-top", 41 | navPositionBottom: "calcite-nav-bottom", 42 | navPositionTopFixed: "calcite-nav-top-fixed", 43 | navPositionBottomFixed: "calcite-nav-bottom-fixed", 44 | navMarginTop:"calcite-margin-top", 45 | navMarginBottom:"calcite-margin-bottom", 46 | navMarginAll:"calcite-margin-all", 47 | navFixedTop: "navbar-fixed-top", 48 | navFixedBottom: "navbar-fixed-bottom", 49 | navMiniBar: "calcite-nav-transparent", 50 | calcitePanels: "calcite-panels", 51 | panelsLeft: "calcite-panels-left", 52 | panelsRight: "calcite-panels-right", 53 | calciteMap: "calcite-map" 54 | } 55 | 56 | CALCITE_STYLES.ALL = { 57 | body: CALCITE_STYLES.layoutThemeSmall + " " + CALCITE_STYLES.layoutThemeLarge + " " + CALCITE_STYLES.layoutThemeInlineLeft + " " + CALCITE_STYLES.layoutThemeInlineRight + " " + 58 | CALCITE_STYLES.navPositionTop + " " + CALCITE_STYLES.navPositionBottom + " " + CALCITE_STYLES.navPositionTopFixed + " " + CALCITE_STYLES.navPositionBottomFixed + " " + 59 | CALCITE_STYLES.navMarginTop + " " + CALCITE_STYLES.navMarginBottom + " " + CALCITE_STYLES.navMarginAll + " " + 60 | CALCITE_STYLES.navMiniBar + " " + 61 | CALCITE_STYLES.panelsLeft + " " + CALCITE_STYLES.panelsRight, 62 | navbar: CALCITE_STYLES.navFixedTop + " " + CALCITE_STYLES.navFixedBottom, 63 | panels: CALCITE_STYLES.panelsLeft + " " + CALCITE_STYLES.panelsRight 64 | } 65 | 66 | return CALCITE_STYLES; 67 | 68 | }); -------------------------------------------------------------------------------- /app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_400.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/calcite-maps-styler-template/0dc454d398d03cfc2da29cfa2934a79275c0836c/app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_400.eot -------------------------------------------------------------------------------- /app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/calcite-maps-styler-template/0dc454d398d03cfc2da29cfa2934a79275c0836c/app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_400.ttf -------------------------------------------------------------------------------- /app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/calcite-maps-styler-template/0dc454d398d03cfc2da29cfa2934a79275c0836c/app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_400.woff -------------------------------------------------------------------------------- /app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/calcite-maps-styler-template/0dc454d398d03cfc2da29cfa2934a79275c0836c/app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_400.woff2 -------------------------------------------------------------------------------- /app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_600.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/calcite-maps-styler-template/0dc454d398d03cfc2da29cfa2934a79275c0836c/app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_600.eot -------------------------------------------------------------------------------- /app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_600.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/calcite-maps-styler-template/0dc454d398d03cfc2da29cfa2934a79275c0836c/app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_600.ttf -------------------------------------------------------------------------------- /app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_600.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/calcite-maps-styler-template/0dc454d398d03cfc2da29cfa2934a79275c0836c/app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_600.woff -------------------------------------------------------------------------------- /app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_600.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/calcite-maps-styler-template/0dc454d398d03cfc2da29cfa2934a79275c0836c/app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_600.woff2 -------------------------------------------------------------------------------- /app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_Italic_400.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/calcite-maps-styler-template/0dc454d398d03cfc2da29cfa2934a79275c0836c/app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_Italic_400.eot -------------------------------------------------------------------------------- /app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_Italic_400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/calcite-maps-styler-template/0dc454d398d03cfc2da29cfa2934a79275c0836c/app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_Italic_400.ttf -------------------------------------------------------------------------------- /app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_Italic_400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/calcite-maps-styler-template/0dc454d398d03cfc2da29cfa2934a79275c0836c/app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_Italic_400.woff -------------------------------------------------------------------------------- /app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_Italic_400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/calcite-maps-styler-template/0dc454d398d03cfc2da29cfa2934a79275c0836c/app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_Italic_400.woff2 -------------------------------------------------------------------------------- /app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_Italic_600.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/calcite-maps-styler-template/0dc454d398d03cfc2da29cfa2934a79275c0836c/app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_Italic_600.eot -------------------------------------------------------------------------------- /app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_Italic_600.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/calcite-maps-styler-template/0dc454d398d03cfc2da29cfa2934a79275c0836c/app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_Italic_600.ttf -------------------------------------------------------------------------------- /app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_Italic_600.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/calcite-maps-styler-template/0dc454d398d03cfc2da29cfa2934a79275c0836c/app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_Italic_600.woff -------------------------------------------------------------------------------- /app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_Italic_600.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/calcite-maps-styler-template/0dc454d398d03cfc2da29cfa2934a79275c0836c/app/calcite-maps/fonts/avenir-next/Avenir_Next_W00_Italic_600.woff2 -------------------------------------------------------------------------------- /app/calcite-maps/fonts/bootstrap/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/calcite-maps-styler-template/0dc454d398d03cfc2da29cfa2934a79275c0836c/app/calcite-maps/fonts/bootstrap/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /app/calcite-maps/fonts/bootstrap/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/calcite-maps-styler-template/0dc454d398d03cfc2da29cfa2934a79275c0836c/app/calcite-maps/fonts/bootstrap/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /app/calcite-maps/fonts/bootstrap/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/calcite-maps-styler-template/0dc454d398d03cfc2da29cfa2934a79275c0836c/app/calcite-maps/fonts/bootstrap/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /app/calcite-maps/fonts/bootstrap/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/calcite-maps-styler-template/0dc454d398d03cfc2da29cfa2934a79275c0836c/app/calcite-maps/fonts/bootstrap/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /app/calcite-maps/fonts/calcite/calcite-ui.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/calcite-maps-styler-template/0dc454d398d03cfc2da29cfa2934a79275c0836c/app/calcite-maps/fonts/calcite/calcite-ui.eot -------------------------------------------------------------------------------- /app/calcite-maps/fonts/calcite/calcite-ui.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/calcite-maps-styler-template/0dc454d398d03cfc2da29cfa2934a79275c0836c/app/calcite-maps/fonts/calcite/calcite-ui.ttf -------------------------------------------------------------------------------- /app/calcite-maps/fonts/calcite/calcite-ui.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Esri/calcite-maps-styler-template/0dc454d398d03cfc2da29cfa2934a79275c0836c/app/calcite-maps/fonts/calcite/calcite-ui.woff -------------------------------------------------------------------------------- /app/calcite-maps/js/dojo/calcitemaps-arcgis-support-v0.10.js: -------------------------------------------------------------------------------- 1 | /* ======================================================================== 2 | * Calcite Maps: calcitemaps-arcgis-support.js v0.4 (dojo) 3 | * ======================================================================== 4 | * Generic handlers for mapping-specific UI 5 | * 6 | * ======================================================================== */ 7 | 8 | define([ 9 | "dojo/_base/declare", 10 | "dojo/_base/lang", 11 | "dojo/query", 12 | "dojo/on", 13 | "dojo/domReady!" 14 | ], function(declare, lang, query, on) { 15 | 16 | var CalciteMapsArcGISSupport = declare(null, { 17 | 18 | searchEventsSet: false, 19 | 20 | constructor: function () { 21 | this._syncTabs(); 22 | }, 23 | 24 | //-------------------------------------------------------------------------- 25 | // 26 | // Private 27 | // 28 | //-------------------------------------------------------------------------- 29 | 30 | _syncTabs: function() { 31 | query(".calcite-navbar li a[data-toggle='tab']").on("click", function(e) { 32 | query(".calcite-navbar li.active").removeClass("active"); 33 | query(e.target).addClass("active"); 34 | }); 35 | }, 36 | 37 | //-------------------------------------------------------------------------- 38 | // 39 | // Public 40 | // 41 | //-------------------------------------------------------------------------- 42 | 43 | //---------------------------------- 44 | // Popup/Panel Synchronization - TODO 45 | //---------------------------------- 46 | 47 | setPopupPanelSync: function(view) { 48 | 49 | if (!view) { 50 | return; 51 | } 52 | 53 | var popup = view.popup; 54 | var screenSize = view.size; 55 | 56 | view.watch("size", function viewSizeChange(size) { 57 | if (screenSize[0] !== size[0] || screenSize[1] !== size[1]) { 58 | screenSize = size; 59 | setPanelVisibility(); 60 | } 61 | }); 62 | 63 | // Popups - Listen to popup changes to show/hide panels 64 | popup.watch(["visible", "dockEnabled", "currentDockPosition"], setPanelVisibility); 65 | 66 | function isDesktopCollision() { 67 | var collision = false; 68 | var panelsRight = query(".calcite-panels-right"); 69 | if (panelsRight.length > 0) { 70 | collision = (popup.currentDockPosition && popup.currentDockPosition === "top-right"); 71 | } else { 72 | collision = (popup.currentDockPosition && popup.currentDockPosition === "top-left") 73 | } 74 | return collision; 75 | } 76 | 77 | function setPanelVisibility() { 78 | var isMobileScreen = view.widthBreakpoint === "xsmall" || view.widthBreakpoint === "small"; 79 | var isDocked = popup.visible && popup.dockEnabled; 80 | var isDockedBottom = view.popup.currentDockPosition && view.popup.currentDockPosition.indexOf("bottom") > -1; 81 | 82 | // Mobile (xsmall/small) 83 | if (isMobileScreen) { 84 | if (isDocked && isDockedBottom) { 85 | query(".calcite-panels").addClass("invisible"); 86 | } else { 87 | query(".calcite-panels").removeClass("invisible"); 88 | } 89 | } else { // Desktop (medium+) 90 | if (isDocked && isDesktopCollision()) { 91 | query(".calcite-panels").addClass("invisible"); 92 | } else { 93 | query(".calcite-panels").removeClass("invisible"); 94 | } 95 | } 96 | } 97 | 98 | // Panels - Listen to panel changes to hide popup at mobile size 99 | query(".calcite-panels .panel").on("show.bs.collapse", function(e) { 100 | if (view.popup.dockEnabled || view.widthBreakpoint === "xsmall") { 101 | view.popup.dockEnabled = false; 102 | } 103 | }); 104 | }, 105 | 106 | //---------------------------------- 107 | // Search Expander 108 | //---------------------------------- 109 | 110 | setSearchExpandEvents: function(search) { 111 | 112 | if (!search) { 113 | return; 114 | } 115 | 116 | function setExpanded(e, expand) { 117 | var searchExpander = query(".calcite-search-expander .esri-search"); 118 | if (searchExpander && searchExpander.length > 0) { 119 | if (expand) { 120 | query(searchExpander[0]).addClass("calcite-search-expanded"); 121 | search._expanded = true; 122 | } else { 123 | query(searchExpander[0]).removeClass("calcite-search-expanded"); 124 | search._expanded = false; 125 | } 126 | } 127 | } 128 | 129 | // Set-up handlers 130 | var handle = query(".calcite-search-expander").on("click", function(e) { 131 | if (!this.searchEventsSet) { 132 | 133 | // Initial expand 134 | setExpanded(e, true); 135 | 136 | // Expand search 137 | query(".calcite-search-expander .esri-search__submit-button").on("click", function(e){ 138 | if (!search._expanded) { 139 | setExpanded(e, true); 140 | } 141 | }.bind(this)); 142 | 143 | // Collapse search 144 | search.view.on("immediate-click", function(e){ 145 | if (search._expanded) { 146 | setExpanded(e, false); 147 | } 148 | }); 149 | 150 | this.searchEventsSet = true; 151 | handle.remove(); 152 | } 153 | }.bind(this)); 154 | } 155 | 156 | }); 157 | 158 | return new CalciteMapsArcGISSupport(); 159 | }); -------------------------------------------------------------------------------- /app/calcite-maps/js/dojo/calcitemaps-v0.10.js: -------------------------------------------------------------------------------- 1 | /* ======================================================================== 2 | * Calcite Maps: calcitemaps.js v0.2 (dojo) 3 | * ======================================================================== 4 | * Generic handlers for mapping-specific UI 5 | * 6 | * ======================================================================== */ 7 | 8 | define([ 9 | "dojo/_base/declare", 10 | "dojo/_base/lang", 11 | "dojo/query", 12 | "dojo/dom-class", 13 | "dojo/on", 14 | "dojo/domReady!" 15 | ], function(declare, lang, query, domClass, on) { 16 | 17 | var CalciteMaps = declare(null, { 18 | 19 | constructor: function () { 20 | 21 | this.initEvents(); 22 | 23 | }, 24 | 25 | //-------------------------------------------------------------------------- 26 | // 27 | // Public 28 | // 29 | //-------------------------------------------------------------------------- 30 | 31 | dropdownMenuItemSelector: ".calcite-navbar .calcite-dropdown li > a", 32 | 33 | autoCollapsePanel: true, 34 | 35 | preventOverscrolling: true, 36 | 37 | activePanel: null, 38 | 39 | stickyDropdownDesktop: false, 40 | 41 | stickyDropdownMobile: false, 42 | 43 | stickyDropdownBreakpoint: 768, 44 | 45 | //---------------------------------- 46 | // Initialize Handlers 47 | //---------------------------------- 48 | 49 | initEvents: function() { 50 | 51 | this.setDropdownItemEvents(); 52 | this.setDropdownToggleEvents(); 53 | this.setToggleNavbarClick(); 54 | this.setPanelEvents(); 55 | 56 | }, 57 | 58 | //---------------------------------- 59 | // Dropdown Menu Item Events 60 | //---------------------------------- 61 | 62 | setDropdownItemEvents: function() { 63 | 64 | var funcContext = function setNavbarEvents(e) { 65 | 66 | if (e.type === "keydown" && e.keyCode !== 13) { 67 | return; 68 | } 69 | 70 | var isPanel = false, 71 | panel = null, 72 | panelBody = null, 73 | panels = null; 74 | 75 | if (e.currentTarget.dataset.target) { 76 | panel = query(e.currentTarget.dataset.target); 77 | if (panel.length > 0) { 78 | isPanel = domClass.contains(panel[0], "panel"); 79 | } 80 | } 81 | 82 | // Toggle panels 83 | if (isPanel && panel) { 84 | // Close all panels and bodies 85 | query(panel).parent().query(".panel, .panel-collapse").removeClass("in"); 86 | // Show body 87 | query(panel).collapse("show").query(".panel-collapse").collapse("show"); 88 | // Set focus 89 | if (e.keyCode === 13) { 90 | panel.query(".panel-toggle")[0].focus(); 91 | } 92 | // Dismiss dropdown automatically 93 | var isMobile = window.innerWidth < this.stickyDropdownBreakpoint; 94 | if (isMobile && !this.stickyDropdownMobile || !isMobile && !this.stickyDropdownDesktop) { 95 | var toggle = query(".calcite-dropdown .dropdown-toggle")[0]; 96 | on.emit(toggle, "click", { bubbles: true, cancelable: true }); 97 | } 98 | // Set active panel 99 | this.activePanel = panel; 100 | } 101 | }.bind(this); 102 | 103 | // Show/hide panels 104 | 105 | query(this.dropdownMenuItemSelector).on(["click","keydown"], lang.hitch(this, funcContext)); 106 | 107 | }, 108 | 109 | //---------------------------------- 110 | // Manually show/hide the dropdown 111 | //---------------------------------- 112 | 113 | setDropdownToggleEvents: function() { 114 | 115 | // Manually show/hide the dropdown 116 | query(".calcite-dropdown .dropdown-toggle").on(["click","keydown"], function (e) { 117 | if (e.type === "keydown" && e.keyCode !== 13) { 118 | return; 119 | } 120 | query(this).parent().toggleClass("open"); 121 | query(".calcite-dropdown-toggle").toggleClass("open"); 122 | }); 123 | 124 | query(".calcite-dropdown").on("hide.bs.dropdown", function () { 125 | query(".calcite-dropdown-toggle").removeClass("open"); 126 | }); 127 | 128 | // Submenu 129 | 130 | // Dismiss dropdown menu 131 | query(window).on("click", function (e) { 132 | var menu = query(".calcite-dropdown.open")[0]; 133 | if (menu) { 134 | if (query(e.target).closest(".calcite-dropdown").length === 0) { 135 | query(menu).removeClass("open"); 136 | query(".calcite-dropdown-toggle").removeClass("open"); 137 | } 138 | } 139 | }); 140 | }, 141 | 142 | //---------------------------------- 143 | // Toggle navbar hidden 144 | //---------------------------------- 145 | 146 | setToggleNavbarClick: function() { 147 | 148 | query("#calciteToggleNavbar").on("click", function(e) { 149 | if (!domClass.contains(query("body")[0],"calcite-nav-hidden")) { 150 | query("body").addClass("calcite-nav-hidden"); 151 | } else { 152 | query("body").removeClass("calcite-nav-hidden"); 153 | } 154 | var menu = query(".calcite-dropdown .dropdown-toggle")[0]; 155 | if (menu) { 156 | on.emit(menu, "click", { bubbles: true, cancelable: true }); 157 | } 158 | }); 159 | 160 | }, 161 | 162 | //---------------------------------- 163 | // Panel Collapse Events 164 | //---------------------------------- 165 | 166 | setPanelEvents: function() { 167 | 168 | if (this.autoCollapsePanel) { 169 | // Hide 170 | query(".calcite-panels .panel .panel-collapse").on("hidden.bs.collapse", function(e) { 171 | query(e.target.parentNode).query(".panel-label, .panel-close").addClass("visible-mobile-only"); 172 | }); 173 | //Show 174 | query(".calcite-panels .panel .panel-collapse").on("show.bs.collapse", function(e) { 175 | query(e.target.parentNode).query(".panel-label, .panel-close").removeClass("visible-mobile-only"); 176 | }); 177 | } 178 | 179 | } 180 | 181 | }); 182 | 183 | return new CalciteMaps(); 184 | }); -------------------------------------------------------------------------------- /app/calcite-maps/vendor/dojo-bootstrap/Affix.js: -------------------------------------------------------------------------------- 1 | /* ========================================================== 2 | * Affix.js v3.0.0 3 | * ========================================================== 4 | * Copyright 2012 xsokev 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 | 19 | define([ 20 | './Support', 21 | 'dojo/_base/declare', 22 | 'dojo/query', 23 | 'dojo/_base/lang', 24 | 'dojo/_base/window', 25 | 'dojo/on', 26 | 'dojo/dom-class', 27 | 'dojo/dom-construct', 28 | 'dojo/dom-attr', 29 | 'dojo/dom-style', 30 | 'dojo/dom-geometry', 31 | 'dojo/NodeList-dom', 32 | 'dojo/NodeList-traverse', 33 | 'dojo/domReady!' 34 | ], function (support, declare, query, lang, win, on, domClass, domConstruct, domAttr, domStyle, domGeom) { 35 | "use strict"; 36 | 37 | var spySelector = '[data-spy=affix]'; 38 | var Affix = declare([], { 39 | defaultOptions:{ 40 | offset: 0 41 | }, 42 | constructor:function (element, options) { 43 | this.options = lang.mixin(lang.clone(this.defaultOptions), (options || {})); 44 | this.domNode = element; 45 | on(win.global, 'scroll', lang.hitch(this, 'checkPosition')); 46 | on(win.global, 'click', lang.hitch(this, (function () { setTimeout(lang.hitch(this, 'checkPosition'), 1); }))); 47 | this.checkPosition(); 48 | }, 49 | checkPosition: function() { 50 | if (domStyle.get(this.domNode, 'display') === 'none') { return; } 51 | 52 | var pos = domGeom.position(this.domNode, false), 53 | scrollHeight = win.doc.height, 54 | scrollTop = win.global.scrollY, 55 | offset = this.options.offset, 56 | reset = 'affix affix-top affix-bottom', 57 | affix, 58 | offsetTop, 59 | offsetBottom; 60 | 61 | if (typeof offset !== 'object') { 62 | offsetBottom = offsetTop = offset; 63 | } else { 64 | if (typeof offset.top === 'function') { 65 | offsetTop = offset.top(); 66 | } else { 67 | offsetTop = offset.top || 0; 68 | } 69 | if (typeof offset.bottom === 'function') { 70 | offsetBottom = offset.bottom(); 71 | } else { 72 | offsetBottom = offset.bottom || 0; 73 | } 74 | } 75 | 76 | affix = this.unpin !== null && (scrollTop + this.unpin <= pos.y) ? 77 | false : offsetBottom !== null && (pos.y + pos.h >= scrollHeight - offsetBottom) ? 78 | 'bottom' : offsetTop !== null && scrollTop <= offsetTop ? 79 | 'top' : false; 80 | 81 | if (this.affixed === affix) { return; } 82 | 83 | this.affixed = affix; 84 | this.unpin = affix === 'bottom' ? pos.y - scrollTop : null; 85 | 86 | query(this.domNode).removeClass(reset).addClass('affix' + (affix ? '-' + affix : '')); 87 | } 88 | }); 89 | 90 | lang.extend(query.NodeList, { 91 | affix:function (option) { 92 | var options = (lang.isObject(option)) ? option : {}; 93 | return this.forEach(function (node) { 94 | var data = support.getData(node, 'affix'); 95 | if (!data) { 96 | support.setData(node, 'affix', (data = new Affix(node, options))); 97 | } 98 | if (lang.isString(option)) { 99 | data[option].call(data); 100 | } 101 | }); 102 | } 103 | }); 104 | 105 | query(spySelector).forEach(function (node) { 106 | var data = support.getData(node); 107 | data.offset = data.offset || {}; 108 | if(data['offset-bottom']) { data.offset.bottom = data['offset-bottom']; } 109 | if(data['offset-top']) { data.offset.top = data['offset-top']; } 110 | query(node).affix(data); 111 | }); 112 | 113 | return Affix; 114 | }); -------------------------------------------------------------------------------- /app/calcite-maps/vendor/dojo-bootstrap/Alert.js: -------------------------------------------------------------------------------- 1 | /* ========================================================== 2 | * Alert.js v3.0.0 3 | * ========================================================== 4 | * Copyright 2012 xsokev 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 | 19 | define([ 20 | './Support', 21 | "dojo/_base/declare", 22 | "dojo/query", 23 | "dojo/_base/lang", 24 | 'dojo/_base/window', 25 | 'dojo/on', 26 | 'dojo/dom-class', 27 | 'dojo/dom-construct', 28 | "dojo/dom-attr", 29 | "dojo/NodeList-dom", 30 | 'dojo/NodeList-traverse', 31 | "dojo/domReady!" 32 | ], function (support, declare, query, lang, win, on, domClass, domConstruct, domAttr) { 33 | "use strict"; 34 | 35 | var dismissSelector = '[data-dismiss="alert"]'; 36 | var Alert = declare([], { 37 | defaultOptions:{}, 38 | constructor:function (element, options) { 39 | this.options = lang.mixin(lang.clone(this.defaultOptions), (options || {})); 40 | this.domNode = element; 41 | on(this.domNode, on.selector(dismissSelector, 'click'), lang.hitch(this, close)); 42 | } 43 | }); 44 | 45 | function close(e) { 46 | var _this = this; 47 | var selector = domAttr.get(_this, 'data-target'); 48 | if (!selector) { 49 | selector = support.hrefValue(_this); 50 | } 51 | var targetNode; 52 | if (selector && selector !== '#' && selector !== '') { 53 | targetNode = query(selector); 54 | } else { 55 | targetNode = domClass.contains(query(_this)[0], 'alert') ? query(_this) : query(_this).parent(); 56 | } 57 | 58 | if (e) { e.stopPropagation(); } 59 | 60 | on.emit(targetNode[0], 'close.bs.modal', {bubbles:true, cancelable:true}); 61 | domClass.remove(targetNode[0], 'in'); 62 | 63 | function _remove() { 64 | on.emit(targetNode[0], 'closed.bs.modal', {bubbles:true, cancelable:true}); 65 | domConstruct.destroy(targetNode[0]); 66 | } 67 | var transition = support.trans && domClass.contains(targetNode[0], 'fade'); 68 | if (transition) { on(targetNode[0], support.trans.end, _remove); } else { _remove(); } 69 | if (e) { e.preventDefault(); } 70 | return false; 71 | } 72 | 73 | lang.extend(query.NodeList, { 74 | alert:function (option) { 75 | var options = (lang.isObject(option)) ? option : {}; 76 | return this.forEach(function (node) { 77 | var data = support.getData(node, 'alert'); 78 | if (!data) { 79 | support.setData(node, 'alert', (data = new Alert(node, options))); 80 | } 81 | if (lang.isString(option) && option === "close") { 82 | close.call(node); 83 | } 84 | }); 85 | } 86 | }); 87 | on(win.body(), on.selector(dismissSelector, 'click'), close); 88 | 89 | return Alert; 90 | }); -------------------------------------------------------------------------------- /app/calcite-maps/vendor/dojo-bootstrap/Button.js: -------------------------------------------------------------------------------- 1 | /* ========================================================== 2 | * Button.js v3.0.0 3 | * ========================================================== 4 | * Copyright 2012 xsokev 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 | 19 | define([ 20 | "./Support", 21 | "dojo/_base/declare", 22 | "dojo/query", 23 | "dojo/_base/lang", 24 | 'dojo/_base/window', 25 | 'dojo/on', 26 | 'dojo/dom-class', 27 | "dojo/dom-attr", 28 | "dojo/NodeList-dom", 29 | 'dojo/NodeList-traverse', 30 | "dojo/domReady!" 31 | ], function (support, declare, query, lang, win, on, domClass, domAttr) { 32 | "use strict"; 33 | 34 | var toggleSelector = '[data-toggle^=button]'; 35 | var toggleRadioSelector = '[data-toggle="buttons-radio"]'; 36 | var Button = declare([], { 37 | defaultOptions:{ 38 | "loading-text":'loading...' 39 | }, 40 | constructor:function (element, options) { 41 | this.options = lang.mixin(lang.clone(this.defaultOptions), (options || {})); 42 | this.domNode = element; 43 | }, 44 | setState:function (state) { 45 | var _this = this; 46 | var d = 'disabled'; 47 | support.getData(this.domNode, 'reset-text', lang.trim((this.domNode.tag === "INPUT") ? this.domNode.val : this.domNode.innerHTML)); 48 | state = state + '-text'; 49 | var data = support.getData(this.domNode, state); 50 | this.domNode[(this.domNode.tag === "INPUT") ? "val" : "innerHTML"] = data || this.options[state]; 51 | 52 | setTimeout(function () { 53 | if (state === 'loading-text') { 54 | domClass.add(_this.domNode, d); 55 | domAttr.set(_this.domNode, d, d); 56 | } else { 57 | domClass.remove(_this.domNode, d); 58 | domAttr.remove(_this.domNode, d); 59 | } 60 | }, 0); 61 | }, 62 | toggle:function () { 63 | var $parent = query(this.domNode).parents(toggleRadioSelector); 64 | if ($parent.length) { 65 | query('.active', $parent[0]).removeClass('active'); 66 | } 67 | domClass.toggle(this.domNode, 'active'); 68 | this.domNode.blur(); 69 | } 70 | }); 71 | 72 | lang.extend(query.NodeList, { 73 | button:function (option) { 74 | var options = (lang.isObject(option)) ? option : {}; 75 | return this.forEach(function (node) { 76 | var data = support.getData(node, 'button'); 77 | if (!data) { 78 | support.setData(node, 'button', (data = new Button(node, options))); 79 | } 80 | if (lang.isString(option) && option === 'toggle') { 81 | data.toggle(); 82 | } 83 | else if (option) { 84 | data.setState(option); 85 | } 86 | }); 87 | } 88 | }); 89 | 90 | on(win.body(), on.selector(toggleSelector, '.btn:click'), function (e) { 91 | var btn = e.target; 92 | if (!domClass.contains(btn, 'btn')){ 93 | btn = query(btn).closest('.btn'); 94 | } 95 | query(btn).button('toggle'); 96 | }); 97 | 98 | return Button; 99 | }); -------------------------------------------------------------------------------- /app/calcite-maps/vendor/dojo-bootstrap/Carousel.js: -------------------------------------------------------------------------------- 1 | /* ========================================================== 2 | * Carousel.js v3.0.0 3 | * ========================================================== 4 | * Copyright 2012 xsokev 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 | define([ 19 | "dojo/_base/declare", 20 | "dojo/_base/sniff", 21 | "dojo/query", 22 | "dojo/_base/lang", 23 | "dojo/_base/window", 24 | "dojo/on", 25 | "dojo/dom-class", 26 | "dojo/dom-attr", 27 | "dojo/dom-construct", 28 | 'dojo/mouse', 29 | "dojo/dom-geometry", 30 | "dojo/dom-style", 31 | "dojo/_base/array", 32 | "./Support", 33 | "dojo/NodeList-traverse", 34 | "dojo/NodeList-dom", 35 | "dojo/domReady!" 36 | ], function (declare, sniff, query, lang, win, on, domClass, domAttr, domConstruct, mouse, domGeom, domStyle, array, support) { 37 | "use strict"; 38 | 39 | var slideSelector = '[data-slide]'; 40 | var Carousel = declare([], { 41 | defaultOptions: { 42 | interval: 3000, 43 | pause: 'hover' 44 | }, 45 | constructor: function (element, options) { 46 | this.options = lang.mixin(lang.clone(this.defaultOptions), (options || {})); 47 | this.domNode = element; 48 | this.indicators = query('.carousel-indicators', this.domNode) 49 | if (this.options.slide) { this.slide(this.options.slide); } 50 | if (this.options.pause === 'hover') { 51 | on(this.domNode, mouse.enter, lang.hitch(this, 'pause')); 52 | on(this.domNode, mouse.leave, lang.hitch(this, 'cycle')); 53 | } 54 | if (this.options.interval) { this.cycle(); } 55 | }, 56 | cycle: function (e) { 57 | if (!e) { this.paused = false; } 58 | if (this.options.interval && !this.paused) { 59 | this.interval = setInterval(lang.hitch(this, 'next'), this.options.interval); 60 | } 61 | return this; 62 | }, 63 | to: function (pos) { 64 | var active = query('.item.active', this.domNode), 65 | children = active.parent().children(), 66 | activePos = children.indexOf(active[0]), 67 | _this = this; 68 | if (pos > (children.length - 1) || pos < 0) { return; } 69 | if (this.sliding) { 70 | return on.once(_this.domNode, 'slid', function () { 71 | _this.to(pos); 72 | }); 73 | } 74 | if (activePos === pos) { 75 | return this.pause().cycle(); 76 | } 77 | return this.slide((pos > activePos ? 'next' : 'prev'), query(children[pos])); 78 | }, 79 | pause: function (e) { 80 | if (!e) { this.paused = true; } 81 | if (query('.next, .prev', this.domNode).length && support.trans.end) { 82 | on.emit(this.domNode, support.trans.end, { bubbles:true, cancelable:true }); 83 | this.cycle(); 84 | } 85 | clearInterval(this.interval); 86 | this.interval = null; 87 | return this; 88 | }, 89 | next: function () { 90 | if (this.sliding) { return; } 91 | return this.slide('next'); 92 | }, 93 | prev: function () { 94 | if (this.sliding) { return; } 95 | return this.slide('prev'); 96 | }, 97 | getActiveIndex: function () { 98 | this.active = query('.item.active', this.domNode); 99 | this.items = this.active.parent().children('.item'); 100 | return this.items.indexOf(this.active[0]); 101 | }, 102 | slide: function (type, next) { 103 | var active = query('.item.active', this.domNode), 104 | isCycling = this.interval, 105 | direction = type === 'next' ? 'left' : 'right', 106 | fallback = type === 'next' ? 'first' : 'last', 107 | _this = this; 108 | next = next || active[type](); 109 | 110 | this.sliding = true; 111 | if (isCycling) { this.pause(); } 112 | 113 | if (this.indicators.length) { 114 | query('.active', this.indicators[0]).removeClass('active'); 115 | on.once(this.domNode, 'slid.bs.carousel', function() { 116 | var nextIndicator = _this.indicators.children()[_this.getActiveIndex()]; 117 | nextIndicator && domClass.add(nextIndicator, 'active'); 118 | }); 119 | } 120 | 121 | next = next.length ? next : query('.item', this.domNode)[fallback](); 122 | 123 | if (domClass.contains(next[0], 'active')) { return; } 124 | 125 | if (support.trans && domClass.contains(this.domNode, 'slide')) { 126 | on.emit(this.domNode, 'slide.bs.carousel', { bubbles:false, cancelable:false, relatedTarget: next[0] }); 127 | //if (e && e.defaultPrevented) { return; } 128 | domClass.add(next[0], type); 129 | next[0].offsetWidth; 130 | 131 | domClass.add(active[0], direction); 132 | domClass.add(next[0], direction); 133 | on.once(this.domNode, support.trans.end, function () { 134 | domClass.remove(next[0], [type, direction].join(' ')); 135 | domClass.add(next[0], 'active'); 136 | domClass.remove(active[0], ['active', direction].join(' ')); 137 | _this.sliding = false; 138 | setTimeout(function () { 139 | on.emit(_this.domNode, 'slid.bs.carousel', { bubbles:false, cancelable:false }); 140 | }, 0); 141 | }); 142 | } else { 143 | on.emit(this.domNode, 'slide.bs.carousel', { bubbles:false, cancelable:false, relatedTarget: next[0] }); 144 | domClass.remove(active[0], 'active'); 145 | domClass.add(next[0], 'active'); 146 | this.sliding = false; 147 | on.emit(_this.domNode, 'slid.bs.carousel', { bubbles:false, cancelable:false }); 148 | } 149 | 150 | if (isCycling) { this.cycle(); } 151 | return this; 152 | } 153 | }); 154 | 155 | lang.extend(query.NodeList, { 156 | carousel:function (option) { 157 | var options = (lang.isObject(option)) ? option : {}; 158 | return this.forEach(function (node) { 159 | var data = support.getData(node, 'carousel'); 160 | var action = typeof option === 'string' ? option : options.slide; 161 | if (!data) { support.setData(node, 'carousel', (data = new Carousel(node, options))); } 162 | if (typeof option === 'number') { data.to(option); } 163 | else if (action) { data[action].call(data); } 164 | }); 165 | } 166 | }); 167 | on(win.body(), on.selector(slideSelector, 'click'), function (e) { 168 | var target = domAttr.get(this, 'data-target') || support.hrefValue(this); 169 | var options = {}; 170 | if(!support.getData(target, 'collapse')){ 171 | options = lang.mixin({}, lang.mixin(support.getData(target), support.getData(this))); 172 | } 173 | query(target).carousel(options); 174 | e.preventDefault(); 175 | }); 176 | 177 | return Carousel; 178 | }); -------------------------------------------------------------------------------- /app/calcite-maps/vendor/dojo-bootstrap/Collapse.js: -------------------------------------------------------------------------------- 1 | /* ========================================================== 2 | * Collapse.js v3.0.0 3 | * ========================================================== 4 | * Copyright 2012 xsokev 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 | define([ 19 | './Support', 20 | 'dojo/_base/declare', 21 | 'dojo/query', 22 | 'dojo/_base/lang', 23 | 'dojo/_base/window', 24 | 'dojo/on', 25 | 'dojo/dom-class', 26 | 'dojo/dom-attr', 27 | 'dojo/dom-geometry', 28 | 'dojo/dom-style', 29 | 'dojo/NodeList-dom', 30 | 'dojo/NodeList-traverse', 31 | 'dojo/domReady!' 32 | ], function (support, declare, query, lang, win, on, domClass, domAttr, domGeom, domStyle) { 33 | "use strict"; 34 | var collapseSelector = '[data-toggle=collapse]'; 35 | var Collapse = declare([], { 36 | defaultOptions:{ 37 | toggle:true 38 | }, 39 | constructor:function (element, options) { 40 | this.options = lang.mixin(lang.clone(this.defaultOptions), (options || {})); 41 | this.domNode = element; 42 | this.transitioning = null; 43 | if (this.options.parent) { this.parent = query(this.options.parent); } 44 | if (this.options.toggle) { this.toggle(); } 45 | }, 46 | dimension:function () { 47 | return domClass.contains(this.domNode, 'width') ? 'width' : 'height'; 48 | }, 49 | show:function () { 50 | var dimension, scroll, actives, hasData; 51 | 52 | if (this.transitioning || domClass.con) { return; } 53 | if(this.parent && this.options.target) { 54 | query('[data-target=' + this.options.target + ']', this.parent[0]).forEach(function(el) { 55 | domClass.remove(el, 'collapsed'); 56 | }); 57 | } 58 | 59 | dimension = this.dimension(); 60 | scroll = support.toCamel(['scroll', dimension].join('-')); 61 | actives = this.parent && query('> .panel > .in', this.parent[0]); 62 | 63 | if (actives && actives.length) { 64 | hasData = support.getData(actives[0], 'collapse'); 65 | if (hasData && hasData.transitioning) { 66 | return; 67 | } 68 | actives.collapse('hide'); 69 | if (!hasData) { support.setData(actives[0], 'collapse', null); } 70 | } 71 | 72 | domStyle.set(this.domNode, dimension, '0px'); 73 | this.transition('add', 'show', 'shown'); 74 | if (support.trans) { domStyle.set(this.domNode, dimension, this.domNode[scroll] + 'px'); } 75 | }, 76 | hide:function () { 77 | if (this.transitioning || !domClass.contains(this.domNode, 'in')) { 78 | return; 79 | } 80 | if(this.parent && this.options.target) { 81 | query('[data-target=' + this.options.target + ']', this.parent[0]).forEach(function(el) { 82 | domClass.add(el, 'collapsed'); 83 | }); 84 | } 85 | 86 | var dimension = this.dimension(); 87 | this.reset(domStyle.get(this.domNode, dimension)); 88 | this.transition('remove', 'hide', 'hidden'); 89 | domStyle.set(this.domNode, dimension, '0px'); 90 | }, 91 | reset:function (size) { 92 | size = size ? parseFloat(size, 10) + 'px' : 'auto'; 93 | var dimension = this.dimension(); 94 | domClass.remove(this.domNode, 'collapse'); 95 | domStyle.set(this.domNode, dimension, size); 96 | this._offsetWidth = this.domNode.offsetWidth; 97 | domClass[(size !== null ? 'add' : 'remove')](this.domNode, 'collapse'); 98 | return this; 99 | }, 100 | transition:function (method, startEvent, completeEvent) { 101 | var _complete = lang.hitch(this, function () { 102 | if (startEvent === 'show'){ 103 | this.reset(); 104 | } 105 | this.transitioning = 0; 106 | 107 | if(method === 'add'){ 108 | domClass.add(this.domNode, 'in'); 109 | } else if(method === 'remove') { 110 | domClass.add(this.domNode, 'collapse'); 111 | } 112 | 113 | domClass.remove(this.domNode, 'collapsing'); 114 | on.emit(this.domNode, completeEvent + '.bs.collapse', {bubbles:false, cancelable:false}); 115 | }); 116 | 117 | on.emit(this.domNode, startEvent + '.bs.collapse', {bubbles:false, cancelable:false}); 118 | 119 | domClass.remove(this.domNode, 'collapse'); 120 | domClass.add(this.domNode, 'collapsing'); 121 | 122 | if(method === 'remove'){ 123 | domClass.remove(this.domNode, 'in'); 124 | } 125 | 126 | this.transitioning = 1; 127 | 128 | if (support.trans){ 129 | on.once(this.domNode, support.trans.end, _complete); 130 | support.emulateTransitionEnd(this.domNode, 350); 131 | } else { 132 | _complete(); 133 | } 134 | }, 135 | toggle:function () { 136 | this[domClass.contains(this.domNode, 'in') ? 'hide' : 'show'](); 137 | } 138 | }); 139 | lang.extend(query.NodeList, { 140 | collapse:function (option) { 141 | var options = (lang.isObject(option)) ? option : false; 142 | return this.forEach(function (node) { 143 | var data = support.getData(node, 'collapse'); 144 | if (!data) { 145 | support.setData(node, 'collapse', (data = new Collapse(node, options))); 146 | } 147 | if (lang.isString(option)) { 148 | data[option].call(data); 149 | } 150 | }); 151 | } 152 | }); 153 | 154 | on(win.body(), on.selector(collapseSelector, 'click'), function (e) { 155 | var node = this; 156 | if (support.getData(node, 'toggle') !== 'collapse') { 157 | node = query(this).closest('[data-toggle=collapse]')[0]; 158 | } 159 | if (node) { 160 | var target = domAttr.get(node, 'data-target') || e.preventDefault() || support.hrefValue(node); 161 | if (target) { 162 | var option = support.getData(target, 'collapse') ? 'toggle' : support.getData(node); 163 | query(target).collapse(option); 164 | } 165 | } 166 | }); 167 | return Collapse; 168 | }); -------------------------------------------------------------------------------- /app/calcite-maps/vendor/dojo-bootstrap/Dropdown.js: -------------------------------------------------------------------------------- 1 | /* ========================================================== 2 | * Dropdown.js v3.0.0 3 | * ========================================================== 4 | * Copyright 2012 xsokev 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 | 19 | define([ 20 | './Support', 21 | "dojo/_base/event", 22 | "dojo/_base/declare", 23 | "dojo/query", 24 | "dojo/_base/lang", 25 | 'dojo/_base/window', 26 | 'dojo/on', 27 | 'dojo/dom-class', 28 | "dojo/dom-attr", 29 | 'dojo/dom-construct', 30 | 'dojo/NodeList-traverse', 31 | 'dojo/NodeList-manipulate', 32 | "dojo/domReady!" 33 | ], function (support, event, declare, query, lang, win, on, domClass, domAttr, domConstruct) { 34 | "use strict"; 35 | 36 | var toggleSelector = '[data-toggle=dropdown]'; 37 | var backDropSelector = '.dropdown-backdrop'; 38 | var Dropdown = declare([], { 39 | defaultOptions:{}, 40 | constructor:function (element, options) { 41 | this.options = lang.mixin(lang.clone(this.defaultOptions), (options || {})); 42 | var el = query(element).closest(toggleSelector); 43 | if (!el[0]) { 44 | el = query(element); 45 | } 46 | if (el) { 47 | this.domNode = el[0]; 48 | domAttr.set(el[0], "data-toggle", "dropdown"); 49 | } 50 | }, 51 | select: function(e){ 52 | var parentNode = _getParent(this)[0]; 53 | if (parentNode) { 54 | var target = query(toggleSelector, parentNode); 55 | // Fix for not setting dropdown target 56 | if (target.length < 1) { 57 | target = [e.target.parentElement]; 58 | } 59 | on.emit(target[0], 'select', { bubbles:true, cancelable:true, selectedItem: query(e.target).closest('li') }); 60 | } 61 | }, 62 | toggle: function(e){ 63 | if (domClass.contains(this, "disabled") || domAttr.get(this, "disabled")) { 64 | return false; 65 | } 66 | var targetNode = _getParent(this)[0]; 67 | if (targetNode) { 68 | var isActive = domClass.contains(targetNode, 'open'), 69 | inNav = query(targetNode).closest('.navbar-nav').length > 0; 70 | clearMenus(); 71 | if (!isActive) { 72 | if('ontouchstart' in document.documentElement && !inNav){ 73 | var backdrop = domConstruct.toDom('