├── README.md
├── config
├── defaults.js
├── demoMap.js
└── templateConfig.js
├── css
└── main.css
├── images
├── SelectAll.png
├── SelectNone.png
├── ajax-loader.gif
├── error.png
└── error_gray.png
├── index.html
├── js
├── Operations
│ └── ApplyStyle.js
├── dijit
│ ├── ColorSelectorDialog.js
│ ├── UniqueComboBox.js
│ └── css
│ │ └── ColorSelectorDialog.css
├── jsoneditor-master
│ ├── .gitignore
│ ├── .npmignore
│ ├── CONTRIBUTING.md
│ ├── HISTORY.md
│ ├── LICENSE
│ ├── NOTICE
│ ├── README.md
│ ├── bower.json
│ ├── dist
│ │ ├── img
│ │ │ └── jsoneditor-icons.png
│ │ ├── jsoneditor.css
│ │ ├── jsoneditor.js
│ │ ├── jsoneditor.map
│ │ ├── jsoneditor.min.css
│ │ └── jsoneditor.min.js
│ ├── docs
│ │ ├── api.md
│ │ ├── shortcut_keys.md
│ │ └── usage.md
│ ├── examples
│ │ ├── 01_basic_usage.html
│ │ ├── 02_viewer.html
│ │ ├── 03_switch_mode.html
│ │ ├── 04_load_and_save.html
│ │ ├── 05_custom_fields_editable.html
│ │ └── requirejs_demo
│ │ │ ├── requirejs_demo.html
│ │ │ └── scripts
│ │ │ ├── main.js
│ │ │ └── require.js
│ ├── gulpfile.js
│ ├── index.js
│ ├── misc
│ │ ├── codeeditor.png
│ │ ├── how_to_publish.md
│ │ ├── jsoneditor.png
│ │ └── todo.txt
│ ├── package.json
│ ├── src
│ │ ├── css
│ │ │ ├── contextmenu.css
│ │ │ ├── img
│ │ │ │ ├── description.txt
│ │ │ │ ├── export.sh
│ │ │ │ ├── jsoneditor-icons.png
│ │ │ │ └── jsoneditor-icons.svg
│ │ │ ├── jsoneditor.css
│ │ │ ├── menu.css
│ │ │ └── searchbox.css
│ │ └── js
│ │ │ ├── ContextMenu.js
│ │ │ ├── Highlighter.js
│ │ │ ├── History.js
│ │ │ ├── JSONEditor.js
│ │ │ ├── Node.js
│ │ │ ├── SearchBox.js
│ │ │ ├── ace
│ │ │ ├── index.js
│ │ │ └── theme-jsoneditor.js
│ │ │ ├── appendNodeFactory.js
│ │ │ ├── header.js
│ │ │ ├── modeswitcher.js
│ │ │ ├── textmode.js
│ │ │ ├── treemode.js
│ │ │ └── util.js
│ └── test
│ │ ├── couchdbeditor.html
│ │ ├── largefile.json
│ │ ├── test_build.html
│ │ ├── test_build_min.html
│ │ └── util.test.js
├── main.js
├── nls
│ ├── fr
│ │ └── resources.js
│ └── resources.js
└── template.js
├── oauth-callback.html
├── previous
├── index_OLD.html
└── main_OLD.js
└── resources
├── VectorBasemapStyleEditor_004
├── VectorBasemapStyleEditor_004.html
├── VectorBasemapStyleEditor_004.mp4
├── VectorBasemapStyleEditor_004_First_Frame.png
├── VectorBasemapStyleEditor_004_Thumbnails.png
├── VectorBasemapStyleEditor_004_config.xml
├── VectorBasemapStyleEditor_004_controller.swf
├── VectorBasemapStyleEditor_004_embed.css
├── VectorBasemapStyleEditor_004_player.html
├── scripts
│ ├── config_xml.js
│ └── techsmith-smart-player.min.js
└── skins
│ └── overlay
│ ├── spritesheet.min.css
│ ├── spritesheet.png
│ └── techsmith-smart-player.min.css
└── configurationPanel.js
/README.md:
--------------------------------------------------------------------------------
1 |
2 | #### Live Demo
3 | - https://maps.esri.com/jg/VectorBasemapStyleEditor/
4 |
5 | #### Vector Basemap Style Editor
6 | Edit the styles of Esri Vector Basemaps via ArcGIS.com items
7 | - Always make a backup copy of the ArcGIS.com item before using this app
8 | - The user experience is focused on color replacement
9 | - Edit style json directly by clicking on 'id' cell. Warning: use caution!
10 |
11 | #### Deployment
12 | - Copy your application to a web accessible location
13 | - Create a new item in your Org to your version of this application
14 | - Register the new application item and make note of the App ID
15 | - In /config/default.js change the oauthappid to the above App ID
16 |
17 | #### Version
18 | - 0.1.4
19 | - JS API 3.23
20 |
21 |
22 | #### License
23 |
24 | > Copyright 2017 Esri
25 | >
26 | > Licensed under the Apache License, Version 2.0 (the "License");
27 | > you may not use this file except in compliance with the License.
28 | > You may obtain a copy of the License at
29 | >
30 | > http://www.apache.org/licenses/LICENSE-2.0
31 | >
32 | > Unless required by applicable law or agreed to in writing, software
33 | > distributed under the License is distributed on an "AS IS" BASIS,
34 | > WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
35 | > See the License for the specific language governing permissions and
36 | > limitations under the License.
37 |
--------------------------------------------------------------------------------
/config/defaults.js:
--------------------------------------------------------------------------------
1 | /*global define,location */
2 | /*jslint sloppy:true */
3 | /*
4 | | Copyright 2014 Esri
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 | //Default configuration settings for the application. This is where you'll define things like a bing maps key,
20 | //default web map, default app color theme and more. These values can be overwritten by template configuration settings and url parameters.
21 | "appid": "",
22 | "webmap": "589a3ac57b7844618f9a8ee94ca49d59",
23 | "oauthappid": "hrFP8yDGOiGFx4ub",
24 | //Group templates must support a group url parameter. This will contain the id of the group.
25 | "group": "",
26 | //Enter the url to the proxy if needed by the application. See the 'Using the proxy page' help topic for details
27 | //http://developers.arcgis.com/en/javascript/jshelp/ags_proxy.html
28 | "proxyurl": "https://maps.esri.com/proxy/DotNet/proxy.ashx",
29 | //Example of a template specific property. If your template had several color schemes
30 | //you could define the default here and setup configuration settings to allow users to choose a different
31 | //color theme.
32 | "theme": "blue",
33 | "bingKey": "", //Enter the url to your organizations bing maps key if you want to use bing basemaps
34 | //Defaults to arcgis.com. Set this value to your portal or organization host name.
35 | "sharinghost": "https://www.arcgis.com",
36 | "units": null,
37 | //If your applcation needs to edit feature layer fields set this value to true. When false the map will
38 | //be dreated with layers that are not set to editable which allows the FeatureLayer to load features optimally.
39 | "editable": false,
40 | "helperServices": {
41 | "geometry": {
42 | "url": null
43 | },
44 | "printTask": {
45 | "url": null
46 | },
47 | "elevationSync": {
48 | "url": null
49 | },
50 | "geocode": [{
51 | "url": null
52 | }]
53 | }
54 | });
--------------------------------------------------------------------------------
/config/demoMap.js:
--------------------------------------------------------------------------------
1 | define({
2 | "item": {
3 | "id": "24e01ef45d40423f95300ad2abc5038a",
4 | "owner": "khutchins_jsapi",
5 | "orgId": "V6ZHFr6zdgNZuVG0",
6 | "created": 1386962036000,
7 | "modified": 1425412391000,
8 | "guid": null,
9 | "name": null,
10 | "title": "Farmers Markets",
11 | "type": "Web Map",
12 | "typeKeywords": ["ArcGIS Online", "Explorer Web Map", "Map", "Online Map", "Web Map"],
13 | "description": "A heat map showing the concentration of farmers markets across the US. ",
14 | "tags": ["map", "cities"],
15 | "snippet": "A heat map showing the concentration of farmers markets across the US.",
16 | "thumbnail": "thumbnail/ago_downloaded.png",
17 | "documentation": null,
18 | "extent": [[-123.4521, 46.9231], [-121.0021, 48.0258]],
19 | "spatialReference": null,
20 | "accessInformation": null,
21 | "licenseInfo": null,
22 | "culture": "en",
23 | "properties": null,
24 | "url": null,
25 | "access": "public",
26 | "size": 4519,
27 | "appCategories": [],
28 | "industries": [],
29 | "languages": [],
30 | "largeThumbnail": null,
31 | "banner": null,
32 | "screenshots": [],
33 | "listed": false,
34 | "commentsEnabled": true,
35 | "numComments": 0,
36 | "numRatings": 0,
37 | "avgRating": 0,
38 | "numViews": 50960
39 | },
40 | "itemData": {
41 | "operationalLayers": [
42 | {
43 | "id": "Farmers_Market_Locations_6307",
44 | "layerType": "ArcGISFeatureLayer",
45 | "url": "http://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Farmers_Market_Locations/FeatureServer/0",
46 | "visibility": true,
47 | "opacity": 0.5346534653465347,
48 | "title": "Farmers Market Locations",
49 | "itemId": "4668eb9347f446bb87b4ca8f6da21550",
50 | "layerDefinition": {
51 | "drawingInfo": {
52 | "renderer": {
53 | "type": "simple",
54 | "symbol": {
55 | "angle": 0,
56 | "xoffset": 0,
57 | "yoffset": 12,
58 | "type": "esriPMS",
59 | "url": "http://static.arcgis.com/images/Symbols/Basic1/Orange_1_Tear_Pin2.png",
60 | "imageData": "iVBORw0KGgoAAAANSUhEUgAAAHkAAAB5CAYAAAAd+o5JAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAADKGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMwMTQgNzkuMTU2Nzk3LCAyMDE0LzA4LzIwLTA5OjUzOjAyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxNCAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo4RUU2RURGQzZDNDkxMUU0QTM3RThDNzNCRDk3QTcyQSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo4RUU2RURGRDZDNDkxMUU0QTM3RThDNzNCRDk3QTcyQSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjhFRTZFREZBNkM0OTExRTRBMzdFOEM3M0JEOTdBNzJBIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjhFRTZFREZCNkM0OTExRTRBMzdFOEM3M0JEOTdBNzJBIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+gzeecQAAB41JREFUeF7tnc2R1EgUhDEBE7jtFRMwARMwARPwgPOeMAETMAETMIHr3mbzdagnNM2nbv28zO4RyogvNiLZkVr5pqpLVSXNm6enp4Odg+bBvkDzYF+gebAv0DzYF2ge7As0D/YFmgf7As2DfYHmwb5A82BfoHmwL9BM4NR///7zQXwW38QP8XSDn+K7+CI+DIexifJwgmaCbqk4H0UV9begQi6liv5JvB1O0SbKwwmaCTqkArwT1fq6CjtF/fK8G067WZSHEzQTbJECfyu+DgVI0lJsysMJmgnWSiHXd6275d6ieo/V3Tjl4QTNBEulUKtrnjOISvFLvB8+3iJRHk7QTLBECrMGVfduvVN8Hj7mbFEeTtBMMFcKsUa4FO4j8W34uLNEeThBM8EcVXgXYT4y9VlnfU9THk7QTHBLCuweo+etfB8+/lVRHk7QTHBNCus1dNFT3Oy6KQ8naCaYkkKqKUkK7zXxZbgcFOXhBM0EJIVTt0mPOopeyuQcOOXhBM0EJAXzSPfBW6lfVhyIUR5O0ExwKQVSM1kU1msGv58pDydoJhhLYdRc9F666Uv+6LYpDydoJhhLQdRcMAW0B34Ml/ksysMJmgnOUgh7bsVnXrRmysMJmgnOUgCJVly/ROedH2NqlqoWGuhnOnkxSUJ5OEEzwVkKwBlyFfHmdh79P3Xr5p5CfV6HpjycoJmgpAuv1SUKZCu1Z2vxXi39jHM583mChPJwgmaCki7c0XpmLxRMST/vuJ37ORwe83CCZoKSLrx7wLVoye+adCzH/Pmpy6Y8nKCZQBf8/iKArfxxq7JVOmb3StinOi7l4QTNBHXBFwFsoXqEtt2UY+m49f1O51zDqaehPJygmUAX3NlKrq76bJGO3bkqduptKA8naCaoC74IYC3Vits3wI+l47e15joe5eEEzQS64K7g2gZbU9I52kbbdTzKwwmaCSiAlZwGM07pHJ2DxA+UhxM0E8DFr2XxpMcawXnXchR5KUMN7NK5ur5ejiIvZaiBXTpX10DxKPIKrCPrs3SeroWUv6rIbd3fUAer4LyrqGNRHk7QTKAL7ur+Fj+LtFQ6R9eEyO86HuXhBM0EuuCuzQKznlrYIp2ja3bur5vx6lxLtsxbn6Xjd30fn6ZfKQ8naCbQBdfeLgpiDbZZLx27cyHlNH6gPJygmWAIsPZdURhraB+A6ZidmwxP38clysMJmglKuvDOVlJdauvtlI7XuRXoubehPJygmaCkC+/ssou6LWsptI7TvTXp43BozMMJmgnO0sV3h1mFXvUuj5J+tn7xOr9Gil/D4U+iPJygmeAsBeB4VLW+RxdvJNDP1IjfsUX4xWehPJygmWAshdA1+3VJFazuxydvserfRI0NXJ+hePEVQnk4QTPBWArBsTPykmrdNZAq6iui/utotZf8cXtHeThBM8GlFEYi8HvwRy9CeThBM8GlFEaiNafBSRrKwwmaCUgKZW+tGccClIcTNBOQFMqeWvPkVCvl4QTNBFNSOJ2zTPfi6jZhysMJmgmmpHCOVzw1g2aCa1JI3TNOSWpccXVqlfJwgmaCa1JIr/l9Xjf3gVMeTtBMcEsKq2vnSJJZT1ZSHk7QTHBLCqwWCl7bLdWshRHKwwmaCeZIobleN+Hg6/Cxb4rycIJmgrlSeK/hlurqLdOlKA8naCaYK4X3GgZhix66ozycoJlgiRTiIw/CFr/GgvJwgmaCpVKYjzoIW7wLhfJwgmaCpVKYjzgTNnuwNRbl4QTNBGukUB9pJuzmzNaUKA8naCZYowpVPMog7Hn35VJRHk7QTLBWCvcRXn6+6Z1hlIcTNBNskUJ2brq7RfUkm569ojycoJlgixRy99v8lrD5nWGUhxM0E2yVwr7HHwd7sUl+rSgPJ2gm2CoFfo9BWMtDdZSHEzQTdEihJ/eEtT3sTnk4QTNBlxR+agGj7UF3ysMJmgm6pPATM2GbB1tjUR5O0EzQKRXB8Qb8M6tntqZEeThBM0GnVATncmT7uzspDydoJuiWiuFYjtw0szUlysMJmgm6pYI49oRZXgRHeThBM4FDKkrnLZXt/WCUhxM0E7ik4nS15rZbpktRHk7QTOCSitNxS2V7L1iJ8nCCZgKnVKQtEySbV5luifJwgmYCp1SkLa25deKDRHk4QTOBWyrWmtZcrbh14oNEeThBM4FbKtaa1mxvxSXKwwmaCRJS0Za2ZnsrLlEeTtBMkJCKtuRZKuuIeizKwwmaCVJS8ebeN1tH1GNRHk7QTJCSijdnFizWikuUhxM0EySlIt5aoYr8sZKzKA8naCZISkW8tkJlWWm6JsrDCZoJklIha72ZClzY/9bjpSgPJ2gmSEvFpOeonv9kQFKUhxM0E6SlgtLt1KqnEreK8nCCZoJ7SEW9vJ2K3TaNRXk4QTPBPaSijp+6+DnYcVEeTtBMcA+psONnqOx//m9KlIcTNBPcSyruucu+S1ddojycoJngXlJxq8uO3xuPRXk4QTPBvaQCV5d9t666RHk4QfNgX6B5sC/QPNgXaB7sCzQP9gWaB/sCzYN9gebBvkDzYF+gebAv0DzYF2ge7ImnN/8DAsn7a/PsTiMAAAAASUVORK5CYII=",
61 | "contentType": "image/png",
62 | "width": 24,
63 | "height": 24
64 | }
65 | }
66 | }
67 | },
68 | "popupInfo": {
69 | "title": "",
70 | "fieldInfos": [
71 | {
72 | "fieldName": "FMID",
73 | "label": "FMID",
74 | "isEditable": true,
75 | "tooltip": "",
76 | "visible": false,
77 | "format": {
78 | "places": 0,
79 | "digitSeparator": true
80 | },
81 | "stringFieldOption": "textbox",
82 | "isEditableOnLayer": true
83 | },
84 | {
85 | "fieldName": "Location",
86 | "label": "Location",
87 | "isEditable": true,
88 | "tooltip": "",
89 | "visible": true,
90 | "stringFieldOption": "textbox",
91 | "isEditableOnLayer": true
92 | },
93 | {
94 | "fieldName": "MarketName",
95 | "label": "MarketName",
96 | "isEditable": true,
97 | "tooltip": "",
98 | "visible": false,
99 | "stringFieldOption": "textbox",
100 | "isEditableOnLayer": true
101 | },
102 | {
103 | "fieldName": "Website",
104 | "label": "Website",
105 | "isEditable": true,
106 | "tooltip": "",
107 | "visible": true,
108 | "stringFieldOption": "textbox",
109 | "isEditableOnLayer": true
110 | },
111 | {
112 | "fieldName": "street",
113 | "label": "street",
114 | "isEditable": true,
115 | "tooltip": "",
116 | "visible": false,
117 | "stringFieldOption": "textbox",
118 | "isEditableOnLayer": true
119 | },
120 | {
121 | "fieldName": "city",
122 | "label": "city",
123 | "isEditable": true,
124 | "tooltip": "",
125 | "visible": false,
126 | "stringFieldOption": "textbox",
127 | "isEditableOnLayer": true
128 | },
129 | {
130 | "fieldName": "County",
131 | "label": "County",
132 | "isEditable": true,
133 | "tooltip": "",
134 | "visible": false,
135 | "stringFieldOption": "textbox",
136 | "isEditableOnLayer": true
137 | },
138 | {
139 | "fieldName": "State",
140 | "label": "State",
141 | "isEditable": true,
142 | "tooltip": "",
143 | "visible": false,
144 | "stringFieldOption": "textbox",
145 | "isEditableOnLayer": true
146 | },
147 | {
148 | "fieldName": "zip",
149 | "label": "zip",
150 | "isEditable": true,
151 | "tooltip": "",
152 | "visible": false,
153 | "format": {
154 | "places": 0,
155 | "digitSeparator": true
156 | },
157 | "stringFieldOption": "textbox",
158 | "isEditableOnLayer": true
159 | },
160 | {
161 | "fieldName": "x",
162 | "label": "x",
163 | "isEditable": true,
164 | "tooltip": "",
165 | "visible": false,
166 | "format": {
167 | "places": 2,
168 | "digitSeparator": true
169 | },
170 | "stringFieldOption": "textbox",
171 | "isEditableOnLayer": true
172 | },
173 | {
174 | "fieldName": "y",
175 | "label": "y",
176 | "isEditable": true,
177 | "tooltip": "",
178 | "visible": false,
179 | "format": {
180 | "places": 2,
181 | "digitSeparator": true
182 | },
183 | "stringFieldOption": "textbox",
184 | "isEditableOnLayer": true
185 | },
186 | {
187 | "fieldName": "FID",
188 | "label": "FID",
189 | "isEditable": false,
190 | "tooltip": "",
191 | "visible": false,
192 | "format": {
193 | "places": 0,
194 | "digitSeparator": true
195 | },
196 | "stringFieldOption": "textbox",
197 | "isEditableOnLayer": false
198 | }
199 | ],
200 | "description": "
{MarketName}
",
201 | "showAttachments": true,
202 | "mediaInfos": [
203 |
204 | ]
205 | }
206 | }
207 | ],
208 | "baseMap": {
209 | "baseMapLayers": [
210 | {
211 | "id": "defaultBasemap",
212 | "layerType": "ArcGISTiledMapServiceLayer",
213 | "opacity": 1,
214 | "visibility": true,
215 | "url": "http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"
216 | }
217 | ],
218 | "title": "Topographic"
219 | },
220 | "spatialReference": {
221 | "wkid": 102100,
222 | "latestWkid": 3857
223 | },
224 | "version": "2.1",
225 | "bookmarks": [
226 | {
227 | "extent": {
228 | "spatialReference": {
229 | "wkid": 102100,
230 | "latestWkid": 3857
231 | },
232 | "xmax": -12636569.516104667,
233 | "xmin": -13378925.93481026,
234 | "ymax": 4372513.169906271,
235 | "ymin": 3882704.692654886
236 | },
237 | "name": "Mojave Desert"
238 | },
239 | {
240 | "extent": {
241 | "spatialReference": {
242 | "wkid": 102100,
243 | "latestWkid": 3857
244 | },
245 | "xmax": -13498167.69893507,
246 | "xmin": -13869345.908287708,
247 | "ymax": 6166795.97187194,
248 | "ymin": 5921891.733246354
249 | },
250 | "name": "Puget Sound"
251 | }
252 | ],
253 | "applicationProperties": {
254 | "viewing": {
255 | "routing": {
256 | "enabled": true
257 | },
258 | "basemapGallery": {
259 | "enabled": true
260 | },
261 | "measure": {
262 | "enabled": true
263 | },
264 | "search": {
265 | "enabled": false,
266 | "disablePlaceFinder": true,
267 | "hintText": "Place or Address",
268 | "layers": [
269 |
270 | ]
271 | }
272 | }
273 | }
274 | }
275 | });
--------------------------------------------------------------------------------
/config/templateConfig.js:
--------------------------------------------------------------------------------
1 | /*global define */
2 | /*jslint sloppy:true */
3 | /*
4 | | Copyright 2014 Esri
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 | // When true, the template will query arcgis.com for the webmap item.
20 | "queryForWebmap": false,
21 | // When true, the template will query arcgis.com for the group's information.
22 | "queryForGroupInfo": false,
23 | // When true, the template will query arcgis.com for the items contained within the group
24 | "queryForGroupItems": false,
25 | // Use a local hosted webmap instead of a webmap on ArcGIS or portal.
26 | "useLocalWebmap": false,
27 | // Webmap file to use for the local webmap
28 | "localWebmapFile": "config/demoMap",
29 | //When true the template will query arcgis.com for default settings for helper services, units etc. If you
30 | //want to use custom settings for units or any of the helper services set queryForOrg to false then enter
31 | //default values for any items you need using the helper services and units properties.
32 | "queryForOrg": false,
33 | //If you need localization set the localize value to true to get the localized strings
34 | //from the javascript/nls/resource files.
35 | //Note that we've included a placeholder nls folder and a resource file with one error string
36 | //to show how to setup the strings file.
37 | "queryForLocale": true,
38 | // These are the options specified for querying items within the group. Modify these to get more items. You can also call the public template.queryGroupItems() method with these options as a parameter.
39 | "groupParams": {
40 | q: "group:\"${groupid}\" AND -type:\"Code Attachment\"",
41 | "sortField": "modified",
42 | "sortOrder": "desc",
43 | "num": 9,
44 | "start": 0
45 | },
46 | //This option demonstrates how to handle additional custom url parameters. For example
47 | //if you want users to be able to specify lat/lon coordinates that define the map's center or
48 | //specify an alternate basemap via a url parameter.
49 | "urlItems": [],
50 | // Most users will not need to modify this value. For esri hosting environments only. Will automatically create a "sharinghost" and "proxyurl" for the application. Only set this is to true if the app is going to be stored on Esri's hosting servers. If you are using your own custom hosted portal, set the "sharinghost" in defaults.js instead of setting this to true.
51 | esriEnvironment: false
52 | });
--------------------------------------------------------------------------------
/images/SelectAll.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jgrayson-apl/VectorBasemapStyleEditor/eb7c2e4b2dc58583e7d70b6de4fec5f9cd419653/images/SelectAll.png
--------------------------------------------------------------------------------
/images/SelectNone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jgrayson-apl/VectorBasemapStyleEditor/eb7c2e4b2dc58583e7d70b6de4fec5f9cd419653/images/SelectNone.png
--------------------------------------------------------------------------------
/images/ajax-loader.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jgrayson-apl/VectorBasemapStyleEditor/eb7c2e4b2dc58583e7d70b6de4fec5f9cd419653/images/ajax-loader.gif
--------------------------------------------------------------------------------
/images/error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jgrayson-apl/VectorBasemapStyleEditor/eb7c2e4b2dc58583e7d70b6de4fec5f9cd419653/images/error.png
--------------------------------------------------------------------------------
/images/error_gray.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jgrayson-apl/VectorBasemapStyleEditor/eb7c2e4b2dc58583e7d70b6de4fec5f9cd419653/images/error_gray.png
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Vector Basemap Style Editor
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
29 |
30 |
61 |
62 |
63 |
166 |
167 |
168 |
--------------------------------------------------------------------------------
/js/Operations/ApplyStyle.js:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * ApplyStyle
4 | * - Apply VectorTileLayer Style
5 | *
6 | * Author: John Grayson - Applications Prototype Lab - Esri
7 | *
8 | * Created: 11/24/2015 - 0.0.1 -
9 | * Modified: 12/21/2015 - 0.0.2 - ADDED CALLBACK FUNCTION AND INPUT VALIDATION
10 | *
11 | */
12 | define([
13 | "dojo/_base/declare",
14 | "esri/OperationBase"
15 | ], function (declare, OperationBase) {
16 |
17 | // CLASS //
18 | var ApplyStyle = declare([OperationBase], {
19 |
20 | // CLASS NAME //
21 | declaredClass: "ApplyStyle",
22 |
23 | // LABEL //
24 | label: "Apply VectorTileLayer Style",
25 |
26 | // TYPE //
27 | type: "ApplyVectorTileLayerStyle",
28 |
29 | // VALID //
30 | validOperation: false,
31 |
32 | /**
33 | * CONSTRUCTOR
34 | */
35 | constructor: function (options) {
36 | declare.safeMixin(this, options);
37 | // VALIDATE INPUTS //
38 | this.validOperation = ((this.layer != null) && (this.undoStyle != null) && (this.redoStyle != null));
39 | },
40 |
41 | /**
42 | * UNDO APPLY STYLE
43 | */
44 | performUndo: function () {
45 | if(this.validOperation) {
46 | // SET STYLE //
47 | this.layer.setStyle(this.undoStyle);
48 | if(this.applyStyleCallback) {
49 | // CALLBACK //
50 | this.applyStyleCallback(this.undoStyle.layers)
51 | }
52 | }
53 | },
54 |
55 | /**
56 | * REDO APPLY STYLE
57 | */
58 | performRedo: function () {
59 | if(this.validOperation) {
60 | // SET STYLE //
61 | this.layer.setStyle(this.redoStyle);
62 | if(this.applyStyleCallback) {
63 | // CALLBACK //
64 | this.applyStyleCallback(this.redoStyle.layers)
65 | }
66 | }
67 | }
68 |
69 | });
70 |
71 | // DEFAULT LABEL //
72 | ApplyStyle.defaultLabel = "Apply VectorTileLayer Style";
73 |
74 | // VERSION //
75 | ApplyStyle.version = "0.0.2";
76 |
77 | // RETURN CLASS //
78 | return ApplyStyle;
79 | });
80 |
81 |
82 |
--------------------------------------------------------------------------------
/js/dijit/UniqueComboBox.js:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * UniqueComboBox
4 | * - COMBOBOX THAT ONLY DISPLAYS UNIQUE VALUES
5 | *
6 | * Adapted from: https://davidwalsh.name/unique-combobox
7 | * https://github.com/dojo/dijit/blob/master/form/_ComboBoxMenu.js
8 | * https://github.com/dojo/dijit/blob/master/form/_ComboBoxMenuMixin.js
9 | *
10 | * Author: John Grayson - Applications Prototype Lab - Esri
11 | * Created: 11/30/2015 - 0.0.1 -
12 | * Modified: 12/18/2015 - 0.0.2 - GET searchAttr FROM COMBOX AND PASS ON TO COMBOXMENU
13 | *
14 | *
15 | * Usage:
16 | *
17 | * var itemList = new UniqueComboBox({
18 | * style: "width:250px;",
19 | * placeHolder: 'select item',
20 | * searchAttr: "source-layer",
21 | * intermediateChanges: true,
22 | * fetchProperties: { sort: [{ attribute: "source-layer", descending: false }] }
23 | * }, "source-layer-combo");
24 | * itemList.startup();
25 | * itemList.on("change", lang.hitch(this, function (evt) {
26 | * console.info(evt);
27 | * }));
28 | *
29 | */
30 |
31 | define([
32 | "dojo/_base/declare",
33 | "dijit/form/ComboBox",
34 | "dijit/form/_ComboBoxMenu",
35 | "dojo/_base/lang",
36 | "dojo/_base/array"
37 | ], function (declare, ComboBox, _ComboBoxMenu, lang, array) {
38 |
39 | /**
40 | * COMBOBOXMENU THAT DISPLAYS UNIQUE VALUES
41 | */
42 | var _UniqueComboBoxMenu = declare(_ComboBoxMenu, {
43 |
44 | // CLASS NAME //
45 | declaredClass: "_UniqueComboBoxMenu",
46 |
47 | /**
48 | *
49 | * @param results
50 | * @param dataObject
51 | * @param labelFunc
52 | * @returns {*}
53 | */
54 | createOptions: function (results, dataObject, labelFunc) {
55 |
56 | // FILTER DUPLICATE VALUES IF WE HAVE searchAttr SET //
57 | if(this.searchAttr) {
58 |
59 | // UNIQUE KEYS AND ITEMS //
60 | var uniqueKeys = {};
61 | var uniqueItems = [];
62 |
63 | array.forEach(results, lang.hitch(this, function (result, index) {
64 | // FOR THIS DATA WE NEED TO ADDITIONALLY CHECK TO SEE //
65 | // IF THE ITEM HAS THE searchAttr PROPERTY... //
66 | if(result.hasOwnProperty(this.searchAttr)) {
67 | var label = labelFunc(result);
68 | if(typeof label != "string") {
69 | label = label.label;
70 | }
71 | if(!uniqueKeys[label]) {
72 | uniqueKeys[label] = result;
73 | uniqueItems.push(result);
74 | }
75 | }
76 | }));
77 |
78 | // RESET RESULTS //
79 | arguments[0] = uniqueItems;
80 | }
81 |
82 | return this.inherited(arguments);
83 | }
84 |
85 | });
86 |
87 | /**
88 | * COMBOBOX THAT ONLY DISPLAYS UNIQUE VALUES IN searchAttr PROPERTY OF ITEMS
89 | */
90 | var UniqueComboBox = declare([ComboBox], {
91 | // DROPDOWN CLASS //
92 | dropDownClass: _UniqueComboBoxMenu,
93 | /**
94 | * OVERRIDE POSTCREATE SO WE CAN SET searchAttr ON COMBOBOXMENU
95 | */
96 | postCreate: function () {
97 | this.inherited(arguments);
98 | // THIS SHOULD FORCE THE CREATION OF DROPDOWN //
99 | this._startSearchAll();
100 | if(this.dropDown) {
101 | // SET searchAttr ON DROPDOWN //
102 | this.dropDown.searchAttr = this.searchAttr;
103 | }
104 | }
105 | });
106 |
107 | // VERSION //
108 | UniqueComboBox.version = "0.0.2";
109 |
110 | // RETURN CLASS //
111 | return UniqueComboBox;
112 | });
113 |
114 |
115 |
--------------------------------------------------------------------------------
/js/dijit/css/ColorSelectorDialog.css:
--------------------------------------------------------------------------------
1 | @import url("//js.arcgis.com/3.17/dojox/widget/ColorPicker/ColorPicker.css");
2 |
3 | .colorSelectorDlg {
4 | /*...*/
5 | }
6 |
7 | .colorSelectorDlg-selector-container {
8 | width : 725px;
9 | height : 225px;
10 | }
11 |
12 | .colorSelectorDlg-selector-custom-container {
13 | width : 350px;
14 | }
15 |
16 | .variations-node {
17 | float : left;
18 | margin-left : 20px;
19 | }
20 |
21 | .dijitColorPalette,
22 | .dojoxColorPicker {
23 | background : none !important;
24 | border : none !important;
25 | }
26 |
27 | .dojoxColorPickerOptional input {
28 | width : 40px;
29 | }
30 |
31 | .dijitColorPalette .dijitPaletteImg {
32 | padding : 2px !important;
33 | }
34 |
35 | .dijitColorPalette .dijitPaletteImg .dijitColorPaletteSwatch,
36 | .dijitColorPalette .dijitPaletteCell:hover .dijitPaletteImg .dijitColorPaletteSwatch,
37 | .dijitColorPalette .dijitPaletteCell:active .dijitPaletteImg .dijitColorPaletteSwatch,
38 | .dijitColorPalette .dijitPaletteCell.dijitPaletteCellSelected .dijitPaletteImg .dijitColorPaletteSwatch {
39 | width : 14px !important;
40 | height : 14px !important;
41 | }
--------------------------------------------------------------------------------
/js/jsoneditor-master/.gitignore:
--------------------------------------------------------------------------------
1 | .idea
2 | build
3 | downloads
4 | node_modules
5 | *.zip
6 | npm-debug.log
--------------------------------------------------------------------------------
/js/jsoneditor-master/.npmignore:
--------------------------------------------------------------------------------
1 | bower.json
2 | downloads
3 | misc
4 | node_modules
5 | test
6 | tools
7 | .idea
8 | component.json
9 | gulpfile.js
10 | .npmignore
11 | .gitignore
12 | *.zip
13 | npm-debug.log
--------------------------------------------------------------------------------
/js/jsoneditor-master/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | ## Contributing
2 |
3 | Contributions to the `jsoneditor` library are very welcome! We can't do this
4 | alone. You can contribute in different ways: spread the word, report bugs, come
5 | up with ideas and suggestions, and contribute to the code.
6 |
7 | There are a few preferences regarding code contributions:
8 |
9 | - `jsoneditor` follows the node.js code style as described
10 | [here](http://nodeguide.com/style.html).
11 | - Send pull requests to the `develop` branch, not the `master` branch.
12 | - Only commit changes done in the source files under `src`, not to the builds
13 | which are located in the root of the project (like `jsoneditor.js`,
14 | `jsoneditor.css`, etc.
15 |
16 | Thanks!
17 |
18 |
--------------------------------------------------------------------------------
/js/jsoneditor-master/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
--------------------------------------------------------------------------------
/js/jsoneditor-master/NOTICE:
--------------------------------------------------------------------------------
1 | JSON Editor
2 | https://github.com/josdejong/jsoneditor
3 |
4 | Copyright (C) 2011-2015 Jos de Jong
5 |
6 |
7 | Licensed under the Apache License, Version 2.0 (the "License");
8 | you may not use this file except in compliance with the License.
9 | You may obtain a copy of the License at
10 |
11 | http://www.apache.org/licenses/LICENSE-2.0
12 |
13 | Unless required by applicable law or agreed to in writing, software
14 | distributed under the License is distributed on an "AS IS" BASIS,
15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | See the License for the specific language governing permissions and
17 | limitations under the License.
18 |
--------------------------------------------------------------------------------
/js/jsoneditor-master/README.md:
--------------------------------------------------------------------------------
1 | # JSON Editor
2 | https://github.com/josdejong/jsoneditor
3 | http://jsoneditoronline.org/
4 |
5 | Website: http://jsoneditoronline.org/
6 | Github: https://github.com/josdejong/jsoneditor
7 |
8 |
9 | ## Description
10 |
11 | JSON Editor is a web-based tool to view, edit, and format JSON.
12 | It has various modes such as a tree editor, a code editor, and a plain text
13 | editor.
14 |
15 | The editor can be used as a component in your own web application. The library
16 | can be loaded as CommonJS module, AMD module, or as a regular javascript file.
17 |
18 | Supported browsers: Chrome, Firefox, Safari, Opera, Internet Explorer 9+.
19 |
20 |
21 |
22 |
23 |
24 |
25 | ## Features
26 |
27 | ### Tree editor
28 | - Edit, add, move, remove, and duplicate fields and values.
29 | - Change type of values.
30 | - Sort arrays and objects.
31 | - Colorized code.
32 | - Search & highlight text in the treeview.
33 | - Undo and redo all actions.
34 |
35 | ### Code editor
36 | - Format and compact JSON.
37 | - Colorized code (powered by Ace).
38 | - Inspect JSON (powered by Ace).
39 |
40 | ### Text editor
41 | - Format and compact JSON.
42 |
43 |
44 | ## Documentation
45 |
46 | - Documentation:
47 | - [API](https://github.com/josdejong/jsoneditor/tree/master/docs/api.md)
48 | - [Usage](https://github.com/josdejong/jsoneditor/tree/master/docs/usage.md)
49 | - [Shortcut keys](https://github.com/josdejong/jsoneditor/tree/master/docs/shortcut_keys.md)
50 | - [Examples](https://github.com/josdejong/jsoneditor/tree/master/examples)
51 | - [Source](https://github.com/josdejong/jsoneditor)
52 | - [History](https://github.com/josdejong/jsoneditor/blob/master/HISTORY.md)
53 |
54 |
55 | ## Install
56 |
57 | with npm:
58 |
59 | npm install jsoneditor
60 |
61 | with bower:
62 |
63 | bower install jsoneditor
64 |
65 | download:
66 |
67 | [http://jsoneditoronline.org/downloads/](http://jsoneditoronline.org/downloads/)
68 |
69 |
70 | #### More
71 |
72 | There is a directive available for using JSONEditor in Angular.js:
73 |
74 | [https://github.com/angular-tools/ng-jsoneditor](https://github.com/angular-tools/ng-jsoneditor)
75 |
76 |
77 | ## Use
78 |
79 | ```html
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
111 |
112 |
113 | ```
114 |
115 |
116 | ## Build
117 |
118 | The code of the JSON Editor is located in the folder `./src`. To build
119 | jsoneditor:
120 |
121 | - Install dependencies:
122 |
123 | ```
124 | npm install
125 | ```
126 |
127 | - Build JSON Editor:
128 |
129 | ```
130 | npm run build
131 | ```
132 |
133 | This will generate the files `./jsoneditor.js`, `./jsoneditor.css`, and
134 | minified versions in the root of the project.
135 |
136 |
137 | ## Custom builds
138 |
139 | The source code of JSONEditor consists of CommonJS modules. JSONEditor can be bundled in a customized way using a module bundler like [browserify](http://browserify.org/) or [webpack](http://webpack.github.io/). First, install all dependencies of jsoneditor:
140 |
141 | npm install
142 |
143 | To create a custom bundle of the source code using browserify:
144 |
145 | browserify ./index.js -o ./jsoneditor.custom.js -s JSONEditor
146 |
147 | The Ace editor, used in mode `code`, accounts for about 75% of the total
148 | size of the library. To exclude the Ace editor from the bundle:
149 |
150 | browserify ./index.js -o ./jsoneditor.custom.js -s JSONEditor -x brace -x brace/mode/json -x brace/ext/searchbox
151 |
152 | To minify the generated bundle, use [uglifyjs](https://github.com/mishoo/UglifyJS2):
153 |
154 | uglifyjs ./jsoneditor.custom.js -o ./jsoneditor.custom.min.js -m -c
155 |
--------------------------------------------------------------------------------
/js/jsoneditor-master/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "jsoneditor",
3 | "version": "4.2.1",
4 | "description": "A web-based tool to view, edit and format JSON",
5 | "tags": [
6 | "json",
7 | "editor",
8 | "viewer",
9 | "formatter"
10 | ],
11 | "homepage": "http://jsoneditoronline.org/",
12 | "repository": {
13 | "type": "git",
14 | "url": "https://github.com/josdejong/jsoneditor.git"
15 | },
16 | "main": [
17 | "./dist/jsoneditor.min.js",
18 | "./dist/jsoneditor.min.css"
19 | ],
20 | "bugs": "https://github.com/josdejong/jsoneditor/issues",
21 | "ignore": [
22 | "misc",
23 | "node_modules",
24 | "test",
25 | "tools",
26 | "gulpfile.js",
27 | "npm-debug.log",
28 | ".idea",
29 | ".npmignore",
30 | ".gitignore"
31 | ],
32 | "dependencies": {}
33 | }
34 |
--------------------------------------------------------------------------------
/js/jsoneditor-master/dist/img/jsoneditor-icons.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jgrayson-apl/VectorBasemapStyleEditor/eb7c2e4b2dc58583e7d70b6de4fec5f9cd419653/js/jsoneditor-master/dist/img/jsoneditor-icons.png
--------------------------------------------------------------------------------
/js/jsoneditor-master/dist/jsoneditor.min.css:
--------------------------------------------------------------------------------
1 | .jsoneditor .field,.jsoneditor .readonly,.jsoneditor .value{border:1px solid transparent;min-height:16px;min-width:32px;padding:2px;margin:1px;word-wrap:break-word;float:left}.jsoneditor .field p,.jsoneditor .value p{margin:0}.jsoneditor .value{word-break:break-word}.jsoneditor .readonly{min-width:16px;color:gray}.jsoneditor .empty{border-color:#d3d3d3;border-style:dashed;border-radius:2px}.jsoneditor .field.empty{background-image:url(img/jsoneditor-icons.png);background-position:0 -144px}.jsoneditor .value.empty{background-image:url(img/jsoneditor-icons.png);background-position:-48px -144px}.jsoneditor .value.url{color:green;text-decoration:underline}.jsoneditor a.value.url:focus,.jsoneditor a.value.url:hover{color:red}.jsoneditor .separator{padding:3px 0;vertical-align:top;color:gray}.jsoneditor .field.highlight,.jsoneditor .field[contenteditable=true]:focus,.jsoneditor .field[contenteditable=true]:hover,.jsoneditor .value.highlight,.jsoneditor .value[contenteditable=true]:focus,.jsoneditor .value[contenteditable=true]:hover{background-color:#FFFFAB;border:1px solid #ff0;border-radius:2px}.jsoneditor .field.highlight-active,.jsoneditor .field.highlight-active:focus,.jsoneditor .field.highlight-active:hover,.jsoneditor .value.highlight-active,.jsoneditor .value.highlight-active:focus,.jsoneditor .value.highlight-active:hover{background-color:#fe0;border:1px solid #ffc700;border-radius:2px}.jsoneditor div.tree button{width:24px;height:24px;padding:0;margin:0;border:none;cursor:pointer;background:url(img/jsoneditor-icons.png)}.jsoneditor div.tree button.collapsed{background-position:0 -48px}.jsoneditor div.tree button.expanded{background-position:0 -72px}.jsoneditor div.tree button.contextmenu{background-position:-48px -72px}.jsoneditor div.tree button.contextmenu.selected,.jsoneditor div.tree button.contextmenu:focus,.jsoneditor div.tree button.contextmenu:hover{background-position:-48px -48px}.jsoneditor div.tree :focus{outline:0}.jsoneditor div.tree button:focus{background-color:#f5f5f5;outline:#e5e5e5 solid 1px}.jsoneditor div.tree button.invisible{visibility:hidden;background:0 0}.jsoneditor{color:#1A1A1A;border:1px solid #97B0F8;box-sizing:border-box;width:100%;height:100%;overflow:auto;position:relative;padding:0;line-height:100%}.jsoneditor,.jsoneditor div.outer{-moz-box-sizing:border-box;-webkit-box-sizing:border-box}.jsoneditor div.tree table.tree{border-collapse:collapse;border-spacing:0;width:100%;margin:0}.jsoneditor div.outer{width:100%;height:100%;margin:-35px 0 0;padding:35px 0 0;box-sizing:border-box;overflow:hidden}.jsoneditor div.tree{width:100%;height:100%;position:relative;overflow:auto}.jsoneditor textarea.text{width:100%;height:100%;margin:0;box-sizing:border-box;border:none;background-color:#fff;resize:none}.jsoneditor .menu,.jsoneditor textarea.text{-moz-box-sizing:border-box;-webkit-box-sizing:border-box}.jsoneditor tr.highlight{background-color:#FFFFAB}.jsoneditor div.tree button.dragarea{background:url(img/jsoneditor-icons.png)-72px -72px;cursor:move}.jsoneditor div.tree button.dragarea:focus,.jsoneditor div.tree button.dragarea:hover{background-position:-72px -48px}.jsoneditor td,.jsoneditor th,.jsoneditor tr{padding:0;margin:0}.jsoneditor td,.jsoneditor td.tree{vertical-align:top}.jsoneditor .field,.jsoneditor .value,.jsoneditor td,.jsoneditor textarea,.jsoneditor th{font-family:droid sans mono,consolas,monospace,courier new,courier,sans-serif;font-size:10pt;color:#1A1A1A}.jsoneditor-contextmenu{position:absolute;z-index:99999}.jsoneditor-contextmenu ul{position:relative;left:0;top:0;width:124px;background:#fff;border:1px solid #d3d3d3;box-shadow:2px 2px 12px rgba(128,128,128,.3);list-style:none;margin:0;padding:0}.jsoneditor-contextmenu ul li button{padding:0;margin:0;width:124px;height:24px;border:none;cursor:pointer;color:#4d4d4d;background:0 0;line-height:26px;text-align:left}.jsoneditor-contextmenu ul li button::-moz-focus-inner{padding:0;border:0}.jsoneditor-contextmenu ul li button:focus,.jsoneditor-contextmenu ul li button:hover{color:#1a1a1a;background-color:#f5f5f5;outline:0}.jsoneditor-contextmenu ul li button.default{width:92px}.jsoneditor-contextmenu ul li button.expand{float:right;width:32px;height:24px;border-left:1px solid #e5e5e5}.jsoneditor-contextmenu div.icon{float:left;width:24px;height:24px;border:none;padding:0;margin:0;background-image:url(img/jsoneditor-icons.png)}.jsoneditor-contextmenu ul li button div.expand{float:right;width:24px;height:24px;padding:0;margin:0 4px 0 0;background:url(img/jsoneditor-icons.png)0 -72px;opacity:.4}.jsoneditor-contextmenu ul li button.expand:focus div.expand,.jsoneditor-contextmenu ul li button.expand:hover div.expand,.jsoneditor-contextmenu ul li button:focus div.expand,.jsoneditor-contextmenu ul li button:hover div.expand,.jsoneditor-contextmenu ul li.selected div.expand{opacity:1}.jsoneditor-contextmenu .separator{height:0;border-top:1px solid #e5e5e5;padding-top:5px;margin-top:5px}.jsoneditor-contextmenu button.remove>.icon{background-position:-24px -24px}.jsoneditor-contextmenu button.remove:focus>.icon,.jsoneditor-contextmenu button.remove:hover>.icon{background-position:-24px 0}.jsoneditor-contextmenu button.append>.icon{background-position:0 -24px}.jsoneditor-contextmenu button.append:focus>.icon,.jsoneditor-contextmenu button.append:hover>.icon{background-position:0 0}.jsoneditor-contextmenu button.insert>.icon{background-position:0 -24px}.jsoneditor-contextmenu button.insert:focus>.icon,.jsoneditor-contextmenu button.insert:hover>.icon{background-position:0 0}.jsoneditor-contextmenu button.duplicate>.icon{background-position:-48px -24px}.jsoneditor-contextmenu button.duplicate:focus>.icon,.jsoneditor-contextmenu button.duplicate:hover>.icon{background-position:-48px 0}.jsoneditor-contextmenu button.sort-asc>.icon{background-position:-168px -24px}.jsoneditor-contextmenu button.sort-asc:focus>.icon,.jsoneditor-contextmenu button.sort-asc:hover>.icon{background-position:-168px 0}.jsoneditor-contextmenu button.sort-desc>.icon{background-position:-192px -24px}.jsoneditor-contextmenu button.sort-desc:focus>.icon,.jsoneditor-contextmenu button.sort-desc:hover>.icon{background-position:-192px 0}.jsoneditor-contextmenu ul li .selected{background-color:#D5DDF6}.jsoneditor-contextmenu ul li{overflow:hidden}.jsoneditor-contextmenu ul li ul{display:none;position:relative;left:-10px;top:0;border:none;box-shadow:inset 0 0 10px rgba(128,128,128,.5);padding:0 10px;-webkit-transition:all .3s ease-out;-moz-transition:all .3s ease-out;-o-transition:all .3s ease-out;transition:all .3s ease-out}.jsoneditor-contextmenu ul li ul li button{padding-left:24px}.jsoneditor-contextmenu ul li ul li button:focus,.jsoneditor-contextmenu ul li ul li button:hover{background-color:#f5f5f5}.jsoneditor-contextmenu button.type-string>.icon{background-position:-144px -24px}.jsoneditor-contextmenu button.type-string.selected>.icon,.jsoneditor-contextmenu button.type-string:focus>.icon,.jsoneditor-contextmenu button.type-string:hover>.icon{background-position:-144px 0}.jsoneditor-contextmenu button.type-auto>.icon{background-position:-120px -24px}.jsoneditor-contextmenu button.type-auto.selected>.icon,.jsoneditor-contextmenu button.type-auto:focus>.icon,.jsoneditor-contextmenu button.type-auto:hover>.icon{background-position:-120px 0}.jsoneditor-contextmenu button.type-object>.icon{background-position:-72px -24px}.jsoneditor-contextmenu button.type-object.selected>.icon,.jsoneditor-contextmenu button.type-object:focus>.icon,.jsoneditor-contextmenu button.type-object:hover>.icon{background-position:-72px 0}.jsoneditor-contextmenu button.type-array>.icon{background-position:-96px -24px}.jsoneditor-contextmenu button.type-array.selected>.icon,.jsoneditor-contextmenu button.type-array:focus>.icon,.jsoneditor-contextmenu button.type-array:hover>.icon{background-position:-96px 0}.jsoneditor-contextmenu button.type-modes>.icon{background-image:none;width:6px}.jsoneditor .menu{width:100%;height:35px;padding:2px;margin:0;overflow:hidden;box-sizing:border-box;color:#1A1A1A;background-color:#D5DDF6;border-bottom:1px solid #97B0F8}.jsoneditor .menu button{width:26px;height:26px;margin:2px;padding:0;border-radius:2px;border:1px solid #aec0f8;background:url(img/jsoneditor-icons.png)#e3eaf6;color:#4D4D4D;opacity:.8;font-family:arial,sans-serif;font-size:10pt;float:left}.jsoneditor .menu button:hover{background-color:#f0f2f5}.jsoneditor .menu button:active,.jsoneditor .menu button:focus{background-color:#fff}.jsoneditor .menu button:disabled{background-color:#e3eaf6}.jsoneditor .menu button.collapse-all{background-position:0 -96px}.jsoneditor .menu button.expand-all{background-position:0 -120px}.jsoneditor .menu button.undo{background-position:-24px -96px}.jsoneditor .menu button.undo:disabled{background-position:-24px -120px}.jsoneditor .menu button.redo{background-position:-48px -96px}.jsoneditor .menu button.redo:disabled{background-position:-48px -120px}.jsoneditor .menu button.compact{background-position:-72px -96px}.jsoneditor .menu button.format{background-position:-72px -120px}.jsoneditor .menu button.modes{background-image:none;width:auto;padding-left:6px;padding-right:6px}.jsoneditor .menu button.separator{margin-left:10px}.jsoneditor .menu a{font-family:arial,sans-serif;font-size:10pt;color:#97B0F8;vertical-align:middle}.jsoneditor .menu a:hover{color:red}.jsoneditor .menu a.poweredBy{font-size:8pt;position:absolute;right:0;top:0;padding:10px}.jsoneditor .search .results,.jsoneditor .search input{font-family:arial,sans-serif;font-size:10pt;color:#1A1A1A;background:0 0}.jsoneditor .search{position:absolute;right:2px;top:2px}.jsoneditor .search .frame{border:1px solid #97B0F8;background-color:#fff;padding:0 2px;margin:0}.jsoneditor .search .frame table{border-collapse:collapse}.jsoneditor .search input{width:120px;border:none;outline:0;margin:1px}.jsoneditor .search .results{color:#4d4d4d;padding-right:5px;line-height:24px}.jsoneditor .search button{width:16px;height:24px;padding:0;margin:0;border:none;background:url(img/jsoneditor-icons.png);vertical-align:top}.jsoneditor .search button:hover{background-color:transparent}.jsoneditor .search button.refresh{width:18px;background-position:-99px -73px}.jsoneditor .search button.next{cursor:pointer;background-position:-124px -73px}.jsoneditor .search button.next:hover{background-position:-124px -49px}.jsoneditor .search button.previous{cursor:pointer;background-position:-148px -73px;margin-right:2px}.jsoneditor .search button.previous:hover{background-position:-148px -49px}
--------------------------------------------------------------------------------
/js/jsoneditor-master/docs/api.md:
--------------------------------------------------------------------------------
1 | # API Reference
2 |
3 | ## JSONEditor
4 |
5 | ### Constructor
6 |
7 | #### `JSONEditor(container [, options] [, json])`
8 |
9 | Constructs a new JSONEditor.
10 |
11 | *Parameters:*
12 |
13 | - `{Element} container`
14 | An HTML DIV element. The JSONEditor will be created inside this container element.
15 | - `{Object} options`
16 | Optional object with options. Available options:
17 |
18 | - `{Object} ace`
19 | Provide a custom version of the [Ace editor](http://ace.c9.io/) and use this instead of the version that comes embedded with JSONEditor. Only applicable when `mode` is `code`.
20 | - `{function} change`
21 | Set a callback method triggered when the contents of the JSONEditor change. Called without parameters. Will only be triggered on changes made by the user, not in case of programmatic changes via the functions `set` or `setText`.
22 | - `{function} editable`
23 | Set a callback method to determine whether individual nodes are editable or read-only. Only applicable when option `mode` is `tree`. The callback is invoked as `editable(node)`, where `node` is an object `{field: string, value: string, path: string[]}`. The function must either return a boolean value to set both the nodes field and value editable or read-only, or return an object `{field: boolean, value: boolean}`.
24 | - `{function} error`
25 | Set a callback method triggered when an error occurs. Invoked with the error as first argument. The callback is only invoked
26 | for errors triggered by a users action.
27 | - `{boolean} history`
28 | Enables history, adds a button Undo and Redo to the menu of the JSONEditor. True by default. Only applicable when `mode` is 'tree' or 'form'.
29 | - `{String} mode`
30 | Set the editor mode. Available values: 'tree' (default), 'view', 'form', 'code', 'text'. In 'view' mode, the data and datastructure is read-only. In 'form' mode, only the value can be changed, the datastructure is read-only. Mode 'code' requires the Ace editor to be loaded on the page. Mode 'text' shows the data as plain text.
31 | - `{String[]} modes`
32 | Create a box in the editor menu where the user can switch between the specified modes. Available values: see option `mode`.
33 | - `{String} name`
34 | Initial field name for the root node, is undefined by default. Can also be set using `JSONEditor.setName(name)`. Only applicable when `mode` is 'tree', 'view', or 'form'.
35 | - `{boolean} search`
36 | Enables a search box in the upper right corner of the JSONEditor. True by default. Only applicable when `mode` is 'tree', 'view', or 'form'.
37 | - `{Number} indentation`
38 | Number of indentation spaces. 2 by default. Only applicable when `mode` is 'code' or 'text'.
39 | - `{String} theme`
40 | Set the Ace editor theme, uses included 'ace/theme/jsoneditor' by default. Please note that only the default theme is included with jsoneditor, so if you specify another one you need to make sure it is loaded.
41 |
42 | - `{JSON} json`
43 | Initial JSON data to be loaded into the JSONEditor. Alternatively, the method `JSONEditor.set(json)` can be used to load JSON data into the editor.
44 |
45 | *Returns:*
46 |
47 | - `{JSONEditor} editor`
48 | New instance of a JSONEditor.
49 |
50 |
51 | ### Methods
52 |
53 | #### `JSONEditor.collapseAll()`
54 |
55 | Collapse all fields. Only applicable for mode 'tree', 'view', and 'form'.
56 |
57 | #### `JSONEditor.expandAll()`
58 |
59 | Expand all fields. Only applicable for mode 'tree', 'view', and 'form'.
60 |
61 | #### `JSONEditor.focus()`
62 |
63 | Set focus to the JSONEditor.
64 |
65 | #### `JSONEditor.set(json)`
66 |
67 | Set JSON data.
68 |
69 | *Parameters:*
70 |
71 | - `{JSON} json`
72 | JSON data to be displayed in the JSONEditor.
73 |
74 | #### `JSONEditor.setMode(mode)`
75 |
76 | Switch mode. Mode `code` requires the [Ace editor](http://ace.ajax.org/).
77 |
78 | *Parameters:*
79 |
80 | - `{String} mode`
81 | Available values: `tree`, 'view', `form`, `code`, `text`.
82 |
83 | #### `JSONEditor.setName(name)`
84 |
85 | Set a field name for the root node.
86 |
87 | *Parameters:*
88 |
89 | - `{String | undefined} name`
90 | Field name of the root node. If undefined, the current name will be removed.
91 |
92 | #### `JSONEditor.setText(jsonString)`
93 |
94 | Set text data in the editor.
95 |
96 | *Parameters:*
97 |
98 | - `{String} jsonString`
99 | Contents of the editor as string.
100 |
101 | #### `JSONEditor.get()`
102 |
103 | Get JSON data.
104 |
105 | *Returns:*
106 |
107 | - `{JSON} json`
108 | JSON data from the JSONEditor.
109 |
110 | #### `JSONEditor.getName()`
111 |
112 | Retrieve the current field name of the root node.
113 |
114 | *Returns:*
115 |
116 | - `{String | undefined} name`
117 | Current field name of the root node, or undefined if not set.
118 |
119 | #### `JSONEditor.getText()`
120 |
121 | Get JSON data as string.
122 |
123 | *Returns:*
124 |
125 | - `{String} jsonString`
126 | Contents of the editor as string. When the editor is in code `text` or `code`,
127 | the returned text is returned as-is. For the other modes, the returned text
128 | is a compacted string. In order to get the JSON formatted with a certain
129 | number of spaces, use `JSON.stringify(JSONEditor.get(), null, 2)`.
130 |
131 |
132 | ### Examples
133 |
134 | A tree editor:
135 |
136 | ```js
137 | var options = {
138 | "mode": "tree",
139 | "search": true
140 | };
141 | var editor = new JSONEditor(container, options);
142 | var json = {
143 | "Array": [1, 2, 3],
144 | "Boolean": true,
145 | "Null": null,
146 | "Number": 123,
147 | "Object": {"a": "b", "c": "d"},
148 | "String": "Hello World"
149 | };
150 | editor.set(json);
151 | editor.expandAll();
152 |
153 | var json = editor.get(json);
154 | ```
155 |
156 | A text editor:
157 |
158 | ```js
159 | var options = {
160 | "mode": "text",
161 | "indentation": 2
162 | };
163 | var editor = new JSONEditor(container, options);
164 | var json = {
165 | "Array": [1, 2, 3],
166 | "Boolean": true,
167 | "Null": null,
168 | "Number": 123,
169 | "Object": {"a": "b", "c": "d"},
170 | "String": "Hello World"
171 | };
172 | editor.set(json);
173 |
174 | var json = editor.get();
175 | ```
176 |
177 | ## JSON parsing and stringification
178 |
179 | In general to parse or stringify JSON data, the browsers built in JSON parser can be used. To create a formatted string from a JSON object, use:
180 |
181 | ```js
182 | var formattedString = JSON.stringify(json, null, 2);
183 | ```
184 |
185 | to create a compacted string from a JSON object, use:
186 |
187 | ```js
188 | var compactString = JSON.stringify(json);
189 | ```
190 |
191 | To parse a String to a JSON object, use:
192 |
193 | ```js
194 | var json = JSON.parse(string);
195 | ```
196 |
--------------------------------------------------------------------------------
/js/jsoneditor-master/docs/shortcut_keys.md:
--------------------------------------------------------------------------------
1 | # Shortcut keys
2 |
3 | ## Tree Editor
4 |
5 | Key | Description
6 | ----------------------- | ------------------------------------------------
7 | Alt+Arrows | Move the caret up/down/left/right between fields
8 | Shift+Alt+Arrows | Move field up/down/left/right
9 | Ctrl+D | Duplicate field
10 | Ctrl+Del | Remove field
11 | Ctrl+Enter | Open link when on a field containing an url
12 | Ctrl+Ins | Insert a new field with type auto
13 | Ctrl+Shift+Ins | Append a new field with type auto
14 | Ctrl+E | Expand or collapse field
15 | Alt+End | Move the caret to the last field
16 | Ctrl+F | Find
17 | F3, Ctrl+G | Find next
18 | Shift+F3, Ctrl+Shift+G | Find previous
19 | Alt+Home | Move the caret to the first field
20 | Ctrl+M | Show actions menu
21 | Ctrl+Z | Undo last action
22 | Ctrl+Shift+Z | Redo
23 |
24 |
25 | ## Code Editor
26 |
27 | The code editor is powered by [Ace Editor](http://ace.c9.io/). This editor's
28 | shortcut keys are described here:
29 |
30 | https://github.com/ajaxorg/ace/wiki/Default-Keyboard-Shortcuts
31 |
32 | Additionally, there are shortcut keys to format/compact the code:
33 |
34 | Key | Description
35 | ----------------------- | ------------------------------------------------
36 | Ctrl+\ | Format JSON data, set proper indentation
37 | Ctrl+Shift+\ | Compact JSON data, remove all whitespace
38 |
--------------------------------------------------------------------------------
/js/jsoneditor-master/docs/usage.md:
--------------------------------------------------------------------------------
1 | # Usage
2 |
3 | ### Install
4 |
5 | with npm:
6 |
7 | npm install jsoneditor
8 |
9 | with bower:
10 |
11 | bower install jsoneditor
12 |
13 | download:
14 |
15 | [http://jsoneditoronline.org/downloads/](http://jsoneditoronline.org/downloads/)
16 |
17 | The library consists of three files: one javascript file, one css file and an
18 | image. Both full and minified version are available.
19 |
20 | ## Load
21 |
22 | To implement JSONEditor in a web application, load the javascript and css file
23 | in the head of the HTML page:
24 |
25 | ```html
26 |
27 |
28 | ```
29 |
30 | ## Use
31 |
32 | In the body, create an div element with an id and a size:
33 |
34 | ```html
35 |
36 | ```
37 |
38 | After the page is loaded, load the editor with javascript:
39 |
40 | ```js
41 | var container = document.getElementById("jsoneditor");
42 | var options = {
43 | mode: 'tree'
44 | };
45 | var editor = new JSONEditor(container, options);
46 | ```
47 |
48 | To set JSON data in the editor:
49 |
50 | ```js
51 | var json = {
52 | "Array": [1, 2, 3],
53 | "Boolean": true,
54 | "Null": null,
55 | "Number": 123,
56 | "Object": {"a": "b", "c": "d"},
57 | "String": "Hello World"
58 | };
59 | editor.set(json);
60 | ```
61 |
62 | To get JSON data from the editor:
63 |
64 | ```js
65 | var json = editor.get();
66 | ```
67 |
68 |
69 | ## Full Example
70 |
71 | ```html
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
33 | Switch editor mode using the mode box.
34 | Note that the mode can be changed programmatically as well using the method
35 | editor.setMode(mode), try it in the console of your browser.
36 |
25 | This examples uses HTML5 to load/save local files.
26 | Powered by FileReader.js and
27 | FileSaver.js.
28 | Only supported on modern browsers (Chrome, FireFox, IE10+, Safari 6.1+, Opera 15+).
29 |
30 | Switch editor mode using the mode box.
31 | Note that the mode can be changed programmatically as well using the method
32 | editor.setMode(mode), try it in the console of your browser.
33 |
30 | Switch editor mode using the mode box.
31 | Note that the mode can be changed programmatically as well using the method
32 | editor.setMode(mode), try it in the console of your browser.
33 |
34 |
35 |
36 |
37 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/js/jsoneditor-master/test/util.test.js:
--------------------------------------------------------------------------------
1 | var assert = require('assert');
2 | var util = require('../src/js/util');
3 |
4 | describe('util', function () {
5 |
6 | describe('sanitize', function () {
7 |
8 | it('should leave valid JSON as is', function () {
9 | assert.equal(util.sanitize('{"a":2}'), '{"a":2}');
10 | });
11 |
12 | it('should replace JavaScript with JSON', function () {
13 | assert.equal(util.sanitize('{a:2}'), '{"a":2}');
14 | assert.equal(util.sanitize('{\'a\':2}'), '{"a":2}');
15 | assert.equal(util.sanitize('{a:\'foo\'}'), '{"a":"foo"}');
16 |
17 | // should leave string content untouched
18 | assert.equal(util.sanitize('"{a:b}"'), '"{a:b}"');
19 | });
20 |
21 | it('should add/remove escape characters', function () {
22 | assert.equal(util.sanitize('"foo\'bar"'), '"foo\'bar"');
23 | assert.equal(util.sanitize('"foo\\"bar"'), '"foo\\"bar"');
24 | assert.equal(util.sanitize('\'foo"bar\''), '"foo\\"bar"');
25 | assert.equal(util.sanitize('\'foo\\\'bar\''), '"foo\'bar"');
26 | assert.equal(util.sanitize('"foo\\\'bar"'), '"foo\'bar"');
27 | });
28 |
29 | it('remove comments', function () {
30 | assert.equal(util.sanitize('/* foo */ {}'), ' {}');
31 |
32 | // should not remove comments in string
33 | assert.equal(util.sanitize('{"str":"/* foo */"}'), '{"str":"/* foo */"}');
34 | });
35 |
36 | it('should strip JSONP notation', function () {
37 | // matching
38 | assert.equal(util.sanitize('callback_123({});'), '{}');
39 | assert.equal(util.sanitize('callback_123([]);'), '[]');
40 | assert.equal(util.sanitize('callback_123(2);'), '2');
41 | assert.equal(util.sanitize('callback_123("foo");'), '"foo"');
42 | assert.equal(util.sanitize('callback_123(null);'), 'null');
43 | assert.equal(util.sanitize('callback_123(true);'), 'true');
44 | assert.equal(util.sanitize('callback_123(false);'), 'false');
45 | assert.equal(util.sanitize('/* foo bar */ callback_123 ({})'), '{}');
46 | assert.equal(util.sanitize('/* foo bar */ callback_123 ({})'), '{}');
47 | assert.equal(util.sanitize('/* foo bar */\ncallback_123({})'), '{}');
48 | assert.equal(util.sanitize('/* foo bar */ callback_123 ( {} )'), ' {} ');
49 | assert.equal(util.sanitize(' /* foo bar */ callback_123 ({}); '), '{}');
50 | assert.equal(util.sanitize('\n/* foo\nbar */\ncallback_123 ({});\n\n'), '{}');
51 |
52 | // non-matching
53 | assert.equal(util.sanitize('callback abc({});'), 'callback abc({});');
54 | assert.equal(util.sanitize('callback {}'), 'callback {}');
55 | assert.equal(util.sanitize('callback({}'), 'callback({}');
56 | });
57 |
58 | });
59 |
60 | // TODO: thoroughly test all util methods
61 | });
--------------------------------------------------------------------------------
/js/nls/fr/resources.js:
--------------------------------------------------------------------------------
1 | /*global define */
2 | /*
3 | | Copyright 2014 Esri
4 | |
5 | | Licensed under the Apache License, Version 2.0 (the "License");
6 | | you may not use this file except in compliance with the License.
7 | | You may obtain a copy of the License at
8 | |
9 | | http://www.apache.org/licenses/LICENSE-2.0
10 | |
11 | | Unless required by applicable law or agreed to in writing, software
12 | | distributed under the License is distributed on an "AS IS" BASIS,
13 | | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | | See the License for the specific language governing permissions and
15 | | limitations under the License.
16 | */
17 | define(({
18 | map: {
19 | error: "Impossible de créer la carte"
20 | }
21 | }));
--------------------------------------------------------------------------------
/js/nls/resources.js:
--------------------------------------------------------------------------------
1 | /*global define */
2 | /*
3 | | Copyright 2014 Esri
4 | |
5 | | Licensed under the Apache License, Version 2.0 (the "License");
6 | | you may not use this file except in compliance with the License.
7 | | You may obtain a copy of the License at
8 | |
9 | | http://www.apache.org/licenses/LICENSE-2.0
10 | |
11 | | Unless required by applicable law or agreed to in writing, software
12 | | distributed under the License is distributed on an "AS IS" BASIS,
13 | | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | | See the License for the specific language governing permissions and
15 | | limitations under the License.
16 | */
17 | define({
18 | root: ({
19 | map: {
20 | error: "Unable to create map"
21 | }
22 | }),
23 | "fr": 1
24 | });
--------------------------------------------------------------------------------
/oauth-callback.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/previous/index_OLD.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Vector Basemap Style Editor
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
38 |
39 |
69 |
70 |
71 |