Loading...
';
var loadContainer = html.toDom(loadHtml);
html.place(loadContainer, map.root);
- if (map.updating) {
+ if(map.updating){
html.addClass(loadContainer, 'loading');
}
- on(
- map,
- 'update-start',
- lang.hitch(this, function() {
- html.addClass(loadContainer, 'loading');
- }),
- );
- on(
- map,
- 'update-end',
- lang.hitch(this, function() {
- html.removeClass(loadContainer, 'loading');
- }),
- );
- on(
- map,
- 'unload',
- lang.hitch(this, function() {
- html.destroy(loadContainer);
- loadContainer = null;
- this._destroyLoadingShelter();
- }),
- );
- },
-
- _destroyLoadingShelter: function() {
- if (this.loading) {
- this.loading.destroy();
- this.loading = null;
- }
+ on(map, 'update-start', lang.hitch(this, function() {
+ html.addClass(loadContainer, 'loading');
+ }));
+ on(map, 'update-end', lang.hitch(this, function() {
+ html.removeClass(loadContainer, 'loading');
+ }));
+ on(map, 'unload', lang.hitch(this, function() {
+ html.destroy(loadContainer);
+ loadContainer = null;
+ }));
},
_checkAppState: function() {
//URL parameters that affect map extent
- var urlKeys = [
- 'extent',
- 'center',
- 'marker',
- 'find',
- 'query',
- 'scale',
- 'level',
- ];
+ var urlKeys = ['extent', 'center', 'marker', 'find', 'query', 'scale', 'level'];
var useAppState = this.appConfig.keepAppState;
- if (useAppState) {
- array.forEach(
- urlKeys,
- function(k) {
- if (k in this.urlParams) {
- useAppState = false;
- }
- },
- this,
- );
+ if(useAppState) {
+ array.forEach(urlKeys, function(k){
+ if(k in this.urlParams){
+ useAppState = false;
+ }
+ }, this);
}
- if (useAppState) {
- this.appStateManager.getWabAppState().then(
- lang.hitch(this, function(stateData) {
- if (stateData.extent || stateData.layers) {
- var appStatePopup = new AppStatePopup({
- nls: {
- title: this.nls.appState.title,
- restoreMap: this.nls.appState.restoreMap,
- },
- });
- appStatePopup.placeAt('main-page');
- on(
- appStatePopup,
- 'applyAppState',
- lang.hitch(this, function() {
- this._applyAppState(stateData, this.map);
- }),
- );
- appStatePopup.startup();
- /* CUSTOM MAP STATE START */
- console.log('applying App State via custom override');
+ if(useAppState){
+ this.appStateManager.getWabAppState().then(lang.hitch(this, function(stateData) {
+ if (stateData.extent || stateData.layers) {
+ var appStatePopup = new AppStatePopup({
+ nls: {
+ title: this.nls.appState.title,
+ restoreMap: this.nls.appState.restoreMap
+ }
+ });
+ appStatePopup.placeAt('main-page');
+ on(appStatePopup, 'applyAppState', lang.hitch(this, function() {
this._applyAppState(stateData, this.map);
- // appStatePopup.show();
- /* CUSTOM MAP STATE END */
- }
- }),
- );
+ }));
+ appStatePopup.startup();
+ /* CUSTOM MAP STATE START */
+ console.log('applying App State via custom override');
+ this._applyAppState(stateData, this.map);
+ // appStatePopup.show();
+ /* CUSTOM MAP STATE END */
+ }
+ }));
}
},
_applyAppState: function(stateData, map) {
var layerOptions = stateData.layers;
this.layerInfosObj.restoreState({
- layerOptions: layerOptions || null,
+ layerOptions: layerOptions || null
});
if (stateData.extent) {
map.setExtent(stateData.extent);
}
- this._publishMapEvent(map);
},
_processMapOptions: function(mapOptions) {
@@ -638,10 +510,10 @@ define([
return;
}
- if (!mapOptions.lods) {
+ if(!mapOptions.lods){
delete mapOptions.lods;
}
- if (mapOptions.lods && mapOptions.lods.length === 0) {
+ if(mapOptions.lods && mapOptions.lods.length === 0){
delete mapOptions.lods;
}
@@ -653,10 +525,7 @@ define([
ret.center = new Point(ret.center);
}
if (ret.infoWindow) {
- ret.infoWindow = new InfoWindow(
- ret.infoWindow,
- html.create('div', {}, this.mapDivId),
- );
+ ret.infoWindow = new InfoWindow(ret.infoWindow, html.create('div', {}, this.mapDivId));
}
return ret;
@@ -678,79 +547,100 @@ define([
'3D_image': 'esri3d/layers/ArcGISImageServiceLayer',
'3D_feature': 'esri3d/layers/FeatureLayer',
'3D_elevation': 'esri3d/layers/ArcGISElevationServiceLayer',
- '3D_3dmodle': 'esri3d/layers/SceneLayer',
+ '3D_3dmodle': 'esri3d/layers/SceneLayer'
};
- require([layMap[maptype + '_' + layerConfig.type]], lang.hitch(
- this,
- function(layerClass) {
- var layer,
- infoTemplate,
- options = {},
- keyProperties = [
- 'label',
- 'url',
- 'type',
- 'icon',
- 'infoTemplate',
- 'isOperationalLayer',
- ];
- for (var p in layerConfig) {
- if (keyProperties.indexOf(p) < 0) {
- options[p] = layerConfig[p];
- }
+ require([layMap[maptype + '_' + layerConfig.type]], lang.hitch(this, function(layerClass) {
+ var layer, infoTemplate, options = {},
+ keyProperties = ['label', 'url', 'type', 'icon', 'infoTemplate', 'isOperationalLayer'];
+ for (var p in layerConfig) {
+ if (keyProperties.indexOf(p) < 0) {
+ options[p] = layerConfig[p];
}
- if (layerConfig.infoTemplate) {
- infoTemplate = new InfoTemplate(
- layerConfig.infoTemplate.title,
- layerConfig.infoTemplate.content,
- );
- options.infoTemplate = infoTemplate;
-
- layer = new layerClass(layerConfig.url, options);
-
- if (
- layerConfig.infoTemplate.width &&
- layerConfig.infoTemplate.height
- ) {
- aspect.after(
- layer,
- 'onClick',
- lang.hitch(this, function() {
- map.infoWindow.resize(
- layerConfig.infoTemplate.width,
- layerConfig.infoTemplate.height,
- );
- }),
- true,
- );
- }
- } else {
- layer = new layerClass(layerConfig.url, options);
+ }
+ if (layerConfig.infoTemplate) {
+ infoTemplate = new InfoTemplate(layerConfig.infoTemplate.title,
+ layerConfig.infoTemplate.content);
+ options.infoTemplate = infoTemplate;
+
+ layer = new layerClass(layerConfig.url, options);
+
+ if (layerConfig.infoTemplate.width && layerConfig.infoTemplate.height) {
+ aspect.after(layer, 'onClick', lang.hitch(this, function() {
+ map.infoWindow.resize(layerConfig.infoTemplate.width,
+ layerConfig.infoTemplate.height);
+ }), true);
}
+ } else {
+ layer = new layerClass(layerConfig.url, options);
+ }
- layer.isOperationalLayer = layerConfig.isOperationalLayer;
- layer.label = layerConfig.label;
- layer.icon = layerConfig.icon;
- map.addLayer(layer);
- },
- ));
+ layer.isOperationalLayer = layerConfig.isOperationalLayer;
+ layer.label = layerConfig.label;
+ layer.icon = layerConfig.icon;
+ map.addLayer(layer);
+ }));
},
onAppConfigChanged: function(appConfig, reason, changedJson) {
// jshint unused:false
this.appConfig = appConfig;
- if (reason === 'mapChange') {
+ if(reason === 'mapChange'){
this._recreateMap(appConfig);
- } else if (reason === 'mapOptionsChange') {
- if (changedJson.lods) {
+ }else if(reason === 'mapOptionsChange'){
+ if(changedJson.lods){
this._recreateMap(appConfig);
}
+ }else if(reason === 'mapRefreshIntervalChange'){
+ var itemData = this.map && this.map.itemInfo.itemData;
+ if (itemData && this.layerInfosObj) {
+ this._updateRefreshInterval(changedJson);
+ }
}
},
- _recreateMap: function(appConfig) {
- if (this.map) {
+ onMapContentModified: function() {
+ this._recreateMap(this.appConfig);
+ },
+
+ _updateRefreshInterval: function(refreshInterval){
+ var minutes = -1;
+
+ if (refreshInterval.useWebMapRefreshInterval) {
+ //Honor the individual interval of each layer
+ minutes = -1;
+ } else {
+ //Use a single interval for all layers
+ minutes = refreshInterval.minutes;
+ }
+
+ this.layerInfosObj.getLayerInfoArrayOfWebmap().forEach(function(layerInfo) {
+ layerInfo.getLayerObject().then(lang.hitch(this, function(layerObject) {
+ if(!layerObject){
+ return;
+ }
+ //only handle non-static layer
+ var originalRefreshinterval = lang.getObject("_wabProperties.originalRefreshinterval", false, layerObject);
+
+ if(originalRefreshinterval > 0){
+ if (typeof layerObject.setRefreshInterval === 'function') {
+ if (minutes < 0) {
+ //Honor the individual interval of each layer
+ layerObject.setRefreshInterval(originalRefreshinterval);
+ } else {
+ //Use a single interval for all layers
+ layerObject.setRefreshInterval(minutes);
+ }
+ }
+ }
+ }), lang.hitch(this, function(err) {
+ console.error("can't get layerObject", err);
+ }));
+ }, this);
+ },
+
+ _recreateMap: function(appConfig){
+ if(this.map){
topic.publish('beforeMapDestory', this.map);
this.map.destroy();
}
@@ -763,7 +653,8 @@ define([
enableWebMapPopup: function() {
this.map.setInfoWindowOnClick(true);
- },
+ }
+
});
clazz.getInstance = function(options, mapDivId) {
diff --git a/app/jimu.js/MapUrlParamsHandler.js b/app/jimu.js/MapUrlParamsHandler.js
index 34cdacc..4d12d3b 100644
--- a/app/jimu.js/MapUrlParamsHandler.js
+++ b/app/jimu.js/MapUrlParamsHandler.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -104,10 +104,24 @@ define([
function setExtent(queryObject, map){
//?extent=-13054125.21,4029134.71,-13032684.63,4041785.04,102100 or ?extent=-13054125.21;4029134.71;-13032684.63;4041785.04;102100
//?extent=-117.2672,33.9927,-117.0746,34.1064 or ?extent=-117.2672;33.9927;-117.0746;34.1064
- var extArray = queryObject.extent.split(";");
- if (extArray.length === 1) {
- extArray = queryObject.extent.split(",");
+
+ //?extent=1008562.1255,1847133.031,1060087.7901,1877230.7859,wkt=PROJCS["NAD_1983_HARN_StatePlane_Illinois_East_FIPS_1201",GEOGCS["GCS_North_American_1983_HARN",DATUM["D_North_American_1983_HARN",SPHEROID["GRS_1980",6378137.0,298.257222101]]......
+ var extArray = queryObject.extent.split("wkt=");
+ var wkt = null;
+ if (extArray.length === 2) {
+ //with "wkt="
+ wkt = extArray[1];
+ extArray = extArray[0];
+
+ extArray = extArray.split(",");
+ } else {
+ //without "wkt="
+ extArray = queryObject.extent.split(";");
+ if (extArray.length === 1) {
+ extArray = queryObject.extent.split(",");
+ }
}
+
if (extArray.length === 4 || extArray.length === 5) {
var minx = parseFloat(extArray[0]);
var miny = parseFloat(extArray[1]);
@@ -124,7 +138,13 @@ define([
if (extArray.length === 5 && !isNaN(extArray[4])) {
wkid = parseInt(extArray[4], 10);
}
- var ext = new Extent(minx, miny, maxx, maxy, new SpatialReference({wkid:wkid}));
+
+ var ext = null;
+ if (wkt) {
+ ext = new Extent(minx, miny, maxx, maxy, new SpatialReference({ wkt: wkt }));
+ } else {
+ ext = new Extent(minx, miny, maxx, maxy, new SpatialReference({ wkid: wkid }));
+ }
if (!sameSpatialReference(map.spatialReference, ext.spatialReference)) {
@@ -158,8 +178,7 @@ define([
?marker=-117,34,,,,My%20location&level=10
?marker=-117,34&level=10
?marker=10406557.402,6590748.134,2526&level=10
- ?marker=-122.333,47.626,,,,&level=5&markertemplate=name," +
@@ -58,7 +61,10 @@ define([
postCreate: function() {
this.undoManager = new UndoManager();
this.layerInfosObj = jimuLayerInfos.getInstanceSync();
- this.originalJimuLayerInfo = this.layerInfosObj.getLayerInfoById(this.originalFeature.getLayer().id);
+ /* jscs:disable */
+ var originalFeatureLayerId = lang.getObject("_wabProperties.referToFeatureLayerId", false, this.originalFeature) ||
+ this.originalFeature.getLayer().id;
+ this.originalJimuLayerInfo = this.layerInfosObj.getLayerInfoById(originalFeatureLayerId);
this._temporaryData = {
eventHandles: [],
dijits: []
@@ -144,6 +150,12 @@ define([
return queryRelationship;
},
+ _getRelatedRecordsByRelatedQuery: function(operationData) {
+ return operationData.oriJimuLayerInfo.getRelatedRecords(operationData.feature,
+ operationData.destJimuLayerInfo);
+ },
+
+ /*
_getRelatedRecordsByRelatedQuery: function(operationData) {
var def = new Deferred();
var relatedQuery = new RelationshipQuery();
@@ -156,6 +168,7 @@ define([
var objectId =
operationData.feature.attributes[operationData.oriJimuLayerInfo.layerObject.objectIdField];
relatedQuery.objectIds = [objectId];
+ relatedQuery.definitionExpression = operationData.destJimuLayerInfo.getFilter();
operationData.oriJimuLayerInfo.layerObject.queryRelatedFeatures(
relatedQuery,
@@ -173,6 +186,7 @@ define([
return def;
},
+ */
_ignoreCaseToGetFieldObject: function(layerObject, fieldKey) {
var result = null;
@@ -196,10 +210,37 @@ define([
});
},
+ // _getDisplayTitleOfRelatedRecord: function(relatedLayerInfo, relatedRecord, displayFieldName) {
+ // var displayTitle;
+ // var displayFieldObject =
+ // this._ignoreCaseToGetFieldObject(relatedLayerInfo.layerObject, displayFieldName);
+
+ // var popupInfoTemplate = relatedLayerInfo.getInfoTemplate();
+ // if(displayFieldName === "popupTitle" && popupInfoTemplate) {
+ // if(typeof popupInfoTemplate.title === "function") {
+ // displayTitle = popupInfoTemplate.title(relatedRecord);
+ // } else {
+ // displayTitle = popupInfoTemplate.title;
+ // }
+ // } else {
+ // displayTitle = displayFieldObject && relatedRecord.attributes[displayFieldName];
+ // }
+
+ // if(displayTitle) {
+ // if(displayFieldObject &&
+ // displayFieldObject.type &&
+ // displayFieldObject.type === "esriFieldTypeDate") {
+ // displayTitle = this.getLocaleDateTime(displayTitle);
+ // }
+ // } else {
+ // displayTitle = "";
+ // }
+
+ // return displayTitle;
+ // },
+
_getDisplayTitleOfRelatedRecord: function(relatedLayerInfo, relatedRecord, displayFieldName) {
var displayTitle;
- var displayFieldObject =
- this._ignoreCaseToGetFieldObject(relatedLayerInfo.layerObject, displayFieldName);
var popupInfoTemplate = relatedLayerInfo.getInfoTemplate();
if(displayFieldName === "popupTitle" && popupInfoTemplate) {
@@ -209,22 +250,33 @@ define([
displayTitle = popupInfoTemplate.title;
}
} else {
- displayTitle = displayFieldObject && relatedRecord.attributes[displayFieldName];
+ displayTitle = this._getDisplayTitleFromPopup(relatedLayerInfo, relatedRecord, displayFieldName);
}
- if(displayTitle) {
- if(displayFieldObject &&
- displayFieldObject.type &&
- displayFieldObject.type === "esriFieldTypeDate") {
- displayTitle = this.getLocaleDateTime(displayTitle);
- }
+ return displayTitle ? displayTitle : "";
+ },
+
+ _getDisplayTitleFromPopup: function(relatedLayerInfo, relatedRecord, displayFieldName) {
+ var displayTitle;
+ var popupTemplate = this._getPopupTemplateWithOnlyDisplayField(relatedLayerInfo, displayFieldName);
+ if(popupTemplate) {
+ //temporary set infoTemplate to relatedRecord.
+ relatedRecord.setInfoTemplate(popupTemplate);
+ displayTitle = this.popupUIController.getDisplayTitle(relatedRecord);
+ // clear infoTemplate for relatedRecord;
+ relatedRecord.setInfoTemplate(null);
} else {
- displayTitle = "";
+ displayTitle = relatedRecord.attributes[displayFieldName];
}
-
return displayTitle;
},
+ _getPopupTemplateWithOnlyDisplayField: function(relatedLayerInfo, displayFieldName) {
+ var popupInfo = relatedLayerInfo._getCustomPopupInfo(relatedLayerInfo.layerObject, [displayFieldName]);
+ var popupTemplate = new PopupTemplate(popupInfo);
+ return popupTemplate;
+ },
+
_canShowRelatedData: function(oriJimuLayerInfo) {
var result = true;
var popupInfo = oriJimuLayerInfo.getPopupInfo();
@@ -499,7 +551,21 @@ define([
});
}
- array.forEach(relatedLayer.fields, function(field){
+ var fields = [];
+ if(popupInfo && popupInfo.fieldInfos) {
+ array.forEach(popupInfo.fieldInfos, function(fieldInfo) {
+ var field = {};
+ if(fieldInfo.visible) {
+ field.name = fieldInfo.fieldName;
+ field.alias = fieldInfo.label;
+ fields.push(field);
+ }
+ });
+ } else {
+ fields = relatedLayer.fields;
+ }
+
+ array.forEach(fields, function(field){
if(field.name.toLowerCase() !== "globalid" &&
field.name.toLowerCase() !== "shape"){
items.push({
@@ -578,21 +644,32 @@ define([
this.rrPopupProjector = rrPopupProjector;
this.popup = rrPopupProjector.popup;
this.initTempPopup();
+ this._initTempPopupForDisplayTitle();
this._initZoomToBtn();
+ this._setScrollable();
},
initTempPopup: function() {
this._tempPopup = new Popup({/*titleInBody: false*/}, html.create('div'));
},
+ _initTempPopupForDisplayTitle: function() {
+ this._tempPopupForDisplayTitle = new Popup({/*titleInBody: false*/}, html.create('div'));
+ this._tempPopupForDisplayTitle.show();
+ },
+
destroy: function() {
this._tempPopup.destroy();
+ this._tempPopupForDisplayTitle.destroy();
if(this._zoomToBtnClickHandle && this._zoomToBtnClickHandle.remove) {
this._zoomToBtnClickHandle.remove();
}
if(this._zoomToBtnANode) {
html.destroy(this._zoomToBtnANode);
}
+ if(this.toucemoveScrollHandle && this.toucemoveScrollHandle.remove) {
+ this.toucemoveScrollHandle.remove();
+ }
},
addDomNode: function(domNode) {
@@ -613,6 +690,7 @@ define([
// projectorParentNode.removeChild(this.rrPopupProjector.domNode);
this.setContent(esriViewPopupDomNode);
html.place(this.rrPopupProjector.domNode, esriViewPopupDomNode, "after");
+ this._unsetScrollable();
}
},
@@ -622,6 +700,52 @@ define([
projectorParentNode.removeChild(this.rrPopupProjector.domNode);
}
this.popup.setContent(content);
+ this._unsetScrollable();
+ },
+
+ _setScrollable: function() {
+ var contentPane = query(".contentPane", this.popup.domNode)[0];
+ if (has("esri-touch") && contentPane) {
+ this.toucemoveScrollHandle = on(contentPane, "touchmove", lang.hitch(this, function (evt) {
+ evt.preventDefault();
+ var esriViewPopupDomNode = query(".esriViewPopup", this.popup.domNode)[0];
+ if(!esriViewPopupDomNode) {
+ return;
+ }
+ var child = contentPane.firstChild;
+ if (child instanceof Text) {
+ child = contentPane.childNodes[1];
+ }
+
+ if(this.rrPopupProjector.domNode) {
+ html.setStyle(this.rrPopupProjector.contentBox, {
+ "-webkit-transition-property": "-webkit-transform",
+ "-webkit-transform": "translate(" + child._currentX + "px, " + child._currentY + "px)"
+ });
+ }
+ }));
+ }
+ },
+
+ _unsetScrollable: function() {
+ html.setStyle(this.rrPopupProjector.contentBox, {
+ "-webkit-transition-property": "none",
+ "-webkit-transform": "none"
+ });
+
+ html.setStyle(this.rrPopupProjector.domNode, {
+ "-webkit-transition-property": "none",
+ "-webkit-transform": "none"
+ });
+ },
+
+
+ getDisplayTitle: function(feature) {
+ var displayTitle;
+ this._tempPopupForDisplayTitle.setFeatures([feature]);
+ var attrValueTdDomNode = query("td.attrValue", this._tempPopupForDisplayTitle.domNode)[0];
+ displayTitle = attrValueTdDomNode && attrValueTdDomNode.innerHTML;
+ return displayTitle;
},
_getRefDomNode: function() {
diff --git a/app/jimu.js/Role.js b/app/jimu.js/Role.js
index 761e8a1..0eb2b86 100644
--- a/app/jimu.js/Role.js
+++ b/app/jimu.js/Role.js
@@ -225,9 +225,9 @@ define([
case "premium:user:geoenrichment":
this.privilegeObj.premium.user.geoenrichment = allow;
break;
-// case "premium:user:geotrigger":
-// this.privilegeObj.premium.user.geotrigger = allow;
-// break;
+ // case "premium:user:geotrigger":
+ // this.privilegeObj.premium.user.geotrigger = allow;
+ // break;
case "premium:user:demographics":
this.privilegeObj.premium.user.demographics = allow;
break;
diff --git a/app/jimu.js/SelectionManager.js b/app/jimu.js/SelectionManager.js
index 679ee74..70793db 100644
--- a/app/jimu.js/SelectionManager.js
+++ b/app/jimu.js/SelectionManager.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -125,8 +125,11 @@ define([
},
clearSelection: function(featureLayer){
+ var def = new Deferred();
this.clearDisplayLayer(featureLayer);
- return this.updateSelectionByFeatures(featureLayer, [], FeatureLayer.SELECTION_NEW);
+ featureLayer.clearSelection();
+ def.resolve();
+ return def;
},
clearDisplayLayer: function(featureLayer){
diff --git a/app/jimu.js/ServiceBrowserRule.js b/app/jimu.js/ServiceBrowserRule.js
index 98338d7..a68fab1 100644
--- a/app/jimu.js/ServiceBrowserRule.js
+++ b/app/jimu.js/ServiceBrowserRule.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -53,6 +53,7 @@ function(declare, lang, array, Deferred, jimuUtils, esriRequest, IdentityManager
//this method return a Deferred object,
//the Deferred object resolve an item object{name,type,url} of the input url
//here is the default implementation of getItem
+ //if resolve null, means can't pass the filter
getItem: function(url){
return this.defaultGetItem(url);
},
diff --git a/app/jimu.js/ServiceDefinitionManager.js b/app/jimu.js/ServiceDefinitionManager.js
new file mode 100644
index 0000000..e213e46
--- /dev/null
+++ b/app/jimu.js/ServiceDefinitionManager.js
@@ -0,0 +1,76 @@
+///////////////////////////////////////////////////////////////////////////
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
+//
+// Licensed under the Apache License Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+///////////////////////////////////////////////////////////////////////////
+
+define([
+ 'dojo/_base/declare',
+ 'esri/request'
+ ],
+ function(declare, esriRequest) {
+ var instance = null;
+
+ var clazz = declare(null, {
+ cache: {}, //{url:deferred}
+
+ getServiceDefinition: function(url, /*optional*/ handleAs) {
+ if(!handleAs){
+ handleAs = 'json';
+ }
+ var def = this.cache[url];
+ if(this._getDefStatus(def) <= 0){
+ def = esriRequest({
+ url: url,
+ handleAs: handleAs,
+ content: {
+ f: handleAs
+ },
+ callbackParamName: 'callback'
+ });
+ this.cache[url] = def;
+ }
+ return def;
+ },
+
+ //-1 means rejected or canceled
+ //0 means def is null
+ //1 means pending
+ //2 means resolved
+ _getDefStatus: function(def) {
+ if (def) {
+ if (def.isFulfilled()) {
+ if (def.isResolved()) {
+ return 2;
+ } else {
+ return -1;
+ }
+ } else {
+ return 1;
+ }
+ } else {
+ return 0;
+ }
+ }
+ });
+
+ clazz.getInstance = function() {
+ if (!instance) {
+ instance = new clazz();
+ window._serviceDefinitionManager = instance;
+ }
+ return instance;
+ };
+
+ return clazz;
+ });
\ No newline at end of file
diff --git a/app/jimu.js/SyncManager.js b/app/jimu.js/SyncManager.js
new file mode 100644
index 0000000..57bf29d
--- /dev/null
+++ b/app/jimu.js/SyncManager.js
@@ -0,0 +1,100 @@
+///////////////////////////////////////////////////////////////////////////
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
+//
+// Licensed under the Apache License Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+///////////////////////////////////////////////////////////////////////////
+
+define(['dojo/_base/declare',
+ 'dojo/_base/lang',
+ 'dojo/topic',
+ './SyncMapState'
+],
+ function (declare, lang, topic, SyncMapState) {
+ var instance = null, clazz;
+ /* global JSON */
+ clazz = declare(null, {
+
+ map: null,
+ isMainView: true,
+ syncEventKey: 'wab_sync_event',
+
+ constructor: function () {
+ if(!window.localStorage){
+ console.error('Localstorage is not supported by your browser, so the sync between browsers are not supported.');
+ return;
+ }
+ this._windows = [];
+ this.isMainView = window.queryObject.ismain === 'false'? false: true;
+ this.syncMapState = SyncMapState.getInstance();
+
+ topic.subscribe("mapLoaded", lang.hitch(this, this._onMapLoaded));
+ topic.subscribe("mapChanged", lang.hitch(this, this._onMapChanged));
+
+ if(!this.isMainView){
+ this._listenSyncEvent();
+ }
+ },
+
+ _onMapLoaded: function(map) {
+ this.map = map;
+ this.syncMapState.setMap(map);
+ this._bindMapEvents();
+ },
+
+ _onMapChanged: function(map) {
+ this.map = map;
+ this.syncMapState.setMap(map);
+ this._bindMapEvents();
+ },
+
+ _bindMapEvents: function(){
+ this.map.on("extent-change", lang.hitch(this, function(evt) {
+ this._broadcastMapEvent('extent-change', evt.extent);
+ }));
+ },
+
+ _broadcastMapEvent: function(evtName, evt){
+ this._broadcastEvent('map/' + evtName, evt);
+ },
+
+ _broadcastEvent: function(evtName, evt){
+ evtName = 'sync/' + evtName;
+ localStorage.setItem(this.syncEventKey, JSON.stringify({
+ evtName: evtName,
+ evt: evt
+ }));
+ },
+
+ _listenSyncEvent: function(){
+ window.addEventListener('storage', lang.hitch(this, function(e){
+ if(e.key !== this.syncEventKey){
+ return;
+ }
+
+ var evtInfo = JSON.parse(window.localStorage.getItem(e.key));
+ if(/^sync\/map/.test(evtInfo.evtName)){
+ this.syncMapState.handleMapChangeEvent(evtInfo);
+ }
+ }));
+ }
+
+ });
+
+ clazz.getInstance = function() {
+ if(instance === null) {
+ instance = new clazz();
+ }
+ return instance;
+ };
+ return clazz;
+});
\ No newline at end of file
diff --git a/app/jimu.js/SyncMapState.js b/app/jimu.js/SyncMapState.js
new file mode 100644
index 0000000..2256430
--- /dev/null
+++ b/app/jimu.js/SyncMapState.js
@@ -0,0 +1,52 @@
+///////////////////////////////////////////////////////////////////////////
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
+//
+// Licensed under the Apache License Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+///////////////////////////////////////////////////////////////////////////
+
+define(['dojo/_base/declare',
+ 'esri/geometry/Extent'
+],
+ function (declare, Extent) {
+ var instance = null, clazz;
+
+ clazz = declare(null, {
+ map: null,
+
+ setMap: function(map){
+ this.map = map;
+ },
+
+ handleMapChangeEvent: function(evtInfo){
+ switch(evtInfo.evtName){
+ case 'sync/map/extent-change':
+ return this._onExtentChange(evtInfo.evt);
+ default:
+ console.error('Unknown event name:', evtInfo.evtName);
+ }
+ },
+
+ _onExtentChange: function(extent){
+ this.map.setExtent(new Extent(extent));
+ }
+
+ });
+
+ clazz.getInstance = function() {
+ if(instance === null) {
+ instance = new clazz();
+ }
+ return instance;
+ };
+ return clazz;
+});
\ No newline at end of file
diff --git a/app/jimu.js/TooltipUtils.js b/app/jimu.js/TooltipUtils.js
index d176903..6ccec11 100644
--- a/app/jimu.js/TooltipUtils.js
+++ b/app/jimu.js/TooltipUtils.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/app/jimu.js/WidgetManager.js b/app/jimu.js/WidgetManager.js
index 78c500e..eaa1576 100644
--- a/app/jimu.js/WidgetManager.js
+++ b/app/jimu.js/WidgetManager.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -15,1186 +15,1284 @@
///////////////////////////////////////////////////////////////////////////
define(['dojo/_base/declare',
- 'dojo/_base/lang',
- 'dojo/_base/array',
- 'dojo/_base/html',
- 'dojo/Deferred',
- 'dojo/topic',
- 'dojo/Evented',
- 'dojo/on',
- 'dojo/aspect',
- 'dojo/json',
- 'dojo/query',
- 'dojo/request/xhr',
- 'dojo/promise/all',
- './utils',
- 'jimu/tokenUtils',
- './dijit/Message'
- ],
- function(declare, lang, array, html, Deferred, topic, Evented, on, aspect,
- json, query, xhr, all, utils, tokenUtils, Message) {
- var instance = null,
- clazz = declare(Evented, {
-
- constructor: function() {
- //the loaded widget list
- this.loaded = [];
-
- //action is triggered, but the widget has not been loaded
- //{id: widgetId, action: {}}
- this.missedActions = [];
-
- this.activeWidget = null;
-
- if(window.isBuilder){
- topic.subscribe("app/mapLoaded", lang.hitch(this, this._onMapLoaded));
- topic.subscribe("app/mapChanged", lang.hitch(this, this._onMapChanged));
- }else{
- topic.subscribe("mapLoaded", lang.hitch(this, this._onMapLoaded));
- topic.subscribe("mapChanged", lang.hitch(this, this._onMapChanged));
- }
+ 'dojo/_base/lang',
+ 'dojo/_base/array',
+ 'dojo/_base/html',
+ 'dojo/Deferred',
+ 'dojo/topic',
+ 'dojo/Evented',
+ // 'dojo/on',
+ 'dijit/Tooltip',
+ 'dojo/aspect',
+ 'dojo/json',
+ 'dojo/query',
+ 'dojo/request/xhr',
+ 'dojo/promise/all',
+ 'dijit/registry',
+ './utils',
+ 'jimu/tokenUtils',
+ './dijit/Message',
+ './DataSourceManager'
+],
+function(declare, lang, array, html, Deferred, topic, Evented, Tooltip, aspect,
+ json, query, xhr, all, registry, utils, tokenUtils, Message, DataSourceManager) {
+ var instance = null,
+ clazz = declare(Evented, {
+
+ constructor: function() {
+ //the loaded widget list
+ this.loaded = [];
+
+ //action is triggered, but the widget has not been loaded
+ //{id: widgetId, action: {}}
+ this.missedActions = [];
+
+ this.activeWidget = null;
+
+ if(window.isBuilder){
+ topic.subscribe("app/mapLoaded", lang.hitch(this, this._onMapLoaded));
+ topic.subscribe("app/mapChanged", lang.hitch(this, this._onMapChanged));
+ }else{
+ topic.subscribe("mapLoaded", lang.hitch(this, this._onMapLoaded));
+ topic.subscribe("mapChanged", lang.hitch(this, this._onMapChanged));
+ }
- if(window.isBuilder){
- topic.subscribe("app/sceneViewLoaded", lang.hitch(this, this._onSceneViewLoaded));
- topic.subscribe("app/sceneViewChanged", lang.hitch(this, this._onSceneViewChanged));
- }else{
- topic.subscribe("sceneViewLoaded", lang.hitch(this, this._onSceneViewLoaded));
- topic.subscribe("sceneViewChanged", lang.hitch(this, this._onSceneViewChanged));
- }
+ if(window.isBuilder){
+ topic.subscribe("app/sceneViewLoaded", lang.hitch(this, this._onSceneViewLoaded));
+ topic.subscribe("app/sceneViewChanged", lang.hitch(this, this._onSceneViewChanged));
+ }else{
+ topic.subscribe("sceneViewLoaded", lang.hitch(this, this._onSceneViewLoaded));
+ topic.subscribe("sceneViewChanged", lang.hitch(this, this._onSceneViewChanged));
+ }
- if(window.isBuilder){
- topic.subscribe("app/appConfigLoaded", lang.hitch(this, this._onAppConfigLoaded));
- topic.subscribe("app/appConfigChanged", lang.hitch(this, this._onAppConfigChanged));
- }else{
- topic.subscribe("appConfigLoaded", lang.hitch(this, this._onAppConfigLoaded));
- topic.subscribe("appConfigChanged", lang.hitch(this, this._onAppConfigChanged));
- }
+ if(window.isBuilder){
+ topic.subscribe("app/appConfigLoaded", lang.hitch(this, this._onAppConfigLoaded));
+ topic.subscribe("app/appConfigChanged", lang.hitch(this, this._onAppConfigChanged));
+ }else{
+ topic.subscribe("appConfigLoaded", lang.hitch(this, this._onAppConfigLoaded));
+ topic.subscribe("appConfigChanged", lang.hitch(this, this._onAppConfigChanged));
+ }
- topic.subscribe('userSignIn', lang.hitch(this, this._onUserSignIn));
- topic.subscribe('userSignOut', lang.hitch(this, this._onUserSignOut));
+ topic.subscribe('userSignIn', lang.hitch(this, this._onUserSignIn));
+ topic.subscribe('userSignOut', lang.hitch(this, this._onUserSignOut));
- //events from builder
- topic.subscribe('builder/actionTriggered', lang.hitch(this, this._onActionTriggered));
+ //events from builder
+ topic.subscribe('builder/actionTriggered', lang.hitch(this, this._onActionTriggered));
- //see panel manager
- topic.subscribe('/dnd/move/start', lang.hitch(this, this._onMoveStart));
- },
+ //see panel manager
+ topic.subscribe('/dnd/move/start', lang.hitch(this, this._onMoveStart));
+ },
- loadWidget: function(setting) {
- // summary:
- // load and create widget, return deferred. when defer is resolved,
- // widget is returned.
- // description:
- // setting should contain 2 properties:
- // id: id should be unique, same id will return same widget object.
- // uri: the widget's main class
+ loadWidget: function(setting) {
+ // summary:
+ // load and create widget, return deferred. when defer is resolved,
+ // widget is returned.
+ // description:
+ // setting should contain 2 properties:
+ // id: id should be unique, same id will return same widget object.
+ // uri: the widget's main class
- var def = new Deferred(),
- findWidget;
+ var def = new Deferred(),
+ findWidget;
- setting = lang.clone(setting);
+ setting = lang.clone(setting);
- findWidget = this.getWidgetById(setting.id);
+ findWidget = this.getWidgetById(setting.id);
- if (findWidget) {
- //widget have loaded(identified by id)
- def.resolve(findWidget);
- } else {
- all([this.loadWidgetClass(setting), this.loadWidgetManifest(setting)])
- .then(lang.hitch(this, function(results) {
- var clazz = results[0];
- var setting = results[1];
- this.loadWidgetResources(setting).then(lang.hitch(this, function(resouces) {
- try {
- var widget = this.createWidget(setting, clazz, resouces);
- html.setAttr(widget.domNode, 'data-widget-name', setting.name);
- console.log('widget [' + setting.uri + '] created.');
- } catch (err) {
- console.log('create [' + setting.uri + '] error:' + err.stack);
- new Message({
- message: window.jimuNls.widgetManager.createWidgetError + ': ' + setting.uri
- });
- def.reject(err);
- }
-
- //use timeout to let the widget can get the correct dimension in startup function
- setTimeout(lang.hitch(this, function() {
- def.resolve(widget);
- this.emit('widget-created', widget);
- topic.publish('widgetCreated', widget);
- }), 50);
-
- }), function(err) {
- def.reject(err);
+ if (findWidget) {
+ //widget have loaded(identified by id)
+ def.resolve(findWidget);
+ } else {
+ all([this.loadWidgetClass(setting), this.loadWidgetManifest(setting)])
+ .then(lang.hitch(this, function(results) {
+ var clazz = results[0];
+ var setting = results[1];
+ this.loadWidgetResources(setting).then(lang.hitch(this, function(resouces) {
+ try {
+ var widget = this.createWidget(setting, clazz, resouces);
+ html.setAttr(widget.domNode, 'data-widget-name', setting.name);
+ console.log('widget [' + setting.uri + '] created.');
+ } catch (err) {
+ console.log('create [' + setting.uri + '] error:' + err.stack);
+ new Message({
+ message: window.jimuNls.widgetManager.createWidgetError + ': ' + setting.uri
});
- }), function(err) {
+
+ //when creation is failed, but the dijit is still registered
+ if(registry.byId(setting.id)){
+ registry.byId(setting.id).destroy();
+ }
def.reject(err);
- });
- }
- return def;
- },
+ }
- loadWidgetClass: function(setting) {
- // summary:
- // load the widget's main class, and return deferred
- var def = new Deferred();
+ //use timeout to let the widget can get the correct dimension in startup function
+ setTimeout(lang.hitch(this, function() {
+ def.resolve(widget);
+ this.emit('widget-created', widget);
+ topic.publish('widgetCreated', widget);
+ }), 50);
- var uri;
- if(setting.isRemote){
- uri = setting.uri + '.js';
- }else{
- uri = setting.uri;
- }
- require(utils.getRequireConfig(), [uri], lang.hitch(this, function(clazz) {
- def.resolve(clazz);
- }));
-
- utils.checkError(setting.uri, def);
- return def;
- },
-
- loadWidgetResources: function(setting) {
- // summary:
- // load the widget's resources(local, style, etc.), and return deferred
-
- var def = new Deferred(),
- defConfig, defI18n, defStyle, defTemplate, defs = [];
-
- var setting2 = lang.clone(setting);
-
- defConfig = this.tryLoadWidgetConfig(setting2);
- defI18n = this._tryLoadResource(setting2, 'i18n');
- defStyle = this._tryLoadResource(setting2, 'style');
- defTemplate = this._tryLoadResource(setting2, 'template');
-
- defs.push(defConfig);
- defs.push(defI18n);
- defs.push(defTemplate);
- defs.push(defStyle);
-
- all(defs).then(lang.hitch(this, function(results) {
- var res = {};
- res.config = results[0];
- res.i18n = results[1];
- res.template = results[2];
- res.style = results[3];
- def.resolve(res);
+ }), function(err) {
+ def.reject(err);
+ });
}), function(err) {
def.reject(err);
});
+ }
+ return def;
+ },
+
+ loadWidgetClass: function(setting) {
+ // summary:
+ // load the widget's main class, and return deferred
+ var def = new Deferred();
+
+ var uri;
+ if(setting.isRemote){
+ uri = setting.uri + '.js';
+ }else{
+ uri = setting.uri;
+ }
+ require(utils.getRequireConfig(), [uri], lang.hitch(this, function(clazz) {
+ def.resolve(clazz);
+ }));
+
+ utils.checkError(setting.uri, def);
+ return def;
+ },
+
+ loadWidgetResources: function(setting) {
+ // summary:
+ // load the widget's resources(local, style, etc.), and return deferred
+
+ var def = new Deferred(),
+ defConfig, defI18n, defStyle, defTemplate, defs = [];
+
+ var setting2 = lang.clone(setting);
+
+ defConfig = this.tryLoadWidgetConfig(setting2);
+ defI18n = this._tryLoadResource(setting2, 'i18n');
+ defStyle = this._tryLoadResource(setting2, 'style');
+ defTemplate = this._tryLoadResource(setting2, 'template');
+
+ defs.push(defConfig);
+ defs.push(defI18n);
+ defs.push(defTemplate);
+ defs.push(defStyle);
+
+ all(defs).then(lang.hitch(this, function(results) {
+ var res = {};
+ res.config = results[0];
+ res.i18n = results[1];
+ res.template = results[2];
+ res.style = results[3];
+ def.resolve(res);
+ }), function(err) {
+ def.reject(err);
+ });
- return def;
- },
-
- loadWidgetManifest: function(widgetJson){
- var def = new Deferred();
- var info = utils.getUriInfo(widgetJson.uri);
- var url;
- if(info.isRemote){
- url = info.folderUrl + 'manifest.json?f=json';
- }else{
- url = info.folderUrl + 'manifest.json';
- }
-
- //json.manifest is added in configmanager if manifest is merged.
- if(widgetJson.manifest){
- def.resolve(widgetJson);
- return def;
- }
+ return def;
+ },
+
+ loadWidgetManifest: function(widgetJson){
+ var def = new Deferred();
+ var info = utils.getUriInfo(widgetJson.uri);
+ var url;
+ if(info.isRemote){
+ url = info.folderUrl + 'manifest.json?f=json';
+ }else{
+ url = info.folderUrl + 'manifest.json';
+ }
- xhr(url, {
- handleAs:'json',
- headers: {
- "X-Requested-With": null
- }
- }).then(lang.hitch(this, function(manifest){
- if(manifest.error && manifest.error.code){
- //request manifest from AGOL item, and there is an error
- //error code may be: 400, 403
- return def.reject(manifest.error);
- }
+ //json.manifest is added in configmanager if manifest is merged.
+ if(widgetJson.manifest){
+ def.resolve(widgetJson);
+ return def;
+ }
- manifest.category = 'widget';
- lang.mixin(manifest, utils.getUriInfo(widgetJson.uri));
+ xhr(url, {
+ handleAs:'json',
+ headers: {
+ "X-Requested-With": null
+ }
+ }).then(lang.hitch(this, function(manifest){
+ if(manifest.error && manifest.error.code){
+ //request manifest from AGOL item, and there is an error
+ //error code may be: 400, 403
+ return def.reject(manifest.error);
+ }
- utils.manifest.addI18NLabel(manifest).then(lang.hitch(this, function(){
- this._processManifest(manifest);
- utils.widgetJson.addManifest2WidgetJson(widgetJson, manifest);
- def.resolve(widgetJson);
- }));
- }), function(err){
- def.reject(err);
- });
+ manifest.category = 'widget';
+ lang.mixin(manifest, utils.getUriInfo(widgetJson.uri));
- return def;
- },
+ utils.manifest.addI18NLabel(manifest).then(lang.hitch(this, function(){
+ this._processManifest(manifest);
+ utils.widgetJson.addManifest2WidgetJson(widgetJson, manifest);
+ def.resolve(widgetJson);
+ }));
+ }), function(err){
+ def.reject(err);
+ });
- getWidgetMarginBox: function(widget) {
- if (typeof widget === 'string') {
- widget = this.getWidgetById(widget);
- if (!widget) {
- return {};
- }
- }
- if(widget._marginBox){
- return widget._marginBox;
- }
+ return def;
+ },
- var position = {
- left: -9999,
- top: -9999,
- relativeTo: widget.position.relativeTo
- };
- widget.setPosition(position);
- this.openWidget(widget);
+ getWidgetMarginBox: function(widget) {
+ if (typeof widget === 'string') {
+ widget = this.getWidgetById(widget);
+ if (!widget) {
+ return {};
+ }
+ }
+ if(widget._marginBox){
+ return widget._marginBox;
+ }
- widget._marginBox = widget.getMarginBox();
+ var position = {
+ left: -9999,
+ top: -9999,
+ relativeTo: widget.position.relativeTo
+ };
+ widget._isTestSizeFlag = true;//set flag for getSize
+ widget.setPosition(position);
+ this.openWidget(widget);
- this.closeWidget(widget);
- return widget._marginBox;
- },
+ widget._marginBox = widget.getMarginBox();
- _processManifest: function(manifest){
- utils.manifest.addManifestProperies(manifest);
- utils.manifest.processManifestLabel(manifest, window.dojoConfig.locale);
- },
+ this.closeWidget(widget);
- createWidget: function(setting, clazz, resouces) {
- var widget;
+ if ("undefined" !== typeof widget._isTestSizeFlag) {
+ delete widget._isTestSizeFlag;//delete flag
+ }
+ return widget._marginBox;
+ },
- //here, check whether widget have loaded again because loading and create a widget
- //needs some time. If in this period time, more then one loading request will create
- //more widgets with the same id, it's a error.
+ _processManifest: function(manifest){
+ utils.manifest.addManifestProperies(manifest);
+ utils.manifest.processManifestLabel(manifest, window.dojoConfig.locale);
+ },
- if (this.getWidgetById(setting.id)) {
- return this.getWidgetById(setting.id);
- }
+ createWidget: function(setting, clazz, resouces) {
+ var widget;
- //the config can contain i18n placeholders
- if (resouces.config && resouces.i18n) {
- resouces.config = utils.replacePlaceHolder(resouces.config, resouces.i18n);
- }
+ //here, check whether widget have loaded again because loading and create a widget
+ //needs some time. If in this period time, more then one loading request will create
+ //more widgets with the same id, it's a error.
- setting.rawConfig = setting.config;
- setting.config = resouces.config || {};
- if (this.appConfig._appData) {
- this._mergeAgolConfig(setting);
- }
- setting.nls = resouces.i18n || {};
- if (resouces.template) {
- setting.templateString = resouces.template;
- }
+ if (this.getWidgetById(setting.id)) {
+ return this.getWidgetById(setting.id);
+ }
- setting['class'] = 'jimu-widget';
- if (!setting.label) {
- setting.label = setting.name;
- }
- if (this.map) {
- setting.map = this.map;
- }
- setting.appConfig = this.appConfig;
+ //the config can contain i18n placeholders
+ if (resouces.config && resouces.i18n) {
+ resouces.config = utils.replacePlaceHolder(resouces.config, resouces.i18n);
+ }
- // for IE8
- var setting2 = {};
- for (var prop in setting) {
- if (setting.hasOwnProperty(prop)) {
- setting2[prop] = setting[prop];
- }
- }
+ setting.rawConfig = setting.config;
+ setting.config = resouces.config || {};
+ if (this.appConfig._appData) {
+ this._mergeAgolConfig(setting);
+ }
+ setting.nls = resouces.i18n || {};
+ if (resouces.template) {
+ setting.templateString = resouces.template;
+ }
- setting2.widgetManager = this;
+ setting['class'] = 'jimu-widget';
+ if (!setting.label) {
+ setting.label = setting.name;
+ }
+ if (this.map) {
+ setting.map = this.map;
+ }
+ setting.appConfig = this.appConfig;
- widget = new clazz(setting2);
- widget.clazz = clazz;
- aspect.after(widget, 'startup', lang.hitch(this, this._postWidgetStartup, widget));
- aspect.before(widget, 'destroy', lang.hitch(this, this._onDestroyWidget, widget));
+ // for IE8
+ var setting2 = {};
+ for (var prop in setting) {
+ if (setting.hasOwnProperty(prop)) {
+ setting2[prop] = setting[prop];
+ }
+ }
- on(widget.domNode, 'click', lang.hitch(this, this._onClickWidget, widget));
+ setting2.widgetManager = this;
- this.loaded.push(widget);
- return widget;
- },
+ widget = new clazz(setting2);
+ widget.clazz = clazz;
+ aspect.after(widget, 'startup', lang.hitch(this, this._postWidgetStartup, widget));
+ aspect.before(widget, 'destroy', lang.hitch(this, this._onDestroyWidget, widget));
- getAllWidgets: function() {
- return this.loaded;
- },
- destroyAllWidgets: function() {
- var allWidgetIds = array.map(this.loaded, function(widget) {
- return widget.id;
- });
- array.forEach(allWidgetIds, function(widgetId) {
- this.destroyWidget(widgetId);
- }, this);
- this.loaded = [];
- },
-
- //load the widget setting page class and create setting page object
- //do not cache for now.
- loadWidgetSettingPage: function(setting) {
- var def = new Deferred();
- setting = lang.clone(setting);
-
- setting.id = setting.id + '_setting';
- all([this.loadWidgetSettingClass(setting)]).
- then(lang.hitch(this, function(results) {
- var clazz = results[0];
+ // on(widget.domNode, 'click', lang.hitch(this, this._onClickWidget, widget));
+ widget.domNode.addEventListener(this._getActiveEventName(),
+ lang.hitch(this, this._onClickWidget, widget), {capture: true});
- this.loadWidgetSettingPageResources(setting).then(lang.hitch(this, function(resources) {
- var settingObject; // style = results[2]
-
- // for IE8
- var setting2 = {
- nls: resources.i18n,
- templateString: resources.template,
- appConfig: this.appConfig,
- // map: this.map,
- 'class': 'jimu-widget-setting'
- };
-
- if(window.appInfo.appType === "HTML3D"){
- //for 3D Map, we pass sceneView
- setting2.sceneView = this.sceneView;
- }else{
- //for 2D Map, we pass map
- setting2.map = this.map;
- }
+ this.loaded.push(widget);
+ return widget;
+ },
- for (var prop in setting) {
- if (setting.hasOwnProperty(prop)) {
- setting2[prop] = setting[prop];
- }
- }
- try {
- settingObject = new clazz(setting2);
- html.setAttr(settingObject.domNode, 'data-widget-name-setting', setting2.name);
- aspect.before(settingObject, 'destroy',
- lang.hitch(this, this._onDestroyWidgetSetting, settingObject));
- def.resolve(settingObject);
- } catch (err) {
- new Message({
- message: window.jimuNls.widgetManager.createWidgetSettingPageError + ':' + setting.uri
- });
- def.reject(err);
- }
- }), function(err) {
- console.log(err);
- });
+ getAllWidgets: function() {
+ return this.loaded;
+ },
- }), function(err) {
- def.reject(err);
- });
- return def;
- },
+ destroyAllWidgets: function() {
+ var allWidgetIds = array.map(this.loaded, function(widget) {
+ return widget.id;
+ });
+ array.forEach(allWidgetIds, function(widgetId) {
+ this.destroyWidget(widgetId);
+ }, this);
+ this.loaded = [];
+ },
+
+ //load the widget setting page class and create setting page object
+ //do not cache for now.
+ loadWidgetSettingPage: function(setting) {
+ var def = new Deferred();
+ setting = lang.clone(setting);
+
+ setting.id = setting.id + '_setting';
+ all([this.loadWidgetSettingClass(setting)]).
+ then(lang.hitch(this, function(results) {
+ var clazz = results[0];
+
+ this.loadWidgetSettingPageResources(setting).then(lang.hitch(this, function(resources) {
+ var settingObject; // style = results[2]
- loadWidgetSettingClass: function(setting) {
- // summary:
- // load the widget's main class, and return deferred
- var def = new Deferred();
+ // for IE8
+ var setting2 = {
+ nls: resources.i18n,
+ templateString: resources.template,
+ appConfig: this.appConfig,
+ // map: this.map,
+ 'class': 'jimu-widget-setting'
+ };
- var uri;
- if(setting.isRemote){
- uri = setting.folderUrl + 'setting/Setting.js';
+ if(window.appInfo.appType === "HTML3D"){
+ //for 3D Map, we pass sceneView
+ setting2.sceneView = this.sceneView;
}else{
- uri = setting.amdFolder + 'setting/Setting';
- }
- require(utils.getRequireConfig(), [uri],
- lang.hitch(this, function(clazz) {
- def.resolve(clazz);
- }));
-
- utils.checkError(setting.folderUrl + 'setting/Setting.js', def);
- return def;
- },
-
- loadWidgetSettingPageResources: function(setting) {
- var def = new Deferred();
- var defI18n, defStyle, defTemplate, defs = [];
-
- setting = lang.clone(setting);
- defI18n = this._tryLoadResource(setting, 'settingI18n');
- defTemplate = this._tryLoadResource(setting, 'settingTemplate');
- defStyle = this._tryLoadResource(setting, 'settingStyle');
-
- defs.push(defI18n);
- defs.push(defTemplate);
- defs.push(defStyle);
-
- all(defs).then(lang.hitch(this, function(results) {
- var res = {};
- res.i18n = results[0] || {};
- res.template = results[1];
- res.style = results[2];
- def.resolve(res);
- }), function(err) {
- console.log(err);
- });
-
- return def;
- },
-
- getWidgetById: function(id) {
- var ret;
- array.some(this.loaded, function(w) {
- if (w.id === id) {
- ret = w;
- return true;
- }
- }, this);
- return ret;
- },
-
- getWidgetByLabel: function(label) {
- var ret;
- array.some(this.loaded, function(w) {
- if (w.label === label) {
- ret = w;
- return true;
- }
- }, this);
- return ret;
- },
-
- getWidgetsByName: function(name) {
- var ret = [];
- array.some(this.loaded, function(w) {
- if (w.name === name) {
- ret.push(w);
- }
- }, this);
- return ret;
- },
-
- //normal, minimized, maximized
- changeWindowStateTo: function(widget, state) {
- if (state === 'normal') {
- this.normalizeWidget(widget);
- } else if (state === 'minimized') {
- this.minimizeWidget(widget);
- } else if (state === 'maximized') {
- this.maximizeWidget(widget);
- } else {
- console.log('error state: ' + state);
+ //for 2D Map, we pass map
+ setting2.map = this.map;
}
- },
- closeWidget: function(widget) {
- if (typeof widget === 'string') {
- widget = this.getWidgetById(widget);
- if (!widget) {
- return;
+ for (var prop in setting) {
+ if (setting.hasOwnProperty(prop)) {
+ setting2[prop] = setting[prop];
}
}
- if (widget.state !== 'closed') {
- if(this.activeWidget && this.activeWidget.id === widget.id){
- this.activeWidget.onDeActive();
- this.activeWidget = null;
- }
- html.setStyle(widget.domNode, 'display', 'none');
- widget.setState('closed');
- try {
- widget.onClose();
- } catch (err) {
- console.log(console.error('fail to close widget ' + widget.name + '. ' + err.stack));
+ try {
+ settingObject = new clazz(setting2);
+ html.setAttr(settingObject.domNode, 'data-widget-name-setting', setting2.name);
+ aspect.before(settingObject, 'destroy',
+ lang.hitch(this, this._onDestroyWidgetSetting, settingObject));
+ def.resolve(settingObject);
+ } catch (err) {
+ new Message({
+ message: window.jimuNls.widgetManager.createWidgetSettingPageError + ':' + setting.uri
+ });
+ //when creation is failed, but the dijit is still registered
+ if(registry.byId(setting2.id)){
+ registry.byId(setting2.id).destroy();
}
+ def.reject(err);
}
- },
+ }), function(err) {
+ console.log(err);
+ });
- openWidget: function(widget) {
- if (typeof widget === 'string') {
- widget = this.getWidgetById(widget);
- if (!widget) {
- return;
- }
- }
- if(!widget.started){
- try {
- widget.started = true;
- widget.startup();
- } catch (err) {
- console.error('fail to startup widget ' + widget.name + '. ' + err.stack);
- }
- }
- if (widget.state === 'closed') {
- html.setStyle(widget.domNode, 'display', '');
- widget.setState('opened');
- try {
- widget.onOpen();
- } catch (err) {
- console.error('fail to open widget ' + widget.name + '. ' + err.stack);
- }
- }
- },
-
- activateWidget: function(widget){
- //activate a widget, the widget must be opened first
- if (typeof widget === 'string') {
- widget = this.getWidgetById(widget);
- if (!widget) {
- return;
- }
- }
- if(widget.state !== 'opened'){
- return;
- }
+ }), function(err) {
+ def.reject(err);
+ });
+ return def;
+ },
+
+ loadWidgetSettingClass: function(setting) {
+ // summary:
+ // load the widget's main class, and return deferred
+ var def = new Deferred();
+
+ var uri;
+ if(setting.isRemote){
+ uri = setting.folderUrl + 'setting/Setting.js';
+ }else{
+ uri = setting.amdFolder + 'setting/Setting';
+ }
+ require(utils.getRequireConfig(), [uri],
+ lang.hitch(this, function(clazz) {
+ def.resolve(clazz);
+ }));
+
+ utils.checkError(setting.folderUrl + 'setting/Setting.js', def);
+ return def;
+ },
+
+ loadWidgetSettingPageResources: function(setting) {
+ var def = new Deferred();
+ var defI18n, defStyle, defTemplate, defs = [];
+
+ setting = lang.clone(setting);
+ defI18n = this._tryLoadResource(setting, 'settingI18n');
+ defTemplate = this._tryLoadResource(setting, 'settingTemplate');
+ defStyle = this._tryLoadResource(setting, 'settingStyle');
+
+ defs.push(defI18n);
+ defs.push(defTemplate);
+ defs.push(defStyle);
+
+ all(defs).then(lang.hitch(this, function(results) {
+ var res = {};
+ res.i18n = results[0] || {};
+ res.template = results[1];
+ res.style = results[2];
+ def.resolve(res);
+ }), function(err) {
+ console.log(err);
+ });
- this._activeWidget(widget);
- },
+ return def;
+ },
- maximizeWidget: function(widget) {
- if (typeof widget === 'string') {
- widget = this.getWidgetById(widget);
- if (!widget) {
- return;
- }
- }
- if (widget.state === 'closed') {
- this.openWidget(widget);
- }
+ getWidgetById: function(id) {
+ var ret;
+ array.some(this.loaded, function(w) {
+ if (w.id === id) {
+ ret = w;
+ return true;
+ }
+ }, this);
+ return ret;
+ },
+
+ getWidgetByLabel: function(label) {
+ var ret;
+ array.some(this.loaded, function(w) {
+ if (w.label === label) {
+ ret = w;
+ return true;
+ }
+ }, this);
+ return ret;
+ },
+
+ getWidgetsByName: function(name) {
+ var ret = [];
+ array.some(this.loaded, function(w) {
+ if (w.name === name) {
+ ret.push(w);
+ }
+ }, this);
+ return ret;
+ },
+
+ //normal, minimized, maximized
+ changeWindowStateTo: function(widget, state) {
+ if (state === 'normal') {
+ this.normalizeWidget(widget);
+ } else if (state === 'minimized') {
+ this.minimizeWidget(widget);
+ } else if (state === 'maximized') {
+ this.maximizeWidget(widget);
+ } else {
+ console.log('error state: ' + state);
+ }
+ },
- widget.setWindowState('maximized');
- try {
- widget.onMaximize();
- } catch (err) {
- console.log(console.error('fail to maximize widget ' + widget.name + '. ' + err.stack));
- }
- },
+ closeWidget: function(widget) {
+ if (typeof widget === 'string') {
+ widget = this.getWidgetById(widget);
+ if (!widget) {
+ return;
+ }
+ }
+ if (widget.state !== 'closed') {
+ if(this.activeWidget && this.activeWidget.id === widget.id){
+ this.activeWidget.onDeActive();
+ this.activeWidget = null;
+ }
+ html.setStyle(widget.domNode, 'display', 'none');
+ widget.setState('closed');
+ try {
+ widget.onClose();
+ } catch (err) {
+ console.log(console.error('fail to close widget ' + widget.name + '. ' + err.stack));
+ }
+ }
- minimizeWidget: function(widget) {
- if (typeof widget === 'string') {
- widget = this.getWidgetById(widget);
- if (!widget) {
- return;
- }
- }
+ if(!this.appConfig.mode){
+ this._removeDataSourceUsage(widget);
+ }
+ },
- if (widget.state === 'closed') {
- this.openWidget(widget);
- }
- widget.setWindowState('minimized');
- try {
- widget.onMinimize();
- } catch (err) {
- console.log(console.error('fail to minimize widget ' + widget.name + '. ' + err.stack));
- }
- },
+ openWidget: function(widget) {
+ if (typeof widget === 'string') {
+ widget = this.getWidgetById(widget);
+ if (!widget) {
+ return;
+ }
+ }
+ if(!widget.started){
+ try {
+ widget.started = true;
+ widget.startup();
+ } catch (err) {
+ console.error('fail to startup widget ' + widget.name + '. ' + err.stack);
+ }
+ }
+ if (widget.state === 'closed') {
+ html.setStyle(widget.domNode, 'display', '');
+ widget.setState('opened');
+ try {
+ widget.onOpen();
+ } catch (err) {
+ console.error('fail to open widget ' + widget.name + '. ' + err.stack);
+ }
+ }else{
+ return;//Prevent repeated opening of the same widget.#14994
+ }
- normalizeWidget: function(widget) {
- if (typeof widget === 'string') {
- widget = this.getWidgetById(widget);
- if (!widget) {
- return;
- }
- }
+ if(!utils.isCommonOnScreenWidget(widget)){
+ if(widget.openAtStart && !widget._isNotOpenAtStart){
+ widget._isNotOpenAtStart = true;
+ }else{
+ utils.focusFirstFocusNode(widget.domNode);
+ }
+ }
- if (widget.state === 'closed') {
- this.openWidget(widget);
- }
- widget.setWindowState('normal');
- try {
- widget.onNormalize();
- } catch (err) {
- console.log(console.error('fail to normalize widget ' + widget.name + '. ' +
- err.stack));
- }
- },
-
- destroyWidget: function(widget) {
- var m;
- if (typeof widget === 'string') {
- m = this.getWidgetById(widget);
- if (!m) {
- //maybe, the widget is loading
- return;
- } else {
- widget = m;
- }
- }
- this._removeWidget(widget);
- try {
- widget.destroy();
- } catch (err) {
- console.log(console.error('fail to destroy widget ' + widget.name + '. ' + err.stack));
- }
- },
+ if(!this.appConfig.mode){
+ this._addDataSourceUsage(widget);
+ }
+ },
+
+ activateWidget: function(widget){
+ //activate a widget, the widget must be opened first
+ if (typeof widget === 'string') {
+ widget = this.getWidgetById(widget);
+ if (!widget) {
+ return;
+ }
+ }
+ if(widget.state !== 'opened'){
+ return;
+ }
- tryLoadWidgetConfig: function(setting) {
- return this._tryLoadWidgetConfig(setting).then(lang.hitch(this, function(config) {
- return this._upgradeWidgetConfig(setting, config).then(function(widgetConfig){
- setting.config = widgetConfig;
- return widgetConfig;
- });
- }));
- },
-
- triggerWidgetOpen: function(widgetId){
- var def = new Deferred();
- var widget = this.getWidgetById(widgetId);
- if(widget){
- if(widget.state !== 'closed'){
- def.resolve(widget);
- return def;
- }else{
- resolveAfterOpen(widget);
- }
- }else{
- var handle = topic.subscribe('widgetCreated', lang.hitch(this, function(_widget){
- if(_widget.id === widgetId){
- handle.remove();
- //we resolve here instead of waiting for onOpen, because onOpen may have been
- //triggered before this call back.
- def.resolve(_widget);
- }
- }));
- }
+ this._activeWidget(widget);
+ },
- topic.publish('openWidget', widgetId);
+ maximizeWidget: function(widget) {
+ if (typeof widget === 'string') {
+ widget = this.getWidgetById(widget);
+ if (!widget) {
+ return;
+ }
+ }
+ if (widget.state === 'closed') {
+ this.openWidget(widget);
+ }
- function resolveAfterOpen(widget){
- var handle = aspect.after(widget, 'onOpen', function(){
- handle.remove();
- def.resolve(widget);
- });
- }
+ widget.setWindowState('maximized');
+ try {
+ widget.onMaximize();
+ } catch (err) {
+ console.log(console.error('fail to maximize widget ' + widget.name + '. ' + err.stack));
+ }
+ },
+
+ minimizeWidget: function(widget) {
+ if (typeof widget === 'string') {
+ widget = this.getWidgetById(widget);
+ if (!widget) {
+ return;
+ }
+ }
+ if (widget.state === 'closed') {
+ this.openWidget(widget);
+ }
+ widget.setWindowState('minimized');
+ try {
+ widget.onMinimize();
+ } catch (err) {
+ console.log(console.error('fail to minimize widget ' + widget.name + '. ' + err.stack));
+ }
+ },
+
+ normalizeWidget: function(widget) {
+ if (typeof widget === 'string') {
+ widget = this.getWidgetById(widget);
+ if (!widget) {
+ return;
+ }
+ }
+
+ if (widget.state === 'closed') {
+ this.openWidget(widget);
+ }
+ widget.setWindowState('normal');
+ try {
+ widget.onNormalize();
+ } catch (err) {
+ console.log(console.error('fail to normalize widget ' + widget.name + '. ' +
+ err.stack));
+ }
+ },
+
+ destroyWidget: function(widget) {
+ var m;
+ if (typeof widget === 'string') {
+ m = this.getWidgetById(widget);
+ if (!m) {
+ //maybe, the widget is loading
+ return;
+ } else {
+ widget = m;
+ }
+ }
+ this._removeWidget(widget);
+ try {
+ widget.destroy();
+ } catch (err) {
+ console.log(console.error('fail to destroy widget ' + widget.name + '. ' + err.stack));
+ }
+ },
+
+ tryLoadWidgetConfig: function(setting) {
+ return this._tryLoadWidgetConfig(setting).then(lang.hitch(this, function(config) {
+ return this._upgradeWidgetConfig(setting, config).then(function(widgetConfig){
+ setting.config = widgetConfig;
+ return widgetConfig;
+ });
+ }));
+ },
+
+ triggerWidgetOpen: function(widgetId){
+ var def = new Deferred();
+ var widget = this.getWidgetById(widgetId);
+ if(widget){
+ if(widget.state !== 'closed'){
+ def.resolve(widget);
return def;
- },
-
- _tryLoadWidgetConfig: function(setting) {
- var def = new Deferred();
- //need load config first, because the template may be use the config data
- if (setting.config && lang.isObject(setting.config)) {
- //if widget is configurated in the app config.json, the i18n has beed processed
- def.resolve(setting.config);
- return def;
- } else if (setting.config) {
- if(require.cache['url:' + setting.config]){
- def.resolve(json.parse(require.cache['url:' + setting.config]));
- return def;
- }
- var configFile = utils.processUrlInAppConfig(setting.config);
- // The widgetConfig filename is dependent on widget label,
- // IE8 & IE9 do not encode automatically while attempt to request file.
- var configFileArray = configFile.split('/');
- configFileArray[configFileArray.length - 1] =
- encodeURIComponent(configFileArray[configFileArray.length - 1]);
- configFile = configFileArray.join('/');
- return xhr(configFile, {
- handleAs: "json",
- headers: {
- "X-Requested-With": null
- }
- });
- } else {
- return this._tryLoadResource(setting, 'config').then(function(config){
- //this property is used in map config plugin
- setting.isDefaultConfig = true;
- return config;
- });
+ }else{
+ resolveAfterOpen(widget);
+ }
+ }else{
+ var handle = topic.subscribe('widgetCreated', lang.hitch(this, function(_widget){
+ if(_widget.id === widgetId){
+ handle.remove();
+ //we resolve here instead of waiting for onOpen, because onOpen may have been
+ //triggered before this call back.
+ def.resolve(_widget);
}
- },
+ }));
+ }
- _upgradeWidgetConfig: function(json, oldConfig){
- var def = new Deferred();
- var widgetVersion = json.manifest.version;
- var configVersion = json.version;
- var newConfig;
+ topic.publish('openWidget', widgetId);
- if(widgetVersion === configVersion){
- def.resolve(oldConfig);
- return def;
+ function resolveAfterOpen(widget){
+ var handle = aspect.after(widget, 'onOpen', function(){
+ handle.remove();
+ def.resolve(widget);
+ });
+ }
+
+ return def;
+ },
+
+ _tryLoadWidgetConfig: function(setting) {
+ var def = new Deferred();
+ //need load config first, because the template may be use the config data
+ if (setting.config && lang.isObject(setting.config)) {
+ //if widget is configurated in the app config.json, the i18n has beed processed
+ def.resolve(setting.config);
+ return def;
+ } else if (setting.config) {
+ if(require.cache['url:' + setting.config]){
+ def.resolve(json.parse(require.cache['url:' + setting.config]));
+ return def;
+ }
+ var configFile = utils.processUrlInAppConfig(setting.config);
+ // The widgetConfig filename is dependent on widget label,
+ // IE8 & IE9 do not encode automatically while attempt to request file.
+ var configFileArray = configFile.split('/');
+ configFileArray[configFileArray.length - 1] =
+ encodeURIComponent(configFileArray[configFileArray.length - 1]);
+ configFile = configFileArray.join('/');
+ return xhr(configFile, {
+ handleAs: "json",
+ headers: {
+ "X-Requested-With": null
}
+ });
+ } else {
+ return this._tryLoadResource(setting, 'config').then(function(config){
+ //this property is used in map config plugin
+ setting.isDefaultConfig = true;
+ return config;
+ });
+ }
+ },
- if(json.hasVersionManager === false){
- //widget config loaded from builder needs update version
- json.version = widgetVersion;
+ _upgradeWidgetConfig: function(json, oldConfig){
+ var def = new Deferred();
+ var widgetVersion = json.manifest.version;
+ var configVersion = json.version;
+ var newConfig;
- //if widget doesn't have version manager, we assume the widget
- //is old version compatible
- def.resolve(oldConfig);
- return def;
- }
+ if(widgetVersion === configVersion){
+ def.resolve(oldConfig);
+ return def;
+ }
- require(utils.getRequireConfig(), [json.amdFolder + 'VersionManager'],
- lang.hitch(this, function(VersionManager) {
- var versionManager = new VersionManager();
-
- var configVersionIndex = versionManager.getVersionIndex(configVersion);
- var widgetVersionIndex = versionManager.getVersionIndex(widgetVersion);
- if(configVersionIndex > widgetVersionIndex){
- def.reject('Bad widget version number, ' + json.name + ',' + configVersion);
- }else{
- try{
- newConfig = versionManager.upgrade(oldConfig, configVersion, widgetVersion);
- json.version = widgetVersion;
- def.resolve(newConfig);
- }catch(err){
- console.log('Read widget [' + json.name + '] old config error,' + err.stack);
- def.resolve(oldConfig);
- }
- }
- }));
+ if(json.hasVersionManager === false){
+ //widget config loaded from builder needs update version
+ json.version = widgetVersion;
- return def;
- },
-
- /*
- * Load the css file in a widget.
- * This function load the widget's css file and insert it into the HTML page through
.
- * It also ensure that the css file is inserted only one time.
- */
- loadWidgetStyle: function(widgetSetting) {
- var id = 'widget/style/' + widgetSetting.uri,
- def = new Deferred();
- id = this._replaceId(id);
- if (html.byId(id)) {
- def.resolve('load');
- return def;
- }
- var themeCommonStyleId = 'theme_' + this.appConfig.theme.name + '_style_common';
- //insert widget style before theme style, to let theme style over widget style
- return utils.loadStyleLink(id, widgetSetting.styleFile, themeCommonStyleId);
- },
-
- loadWidgetSettingStyle: function(widgetSetting) {
- var id = 'widget/style/' + widgetSetting.uri + '/setting',
- def = new Deferred();
- id = this._replaceId(id);
- if (html.byId(id)) {
- def.resolve('load');
- return def;
- }
- return utils.loadStyleLink(id, widgetSetting.settingStyleFile);
- },
-
- loadWidgetConfig: function(widgetSetting) {
- var configFilePath = require(utils.getRequireConfig()).toUrl(widgetSetting.configFile);
- if(require.cache['url:' + configFilePath]){
- var def = new Deferred();
- def.resolve(json.parse(require.cache['url:' + configFilePath]));
- return def;
+ //if widget doesn't have version manager, we assume the widget
+ //is old version compatible
+ def.resolve(oldConfig);
+ return def;
+ }
+
+ require(utils.getRequireConfig(), [json.amdFolder + (json.isRemote? 'VersionManager.js': 'VersionManager')],
+ lang.hitch(this, function(VersionManager) {
+ var versionManager = new VersionManager();
+
+ var configVersionIndex = versionManager.getVersionIndex(configVersion);
+ var widgetVersionIndex = versionManager.getVersionIndex(widgetVersion);
+ if(configVersionIndex > widgetVersionIndex){
+ def.reject('Bad widget version number, ' + json.name + ',' + configVersion);
+ }else{
+ try{
+ newConfig = versionManager.upgrade(oldConfig, configVersion, widgetVersion);
+ json.version = widgetVersion;
+ def.resolve(newConfig);
+ }catch(err){
+ console.log('Read widget [' + json.name + '] old config error,' + err.stack);
+ def.resolve(oldConfig);
}
- return xhr(configFilePath, {
- handleAs: "json",
- headers: {
- "X-Requested-With": null
- }
- });
- },
+ }
+ }));
+
+ return def;
+ },
+
+ /*
+ * Load the css file in a widget.
+ * This function load the widget's css file and insert it into the HTML page through
.
+ * It also ensure that the css file is inserted only one time.
+ */
+ loadWidgetStyle: function(widgetSetting) {
+ var id = this._getStyleIdFromWidgetJson(widgetSetting, false),
+ def = new Deferred();
+ if (html.byId(id)) {
+ def.resolve('load');
+ return def;
+ }
+ var themeCommonStyleId = 'theme_' + this.appConfig.theme.name + '_style_common';
+ //insert widget style before theme style, to let theme style over widget style
+ return utils.loadStyleLink(id, widgetSetting.styleFile, themeCommonStyleId);
+ },
+
+ loadWidgetSettingStyle: function(widgetSetting) {
+ var id = this._getStyleIdFromWidgetJson(widgetSetting, true),
+ def = new Deferred();
+ if (html.byId(id)) {
+ def.resolve('load');
+ return def;
+ }
+ return utils.loadStyleLink(id, widgetSetting.settingStyleFile);
+ },
+
+ loadWidgetConfig: function(widgetSetting) {
+ var configFilePath = require(utils.getRequireConfig()).toUrl(widgetSetting.configFile);
+ if(require.cache['url:' + configFilePath]){
+ var def = new Deferred();
+ def.resolve(json.parse(require.cache['url:' + configFilePath]));
+ return def;
+ }
+ return xhr(configFilePath, {
+ handleAs: "json",
+ headers: {
+ "X-Requested-With": null
+ }
+ });
+ },
- loadWidgetI18n: function(widgetSetting) {
- var def = new Deferred();
- require(utils.getRequireConfig(), ['dojo/i18n!' + widgetSetting.i18nFile],
- function(bundle) {
- def.resolve(bundle);
- });
- return def;
- },
+ loadWidgetI18n: function(widgetSetting) {
+ var def = new Deferred();
+ require(utils.getRequireConfig(), ['dojo/i18n!' + widgetSetting.i18nFile],
+ function(bundle) {
+ def.resolve(bundle);
+ });
+ return def;
+ },
+
+ loadWidgetSettingI18n: function(widgetSetting) {
+ var def = new Deferred();
+ require(utils.getRequireConfig(), ['dojo/i18n!' + widgetSetting.settingI18nFile],
+ function(bundle) {
+ def.resolve(bundle);
+ });
+ return def;
+ },
+
+ loadWidgetTemplate: function(widgetSetting) {
+ var def = new Deferred();
+ require(utils.getRequireConfig(), ['dojo/text!' + widgetSetting.templateFile],
+ function(template) {
+ def.resolve(template);
+ });
- loadWidgetSettingI18n: function(widgetSetting) {
- var def = new Deferred();
- require(utils.getRequireConfig(), ['dojo/i18n!' + widgetSetting.settingI18nFile],
- function(bundle) {
- def.resolve(bundle);
- });
- return def;
- },
+ utils.checkError(widgetSetting.templateFile, def);
+ return def;
+ },
- loadWidgetTemplate: function(widgetSetting) {
- var def = new Deferred();
- require(utils.getRequireConfig(), ['dojo/text!' + widgetSetting.templateFile],
- function(template) {
- def.resolve(template);
- });
+ loadWidgetSettingTemplate: function(widgetSetting) {
+ var def = new Deferred();
+ require(utils.getRequireConfig(), ['dojo/text!' + widgetSetting.settingTemplateFile],
+ function(template) {
+ def.resolve(template);
+ });
- utils.checkError(widgetSetting.templateFile, def);
- return def;
- },
+ utils.checkError(widgetSetting.settingTemplateFile, def);
+ return def;
+ },
- loadWidgetSettingTemplate: function(widgetSetting) {
- var def = new Deferred();
- require(utils.getRequireConfig(), ['dojo/text!' + widgetSetting.settingTemplateFile],
- function(template) {
- def.resolve(template);
- });
+ removeWidgetStyle: function(widget) {
+ this._removeStyle(this._getStyleIdFromWidgetJson(widget, false));
+ },
- utils.checkError(widgetSetting.settingTemplateFile, def);
- return def;
- },
+ removeWidgetSettingStyle: function(widget) {
+ this._removeStyle(this._getStyleIdFromWidgetJson(widget, true));
+ },
- removeWidgetStyle: function(widget) {
- html.destroy(this._replaceId('widget/style/' + widget.uri));
- },
+ _removeStyle: function(styleId){
+ if(!html.byId(styleId)){
+ return;
+ }
+ var importStyles = html.attr(styleId, 'data-import-styles');
+ if(importStyles){
+ for(var i = 0; i < parseInt(importStyles, 10); i ++){
+ html.destroy(styleId + '_import_' + i);
+ }
+ }
+ html.destroy(styleId);
+ },
+
+ _getStyleIdFromWidgetJson: function(widgetJson, isSetting){
+ var p = widgetJson.itemId? widgetJson.itemId: widgetJson.uri;
+ var id = 'widget/style/' + p + (isSetting? '/setting': '');
+ return this._replaceId(id);
+ },
+
+ getControllerWidgets: function() {
+ return array.filter(this.loaded, function(widget) {
+ return widget.isController;
+ });
+ },
- removeWidgetSettingStyle: function(widget) {
- html.destroy(this._replaceId('widget/style/' + widget.uri + '/setting'));
- },
+ getOffPanelWidgets: function() {
+ return array.filter(this.loaded, function(widget) {
+ return !widget.inPanel;
+ });
+ },
- getControllerWidgets: function() {
- return array.filter(this.loaded, function(widget) {
- return widget.isController;
- });
- },
+ getOnScreenOffPanelWidgets: function() {
+ return array.filter(this.loaded, function(widget) {
+ return widget.isOnScreen && !widget.inPanel;
+ });
+ },
- getOffPanelWidgets: function() {
- return array.filter(this.loaded, function(widget) {
- return !widget.inPanel;
- });
- },
+ closeOtherWidgetsInTheSameGroup: function(widget){
+ if (typeof widget === 'string') {
+ widget = this.getWidgetById(widget);
+ if (!widget) {
+ return;
+ }
+ }
+ for(var i = 0; i < this.loaded.length; i++){
+ if(this.loaded[i].gid === widget.gid && this.loaded[i].id !== widget.id){
+ this.closeWidget(this.loaded[i]);
+ }
+ }
+ },
- getOnScreenOffPanelWidgets: function() {
- return array.filter(this.loaded, function(widget) {
- return widget.isOnScreen && !widget.inPanel;
- });
- },
+ closeAllWidgetsInGroup: function (groupId){
+ for(var i = 0; i < this.loaded.length; i++){
+ if(this.loaded[i].gid === groupId){
+ this.closeWidget(this.loaded[i]);
+ }
+ }
+ },
- closeOtherWidgetsInTheSameGroup: function(widget){
- if (typeof widget === 'string') {
- widget = this.getWidgetById(widget);
- if (!widget) {
- return;
- }
- }
- for(var i = 0; i < this.loaded.length; i++){
- if(this.loaded[i].gid === widget.gid && this.loaded[i].id !== widget.id){
- this.closeWidget(this.loaded[i]);
- }
- }
- },
+ _addDataSourceUsage: function(widget){
+ array.forEach(this._getUsedDataSourceIdFromWidget(widget), function(dsId){
+ DataSourceManager.getInstance().addDataSourceUsage(dsId, widget.id);
+ });
+ },
- closeAllWidgetsInGroup: function (groupId){
- for(var i = 0; i < this.loaded.length; i++){
- if(this.loaded[i].gid === groupId){
- this.closeWidget(this.loaded[i]);
- }
- }
- },
-
- // Merge AGOL configs when first open widget (because the
- // widgetConfig just loaded if the widget has not been edited yet).
- // This method only merge fields in widget config,
- // the other fields were merged in ConfigManager.js
- _mergeAgolConfig: function(setting) {
- var values = this.appConfig._appData.values;
- function doMerge(sectionKey) {
- for (var key in values) {
- var sectionKeyIndex = key.replace(/\//g, '_').indexOf(sectionKey + '_config');
- if (sectionKeyIndex >= 0){
- utils.template.setConfigValue(setting,
- key.replace(/\//g, '_').substr(sectionKeyIndex, key.length).
- replace(sectionKey, 'widget'),
- values[key]);
- }
- }
- }
- var sectionKey;
- sectionKey = 'widgets[' + setting.id + ']';
- doMerge(sectionKey);
- },
-
- _onUserSignIn: function(credential) {
- array.forEach(this.loaded, function(m) {
- m.onSignIn(credential);
- }, this);
- },
-
- _onUserSignOut: function() {
- array.forEach(this.loaded, function(m) {
- m.onSignOut();
- }, this);
- },
-
- _activeWidget: function(widget){
- if(this.activeWidget){
- if(this.activeWidget.id === widget.id){
- //zIndex may be reset by widget self, we do not set in-panel widget zindex
- if(this.activeWidget.inPanel === false && this.activeWidget.moveTopOnActive){
- html.setStyle(this.activeWidget.domNode, 'zIndex', 101);
- }
- return;
- }
- if(this.activeWidget.state === 'active'){
- this.activeWidget.setState('opened');
- if(this.activeWidget.inPanel === false){
- html.setStyle(widget.domNode, 'zIndex',
- 'zIndex' in widget.position? widget.position.zIndex: 'auto');
- }
- this.activeWidget.onDeActive();
- }
- }
- this.activeWidget = widget;
- if(this.activeWidget.state !== 'opened'){
- return;
+ _removeDataSourceUsage: function(widget){
+ array.forEach(this._getUsedDataSourceIdFromWidget(widget), function(dsId){
+ DataSourceManager.getInstance().removeDataSourceUsage(dsId, widget.id);
+ });
+ },
+
+ _getUsedDataSourceIdFromWidget: function(widget){
+ var widgetJson = this.appConfig.getConfigElementById(widget.id);
+ if(!widgetJson || !widgetJson.config){
+ return;
+ }
+ var configStr = json.stringify(widgetJson.config);
+ return array.filter(Object.keys(this.appConfig.dataSource.dataSources), function(dsId){
+ return configStr.indexOf(dsId) > -1;
+ }, this);
+ },
+
+ // Merge AGOL configs when first open widget (because the
+ // widgetConfig just loaded if the widget has not been edited yet).
+ // This method only merge fields in widget config,
+ // the other fields were merged in ConfigManager.js
+ _mergeAgolConfig: function(setting) {
+ var values = this.appConfig._appData.values;
+ function doMerge(sectionKey) {
+ for (var key in values) {
+ var sectionKeyIndex = key.replace(/\//g, '_').indexOf(sectionKey + '_config');
+ if (sectionKeyIndex >= 0){
+ utils.template.setConfigValue(setting,
+ key.replace(/\//g, '_').substr(sectionKeyIndex, key.length).
+ replace(sectionKey, 'widget'),
+ values[key]);
}
- this.activeWidget.setState('active');
+ }
+ }
+ var sectionKey;
+ sectionKey = 'widgets[' + setting.id + ']';
+ doMerge(sectionKey);
+ },
+
+ _onUserSignIn: function(credential) {
+ array.forEach(this.loaded, function(m) {
+ m.onSignIn(credential);
+ }, this);
+ },
+
+ _onUserSignOut: function() {
+ array.forEach(this.loaded, function(m) {
+ m.onSignOut();
+ }, this);
+ },
+
+ _activeWidget: function(widget){
+ if(this.activeWidget){
+ if(this.activeWidget.id === widget.id){
+ //zIndex may be reset by widget self, we do not set in-panel widget zindex
if(this.activeWidget.inPanel === false && this.activeWidget.moveTopOnActive){
html.setStyle(this.activeWidget.domNode, 'zIndex', 101);
}
- this.activeWidget.onActive();
- topic.publish('widgetActived', widget);
- },
-
- _onClickWidget: function(widget, evt){
- var childWidgets = query('.jimu-widget', widget.domNode);
- if(childWidgets.length > 0){
- for(var i = 0; i < childWidgets.length; i++){
- if(evt.target === childWidgets[i] || html.isDescendant(evt.target, childWidgets[i])){
- //click on the child widget or child widget's children dom
- return;
- }
- }
+ return;
+ }
+ if(this.activeWidget.state === 'active'){
+ this.activeWidget.setState('opened');
+ if(this.activeWidget.inPanel === false){
+ html.setStyle(widget.domNode, 'zIndex',
+ 'zIndex' in widget.position? widget.position.zIndex: 'auto');
}
- this._activeWidget(widget);
- },
-
- _onMoveStart: function(mover){
- array.forEach(this.loaded, function(widget){
- if(widget.domNode === mover.node){
- this._activeWidget(widget);
- }
- }, this);
- },
-
- _onAppConfigLoaded: function(_appConfig) {
- var appConfig = lang.clone(_appConfig);
- this.appConfig = appConfig;
- tokenUtils.setPortalUrl(appConfig.portalUrl);
- },
-
- _onMapLoaded: function(map) {
- this.map = map;
- },
-
- _onMapChanged: function(map) {
- this.map = map;
- },
-
- _onSceneViewLoaded: function(sceneView){
- this.sceneView = sceneView;
- },
-
- _onSceneViewChanged: function(sceneView){
- this.sceneView = sceneView;
- },
-
- _onAppConfigChanged: function(_appConfig, reason, changedData, otherOptions) {
- var appConfig = lang.clone(_appConfig);
- this.appConfig = appConfig;
- array.forEach(this.loaded, function(w) {
- if (!w) {
- //widget maybe deleted in the handler of appConfigChange event
- return;
- }
- w.onAppConfigChanged(appConfig, reason, changedData, otherOptions);
- if (reason === 'widgetChange') {
- this._onConfigChanged(changedData.id, changedData.config, otherOptions);
- }
- }, this);
- },
-
- _onConfigChanged: function(id, config) {
- //summary:
- // widget which care it's own config change should override onConfigChanged function
- var w = this.getWidgetById(id);
- if (!w) {
+ this.activeWidget.onDeActive();
+ }
+ }
+ this.activeWidget = widget;
+ if(this.activeWidget.state !== 'opened'){
+ return;
+ }
+ this.activeWidget.setState('active');
+ if(this.activeWidget.inPanel === false && this.activeWidget.moveTopOnActive){
+ html.setStyle(this.activeWidget.domNode, 'zIndex', 101);
+ }
+ this.activeWidget.onActive();
+ // utils.focusFirstFocusNode(widget.domNode);
+ topic.publish('widgetActived', widget);
+ },
+
+ _onClickWidget: function(widget, evt){
+ var childWidgets = query('.jimu-widget', widget.domNode);
+ if(childWidgets.length > 0){
+ for(var i = 0; i < childWidgets.length; i++){
+ if(evt.target === childWidgets[i] || html.isDescendant(evt.target, childWidgets[i])){
+ //click on the child widget or child widget's children dom
return;
}
+ }
+ }
+ this._activeWidget(widget);
+ },
- w.onConfigChanged(config);
- lang.mixin(w.config, config);
- },
+ _onMoveStart: function(mover){
+ array.forEach(this.loaded, function(widget){
+ if(widget.domNode === mover.node){
+ this._activeWidget(widget);
+ }
+ }, this);
+ },
+
+ _onAppConfigLoaded: function(_appConfig) {
+ var appConfig = lang.clone(_appConfig);
+ this.appConfig = appConfig;
+ tokenUtils.setPortalUrl(appConfig.portalUrl);
+ },
+
+ _onMapLoaded: function(map) {
+ this.map = map;
+ },
+
+ _onMapChanged: function(map) {
+ this.map = map;
+ },
+
+ _onSceneViewLoaded: function(sceneView){
+ this.sceneView = sceneView;
+ },
+
+ _onSceneViewChanged: function(sceneView){
+ this.sceneView = sceneView;
+ },
+
+ _onAppConfigChanged: function(_appConfig, reason, changedData, otherOptions) {
+ var appConfig = lang.clone(_appConfig);
+ this.appConfig = appConfig;
+ array.forEach(this.loaded, function(w) {
+ if (!w) {
+ //widget maybe deleted in the handler of appConfigChange event
+ return;
+ }
+ w.onAppConfigChanged(appConfig, reason, changedData, otherOptions);
+ if (reason === 'widgetChange') {
+ this._onConfigChanged(changedData.id, changedData.config, otherOptions);
+ }
+ }, this);
+ },
+
+ _onConfigChanged: function(id, config) {
+ //summary:
+ // widget which care it's own config change should override onConfigChanged function
+ var w = this.getWidgetById(id);
+ if (!w) {
+ return;
+ }
- _onActionTriggered: function(info) {
- if (info.elementId === 'map' || info.elementId === 'app') {
- return;
- }
- var m = this.getWidgetById(info.elementId);
- if (!m) {
- this.missedActions.push({
- id: info.elementId,
- action: {
- name: info.action,
- data: info.data
- }
- });
- } else {
- m.onAction(info.action, info.data);
- }
- //may be the controller widget also need process the action
- array.forEach(this.getControllerWidgets(), function(ctrlWidget) {
- if (ctrlWidget.widgetIsControlled(info.elementId)) {
- ctrlWidget.onAction(info.action, {
- widgetId: info.elementId,
- data: info.data
- });
- }
- }, this);
- },
-
- _postWidgetStartup: function(widgetObject) {
- widgetObject.started = true;//for backward compatibility
- utils.setVerticalCenter(widgetObject.domNode);
- aspect.after(widgetObject, 'resize', lang.hitch(this,
- utils.setVerticalCenter, widgetObject.domNode));
- this.openWidget(widgetObject);
- // if(widgetObject.defaultState){
- // this.changeWindowStateTo(widgetObject, widgetObject.defaultState);
- // }
-
- var portalUrl = this.appConfig.portalUrl;
- var credential = tokenUtils.getPortalCredential(portalUrl);
- if (credential) {
- widgetObject.onSignIn(credential);
- } else {
- widgetObject.onSignOut();
- }
- this._triggerMissedAction(widgetObject);
- },
+ w.onConfigChanged(config);
+ lang.mixin(w.config, config);
+ },
- _triggerMissedAction: function(widget) {
- this.missedActions.forEach(function(info) {
- if (info.id === widget.id) {
- widget.onAction(info.action.name, info.action.data);
- }
+ _onActionTriggered: function(info) {
+ if (info.elementId === 'map' || info.elementId === 'app') {
+ return;
+ }
+ var m = this.getWidgetById(info.elementId);
+ if (!m) {
+ this.missedActions.push({
+ id: info.elementId,
+ action: {
+ name: info.action,
+ data: info.data
+ }
+ });
+ } else {
+ m.onAction(info.action, info.data);
+ }
+ //may be the controller widget also need process the action
+ array.forEach(this.getControllerWidgets(), function(ctrlWidget) {
+ if (ctrlWidget.widgetIsControlled(info.elementId)) {
+ ctrlWidget.onAction(info.action, {
+ widgetId: info.elementId,
+ data: info.data
});
- },
+ }
+ }, this);
+ },
+
+ _postWidgetStartup: function(widgetObject) {
+ widgetObject.started = true;//for backward compatibility
+ utils.setVerticalCenter(widgetObject.domNode);
+ aspect.after(widgetObject, 'resize', lang.hitch(this,
+ utils.setVerticalCenter, widgetObject.domNode));
+
+ //init styles and event for first/last nodes
+ utils.initTabIndexAndOrder(widgetObject);
+ //init cancel event for widgetDom
+ utils.initWidgetCancelEvent(widgetObject);
+
+ this.openWidget(widgetObject);
+ // if(widgetObject.defaultState){
+ // this.changeWindowStateTo(widgetObject, widgetObject.defaultState);
+ // }
+
+ var portalUrl = this.appConfig.portalUrl;
+ var credential = tokenUtils.getPortalCredential(portalUrl);
+ if (credential) {
+ widgetObject.onSignIn(credential);
+ } else {
+ widgetObject.onSignOut();
+ }
+ this._triggerMissedAction(widgetObject);
- _remove: function(id) {
- return array.some(this.loaded, function(w, i) {
- if (w.id === id) {
- this.loaded.splice(i, 1);
- return true;
- }
- }, this);
- },
-
- _tryLoadResource: function(setting, flag) {
- var file, hasp,
- def = new Deferred(),
- doLoad = function() {
- var loadDef;
- if (flag === 'config') {
- loadDef = this.loadWidgetConfig(setting);
- } else if (flag === 'style') {
- loadDef = this.loadWidgetStyle(setting);
- } else if (flag === 'i18n') {
- loadDef = this.loadWidgetI18n(setting);
- } else if (flag === 'template') {
- loadDef = this.loadWidgetTemplate(setting);
- } else if (flag === 'settingTemplate') {
- loadDef = this.loadWidgetSettingTemplate(setting);
- } else if (flag === 'settingStyle') {
- loadDef = this.loadWidgetSettingStyle(setting);
- } else if (flag === 'settingI18n') {
- loadDef = this.loadWidgetSettingI18n(setting);
- } else {
- return def;
- }
- loadDef.then(function(data) {
- def.resolve(data);
- }, function(err) {
- new Message({
- message: window.jimuNls.widgetManager.loadWidgetResourceError + ': ' + setting.uri
- });
- def.reject(err);
- });
- };
+ //add tooltips
+ utils.addTooltipByDomNode(Tooltip, widgetObject.domNode, widgetObject.label);
+ },
+ _triggerMissedAction: function(widget) {
+ this.missedActions.forEach(function(info) {
+ if (info.id === widget.id) {
+ widget.onAction(info.action.name, info.action.data);
+ }
+ });
+ },
+
+ _remove: function(id) {
+ return array.some(this.loaded, function(w, i) {
+ if (w.id === id) {
+ this.loaded.splice(i, 1);
+ return true;
+ }
+ }, this);
+ },
+
+ _tryLoadResource: function(setting, flag) {
+ var file, hasp,
+ def = new Deferred(),
+ doLoad = function() {
+ var loadDef;
if (flag === 'config') {
- file = setting.amdFolder + 'config.json';
- setting.configFile = file;
- hasp = 'hasConfig';
+ loadDef = this.loadWidgetConfig(setting);
} else if (flag === 'style') {
- file = setting.amdFolder + 'css/style.css';
- setting.styleFile = file;
- hasp = 'hasStyle';
+ loadDef = this.loadWidgetStyle(setting);
} else if (flag === 'i18n') {
- file = setting.amdFolder + 'nls/strings.js';
- if(setting.isRemote){
- setting.i18nFile = file;
- }else{
- setting.i18nFile = setting.amdFolder + 'nls/strings';
- }
- hasp = 'hasLocale';
+ loadDef = this.loadWidgetI18n(setting);
} else if (flag === 'template') {
- file = setting.amdFolder + 'Widget.html';
- setting.templateFile = file;
- hasp = 'hasUIFile';
+ loadDef = this.loadWidgetTemplate(setting);
} else if (flag === 'settingTemplate') {
- file = setting.amdFolder + 'setting/Setting.html';
- setting.settingTemplateFile = file;
- hasp = 'hasSettingUIFile';
- } else if (flag === 'settingI18n') {
- file = setting.amdFolder + 'setting/nls/strings.js';
- if(setting.isRemote){
- setting.settingI18nFile = file;
- }else{
- setting.settingI18nFile = setting.amdFolder + 'setting/nls/strings';
- }
- hasp = 'hasSettingLocale';
+ loadDef = this.loadWidgetSettingTemplate(setting);
} else if (flag === 'settingStyle') {
- file = setting.amdFolder + 'setting/css/style.css';
- setting.settingStyleFile = file;
- hasp = 'hasSettingStyle';
+ loadDef = this.loadWidgetSettingStyle(setting);
+ } else if (flag === 'settingI18n') {
+ loadDef = this.loadWidgetSettingI18n(setting);
} else {
return def;
}
+ loadDef.then(function(data) {
+ def.resolve(data);
+ }, function(err) {
+ console.error('Load widget resource error. resource:', flag);
+ console.error(err);
+ new Message({
+ message: window.jimuNls.widgetManager.loadWidgetResourceError + ': ' + setting.uri
+ });
+ def.reject(err);
+ });
+ };
+
+ if (flag === 'config') {
+ file = setting.amdFolder + 'config.json';
+ setting.configFile = file;
+ hasp = 'hasConfig';
+ } else if (flag === 'style') {
+ file = setting.amdFolder + 'css/style.css';
+ setting.styleFile = file;
+ hasp = 'hasStyle';
+ } else if (flag === 'i18n') {
+ file = setting.amdFolder + 'nls/strings.js';
+ if(setting.isRemote){
+ setting.i18nFile = file;
+ }else{
+ setting.i18nFile = setting.amdFolder + 'nls/strings';
+ }
+ hasp = 'hasLocale';
+ } else if (flag === 'template') {
+ file = setting.amdFolder + 'Widget.html';
+ setting.templateFile = file;
+ hasp = 'hasUIFile';
+ } else if (flag === 'settingTemplate') {
+ file = setting.amdFolder + 'setting/Setting.html';
+ setting.settingTemplateFile = file;
+ hasp = 'hasSettingUIFile';
+ } else if (flag === 'settingI18n') {
+ file = setting.amdFolder + 'setting/nls/strings.js';
+ if(setting.isRemote){
+ setting.settingI18nFile = file;
+ }else{
+ setting.settingI18nFile = setting.amdFolder + 'setting/nls/strings';
+ }
+ hasp = 'hasSettingLocale';
+ } else if (flag === 'settingStyle') {
+ file = setting.amdFolder + 'setting/css/style.css';
+ setting.settingStyleFile = file;
+ hasp = 'hasSettingStyle';
+ } else {
+ return def;
+ }
- if (setting[hasp]){
- doLoad.apply(this);
- }else {
- def.resolve(null);
- }
- return def;
- },
-
- _replaceId: function(id) {
- return id.replace(/\//g, '_').replace(/\./g, '_');
- },
+ if (setting[hasp]){
+ doLoad.apply(this);
+ }else {
+ def.resolve(null);
+ }
+ return def;
+ },
- _onDestroyWidget: function(widget) {
- if (widget.state !== 'closed') {
- this.closeWidget(widget);
- }
- this._removeWidget(widget);
- this.emit('widget-destroyed', widget.id);
- topic.publish('widgetDestroyed', widget.id);
- console.log('destroy widget [' + widget.uri + '].');
- },
-
- _onDestroyWidgetSetting: function(settingWidget) {
- this.removeWidgetSettingStyle(settingWidget);
- },
-
- _removeWidget: function(widget) {
- var m;
- if (typeof widget === 'string') {
- m = this.getWidgetById(widget);
- if (!m) {
- //maybe, the widget is loading
- return;
- } else {
- widget = m;
- }
- }
+ _replaceId: function(id) {
+ return id.replace(/\//g, '_').replace(/\./g, '_');
+ },
- if(this.activeWidget && this.activeWidget.id === widget.id){
- this.activeWidget = null;
- }
- this._remove(widget.id);
- if(this.getWidgetsByName(widget.name).length === 0){
- this.removeWidgetStyle(widget);
- }
+ _onDestroyWidget: function(widget) {
+ if (widget.state !== 'closed') {
+ this.closeWidget(widget);
+ }
+ this._removeWidget(widget);
+ this.emit('widget-destroyed', widget.id);
+ topic.publish('widgetDestroyed', widget.id);
+ console.log('destroy widget [' + widget.uri + '].');
+ },
+
+ _onDestroyWidgetSetting: function(settingWidget) {
+ this.removeWidgetSettingStyle(settingWidget);
+ },
+
+ _removeWidget: function(widget) {
+ var m;
+ if (typeof widget === 'string') {
+ m = this.getWidgetById(widget);
+ if (!m) {
+ //maybe, the widget is loading
+ return;
+ } else {
+ widget = m;
}
- });
+ }
- clazz.getInstance = function(urlParams) {
- if (instance === null) {
- instance = new clazz(urlParams);
- window._widgetManager = instance;
+ if(this.activeWidget && this.activeWidget.id === widget.id){
+ this.activeWidget = null;
+ }
+ this._remove(widget.id);
+ if(this.getWidgetsByName(widget.name).length === 0){
+ this.removeWidgetStyle(widget);
}
- return instance;
- };
- return clazz;
- });
\ No newline at end of file
+ },
+
+ _getActiveEventName: function() {
+ var hasPointer = "PointerEvent" in window ? "pointer" :
+ "MSPointerEvent" in window? "MSPointer" : false;
+ var hasMSPointer = hasPointer && hasPointer.slice(0, 2) === "MS";
+ var activeEventName = hasPointer ? hasPointer + (hasMSPointer ? "Down" : "down") : "mousedown";
+ return activeEventName;
+ }
+ });
+
+ clazz.getInstance = function(urlParams) {
+ if (instance === null) {
+ instance = new clazz(urlParams);
+ window._widgetManager = instance;
+ }
+ return instance;
+ };
+ return clazz;
+});
diff --git a/app/jimu.js/WidgetPlaceholder.js b/app/jimu.js/WidgetPlaceholder.js
index f62be03..fa631eb 100644
--- a/app/jimu.js/WidgetPlaceholder.js
+++ b/app/jimu.js/WidgetPlaceholder.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/app/jimu.js/_chartHelpUtils.js b/app/jimu.js/_chartHelpUtils.js
new file mode 100644
index 0000000..8ebb2ab
--- /dev/null
+++ b/app/jimu.js/_chartHelpUtils.js
@@ -0,0 +1,1480 @@
+define(['dojo/_base/declare',
+ 'jimu/utils',
+ 'dojo/_base/lang',
+ 'dojo/_base/config',
+ 'dojo/_base/Color',
+ './_dateFormat',
+ 'moment/moment',
+ 'esri/lang',
+ 'esri/graphic',
+ 'esri/symbols/jsonUtils'
+], function(declare, jimuUtils, lang, dojoConfig, Color, dateFormat, moment,
+ esriLang, Graphic, symbolJsonUtils) {
+
+ return declare(null, {
+ //popupInfo
+ //featureLayer
+ //_cachePlaces
+ constructor: function(options) {
+ if (options) {
+ lang.mixin(this, options);
+ }
+ if (!this.popupInfo) {
+ this.popupInfo = {};
+ }
+ if (!this.featureLayer) {
+ this.featureLayer = {};
+ }
+ this._cachePlaces = {};
+ },
+
+ setLayerFeatureLayer: function(featureLayer) {
+ this.featureLayer = featureLayer;
+ },
+
+ setLayerObject: function(layerObject) {
+ this.layerObject = layerObject;
+ },
+
+ setSymbolLayer: function(symbolLayer) {
+ this.symbolLayer = symbolLayer;
+ },
+
+ setPopupInfo: function(popupInfo) {
+ this.popupInfo = popupInfo;
+ },
+
+ setMap: function(map) {
+ this.map = map;
+ },
+
+ getBestLabelDisplay: function(data, field, mode) {
+ if (mode === 'feature') {
+ return this.betterDataCategoryForFeatureMode(data, field);
+ } else if (mode === 'category') {
+ return this.betterDataCategoryForCategoryCountMode(data, field);
+ } else if (mode === 'count') {
+ return this.betterDataCategoryForCategoryCountMode(data, field);
+ } else if (mode === 'field') {
+ return this.betterDataCategoryForFieldMode(data);
+ }
+ },
+
+ //Make category value's display more friendly
+ betterDataCategoryForFeatureMode: function(data, field) {
+ data.forEach(lang.hitch(this, function(item) {
+ item.label = this.getBestDisplayValue(field, item.label);
+ }));
+ return data;
+ },
+
+ betterDataCategoryForFieldMode: function(data) {
+ data.forEach(lang.hitch(this, function(item) {
+ item.label = this.getFieldAlias(item.label);
+ }));
+ return data;
+ },
+
+ betterDataCategoryForCategoryCountMode: function(data, field) {
+ data.forEach(lang.hitch(this, function(item) {
+ if (typeof item.unit !== 'undefined') {
+ item.label = this.getCategoryDisplayForDateUnit(item.label, item.unit);
+ } else {
+ item.label = this.getBestDisplayValue(field, item.label);
+ }
+
+ }));
+ return data;
+ },
+
+ keepStatisticsDataBestDecimalPlace: function(options, data, mode) {
+ if (mode === 'count') {
+ return data;
+ }
+ var valueFields = options.valueFields;
+ var operation = options.operation;
+ var features = options.features;
+ this.cacheDecimalPlace(valueFields, features, this.popupInfo);
+ var places = null;
+ if (mode === 'feature' || mode === 'category') {
+ data.forEach(lang.hitch(this, function(item) {
+ item.originalValues = lang.clone(item.values);
+ valueFields.forEach(lang.hitch(this, function(fieldName, index) {
+ var value = item.values[index];
+ if (this.isIntegerNumberField(fieldName) && operation === 'average') {
+ value = this.getBestValueForIntegerFieldAverage(value, 6);
+ } else {
+ places = this._getFieldDecimalPlaceFromCache(fieldName);
+ value = this.formatValuePlaces(value, places);
+ }
+ item.values[index] = value;
+ }));
+ }));
+ } else if (mode === 'field') {
+ valueFields.forEach(lang.hitch(this, function(fieldName) {
+ data.some(lang.hitch(this, function(item) {
+ if (item.label === fieldName) {
+ var value = item.values[0];
+ if (this.isIntegerNumberField(fieldName) && operation === 'average') {
+ value = this.getBestValueForIntegerFieldAverage(value, 6);
+ } else {
+ places = this._getFieldDecimalPlaceFromCache(fieldName);
+ value = this.formatValuePlaces(value, places);
+ }
+ item.values[0] = value;
+ return true;
+ }
+ return false;
+ }));
+ }));
+ }
+
+ return data;
+ },
+
+ isIntegerNumberField: function(fieldName) {
+ if (!this.featureLayer || !this.featureLayer.fields) {
+ return false;
+ }
+ var numberTypes = ['esriFieldTypeSmallInteger', 'esriFieldTypeInteger'];
+ var isNumber = this.featureLayer.fields.some(lang.hitch(this, function(fieldInfo) {
+ return fieldInfo.name === fieldName && numberTypes.indexOf(fieldInfo.type) >= 0;
+ }));
+ return isNumber;
+ },
+
+ formatValuePlaces: function(value, places) {
+ if (typeof places !== 'number') {
+ return value;
+ }
+ if (!value && value !== 0) {
+ return value;
+ }
+ var str = value.toFixed(places);
+ return str;
+ },
+
+ getBestValueForIntegerFieldAverage: function(value, maxDecimalPlaces) {
+ value = Number(value);
+ if (typeof value !== 'number') {
+ return value;
+ }
+ var decimalPlace = 0;
+ var splits = value.toString().split(".");
+
+ if (splits.length === 1) {
+ //value doesn't have fractional part
+ decimalPlace = 0;
+ } else if (splits.length === 2) {
+ //value has fractional part
+ decimalPlace = splits[1].length;
+ }
+ if (decimalPlace > 0) {
+ if (decimalPlace > maxDecimalPlaces) {
+ decimalPlace = maxDecimalPlaces;
+ }
+ var str = value.toFixed(decimalPlace);
+ return parseFloat(str);
+ } else {
+ return value;
+ }
+ },
+
+ _getFieldDecimalPlaceFromCache: function(field) {
+ var decimalPlace;
+ if (this._cachePlaces) {
+ var value = this._cachePlaces[field];
+ if (typeof value === 'number') {
+ decimalPlace = value;
+ }
+ }
+ return decimalPlace;
+ },
+
+ cacheDecimalPlace: function(fields, features, popupInfo) {
+ this._cachePlaces = {}; //{fieldName: decimal place,...}
+ var fieldNames = fields;
+ if (!fields || !fields.length) {
+ return;
+ }
+ var floatNumberFields = fieldNames.filter(lang.hitch(this, function(fieldName) {
+ return this.isFloatNumberField(fieldName);
+ }));
+ //{field:values, ...} like {POP: [1,2,3],...}
+ var floatNumberFieldValues = {};
+ floatNumberFields.forEach(lang.hitch(this, function(fieldName) {
+ floatNumberFieldValues[fieldName] = [];
+ }));
+
+ if (features && features.length > 0) {
+ features.forEach(lang.hitch(this, function(feature) {
+ var attributes = feature.attributes;
+ if (attributes) {
+ floatNumberFields.forEach(lang.hitch(this, function(fieldName) {
+ var value = attributes[fieldName];
+ if (typeof value === 'number') {
+ floatNumberFieldValues[fieldName].push(value);
+ }
+ }));
+ }
+ }));
+ }
+ floatNumberFields.forEach(lang.hitch(this, function(fieldName) {
+ var fieldInfo = this.getFieldInfoFromPopupInfo(popupInfo, fieldName);
+ this._cachePlaces[fieldName] = 0;
+ var values = floatNumberFieldValues[fieldName];
+ if (values.length > 0) {
+ try {
+ var decimalPlace = this.getBestDecimalPlaceForArrayValues(values);
+ this._cachePlaces[fieldName] = decimalPlace;
+ } catch (e) {
+ this._cachePlaces[fieldName] = 0;
+ console.error(e);
+ }
+ }
+ //use popup field info to override the calculated places
+ if (popupInfo) {
+ var places = this.getPlacesFromPopupFieldInfo(fieldInfo);
+ if (places || places === 0) {
+ this._cachePlaces[fieldName] = places;
+ }
+ }
+ }));
+ },
+
+ getBestDecimalPlaceForArrayValues: function(floatValues) {
+ var decimalPlace = 0;
+ //{decimal:count,...} like {2:123, 3:321, ...}
+ var statisticsHash = {};
+ floatValues.forEach(function(value) {
+ var splits = value.toString().split(".");
+ var key = null;
+ if (splits.length === 1) {
+ //value doesn't have fractional part
+ key = 0;
+ } else if (splits.length === 2) {
+ //value has fractional part
+ key = splits[1].length;
+ }
+ if (key !== null) {
+ if (statisticsHash[key] === undefined) {
+ statisticsHash[key] = 1;
+ } else {
+ statisticsHash[key] += 1;
+ }
+ }
+ });
+ var maxDecimalPlaceItem = null;
+ for (var key in statisticsHash) {
+ key = parseInt(key, 10);
+ var value = statisticsHash[key];
+ if (maxDecimalPlaceItem) {
+ if (value > maxDecimalPlaceItem.value) {
+ maxDecimalPlaceItem = {
+ key: key,
+ value: value
+ };
+ }
+ } else {
+ maxDecimalPlaceItem = {
+ key: key,
+ value: value
+ };
+ }
+ }
+ if (maxDecimalPlaceItem) {
+ decimalPlace = parseInt(maxDecimalPlaceItem.key, 10);
+ }
+ return decimalPlace;
+ },
+
+ getFieldInfoFromPopupInfo: function(popupInfo, fieldName) {
+ var fieldInfo = null;
+ if (!popupInfo || !popupInfo.fieldInfos) {
+ return fieldInfo;
+ }
+ var fieldInfos = popupInfo.fieldInfos;
+ fieldInfo = fieldInfos.filter(function(item) {
+ return item.fieldName === fieldName;
+ })[0];
+ return fieldInfo;
+ },
+
+ getPlacesFromPopupFieldInfo: function(fieldInfo) {
+ return fieldInfo && fieldInfo.format && fieldInfo.format.places;
+ },
+
+ getAliasFromPopupInfo: function(popupInfo, fieldName) {
+ var label = fieldName;
+ if (!popupInfo || !popupInfo.fieldInfos) {
+ return label;
+ }
+ var fieldInfos = popupInfo.fieldInfos;
+ if (fieldInfos && fieldInfos.length > 0) {
+ fieldInfos.some(function(item) {
+ if (item.fieldName === fieldName) {
+ label = item.label;
+ return true;
+ }
+ });
+ }
+ return label;
+ },
+
+ isFloatNumberField: function(fieldName) {
+ if (!this.featureLayer || !this.featureLayer.fields) {
+ return false;
+ }
+ var numberTypes = ['esriFieldTypeSingle', 'esriFieldTypeDouble'];
+ var isNumber = this.featureLayer.fields.some(lang.hitch(this, function(fieldInfo) {
+ return fieldInfo.name === fieldName && numberTypes.indexOf(fieldInfo.type) >= 0;
+ }));
+ return isNumber;
+ },
+
+ isNumberField: function(fieldName) {
+ if (!this.featureLayer || !this.featureLayer.fields) {
+ return false;
+ }
+ var numberTypes = ['esriFieldTypeSmallInteger',
+ 'esriFieldTypeInteger',
+ 'esriFieldTypeSingle',
+ 'esriFieldTypeDouble'
+ ];
+ var isNumber = this.featureLayer.fields.some(lang.hitch(this, function(fieldInfo) {
+ return fieldInfo.name === fieldName && numberTypes.indexOf(fieldInfo.type) >= 0;
+ }));
+ return isNumber;
+ },
+
+ isDateField: function(fieldName) {
+ var fieldInfo = this.getFieldInfo(fieldName);
+ if (fieldInfo) {
+ return fieldInfo.type === 'esriFieldTypeDate';
+ }
+ return false;
+ },
+
+ getFieldInfo: function(fieldName) {
+ if (this.featureLayer) {
+ var fieldInfos = this.featureLayer.fields;
+ for (var i = 0; i < fieldInfos.length; i++) {
+ if (fieldInfos[i].name === fieldName) {
+ return fieldInfos[i];
+ }
+ }
+ }
+ return null;
+ },
+
+ getFieldAliasArray: function(fieldNames) {
+ var results = fieldNames.map(lang.hitch(this, function(fieldName) {
+ return this.getFieldAlias(fieldName);
+ }));
+ return results;
+ },
+ /* getBestDisplayValue */
+ getBestDisplayValue: function(fieldName, fieldValue) {
+ if (fieldValue === '_NULL&UNDEFINED_') {
+ return 'null';
+ }
+ if (this.isDateField(fieldName)) {
+ //handle date
+ return this.formatedDateByPopupInfoOrLocal(fieldName, fieldValue);
+ }
+ var value;
+ var attributes = {};
+ attributes[fieldName] = fieldValue;
+ var res = jimuUtils.getDisplayValueForCodedValueOrSubtype(this.layerObject ||
+ this.featureLayer, fieldName, attributes);
+ if (res.isCodedValueOrSubtype) {
+ value = res.displayValue;
+ } else {
+ if (this.isNumberField(fieldName)) {
+ var fieldInfo = this.getFieldInfoFromPopupInfo(this.popupInfo, fieldName);
+ value = jimuUtils.localizeNumberByFieldInfo(fieldValue, fieldInfo);
+ } else {
+ value = fieldValue;
+ }
+ }
+ return value;
+
+ },
+
+ formatedDateByPopupInfoOrLocal: function(fieldName, fieldValue, popupInfo) {
+ if (!popupInfo) {
+ popupInfo = this.popupInfo;
+ }
+
+ function getFormatInfo(fieldName) {
+ if (popupInfo && esriLang.isDefined(popupInfo.fieldInfos)) {
+ for (var i = 0, len = popupInfo.fieldInfos.length; i < len; i++) {
+ var f = popupInfo.fieldInfos[i];
+ if (f.fieldName === fieldName) {
+ return f.format;
+ }
+ }
+ }
+ return null;
+ }
+ var format = getFormatInfo.call(this, fieldName);
+ fieldValue = Number(fieldValue);
+ return jimuUtils.fieldFormatter.getFormattedDate(fieldValue, format);
+ },
+
+ getDisplayValForNumberCodedValueSubTypes: function(fieldName, value) {
+ var displayValue = this.tryLocaleNumber(value, fieldName);
+ //check subtype description
+ //http://services1.arcgis.com/oC086ufSSQ6Avnw2/arcgis/rest/services/Parcels/FeatureServer/0
+ if (this.featureLayer && this.featureLayer.typeIdField === fieldName) {
+ var types = this.featureLayer.types;
+ if (types && types.length > 0) {
+ var typeObjs = types.filter(lang.hitch(this, function(item) {
+ return item.id === value;
+ }));
+ if (typeObjs.length > 0) {
+ displayValue = typeObjs[0].name;
+ return displayValue;
+ }
+ }
+ }
+
+ //check codedValue
+ //http://jonq/arcgis/rest/services/BugFolder/BUG_000087622_CodedValue/FeatureServer/0
+ //http://services1.arcgis.com/oC086ufSSQ6Avnw2/arcgis/rest/services/Parcels/FeatureServer/0
+ var fieldInfo = this.getFieldInfo(fieldName);
+ if (fieldInfo) {
+ if (fieldInfo.domain) {
+ var codedValues = fieldInfo.domain.codedValues;
+ if (codedValues && codedValues.length > 0) {
+ codedValues.some(function(item) {
+ if (item.code === value) {
+ displayValue = item.name;
+ return true;
+ } else {
+ return false;
+ }
+ });
+ }
+ }
+ }
+ return displayValue;
+ },
+
+ tryLocaleNumber: function(value, /*optional*/ fieldName) {
+ var result = value;
+ if (esriLang.isDefined(value) && isFinite(value)) {
+ try {
+ var a;
+ //if pass "abc" into localizeNumber, it will return null
+ if (fieldName && this.isNumberField(fieldName)) {
+ var popupFieldInfo = this.popupInfo[fieldName];
+ if (popupFieldInfo && lang.exists('format.places', popupFieldInfo)) {
+ a = jimuUtils.localizeNumberByFieldInfo(value, popupFieldInfo);
+ } else {
+ a = jimuUtils.localizeNumber(value);
+ }
+ } else {
+ //#6117
+ a = value; //jimuUtils.localizeNumber(value);
+ }
+
+ if (typeof a === "string") {
+ result = a;
+ }
+ } catch (e) {
+ console.error(e);
+ }
+ }
+ //make sure the retun value is string
+ result += "";
+ return result;
+ },
+
+ getCategoryDisplayForDateUnit: function(fieldValue, dateUnit) {
+ if (!dateUnit) {
+ return fieldValue;
+ }
+ fieldValue = Number(fieldValue);
+ return this._getFormatteredDate(fieldValue, dateUnit);
+ },
+
+ //return formattered date or date and time
+ _getFormatteredDate: function(time, dateUnit) {
+ var timePattern = this._getDateTemplate(dateUnit);
+ var dateTime, date, times;
+ if (['year', 'month', 'day'].indexOf(dateUnit) >= 0) {
+ dateTime = jimuUtils.localizeDate(new Date(time), {
+ selector: 'date',
+ datePattern: timePattern.date
+ });
+ } else {
+ date = jimuUtils.localizeDate(new Date(time), {
+ selector: 'date',
+ datePattern: timePattern.date
+ });
+ // times = jimuUtils.localizeDate(new Date(time),{selector:'time', datePattern : timePattern.time});
+ times = moment(time).format(timePattern.time);
+ dateTime = date + timePattern.connector + times;
+ }
+ return dateTime;
+ },
+
+ _getDateTemplate: function(dateFormatter) {
+ // return {
+ // date: {
+ // short: 'MMM d, y'
+ // sNoDay:'MMM, y'
+ // },
+ // time:{
+ // short:'h:mm:ss a'
+ // },
+ // connector:' , '
+ // }
+ var langFormat = dateFormat[dojoConfig.locale];
+
+ langFormat = langFormat || {};
+ if (langFormat && !langFormat.date) {
+ langFormat.date = {
+ 'short': 'short'
+ };
+ }
+
+ if (langFormat && !langFormat.time) {
+ langFormat.time = {
+ 'medium': 'HH:mm:ss a'
+ };
+ }
+
+ if (langFormat && !langFormat.connector) {
+ langFormat.connector = ' ';
+ }
+
+ if (langFormat && !langFormat.sNoDay) {
+ langFormat.sNoDay = 'MMM, y';
+ }
+
+ var dateTemplate = {};
+
+ if (dateFormatter === 'year') {
+ dateTemplate.date = 'y';
+ } else if (dateFormatter === 'month') {
+ dateTemplate.date = langFormat.date.sNoDay;
+ } else if (dateFormatter === 'day') {
+ dateTemplate.date = langFormat.date['short'];
+ } else if (dateFormatter === 'hour') {
+ dateTemplate.date = langFormat.date['short'];
+ dateTemplate.time = 'HH a';
+ dateTemplate.connector = langFormat.connector;
+ } else if (dateFormatter === 'minute') {
+ dateTemplate.date = langFormat.date['short'];
+ dateTemplate.time = 'HH:mm a';
+ dateTemplate.connector = langFormat.connector;
+ } else if (dateFormatter === 'second') {
+ dateTemplate.date = langFormat.date['short'];
+ dateTemplate.time = langFormat.time.medium;
+ dateTemplate.connector = langFormat.connector;
+ }
+
+ return dateTemplate;
+ },
+
+ _getSymbolLayerGraphics: function(filterByExtent, useSelection) {
+ if (!this.symbolLayer) {
+ return null;
+ }
+ var isDynamicLayer = !!this.symbolLayer.refreshInterval;
+ if (!isDynamicLayer && this.symbolGraphics && this.symbolGraphics.filterByExtent === false &&
+ this.symbolGraphics.useSelection === false) {
+ return this.symbolGraphics.graphics;
+ }
+ var graphics = null;
+ if (this.map && this.symbolLayer) {
+ graphics = jimuUtils.getClientFeaturesFromMap(this.map, this.symbolLayer, useSelection, !!filterByExtent);
+ }
+ this.symbolGraphics = {
+ filterByExtent: filterByExtent,
+ useSelection: useSelection,
+ graphics: graphics
+ };
+ return graphics;
+ },
+
+ _isContainAttr: function(attributes, inputAttr) {
+ if (typeof inputAttr !== 'object' || typeof inputAttr !== 'object') {
+ return false;
+ }
+ var isContain = true;
+ for (var name in inputAttr) {
+ if (inputAttr.hasOwnProperty(name)) {
+ var val1 = inputAttr[name];
+ var val2 = attributes[name];
+ isContain = val1 === val2;
+ }
+ }
+ return isContain;
+ },
+
+ _getFeaturesByAttr: function(attributes, features) {
+ if (!features) {
+ return;
+ }
+
+ var feature = null;
+
+ features.some(function(f) {
+ if (this._isContainAttr(f.attributes, attributes)) {
+ feature = f;
+ return true;
+ }
+ return false;
+ }.bind(this));
+
+ return feature;
+ },
+
+ _getFeaturesByClusterfield: function(clusterField, label, filterByExtent, dateConfig) {
+
+ var features = this._getSymbolLayerGraphics(filterByExtent);
+
+ if (!features) {
+ return;
+ }
+ var fs = null;
+
+ var cluseringObj = this.clientStatisticsUtils.getCluseringObj(clusterField, features, dateConfig);
+ var notNullLabelClusteringObj = cluseringObj.notNullLabel;
+ var nullLabelClusteringObj = cluseringObj.nullLabel;
+ var assignCluseringObj = lang.mixin(notNullLabelClusteringObj, nullLabelClusteringObj);
+
+ var obj = assignCluseringObj[label];
+ if (obj && obj.features && obj.features.length) {
+ fs = obj.features;
+ }
+ return fs;
+ },
+
+ _getFeatureForSerieData: function(dataItem, dataOption, valueField) {
+ var clusterField = dataOption.clusterField;
+ var mode = dataOption.mode;
+ var filterByExtent = dataOption.filterByExtent;
+ var useSelection = dataOption.useSelection;
+ var attributes = {};
+ attributes[clusterField] = dataItem.name;
+ if (mode === 'feature') {
+ return this._getFeatureBySerieDataItem(dataItem, clusterField, valueField, filterByExtent, useSelection);
+ } else if (mode === 'category' || mode === 'count') {
+ return new Graphic(null, null, attributes);
+ }
+ },
+
+ _getFeatureBySerieDataItem: function(dataItem, clusterField, valueField, filterByExtent, useSelection) {
+ var attributes = {};
+ attributes[clusterField] = dataItem.name;
+ var value = typeof dataItem.originValue !== 'undefined' ? dataItem.originValue : dataItem.value;
+ attributes[valueField] = Number(value);
+
+ var features = this._getSymbolLayerGraphics(filterByExtent, useSelection);
+ return this._getFeaturesByAttr(attributes, features);
+ },
+
+ _getFeatureBycsuDataItem: function(dataItem, clusterField, valueField, vfIndex, filterByExtent, useSelection) {
+ var attributes = {};
+ attributes[clusterField] = dataItem.label;
+ var values = dataItem.originalValues || dataItem.values;
+ var value = values && values[vfIndex];
+
+ attributes[valueField] = Number(value);
+
+ var features = this._getSymbolLayerGraphics(filterByExtent, useSelection);
+ return this._getFeaturesByAttr(attributes, features);
+ },
+
+ /* bind event to eCharts*/
+ bindChartEvent: function(chart, options, data) {
+ var filterByExtent = options.filterByExtent;
+ var useSelection = options.useSelection;
+ var clusterField = options.clusterField;
+ var valueFields = options.valueFields;
+
+ var dateConfig = null;
+ if (options.dateConfig !== 'undefined') {
+ dateConfig = options.dateConfig;
+ }
+
+ this.highLightColor = options.highLightColor || '#00ffff';
+ var mode = options.mode;
+ if (!this.map) {
+ return;
+ }
+ if (data.length === 0) {
+ return;
+ }
+ var mouseoverCallback = lang.hitch(this, function(evt) {
+ if (evt.componentType !== 'series') {
+ return;
+ }
+ var features = null;
+ var symbolFeatures = this._getSymbolLayerGraphics(filterByExtent, useSelection);
+ if (mode === 'field') {
+ features = symbolFeatures;
+ } else {
+ //category: {category,valueFields,}
+ //count {fieldValue:value1,count:count1}
+ var dataItem = data[evt.dataIndex];
+ if (dataItem) {
+ if (mode === 'feature') {
+ var vfIndex = evt.seriesIndex;
+ var valueField = valueFields[vfIndex];
+ if (!valueField) {
+ return;
+ }
+ var feature = this._getFeatureBycsuDataItem(dataItem, clusterField, valueField, vfIndex,
+ filterByExtent, useSelection);
+ if (feature) {
+ features = [feature];
+ }
+ } else {
+ var label = dataItem.label;
+ if (typeof label !== 'undefined') {
+ features = this._getFeaturesByClusterfield(clusterField, label, filterByExtent, dateConfig);
+ }
+ }
+
+ }
+ }
+
+ if (!features) {
+ return;
+ }
+
+ if (evt.type === 'mouseover') {
+ this._mouseoverFeatures = features;
+ this._mouseOverChartItem(features);
+ }
+ });
+
+ var mouseoutCallback = lang.hitch(this, function() {
+ if (this._mouseoverFeatures) {
+ this._mouseOutChartItem(this._mouseoverFeatures);
+ this._mouseoverFeatures = null;
+ }
+ });
+
+ var events = [{
+ name: 'mouseover',
+ callback: mouseoverCallback
+ }, {
+ name: 'mouseout',
+ callback: mouseoutCallback
+ }];
+
+ events.forEach(lang.hitch(this, function(event) {
+ chart.chart.off(event.name);
+ chart.chart.on(event.name, lang.hitch(this, function(evt) {
+ if (evt.type === 'mouseover') {
+ if (!this._hasTriggerMouseoverEvent) {
+ this._hasTriggerMouseoverEvent = true;
+ event.callback(evt);
+ }
+ setTimeout(lang.hitch(this, function() {
+ this._hasTriggerMouseoverEvent = false;
+ }, 500));
+ } else if (evt.type === 'mouseout') {
+ event.callback(evt);
+ }
+ }));
+ }));
+ },
+
+ _mouseOverChartItem: function(features) {
+ var isVisible = this.featureLayer && this.featureLayer.getMap() && this.featureLayer.visible;
+ if (!isVisible) {
+ return;
+ }
+ var geoType = jimuUtils.getTypeByGeometryType(this.featureLayer.geometryType);
+ //We need to store the original feature symbol because we will use it in mouse out event.
+ features.forEach(lang.hitch(this, function(feature) {
+ feature._originalSymbol = feature.symbol;
+ }));
+
+ var symbol = null;
+ if (geoType === 'point') {
+ symbol = this._getHighLightMarkerSymbol();
+ this.tempGraphics = [];
+ features.forEach(lang.hitch(this, function(feature) {
+ var g = new Graphic(feature.geometry, symbol);
+ this.tempGraphics.push(g);
+ this.featureLayer.add(g);
+ }));
+ } else if (geoType === 'polyline') {
+ symbol = this._getHighLightLineSymbol(this.highLightColor);
+
+ features.forEach(lang.hitch(this, function(feature) {
+ feature.setSymbol(symbol);
+ }));
+ } else if (geoType === 'polygon') {
+
+ var selectedFeatures = this.featureLayer.getSelectedFeatures() || [];
+
+ features.forEach(lang.hitch(this, function(feature) {
+ var isSelectedFeature = selectedFeatures.indexOf(feature) >= 0;
+ var highLightSymbol = this._getHighLightFillSymbol(this.featureLayer, feature, isSelectedFeature);
+ feature.setSymbol(highLightSymbol);
+ }));
+
+ //The outline of these features maybe overlapped by others,
+ //so we need to put these features at the end of the featureLayer
+ var symbolFeatures = this._getSymbolLayerGraphics(false, false);
+ if (symbolFeatures.length !== features.length && geoType === 'polygon') {
+ features.forEach(lang.hitch(this, function(feature) {
+ this.featureLayer.remove(feature);
+ }));
+ features.forEach(lang.hitch(this, function(feature) {
+ this.featureLayer.add(feature);
+ }));
+ }
+ }
+ },
+
+ _mouseOutChartItem: function(features) {
+ this._removeTempGraphics();
+ //Restore feature's original symbol.
+ features.forEach(lang.hitch(this, function(feature) {
+ var _originalSymbol = feature._originalSymbol || null;
+ feature.setSymbol(_originalSymbol);
+ }));
+ },
+
+ _removeTempGraphics: function() {
+ if (this.featureLayer && this.tempGraphics && this.tempGraphics.length > 0) {
+ while (this.tempGraphics.length > 0) {
+ this.featureLayer.remove(this.tempGraphics[0]);
+ this.tempGraphics.splice(0, 1);
+ }
+ }
+ this.tempGraphics = null;
+ },
+
+ _getHighLightMarkerSymbol: function() {
+ // var sym = symbolJsonUtils.fromJson(this.config.symbol);
+ // var size = Math.max(sym.size || 0, sym.width || 0, sym.height, 18);
+ // size += 1;
+
+ var size = 30;
+
+ var symJson = {
+ "color": [255, 255, 255, 0],
+ "size": 18,
+ "angle": 0,
+ "xoffset": 0,
+ "yoffset": 0,
+ "type": "esriSMS",
+ "style": "esriSMSSquare",
+ "outline": {
+ "color": [0, 0, 128, 255],
+ "width": 0.75,
+ "type": "esriSLS",
+ "style": "esriSLSSolid"
+ }
+ };
+ var symbol = symbolJsonUtils.fromJson(symJson);
+ symbol.setSize(size);
+ symbol.outline.setColor(new Color(this.highLightColor));
+
+ return symbol;
+ },
+
+ _getHighLightLineSymbol: function( /*optional*/ highLightColor) {
+ var selectedSymJson = {
+ "color": [0, 255, 255, 255],
+ "width": 1.5,
+ "type": "esriSLS",
+ "style": "esriSLSSolid"
+ };
+ var symbol = symbolJsonUtils.fromJson(selectedSymJson);
+ symbol.setColor(new Color(highLightColor || this.highLightColor));
+ return symbol;
+ },
+
+ _getDefaultHighLightFillSymbol: function() {
+ var symbolJson = {
+ "color": [0, 255, 255, 128],
+ "outline": {
+ "color": [0, 255, 255, 255],
+ "width": 1.5,
+ "type": "esriSLS",
+ "style": "esriSLSSolid"
+ },
+ "type": "esriSFS",
+ "style": "esriSFSSolid"
+ };
+ var symbol = symbolJsonUtils.fromJson(symbolJson);
+ symbol.outline.setColor(new Color(this.highLightColor));
+ return symbol;
+ },
+
+ _getSymbolByRenderer: function(renderer, feature) {
+ var symbol = this._getDefaultHighLightFillSymbol();
+ var visualVariables = renderer.visualVariables;
+ var visVar = this.getVisualVariableByType('colorInfo', visualVariables);
+ if (visVar) {
+ var color = renderer.getColor(feature, {
+ colorInfo: visVar
+ });
+ if (color) {
+ color = lang.clone(color);
+ symbol.setColor(color);
+ }
+ } else {
+ symbol = renderer.getSymbol(feature);
+ }
+ return symbol;
+ },
+
+ getVisualVariableByType: function(type, visualVariables) {
+ // we could also use esri.renderer.Renderer.getVisualVariablesForType for renderers
+ if (visualVariables) {
+ var visVars = visualVariables.filter(function(visVar) {
+ return (visVar.type === type && !visVar.target);
+ });
+ if (visVars.length) {
+ return visVars[0];
+ } else {
+ return null;
+ }
+ }
+ return null;
+ },
+
+ _getHighLightFillSymbol: function(featureLayer, feature, isSelectedFeature) {
+ var highLightSymbol = null;
+ var currentSymbol = feature.symbol;
+ var renderer = featureLayer.renderer;
+ if (!currentSymbol && renderer) {
+ currentSymbol = this._getSymbolByRenderer(renderer, feature);
+ }
+ if (currentSymbol && typeof currentSymbol.setOutline === 'function') {
+ highLightSymbol = symbolJsonUtils.fromJson(currentSymbol.toJson());
+ var outlineWidth = 1.5;
+ if (currentSymbol.outline) {
+ if (currentSymbol.outline.width > 0) {
+ outlineWidth = currentSymbol.outline.width + 1;
+ }
+ }
+ //if feature in feature selection, set red color for selected features
+ //if feature is not in feature selection, set selection like symbol
+ var highLightColor = isSelectedFeature ? "#ff0000" : "#00ffff";
+ var outline = this._getHighLightLineSymbol(highLightColor);
+ outline.setWidth(outlineWidth);
+ highLightSymbol.setOutline(outline);
+ } else {
+ highLightSymbol = this._getDefaultHighLightFillSymbol();
+ }
+ return highLightSymbol;
+ },
+
+ _isNumberField: function(fieldName) {
+ var numberTypes = ['esriFieldTypeSmallInteger',
+ 'esriFieldTypeInteger',
+ 'esriFieldTypeSingle',
+ 'esriFieldTypeDouble'
+ ];
+ var isNumber = this.featureLayer.fields.some(lang.hitch(this, function(fieldInfo) {
+ return fieldInfo.name === fieldName && numberTypes.indexOf(fieldInfo.type) >= 0;
+ }));
+ return isNumber;
+ },
+
+ getFieldAlias: function(fieldName) {
+ var fieldAlias;
+ if (this.popupInfo) {
+ fieldAlias = this.getAliasFromPopupInfo(this.popupInfo, fieldName);
+ }
+ if (!fieldAlias) {
+ fieldAlias = fieldName;
+ var fieldInfo = this.getFieldInfo(fieldName);
+ if (fieldInfo && fieldInfo.alias) {
+ fieldAlias = fieldInfo.alias;
+ }
+ }
+ return fieldAlias;
+ },
+ //Removing duplicate elements from an object array
+ _removeDuplicateElementForObjArray: function(array) {
+ if (!Array.isArray(array)) {
+ return array;
+ }
+ var n = [];
+ n.push(array[0]);
+ array.forEach(function(item) {
+ var isInArray = n.some(function(e) {
+ return jimuUtils.isEqual(e, item);
+ });
+
+ if (!isInArray) {
+ n.push(item);
+ }
+ });
+
+ return n;
+ },
+ //assignee setting color to chart series
+ assigneeSettingColor: function(displayOption, series, dataOption) {
+ if (!series || !series.length) {
+ return series;
+ }
+ var seriesStyle = displayOption.seriesStyle;
+ if (!seriesStyle) {
+ return series;
+ }
+
+ if (seriesStyle.type === 'layerSymbol') {
+ series = this._assigneeStyleLayerSymbolColor(series, dataOption);
+ } else if (seriesStyle.type === 'series') {
+ series = this._assigneeStyleSeriesColor(displayOption, series);
+ } else if (seriesStyle.type === 'custom') {
+ series = this._assigneeStyleCustomColor(displayOption, series);
+ }
+ return series;
+ },
+
+ _assigneeStyleCustomColor: function(displayOption, series) {
+ var seriesStyle = displayOption.seriesStyle;
+ if (!seriesStyle || !seriesStyle.customColor) {
+ return series;
+ }
+ var customColor = seriesStyle.customColor;
+ var categories = customColor.categories;
+ var others = customColor.others;
+ if ((!categories || !categories.length) &&
+ (!others || !others.length)) {
+ return series;
+ }
+ if (others && others.length) {
+ this._setCustomOthersColor(others, series);
+ }
+ if (categories && categories.length) {
+ this._setCustomCategoriesColor(categories, series);
+ }
+ },
+
+ _setCustomCategoriesColor: function(categories, series) {
+ series.forEach(function(serie) {
+ var data = serie.data;
+ if (data && data.length) {
+ data.forEach(function(dataItem) {
+ if (typeof dataItem.name !== 'undefined') {
+ var matchColor = this._getMatchingCustomColor(dataItem.name, categories);
+ this.setColorToDataItem(dataItem, matchColor);
+ }
+ }.bind(this));
+ }
+ }.bind(this));
+ },
+
+ _getMatchingCustomColor: function(name, categories) {
+ var color = false;
+ if (!categories || !categories.length) {
+ return color;
+ }
+ var matchCustomItem = categories.filter(function(cc) {
+ return cc.id === name;
+ })[0];
+ if (matchCustomItem && matchCustomItem.color) {
+ color = matchCustomItem.color;
+ }
+ return color;
+ },
+
+ _getMatchingCustomLabel: function(name, categories) {
+
+ var label = false;
+ if (!categories || !categories.length) {
+ return label;
+ }
+ var matchCustomItem = categories.filter(function(cc) {
+ return cc.id === name;
+ })[0];
+ if (matchCustomItem && matchCustomItem.label) {
+ label = matchCustomItem.label;
+ }
+ return label;
+ },
+
+ _setCustomOthersColor: function(others, series) {
+ this._setOtherColorForCustomColor(others, series);
+ this._setNullLabelColorForCustomColor(others, series);
+ },
+
+ _setOtherColorForCustomColor: function(others, series) {
+ var otherConfig = others.filter(function(oc) {
+ return oc.id === 'others';
+ })[0];
+ if (otherConfig && otherConfig.color) {
+ this.setColorToAllSerieDataItem(series, otherConfig.color);
+ }
+ },
+
+ _setNullLabelColorForCustomColor: function(others, series) {
+ var nullConfig = others.filter(function(oc) {
+ return oc.id === 'null';
+ })[0];
+ if (!nullConfig || !nullConfig.color) {
+ return;
+ }
+ var nullColor = nullConfig.color;
+ series.forEach(function(serie) {
+ var data = serie.data;
+ if (data && data.length) {
+ data.forEach(function(dataItem) {
+ if (dataItem.name && dataItem.name === '_NULL&UNDEFINED_') {
+ this.setColorToDataItem(dataItem, nullColor);
+ }
+ }.bind(this));
+ }
+ }.bind(this));
+ },
+
+ _assigneeStyleSeriesColor: function(displayOption, series) {
+ var seriesStyle = displayOption.seriesStyle;
+ if (!seriesStyle || !seriesStyle.styles || !seriesStyle.styles[0]) {
+ return series;
+ }
+ var mode = displayOption.mode;
+ var area = displayOption.area;
+ return series.map(function(serie) {
+ var matchStyle = null;
+ var type = serie.type;
+
+ if (mode === 'field') {
+ if (type === 'line') {
+ matchStyle = seriesStyle.styles[0].style;
+ serie = this._setStyleToSerie(matchStyle, serie, area);
+ } else {
+ var data = serie.data;
+ if (data && data[0]) {
+ serie.data = data.map(function(item) {
+ matchStyle = this._getMatchingStyle(item.name, seriesStyle);
+ return this.setStyleToSerieDataItem(matchStyle, item);
+ }.bind(this));
+ }
+ }
+ } else {
+ if (type === 'column' || type === 'bar' || type === 'line') {
+ if (mode === 'count') {
+ matchStyle = seriesStyle.styles[0].style;
+ serie = this._setStyleToSerie(matchStyle, serie, area);
+ } else {
+ if (typeof serie.name !== 'undefined') {
+ matchStyle = this._getMatchingStyle(serie.name, seriesStyle);
+ if (matchStyle) {
+ serie = this._setStyleToSerie(matchStyle, serie, area);
+ }
+ }
+ }
+ }
+ //else pie color array --> _chartDijitOption._mapSettingConfigToChartOption
+ }
+ return serie;
+ }.bind(this));
+ },
+
+ _assigneeStyleLayerSymbolColor: function(series, dataOption) {
+ series.forEach(function(serie) {
+ var valueField = serie.name;
+ var data = serie.data;
+ if (data && data.length) {
+ data.forEach(function(dataItem) {
+ var feature = this._getFeatureForSerieData(dataItem, dataOption, valueField);
+ var features = [feature];
+ var color = this._getSymbolColorForDataItem(features);
+ if (color) {
+ dataItem.itemStyle = {
+ color: color
+ };
+ }
+ }.bind(this));
+ }
+ }.bind(this));
+ },
+
+ _setStyleToSerie: function(matchStyle, serie, area) {
+ if (!serie.itemStyle) {
+ serie.itemStyle = {};
+ }
+ if (matchStyle && typeof matchStyle.color !== 'undefined') {
+ if (Array.isArray(matchStyle.color)) {
+ serie.itemStyle.color = matchStyle.color[0];
+ } else {
+ serie.itemStyle.color = matchStyle.color;
+ }
+ }
+ if (matchStyle && typeof matchStyle.opacity !== 'undefined') {
+ if (area) {
+ if (!serie.areaStyle) {
+ serie.areaStyle = {};
+ }
+ serie.areaStyle.opacity = (1 - parseFloat(matchStyle.opacity / 10));
+ } else {
+ serie.itemStyle.opacity = (1 - parseFloat(matchStyle.opacity / 10));
+ }
+ }
+ return serie;
+ },
+
+ _getMatchingStyle: function(name, seriesStyle) {
+ var style = null;
+ var styles = seriesStyle.styles;
+ if (!styles || !styles[0]) {
+ return style;
+ }
+ if (name === '') {
+ return style;
+ }
+ styles.forEach(function(item) {
+ if (item.name === name) {
+ style = item.style;
+ }
+ });
+ return style;
+ },
+
+ _getSymbolColorForDataItem: function(features) {
+ var color = false;
+ if (!this.symbolLayer) {
+ return color;
+ }
+ var renderer = this.symbolLayer.renderer;
+ var feature = features && features[0];
+ if (!feature) {
+ return color;
+ }
+ color = this._getColorForFeature(renderer, feature);
+ return color;
+ },
+
+ _getColorForFeature: function(renderer, feature) {
+ var color = false;
+ var visualVariables = renderer.visualVariables;
+ var visVar = this.getVisualVariableByType('colorInfo', visualVariables);
+ if (visVar) {
+ var featureColor = renderer.getColor(feature, {
+ colorInfo: visVar
+ });
+ if (featureColor) {
+ color = this._convertToEchartsRbga(featureColor);
+ }
+ } else {
+ var symbol = renderer.getSymbol(feature);
+ if (symbol && typeof symbol.color !== 'undefined') {
+ color = this._convertToEchartsRbga(symbol.color);
+ }
+ }
+ return color;
+ },
+
+ _convertToEchartsRbga: function(symbolColor) {
+ if (!symbolColor || typeof symbolColor.r === 'undefined') {
+ return symbolColor;
+ }
+ symbolColor = window.JSON.parse(window.JSON.stringify(symbolColor));
+ var color = 'rgba(';
+ color += symbolColor.r + ',';
+ color += symbolColor.g + ',';
+ color += symbolColor.b + ',';
+ color += symbolColor.a + ')';
+ return color;
+ },
+
+ getColors: function(originColors, count) {
+ var colors = [];
+
+ if (originColors.length === 2) {
+ //gradient colors
+ colors = this._createGradientColors(originColors[0],
+ originColors[originColors.length - 1],
+ count);
+ } else {
+ var a = Math.ceil(count / originColors.length);
+ for (var i = 0; i < a; i++) {
+ colors = colors.concat(originColors);
+ }
+ colors = colors.slice(0, count);
+ }
+
+ return colors;
+ },
+
+ _createGradientColors: function(firstColor, lastColor, count) {
+ var colors = [];
+ var c1 = new Color(firstColor);
+ var c2 = new Color(lastColor);
+ var deltaR = (c2.r - c1.r) / count;
+ var deltaG = (c2.g - c1.g) / count;
+ var deltaB = (c2.b - c1.b) / count;
+ var c = new Color();
+ var r = 0;
+ var g = 0;
+ var b = 0;
+ for (var i = 0; i < count; i++) {
+ r = parseInt(c1.r + deltaR * i, 10);
+ g = parseInt(c1.g + deltaG * i, 10);
+ b = parseInt(c1.b + deltaB * i, 10);
+ c.setColor([r, g, b]);
+ colors.push(c.toHex());
+ }
+ return colors;
+ },
+
+ setStyleToSerieDataItem: function(matchStyle, item) {
+ if (!item.itemStyle) {
+ item.itemStyle = {};
+ }
+ if (matchStyle && typeof matchStyle.color !== 'undefined') {
+ if (Array.isArray(matchStyle.color)) {
+ item.itemStyle.color = matchStyle.color[0];
+ } else {
+ item.itemStyle.color = matchStyle.color;
+ }
+ }
+ if (matchStyle && typeof matchStyle.opacity !== 'undefined') {
+ item.itemStyle.opacity = (1 - parseFloat(matchStyle.opacity / 10));
+ }
+ return item;
+ },
+
+ setColorToSerie: function(serie, color) {
+ if (!serie || typeof serie !== 'object' || Array.isArray(serie)) {
+ return serie;
+ }
+ if (!serie.itemStyle) {
+ serie.itemStyle = {};
+ }
+ if (color) {
+ serie.itemStyle.color = color;
+ }
+ },
+
+ setColorToDataItem: function(dataItem, color) {
+ if (!dataItem || typeof dataItem !== 'object') {
+ return dataItem;
+ }
+ if (!dataItem.itemStyle) {
+ dataItem.itemStyle = {};
+ }
+ if (color) {
+ dataItem.itemStyle.color = color;
+ }
+ },
+
+ // set one color to all series's data item
+ setColorToAllSerieDataItem: function(series, otherColor) {
+ series.forEach(function(serie) {
+ var data = serie.data;
+ if (data && data.length) {
+ data.forEach(function(dataItem) {
+ this.setColorToDataItem(dataItem, otherColor);
+ }.bind(this));
+ }
+ }.bind(this));
+ },
+
+ _updateDataItemNameForCustom: function(dataItem, nullLabel, categories) {
+ var label;
+ if (typeof dataItem.name !== 'undefined') {
+ label = dataItem.name;
+ if (dataItem.name === '_NULL&UNDEFINED_' && nullLabel) {
+ label = nullLabel;
+ } else {
+ var originName = typeof dataItem.originName !== 'undefined' ? dataItem.originName : dataItem.name;
+ var matchLabel = this._getMatchingCustomLabel(originName, categories);
+ if (matchLabel) {
+ label = matchLabel;
+ }
+ }
+ dataItem.name = label;
+ }
+ return label;
+ },
+
+ _updateSerieDataItemName: function(dataItem, mode, clusterField) {
+ var name = dataItem.name;
+ var formatedName = name;
+
+ if (dataItem.unit && name) {
+ formatedName = this.getCategoryDisplayForDateUnit(name, dataItem.unit);
+ } else {
+ if (mode !== 'field') {
+ formatedName = this.getBestDisplayValue(clusterField, name);
+ } else {
+ formatedName = this.getFieldAlias(name);
+ }
+ }
+
+ dataItem.name = formatedName;
+ dataItem.originName = name;
+ return formatedName;
+ },
+
+ updateChartSeriesDisplayName: function(chartSeriesOption, displayOption, dataOption) {
+
+ var clusterField = dataOption.mode === 'feature' ?
+ dataOption.labelField : dataOption.categoryField;
+ var mode = dataOption.mode;
+ var series = chartSeriesOption.series;
+ var labels = [];
+ //setting label
+ var seriesStyle = displayOption.seriesStyle;
+ var categories, nullLabel, others, nullConfig;
+
+ var label;
+ //default
+ series.forEach(function(serie, index) {
+ if (serie.name) {
+ serie.name = this.getFieldAlias(serie.name);
+ }
+ var data = serie.data;
+ if (data && data.length) {
+ data.forEach(function(dataItem, dataIndex) {
+ label = this._updateSerieDataItemName(dataItem, mode, clusterField);
+ if (index === 0) {
+ labels[dataIndex] = label;
+ }
+ }.bind(this));
+ }
+ }.bind(this));
+
+ if (seriesStyle.type === 'custom') {
+ var customColor = seriesStyle.customColor;
+
+ if (customColor && customColor.categories && customColor.categories.length) {
+ categories = customColor.categories;
+ others = customColor.others || [];
+ nullConfig = others.filter(function(oc) {
+ return oc.id === 'null';
+ })[0];
+ if (nullConfig && nullConfig.label) {
+ nullLabel = nullConfig.label;
+ }
+ }
+
+ series.forEach(function(serie, index) {
+ var data = serie.data;
+ if (data && data.length) {
+ data.forEach(function(dataItem, dataIndex) {
+ label = this._updateDataItemNameForCustom(dataItem, nullLabel, categories);
+ if (index === 0) {
+ labels[dataIndex] = label;
+ }
+ }.bind(this));
+ }
+ }.bind(this));
+ }
+
+ chartSeriesOption.labels = null;
+ chartSeriesOption.labels = labels;
+ }
+
+ });
+});
\ No newline at end of file
diff --git a/app/jimu.js/_dateFormat.js b/app/jimu.js/_dateFormat.js
new file mode 100644
index 0000000..ca4cc50
--- /dev/null
+++ b/app/jimu.js/_dateFormat.js
@@ -0,0 +1,375 @@
+///////////////////////////////////////////////////////////////////////////
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
+//
+// Licensed under the Apache License Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+///////////////////////////////////////////////////////////////////////////
+
+define([],
+ function() {
+ return {
+ 'ar': {
+ 'date': {
+ 'short': 'd/M/y',
+ 'medium': 'dd/MM/y',
+ 'long': 'd MMMM. y',
+ 'onlyDate': 'dd/MM',
+ 'mNoDay': 'MM/y',
+ 'sNoDay': 'M/y'
+ },
+ 'time': {
+ 'short': 'h:mm a',
+ 'medium': 'h:mm:ss a'
+ }
+ },
+ 'bs': {
+ 'date': {
+ 'short': 'd.M.yy.',
+ 'medium': 'd. MMM. y.',
+ 'long': 'd. MMMM y.',
+ 'onlyDate': 'd. MMM.',
+ 'mNoDay': 'MMM. y.',
+ 'sNoDay': 'M.yy'
+ }
+ },
+ 'cs': {
+ 'date': {
+ 'short': 'dd.MM.yy',
+ 'medium': 'd. M. y',
+ 'onlyDate': 'd. M.',
+ 'mNoDay': 'M. y',
+ 'sNoDay': 'MM.yy'
+ }
+ },
+ 'da': {
+ 'date': {
+ 'short': 'dd/MM/y',
+ 'medium': 'd. MMM y',
+ 'long': 'd. MMMM y',
+ 'onlyDate': 'd. MMM',
+ 'mNoDay': 'MMM y',
+ 'sNoDay': 'MM/y'
+ }
+ },
+ 'de': {
+ 'date': {
+ 'short': 'dd.MM.yy',
+ 'medium': 'dd.MM.y',
+ 'onlyDate': 'dd.MM.'
+ },
+ 'connector': ' , ',
+ 'mNoDay': 'MM.y',
+ 'sNoDay': 'MM.yy'
+ },
+ 'el': {
+ 'date': {
+ 'short': 'd/M/yy',
+ 'medium': 'd MMM y',
+ 'onlyDate': 'd MMM'
+ },
+ 'connector': ' , ',
+ 'mNoDay': 'MMM y',
+ 'sNoDay': 'M/yy'
+ },
+ 'en': {
+ 'date': {
+ 'short': 'M/d/yy',
+ 'medium': 'MMM d, y',
+ 'onlyDate': 'MMM d',
+ 'mNoDay': 'MMM, y',
+ 'sNoDay': 'M/yy'
+ }
+ },
+ 'es': {
+ 'date': {
+ 'short': 'd/M/yy',
+ 'medium': 'd MMM y',
+ 'onlyDate': 'd MMM',
+ 'mNoDay': 'MMM y',
+ 'sNoDay': 'M/yy'
+ }
+ },
+ 'et': {
+ 'date': {
+ 'short': 'd.MM.y',
+ 'medium': 'd. MMM y',
+ 'onlyDate': 'd. MMM',
+ 'mNoDay': 'MMM y',
+ 'sNoDay': 'MM.y'
+ },
+ 'time': {
+ 'short': 'H:mm',
+ 'medium': 'H:mm:ss'
+ }
+ },
+ 'fi': {
+ 'date': {
+ 'short': 'd.M.y',
+ 'medium': 'd.M.y',
+ 'onlyDate': 'd.M.',
+ 'mNoDay': 'M.y',
+ 'sNoDay': 'M.y'
+ },
+ 'connector': " 'klo' "
+ },
+ 'fr': {
+ 'date': {
+ 'short': 'dd/MM/y',
+ 'medium': 'd MMM y',
+ 'onlyDate': 'd MMM',
+ 'mNoDay': 'MMM y',
+ 'sNoDay': 'MM/y'
+ },
+ 'connector': " 'à' "
+ },
+ 'he': {
+ 'date': {
+ 'short': 'dd/MM/yy',
+ 'medium': "d 'ב'MMM y",
+ 'onlyDate': "d 'ב'MMM",
+ 'mNoDay': "'ב'MMM y",
+ 'sNoDay': 'MM/yy'
+ },
+ 'connector': ' , '
+ },
+ 'hi': {
+ 'date': {
+ 'short': 'd/M/yy',
+ 'medium': 'dd/MM/y',
+ 'long': 'd MMMM y',
+ 'onlyDate': 'dd/MM',
+ 'mNoDay': 'MM/y',
+ 'sNoDay': 'M/yy'
+ },
+ 'time': {
+ 'short': 'h:mm a',
+ 'medium': 'h:mm:ss a',
+ 'sNoDay': ''
+ },
+ 'connector': ' , '
+ },
+ 'hr': {
+ 'date': {
+ 'short': 'd.M.y',
+ 'medium': 'd. MMM y.',
+ 'onlyDate': 'd. MMM',
+ 'mNoDay': 'MMM y.',
+ 'sNoDay': 'M.y'
+ }
+ },
+ 'id': {
+ 'short': 'dd/MM/yy',
+ 'date': {
+ 'medium': 'd MMM y',
+ 'onlyDate': 'd MMM',
+ 'mNoDay': 'MMM y',
+ 'sNoDay': 'MM/yy'
+ }
+ },
+ 'it': {
+ 'date': {
+ 'medium': 'dd MMM y',
+ 'long': 'd MMMM y',
+ 'onlyDate': 'dd MMM',
+ 'mNoDay': 'MMM y',
+ 'sNoDay': 'MM/yy'
+ },
+ 'connector': ' , '
+ },
+ 'ja': {
+ 'date': {
+ 'medium': 'y/MM/dd',
+ 'onlyDate': 'MM/dd',
+ 'mNoDay': 'y/MM',
+ 'sNoDay': 'y/MM'
+ },
+ 'time': {
+ 'short': 'a h:mm',
+ 'medium': 'a h:mm:ss'
+ }
+ },
+ 'ko': {
+ 'date': {
+ 'medium': 'y. M. d.',
+ 'onlyDate': 'M. d.',
+ 'mNoDay': 'y. M.',
+ 'sNoDay': 'yy. M.'
+ }
+ },
+ 'lt': {
+ 'date': {
+ 'medium': 'y-MM-dd',
+ 'long': "y 'm'. MMMM d 'd'.",
+ 'onlyDate': 'MM-dd',
+ 'mNoDay': 'y-MM',
+ 'sNoDay': 'y-MM'
+ },
+ 'time': {
+ 'medium': 'HH:mm:ss'
+ }
+ },
+ 'lv': {
+ 'date': {
+ 'short': 'dd.MM.y',
+ 'medium': "y. 'gada' d. MMM.",
+ 'long': "y. 'gada' d. MMMM",
+ 'onlyDate': 'd. MMM.',
+ 'mNoDay': "y. 'gada' MMM.",
+ 'sNoDay': 'MM.y'
+ }
+ },
+ 'nb': {
+ 'date': {
+ 'short': 'dd.MM.y',
+ 'medium': 'd. MMM y',
+ 'long': 'd. MMMM y',
+ 'onlyDate': 'd. MMM',
+ 'mNoDay': 'MMM y',
+ 'sNoDay': 'MM.y'
+ },
+ 'time': {
+ 'short': 'HH:mm',
+ 'medium': 'HH:mm:ss'
+ },
+ 'connector': ' , '
+ },
+ 'nl': {
+ 'date': {
+ 'medium': 'd MMM y',
+ 'onlyDate': 'd MMM',
+ 'mNoDay': 'MMM y',
+ 'sNoDay': 'MM-yy'
+ }
+ },
+ 'pl': {
+ 'date': {
+ 'medium': 'd MMM y',
+ 'onlyDate': 'd MMM',
+ 'mNoDay': 'MMM y',
+ 'sNoDay': 'MM.y'
+ },
+ 'connector': ' , '
+ },
+ 'pt-br': {
+ 'date': {
+ 'short': 'dd/MM/y',
+ 'medium': "d 'de' MMM 'de' y",
+ 'onlyDate': "d 'de' MMM",
+ 'mNoDay': "MMM 'de' y",
+ 'sNoDay': 'MM/y'
+ }
+ },
+ 'pt-pt': {
+ 'date': {
+ 'medium': 'dd/MM/y',
+ 'onlyDate': 'dd/MM',
+ 'mNoDay': 'MM/y',
+ 'sNoDay': 'MM/yy'
+ }
+ },
+ 'ro': {
+ 'date': {
+ 'medium': 'd MMM y',
+ 'onlyDate': 'd MMM',
+ 'mNoDay': 'MMM y',
+ 'sNoDay': 'MM.y'
+ },
+ 'connector': ' , '
+ },
+ 'ru': {
+ 'date': {
+ 'short': 'dd.MM.y',
+ 'medium': "d MMM y 'г.'",
+ 'onlyDate': 'd MMM',
+ 'mNoDay': "MMM y 'г.'",
+ 'sNoDay': 'MM.y'
+ },
+ 'connector': ' , '
+ },
+ 'sr': {
+ 'date': {
+ 'medium': 'dd.MM.y.',
+ 'onlyDate': 'dd.MM.',
+ 'mNoDay': 'MM.y.',
+ 'sNoDay': 'M.yy.'
+ },
+ 'time': {
+ 'short': 'HH:mm',
+ 'medium': 'HH:mm:ss'
+ }
+ },
+ 'sv': {
+ 'date': {
+ 'medium': 'd MMM. y',
+ 'onlyDate': 'd MMM.',
+ 'mNoDay': 'MMM. y',
+ 'sNoDay': 'y-MM'
+ }
+ },
+ 'th': {
+ 'date': {
+ 'medium': 'd MMM y',
+ 'onlyDate': 'd MMM',
+ 'mNoDay': 'MMM y',
+ 'sNoDay': 'M/yy'
+ }
+ },
+ 'tr': {
+ 'date': {
+ 'medium': 'd MMM y',
+ 'onlyDate': 'd MMM',
+ 'mNoDay': 'MMM y',
+ 'sNoDay': 'MM.y'
+ }
+ },
+ 'vi': {
+ 'date': {
+ 'short': 'dd/MM/y',
+ 'medium': 'd MMM, y',
+ 'long': "'Ngày' dd 'tháng' MM 'năm' y",
+ 'onlyDate': 'd MMM',
+ 'mNoDay': 'MMM, y',
+ 'sNoDay': 'MM/y'
+ },
+ 'time': {
+ 'short': 'hh:mm a',
+ 'medium': 'hh:mm:ss a'
+ },
+ 'connector': ' , '
+ },
+ 'zh-cn': {
+ 'date': {
+ 'short': 'y/M/d',
+ 'medium': "y'年'M'月'd'日'",
+ 'onlyDate': "M'月'd'日'",
+ 'mNoDay': "y'年'M'月'",
+ 'sNoDay': 'y/M'
+ }
+ },
+ 'zh-hk': {
+ 'date': {
+ 'medium': "y'年'M'月'd'日'",
+ 'onlyDate': "M'月'd'日'",
+ 'mNoDay': "y'年'M'月'",
+ 'sNoDay': 'M/y'
+ }
+ },
+ 'zh-tw': {
+ 'date': {
+ 'medium': "y'年'M'月'd'日'",
+ 'onlyDate': "M'月'd'日'",
+ 'mNoDay': "y'年'M'月'",
+ 'sNoDay': 'y/M'
+ }
+ }
+ };
+ });
\ No newline at end of file
diff --git a/app/jimu.js/accessibleUtils.js b/app/jimu.js/accessibleUtils.js
new file mode 100644
index 0000000..64b7aca
--- /dev/null
+++ b/app/jimu.js/accessibleUtils.js
@@ -0,0 +1,358 @@
+define([
+ 'dojo/_base/lang',
+ 'dojo/_base/html',
+ 'dojo/query',
+ 'dojo/keys',
+ 'dojo/on'
+], function(lang, html, query, keys, on) {
+ var mo = {};
+
+ mo.firstFocusNodeClass = 'firstFocusNode';
+ mo.lastFocusNodeClass = 'lastFocusNode';
+
+ mo.isInNavMode = function(){
+ return html.hasClass(document.body, 'jimu-nav-mode') ? true : false;
+ };
+
+ //init class and event for first/last nodes
+ mo.initTabIndexAndOrder = function(widgetObj){
+ var firstNode = mo.getFirstFocusNode(widgetObj.domNode, widgetObj.inPanel);
+ var lastNode = mo.getLastFocusNode(widgetObj.domNode);
+
+ //for simple inpanel widgets, they don't need to change any code
+ if(firstNode && !lastNode){
+ lastNode = firstNode;
+ }
+ if(widgetObj.isController){
+ firstNode = lastNode = null;
+ }
+ mo.initFirstFocusNode(widgetObj.domNode, firstNode);
+ mo.initLastFocusNode(widgetObj.domNode, lastNode);
+ };
+
+ //There types of widgets:
+ //1. common onScreen widgets, like HomeButton, ZoomSlider, Search(can't closeable), AT, ...
+ //2. special onScreen widgets, like Search(in simulated panel)
+ //3. inPanel widgets, like About, Filter, Bookmark, ...
+ mo.isCommonOnScreenWidget = function(widgetObject){
+ return widgetObject.isOnScreen && widgetObject.closeable !== true;
+ };
+
+ //Prevent to trigger map navigation
+ //stop arrow,plus/minus events for map when mouse is hovering it.
+ mo.preventMapNavigation = function(evt){
+ var keyCode = evt.keyCode;
+ var mapNavigationKeys = [
+ //Zoom '+','-','+=','-_'
+ keys.NUMPAD_PLUS, 61, 187, keys.NUMPAD_MINUS, 173, 189,
+ //Pan Cardinal
+ keys.UP_ARROW, keys.NUMPAD_8,
+ keys.RIGHT_ARROW, keys.NUMPAD_6,
+ keys.DOWN_ARROW, keys.NUMPAD_2,
+ keys.LEFT_ARROW, keys.NUMPAD_4,
+ //Pan Diagonal
+ keys.PAGE_UP, keys.NUMPAD_9,
+ keys.PAGE_DOWN, keys.NUMPAD_3,
+ keys.END, keys.NUMPAD_1,
+ keys.HOME, keys.NUMPAD_7
+ ];
+ if(mapNavigationKeys.indexOf(keyCode) >= 0){
+ evt.stopPropagation();
+ }
+ };
+
+ mo.initWidgetCancelEvent = function(widgetObject){
+ html.setAttr(widgetObject.domNode, 'role', 'application');//resolve ff&nvda
+ on(widgetObject.domNode, 'keydown', lang.hitch(this, function(evt){
+ // var isKeyboardNavigation = map.isKeyboardNavigation;
+ // map.disableKeyboardNavigation();
+ mo.preventMapNavigation(evt);
+ var target = evt.target;
+ window.isMoveFocusFromMap = false;
+ //inPanel widgets use their panels' close event to enter or escape
+ if(!widgetObject.inPanel){
+ if([keys.ENTER, keys.ESCAPE].indexOf(evt.keyCode) < 0){
+ return;
+ }
+ //cases like zoomSlider, search(one state), splash, AT, overview, ...
+ if(mo.isCommonOnScreenWidget(widgetObject)){
+ //enter event: focus to first node of expanded widget
+ if(evt.keyCode === keys.ENTER && html.hasClass(target, widgetObject.baseClass)){
+ evt.preventDefault();//prevent to trigger the enter-event for the firstNode#ie,ff
+ mo.focusFirstFocusNode(widgetObject.domNode);
+ }else if(evt.keyCode === keys.ESCAPE){//esc event
+ var dom, isFocusMinIndex = false;
+ //back to focus widgetDom if cancel operation is from widgetDom's childNode
+ if(!html.hasClass(target, widgetObject.baseClass)){
+ evt.stopPropagation(); //stop triggering panel's esc-event for dashboard theme
+ widgetObject.domNode.focus();
+ return;
+ }
+ var parentNode = widgetObject.domNode.parentNode;
+ //controller, AT, splash
+ if(html.getAttr(parentNode, 'id') === 'jimu-layout-manager'){
+ dom = widgetObject.domNode;
+ }else{
+ dom = widgetObject.domNode.parentNode;
+ }
+ mo.trapToNextFocusContainer(dom, isFocusMinIndex);
+ }
+ }
+ //special cases like search(in a simulated panel)
+ else if(evt.keyCode === keys.ESCAPE && !html.hasClass(target, widgetObject.baseClass)){
+ widgetObject.domNode.focus();//works for screen condition
+ widgetObject.onClose();//works for popup like inpanel
+ evt.preventDefault();
+ evt.stopPropagation();
+ }
+ }
+ // if(isKeyboardNavigation){
+ // map.enableKeyboardNavigation();
+ // }
+ }));
+ };
+
+ //init class and event to first focusable node
+ mo.initFirstFocusNode = function(widgetDom, firstNode){
+ //empty previous firstNode's class
+ // var _firstNode = query('.' + mo.firstFocusNodeClass, widgetDom)[0];
+ var _firstNode = mo.getFirstFocusNode(widgetDom);
+ if(_firstNode){
+ html.removeClass(_firstNode, mo.firstFocusNodeClass);
+ if(_firstNode.firstNodeEvent){
+ _firstNode.firstNodeEvent.remove();
+ }
+ if(_firstNode === widgetDom){
+ html.setAttr(_firstNode, 'tabindex', null);//update first node and reset widgetDom's tabindex
+ }
+ }
+ if(firstNode){
+ if(firstNode === widgetDom){
+ html.setAttr(firstNode, 'tabindex', 0);
+ }
+ html.addClass(firstNode, mo.firstFocusNodeClass);
+ firstNode.firstNodeEvent = on(firstNode, 'keydown', lang.hitch(this, function(evt){
+ if(html.hasClass(evt.target, mo.firstFocusNodeClass) && evt.keyCode === keys.TAB){
+ //Resolve the cursor is fousing on the first focusable node from other widget not current msg popup when the app starts.
+ if(window.currentMsgPopup && window.currentMsgPopup.firstFocusNode){
+ window.currentMsgPopup.focusedNodeBeforeOpen = evt.target;
+ evt.preventDefault();
+ window.currentMsgPopup.firstFocusNode.focus();
+ return;
+ }
+ //Resolve the cursor is fousing on the first focusable node from other widget not splash widget when the app starts.
+ var splashWidget = query('.jimu-widget-splash', query('#jimu-layout-manager')[0])[0];
+ if(splashWidget && html.getStyle(splashWidget, 'display') !== 'none' && splashWidget !== widgetDom){
+ evt.preventDefault();
+ var splashFirstNode = query('.' + mo.firstFocusNodeClass, splashWidget)[0];
+ splashFirstNode.focus();
+ }else if(evt.shiftKey){//shift&Tab
+ evt.preventDefault();
+ var lastNode = mo.getLastFocusNode(widgetDom);
+ lastNode.focus();
+ }
+ }
+ }));
+ }
+ };
+
+ //init class and event to last focusable node
+ mo.initLastFocusNode = function(widgetDom, lastNode){
+ // var _lastNode = query('.' + mo.lastFocusNodeClass, widgetDom)[0];
+ var _lastNode = mo.getLastFocusNode(widgetDom);
+ if(_lastNode){
+ html.removeClass(_lastNode, mo.lastFocusNodeClass);
+ if(_lastNode.lastNodeEvent){
+ _lastNode.lastNodeEvent.remove();
+ }
+ if(_lastNode === widgetDom){
+ html.setAttr(_lastNode, 'tabindex', null);
+ }
+ }
+ if(lastNode){
+ if(lastNode === widgetDom){
+ html.setAttr(lastNode, 'tabindex', 0);
+ }
+ html.addClass(lastNode, mo.lastFocusNodeClass);
+ lastNode.lastNodeEvent = on(lastNode, 'keydown', lang.hitch(this, function(evt){
+ if(!evt.shiftKey && evt.keyCode === keys.TAB){
+ // console.log(evt.target);
+ if(widgetDom === lastNode){
+ evt.preventDefault();
+ this.focusFirstFocusNode(widgetDom);
+ return;
+ }
+ var innerNodes = this.getFocusNodesInDom(lastNode);
+ if(innerNodes.length === 0){// no child nodes
+ evt.preventDefault();
+ this.focusFirstFocusNode(widgetDom);
+ }else{ // has nodes
+ if(!html.hasClass(evt.target, mo.lastFocusNodeClass)){
+ // var lastNode = this.getAncestorDom(evt.target, function(dom){
+ // return html.hasClass(dom, mo.lastFocusNodeClass);
+ // }, 10);
+ // if(innerNodes.length === 1 && innerNodes[0] === evt.target){//one focusable node
+ // if(innerNodes.length === 1){//one focusable node
+ // evt.preventDefault();
+ // utils.focusFirstFocusNode(widgetObject.domNode);
+ // }else if(innerNodes[innerNodes.length - 1] === evt.target){
+ // }
+ if(innerNodes[innerNodes.length - 1] === evt.target){
+ evt.preventDefault();
+ this.focusFirstFocusNode(widgetDom);
+ }
+ }
+ }
+ }
+ }));
+ }
+ };
+
+ //focus first node, add lastTag to last node
+ mo.focusFirstFocusNode = function(widgetDom){
+ var firstNode = query('.' + mo.firstFocusNodeClass, widgetDom)[0];
+ // var focusNode = firstNode ? firstNode : widgetDom.children[0];
+ // if(focusNode){//scalebar widget does not has children
+ // focusNode.focus();
+ // }
+ var focusNode = firstNode ? firstNode : widgetDom;
+ focusNode.focus();
+ };
+
+ mo.getFirstFocusNode = function(widgetDom, inPanel){
+ var firstNode = html.hasClass(widgetDom, mo.firstFocusNodeClass) ?
+ widgetDom : query('.' + mo.firstFocusNodeClass, widgetDom)[0];
+ // return firstNode ? firstNode : widgetDom.children[0];
+ if(!firstNode && inPanel){
+ // firstNode = widgetDom.children[0];
+ // if(firstNode){
+ // html.setAttr(firstNode, 'tabindex', 0);
+ // }
+ firstNode = widgetDom;
+ //Do not rewrite current tabindex, like controller
+ // if(!(html.getAttr(firstNode, 'tabindex') >= 0)){//controller doesn't need rewrite tabindex
+ if(html.getAttr(firstNode, 'tabindex') === null){
+ html.setAttr(firstNode, 'tabindex', 0);
+ }
+ }
+ return firstNode;
+ };
+
+ mo.getLastFocusNode = function(widgetDom){
+ var lastNode = html.hasClass(widgetDom, mo.lastFocusNodeClass) ?
+ widgetDom : query('.' + mo.lastFocusNodeClass, widgetDom)[0];
+ return lastNode;
+ };
+
+ mo.traversalDom = function(node, items){
+ items = items ? items : [];
+ var item, childNodes = node.childNodes;
+ for(var i = 0; i < childNodes.length ; i++){
+ item = childNodes[i];
+ if(item.nodeType === 1){
+ items.push(item);
+ mo.traversalDom(item, items);
+ }
+ }
+ return items;
+ };
+
+ mo.getFocusNodesInDom = function(Dom){
+ var searchKey = ['A', 'INPUT', 'BUTTON', 'FORM'];
+ var nodes = mo.traversalDom(Dom);
+
+ var focusNodes = [];
+ for(var key = 0; key < nodes.length; key ++){
+ var node = nodes[key];
+ var noPresentation = html.getAttr(node, 'role') !== 'presentation';
+ var noHidden = html.getAttr(node, 'type') !== 'hidden';
+ var noDisabled = html.getAttr(node, 'disabled') !== true;
+ var validTabindex = html.getAttr(node, 'tabindex');//could be null
+ //spacial focusable tags, or div that has tabindex>=0
+ if(noPresentation && noHidden && noDisabled &&
+ ((searchKey.indexOf(node.tagName) >= 0 && validTabindex !== -1) || //focuasable tags
+ (node.tagName === 'DIV' && validTabindex && validTabindex >= 0))){ //div with focusable attr
+ focusNodes.push(node);
+ }
+ }
+ return focusNodes;
+ };
+
+ mo.trapToNextFocusContainer = function(currentContainer, isFocusMinIndex){
+ var frameNodes = currentContainer.parentNode.children;
+ var newFrameNodesArray = [];
+ for(var key = 0; key < frameNodes.length; key ++){
+ var frameNode = frameNodes[key];
+ var tabindex = html.getAttr(frameNode, 'tabindex');
+ //only check the visible containers(not including hidden splash widget)
+ if(tabindex > 0 && html.getStyle(frameNode, 'display') !== 'none'){
+ newFrameNodesArray.push(frameNode);
+ }
+ }
+ newFrameNodesArray.sort(function(dom1, dom2){
+ var value1 = html.getAttr(dom1, 'tabindex');
+ var value2 = html.getAttr(dom2, 'tabindex');
+ if(value1 < value2){
+ return -1;
+ }else if(value1 === value2){
+ return 0;
+ }else{
+ return 1;
+ }
+ });
+
+ var focusNode = null;
+ if(isFocusMinIndex){//focus min tabindex
+ focusNode = newFrameNodesArray[0];
+ }else{
+ //current node is hidden,like canceling splash
+ if(html.getStyle(currentContainer, 'display') === 'none'){
+ focusNode = newFrameNodesArray[0];
+ }else{
+ //focus next tabindex base on current
+ var currentIndex = html.getAttr(currentContainer, 'tabindex');
+ for(var key2 = 0; key2 < newFrameNodesArray.length; key2 ++){
+ var tabindex2 = html.getAttr(newFrameNodesArray[key2], 'tabindex');
+ if(tabindex2 === currentIndex){
+ var isLastOne = key2 === newFrameNodesArray.length - 1;
+ if(isLastOne){
+ focusNode = newFrameNodesArray[0];
+ }else{
+ focusNode = newFrameNodesArray[key2 + 1];
+ }
+ break;
+ }
+ }
+ }
+ }
+ focusNode.focus();
+ return focusNode;
+ };
+
+ mo.addTooltipByDomNode = function(){ //tooltip, domNode, label
+ // tooltip.position = "below"; //"below-centered";
+ // tooltip.class = ["jimu-access-tooltip"];
+ // tooltip.baseClass = ["jimu-access-tooltip----"];
+ // tooltip.style = {"padding-right":"5px"};
+
+ //hide tooltip
+ /*
+ tooltip.defaultPosition = ["below-centered","above-centered", "after-centered", "before-centered"];
+ on(domNode, 'focus', lang.hitch(this, function(evt){
+ if(mo.isInNavMode()){
+ tooltip.show(label + ' ', evt.target);
+ setTimeout(lang.hitch(this, function(){
+ tooltip.hide(evt.target);
+ }),1500);
+ }
+ }));
+ on(domNode, 'blur', lang.hitch(this, function(evt){
+ if(mo.isInNavMode()){
+ tooltip.hide(evt.target);
+ }
+ }));
+ */
+ };
+
+ return mo;
+});
diff --git a/app/jimu.js/appConfigResourceUtils.js b/app/jimu.js/appConfigResourceUtils.js
new file mode 100644
index 0000000..655d74b
--- /dev/null
+++ b/app/jimu.js/appConfigResourceUtils.js
@@ -0,0 +1,79 @@
+///////////////////////////////////////////////////////////////////////////
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
+//
+// Licensed under the Apache License Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+///////////////////////////////////////////////////////////////////////////
+
+define([
+ 'dojo/Deferred',
+ 'dojo/promise/all',
+ 'jimu/portalUtils',
+ 'jimu/utils'
+
+ ],
+ function(Deferred, all, portalUtils, jimuUtils) {
+ return {
+ AddResourcesToItemForAppSave: function(portalUrl, resourcesUrls, originItemId, newItemId) {
+ //Add resources to item, based on the existing virtual resources url to determine the path and file name
+ //resourcesUrls:[{resUrl:required,b64}]
+ resourcesUrls = resourcesUrls || [];
+ if (resourcesUrls.length === 0) {
+ var deferred = new Deferred();
+ deferred.resolve(resourcesUrls);
+ return deferred;
+ }
+ var getBlobDefs = resourcesUrls.map(function(item) {
+ var prefix_FileName = item.resUrl.split('resources/')[1];
+ var getBlobDef = new Deferred();
+ if (item.b64) {
+ var blobFile = jimuUtils.b64toBlob(item.b64);
+ getBlobDef.resolve({
+ blob: blobFile,
+ fileName: prefix_FileName.split('/')[1],
+ prefixName: prefix_FileName.split('/')[0]
+ });
+ } else {
+ var retUrl = item.resUrl;
+ if (retUrl.indexOf('${itemId}') > 0) {
+ retUrl = retUrl.replace('${itemId}', originItemId);
+ }
+ jimuUtils.resourcesUrlToBlob(retUrl).then(function(result) {
+ getBlobDef.resolve({
+ blob: result,
+ fileName: prefix_FileName.split('/')[1],
+ prefixName: prefix_FileName.split('/')[0]
+ }, function(err) {
+ console.error(err.message || err);
+ getBlobDef.reject(err);
+ });
+ });
+ }
+ return getBlobDef;
+ });
+ return all(getBlobDefs).then(function(result) {
+ if (result instanceof Array && result.length > 0) {
+ var uploadDefs = result.map(function(e) {
+ var itemId = originItemId;
+ if (newItemId) {
+ itemId = newItemId;
+ }
+ return portalUtils.addResource(portalUrl, itemId, e.blob, e.fileName, e.prefixName);
+ }.bind(this));
+ return all(uploadDefs).then(function(results) {
+ return results;
+ });
+ }
+ }.bind(this));
+ }
+ };
+ });
\ No newline at end of file
diff --git a/app/jimu.js/clientStatisticsUtils.js b/app/jimu.js/clientStatisticsUtils.js
new file mode 100644
index 0000000..3c10bb7
--- /dev/null
+++ b/app/jimu.js/clientStatisticsUtils.js
@@ -0,0 +1,944 @@
+///////////////////////////////////////////////////////////////////////////
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
+//
+// Licensed under the Apache License Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+///////////////////////////////////////////////////////////////////////////
+
+define([
+ 'dojo/_base/lang',
+ 'moment/moment',
+ './_chartHelpUtils',
+ 'jimu/utils'
+], function(lang, moment, ChartHelpUtils, jimuUtils) {
+
+ if (window.makeTwix) {
+ window.makeTwix(moment);
+ }
+
+ //punlic method
+ //getClietStatisticsData
+ // getFeatureModeStatisticsData
+ // getCategoryModeStatisticsData
+ // getCountModeStatisticsData
+ // getFieldModeStatisticsData
+
+ //getCluseringObj
+ //sortClientStatisticsData
+ //getDataForMaxLabels
+
+ //convertingNullOrUndefinedAsPlaceholders
+ //separateFeaturesWhetherFieldValueNull
+ //keepFieldValueType
+ //calcValuesByFeaturesForCatetoryMode
+ //calcValuesByFeaturesForCountMode
+ //getValuesByValueFieldForFieldMode
+ //calcValueByOperation
+
+ // Deprecated, Only used for Chart Widget StatisticsChart.js
+ // getFeatureModeStatisticsInfo
+ // getCategoryModeStatisticsInfo
+ // getCountModeStatisticsInfo
+ // getFieldModeStatisticsInfo
+
+ var mo = {
+ // return {label:'', values:[2000], unit /*optional*/}
+ getClietStatisticsData: function(options) {
+ var mode = options.mode;
+ if (mode === 'feature') {
+ return this.getFeatureModeStatisticsData(options);
+ } else if (mode === 'category') {
+ return this.getCategoryModeStatisticsData(options);
+ } else if (mode === 'count') {
+ return this.getCountModeStatisticsData(options);
+ } else if (mode === 'field') {
+ return this.getFieldModeStatisticsData(options);
+ }
+ },
+
+ //sort order client statistics data
+ sortClientStatisticsData: function(data, options) {
+ var mode = options.mode;
+ var sortOrder = options.sortOrder; //{isAsc:boolean,field:''}
+ var valueFields = options.valueFields;
+ var clusterField = options.clusterField;
+ return this.sortStatisticsData(data, mode, sortOrder, clusterField, valueFields);
+ },
+
+ //Slice data by input number
+ getDataForMaxLabels: function(data, maxLabels) {
+ if (data && data.length && typeof maxLabels === 'number' &&
+ maxLabels > 0 && maxLabels < data.length) {
+ return data.slice(0, maxLabels);
+ } else {
+ return data;
+ }
+ },
+
+ //options: {features, clusterField, valueFields}
+ //return [{label:'a',values:[10,100,2],features:[f1]}]
+ getFeatureModeStatisticsData: function(options) {
+ var features = options.features;
+ var clusterField = options.clusterField;
+ var valueFields = options.valueFields;
+ var showNullLabelData = options.showNullLabelData !== undefined ? options.showNullLabelData : true;
+
+ var separationFeatures = this.separateFeaturesWhetherFieldValueNull(clusterField, features);
+ var notNullLabelFeatures = separationFeatures.notNullLabelFeatures;
+ var nullLabelFeatures = separationFeatures.nullLabelFeatures;
+
+ features = showNullLabelData ? notNullLabelFeatures.concat(nullLabelFeatures) : notNullLabelFeatures;
+
+ var data = [];
+
+ data = features.map(function(feature) {
+ var attributes = feature.attributes;
+ var fieldValue = attributes && attributes[clusterField];
+ fieldValue = this.convertingNullOrUndefinedAsPlaceholders(fieldValue);
+ var option = {
+ label: fieldValue,
+ values: [],
+ features: [feature]
+ };
+
+ option.values = valueFields.map(function(fieldName) {
+ return attributes[fieldName];
+ });
+ return option;
+ }.bind(this));
+
+ return data;
+ },
+
+ //options:{features, clusterField, valueFields, operation,
+ //dateConfig, /*optional, Only date time type is valid*/
+ //nullValue:boolean /*optional, for 'null' value, calcute as 0 or ignore it*/
+ //showNullLabelData:boolean /* Whether to display the data item whitch cluster field is null */ }
+
+ //return [{label:'a',values:[10,100,2]},
+ //unit/*optional, Only available if the cluster field is a datetime type*/]
+ getCategoryModeStatisticsData: function(options) {
+ //For example: valueFields[0] = hasStatisticsed ? valueFields[0] + operation:valueFields[0]
+ var hasStatisticsed = options.hasStatisticsed;
+
+ var features = options.features;
+ var clusterField = options.clusterField;
+ var valueFields = options.valueFields;
+ var operation = options.operation;
+
+ //dateConfig:{isNeedFilled:boolean,dateFormatter:''//automatic, year, month, day, hour, minute, second}
+ var dateConfig = options.dateConfig;
+
+ var showNullLabelData = options.showNullLabelData !== undefined ? options.showNullLabelData : true;
+ var useNullValueAsZero = options.nullValue; //boolean
+
+ var data = []; //[{label:'a',value:[10,100,2],...]
+
+ var cluseringObj = this.getCluseringObj(clusterField, features, dateConfig);
+ //{label:{count:number, features:[f1,f2...], type},...}
+ var notNullLabelClusteringObj = cluseringObj.notNullLabel;
+ var nullLabelClusteringObj = cluseringObj.nullLabel;
+
+ var notNullLabelClusteredData = clusterByLbabel.call(this, notNullLabelClusteringObj);
+ var nullLabelClusteredData = clusterByLbabel.call(this, nullLabelClusteringObj);
+
+ data = showNullLabelData ? notNullLabelClusteredData.concat(nullLabelClusteredData) : notNullLabelClusteredData;
+ //return [{category:'a',valueFields:[10,100,2],features:[f1,f2...]},...]
+ /*jshint -W083 */
+ function clusterByLbabel(clusteringObj) {
+ var data = [];
+ var categoryObj = null;
+ for (var clusterFieldValue in clusteringObj) {
+ categoryObj = clusteringObj[clusterFieldValue];
+ clusterFieldValue = this.keepFieldValueType(clusterFieldValue, categoryObj.type, dateConfig);
+
+ var values = this.calcValuesByFeaturesForCatetoryMode(valueFields, categoryObj,
+ hasStatisticsed, operation, useNullValueAsZero);
+
+ data.push({
+ label: clusterFieldValue,
+ values: values,
+ features: categoryObj.features,
+ unit: categoryObj.unit
+ });
+ }
+ return data;
+ }
+
+ return data;
+ },
+ //options:{features, clusterField,
+ //dateConfig, /*optional, Only date time type is valid*/
+ //showNullLabelData:boolean /* Whether to display the data item whitch cluster field is null */ }
+
+ //return [{label:'',values:count1,features:[f1,f2...]},
+ //unit/*optional, Only available if the cluster field is a datetime type*/]
+ getCountModeStatisticsData: function(options) {
+ var hasStatisticsed = options.hasStatisticsed;
+ var features = options.features;
+ var clusterField = options.clusterField;
+ //dateConfig:{isNeedFilled:boolean,dateFormatter:''//automatic, year, month, day, hour, minute, second}
+ var dateConfig = options.dateConfig;
+ var showNullLabelData = options.showNullLabelData !== undefined ? options.showNullLabelData : true;
+ var data = []; //[{fieldValue:value1,count:count1,features:[f1,f2...]}]
+ var isStatisticsed = hasStatisticsed && !dateConfig;
+
+ //{fieldValue1:{count:count1,features:[f1,f2...]},...}
+ var cluseringObj = this.getCluseringObj(clusterField, features, dateConfig);
+ var notNullLabelClusteringObj = cluseringObj.notNullLabel;
+ var nullLabelClusteringObj = cluseringObj.nullLabel;
+
+ var notNullLabelClusteredData = clusterByLbabel.call(this, notNullLabelClusteringObj);
+ var nullLabelClusteredData = clusterByLbabel.call(this, nullLabelClusteringObj);
+ data = showNullLabelData ? notNullLabelClusteredData.concat(nullLabelClusteredData) : notNullLabelClusteredData;
+ //return [{label:'a',values:[10,100,2],unit},...]
+ function clusterByLbabel(clusteringObj) {
+ var data = [];
+ var categoryObj = null;
+ for (var clusterFieldValue in clusteringObj) {
+ categoryObj = clusteringObj[clusterFieldValue]; //{count:count1,features:[f1,f2...]}
+ var values = this.calcValuesByFeaturesForCountMode(categoryObj, isStatisticsed); //STAT_COUNT
+ clusterFieldValue = this.keepFieldValueType(clusterFieldValue, categoryObj.type, dateConfig);
+
+ data.push({
+ label: clusterFieldValue,
+ values: values,
+ features: categoryObj.features,
+ unit: categoryObj.unit
+ });
+ }
+ return data;
+ }
+ return data;
+ },
+
+ calcValuesByFeaturesForCountMode: function(categoryObj, hasStatisticsed) {
+
+ var values;
+ if (hasStatisticsed) {
+ var upperValueField = 'STAT_COUNT';
+ var lowerValueField = 'stat_count';
+ var features = categoryObj.features;
+ values = features.map(function(feature) {
+ var attributes = feature.attributes;
+ var v = attributes && attributes[upperValueField];
+ if (typeof v === 'undefined') {
+ v = attributes[lowerValueField];
+ }
+ return v;
+ }.bind(this));
+ } else {
+ values = [categoryObj.count];
+ }
+ return values;
+ },
+
+ //options:{features, valueFields, operation}
+ //nullValue:boolean /*optional, for 'null' value, calcute as 0 or ignore it*/
+ //return {label:'',values: [1,2]}
+ getFieldModeStatisticsData: function(options) {
+ //For example: valueFields[0] = hasStatisticsed ? valueFields[0] + operation:valueFields[0]
+ var hasStatisticsed = options.hasStatisticsed;
+
+ var features = options.features;
+ var valueFields = options.valueFields;
+ var operation = options.operation;
+ var useNullValueAsZero = options.nullValue; //boolean
+
+ var data = [];
+
+ data = valueFields.map(lang.hitch(this, function(fieldName) {
+ var vs = this.getValuesByValueFieldForFieldMode(fieldName, features, hasStatisticsed, operation);
+ var summarizeValue = this.calcValueByOperation(vs, operation, useNullValueAsZero);
+ return {
+ label: fieldName,
+ values: [summarizeValue]
+ };
+ }));
+
+ return data;
+ },
+
+ getValuesByValueFieldForFieldMode: function(fieldName, features, hasStatisticsed, operation) {
+ var cloneOperator = operation === 'average' ? 'avg' : operation;
+ if (hasStatisticsed) {
+ var upperFieldName = jimuUtils.upperCaseString(fieldName + '_' + cloneOperator);
+ var lowerFieldName = jimuUtils.lowerCaseString(fieldName + '_' + cloneOperator);
+ }
+ var values = features.map(lang.hitch(this, function(feature) {
+ var attributes = feature.attributes;
+ if (!attributes) {
+ return;
+ }
+ var v;
+ if (hasStatisticsed) {
+ v = attributes[upperFieldName];
+ if (typeof v === 'undefined') {
+ v = attributes[lowerFieldName];
+ }
+ } else {
+ v = attributes[fieldName];
+ }
+ return v;
+ }));
+ return values;
+ },
+
+ /*------------ Tool method -------------*/
+ //return sorted data
+ sortStatisticsData: function(data, mode, sortOrder, labelField, valueFields) {
+ //sortOrder
+ // isLabelAxis:boolean
+ // isAsc:boolean
+ // field:''
+
+ if (!sortOrder) {
+ return data;
+ }
+
+ var isAsc = sortOrder.isAsc;
+
+ function getVaildValue(obj, mode, sortOrder) {
+ var value;
+ if (mode === 'category') {
+ if (!sortOrder.isLabelAxis) {
+ if (!sortOrder.field && obj.values.length === 1) {
+ value = obj.values[0];
+ } else {
+ var index = valueFields.indexOf(sortOrder.field);
+ value = obj.values[index];
+ }
+ } else if (sortOrder.isLabelAxis) {
+ value = obj.label;
+ }
+ } else if (mode === 'count') {
+ var xValue = obj.label;
+ value = sortOrder.isLabelAxis ? xValue : obj.values[0];
+ } else if (mode === 'field') {
+ value = sortOrder.isLabelAxis ? obj.label : obj.values[0];
+ } else if (mode === 'feature') {
+ var attributes, field = sortOrder.field;
+ if (obj && obj.features && obj.features[0]) {
+ attributes = obj.features[0].attributes;
+ if (attributes) {
+ if (sortOrder.isLabelAxis) {
+ value = attributes[labelField];
+ } else {
+ if (field) {
+ value = attributes[field];
+ } else if (obj.values.length) {
+ value = obj.values[0];
+ }
+ }
+ }
+ }
+ }
+ return value;
+ }
+
+ if (!Array.isArray(data)) {
+ return data;
+ }
+
+ data.sort(function(a, b) {
+ var aValue = getVaildValue(a, mode, sortOrder);
+ var bValue = getVaildValue(b, mode, sortOrder);
+
+ if (aValue === '_NULL&UNDEFINED_') {
+ aValue = Infinity;
+ }
+ if (bValue === '_NULL&UNDEFINED_') {
+ bValue = Infinity;
+ }
+ if (jimuUtils.isNumberOrNumberString(aValue)) {
+ aValue = Number(aValue);
+ }
+ if (jimuUtils.isNumberOrNumberString(bValue)) {
+ bValue = Number(bValue);
+ }
+
+ var sortBoolean = aValue > bValue ? isAsc : !isAsc;
+
+ if (aValue === Infinity) {
+ sortBoolean = isAsc;
+ } else if (bValue === Infinity) {
+ sortBoolean = !isAsc;
+ }
+
+ var sortvalue = 0;
+ if (aValue !== bValue) {
+ sortvalue = sortBoolean ? 1 : -1;
+ }
+
+ return sortvalue;
+ }.bind(this));
+
+ return data;
+ },
+
+ convertingNullOrUndefinedAsPlaceholders: function(value) {
+ if (value === null || value === undefined) {
+ return '_NULL&UNDEFINED_';
+ }
+ return value;
+ },
+
+ keepFieldValueType: function(clusterFieldValue, type, dateConfig) {
+ if (type === 'number') {
+ clusterFieldValue = Number(clusterFieldValue);
+ }
+ if (dateConfig && clusterFieldValue !== '_NULL&UNDEFINED_') {
+ clusterFieldValue = Number(clusterFieldValue);
+ }
+ return clusterFieldValue;
+ },
+
+ calcValuesByFeaturesForCatetoryMode: function(valueFields, categoryObj, hasStatisticsed, operation, nullValue) {
+ var values = valueFields.map(function(fieldName) {
+ var vs = this.getValuesByValueFieldForCategoryMode(fieldName, categoryObj.features,
+ hasStatisticsed, operation);
+ return this.calcValueByOperation(vs, operation, nullValue);
+ }.bind(this));
+ return values;
+ },
+
+ getValuesByValueFieldForCategoryMode: function(fieldName, features, hasStatisticsed, operation) {
+
+ var cloneOperator = operation === 'average' ? 'avg' : operation;
+ if (hasStatisticsed) {
+ var upperFieldName = jimuUtils.upperCaseString(fieldName + '_' + cloneOperator);
+ var lowerFieldName = jimuUtils.lowerCaseString(fieldName + '_' + cloneOperator);
+ }
+ var values = features.map(lang.hitch(this, function(feature) {
+ var attributes = feature.attributes;
+ if (!attributes) {
+ return;
+ }
+ var v;
+ if (hasStatisticsed) {
+ v = attributes[upperFieldName];
+ if (typeof v === 'undefined') {
+ v = attributes[lowerFieldName];
+ }
+ } else {
+ v = attributes[fieldName];
+ }
+ return v;
+ }));
+ return values;
+ },
+
+ _isNumber: function(value) {
+ var valueType = Object.prototype.toString.call(value).toLowerCase();
+ return valueType === "[object number]";
+ },
+
+ //return year...second
+ _getDateUnit: function(range, dateFormatter) {
+ var dateUnit = dateFormatter;
+ if (dateFormatter === 'automatic') {
+ var start = moment(range[0]).local();
+ var end = moment(range[1]).local();
+ var minutes = Math.round(end.diff(start, 'minute', true));
+ if (minutes >= 0 && minutes <= 1) {
+ dateUnit = 'second';
+ } else if (minutes > 1 && minutes <= 60) {
+ dateUnit = 'minute';
+ } else if (minutes > 60 && minutes <= 60 * 24) {
+ dateUnit = 'hour';
+ } else if (minutes > 60 * 24 && minutes <= 60 * 24 * 30) {
+ dateUnit = 'day';
+ } else if (minutes > 60 * 24 * 30 && minutes <= 60 * 24 * 30 * 12) {
+ dateUnit = 'month';
+ } else if (minutes > 60 * 24 * 30 * 12) {
+ dateUnit = 'year';
+ }
+ }
+ return dateUnit;
+ },
+
+ //return [minTime, maxTime]
+ _getTimeRange: function(features, fieldName) {
+
+ var times = features.map(lang.hitch(this, function(feature) {
+ var attributes = feature.attributes;
+ return attributes && attributes[fieldName];
+ }));
+ times = times.filter(function(e) {
+ return !!e;
+ });
+
+ var minTime = Math.min.apply(Math, times);
+ var maxTime = Math.max.apply(Math, times);
+ return [minTime, maxTime];
+ },
+ //return {twixs:[], dateUnit:'year...second'}
+ _getTimeTwixs: function(features, fieldName, dateFormatter) {
+ var formats = ['year', 'month', 'day', 'hour', 'minute', 'second', 'automatic'];
+ if (formats.indexOf(dateFormatter) < 0) {
+ console.log('Invaild data formatter: ' + dateFormatter);
+ return false;
+ }
+ var range = this._getTimeRange(features, fieldName);
+ //all time is same
+ if (range[0] === range[1]) {
+ return false;
+ }
+ var dateUnit = this._getDateUnit(range, dateFormatter);
+ //example: dateUnit = month, range[0] = 2/8/2000 08:20:20,
+ //return startTime = 1/8/2000 00:00:00,
+ var startTime = this.getStartTimeByUnit(range[0], dateUnit);
+
+ var start = moment(startTime).local();
+ var end = moment(range[1]).local();
+
+ var tw = start.twix(end);
+ var twixs = tw.split(1, dateUnit);
+ var twixEndValue = twixs[twixs.length - 1].end().valueOf();
+ var lastTwix = {
+ startValue: twixEndValue,
+ endValue: Infinity
+ };
+ twixs.push(lastTwix);
+ return {
+ twixs: twixs,
+ dateUnit: dateUnit
+ };
+ },
+
+ //get the categories by features(for category and count mode)
+ //hashObj:{[hashlabel]:{count:0, features:[f1,f2...]}}
+ //return {notNullLabelHashObj:hashObj,nullLabelHashObj:hashObj}
+ getCluseringObj: function(clusterField, features, dateConfig) {
+
+ var notNullLabelClusteringObj = {};
+ var nullLabelClusteringObj = {};
+
+ if (dateConfig) {
+ var clusterObj = this.getClusteringObjForDateType(clusterField, features, dateConfig);
+ notNullLabelClusteringObj = clusterObj.notNullLabel;
+ nullLabelClusteringObj = clusterObj.nullLabel;
+ } else {
+ var separationFeatures = this.separateFeaturesWhetherFieldValueNull(clusterField, features);
+ var notNullLabelFeatures = separationFeatures.notNullLabelFeatures;
+ var nullLabelFeatures = separationFeatures.nullLabelFeatures;
+ notNullLabelClusteringObj = this.getClusteringObjByField(notNullLabelFeatures, clusterField);
+ nullLabelClusteringObj = this.getClusteringObjByField(nullLabelFeatures, clusterField);
+ }
+
+ return {
+ notNullLabel: notNullLabelClusteringObj,
+ nullLabel: nullLabelClusteringObj
+ };
+ },
+
+ calcValueByOperation: function(values, operation, useNullValueAsZero) {
+
+ if (values && values.length === 1) {
+ if (!useNullValueAsZero) {
+ return values[0];
+ } else if (!this._isNumber(values[0])) {
+ return 0;
+ }
+ }
+
+ var summarizeValue;
+ if (values.length !== 0) {
+ summarizeValue = 0;
+ if (operation === 'max') {
+ summarizeValue = -Infinity;
+ } else if (operation === 'min') {
+ summarizeValue = Infinity;
+ }
+ //handle null value
+ if (useNullValueAsZero) {
+ values = values.map(function(val) {
+ if (!this._isNumber(val)) {
+ val = 0;
+ }
+ return val;
+ }.bind(this));
+ } else {
+ values = values.filter(function(val) {
+ return this._isNumber(val);
+ }.bind(this));
+ }
+ //use nonNullValueCount to record how many feature values are not null for the fieldName
+ var count = 0;
+ values.forEach(lang.hitch(this, function(value) {
+ count++;
+ if (operation === 'average' || operation === 'sum') {
+ summarizeValue += value;
+ } else if (operation === 'max') {
+ summarizeValue = Math.max(summarizeValue, value);
+ } else if (operation === 'min') {
+ summarizeValue = Math.min(summarizeValue, value);
+ }
+ }));
+
+ if (count > 0) {
+ if (operation === 'average') {
+ //summarizeValue = summarizeValue / values.length;
+ summarizeValue = summarizeValue / count;
+ }
+ } else {
+ //if all values for the fieldName are null, we set summarizeValue to null, no matter
+ //what's the value of operation
+ summarizeValue = null;
+ }
+ } else {
+ summarizeValue = null;
+ }
+ return summarizeValue;
+ },
+
+ getClusteringObjByField: function(features, clusterField) {
+ var clusteringObj = {};
+ features.forEach(lang.hitch(this, function(feature) {
+ var attributes = feature.attributes;
+ var clusterFieldValue = attributes && attributes[clusterField];
+ var type = typeof clusterFieldValue;
+ clusterFieldValue = this.convertingNullOrUndefinedAsPlaceholders(clusterFieldValue);
+ var hashValue = null;
+
+ if (clusteringObj.hasOwnProperty(clusterFieldValue)) {
+ hashValue = clusteringObj[clusterFieldValue];
+ hashValue.features.push(feature);
+ hashValue.count++;
+ } else {
+ hashValue = {
+ count: 1,
+ features: [feature],
+ type: type
+ };
+ clusteringObj[clusterFieldValue] = hashValue;
+ }
+ }));
+ return clusteringObj;
+ },
+
+ _removeNaNDataItem: function(data) {
+ return data.filter(function(item) {
+ var isNaNValue = false;
+ var category = item.category;
+ if (typeof category === 'number') {
+ isNaNValue = isNaN(category);
+ }
+ return !isNaNValue;
+ });
+ },
+
+ separateFeaturesWhetherFieldValueNull: function(field, features) {
+ var nullLabelFeatures = [],
+ notNullLabelFeatures = [];
+ if (Array.isArray(features)) {
+ notNullLabelFeatures = features.filter(function(feature) {
+ var attributes = feature.attributes;
+ var fieldValue = attributes && attributes[field];
+ if (fieldValue === null || fieldValue === undefined) {
+ nullLabelFeatures.push(feature);
+ } else {
+ return true;
+ }
+ });
+ }
+ return {
+ nullLabelFeatures: nullLabelFeatures,
+ notNullLabelFeatures: notNullLabelFeatures
+ };
+ },
+
+ getStartTimeByUnit: function(timestamp, unit) {
+ return moment(timestamp).startOf(unit).utc().valueOf();
+ },
+
+ _mosaicFieldNameWithOperatorAndUpper: function(fieldname, operator) {
+ return jimuUtils.upperCaseString(fieldname + '_' + operator);
+ },
+
+ _mosaicFieldNameWithOperatorAndLower: function(fieldname, operator) {
+ return jimuUtils.lowerCaseString(fieldname + '_' + operator);
+ },
+
+ getClusteringObjForDateType: function(clusterField, features, dateConfig) {
+ var separationFeatures = this.separateFeaturesWhetherFieldValueNull(clusterField, features);
+ var notNullLabelFeatures = separationFeatures.notNullLabelFeatures;
+
+ var nullLabelFeatures = separationFeatures.nullLabelFeatures;
+ var nullLabelClusteringObj = {};
+ nullLabelClusteringObj = this.getClusteringObjByField(nullLabelFeatures, clusterField);
+ var notNullLabelClusteringObj = {};
+
+ function updateHashValue(notNullLabelHashObj, clusterFieldValue, hashValue) {
+
+ if (notNullLabelHashObj[clusterFieldValue]) {
+ var oriHashValue = notNullLabelHashObj[clusterFieldValue];
+ oriHashValue.count += hashValue.count;
+ oriHashValue.features = oriHashValue.features.concat(hashValue.features);
+ } else {
+ notNullLabelHashObj[clusterFieldValue] = hashValue;
+ }
+ }
+
+ function clusterByTimestampUnit(clusterObj, clusterFieldValue, valueObj, unit) {
+ clusterFieldValue = Number(clusterFieldValue);
+ var startTime = this.getStartTimeByUnit(clusterFieldValue, unit);
+
+ if (clusterObj[startTime]) {
+ var oriHashValue = clusterObj[startTime];
+ oriHashValue.count += valueObj.count;
+ oriHashValue.features = oriHashValue.features.concat(valueObj.features);
+ } else {
+ valueObj.originTime = clusterFieldValue;
+ clusterObj[startTime] = valueObj;
+ }
+ }
+
+ function getHashObjForOneLabelOfDateType(features, clusterField, notNullLabelHashObj /*dateConfig*/ ) {
+ var attributes = features[0].attributes;
+ var clusterFieldValue = attributes[clusterField];
+ var value = {
+ count: 1,
+ features: features
+ };
+ notNullLabelHashObj[clusterFieldValue] = value;
+
+ return notNullLabelHashObj;
+ }
+
+ if (notNullLabelFeatures.length === 1) {
+ notNullLabelClusteringObj = getHashObjForOneLabelOfDateType.call(this, notNullLabelFeatures, clusterField,
+ notNullLabelClusteringObj, dateConfig);
+ } else if (notNullLabelFeatures.length !== 0) {
+ //{twixs:[], dateUnit:'year...second'}
+ var twixInfo = this._getTimeTwixs(notNullLabelFeatures, clusterField, dateConfig.minPeriod);
+ if (!twixInfo) {
+ notNullLabelClusteringObj = getHashObjForOneLabelOfDateType.call(this, notNullLabelFeatures, clusterField,
+ notNullLabelClusteringObj, dateConfig);
+ } else {
+ var dateClusterObj = {};
+ var twixs = twixInfo.twixs;
+ var dateUnit = twixInfo.dateUnit;
+ twixs.forEach(function(twix) {
+
+ var start = typeof twix.startValue !== 'undefined' ? twix.startValue : twix.start().valueOf(),
+ end = typeof twix.endValue !== 'undefined' ? twix.endValue : twix.end().valueOf();
+ //Get a formatted localized label for chart x axis
+ // var hashLabel = this._getDateCategory(start, dateUnit);
+ var hashValue = {
+ unit: dateUnit,
+ count: 0,
+ features: []
+ };
+ notNullLabelFeatures.forEach(lang.hitch(this, function(feature) {
+ var attributes = feature.attributes;
+ var fieldValue = attributes && attributes[clusterField];
+ if (fieldValue >= start && fieldValue < end) {
+ hashValue.features.push(feature);
+ hashValue.count++;
+ }
+ }));
+ if (dateConfig.isNeedFilled) {
+ updateHashValue.call(this, dateClusterObj, start, hashValue);
+ } else {
+ if (hashValue.count > 0) {
+ updateHashValue.call(this, dateClusterObj, start, hashValue);
+ }
+ }
+ }.bind(this));
+ var cacheObj = {};
+ var label, value;
+ //Cluster again by time stamp's start time
+ for (label in dateClusterObj) {
+ if (dateClusterObj.hasOwnProperty(label)) {
+ value = dateClusterObj[label];
+ clusterByTimestampUnit.call(this, cacheObj, label, value, dateUnit);
+ }
+ }
+ //re origin time stamp
+ for (label in cacheObj) {
+ if (cacheObj.hasOwnProperty(label)) {
+ value = cacheObj[label];
+ var originTime = value.originTime;
+ delete value.originTime;
+ notNullLabelClusteringObj[originTime] = value;
+ }
+ }
+
+ }
+ }
+ return {
+ notNullLabel: notNullLabelClusteringObj,
+ nullLabel: nullLabelClusteringObj
+ };
+ },
+ /* -------- Deprecated, Only used for Chart Widget StatisticsChart.js --------*/
+
+ //In order to be compatible statistiscChart, do this map
+ _mapOptions: function(options, mode) {
+ var labelField, categoryField;
+ if (mode === 'feature') {
+ labelField = options.labelField;
+ delete options.labelField;
+ options.clusterField = labelField;
+ options.showNullLabelData = true;
+ } else if (mode === 'category') {
+ categoryField = options.categoryField;
+ delete options.categoryField;
+ options.clusterField = categoryField;
+ options.showNullLabelData = true;
+ } else if (mode === 'count') {
+ categoryField = options.categoryField;
+ delete options.categoryField;
+ options.clusterField = categoryField;
+ } else if (mode === 'field') {
+ options.showNullLabelData = true;
+ }
+ return options;
+ },
+
+ //In order to be compatible statistiscChart, do this map
+ _mapDataItemForStatisticsChart: function(data, mode) {
+ var label, values, features;
+ return data.map(function(dataItem) {
+ label = dataItem.label;
+ delete dataItem.label;
+
+ values = dataItem.values;
+ delete dataItem.values;
+
+ features = dataItem.features;
+ delete dataItem.features;
+
+ if (mode === 'feature') {
+ dataItem.category = label; //label -> category
+ dataItem.valueFields = values; //values -> valueFields
+ dataItem.dataFeatures = features; //features -> dataFeatures
+ } else if (mode === 'category') {
+ dataItem.category = label; //label -> category
+ dataItem.valueFields = values; //values -> valueFields
+ dataItem.dataFeatures = features; //features -> dataFeatures
+ } else if (mode === 'count') {
+ dataItem.fieldValue = label; //label -> fieldValue
+ dataItem.count = values[0]; //values -> count
+ dataItem.dataFeatures = features; //features -> dataFeatures
+ } else if (mode === 'field') {
+ dataItem.label = label; //label -> label
+ dataItem.value = values[0]; //values -> value
+ }
+ return dataItem;
+ });
+ },
+
+ //---feature mode---
+ //options: {layerDefinition, features, labelField, valueFields, sortOrder}
+ //return [{category:'a',valueFields:[10,100,2],dataFeatures:[f1]}]
+ getFeatureModeStatisticsInfo: function(options) {
+ var chartHelpUtils = new ChartHelpUtils({
+ featureLayer: options.layerDefinition,
+ popupInfo: options.popupFieldInfosObj
+ });
+ options = this._mapOptions(options, 'feature');
+ var clusterField = options.clusterField;
+ // get statistics data
+ var data = this.getFeatureModeStatisticsData(options);
+ //sort order
+ var sortOrder = options.sortOrder; //{isAsc:boolean,field:''}
+ data = this.sortStatisticsData(data, 'feature', sortOrder, clusterField);
+ //slice data for max labels number
+ var maxLabels = options.maxLabels; //number or undefined
+ data = this.getDataForMaxLabels(data, maxLabels);
+ //Make category value's display more friendly //-- x-Axia display --
+ data = chartHelpUtils.getBestLabelDisplay(data, clusterField, 'feature');
+ // keep best decimal places //-- y-Axia display --
+ data = chartHelpUtils.keepStatisticsDataBestDecimalPlace(options, data, 'feature');
+ return this._mapDataItemForStatisticsChart(data, 'feature');
+ },
+
+ //---category mode---
+ //options: {layerDefinition, features, categoryField, valueFields, operation, sortOrder}
+ //return [{category:'a',valueFields:[10,100,2],dataFeatures:[f1,f2...]}]
+ getCategoryModeStatisticsInfo: function(options) {
+ var chartHelpUtils = new ChartHelpUtils({
+ featureLayer: options.layerDefinition,
+ popupInfo: options.popupFieldInfosObj
+ });
+ options = this._mapOptions(options, 'category');
+ var clusterField = options.clusterField;
+ //get statistics data for category mode
+ var data = this.getCategoryModeStatisticsData(options);
+ //sort order
+ var valueFields = options.valueFields;
+ var sortOrder = options.sortOrder;
+ data = this.sortStatisticsData(data, 'category', sortOrder, null, valueFields);
+ //remove NaN data item
+ data = this._removeNaNDataItem(data);
+ //slice data
+ var maxLabels = options.maxLabels; //number or undefined
+ data = this.getDataForMaxLabels(data, maxLabels);
+ //Make category value's display more friendly //-- x-Axia display --
+ data = chartHelpUtils.getBestLabelDisplay(data, clusterField, 'category');
+ // keep best decimal places //-- y-Axia display --
+ data = chartHelpUtils.keepStatisticsDataBestDecimalPlace(options, data, 'category');
+ return this._mapDataItemForStatisticsChart(data, 'category');
+ },
+ //---count mode---
+ //options: {layerDefinition, features, categoryField, sortOrder, maxLabels ...}
+ //return [{fieldValue:'',count:count1,dataFeatures:[f1,f2...]}]
+ getCountModeStatisticsInfo: function(options) {
+ var chartHelpUtils = new ChartHelpUtils({
+ featureLayer: options.layerDefinition,
+ popupInfo: options.popupFieldInfosObj
+ });
+ options = this._mapOptions(options, 'count');
+ var clusterField = options.clusterField;
+ var data = this.getCountModeStatisticsData(options);
+ //sort order
+ var sortOrder = options.sortOrder;
+ data = this.sortStatisticsData(data, 'count', sortOrder);
+ //slice data
+ var maxLabels = options.maxLabels; //number or undefined
+ data = this.getDataForMaxLabels(data, maxLabels);
+ //Make category value's display more friendly //-- x-Axia display --
+ data = chartHelpUtils.getBestLabelDisplay(data, clusterField, 'count');
+ //Convert data[i],category to 'fieldValue'
+ return this._mapDataItemForStatisticsChart(data, 'count');
+ },
+
+ //---field mode---
+ //options: {layerDefinition, features, valueFields, operation}
+ //return {label:'',value:value2}
+ getFieldModeStatisticsInfo: function(options) {
+ var chartHelpUtils = new ChartHelpUtils({
+ featureLayer: options.layerDefinition,
+ popupInfo: options.popupFieldInfosObj
+ });
+ options = this._mapOptions(options, 'category');
+ var data = this.getFieldModeStatisticsData(options);
+ //sort order
+ var sortOrder = options.sortOrder;
+ data = this.sortStatisticsData(data, 'field', sortOrder);
+ //slice data
+ var maxLabels = options.maxLabels; //number or undefined
+ data = this.getDataForMaxLabels(data, maxLabels);
+ //Make category value's display more friendly //-- x-Axia display --
+ data = chartHelpUtils.getBestLabelDisplay(data, null, 'field');
+ // keep best decimal places //-- y-Axia display --
+ data = chartHelpUtils.keepStatisticsDataBestDecimalPlace(options, data, 'field');
+ //Convert data[i],category to 'label'
+ return this._mapDataItemForStatisticsChart(data, 'field');
+ }
+
+ };
+
+ return mo;
+});
\ No newline at end of file
diff --git a/app/jimu.js/css/ColorPicker.css b/app/jimu.js/css/ColorPicker.css
index 1d29447..50ce12e 100644
--- a/app/jimu.js/css/ColorPicker.css
+++ b/app/jimu.js/css/ColorPicker.css
@@ -1 +1,15 @@
-.dojoxColorPicker {padding:8px; -moz-border-radius:4pt; -webkit-border-radius:5pt; -webkit-drop-shadow:3pt;}.dojoxColorPickerRightPad {padding-right: 8px;}.tundra .dojoxColorPicker {background:#fff; border:1px solid #ccc;}.dojoxColorPickerBox {position:relative; width:150px; height:150px; margin:0; padding:0;}.dojoxColorPickerUnderlay {position:relative; top:0; left:0; width:150px; height:150px; z-index:1;}.tundra .dojoxColorPickerUnderlay {border:1px solid #a0a0a0;}.claro .dojoxColorPicker {background:#fff; border:1px solid #cdcdcd;}.claro .dojoxColorPickerUnderlay {border:1px solid #cccccc;}.dojoxHuePickerUnderlay {position:relative; top:0; left:0; height:150px; width:20px; z-index:1; text-align: center;}.dojoxHuePicker {position:relative; top: 0px; left: 0px; padding: 0px;}.dojoxHuePickerPoint {position:absolute; top:0; left:0; width:20px; height:8px; z-index:3; cursor:move;}.dojoxColorPickerPoint {position:absolute; width:10px; height:10px; border:0; z-index:3; cursor:move;}.dojoxColorPickerPreview {display:block; width:45px; height:45px; border:1px solid #333; background-color:#fff; position:relative; top: 0px; left: 0px;}.dojoxColorPickerWebSafePreview {display:block; width:25px; height:25px; position:relative; top: 0px; left: 0px; border:1px solid #333;}.dojoxColorPickerOptional {position:relative; top: 0px; left: 0px; height: 100%;}.dojoxColorPickerOptional table {border-spacing: 4px;}.dojoxColorPickerPreviewContainer table {border-spacing: 6px 0px;}.dojoxColorPickerOptional input {border:1px solid #a7a7a7; width:25px; padding:1px 3px 1px 3px; line-height:1.1em;}.dojoxColorPickerHex input {width:55px;}
\ No newline at end of file
+.dojoxColorPicker {padding:8px; -moz-border-radius:4pt; -webkit-border-radius:5pt; -webkit-drop-shadow:3pt;}.dojoxColorPickerRightPad {padding-right: 8px;}.tundra .dojoxColorPicker {background:#fff; border:1px solid #ccc;}.dojoxColorPickerBox {position:relative; width:150px; height:150px; margin:0; padding:0;}.dojoxColorPickerUnderlay {position:relative; top:0; left:0; width:150px; height:150px; z-index:1;}.tundra .dojoxColorPickerUnderlay {border:1px solid #a0a0a0;}.claro .dojoxColorPicker {background:#fff; border:1px solid #cdcdcd;}.claro .dojoxColorPickerUnderlay {border:1px solid #cccccc;}.dojoxHuePickerUnderlay {position:relative; top:0; left:0; height:150px; width:20px; z-index:1; text-align: center;}.dojoxHuePicker {position:relative; top: 0px; left: 0px; padding: 0px;}.dojoxHuePickerPoint {position:absolute; top:0; left:0; width:20px; height:8px; z-index:3; cursor:move;}.dojoxColorPickerPoint {position:absolute; width:10px; height:10px; border:0; z-index:3; cursor:move;}.dojoxColorPickerPreview {display:block; width:45px; height:45px; border:1px solid #333; background-color:#fff; position:relative; top: 0px; left: 0px;}.dojoxColorPickerWebSafePreview {display:block; width:25px; height:25px; position:relative; top: 0px; left: 0px; border:1px solid #333;}.dojoxColorPickerOptional {position:relative; top: 0px; left: 0px; height: 100%;}.dojoxColorPickerOptional table {border-spacing: 4px;}.dojoxColorPickerPreviewContainer table {border-spacing: 6px 0px;}.dojoxColorPickerOptional input {border:1px solid #a7a7a7; width:25px; padding:1px 3px 1px 3px; line-height:1.1em;}.dojoxColorPickerHex input {width:55px;}
+
+.dojoxColorPicker .dojoxColorPickerBox .dojoxColorPickerUnderlay {
+ position: relative;
+ top: -2px;
+ left: -1px;
+ margin-top: 2px;
+ width: 151px;
+ height: 151px;
+ z-index: 1;
+}
+.jimu-rtl .dojoxColorPicker .dojoxColorPickerBox .dojoxColorPickerUnderlay {
+ left: auto;
+ right: -1px;
+}
\ No newline at end of file
diff --git a/app/jimu.js/css/clamp.css b/app/jimu.js/css/clamp.css
new file mode 100644
index 0000000..28061f5
--- /dev/null
+++ b/app/jimu.js/css/clamp.css
@@ -0,0 +1,62 @@
+/*
+
+
+PS: style padding should be set in wrapper
+*/
+.jimu-clamp-wrap {
+ height: 44px;
+ line-height: 22px;/*clamp 2 line*/
+ overflow: hidden;
+}
+.jimu-clamp-wrap .clamp {
+ float: right;
+ margin-left: -5px;
+ width: 100%;
+ word-break: break-all;
+}
+.jimu-rtl .jimu-clamp-wrap .clamp {
+ float: left;
+ margin-left: auto;
+ margin-right: -5px;
+}
+.jimu-clamp-wrap::before {
+ float: left;
+ width: 5px;
+ content: '';
+ height: 44px;
+}
+.jimu-rtl .jimu-clamp-wrap::before {
+ float: right;
+}
+.jimu-clamp-wrap::after {
+ position: relative;
+ float: right;
+ text-align: right;
+ content: "...";
+ width: 4em;
+ margin-left: -4em;
+ left: 100%;
+ padding-right: 5px;
+
+ height: 22px;/*line height*/
+ line-height: 22px;
+ top: -22px;
+ /*background: -webkit-gradient(linear, left top, right top, from(rgba(255, 255, 255, 0)), to(white), color-stop(50%, white));
+ background: -moz-linear-gradient(to right, rgba(255, 255, 255, 0), white 50%, white);
+ background: -o-linear-gradient(to right, rgba(255, 255, 255, 0), white 50%, white);
+ background: -ms-linear-gradient(to right, rgba(255, 255, 255, 0), white 50%, white);*/
+ background: linear-gradient(to right, rgba(255, 255, 255, 0), white 65%, white);
+}
+.jimu-rtl .jimu-clamp-wrap::after {
+ float: left;
+ text-align: left;
+ margin-left: auto;
+ margin-right: -4em;
+ left: auto;
+ right: 100%;
+ padding-right: 0;
+ padding-left: 5px;
+ background: linear-gradient(to left, rgba(255, 255, 255, 0), white 65%, white);
+}
\ No newline at end of file
diff --git a/app/jimu.js/css/dojo-override.css b/app/jimu.js/css/dojo-override.css
index ba7ab80..37e0347 100644
--- a/app/jimu.js/css/dojo-override.css
+++ b/app/jimu.js/css/dojo-override.css
@@ -65,6 +65,35 @@
.claro .dijitTextBoxHover{
border-color: #759dc0;
}
+.claro .jimu-list-multiple-select .searchKeyInput .dijitTextBox{
+ height: 25px;
+ border: none;
+ border-bottom: 1px solid #ccc;
+}
+.claro .jimu-list-multiple-select .searchKeyInput .dijitTextBox .dijitInputInner{
+ height: 21px;
+ line-height: 21px !important;
+ font-size: 12px;
+}
+.claro .jimu-list-multiple-select .searchKeyInput .dijitTextBox .dijitPlaceHolder{
+ height: 21px;
+ font-size: 12px;
+}
+.claro .jimu-list-multiple-select .searchKeyInput .dijitTextBox .dijitInputField {
+ font-size: 13px;
+ line-height: 25px;
+ padding: 1px 0;
+}
+.claro .jimu-list-multiple-select .searchKeyInput .dijitTextBoxHover{
+ border-color: #24B5CC;
+ background-color: initial !important;
+ background-image: none;
+}
+.claro .jimu-list-multiple-select .searchKeyInput .dijitTextBoxFocused{
+ border-color: #24B5CC !important;
+ box-shadow: none;
+ background-image: none;
+}
.claro .dijitValidationTextBox .dijitValidationContainer,
.claro .dijitSpinner .dijitSpinnerButtonContainer,
.claro .dijitSpinner .dijitInputContainer
@@ -131,10 +160,78 @@ table.dijitDownArrowButton.dijitSelect.restrict-select-width > tbody > tr > td.d
/* dgrid*/
.jimu-rtl .dgrid-rtl-swap .dgrid-header-row {
- right: 0;
- left: 17px;
+ right: 0;
+ left: 17px;
}
- .jimu-rtl .dgrid-cell {
+.jimu-rtl .dgrid-cell {
border-right-style: none;
border-left: solid 1px #ccc;
- }
\ No newline at end of file
+ text-align: right;
+}
+
+.jimu-rtl .dgrid-sort-arrow {
+ float: left;
+}
+
+ /* radio button */
+.claro .dijitRadio{
+ width: 16px;
+ height: 16px;
+ background-image: url(images/radioBtn_normal.svg);
+ background-repeat: no-repeat;
+ background-position: center;
+ vertical-align: text-bottom;
+}
+.claro .dijitRadio.dijitRadioChecked{
+ background-image: url(images/radioBtn_selected.svg);
+}
+.claro .dijitRadio +.dijitFocusedLabel{
+ outline: none;
+}
+.claro .dijitRadio.dijitDisabled {
+ background-image: url(images/radioBtn_disabled.svg);
+}
+.claro .dijitRadio.dijitDisabled.dijitRadioCheckedDisabled {
+ background-image: url(images/radioBtn_selected_diabled.svg);
+}
+.claro .dijitRadio.dijitDisabled +label{
+ opacity: 0.65;
+ color: #ccc;
+}
+/* checkbox */
+.claro .dijitCheckBox{
+ background-image: url(images/checkbox_default.png);
+ background-repeat: no-repeat;
+ background-position: 0;
+ background-color: transparent;
+ width: 16px;
+ height: 16px;
+ border-radius: 2px;
+ /*cursor: pointer;*/
+}
+.claro .dijitCheckBox.dijitCheckBoxChecked {
+ background-image: url(images/checked_default.png);
+}
+.claro .dijitCheckBox.dijitDisabled{
+ background-image: url(images/checkbox_disabled.png);
+}
+.claro .dijitCheckBox.dijitCheckBoxChecked.dijitDisabled{
+ background-image: url(images/checked_disabled.png);
+}
+.claro .dijitCheckBox +.dijitFocusedLabel{
+ outline: none;
+}
+.claro.jimu-nav-mode .dijitCheckBox.dijitCheckBoxFocused{
+ outline: 2px solid #24B5CC !important;
+}
+/*
+.claro .dijitCheckBox:hover{
+ background-color: #f7f7f7;
+}
+.claro .dijitCheckBox:hover{
+ background-image: url(images/checkbox_hover.png);
+}
+.claro .dijitCheckBox.dijitCheckBoxChecked:hover{
+ background-image: url(images/checked_hover.png);
+}
+*/
diff --git a/app/jimu.js/css/fonts/294099f3-8d00-4676-afc5-5e9d8d43ad69.svg b/app/jimu.js/css/fonts/294099f3-8d00-4676-afc5-5e9d8d43ad69.svg
index 8d04564..1b70d2c 100644
--- a/app/jimu.js/css/fonts/294099f3-8d00-4676-afc5-5e9d8d43ad69.svg
+++ b/app/jimu.js/css/fonts/294099f3-8d00-4676-afc5-5e9d8d43ad69.svg
@@ -1,683 +1 @@
-
-
-
+
\ No newline at end of file
diff --git a/app/jimu.js/css/fonts/731dd4d3-64da-427d-ba61-01575b3cf3f7.svg b/app/jimu.js/css/fonts/731dd4d3-64da-427d-ba61-01575b3cf3f7.svg
index 44c0558..7442c88 100644
--- a/app/jimu.js/css/fonts/731dd4d3-64da-427d-ba61-01575b3cf3f7.svg
+++ b/app/jimu.js/css/fonts/731dd4d3-64da-427d-ba61-01575b3cf3f7.svg
@@ -1,730 +1 @@
-
-
-
+
\ No newline at end of file
diff --git a/app/jimu.js/css/fonts/CalciteWebCoreIcons.svg b/app/jimu.js/css/fonts/CalciteWebCoreIcons.svg
index 43a9fbc..d7847d5 100644
--- a/app/jimu.js/css/fonts/CalciteWebCoreIcons.svg
+++ b/app/jimu.js/css/fonts/CalciteWebCoreIcons.svg
@@ -1,157 +1 @@
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/jimu.js/css/fonts/Themefont.eot b/app/jimu.js/css/fonts/Themefont.eot
new file mode 100644
index 0000000..4ad0a0d
Binary files /dev/null and b/app/jimu.js/css/fonts/Themefont.eot differ
diff --git a/app/jimu.js/css/fonts/Themefont.svg b/app/jimu.js/css/fonts/Themefont.svg
new file mode 100644
index 0000000..7c7a8e6
--- /dev/null
+++ b/app/jimu.js/css/fonts/Themefont.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/jimu.js/css/fonts/Themefont.ttf b/app/jimu.js/css/fonts/Themefont.ttf
new file mode 100644
index 0000000..27037a2
Binary files /dev/null and b/app/jimu.js/css/fonts/Themefont.ttf differ
diff --git a/app/jimu.js/css/fonts/Themefont.woff b/app/jimu.js/css/fonts/Themefont.woff
new file mode 100644
index 0000000..8d49480
Binary files /dev/null and b/app/jimu.js/css/fonts/Themefont.woff differ
diff --git a/app/jimu.js/css/fonts/ca038835-1be3-4dc5-ba25-be1df6121499.svg b/app/jimu.js/css/fonts/ca038835-1be3-4dc5-ba25-be1df6121499.svg
index 3c496dc..521e314 100644
--- a/app/jimu.js/css/fonts/ca038835-1be3-4dc5-ba25-be1df6121499.svg
+++ b/app/jimu.js/css/fonts/ca038835-1be3-4dc5-ba25-be1df6121499.svg
@@ -1,745 +1 @@
-
-
-
+
\ No newline at end of file
diff --git a/app/jimu.js/css/fonts/drawbox.eot b/app/jimu.js/css/fonts/drawbox.eot
new file mode 100644
index 0000000..8c39d17
Binary files /dev/null and b/app/jimu.js/css/fonts/drawbox.eot differ
diff --git a/app/jimu.js/css/fonts/drawbox.svg b/app/jimu.js/css/fonts/drawbox.svg
new file mode 100644
index 0000000..eebd6dc
--- /dev/null
+++ b/app/jimu.js/css/fonts/drawbox.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/jimu.js/css/fonts/drawbox.ttf b/app/jimu.js/css/fonts/drawbox.ttf
new file mode 100644
index 0000000..7c82ad3
Binary files /dev/null and b/app/jimu.js/css/fonts/drawbox.ttf differ
diff --git a/app/jimu.js/css/fonts/drawbox.woff b/app/jimu.js/css/fonts/drawbox.woff
new file mode 100644
index 0000000..b5e1048
Binary files /dev/null and b/app/jimu.js/css/fonts/drawbox.woff differ
diff --git a/app/jimu.js/css/fonts/feature_actions.eot b/app/jimu.js/css/fonts/feature_actions.eot
index 2163ecb..cd234e1 100644
Binary files a/app/jimu.js/css/fonts/feature_actions.eot and b/app/jimu.js/css/fonts/feature_actions.eot differ
diff --git a/app/jimu.js/css/fonts/feature_actions.svg b/app/jimu.js/css/fonts/feature_actions.svg
index cf2f4d7..45e448c 100644
--- a/app/jimu.js/css/fonts/feature_actions.svg
+++ b/app/jimu.js/css/fonts/feature_actions.svg
@@ -1,48 +1 @@
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/jimu.js/css/fonts/feature_actions.ttf b/app/jimu.js/css/fonts/feature_actions.ttf
index 8d878e2..79d37c0 100644
Binary files a/app/jimu.js/css/fonts/feature_actions.ttf and b/app/jimu.js/css/fonts/feature_actions.ttf differ
diff --git a/app/jimu.js/css/fonts/feature_actions.woff b/app/jimu.js/css/fonts/feature_actions.woff
index 7ea1c4f..a9a433c 100644
Binary files a/app/jimu.js/css/fonts/feature_actions.woff and b/app/jimu.js/css/fonts/feature_actions.woff differ
diff --git a/app/jimu.js/css/fonts/wab_2d.svg b/app/jimu.js/css/fonts/wab_2d.svg
index 2b6c633..c47c0a7 100644
--- a/app/jimu.js/css/fonts/wab_2d.svg
+++ b/app/jimu.js/css/fonts/wab_2d.svg
@@ -1,28 +1 @@
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/add.png b/app/jimu.js/css/images/add.png
new file mode 100644
index 0000000..765f4d8
Binary files /dev/null and b/app/jimu.js/css/images/add.png differ
diff --git a/app/jimu.js/css/images/add_default.png b/app/jimu.js/css/images/add_default.png
index 1f4a0be..a6f50d5 100644
Binary files a/app/jimu.js/css/images/add_default.png and b/app/jimu.js/css/images/add_default.png differ
diff --git a/app/jimu.js/css/images/add_disabled.png b/app/jimu.js/css/images/add_disabled.png
index 8e93c5f..d3c23de 100644
Binary files a/app/jimu.js/css/images/add_disabled.png and b/app/jimu.js/css/images/add_disabled.png differ
diff --git a/app/jimu.js/css/images/add_hover.png b/app/jimu.js/css/images/add_hover.png
index 0b780a1..e0f4215 100644
Binary files a/app/jimu.js/css/images/add_hover.png and b/app/jimu.js/css/images/add_hover.png differ
diff --git a/app/jimu.js/css/images/api_popup_light.png b/app/jimu.js/css/images/api_popup_light.png
new file mode 100644
index 0000000..101e5eb
Binary files /dev/null and b/app/jimu.js/css/images/api_popup_light.png differ
diff --git a/app/jimu.js/css/images/arrow-back-black_hover.svg b/app/jimu.js/css/images/arrow-back-black_hover.svg
new file mode 100644
index 0000000..6fe1074
--- /dev/null
+++ b/app/jimu.js/css/images/arrow-back-black_hover.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/arrow-back-black_normal.svg b/app/jimu.js/css/images/arrow-back-black_normal.svg
new file mode 100644
index 0000000..381b361
--- /dev/null
+++ b/app/jimu.js/css/images/arrow-back-black_normal.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/black_close_default.png b/app/jimu.js/css/images/black_close_default.png
index 91ac64a..0685e06 100644
Binary files a/app/jimu.js/css/images/black_close_default.png and b/app/jimu.js/css/images/black_close_default.png differ
diff --git a/app/jimu.js/css/images/chart/bar.png b/app/jimu.js/css/images/chart/bar.png
new file mode 100644
index 0000000..0763201
Binary files /dev/null and b/app/jimu.js/css/images/chart/bar.png differ
diff --git a/app/jimu.js/css/images/chart/c0.png b/app/jimu.js/css/images/chart/c0.png
new file mode 100644
index 0000000..d9ca6d4
Binary files /dev/null and b/app/jimu.js/css/images/chart/c0.png differ
diff --git a/app/jimu.js/css/images/chart/c1.png b/app/jimu.js/css/images/chart/c1.png
new file mode 100644
index 0000000..4532e81
Binary files /dev/null and b/app/jimu.js/css/images/chart/c1.png differ
diff --git a/app/jimu.js/css/images/chart/c2.png b/app/jimu.js/css/images/chart/c2.png
new file mode 100644
index 0000000..c8b0577
Binary files /dev/null and b/app/jimu.js/css/images/chart/c2.png differ
diff --git a/app/jimu.js/css/images/chart/c3.png b/app/jimu.js/css/images/chart/c3.png
new file mode 100644
index 0000000..59f921e
Binary files /dev/null and b/app/jimu.js/css/images/chart/c3.png differ
diff --git a/app/jimu.js/css/images/chart/c4.png b/app/jimu.js/css/images/chart/c4.png
new file mode 100644
index 0000000..10fcf30
Binary files /dev/null and b/app/jimu.js/css/images/chart/c4.png differ
diff --git a/app/jimu.js/css/images/chart/column.png b/app/jimu.js/css/images/chart/column.png
new file mode 100644
index 0000000..5f49b6e
Binary files /dev/null and b/app/jimu.js/css/images/chart/column.png differ
diff --git a/app/jimu.js/css/images/chart/disabled.png b/app/jimu.js/css/images/chart/disabled.png
new file mode 100644
index 0000000..5c377aa
Binary files /dev/null and b/app/jimu.js/css/images/chart/disabled.png differ
diff --git a/app/jimu.js/css/images/chart/g1.png b/app/jimu.js/css/images/chart/g1.png
new file mode 100644
index 0000000..31adfe0
Binary files /dev/null and b/app/jimu.js/css/images/chart/g1.png differ
diff --git a/app/jimu.js/css/images/chart/g10.png b/app/jimu.js/css/images/chart/g10.png
new file mode 100644
index 0000000..a085ade
Binary files /dev/null and b/app/jimu.js/css/images/chart/g10.png differ
diff --git a/app/jimu.js/css/images/chart/g11.png b/app/jimu.js/css/images/chart/g11.png
new file mode 100644
index 0000000..ba127ab
Binary files /dev/null and b/app/jimu.js/css/images/chart/g11.png differ
diff --git a/app/jimu.js/css/images/chart/g12.png b/app/jimu.js/css/images/chart/g12.png
new file mode 100644
index 0000000..2069d36
Binary files /dev/null and b/app/jimu.js/css/images/chart/g12.png differ
diff --git a/app/jimu.js/css/images/chart/g2.png b/app/jimu.js/css/images/chart/g2.png
new file mode 100644
index 0000000..365e582
Binary files /dev/null and b/app/jimu.js/css/images/chart/g2.png differ
diff --git a/app/jimu.js/css/images/chart/g3.png b/app/jimu.js/css/images/chart/g3.png
new file mode 100644
index 0000000..96e8c67
Binary files /dev/null and b/app/jimu.js/css/images/chart/g3.png differ
diff --git a/app/jimu.js/css/images/chart/g4.png b/app/jimu.js/css/images/chart/g4.png
new file mode 100644
index 0000000..2a9b3e2
Binary files /dev/null and b/app/jimu.js/css/images/chart/g4.png differ
diff --git a/app/jimu.js/css/images/chart/g5.png b/app/jimu.js/css/images/chart/g5.png
new file mode 100644
index 0000000..dfda910
Binary files /dev/null and b/app/jimu.js/css/images/chart/g5.png differ
diff --git a/app/jimu.js/css/images/chart/g6.png b/app/jimu.js/css/images/chart/g6.png
new file mode 100644
index 0000000..0b61e61
Binary files /dev/null and b/app/jimu.js/css/images/chart/g6.png differ
diff --git a/app/jimu.js/css/images/chart/g7.png b/app/jimu.js/css/images/chart/g7.png
new file mode 100644
index 0000000..992a431
Binary files /dev/null and b/app/jimu.js/css/images/chart/g7.png differ
diff --git a/app/jimu.js/css/images/chart/g8.png b/app/jimu.js/css/images/chart/g8.png
new file mode 100644
index 0000000..53695fb
Binary files /dev/null and b/app/jimu.js/css/images/chart/g8.png differ
diff --git a/app/jimu.js/css/images/chart/g9.png b/app/jimu.js/css/images/chart/g9.png
new file mode 100644
index 0000000..0ad4a4a
Binary files /dev/null and b/app/jimu.js/css/images/chart/g9.png differ
diff --git a/app/jimu.js/css/images/chart/left_indicator.svg b/app/jimu.js/css/images/chart/left_indicator.svg
new file mode 100644
index 0000000..6839c26
--- /dev/null
+++ b/app/jimu.js/css/images/chart/left_indicator.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/chart/left_indicator_rtl.svg b/app/jimu.js/css/images/chart/left_indicator_rtl.svg
new file mode 100644
index 0000000..e0c1bb0
--- /dev/null
+++ b/app/jimu.js/css/images/chart/left_indicator_rtl.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/chart/line.png b/app/jimu.js/css/images/chart/line.png
new file mode 100644
index 0000000..4560c4a
Binary files /dev/null and b/app/jimu.js/css/images/chart/line.png differ
diff --git a/app/jimu.js/css/images/chart/pie.png b/app/jimu.js/css/images/chart/pie.png
new file mode 100644
index 0000000..c3b57a7
Binary files /dev/null and b/app/jimu.js/css/images/chart/pie.png differ
diff --git a/app/jimu.js/css/images/chart/top_indicator.svg b/app/jimu.js/css/images/chart/top_indicator.svg
new file mode 100644
index 0000000..aff3102
--- /dev/null
+++ b/app/jimu.js/css/images/chart/top_indicator.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/checkbox_default.png b/app/jimu.js/css/images/checkbox_default.png
index e6cdf4c..c11920a 100644
Binary files a/app/jimu.js/css/images/checkbox_default.png and b/app/jimu.js/css/images/checkbox_default.png differ
diff --git a/app/jimu.js/css/images/checkbox_disabled.png b/app/jimu.js/css/images/checkbox_disabled.png
index 05ed700..7156df6 100644
Binary files a/app/jimu.js/css/images/checkbox_disabled.png and b/app/jimu.js/css/images/checkbox_disabled.png differ
diff --git a/app/jimu.js/css/images/checkbox_hover.png b/app/jimu.js/css/images/checkbox_hover.png
index ccbd739..c11920a 100644
Binary files a/app/jimu.js/css/images/checkbox_hover.png and b/app/jimu.js/css/images/checkbox_hover.png differ
diff --git a/app/jimu.js/css/images/checked_default.png b/app/jimu.js/css/images/checked_default.png
index 69dea96..a961f55 100644
Binary files a/app/jimu.js/css/images/checked_default.png and b/app/jimu.js/css/images/checked_default.png differ
diff --git a/app/jimu.js/css/images/checked_disabled.png b/app/jimu.js/css/images/checked_disabled.png
index cac4eab..d3330a8 100644
Binary files a/app/jimu.js/css/images/checked_disabled.png and b/app/jimu.js/css/images/checked_disabled.png differ
diff --git a/app/jimu.js/css/images/checked_hover.png b/app/jimu.js/css/images/checked_hover.png
index 5cbe272..a961f55 100644
Binary files a/app/jimu.js/css/images/checked_hover.png and b/app/jimu.js/css/images/checked_hover.png differ
diff --git a/app/jimu.js/css/images/clearAllSelectedHover.svg b/app/jimu.js/css/images/clearAllSelectedHover.svg
new file mode 100644
index 0000000..b5c81f0
--- /dev/null
+++ b/app/jimu.js/css/images/clearAllSelectedHover.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/clearAllSelectedNormal.svg b/app/jimu.js/css/images/clearAllSelectedNormal.svg
new file mode 100644
index 0000000..b801283
--- /dev/null
+++ b/app/jimu.js/css/images/clearAllSelectedNormal.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/close_8_default.png b/app/jimu.js/css/images/close_8_default.png
index e0b735a..fee1c9b 100644
Binary files a/app/jimu.js/css/images/close_8_default.png and b/app/jimu.js/css/images/close_8_default.png differ
diff --git a/app/jimu.js/css/images/close_8_hover.png b/app/jimu.js/css/images/close_8_hover.png
index 99470f5..1f8e34e 100644
Binary files a/app/jimu.js/css/images/close_8_hover.png and b/app/jimu.js/css/images/close_8_hover.png differ
diff --git a/app/jimu.js/css/images/close_btn_bg.svg b/app/jimu.js/css/images/close_btn_bg.svg
new file mode 100644
index 0000000..8de1a7b
--- /dev/null
+++ b/app/jimu.js/css/images/close_btn_bg.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/close_btn_gray.svg b/app/jimu.js/css/images/close_btn_gray.svg
new file mode 100644
index 0000000..2b53845
--- /dev/null
+++ b/app/jimu.js/css/images/close_btn_gray.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/close_default.png b/app/jimu.js/css/images/close_default.png
index 212d314..cdcada8 100644
Binary files a/app/jimu.js/css/images/close_default.png and b/app/jimu.js/css/images/close_default.png differ
diff --git a/app/jimu.js/css/images/close_hover.png b/app/jimu.js/css/images/close_hover.png
index 84ca8bc..ef9d8a8 100644
Binary files a/app/jimu.js/css/images/close_hover.png and b/app/jimu.js/css/images/close_hover.png differ
diff --git a/app/jimu.js/css/images/coordinateControl/arrow-down_black.png b/app/jimu.js/css/images/coordinateControl/arrow-down_black.png
new file mode 100644
index 0000000..61487f2
Binary files /dev/null and b/app/jimu.js/css/images/coordinateControl/arrow-down_black.png differ
diff --git a/app/jimu.js/css/images/coordinateControl/arrow-down_black_hover.png b/app/jimu.js/css/images/coordinateControl/arrow-down_black_hover.png
new file mode 100644
index 0000000..f77835c
Binary files /dev/null and b/app/jimu.js/css/images/coordinateControl/arrow-down_black_hover.png differ
diff --git a/app/jimu.js/css/images/coordinateControl/arrow-right_black.png b/app/jimu.js/css/images/coordinateControl/arrow-right_black.png
new file mode 100644
index 0000000..2fad29c
Binary files /dev/null and b/app/jimu.js/css/images/coordinateControl/arrow-right_black.png differ
diff --git a/app/jimu.js/css/images/coordinateControl/arrow-right_black_hover.png b/app/jimu.js/css/images/coordinateControl/arrow-right_black_hover.png
new file mode 100644
index 0000000..8548c64
Binary files /dev/null and b/app/jimu.js/css/images/coordinateControl/arrow-right_black_hover.png differ
diff --git a/app/jimu.js/css/images/coordinateControl/copy_black.png b/app/jimu.js/css/images/coordinateControl/copy_black.png
new file mode 100644
index 0000000..d42429b
Binary files /dev/null and b/app/jimu.js/css/images/coordinateControl/copy_black.png differ
diff --git a/app/jimu.js/css/images/coordinateControl/copy_black_hover.png b/app/jimu.js/css/images/coordinateControl/copy_black_hover.png
new file mode 100644
index 0000000..8452e87
Binary files /dev/null and b/app/jimu.js/css/images/coordinateControl/copy_black_hover.png differ
diff --git a/app/jimu.js/css/images/coordinateControl/draw_black.png b/app/jimu.js/css/images/coordinateControl/draw_black.png
new file mode 100644
index 0000000..a27d867
Binary files /dev/null and b/app/jimu.js/css/images/coordinateControl/draw_black.png differ
diff --git a/app/jimu.js/css/images/coordinateControl/draw_black_hover.png b/app/jimu.js/css/images/coordinateControl/draw_black_hover.png
new file mode 100644
index 0000000..1381216
Binary files /dev/null and b/app/jimu.js/css/images/coordinateControl/draw_black_hover.png differ
diff --git a/app/jimu.js/css/images/coordinateControl/settings_black.png b/app/jimu.js/css/images/coordinateControl/settings_black.png
new file mode 100644
index 0000000..f699590
Binary files /dev/null and b/app/jimu.js/css/images/coordinateControl/settings_black.png differ
diff --git a/app/jimu.js/css/images/coordinateControl/settings_black_hover.png b/app/jimu.js/css/images/coordinateControl/settings_black_hover.png
new file mode 100644
index 0000000..589401e
Binary files /dev/null and b/app/jimu.js/css/images/coordinateControl/settings_black_hover.png differ
diff --git a/app/jimu.js/css/images/coordinateControl/zoom_to_black.png b/app/jimu.js/css/images/coordinateControl/zoom_to_black.png
new file mode 100644
index 0000000..9ef18b1
Binary files /dev/null and b/app/jimu.js/css/images/coordinateControl/zoom_to_black.png differ
diff --git a/app/jimu.js/css/images/coordinateControl/zoom_to_black_hover.png b/app/jimu.js/css/images/coordinateControl/zoom_to_black_hover.png
new file mode 100644
index 0000000..e42b8ed
Binary files /dev/null and b/app/jimu.js/css/images/coordinateControl/zoom_to_black_hover.png differ
diff --git a/app/jimu.js/css/images/custom.svg b/app/jimu.js/css/images/custom.svg
index 83907bb..4838b8f 100644
--- a/app/jimu.js/css/images/custom.svg
+++ b/app/jimu.js/css/images/custom.svg
@@ -1,23 +1 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/delete_default.png b/app/jimu.js/css/images/delete_default.png
index ce58a64..22cfef7 100644
Binary files a/app/jimu.js/css/images/delete_default.png and b/app/jimu.js/css/images/delete_default.png differ
diff --git a/app/jimu.js/css/images/delete_disabled.png b/app/jimu.js/css/images/delete_disabled.png
index 0ff499b..6088db7 100644
Binary files a/app/jimu.js/css/images/delete_disabled.png and b/app/jimu.js/css/images/delete_disabled.png differ
diff --git a/app/jimu.js/css/images/delete_hover.png b/app/jimu.js/css/images/delete_hover.png
index a9390fc..0135fb8 100644
Binary files a/app/jimu.js/css/images/delete_hover.png and b/app/jimu.js/css/images/delete_hover.png differ
diff --git a/app/jimu.js/css/images/depressed.png b/app/jimu.js/css/images/depressed.png
index 63b794f..dd7c2ed 100644
Binary files a/app/jimu.js/css/images/depressed.png and b/app/jimu.js/css/images/depressed.png differ
diff --git a/app/jimu.js/css/images/details_hover.svg b/app/jimu.js/css/images/details_hover.svg
index 102abfc..18dd1a1 100644
--- a/app/jimu.js/css/images/details_hover.svg
+++ b/app/jimu.js/css/images/details_hover.svg
@@ -1,17 +1 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/details_normal.svg b/app/jimu.js/css/images/details_normal.svg
index 3dc27e6..81b8d2a 100644
--- a/app/jimu.js/css/images/details_normal.svg
+++ b/app/jimu.js/css/images/details_normal.svg
@@ -1,17 +1 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/details_rtl_hover.svg b/app/jimu.js/css/images/details_rtl_hover.svg
index 56ff7bd..7948c78 100644
--- a/app/jimu.js/css/images/details_rtl_hover.svg
+++ b/app/jimu.js/css/images/details_rtl_hover.svg
@@ -1,17 +1 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/details_rtl_normal.svg b/app/jimu.js/css/images/details_rtl_normal.svg
index 7450f7e..957e524 100644
--- a/app/jimu.js/css/images/details_rtl_normal.svg
+++ b/app/jimu.js/css/images/details_rtl_normal.svg
@@ -1,17 +1 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/done_black.svg b/app/jimu.js/css/images/done_black.svg
new file mode 100644
index 0000000..41030ab
--- /dev/null
+++ b/app/jimu.js/css/images/done_black.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/dot1.png b/app/jimu.js/css/images/dot1.png
new file mode 100644
index 0000000..42ecbb8
Binary files /dev/null and b/app/jimu.js/css/images/dot1.png differ
diff --git a/app/jimu.js/css/images/dot2.png b/app/jimu.js/css/images/dot2.png
new file mode 100644
index 0000000..98e0c24
Binary files /dev/null and b/app/jimu.js/css/images/dot2.png differ
diff --git a/app/jimu.js/css/images/down_arrow_8_default.png b/app/jimu.js/css/images/down_arrow_8_default.png
index c31502f..f81da08 100644
Binary files a/app/jimu.js/css/images/down_arrow_8_default.png and b/app/jimu.js/css/images/down_arrow_8_default.png differ
diff --git a/app/jimu.js/css/images/down_arrow_8_hover.png b/app/jimu.js/css/images/down_arrow_8_hover.png
index a3e3af0..0f9ffca 100644
Binary files a/app/jimu.js/css/images/down_arrow_8_hover.png and b/app/jimu.js/css/images/down_arrow_8_hover.png differ
diff --git a/app/jimu.js/css/images/down_default.png b/app/jimu.js/css/images/down_default.png
index 90195dc..0d058fb 100644
Binary files a/app/jimu.js/css/images/down_default.png and b/app/jimu.js/css/images/down_default.png differ
diff --git a/app/jimu.js/css/images/down_disabled.png b/app/jimu.js/css/images/down_disabled.png
index aa7f37b..eaf3e32 100644
Binary files a/app/jimu.js/css/images/down_disabled.png and b/app/jimu.js/css/images/down_disabled.png differ
diff --git a/app/jimu.js/css/images/down_hover.png b/app/jimu.js/css/images/down_hover.png
index 1baf1d8..3465c1f 100644
Binary files a/app/jimu.js/css/images/down_hover.png and b/app/jimu.js/css/images/down_hover.png differ
diff --git a/app/jimu.js/css/images/draw_circle.png b/app/jimu.js/css/images/draw_circle.png
index 9d3cef7..f5e3ea6 100644
Binary files a/app/jimu.js/css/images/draw_circle.png and b/app/jimu.js/css/images/draw_circle.png differ
diff --git a/app/jimu.js/css/images/draw_ellipse.png b/app/jimu.js/css/images/draw_ellipse.png
index 6b2f5ac..722848b 100644
Binary files a/app/jimu.js/css/images/draw_ellipse.png and b/app/jimu.js/css/images/draw_ellipse.png differ
diff --git a/app/jimu.js/css/images/draw_extent.png b/app/jimu.js/css/images/draw_extent.png
index eeb8e45..505176e 100644
Binary files a/app/jimu.js/css/images/draw_extent.png and b/app/jimu.js/css/images/draw_extent.png differ
diff --git a/app/jimu.js/css/images/draw_freehand_polygon.png b/app/jimu.js/css/images/draw_freehand_polygon.png
index 04df9cd..c614f90 100644
Binary files a/app/jimu.js/css/images/draw_freehand_polygon.png and b/app/jimu.js/css/images/draw_freehand_polygon.png differ
diff --git a/app/jimu.js/css/images/draw_freehand_polyline.png b/app/jimu.js/css/images/draw_freehand_polyline.png
index f318747..52743e2 100644
Binary files a/app/jimu.js/css/images/draw_freehand_polyline.png and b/app/jimu.js/css/images/draw_freehand_polyline.png differ
diff --git a/app/jimu.js/css/images/draw_line.png b/app/jimu.js/css/images/draw_line.png
index c9c6816..268d9b9 100644
Binary files a/app/jimu.js/css/images/draw_line.png and b/app/jimu.js/css/images/draw_line.png differ
diff --git a/app/jimu.js/css/images/draw_point.png b/app/jimu.js/css/images/draw_point.png
index 63290d7..1ddc0d0 100644
Binary files a/app/jimu.js/css/images/draw_point.png and b/app/jimu.js/css/images/draw_point.png differ
diff --git a/app/jimu.js/css/images/draw_polygon.png b/app/jimu.js/css/images/draw_polygon.png
index ebf3e3f..67dbe12 100644
Binary files a/app/jimu.js/css/images/draw_polygon.png and b/app/jimu.js/css/images/draw_polygon.png differ
diff --git a/app/jimu.js/css/images/draw_polyline.png b/app/jimu.js/css/images/draw_polyline.png
index 023ab86..1f776ab 100644
Binary files a/app/jimu.js/css/images/draw_polyline.png and b/app/jimu.js/css/images/draw_polyline.png differ
diff --git a/app/jimu.js/css/images/draw_text.png b/app/jimu.js/css/images/draw_text.png
index dcf9b03..8fd0f88 100644
Binary files a/app/jimu.js/css/images/draw_text.png and b/app/jimu.js/css/images/draw_text.png differ
diff --git a/app/jimu.js/css/images/draw_triangle.png b/app/jimu.js/css/images/draw_triangle.png
index 7a42d95..3398c63 100644
Binary files a/app/jimu.js/css/images/draw_triangle.png and b/app/jimu.js/css/images/draw_triangle.png differ
diff --git a/app/jimu.js/css/images/dropdown.svg b/app/jimu.js/css/images/dropdown.svg
index 3e492a3..0c52a60 100644
--- a/app/jimu.js/css/images/dropdown.svg
+++ b/app/jimu.js/css/images/dropdown.svg
@@ -1,22 +1 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/dropdown_hover.svg b/app/jimu.js/css/images/dropdown_hover.svg
index 0ebe81a..44afa0b 100644
--- a/app/jimu.js/css/images/dropdown_hover.svg
+++ b/app/jimu.js/css/images/dropdown_hover.svg
@@ -1,22 +1 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/edit_default.png b/app/jimu.js/css/images/edit_default.png
index 9a9fb99..b711bac 100644
Binary files a/app/jimu.js/css/images/edit_default.png and b/app/jimu.js/css/images/edit_default.png differ
diff --git a/app/jimu.js/css/images/edit_disabled.png b/app/jimu.js/css/images/edit_disabled.png
index 1945f72..297e933 100644
Binary files a/app/jimu.js/css/images/edit_disabled.png and b/app/jimu.js/css/images/edit_disabled.png differ
diff --git a/app/jimu.js/css/images/edit_hover.png b/app/jimu.js/css/images/edit_hover.png
index fd19179..0e0ee51 100644
Binary files a/app/jimu.js/css/images/edit_hover.png and b/app/jimu.js/css/images/edit_hover.png differ
diff --git a/app/jimu.js/css/images/error_default.png b/app/jimu.js/css/images/error_default.png
index cfb1feb..caba77d 100644
Binary files a/app/jimu.js/css/images/error_default.png and b/app/jimu.js/css/images/error_default.png differ
diff --git a/app/jimu.js/css/images/filter/delete_hover.png b/app/jimu.js/css/images/filter/delete_hover.png
new file mode 100644
index 0000000..69d8fa5
Binary files /dev/null and b/app/jimu.js/css/images/filter/delete_hover.png differ
diff --git a/app/jimu.js/css/images/filter/delete_normal.png b/app/jimu.js/css/images/filter/delete_normal.png
new file mode 100644
index 0000000..c61a7bf
Binary files /dev/null and b/app/jimu.js/css/images/filter/delete_normal.png differ
diff --git a/app/jimu.js/css/images/filter/down_hover.png b/app/jimu.js/css/images/filter/down_hover.png
new file mode 100644
index 0000000..460bc55
Binary files /dev/null and b/app/jimu.js/css/images/filter/down_hover.png differ
diff --git a/app/jimu.js/css/images/filter/down_normal.png b/app/jimu.js/css/images/filter/down_normal.png
new file mode 100644
index 0000000..67b4772
Binary files /dev/null and b/app/jimu.js/css/images/filter/down_normal.png differ
diff --git a/app/jimu.js/css/images/filter/up_hover.png b/app/jimu.js/css/images/filter/up_hover.png
new file mode 100644
index 0000000..fa93cd8
Binary files /dev/null and b/app/jimu.js/css/images/filter/up_hover.png differ
diff --git a/app/jimu.js/css/images/filter/up_normal.png b/app/jimu.js/css/images/filter/up_normal.png
new file mode 100644
index 0000000..856441d
Binary files /dev/null and b/app/jimu.js/css/images/filter/up_normal.png differ
diff --git a/app/jimu.js/css/images/fold_down.png b/app/jimu.js/css/images/fold_down.png
index fb51e19..7555be3 100644
Binary files a/app/jimu.js/css/images/fold_down.png and b/app/jimu.js/css/images/fold_down.png differ
diff --git a/app/jimu.js/css/images/fold_up.png b/app/jimu.js/css/images/fold_up.png
index b31c849..1109f91 100644
Binary files a/app/jimu.js/css/images/fold_up.png and b/app/jimu.js/css/images/fold_up.png differ
diff --git a/app/jimu.js/css/images/folder_close_default.png b/app/jimu.js/css/images/folder_close_default.png
index b1a2f36..190efc5 100644
Binary files a/app/jimu.js/css/images/folder_close_default.png and b/app/jimu.js/css/images/folder_close_default.png differ
diff --git a/app/jimu.js/css/images/folder_close_hover.png b/app/jimu.js/css/images/folder_close_hover.png
index f9133be..70636ae 100644
Binary files a/app/jimu.js/css/images/folder_close_hover.png and b/app/jimu.js/css/images/folder_close_hover.png differ
diff --git a/app/jimu.js/css/images/folder_open_default.png b/app/jimu.js/css/images/folder_open_default.png
index 94d178f..ea76e0f 100644
Binary files a/app/jimu.js/css/images/folder_open_default.png and b/app/jimu.js/css/images/folder_open_default.png differ
diff --git a/app/jimu.js/css/images/folder_open_hover.png b/app/jimu.js/css/images/folder_open_hover.png
index 75ac7b6..c0491a0 100644
Binary files a/app/jimu.js/css/images/folder_open_hover.png and b/app/jimu.js/css/images/folder_open_hover.png differ
diff --git a/app/jimu.js/css/images/grey_pin.png b/app/jimu.js/css/images/grey_pin.png
index 39ec04e..b3bf8a3 100644
Binary files a/app/jimu.js/css/images/grey_pin.png and b/app/jimu.js/css/images/grey_pin.png differ
diff --git a/app/jimu.js/css/images/group_layer1.png b/app/jimu.js/css/images/group_layer1.png
index b9cbde7..9e8171f 100644
Binary files a/app/jimu.js/css/images/group_layer1.png and b/app/jimu.js/css/images/group_layer1.png differ
diff --git a/app/jimu.js/css/images/group_layer2.png b/app/jimu.js/css/images/group_layer2.png
index d412752..5139bcf 100644
Binary files a/app/jimu.js/css/images/group_layer2.png and b/app/jimu.js/css/images/group_layer2.png differ
diff --git a/app/jimu.js/css/images/image_layer.png b/app/jimu.js/css/images/image_layer.png
index 83f9028..c59cae4 100644
Binary files a/app/jimu.js/css/images/image_layer.png and b/app/jimu.js/css/images/image_layer.png differ
diff --git a/app/jimu.js/css/images/left_arrow_8_default.png b/app/jimu.js/css/images/left_arrow_8_default.png
new file mode 100644
index 0000000..6e6db3b
Binary files /dev/null and b/app/jimu.js/css/images/left_arrow_8_default.png differ
diff --git a/app/jimu.js/css/images/line_layer1.png b/app/jimu.js/css/images/line_layer1.png
index eec8ea6..f52611e 100644
Binary files a/app/jimu.js/css/images/line_layer1.png and b/app/jimu.js/css/images/line_layer1.png differ
diff --git a/app/jimu.js/css/images/line_layer2.png b/app/jimu.js/css/images/line_layer2.png
index 097ebfb..0bf8ad6 100644
Binary files a/app/jimu.js/css/images/line_layer2.png and b/app/jimu.js/css/images/line_layer2.png differ
diff --git a/app/jimu.js/css/images/loadingmap.gif b/app/jimu.js/css/images/loadingmap.gif
index 6a41e6e..a387900 100644
Binary files a/app/jimu.js/css/images/loadingmap.gif and b/app/jimu.js/css/images/loadingmap.gif differ
diff --git a/app/jimu.js/css/images/mapserver_close.png b/app/jimu.js/css/images/mapserver_close.png
index 4c40fce..56af996 100644
Binary files a/app/jimu.js/css/images/mapserver_close.png and b/app/jimu.js/css/images/mapserver_close.png differ
diff --git a/app/jimu.js/css/images/max.png b/app/jimu.js/css/images/max.png
index 1c38251..d0befb4 100644
Binary files a/app/jimu.js/css/images/max.png and b/app/jimu.js/css/images/max.png differ
diff --git a/app/jimu.js/css/images/menu.svg b/app/jimu.js/css/images/menu.svg
new file mode 100644
index 0000000..57451ae
--- /dev/null
+++ b/app/jimu.js/css/images/menu.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/more_disabled.svg b/app/jimu.js/css/images/more_disabled.svg
index 963cc07..77ac838 100644
--- a/app/jimu.js/css/images/more_disabled.svg
+++ b/app/jimu.js/css/images/more_disabled.svg
@@ -1,14 +1 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/more_hover.svg b/app/jimu.js/css/images/more_hover.svg
index 524dc48..8727e73 100644
--- a/app/jimu.js/css/images/more_hover.svg
+++ b/app/jimu.js/css/images/more_hover.svg
@@ -1,14 +1 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/more_normal.svg b/app/jimu.js/css/images/more_normal.svg
index 8064920..8c3b4f9 100644
--- a/app/jimu.js/css/images/more_normal.svg
+++ b/app/jimu.js/css/images/more_normal.svg
@@ -1,14 +1 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/point_layer1.png b/app/jimu.js/css/images/point_layer1.png
index 8c76524..1629665 100644
Binary files a/app/jimu.js/css/images/point_layer1.png and b/app/jimu.js/css/images/point_layer1.png differ
diff --git a/app/jimu.js/css/images/point_layer2.png b/app/jimu.js/css/images/point_layer2.png
index 144c82a..4c689e4 100644
Binary files a/app/jimu.js/css/images/point_layer2.png and b/app/jimu.js/css/images/point_layer2.png differ
diff --git a/app/jimu.js/css/images/polygon_layer1.png b/app/jimu.js/css/images/polygon_layer1.png
index 9afa160..443fbad 100644
Binary files a/app/jimu.js/css/images/polygon_layer1.png and b/app/jimu.js/css/images/polygon_layer1.png differ
diff --git a/app/jimu.js/css/images/polygon_layer2.png b/app/jimu.js/css/images/polygon_layer2.png
index e0e05d2..ba7534f 100644
Binary files a/app/jimu.js/css/images/polygon_layer2.png and b/app/jimu.js/css/images/polygon_layer2.png differ
diff --git a/app/jimu.js/css/images/radioBtn_disabled.svg b/app/jimu.js/css/images/radioBtn_disabled.svg
new file mode 100644
index 0000000..9002d37
--- /dev/null
+++ b/app/jimu.js/css/images/radioBtn_disabled.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/radioBtn_normal.svg b/app/jimu.js/css/images/radioBtn_normal.svg
new file mode 100644
index 0000000..2c61d49
--- /dev/null
+++ b/app/jimu.js/css/images/radioBtn_normal.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/radioBtn_selected.svg b/app/jimu.js/css/images/radioBtn_selected.svg
new file mode 100644
index 0000000..ca1870f
--- /dev/null
+++ b/app/jimu.js/css/images/radioBtn_selected.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/radioBtn_selected_diabled.svg b/app/jimu.js/css/images/radioBtn_selected_diabled.svg
new file mode 100644
index 0000000..a4bead9
--- /dev/null
+++ b/app/jimu.js/css/images/radioBtn_selected_diabled.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/right_arrow_8_default.png b/app/jimu.js/css/images/right_arrow_8_default.png
index 62cb88a..13ab1bf 100644
Binary files a/app/jimu.js/css/images/right_arrow_8_default.png and b/app/jimu.js/css/images/right_arrow_8_default.png differ
diff --git a/app/jimu.js/css/images/right_arrow_8_hover.png b/app/jimu.js/css/images/right_arrow_8_hover.png
index 03ecd49..33cc339 100644
Binary files a/app/jimu.js/css/images/right_arrow_8_hover.png and b/app/jimu.js/css/images/right_arrow_8_hover.png differ
diff --git a/app/jimu.js/css/images/rubbish_bin.png b/app/jimu.js/css/images/rubbish_bin.png
index 352499c..9e35e82 100644
Binary files a/app/jimu.js/css/images/rubbish_bin.png and b/app/jimu.js/css/images/rubbish_bin.png differ
diff --git a/app/jimu.js/css/images/rubbish_bin_white.png b/app/jimu.js/css/images/rubbish_bin_white.png
index b8964d5..ed719fa 100644
Binary files a/app/jimu.js/css/images/rubbish_bin_white.png and b/app/jimu.js/css/images/rubbish_bin_white.png differ
diff --git a/app/jimu.js/css/images/search_default.png b/app/jimu.js/css/images/search_default.png
index 706c8d2..7be5f8a 100644
Binary files a/app/jimu.js/css/images/search_default.png and b/app/jimu.js/css/images/search_default.png differ
diff --git a/app/jimu.js/css/images/search_disabled.png b/app/jimu.js/css/images/search_disabled.png
index c375a41..f2c3cfe 100644
Binary files a/app/jimu.js/css/images/search_disabled.png and b/app/jimu.js/css/images/search_disabled.png differ
diff --git a/app/jimu.js/css/images/search_hover.png b/app/jimu.js/css/images/search_hover.png
index 1124935..13e2cc6 100644
Binary files a/app/jimu.js/css/images/search_hover.png and b/app/jimu.js/css/images/search_hover.png differ
diff --git a/app/jimu.js/css/images/select_circle.png b/app/jimu.js/css/images/select_circle.png
index 87f9795..2aae292 100644
Binary files a/app/jimu.js/css/images/select_circle.png and b/app/jimu.js/css/images/select_circle.png differ
diff --git a/app/jimu.js/css/images/select_features.png b/app/jimu.js/css/images/select_features.png
index 4fed438..0244f50 100644
Binary files a/app/jimu.js/css/images/select_features.png and b/app/jimu.js/css/images/select_features.png differ
diff --git a/app/jimu.js/css/images/select_polygon.png b/app/jimu.js/css/images/select_polygon.png
index 9eb247b..dcb2a41 100644
Binary files a/app/jimu.js/css/images/select_polygon.png and b/app/jimu.js/css/images/select_polygon.png differ
diff --git a/app/jimu.js/css/images/select_polyline.png b/app/jimu.js/css/images/select_polyline.png
index 94fca3d..71cdf73 100644
Binary files a/app/jimu.js/css/images/select_polyline.png and b/app/jimu.js/css/images/select_polyline.png differ
diff --git a/app/jimu.js/css/images/select_rectangle.png b/app/jimu.js/css/images/select_rectangle.png
index 703f198..760cf20 100644
Binary files a/app/jimu.js/css/images/select_rectangle.png and b/app/jimu.js/css/images/select_rectangle.png differ
diff --git a/app/jimu.js/css/images/setting_default.png b/app/jimu.js/css/images/setting_default.png
index d88bd59..6184e15 100644
Binary files a/app/jimu.js/css/images/setting_default.png and b/app/jimu.js/css/images/setting_default.png differ
diff --git a/app/jimu.js/css/images/setting_disabled.png b/app/jimu.js/css/images/setting_disabled.png
index fbc603d..6658875 100644
Binary files a/app/jimu.js/css/images/setting_disabled.png and b/app/jimu.js/css/images/setting_disabled.png differ
diff --git a/app/jimu.js/css/images/setting_hover.png b/app/jimu.js/css/images/setting_hover.png
index d88bd59..421728e 100644
Binary files a/app/jimu.js/css/images/setting_hover.png and b/app/jimu.js/css/images/setting_hover.png differ
diff --git a/app/jimu.js/css/images/share/arrow-back-rtl.svg b/app/jimu.js/css/images/share/arrow-back-rtl.svg
index 8c8ebd1..ceaed73 100644
--- a/app/jimu.js/css/images/share/arrow-back-rtl.svg
+++ b/app/jimu.js/css/images/share/arrow-back-rtl.svg
@@ -1,14 +1 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/share/arrow-back.svg b/app/jimu.js/css/images/share/arrow-back.svg
index 737626c..b803390 100644
--- a/app/jimu.js/css/images/share/arrow-back.svg
+++ b/app/jimu.js/css/images/share/arrow-back.svg
@@ -1,14 +1 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/share/arrow-back_hover-rtl.svg b/app/jimu.js/css/images/share/arrow-back_hover-rtl.svg
index 6996518..2d88a88 100644
--- a/app/jimu.js/css/images/share/arrow-back_hover-rtl.svg
+++ b/app/jimu.js/css/images/share/arrow-back_hover-rtl.svg
@@ -1,14 +1 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/share/arrow-back_hover.svg b/app/jimu.js/css/images/share/arrow-back_hover.svg
index b222ad1..6fe1074 100644
--- a/app/jimu.js/css/images/share/arrow-back_hover.svg
+++ b/app/jimu.js/css/images/share/arrow-back_hover.svg
@@ -1,14 +1 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/share/arrow_down.svg b/app/jimu.js/css/images/share/arrow_down.svg
index f3fb420..ea3029a 100644
--- a/app/jimu.js/css/images/share/arrow_down.svg
+++ b/app/jimu.js/css/images/share/arrow_down.svg
@@ -1,16 +1 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/share/arrow_down_hover.svg b/app/jimu.js/css/images/share/arrow_down_hover.svg
index b040f4e..a6ac9f8 100644
--- a/app/jimu.js/css/images/share/arrow_down_hover.svg
+++ b/app/jimu.js/css/images/share/arrow_down_hover.svg
@@ -1,16 +1 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/share/email.png b/app/jimu.js/css/images/share/email.png
index cda8f53..dd26196 100644
Binary files a/app/jimu.js/css/images/share/email.png and b/app/jimu.js/css/images/share/email.png differ
diff --git a/app/jimu.js/css/images/share/email_hover.png b/app/jimu.js/css/images/share/email_hover.png
index 30b74de..bd26965 100644
Binary files a/app/jimu.js/css/images/share/email_hover.png and b/app/jimu.js/css/images/share/email_hover.png differ
diff --git a/app/jimu.js/css/images/share/facebook.png b/app/jimu.js/css/images/share/facebook.png
index ed71a8c..f984a53 100644
Binary files a/app/jimu.js/css/images/share/facebook.png and b/app/jimu.js/css/images/share/facebook.png differ
diff --git a/app/jimu.js/css/images/share/facebook_hover.png b/app/jimu.js/css/images/share/facebook_hover.png
index 04c46eb..41e5abb 100644
Binary files a/app/jimu.js/css/images/share/facebook_hover.png and b/app/jimu.js/css/images/share/facebook_hover.png differ
diff --git a/app/jimu.js/css/images/share/gplus.png b/app/jimu.js/css/images/share/gplus.png
index e53f6a3..17d0c94 100644
Binary files a/app/jimu.js/css/images/share/gplus.png and b/app/jimu.js/css/images/share/gplus.png differ
diff --git a/app/jimu.js/css/images/share/gplus_hover.png b/app/jimu.js/css/images/share/gplus_hover.png
index d38d085..8de402a 100644
Binary files a/app/jimu.js/css/images/share/gplus_hover.png and b/app/jimu.js/css/images/share/gplus_hover.png differ
diff --git a/app/jimu.js/css/images/share/marker.svg b/app/jimu.js/css/images/share/marker.svg
index 284a0dd..9788ccd 100644
--- a/app/jimu.js/css/images/share/marker.svg
+++ b/app/jimu.js/css/images/share/marker.svg
@@ -1,16 +1 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/share/marker_hover.svg b/app/jimu.js/css/images/share/marker_hover.svg
index 91b0bff..d319fab 100644
--- a/app/jimu.js/css/images/share/marker_hover.svg
+++ b/app/jimu.js/css/images/share/marker_hover.svg
@@ -1,16 +1 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/share/marker_selected.svg b/app/jimu.js/css/images/share/marker_selected.svg
index 26ffbf0..84a5ae9 100644
--- a/app/jimu.js/css/images/share/marker_selected.svg
+++ b/app/jimu.js/css/images/share/marker_selected.svg
@@ -1,16 +1 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/share/twitter.png b/app/jimu.js/css/images/share/twitter.png
index 4edd8c9..bffacb9 100644
Binary files a/app/jimu.js/css/images/share/twitter.png and b/app/jimu.js/css/images/share/twitter.png differ
diff --git a/app/jimu.js/css/images/share/twitter_hover.png b/app/jimu.js/css/images/share/twitter_hover.png
index cbb645c..f932be5 100644
Binary files a/app/jimu.js/css/images/share/twitter_hover.png and b/app/jimu.js/css/images/share/twitter_hover.png differ
diff --git a/app/jimu.js/css/images/showAllHover.svg b/app/jimu.js/css/images/showAllHover.svg
new file mode 100644
index 0000000..1a60d21
--- /dev/null
+++ b/app/jimu.js/css/images/showAllHover.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/showAllNormal.svg b/app/jimu.js/css/images/showAllNormal.svg
new file mode 100644
index 0000000..aede2b6
--- /dev/null
+++ b/app/jimu.js/css/images/showAllNormal.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/showSelectedHover.svg b/app/jimu.js/css/images/showSelectedHover.svg
new file mode 100644
index 0000000..a75d250
--- /dev/null
+++ b/app/jimu.js/css/images/showSelectedHover.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/showSelectedNormal.svg b/app/jimu.js/css/images/showSelectedNormal.svg
new file mode 100644
index 0000000..36d1358
--- /dev/null
+++ b/app/jimu.js/css/images/showSelectedNormal.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/symbol/c1.png b/app/jimu.js/css/images/symbol/c1.png
index af3daa8..43ab43e 100644
Binary files a/app/jimu.js/css/images/symbol/c1.png and b/app/jimu.js/css/images/symbol/c1.png differ
diff --git a/app/jimu.js/css/images/symbol/c2.png b/app/jimu.js/css/images/symbol/c2.png
index 83c7d42..e81c75f 100644
Binary files a/app/jimu.js/css/images/symbol/c2.png and b/app/jimu.js/css/images/symbol/c2.png differ
diff --git a/app/jimu.js/css/images/symbol/c3.png b/app/jimu.js/css/images/symbol/c3.png
index 605c473..4871705 100644
Binary files a/app/jimu.js/css/images/symbol/c3.png and b/app/jimu.js/css/images/symbol/c3.png differ
diff --git a/app/jimu.js/css/images/symbol/c4.png b/app/jimu.js/css/images/symbol/c4.png
index 497d1e0..b5c9bdf 100644
Binary files a/app/jimu.js/css/images/symbol/c4.png and b/app/jimu.js/css/images/symbol/c4.png differ
diff --git a/app/jimu.js/css/images/symbol/c5.png b/app/jimu.js/css/images/symbol/c5.png
index 3a5e7cd..50a03a1 100644
Binary files a/app/jimu.js/css/images/symbol/c5.png and b/app/jimu.js/css/images/symbol/c5.png differ
diff --git a/app/jimu.js/css/images/symbol/c6.png b/app/jimu.js/css/images/symbol/c6.png
index ffd27c6..a88534f 100644
Binary files a/app/jimu.js/css/images/symbol/c6.png and b/app/jimu.js/css/images/symbol/c6.png differ
diff --git a/app/jimu.js/css/images/symbol/cb1.png b/app/jimu.js/css/images/symbol/cb1.png
index df34ba1..46ff097 100644
Binary files a/app/jimu.js/css/images/symbol/cb1.png and b/app/jimu.js/css/images/symbol/cb1.png differ
diff --git a/app/jimu.js/css/images/symbol/cb10.png b/app/jimu.js/css/images/symbol/cb10.png
index 4c0ab87..5e14528 100644
Binary files a/app/jimu.js/css/images/symbol/cb10.png and b/app/jimu.js/css/images/symbol/cb10.png differ
diff --git a/app/jimu.js/css/images/symbol/cb11.png b/app/jimu.js/css/images/symbol/cb11.png
index ba74fd5..1bff03d 100644
Binary files a/app/jimu.js/css/images/symbol/cb11.png and b/app/jimu.js/css/images/symbol/cb11.png differ
diff --git a/app/jimu.js/css/images/symbol/cb12.png b/app/jimu.js/css/images/symbol/cb12.png
index 750256d..17aef1a 100644
Binary files a/app/jimu.js/css/images/symbol/cb12.png and b/app/jimu.js/css/images/symbol/cb12.png differ
diff --git a/app/jimu.js/css/images/symbol/cb13.png b/app/jimu.js/css/images/symbol/cb13.png
index 6adeace..42fd46b 100644
Binary files a/app/jimu.js/css/images/symbol/cb13.png and b/app/jimu.js/css/images/symbol/cb13.png differ
diff --git a/app/jimu.js/css/images/symbol/cb14.png b/app/jimu.js/css/images/symbol/cb14.png
index 6cfdf74..31d5cc5 100644
Binary files a/app/jimu.js/css/images/symbol/cb14.png and b/app/jimu.js/css/images/symbol/cb14.png differ
diff --git a/app/jimu.js/css/images/symbol/cb15.png b/app/jimu.js/css/images/symbol/cb15.png
index 1a494e0..0dd58e0 100644
Binary files a/app/jimu.js/css/images/symbol/cb15.png and b/app/jimu.js/css/images/symbol/cb15.png differ
diff --git a/app/jimu.js/css/images/symbol/cb16.png b/app/jimu.js/css/images/symbol/cb16.png
index 387478f..85982a0 100644
Binary files a/app/jimu.js/css/images/symbol/cb16.png and b/app/jimu.js/css/images/symbol/cb16.png differ
diff --git a/app/jimu.js/css/images/symbol/cb17.png b/app/jimu.js/css/images/symbol/cb17.png
index 188a961..623a395 100644
Binary files a/app/jimu.js/css/images/symbol/cb17.png and b/app/jimu.js/css/images/symbol/cb17.png differ
diff --git a/app/jimu.js/css/images/symbol/cb18.png b/app/jimu.js/css/images/symbol/cb18.png
index 8882ac7..3096db0 100644
Binary files a/app/jimu.js/css/images/symbol/cb18.png and b/app/jimu.js/css/images/symbol/cb18.png differ
diff --git a/app/jimu.js/css/images/symbol/cb19.png b/app/jimu.js/css/images/symbol/cb19.png
index 811593e..c8b7f29 100644
Binary files a/app/jimu.js/css/images/symbol/cb19.png and b/app/jimu.js/css/images/symbol/cb19.png differ
diff --git a/app/jimu.js/css/images/symbol/cb2.png b/app/jimu.js/css/images/symbol/cb2.png
index 2a05f95..8fe8239 100644
Binary files a/app/jimu.js/css/images/symbol/cb2.png and b/app/jimu.js/css/images/symbol/cb2.png differ
diff --git a/app/jimu.js/css/images/symbol/cb20.png b/app/jimu.js/css/images/symbol/cb20.png
index e23dd6c..f1ed29a 100644
Binary files a/app/jimu.js/css/images/symbol/cb20.png and b/app/jimu.js/css/images/symbol/cb20.png differ
diff --git a/app/jimu.js/css/images/symbol/cb21.png b/app/jimu.js/css/images/symbol/cb21.png
index 3a79bdb..9406972 100644
Binary files a/app/jimu.js/css/images/symbol/cb21.png and b/app/jimu.js/css/images/symbol/cb21.png differ
diff --git a/app/jimu.js/css/images/symbol/cb22.png b/app/jimu.js/css/images/symbol/cb22.png
index 89f1537..7d6fc02 100644
Binary files a/app/jimu.js/css/images/symbol/cb22.png and b/app/jimu.js/css/images/symbol/cb22.png differ
diff --git a/app/jimu.js/css/images/symbol/cb23.png b/app/jimu.js/css/images/symbol/cb23.png
index 754239e..db696de 100644
Binary files a/app/jimu.js/css/images/symbol/cb23.png and b/app/jimu.js/css/images/symbol/cb23.png differ
diff --git a/app/jimu.js/css/images/symbol/cb24.png b/app/jimu.js/css/images/symbol/cb24.png
index 4031a41..3c61af4 100644
Binary files a/app/jimu.js/css/images/symbol/cb24.png and b/app/jimu.js/css/images/symbol/cb24.png differ
diff --git a/app/jimu.js/css/images/symbol/cb25.png b/app/jimu.js/css/images/symbol/cb25.png
index 5e4d0f5..f98cfbe 100644
Binary files a/app/jimu.js/css/images/symbol/cb25.png and b/app/jimu.js/css/images/symbol/cb25.png differ
diff --git a/app/jimu.js/css/images/symbol/cb26.png b/app/jimu.js/css/images/symbol/cb26.png
index 5ca478c..b1f2a91 100644
Binary files a/app/jimu.js/css/images/symbol/cb26.png and b/app/jimu.js/css/images/symbol/cb26.png differ
diff --git a/app/jimu.js/css/images/symbol/cb27.png b/app/jimu.js/css/images/symbol/cb27.png
index f0efd6e..17dbc31 100644
Binary files a/app/jimu.js/css/images/symbol/cb27.png and b/app/jimu.js/css/images/symbol/cb27.png differ
diff --git a/app/jimu.js/css/images/symbol/cb3.png b/app/jimu.js/css/images/symbol/cb3.png
index a5ea081..908d8f2 100644
Binary files a/app/jimu.js/css/images/symbol/cb3.png and b/app/jimu.js/css/images/symbol/cb3.png differ
diff --git a/app/jimu.js/css/images/symbol/cb4.png b/app/jimu.js/css/images/symbol/cb4.png
index 7efccba..2aca619 100644
Binary files a/app/jimu.js/css/images/symbol/cb4.png and b/app/jimu.js/css/images/symbol/cb4.png differ
diff --git a/app/jimu.js/css/images/symbol/cb5.png b/app/jimu.js/css/images/symbol/cb5.png
index 7903fc3..a65cd2a 100644
Binary files a/app/jimu.js/css/images/symbol/cb5.png and b/app/jimu.js/css/images/symbol/cb5.png differ
diff --git a/app/jimu.js/css/images/symbol/cb6.png b/app/jimu.js/css/images/symbol/cb6.png
index ccdd6d5..b2823c1 100644
Binary files a/app/jimu.js/css/images/symbol/cb6.png and b/app/jimu.js/css/images/symbol/cb6.png differ
diff --git a/app/jimu.js/css/images/symbol/cb7.png b/app/jimu.js/css/images/symbol/cb7.png
index 3e444ef..f236412 100644
Binary files a/app/jimu.js/css/images/symbol/cb7.png and b/app/jimu.js/css/images/symbol/cb7.png differ
diff --git a/app/jimu.js/css/images/symbol/cb8.png b/app/jimu.js/css/images/symbol/cb8.png
index c937afc..ff7c525 100644
Binary files a/app/jimu.js/css/images/symbol/cb8.png and b/app/jimu.js/css/images/symbol/cb8.png differ
diff --git a/app/jimu.js/css/images/symbol/cb9.png b/app/jimu.js/css/images/symbol/cb9.png
index 30203e9..84c19ef 100644
Binary files a/app/jimu.js/css/images/symbol/cb9.png and b/app/jimu.js/css/images/symbol/cb9.png differ
diff --git a/app/jimu.js/css/images/table.png b/app/jimu.js/css/images/table.png
index ea1c21b..0dc94cc 100644
Binary files a/app/jimu.js/css/images/table.png and b/app/jimu.js/css/images/table.png differ
diff --git a/app/jimu.js/css/images/togglebutton_check.svg b/app/jimu.js/css/images/togglebutton_check.svg
new file mode 100644
index 0000000..d5fa611
--- /dev/null
+++ b/app/jimu.js/css/images/togglebutton_check.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/togglebutton_uncheck.svg b/app/jimu.js/css/images/togglebutton_uncheck.svg
new file mode 100644
index 0000000..f9c975f
--- /dev/null
+++ b/app/jimu.js/css/images/togglebutton_uncheck.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/tool.png b/app/jimu.js/css/images/tool.png
index 5e2c2f7..5cdab38 100644
Binary files a/app/jimu.js/css/images/tool.png and b/app/jimu.js/css/images/tool.png differ
diff --git a/app/jimu.js/css/images/toolbox.png b/app/jimu.js/css/images/toolbox.png
index 05cf623..3176570 100644
Binary files a/app/jimu.js/css/images/toolbox.png and b/app/jimu.js/css/images/toolbox.png differ
diff --git a/app/jimu.js/css/images/transparent.svg b/app/jimu.js/css/images/transparent.svg
index c4cb111..eede517 100644
--- a/app/jimu.js/css/images/transparent.svg
+++ b/app/jimu.js/css/images/transparent.svg
@@ -1,24 +1 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/unselect_features.png b/app/jimu.js/css/images/unselect_features.png
index 079bff0..f505fb5 100644
Binary files a/app/jimu.js/css/images/unselect_features.png and b/app/jimu.js/css/images/unselect_features.png differ
diff --git a/app/jimu.js/css/images/up_default.png b/app/jimu.js/css/images/up_default.png
deleted file mode 100644
index c1651cd..0000000
Binary files a/app/jimu.js/css/images/up_default.png and /dev/null differ
diff --git a/app/jimu.js/css/images/up_disabled.png b/app/jimu.js/css/images/up_disabled.png
deleted file mode 100644
index a8b4f28..0000000
Binary files a/app/jimu.js/css/images/up_disabled.png and /dev/null differ
diff --git a/app/jimu.js/css/images/up_hover.png b/app/jimu.js/css/images/up_hover.png
deleted file mode 100644
index 367c4f2..0000000
Binary files a/app/jimu.js/css/images/up_hover.png and /dev/null differ
diff --git a/app/jimu.js/css/images/uploadImageIcon_disabled.gif b/app/jimu.js/css/images/uploadImageIcon_disabled.gif
new file mode 100644
index 0000000..d93339b
Binary files /dev/null and b/app/jimu.js/css/images/uploadImageIcon_disabled.gif differ
diff --git a/app/jimu.js/css/images/v-black.png b/app/jimu.js/css/images/v-black.png
new file mode 100644
index 0000000..62239fe
Binary files /dev/null and b/app/jimu.js/css/images/v-black.png differ
diff --git a/app/jimu.js/css/images/v_hover.svg b/app/jimu.js/css/images/v_hover.svg
index 0ebe81a..44afa0b 100644
--- a/app/jimu.js/css/images/v_hover.svg
+++ b/app/jimu.js/css/images/v_hover.svg
@@ -1,22 +1 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/v_normal.svg b/app/jimu.js/css/images/v_normal.svg
index 3e492a3..0c52a60 100644
--- a/app/jimu.js/css/images/v_normal.svg
+++ b/app/jimu.js/css/images/v_normal.svg
@@ -1,22 +1 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/jimu.js/css/images/valid.png b/app/jimu.js/css/images/valid.png
index 6d4ad26..bd16c64 100644
Binary files a/app/jimu.js/css/images/valid.png and b/app/jimu.js/css/images/valid.png differ
diff --git a/app/jimu.js/css/images/validating.gif b/app/jimu.js/css/images/validating.gif
index 5c162c7..b0ee994 100644
Binary files a/app/jimu.js/css/images/validating.gif and b/app/jimu.js/css/images/validating.gif differ
diff --git a/app/jimu.js/css/images/white_close_default.png b/app/jimu.js/css/images/white_close_default.png
index a81c177..8c5e1ce 100644
Binary files a/app/jimu.js/css/images/white_close_default.png and b/app/jimu.js/css/images/white_close_default.png differ
diff --git a/app/jimu.js/css/images/zoom_normal.png b/app/jimu.js/css/images/zoom_normal.png
new file mode 100644
index 0000000..1148b0c
Binary files /dev/null and b/app/jimu.js/css/images/zoom_normal.png differ
diff --git a/app/jimu.js/css/jimu-theme.css b/app/jimu.js/css/jimu-theme.css
index f125512..926e6c5 100644
--- a/app/jimu.js/css/jimu-theme.css
+++ b/app/jimu.js/css/jimu-theme.css
@@ -13,6 +13,16 @@
font-weight: normal;
font-style: normal;
}
+@font-face {
+ font-family: 'Themefont';
+ src: url('fonts/Themefont.eot?cwzds4');
+ src: url('fonts/Themefont.eot?cwzds4#iefix') format('embedded-opentype'),
+ url('fonts/Themefont.ttf?cwzds4') format('truetype'),
+ url('fonts/Themefont.woff?cwzds4') format('woff'),
+ url('fonts/Themefont.svg?cwzds4#Themefont') format('svg');
+ font-weight: normal;
+ font-style: normal;
+}
/* css for jimu-main- */
.jimu-main-background{
background-color: #485566;
@@ -35,7 +45,7 @@
font-size: 12px;
font-weight: normal;
color: #ffffff;
- color: rgba(255, 255, 255, 0.8);
+ font-family: Avenir Medium;
}
/* css for jimu-footer */
@@ -49,23 +59,23 @@
.jimu-link{
font-size: 14px;
font-weight: normal;
+ color: #ffffff;
+ font-family: Avenir Medium;
}
.jimu-link:link, .jimu-link:visited{
text-decoration: none;
- color: #95a2a9;
- color: rgba(255, 255, 255, 0.7);
}
.jimu-link:hover{
- text-decoration: none;
+ text-decoration: underline;
color: #ffffff;
+ opacity: 1;
}
.jimu-link:active{
text-decoration: none;
color: #ececec;
- color: rgba(255, 255, 255, 0.9);
}
/* css for jimu-widget- */
@@ -89,14 +99,14 @@
.jimu-widget-placeholder{
background-color: #000000;
filter:alpha(opacity=20);
- opacity: 0.2;
+ opacity: 0.5;
border-radius: 4px;
border: 1px dashed #a0acbf;
}
.jimu-widget-placeholder:hover{
filter:alpha(opacity=40);
- opacity: 0.4;
+ opacity: 0.7;
}
.jimu-widget-placeholder .inner {
@@ -119,18 +129,14 @@
}
.jimu-widget-onscreen-icon{
- background-color: #ccc;
- background-color: rgba(0, 0, 0, 0.2);
- border: 1px solid #000000;
- border: 1px solid rgba(0, 0, 0, 0.5);
+ background-color: #555;
+ border: 1px solid #999;
}
.jimu-widget-onscreen-icon:hover{
- background-color: #999;
- background-color: rgba(0, 0, 0, 0.4);
+ background-color: #333;
}
.jimu-widget-onscreen-icon.jimu-state-selected{
- background-color: #666;
- background-color: rgba(0, 0, 0, 0.6);
+ background-color: #333;
}
/* css for jimu-panel- */
@@ -275,18 +281,6 @@
color: #596679;
}
-/* css for Filter dijit */
-.jimu-filter .odd-filter{
- background: #eef2f5;
- border-left: 1px solid #eef2f5;
- border-right: 1px solid #eef2f5;
-}
-
-.jimu-filter .even-filter{
- background: #ffffff;
- border: 1px solid #eef2f5;
-}
-
/* css for ItemSelector dijit */
.jimu-item-selector .signin-tip{
color: #d6d6d6;
@@ -334,6 +328,7 @@
border-right: 0;
border-top: 0;
border-bottom: 1px solid #ccc;
+ font-family: "Avenir Light";
}
/*.jimu-tab3 .tab-item-td.jimu-state-active{
@@ -347,9 +342,8 @@
.jimu-tab3 .tab-item-td.jimu-state-active{
color: #48494B;
border-bottom: 2px solid #24B5CC;
- /*font-family: "Avenir Medium";*/
- color: #000;
- font-weight: bold;
+ font-family: "Avenir Medium";
+ color: #24B5CC;
}
/* css for LayerChooserFromMap dijit */
@@ -358,6 +352,17 @@
}
/* css for DrawBox dijit */
+@font-face {
+ font-family: 'draw box';
+
+ src: url('fonts/drawbox.eot');
+ src: url('fonts/drawbox.eot?#iefix') format('embedded-opentype'),
+ url('fonts/drawbox.woff') format('woff'),
+ url('fonts/drawbox.ttf') format('truetype'),
+ url('fonts/drawbox.svg#drawbox') format('svg');
+ font-weight: normal;
+ font-style: normal;
+}
.jimu-draw-box .draw-item.jimu-state-active{
background-color: #DDDDDD;
border: 2px solid #000000;
@@ -366,53 +371,73 @@
background-color: #c0c0c0;
}*/
-.jimu-draw-box .point-icon{
- background-image: url(images/draw_point.png);
+.jimu-draw-box .draw-item {
+ font-family: 'draw box' !important;
+ speak: none;
+ font-style: normal;
+ font-weight: normal;
+ font-variant: normal;
+ text-transform: none;
+ line-height: 1;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ color: rgba(0,0,0,0.5);
+ cursor: pointer;
+ font-size: 16px;
+ color: black;
}
-.jimu-draw-box .line-icon{
- background-image: url(images/draw_line.png);
+.jimu-draw-box .point-icon:before{
+ content: '\e90c';
}
-.jimu-draw-box .polyline-icon{
- background-image: url(images/draw_polyline.png);
+.jimu-draw-box .line-icon:before{
+ content: '\e90b';
}
-.jimu-draw-box .freehand-polyline-icon{
- background-image: url(images/draw_freehand_polyline.png);
+.jimu-draw-box .polyline-icon:before{
+ content: '\e90e';
}
-.jimu-draw-box .triangle-icon{
- background-image: url(images/draw_triangle.png);
+.jimu-draw-box .freehand-polyline-icon:before{
+ content: '\e908';
}
-.jimu-draw-box .extent-icon{
- background-image: url(images/draw_extent.png);
+.jimu-draw-box .triangle-icon:before{
+ content: '\e910';
}
-.jimu-draw-box .circle-icon{
- background-image: url(images/draw_circle.png);
+.jimu-draw-box .extent-icon:before{
+ content: '\e905';
}
-.jimu-draw-box .ellipse-icon{
- background-image: url(images/draw_ellipse.png);
+.jimu-draw-box .circle-icon:before{
+ content: '\e907';
}
-.jimu-draw-box .polygon-icon{
- background-image: url(images/draw_polygon.png);
+.jimu-draw-box .ellipse-icon:before{
+ content: '\e904';
}
-.jimu-draw-box .freehand-polygon-icon{
- background-image: url(images/draw_freehand_polygon.png);
+.jimu-draw-box .polygon-icon:before{
+ content: '\e90d';
}
-.jimu-draw-box .text-icon{
- background-image: url(images/draw_text.png);
+.jimu-draw-box .freehand-polygon-icon:before{
+ content: '\e90a';
+}
+
+.jimu-draw-box .text-icon:before{
+ content: '\e900';
}
.jimu-draw-box .drawings-clear{
- background-image: url(images/rubbish_bin_white.png);
- background-color: #D0021B;
+ font-family: 'draw box' !important;
+ background-color: #D0021B !important;
+ color: white !important;
+}
+.jimu-draw-box .drawings-clear:before{
+ content: '\e901';
}
.jimu-draw-box.enabled .drawings-clear:hover{
diff --git a/app/jimu.js/css/jimu.css b/app/jimu.js/css/jimu.css
index 435cb35..74a031e 100644
--- a/app/jimu.js/css/jimu.css
+++ b/app/jimu.js/css/jimu.css
@@ -15,12 +15,68 @@ td, th{
@import url("dojo-override.css");
@import url("spacing.css");
@import url("sprite.css");
+@import url("clamp.css");
+
+/* custom webkit scrollbar */
+
+::-webkit-scrollbar {
+ border-radius: 3px;
+ width: 6px;
+ background-color: #EEEEEE;
+ height: 6px;
+}
+
+::-webkit-scrollbar-thumb {
+ border-radius: 3px;
+ opacity: 0.6;
+ background: #999999;
+}
+
+::-webkit-scrollbar-thumb:hover {
+ opacity: 0.66;
+ background: #666666;
+}
+/* disable the default font style italic in ie version greater than or equal to 10 */
+.ie-gte-10 input[type="text"] {
+ font-style: normal;
+}
/* disable the blue color outline in chrome */
*:focus{
outline: none;
}
+.jimu-nav-mode *:focus{
+ outline: 2px solid #24B5CC !important;
+}
+
+/*use border, for some fullscreen dom*/
+.jimu-nav-mode * .jimu-widget-header-controller:focus,
+.jimu-nav-mode * .jimu-multiple-items-list:focus{
+ outline-offset: -2px !important;
+}
+
+/*outline style changes its postion or doesn't work*/
+.jimu-nav-mode * #map:focus,
+.jimu-nav-mode * .jimu-widget-overview:focus,
+.jimu-nav-mode * .jimu-widget-splash:focus,
+.ie-low-nav-mode.jimu-nav-mode * .jimu-multiple-items-list:focus, /*for ie v<=9*/
+.jimu-nav-mode * .jimu-widget-attributetable.jimu-widget.closed:focus{
+ outline: none !important;
+ border: 2px solid #24B5CC;
+ /* box-shadow: inset 0px 0px 0px 2px #24B5CC; */
+}
+
+/*ie doesn't support outline-offset, use box-shadow instead.*/
+.ie-nav-mode.jimu-nav-mode * .jimu-multiple-items-list:focus{
+ outline: none !important;
+ box-shadow: inset 0px 0px 0px 2px #24B5CC; /*v>9*/
+}
+
+input[type="text"]::-ms-clear{
+ display: none;
+}
+
/* enables the border box model at all elements which has a "jimu" class and the children of it*/
[class*='jimu'],
[class*='jimu'] * {
@@ -43,6 +99,10 @@ td, th{
z-index: auto;
}
+.esriAttribution{
+ background: #fff;/*508*/
+}
+
.jimu-rtl .esriControlsBR{
left: 5px;
text-align: left;
@@ -88,29 +148,74 @@ td, th{
z-index: 0;
}
-.map .load-container {
+.map-loading{
float: left;
position: absolute;
overflow: hidden;
- bottom: 40px;
+ bottom: 45px;
right: 10px;
display: none;
}
-.map .load-container.loading{
+.map-loading.loading{
display: block;
}
-.map .load-container .loader {
- font-size: 20px;
- width: 1.5em;
- height: 1.5em;
+.jimu-rtl .map-loading {
+ right: auto;
+ left: 10px;
+}
+
+.map-loading,
+.map-loading:after {
border-radius: 50%;
- position: relative;
+ width: 24px;
+ height: 24px;
+}
+.map-loading {
+ font-size: 10px;
text-indent: -9999em;
- background: url("images/loadingmap.gif");
+ border-top: 3px solid rgba(0, 0, 0, 0.2);
+ border-right: 3px solid rgba(0, 0, 0, 0.2);
+ border-bottom: 3px solid rgba(0, 0, 0, 0.2);
+ border-left: 3px solid #ffffff;
+ -webkit-transform: translateZ(0);
+ -ms-transform: translateZ(0);
+ transform: translateZ(0);
+ -webkit-animation: load8 1.1s infinite linear;
+ animation: load8 1.1s infinite linear;
+ box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.2);
+}
+@-webkit-keyframes load8 {
+ 0% {
+ -webkit-transform: rotate(0deg);
+ transform: rotate(0deg);
+ }
+ 100% {
+ -webkit-transform: rotate(360deg);
+ transform: rotate(360deg);
+ }
}
-.jimu-rtl .map .load-container {
- right: auto;
- left: 10px;
+@keyframes load8 {
+ 0% {
+ -webkit-transform: rotate(0deg);
+ transform: rotate(0deg);
+ }
+ 100% {
+ -webkit-transform: rotate(360deg);
+ transform: rotate(360deg);
+ }
+}
+
+/*set style on measurement*/
+.esriMeasurement .esriMeasurementResultLabel {
+ padding-bottom: 10px;
+}
+.esriMeasurement .esriMeasurementResultValue .result {
+ display: block;
+ font-size: 24px;
+ color: #000000;
+ letter-spacing: 0.67px;
+ line-height: 40px;
+ text-align: center;
}
/************* END **********************/
@@ -156,17 +261,6 @@ td, th{
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
-/* Avenir Next doesn't support all vietnamese characters
- * use Lucida Grande for vi */
-.vi,
-.vi .top-nav-link,
-.vi .avenir-light,
-.vi .avenir-regular,
-.vi .top-nav,
-.vi .dropdown-link {
- font-family: "Lucida Grande", "Arial", sans-serif;
- }
-
@font-face {
font-family: 'CalciteWebCoreIcons';
src: url('./fonts/CalciteWebCoreIcons.eot?-v8piff');
@@ -180,6 +274,18 @@ body,html{
font-family: 'Avenir Light', Verdana, Geneva, sans-serif;
}
+/* Avenir Next doesn't support all vietnamese characters
+ * use Lucida Grande for vi */
+.vi,
+.vi body,
+.vi .top-nav-link,
+.vi .avenir-light,
+.vi .avenir-regular,
+.vi .top-nav,
+.vi .dropdown-link {
+ font-family: "Lucida Grande", "Arial", sans-serif;
+ }
+
/*override original style of title and subtitle of theme after custmize font style*/
div.attribute-custom-style{
font-weight: normal !important;
@@ -196,7 +302,19 @@ classes can be used in the html
text-overflow: ellipsis;
white-space: nowrap;
}
-
+.jimu-ellipsis-Blanks{
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: pre; /*keep all spaces*/
+}
+.jimu-break-word {
+ word-break: break-word;
+ word-wrap: break-word;
+ -ms-hyphens: auto;
+ -moz-hyphens: auto;
+ -webkit-hyphens: auto;
+ hyphens: auto;
+}
/* style to keep content middle aligned */
.jimu-auto-vertical{
text-align:center;
@@ -451,6 +569,11 @@ classes can be used in the html
border-radius: 2px;
font-size: 16px;
}
+
+.jimu-input::-ms-clear {
+ display: none;
+}
+
.jimu-input:focus{
color: #686868;
outline: none;
@@ -540,6 +663,9 @@ classes can be used in the html
line-height: 24px;
vertical-align: middle;
margin-left: 7px;
+ text-decoration: none;
+}
+.add-with-icon .add-label:hover{
text-decoration: underline;
}
@@ -624,20 +750,6 @@ css for the dijits
display: inline-block;
cursor: pointer;
border-radius: 2px;
- margin-top:1px;
- background-image: url(images/checkbox_default.png);
-}
-
-.jimu-checkbox .checkbox.checked{
- background-image: url(images/checked_default.png);
-}
-
-.jimu-checkbox.jimu-state-disabled .checkbox{
- background-image: url(images/checkbox_disabled.png);
-}
-
-.jimu-checkbox.jimu-state-disabled .checkbox.checked{
- background-image: url(images/checked_disabled.png);
}
.jimu-checkbox .label{
@@ -682,7 +794,7 @@ css for the dijits
cursor: pointer;
}
.jimu-dropmenu .menu-item:hover{
- color: #51b1fe;
+ color: #000000;
text-decoration: underline;
}
.jimu-dropmenu .menu-item-line{
@@ -719,18 +831,28 @@ css for the dijits
width: 16px;
height: 16px;
display: inline-block;
- border-radius: 8px;
- border: 1px solid #8a8a8a;
+ border-radius: 50%;
+ border: 1px solid #ccc;
+ background-color: transparent;
+ align-items: center;
+ vertical-align: text-bottom;
cursor: pointer;
- background-color: white;
+ position: relative;
+ box-sizing: border-box;
+}
+.jimu-radio-checked.jimu-radio{
+ border: 1px solid #24B5CC;
}
.jimu-radio-inner{
- width: 10px;
- height: 10px;
- margin: 2px;
display: none;
- border-radius: 5px;
- background-color: black;
+ position: absolute;
+ width: 7px;
+ height: 7px;
+ border-radius: 50%;
+ background-color: #24B5CC;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%,-50%);
}
.jimu-radio-checked .jimu-radio-inner{
display: block;
@@ -830,7 +952,63 @@ css for the dijits
.jimu-widget-onscreen-icon img{
width: 20px;
height: 20px;
- margin: 10px;
+ margin: 9px;
+}
+
+/*jimu-loading*/
+.jimu-loading,
+.jimu-loading:before,
+.jimu-loading:after {
+ border-radius: 50%;
+ width: 1.2em;
+ height: 1.2em;
+ -webkit-animation-fill-mode: both;
+ animation-fill-mode: both;
+ -webkit-animation: jimu-loading-anim 1.8s infinite ease-in-out;
+ animation: jimu-loading-anim 1.8s infinite ease-in-out;
+}
+.jimu-loading {
+ color: #929292;
+ text-indent: -9999em;
+ -webkit-transform: translateZ(0);
+ -ms-transform: translateZ(0);
+ transform: translateZ(0);
+ -webkit-animation-delay: -0.16s;
+ animation-delay: -0.16s;
+}
+.jimu-loading:before,
+.jimu-loading:after {
+ content: '';
+ position: absolute;
+ top: 0;
+}
+.jimu-loading:before {
+ left: -2em;
+ -webkit-animation-delay: -0.32s;
+ animation-delay: -0.32s;
+}
+.jimu-loading:after {
+ left: 2em;
+}
+@-webkit-keyframes jimu-loading-anim {
+ 0%,
+ 80%,
+ 100% {
+ box-shadow: 0 2.5em 0 -1.3em;
+ }
+ 40% {
+ box-shadow: 0 2.5em 0 0;
+ }
+}
+@keyframes jimu-loading-anim {
+ 0%,
+ 80%,
+ 100% {
+ box-shadow: 0 2.5em 0 -1.3em;
+ }
+ 40% {
+ box-shadow: 0 2.5em 0 0;
+ }
}
/**CSS for LoadingIndicator dijit***/
@@ -841,28 +1019,44 @@ css for the dijits
left: 0;
right: 0;
}
+@keyframes indicator-agol-loading {
+ 0%,80%,100% {
+ opacity: .75;
+ box-shadow: 0 0 #999;
+ height: 1rem;
+ }
-.jimu-loading-indicator .loading-section{
+ 40% {
+ opacity: 1;
+ box-shadow: 0 -0.5rem #999;
+ height: 1.2rem;
+ }
+}
+.jimu-loading-indicator.jimu-agol-loading .loading-container .img-div,
+.jimu-loading-indicator.jimu-agol-loading .loading-container .img-div:before,
+.jimu-loading-indicator.jimu-agol-loading .loading-container .img-div:after{
+ background: #999;
+ width: 0.425rem;
+ height: 1rem;
+ animation: indicator-agol-loading 0.8s infinite ease-in-out;
+}
+.jimu-loading-indicator.jimu-agol-loading .loading-container .img-div{
+ animation-delay: 0.16s;
+ right: calc(50% - 0.212rem);
+}
+.jimu-loading-indicator.jimu-agol-loading .loading-container .img-div:after{
+ animation-delay: 0.32s;
+ left: 0.625rem;
+}
+.jimu-loading-indicator.jimu-agol-loading .loading-container .img-div:before{
+ left: -0.625rem;
+}
+.jimu-loading-indicator .jimu-loading{
position: absolute;
- width: 48px;
- height: 48px;
left: 50%;
top: 50%;
- margin-left: -32px;
- margin-top: -32px;
- background-color: #f4f4f4;
- -webkit-border-radius: 50%;
- -moz-border-radius: 50%;
- -o-border-radius: 50%;
- border-radius: 50%;
- -webkit-box-shadow: 0 0 10px rgba(0,0,0,0.3);
- -moz-box-shadow: 0 0 10px rgba(0,0,0,0.3);
- -o-box-shadow: 0 0 10px rgba(0,0,0,0.3);
- box-shadow: 0 0 10px rgba(0,0,0,0.3);
-}
-
-.jimu-loading-indicator .loading-section .jimu-loading{
- margin: 12px;
+ margin-left: -6px;
+ margin-top: -35px;
}
/**CSS for LoadingShelter dijit***/
@@ -881,6 +1075,35 @@ css for the dijits
font-size:14px;
line-height:20px;
}
+.jimu-loading-shelter.jimu-agol-loading .loading-container{
+ left: auto;
+ margin-left: auto;
+}
+@keyframes shelter-agol-loading {
+ 0%,80%,100% {
+ opacity: .75;
+ box-shadow: 0 0 #999;
+ height: 2rem;
+ }
+
+ 40% {
+ opacity: 1;
+ box-shadow: 0 -0.5rem #999;
+ height: 2.5rem;
+ }
+}
+.jimu-loading-shelter.jimu-agol-loading .loading-container .img-div,
+.jimu-loading-shelter.jimu-agol-loading .loading-container .img-div:before,
+.jimu-loading-shelter.jimu-agol-loading .loading-container .img-div:after{
+ background: #999;
+ animation: shelter-agol-loading 0.8s infinite ease-in-out;
+}
+.jimu-loading-shelter.jimu-agol-loading .loading-container .img-div{
+ animation-delay: 0.16s;
+}
+.jimu-loading-shelter.jimu-agol-loading .loading-container .img-div:after{
+ animation-delay: 0.32s;
+}
.jimu-loading-shelter .loading-container{
position:absolute;
width:250px;
@@ -888,54 +1111,14 @@ css for the dijits
top:50%;
left:50%;
margin-left:-24px;
- margin-top:-24px;
+ margin-top:-48px;
color:#000000;
font-weight:bold;
}
-.jimu-loading-shelter .loading-container .img-div{
- position:absolute;
- left:0;
- top: 0;
- width: 48px;
- height: 48px;
- background-color: #f4f4f4;
- -webkit-border-radius: 50%;
- -moz-border-radius: 50%;
- -o-border-radius: 50%;
- border-radius: 50%;
- -webkit-box-shadow: 0 0 10px rgba(0,0,0,0.3);
- -moz-box-shadow: 0 0 10px rgba(0,0,0,0.3);
- -o-box-shadow: 0 0 10px rgba(0,0,0,0.3);
- box-shadow: 0 0 10px rgba(0,0,0,0.3);
-}
-.jimu-loading-shelter .loading-container img{
- width: 24px;
- height: 24px;
- margin: 12px;
-}
-.jimu-loading-shelter .loading-container p{
- position:absolute;
- left:68px;
- top:0;
- display:inline-block;
- height: 48px;
- line-height:48px;
- white-space:nowrap;
- margin:0;
-}
-.jimu-rtl .jimu-loading-shelter .loading-container{
- left: auto;
- right: 50%;
- margin-left:auto;
- margin-right:-24px;
-}
-.jimu-rtl .jimu-loading-shelter .loading-container .img-div{
- left:auto;
- right: 0;
-}
-.jimu-rtl .jimu-loading-shelter .loading-container p{
- left: auto;
- right: 68px;
+.jimu-loading-shelter .loading-container .jimu-loading{
+ position: relative;
+ top: -18px;
+ left: 40px;
}
/**CSS for popup dijit***/
@@ -947,6 +1130,7 @@ css for the dijits
opacity: 0;
overflow: hidden;
}
+
.jimu-popup > .title{
height: 40px;
padding: 0 10px;
@@ -979,6 +1163,11 @@ css for the dijits
overflow-x: hidden;
overflow-y: auto;
}
+.jimu-popup .content .subTitle{
+ opacity: 0.6;
+ font-size: 13px;
+ margin-bottom: 6px;
+}
.jimu-popup .content-absolute{
position: absolute;
top: 60px;
@@ -986,18 +1175,50 @@ css for the dijits
left: 30px;
right: 30px;
}
+.jimu-popup .content-absolute.no-popup-title-content-absolute{
+ top: 20px;
+}
.jimu-popup .content-static{
position: static;
margin: 20px 30px 0;
}
+.jimu-popup .content-absolute.content-fill-Popup,
+.jimu-popup .content-static.content-fill-Popup{
+ margin: 0 0 3px 0;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0!important;
+}
.jimu-popup .button-container{
overflow: hidden;
padding: 15px 30px;
- width: 100%;
+ /* width: 100%; */
+ width: auto;
+ float: right;
+}
+.jimu-rtl .jimu-popup .button-container{
+ float: left;
}
.jimu-popup .button-container-absolute{
position: absolute;
bottom: 0;
+ width: auto;
+ right: 0;
+}
+.jimu-rtl .jimu-popup .button-container-absolute{
+ left: 0;
+ right: auto;
+}
+.jimu-popup .button-container .jimu-float-trailing,
+.jimu-popup .button-container-absolute .jimu-float-trailing {
+ float: left;
+ margin-left: 1em;
+}
+.jimu-rtl .jimu-popup .button-container .jimu-float-trailing,
+.jimu-rtl .jimu-popup .button-container-absolute .jimu-float-trailing {
+ float: right;
+ margin-right: 1em;
}
.jimu-popup .button-container .jimu-btn:nth-child(1).jimu-trailing-margin1,
.jimu-popup .button-container .jimu-btn:nth-child(2).jimu-trailing-margin1 {
@@ -1045,10 +1266,6 @@ css for the dijits
font-size: 12px;
}
-.jimu-search .jimu-input::-ms-clear{
- display: none;
-}
-
.jimu-search .search-btn{
position:absolute;
right:10px;
@@ -1207,6 +1424,10 @@ widget:jimu-w
font-size: 14px;
}
+.jimu-simple-table .simple-table-title .jimu-checkbox.jimu-state-disabled .label{
+ color: #BBB;
+}
+
.jimu-simple-table .head-section{
width:100%;
height:36px;
@@ -1374,6 +1595,10 @@ widget:jimu-w
cursor: pointer;
text-align: center;
}
+.jimu-color-picker.disable{
+ cursor: not-allowed;
+ background: rgba(0,0,0,0.4) !important;
+}
.jimu-color-picker:after{
content: "";
display: inline-block;
@@ -1581,6 +1806,10 @@ widget:jimu-w
right: -16px;
}
+.jimu-rtl .jimu-symbol-chooser .dijitReset.dijitInputInner{
+ text-align: left;
+}
+
.jimu-symbol-chooser .custom-image-chooser{
width: 140px;
height: 30px;
@@ -1644,9 +1873,13 @@ widget:jimu-w
font-size: 13px;
}
+.jimu-renderer-chooser .default-sym-check{
+ margin-top: 20px;
+}
+
.jimu-renderer-chooser .default-sym-preview{
display: none;
- margin-top: 30px;
+ margin-top: 10px;
}
.jimu-renderer-chooser .default-sym-btn{
@@ -1735,6 +1968,10 @@ widget:jimu-w
display:block;
}
+.jimu-renderer-chooser .default-symbol-tr .check-td {
+ width: 22px;
+}
+
.jimu-renderer-chooser .class-breaks-div{
border:1px solid #bba;
max-height:200px;
@@ -1746,7 +1983,8 @@ widget:jimu-w
border-collapse:collapse;
}
-.jimu-renderer-chooser .class-breaks-tr > td{
+.jimu-renderer-chooser .class-breaks-tr > td,
+.jimu-renderer-chooser .default-symbol-tr > td{
vertical-align: middle;
width:auto;
}
@@ -1763,7 +2001,8 @@ widget:jimu-w
background:#e1f0fb !important;
}
-.jimu-renderer-chooser .class-breaks-tr:hover > td{
+.jimu-renderer-chooser .class-breaks-tr:hover > td,
+.jimu-renderer-chooser .default-symbol-tr:hover > td{
background:#e1f0fb !important;
}
@@ -1791,6 +2030,11 @@ widget:jimu-w
display:block;
}
+.jimu-renderer-chooser .render-select .dijitSelectLabel {
+ width: 140px;
+ overflow: hidden;
+}
+
/* css for dijit DrawBox */
.jimu-draw-box{
-ms-overflow-y:hidden;
@@ -1818,6 +2062,7 @@ widget:jimu-w
.jimu-draw-box .draw-items .draw-item, .jimu-draw-box .drawings-clear{
width:40px;
height:40px;
+ line-height: 40px;
background-repeat: no-repeat;
text-align: center;
margin-top: 7px;
@@ -1830,6 +2075,7 @@ widget:jimu-w
.jimu-draw-box .draw-items .draw-item{
background-size: contain;
margin-right: 14px;
+ line-height: 40px;
}
.jimu-rtl .jimu-draw-box .draw-items .draw-item{
@@ -1887,6 +2133,14 @@ widget:jimu-w
vertical-align: top;
}
+.jimu-basic-service-chooser-content table.layout .example-tr .first-td > span {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ max-width: 93%;
+ display: block;
+}
+
.jimu-basic-service-chooser-content .example-url{
font-size:12px;
-ms-word-wrap:break-word;
@@ -1932,17 +2186,17 @@ widget:jimu-w
left: 0;
right: 0;
bottom: 0;
- height: 33px;
+ height: 36px;
overflow: hidden;
}
.jimu-basic-service-chooser-content .operations .ok{
- margin-right: 10px;
+ margin-right: 14px;
}
.jimu-rtl .jimu-basic-service-chooser-content .operations .ok{
margin-right: auto;
- margin-left: 10px;
+ margin-left: 14px;
}
/* css for dijit _BasicServiceChooser */
@@ -1985,7 +2239,7 @@ widget:jimu-w
width: 100%;
/*table-layout: fixed;*/
border-collapse: collapse;
- font-size: 12px;
+ font-size: 14px;
text-align: center;
}
@@ -1996,6 +2250,10 @@ widget:jimu-w
white-space:nowrap;
}
+.jimu-tab3.average .tab-item-td{
+ padding: 0;
+}
+
.jimu-tab3 .tab-item-td.jimu-state-active{
color: #48494B;
}
@@ -2005,11 +2263,6 @@ widget:jimu-w
width:100%;
height:36px;
line-height:36px;
- /*-webkit-border-radius:3px;
- -moz-border-radius:3px;
- -o-border-radius:3px;
- -ms-border-radius:3px;
- border-radius:3px;*/
margin: 0 auto;
white-space: nowrap;
overflow: hidden;
@@ -2027,48 +2280,230 @@ widget:jimu-w
opacity: 0.5;
}
-/* css for dijit _SingleFilter */
-.jimu-single-filter .setting-table{
- width:100%;
- border-collapse: collapse;
+/* css for dijit Filter */
+.jimu-filter{
+ position: relative;
+ box-sizing: border-box;
+ height: 100%;
}
-.jimu-single-filter .setting-table > tbody > tr > td{
- vertical-align: top;
+.jimu-filter .hidden{
+ display: none !important;
}
-.jimu-single-filter .setting-table .fields-td{
- width: 175px;
- padding-right: 8px;
+.jimu-filter .content-section{
+ width: 100%;
+ height: 100%;
+ display: inline-block;
}
-.jimu-single-filterRtl .setting-table .fields-td{
- padding-right: 0;
- padding-left: 8px;
+.jimu-filter .content-section .match-msg{
+ font-size: 12px;
+ margin: 10px;
}
-.jimu-single-filter .setting-table .operators-td{
- width: 130px;
- padding-right: 8px;
+.jimu-filter .content-section .match-msg select,
+.jimu-filter-set .header-table select {
+ padding: 3px 1px;
+ color: #2b2a2a;
+ max-width: 100%;/*don't show scrolling when the string is too long*/
+ width: 99%; /*for filterSet's UI in runtime*/
}
-.jimu-single-filterRtl .setting-table .operators-td{
- padding-right: 0;
- padding-left: 8px;
-}
+.jimu-filter .desktop-add-section{
+ position: relative;
+ overflow: hidden;
+ position: relative;
+ overflow: hidden;
+ margin: 10px 20px 0 10px;
+ font-family: Avenir Medium;
+}
+.jimu-filter .mobile-add-section{
+ display: flex;
+ justify-content: space-around;
+ position: absolute;
+ bottom: 0px;
+ width: 100%;
+}
+.jimu-filter .mobile-add-section .jimu-btn{
+ min-width: 140px;
+ max-width: 150px;
+}
-.jimu-single-filter .setting-table .value-td{
- width: auto;
- padding-right:8px;
+.jimu-filter .desktop-add-section .add-tip-section{
+ display: inline-flex;
+ padding: 0 8px;
+ flex-flow: row nowrap;
+ align-items: center;
+ border: 1px solid #ccc;
+ cursor: default !important;
}
-.jimu-single-filterRtl .setting-table .value-td{
- padding-right: 0;
- padding-left: 8px;
+.jimu-filter .desktop-add-section .add-with-icon{
+ margin-right: 20px;
}
-.jimu-single-filter .setting-table .delete-td{
- width: 16px;
+.jimu-filter .desktop-add-section .add-tip-section > *{
+ flex: 0 0 auto;
+}
+
+.jimu-filter .desktop-add-section .add-tip{
+ display: inline-block;
+ height: 28px;
+ line-height: 28px;
+ margin: 0 5px;
+}
+
+.jimu-filter .jimu-icon-error{
+ margin-left: 5px;
+}
+
+.jimu-filter .error-tip{
+ font-size:13px;
+ color:#ff0000;
+ margin-left: 10px;
+}
+
+.jimu-filter .no-filter-tip{
+ font-size: 12px;
+ position: absolute;
+ bottom: 40px;
+ margin: 0 20px;
+}
+
+.jimu-filter .allExpsBox{
+ width: 100%;
+ box-sizing: border-box;
+ background: #eee;
+ display: inline-block;
+ max-height: calc(100% - 85px);
+ overflow-y: auto;
+}
+
+.jimu-filter .allExpsBox > div{
+ box-sizing: border-box;
+ padding: 10px;
+ margin: 3px auto;
+}
+
+html.hr .jimu-filter .allExpsBox > div{
+ padding-left: 5px;
+ padding-right: 5px;
+}
+
+/* css for dijit _FilterSet */
+.jimu-filter-set{
+ background-color: white;
+ margin: 15px auto 0 auto;
+ border: 0;
+}
+
+.jimu-filter-set .header-table{
+ width:100%;
+ border-collapse: collapse;
+}
+
+.jimu-filter-set .header-table .jimu-icon-delete{
+ cursor: pointer;
+}
+
+.jimu-filter-set .header-table .jimu-icon-add{
+ cursor: pointer;
+}
+
+/* css for dijit _SingleFilter */
+.jimu-single-filter{
+ background-color: white;
+ position: relative;
+}
+
+.jimu-filter-set .jimu-filter-set-delete{
+ width: 15px;
+ padding-right: 20px;
+}
+
+.jimu-filter-set .jimu-filter-set-add{
+ width: 15px;
+ padding-right: 12px;
+}
+
+.jimu-filter-set .jimu-filter-exps-box{
+ margin-bottom: -5px;
+}
+
+.jimu-filter-set .jimu-single-filter{
+ background-color: #fff;
+ margin-top: 5px;
+ padding: 5px 0;
+ /* border-bottom: 1px solid #eee; */
+}
+
+.jimu-filter-set .jimu-single-filter:last-child {
+ border-bottom: 0;
+}
+
+.jimu-filter-set .jimu-single-filter .askvalues {
+ margin-bottom: 0;
+}
+
+.jimu-single-filter .attribute-value-container{
+ display: flex;
+ flex-flow: row nowrap;
+ align-items: center;
+}
+.jimu-single-filter .attribute-value-container .value-provider-container{
+ width: calc(100% - 35px);
+}
+
+.jimu-single-filter .attribute-value-container > .value-type-set{
+ margin-left: 10px;
+ margin-right: 10px;
+}
+
+.jimu-single-filter .attribute-value-container > .jimu-filter-value-provider{
+ flex: 1 1 auto;
+ margin-left: 8px;
+}
+
+.jimu-single-filter .attribute-value-container .jimu-filter-value-provider .predefined-btn{
+ display: inline-block;
+ width: 100%;
+ line-height: 25px;
+ padding-bottom: 3px;
+ text-align: center;
+ cursor: pointer;
+ font-size: 14px;
+ border: 1px solid #CCCCCC;
+ opacity: 0.99;
+ color: #000;
+ background-color: #fff;
+}
+
+.jimu-single-filter .attribute-value-container .jimu-filter-value-provider .predefined-btn:hover{
+ background: #EEEEEE;
+}
+
+.jimu-single-filter .attribute-value-container .jimu-filter-value-provider .predefined-btn .tip{
+ max-width: 200px;
+ margin: 0 auto;
+}
+
+.jimu-rtl .jimu-single-filter .attribute-value-container > .jimu-filter-value-provider{
+ margin-left: auto;
+ margin-right: 8px;
+}
+
+.jimu-rtl .jimu-single-filter .attribute-value-container .jimu-filter-value-provider .predefined-btn .tip{
+ margin-left: 0;
+ margin-right: 8px;
+}
+
+.jimu-filter-setRtl .jimu-filter-set-delete{
+ padding-left:6px;
+}
+
+.jimu-filter-setRtl .jimu-filter-set-add{
+ padding-left:10px;
}
.jimu-single-filter .dijit-form-Select>tbody>tr>td{
@@ -2106,6 +2541,11 @@ widget:jimu-w
padding:0;
height: 100%;
height: 100% !important;
+ text-align: left; /*#13348*/
+}
+
+.jimu-rtl .jimu-single-filter .dijit-form-ValidationTextBox>div.dijitInputField>input.dijitInputInner{
+ text-align: right;
}
.jimu-single-filter .dijit-form-NumberTextBox>div.dijitInputField{
@@ -2118,6 +2558,12 @@ widget:jimu-w
height: 100%;
padding:0 !important;
height: 100% !important;
+ text-align: left;
+}
+
+.jimu-rtl .jimu-single-filter .dijit-form-NumberTextBox>div.dijitInputField>input.dijitInputInner{
+ text-align: right;
+ /* direction: rtl; */
}
.jimu-single-filter .dijit-form-DateTextBox>.dijitRight{
@@ -2143,43 +2589,13 @@ widget:jimu-w
overflow: hidden;
}
-.jimu-single-filter .value-container{
- position:relative;
- width:100%;
-}
-
-.jimu-single-filter .radio-table-container{
- margin-top: 10px;
- overflow: hidden;
-}
-
-.jimu-single-filter .radio-table{
- width:100%;
- border-collapse:collapse;
-}
-
-.jimu-single-filter .radio-table label{
- position: relative;
- left: -3px;
-}
-
-.jimu-rtl .jimu-single-filter .radio-table label{
- position: relative;
- left: auto;
- right: -3px;
-}
-
-.jimu-single-filter .jimu-checkbox div.label{
- white-space: nowrap;
-}
-
-.jimu-single-filter .jimu-icon-delete{
- margin-top:5px;
+.jimu-single-filter .jimu-icon{
cursor: pointer;
}
.jimu-single-filter .askvalues{
margin-top: 10px;
+ margin-bottom: -5px;
}
.jimu-single-filter .prompt-table{
@@ -2217,93 +2633,231 @@ widget:jimu-w
display: table-row;
}
-/* css for dijit _FilterSet */
-.jimu-filter-set .header-table{
- width:100%;
- border-collapse: collapse;
- margin-top:16px;
+.jimu-filter-valueTypePopup .value-type-popup{
+ background: #FFFFFF;
+ box-shadow: 0 0 8px 0 rgba(0,0,0,0.30);
+ color: black;
+ font-family: "Avenir Medium";
+ min-width: 204px;
+ z-index: 1;
}
-.jimu-filter-set .header-table .jimu-icon-delete{
- cursor: pointer;
+.jimu-filter-valueTypePopup .value-type-popup .value-type-popup-header{
+ width: 184px;
+ margin: 0 auto;
+ height: 35px;
+ line-height: 35px;
+ margin-bottom: 5px;
+ border-bottom: 1px solid #eee;
+ position: relative;
}
-.jimu-filter-set .header-table .jimu-icon-add{
+.jimu-filter-valueTypePopup .value-type-popup .value-type-popup-header .value-type-popup-title{
+ display: inline-block;
+ width: 160px;
+}
+.jimu-filter-valueTypePopup .value-type-popup .value-type-popup-header .value-type-popup-icon{
+ display: inline-block;
+ vertical-align: middle;
cursor: pointer;
+ position: absolute;
+ top: 10px;
+ right: 5px;
}
-
-/* css for dijit Filter */
-.jimu-filter{
- position: relative;
- width: 624px;
+.jimu-rtl .jimu-filter-valueTypePopup .value-type-popup .value-type-popup-header .value-type-popup-icon{
+ right: inherit;
+ left: 5px;
}
-
-.jimu-filter .content-section{
- width: 100%;
- height: 100%;
+.jimu-filter-parameters .value-type-popup{
+ background: #FFFFFF;
+ box-shadow: 0 0 8px 0 rgba(0,0,0,0.30);
}
-
-.jimu-filter .add-btn-section{
- overflow: hidden;
+.jimu-filter-valueTypePopup .value-type-popup ul{
+ padding: 0;
+ margin: 0;
}
-
-.jimu-filter .add-btn-section .add-expression{
- margin-right: 20px;
+.jimu-filter-valueTypePopup .value-type-popup li{
+ list-style: none;
+ padding: 0;
+ line-height: 40px;
+ cursor: pointer;
+ word-break: break-all;
+}
+.jimu-filter-valueTypePopup .value-type-popup li:hover {
+ background: #eee;
+}
+.jimu-filter-valueTypePopup .value-type-popup li.disabled{
+ color: #ccc
+}
+.jimu-filter-valueTypePopup .value-type-popup li span{
+ display: inline-block;
+ /* word-break: keep-all; */
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ vertical-align: middle; /*fixed that : overflow: hidden; will add 5px in one li */
+}
+.jimu-filter-valueTypePopup .value-type-popup li span:nth-child(1){
+ width: 149px;
+ margin-left: 27px;
+ padding-right: 10px;
+}
+.jimu-filter-valueTypePopup .value-type-popup li span:nth-child(2){
+ background: url(images/done_black.svg) center no-repeat;
+ width: 15px;
+ height: 11px;
+ display: none;
+}
+.jimu-rtl .jimu-filter-valueTypePopup .value-type-popup li span:nth-child(1){
+ margin-left: 0;
+ margin-right: 27px;
+ padding-right: 0;
+ padding-left: 10px;
+}
+.jimu-rtl .jimu-filter-valueTypePopup .value-type-popup li span:nth-child(2){
+ transform: scaleX(-1);
+}
+.jimu-filter-valueTypePopup .value-type-popup li.selected span:nth-child(2){
+ display: inline-block;
}
-.jimu-filterRtl .add-btn-section .add-expression{
- margin-right: 0;
- margin-right: 0 !important;
- margin-left: 20px;
+/*
+.claro .dojoxCheckedMultiSelect .dojoxCheckedMultiSelectWrapper{
+ width: 100%;
+ height: 98%;
+ overflow-y: auto;
+ border: 0;
+ background: none;
+}
+*/
+/* .desktop-mode for Filter */
+.jimu-filter.desktop-mode{
+ max-width: 830px;
}
+.jimu-filter.desktop-mode .jimu-single-filter .settings-container{
+ display: flex;
+ flex-flow: row nowrap;
+ align-items: center;
+}
-.jimu-filter .jimu-icon-error{
- margin-left: 5px;
+.jimu-filter.desktop-mode .jimu-single-filter .settings-container > .fields-select{
+ flex: 0 0 165px;
+ width: 165px;
}
-.jimu-filter .error-tip{
- font-size:13px;
- color:#ff0000;
- margin-left: 10px;
+.jimu-filter.desktop-mode .jimu-single-filter .settings-container > .operator-select{
+ flex: 0 0 120px;
+ width: 120px;
+ margin: 0 8px;
}
-.jimu-filter .no-filter-tip{
- font-size: 12px;
+.jimu-filter.desktop-mode .jimu-single-filter .settings-container > .attribute-value-container{
+ flex: 1 1 auto;
}
-.jimu-filter .allExpsBox{
- padding-top:12px;
- padding-bottom:4px;
+.jimu-filter.desktop-mode .jimu-single-filter .settings-container > .jimu-icon-delete{
+ flex: 0 0 16px;
+ /* margin-left: 8px; */
+ margin: 0 10px;
}
-.jimu-filter .allExpsBox > div{
- padding: 10px;
+.jimu-rtl .jimu-filter.desktop-mode .jimu-single-filter .settings-container > .jimu-icon-delete{
margin-left: auto;
- margin-right: auto;
+ margin: 0 8px;
}
-html.hr .jimu-filter .allExpsBox > div{
- padding-left: 5px;
- padding-right: 5px;
+/* .mobile-mode for Filter */
+.jimu-filter.mobile-mode{
+ height: 100%;
+}
+.jimu-filter.mobile-mode .content-section{
+ height: calc(100% - 40px);
+}
+.jimu-filter.mobile-mode .allExpsBox{
+ max-height: calc(100% - 50px);
+}
+.jimu-filter.mobile-mode .allExpsBox > .jimu-single-filter{
+ /* padding: 20px; */
+ margin: 5px auto;
}
-/* css for dijit _Tree */
-.jimu-tree .jimu-tree-check-node{
+.jimu-filter.mobile-mode .jimu-single-filter .settings-container{
position: relative;
- top: 3px;
+ margin-top: 15px;
}
-.jimu-tree .dijitTreeContainer{
+.jimu-filter.mobile-mode .jimu-single-filter .settings-container > .fields-select{
width: 100%;
}
-.jimu-tree .dijitTreeRowSelected{
- border-width: 1px;
+.jimu-filter.mobile-mode .jimu-single-filter .settings-container > .operator-select{
+ width: 100%;
+ margin-top: 10px;
}
-.jimu-tree .dijitTreeRowHover{
- border-width: 1px;
+.jimu-filter.mobile-mode .jimu-single-filter .settings-container > .attribute-value-container{
+ width: 100%;
+ margin-top: 10px;
+}
+
+.jimu-filter.mobile-mode .jimu-single-filter .settings-container > .jimu-icon-delete{
+ position: absolute;
+ right: 0;
+ top: -20px;
+}
+
+.jimu-rtl .jimu-filter.mobile-mode .jimu-single-filter .settings-container > .jimu-icon-delete{
+ right: auto;
+ left: 0;
+}
+
+
+/* css for DateValueSelector */
+.jimu-date-value-selector{
+ position: relative;
+ width: 100%;
+ height: 30px;
+ box-sizing: border-box;
+}
+
+.jimu-date-value-selector .hidden{
+ display: none !important;
+}
+
+.jimu-date-value-selector .date-type-select{
+ position: absolute;
+ left: 0;
+ right: 0;
+ top: 0;
+ width: 100%;
+}
+
+.jimu-date-value-selector .custom-date-text-box{
+ width: 100%;
+ visibility: hidden;
+}
+
+.jimu-date-is-in-value-provider, .jimu-date-is-in-value-provider .date-type-select{
+ width: 100%;
+}
+
+/* css for dijit _Tree */
+.jimu-tree .jimu-tree-check-node{
+ position: relative;
+ top: 3px;
+}
+
+.jimu-tree .dijitTreeContainer{
+ width: 100%;
+}
+
+.jimu-tree .dijitTreeRowSelected{
+ border-width: 1px;
+}
+
+.jimu-tree .dijitTreeRowHover{
+ border-width: 1px;
}
/*.jimu-tree .dijitTreeRow{
@@ -2349,10 +2903,6 @@ html.hr .jimu-filter .allExpsBox > div{
position: relative;
}
-.jimu-serviceurl-input input[type="text"]::-ms-clear{
- display: none;
-}
-
.jimu-service-validating,
.jimu-service-valid,
.jimu-service-invalid{
@@ -2501,11 +3051,18 @@ html.hr .jimu-filter .allExpsBox > div{
.jimu-item-selector .groups-section{
font-size: 14px;
+ position:absolute;
+ width:100%;
+ margin-top: 50px;
+ align-items: center;
+ margin: 0 1px;
}
.jimu-item-selector .groups-section .groups-select{
+ display: flex;
height: 30px;
- padding: 0 30px;
+ border: solid 1px #000;
+ margin: 0 5px;
}
/* css for _ItemTable */
@@ -2587,6 +3144,8 @@ html.hr .jimu-filter .allExpsBox > div{
}
.jimu-item-table .none-thumbnail-tip{
+ font-size: 12px;
+ color: #666666;
max-height: 100%;
overflow: hidden;
text-overflow: ellipsis;
@@ -2671,18 +3230,17 @@ html.hr .jimu-filter .allExpsBox > div{
position: absolute;
width: 100%;
left: 0;
- height: 54px;
+ height: 36px;
bottom: 0;
}
.jimu-service-chooser-from-portal .footer .jimu-btn{
- margin-left: 10px;
- margin-top: 10px;
+ margin-left: 14px;
}
.jimu-rtl .jimu-service-chooser-from-portal .footer .jimu-btn{
margin-left: auto;
- margin-right: 10px;
+ margin-right: 14px;
}
.jimu-service-chooser-from-portal .footer .back{
@@ -2794,6 +3352,42 @@ html.hr .jimu-filter .allExpsBox > div{
filter: Alpha(opacity=40);
}
+/* css for dijit listvalueprovider noDataTips at runtime */
+.jimu-filter-list-value-provider-tip-container{
+ position: relative;
+ width: 100%;
+ height: 20px;
+}
+
+.jimu-filter-list-value-provider-tip-container .error-tip-section{
+ position: absolute;
+ left: 0;
+ right: 0;
+ top: 0;
+ line-height: 25px;
+}
+
+.jimu-filter-list-value-provider-tip-container .error-tip-section .jimu-icon-error{
+ vertical-align: top;
+ margin-top: 4px;
+}
+
+.jimu-filter-list-value-provider-tip-container .jimu-state-error-text{
+ color: #ff0000;
+ display: inline-block;
+ font-size: 12px;
+ margin-left: 5px;
+ width: 85%;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.jimu-rtl .jimu-filter-list-value-provider-tip-container .jimu-state-error-text{
+ margin-left: 0;
+ margin-right: 10px;
+}
+
/* css for dijit LayerChooserFromMap */
.jimu-basic-layer-chooser-from-map{
position: relative;
@@ -2829,7 +3423,7 @@ html.hr .jimu-filter .allExpsBox > div{
}
.jimu-basic-layer-chooser-from-map .jimu-tree{
- position: absolute;
+ /*position: absolute;*/
left: 0;
right: 0;
width: 100%;
@@ -2838,6 +3432,88 @@ html.hr .jimu-filter .allExpsBox > div{
background: #ffffff;
}
+/* css for dijit LayerChooserFromMapLite */
+.jimu-basic-layer-chooser-from-map-lite{
+}
+
+.jimu-basic-layer-chooser-from-map-lite .tree-ul{
+ list-style-type: none;
+}
+
+.jimu-basic-layer-chooser-from-map-lite .tree-root-ul{
+ border: 1px solid #d9dde0;
+ padding-left: 0;
+ padding-right: 0;
+ margin: 0 0 0 0;
+}
+
+.jimu-basic-layer-chooser-from-map-lite .tree-subnode-ul{
+ padding-left: 20px;
+}
+
+.jimu-rtl .jimu-basic-layer-chooser-from-map-lite .tree-subnode-ul{
+ padding-right: 20px;
+}
+
+.jimu-basic-layer-chooser-from-map-lite .tree-node-div{
+ display: flex;
+}
+
+.jimu-basic-layer-chooser-from-map-lite .tree-node-column-span{
+ font-size: 14px;
+}
+
+.jimu-basic-layer-chooser-from-map-lite .collapse-span{
+ background-repeat: no-repeat;
+ background-position: center;
+ width: 13px;
+ height: 26px;
+}
+
+.jimu-basic-layer-chooser-from-map-lite .collapse-span.is-leaf{
+ background-image: url(../css/images/right_arrow_8_default.png);
+ cursor: pointer;
+}
+
+.jimu-rtl .jimu-basic-layer-chooser-from-map-lite .collapse-span.is-leaf{
+ background-image: url(../css/images/left_arrow_8_default.png);
+}
+
+.jimu-basic-layer-chooser-from-map-lite .collapse-span.is-leaf.opened{
+ background-image: url(../css/images/down_arrow_8_default.png);
+}
+
+
+.jimu-basic-layer-chooser-from-map-lite .check-box-div{
+ margin-top: 4px;
+ margin-left: 3px;
+}
+
+.jimu-basic-layer-chooser-from-map-lite .jimu-checkbox.jimu-state-disabled .checkbox{
+ cursor: default;
+}
+
+.jimu-basic-layer-chooser-from-map-lite .icon-span{
+ background-repeat: no-repeat;
+ background-position: center;
+ width: 4px;
+ height: 26px;
+}
+
+.jimu-basic-layer-chooser-from-map-lite .icon-span.display{
+ width: 24px;
+}
+
+
+.jimu-basic-layer-chooser-from-map-lite .title-span{
+ padding-top: 3px;
+ cursor: default;
+ flex: 1;
+}
+.jimu-basic-layer-chooser-from-map-lite .title-span.is-leaf{
+ cursor: pointer;
+}
+
/* css for dijit GpSource */
.jimu-gp-source{
position: relative;
@@ -2943,6 +3619,29 @@ html.hr .jimu-filter .allExpsBox > div{
margin-bottom: 15px;
}
+/* css for jimu-dijit-data-source */
+.jimu-dijit-data-source{
+ position: relative;
+ width: 100%;
+ min-height: 400px;
+}
+
+.jimu-dijit-data-source .hidden{
+ display: none;
+}
+
+.jimu-dijit-data-source > .jimu-tab3{
+ height: 100%;
+}
+
+.jimu-dijit-data-source > .jimu-tab3 > .container-node.jimu-viewstack{
+ position: absolute;
+ left: 0;
+ right: 0;
+ top: 50px;
+ bottom: 0;
+}
+
/* css for jimu-layer-chooser-with-buttons */
.jimu-layer-chooser-with-buttons{
position: relative;
@@ -2969,6 +3668,45 @@ html.hr .jimu-filter .allExpsBox > div{
height: 36px;
}
+/* css for jimu-dijit-framework-datasource-chooser */
+.jimu-dijit-framework-datasource-chooser .no-data-section{
+ display: none;
+}
+
+.jimu-dijit-framework-datasource-chooser .no-data-section .jimu-widget-note{
+ line-height: 24px;
+}
+
+.jimu-dijit-framework-datasource-chooser.no-data .no-data-section{
+ display: block;
+}
+
+/* css for jimu-dijit-framework-datasource-chooser-with-buttons */
+.jimu-dijit-framework-datasource-chooser-with-buttons{
+ position: relative;
+ width: 100%;
+ height: 100%;
+}
+
+.jimu-dijit-framework-datasource-chooser-with-buttons .chooser-container{
+ position: absolute;
+ width: 100%;
+ left: 0;
+ right: 0;
+ top: 0;
+ bottom: 40px;
+ overflow-y: auto;
+}
+
+.jimu-dijit-framework-datasource-chooser-with-buttons .footer{
+ position: absolute;
+ width: 100%;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ height: 36px;
+}
+
/* css for dijit SymbolPicker */
.jimu-symbol-picker{
display: inline-block;
@@ -3030,7 +3768,8 @@ html.hr .jimu-filter .allExpsBox > div{
width: 100%;
background-color: #485566;
box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.4);
- position: relative;
+ /* position: relative; */
+ display: flex;
}
.jimu-on-screen-widget-panel>.title-full{
cursor: default;
@@ -3044,11 +3783,19 @@ html.hr .jimu-filter .allExpsBox > div{
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
- width: 66%;
+ /* width: 66%; */
+ flex-grow: 1;
+ padding: 0 10px;
}
-.jimu-on-screen-widget-panel>.jimu-panel-title>.close-btn,
-.jimu-on-screen-widget-panel>.jimu-panel-title>.foldable-btn,
-.jimu-on-screen-widget-panel>.jimu-panel-title>.max-btn{
+.jimu-on-screen-widget-panel>.jimu-panel-title>.btns-container{
+ min-width: 35px;
+ max-width: 105px;
+ flex-grow: 0;
+ display: flex;
+}
+.jimu-on-screen-widget-panel>.jimu-panel-title>.btns-container>.close-btn,
+.jimu-on-screen-widget-panel>.jimu-panel-title>.btns-container>.foldable-btn,
+.jimu-on-screen-widget-panel>.jimu-panel-title>.btns-container>.max-btn{
width: 35px;
height: 100%;
border-radius: 11px;
@@ -3056,16 +3803,16 @@ html.hr .jimu-filter .allExpsBox > div{
cursor: pointer;
margin: 0 !important;
}
-.jimu-on-screen-widget-panel>.jimu-panel-title>.close-btn{
+.jimu-on-screen-widget-panel>.jimu-panel-title>.btns-container>.close-btn{
background: url(images/white_close_default.png) no-repeat center center;
}
-.jimu-on-screen-widget-panel>.jimu-panel-title>.fold-down{
+.jimu-on-screen-widget-panel>.jimu-panel-title>.btns-container>.fold-down{
background: url(images/fold_down.png) no-repeat center center;
}
-.jimu-on-screen-widget-panel>.jimu-panel-title>.fold-up{
+.jimu-on-screen-widget-panel>.jimu-panel-title>.btns-container>.fold-up{
background: url(images/fold_up.png) no-repeat center center;
}
-.jimu-on-screen-widget-panel>.jimu-panel-title>.max-btn{
+.jimu-on-screen-widget-panel>.jimu-panel-title>.btns-container>.max-btn{
background: url(images/max.png) no-repeat center center;
}
.jimu-on-screen-widget-panel>.jimu-panel-content{
@@ -3315,6 +4062,7 @@ html.hr .jimu-filter .allExpsBox > div{
}
.jimu-image-chooser .hint{
+ position: relative;
display: none;
width: 100%;
height: 100%;
@@ -3346,10 +4094,21 @@ html.hr .jimu-filter .allExpsBox > div{
}
.jimu-image-chooser .hint .display-image{
+ position: absolute;
cursor: pointer;
- display: inline-block;
width: 100%;
height: 100%;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ margin: 0 0 !important;
+}
+
+.jimu-image-chooser .hint .display-image.no-stretch-img{
+ width: auto !important;
+ height: auto !important;
+ max-width: 100%;
+ max-height: 100%;
}
.image-chooser-crop-popup .title {
@@ -3415,6 +4174,11 @@ html.hr .jimu-filter .allExpsBox > div{
padding:0;
height: 100%;
height: 100% !important;
+ text-align: left; /*#13348*/
+}
+
+.jimu-rtl .jimu-single-filter-parameter .dijit-form-ValidationTextBox>div.dijitInputField>input.dijitInputInner{
+ text-align: right;
}
.jimu-single-filter-parameter .dijit-form-NumberTextBox>div.dijitInputField{
@@ -3427,6 +4191,11 @@ html.hr .jimu-filter .allExpsBox > div{
height: 100%;
padding:0 !important;
height: 100% !important;
+ text-align: left; /*#13348*/
+}
+
+.jimu-rtl .jimu-single-filter-parameter .dijit-form-NumberTextBox>div.dijitInputField>input.dijitInputInner{
+ text-align: right;
}
.jimu-single-filter-parameter .dijit-form-DateTextBox>.dijitRight{
@@ -3440,10 +4209,7 @@ html.hr .jimu-filter .allExpsBox > div{
}
.jimu-single-filter-parameter .dijitSelectLabel.dijitValidationTextBoxLabel{
- width:52px;
- max-width:52px;
overflow:hidden;
- max-width:52px !important;
overflow:hidden !important;
}
@@ -3470,6 +4236,7 @@ html.hr .jimu-filter .allExpsBox > div{
.jimu-dijit-spatial-filter-features .jimu-draw-box .draw-items > div{
width: 30px;
height: 30px;
+ line-height: 30px;
margin: 0 7px;
}
@@ -3493,6 +4260,8 @@ html.hr .jimu-filter .allExpsBox > div{
/*overflow: hidden;*/
height: 40px;
white-space: nowrap;
+ display: flex;
+ justify-content: space-between;
}
.jimu-multiple-layers-featureset-chooser .hidden{
@@ -3510,17 +4279,12 @@ html.hr .jimu-filter .allExpsBox > div{
.jimu-multiple-layers-featureset-chooser > div{
height: 40px;
- line-height: 40px;
- display: inline-block;
}
.jimu-multiple-layers-featureset-chooser .draw-item-btn{
- width: 53%;
- position: relative;
+ width: 65%;
overflow: visible;
height: 40px;
- line-height: 40px;
- display: inline-block;
}
.jimu-multiple-layers-featureset-chooser .draw-item-btn .current-draw-item{
@@ -3529,77 +4293,51 @@ html.hr .jimu-filter .allExpsBox > div{
}
.jimu-multiple-layers-featureset-chooser .draw-item-btn .current-draw-item > div{
- display: inline-block;
- height: 100%;
- vertical-align: middle;
font-size: 12px;
}
.jimu-multiple-layers-featureset-chooser .btn-select{
- position: absolute;
- left: 0;
- right: 20px;
- top: 0;
- bottom: 0;
+ width: 100%;
+ height: 100%;
background-color: #009966;
- color: #ffffff;
+ color: #FFF;
text-align: center;
white-space: nowrap;
- border: 2px solid transparent;
overflow: hidden;
text-overflow: ellipsis;
+ display: flex;
+ justify-content: space-between;
+ line-height: 40px;
}
-.jimu-rtl .jimu-multiple-layers-featureset-chooser .btn-select{
- left: 20px;
- right: 0;
-}
-
-.jimu-multiple-layers-featureset-chooser .btn-select:hover{
- background-color: #006241;
-}
-
-.jimu-multiple-layers-featureset-chooser .btn-select:active{
- background-color: #59A700;
+.jimu-multiple-layers-featureset-chooser .btn-select .labels{
+ display: flex;
+ justify-content: center;
+ flex: 1 1 100%;
}
.jimu-multiple-layers-featureset-chooser .btn-select.selected{
- background-color: #009966;
- border: 2px solid #006141;
-}
-
-.jimu-multiple-layers-featureset-chooser.disabled .btn-select{
- background-color: #D2D2D2 !important;
-}
-
-.jimu-multiple-layers-featureset-chooser .current-draw-item .btn-select .select-icon{
- display: inline-block;
- text-align: center;
- position: relative;
- top: 8px;
- width: 24px;
- height: 24px;
-}
-
-.jimu-multiple-layers-featureset-chooser .current-draw-item.EXTENT .btn-select .select-icon{
- background: url(images/select_rectangle.png) center center no-repeat;
+ background: #005134;
+ border: 3px solid #009966;
+ line-height: 34px;
}
-.jimu-multiple-layers-featureset-chooser .current-draw-item.POLYGON .btn-select .select-icon{
- background: url(images/select_polygon.png) center center no-repeat;
+.jimu-multiple-layers-featureset-chooser .btn-select.selected .arrow,
+.jimu-multiple-layers-featureset-chooser .btn-select .feature-action{
+ line-height: inherit;
}
-.jimu-multiple-layers-featureset-chooser .current-draw-item.CIRCLE .btn-select .select-icon{
- background: url(images/select_circle.png) center center no-repeat;
+.jimu-multiple-layers-featureset-chooser .btn-select .feature-action{
+ color: #FFF;
+ height: 100%;
}
-.jimu-multiple-layers-featureset-chooser .current-draw-item.POLYLINE .btn-select .select-icon{
- background: url(images/select_polyline.png) center center no-repeat;
+.jimu-multiple-layers-featureset-chooser.disabled .btn-select{
+ background-color: #ccc;
+ color: #FFF;
}
.jimu-multiple-layers-featureset-chooser .btn-select .select-text{
- display: inline-block;
- text-align: center;
margin-left: 10px;
}
@@ -3609,117 +4347,51 @@ html.hr .jimu-filter .allExpsBox > div{
}
.jimu-multiple-layers-featureset-chooser .current-draw-item .arrow{
- width: 20px;
- border-left: 1px solid white;
- background-color: #009966;
- background-image: url(images/v-white.png);
- background-position: center center;
- background-repeat: no-repeat;
+ /* width: 30px; */
+ height: 100%;
+ color: #FFF;
+ opacity: 0.5;
+ flex: 0 0 30px;
}
.jimu-rtl .jimu-multiple-layers-featureset-chooser .current-draw-item .arrow{
- margin-right: 1px;
- border-left: 0;
- border-right: 1px solid white;
+ right: auto;
+ left: 0;
}
-.jimu-multiple-layers-featureset-chooser.disabled .current-draw-item .arrow{
- background-color: #D2D2D2 !important;
+.jimu-multiple-layers-featureset-chooser .current-draw-item .arrow:hover{
+ opacity: 1;
}
.jimu-multiple-layers-featureset-chooser.single-geotype .current-draw-item .arrow{
display: none !important;
}
-.jimu-multiple-layers-featureset-chooser .draw-items{
- position: absolute;
- left: 0;
- right: 0;
- top: 100%;
- height: 164px;
- background-color: white;
- color: white;
- z-index: 1;
-}
-
-.jimu-multiple-layers-featureset-chooser .draw-items .draw-item{
- position: relative;
- width: 100%;
- height: 40px;
- margin-top: 1px;
- background-color: #009966;
-}
-
-.jimu-multiple-layers-featureset-chooser .draw-items .draw-item.selected,
-.jimu-multiple-layers-featureset-chooser .draw-items .draw-item:hover{
- background-color: #006241;
-}
-
-.jimu-multiple-layers-featureset-chooser .draw-items .draw-item .draw-icon{
- float: left;
- width: 40px;
- height: 40px;
-}
-
-.jimu-multiple-layers-featureset-chooser .draw-items .draw-item-rectangle .draw-icon{
- background: url(images/select_rectangle.png) center center no-repeat;
-}
-
-.jimu-multiple-layers-featureset-chooser .draw-items .draw-item-polygon .draw-icon{
- background: url(images/select_polygon.png) center center no-repeat;
-}
-
-.jimu-multiple-layers-featureset-chooser .draw-items .draw-item-circle .draw-icon{
- background: url(images/select_circle.png) center center no-repeat;
-}
-
-.jimu-multiple-layers-featureset-chooser .draw-items .draw-item-polyline .draw-icon{
- background: url(images/select_polyline.png) center center no-repeat;
-}
-
-.jimu-multiple-layers-featureset-chooser .draw-items .draw-item .draw-text{
- position: absolute;
- left: 40px;
- right: 0;
- top: 0;
- bottom: 0;
- overflow: hidden;
- text-overflow: ellipsis;
-}
-
-.jimu-rtl .jimu-multiple-layers-featureset-chooser .draw-items .draw-item .draw-icon{
- float: right;
-}
-
-.jimu-rtl .jimu-multiple-layers-featureset-chooser .draw-items .draw-item .draw-text{
- left: 0;
- right: 40px;
-}
-
.jimu-multiple-layers-featureset-chooser .btn-clear{
- width: 35%;
+ width: 30%;
border: 1px solid #D7D7D7;
- margin-left: 10%;
color: #000000;
text-align: center;
white-space: nowrap;
- display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
}
.jimu-multiple-layers-featureset-chooser .btn-clear > div{
- display: inline-block;
text-align: center;
+ display: inline-block;
+ vertical-align: middle;
+ height: 100%;
+ line-height: 40px;
}
.jimu-multiple-layers-featureset-chooser .btn-clear:hover{
- border: 1px solid #D0021B;
+ background-color: #CC0000;
+ color: #FFFFFF;
}
-.jimu-rtl .jimu-multiple-layers-featureset-chooser .btn-clear{
- margin-left: 0;
- margin-right: 10%;
+.jimu-multiple-layers-featureset-chooser .btn-clear:hover .feature-action{
+ color: #FFFFFF;
}
.jimu-multiple-layers-featureset-chooser.disabled .btn-clear{
@@ -3728,14 +4400,6 @@ html.hr .jimu-filter .allExpsBox > div{
color: #ffffff !important;
}
-.jimu-multiple-layers-featureset-chooser .btn-clear .clear-icon{
- position: relative;
- top: 3px;
- width: 16px;
- height: 16px;
- background: url(images/unselect_features.png) center center no-repeat;
-}
-
.jimu-multiple-layers-featureset-chooser .btn-clear .clear-text{
margin-left: 10px;
}
@@ -3852,7 +4516,8 @@ html.hr .jimu-filter .allExpsBox > div{
width: 10px;
height: 10px;
cursor: pointer;
- background: url('images/close_8_default.png') no-repeat center;
+ background: url('images/close_btn_gray.svg') no-repeat center;
+ background-size: contain;
}
.jimu-appstate-popup .appstate-close:hover {
@@ -3909,7 +4574,8 @@ html.hr .jimu-filter .allExpsBox > div{
top: auto;
width: 100%;
height: 12px;
- background: url('images/close_default.png') no-repeat center;
+ background: url('images/close_btn_gray.svg') no-repeat center;
+ background-size: contain;
}
.jimu-appstate-popup.mobile .appstate-close:hover {
@@ -3980,13 +4646,17 @@ html.hr .jimu-filter .allExpsBox > div{
height: 40px;
cursor: pointer;
}
-.popup-menu .popup-menu-item:hover {
+.popup-menu .popup-menu-item:hover,
+.popup-menu .popup-menu-item.selected {
background: #F3F3F3;
}
.popup-menu .popup-menu-item .icon {
width: 40px;
height: 40px;
}
+.popup-menu .popup-menu-item .icon.no-icon {
+ width: 20px;
+}
.popup-menu .popup-menu-item .icon div {
width: 16px;
height: 16px;
@@ -4003,7 +4673,12 @@ html.hr .jimu-filter .allExpsBox > div{
max-width: 240px;
overflow: hidden;
text-overflow: ellipsis;
- margin-right: 10px;
+ margin-right: 20px;
+}
+
+.jimu-rtl .popup-menu .popup-menu-item .label {
+ margin-right: 0;
+ margin-left: 20px;
}
/*PopupMenuButton*/
@@ -4431,6 +5106,9 @@ html.hr .jimu-filter .allExpsBox > div{
color: rgba(0,0,0,0.25);
cursor: default;
}
+.feature-action.no-icon {
+ display: none;
+}
.icon-select:before {
content: '\e900';
}
@@ -4536,6 +5214,33 @@ html.hr .jimu-filter .allExpsBox > div{
.icon-save:before{
content: '\e925';
}
+.icon-road-open:before{
+ content: '\e926';
+}
+.icon-direction-open-route:before {
+ content: '\e927';
+}
+.icon-select-by-circle:before {
+ content: '\e928';
+}
+.icon-select-by-line:before {
+ content: '\e929';
+}
+.icon-select-by-polygon:before {
+ content: '\e92a';
+}
+.icon-drop-down:before {
+ content: '\e92c';
+}
+.icon-select-by-freehand-polygon:before {
+ content: '\e92d';
+}
+.icon-select-by-point:before {
+ content: '\e92e';
+}
+.icon-select-by-rect:before {
+ content: '\e92f';
+}
/* ~~ feature action icons*/
/* for statistics */
@@ -4561,6 +5266,11 @@ html.hr .jimu-filter .allExpsBox > div{
color: #000000;
background-color: #fff;
box-shadow: 0 0 4px 0 rgba(0,0,0,0.50);
+ overflow: hidden;
+ /*transition: max-height 1.5s;*/
+}
+.jimu-colorpalette .hide{
+ display: none !important;
}
.jimu-colorpalette .btn{
vertical-align: middle;
@@ -4628,6 +5338,27 @@ html.hr .jimu-filter .allExpsBox > div{
margin: 4px;
cursor: pointer;
}
+
+.jimu-colorpalette .custom-panel{
+ overflow: hidden;
+}
+.jimu-colorpalette .custom-panel .jimu-color-picker{
+ height: 100% !important;
+}
+.jimu-colorpalette .custom-panel .jimu-color-picker .dojoxColorPicker{
+ border: none;
+ background: transparent;
+}
+.jimu-colorpalette .custom-panel .btns-container {
+ margin-top: 20px;
+}
+.jimu-colorpalette .custom-panel .btns-container .jimu-btn {
+ width: 80px;
+ height: 30px;
+ margin: 0 5px;
+ vertical-align: middle;
+ line-height: 30px;
+}
/* jimu-colorPalette end */
/* marker-feature-action start */
@@ -4700,7 +5431,7 @@ html.hr .jimu-filter .allExpsBox > div{
background: #fff !important;
border-radius: 0;
border-style: none;
- box-shadow: 0 0 10px;
+ box-shadow: 0 0 12px #9A9A9A;
padding: 0;
border:none;
}
@@ -4783,4 +5514,1851 @@ html.hr .jimu-filter .allExpsBox > div{
top: 0;
bottom: 0;
z-index: 109;
-}
\ No newline at end of file
+}
+
+/*jimu-dijit-chart*/
+.jimu-dijit-chart .tooltip-div span {
+ display: block;
+}
+.jimu-dijit-chart .tooltip-div {
+ display: flex;
+ flex-direction: column;
+ justify-content: flex-start;
+ align-items: flex-start;
+}
+/*
+.jimu-rtl .jimu-dijit-chart .tooltip-div {
+ align-items: flex-end;
+}
+*/
+
+.jimu-dijit-chart .tooltip-div .tooltip-tr {
+ display: flex;
+ align-items: center;
+ justify-content: space-around;
+}
+
+.jimu-dijit-chart .tooltip-div .tooltip-tr .space-right {
+ margin-right: 5px;
+}
+
+.jimu-rtl .jimu-dijit-chart .tooltip-div .tooltip-tr .space-right {
+ margin-left: 5px;
+}
+
+.jimu-dijit-chart .tooltip-div .tooltip-tr .space-left {
+ margin-left: 5px;
+}
+
+.jimu-rtl .jimu-dijit-chart .tooltip-div .tooltip-tr .space-left {
+ margin-right: 5px;
+}
+
+.jimu-rtl .jimu-dijit-chart .tooltip-div .reverse.tooltip-tr {
+ flex-direction: row-reverse;
+}
+.jimu-dijit-chart .tooltip-div .colorEl {
+ display:inline-block;
+ border-radius:10px;
+ width:9px;
+ height:9px;
+}
+.jimu-dijit-chart .tooltip-div .marginRight5 {
+ margin-right: 5px;
+ margin-left: 0;
+}
+
+.jimu-rtl .jimu-dijit-chart .tooltip-div .marginRight5 {
+ margin-left: 5px;
+ margin-right: 0;
+}
+
+/**/
+.jimu-dijit-statistics-chart{
+ position: relative;
+}
+
+.jimu-dijit-statistics-chart .results-header{
+ display: none;
+ width: 100%;
+ height: 33px;
+}
+
+.jimu-dijit-statistics-chart.has-title .results-header{
+ display: block;
+}
+
+.jimu-dijit-statistics-chart .chart-title{
+ text-align: center;
+ width: 100%;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.jimu-dijit-statistics-chart .paging-section{
+ height: 5px;
+ margin-top: 10px;
+}
+
+.jimu-dijit-statistics-chart .paging-section ul{
+ margin: 0;
+ padding: 0;
+ height: 100%;
+ list-style: none;
+}
+
+.jimu-dijit-statistics-chart .paging-section ul li{
+ float: left;
+ height: 100%;
+}
+
+.jimu-rtl .jimu-dijit-statistics-chart .paging-section ul li{
+ float: right;
+}
+
+.jimu-dijit-statistics-chart .paging-section ul li a{
+ display: block;
+ width: 5px;
+ height: 100%;
+ padding:0 5px;
+ background-repeat: no-repeat;
+ background-position: center center;
+ background-image: url(images/dot1.png);
+ cursor: pointer;
+}
+
+.jimu-dijit-statistics-chart .paging-section ul li a:hover,.jimu-dijit-statistics-chart .paging-section ul li.selected a{
+ background-image:url(images/dot2.png);
+}
+
+.jimu-dijit-statistics-chart .settings, .jimu-dijit-statistics-chart .zoomin{
+ cursor: pointer;
+ width: 16px;
+ height: 16px;
+}
+
+.jimu-dijit-statistics-chart .settings{
+ background: no-repeat center center url(images/setting_default.png);
+}
+
+.jimu-dijit-statistics-chart .zoomin{
+ background: no-repeat center center url(images/zoom_normal.png);
+ margin-left: 5px;
+}
+
+.jimu-rtl .jimu-dijit-statistics-chart .zoomin{
+ margin-left: 0;
+ margin-right: 5px;
+}
+
+.jimu-dijit-statistics-chart .chart-section{
+ position: relative;
+ width: 100%;
+}
+
+.jimu-dijit-statistics-chart .chart-section.render-faild .chart-container {
+ display: none !important;
+}
+
+.jimu-dijit-statistics-chart .chart-section .fiald-render-info {
+ display: none;
+ align-items: center;
+ justify-content: center;
+}
+
+.jimu-dijit-statistics-chart .chart-section.render-faild .fiald-render-info {
+ display: flex !important;
+}
+
+.jimu-dijit-statistics-chart .chart-section .arrow-td{
+ width: 15px;
+}
+
+.jimu-dijit-statistics-chart .chart-section .content-td{
+ width: auto;
+}
+
+.jimu-dijit-statistics-chart.no-more-than-one-chart .chart-section .arrow-td{
+ display: none;
+ width: 0;
+}
+
+.jimu-dijit-statistics-chart .chart-section .content-td{
+ width: 100%;
+}
+
+.jimu-dijit-statistics-chart .chart-section .arrow{
+ width:100%;
+ background-repeat: no-repeat;
+ background-position: center center;
+ cursor:pointer;
+ height: 60px;
+}
+
+.jimu-dijit-statistics-chart .chart-section .arrow:hover{
+ background-color:#cccccc;
+}
+
+.jimu-dijit-statistics-chart .chart-section .left-arrow{
+ background-image:url(images/left_arrow_8_default.png);
+}
+
+.jimu-rtl .jimu-dijit-statistics-chart .chart-section .left-arrow{
+ background-image:url(./images/right_arrow_8_default.png);
+}
+
+.jimu-dijit-statistics-chart.big-preview .chart-section .chart-container{
+ width:100%;
+ margin:0 auto;
+ overflow: auto;
+}
+
+.jimu-dijit-statistics-chart .chart-section .right-arrow{
+ background-image:url(images/right_arrow_8_default.png);
+}
+
+.jimu-rtl .jimu-dijit-statistics-chart .chart-section .right-arrow{
+ background-image:url(images/left_arrow_8_default.png);
+}
+
+.jimu-dijit-statistics-chart .chart-description{
+ margin-top: 20px;
+ max-height: 48px;
+ line-height: 16px;
+ overflow-y: auto;
+}
+
+.jimu-dijit-statistics-chart-tooltip {
+ padding-right:13px;
+ padding-left: 0px;
+}
+
+.jimu-rtl .jimu-dijit-statistics-chart-tooltip {
+ padding-right:0px;
+ padding-left: 13px;
+}
+
+/* jimu-dijit-statistics-chart-settings */
+.jimu-dijit-statistics-chart-settings{
+ position: relative;
+}
+
+.jimu-dijit-statistics-chart-settings .setting-item{
+ margin-bottom: 10px;
+}
+
+.jimu-dijit-statistics-chart-settings .setting-item label{
+ margin-left: 5px;
+}
+
+.jimu-rtl .jimu-dijit-statistics-chart-settings .setting-item label{
+ margin-left: 0;
+ margin-right: 5px;
+}
+
+.jimu-dijit-statistics-chart-settings .color-tip{
+ margin-bottom: 10px;
+}
+
+.jimu-dijit-statistics-chart-settings .single-color-section{
+ width: 220px;
+}
+
+.jimu-dijit-statistics-chart-settings .single-color-div{
+ height: 30px;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ -ms-border-radius: 5px;
+ -o-border-radius: 5px;
+ border-radius: 5px;
+ margin-bottom: 15px;
+}
+
+.jimu-dijit-statistics-chart-settings .multi-color-section{
+ width: 210px;
+ max-height: 300px;
+ overflow: auto;
+}
+
+.jimu-dijit-statistics-chart-settings .multi-color-section .multi-color{
+ width: 180px;
+ height: 30px;
+ background-repeat: no-repeat;
+ background-position: center center;
+ cursor: pointer;
+}
+
+.jimu-dijit-statistics-chart-settings .multi-color-section .c1{
+ background-image: url(images/chart/c1.png);
+}
+
+.jimu-dijit-statistics-chart-settings .multi-color-section .c2{
+ background-image: url(images/chart/c2.png);
+}
+
+.jimu-dijit-statistics-chart-settings .multi-color-section .c3{
+ background-image: url(images/chart/c3.png);
+}
+
+.jimu-dijit-statistics-chart-settings .multi-color-section .c4{
+ background-image: url(images/chart/c4.png);
+}
+
+.jimu-dijit-statistics-chart-settings .multi-color-section .g1{
+ background-image: url(images/chart/g1.png);
+}
+
+.jimu-dijit-statistics-chart-settings .multi-color-section .g2{
+ background-image: url(images/chart/g2.png);
+}
+
+.jimu-dijit-statistics-chart-settings .multi-color-section .g3{
+ background-image: url(images/chart/g3.png);
+}
+
+.jimu-dijit-statistics-chart-settings .multi-color-section .g4{
+ background-image: url(images/chart/g4.png);
+}
+
+.jimu-dijit-statistics-chart-settings .multi-color-section .g5{
+ background-image: url(images/chart/g5.png);
+}
+
+.jimu-dijit-statistics-chart-settings .multi-color-section .g6{
+ background-image: url(images/chart/g6.png);
+}
+
+.jimu-dijit-statistics-chart-settings .multi-color-section .g7{
+ background-image: url(images/chart/g7.png);
+}
+
+.jimu-dijit-statistics-chart-settings .multi-color-section .g8{
+ background-image: url(images/chart/g8.png);
+}
+
+.jimu-dijit-statistics-chart-settings .multi-color-section .g9{
+ background-image: url(images/chart/g9.png);
+}
+
+.jimu-dijit-statistics-chart-settings .multi-color-section .g10{
+ background-image: url(images/chart/g10.png);
+}
+
+.jimu-dijit-statistics-chart-settings .multi-color-section .g11{
+ background-image: url(images/chart/g11.png);
+}
+
+.jimu-dijit-statistics-chart-settings .multi-color-section .g12{
+ background-image: url(images/chart/g12.png);
+}
+
+.jimu-dijit-statistics-chart-settings .multi-color-section .selected{
+ border: 2px solid #f4c6af;
+}
+
+.jimu-dijit-statistics-chart-settings .shelter{
+ display: none;
+ position: absolute;
+ width: 100%;
+ height: 100%;
+}
+/* begin jimu/layoutmanagers/GridMobileController */
+.jimu-dnd-mobile-controller {
+ position: absolute;
+ top: 10px;
+ left: 10px;
+ width: 30px;
+ height: 30px;
+ background: rgba(0,0,0,0.5);
+ color: #FFF;
+ cursor: pointer;
+}
+
+.jimu-rtl .jimu-dnd-mobile-controller {
+ right: 10px;
+ left: auto;
+}
+
+.jimu-dnd-mobile-controller .container-section {
+ position: absolute;
+ top: -10px;
+ left: -10px;
+ width: 160px;
+ height: auto;
+ max-height: 250px;
+ background: #222222;
+ color: #FFF;
+ z-index: 200;
+ animation: containerOut 300ms;
+ -moz-animation: containerOut 300ms; /* Firefox */
+ -webkit-animation: containerOut 300ms; /* Safari 和 Chrome */
+ -o-animation: containerOut 300ms; /* Opera */
+ animation-delay: -300ms;
+ -moz-animation-delay: -300ms;
+ -webkit-animation-delay: -300ms;
+ -o-animation-delay: -300ms;
+ animation-fill-mode: forwards;
+ -moz-animation-fill-mode: forwards;
+ -webkit-animation-fill-mode: forwards;
+ -o-animation-fill-mode: forwards;
+}
+
+.jimu-rtl .jimu-dnd-mobile-controller .container-section {
+ right: -10px;
+ left: auto;
+ animation: containerOutRTL 300ms;
+ -moz-animation: containerOutRTL 300ms; /* Firefox */
+ -webkit-animation: containerOutRTL 300ms; /* Safari 和 Chrome */
+ -o-animation: containerOutRTL 300ms; /* Opera */
+ animation-delay: -300ms;
+ -moz-animation-delay: -300ms;
+ -webkit-animation-delay: -300ms;
+ -o-animation-delay: -300ms;
+ animation-fill-mode: forwards;
+ -moz-animation-fill-mode: forwards;
+ -webkit-animation-fill-mode: forwards;
+ -o-animation-fill-mode: forwards;
+}
+
+.jimu-dnd-mobile-controller .container-section.out,
+.jimu-dnd-mobile-controller .container-section.in,
+.jimu-rtl .jimu-dnd-mobile-controller .container-section.out
+.jimu-rtl .jimu-dnd-mobile-controller .container-section.in {
+ animation-delay: 0s;
+ -moz-animation-delay: 0s;
+ -webkit-animation-delay: 0s;
+ -o-animation-delay: 0s;
+}
+
+.jimu-dnd-mobile-controller .container-section.in {
+ animation: containerIn 300ms;
+ -moz-animation: containerIn 300ms; /* Firefox */
+ -webkit-animation: containerIn 300ms; /* Safari 和 Chrome */
+ -o-animation: containerIn 300ms; /* Opera */
+}
+
+.jimu-rtl .jimu-dnd-mobile-controller .container-section.in {
+ animation: containerInRTL 300ms;
+ -moz-animation: containerInRTL 300ms; /* Firefox */
+ -webkit-animation: containerInRTL 300ms; /* Safari 和 Chrome */
+ -o-animation: containerInRTL 300ms; /* Opera */
+}
+
+@keyframes containerIn
+{
+ from {left: -170px;}
+ to {left: -10px;}
+}
+
+@-moz-keyframes containerIn { /* Firefox */
+ from {left: -170px;}
+ to {left: -10px;}
+}
+
+@-webkit-keyframes containerIn /* Safari 和 Chrome */
+{
+ from {left: -170px;}
+ to {left: -10px;}
+}
+
+@-o-keyframes containerIn /* Opera */
+{
+ from {left: -170px;}
+ to {left: -10px;}
+}
+
+@keyframes containerInRTL
+{
+ from {right: -170px;}
+ to {right: -10px;}
+}
+
+@-moz-keyframes containerInRTL { /* Firefox */
+ from {right: -170px;}
+ to {right: -10px;}
+}
+
+@-webkit-keyframes containerInRTL /* Safari 和 Chrome */
+{
+ from {right: -170px;}
+ to {right: -10px;}
+}
+
+@-o-keyframes containerInRTL /* Opera */
+{
+ from {right: -170px;}
+ to {right: -10px;}
+}
+
+@keyframes containerOut
+{
+ from {left: -10px;}
+ to {left: -170px;}
+}
+
+@-moz-keyframes containerOut { /* Firefox */
+ from {left: -10px;}
+ to {left: -170px;}
+}
+
+@-webkit-keyframes containerOut /* Safari 和 Chrome */
+{
+ from {left: -10px;}
+ to {left: -170px;}
+}
+
+@-o-keyframes containerOut /* Opera */
+{
+ from {left: -10px;}
+ to {left: -170px;}
+}
+
+@keyframes containerOutRTL
+{
+ from {right: -10px;}
+ to {right: -170px;}
+}
+
+@-moz-keyframes containerOutRTL { /* Firefox */
+ from {right: -10px;}
+ to {right: -170px;}
+}
+
+@-webkit-keyframes containerOutRTL /* Safari 和 Chrome */
+{
+ from {right: -10px;}
+ to {right: -170px;}
+}
+
+@-o-keyframes containerOutRTL /* Opera */
+{
+ from {right: -10px;}
+ to {right: -170px;}
+}
+
+.jimu-dnd-mobile-controller .container-section .row {
+ margin: 10px 20px;
+ cursor: pointer;
+}
+
+.jimu-dnd-mobile-controller .container-section .row .column {
+ display: inline-block;
+ vertical-align: bottom;
+}
+
+.jimu-dnd-mobile-controller .container-section .row .widget-icon {
+ width: 20px;
+ height: 20px;
+ background-size: 20px !important;
+}
+
+.jimu-dnd-mobile-controller .container-section .row .widget-label {
+ padding-left: 15px;
+ line-height: 20px;
+ width: 100px;
+}
+
+.jimu-rtl .jimu-dnd-mobile-controller .container-section .row .widget-label {
+ padding-right: 15px;
+ margin-left: auto;
+}
+/* End jimu/layoutmanagers/GridMobileController*/
+
+/* jimu-dijit-data-fields */
+.jimu-dijit-data-fields{
+ box-sizing: content-box;
+ width: 100%;
+ max-height: 200px;
+ overflow-y: auto;
+ border: 1px solid #ccc;
+ padding: 3px 0;
+}
+
+.jimu-dijit-data-fields .fields-content{
+
+}
+
+.jimu-dijit-data-fields .field-item{
+ height: 20px;
+ line-height: 20px;
+ font-size: 12px;
+}
+
+.jimu-dijit-data-fields .field-item span{
+ display: inline-block;
+ vertical-align: middle;
+}
+
+/*.jimu-dijit-data-fields .field-item.selected{
+ background: #e3ecf2;
+}*/
+
+.jimu-dijit-data-fields .field-item input{
+ margin-left: 10px;
+ margin-right: 10px;
+ vertical-align: middle;
+}
+
+.jimu-dijit-data-fields .operation{
+ display: none;
+ position: absolute;
+ right: 0;
+ top: 0;
+ width: 16px;
+ height: 50px;
+}
+
+.jimu-rtl .jimu-dijit-data-fields .operation{
+ right: auto;
+ left: 0;
+}
+
+.jimu-dijit-data-fields .operation div{
+ cursor: pointer;
+ width: 100%;
+ height: 14px;
+ /*background-repeat: no-repeat;
+ background-position: center center;*/
+}
+
+/*Do not show highlight rect in the layout*/
+.jimu-dijit-gridlayout .lm_stack_highlight{
+ display: none !important;
+}
+
+.jimu-dijit-gridlayout.lm_goldenlayout{
+ background: transparent;
+}
+
+.jimu-dijit-gridlayout .lm_content {
+ background: transparent;
+ border: 1px dashed #ccc;
+}
+
+.jimu-dijit-gridlayout.viewonly .lm_splitter{
+ display: none;
+}
+
+.jimu-dijit-gridlayout.viewonly .lm_content {
+ border: none;
+}
+
+.jimu-dijit-gridlayout.viewonly .lm_item_container > .lm_dragmask,
+.jimu-dijit-gridlayout.viewonly .lm_item_container > .lm_dragmask .lm_drag_handler {
+ display: none !important;
+}
+
+.jimu-dijit-gridlayout .lm_item_container > .lm_dragmask,
+.jimu-dijit-gridlayout .lm_item_container.lm_selected > .lm_dragmask .lm_drag_handler {
+ display: block !important;
+}
+
+.jimu-dijit-gridlayout .lm_item_container.lm_selected > .lm_dragmask {
+ border: 2px solid #24B5CC;
+}
+
+.jimu-dijit-gridlayout .lm_item_container.lm_highlight > .lm_dragmask,
+.jimu-dijit-gridlayout .lm_item_container.lm_selected.lm_highlight > .lm_dragmask {
+ border: 2px solid #CC0000;
+}
+
+.jimu-dijit-gridlayout .lm_item_container > .lm_dragmask .lm_drag_handler {
+ position: absolute;
+ top: -1px;
+ right: -1px;
+ width: 16px;
+ height: 16px;
+ background-image: url(images/menu.svg);
+ background-size: 16px;
+ z-index: 30;
+ cursor: move;
+}
+
+.jimu-rtl .jimu-dijit-gridlayout .lm_item_container .lm_dragmask .lm_drag_handler {
+ right: auto;
+ left: 0;
+}
+
+/*.jimu-dijit-data-fields .up-icon{
+ background-image: url(images/up1.png);
+}
+
+.jimu-dijit-data-fields .up-icon.high-light{
+ background-image: url(images/up2.png);
+}
+
+.jimu-dijit-data-fields .down-icon{
+ background-image: url(images/down1.png);
+ margin-top: 10px;
+}
+
+.jimu-dijit-data-fields .down-icon.high-light{
+ background-image: url(images/down2.png);
+}*/
+/* jimu.dijit.DataPreviewTable */
+.jimu-data-preview-table{
+ font-size: 12px;
+}
+
+.jimu-popup.data-preview-popup .content,
+.jimu-popup.data-preview-popup .table-container{
+ overflow-x: auto;
+ overflow-y: hidden;
+ border: none;
+}
+.jimu-popup.data-preview-popup .table-container .dgrid{
+ width:100%;
+ height:100%;
+}
+.jimu-popup.data-preview-popup .dgrid-cell{
+ border: none;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
+.jimu-popup.data-preview-popup .dgrid-header .dgrid-cell-padding {
+ padding: 5px 10px;
+}
+.jimu-popup.data-preview-popup .dgrid-header .dgrid-row-table{
+ font-family: Avenir Medium;
+ font-size: 14px;
+ color: #333333;
+}
+.jimu-popup.data-preview-popup .dgrid-header .dgrid-resize-header-container{
+ /*display: inline;*/
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
+
+.jimu-popup.data-preview-popup .dgrid-scroller{
+ margin-top: 30px;
+}
+.jimu-popup.data-preview-popup .dgrid-row .dgrid-cell-padding {
+ padding: 10px;
+}
+.jimu-rtl .jimu-popup.data-preview-popup .dgrid-row .dgrid-cell-padding {
+ text-align: right;
+}
+
+/**
+ * CSS for Coordinate Control dijit
+ **/
+.jimu-coordinate-control .jimu-input {
+ border: 1px solid #999999;
+ font-size: 12px;
+ height: 30px;
+ background-color: transparent;
+ background: white;
+ color: #d9dde0;
+ padding: 5px;
+ margin: 0;
+ border-radius: 2px;
+}
+
+.jimu-coordinate-control .coordLabel {
+ padding-bottom: 5px;
+}
+
+.jimu-coordinate-control textarea {
+ font-family: 'Avenir Medium';
+ font-size: 12px;
+ resize: none;
+ width: 240px;
+ height: 35px;
+ background-color: transparent;
+ background: #FFFFFF;
+ border: 1px solid #999999;
+ color: #000000;
+ padding: 10px 0px 10px 14px;
+ margin: 0;
+ letter-spacing: 0px;
+ display: block;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ -webkit-line-clamp: 3;
+ -webkit-box-orient: vertical;
+}
+
+.jimu-coordinate-control textarea:active {
+ border: 1px solid #15a4fa;
+}
+
+.jimu-coordinate-control .coordNameContainer {
+ margin-bottom: 6px;
+}
+
+.jimu-coordinate-control .coordinateContainer {
+ padding-top: 5px;
+ width: 95%;
+}
+
+.jimu-coordinate-control .coordarea {
+ height: 0px;
+ overflow: hidden;
+}
+
+.jimu-coordinate-control .cpbtn {
+ display: inline-block;
+ background: url('./images/coordinateControl/copy_black.png');
+ background-repeat: no-repeat;
+ background-color: transparent;
+ width: 14px;
+ height: 16px;
+}
+
+.jimu-coordinate-control .settingBtn {
+ display: inline-block;
+ background: url('./images/coordinateControl/settings_black.png');
+ background-repeat: no-repeat;
+ background-color: transparent;
+ width: 15px;
+ height: 15px;
+}
+
+.jimu-coordinate-control .settingBtn:hover {
+ background: url('./images/coordinateControl/settings_black_hover.png');
+}
+
+
+.jimu-coordinate-control .cpbtn:hover {
+ background: url('./images/coordinateControl/copy_black_hover.png');
+}
+
+.jimu-coordinate-control .zoomBtn {
+ display: inline-block;
+ background: url('./images/coordinateControl/zoom_to_black.png');
+ background-repeat: no-repeat;
+ background-color: transparent;
+ width: 15.4px;
+ height: 15.2px;
+}
+
+.jimu-coordinate-control .zoomBtn:hover {
+ background: url('./images/coordinateControl/zoom_to_black_hover.png');
+}
+
+.jimu-coordinate-control .drawPointBtn {
+ display: inline-block;
+ background: url('./images/coordinateControl/draw_black.png');
+ background-repeat: no-repeat;
+ background-color: transparent;
+ width: 11px;
+ height: 15.2px;
+}
+
+.jimu-coordinate-control .drawPointBtn-active {
+ background: url('./images/coordinateControl/draw_black_hover.png');
+}
+
+.jimu-coordinate-control .drawPointBtn:hover {
+ background: url('./images/coordinateControl/draw_black_hover.png');
+}
+
+.jimu-coordinate-control .expandBtn {
+ display: inline-block;
+ background: url('./images/coordinateControl/arrow-right_black.png');
+ background-repeat: no-repeat;
+ background-color: transparent;
+ width: 5px;
+ height: 10px;
+ vertical-align: text-top;
+}
+
+.jimu-coordinate-control .expandBtn:hover {
+ background: url('./images/coordinateControl/arrow-right_black_hover.png');
+}
+
+.jimu-coordinate-control .collapseBtn {
+ display: inline-block;
+ background: url('./images/coordinateControl/arrow-down_black.png');
+ background-repeat: no-repeat;
+ background-color: transparent;
+ width: 10px;
+ height: 5px;
+ vertical-align: text-top;
+}
+
+.jimu-coordinate-control .collapseBtn:hover {
+ background: url('./images/coordinateControl/arrow-down_black_hover.png');
+ background-repeat: no-repeat;
+ background-color: transparent;
+}
+
+.jimu-coordinate-control .crdfrmtlabel {
+ display: inline-block;
+ height: 16px;
+ font-size: 12px;
+ color: #000000;
+ /*margin-top:14px;*/
+ /*margin-right: 4px;*/
+ width: 100px;
+ /*text-align: right;*/
+ padding-left: 5px;
+}
+
+.jimu-coordinate-control .coordfrmt {
+ width:50%;
+}
+
+.jimu-coordinate-control .coordformat {
+ display: inline-flex;
+ align-items: center;
+ /*margin-bottom: 4px;*/
+}
+
+.jimu-coordinate-control .crds {
+ display: inline-block;
+ width: 130px;
+ margin-right: 10px;
+}
+
+.jimu-coordinate-control .coordarea.expanded {
+ margin-top: 0px;
+}
+
+.jimu-coordinate-control .coordarea.collapsed {
+
+}
+
+.jimu-coordinate-control .coordactions {
+ display:inline-block;
+ padding-left: 10px;
+
+}
+
+.jimu-coordinate-control .add-with-icon {
+ display: inline-block;
+ height: 40px;
+ line-height:40px;
+ color: #000000;
+ padding-right: 5px;
+}
+
+.jimu-coordinate-control .add-with-icon.coordLabel {
+ width: 75px;
+}
+
+.jimu-coordinate-control .add-output {
+ margin-bottom: 7px;
+ cursor: pointer;
+ display: inline-block;
+}
+
+.jimu-coordinate-control .add-output-coordinate-icon {
+ background-image: url(./images/add_default.png);
+ background-repeat: no-repeat;
+ background-position: center;
+ width: 14px;
+ height: 14px;
+ display: inline-block;
+ vertical-align: middle;
+}
+
+.jimu-coordinate-control .add-output-coordinate-label {
+ font-size: 14px;
+ color: #518dca;
+ margin-left: 10px;
+ /* line-height: 24px; */
+ display: inline-block;
+ height: 100%;
+ text-decoration: underline;
+}
+
+.jimu-coordinate-control .line-separator {
+ height: 2px;
+ border-bottom: 1px solid #666666;
+ width: 320px;
+ margin-top: 3px;
+}
+
+/**
+ * Coordinate Format Dialog
+ **/
+
+.jimu-coordinate-control .formatInput {
+ width: 200px;
+ height: 30px;
+ opacity: 0.99;
+ background: #FFFFFF;
+ border: 1px solid #999999;
+ color: #000000;
+ padding-left: 4px;
+ margin-left: 5px;
+}
+
+.jimu-coordinate-control .selectFormat {
+ width: 160px;
+ height: 32px;
+ opacity: 0.99;
+ background: #FFFFFF;
+ border: 1px solid #999999;
+ padding-left: 4px;
+}
+
+.jimu-coordinate-control .btnContainer {
+ text-align: right;
+ margin-top: 6px;
+ padding-right: 10px;
+}
+
+.jimu-coordinate-control .settingsContainer {
+ margin-top: 6px;
+}
+
+.jimu-coordinate-control .controlContainer {
+ margin-top: 6px;
+}
+
+.jimu-coordinate-control .formatText {
+ font-size: 12px;
+ letter-spacing: 0.39px;
+ line-height: 19px;
+ color: #000000;
+ padding-left: 3px;
+}
+
+/**CSS for LoadingShelter dijit***/
+.jimu-agol-loading{
+ position:absolute;
+ top:0;
+ left:0;
+ right:0;
+ bottom:0;
+ height:100%;
+ width:100%;
+ z-index:110;
+ background: no-repeat center center;
+ font-size:14px;
+ line-height:20px;
+}
+.jimu-agol-loading .loading-container{
+ position:absolute;
+ width:100%;
+ top:50%;
+ color:#000000;
+ font-weight:bold;
+ text-align: center;
+}
+@keyframes agol-loading {
+ 0%,80%,100% {
+ opacity: .75;
+ box-shadow: 0 0 #00ACC5;
+ height: 2rem
+ }
+
+ 40% {
+ opacity: 1;
+ box-shadow: 0 -0.5rem #00ACC5;
+ height: 2.5rem
+ }
+}
+.jimu-agol-loading .loading-container .img-div:before,
+.jimu-agol-loading .loading-container .img-div:after,
+.jimu-agol-loading .loading-container .img-div {
+ background: #00ACC5;
+ animation: agol-loading 0.8s infinite ease-in-out;
+ width: 0.85rem;
+ height: 2rem
+}
+.jimu-agol-loading .loading-container .img-div{
+ text-indent: -9999em;
+ margin: auto;
+ position: absolute;
+ right: calc(50% - 0.425rem);
+ font-size: 11px;
+ animation-delay: 0.16s;
+}
+.jimu-agol-loading .loading-container .img-div:before,
+.jimu-agol-loading .loading-container .img-div:after {
+ position: absolute;
+ top: 0;
+ content: '';
+}
+.jimu-agol-loading .loading-container .img-div:before{
+ left: -1.25rem;
+}
+.jimu-agol-loading .loading-container .img-div:after{
+ left: 1.25rem;
+ animation-delay: 0.32s;
+}
+.jimu-agol-loading .loading-container p{
+ display:inline-block;
+ height: 48px;
+ line-height:48px;
+ white-space:nowrap;
+ margin-top: 40px;
+}
+
+/* EditorChooseImage */
+.editor-container .dijitToolbar .editorIconUploadImage{
+ background-position: 3px 4px;
+}
+.editor-container .dijitToolbar .dijitButtonDisabled .editorIconUploadImage{
+ background: url(images/uploadImageIcon_disabled.gif) no-repeat;
+ background-position: 3px 4px;
+}
+
+
+/* toggle button*/
+.jimu-toggle-button{
+ width: 34px;
+ height: 19px;
+ background: #999;
+ border-radius: 10px;
+ cursor: pointer;
+}
+.jimu-toggle-button.checked{
+ background: #009966;
+}
+.jimu-toggle-button .inner{
+ width: 14px;
+ height: 14px;
+ background: white;
+ border-radius: 50%;
+ cursor: pointer;
+ margin: 3px;
+}
+.jimu-toggle-button.checked .inner{
+ float: right;
+}
+.jimu-rtl .jimu-toggle-button.checked .inner{
+ float: left;
+}
+
+/* multiple select*/
+
+.jimu-multiple-set-container .items-list-header,
+.jimu-multiple-set-container .items-list-content{
+ position: absolute;
+ left: 0;
+ right: 0;
+ top: 72px;
+ bottom: 30px;
+ overflow: auto;
+ padding: 0 20px;
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.jimu-multiple-set-container .items-list-header{
+ top: 30px;
+ bottom: auto;
+ overflow: hidden;
+ /* border-top: 1px solid #999999; */
+ border-bottom: 1px solid #999999;
+}
+
+.jimu-multiple-set-container .items-list-content .item{
+ position: relative;
+ width: 100%;
+ height: 40px;
+ border-top: 1px solid #F3F3F3;
+ cursor: pointer;
+}
+
+.jimu-multiple-set-container .items-list-content .item > *{
+ cursor: pointer;
+}
+
+.jimu-multiple-set-container .items-list-content .item:first-child{
+ border-top: 0;
+}
+
+.jimu-multiple-set-container .items-list-content .item .label{
+ display: inline-block;
+ width: 250px;
+ line-height: 40px;
+ /* font-family: AvenirNext-Regular; */
+ font-size: 14px;
+ color: #000000;
+ letter-spacing: 0.39px;
+ margin-right: 10px;
+ vertical-align: middle;
+}
+.jimu-rtl .jimu-multiple-set-container .items-list-content .item .label{
+ margin-right: 0;
+ margin-left: 7px;
+}
+.jimu-rtl .jimu-multiple-set-container .items-list-content .item .label:last-child {
+ margin-right: 0;
+}
+.jimu-rtl .jimu-multiple-set-container .items-list-content .item .lableR {
+ text-align: left;
+}
+.jimu-multiple-set-container .items-list-content .item.custom .label {
+ color: #999;
+ font-style: italic;
+}
+.jimu-multiple-set-container .items-list-content .item .label:last-child{
+ margin-right: 0;
+}
+.jimu-multiple-set-container .items-list-content .item .lableR{
+ text-align: right;
+}
+
+.jimu-multiple-set-container .items-list-header .item .label{
+ /* font-family: AvenirNext-Medium; */
+ font-size: 14px;
+ color: #000000;
+ letter-spacing: 0.39px;
+ /* font-weight: bold; */
+}
+
+.jimu-multiple-set-container .items-list-content .item .label .updateInputDiv{
+ /* width: 245px;
+ height:31px;
+ margin-left: 1px;
+ position: relative;
+ border: 1px solid #999; */
+}
+.jimu-multiple-set-container .items-list-content .item .label .inputDiv{
+ display: inline-block;
+ width: 226px;
+}
+.jimu-multiple-set-container .items-list-content .item .label .inputDiv .dijitTextBox{
+ border-color: #999;
+ /* border-color: #fff;
+ position: absolute;
+ right: 5px;
+ top: 5px; */
+}
+
+/*
+.jimu-multiple-set-container .items-list-content .item .label .searchBtn{
+ margin-left: 1px;
+ vertical-align: middle;
+}*/
+
+.jimu-multiple-set-container .items-list-content .item .label .searchBtn{
+ display: inline-block;
+ border: 1px solid #999;
+ border-left: none;
+ width: 20px;
+ height: 30px;
+ vertical-align: middle;
+
+ /* display: inline-block;
+ width: 20px;
+ height: 30px;
+ position: absolute;
+ right: 0;
+ top: 0px; */
+}
+.jimu-rtl .jimu-multiple-set-container .items-list-content .item .label .searchBtn{
+ border-left: 1px solid #dadada;
+ border-right: none;
+}
+.jimu-multiple-set-container .items-list-content .item .label .searchBtn .jimu-icon{
+ margin: 5px;
+}
+
+/* .jimu-multiple-set-container .items-list-content .item .updateInputDiv input {
+ width: 100%;
+ padding: 5px 3px;
+} */
+.jimu-multiple-set-container .items-list-content .item .checkbox,
+.jimu-multiple-set-container .items-list-content .item .radio,
+.jimu-multiple-set-container .items-list-content .item .checkboxHeader,
+.jimu-multiple-set-container .items-list-content .item .actions,
+.jimu-multiple-set-container .items-list-content .item .lableR{
+ width: 70px;
+}
+
+.jimu-multiple-set-container .items-list-content .item .label.checkbox,
+.jimu-multiple-set-container .items-list-content .item .label.radio{
+ height: 16px;
+ margin-left: 10px;
+ /* background-image: url(images/checkbox_default.png); */
+ background-repeat: no-repeat;
+ background-position-x: left;
+}
+
+.jimu-multiple-set-container .items-list-content .item .label.checkbox{
+ background-image: url(images/checkbox_default.png);
+}
+.jimu-multiple-set-container .items-list-content .item .label.checkbox.checked{
+ background-image: url(images/checked_default.png);
+}
+.jimu-multiple-set-container .items-list-content .item .label.radio{
+ background-image: url(images/radioBtn_normal.svg);
+}
+.jimu-multiple-set-container .items-list-content .item .label.radio.checked{
+ background-image: url(images/radioBtn_selected.svg);
+}
+.jimu-multiple-set-container .items-list-content .item .label.checkbox.checkboxEmpty{
+ width: 16px;
+ margin-left: 60px;
+}
+.jimu-rtl .jimu-multiple-set-container .items-list-content .item .label.checkbox.checkboxEmpty{
+ margin-left: 0;
+ margin-right: 65px;
+}
+.jimu-multiple-set-container .items-list-content .item .actions{
+ position: relative;
+ height: 100%;
+ right: 10px;
+ overflow: hidden;
+ background-color: #FFFFFF;
+}
+
+.jimu-multiple-set-container .items-list-content .item:hover .actions{
+ display: block;
+}
+
+.jimu-multiple-set-container .items-list-content .item .action{
+ width: 12px;
+ height: 12px;
+ background-repeat: no-repeat;
+ background-position: center center;
+ position: relative;
+ top: 14px;
+ cursor: pointer;
+ margin: 0 5px;
+}
+
+.jimu-multiple-set-container .items-list-content .item .action.up{
+ background-image: url(images/filter/up_normal.png);
+}
+
+.jimu-multiple-set-container .items-list-content .item .action.up:hover{
+ background-image: url(images/filter/up_hover.png);
+}
+
+.jimu-multiple-set-container .items-list-content .item .action.down{
+ background-image: url(images/filter/down_normal.png);
+}
+
+.jimu-multiple-set-container .items-list-content .item .action.down:hover{
+ background-image: url(images/filter/down_hover.png);
+}
+
+.jimu-multiple-set-container .items-list-content .item .action.delete{
+ background-image: url(images/filter/delete_normal.png);
+}
+
+.jimu-multiple-set-container .items-list-content .item .action.delete:hover{
+ background-image: url(images/filter/delete_hover.png);
+}
+
+.jimu-multiple-set-container .items-list-content .item:first-child .action.up{
+ display: none;
+}
+
+.jimu-multiple-set-container .items-list-content .item:last-child .action.down{
+ display: none;
+}
+
+/*Keep empty predefined radio item as first place all the time. #14241*/
+.jimu-multiple-set-container .items-list-content.radio-items-list-content .item:nth-child(2) .action.up{
+ display: none;
+}
+
+/* .jimu-multiple-set-container .items-list-content .item .action.enabled{
+ width: 34px;
+ height: 19px;
+ background-image: url(images/filter/enabled.png);
+}
+
+.jimu-multiple-set-container .items-list-content .item .action.disabled{
+ width: 34px;
+ height: 19px;
+ background-image: url(images/filter/disabled.png);
+} */
+
+.jimu-rtl .jimu-multiple-set-container .items-list-content .item .label.checkbox,
+.jimu-rtl .jimu-multiple-set-container .items-list-content .item .label.radio{
+ margin-right: 10px;
+ background-position-x: right;
+}
+.jimu-rtl .jimu-multiple-set-container .items-list-content .item .actions{
+ right: auto;
+ left: 10px;
+}
+/*layer multiselect option cbx
+ style works in both jimu-popup and widget
+*/
+.jimu-multiple-items-list .item{
+ line-height: 30px;
+ height: 30px;
+ overflow-y: hidden;
+ cursor: pointer;
+ padding-left: 10px;
+ /* border-bottom: 1px solid #d9dde0; */
+}
+.jimu-multiple-items-list .item:last-child{
+ /* border-bottom: none; */
+}
+.jimu-multiple-items-list .item .checkbox{
+ width: 20px;
+ height: 16px;
+ vertical-align: middle;
+ background-image: url(images/checkbox_default.png);
+ background-repeat: no-repeat;
+ display: inline-block;
+ /* margin-left: 10px; */
+}
+.jimu-rtl .jimu-multiple-items-list .item{
+ padding-left: 0;
+ padding-right: 10px;
+}
+.jimu-multiple-items-list .item .checkbox.checked{
+ background-image: url(images/checked_default.png);
+}
+.jimu-multiple-items-list .item .radio{
+ width: 20px;
+ height: 16px;
+ /* vertical-align: middle; */
+ background-image: url(images/radioBtn_normal.svg);
+ background-repeat: no-repeat;
+ /* display: inline-block; */
+ display: none; /*hide radio in UI for setting*/
+ /* margin-left: 10px;
+ margin-right: 10px; */
+}
+.jimu-multiple-items-list .item .radio.checked{
+ background-image: url(images/radioBtn_selected.svg);
+}
+.jimu-multiple-items-list .item .label{
+ font-size: 12px;
+ max-width: 167px;
+ /* line-height: 14px; */
+ vertical-align: middle;
+ display: inline-block;
+}
+.jimu-multiple-items-list .item .labelBig{
+ max-width: 190px;
+}
+.jimu-multiple-items-list .item .labelRuntime{
+ max-width: 280px;
+}
+.jimu-popup .jimu-list-multiple-select .searchKeyInput {
+ margin: 2px 10px;
+}
+.jimu-panel-content .jimu-list-multiple-select .items-content {
+ /* height: 470px; for jimu-popup */
+ padding: 5px;
+ border: 1px solid #999;
+
+}
+.jimu-popup .jimu-list-multiple-select .items-content.items-setting-popup-content {
+ height: 480px;
+}
+.jimu-popup .jimu-list-multiple-select .items-content.items-setting-dropdown-content {
+ height: 286px;
+}
+.jimu-popup .jimu-list-multiple-select .items-content.items-setting-dropdown-content .jimu-multiple-items-list{
+ /* margin: 0 3px; */
+}
+.jimu-popup .jimu-list-multiple-select .items-content.items-setting-dropdown-content.items_content_no_selected_toggle {
+ height: 301px;
+}
+.jimu-panel-content .jimu-list-multiple-select .items-content.items-widget-content {
+ /* height: 300px; */
+ max-height:225px;
+}
+.jimu-panel-content .jimu-list-multiple-select .items-content {
+ margin-top: 0;
+}
+.jimu-list-multiple-select .items-content.loading {
+ /* background-image: url('images/loading.gif');
+ background-repeat: no-repeat;
+ background-position: center 10px;
+ background-position-y: center; */
+}
+.multiple-Select{
+ width:100%;
+ height:30px;
+}
+/*expaned style at runtime*/
+.jimu-panel-content .jimu-list-multiple-select .items-content.items-widget-expaned-content {
+ border: 0;
+}
+.jimu-multiple-items-expanded-list {
+ background: #f3f3f3;
+}
+.jimu-multiple-items-expanded-list .item {
+ padding: 3px 5px;
+ margin: 0 auto;
+ margin-bottom: 5px;
+ background: #fff;
+ border-bottom: none;
+}
+.jimu-multiple-items-expanded-list .item .checkbox{
+ vertical-align: middle;
+}
+.jimu-multiple-items-expanded-list .item .radio{
+ vertical-align: middle;
+ display: inline-block;
+}
+.jimu-multiple-items-expanded-list .item .label{
+ font-size: 12px;
+}
+.jimu-rtl .jimu-multiple-items-list .item .label{
+ margin-right: 3px;
+}
+.jimu-panel-content .jimu-list-multiple-select .items-widget-content{
+ padding: 0;
+ background: #f3f3f3;
+}
+.jimu-list-multiple-select .selectedContainer{
+ position: absolute;
+ height: 324px;
+ width: 100%;
+ background: rgb(255, 255, 255);
+ z-index: 1;
+ overflow-y: auto;
+ display: none;
+}
+/*load more and no data in list multiple list*/
+.jimu-list-multiple-select .jimu-list-multiple-select-Tips{
+ /* font-family: AvenirNext-Regular; */
+ font-size: 12px;
+ color: #333333;
+ margin-top: 5px;
+ margin-left: 10px;
+ margin-right: 10px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ display:none;
+}
+.jimu-list-multiple-select .jimu-list-multiple-select-Tips.no-data-Tips{
+ font-style: italic;
+}
+.jimu-list-multiple-select .jimu-list-multiple-select-Tips.load-more-data-Tips{
+ cursor: pointer;
+ /* text-align: center; */
+ color: #24B5CC;
+ text-decoration: underline;
+ text-decoration-color: #24B5CC;
+}
+.jimu-list-multiple-select .jimu-list-multiple-select-Tips.load-more-data-Tips:hover{
+ color:#0090A8;
+ text-decoration-color: #0090A8;
+}
+
+/*show selected toggle - with icons*/
+.jimu-list-multiple-select .selectedToggleDiv{
+ margin-top: 5px;
+ height: 30px;
+ position: relative;
+ border-top: 1px solid #d9dde0;
+}
+.jimu-list-multiple-select .selectedToggleDiv .showAllIcon,
+.jimu-list-multiple-select .selectedToggleDiv .showSelectedIcon{
+ position: absolute;
+ top: 4px;
+ width: 24px;
+ height: 24px;
+ background-size: 24px 24px;
+ cursor: pointer;
+}
+.jimu-list-multiple-select .selectedToggleDiv .showAllIcon{
+ left: 10px;
+ background: url(images/showAllNormal.svg) no-repeat center;
+}
+.jimu-list-multiple-select .selectedToggleDiv .showSelectedIcon{
+ left: 36px;
+ background: url(images/showSelectedNormal.svg) no-repeat center;
+}
+.jimu-list-multiple-select .selectedToggleDiv .showAllIcon.iconHover{
+ background: url(images/showAllHover.svg) no-repeat center;
+ background-color: #eee;/*it works only after background-image */
+}
+.jimu-list-multiple-select .selectedToggleDiv .showSelectedIcon.iconHover{
+ background: url(images/showSelectedHover.svg) no-repeat center;
+ background-color: #eee;
+}
+.jimu-list-multiple-select .selectedToggleDiv .clearAllSelectedIcon{
+ position: absolute;
+ top: 8px;
+ right: 10px;
+ width: 13px;
+ height: 16px;
+ background: url(images/clearAllSelectedNormal.svg) no-repeat center;
+ background-size: 13px 16px;
+ cursor: pointer;
+}
+.jimu-list-multiple-select .selectedToggleDiv .clearAllSelectedIcon:hover{
+ background: url(images/clearAllSelectedHover.svg) no-repeat center;
+}
+.jimu-rtl .jimu-list-multiple-select .selectedToggleDiv .showAllIcon{
+ left: inherit;
+ right: 10px;
+}
+.jimu-rtl .jimu-list-multiple-select .selectedToggleDiv .showSelectedIcon{
+ left: inherit;
+ right: 34px;
+}
+.jimu-rtl .jimu-list-multiple-select .selectedToggleDiv .clearAllSelectedIcon{
+ right: inherit;
+ left: 10px;
+}
+
+/*pageControl*/
+.pageControl .pageItem {
+ float: left;
+ line-height: 21px;
+ padding: 2px 3px;
+ text-align: center;
+ cursor: pointer;
+}
+.pageControl .pageBtn {
+ background: #86d5e3;
+ width: 74px;
+ padding: 3px;
+ /* line-height: 21px; */
+ border-radius: 5px;
+}
+.pageControl .pageBtn.pageDisabled {
+ background: #f0f0f0;
+}
+
+/*filter indexButtonProvider -- check btn*/
+.checkBtn{
+ position: relative;
+ width: 100%;
+ height: 30px;
+ padding-left: 6px;
+ line-height: 30px;
+ cursor: pointer;
+ background: #fff;
+ border: 1px solid #999;
+}
+.checkBtn .checkedNumDiv, .checkBtn .checkedNameDiv{
+ display: none;
+ text-align: left;
+}
+.checkBtn .checkedNumDiv .checkedNum{
+ padding: 0 5px;
+}
+.checkBtn .checkedNameDiv{
+ width: 200px;
+ height: 30px; /*for white-space: pre*/
+}
+.checkBtn .checkBtnDownIcon{
+ position: absolute;
+ right: 5px;
+ top: 10px;
+}
+.jimu-panel .checkBtn .checkedNameDiv{
+ width: 305px;
+}
+.jimu-panel .checkBtn .checkedNameDiv.checkedEmptyNameDiv{
+ color: #666;
+}
+.jimu-rtl .checkBtn .checkedNumDiv, .jimu-rtl .checkBtn .checkedNameDiv{
+ text-align: right;
+ padding-right: 5px;
+}
+.jimu-rtl .checkBtn .checkBtnDownIcon{
+ right: auto;
+ left: 5px;
+}
+.jimu-list-multiple-select{
+ overflow-y: hidden;
+}
+.jimu-list-multiple-select .items-content{
+ margin-top: 3px;
+ overflow-y: auto;
+}
+.jimu-list-multiple-select .items-content .item {
+ /* border-bottom: 1px solid #d9dde0; */
+}
+.jimu-list-multiple-select .items-content .item.emptyItem{
+ color: #666;
+}
+.jimu-list-multiple-select .items-content .item.active {
+ color: #fff;
+ background: #999;
+}
+.jimu-list-multiple-select .items-content .item:last-child {
+ border-bottom: none;
+}
+.jimu-list-multiple-select .items-content .createNewItem{
+ color: white;
+ background: #99dfea;
+ font-size: 14px;
+ font-weight: 600;
+ line-height: 40px;
+ margin-top: 5px;
+ text-align: center;
+ cursor: pointer;
+ display: none;
+}
+.jimu-list-multiple-select .items-content .createNewItem:hover {
+ color: #fff;
+ background: #24b5cc;
+}
+
+.jimu-popup .add-label-btn{
+ width: auto;
+ height: 28px;
+ padding-left: 5px;
+ text-align: left;
+ display: inline-block;
+ color: #24B5CC;
+ cursor: pointer;
+ position: relative;
+}
+
+.jimu-popup .add-label-btn > div{
+ display: inline-block;
+ cursor: pointer;
+ height: 28px;
+ line-height: 28px;
+ font-size: 14px;
+}
+
+.jimu-popup .add-label-btn .icon{
+ position: absolute;
+ top: 7px;
+ left: 0;
+ width: 13px;
+ height: 13px;
+ background: url(images/add.png) center center no-repeat;
+ background-size: contain;
+}
+
+.jimu-popup .add-label-btn .tip{
+ position: absolute;
+ left: 18px;
+ max-width: 710px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ font-size: 13px;
+ font-family: Avenir Medium;
+}
+
+.jimu-popup .add-label-btn .tip:hover{
+ text-decoration: underline;
+}
+
+.jimu-rtl .jimu-popup .add-label-btn .icon{
+ left: auto;
+ right: 0;
+}
+.jimu-rtl .jimu-popup .add-label-btn .tip{
+ left: auto;
+ right: 18px;
+}
+
+/*list multiple value provider *** display types*/
+.jimu-popup .displayTypes{
+ width: 100%;
+ position: absolute;
+ bottom: 0;
+}
+.jimu-popup .displayTypes div{
+ font-size: 14px;
+ cursor: pointer;
+ display:inline-block;
+ vertical-align: middle;
+}
+.jimu-popup .displayTypes .title{
+ font-weight: bold;
+}
+.jimu-popup .displayTypes .option .radio{
+ width: 20px;
+ height: 16px;
+ margin-left: 10px;
+ vertical-align: middle;
+ background-image: url(images/radioBtn_normal.svg);
+ background-repeat: no-repeat;
+ background-position-x: left;
+}
+.jimu-popup .displayTypes .option.checked .radio{
+ background-image: url(images/radioBtn_selected.svg);
+}
+.jimu-popup .displayTypes .option .label{
+ width: auto;
+ min-width: 130px;
+ color: #000000;
+ vertical-align: middle;
+ /* font-family: AvenirNext-Regular; */
+ letter-spacing: 0.39px;
+}
+
+/* to mirror item under RTL */
+.jimu-rtl .jimu-flipx {
+ -moz-transform: scaleX(-1);
+ -webkit-transform: scaleX(-1);
+ -o-transform: scaleX(-1);
+ transform: scaleX(-1);
+ filter: FlipH;/*IE*/
+}
+
+/*editTable row name update input*/
+.updateInput {
+ /* background: #eee; */
+}
+
+.updateInput input {
+ line-height: 18px;
+ width: 75px;
+}
+
+.updateInput div {
+ border: 1px solid #333;
+}
+
+.updateInput span {
+ display: inline-block;
+ /* background: #e9e2e2; */
+ height: 24px;
+ vertical-align: middle;
+ line-height: 25px;
+ padding: 0 2px;
+}
+
+/*css circle loading*/
+@keyframes jimu-circle-loading {
+ to {transform: rotate(360deg);}
+}
+
+.jimu-circle-loading:before {
+ content: '';
+ box-sizing: border-box;
+ position: absolute;
+ top: 50%;
+ right: 15px;
+ width: 20px;
+ height: 20px;
+ margin-top: -10px;
+ margin-left: -10px;
+ border-radius: 50%;
+ border: 2px solid #ccc;
+ border-top-color: #7b7777;
+ animation: jimu-circle-loading .8s linear infinite;
+}
+
+.jimu-circle-loading.loading-center:before {
+ left: 50%;
+}
+.jimu-rtl .jimu-circle-loading:before {
+ right: auto;
+ left: 25px;
+}
+.jimu-rtl .jimu-circle-loading.loading-center:before {
+ left: 50%;
+}
+
+/* Mult-selector */
+.dijitMenuPopup .dojoxCheckedMultiSelectMenu .dijitMenuItem .dojoxCheckedMultiSelectMenuCheckBoxItemIcon{
+ background-image: url(sprite.png);
+ border-radius: 2px;
+ background-position: -0px -102px;
+ width: 16px;
+ height: 16px;
+}
+.dijitMenuPopup .dojoxCheckedMultiSelectMenu .dijitMenuItem.dojoxCheckedMultiSelectMenuItemChecked .dojoxCheckedMultiSelectMenuCheckBoxItemIcon{
+ background-position: -0px -123px;
+}
+/* Mult-selector */
\ No newline at end of file
diff --git a/app/jimu.js/css/popup.css b/app/jimu.js/css/popup.css
index ca3fa0f..aa3c869 100644
--- a/app/jimu.js/css/popup.css
+++ b/app/jimu.js/css/popup.css
@@ -58,6 +58,7 @@
.esriPopup .related-records-popup-projector.second-page-mode , .esriMobileInfoView.esriMobilePopupInfoView .related-records-popup-projector.second-page-mode{
min-height: 60px;
padding-top: 30px;
+ background-color: inherit;
}
.esriPopup .related-records-popup-projector .operation-box , .esriMobileInfoView.esriMobilePopupInfoView .operation-box {
@@ -73,6 +74,7 @@
/*font-weight: bold;*/
font-family: "Avenir Heavy";
font-size: 13px;
+ background-color: inherit;
}
.esriPopup .related-records-popup-projector .operation-box .previos-btn ,.esriMobileInfoView.esriMobilePopupInfoView .previos-btn{
@@ -212,3 +214,13 @@
/************related records popup projector end***************************/
+
+/* jimu-popup-link: link menu for mobile, when click logo*/
+.jimu-popup-link-close-btn{
+ width: 30px;
+ height: 30px;
+ background-image: url(images/close_btn_bg.svg);
+ background-repeat: no-repeat;
+ background-position: center;
+ user-select: none;
+}
\ No newline at end of file
diff --git a/app/jimu.js/css/sprite-icons/add_default.png b/app/jimu.js/css/sprite-icons/add_default.png
new file mode 100644
index 0000000..a6f50d5
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/add_default.png differ
diff --git a/app/jimu.js/css/sprite-icons/add_disabled.png b/app/jimu.js/css/sprite-icons/add_disabled.png
new file mode 100644
index 0000000..d3c23de
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/add_disabled.png differ
diff --git a/app/jimu.js/css/sprite-icons/add_hover.png b/app/jimu.js/css/sprite-icons/add_hover.png
new file mode 100644
index 0000000..e0f4215
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/add_hover.png differ
diff --git a/app/jimu.js/css/sprite-icons/checkbox_deafult.png b/app/jimu.js/css/sprite-icons/checkbox_deafult.png
new file mode 100644
index 0000000..53ec9f8
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/checkbox_deafult.png differ
diff --git a/app/jimu.js/css/sprite-icons/checkbox_default.png b/app/jimu.js/css/sprite-icons/checkbox_default.png
new file mode 100644
index 0000000..c11920a
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/checkbox_default.png differ
diff --git a/app/jimu.js/css/sprite-icons/checkbox_disabled.png b/app/jimu.js/css/sprite-icons/checkbox_disabled.png
new file mode 100644
index 0000000..7882a9b
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/checkbox_disabled.png differ
diff --git a/app/jimu.js/css/sprite-icons/checkbox_hover.png b/app/jimu.js/css/sprite-icons/checkbox_hover.png
new file mode 100644
index 0000000..53ec9f8
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/checkbox_hover.png differ
diff --git a/app/jimu.js/css/sprite-icons/checked_default.png b/app/jimu.js/css/sprite-icons/checked_default.png
new file mode 100644
index 0000000..bae3c7b
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/checked_default.png differ
diff --git a/app/jimu.js/css/sprite-icons/checked_disabled.png b/app/jimu.js/css/sprite-icons/checked_disabled.png
new file mode 100644
index 0000000..e076d52
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/checked_disabled.png differ
diff --git a/app/jimu.js/css/sprite-icons/checked_hover.png b/app/jimu.js/css/sprite-icons/checked_hover.png
new file mode 100644
index 0000000..bae3c7b
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/checked_hover.png differ
diff --git a/app/jimu.js/css/sprite-icons/close_8_default.png b/app/jimu.js/css/sprite-icons/close_8_default.png
new file mode 100644
index 0000000..fee1c9b
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/close_8_default.png differ
diff --git a/app/jimu.js/css/sprite-icons/close_8_hover.png b/app/jimu.js/css/sprite-icons/close_8_hover.png
new file mode 100644
index 0000000..1f8e34e
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/close_8_hover.png differ
diff --git a/app/jimu.js/css/sprite-icons/close_default.png b/app/jimu.js/css/sprite-icons/close_default.png
new file mode 100644
index 0000000..c032f3c
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/close_default.png differ
diff --git a/app/jimu.js/css/sprite-icons/close_hover.png b/app/jimu.js/css/sprite-icons/close_hover.png
new file mode 100644
index 0000000..a5b956e
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/close_hover.png differ
diff --git a/app/jimu.js/css/sprite-icons/delete_default.png b/app/jimu.js/css/sprite-icons/delete_default.png
new file mode 100644
index 0000000..22cfef7
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/delete_default.png differ
diff --git a/app/jimu.js/css/sprite-icons/delete_disabled.png b/app/jimu.js/css/sprite-icons/delete_disabled.png
new file mode 100644
index 0000000..6088db7
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/delete_disabled.png differ
diff --git a/app/jimu.js/css/sprite-icons/delete_hover.png b/app/jimu.js/css/sprite-icons/delete_hover.png
new file mode 100644
index 0000000..0135fb8
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/delete_hover.png differ
diff --git a/app/jimu.js/css/sprite-icons/down_arrow_8_default.png b/app/jimu.js/css/sprite-icons/down_arrow_8_default.png
new file mode 100644
index 0000000..f81da08
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/down_arrow_8_default.png differ
diff --git a/app/jimu.js/css/sprite-icons/down_arrow_8_hover.png b/app/jimu.js/css/sprite-icons/down_arrow_8_hover.png
new file mode 100644
index 0000000..0f9ffca
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/down_arrow_8_hover.png differ
diff --git a/app/jimu.js/css/sprite-icons/down_default.png b/app/jimu.js/css/sprite-icons/down_default.png
new file mode 100644
index 0000000..0399f36
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/down_default.png differ
diff --git a/app/jimu.js/css/sprite-icons/down_disabled.png b/app/jimu.js/css/sprite-icons/down_disabled.png
new file mode 100644
index 0000000..4d8508f
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/down_disabled.png differ
diff --git a/app/jimu.js/css/sprite-icons/down_hover.png b/app/jimu.js/css/sprite-icons/down_hover.png
new file mode 100644
index 0000000..e2d375d
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/down_hover.png differ
diff --git a/app/jimu.js/css/sprite-icons/edit_default.png b/app/jimu.js/css/sprite-icons/edit_default.png
new file mode 100644
index 0000000..7650a84
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/edit_default.png differ
diff --git a/app/jimu.js/css/sprite-icons/edit_disabled.png b/app/jimu.js/css/sprite-icons/edit_disabled.png
new file mode 100644
index 0000000..f224824
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/edit_disabled.png differ
diff --git a/app/jimu.js/css/sprite-icons/edit_hover.png b/app/jimu.js/css/sprite-icons/edit_hover.png
new file mode 100644
index 0000000..4923292
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/edit_hover.png differ
diff --git a/app/jimu.js/css/sprite-icons/error_default.png b/app/jimu.js/css/sprite-icons/error_default.png
new file mode 100644
index 0000000..caba77d
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/error_default.png differ
diff --git a/app/jimu.js/css/sprite-icons/folder_close_default.png b/app/jimu.js/css/sprite-icons/folder_close_default.png
new file mode 100644
index 0000000..cd1e591
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/folder_close_default.png differ
diff --git a/app/jimu.js/css/sprite-icons/folder_close_hover.png b/app/jimu.js/css/sprite-icons/folder_close_hover.png
new file mode 100644
index 0000000..6e75f91
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/folder_close_hover.png differ
diff --git a/app/jimu.js/css/sprite-icons/folder_open_default.png b/app/jimu.js/css/sprite-icons/folder_open_default.png
new file mode 100644
index 0000000..d9de9ff
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/folder_open_default.png differ
diff --git a/app/jimu.js/css/sprite-icons/folder_open_hover.png b/app/jimu.js/css/sprite-icons/folder_open_hover.png
new file mode 100644
index 0000000..8a4322f
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/folder_open_hover.png differ
diff --git a/app/jimu.js/css/sprite-icons/left_arrow_8_default.png b/app/jimu.js/css/sprite-icons/left_arrow_8_default.png
new file mode 100644
index 0000000..875588a
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/left_arrow_8_default.png differ
diff --git a/app/jimu.js/css/sprite-icons/right_arrow_8_default.png b/app/jimu.js/css/sprite-icons/right_arrow_8_default.png
new file mode 100644
index 0000000..13ab1bf
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/right_arrow_8_default.png differ
diff --git a/app/jimu.js/css/sprite-icons/right_arrow_8_hover.png b/app/jimu.js/css/sprite-icons/right_arrow_8_hover.png
new file mode 100644
index 0000000..33cc339
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/right_arrow_8_hover.png differ
diff --git a/app/jimu.js/css/sprite-icons/search_default.png b/app/jimu.js/css/sprite-icons/search_default.png
new file mode 100644
index 0000000..aefbfb6
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/search_default.png differ
diff --git a/app/jimu.js/css/sprite-icons/search_disabled.png b/app/jimu.js/css/sprite-icons/search_disabled.png
new file mode 100644
index 0000000..2a04044
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/search_disabled.png differ
diff --git a/app/jimu.js/css/sprite-icons/search_hover.png b/app/jimu.js/css/sprite-icons/search_hover.png
new file mode 100644
index 0000000..605d815
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/search_hover.png differ
diff --git a/app/jimu.js/css/sprite-icons/setting_default.png b/app/jimu.js/css/sprite-icons/setting_default.png
new file mode 100644
index 0000000..6184e15
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/setting_default.png differ
diff --git a/app/jimu.js/css/sprite-icons/setting_disabled.png b/app/jimu.js/css/sprite-icons/setting_disabled.png
new file mode 100644
index 0000000..6658875
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/setting_disabled.png differ
diff --git a/app/jimu.js/css/sprite-icons/setting_hover.png b/app/jimu.js/css/sprite-icons/setting_hover.png
new file mode 100644
index 0000000..421728e
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/setting_hover.png differ
diff --git a/app/jimu.js/css/sprite-icons/up_default.png b/app/jimu.js/css/sprite-icons/up_default.png
new file mode 100644
index 0000000..fd66fd5
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/up_default.png differ
diff --git a/app/jimu.js/css/sprite-icons/up_disabled.png b/app/jimu.js/css/sprite-icons/up_disabled.png
new file mode 100644
index 0000000..35da577
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/up_disabled.png differ
diff --git a/app/jimu.js/css/sprite-icons/up_hover.png b/app/jimu.js/css/sprite-icons/up_hover.png
new file mode 100644
index 0000000..f0bb9ce
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/up_hover.png differ
diff --git a/app/jimu.js/css/sprite-icons/white_close_default.png b/app/jimu.js/css/sprite-icons/white_close_default.png
new file mode 100644
index 0000000..d820d62
Binary files /dev/null and b/app/jimu.js/css/sprite-icons/white_close_default.png differ
diff --git a/app/jimu.js/css/sprite.css b/app/jimu.js/css/sprite.css
index afc6ed7..8f4be5f 100644
--- a/app/jimu.js/css/sprite.css
+++ b/app/jimu.js/css/sprite.css
@@ -4,53 +4,51 @@
.jimu-icon-down-arrow-8{background-position: -0px -13px;width:8px;height:8px;}
.jimu-icon-down-arrow-8.jimu-state-hover{background-position: -13px -13px;width:8px;height:8px;}
.jimu-icon-down-arrow-8:hover{background-position: -13px -13px;width:8px;height:8px;}
-.jimu-icon-right-arrow-8{background-position: -0px -26px;width:8px;height:8px;}
-.jimu-icon-right-arrow-8.jimu-state-hover{background-position: -13px -26px;width:8px;height:8px;}
-.jimu-icon-right-arrow-8:hover{background-position: -13px -26px;width:8px;height:8px;}
-.jimu-icon-add{background-position: -0px -47px;width:16px;height:16px;}
-.jimu-icon-add.jimu-state-disabled{background-position: -63px -47px;width:16px;height:16px;}
-.jimu-icon-add.jimu-state-hover{background-position: -21px -47px;width:16px;height:16px;}
-.jimu-icon-add:hover{background-position: -21px -47px;width:16px;height:16px;}
-.jimu-icon-checkbox{background-position: -0px -68px;width:16px;height:16px;}
-.jimu-icon-checkbox.jimu-state-hover{background-position: -21px -68px;width:16px;height:16px;}
-.jimu-icon-checkbox:hover{background-position: -21px -68px;width:16px;height:16px;}
-.jimu-icon-checkbox.jimu-state-disabled{background-position: -63px -68px;width:16px;height:16px;}
-.jimu-icon-checked{background-position: -0px -89px;width:16px;height:16px;}
-.jimu-icon-checked.jimu-state-hover{background-position: -21px -89px;width:16px;height:16px;}
-.jimu-icon-checked:hover{background-position: -21px -89px;width:16px;height:16px;}
-.jimu-icon-checked.jimu-state-disabled{background-position: -63px -89px;width:16px;height:16px;}
-.jimu-icon-close{background-position: -0px -110px;width:16px;height:16px;}
-.jimu-icon-close.jimu-state-hover{background-position: -21px -110px;width:16px;height:16px;}
-.jimu-icon-close:hover{background-position: -21px -110px;width:16px;height:16px;}
-.jimu-icon-delete{background-position: -0px -131px;width:16px;height:16px;}
-.jimu-icon-delete.jimu-state-hover{background-position: -21px -131px;width:16px;height:16px;}
-.jimu-icon-delete:hover{background-position: -21px -131px;width:16px;height:16px;}
-.jimu-icon-delete.jimu-state-disabled{background-position: -63px -131px;width:16px;height:16px;}
-.jimu-icon-down{background-position: -0px -152px;width:16px;height:16px;}
-.jimu-icon-down.jimu-state-hover{background-position: -21px -152px;width:16px;height:16px;}
-.jimu-icon-down:hover{background-position: -21px -152px;width:16px;height:16px;}
-.jimu-icon-down.jimu-state-disabled{background-position: -63px -152px;width:16px;height:16px;}
-.jimu-icon-edit{background-position: -0px -173px;width:16px;height:16px;}
-.jimu-icon-edit.jimu-state-hover{background-position: -21px -173px;width:16px;height:16px;}
-.jimu-icon-edit:hover{background-position: -21px -173px;width:16px;height:16px;}
-.jimu-icon-edit.jimu-state-disabled{background-position: -63px -173px;width:16px;height:16px;}
-.jimu-icon-error{background-position: -0px -194px;width:16px;height:16px;}
-.jimu-icon-folder-close{background-position: -0px -215px;width:16px;height:16px;}
-.jimu-icon-folder-close.jimu-state-hover{background-position: -21px -215px;width:16px;height:16px;}
-.jimu-icon-folder-close:hover{background-position: -21px -215px;width:16px;height:16px;}
-.jimu-icon-folder-open{background-position: -0px -236px;width:16px;height:16px;}
-.jimu-icon-folder-open.jimu-state-hover{background-position: -21px -236px;width:16px;height:16px;}
-.jimu-icon-folder-open:hover{background-position: -21px -236px;width:16px;height:16px;}
-.jimu-icon-search{background-position: -0px -257px;width:16px;height:16px;}
-.jimu-icon-search.jimu-state-disabled{background-position: -63px -257px;width:16px;height:16px;}
-.jimu-icon-search.jimu-state-hover{background-position: -21px -257px;width:16px;height:16px;}
-.jimu-icon-search:hover{background-position: -21px -257px;width:16px;height:16px;}
-.jimu-icon-setting{background-position: -0px -278px;width:16px;height:16px;}
-.jimu-icon-setting.jimu-state-hover{background-position: -21px -278px;width:16px;height:16px;}
-.jimu-icon-setting:hover{background-position: -21px -278px;width:16px;height:16px;}
-.jimu-icon-setting.jimu-state-disabled{background-position: -63px -278px;width:16px;height:16px;}
-.jimu-icon-up{background-position: -0px -299px;width:16px;height:16px;}
-.jimu-icon-up.jimu-state-hover{background-position: -21px -299px;width:16px;height:16px;}
-.jimu-icon-up:hover{background-position: -21px -299px;width:16px;height:16px;}
-.jimu-icon-up.jimu-state-disabled{background-position: -63px -299px;width:16px;height:16px;}
-.jimu-icon-white-close{background-position: -0px -320px;width:16px;height:16px;}
\ No newline at end of file
+.jimu-icon-left-arrow-8{background-position: -0px -26px;width:8px;height:8px;}
+.jimu-icon-right-arrow-8{background-position: -0px -39px;width:8px;height:8px;}
+.jimu-icon-right-arrow-8.jimu-state-hover{background-position: -13px -39px;width:8px;height:8px;}
+.jimu-icon-right-arrow-8:hover{background-position: -13px -39px;width:8px;height:8px;}
+.jimu-icon-add{background-position: -0px -60px;width:16px;height:16px;}
+.jimu-icon-add.jimu-state-disabled{background-position: -63px -60px;width:16px;height:16px;}
+.jimu-icon-add.jimu-state-hover{background-position: -21px -60px;width:16px;height:16px;}
+.jimu-icon-add:hover{background-position: -21px -60px;width:16px;height:16px;}
+.jimu-icon-black-close{background-position: -0px -81px;width:16px;height:16px;}
+.jimu-icon-checkbox{background-position: -0px -102px;width:16px;height:16px;}
+.jimu-icon-checkbox.jimu-state-hover{background-position: -21px -102px;width:16px;height:16px;}
+.jimu-icon-checkbox:hover{background-position: -21px -102px;width:16px;height:16px;}
+.jimu-icon-checkbox.jimu-state-disabled{background-position: -63px -102px;width:16px;height:16px;}
+.jimu-icon-checked.jimu-state-disabled{background-position: -0px -123px;width:16px;height:16px;}
+.jimu-icon-checked.jimu-state-hover{background-position: -21px -123px;width:16px;height:16px;}
+.jimu-icon-checked:hover{background-position: -21px -123px;width:16px;height:16px;}
+.jimu-icon-checked{background-position: -0px -123px;width:16px;height:16px;}
+.jimu-icon-close{background-position: -0px -144px;width:16px;height:16px;}
+.jimu-icon-close.jimu-state-hover{background-position: -21px -144px;width:16px;height:16px;}
+.jimu-icon-close:hover{background-position: -21px -144px;width:16px;height:16px;}
+.jimu-icon-delete{background-position: -0px -165px;width:16px;height:16px;}
+.jimu-icon-delete.jimu-state-hover{background-position: -21px -165px;width:16px;height:16px;}
+.jimu-icon-delete:hover{background-position: -21px -165px;width:16px;height:16px;}
+.jimu-icon-delete.jimu-state-disabled{background-position: -63px -165px;width:16px;height:16px;}
+.jimu-icon-down{background-position: -0px -186px;width:16px;height:16px;}
+.jimu-icon-down.jimu-state-disabled{background-position: -63px -186px;width:16px;height:16px;}
+.jimu-icon-down.jimu-state-hover{background-position: -21px -186px;width:16px;height:16px;}
+.jimu-icon-down:hover{background-position: -21px -186px;width:16px;height:16px;}
+.jimu-icon-edit{background-position: -0px -207px;width:16px;height:16px;}
+.jimu-icon-edit.jimu-state-hover{background-position: -21px -207px;width:16px;height:16px;}
+.jimu-icon-edit:hover{background-position: -21px -207px;width:16px;height:16px;}
+.jimu-icon-edit.jimu-state-disabled{background-position: -63px -207px;width:16px;height:16px;}
+.jimu-icon-error{background-position: -0px -228px;width:16px;height:16px;}
+.jimu-icon-folder-close{background-position: -0px -249px;width:16px;height:16px;}
+.jimu-icon-folder-close.jimu-state-hover{background-position: -21px -249px;width:16px;height:16px;}
+.jimu-icon-folder-close:hover{background-position: -21px -249px;width:16px;height:16px;}
+.jimu-icon-folder-open{background-position: -0px -270px;width:16px;height:16px;}
+.jimu-icon-folder-open.jimu-state-hover{background-position: -21px -270px;width:16px;height:16px;}
+.jimu-icon-folder-open:hover{background-position: -21px -270px;width:16px;height:16px;}
+.jimu-icon-search{background-position: -0px -291px;width:16px;height:16px;}
+.jimu-icon-search.jimu-state-hover{background-position: -21px -291px;width:16px;height:16px;}
+.jimu-icon-search:hover{background-position: -21px -291px;width:16px;height:16px;}
+.jimu-icon-search.jimu-state-disabled{background-position: -63px -291px;width:16px;height:16px;}
+.jimu-icon-setting{background-position: -0px -312px;width:16px;height:16px;}
+.jimu-icon-setting.jimu-state-hover{background-position: -21px -312px;width:16px;height:16px;}
+.jimu-icon-setting:hover{background-position: -21px -312px;width:16px;height:16px;}
+.jimu-icon-setting.jimu-state-disabled{background-position: -63px -312px;width:16px;height:16px;}
+.jimu-icon-white-close{background-position: -0px -333px;width:16px;height:16px;}
\ No newline at end of file
diff --git a/app/jimu.js/css/sprite.png b/app/jimu.js/css/sprite.png
index 1fc9628..639bcf4 100644
Binary files a/app/jimu.js/css/sprite.png and b/app/jimu.js/css/sprite.png differ
diff --git a/app/jimu.js/demo/dijit.html b/app/jimu.js/demo/dijit.html
new file mode 100644
index 0000000..0543c1e
--- /dev/null
+++ b/app/jimu.js/demo/dijit.html
@@ -0,0 +1,1384 @@
+
+
+
+
+
+
+
Jimu Dijit Demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
tab content 1
+
tab content 2
+
+
+
+
tab content 1-2
+
tab content 2-2
+
tab content 3-2
+
+
+
+
+
+
+
+
+
+
+
ShowMessage
+
ShowMessage2
+
+
+
+
+
+
+
+
+
Search while typing
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/jimu.js/dijit/AGOLLoading.js b/app/jimu.js/dijit/AGOLLoading.js
new file mode 100644
index 0000000..e06a92b
--- /dev/null
+++ b/app/jimu.js/dijit/AGOLLoading.js
@@ -0,0 +1,74 @@
+///////////////////////////////////////////////////////////////////////////
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
+//
+// Licensed under the Apache License Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+///////////////////////////////////////////////////////////////////////////
+
+define(['dojo/_base/declare',
+ 'dijit/_WidgetBase',
+ 'dijit/_TemplatedMixin',
+ 'dojo/text!./templates/AGOLLoading.html',
+ 'dojo/_base/html'
+],
+function(declare, _WidgetBase, _TemplatedMixin, template, html) {
+ return declare([_WidgetBase, _TemplatedMixin], {
+ 'baseClass': 'jimu-agol-loading',
+ declaredClass: 'jimu.dijit.AGOLLoading',
+ templateString: template,
+ loadingText:null,
+ hidden:false,
+ showLoading: true,
+
+ postMixInProperties:function(){
+ this.nls = window.jimuNls.loadingShelter;
+ },
+
+ postCreate: function(){
+ this.inherited(arguments);
+ if(this.hidden){
+ html.setStyle(this.domNode, 'display', 'none');
+ }
+ html.setStyle(this.domNode, {width: '100%', height: '100%'});
+ // this.loadingImg.src = require.toUrl('jimu') + '/images/loading2.gif';
+ if(!this.showLoading){
+ html.setStyle(this.imgDiv, 'display', 'none');
+ }
+ if(typeof this.loadingText === 'string'){
+ this.textNode.innerHTML = this.loadingText;
+ }
+ },
+
+ show:function(loadingText){
+ if(!this.domNode){
+ return;
+ }
+ if (this.hidden){
+ if(typeof loadingText === 'string'){
+ this.textNode.innerHTML = loadingText;
+ }
+ html.setStyle(this.domNode, 'display', 'block');
+ this.hidden = false;
+ }
+ },
+
+ hide:function(){
+ if(!this.domNode){
+ return;
+ }
+ if (!this.hidden){
+ html.setStyle(this.domNode, 'display', 'none');
+ this.hidden = true;
+ }
+ }
+ });
+});
\ No newline at end of file
diff --git a/app/jimu.js/dijit/AppStatePopup.js b/app/jimu.js/dijit/AppStatePopup.js
index ed828e4..50030ba 100644
--- a/app/jimu.js/dijit/AppStatePopup.js
+++ b/app/jimu.js/dijit/AppStatePopup.js
@@ -8,8 +8,9 @@ define(['dojo/_base/declare',
'dojo/on',
'dojo/mouse',
'dojo/_base/fx',
+ 'dojo/topic',
'dojo/Evented'
-], function(declare, _WidgetBase, lang, html, on, Mouse, baseFx, Evented) {
+], function(declare, _WidgetBase, lang, html, on, Mouse, baseFx, topic, Evented) {
var ANIMATION_DURATION = 1000,
AUTO_CLOSE_INTERVAL = 10000,
STATE_HIDE = 0,
@@ -64,16 +65,11 @@ define(['dojo/_base/declare',
})));
this.own(on(this.domNode, Mouse.enter, lang.hitch(this, function() {
- if(this.timeoutHandler) {
- clearTimeout(this.timeoutHandler);
- this.timeoutHandler = undefined;
- }
+ this._timerStop();
})));
this.own(on(this.domNode, Mouse.leave, lang.hitch(this, function() {
- if(this.currentState === STATE_SHOW && !this.timeoutHandler) {
- this.timeoutHandler = setTimeout(lang.hitch(this, this.hide), AUTO_CLOSE_INTERVAL);
- }
+ this._timerStart();
})));
},
@@ -103,6 +99,14 @@ define(['dojo/_base/declare',
})
}).play();
+ //wait for splash hide, when init
+ topic.subscribe("splashPopupShow", lang.hitch(this, function () {
+ this._timerStop();
+ }));
+ topic.subscribe("splashPopupHide", lang.hitch(this, function () {
+ this._timerStart();
+ }));
+
this.timeoutHandler = setTimeout(lang.hitch(this, this.hide), AUTO_CLOSE_INTERVAL);
},
@@ -137,6 +141,18 @@ define(['dojo/_base/declare',
html.setStyle(this.domNode, 'display', 'none');
})
}).play();
+ },
+
+ _timerStart: function () {
+ if (this.currentState === STATE_SHOW && !this.timeoutHandler) {
+ this.timeoutHandler = setTimeout(lang.hitch(this, this.hide), AUTO_CLOSE_INTERVAL);
+ }
+ },
+ _timerStop: function () {
+ if (this.timeoutHandler) {
+ clearTimeout(this.timeoutHandler);
+ this.timeoutHandler = undefined;
+ }
}
});
});
diff --git a/app/jimu.js/dijit/Chart.js b/app/jimu.js/dijit/Chart.js
new file mode 100644
index 0000000..038eb10
--- /dev/null
+++ b/app/jimu.js/dijit/Chart.js
@@ -0,0 +1,402 @@
+///////////////////////////////////////////////////////////////////////////
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
+//
+// Licensed under the Apache License Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+///////////////////////////////////////////////////////////////////////////
+
+define([
+ 'dojo/_base/declare',
+ 'dijit/_WidgetBase',
+ 'dojo/_base/lang',
+ 'dojo/_base/html',
+ 'dojo/Evented',
+ 'libs/echarts/echarts',
+ 'jimu/utils',
+ './_chartUtils',
+ './_Gauge',
+ './_ChartOptionFactory',
+ 'libs/echarts/light',
+ 'libs/echarts/dark'
+ ],
+ function(declare, _WidgetBase, lang, html, Evented, echarts,
+ jimuUtils, ChartUtils, Gauge, ChartOptionFactory) {
+
+ return declare([_WidgetBase, Evented], {
+ 'baseClass': 'jimu-dijit-chart',
+ templateString: '
',
+ declaredClass: 'jimu.dijit.chart',
+ // constructor -> this.config, this.chartDom
+
+ //public methods:
+ //setConfig -> update the option of this.chart.
+ //updateConfig -> update this.config's value
+ //clear -> Removes all components and charts in this.chart.
+ //resize -> Resizes chart, which should be called manually when container size changes.
+
+ //config params:
+ // "type":"bar", //"column", "line", "pie", "radar", "funnel", "gauge"
+ // "title":"string",
+ // "legend":{show:true,textStyle:{}},
+ // "xAxis":{name:'',show:true,textStyle:{},nameTextStyle:{}},
+ // yAxis: {
+ // name: '',
+ // show: true,
+ // nameTextStyle: {},
+ // format: {
+ // type: 'int' | 'float',
+ // places: number,
+ // separator: boolean
+ // }
+ // }
+ // "dataLabel":{show:true,textStyle:{}},
+ // "confine":boolean,//Whether the tooltip is limited to canvas tag
+ // "theme":"",//A registered theme name, light or dark
+ // "toolbox": ["saveAsImage", "restore", "dataView", "magicType"],
+ // "color":[],//[#fff]
+ // "backgroundColor": "#fff",
+ // "scale": true, //if stack = true, force scale = false
+ // "dataZoom": ["slider"], //inside
+ // "events": [{
+ // "name": "", //"click"、"dblclick"、"mousedown"、"mousemove"、"mouseup"、"mouseover"、"mouseout"
+ // "callback": "function (params) {}"
+ // }],
+ // "labels": [],
+ // "series": [{}], //series:[{name,data:[number or serie obj}]
+ // /**pie*/
+ // "pieMode": "",//normal,rose
+ // "roseType":"",//radius, area
+ // "labelLine": "boolean",
+ // innerRadius:number,0-50
+ // /**bar line colmun*/
+ // "stack": 'normal','percent'
+ // /* line */
+ // area:true
+ // "axisPointer": true,
+ // /**funnel*/
+ // "funnelSort": "descending",
+ // /**funnel gauge*/
+ // "min": 0,
+ // //funnel gauge
+ // "max": 100,
+ // /**radar*/
+ // "radarShape": "circle", //["circle", "polygon"],
+ // "indicator": [{}], //{name,max} only for radar
+ // /**gauge*/
+ // shape:"curved" //horizontal,vertical,curved
+ // "gaugeOption": {
+ // "columnColor":"#000",
+ // "bgColor":"",
+ // "valueStyle":{
+ // textStyle:{
+ // color:"#fff",
+ // fontSize:20,
+ // fontWeight:'bold',
+ // fontStyle:'italic',
+ // fontFamily:'Avenir Next'
+ // },
+ // formatter:'function'
+ // },
+ // "labelColor":"#000",
+ // "targetValue:[]",
+ // "showDataRangeLabel":boolean,
+ // "showTargetValueLabel":boolean,
+ // },
+ // /**advance option*/
+ // "advanceOption": {},
+ // markLine:{
+ // data: [{
+ // "name": "",
+ // "label": {
+ // "show": "boolean",
+ // "position": "", //start, middle, end
+ // "color": "",
+ // "fontSize": 12
+ // },
+ // "lineStyle": {
+ // "color": "",
+ // "width": 12,
+ // "type": "solid", //dashed, dotted
+ // },
+ // "x/yAxis": 1,
+ // }]
+ //}
+ // markArea:[{
+ // "data": [{
+ // "name": "",
+ // "x/yAxis": 1,
+ // "label": {
+ // "show": "boolean",
+ // "position": "", //"top", "left","right","bottom",
+ // "inside","insideLeft","insideRight","insideTop",
+ // "insideBottom","insideTopLeft","insideBottomLeft",
+ // "insideTopRight","insideBottomRight",
+ // "color": "",
+ // "fontSize": 12
+ // },
+ // "itemStyle": {
+ // "color": "",
+ // "opacity": 1
+ // },
+ // }, {
+ // "x/yAxis": 1,
+ // }]
+ // }]
+
+ config: null,
+
+ postCreate: function() {
+ this.inherited(arguments);
+ this._initChart();
+ },
+
+ updateConfig: function(config) {
+ if (!config) {
+ return false;
+ }
+ this.config = config;
+ this._specialThemeByConfig(config);
+ var option = this._chartFactory(config);
+ this.chart.setOption(option, true);
+
+ this._settingByGrid(config, option);
+
+ return true;
+ },
+
+ _settingByGrid: function(config, option) {
+ if (config.type === 'gauge') {
+ return this._resetGaugePosition(config);
+ }
+ var position = this.chartUtils.getAxisZeroPosition();
+ config.layout = this.chartUtils.calcDefaultLayout(config);
+ if (this.chartUtils.isAxisChart(config)) {
+ option = this.chartUtils.settingGrid(option, config);
+ option = this.chartUtils.settingDataZoom(option, config, position);
+ }
+ option = this.chartUtils.settingChartLayout(option, config);
+ this.chart.setOption(option, false);
+ },
+
+ _resetGaugePosition: function(config) {
+ this._resetGaugeGrid(config);
+ this._resetGaugeGraphic(config);
+ },
+
+ setConfig: function(config) {
+ if (!config) {
+ return false;
+ }
+
+ this.config = config;
+
+ this._specialThemeByConfig(this.config);
+ this.clear();
+ var option = this._chartFactory(this.config);
+ this.chart.setOption(option, true);
+
+ this._setAixsGrid(config, option);
+ this._resetGaugePosition(config, option);
+
+ return true;
+ },
+
+ destroy: function() {
+ this._offEvents();
+ this.clear();
+ this.inherited(arguments);
+ },
+
+ _chartFactory: function(config) {
+ this.option = this.chartOptionFactory.produceOption(config);
+ return this.option;
+ },
+
+ bindEvents: function(config) {
+ if (!this.chart || !config.events || !config.events.length) {
+ return;
+ }
+ this._offEvents();
+ config.events.forEach(lang.hitch(this, function(event) {
+ this.chart.on(event.name, event.callback);
+ }));
+
+ },
+
+ _offEvents: function() {
+ if (this.config.events && this.config.events[0]) {
+ this.config.events.forEach(lang.hitch(this, function(event) {
+ this.chart.off(event.name);
+ }));
+ }
+ },
+
+ getDataURL: function() {
+ if (!this.chart) {
+ return;
+ }
+ return this.chart.getDataURL();
+ },
+
+ clear: function() {
+ if (!this.chart) {
+ return;
+ }
+ this.chart.clear();
+ },
+
+ resize: function(width, height) {
+ if (!this.chart) {
+ return;
+ }
+
+ html.setStyle(this.domNode, {
+ width: width || '100%',
+ height: height || '100%'
+ });
+ this.chart.resize();
+ //data zoom
+ this._resizeDataZoom();
+ this._resetGaugePosition(this.config);
+ },
+
+ _resizeDataZoom: function() {
+ var option = this.option;
+ var config = this.config;
+ if (!option || !config) {
+ return;
+ }
+ var position = this.chartUtils.getAxisZeroPosition();
+ option = this.chartUtils.settingDataZoom(option, config, position);
+ this.chart.setOption(option);
+ },
+
+ _setAixsGrid: function(config, option) {
+ if (this.chartUtils.isAxisChart(config)) {
+ option = this.chartUtils.settingGrid(option, config);
+ this.chart.setOption(option, false);
+ }
+ },
+
+ _resetGaugeGraphic: function(config) {
+ if (config.type === 'gauge') {
+ this.gauge.resetGraphic(config);
+ }
+ },
+
+ _resetGaugeGrid: function(config) {
+ if (config.type === 'gauge') {
+ this.gauge.resetGrid(config);
+ }
+ },
+
+ _specialChartTheme: function() {
+ if (!this.chart) {
+ return;
+ }
+ //_theme.axisPointer
+ this.chart._theme.tooltip.axisPointer = {
+ type: 'cross',
+ label: {
+ show: true,
+ precision: 2,
+ formatter: function(params) {
+ if (typeof params.value === 'number') {
+ var value = parseFloat(params.value).toFixed(2);
+ return this.chartUtils.tryLocaleNumber(value);
+ } else {
+ return params.value;
+ }
+ }.bind(this)
+ },
+ lineStyle: {
+ color: '#27727B',
+ type: 'dashed'
+ },
+ crossStyle: {
+ color: '#27727B'
+ },
+ shadowStyle: {
+ color: 'rgba(200,200,200,0.3)'
+ }
+ };
+ //value axis formatter
+ if (!this.chart._theme.valueAxis) {
+ this.chart._theme.valueAxis = {};
+ }
+ if (!this.chart._theme.valueAxis.axisLabel) {
+ this.chart._theme.valueAxis.axisLabel = {};
+ }
+ this.chart._theme.valueAxis.axisLabel.formatter = function(value) {
+ return jimuUtils.localizeNumber(value);
+ };
+ },
+
+ _specialThemeByConfig: function(config) {
+ this._initChartTheme();
+ //mixin color to _theme
+ if (config.color && config.color[0]) {
+ this.chart._theme.color = config.color;
+ }
+ // if (config.confine) {
+ this.chart._theme.tooltip.confine = true;
+ // }
+
+ var isPercent = config.stack === 'percent';
+
+ this.chart._theme.tooltip.formatter = function(params) {
+ return this.chartUtils.handleToolTip(params, null, false, isPercent);
+ }.bind(this);
+ },
+
+ _initChartTheme: function() {
+ if (!this.chart) {
+ return;
+ }
+ if (!this.chart._theme) {
+ this.chart._theme = {};
+ }
+ if (!this.chart._theme.tooltip) {
+ this.chart._theme.tooltip = {};
+ }
+ if (!this.chart._theme.valueAxis) {
+ this.chart._theme.valueAxis = {};
+ }
+ if (!this.chart._theme.valueAxis.axisLabel) {
+ this.chart._theme.valueAxis.axisLabel = {};
+ }
+ },
+
+ _initChart: function() {
+ var theme = this.config && this.config.theme;
+ theme = theme || 'light';
+ this.chart = echarts.init(this.domNode, theme);
+
+ this.chartUtils = new ChartUtils({
+ chart: this.chart
+ });
+
+ this.gauge = new Gauge({
+ chart: this.chart,
+ chartUtils: this.chartUtils
+ });
+
+ this.chartOptionFactory = new ChartOptionFactory({
+ chart: this.chart,
+ gauge: this.gauge,
+ chartUtils: this.chartUtils
+ });
+ this._specialChartTheme(this.config);
+ }
+
+ });
+ });
\ No newline at end of file
diff --git a/app/jimu.js/dijit/CheckBox.js b/app/jimu.js/dijit/CheckBox.js
index 66d6116..eef4c32 100644
--- a/app/jimu.js/dijit/CheckBox.js
+++ b/app/jimu.js/dijit/CheckBox.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -21,9 +21,10 @@ define([
'dojo/_base/html',
'dojo/dom-class',
'dojo/on',
- 'dojo/Evented'
+ 'dojo/Evented',
+ "dojo/keys"
],
-function(declare, _WidgetBase, lang, html, domClass, on, Evented) {
+function(declare, _WidgetBase, lang, html, domClass, on, Evented, keys) {
return declare([_WidgetBase, Evented], {
'baseClass': 'jimu-checkbox',
@@ -32,10 +33,11 @@ function(declare, _WidgetBase, lang, html, domClass, on, Evented) {
checked: false,
status: true,
label: "",
+ title: "", //it's used for screen reader when no label'
postCreate: function(){
this.checkNode = html.create('div', {
- 'class': 'checkbox jimu-float-leading'
+ 'class': 'checkbox jimu-float-leading jimu-icon jimu-icon-checkbox'
}, this.domNode);
this.labelNode = html.create('div', {
'class': 'label jimu-float-leading',
@@ -43,9 +45,11 @@ function(declare, _WidgetBase, lang, html, domClass, on, Evented) {
}, this.domNode);
if(this.checked){
html.addClass(this.checkNode, 'checked');
+ html.addClass(this.checkNode, 'jimu-icon-checked');
}
if(!this.status){
html.addClass(this.domNode, 'jimu-state-disabled');
+ html.addClass(this.checkNode, 'jimu-state-disabled');
}
this.own(
@@ -70,11 +74,14 @@ function(declare, _WidgetBase, lang, html, domClass, on, Evented) {
}))
);
this._udpateLabelClass();
+
+ this._initSection508();
},
setLabel: function(label){
this.label = label;
this.labelNode.innerHTML = this.label;
+ this.labelNode.title = this.label;
this._udpateLabelClass();
},
@@ -88,6 +95,37 @@ function(declare, _WidgetBase, lang, html, domClass, on, Evented) {
}
},
+
+ _initSection508: function () {
+ html.setAttr(this.domNode, 'tabindex', '0');
+ if(this.label === ''){
+ html.setAttr(this.domNode, 'title', this.title);//read content's string
+ }
+ html.setAttr(this.domNode, 'role', 'checkbox');
+ this._changeAriaCheckedAttr();
+ //css class
+ this.own(on(this.domNode, 'focus', lang.hitch(this, function () {
+ html.addClass(this.checkNode, "dijitCheckBoxFocused");
+ })));
+ this.own(on(this.domNode, 'blur', lang.hitch(this, function () {
+ html.removeClass(this.checkNode, "dijitCheckBoxFocused");
+ })));
+ //use keydown instead of keypress event, for#14747
+ this.own(on(this.domNode, 'keydown', lang.hitch(this, function (evt) {
+ var charOrCode = evt.charCode || evt.keyCode;
+ if (html.hasClass(this.checkNode, "dijitCheckBoxFocused") &&
+ (keys.SPACE === charOrCode || keys.ENTER === charOrCode)) {
+ if (this.status) {
+ if (this.checked) {
+ this.uncheck();
+ } else {
+ this.check();
+ }
+ }
+ }
+ })));
+ },
+
setValue: function(value){
if(!this.status){
return;
@@ -112,8 +150,10 @@ function(declare, _WidgetBase, lang, html, domClass, on, Evented) {
if(this.status){
domClass.remove(this.domNode, 'jimu-state-disabled');
+ html.removeClass(this.checkNode, 'jimu-state-disabled');
}else{
domClass.add(this.domNode, 'jimu-state-disabled');
+ html.addClass(this.checkNode, 'jimu-state-disabled');
}
if(isStatusChanged){
@@ -125,13 +165,16 @@ function(declare, _WidgetBase, lang, html, domClass, on, Evented) {
return this.status;
},
- check: function(){
+ check: function(notEvent){
if(!this.status){
return;
}
this.checked = true;
- html.addClass(this.checkNode, 'checked');
- this.onStateChange();
+ html.addClass(this.checkNode, 'checked jimu-icon-checked');
+ html.removeClass(this.checkNode, 'checked jimu-icon-checkbox');
+ if(!notEvent){
+ this.onStateChange();
+ }
},
uncheck: function(notEvent){
@@ -140,6 +183,9 @@ function(declare, _WidgetBase, lang, html, domClass, on, Evented) {
}
this.checked = false;
html.removeClass(this.checkNode, 'checked');
+ html.removeClass(this.checkNode, 'jimu-icon-checked');
+ html.addClass(this.checkNode, 'jimu-icon-checkbox');
+
if(!notEvent){
this.onStateChange();
}
@@ -150,6 +196,18 @@ function(declare, _WidgetBase, lang, html, domClass, on, Evented) {
this.onChange(this.checked);
}
this.emit('change', this.checked);
+ this._changeAriaCheckedAttr();
+ },
+
+ _changeAriaCheckedAttr: function(){
+ var ariaChecked = this.checked ? 'true' : 'false';
+ html.setAttr(this.domNode, 'aria-checked', ariaChecked);
+ },
+
+ focus: function () {
+ if (this.checkNode && this.checkNode.focus) {
+ this.checkNode.focus();
+ }
}
});
});
\ No newline at end of file
diff --git a/app/jimu.js/dijit/ColorChooser.js b/app/jimu.js/dijit/ColorChooser.js
index 2f15c84..201f49c 100644
--- a/app/jimu.js/dijit/ColorChooser.js
+++ b/app/jimu.js/dijit/ColorChooser.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/app/jimu.js/dijit/ColorPalette.js b/app/jimu.js/dijit/ColorPalette.js
index 2ec7c41..9beb168 100644
--- a/app/jimu.js/dijit/ColorPalette.js
+++ b/app/jimu.js/dijit/ColorPalette.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,7 +14,8 @@
// limitations under the License.
///////////////////////////////////////////////////////////////////////////
-define(['dojo/_base/declare',
+define(['dojo/Evented',
+ 'dojo/_base/declare',
'dijit/_WidgetBase',
'dijit/_TemplatedMixin',
'dijit/_WidgetsInTemplateMixin',
@@ -24,28 +25,30 @@ define(['dojo/_base/declare',
'dojo/_base/Color',
'dojo/query',
"jimu/dijit/ColorChooser",
- 'jimu/dijit/ColorPicker',
+ 'jimu/dijit/CustomColorPicker',
'jimu/dijit/ColorRecords',
'dijit/popup',
'jimu/utils',
"dijit/a11yclick"
],
- function (declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
+ function (Evented, declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
lang, html, on, Color, query,
- ColorChooser, JimuColorPicker, ColorRecords, dojoPopup, jimuUtils, a11yclick) {
- return declare([_WidgetBase, _WidgetsInTemplateMixin, _TemplatedMixin], {
+ ColorChooser, CustomColorPicker, ColorRecords, dojoPopup, jimuUtils, a11yclick) {
+ return declare([_WidgetBase, _WidgetsInTemplateMixin, _TemplatedMixin, Evented], {
templateString: "
",
baseClass: 'jimu-color-palette',
declaredClass: 'jimu.dijit.ColorPalette',
_TRANSPARENT_STR: "rgba(0, 0, 0, 0)",
- value: "",//dojoColor
+ value: "",//typeof dojoColor
_defaultAppearance: {
showTransparent: true,
showColorPalette: true,
- showColorPickerOK: false,
showCoustom: true,
- showCoustomRecord: true
+ showColorPickerOK: false,//ok btn
+ showColorPickerApply: true,//apply btn
+ showCoustomRecord: true,
+ closeDialogWhenChange: false//close colorPalette dialog, when color changed
},
recordUID: "",//uid for colorRecords
@@ -65,22 +68,32 @@ define(['dojo/_base/declare',
this._createContent();
},
+
+ initUI: function () {
+ //restore init ui
+ var isTirggerEvent = false;
+ this._toggleCustomColorPicker("init", isTirggerEvent);
+ },
+
_createContent: function () {
this.appearance = lang.mixin(this._defaultAppearance, this.appearance);
var tooltipDialogContent = html.create("div", { "class": "jimu-colorpalette" }, this.domNode);
+ this.initPanel = html.create("div", { "class": "init-panel" }, tooltipDialogContent);
+ this.customPanel = html.create("div", { "class": "custom-panel hide" }, tooltipDialogContent);
+
if (this.appearance.showTransparent) {
- this._createSpecialColors(tooltipDialogContent);
+ this._createSpecialColors( this.initPanel);
}
if (this.appearance.showColorPalette) {
- this._createColorChooser(tooltipDialogContent);
+ this._createColorChooser( this.initPanel);
}
if (this.appearance.showCoustom) {
- this._createJimuColorPicker(tooltipDialogContent);
+ this._createCustomColorPicker( this.initPanel);
}
if (this.appearance.showCoustom && this.appearance.showCoustomRecord) {
- this._createCoustomRecord(tooltipDialogContent);
+ this._createCoustomRecord( this.initPanel);
}
},
setColor: function (newColor) {
@@ -106,12 +119,20 @@ define(['dojo/_base/declare',
getColor: function () {
return this.value;
},
- changeColor: function(){
+ changeColor: function(isClose){
if ("undefined" !== typeof this.value.a && 0 === this.value.a) {
this.onChange(this.value);
} else {
this.onChange(this.value.toHex());
}
+
+ this.emit("change", this.value);
+
+ if (true === this.appearance.closeDialogWhenChange &&
+ isClose !== false//DO NOT close dialog, when apply click
+ ) {
+ this._closeDialog();
+ }
},
refreshRecords: function () {
if (this.colorRecords) {
@@ -166,34 +187,63 @@ define(['dojo/_base/declare',
})));
},
- //3. JimuColorPicker
- _createJimuColorPicker: function (tooltipDialogContent) {
+ //3. customColorPicker
+ _createCustomColorPicker: function () {
this.coustomtBtn = html.create("div", {
- "class": "coustom btn"
- }, tooltipDialogContent);
+ "class": "coustom btn",
+ "innerHTML": '
' +
+ '
' + this.nls.custom + '
'
+ }, this.initPanel);
+
+ this.own(on(this.coustomtBtn, 'click', lang.hitch(this, function () {
+ this._toggleCustomColorPicker("custom");
+ })));
- var customColorHtml = '
' +
- '
' + this.nls.custom + '
';
- this.picker = new JimuColorPicker({
- ensureMode: true,
+ this.picker = new CustomColorPicker({
showOk: this.appearance.showColorPickerOK,
- showLabel: false,
- value: this.value.toHex(),
- onChange: lang.hitch(this, function (colorHex) {
- //JimuColorPicker use hex or RGB only, can't use Rgba
- var color = new Color(colorHex);
- this.setColor(color);
- this.changeColor();
-
- if (this.colorRecords && this.colorRecords.push) {
- this.colorRecords.push(color);
- }
- })
+ showApply: this.appearance.showColorPickerApply,
+ value: this.value.toHex()
});
- this.picker.placeAt(this.coustomtBtn);
- this.picker.setLabel(customColorHtml);//icon + text
- //this.picker.setColor(this.value, false);
+
+ this.picker.placeAt(this.customPanel);
this.picker.setColor(this.value);
+
+ this.own(on(this.picker, 'ok', lang.hitch(this, function (color) {
+ this.setColor(new Color(color));
+ this.changeColor();
+
+ this._addAColorRecord(color);
+
+ this._toggleCustomColorPicker("init");
+ this._closeDialog();
+ })));
+ this.own(on(this.picker, 'apply', lang.hitch(this, function (color) {
+ this.setColor(new Color(color));
+ var isClose = false;
+ this.changeColor(isClose);
+
+ this._addAColorRecord(color);
+ })));
+ this.own(on(this.picker, 'cancel', lang.hitch(this, function () {
+ this._toggleCustomColorPicker("init");
+ this._closeDialog();
+ })));
+ },
+
+ _toggleCustomColorPicker: function (mode, isTirgger) {
+ if ("custom" === mode) {
+ html.removeClass(this.customPanel, "hide");
+ html.addClass(this.initPanel, "hide");
+ } else {
+ html.addClass(this.customPanel, "hide");
+ html.removeClass(this.initPanel, "hide");
+ }
+
+ if ("undefined" !== typeof isTirgger && false === isTirgger) {
+
+ } else {
+ this.emit("change-style");
+ }
},
//4. CoustomRecord
@@ -209,6 +259,11 @@ define(['dojo/_base/declare',
this.changeColor();
})));
},
+ _addAColorRecord: function(color){
+ if (this.colorRecords && this.colorRecords.push) {
+ this.colorRecords.push(color);//update colorRecord
+ }
+ },
///////////////////////////////////////////////////////////////////////////////
_isColorEqual: function (newColor) {
@@ -228,22 +283,20 @@ define(['dojo/_base/declare',
}
}, this.domNode);
},
- getPickerTooltipDialog: function(){
- var tooltipDialog = null;
- if(this.picker && this.picker.tooltipDialog){
- tooltipDialog = this.picker.tooltipDialog;
- }
- return tooltipDialog;
- }//,
// onChange: function (newColor) {
- // /*jshint unused: false*/
- // // if (this.showColorInBG) {
- // // html.setStyle(this.domNode, 'backgroundColor', newColor.toString());
- // // }
- // // if (this.showLabel) {
- // // this._changeLabel(newColor);
- // // }
// this.emit("change", newColor);
- // }
+ // },
+ onOpen: function(){
+ this.openDialog();
+ },
+ openDialog: function(){
+ this.initUI();
+ },
+ _closeDialog: function(){
+ this.emit("close");
+ },
+ onClose: function () {
+ this._closeDialog();//for parent call, like EditorBackgroundColor.js
+ }
});
});
\ No newline at end of file
diff --git a/app/jimu.js/dijit/ColorPicker.js b/app/jimu.js/dijit/ColorPicker.js
index 440594a..c071834 100644
--- a/app/jimu.js/dijit/ColorPicker.js
+++ b/app/jimu.js/dijit/ColorPicker.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -23,11 +23,11 @@ define(['dojo/_base/declare',
'dojo/_base/Color',
'dijit/TooltipDialog',
'dijit/popup',
- 'dojox/widget/ColorPicker',
+ "jimu/dijit/ColorSelector",
'jimu/utils'
],
function (declare, _WidgetBase, _TemplatedMixin, lang, html, on, Color, TooltipDialog,
- dojoPopup, DojoColorPicker, jimuUtils) {
+ dojoPopup, ColorSelector, jimuUtils) {
return declare([_WidgetBase, _TemplatedMixin], {
baseClass: 'jimu-color-picker',
declaredClass: 'jimu.dijit.ColorPicker',
@@ -96,11 +96,14 @@ define(['dojo/_base/declare',
around: this.domNode
});
this._isTooltipDialogOpened = true;
+ //this.emit("popupopen");
},
_hideTooltipDialog: function () {
- dojoPopup.close(this.tooltipDialog);
this._isTooltipDialogOpened = false;
+ //this.emit("popupclose");
+ this.onClose();
+ dojoPopup.close(this.tooltipDialog);
},
_createTooltipDialog: function () {
@@ -109,7 +112,7 @@ define(['dojo/_base/declare',
content: ttdContent
});
html.addClass(this.tooltipDialog.domNode, 'jimu-color-picker-dialog');
- var picker = new DojoColorPicker({
+ var picker = new ColorSelector({
showHex: this.showHex,
showRgb: this.showRgb,
showHsv: this.showHsv,
@@ -224,6 +227,10 @@ define(['dojo/_base/declare',
}
},
+ onClose: function(){
+
+ },
+
getPopup: function () {
return this.tooltipDialog || null;
},
@@ -234,6 +241,10 @@ define(['dojo/_base/declare',
innerHTML: text || "",
className: "text-label"
}, this.domNode);
+ },
+
+ isTooltipDialogOpened:function(){
+ return this._isTooltipDialogOpened;
}
});
});
\ No newline at end of file
diff --git a/app/jimu.js/dijit/ColorPickerButton.js b/app/jimu.js/dijit/ColorPickerButton.js
index c48b429..b021752 100644
--- a/app/jimu.js/dijit/ColorPickerButton.js
+++ b/app/jimu.js/dijit/ColorPickerButton.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -23,10 +23,10 @@ define(['dojo/_base/declare',
'dojo/_base/Color',
'dijit/TooltipDialog',
'dijit/popup',
- 'dojox/widget/ColorPicker'
+ "jimu/dijit/ColorSelector"
],
function(declare, _WidgetBase, _TemplatedMixin, lang, html, on, Color, TooltipDialog,
- dojoPopup, DojoColorPicker) {
+ dojoPopup, ColorSelector) {
return declare([_WidgetBase, _TemplatedMixin], {
baseClass: 'jimu-color-picker-btn',
declaredClass: 'jimu.dijit.ColorPickerButton',
@@ -134,7 +134,7 @@ function(declare, _WidgetBase, _TemplatedMixin, lang, html, on, Color, TooltipDi
content: ttdContent
});
html.addClass(this.tooltipDialog.domNode, 'jimu-color-picker-dialog');
- this.picker = new DojoColorPicker({
+ this.picker = new ColorSelector({
showHex: this.showHex,
showRgb: this.showRgb,
showHsv: this.showHsv,
diff --git a/app/jimu.js/dijit/ColorPickerPopup.js b/app/jimu.js/dijit/ColorPickerPopup.js
index a4ec3d3..0e253bb 100644
--- a/app/jimu.js/dijit/ColorPickerPopup.js
+++ b/app/jimu.js/dijit/ColorPickerPopup.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -15,18 +15,18 @@
///////////////////////////////////////////////////////////////////////////
define(['dojo/_base/declare',
- 'dijit/_WidgetBase',
- 'dijit/_TemplatedMixin',
- 'dojo/_base/lang',
- 'dojo/_base/html',
- 'dojo/on',
- 'dojo/_base/Color',
- 'dijit/TooltipDialog',
- 'dijit/popup',
- 'jimu/dijit/ColorPalette',
- 'jimu/utils'
-],
- function (declare, _WidgetBase, _TemplatedMixin, lang, html, on, Color, TooltipDialog,
+ 'dijit/_WidgetBase',
+ 'dijit/_TemplatedMixin',
+ 'dojo/_base/lang',
+ 'dojo/_base/html',
+ 'dojo/on',
+ 'dojo/_base/Color',
+ 'dijit/TooltipDialog',
+ 'dijit/popup',
+ 'jimu/dijit/ColorPalette',
+ 'jimu/utils'
+ ],
+ function(declare, _WidgetBase, _TemplatedMixin, lang, html, on, Color, TooltipDialog,
dojoPopup, ColorPalette, jimuUtils) {
return declare([_WidgetBase, _TemplatedMixin], {
baseClass: 'jimu-color-pickerPopup',
@@ -36,56 +36,70 @@ define(['dojo/_base/declare',
color: null, //dojo.Color or hex string
showLabel: false,
+ around: null,
+
+ _ENABLE: true,
//events:
//change
recordUID: "",
- postCreate: function () {
+ postCreate: function() {
this.inherited(arguments);
this._createTooltipDialog(this.domNode);
this._hideTooltipDialog();
},
- destroy: function () {
+ destroy: function() {
dojoPopup.close(this.tooltipDialog);
this.picker.destroy();
this.tooltipDialog.destroy();
this.inherited(arguments);
},
- isPartOfPopup: function (target) {
- var node = this.tooltipDialog.domNode;
- var isInternal1 = target === node || html.isDescendant(target, node);
-
- var nodeInsidePopup = null;
- if (this.picker && this.picker.getPickerTooltipDialog) {
- nodeInsidePopup = this.picker.getPickerTooltipDialog().domNode;
- }
- var isInternal2 = target === nodeInsidePopup || html.isDescendant(target, nodeInsidePopup);
+ enable: function (){
+ this._ENABLE = true;
+ html.removeClass(this.domNode, "disable");
+ },
+ disable: function() {
+ this._ENABLE = false;
+ html.addClass(this.domNode, "disable");
+ },
- var isInternal = isInternal1 || isInternal2;
+ isPartOfPopup: function(target) {
+ var node = this.tooltipDialog.domNode;
+ var isInternal = target === node || html.isDescendant(target, node);
return isInternal;
},
- hideTooltipDialog: function () {
+ hideTooltipDialog: function() {
this._hideTooltipDialog();
},
- _showTooltipDialog: function () {
+ showTooltipDialog: function() {
+ this._showTooltipDialog();
+ },
+
+ initUI: function(){
+ this.picker.initUI();
+ },
+
+ _showTooltipDialog: function() {
dojoPopup.open({
parent: this.getParent(),
popup: this.tooltipDialog,
- around: this.domNode
+ around: this.around ? this.around : this.domNode,//position
+ orient: this.orient
});
+
this._isTooltipDialogOpened = true;
},
- _hideTooltipDialog: function () {
- dojoPopup.close(this.tooltipDialog);
+ _hideTooltipDialog: function() {
+ dojoPopup.hide(this.tooltipDialog);
this._isTooltipDialogOpened = false;
},
- _createTooltipDialog: function () {
+ _createTooltipDialog: function() {
var ttdContent = html.create("div");
this.tooltipDialog = new TooltipDialog({
content: ttdContent
@@ -97,31 +111,44 @@ define(['dojo/_base/declare',
showTransparent: false,
showColorPalette: true,
showCoustom: true,
- showCoustomRecord: true
+ showColorPickerOK: true,//ok btn
+ showColorPickerApply: true,//apply btn
+ showCoustomRecord: true,
+ closeDialogWhenChange: true//TODO
},
recordUID: this.recordUID,
- onChange: lang.hitch(this, function (color) {
+ onChange: lang.hitch(this, function(color) {
if (color) {
var newColor = new Color(color);
this.setColor(newColor);
- this.onChange(newColor);
+ this.onChange(newColor);//emit change event
}
})
});
picker.placeAt(ttdContent);
picker.startup();
- this.own(on(this.domNode, 'click', lang.hitch(this, function (event) {
+ this.own(on(picker, 'close', lang.hitch(this, function () {
+ this._hideTooltipDialog();
+ })));
+ this.own(on(picker, 'change-style', lang.hitch(this, function () {
+ this._hideTooltipDialog();
+ this._showTooltipDialog();//re-open to re-posction
+ })));
+
+ this.own(on(this.domNode, 'click', lang.hitch(this, function(event) {
event.stopPropagation();
event.preventDefault();
if (this._isTooltipDialogOpened) {
this._hideTooltipDialog();
} else {
- this._showTooltipDialog();
+ if (false !== this._ENABLE) {
+ this._showTooltipDialog();
+ }
}
})));
- this.own(on(document, 'click', lang.hitch(this, function (event) {
+ this.own(on(document, 'click', lang.hitch(this, function(event) {
var target = event.srcElement || event.target;
if (!this.isPartOfPopup(target)) {
this._hideTooltipDialog();
@@ -131,7 +158,7 @@ define(['dojo/_base/declare',
this.picker = picker;
},
- setColor: function (newColor) {
+ setColor: function(newColor) {
if (!(newColor instanceof Color)) {
return;
}
@@ -154,11 +181,11 @@ define(['dojo/_base/declare',
}
},
- getColor: function () {
+ getColor: function() {
return this.color;
},
- _changeLabel: function (newColor) {
+ _changeLabel: function(newColor) {
html.empty(this.domNode);
html.create('span', {
innerHTML: newColor.toHex(),
@@ -169,13 +196,13 @@ define(['dojo/_base/declare',
}, this.domNode);
},
- onChange: function (newColor) {
+ onChange: function(newColor) {
/*jshint unused: false*/
if (newColor && this.showLabel) {
this._changeLabel(newColor);
}
},
- changeColor: function () {
+ changeColor: function() {
if (this.picker) {
this.picker.changeColor();
}
@@ -183,11 +210,11 @@ define(['dojo/_base/declare',
this._changeLabel(this.color);
}
},
- setTitle: function (str) {
+ setTitle: function(str) {
this.domNode.title = str;
+ },
+ getTooltipDialog: function() {
+ return this.tooltipDialog || null;
}
- // getPopup: function () {
- // return this.tooltipDialog || null;
- // }
});
});
\ No newline at end of file
diff --git a/app/jimu.js/dijit/ColorRecords.js b/app/jimu.js/dijit/ColorRecords.js
index d7c8763..e4ef54a 100644
--- a/app/jimu.js/dijit/ColorRecords.js
+++ b/app/jimu.js/dijit/ColorRecords.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/app/jimu.js/dijit/ColorSelector.js b/app/jimu.js/dijit/ColorSelector.js
new file mode 100644
index 0000000..807ca95
--- /dev/null
+++ b/app/jimu.js/dijit/ColorSelector.js
@@ -0,0 +1,103 @@
+///////////////////////////////////////////////////////////////////////////
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
+//
+// Licensed under the Apache License Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+///////////////////////////////////////////////////////////////////////////
+define([
+ 'dojo/Evented',
+ 'dojo/_base/declare',
+ 'dijit/_WidgetBase',
+ 'dojox/widget/ColorPicker',
+ "dijit/_base/focus",
+ "dojo/fx",
+ 'dojo/_base/lang',
+ 'dojo/_base/html',
+ "dojo/sniff"
+], function (Evented, declare, _WidgetBase, dojoxColorPicker, FocusManager, fx, lang, html, has) {
+ return declare([_WidgetBase, dojoxColorPicker, Evented], {
+ baseClass: 'jimu-color-selector',
+ declaredClass: 'jimu.dijit.ColorSelector',
+
+ //overwirte this method, because it get wrong color when clicled
+ _setPoint: function (/* Event */evt) {
+ if (evt) { FocusManager.focus(evt.target); }
+ //half of icon
+ if (!this._CURSOR_WIDTH || !this._CURSOR_HEIGHT) {
+ var cursorNodeBox = html.getMarginBox(this.cursorNode);
+ if (cursorNodeBox.w && cursorNodeBox.h) {
+ this._CURSOR_WIDTH = cursorNodeBox.w / 2;
+ this._CURSOR_HEIGHT = cursorNodeBox.h / 2;
+ }
+ }
+ //border w/h
+ if (!this._BORDER_WIDTH || !this._BORDER_HEIGHT) {
+ var borderObj = html.getBorderExtents(evt.target || evt.srcElement);
+ if (borderObj.w && borderObj.h) {
+ this._BORDER_WIDTH = borderObj.w;
+ this._BORDER_HEIGHT = borderObj.h;
+ }
+ }
+
+ //fix position
+ var tarX = 0,
+ tarY = 0;
+ if (has("ff") || has("ie") || has("MSIE")) {
+ //ff ie, without border
+ tarX = evt.offsetX;
+ tarY = evt.offsetY;
+ } else if (evt.offsetX && evt.offsetY) {
+ //chrome edge, with border w/h
+ tarX = evt.offsetX + this._BORDER_WIDTH;
+ tarY = evt.offsetY + this._BORDER_HEIGHT;
+ }
+ //targetX/Y - halfWidth/Height of icon
+ var newTop = tarY - this._CURSOR_HEIGHT;
+ var newLeft = tarX - this._CURSOR_WIDTH;
+
+ //set color
+ if (this.animatePoint) {
+ fx.slideTo({
+ node: this.cursorNode,
+ duration: this.slideDuration,
+ top: newTop,
+ left: newLeft,
+ onEnd: lang.hitch(this, function () { this._updateColor(true); FocusManager.focus(this.cursorNode); })
+ }).play();
+ } else {
+ html.style(this.cursorNode, {
+ left: newLeft + "px",
+ top: newTop + "px"
+ });
+ this._updateColor(true);
+ }
+ },
+
+ _setHuePoint: function (/* Event */evt) {
+ var selCenter = this.PICKER_HUE_SELECTOR_H / 2;//half of icon
+ var ypos = evt.offsetY - selCenter;
+
+ if (this.animatePoint) {
+ fx.slideTo({
+ node: this.hueCursorNode,
+ duration: this.slideDuration,
+ top: ypos,
+ left: 0,
+ onEnd: lang.hitch(this, function () { this._updateColor(true); FocusManager.focus(this.hueCursorNode); })
+ }).play();
+ } else {
+ html.style(this.hueCursorNode, "top", ypos + "px");
+ this._updateColor(true);
+ }
+ }
+ });
+});
\ No newline at end of file
diff --git a/app/jimu.js/dijit/CoordinateControl.js b/app/jimu.js/dijit/CoordinateControl.js
new file mode 100644
index 0000000..d21bcdb
--- /dev/null
+++ b/app/jimu.js/dijit/CoordinateControl.js
@@ -0,0 +1,1816 @@
+///////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2014 - 2018 Esri. All Rights Reserved.
+//
+// Licensed under the Apache License Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+///////////////////////////////////////////////////////////////////////////
+
+/*global define*/
+define([
+ 'dojo/_base/declare',
+ 'dojo/_base/array',
+ 'dojo/_base/lang',
+ 'dojo/on',
+ 'dojo/dom-attr',
+ 'dojo/dom-class',
+ 'dojo/dom-style',
+ 'dojo/string',
+ 'dojo/topic',
+ 'dojo/keys',
+ 'dojo/Deferred',
+ 'dojo/Evented',
+ 'dojo/dom',
+ 'dojo/dom-construct',
+ 'dijit/_WidgetBase',
+ 'dijit/_TemplatedMixin',
+ 'dijit/_WidgetsInTemplateMixin',
+ 'dijit/registry',
+ 'dijit/Tooltip',
+ 'dijit/TooltipDialog',
+ 'dijit/popup',
+ 'dojo/text!./templates/CoordinateControl.html',
+ 'esri/geometry/webMercatorUtils',
+ 'esri/graphic',
+ 'esri/geometry/Point',
+ 'esri/request',
+ 'esri/SpatialReference',
+ 'esri/tasks/GeometryService',
+ 'esri/tasks/ProjectParameters',
+ 'esri/toolbars/draw',
+ 'jimu/dijit/Message',
+ './_CoordinateControlFormatNotation',
+ './_CoordinateControlConfirmNotation',
+ 'dijit/form/TextBox',
+ 'dijit/form/Textarea',
+ 'dijit/form/Select',
+ 'dijit/InlineEditBox'
+], function (
+ dojoDeclare,
+ dojoArray,
+ dojoLang,
+ dojoOn,
+ dojoDomAttr,
+ dojoDomClass,
+ dojoDomStyle,
+ dojoString,
+ dojoTopic,
+ dojoKeys,
+ dojoDeferred,
+ dojoEvented,
+ dojoDom,
+ dojoDomConstruct,
+ dijitWidgetBase,
+ dijitTemplatedMixin,
+ dijitWidgetsInTemplate,
+ dijitRegistry,
+ dijitTooltip,
+ dijitTooltipDialog,
+ dijitPopup,
+ coordCntrl,
+ EsriWMUtils,
+ EsriGraphic,
+ EsriPoint,
+ EsriRequest,
+ EsriSpatialReference,
+ EsriGeometryService,
+ EsriProjectParameters,
+ EsriDraw,
+ JimuMessage,
+ CoordFormat,
+ ConfirmNotation
+) {
+ 'use strict';
+ return dojoDeclare([dijitWidgetBase, dijitTemplatedMixin, dijitWidgetsInTemplate, dojoEvented], {
+ templateString: coordCntrl,
+ baseClass: 'jimu-coordinate-control',
+
+ /**
+ Config parameters:
+ parentWidget: widget (mandatory) ->
+ the parent widget the control is going to be used in
+ input: boolean (optional) ->
+ set the control to type input or output
+ Default true
+ label: string (optional) ->
+ label to be used above the coordinate control
+ if not set label will not be shown
+ showCopyButton: boolean (optional) ->
+ is copy notation button shown
+ Default false
+ showFormatButton: boolean (optional) ->
+ is format notation button shown
+ Default false
+ zoomScale: number (optional) ->
+ if not set, the zoom button will not be shown
+ showDeleteButton: boolean (optional) ->
+ is delete button shown (only used if input set to false)
+ Default true
+ showExpandButton: boolean (optional) ->
+ is expand button shown (only used if input set to false)
+ Default true
+ drawButtonLabel: string (optional) ->
+ if not set, the draw button button will not be shown
+ drawToolTip: string (optional) ->
+ tooltip to be used on draw point
+ if not set default tooltip will be used from main nls file
+ graphicsLayer: graphicsLayer (optional) ->
+ The graphics layer to place current map point on
+ if not supplied no graphics will be drawn on map
+ type: string (optional) ->
+ default notation format. Available Types:
+ DD, DDM, DMS, GARS, GEOREF, MGRS, USNG, UTM, UTM_H
+ Default DD
+
+ Methods:
+ getFormattedCoordinateText: Returns the sanitized formatted coordinate
+ getCurrentMapCoordinate: Returns the current map coordinate
+ getMapCoordinateDD: Returns the current map coordinate in DD
+
+ Event:
+ get-coordinate-complete: Fired when coordinates are returned in sanitized format.
+ */
+
+ parentWidget: null,
+ input: true,
+ label: null,
+ showCopyButton: false,
+ showFormatButton: false,
+ zoomScale: null,
+ showDeleteButton: true,
+ showExpandButton: true,
+ drawButtonLabel: null,
+ drawToolTip: null,
+ graphicsLayer: null,
+ type: 'DD',
+ inputFromText: true,
+ addSign: false,
+
+ /**
+ *
+ **/
+ postMixInProperties: function () {
+ this.nls = window.jimuNls.coordinateControl;
+ },
+
+ /**
+ *
+ **/
+ constructor: function (args) {
+ dojoDeclare.safeMixin(this, args);
+ this.uid = args.id || dijitRegistry.getUniqueId('cc');
+
+ if (this.parentWidget === null) {
+ console.error('No parentWidget parameter supplied: ' +
+ 'Parameter is mandatory');
+ }
+
+ if (this.label === null) {
+ console.info('No label parameter supplied (optional): ' +
+ 'Coordinate Control will have no label');
+ }
+
+ if (this.zoomScale === null) {
+ console.info('No zoomScale parameter supplied (optional): ' +
+ 'Coordinate Control will have no zoom button');
+ }
+
+ if (this.drawButtonLabel === null) {
+ console.info('No drawButtonLabel parameter supplied (optional): ' +
+ 'Coordinate Control will have no draw button');
+ }
+
+ if (this.graphicsLayer === null) {
+ console.info('No graphicsLayer parameter supplied: ' +
+ 'Input graphics will not be shown on map');
+ }
+ },
+
+ /**
+ *
+ **/
+ postCreate: function () {
+ this._frmtdlg = new dijitTooltipDialog({
+ id: this.uid + '_formatCoordinateTooltip',
+ content: new CoordFormat({
+ nls: this.nls,
+ ct: this.type
+ }),
+ style: 'width: 400px',
+ onClose: dojoLang.hitch(this, this.popupDidClose)
+ });
+ if (this.parentWidget.appConfig.theme.name === 'DartTheme') {
+ dojoDomClass.add(this._frmtdlg.domNode, 'coordinateControlDialog');
+ }
+ if (this.defaultFormat) {
+ this._frmtdlg.content.formats[this.type].defaultFormat = this.defaultFormat;
+ }
+ this.geomsrvc = new EsriGeometryService(this.parentWidget.appConfig.geometryService);
+ this.dt = new EsriDraw(this.parentWidget.map);
+ this.initUI();
+ this.setUIListeners();
+ },
+
+ /**
+ *
+ **/
+ initUI: function () {
+ // show label above control
+ if (this.label === null) {
+ this.setHidden(this.coordNameContainer, false);
+ } else {
+ this.coordName.innerText = this.label;
+ }
+ if (this.input) {
+ // hide any actions we don't want to see on the input coords
+ this.setHidden(this.expandButton, true); //we never want to show expand button on input
+ this.setHidden(this.removeControlBtn, true); //we never want to show delete on input
+ if (this.drawButtonLabel === null) {
+ // if no drawButtonLabel supplied hide button
+ this.setHidden(this.drawPointButton, true);
+ } else {
+ this.drawPointButton.title = this.drawButtonLabel;
+ if (this.drawToolTip === null) {
+ this.drawToolTip = this.nls.tooltip;
+ }
+ }
+ } else {
+ //for an output control set the text area to read only
+ this.coordtext.disabled = true;
+ this.setHidden(this.drawPointButton, true); //we never want to show draw button on output
+ if (!this.showExpandButton) {
+ this.setHidden(this.expandButton, true);
+ dojoDomClass.remove(this.domNode, "coordinateContainer");
+ dojoDomClass.add(this.domNode, "outputCoordinateContainer");
+ dojoDomClass.add(this.cpbtn, 'outputCopyBtn');
+ this.coordtext.readOnly = true;
+ }
+ if (!this.showDeleteButton) {
+ this.setHidden(this.removeControlBtn, true);
+ }
+ }
+ if (!this.showCopyButton) {
+ this.setHidden(this.cpbtn, true);
+ dojoDomClass.add(this.cpbtn, 'inputCopyBtn');
+ dojoDomAttr.set(this.cpbtn, 'title', this.nls.copyAll);
+ }
+ if (!this.showFormatButton) {
+ this.setHidden(this.formatButton, true);
+ }
+ if (this.zoomScale === null) {
+ this.setHidden(this.zoomButton, true);
+ }
+ this.formatButton.title = this.nls.formatInput;
+ },
+
+ /**
+ *
+ **/
+ setUIListeners: function () {
+ if (!this.input) {
+ dojoTopic.subscribe(
+ 'INPUTPOINTDIDCHANGE',
+ dojoLang.hitch(this, this.mapWasClicked)
+ );
+ }
+
+ dojoTopic.subscribe(
+ 'INPUTERROR',
+ dojoLang.hitch(this, this.inputError)
+ );
+
+ // listen for dijit events
+ this.own(dojoOn(
+ this.expandButton,
+ 'click',
+ dojoLang.hitch(this, this.expandButtonWasClicked)
+ ));
+
+ this.own(dojoOn(
+ this.zoomButton,
+ 'click',
+ dojoLang.hitch(this, this.zoomButtonWasClicked)
+ ));
+
+ this.cpbtn.addEventListener(
+ 'click',
+ dojoLang.hitch(this, this.cpBtnWasClicked)
+ );
+
+ this.subVal1CpBtn.addEventListener(
+ 'click',
+ dojoLang.hitch(this, this.cpSubBtnWasClicked)
+ );
+
+ this.subVal2CpBtn.addEventListener(
+ 'click',
+ dojoLang.hitch(this, this.cpSubBtnWasClicked)
+ );
+
+ this.subVal3CpBtn.addEventListener(
+ 'click',
+ dojoLang.hitch(this, this.cpSubBtnWasClicked)
+ );
+
+ this.subVal4CpBtn.addEventListener(
+ 'click',
+ dojoLang.hitch(this, this.cpSubBtnWasClicked)
+ );
+
+ this.own(dojoOn(
+ this.formatButton,
+ 'click',
+ dojoLang.hitch(this, this.formatButtonWasClicked)
+ ));
+
+ this.own(dojoOn(
+ this.drawPointButton,
+ 'click',
+ dojoLang.hitch(this, this.drawPointButtonWasClicked)
+ ));
+
+ this.own(dojoOn(this._frmtdlg.content.applyButton, 'click',
+ dojoLang.hitch(this, function () {
+ this.type = this._frmtdlg.content.ct;
+ this.updateDisplay();
+ if (!this.hasCustomLabel &&
+ !this._frmtdlg.content.formats[this._frmtdlg.content.ct].useCustom) {
+ //this.coordName.set('value', this._frmtdlg.content.ct);
+ }
+ dijitPopup.close(this._frmtdlg);
+ })));
+
+ this.own(dojoOn(this._frmtdlg.content.cancelButton, 'click',
+ dojoLang.hitch(this, function () {
+ dijitPopup.close(this._frmtdlg);
+ })));
+
+ this.own(dojoOn(
+ this.coordtext,
+ 'keyup',
+ dojoLang.hitch(this, this.coordTextInputKeyWasPressed)
+ ));
+
+ this.own(this.geomsrvc.on('error', dojoLang.hitch(
+ this,
+ this.geomSrvcDidFail)));
+
+ this.own(dojoOn(
+ this.dt,
+ 'draw-complete',
+ dojoLang.hitch(this, this.drawComplete)
+ ));
+ },
+
+ /**
+ *
+ **/
+ popupDidClose: function () {
+ var isCanceled =
+ this._frmtdlg.content.isCanceled;
+ if (isCanceled) {
+ if (this.addSign !== this._frmtdlg.content.addSignChkBox.checked) {
+ this._frmtdlg.content.addSignChkBox.checked = this.addSign;
+ }
+ return;
+ }
+ this.addSign = this._frmtdlg.content.addSignChkBox.checked;
+ var fv = this._frmtdlg.content.ct;
+ if (this.type !== fv) {
+ this.type = fv;
+ this.updateDisplay();
+ }
+ },
+
+ /**
+ *
+ **/
+ cpSubBtnWasClicked: function (evt) {
+ var c = evt.currentTarget.id.split('~')[0];
+ var s;
+ this[c].select();
+ try {
+ s = document.execCommand('copy');
+ } catch (err) {
+ s = false;
+ }
+ var t = s ? this.nls.copySuccessful : this.nls.copyFailed;
+ this.showToolTip(evt.currentTarget.id, t);
+ },
+
+ /**
+ *
+ **/
+ cpBtnWasClicked: function (evt) {
+ evt.preventDefault();
+ var s, t, tv, fw, w;
+ if (this.input) {
+ fw = dijitRegistry.toArray().filter(function (w) {
+ return w.baseClass === 'jimu-widget-cc' && !w.input;
+ });
+ fw.reverse();
+
+ w = fw.map(function (w) {
+ return w.coordtext.value;
+ }).join('\r\n');
+
+ tv = this.coordtext.value;
+ w = tv + '\r\n' + w;
+
+ this.coordtext.value = w;
+ this.coordtext.select();
+
+ try {
+ s = document.execCommand('copy');
+ } catch (caerr) {
+ s = false;
+ }
+ this.coordtext.value = tv;
+ } else {
+ this.coordtext.select();
+ try {
+ s = document.execCommand('copy');
+ } catch (cerr) {
+ s = false;
+ }
+ }
+ t = s ? this.nls.copySuccessful : this.nls.copyFailed;
+ this.showToolTip(this.cpbtn.id, t);
+ },
+
+ /**
+ *
+ **/
+ showToolTip: function (onId, withText) {
+ var n = dojoDom.byId(onId);
+ dijitTooltip.show(withText, n);
+ setTimeout(function () {
+ dijitTooltip.hide(n);
+ }, 1000);
+ },
+
+ /**
+ *
+ **/
+ geomSrvcDidComplete: function (r) {
+ if (r[0].length <= 0) {
+ new JimuMessage({
+ message: this.nls.parseCoordinatesError
+ });
+ dojoTopic.publish('INPUTERROR');
+ return;
+ }
+ var newpt = new EsriPoint(r[0][0], r[0][1], new EsriSpatialReference({
+ wkid: 4326
+ }));
+ this.currentClickPointDD = this.currentClickPoint = newpt;
+ if (this.input) {
+ this.parentWidget.map.centerAt(this.currentClickPointDD);
+ this.updateDisplay();
+ dojoTopic.publish('INPUTPOINTDIDCHANGE', {
+ mapPoint: this.currentClickPointDD,
+ inputFromText: true
+ });
+ }
+ },
+
+ /**
+ *
+ **/
+ geomSrvcDidFail: function () {
+ new JimuMessage({
+ message: this.nls.parseCoordinatesError
+ });
+ dojoTopic.publish('INPUTERROR');
+ },
+
+ /**
+ * Handles enter key press event
+ **/
+ coordTextInputKeyWasPressed: function (evt) {
+ if (evt.keyCode === dojoKeys.ENTER) {
+ var sanitizedInput = this.getCleanInput(evt.currentTarget.value);
+ this.getCoordinateType(sanitizedInput).then(dojoLang.hitch(this, function (itm) {
+ if (itm) {
+ if (itm.length === 1) {
+ var withStr = this.processCoordTextInput(sanitizedInput, itm[0], false);
+ this.getXYNotation(withStr, itm[0].conversionType).then(
+ dojoLang.hitch(this, function (r) {
+ if (r[0].length > 0) {
+ this.geomSrvcDidComplete(r);
+ } else {
+ this.geomSrvcDidFail();
+ }
+ }));
+ } else {
+ var dialog = new ConfirmNotation({
+ title: this.nls.comfirmInputNotation,
+ nls: this.nls,
+ options: itm,
+ style: "width: 400px",
+ hasSkipCheckBox: false,
+ theme: this.parentWidget.appConfig.theme.name
+ });
+
+ dialog.show().then(dojoLang.hitch(this, function () {
+ var singleMatch = dojoArray.filter(itm, function (singleItm) {
+ return singleItm.name === dialog.comboOptions.get('value');
+ });
+ var withStr = this.processCoordTextInput(sanitizedInput, singleMatch[0], false);
+ this.getXYNotation(withStr, singleMatch[0].conversionType).then(
+ dojoLang.hitch(this, function (r) {
+ if (r[0].length > 0) {
+ this.geomSrvcDidComplete(r);
+ } else {
+ this.geomSrvcDidFail();
+ }
+ }));
+ }, function () {
+ //THROW ERROR
+ }));
+ }
+ } else {
+ new JimuMessage({
+ message: this.nls.parseCoordinatesError
+ });
+ dojoTopic.publish('INPUTERROR');
+ }
+ }));
+ dojoDomAttr.set(this.coordtext, 'value', sanitizedInput);
+ this.emit('get-coordinate-complete', sanitizedInput);
+ this.currentClickPoint = null;
+ }
+ },
+
+ /**
+ * Returns the sanitized formatted coordinate
+ */
+ getFormattedCoordinateText: function () {
+ return this.coordtext.value;
+ },
+
+ /**
+ * Returns the current map coordinate
+ */
+ getCurrentMapCoordinate: function () {
+ return this.currentClickPoint;
+ },
+
+ /**
+ * Returns the current map coordinate in DD
+ */
+ getMapCoordinateDD: function () {
+ return this.currentClickPointDD;
+ },
+
+ /**
+ *
+ **/
+ processCoordTextInput: function (withStr, asType, testingMode) {
+ var match = asType.pattern.exec(withStr);
+ var northSouthPrefix, northSouthSuffix,
+ eastWestPrefix, eastWestSuffix,
+ latDeg, longDeg, latMin,
+ longMin, latSec, longSec;
+ var prefixSuffixError = false;
+ var conversionType = asType.name;
+
+ switch (asType.name) {
+ case 'DD':
+ northSouthPrefix = match[2];
+ northSouthSuffix = match[7];
+ eastWestPrefix = match[10];
+ eastWestSuffix = match[16];
+ latDeg = match[3].replace(/[,:]/, '.');
+ longDeg = match[11].replace(/[,:]/, '.');
+ conversionType = 'DD';
+ break;
+ case 'DDrev':
+ northSouthPrefix = match[11];
+ northSouthSuffix = match[16];
+ eastWestPrefix = match[2];
+ eastWestSuffix = match[8];
+ latDeg = match[12].replace(/[,:]/, '.');
+ longDeg = match[3].replace(/[,:]/, '.');
+ conversionType = 'DD';
+ break;
+ case 'DDM':
+ northSouthPrefix = match[2];
+ northSouthSuffix = match[7];
+ eastWestPrefix = match[10];
+ eastWestSuffix = match[15];
+ latDeg = match[3];
+ latMin = match[4].replace(/[,:]/, '.');
+ longDeg = match[11];
+ longMin = match[12].replace(/[,:]/, '.');
+ conversionType = 'DDM';
+ break;
+ case 'DDMrev':
+ northSouthPrefix = match[10];
+ northSouthSuffix = match[15];
+ eastWestPrefix = match[2];
+ eastWestSuffix = match[7];
+ latDeg = match[11];
+ latMin = match[12].replace(/[,:]/, '.');
+ longDeg = match[3];
+ longMin = match[4].replace(/[,:]/, '.');
+ conversionType = 'DDM';
+ break;
+ case 'DMS':
+ northSouthPrefix = match[2];
+ northSouthSuffix = match[8];
+ eastWestPrefix = match[11];
+ eastWestSuffix = match[17];
+ latDeg = match[3];
+ latMin = match[4];
+ latSec = match[5].replace(/[,:]/, '.');
+ longDeg = match[12];
+ longMin = match[13];
+ longSec = match[14].replace(/[,:]/, '.');
+ conversionType = 'DMS';
+ break;
+ case 'DMSrev':
+ northSouthPrefix = match[11];
+ northSouthSuffix = match[17];
+ eastWestPrefix = match[2];
+ eastWestSuffix = match[8];
+ latDeg = match[12];
+ latMin = match[13];
+ latSec = match[14].replace(/[,:]/, '.');
+ longDeg = match[3];
+ longMin = match[4];
+ longSec = match[5].replace(/[,:]/, '.');
+ conversionType = 'DMS';
+ break;
+ }
+
+ //check for north/south prefix/suffix
+ if (northSouthPrefix && northSouthSuffix) {
+ prefixSuffixError = true;
+ if (new RegExp(/[Ss-]/).test(northSouthPrefix)) {
+ northSouthPrefix = '-';
+ } else {
+ northSouthPrefix = '+';
+ }
+ } else {
+ if (northSouthPrefix && new RegExp(/[Ss-]/).test(northSouthPrefix)) {
+ northSouthPrefix = '-';
+ } else {
+ if (northSouthSuffix && new RegExp(/[Ss-]/).test(northSouthSuffix)) {
+ northSouthPrefix = '-';
+ } else {
+ northSouthPrefix = '+';
+ }
+ }
+ }
+
+ //check for east/west prefix/suffix
+ if (eastWestPrefix && eastWestSuffix) {
+ prefixSuffixError = true;
+ if (new RegExp(/[Ww-]/).test(eastWestPrefix)) {
+ eastWestPrefix = '-';
+ } else {
+ eastWestPrefix = '+';
+ }
+ } else {
+ if (eastWestPrefix && new RegExp(/[Ww-]/).test(eastWestPrefix)) {
+ eastWestPrefix = '-';
+ } else {
+ if (eastWestSuffix && new RegExp(/[Ww-]/).test(eastWestSuffix)) {
+ eastWestPrefix = '-';
+ } else {
+ eastWestPrefix = '+';
+ }
+ }
+ }
+
+ //give user warning if lat or long is determined as having a prefix and suffix
+ if (prefixSuffixError) {
+ if (!testingMode) {
+ new JimuMessage({
+ message: this.nls.latLongWarningMessage
+ });
+ }
+ }
+
+ switch (conversionType) {
+ case 'DD':
+ withStr = northSouthPrefix + latDeg + ',' + eastWestPrefix + longDeg;
+ break;
+ case 'DDM':
+ withStr = northSouthPrefix + latDeg +
+ ' ' + latMin + ',' + eastWestPrefix +
+ longDeg + ' ' + longMin;
+ break;
+ case 'DMS':
+ withStr = northSouthPrefix + latDeg + ' ' +
+ latMin + ' ' + latSec + ',' + eastWestPrefix +
+ longDeg + ' ' + longMin + ' ' + longSec;
+ break;
+ default:
+ withStr = withStr;
+ break;
+ }
+ return withStr;
+ },
+
+ /**
+ *
+ **/
+ zoomButtonWasClicked: function () {
+ if (this.parentWidget.map.getZoom() < this.zoomScale) {
+ this.parentWidget.map.centerAt(this.currentClickPointDD).then(
+ dojoLang.hitch(this, function () {
+ this.parentWidget.map.setScale(this.zoomScale);
+ })
+ );
+ } else {
+ this.parentWidget.map.centerAt(this.currentClickPointDD);
+ }
+ },
+
+ /**
+ *
+ **/
+ setHidden: function (cntrl, shouldDestroy) {
+ dojoDomStyle.set(cntrl, 'display', 'none');
+ if (shouldDestroy) {
+ dojoDomConstruct.destroy(cntrl.parentNode);
+ }
+ },
+
+ /**
+ *
+ **/
+ setVisible: function (cntrl) {
+ dojoDomStyle.set(cntrl, 'display', 'inline-flex');
+ },
+
+ /**
+ *
+ **/
+ remove: function () {
+ this.destroyRecursive();
+ },
+
+ /**
+ *
+ **/
+ mapWasClicked: function (evt) {
+ this.currentClickPoint = evt.mapPoint;
+ this.getDDPoint(evt.mapPoint).then(dojoLang.hitch(this, function (mapPoint) {
+ this.currentClickPointDD = mapPoint;
+ this.currentClickPointDDDD = mapPoint;
+ if (evt.inputFromText) {
+ this.inputFromText = true;
+ } else {
+ this.inputFromText = false;
+ }
+ this.updateDisplay();
+ }), dojoLang.hitch(this,
+ function (err) {
+ console.error(err);
+ }
+ ));
+ },
+
+ /**
+ *
+ **/
+ getDDPoint: function (fromPoint) {
+ var def = new dojoDeferred();
+ var webMerc = new EsriSpatialReference(3857);
+ if (EsriWMUtils.canProject(fromPoint, webMerc)) {
+ // if the point is in geographics or can be projected to geographics do so
+ def.resolve(EsriWMUtils.webMercatorToGeographic(EsriWMUtils.project(fromPoint, webMerc)));
+ } else {
+ // if the point is NOT geographics and can NOT be projected to geographics
+ // Find the most appropriate geo transformation and project the point to geographic
+ var args = {
+ url: this.geomsrvc.url + '/findTransformations',
+ content: {
+ f: 'json',
+ inSR: fromPoint.spatialReference.wkid,
+ outSR: 4326,
+ extentOfInterest: JSON.stringify(this.parentWidget.map.extent) // jshint ignore:line
+ },
+ handleAs: 'json',
+ callbackParamName: 'callback'
+ };
+ new EsriRequest(args, {
+ usePost: false
+ }).then(dojoLang.hitch(this, function (response) {
+ var transformations = response && response.transformations ?
+ response.transformations : undefined;
+ var wkid = transformations && transformations.length > 0 ?
+ transformations[0].wkid : undefined;
+ var pp = new EsriProjectParameters();
+ pp.outSR = new EsriSpatialReference(4326);
+ pp.geometries = [fromPoint];
+ pp.transformForward = true;
+ pp.transformation = wkid;
+ this.geomsrvc.project(pp, dojoLang.hitch(this, function (r) {
+ def.resolve(r[0]);
+ }), function (err) {
+ def.reject(err);
+ });
+ }), dojoLang.hitch(this, function (err) {
+ def.reject(err);
+ }));
+ }
+ return def;
+ },
+
+ /**
+ *
+ **/
+ getProjectedPoint: function (fromPoint) {
+ var def = new dojoDeferred();
+ if (EsriWMUtils.canProject(fromPoint, this.parentWidget.map)) {
+ // if the geographic point can be projected the map spatial reference do so
+ def.resolve(EsriWMUtils.geographicToWebMercator(fromPoint));
+ } else {
+ // if the point can NOT be projected to the maps spatial reference
+ // find the most appropriate geo transformation and project the point to the map SR
+ var args = {
+ url: this.geomsrvc.url + '/findTransformations',
+ content: {
+ f: 'json',
+ inSR: 4326,
+ outSR: this.parentWidget.map.spatialReference.wkid,
+ extentOfInterest: JSON.stringify(this.parentWidget.map.extent) // jshint ignore:line
+ },
+ handleAs: 'json',
+ callbackParamName: 'callback'
+ };
+ new EsriRequest(args, {
+ usePost: false
+ }).then(dojoLang.hitch(this, function (response) {
+ var transformations = response && response.transformations ?
+ response.transformations : undefined;
+ var wkid = transformations && transformations.length > 0 ?
+ transformations[0].geoTransforms[0].wkid : undefined;
+ var pp = new EsriProjectParameters();
+ pp.outSR = new EsriSpatialReference(this.parentWidget.map.spatialReference);
+ pp.geometries = [fromPoint];
+ pp.transformForward = true;
+ pp.transformation = wkid;
+ this.geomsrvc.project(pp, dojoLang.hitch(this, function (r) {
+ def.resolve(r[0]);
+ }), function (err) {
+ def.reject(err);
+ });
+ }), dojoLang.hitch(this, function (err) {
+ def.reject(err);
+ }));
+ }
+ return def;
+ },
+
+ /**
+ *
+ **/
+ expandButtonWasClicked: function () {
+ dojoDomClass.toggle(this.coordcontrols, 'expanded');
+ if (dojoDomClass.contains(this.coordcontrols, 'expanded')) {
+ dojoDomClass.remove(this.expandButton, "expandBtn");
+ dojoDomClass.add(this.expandButton, "collapseBtn");
+ } else {
+ dojoDomClass.remove(this.expandButton, "collapseBtn");
+ dojoDomClass.add(this.expandButton, "expandBtn");
+ }
+ // if this.coordcontrols is expanded then disable all it's children
+ this.setSubCoordUI(dojoDomClass.contains(this.coordcontrols, 'expanded'));
+ },
+
+ /**
+ *
+ **/
+ formatButtonWasClicked: function () {
+ this._frmtdlg.content.setCt(this.type);
+ dijitPopup.open({
+ popup: this._frmtdlg,
+ around: this.formatButton
+ });
+ },
+
+ /**
+ *
+ **/
+ drawPointButtonWasClicked: function () {
+ if (dojoDomClass.contains(this.drawPointButton, 'drawPointBtn-active')) {
+ //already selected so deactivate draw tool
+ this.dt.deactivate();
+ this.parentWidget.map.enableMapNavigation();
+ } else {
+ this.parentWidget.map.disableMapNavigation();
+ this.dt.activate(EsriDraw.POINT);
+ var tooltip = this.dt._tooltip;
+ if (tooltip) {
+ tooltip.innerHTML = this.drawToolTip;
+ }
+ }
+ dojoDomClass.toggle(this.drawPointButton, 'drawPointBtn-active');
+ },
+
+ drawComplete: function (results) {
+ this.dt.deactivate();
+ dojoDomClass.toggle(this.drawPointButton, 'drawPointBtn-active');
+ var evt = {};
+ evt.mapPoint = results.geometry;
+ this.parentWidget.map.enableMapNavigation();
+ this.mapWasClicked(evt);
+ },
+
+ /**
+ *
+ **/
+ setSubCoordUI: function (expanded) {
+ if (expanded) {
+ var cntrHeight = '165px';
+ switch (this.type) {
+ case 'DD':
+ case 'DMS':
+ case 'DDM':
+ this.sub1label.innerHTML = 'Lat';
+ this.sub2label.innerHTML = 'Lon';
+ this.setHidden(this.sub3, false);
+ this.setHidden(this.sub4, false);
+ cntrHeight = '90px';
+ break;
+ case 'GARS':
+ this.sub1label.innerHTML = 'Lon';
+ this.sub2label.innerHTML = 'Lat';
+ this.sub3label.innerHTML = 'Quadrant';
+ this.sub4label.innerHTML = 'Key';
+ this.setVisible(this.sub3);
+ this.setVisible(this.sub4);
+ break;
+ case 'GEOREF':
+ this.sub1label.innerHTML = '15° Quad';
+ this.sub2label.innerHTML = '1° Quad';
+ this.sub3label.innerHTML = 'Easting';
+ this.setVisible(this.sub3);
+ this.sub4label.innerHTML = 'Northing';
+ this.setVisible(this.sub4);
+ break;
+ case 'USNG':
+ case 'MGRS':
+ this.sub1label.innerHTML = 'GZD';
+ this.sub2label.innerHTML = 'Grid Sq';
+ this.sub3label.innerHTML = 'Easting';
+ this.sub4label.innerHTML = 'Northing';
+ this.setVisible(this.sub3);
+ this.setVisible(this.sub4);
+ break;
+ case 'UTM':
+ this.sub1label.innerHTML = 'Zone';
+ this.sub2label.innerHTML = 'Band';
+ this.sub3label.innerHTML = 'Easting';
+ this.sub4label.innerHTML = 'Northing';
+ this.setVisible(this.sub3);
+ this.setVisible(this.sub4);
+ break;
+ case 'UTM_H':
+ this.sub1label.innerHTML = 'Zone';
+ this.sub2label.innerHTML = 'Hemisphere';
+ this.sub3label.innerHTML = 'Easting';
+ this.sub4label.innerHTML = 'Northing';
+ this.setVisible(this.sub3);
+ this.setVisible(this.sub4);
+ break;
+ }
+ dojoDomStyle.set(this.coordcontrols, 'height', cntrHeight);
+ dojoDomStyle.set(this.coordcontrols, 'width', '300px');
+ } else {
+ dojoDomStyle.set(this.coordcontrols, 'height', '0px');
+ }
+ },
+
+ /**
+ *
+ **/
+ setCoordUI: function (withValue) {
+ var formattedStr;
+ if (withValue) {
+ var cntrlid = this.uid.split('_')[1];
+
+ // make sure we haven't been removed
+ if (!this['cc_' + cntrlid + 'sub1val']) {
+ return;
+ }
+
+ if (this.input && this.inputFromText) {
+ return;
+ } else {
+ var format;
+ var f = this._frmtdlg.content.formats[this.type];
+ var r;
+
+ if (f.useCustom) {
+ format = f.customFormat;
+ } else {
+ format = f.defaultFormat;
+ }
+
+ switch (this.type) {
+ case 'DD':
+
+ r = this.getFormattedDDStr(withValue, format, this.addSign);
+
+ this['cc_' + cntrlid + 'sub1val'].value =
+ dojoString.substitute('${xcrd}', {
+ xcrd: r.latdeg
+ });
+
+ this['cc_' + cntrlid + 'sub2val'].value =
+ dojoString.substitute('${ycrd}', {
+ ycrd: r.londeg
+ });
+
+ formattedStr = r.formatResult;
+ break;
+ case 'DDM':
+
+ r = this.getFormattedDDMStr(withValue, format, this.addSign);
+
+ this['cc_' + cntrlid + 'sub1val'].value =
+ dojoString.substitute('${latd} ${latm}', {
+ latd: r.latdeg,
+ latm: r.latmin
+ });
+
+ this['cc_' + cntrlid + 'sub2val'].value =
+ dojoString.substitute('${lond} ${lonm}', {
+ lond: r.londeg,
+ lonm: r.lonmin
+ });
+
+ formattedStr = r.formatResult;
+ break;
+ case 'DMS':
+
+ r = this.getFormattedDMSStr(withValue, format, this.addSign);
+
+ this['cc_' + cntrlid + 'sub1val'].value =
+ dojoString.substitute('${latd} ${latm} ${lats}', {
+ latd: r.latdeg,
+ latm: r.latmin,
+ lats: r.latsec
+ });
+
+ this['cc_' + cntrlid + 'sub2val'].value =
+ dojoString.substitute('${lond} ${lonm} ${lons}', {
+ lond: r.londeg,
+ lonm: r.lonmin,
+ lons: r.lonsec
+ });
+
+ formattedStr = r.formatResult;
+ break;
+ case 'USNG':
+
+ r = this.getFormattedUSNGStr(withValue, format, false);
+
+ this['cc_' + cntrlid + 'sub1val'].value = r.gzd;
+ this['cc_' + cntrlid + 'sub2val'].value = r.grdsq;
+ this['cc_' + cntrlid + 'sub3val'].value = r.easting;
+ this['cc_' + cntrlid + 'sub4val'].value = r.northing;
+
+ formattedStr = r.formatResult;
+
+ break;
+ case 'MGRS':
+ r = this.getFormattedMGRSStr(withValue, format, false);
+
+ this['cc_' + cntrlid + 'sub1val'].value = r.gzd;
+ this['cc_' + cntrlid + 'sub2val'].value = r.grdsq;
+ this['cc_' + cntrlid + 'sub3val'].value = r.easting;
+ this['cc_' + cntrlid + 'sub4val'].value = r.northing;
+
+ formattedStr = r.formatResult;
+ break;
+ case 'GARS':
+ r = this.getFormattedGARSStr(withValue, format, false);
+
+ this['cc_' + cntrlid + 'sub1val'].value = r.lon;
+ this['cc_' + cntrlid + 'sub2val'].value = r.lat;
+ this['cc_' + cntrlid + 'sub3val'].value = r.quadrant;
+ this['cc_' + cntrlid + 'sub4val'].value = r.key;
+
+ formattedStr = r.formatResult;
+ break;
+ case 'GEOREF':
+ r = this.getFormattedGEOREFStr(withValue, format, false);
+
+ this['cc_' + cntrlid + 'sub1val'].value = r.lon + r.lat;
+ this['cc_' + cntrlid + 'sub2val'].value = r.quadrant15lon + r.quadrant15lat;
+ this['cc_' + cntrlid + 'sub3val'].value = r.quadrant1lon;
+ this['cc_' + cntrlid + 'sub4val'].value = r.quadrant1lat;
+
+ formattedStr = r.formatResult;
+ break;
+ case 'UTM':
+ r = this.getFormattedUTMStr(withValue, format, false);
+
+ if (r.bandLetter.match(/^[AaBbYyZz]/)) {
+ //do not calculate values if out side of the UTM range (i.e. polar regions)
+ this['cc_' + cntrlid + 'sub1val'].value = '';
+ this['cc_' + cntrlid + 'sub2val'].value = '';
+ this['cc_' + cntrlid + 'sub3val'].value = '';
+ this['cc_' + cntrlid + 'sub4val'].value = '';
+ r.formatResult = '';
+ } else {
+ this['cc_' + cntrlid + 'sub1val'].value = r.zone;
+ this['cc_' + cntrlid + 'sub2val'].value = r.bandLetter;
+ this['cc_' + cntrlid + 'sub3val'].value = r.easting;
+ this['cc_' + cntrlid + 'sub4val'].value = r.westing;
+ }
+
+ //r.bandLetter.match(/^[AaBbYyZz]/)?this.coordName.set('value','UPS'):this.coordName.set('value','UTM');
+ formattedStr = r.formatResult;
+ break;
+ case 'UTM_H':
+ r = this.getFormattedUTMHStr(withValue, format, false);
+
+ if (r.hemisphere.match(/^[AaBbYyZz]/)) {
+ //do not calculate values if out side of the UTM range (i.e. polar regions)
+ this['cc_' + cntrlid + 'sub1val'].value = '';
+ this['cc_' + cntrlid + 'sub2val'].value = '';
+ this['cc_' + cntrlid + 'sub3val'].value = '';
+ this['cc_' + cntrlid + 'sub4val'].value = '';
+ r.formatResult = '';
+ } else {
+ this['cc_' + cntrlid + 'sub1val'].value = r.zone;
+ this['cc_' + cntrlid + 'sub2val'].value = r.hemisphere;
+ this['cc_' + cntrlid + 'sub3val'].value = r.easting;
+ this['cc_' + cntrlid + 'sub4val'].value = r.westing;
+ }
+
+ //r.hemisphere.match(/^[AaBbYyZz]/) ?
+ // this.coordName.set('value','UPS') :
+ // this.coordName.set('value','UTM_H');
+ formattedStr = r.formatResult;
+ break;
+ }
+ }
+ } else {
+ formattedStr = '';
+
+ }
+ this.setSubCoordUI(dojoDomClass.contains(this.coordcontrols, 'expanded'));
+ if (this.coordtext) {
+ dojoDomAttr.set(this.coordtext, 'value', formattedStr);
+ this.emit('get-coordinate-complete', formattedStr);
+ }
+ },
+
+ /**
+ *
+ **/
+ getFormattedCoordinates: function () {
+ this.getCoordValues(this.currentClickPointDD, this.type, 4).then(
+ dojoLang.hitch(this, function (r) {
+ this.setCoordUI(r);
+ }),
+ dojoLang.hitch(this, function (err) {
+ console.log(err);
+ })
+ );
+ },
+
+ /**
+ * Updates the input coordinate textbox (coordtext)
+ **/
+ updateDisplay: function () {
+ if (this.currentClickPoint) {
+ this.getFormattedCoordinates(this.currentClickPointDD);
+ if (this.input) {
+ if (this.graphicsLayer !== null) {
+ this.graphicsLayer.clear();
+ if (this.currentClickPoint.spatialReference.wkid ===
+ this.parentWidget.map.spatialReference.wkid) {
+ this.graphicsLayer.add(new EsriGraphic(this.currentClickPoint));
+ } else {
+ this.getProjectedPoint(this.currentClickPointDD).then(dojoLang.hitch(this,
+ function (mapPoint) {
+ this.graphicsLayer.add(new EsriGraphic(mapPoint));
+ }
+ ), dojoLang.hitch(this,
+ function (err) {
+ console.error(err);
+ }));
+ }
+ }
+ dojoTopic.publish('INPUTPOINTDIDCHANGE', {
+ mapPoint: this.currentClickPointDD,
+ inputFromText: true
+ });
+ }
+ }
+ },
+
+ /**
+ * Clears current coordinate and text input
+ */
+ clear: function () {
+ this.coordtext.value = "";
+ this.currentClickPoint = null;
+ },
+
+ /**
+ *
+ **/
+ inputError: function () {
+ this.setCoordUI();
+ },
+
+ /**
+ *
+ **/
+ getCleanInput: function (fromstr) {
+ fromstr = fromstr.replace(/\n/g, '');
+ fromstr = fromstr.replace(/\s+/g, ' ').trim();
+ return fromstr.toUpperCase();
+ },
+
+ /**
+ * Send request to get dd coordinates in format string
+ **/
+ getCoordValues: function (fromInput, toType, numDigits) {
+ var deferred = new dojoDeferred();
+ var nd = numDigits || 6;
+ var tt;
+ if (toType.name) {
+ tt = toType.name;
+ } else {
+ tt = toType;
+ }
+ /**
+ * for parameter info
+ * http://resources.arcgis.com/en/help/arcgis-rest-api/#/To_GeoCoordinateString/02r30000026w000000/
+ **/
+ var params = {
+ sr: 4326,
+ coordinates: [
+ [fromInput.x, fromInput.y]
+ ],
+ conversionType: tt,
+ numOfDigits: nd,
+ rounding: true,
+ addSpaces: false
+ };
+
+ switch (toType) {
+ case 'DD':
+ params.numOfDigits = 6;
+ break;
+ case 'USNG':
+ params.numOfDigits = 5;
+ break;
+ case 'MGRS':
+ params.conversionMode = 'mgrsDefault';
+ params.numOfDigits = 5;
+ break;
+ case 'UTM_H':
+ params.conversionType = 'utm';
+ params.conversionMode = 'utmNorthSouth';
+ params.addSpaces = true;
+ break;
+ case 'UTM':
+ params.conversionType = 'utm';
+ params.conversionMode = 'utmDefault';
+ params.addSpaces = true;
+ break;
+ case 'GARS':
+ params.conversionMode = 'garsDefault';
+ break;
+ }
+
+ this.geomsrvc.toGeoCoordinateString(params).then(function (itm) {
+ deferred.resolve(itm);
+ }, function () {
+ deferred.resolve(null);
+ });
+
+ return deferred.promise;
+ },
+
+ /**
+ *
+ **/
+ getXYNotation: function (fromStr, toType) {
+ var deferred = new dojoDeferred();
+ var a;
+ var tt;
+ if (toType.name) {
+ tt = toType.name;
+ } else {
+ tt = toType;
+ }
+
+ var params = {
+ sr: 4326,
+ conversionType: tt,
+ strings: []
+ };
+
+ switch (tt) {
+ case 'DD':
+ case 'DDM':
+ case 'DMS':
+ params.numOfDigits = 2;
+ a = fromStr.replace(/[°˚º^~*"'′¨˝]/g, '');
+ params.strings.push(a);
+ break;
+ case 'DDrev':
+ params.conversionType = 'DD';
+ params.numOfDigits = 2;
+ a = fromStr.replace(/[°˚º^~*"'′¨˝]/g, '');
+ params.strings.push(a);
+ break;
+ case 'DDMrev':
+ params.conversionType = 'DDM';
+ params.numOfDigits = 2;
+ a = fromStr.replace(/[°˚º^~*"'′¨˝]/g, '');
+ params.strings.push(a);
+ break;
+ case 'DMSrev':
+ params.conversionType = 'DMS';
+ params.numOfDigits = 2;
+ a = fromStr.replace(/[°˚º^~*"'′¨˝]/g, '');
+ params.strings.push(a);
+ break;
+ case 'USNG':
+ params.strings.push(fromStr);
+ params.addSpaces = 'false';
+ break;
+ case 'MGRS':
+ params.conversionMode = 'mgrsNewStyle';
+ params.strings.push(fromStr);
+ params.addSpaces = 'false';
+ break;
+ case 'UTM_H':
+ params.conversionType = 'utm';
+ params.conversionMode = 'utmNorthSouth';
+ params.strings.push(fromStr);
+ break;
+ case 'UTM':
+ params.conversionType = 'utm';
+ params.conversionMode = 'utmDefault';
+ params.strings.push(fromStr);
+ break;
+ case 'GARS':
+ params.conversionMode = 'garsCenter';
+ params.strings.push(fromStr);
+ break;
+ case 'GEOREF':
+ params.strings.push(fromStr);
+ break;
+ }
+
+ this.geomsrvc.fromGeoCoordinateString(params).then(function (itm) {
+ deferred.resolve(itm);
+ }, function () {
+ deferred.resolve(null);
+ });
+
+ return deferred.promise;
+ },
+
+ getNotations: function () {
+ // using jshint ignore line on parts of the regular
+ // expressions that cannot be split over lines
+ var strs = [{
+ name: "DD",
+ pattern: new RegExp([
+ /^(([NS\+\-\s])*([0-8]?\d([,.]\d*)?|90([,.]0*)?)([°˚º^~*]*)([NS\+\-\s])*)([,:;\s|\/\\]+)/,
+ /(([EW\+\-\s])*([0]?\d?\d([,.]\d*)?|1[0-7]\d([,.]\d*)?|180([,.]0*)?)([°˚º^~*]*)([EW\+\-\s])*)$/ // jshint ignore:line
+ ].map(function (r) {
+ return r.source;
+ }).join("")),
+ notationType: this.nls.DDLatLongNotation,
+ conversionType: "DD"
+ }, {
+ name: "DDrev",
+ pattern: new RegExp([
+ /^(([EW\+\-\s])*([0]?\d?\d([,.]\d*)?|1[0-7]\d([,.]\d*)?|180([,.]0*)?)([°˚º^~*]*)([EW\+\-\s])*)/, // jshint ignore:line
+ /([,:;\s|\/\\]+)(([NS\+\-\s])*([0-8]?\d([,.]\d*)?|90([,.]0*)?)([°˚º^~*]*)([NS\+\-\s])*)$/
+ ].map(function (r) {
+ return r.source;
+ }).join("")),
+ notationType: this.nls.DDLongLatNotation,
+ conversionType: "DD"
+ }, {
+ name: "DDM",
+ pattern: new RegExp([
+ /^(([NS\+\-\s])*([0-8]?\d|90)[°˚º^~*\s\-_]+(([0-5]?\d|\d)([,.]\d*)?)['′\s_]*([NS\+\-\s])*)/,
+ /([,:;\s|\/\\]+)/,
+ /(([EW\+\-\s])*([0]?\d?\d|1[0-7]\d|180)[°˚º^~*\s\-_]+(([0-5]\d|\d)([,.]\d*)?)['′\s_]*([EW\+\-\s])*)/, // jshint ignore:line
+ /[\s]*$/
+ ].map(function (r) {
+ return r.source;
+ }).join("")),
+ notationType: this.nls.DDMLatLongNotation,
+ conversionType: "DDM"
+ }, {
+ name: "DDMrev",
+ pattern: new RegExp([
+ /^(([EW\+\-\s])*([0]?\d?\d|1[0-7]\d|180)[°˚º^~*\s\-_]+(([0-5]\d|\d)([,.]\d*)?)['′\s_]*([EW\+\-\s])*)/, // jshint ignore:line
+ /([,:;\s|\/\\]+)/,
+ /(([NS\+\-\s])*([0-8]?\d|90)[°˚º^~*\s\-_]+(([0-5]?\d|\d)([,.]\d*)?)['′\s_]*([NS\+\-\s])*)[\s]*$/ // jshint ignore:line
+ ].map(function (r) {
+ return r.source;
+ }).join("")),
+ notationType: this.nls.DDMLongLatNotation,
+ conversionType: "DDM"
+ }, {
+ name: "DMS",
+ pattern: new RegExp([
+ /^(([NS\+\-\s])*([0-8]?\d|90)[°˚º^~*\s\-_]+([0-5]?\d|\d)['′\s\-_]+(([0-5]?\d|\d)([,.]\d*)?)["¨˝\s_]*([NS\+\-\s])*)/, // jshint ignore:line
+ /([,:;\s|\/\\]+)/,
+ /(([EW\+\-\s])*([0]?\d?\d|1[0-7]\d|180)[°˚º^~*\s\-_]+([0-5]\d|\d)['′\s\-_]+(([0-5]?\d|\d)([,.]\d*)?)["¨˝\s_]*([EW\+\-\s])*)[\s]*$/ // jshint ignore:line
+ ].map(function (r) {
+ return r.source;
+ }).join("")),
+ notationType: this.nls.DMSLatLongNotation,
+ conversionType: "DMS"
+ }, {
+ name: "DMSrev",
+ pattern: new RegExp([
+ /^(([EW\+\-\s])*([0]?\d?\d|1[0-7]\d|180)[°˚º^~*\s\-_]+([0-5]\d|\d)['′\s\-_]+(([0-5]?\d|\d)([,.]\d*)?)["¨˝\s_]*([EW\+\-\s])*)/, // jshint ignore:line
+ /([,:;\s|\/\\]+)/,
+ /(([NS\+\-\s])*([0-8]?\d|90)[°˚º^~*\s\-_]+([0-5]?\d|\d)['′\s\-_]+(([0-5]?\d|\d)([,.]\d*)?)["¨˝\s_]*([NS\+\-\s])*)[\s]*$/ // jshint ignore:line
+ ].map(function (r) {
+ return r.source;
+ }).join("")),
+ notationType: this.nls.DMSLongLatNotation,
+ conversionType: "DMS"
+ }, {
+ name: "GARS",
+ pattern: /^\d{3}[a-zA-Z]{2}[1-4]?[1-9]?$/,
+ notationType: this.nls.GARSNotation,
+ conversionType: "GARS"
+ }, {
+ name: "GEOREF",
+ pattern: /^[a-zA-Z]{4}\d{1,8}$/,
+ notationType: this.nls.GEOREFNotation,
+ conversionType: "GEOREF"
+ }, {
+ name: "MGRS",
+ pattern: new RegExp([
+ /^\d{1,2}[-,;:\s]*[C-HJ-NP-X][-,;:\s]*[A-HJ-NP-Z]{2}[-,;:\s]*/,
+ /(\d[-,;:\s]+\d|\d{2}[-,;:\s]+\d{2}|\d{3}[-,;:\s]+\d{3}|\d{4}[-,;:\s]+\d{4}|\d{5}[-,;:\s]+\d{5})/, // jshint ignore:line
+ /$|^(\d{1,2}[-,;:\s]*[C-HJ-NP-X][-,;:\s]*[A-HJ-NP-Z]{2}[-,;:\s]*)/,
+ /(\d{2}|\d{4}|\d{6}|\d{8}|\d{10})?$|^[ABYZ][-,;:\s]*[A-HJ-NP-Z]{2}[-,;:\s]*/,
+ /(\d[-,;:\s]+\d|\d{2}[-,;:\s]+\d{2}|\d{3}[-,;:\s]+\d{3}|\d{4}[-,;:\s]+\d{4}|\d{5}[-,;:\s]+\d{5})/, // jshint ignore:line
+ /$|^[ABYZ][-,;:\s]*[A-HJ-NP-Z]{2}[-,;:\s]*(\d{2}|\d{4}|\d{6}|\d{8}|\d{10})?$/
+ ].map(function (r) {
+ return r.source;
+ }).join("")),
+ notationType: this.nls.MGRSNotation,
+ conversionType: "MGRS"
+ },
+ {
+ name: "UTM",
+ pattern: new RegExp([
+ /^\d{1,2}[-,;:\s]*[c-hj-np-xC-HJ-NP-X][-,;:\s]*\d{1,6}\.?\d*[mM]?[-,;:\s]?\d{1,7}\.?\d*[mM]?$/ // jshint ignore:line
+ ].map(function (r) {
+ return r.source;
+ }).join("")),
+ notationType: this.nls.UTMBandNotation,
+ conversionType: "UTM"
+ }, {
+ name: "UTM (H)",
+ pattern: new RegExp([
+ /^\d{1,2}[-,;:\s]*[NnSs][-,;:\s]*\d{1,6}\.?\d*[mM]?[-,;:\s]+\d{1,7}\.?\d*[mM]?$/
+ ].map(function (r) {
+ return r.source;
+ }).join("")),
+ notationType: this.nls.UTMHemNotation,
+ conversionType: "UTM_H"
+ }
+ ];
+ return strs;
+ },
+
+ getCoordinateType: function (fromInput) {
+ var clnInput = this.getCleanInput(fromInput);
+ var deferred = new dojoDeferred();
+ //regexr.com
+
+ var strs = this.getNotations();
+
+ var matchedtype = dojoArray.filter(strs, function (itm) {
+ return itm.pattern.test(this.v);
+ }, {
+ v: clnInput
+ });
+
+ if (matchedtype.length > 0) {
+ deferred.resolve(matchedtype);
+ } else {
+ deferred.resolve(null);
+ }
+ return deferred.promise;
+ },
+
+ /**
+ *
+ **/
+ getFormattedDDStr: function (fromValue, withFormatStr, addSignPrefix) {
+ var r = {};
+ r.sourceValue = fromValue;
+ r.sourceFormatString = withFormatStr;
+
+ var parts = fromValue[0].split(/[ ,]+/);
+
+ r.latdeg = parts[0].replace(/[nNsS]/, '');
+ r.londeg = parts[1].replace(/[eEwW]/, '');
+
+ if (addSignPrefix) {
+ if (parts[0].slice(-1) === 'N') {
+ r.latdeg = '+' + r.latdeg;
+ } else {
+ r.latdeg = '-' + r.latdeg;
+ }
+ if (parts[1].slice(-1) === "W") {
+ r.londeg = '-' + r.londeg;
+ } else {
+ r.londeg = '+' + r.londeg;
+ }
+ }
+
+ var s = withFormatStr.replace(/X/, r.londeg);
+ s = s.replace(/[eEwW]/, parts[1].slice(-1));
+ s = s.replace(/[nNsS]/, parts[0].slice(-1));
+ s = s.replace(/Y/, r.latdeg);
+
+ r.formatResult = s;
+ return r;
+ },
+
+ /**
+ *
+ **/
+ getFormattedDDMStr: function (fromValue, withFormatStr, addSignPrefix) {
+ var r = {};
+ r.sourceValue = fromValue;
+ r.sourceFormatString = withFormatStr;
+
+ r.parts = fromValue[0].split(/[ ,]+/);
+
+ r.latdeg = r.parts[0];
+ r.latmin = r.parts[1].replace(/[nNsS]/, '');
+ r.londeg = r.parts[2];
+ r.lonmin = r.parts[3].replace(/[eEwW]/, '');
+
+ if (addSignPrefix) {
+ if (r.parts[1].slice(-1) === 'N') {
+ r.latdeg = '+' + r.latdeg;
+ } else {
+ r.latdeg = '-' + r.latdeg;
+ }
+ if (r.parts[3].slice(-1) === 'W') {
+ r.londeg = '-' + r.londeg;
+ } else {
+ r.londeg = '+' + r.londeg;
+ }
+ }
+
+ //A° B'N X° Y'E
+ var s = withFormatStr.replace(/[EeWw]/, r.parts[3].slice(-1));
+ s = s.replace(/Y/, r.lonmin);
+ s = s.replace(/X/, r.londeg);
+ s = s.replace(/[NnSs]/, r.parts[1].slice(-1));
+ s = s.replace(/B/, r.latmin);
+ s = s.replace(/A/, r.latdeg);
+
+ r.formatResult = s;
+ return r;
+ },
+
+ /**
+ *
+ **/
+ getFormattedDMSStr: function (fromValue, withFormatStr, addSignPrefix) {
+ var r = {};
+ r.sourceValue = fromValue;
+ r.sourceFormatString = withFormatStr;
+
+ r.parts = fromValue[0].split(/[ ,]+/);
+
+ r.latdeg = r.parts[0];
+ r.latmin = r.parts[1];
+ r.latsec = r.parts[2].replace(/[NnSs]/, '');
+
+
+ r.londeg = r.parts[3];
+ r.lonmin = r.parts[4];
+ if (r.parts[5]) {
+ r.lonsec = r.parts[5].replace(/[EWew]/, '');
+ }
+
+ if (addSignPrefix) {
+ if (r.parts[2].slice(-1) === 'N') {
+ r.latdeg = '+' + r.latdeg;
+ } else {
+ r.latdeg = '-' + r.latdeg;
+ }
+ if (r.parts[5].slice(-1) === 'W') {
+ r.londeg = '-' + r.londeg;
+ } else {
+ r.londeg = '+' + r.londeg;
+ }
+ }
+
+ //A° B' C''N X° Y' Z''E
+ var s = withFormatStr.replace(/A/, r.latdeg);
+ s = s.replace(/B/, r.latmin);
+ s = s.replace(/C/, r.latsec);
+ s = s.replace(/X/, r.londeg);
+ s = s.replace(/Y/, r.lonmin);
+ s = s.replace(/Z/, r.lonsec);
+ s = s.replace(/[NnSs]/, r.parts[2].slice(-1));
+ if (r.parts[5]) {
+ s = s.replace(/[EeWw]/, r.parts[5].slice(-1));
+ }
+
+ r.formatResult = s;
+ return r;
+ },
+
+ /**
+ *
+ **/
+ getFormattedUSNGStr: function (fromValue, withFormatStr) {
+ var r = {};
+ r.sourceValue = fromValue;
+ r.sourceFormatString = withFormatStr;
+
+ if (fromValue[0].match(/^[ABYZ]/)) {
+ r.gzd = fromValue[0].match(/[ABYZ]/)[0].trim();
+ } else {
+ r.gzd = fromValue[0].match(/\d{1,2}[C-HJ-NP-X]/)[0].trim();
+ }
+ if (fromValue[0].replace(r.gzd, '').match(/[a-hJ-zA-HJ-Z]{2}/)) {
+ r.grdsq = fromValue[0].replace(r.gzd, '').match(/[a-hJ-zA-HJ-Z]{2}/)[0].trim();
+ }
+ if (fromValue[0].replace(r.gzd + r.grdsq, '').match(/^\d{1,5}/)) {
+ r.easting = fromValue[0].replace(r.gzd + r.grdsq, '').match(/^\d{1,5}/)[0].trim();
+ }
+ if (fromValue[0].replace(r.gzd + r.grdsq, '').match(/\d{1,5}$/)) {
+ r.northing = fromValue[0].replace(r.gzd + r.grdsq, '').match(/\d{1,5}$/)[0].trim();
+ }
+
+ //Z S X# Y#
+ var s = withFormatStr.replace(/Y/, r.northing);
+ s = s.replace(/X/, r.easting);
+ s = s.replace(/S/, r.grdsq);
+ s = s.replace(/Z/, r.gzd);
+
+ r.formatResult = s;
+ return r;
+ },
+
+ /**
+ *
+ **/
+ getFormattedMGRSStr: function (fromValue, withFormatStr) {
+ var r = {};
+ r.sourceValue = fromValue;
+ r.sourceFormatString = withFormatStr;
+
+ if (fromValue[0].match(/^[ABYZ]/)) {
+ r.gzd = fromValue[0].match(/[ABYZ]/)[0].trim();
+ } else {
+ r.gzd = fromValue[0].match(/\d{1,2}[C-HJ-NP-X]/)[0].trim();
+ }
+ r.grdsq = fromValue[0].replace(r.gzd, '').match(/[a-hJ-zA-HJ-Z]{2}/)[0].trim();
+ r.easting = fromValue[0].replace(r.gzd + r.grdsq, '').match(/^\d{1,5}/)[0].trim();
+ r.northing = fromValue[0].replace(r.gzd + r.grdsq, '').match(/\d{1,5}$/)[0].trim();
+
+ //Z S X# Y#
+ var s = withFormatStr.replace(/Y/, r.northing);
+ s = s.replace(/X/, r.easting);
+ s = s.replace(/S/, r.grdsq);
+ s = s.replace(/Z/, r.gzd);
+
+ r.formatResult = s;
+ return r;
+ },
+
+ /**
+ *
+ **/
+ getFormattedGARSStr: function (fromValue, withFormatStr) {
+ var r = {};
+ r.sourceValue = fromValue;
+ r.sourceFormatString = withFormatStr;
+
+ r.lon = fromValue[0].match(/\d{3}/);
+ r.lat = fromValue[0].match(/[a-zA-Z]{2}/);
+
+ var q = fromValue[0].match(/\d*$/);
+ r.quadrant = q[0][0];
+ r.key = q[0][1];
+
+ //XYQK
+ var s = withFormatStr.replace(/K/, r.key);
+ s = s.replace(/Q/, r.quadrant);
+ s = s.replace(/Y/, r.lat);
+ s = s.replace(/X/, r.lon);
+
+ r.formatResult = s;
+ return r;
+ },
+
+ /**
+ *
+ **/
+ getFormattedGEOREFStr: function (fromValue, withFormatStr) {
+ var r = {};
+ r.sourceValue = fromValue;
+ r.sourceFormatString = withFormatStr;
+
+ r.lon = fromValue[0].match(/[a-zA-Z]{1}/)[0].trim();
+ r.lat = fromValue[0].replace(r.lon, '').match(/[a-zA-Z]{1}/)[0].trim();
+ r.quadrant15lon = fromValue[0].replace(r.lon + r.lat, '').match(/[a-zA-Z]{1}/)[0].trim();
+ r.quadrant15lat = fromValue[0].replace(r.lon +
+ r.lat + r.quadrant15lon, '').match(/[a-zA-Z]{1}/)[0].trim();
+
+ var q = fromValue[0].replace(r.lon + r.lat + r.quadrant15lon + r.quadrant15lat, '');
+
+ r.quadrant1lon = q.substr(0, q.length / 2);
+ r.quadrant1lat = q.substr(q.length / 2, q.length);
+
+ //ABCDXY
+ var s = withFormatStr.replace(/Y/, r.quadrant1lat);
+ s = s.replace(/X/, r.quadrant1lon);
+ s = s.replace(/D/, r.quadrant15lat);
+ s = s.replace(/C/, r.quadrant15lon);
+ s = s.replace(/B/, r.lat);
+ s = s.replace(/A/, r.lon);
+
+ r.formatResult = s;
+ return r;
+ },
+
+ /**
+ *
+ **/
+ getFormattedUTMStr: function (fromValue, withFormatStr) {
+ var r = {};
+ r.sourceValue = fromValue;
+ r.sourceFormatString = withFormatStr;
+
+ r.parts = fromValue[0].split(/[ ,]+/);
+ r.zone = r.parts[0].replace(/[A-Z]/, '');
+ r.bandLetter = r.parts[0].slice(-1);
+ r.easting = r.parts[1];
+ r.westing = r.parts[2];
+
+ //ZB Xm Ym'
+ var s = withFormatStr.replace(/Y/, r.westing);
+ s = s.replace(/X/, r.easting);
+ s = s.replace(/B/, r.bandLetter);
+ s = s.replace(/Z/, r.zone);
+
+ r.formatResult = s;
+ return r;
+ },
+
+ /**
+ *
+ **/
+ getFormattedUTMHStr: function (fromValue, withFormatStr) {
+ var r = {};
+ r.sourceValue = fromValue;
+ r.sourceFormatString = withFormatStr;
+
+ r.parts = fromValue[0].split(/[ ,]+/);
+ r.zone = r.parts[0].replace(/[A-Z]/, '');
+ r.hemisphere = r.parts[0].slice(-1);
+
+ r.easting = r.parts[1];
+ r.westing = r.parts[2];
+
+ //ZH Xm Ym'
+ var s = withFormatStr.replace(/Y/, r.westing);
+ s = s.replace(/X/, r.easting);
+ s = s.replace(/H/, r.hemisphere);
+ s = s.replace(/Z/, r.zone);
+
+ r.formatResult = s;
+ return r;
+ }
+ });
+});
\ No newline at end of file
diff --git a/app/jimu.js/dijit/CustomColorPicker.js b/app/jimu.js/dijit/CustomColorPicker.js
new file mode 100644
index 0000000..4ea16be
--- /dev/null
+++ b/app/jimu.js/dijit/CustomColorPicker.js
@@ -0,0 +1,193 @@
+///////////////////////////////////////////////////////////////////////////
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
+//
+// Licensed under the Apache License Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+///////////////////////////////////////////////////////////////////////////
+
+define(['dojo/Evented',
+ 'dojo/_base/declare',
+ 'dijit/_WidgetBase',
+ 'dijit/_TemplatedMixin',
+ 'dojo/_base/lang',
+ 'dojo/_base/html',
+ 'dojo/on',
+ 'dojo/_base/Color',
+ "jimu/dijit/ColorSelector"
+],
+ function (Evented, declare, _WidgetBase, _TemplatedMixin, lang, html, on, Color, ColorSelector) {
+ return declare([_WidgetBase, _TemplatedMixin, Evented], {
+ baseClass: 'jimu-color-picker',
+ declaredClass: 'jimu.dijit.ColorPicker',
+ templateString: '
',
+ _isTooltipDialogOpened: false,
+
+ //options:
+ color: null, //dojo.Color or hex string
+ showHex: true,
+ showHsv: true,
+ showRgb: true,
+ ensureMode: false,
+ showLabel: false,
+
+ //public methods:
+ //setColor
+ //getColor
+ //isPartOfPopup
+
+ //events:
+ //change
+
+ postMixInProperties: function () {
+ this.nls = window.jimuNls.common;
+ },
+
+ postCreate: function () {
+ this.inherited(arguments);
+ if (this.color) {
+ if (!(this.color instanceof Color)) {
+ this.color = new Color(this.color);
+ }
+ } else {
+ this.color = new Color('#ccc');
+ }
+
+ html.setStyle(this.domNode, 'backgroundColor', this.color.toHex());
+
+ this._createDialog(this.domNode);
+ },
+
+ destroy: function () {
+ //dojoPopup.close(this.tooltipDialog);
+ this.picker.destroy();
+ //this.tooltipDialog.destroy();
+ this.inherited(arguments);
+ },
+
+ _handlerOk: function (event) {
+ if (event && event.stopPropagation && event.preventDefault) {
+ event.stopPropagation();
+ event.preventDefault();
+ }
+
+ this.emit("ok", this.color);
+ },
+ _handlerApply: function (event) {
+ if (event && event.stopPropagation && event.preventDefault) {
+ event.stopPropagation();
+ event.preventDefault();
+ }
+
+ this.emit("apply", this.color);
+ },
+ _handlerCancel: function (event) {
+ if (event && event.stopPropagation && event.preventDefault) {
+ event.stopPropagation();
+ event.preventDefault();
+ }
+
+ this.emit("cancel");
+ },
+
+ _createDialog: function () {
+ var ttdContent = html.create("div", {
+ "class": "dojox-color-picker-container"
+ }, this.domNode);
+ var picker = new ColorSelector({
+ showHex: this.showHex,
+ showRgb: this.showRgb,
+ showHsv: this.showHsv,
+ value: this.color.toHex(),
+ onChange: lang.hitch(this, function (newHex) {
+ var color = new Color(newHex);
+ this.setColor(color);
+ })
+ });
+ picker.placeAt(ttdContent);
+ picker.startup();
+
+ var btnsContainer = html.create("div", {
+ "class": "btns-container jimu-float-trailing"
+ }, ttdContent);
+ //1. "ok" will set color AND close dialog
+ if (true === this.showOk) {
+ var ok = html.create('div', {
+ 'class': 'jimu-btn jimu-float-leading ok',
+ 'title': this.nls.ok,
+ 'innerHTML': this.nls.ok
+ }, btnsContainer);
+ this.own(on(ok, 'click', lang.hitch(this, function (e) {
+ var c = this.picker.get('value');
+ this.setColor(new Color(c));
+ this._handlerOk(e);
+ })));
+ }
+ //2. "apply" will set color, DO NOT close dialog
+ if (true === this.showApply) {
+ var apply = html.create('div', {
+ 'class': 'jimu-btn jimu-float-leading apply',
+ 'title': this.nls.apply,
+ 'innerHTML': this.nls.apply
+ }, btnsContainer);
+ this.own(on(apply, 'click', lang.hitch(this, function (e) {
+ var c = this.picker.get('value');
+ this.setColor(new Color(c));
+ this._handlerApply(e);
+ })));
+ }
+ //3. just close dialog
+ var cancel = html.create('div', {
+ 'class': 'jimu-btn jimu-btn-vacation jimu-float-leading',
+ 'title': this.nls.cancel,
+ 'innerHTML': this.nls.cancel
+ }, btnsContainer);
+ this.own(on(cancel, 'click', lang.hitch(this, function (e) {
+ this._handlerCancel(e);
+ })));
+
+ this.picker = picker;
+ },
+
+ setColor: function (newColor/*, isOnChange*/) {
+ if (!(newColor instanceof Color)) {
+ return;
+ }
+ var oldColor = this.color;
+ var oldHex = '';
+ if (oldColor) {
+ oldHex = oldColor.toHex();
+ }
+ var newHex = newColor.toHex();
+ this.color = newColor;
+
+ if (oldHex !== newHex) {
+ this.picker.set('value', newHex);
+ // if (false !== isOnChange) {
+ // this.onChange(new Color(newHex)); //==> onChange will hide popoup
+ // }
+ }
+ },
+
+ getColor: function () {
+ return this.color;
+ },
+ // onChange: function (newColor) {
+ // /*jshint unused: false*/
+
+ // if (this.showLabel) {
+ // this._changeLabel(newColor);
+ // }
+ // },
+ onClose: function () {
+ }
+ });
+ });
\ No newline at end of file
diff --git a/app/jimu.js/dijit/DataPreviewTable.js b/app/jimu.js/dijit/DataPreviewTable.js
new file mode 100644
index 0000000..a88cdcd
--- /dev/null
+++ b/app/jimu.js/dijit/DataPreviewTable.js
@@ -0,0 +1,99 @@
+/*
+// Copyright © 2014 - 2018 Esri. All rights reserved.
+
+TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
+Unpublished material - all rights reserved under the
+Copyright Laws of the United States and applicable international
+laws, treaties, and conventions.
+
+For additional information, contact:
+Attn: Contracts and Legal Department
+Environmental Systems Research Institute, Inc.
+380 New York Street
+Redlands, California, 92373
+USA
+
+email: contracts@esri.com
+*/
+
+define([
+ 'dojo/_base/declare',
+ 'dojo/_base/html',
+ 'dijit/_WidgetBase',
+ 'dojo/_base/lang',
+ 'dojo/_base/array',
+ 'jimu/utils',
+ 'dgrid/OnDemandGrid',
+ /*"dgrid/extensions/ColumnHider",*/
+ "dgrid/extensions/ColumnResizer",
+ "dgrid/extensions/ColumnReorder"
+], function (declare, html, _WidgetBase, lang, array, utils,
+ OnDemandGrid, /*ColumnHider,*/ColumnResizer, ColumnReorder) {
+ /* global apiUrl */
+ return declare([_WidgetBase], {
+ declaredClass: "jimu.dijit.DataPreviewTable",
+ baseClass: "jimu-data-preview-table",
+ featureSet: null,
+ loadingIndicator: null,
+ _AUTO_WIDTH_COLS: 6,
+
+ postCreate: function () {
+ this.inherited(arguments);
+ utils.loadStyleLink("dgrid", apiUrl + "dgrid/css/dgrid.css");
+
+ this.tableContainer = html.create('div', {
+ 'class': "table-container"
+ }, this.domNode);
+
+ if (this.height) {
+ html.style(this.tableContainer, "height", (this.height - 80) + "px");
+ }
+
+ var columns = this._getColumns();
+ this.grid = new (declare([OnDemandGrid, /*ColumnHider,*/ColumnResizer, ColumnReorder]))({
+ columns: columns
+ }, this.tableContainer);
+ var data = this._getData();
+ this.grid.renderArray(data);
+ },
+
+ _getColumns: function () {
+ // columns: {
+ // first: 'First Name',
+ // last: 'Last Name',
+ // age: 'Age'
+ // }
+ var cellWidth = "auto";
+ if (this.featureSet.fields &&
+ this.featureSet.fields.length && this.featureSet.fields.length > this._AUTO_WIDTH_COLS) {
+ cellWidth = 120;
+ }
+
+ var layout = {};
+ array.forEach(this.featureSet.fields, function (f) {
+ layout[f.name] = {
+ label: f.alias,
+ width: cellWidth
+ };
+ });
+ return layout;
+ },
+ _getData: function () {
+ // [
+ // { first: 'Bob', last: 'Barker', age: 89 },
+ // { first: 'Vanna', last: 'White', age: 55 },
+ // { first: 'Pat', last: 'Sajak', age: 65 }
+ // ];
+ var data = [];
+ array.forEach(this.featureSet.features, function (feature, idx) {
+ var row = {};
+ array.forEach(this.featureSet.fields, function (f) {
+ row[f.name] = feature.attributes[f.name];
+ }, this);
+ data.push(lang.clone(lang.mixin({ id: idx + 1 }, row)));
+ }, this);
+
+ return data;
+ }
+ });
+});
\ No newline at end of file
diff --git a/app/jimu.js/dijit/DataSource.js b/app/jimu.js/dijit/DataSource.js
new file mode 100644
index 0000000..b5e7d0b
--- /dev/null
+++ b/app/jimu.js/dijit/DataSource.js
@@ -0,0 +1,256 @@
+///////////////////////////////////////////////////////////////////////////
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
+//
+// Licensed under the Apache License Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+///////////////////////////////////////////////////////////////////////////
+
+define([
+ 'dojo/on',
+ 'dojo/Evented',
+ 'dojo/_base/lang',
+ 'dojo/_base/html',
+ 'dojo/_base/array',
+ 'dojo/_base/declare',
+ 'dijit/_WidgetBase',
+ 'dijit/_TemplatedMixin',
+ 'dijit/_WidgetsInTemplateMixin',
+ 'jimu/dijit/TabContainer3',
+ 'jimu/dijit/_FeaturelayerChooserWithButtons',
+ 'jimu/dijit/_QueryableLayerChooserWithButtons',
+ 'jimu/dijit/QueryableServiceChooserFromPortal',
+ 'jimu/dijit/_QueryableServiceChooserContent',
+ 'jimu/dijit/_FrameworkDataSourceChooserWithButtons'
+ ],
+ function(on, Evented, lang, html, array, declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
+ TabContainer3, FeaturelayerChooserWithButtons, QueryableLayerChooserWithButtons,
+ QueryableServiceChooserFromPortal, _QueryableServiceChooserContent, _FrameworkDataSourceChooserWithButtons) {
+
+ var NLS = window.jimuNls.queryableLayerSource;
+
+ var clazz = declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, Evented], {
+ templateString: "
",
+ baseClass: 'jimu-dijit-data-source',
+ declaredClass: 'jimu.dijit.DataSource',
+ nls: null,
+ dijits: null,
+
+ //options:
+ types: null, //[{type: "", options: {}},...]
+
+ //public methods:
+ //getSelectedItems
+
+ //events:
+ //ok
+ //cancel
+
+ postMixInProperties: function() {
+ this.nls = NLS;
+ this.dijits = [];
+ },
+
+ postCreate: function() {
+ this.inherited(arguments);
+ this._initSelf();
+ },
+
+ _initSelf: function(){
+ var tabs = [];
+
+ array.forEach(this.types, lang.hitch(this, function(item, index){
+ var type = item.type;
+ var classInfo = clazz[type + '_CLASS_INFO'];
+
+ if(!classInfo){
+ console.error("Unsupported data source type:", type);
+ return;
+ }
+
+ var options = null;
+
+ if(classInfo.defaultOptions){
+ var defaultOptions = lang.clone(classInfo.defaultOptions);
+ options = lang.mixin(defaultOptions, item.options);
+ }else{
+ options = item.options;
+ }
+
+ if(!options){
+ options = {};
+ }
+
+ options.style = {
+ width: '100%',
+ height: '100%'
+ };
+
+ var dataSourceId = type + "_" + index;
+ var dsType = type;
+
+ var dsDijit = new classInfo.className(options);
+ html.addClass(dsDijit.domNode, 'hidden');
+ dsDijit._dsType = dsType;
+ dsDijit._dataSourceId = dataSourceId;
+ dsDijit._classInfo = classInfo;
+ this.own(on(dsDijit, 'ok', lang.hitch(this, function() {
+ var items = this.getSelectedItems();
+ if (items && items.length > 0) {
+ this.emit('ok', items);
+ }
+ })));
+ this.own(on(dsDijit, 'cancel', lang.hitch(this, function() {
+ this.emit('cancel');
+ })));
+ this.dijits.push(dsDijit);
+
+ tabs.push({
+ title: classInfo.defaultTitle,
+ content: dsDijit
+ });
+ }));
+
+ this.tab = new TabContainer3({
+ tabs: tabs
+ });
+ this.tab.placeAt(this.domNode);
+ },
+
+ _getSelectedDijit: function(){
+ var index = this.tab.getSelectedIndex();
+ return this.dijits[index];
+ },
+
+ getSelectedSourceType: function() {
+ var dsDijit = this._getSelectedDijit();
+ if(dsDijit){
+ return dsDijit._classInfo.sourceType;
+ }
+ return "";
+ },
+
+ getSelectedItems: function() {
+ var items = [];
+ var dsDijit = this._getSelectedDijit();
+ if(dsDijit){
+ items = dsDijit.getSelectedItems();
+ if(items && items.length > 0){
+ array.forEach(items, lang.hitch(this, function(item){
+ item.dataSourceType = dsDijit._dsType;
+ }));
+ }
+ }
+ return items;
+ },
+
+ destroy: function(){
+ if(this.dijits && this.dijits.length > 0){
+ array.forEach(this.dijits, lang.hitch(this, function(dsDijit){
+ dsDijit.destroy();
+ dsDijit = null;
+ }));
+ }
+ this.dijits = null;
+ this.inherited(arguments);
+ }
+ });
+
+ clazz.DATA_SOURCE_FEATURE_LAYER_FROM_MAP = "DATA_SOURCE_FEATURE_LAYER_FROM_MAP";
+ clazz.DATA_SOURCE_QUERYABLE_LAYER_FROM_MAP = "DATA_SOURCE_QUERYABLE_LAYER_FROM_MAP";
+ clazz.DATA_SOURCE_QUERYABLE_LAYER_FROM_PORTAL = "DATA_SOURCE_QUERYABLE_LAYER_FROM_PORTAL";
+ clazz.DATA_SOURCE_QUERYABLE_LAYER_FROM_URL = "DATA_SOURCE_QUERYABLE_LAYER_FROM_URL";
+ clazz.DATA_SOURCE_FROM_FRAMEWORK = "DATA_SOURCE_FROM_FRAMEWORK";
+
+ clazz.DATA_SOURCE_FEATURE_LAYER_FROM_MAP_CLASS_INFO = {
+ className: FeaturelayerChooserWithButtons,
+ defaultTitle: NLS.selectFromMap,
+ defaultOptions: {
+ multiple: false
+ },
+ sourceType: 'map'
+ };
+
+ clazz.DATA_SOURCE_QUERYABLE_LAYER_FROM_MAP_CLASS_INFO = {
+ className: QueryableLayerChooserWithButtons,
+ defaultTitle: NLS.selectFromMap,
+ defaultOptions: {
+ multiple: false
+ },
+ sourceType: 'map'
+ };
+
+ clazz.DATA_SOURCE_QUERYABLE_LAYER_FROM_PORTAL_CLASS_INFO = {
+ className: QueryableServiceChooserFromPortal,
+ defaultTitle: NLS.selectFromPortal,
+ defaultOptions: {
+ multiple: false
+ },
+ sourceType: 'portal'
+ };
+
+ clazz.DATA_SOURCE_QUERYABLE_LAYER_FROM_URL_CLASS_INFO = {
+ className: _QueryableServiceChooserContent,
+ defaultTitle: NLS.addServiceUrl,
+ defaultOptions: {
+ multiple: false
+ },
+ sourceType: 'url'
+ };
+
+ clazz.DATA_SOURCE_FROM_FRAMEWORK_CLASS_INFO = {
+ className: _FrameworkDataSourceChooserWithButtons,
+ defaultTitle: window.jimuNls.frameworkDatasource.customDataSource,
+ defaultOptions: null,
+ sourceType: 'framework'
+ };
+
+ //options: {createMapResponse, portalUrl}
+ clazz.createQueryableLayerTypes = function(options) {
+ return [{
+ type: clazz.DATA_SOURCE_QUERYABLE_LAYER_FROM_MAP,
+ options: {
+ createMapResponse: options.createMapResponse,
+ onlyShowWebMapLayers: true
+ }
+ }, {
+ type: clazz.DATA_SOURCE_QUERYABLE_LAYER_FROM_PORTAL,
+ options: {
+ portalUrl: options.portalUrl
+ }
+ }, {
+ type: clazz.DATA_SOURCE_QUERYABLE_LAYER_FROM_URL
+ }];
+ };
+
+ //options: {createMapResponse, appConfig}
+ clazz.createInfographicTypes = function(options){
+ return [{
+ type: clazz.DATA_SOURCE_FEATURE_LAYER_FROM_MAP,
+ options: {
+ createMapResponse: options.createMapResponse,
+ types: ['point','polyline','polygon'],
+ showLayerFromFeatureSet: true,
+ showTable: false,
+ mustSupportStatistics: false,
+ ignoreVirtualLayer: true,
+ onlyShowWebMapLayers: true
+ }
+ }, {
+ type: clazz.DATA_SOURCE_FROM_FRAMEWORK,
+ options: {
+ appConfig: options.appConfig
+ }
+ }];
+ };
+
+ return clazz;
+ });
\ No newline at end of file
diff --git a/app/jimu.js/dijit/DrawBox.js b/app/jimu.js/dijit/DrawBox.js
index efca778..7efb1a7 100644
--- a/app/jimu.js/dijit/DrawBox.js
+++ b/app/jimu.js/dijit/DrawBox.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -34,6 +34,7 @@ define([
],
function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, template, lang, html,
array, on, query, Evented, Graphic, GraphicsLayer, Draw, jsonUtils, Polygon) {
+ var instancesObj = {};
return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, Evented], {
templateString:template,
@@ -141,6 +142,8 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, templat
var display = this.showClear === true ? 'block' : 'none';
html.setStyle(this.btnClear, 'display', display);
this.enable();
+
+ instancesObj[this.id] = this;
},
enable: function(){
@@ -201,6 +204,7 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, templat
this.drawToolBar = null;
this.map = null;
this.drawLayer = null;
+ delete instancesObj[this.id];
this.inherited(arguments);
},
@@ -421,6 +425,8 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, templat
},
_activate: function(itemIcon){
+ this._deactiveAllDrawBoxes();
+
var items = query('.draw-item', this.domNode);
items.removeClass('jimu-state-active');
html.addClass(itemIcon, 'jimu-state-active');
@@ -481,7 +487,16 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, templat
}
this.onDrawEnd(g, geotype, commontype, this._shiftKey, this._ctrlKey, this._metaKey);
- }
+ },
+ _deactiveAllDrawBoxes: function() {
+ var widget;
+ array.forEach(Object.keys(instancesObj), lang.hitch(this, function(key) {
+ widget = instancesObj[key];
+ if (widget && widget.drawToolBar && key !== this.id) {
+ widget.deactivate();
+ }
+ }));
+ }
});
});
\ No newline at end of file
diff --git a/app/jimu.js/dijit/DropMenu.js b/app/jimu.js/dijit/DropMenu.js
index 4329500..eaa3ae5 100644
--- a/app/jimu.js/dijit/DropMenu.js
+++ b/app/jimu.js/dijit/DropMenu.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/app/jimu.js/dijit/DropdownMenu.js b/app/jimu.js/dijit/DropdownMenu.js
index 3cbd729..3ba1725 100644
--- a/app/jimu.js/dijit/DropdownMenu.js
+++ b/app/jimu.js/dijit/DropdownMenu.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -36,6 +36,7 @@ function(declare, _WidgetBase, _TemplatedMixin, lang, array, html, on, query, Ev
offsetY: 5,
shelter: null,
paddingOffsetY: 8,
+ dropdownMenuClass: '',
dropdownMenuItemClass: 'dropdown-menu-item',
//options:
@@ -54,7 +55,8 @@ function(declare, _WidgetBase, _TemplatedMixin, lang, array, html, on, query, Ev
this.items = [];
}
this.shelter = html.toDom('');
- this.itemsContainer = html.toDom('');
+ this.itemsContainer = html.toDom('');
if(this.maxDisplayItems <= 0){
this.maxDisplayItems = 20;
}
@@ -74,12 +76,12 @@ function(declare, _WidgetBase, _TemplatedMixin, lang, array, html, on, query, Ev
}
},
- _onIconClick: function(evt){
+ _onIconClick: function(evt, srcElement){
evt.stopPropagation();
if(this.isShowing()){
this.hideMenu();
}else{
- var position = html.position(evt.target || evt.srcElement);
+ var position = html.position(srcElement || evt.target || evt.srcElement);
this.showMenu(position);
}
},
@@ -126,6 +128,20 @@ function(declare, _WidgetBase, _TemplatedMixin, lang, array, html, on, query, Ev
return null;
},
+ getHighlightLabel: function() {
+ var highlightValue = this.getHighlightValue();
+ var highlightLabel = '';
+ array.some(this.items, function(item) {
+ if(item.value === highlightValue) {
+ highlightLabel = item.label;
+ return true;
+ } else {
+ return false;
+ }
+ }, this);
+ return highlightLabel;
+ },
+
isShowing: function(){
return html.hasClass(this.domNode, "showing");
},
diff --git a/app/jimu.js/dijit/EditorBackgroundColor.js b/app/jimu.js/dijit/EditorBackgroundColor.js
index c17a7f5..8c10d0a 100644
--- a/app/jimu.js/dijit/EditorBackgroundColor.js
+++ b/app/jimu.js/dijit/EditorBackgroundColor.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -75,6 +75,8 @@ define([
showTransparent: true,
showColorPalette: true,
showCoustom: true,
+ showColorPickerOK: true,
+ showColorPickerApply: false,//change color will close DropDown, so can't use apply
showCoustomRecord: true
},
recordUID: recordUID,
@@ -87,6 +89,9 @@ define([
},
onExecute: function () {
self.editor.execCommand(self.hackCommand, this.get("value"));
+ },
+ onClose: function(){
+ self.button.closeDropDown();
}
});
callback();
diff --git a/app/jimu.js/dijit/EditorChooseImage.js b/app/jimu.js/dijit/EditorChooseImage.js
new file mode 100644
index 0000000..d68b7b0
--- /dev/null
+++ b/app/jimu.js/dijit/EditorChooseImage.js
@@ -0,0 +1,139 @@
+define([
+ "dojo",
+ "dijit",
+ "dijit/_editor/_Plugin",
+ "jimu/dijit/ImageChooser",
+ "dojo/_base/html",
+ 'dojo/_base/lang',
+ "dojo/sniff",
+ "dojo/i18n",
+ "dojo/_base/connect",
+ "dojo/_base/declare"
+], function(
+ dojo, dijit, _Plugin, ImageChooser, html, lang, has, i18n
+) {
+ dojo.experimental("dojox.editor.plugins.ChooseImage");
+
+ var ChooseImage = dojo.declare("dojox.editor.plugins.ChooseImage", _Plugin, {
+ iconClassPrefix: "editorIcon",
+ useDefaultCommand: false,
+
+ _initButton: function() {
+ this.createFileInput();
+ this.command = "chooseImage";
+
+ var strings = i18n.getLocalization("dijit._editor", "commands");
+ this.button = new dijit.form.Button({
+ label: strings.insertImage,
+ showLabel: false,
+ iconClass: this.iconClassPrefix + " " + this.iconClassPrefix + "UploadImage",
+ tabIndex: "-1",
+ onClick: lang.hitch(this, this._chooseImage)
+ });
+ this.button.set("readOnly", false);
+
+ this.editor.commands[this.command] = "Upload Image";
+ this.inherited("_initButton", arguments);
+ delete this.command;
+ },
+
+ updateState: function() {
+ //change icon ,when "viewsource" dijit clicked
+ var disabled = this.get("disabled");
+ this.button.set("disabled",this.get("disabled"));
+ if (true === disabled) {
+ html.addClass(this.button, 'dijitButtonDisabled');
+ this.imageChooser.disableChooseImage();
+ } else {
+ html.removeClass(this.button, 'dijitButtonDisabled');
+ this.imageChooser.enableChooseImage();
+ }
+ },
+
+ createFileInput: function() {
+ var node = dojo.create('span', {
+ innerHTML: "."
+ }, document.body);
+ this.imageChooser = new ImageChooser({
+ showSelfImg: false,
+ cropImage: false,
+ format: [ImageChooser.GIF, ImageChooser.JPEG, ImageChooser.PNG]
+ }, node);
+
+ this.connect(this.imageChooser, "onImageChange", "insertTempImage");
+ // this.connect(this.button, "onComplete", "onComplete");
+ },
+
+ _chooseImage: function () {
+ var mask = this.imageChooser.mask;
+ if (has('safari')) {
+ // # First create an event
+ var click_ev = document.createEvent("MouseEvents");
+ // # initialize the event
+ click_ev.initEvent("click", true /* bubble */, true /* cancelable */);
+ // # trigger the evevnt/
+ mask.dispatchEvent(click_ev);
+ } else {
+ mask.click();
+ }
+ },
+
+ onComplete: function(data /*,ioArgs,widgetRef*/ ) {
+ data = data[0];
+ // Image is ready to insert
+ var tmpImgNode = dojo.byId(this.currentImageId, this.editor.document);
+ var file;
+ // download path is mainly used so we can access a PHP script
+ // not relative to this file. The server *should* return a qualified path.
+ if (this.downloadPath) {
+ file = this.downloadPath + data.name;
+ } else {
+ file = data.file;
+ }
+
+ tmpImgNode.src = file;
+ dojo.attr(tmpImgNode, '_djrealurl', file);
+
+ if (data.width) {
+ tmpImgNode.width = data.width;
+ tmpImgNode.height = data.height;
+ }
+ },
+
+ insertTempImage: function(fileData) {
+ // summary:
+ // inserting a "busy" image to show something is hapening
+ // during upload and download of the image.
+ this.currentImageId = "img_" + (new Date().getTime());
+ var iTxt = '
';
+ this.editor.execCommand('inserthtml', iTxt);
+ },
+
+ destroy: function () {
+ if (this.imageChooser) {
+ this.imageChooser.destroy();
+ }
+
+ this.inherited(arguments);
+ }
+ });
+
+ dojo.subscribe(dijit._scopeName + ".Editor.getPlugin", null, function(o) {
+ if (o.plugin) {
+ return;
+ }
+ switch (o.args.name) {
+ case "chooseImage":
+ o.plugin = new ChooseImage({
+ url: o.args.url
+ });
+ }
+ });
+
+ /*jshint sub: true */
+ _Plugin.registry["chooseImage"] = function(args){
+ return new ChooseImage(args);
+ };
+
+ return ChooseImage;
+});
\ No newline at end of file
diff --git a/app/jimu.js/dijit/EditorTextColor.js b/app/jimu.js/dijit/EditorTextColor.js
index 30637b1..8a80224 100644
--- a/app/jimu.js/dijit/EditorTextColor.js
+++ b/app/jimu.js/dijit/EditorTextColor.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -78,6 +78,7 @@ define([
showTransparent: false,
showColorPalette: true,
showCoustom: true,
+ showColorPickerApply: false,//change color will close DropDown, so can't use apply
showCoustomRecord: true
},
recordUID: recordUID,
@@ -87,6 +88,9 @@ define([
self.editor.execCommand("styleWithCSS", !forceAttr);
self.editor.execCommand(self.hackCommand, color);
+ },
+ onClose: function(){
+ self.button.closeDropDown();
}/*,
onExecute: function () {
self.editor.execCommand(self.hackCommand, this.get("value"));
diff --git a/app/jimu.js/dijit/ExportChooser.js b/app/jimu.js/dijit/ExportChooser.js
index 3127fd7..67666ed 100644
--- a/app/jimu.js/dijit/ExportChooser.js
+++ b/app/jimu.js/dijit/ExportChooser.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/app/jimu.js/dijit/ExtentChooser.js b/app/jimu.js/dijit/ExtentChooser.js
index 8887777..9ce0a29 100644
--- a/app/jimu.js/dijit/ExtentChooser.js
+++ b/app/jimu.js/dijit/ExtentChooser.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -23,11 +23,12 @@ define(['dojo/_base/declare',
'dojo/Evented',
'esri/geometry/Extent',
'jimu/portalUrlUtils',
+ "esri/dijit/Search",
'jimu/dijit/LoadingShelter',
'jimu/utils'
],
function(declare, lang, html, on, Deferred, _WidgetBase,
- Evented, Extent, portalUrlUtils,
+ Evented, Extent, portalUrlUtils, Search,
LoadingShelter, jimuUtils) {
/* global esriConfig */
@@ -79,6 +80,13 @@ function(declare, lang, html, on, Deferred, _WidgetBase,
height: '100%'
}
}, this.domNode);
+ this.search = html.create('div', {
+ style: {
+ position: "absolute",
+ right: 0,
+ top: 0
+ }
+ }, mapNode);
if(!this.portalUrl || !this.itemId){
return;
@@ -118,6 +126,18 @@ function(declare, lang, html, on, Deferred, _WidgetBase,
this.onExtentChange(evt.extent);
})));
+ var search = new Search({
+ map: this.map,
+ enableLabel: false
+ }, this.search);
+ search.startup();
+ this.own(on(search, 'search-results', lang.hitch(this, function (evt) {
+ if (evt && evt.results && evt.results[0] &&
+ evt.results[0][0] && evt.results[0][0].extent) {
+ this.onExtentChange(evt.results[0][0].extent);
+ }
+ })));
+
if(!this.initExtent){
this.onExtentChange(this.map.extent); // send map default extent
}else {
diff --git a/app/jimu.js/dijit/FeatureActionPopupMenu.js b/app/jimu.js/dijit/FeatureActionPopupMenu.js
index f523675..9b6a4ee 100644
--- a/app/jimu.js/dijit/FeatureActionPopupMenu.js
+++ b/app/jimu.js/dijit/FeatureActionPopupMenu.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -92,6 +92,16 @@ define(['dojo/_base/declare',
this.own(on(menuItem, 'click', lang.hitch(this, this.hide)));
},
+ markAsSelected: function(action) {
+ array.forEach(this.menuItems, function(menuItem) {
+ if (menuItem.action.label === action.label) {
+ menuItem.setSelected(true);
+ } else {
+ menuItem.setSelected(false);
+ }
+ });
+ },
+
prepareActions: function(featureset, allowExport) {
var fm = FeatureActionManager.getInstance();
diff --git a/app/jimu.js/dijit/FeatureActionPopupMenuItem.js b/app/jimu.js/dijit/FeatureActionPopupMenuItem.js
index 15a11cc..aea8158 100644
--- a/app/jimu.js/dijit/FeatureActionPopupMenuItem.js
+++ b/app/jimu.js/dijit/FeatureActionPopupMenuItem.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@ define(['dojo/_base/declare',
return declare([_WidgetBase, _TemplatedMixin, Evented], {
baseClass: 'popup-menu-item',
templateString: '
' +
- '
' +
+ '
' +
'
' +
@@ -49,8 +49,12 @@ define(['dojo/_base/declare',
if (this.action) {
this.labelNode.innerHTML = this.action.label;
+ this.labelNode.title = this.action.label;
if(this.action.iconClass) {
+ if (this.action.iconClass === 'no-icon') {
+ html.addClass(this.iconContainer, 'no-icon');
+ }
html.addClass(this.iconNode, this.action.iconClass);
} else {
html.setStyle(this.iconNode, 'background-image', 'url(' + this.action.getIcon('default') + ')');
@@ -63,6 +67,14 @@ define(['dojo/_base/declare',
this.own(on(this.domNode, 'click', lang.hitch(this, this._clickHandler)));
},
+ setSelected: function(selected) {
+ if (selected) {
+ html.addClass(this.domNode, 'selected');
+ } else {
+ html.removeClass(this.domNode, 'selected');
+ }
+ },
+
_useNormalIcon: function() {
if(this.action.iconClass) {
html.removeClass(this.iconNode, 'highlight');
diff --git a/app/jimu.js/dijit/FeatureSetChooserForMultipleLayers.js b/app/jimu.js/dijit/FeatureSetChooserForMultipleLayers.js
index b4a40e8..bda0a28 100644
--- a/app/jimu.js/dijit/FeatureSetChooserForMultipleLayers.js
+++ b/app/jimu.js/dijit/FeatureSetChooserForMultipleLayers.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -33,13 +33,17 @@ define([
'dijit/TooltipDialog',
'jimu/utils',
'jimu/dijit/DrawBox',
- 'jimu/dijit/_FeatureSetChooserCore'
+ 'jimu/dijit/_FeatureSetChooserCore',
+ 'jimu/SelectionManager',
+ 'jimu/dijit/FeatureActionPopupMenu'
],
function(on, sniff, mouse, query, Evented, html, lang, array, all, declare, _WidgetBase, _TemplatedMixin,
- _WidgetsInTemplateMixin, template, dojoPopup, TooltipDialog, jimuUtils, DrawBox, _FeatureSetChooserCore) {
+ _WidgetsInTemplateMixin, template, dojoPopup, TooltipDialog, jimuUtils, DrawBox, _FeatureSetChooserCore,
+ SelectionManager, PopupMenu) {
return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, Evented], {
baseClass: 'jimu-multiple-layers-featureset-chooser',
+ declaredClass: 'jimu.dijit.FeatureSetChooserForMultipleLayers',
templateString: template,
drawBox: null,
_instances: null,//[{featureLayer,featureSetChooserCore}]
@@ -48,14 +52,15 @@ function(on, sniff, mouse, query, Evented, html, lang, array, all, declare, _Wid
_tooltipDialogTimeoutId2: -1,
_tooltipDialogClientX2: -1,
_tooltipTimeout: 1000,
- _currentGeoTypeInfo: null,//{geoType,dom1,dom2}
- _geoTypeInfos: null,//[{geoType,dom1,dom2}]
+ _currentGeoTypeInfo: null,//{geoType,action,dom}
+ _geoTypeInfos: null,//[{geoType,action,dom}]
//constructor options:
map: null,
updateSelection: false,
fullyWithin: false,
- geoTypes: null,//['EXTENT', 'POLYGON', 'CIRCLE', 'POLYLINE']
+ geoTypes: null,//['POINT', EXTENT', 'POLYGON', 'CIRCLE', 'POLYLINE', 'FREEHAND_POLYGON']
+ actions: null,
//public methods:
//enable
@@ -75,7 +80,7 @@ function(on, sniff, mouse, query, Evented, html, lang, array, all, declare, _Wid
postMixInProperties:function(){
this.inherited(arguments);
this.nls = window.jimuNls.featureSetChooser;
- var validGeoTypes = ['EXTENT', 'POLYGON', 'CIRCLE', 'POLYLINE'];
+ var validGeoTypes = ['POINT', 'EXTENT', 'POLYGON', 'CIRCLE', 'POLYLINE', 'FREEHAND_POLYGON'];
if(this.geoTypes && this.geoTypes.length > 0){
this.geoTypes = array.filter(this.geoTypes, lang.hitch(this, function(geoType){
@@ -92,6 +97,7 @@ function(on, sniff, mouse, query, Evented, html, lang, array, all, declare, _Wid
this.inherited(arguments);
this._instances = [];
+ this.popupMenu = PopupMenu.getInstance();
var selectTextDom = query('.select-text', this.domNode)[0];
selectTextDom.innerHTML = this.nls.select;
@@ -99,16 +105,12 @@ function(on, sniff, mouse, query, Evented, html, lang, array, all, declare, _Wid
var clearTextDom = query('.clear-text', this.domNode)[0];
clearTextDom.innerHTML = window.jimuNls.common.clear;
- query('.draw-item-rectangle .draw-text', this.domNode)[0].innerHTML = this.nls.selectByRectangle;
- query('.draw-item-polygon .draw-text', this.domNode)[0].innerHTML = this.nls.selectByPolygon;
- query('.draw-item-circle .draw-text', this.domNode)[0].innerHTML = this.nls.selectByCircle;
- query('.draw-item-polyline .draw-text', this.domNode)[0].innerHTML = this.nls.selectByLine;
-
this._initTooltipDialogs();
this._initDrawBox();
this._geoTypeInfos = [];
+ this.actions = [];
if(this.geoTypes.length === 0){
this.geoTypes.push("EXTENT");
@@ -120,35 +122,59 @@ function(on, sniff, mouse, query, Evented, html, lang, array, all, declare, _Wid
html.addClass(this.domNode, 'multiple-geotypes');
}
- var validGeoTypes = ['EXTENT', 'POLYGON', 'CIRCLE', 'POLYLINE'];
+ var validGeoTypes = ['POINT', 'EXTENT', 'POLYGON', 'CIRCLE', 'POLYLINE', 'FREEHAND_POLYGON'];
var geoTypeMap = {
- EXTENT: [this.rectangleItem, this.drawBox.extentIcon],
- POLYGON: [this.polygonItem, this.drawBox.polygonIcon],
- CIRCLE: [this.circleItem, this.drawBox.circleIcon],
- POLYLINE: [this.polylineItem, this.drawBox.polylineIcon]
+ POINT: ['icon-select-by-point', this.nls.selectByPoint, this.drawBox.pointIcon],
+ EXTENT: ['icon-select-by-rect', this.nls.selectByRectangle, this.drawBox.extentIcon],
+ POLYGON: ['icon-select-by-polygon', this.nls.selectByPolygon, this.drawBox.polygonIcon],
+ CIRCLE: ['icon-select-by-circle', this.nls.selectByCircle, this.drawBox.circleIcon],
+ POLYLINE: ['icon-select-by-line', this.nls.selectByLine, this.drawBox.polylineIcon],
+ FREEHAND_POLYGON: ['icon-select-by-freehand-polygon',
+ this.nls.selectByFreehandPolygon,
+ this.drawBox.freehandPolygonIcon]
};
+ var extentIndex = -1;
array.forEach(validGeoTypes, lang.hitch(this, function(geoType) {
- var doms = geoTypeMap[geoType];
- var attachpoint = doms[0];
+ var dataItem = geoTypeMap[geoType];
+ //var attachpoint = doms[0];
if (this.geoTypes.indexOf(geoType) >= 0) {
var geoTypeInfo = {
geoType: geoType,
- dom1: doms[0],
- dom2: doms[1]
+ action: {
+ iconClass: dataItem[0],
+ label: dataItem[1],
+ data: {}
+ },
+ dom: dataItem[2]
+ };
+ var action = {
+ iconClass: dataItem[0],
+ label: dataItem[1],
+ data: {},
+ onExecute: lang.hitch(this, this._onDrawItemClicked, geoTypeInfo)
};
this._geoTypeInfos.push(geoTypeInfo);
- this.own(on(attachpoint, 'click', lang.hitch(this, this._onDrawItemClicked, geoTypeInfo)));
- } else {
- html.addClass(attachpoint, 'hidden');
+ this.actions.push(action);
+ if (geoType === 'EXTENT') {
+ extentIndex = this._geoTypeInfos.length - 1;
+ }
}
}));
this.own(on(this.btnSelect, 'click', lang.hitch(this, function() {
- jimuUtils.simulateClickEvent(this._currentGeoTypeInfo.dom2);
+ jimuUtils.simulateClickEvent(this._currentGeoTypeInfo.dom);
this._hideDrawItems();
})));
- this._setCurrentGeoInfo(this._geoTypeInfos[0]);
+ // default value is selecting by extent
+ if (extentIndex >= 0) {
+ this._setCurrentGeoInfo(this._geoTypeInfos[extentIndex]);
+ html.addClass(this.geoTypeIcon, 'icon-select-by-rect');
+ } else {
+ this._setCurrentGeoInfo(this._geoTypeInfos[0]);
+ html.addClass(this.geoTypeIcon, this._geoTypeInfos[0].action.iconClass);
+ }
+
this.deactivate();
},
@@ -205,6 +231,10 @@ function(on, sniff, mouse, query, Evented, html, lang, array, all, declare, _Wid
titleDom.innerHTML = this.nls.selectByCircle;
}else if(geoType === 'POLYLINE'){
titleDom.innerHTML = this.nls.selectByLine;
+ }else if(geoType === 'FREEHAND_POLYGON') {
+ titleDom.innerHTML = this.nls.selectByFreehandPolygon;
+ }else if(geoType === 'POINT') {
+ titleDom.innerHTML = this.nls.selectByPoint;
}
}
dojoPopup.open({
@@ -264,11 +294,8 @@ function(on, sniff, mouse, query, Evented, html, lang, array, all, declare, _Wid
_onArrowClicked: function(event){
event.stopPropagation();
- if(this._isDrawItemsVisible()){
- this._hideDrawItems();
- }else{
- this._showDrawItems();
- }
+ var position = html.position(event.target);
+ this._showDrawItems(position);
},
_setCurrentGeoInfo: function(geoTypeInfo){
@@ -281,29 +308,54 @@ function(on, sniff, mouse, query, Evented, html, lang, array, all, declare, _Wid
if(this.isActive()){
if(oldGeoType !== this._currentGeoTypeInfo.geoType){
- jimuUtils.simulateClickEvent(this._currentGeoTypeInfo.dom2);
+ jimuUtils.simulateClickEvent(this._currentGeoTypeInfo.dom);
}
}else{
- jimuUtils.simulateClickEvent(this._currentGeoTypeInfo.dom2);
+ jimuUtils.simulateClickEvent(this._currentGeoTypeInfo.dom);
}
},
- _isDrawItemsVisible: function(){
- return !html.hasClass(this.drawItems, 'hidden');
- },
-
- _showDrawItems: function(){
- html.removeClass(this.drawItems, 'hidden');
+ _showDrawItems: function(position){
+ this.popupMenu.setActions(this.actions);
+ this.popupMenu.markAsSelected(this._currentGeoTypeInfo.action);
+ this.popupMenu.show(position);
},
_hideDrawItems: function(){
- html.addClass(this.drawItems, 'hidden');
+ this.popupMenu.hide();
},
- _onDrawItemClicked: function(geoTypeInfo, event){
- event.stopPropagation();
+ _onDrawItemClicked: function(geoTypeInfo){
this._hideDrawItems();
this._setCurrentGeoInfo(geoTypeInfo);
+ // 'EXTENT', 'POLYGON', 'CIRCLE', 'POLYLINE'
+ html.removeClass(this.geoTypeIcon, [
+ 'icon-select-by-point',
+ 'icon-select-by-circle',
+ 'icon-select-by-rect',
+ 'icon-select-by-polygon',
+ 'icon-select-by-line',
+ 'icon-select-by-freehand-polygon'
+ ]);
+ switch(geoTypeInfo.geoType) {
+ case 'POLYGON':
+ html.addClass(this.geoTypeIcon, 'icon-select-by-polygon');
+ break;
+ case 'CIRCLE':
+ html.addClass(this.geoTypeIcon, 'icon-select-by-circle');
+ break;
+ case 'POLYLINE':
+ html.addClass(this.geoTypeIcon, 'icon-select-by-line');
+ break;
+ case 'FREEHAND_POLYGON':
+ html.addClass(this.geoTypeIcon, 'icon-select-by-freehand-polygon');
+ break;
+ case 'POINT':
+ html.addClass(this.geoTypeIcon, 'icon-select-by-point');
+ break;
+ default:
+ html.addClass(this.geoTypeIcon, 'icon-select-by-rect');
+ }
},
_initDrawBox: function(){
@@ -320,14 +372,13 @@ function(on, sniff, mouse, query, Evented, html, lang, array, all, declare, _Wid
this.own(on(this.drawBox, 'draw-activate', lang.hitch(this, function(){
this.map.infoWindow.hide();
+ html.addClass(this.currentDrawItem, 'pressed');
html.addClass(this.btnSelect, 'selected');
- query('.draw-item.selected', this.drawItems).removeClass('selected');
- html.addClass(this._currentGeoTypeInfo.dom1, 'selected');
})));
this.own(on(this.drawBox, 'draw-deactivate', lang.hitch(this, function(){
+ html.removeClass(this.currentDrawItem, 'pressed');
html.removeClass(this.btnSelect, 'selected');
- query('.draw-item.selected', this.drawItems).removeClass('selected');
})));
this.own(on(this.btnClear, 'click', lang.hitch(this, function(){
@@ -412,6 +463,18 @@ function(on, sniff, mouse, query, Evented, html, lang, array, all, declare, _Wid
}
},
+ setDisplayLayerVisibility: function(featureLayer, visible) {
+ var selectionManager = SelectionManager.getInstance();
+ var displayLayer = selectionManager.getDisplayLayer(featureLayer.id);
+ if (displayLayer) {
+ if (visible) {
+ displayLayer.show();
+ } else {
+ displayLayer.hide();
+ }
+ }
+ },
+
_removeInstance: function(instance){
if(instance){
var index = this._instances.indexOf(instance);
@@ -479,7 +542,7 @@ function(on, sniff, mouse, query, Evented, html, lang, array, all, declare, _Wid
all(defs).always(lang.hitch(this, function() {
this.enable();
if(this._currentGeoTypeInfo){
- jimuUtils.simulateClickEvent(this._currentGeoTypeInfo.dom2);
+ jimuUtils.simulateClickEvent(this._currentGeoTypeInfo.dom);
}
this.emit('unloading');
}));
diff --git a/app/jimu.js/dijit/FeatureSetChooserForSingleLayer.js b/app/jimu.js/dijit/FeatureSetChooserForSingleLayer.js
index 9f81788..5d6c44e 100644
--- a/app/jimu.js/dijit/FeatureSetChooserForSingleLayer.js
+++ b/app/jimu.js/dijit/FeatureSetChooserForSingleLayer.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/app/jimu.js/dijit/FeaturelayerChooserFromMap.js b/app/jimu.js/dijit/FeaturelayerChooserFromMap.js
index 79e737d..463a9cb 100644
--- a/app/jimu.js/dijit/FeaturelayerChooserFromMap.js
+++ b/app/jimu.js/dijit/FeaturelayerChooserFromMap.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -32,6 +32,8 @@ function(declare, Deferred, html, lang, LayerChooserFromMap) {
showTable: false,//if true, types will be ignored for table layer
onlyShowVisible: false,//if the layer is a Table, this option is ignored
ignoredFeaturelayerIds: null,//an array of ignored feature layer ids
+ mustSupportStatistics: false,
+ ignoreVirtualLayer: false,
//public methods:
//getSelectedItems return [{name, url, layerInfo}]
@@ -48,7 +50,14 @@ function(declare, Deferred, html, lang, LayerChooserFromMap) {
this.basicFilter = lang.hitch(this, this.basicFilter);
this.filter = LayerChooserFromMap.createFeaturelayerFilter(this.types,
this.showLayerFromFeatureSet,
- this.showTable);
+ this.showTable,
+ this.mustSupportStatistics);
+
+ if(this.ignoreVirtualLayer){
+ this.filter = LayerChooserFromMap.andCombineFilters(
+ [this.filter, lang.hitch(this, this._ignoreVirtualLayerFilter)]
+ );
+ }
},
postCreate: function(){
@@ -56,6 +65,14 @@ function(declare, Deferred, html, lang, LayerChooserFromMap) {
html.addClass(this.domNode, 'jimu-basic-layer-chooser-from-map');
},
+ _ignoreVirtualLayerFilter: function(layerInfo){
+ return layerInfo.getLayerType().then(function(layerType) {
+ var virtualLayer = layerType === 'ArcGISDynamicMapServiceLayer' ||
+ layerType === 'ArcGISTiledMapServiceLayer' || layerType === 'GroupLayer';
+ return !virtualLayer;
+ });
+ },
+
//override basicFilter method of LayerChooserFromMap
basicFilter: function(layerInfo) {
var def = new Deferred();
diff --git a/app/jimu.js/dijit/FeaturelayerChooserFromPortal.js b/app/jimu.js/dijit/FeaturelayerChooserFromPortal.js
index d386e44..90a1222 100644
--- a/app/jimu.js/dijit/FeaturelayerChooserFromPortal.js
+++ b/app/jimu.js/dijit/FeaturelayerChooserFromPortal.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/app/jimu.js/dijit/FeaturelayerServiceBrowser.js b/app/jimu.js/dijit/FeaturelayerServiceBrowser.js
index d41995d..bcf1b5f 100644
--- a/app/jimu.js/dijit/FeaturelayerServiceBrowser.js
+++ b/app/jimu.js/dijit/FeaturelayerServiceBrowser.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/app/jimu.js/dijit/FeaturelayerServiceChooser.js b/app/jimu.js/dijit/FeaturelayerServiceChooser.js
index b65ba6f..3544b02 100644
--- a/app/jimu.js/dijit/FeaturelayerServiceChooser.js
+++ b/app/jimu.js/dijit/FeaturelayerServiceChooser.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/app/jimu.js/dijit/FeaturelayerSource.js b/app/jimu.js/dijit/FeaturelayerSource.js
index eb256dd..3df8af9 100644
--- a/app/jimu.js/dijit/FeaturelayerSource.js
+++ b/app/jimu.js/dijit/FeaturelayerSource.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -24,86 +24,15 @@ define([
'dojo/_base/html',
'dojo/on',
'dojo/Evented',
- 'jimu/dijit/FeaturelayerChooserFromMap',
+ 'jimu/dijit/RadioBtn',
+ 'jimu/dijit/_FeaturelayerChooserWithButtons',
'jimu/dijit/FeaturelayerChooserFromPortal',
'jimu/dijit/_FeaturelayerServiceChooserContent',
'jimu/portalUrlUtils'
],
-function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
- template, lang, html, on, Evented, FeaturelayerChooserFromMap,
- FeaturelayerChooserFromPortal, _FeaturelayerServiceChooserContent, portalUrlUtils) {
- //define private dijit FeaturelayerChooserWithButtons
- var baseClassArr = [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, Evented];
- var FeaturelayerChooserWithButtons = declare(baseClassArr, {
- baseClass: 'jimu-layer-chooser-with-buttons jimu-featurelayer-chooser-with-buttons',
- declaredClass: 'jimu.dijit.FeaturelayerChooserWithButtons',
- templateString: '
',
-
- featureLayerChooserArgs: null,
-
- //events:
- //ok
- //cancel
-
- //public methods:
- //getSelectedItems
-
- postMixInProperties: function(){
- this.nls = lang.clone(window.jimuNls.common);
- },
-
- postCreate: function(){
- this.inherited(arguments);
-
- this.flcMap = new FeaturelayerChooserFromMap(this.featureLayerChooserArgs);
- this.flcMap.placeAt(this.flcDiv);
- html.setStyle(this.flcMap.domNode, {
- width: '100%',
- height: '100%'
- });
-
- this.own(on(this.flcMap, 'tree-click', lang.hitch(this, function(){
- var items = this.getSelectedItems();
- if(items.length > 0){
- html.removeClass(this.btnOk, 'jimu-state-disabled');
- }
- else{
- html.addClass(this.btnOk, 'jimu-state-disabled');
- }
- })));
-
- this.own(on(this.btnOk, 'click', lang.hitch(this, function(){
- var items = this.getSelectedItems();
- if(items.length > 0){
- this.emit('ok', items);
- }
- })));
-
- this.own(on(this.btnCancel, 'click', lang.hitch(this, function(){
- this.emit('cancel');
- })));
- },
-
- getSelectedItems: function(){
- return this.flcMap.getSelectedItems();
- },
-
- startup: function(){
- this.inherited(arguments);
- this.flcMap.startup();
- }
- });
+function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, template, lang, html, on, Evented,
+ RadioBtn, FeaturelayerChooserWithButtons, FeaturelayerChooserFromPortal, _FeaturelayerServiceChooserContent,
+ portalUrlUtils) {
return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, Evented], {
templateString: template,
@@ -120,6 +49,7 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
//FeaturelayerChooserFromPortal options
portalUrl: null,
+ layerChooserFromMap: null, // optional, default value is 'jimu/dijit/FeaturelayerChooserFromMap'
//public methods:
//getSelectedItems
//getSelectedRadioType
@@ -190,10 +120,10 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
width: '100%',
height: '100%'
},
- featureLayerChooserArgs:{
- multiple: this.multiple,
- createMapResponse: this.createMapResponse
- }
+ multiple: this.multiple,
+ createMapResponse: this.createMapResponse,
+ onlyShowWebMapLayers: true,
+ layerChooserFromMap: this.layerChooserFromMap
};
this.flcMap = new FeaturelayerChooserWithButtons(args1);
this.flcMap.operationTip = this.nls.selectLayer;
@@ -276,18 +206,41 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
},
_initRadios: function(){
- var name = "featureLayerSourceRadios_" + this._getRandomString();
- this.mapRadio.name = name;
- html.setAttr(this.mapRadio, 'id', "mapRadio_" + this._getRandomString());
- html.setAttr(this.mapLabel, 'for', this.mapRadio.id);
-
- this.portalRadio.name = name;
- html.setAttr(this.portalRadio, 'id', "portalRadio_" + this._getRandomString());
- html.setAttr(this.portalLabel, 'for', this.portalRadio.id);
-
- this.urlRadio.name = name;
- html.setAttr(this.urlRadio, 'id', "urlRadio_" + this._getRandomString());
- html.setAttr(this.urlLabel, 'for', this.urlRadio.id);
+ var group = "featureLayerSourceRadios_" + this._getRandomString();
+ var radioChangeHandler = lang.hitch(this, this._onRadioClicked);
+
+ this.mapRadio = new RadioBtn({
+ group: group,
+ onStateChange: radioChangeHandler,
+ checked: true
+ });
+ this.mapRadio.placeAt(this.mapTd, 'first');
+
+ this.portalRadio = new RadioBtn({
+ group: group,
+ onStateChange: radioChangeHandler,
+ checked: false
+ });
+ this.portalRadio.placeAt(this.portalTd, 'first');
+
+ this.urlRadio = new RadioBtn({
+ group: group,
+ onStateChange: radioChangeHandler,
+ checked: false
+ });
+ this.urlRadio.placeAt(this.urlTd, 'first');
+
+ this.own(on(this.mapLabel, 'click', lang.hitch(this, function(){
+ this.mapRadio.check();
+ })));
+
+ this.own(on(this.portalLabel, 'click', lang.hitch(this, function(){
+ this.portalRadio.check();
+ })));
+
+ this.own(on(this.urlLabel, 'click', lang.hitch(this, function(){
+ this.urlRadio.check();
+ })));
},
_getRandomString: function(){
@@ -330,4 +283,4 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
}
});
-});
\ No newline at end of file
+});
diff --git a/app/jimu.js/dijit/FieldStatistics.js b/app/jimu.js/dijit/FieldStatistics.js
index c56f602..53d3cba 100644
--- a/app/jimu.js/dijit/FieldStatistics.js
+++ b/app/jimu.js/dijit/FieldStatistics.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -106,15 +106,23 @@ define(['dojo/_base/declare',
}));
},
- _getFieldAliaseFromStatInfo: function(fieldName){
- if(this.statInfo.layer){
- var flabels = array.filter(this.statInfo.layer.fields, function(f) {
- return f.name === fieldName;
- });
- return flabels[0]? flabels[0].alias: '';
- }else{
- return this.statInfo.featureSet.fieldAliases? this.statInfo.featureSet.fieldAliases[fieldName]: fieldName;
+ _getFieldAliaseFromStatInfo: function(fieldName) {
+ var featureSet = this.statInfo.featureSet;
+ var fieldAliases = featureSet && featureSet.fieldAliases;
+ var alias;
+ if (fieldAliases && typeof fieldAliases[fieldName] !== 'undefined') {
+ alias = fieldAliases[fieldName];
+ } else {
+ if (this.statInfo.layer) {
+ var flabels = array.filter(this.statInfo.layer.fields, function(f) {
+ return f.name === fieldName;
+ });
+ alias = flabels[0] ? flabels[0].alias : '';
+ } else {
+ alias = fieldName;
+ }
}
+ return alias;
},
_createFieldDom: function(container){
diff --git a/app/jimu.js/dijit/Filter.js b/app/jimu.js/dijit/Filter.js
index 779aa4b..1c30187 100644
--- a/app/jimu.js/dijit/Filter.js
+++ b/app/jimu.js/dijit/Filter.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
///////////////////////////////////////////////////////////////////////////
define([
+ 'dojo/on',
'dojo/Evented',
'dojo/_base/declare',
'dijit/_WidgetBase',
@@ -23,22 +24,22 @@ define([
'dojo/text!./templates/Filter.html',
'jimu/filterUtils',
'jimu/utils',
+ 'jimu/LayerInfos/LayerInfos',
'jimu/dijit/_filter/ValueProviderFactory',
'dijit/registry',
'dojo/_base/lang',
'dojo/_base/html',
'dojo/_base/array',
'dojo/aspect',
- 'dojo/query',
'dojo/Deferred',
'esri/request',
'./_SingleFilter',
'./_FilterSet',
'./LoadingIndicator'
],
-function(Evented, declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
- template, filterUtils, jimuUtils, ValueProviderFactory, registry, lang, html, array, aspect,
- query, Deferred, esriRequest, SingleFilter, FilterSet) {
+function(on, Evented, declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, template, filterUtils,
+ jimuUtils, LayerInfos, ValueProviderFactory, registry, lang, html, array, aspect, Deferred, esriRequest,
+ SingleFilter, FilterSet) {
return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, filterUtils, Evented], {
templateString: template,
@@ -46,6 +47,8 @@ function(Evented, declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin
declaredClass: 'jimu.dijit.Filter',
nls: null,
+ autoSwitchMode: true,
+
//test urls:
//http://discomap.eea.europa.eu/arcgis/rest/services/
//NoiseWatch/NoiseWatch_Overview_WM/MapServer/3
@@ -64,19 +67,28 @@ function(Evented, declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin
_validOptions: false,
_layerDefinition: null,
+ _popupFieldsInfo:[],
_def: null,
valueProviderFactory: null,
+ featureLayerId: null,
+ layerInfosObj: null,
+ mode: 'desktop',//desktop,mobile
//options:
- noFilterTip: '',
- enableAskForValues: false,
+ noFilterTip: '',//optional
+ enableAskForValues: false,//optional
+ mobileBreakWidth: 600,
+ runtime: false, //optional
//public methods:
+ //build: partsObj or expr -> UI
//buildByExpr: expr->UI
//buildByFilterObj: partsObj->UI
//toJson: UI->partsObj
//getFilterObjByExpr(inherited): expr->partsObj
//getExprByFilterObj(inherited): partsObj->expr
+ //autoUpdateMode: update UI mode automatically
+ //setMode: set fixed UI mode
//attributes:
//url: null, //required
@@ -86,32 +98,95 @@ function(Evented, declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin
//css classes:
//jimu-single-filter
//jimu-filter-set
- //odd-filter
- //even-filter
//no-filter-tip
+ //events:
+ //change
+
postMixInProperties:function(){
this.nls = window.jimuNls.filterBuilder;
- var a = "${any_or_all}";
- var splits = this.nls.matchMsg.split(a);
- this.nls.strMatchMsgPart1 = splits[0] || '';
- this.nls.strMatchMsgPart2 = splits[1] || '';
+ this.nls.add = window.jimuNls.common.add;
+ this.nls.apply = window.jimuNls.common.apply;
+ this.layerInfosObj = LayerInfos.getInstanceSync();
this.inherited(arguments);
},
postCreate: function(){
this.inherited(arguments);
+ this._setDesktopMode();
if(this.noFilterTip && typeof this.noFilterTip === 'string'){
this.noFilterTipSection.innerHTML = this.noFilterTip;
}
},
+ startup: function(){
+ this.inherited(arguments);
+ this.autoUpdateMode();
+ },
+
+ resize: function(){
+ this.autoUpdateMode();
+ },
+
+ //Update mode automatically. Should call this method when widget resize if Filter hosted in widget
+ autoUpdateMode: function(){
+ if(!this.autoSwitchMode){
+ return;
+ }
+ this._clearMode();
+ var w = this.domNode.clientWidth;
+ if(w >= this.mobileBreakWidth){
+ this._setDesktopMode();
+ }else{
+ this._setMobileMode();
+ }
+ },
+
+ setMode: function(mode){
+ if(mode === 'desktop'){
+ this._setDesktopMode();
+ }else if(mode === 'mobile'){
+ this._setMobileMode();
+ }
+ },
+
+ _setMode: function(mode){
+ this.mode = mode;
+ this._setModeClass(this.mode);
+ },
+
+ _setModeClass: function(mode){
+ html.removeClass(this.domNode, 'desktop-mode');
+ html.removeClass(this.domNode, 'mobile-mode');
+ html.addClass(this.desktopAddSection, 'hidden');
+ html.addClass(this.mobileAddSection, 'hidden');
+ if(mode){
+ html.addClass(this.domNode, mode + '-mode');
+ }
+ },
+
+ _clearMode: function(){
+ this._setModeClass("");
+ },
+
+ _setDesktopMode: function(){
+ this._setMode('desktop');
+ html.removeClass(this.desktopAddSection, 'hidden');
+ },
+
+ _setMobileMode: function(){
+ this._setMode('mobile');
+ html.removeClass(this.mobileAddSection, 'hidden');
+ },
+
reset: function(){
if(!this.isBuilding()){
this.removeAllFilters();
this.url = null;
this.isHosted = false;
this._layerDefinition = null;
+ this._popupFieldsInfo = [];
+ this.featureLayerId = null;
this.expr = null;
this.partsObj = null;
this.valueProviderFactory = null;
@@ -122,7 +197,15 @@ function(Evented, declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin
return this._def && !this._def.isFulfilled();
},
- buildByExpr: function(url, expr, /*optional*/ layerDefinition){
+ /*
+ options.url: required,
+ options.partsObj: {logicalOperator,parts,expr}
+ options.expr: sql expression
+ options.partsObj or options.expr is required. options.partsObj has priority.
+ options.layerDefinition: optional
+ options.featureLayerId: optional
+ */
+ build: function(options){
var def = new Deferred();
if(this.isBuilding()){
@@ -130,35 +213,47 @@ function(Evented, declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin
} else{
this._def = null;
this.reset();
- this.url = url;
+ this.url = options.url;
this.isHosted = jimuUtils.isHostedService(this.url);
- this.expr = expr || '1=1';
- this._layerDefinition = layerDefinition;
- this._def = this._init("expr");
+ this._layerDefinition = options.layerDefinition;
+ this.featureLayerId = options.featureLayerId;
+
+ if(options.partsObj){
+ this.partsObj = this._updatePartsObj(options.partsObj);
+ this._def = this._init("partsObj");
+ }else{
+ this.expr = options.expr || '1=1';
+ this._def = this._init("expr");
+ }
def = this._def;
}
return def;
},
+ buildByExpr: function(url, expr, /*optional*/ layerDefinition){
+ console.warn('Filter#buildByExpr() method is deprecated, please use Filter#build() instead.');
+ var options = {
+ url: url,
+ expr: expr,
+ layerDefinition: layerDefinition,
+ featureLayerId: this.featureLayerId
+ };
+
+ return this.build(options);
+ },
+
//partsObj:{logicalOperator,parts,expr}
buildByFilterObj: function(url, partsObj, /*optional*/ layerDefinition){
- var def = new Deferred();
-
- if(this.isBuilding()){
- def.reject('Filter is already building.');
- } else{
- this._def = null;
- this.reset();
- this.url = url;
- this.isHosted = jimuUtils.isHostedService(this.url);
- this.partsObj = this._updatePartsObj(partsObj);
- this._layerDefinition = layerDefinition;
- this._def = this._init("partsObj");
- def = this._def;
- }
+ console.warn('Filter#buildByFilterObj() method is deprecated, please use Filter#build() instead.');
+ var options = {
+ url: url,
+ partsObj: partsObj,
+ layerDefinition: layerDefinition,
+ featureLayerId: this.featureLayerId
+ };
- return def;
+ return this.build(options);
},
_updatePartsObj: function(partsObj) {
@@ -233,18 +328,34 @@ function(Evented, declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin
var resolveDef = lang.hitch(this, function(){
setTimeout(lang.hitch(this, function() {
+ this.emit('change');
def.resolve();
}), 1500);
});
var callback = lang.hitch(this, function() {
- html.setStyle(this.contentSection, 'display', 'block');
- html.setStyle(this.errorSection, 'display', 'none');
+ html.addClass(this.errorSection, 'hidden');
this.removeAllFilters();
+
+ var _popup;
+ if(this.featureLayerId){
+ this._tryOverrideFieldAliases(this.featureLayerId, this._layerDefinition);
+ var _layerInfo = this.layerInfosObj.getLayerOrTableInfoById(this.featureLayerId);
+ _popup = _layerInfo.getPopupInfo();
+ }
var fields = this._layerDefinition.fields;
if (!(fields && fields.length > 0)) {
+ if(_popup){
+ this._popupFieldsInfo = _popup.fieldInfos;
+ }
def.reject();
return;
+ }else{
+ if(_popup){//complete popupFields with layerFields
+ this._popupFieldsInfo = jimuUtils.completePopupFieldFromLayerField(fields, _popup.fieldInfos);
+ }else{ //use default setting if no popupInfo
+ this._popupFieldsInfo = fields;
+ }
}
fields = array.filter(fields, lang.hitch(this, function(fieldInfo) {
@@ -257,14 +368,17 @@ function(Evented, declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin
return;
}
this._validOptions = true;
- html.removeClass(this.btnAddSet, 'jimu-state-disabled');
- html.removeClass(this.btnAddExp, 'jimu-state-disabled');
- html.removeClass(this.iconAddExp, 'jimu-state-disabled');
- html.removeClass(this.iconAddSet, 'jimu-state-disabled');
+
+ html.removeClass(this.btnAddSetDesktop, 'jimu-state-disabled');
+ html.removeClass(this.btnAddExpDesktop, 'jimu-state-disabled');
+ html.removeClass(this.btnAddSetMobile, 'jimu-state-disabled');
+ html.removeClass(this.btnAddExpMobile, 'jimu-state-disabled');
+
this.createFieldsStore();
this.valueProviderFactory = new ValueProviderFactory({
url: this.url,
- layerDefinition: this._layerDefinition
+ layerDefinition: this._layerDefinition,
+ featureLayerId: this.featureLayerId
});
if (mode === 'expr') {
@@ -336,6 +450,33 @@ function(Evented, declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin
return def;
},
+ _tryOverrideFieldAliases: function(layerId, layerDefinition){
+ var layerInfo = this.layerInfosObj.getLayerOrTableInfoById(layerId);
+ if(layerInfo){
+ var popupInfo = layerInfo.getPopupInfo();
+ if(popupInfo){
+ var popupFieldInfos = popupInfo.fieldInfos;//[{fieldName,label,tooltip,visible,format,stringFieldOption}]
+ var serviceFieldInfos = layerDefinition.fields;//[{name,alias}]
+ //replace serviceFieldInfo's alias with popupFieldInfo's label
+ if(popupFieldInfos && popupFieldInfos.length > 0 && serviceFieldInfos && serviceFieldInfos.length > 0){
+ var popupFieldInfosObj = {};
+ array.forEach(popupFieldInfos, lang.hitch(this, function(popupFieldInfo){
+ if(popupFieldInfo.fieldName){
+ popupFieldInfosObj[popupFieldInfo.fieldName] = popupFieldInfo;
+ }
+ }));
+ array.forEach(serviceFieldInfos, lang.hitch(this, function(serviceFieldInfo){
+ var popupFieldInfo = popupFieldInfosObj[serviceFieldInfo.name];
+ if(popupFieldInfo && popupFieldInfo.label){
+ serviceFieldInfo.alias = popupFieldInfo.label;
+ }
+ }));
+ }
+ }
+ }
+ },
+
+
/**************************************************/
/**** stringify ****/
/**************************************************/
@@ -374,8 +515,10 @@ function(Evented, declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin
return;
}
- var copyLayerInfo = lang.clone(this._layerDefinition);
- var layerInfoFields = copyLayerInfo.fields;
+ // var copyLayerInfo = lang.clone(this._layerDefinition);
+ // var layerInfoFields = copyLayerInfo.fields;
+ var layerInfoFields = lang.clone(this._layerDefinition.fields);
+
// layerInfoFields = layerInfoFields.sort(function(a, b){
// a.label = a.alias || a.name;
// b.label = b.alias || b.name;
@@ -444,7 +587,6 @@ function(Evented, declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin
return;
}
this._destroyAllFilters();
- this.allAnySelect.value = partsObj.logicalOperator;
array.forEach(partsObj.parts, lang.hitch(this, function(item){
if(item.parts){
//FilterSet
@@ -454,6 +596,9 @@ function(Evented, declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin
this._addSingleFilter(item);
}
}));
+ //reset all/any operator from config
+ this.allAnySelect.value = partsObj.logicalOperator;
+ this._setFilterMsgUI(partsObj.parts.length);
},
/**************************************************/
@@ -464,6 +609,7 @@ function(Evented, declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin
var args = {
url: this.url,
layerInfo: this._layerDefinition,
+ popupFieldsInfo: this._popupFieldsInfo,
stringFieldType: this._stringFieldType,
dateFieldType: this._dateFieldType,
numberFieldTypes: this._numberFieldTypes,
@@ -471,19 +617,28 @@ function(Evented, declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin
OPERATORS: lang.mixin({}, this.OPERATORS),
enableAskForValues: this.enableAskForValues,
isHosted: this.isHosted,
- valueProviderFactory: this.valueProviderFactory
+ valueProviderFactory: this.valueProviderFactory,
+ runtime: this.runtime
};
var singleFilter = new SingleFilter(args);
singleFilter.placeAt(this.allExpsBox);
singleFilter.startup();
- this.own(aspect.after(singleFilter, '_destroySelf', lang.hitch(this, this._checkFilterNumbers)));
+ this.own(aspect.after(singleFilter, '_destroySelf', lang.hitch(this, function(){
+ this._checkFilterNumbers();
+ this.emit('change');
+ })));
+ this.own(on(singleFilter, 'change', lang.hitch(this, function(){
+ this.emit('change');
+ })));
this._checkFilterNumbers();
+ return singleFilter;
},
_addFilterSet:function(/*optional*/ partsObj){
var args = {
url: this.url,
layerInfo: this._layerDefinition,
+ popupFieldsInfo: this._popupFieldsInfo,
stringFieldType: this._stringFieldType,
dateFieldType: this._dateFieldType,
numberFieldTypes: this._numberFieldTypes,
@@ -491,13 +646,21 @@ function(Evented, declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin
OPERATORS: lang.mixin({}, this.OPERATORS),
enableAskForValues: this.enableAskForValues,
isHosted: this.isHosted,
- valueProviderFactory: this.valueProviderFactory
+ valueProviderFactory: this.valueProviderFactory,
+ runtime: this.runtime
};
var filterSet = new FilterSet(args);
filterSet.placeAt(this.allExpsBox);
filterSet.startup();
- this.own(aspect.after(filterSet, '_destroySelf', lang.hitch(this, this._checkFilterNumbers)));
+ this.own(aspect.after(filterSet, '_destroySelf', lang.hitch(this, function(){
+ this._checkFilterNumbers();
+ this.emit('change');
+ })));
+ this.own(on(filterSet, 'change', lang.hitch(this, function(){
+ this.emit('change');
+ })));
this._checkFilterNumbers();
+ return filterSet;
},
_destroyAllFilters:function(){
@@ -511,7 +674,15 @@ function(Evented, declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin
},
_getAllSingleFiltersAndFilterSetsDoms: function(){
- return query('.allExpsBox>.jimu-single-filter,.allExpsBox>.jimu-filter-set', this.contentSection);
+ var doms = [];
+ if(this.allExpsBox.childNodes && this.allExpsBox.childNodes.length > 0){
+ array.forEach(this.allExpsBox.childNodes, lang.hitch(this, function(childNode){
+ if(html.hasClass(childNode, 'jimu-single-filter') || html.hasClass(childNode, 'jimu-filter-set')){
+ doms.push(childNode);
+ }
+ }));
+ }
+ return doms;
},
_getAllSingleFiltersAndFilterSets:function(){
@@ -522,43 +693,47 @@ function(Evented, declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin
return filters;
},
- _checkFilterNumbers:function(){
- var filterDoms = this._getAllSingleFiltersAndFilterSetsDoms();
- if(filterDoms.length > 1){
- html.setStyle(this.matchMsg, 'display', 'block');
- } else{
- html.setStyle(this.matchMsg, 'display', 'none');
+ _setFilterMsgUI: function(filterLength){
+ if(filterLength < 2){
+ //this default value need to set before config's value
+ this.allAnySelect.value = 'AND';
+ html.setStyle(this.allAnySelect, 'display', 'none');
+ html.setStyle(this.oneOrZeroMsg, 'display', 'block');
+ }else{
+ html.setStyle(this.oneOrZeroMsg, 'display', 'none');
+ html.setStyle(this.allAnySelect, 'display', 'block');
}
+ },
+ _checkFilterNumbers:function(){
+ var filterDoms = this._getAllSingleFiltersAndFilterSetsDoms();
+ this._setFilterMsgUI(filterDoms.length);
if(filterDoms.length > 0){
- html.setStyle(this.noFilterTipSection, 'display', 'none');
+ html.addClass(this.noFilterTipSection, 'hidden');
} else{
- html.setStyle(this.noFilterTipSection, 'display', 'block');
+ html.removeClass(this.noFilterTipSection, 'hidden');
}
- array.forEach(filterDoms, lang.hitch(this, function(filterDom, index){
- html.removeClass(filterDom, 'even-filter');
- html.removeClass(filterDom, 'odd-filter');
- var cName = (index + 1) % 2 === 0 ? "even-filter" : "odd-filter";
- html.addClass(filterDom, cName);
- }));
-
this.emit("filter-number-change");
},
_showErrorOptions:function(strError){
console.error(strError);
- // html.setStyle(this.contentSection, 'display', 'none');
- html.setStyle(this.errorSection, 'display', 'none');//block
+ html.addClass(this.errorSection, 'hidden');
this.errorTip.innerHTML = strError;
this.loading.hide();
},
+ _onBtnApplyClicked: function(){
+ this.emit('apply');
+ },
+
_onBtnAddSetClick:function(){
if(!this._layerDefinition || !this._validOptions){
return;
}
this._addFilterSet();
+ this.emit('change');
},
_onBtnAddExpClick:function(){
@@ -566,6 +741,7 @@ function(Evented, declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin
return;
}
this._addSingleFilter();
+ this.emit('change');
}
});
});
\ No newline at end of file
diff --git a/app/jimu.js/dijit/FilterParameters.js b/app/jimu.js/dijit/FilterParameters.js
index 8b328c6..454da21 100644
--- a/app/jimu.js/dijit/FilterParameters.js
+++ b/app/jimu.js/dijit/FilterParameters.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -51,10 +51,11 @@ define([
layerInfo: null,
OPERATORS: null,
url: null,
- featureLayerId: null,//optional
+ featureLayerId: null,
//events:
//change
+ //enter
postMixInProperties:function(){
this.nls = window.jimuNls.filterBuilder;
@@ -70,9 +71,20 @@ define([
},
//the default value of showErrorTip is true
- getFilterExpr: function(){
+ /*
+ return execution expr by default
+ options.ifDisplaySQL: true/false, if true,return the friendly sql to end user
+ options.custom: you can customize your params
+ */
+ getFilterExpr: function(options){
var newPartsObj = this._getNewValidPartsObj(this.partsObj, true);
var expr = newPartsObj ? this._getFilterExprByPartsObj(newPartsObj) : null;
+ if(options && options.ifDisplaySQL){
+ if(newPartsObj.displaySQL === undefined){ //origin widget config don't has ifDisplaySQL
+ return expr;
+ }
+ return newPartsObj.displaySQL;
+ }
return expr;
},
@@ -102,8 +114,34 @@ define([
var validateSinglePart = lang.hitch(this, function(singlePart){
if(singlePart.spId){
var sp = this._getSingleFilterParameterBySpId(singlePart.spId);
- singlePart.valueObj = sp.getValueObject();
- return sp.getStatus();
+ // singlePart.valueObj = sp.getValueObject();
+ // return sp.getStatus();
+
+ var valObj = sp.getValueObject();
+ singlePart.valueObj = valObj;
+ if(valObj && (valObj.type === 'uniquePredefined' || valObj.type === 'multiplePredefined')){ //for valueList [{},{}]
+ var newValObj = [];
+ for(var key in valObj.value){
+ if(valObj.value[key].isChecked){
+ newValObj.push(valObj.value[key]);
+ }
+ }
+ if(newValObj.length > 0){
+ singlePart.valueObj.value = newValObj;
+ return 1;
+ }else{
+ singlePart.valueObj.value = '';
+ return -1;
+ }
+ }else if(valObj && valObj.type === 'multipleDynamic'){//for valueList [1,2]
+ return valObj.value.length > 0 ? 1: -1;
+ }else if(valObj && valObj.type === 'unique'){//for value
+ // return !valObj.value ? -1: 1; //it could be number 0.
+ return (valObj.value === null || valObj.value === undefined || valObj.value === '') ? -1 : 1;
+ }
+ else{//for common value type
+ return sp.getStatus();
+ }
}else{
return singlePart.valueObj ? 1 : -1;
}
@@ -141,16 +179,23 @@ define([
for(var i = 0; i < _partsObj.parts.length; i++){
var p = _partsObj.parts[i];
if (p.parts) {
- if(tryPushParts(p) < 0 && returnNullIfInvalidPart){
+ if(tryPushParts(p) < 0 && returnNullIfInvalidPart){ //?????
return null;
}
} else {
if(tryPushSinglePart(p) < 0 && returnNullIfInvalidPart){
- return null;
+ if(p.valueObj && p.valueObj.type !== 'uniquePredefined' && p.valueObj.type !== 'multiplePredefined' &&
+ p.valueObj.type !== 'unique'){
+ return null;
+ }
}
}
}
+ //for predefined (needs a object structure to enable toggleFilter)
+ // if(newPartsObj.parts.length === 0){
+ // return null;
+ // }
return newPartsObj;
},
@@ -164,10 +209,7 @@ define([
return this._spObj[id];
},
- _getCascadeFilterExpr: function(desPart){
- /*jshint loopfunc: true */
- var expr = "1=1";
- //get cascadePartsObj
+ _getCascadeFilterPartsObj: function(desPart){
var cascadePartsObj = {
logicalOperator: this.partsObj.logicalOperator,
parts: []
@@ -213,17 +255,21 @@ define([
}
}
}
-
cascadePartsObj = this._getNewValidPartsObj(cascadePartsObj, false);
+ return cascadePartsObj;
+ },
+ _getCascadeFilterExpr: function(desPart){
+ /*jshint loopfunc: true */
+ var expr = "1=1";
+ //get cascadePartsObj
+ var cascadePartsObj = this._getCascadeFilterPartsObj(desPart);
if(cascadePartsObj){
expr = this._getFilterExprByPartsObj(cascadePartsObj);
}
-
if(!expr){
expr = "1=1";
}
-
return expr;
},
@@ -243,7 +289,7 @@ define([
//return a deferred object
//if resolved, means it build successfully
//if rejected, means it fail to build
- build: function(url, layerDefinition, partsObj, /*optional*/ featureLayerId){
+ build: function(url, layerDefinition, partsObj, featureLayerId){
var resultDef = new Deferred();
this.clear();
this.url = url;
@@ -275,6 +321,7 @@ define([
};
var sp = new _SingleFilterParameter(args);
this.own(on(sp, 'change', lang.hitch(this, this._onSingleFilterParameterChanged)));
+ this.own(on(sp, 'enter', lang.hitch(this, this._catchSingleFilterParameterEnter)));
sp.placeAt(td);
sp.startup();
singlePart.spId = sp.id;
@@ -284,12 +331,13 @@ define([
//override method sp.valueProvider.getCascadeFilterExpr after create all sps and also before build
array.forEach(sps, lang.hitch(this, function(sp){
sp.valueProvider.getCascadeFilterExpr = lang.hitch(this, this._getCascadeFilterExpr, sp.part);
+ sp.valueProvider.getCascadeFilterPartsObj = lang.hitch(this, this._getCascadeFilterPartsObj, sp.part);
}));
var defs = array.map(sps, lang.hitch(this, function(sp){
return sp.init();
}));
- all(defs).then(lang.hitch(this, function(){
- resultDef.resolve();
+ all(defs).then(lang.hitch(this, function(vp){
+ resultDef.resolve(vp);
}), lang.hitch(this, function(){
resultDef.reject();
}));
@@ -381,6 +429,10 @@ define([
return result;
},
+ _catchSingleFilterParameterEnter: function(){
+ this.emit('enter');
+ },
+
_onSingleFilterParameterChanged: function(){
//when changed, we should get the filter silently and don't show error tip
this.emit('change', this.getFilterExpr(false));
diff --git a/app/jimu.js/dijit/GeocodeServiceBrowser.js b/app/jimu.js/dijit/GeocodeServiceBrowser.js
index 2146ded..532ae97 100644
--- a/app/jimu.js/dijit/GeocodeServiceBrowser.js
+++ b/app/jimu.js/dijit/GeocodeServiceBrowser.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/app/jimu.js/dijit/GeocodeServiceChooser.js b/app/jimu.js/dijit/GeocodeServiceChooser.js
index 3042096..b4ebd8c 100644
--- a/app/jimu.js/dijit/GeocodeServiceChooser.js
+++ b/app/jimu.js/dijit/GeocodeServiceChooser.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/app/jimu.js/dijit/GpChooserFromPortal.js b/app/jimu.js/dijit/GpChooserFromPortal.js
index 0c061df..e95431c 100644
--- a/app/jimu.js/dijit/GpChooserFromPortal.js
+++ b/app/jimu.js/dijit/GpChooserFromPortal.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/app/jimu.js/dijit/GpServiceBrowser.js b/app/jimu.js/dijit/GpServiceBrowser.js
index 6c4e448..6d14d8c 100644
--- a/app/jimu.js/dijit/GpServiceBrowser.js
+++ b/app/jimu.js/dijit/GpServiceBrowser.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/app/jimu.js/dijit/GpServiceChooser.js b/app/jimu.js/dijit/GpServiceChooser.js
index c600455..62335b9 100644
--- a/app/jimu.js/dijit/GpServiceChooser.js
+++ b/app/jimu.js/dijit/GpServiceChooser.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/app/jimu.js/dijit/GpSource.js b/app/jimu.js/dijit/GpSource.js
index 0d0050d..ea8cd6f 100644
--- a/app/jimu.js/dijit/GpSource.js
+++ b/app/jimu.js/dijit/GpSource.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/app/jimu.js/dijit/GridLayout.js b/app/jimu.js/dijit/GridLayout.js
new file mode 100644
index 0000000..65b35e0
--- /dev/null
+++ b/app/jimu.js/dijit/GridLayout.js
@@ -0,0 +1,293 @@
+///////////////////////////////////////////////////////////////////////////
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
+//
+// Licensed under the Apache License Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+///////////////////////////////////////////////////////////////////////////
+
+define(['dojo/_base/declare',
+ 'dojo/_base/lang',
+ 'dojo/_base/array',
+ 'dijit/_WidgetBase',
+ 'dojo/dom-geometry',
+ 'dojo/dom-class',
+ 'dojo/Evented',
+ 'dojo/debounce'
+],
+function(declare, lang, array, _WidgetBase, domGeometry, domClass, Evented, debounce) {
+ var COMPONENT_NAME = 'jimu grid';
+ /**
+ * The structure of the this layout has one limitation:
+ * A stack only contains one component.
+ */
+ return declare([_WidgetBase, Evented], {
+ 'baseClass': 'jimu-dijit-gridlayout',
+ declaredClass: 'jimu.dijit.GridLayout',
+
+ container: null, // the container domNode of golden layout
+ layoutDefinition: null, // configuration of golden layout
+ components: null, // array of {id: string, dijit: dijit instance}
+ editable: false,
+
+ _layout: null, // instance of goldenLayout
+ _coordinates: null, // an object whose key is component id and value is component coordinate.
+ _isCreatingLayout: null,
+
+ postCreate: function(){
+ this.inherited(arguments);
+ this._isCreatingLayout = false;
+ this._createLayout(this.layoutDefinition);
+ },
+
+ restoreLayout: function(layoutDefinition) {
+ layoutDefinition = layoutDefinition || this.layoutDefinition;
+ this._createLayout(layoutDefinition);
+ },
+
+ destroy: function() {
+ array.forEach(this.components, function(component) {
+ component.dijit.destroy();
+ });
+ this._layout.destroy();
+ this.inherited(arguments);
+ },
+
+ getLayoutDefinition: function() {
+ var currentConfig = this._layout.toConfig();
+ return currentConfig.content;
+ },
+
+ resize: function() {
+ var box = domGeometry.getMarginBox(this.container);
+ this._layout.updateSize(box.w, box.h);
+ },
+
+ getComponentSize: function(componentId) {
+ var rootElem = this._layout.root.contentItems[0];
+ var contentItem = rootElem.getItemsById(componentId), container;
+ if (contentItem && contentItem.length > 0) {
+ container = contentItem[0].container;
+ return {
+ w: container.width,
+ h: container.height
+ };
+ }
+ return {
+ w: 0,
+ h: 0
+ };
+ },
+
+ getSize: function() {
+ return {
+ w: this._layout.width,
+ h: this._layout.height
+ };
+ },
+
+ /**
+ *
+ */
+ setVisible: function(componentId, visible) {
+ var rootElem = this._layout.root.contentItems[0];
+ var contentItem = rootElem.getItemsById(componentId);
+ if (contentItem && contentItem.length > 0 && visible === false) {
+ this._hideComponent(contentItem[0]);
+ } else if ((!contentItem || contentItem.length === 0) && visible === true) {
+ this._showComponent(componentId);
+ }
+ },
+
+ highlightItem: function(componentId) {
+ var rootElem = this._layout.root.contentItems[0];
+ var contentItem = rootElem.getItemsById(componentId);
+ if (contentItem && contentItem.length > 0) {
+ contentItem[0].highlight();
+ }
+ },
+
+ unhighlightItem: function(componentId) {
+ var rootElem = this._layout.root.contentItems[0];
+ var contentItem = rootElem.getItemsById(componentId);
+ if (contentItem && contentItem.length > 0) {
+ contentItem[0].unhighlight();
+ }
+ },
+
+ _createLayout: function(layoutDefinition) {
+ if (this._isCreatingLayout) {
+ return;
+ }
+ this._coordinates = {};
+ this._isCreatingLayout = true;
+ var config = {
+ settings: {
+ hasHeaders: false,
+ resizeEnabled: this.editable,
+ reorderEnabled: this.editable,
+ selectionEnabled: this.editable,
+ highlightEnabled: this.editable
+ },
+ dimensions: {
+ borderWidth: 1,
+ dragProxyWidth: 0,
+ dragProxyHeight: 0
+ },
+ content: layoutDefinition
+ };
+ var oldLayout = this._layout;
+
+ require(['libs/goldenlayout/goldenlayout'], lang.hitch(this, function(GoldenLayout){
+ this._layout = new GoldenLayout(config, this.container);
+ this._layout.registerComponent(COMPONENT_NAME, lang.hitch(this, function(container, componentState){
+ var targetDijit;
+ container.parent.config.id = componentState.id;
+ array.some(this.components, function(item) {
+ if (item.id === componentState.id) {
+ targetDijit = item.dijit;
+ container.getElement().html(item.dijit.domNode);
+ return true;
+ }
+ }, this);
+ container.on('resize', debounce(lang.hitch(this, function() {
+ if (container.width > 0 && container.height > 0 && targetDijit &&
+ typeof targetDijit.resize === 'function') {
+ targetDijit.resize(container.width, container.height);
+ }
+ }), 200));
+ container.on('select', lang.hitch(this, function() {
+ if(this.editable) {
+ container.parent.select();
+ }
+ this.emit('mask-click', container.parent.config.id);
+ }));
+ }));
+ this._layout.on( 'initialised', lang.hitch(this, function(){
+ this._resetCoordinate();
+ this.emit("initialised");
+ this._isCreatingLayout = false;
+ if (oldLayout) {
+ oldLayout.destroy();
+ }
+ }));
+ this._layout.on('stateChanged', lang.hitch(this, function(){
+ this._resetCoordinate();
+ }));
+ this._layout.init();
+
+ if (!this.editable) {
+ domClass.add(this._layout.root.childElementContainer[0], 'viewonly');
+ }
+ domClass.add(this._layout.root.childElementContainer[0], 'jimu-dijit-gridlayout');
+ setTimeout(lang.hitch(this, this.resize), 100);
+ }));
+ },
+
+ _hideComponent: function(contentItem) {
+ if (contentItem.parent) {
+ // remove component but won't destroy it
+ contentItem.parent.removeChild(contentItem, true);
+ }
+ },
+
+ _showComponent: function(componentId) {
+ var component, coordinates, currentNode, config, rootItem, rootContentItem, actualIndex;
+ array.some(this.components, function(item) {
+ if (item.id === componentId) {
+ component = item;
+ return true;
+ }
+ }, this);
+
+ if (component) {
+ config = {
+ id: componentId,
+ type: 'component',
+ componentName: COMPONENT_NAME,
+ componentState: {
+ id: componentId
+ }
+ };
+ coordinates = this._coordinates[componentId];
+ rootItem = this._layout.root;
+ if (coordinates) {
+ // rootItem.type may be stack is there is only one component
+ if (coordinates[0].type !== rootItem.contentItems[0].type) {
+ rootContentItem = rootItem.contentItems[0];
+ rootItem.replaceChild(rootContentItem, {
+ type: coordinates[0].type,
+ content: []
+ });
+ rootItem.contentItems[0].addChild(rootContentItem);
+ }
+
+ currentNode = rootItem;
+ array.forEach(coordinates, function(pos) {
+ actualIndex = pos.index <= currentNode.contentItems.length ?
+ pos.index : currentNode.contentItems.length;
+ if (pos.type === 'component') {
+ currentNode.addChild(config, actualIndex);
+ } else { //stack, column or row
+ if (pos.type === 'stack' ||
+ currentNode.contentItems[pos.index].type !== pos.type) {
+ currentNode.addChild({
+ type: pos.type,
+ content: []
+ }, actualIndex);
+ }
+ currentNode = currentNode.contentItems[actualIndex];
+ }
+ }, this);
+ } else {
+ if (rootItem.contentItems[0].type === 'stack') {
+ rootContentItem = rootItem.contentItems[0];
+ rootItem.replaceChild(rootContentItem, {
+ type: 'column',
+ content: []
+ });
+ rootItem.contentItems[0].addChild(rootContentItem);
+ }
+ rootItem.contentItems[0].addChild(config);
+ }
+ }
+ },
+
+ /**
+ * Calculate the coordinate of each component
+ */
+ _resetCoordinate: function() {
+ var components = this._layout.root.getItemsByType('component');
+ var next = function(item, coordinates) {
+ var parent = item.parent;
+ if (!parent) {
+ return;
+ }
+ // get the index of the item in the contentItems array of its parent
+ array.some(parent.contentItems, function(sibliingItem, index) {
+ if (sibliingItem === item) {
+ coordinates.push({
+ type: sibliingItem.type,
+ index: index
+ });
+ return true;
+ }
+ });
+ next(parent, coordinates);
+ };
+ array.forEach(components, function(component) {
+ var coordinates = [];
+ next(component, coordinates);
+ this._coordinates[component.config.id] = coordinates.reverse();
+ }, this);
+ }
+ });
+});
\ No newline at end of file
diff --git a/app/jimu.js/dijit/ImageChooser.js b/app/jimu.js/dijit/ImageChooser.js
index c60c1b0..c3c3a3b 100644
--- a/app/jimu.js/dijit/ImageChooser.js
+++ b/app/jimu.js/dijit/ImageChooser.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -24,7 +24,6 @@ define([
'dojo/on',
'dojo/text!./templates/ImageChooser.html',
'dojo/sniff',
- 'dojo/request',
'esri/lang',
'../utils',
'./_CropImage',
@@ -33,7 +32,7 @@ define([
'jimu/dijit/LoadingShelter'
],
function(Evented, declare, _WidgetBase, _TemplatedMixin, lang, html,
- on, template, has, request, esriLang, utils, _CropImage,
+ on, template, has, esriLang, utils, _CropImage,
Popup, Message, LoadingShelter) {
var count = 0;
@@ -47,6 +46,7 @@ define([
// public properties
cropImage: true, // if imagechooser run in integration ignore this property
displayImg: null,
+ stretchImg: true,//default stretch img in old version
defaultSelfSrc: null,
showSelfImg: false,
label: null,
@@ -56,6 +56,8 @@ define([
maxSize: 1024,
format: null, // array:['image/png','image/gif','image/jpeg']
+ customZIndex: null, //optional
+
// public methods
//enableChooseImage
//disableChooseImage
@@ -111,9 +113,8 @@ define([
},
_initial: function() {
+ this._initFileForm();
this._processProperties();
- this._porcessMaskClick();
- this._setupFileInput();
this._addTip();
},
@@ -127,6 +128,11 @@ define([
if (this.showSelfImg) {
html.setStyle(this.hintImage, 'display', 'block');
}
+ if (false === this.stretchImg) {
+ html.addClass(this.selfImg, "no-stretch-img");//set false by manual
+ } else {
+ html.removeClass(this.selfImg, "no-stretch-img");//default
+ }
if (this.defaultSelfSrc) {
this.selfImg.src = this.defaultSelfSrc;
this.imageData = this.defaultSelfSrc;
@@ -156,16 +162,22 @@ define([
}
},
+ _newMessage: function(msg){
+ this.msgPopupOpen = true;
+ this.msgPopup = new Message({
+ customZIndex: this.customZIndex,
+ message: msg
+ });
+ },
+
_porcessMaskClick: function() {
html.setAttr(this.fileInput, 'id', 'imageChooser_' + count);
html.setAttr(this.mask, 'for', 'imageChooser_' + count);
count++;
- this.maskHandle = on(this.mask, 'click', lang.hitch(this, function(evt) {
+ on.once(this.mask, 'click', lang.hitch(this, function(evt) {
evt.stopPropagation();
if (has('safari') && has('safari') < 7) {
- new Message({
- message: this.nls.unsupportReaderAPI
- });
+ this._newMessage(this.nls.unsupportReaderAPI);
evt.preventDefault();
return;
}
@@ -176,17 +188,12 @@ define([
innerHTML: this.nls.enableFlash,
target: '_blank'
});
-
- new Message({
- message: errContent
- });
+ this._newMessage(errContent);
evt.preventDefault();
return;
}
if (!utils.file.supportFileAPI()) {
- new Message({
- message: this.nls.unsupportReaderAPI
- });
+ this._newMessage(this.nls.unsupportReaderAPI);
evt.preventDefault();
return;
}
@@ -212,78 +219,74 @@ define([
}
},
- _setupFileInput: function() {
- if (has('ie') <= 9) {
- this.own(on(this.fileInput, 'change', lang.hitch(this, this._onFileInputChange)));
- } else {
- on.once(this.fileInput, 'change', lang.hitch(this, this._onFileInputChange));
- }
- },
+ // _setupFileInput: function() {
+ // if (has('ie') <= 9) {
+ // this.own(on(this.fileInput, 'change', lang.hitch(this, this._onFileInputChange)));
+ // } else {
+ // on.once(this.fileInput, 'change', lang.hitch(this, this._onFileInputChange));
+ // }
+ // },
- _onFileInputChange: function(evt) {
+ _onFileInputChange: function (evt) {
var file = (evt.target.files && evt.target.files[0]) || (evt.files && evt.files[0]);
if (this.format && this.format.indexOf(file.type) === -1) {
- new Message({
- 'message': this.nls.invalidType
- });
+ this._newMessage(this.nls.invalidType);
- if (!has('ie') || has('ie') > 9) {
- // recreate fileForm to support select same image again.
- this._recreateFileForm();
- }
+ this._initFileForm();//recreate fileForm to support select same image again.
return;
}
- var maxSize = has('ie') < 9 ? 23552 : this.maxSize * 1024; //ie8:21k others:1M
- utils.file.readFile(
- evt,
- 'image/*',
- maxSize,
- lang.hitch(this, function(err, fileName, fileData) {
- /*jshint unused: false*/
- if (err) {
- var message = this.nls[err.errCode];
- if (err.errCode === 'exceed') {
- message = message.replace('1024', maxSize / 1024);
- }
- new Message({
- 'message': message
- });
+ var maxSize = this.maxSize * 1024;
+ utils.file.readFile(evt, 'image/*', maxSize, lang.hitch(this, function (err, fileName, fileData) {
+ /*jshint unused: false*/
+ if (err) {
+ var message = this.nls[err.errCode];
+ if (err.errCode === 'exceed') {
+ message = message.replace('1024', maxSize / 1024);
+ }
+ this._newMessage(message);
+ } else {
+ this.fileProperty.fileName = fileName;
+ if (this.cropImage && file.type !== 'image/gif') {
+ this._cropImageByUser(fileData, file.type);
} else {
- this.fileProperty.fileName = fileName;
- if (window.isXT && this.cropImage && file.type !== 'image/gif') {
- this._cropImageByUser(fileData);
- } else {
- this._readFileData(fileData);
- }
+ this._readFileData(fileData);
}
+ }
- if (!has('ie') || has('ie') > 9) {
- // recreate fileForm to support select same image again.
- this._recreateFileForm();
- }
- }));
+ this._initFileForm();//recreate fileForm to support select same image again.
+ }));
},
- _recreateFileForm: function() {
- var newMask = lang.clone(this.mask);
- var newFileInput = lang.clone(this.fileInput);
- html.destroy(this.mask);
- html.destroy(this.fileInput);
-
- var newFileForm = lang.clone(this.fileForm);
- html.place(newMask, newFileForm);
- html.place(newFileInput, newFileForm);
- html.place(newFileForm, this.fileForm, 'replace');
-
- this.maskHandle.remove();
- this.mask = newMask;
- this.fileInput = newFileInput;
- html.destroy(this.fileForm);
- this.fileForm = newFileForm;
-
- this._porcessMaskClick();
- this._setupFileInput();
+ _initFileForm: function () {
+ //clean
+ if (this.mask) {
+ html.destroy(this.mask);
+ }
+ if (this.fileInput) {
+ html.destroy(this.fileInput);
+ }
+ if (this.fileForm) {
+ html.destroy(this.fileForm);
+ }
+ //create
+ //
+ this.fileForm = html.create('form', {
+ "data-dojo-attach-point": "fileForm"
+ }, this.domNode);
+ this.mask = html.create('label', {
+ "data-dojo-attach-point": "mask"
+ }, this.fileForm);
+ this.fileInput = html.create('input', {
+ "type": "file",
+ "data-dojo-attach-point": "fileInput"
+ }, this.fileForm);
+
+ this._porcessMaskClick();//masker event
+ on.once(this.fileInput, 'change', lang.hitch(this, this._onFileInputChange));//fileInput event
},
_readFileData: function(fileData) {
@@ -297,69 +300,55 @@ define([
} else {
this.selfImg.src = fileData;
}
+ //Center&Vertically
+ var layoutBox = html.getMarginBox(this.hintImage);
+ if (layoutBox && layoutBox.w && layoutBox.h) {
+ html.style(this.selfImg, "maxWidth", layoutBox.w + "px");
+ html.style(this.selfImg, "maxHeight", layoutBox.h + "px");
+ }
}
},
- _cropImageByUser: function(fileData) {
+ _cropImageByUser: function (data, type) {
var cropImage = new _CropImage({
- imageSrc: fileData,
+ imageSrc: data,
+ type: type,
nls: lang.clone(this.nls),
- realWidth: this.goldenWidth,
- realHeight: this.goldenHeight
+ goldenWidth: this.goldenWidth,
+ goldenHeight: this.goldenHeight
});
var shelter = new LoadingShelter({
hidden: true
});
- var cropPopup = new Popup({
+ this.cropPopupOpen = true;
+ this.cropPopup = new Popup({
titleLabel: this.nls.cropImage,
content: cropImage,
+ customZIndex: this.customZIndex,
// autoHeight: true,
width: 500,
height: 480,
buttons: [{
label: this.nls.common.ok,
- onClick: lang.hitch(this, function() {
- var imageSize = cropImage.getImageSize();
- var cropSize = cropImage.getCropSize();
+ onClick: lang.hitch(this, function () {
shelter.show();
- request("/webappbuilder/rest/cropimage", {
- data: {
- imageData: fileData,
- imageDisplaySize: imageSize.w + ',' + imageSize.h,
- cropRectangle: cropSize.w + ',' + cropSize.h + ',' + cropSize.t + ',' + cropSize.l
- },
- method: 'POST',
- handleAs: 'json',
- headers: {
- "X-Requested-With": null
- }
- }).then(lang.hitch(this, function(response) {
- if (response.success) {
- var fileData = response.imageData;
- this._readFileData(fileData);
- cropPopup.close();
- } else {
- new Message({
- 'message': this.nls.unknowError
- });
-
- shelter.hide();
- }
- }), lang.hitch(this, function(err) {
- console.error(err);
- new Message({
- 'message': this.nls.unknowError
- });
- shelter.hide();
- }));
+
+ var fileData = cropImage.getData();
+ if(fileData){
+ this._readFileData(fileData);
+ }
+
+ this.cropPopup.close();
+ cropImage.destroy();
+ shelter.hide();
})
}]
});
- shelter.placeAt(cropPopup.domNode);
+ shelter.placeAt(this.cropPopup.domNode);
cropImage.startup();
- html.addClass(cropPopup.domNode, 'image-chooser-crop-popup');
+ html.addClass(this.cropPopup.domNode, 'image-chooser-crop-popup');
},
onImageChange: function(fileData) {
diff --git a/app/jimu.js/dijit/ItemSelector.js b/app/jimu.js/dijit/ItemSelector.js
index a0f6f7f..c5333f7 100644
--- a/app/jimu.js/dijit/ItemSelector.js
+++ b/app/jimu.js/dijit/ItemSelector.js
@@ -1,5 +1,5 @@
/*
-Copyright ©2014 Esri. All rights reserved.
+// Copyright © 2014 - 2018 Esri. All rights reserved.
TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
Unpublished material - all rights reserved under the
@@ -39,7 +39,8 @@ define([
'jimu/dijit/ViewStack',
'jimu/dijit/Search',
'jimu/dijit/TabContainer3',
- 'jimu/dijit/_ItemTable'
+ 'jimu/dijit/_ItemTable',
+ 'dijit/form/RadioButton'
], function(declare, topic, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, template,
Evented, lang, dojoConfig, array, html, Deferred, all, query, on, jimuUtils, portalUtils,
tokenUtils, portalUrlUtils, ViewStack, Search, TabContainer3, _ItemTable) {
@@ -202,14 +203,12 @@ define([
},
_initPortalRadio: function(){
- jimuUtils.combineRadioCheckBoxWithLabel(this.portalPublicRaido, this.portalPublicLabel);
- jimuUtils.combineRadioCheckBoxWithLabel(this.onlinePublicRaido, this.onlinePublicLabel);
var portalUrl = this._getPortalUrl();
var portalServer = portalUrlUtils.getServerByUrl(portalUrl);
- this.portalPublicRaido.disabled = false;
- this.onlinePublicRaido.disabled = false;
- this.portalPublicRaido.checked = true;
+ this.portalPublicRaido.set("disabled", false);
+ this.onlinePublicRaido.set("disabled", false);
+ this.portalPublicRaido.set("checked", true);
var shouldHidePublicArcGIScom = false;
if(portalUrlUtils.isArcGIScom(portalServer)){
shouldHidePublicArcGIScom = true;
@@ -225,7 +224,7 @@ define([
}
}
if(shouldHidePublicArcGIScom){
- this.onlinePublicRaido.disabled = true;
+ this.onlinePublicRaido.set("disabled", true);
html.setStyle(this.onlinePublicRaido, 'display', 'none');
html.setStyle(this.onlinePublicLabel, 'display', 'none');
}
@@ -358,14 +357,14 @@ define([
var portalUrl = this._getPortalUrl();
//portal public
- if(!this.portalPublicRaido.disabled){
+ if(!this.portalPublicRaido.get("disabled")){
this.publicPortalItemTable.set('portalUrl', portalUrl);
this.publicPortalItemTable.searchAllItems(this._allPublicPortalQuery);
this.publicPortalItemTable.set('filteredQuery', this._filterPublicPortalQuery);
}
//ArcGIS.com public
- if(!this.onlinePublicRaido.disabled){
+ if(!this.onlinePublicRaido.get("disabled")){
this.publicOnlineItemTable.set('portalUrl', window.location.protocol + '//www.arcgis.com');
this.publicOnlineItemTable.searchAllItems(this._allPublicOnlineQuery);
this.publicOnlineItemTable.set('filteredQuery', this._filterPublicOnlineQuery);
@@ -379,11 +378,11 @@ define([
},
_onPublicRaidoClicked: function(){
- if(this.portalPublicRaido.checked){
+ if(this.portalPublicRaido.get("checked")){
this.publicPortalItemTable.show();
this.publicOnlineItemTable.hide();
}
- else if(this.onlinePublicRaido.checked){
+ else if(this.onlinePublicRaido.get("checked")){
this.publicPortalItemTable.hide();
this.publicOnlineItemTable.show();
}
@@ -396,12 +395,12 @@ define([
this.publicPortalItemTable.showFilterItemsSection();
this.publicOnlineItemTable.showFilterItemsSection();
- if (this.portalPublicRaido.checked) {
+ if (this.portalPublicRaido.get("checked")) {
//text + this._itemTypeQueryString + ' AND access:public ' + this._typeKeywordQueryString
this._filterPublicPortalQuery.q = text + ' ' + this._filterPublicPortalQuery.basicQ;
this._filterPublicPortalQuery.start = 1;
this.publicPortalItemTable.searchFilteredItems(this._filterPublicPortalQuery);
- } else if (this.onlinePublicRaido.checked) {
+ } else if (this.onlinePublicRaido.get("checked")) {
this._filterPublicOnlineQuery.q = text + ' ' + this._itemTypeQueryString +
' AND access:public ' + this._typeKeywordQueryString;
this._filterPublicOnlineQuery.start = 1;
@@ -540,7 +539,7 @@ define([
_searchGroups: function(user){
this._resetGroupsSection();
- html.setStyle(this.groupsSection, "display", "block");
+ html.setStyle(this.groupsSection, "display", "flex");
var groups = user.getGroups();
if (groups.length > 0) {
html.setStyle(this.groupSearch.domNode, 'display', 'block');
diff --git a/app/jimu.js/dijit/LayerChooserFromMap.js b/app/jimu.js/dijit/LayerChooserFromMap.js
index 8180357..bddfc44 100644
--- a/app/jimu.js/dijit/LayerChooserFromMap.js
+++ b/app/jimu.js/dijit/LayerChooserFromMap.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -15,12 +15,12 @@
///////////////////////////////////////////////////////////////////////////
define([
+ 'dojo/on',
+ 'dojo/Evented',
'dojo/_base/declare',
'dijit/_WidgetBase',
'dijit/_TemplatedMixin',
'dijit/_WidgetsInTemplateMixin',
- 'dojo/Evented',
- 'dojo/on',
'dojo/store/Memory',
'dojo/Deferred',
'dojo/store/Observable',
@@ -34,9 +34,9 @@ define([
'jimu/LayerInfos/LayerInfos',
'jimu/dijit/LoadingIndicator'
],
- function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, Evented, on,
- Memory, Deferred, Observable, ObjectStoreModel, all, lang, html, array, jimuUtils,
- JimuTree, LayerInfos, LoadingIndicator) {
+ function(on, Evented, declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, Memory, Deferred, Observable,
+ ObjectStoreModel, all, lang, html, array, jimuUtils, JimuTree, LayerInfos, LoadingIndicator) {
+
var LayerChooser = declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, Evented], {
templateString:'
' +
'
' +
@@ -54,6 +54,8 @@ define([
multiple: false, //Can select multiple layers or a single layer.
onlyShowVisible: false,
updateWhenLayerInfosIsShowInMapChanged: false,
+ onlyShowWebMapLayers: false,
+ displayTooltipForTreeNode: false,
//public methods:
//getSelectedItems
@@ -178,11 +180,20 @@ define([
_buildTree: function(layerInfosObj){
this._clear();
html.setStyle(this.errorTipSection, 'display', 'block');
- var layerInfos = layerInfosObj.getLayerInfoArray();//get layerInfo array
- layerInfos = layerInfos.concat(layerInfosObj.getTableInfoArray());//get tableInfo array
+ var layerInfos = [];
+
+ if(this.onlyShowWebMapLayers){
+ layerInfos = layerInfosObj.getLayerInfoArrayOfWebmap();
+ layerInfos = layerInfos.concat(layerInfosObj.getTableInfoArrayOfWebmap());
+ }else{
+ layerInfos = layerInfosObj.getLayerInfoArray();
+ layerInfos = layerInfos.concat(layerInfosObj.getTableInfoArray());
+ }
+
if(layerInfos.length === 0){
return;
}
+
html.setStyle(this.errorTipSection, 'display', 'none');
array.forEach(layerInfos, lang.hitch(this, function(layerInfo){
this._addDirectLayerInfo(layerInfo);
@@ -290,19 +301,23 @@ define([
model: myModel,
showRoot: false,
isLeafItem: lang.hitch(this, this._isLeafItem),
+
style: {
width: "100%"
},
+
onOpen: lang.hitch(this, function(item, node) {
if (item.id === 'root') {
return;
}
this._onTreeOpen(item, node);
}),
+
onClick: lang.hitch(this, function(item, node, evt) {
this._onTreeClick(item, node, evt);
this.emit('tree-click', item, node, evt);
}),
+
getIconStyle: lang.hitch(this, function(item, opened) {
var icon = null;
if (!item || item.id === 'root') {
@@ -317,10 +332,9 @@ define([
backgroundImage: ''
};
- var baseUrl = window.location.protocol + "//" +
- window.location.host + require.toUrl("jimu");
+ var baseUrl = window.location.protocol + "//" + window.location.host + require.toUrl("jimu");
- var imageName = this._getIconImageName(item, opened);
+ var imageName = this._getIconInfo(item, opened).imageName;
if (imageName) {
a.backgroundImage = "url(" + baseUrl + "/css/images/" + imageName + ")";
@@ -328,6 +342,14 @@ define([
}
return icon;
+ }),
+
+ getIconClass: lang.hitch(this, function(item, opend) {
+ return this._getIconInfo(item, opend).className;
+ }),
+
+ getTooltip: lang.hitch(this, function(item){
+ return this.displayTooltipForTreeNode ? item.layerInfo.title : "";
})
});
html.addClass(this.tree.domNode, this._treeClass);
@@ -338,44 +360,59 @@ define([
return item.hasChildren;
},
- _getIconImageName: function(item, opened) {
+ _getIconInfo: function(item, opened) {
var imageName = '';
+ var className = '';
if (item.type === 'ArcGISDynamicMapServiceLayer' ||
item.type === 'ArcGISTiledMapServiceLayer') {
if (opened) {
imageName = 'mapserver_open.png';
+ className = 'mapservice-layer-icon open';
} else {
imageName = 'mapserver_close.png';
+ className = 'mapservice-layer-icon close';
}
} else if (item.type === 'GroupLayer') {
if (opened) {
imageName = 'group_layer2.png';
+ className = 'group-layer-icon open';
} else {
imageName = 'group_layer1.png';
+ className = 'group-layer-icon close';
}
} else if (item.type === 'FeatureLayer') {
var geoType = jimuUtils.getTypeByGeometryType(item.layerInfo.layerObject.geometryType);
if (geoType === 'point') {
imageName = 'point_layer1.png';
+ className = 'point-layer-icon';
} else if (geoType === 'polyline') {
imageName = 'line_layer1.png';
+ className = 'line-layer-icon';
} else if (geoType === 'polygon') {
imageName = 'polygon_layer1.png';
+ className = 'polygon-layer-icon';
}
} else if(item.type === 'Table'){
imageName = "table.png";
+ className = 'table-icon';
} else if(item.type === 'ArcGISImageServiceLayer' ||
item.type === 'ArcGISImageServiceVectorLayer'){
imageName = 'image_layer.png';
+ className = 'iamge-layer-icon';
} else {
if (opened) {
imageName = 'mapserver_open.png';
+ className = 'mapservice-layer-icon open';
} else {
imageName = 'mapserver_close.png';
+ className = 'mapservice-layer-icon close';
}
}
- return imageName;
+ return {
+ imageName: imageName,
+ className: className
+ };
},
_onTreeOpen: function(item, node) { /*jshint unused: false*/
@@ -418,12 +455,11 @@ define([
destroy: function(){
if(this.shelter){
this.shelter.destroy();
+ this.shelter = null;
}
if(this.tree){
this.tree.destroy();
}
- this.shelter = null;
- this.tree.destroy();
this.inherited(arguments);
}
});
@@ -475,7 +511,7 @@ define([
};
//the returned filter only filters FeatureLayer
- LayerChooser.createFeaturelayerFilter = function(types, showLayerFromFeatureSet, showTable){
+ LayerChooser.createFeaturelayerFilter = function(types, showLayerFromFeatureSet, showTable, mustSupportStatistics){
var allTypes = ['point', 'polyline', 'polygon'];
if(types && types.length > 0){
types = array.filter(types, function(type){
@@ -490,90 +526,100 @@ define([
}
return function(layerInfo){
- var def = new Deferred();
var defLayerType = layerInfo.getLayerType();
var defLayerObject = layerInfo.getLayerObject();
- all({
+ return all({
layerType: defLayerType,
layerObject: defLayerObject
}).then(function(result){
var layerType = result.layerType;
var layerObject = result.layerObject;
if (layerType === 'ArcGISDynamicMapServiceLayer') {
- def.resolve(true);
+ return true;
} else if (layerType === 'ArcGISTiledMapServiceLayer') {
- def.resolve(true);
+ return true;
} else if (layerType === 'GroupLayer'){
- def.resolve(true);
+ return true;
} else if (layerType === 'FeatureCollection'){
- def.resolve(true);
+ return true;
}else if (layerType === 'FeatureLayer') {
var geoType = jimuUtils.getTypeByGeometryType(layerObject.geometryType);
var isValidGeoType = array.indexOf(types, geoType) >= 0;
+ var isLayerValidStatistics = LayerChooser._shouldPassStatisticsCheck(mustSupportStatistics, layerObject);
if (layerObject.url) {
//featurelayer by url
var isLayerSupportQuery = jimuUtils.isFeaturelayerUrlSupportQuery(layerObject.url,
layerObject.capabilities);
- def.resolve(isValidGeoType && isLayerSupportQuery);
+ return (isValidGeoType && isLayerSupportQuery && isLayerValidStatistics);
} else {
//featurelayer by featureset
- def.resolve(showLayerFromFeatureSet && isValidGeoType);
+ return (showLayerFromFeatureSet && isValidGeoType);
}
} else if(layerType === 'Table'){
//if showTable is true, we will ignore types
var isTableSupportQuery = jimuUtils.isFeaturelayerUrlSupportQuery(layerObject.url,
layerObject.capabilities);
- def.resolve(showTable && isTableSupportQuery);
+ var isTableValidStatistics = LayerChooser._shouldPassStatisticsCheck(mustSupportStatistics, layerObject);
+ return (showTable && isTableSupportQuery && isTableValidStatistics);
}else{
- def.resolve(false);
+ return false;
}
- }, function(err){
- console.log(err);
- def.reject(err);
});
-
- return def;
};
};
//the returned filter only filters ArcGISImageServiceLayer and ArcGISImageServiceVectorLayer
- LayerChooser.createImageServiceLayerFilter = function(isSupportQuery){
+ LayerChooser.createImageServiceLayerFilter = function(isSupportQuery, mustSupportStatistics){
return function(layerInfo){
- var def = new Deferred();
var defLayerType = layerInfo.getLayerType();
var defLayerObject = layerInfo.getLayerObject();
- all({
+ return all({
layerType: defLayerType,
layerObject: defLayerObject
}).then(function(result){
var layerType = result.layerType;
+ var layerObject = result.layerObject;
if(layerType === 'ArcGISImageServiceLayer' ||
layerType === 'ArcGISImageServiceVectorLayer'){
if(isSupportQuery){
if(jimuUtils.isImageServiceSupportQuery(result.layerObject.capabilities)){
- def.resolve(true);
+ if(mustSupportStatistics){
+ return LayerChooser._shouldPassStatisticsCheck(mustSupportStatistics, layerObject);
+ }else{
+ return true;
+ }
}else{
- def.resolve(false);
+ return false;
}
}else{
- def.resolve(true);
+ return true;
}
}else{
- def.resolve(false);
+ return false;
}
- }, function(err){
- console.log(err);
- def.reject(err);
});
- return def;
};
};
- LayerChooser.createQueryableLayerFilter = function(){
+ LayerChooser._shouldPassStatisticsCheck = function(mustSupportStatistics, layerObject){
+ if(mustSupportStatistics){
+ var isSupport = false;
+ if (layerObject.advancedQueryCapabilities) {
+ isSupport = !!layerObject.advancedQueryCapabilities.supportsStatistics;
+ } else {
+ isSupport = !!layerObject.supportsStatistics;
+ }
+ return isSupport;
+ }else{
+ return true;
+ }
+ };
+
+ LayerChooser.createQueryableLayerFilter = function(mustSupportStatistics){
var types = ['point', 'polyline', 'polygon'];
- var featureLayerFilter = LayerChooser.createFeaturelayerFilter(types, false, true);
- var imageServiceLayerFilter = LayerChooser.createImageServiceLayerFilter(true);
+ var featureLayerFilter = LayerChooser.createFeaturelayerFilter(types, false, true, mustSupportStatistics);
+ var imageServiceLayerFilter = LayerChooser.createImageServiceLayerFilter(true, mustSupportStatistics);
var filters = [featureLayerFilter, imageServiceLayerFilter];
var combinedFilter = LayerChooser.orCombineFilters(filters);
return combinedFilter;
@@ -619,4 +665,4 @@ define([
};
return LayerChooser;
- });
\ No newline at end of file
+ });
diff --git a/app/jimu.js/dijit/LayerChooserFromMapLite.js b/app/jimu.js/dijit/LayerChooserFromMapLite.js
new file mode 100644
index 0000000..43a0294
--- /dev/null
+++ b/app/jimu.js/dijit/LayerChooserFromMapLite.js
@@ -0,0 +1,598 @@
+///////////////////////////////////////////////////////////////////////////
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
+//
+// Licensed under the Apache License Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+///////////////////////////////////////////////////////////////////////////
+
+define([ 'dojo/on',
+ 'dojo/_base/declare',
+ 'dojo/promise/all',
+ 'dojo/_base/lang',
+ 'dojo/_base/html',
+ 'dojo/_base/array',
+ 'jimu/dijit/CheckBox',
+ 'jimu/dijit/LayerChooserFromMap',
+ 'jimu/LayerStructure'
+ ],
+ function(on, declare, all, lang, html, array, CheckBox, LayerChooserFromMap, LayerStructure) {
+
+ var LayerChooser = declare([LayerChooserFromMap], {
+ templateString:'
' +
+ '
' +
+ '' +
+ '' +
+ '${nls.noLayersTip}' +
+ '
' +
+ '
' +
+ '
',
+
+ //constructor options:
+ //multiple: false, //Can select multiple layers or a single layer.
+ //onlyShowVisible: false, //optional
+ //updateWhenLayerInfosIsShowInMapChanged: false, //optional
+ map: null, //optional
+ layerStateController: null, //optional
+ layerState: null, //optional
+ customFilter: null, //optional
+ onlySelectLeafLayer: false, //optional
+ displayLayerTypeIcon: true, //optional
+ showTables: true, //optional
+ viewMode: false, //optional
+ onlyShowWebMapLayers: false, //optional
+
+ //public methods:
+ //getSelectedItems
+
+ //events:
+ //tree-click
+ //update
+
+ layerStructure: null,
+ _layerDatas: null,
+ _eventHandles: null,
+
+ postMixInProperties:function(){
+ this.nls = window.jimuNls.basicLayerChooserFromMap;
+ },
+
+ postCreate: function() {
+ //this.inherited(arguments);
+ html.addClass(this.domNode, 'jimu-basic-layer-chooser-from-map');
+ html.addClass(this.domNode, 'jimu-basic-layer-chooser-from-map-lite');
+
+ /*
+ this.shelter = new LoadingIndicator({hidden:true});
+ this.shelter.placeAt(this.domNode);
+ this.shelter.startup();
+ */
+
+ // init properties
+ this._layerDatas = {};
+ this._eventHandles = [];
+
+ // init layerStructure
+ if(this.map){
+ this.layerStructure = LayerStructure.createInstance(this.map);
+ } else {
+ this.layerStructure = LayerStructure.getInstance();
+ }
+ this.layerInfosObj = this.layerStructure._layerInfos;
+
+ // clear layer state
+ this.layerState = this._clearLayerState(this.layerState) || {};
+
+ /*
+ this.own(on(this.layerStructure,
+ LayerStructure.EVENT_STRUCTURE_CHANGE,
+ lang.hitch(this, this._onLayerInfosChanged)));
+ if(this.updateWhenLayerInfosIsShowInMapChanged) {
+ this.own(on(this.layerStructure,
+ LayerStructure.EVENT_VISIBILITY_CHANGE,
+ lang.hitch(this, this._onLayerInfosIsShowInMapChanged)));
+ }
+ */
+
+ // init layerStateController
+ if(!this.layerStateController) {
+ this.layerStateController = new LayerChooser.LayerStateController();
+ }
+
+ // init filter
+ var filter;
+ if(this.customFilter) {
+ filter = lang.hitch(this, this.customFilter);
+ } else {
+ filter = lang.hitch(this, this.filter);
+ }
+ this.filter = LayerChooserFromMap.andCombineFilters([this.basicFilter, filter]);
+
+ // create tree
+ this._createTree();
+ },
+
+ _createTree: function() {
+ var layerNodes, tableNodes;
+ if(this.onlyShowWebMapLayers) {
+ layerNodes = this.layerStructure.getWebmapLayerNodes();
+ tableNodes = this.layerStructure.getWebmapTableNodes();
+ } else {
+ layerNodes = this.layerStructure.getLayerNodes();
+ tableNodes = this.layerStructure.getTableNodes();
+ }
+ var createdCount = this._createLayerNodes(layerNodes.concat(this.showTables ? tableNodes : []), this.treeUl);
+
+ if(createdCount > 0) {
+ html.setStyle(this.errorTipSection, 'display', 'none');
+ this.layerStateController.restoreState(this.layerState, this.layerStructure);
+ }
+ },
+
+ _createLayerNodes: function(layerNodes, nodeUl) {
+ var filterDefs = array.map(layerNodes, function(layerNode) {
+ return this.filter(layerNode._layerInfo);
+ }, this);
+
+ var createdCount = 0;
+ all(filterDefs).then(lang.hitch(this, function(results) {
+ array.forEach(results, function(isPass, index) {
+ if(isPass) {
+ this._createLayerNode(layerNodes[index], nodeUl);
+ createdCount++;
+ }
+ }, this);
+ }));
+
+ return createdCount;
+ },
+
+ _createLayerNode: function(layerNode, nodeUl) {
+ var handle;
+
+ var layerNodeLi = html.create('li', {
+ 'class': 'tree-node-li',
+ 'id': 'layerchooserlite-tree-node-li-' + layerNode.id
+ //'style': 'display:none'
+ }, nodeUl);
+
+ var layerNodeDiv = html.create('div', {
+ 'class': 'tree-node-div'
+ }, layerNodeLi);
+
+ var collapseSpan = html.create('span', {
+ 'class': 'tree-node-column-span collapse-span'
+ }, layerNodeDiv);
+
+ var checkBoxSpan = html.create('span', {
+ 'class': 'tree-node-column-span check-box-span'
+ }, layerNodeDiv);
+
+ var checkBoxDiv = html.create('div', {
+ 'class': 'tree-node-column-div check-box-div'
+ }, checkBoxSpan);
+
+ var displayIconClass = this.displayLayerTypeIcon ? "display" : "";
+ var iconSpan = html.create('span', {
+ 'class': 'tree-node-column-span icon-span ' + displayIconClass
+ }, layerNodeDiv);
+
+ /*
+ var iconDiv = html.create('div', {
+ 'class': 'tree-node-column-div icon-div',
+ 'style': iconSpanStyle
+ }, iconSpan);
+ */
+
+ // restore layer state
+ var state;
+ var oldState = this.layerState[layerNode.id];
+ if(oldState) {
+ state = oldState.selected;
+ } else {
+ state = this.layerStateController.getState(layerNode);
+ }
+
+ var checkBox = new CheckBox({
+ 'checked': state
+ }, checkBoxDiv);
+
+ var titleSpan = html.create('span', {
+ 'class': 'tree-node-column-span title-span',
+ 'innerHTML': layerNode.title
+ }, layerNodeDiv);
+
+
+ // create subLayerNode ul
+ var subLayerNodeUl = html.create('ul', {
+ 'class': 'tree-ul tree-subnode-ul',
+ 'style': 'display:none; '
+ }, layerNodeLi);
+
+ var layerData = {
+ layerNode: layerNode,
+ layerNodeLi: layerNodeLi,
+ layerNodeDiv: layerNodeDiv,
+ collapseSpan: collapseSpan,
+ iconSpan: iconSpan,
+ checkBox: checkBox,
+ subLayerNodeUl: subLayerNodeUl,
+ hasBeenOpened: false
+ };
+
+ this._layerDatas[layerNode.id] = layerData;
+ if(!layerNode.isLeaf()) {
+ html.addClass(collapseSpan, 'is-leaf');
+ html.addClass(titleSpan, 'is-leaf');
+ handle = on(collapseSpan, 'click', lang.hitch(this, this._onCollapse, layerData));
+ this._eventHandles.push(handle);
+ handle = on(titleSpan, 'click', lang.hitch(this, this._onCollapse, layerData));
+ this._eventHandles.push(handle);
+ if(this.onlySelectLeafLayer) {
+ checkBox.setStatus(false);
+ html.setStyle(checkBoxDiv, 'display', 'none');
+ }
+ }
+
+ if(this.viewMode === true) {
+ checkBox.setStatus(false);
+ }
+
+ //this.own(on(checkBox, 'change', lang.hitch(this, this._onCheckBoxChange, layerData)));
+ handle = on(checkBox.domNode, 'click', lang.hitch(this, this._onCheckBoxChange, layerData));
+ this._eventHandles.push(handle);
+
+ this._setIconImage(layerData, false);
+
+ return layerData;
+ },
+
+ _setIconImage: function(layerData, opened) {
+ if(!this.displayLayerTypeIcon) {
+ return;
+ }
+
+ var layerNode = layerData.layerNode;
+ var layerTypeDef = layerNode.getLayerType();
+ var layerObjectDef = layerNode.getLayerObject();
+ all({
+ layerType: layerTypeDef,
+ layerObject: layerObjectDef
+ }).then(lang.hitch(this, function(result) {
+ var item;
+ if(result.layerType && result.layerObject) {
+ item = {
+ type: result.layerType,
+ layerInfo: layerNode._layerInfo
+ };
+
+ var baseUrl = window.location.protocol + "//" + window.location.host + require.toUrl("jimu");
+ var imageName = this._getIconInfo(item, opened).imageName;
+ if (imageName) {
+ var backgroundImageUrl = "url(" + baseUrl + "/css/images/" + imageName + ")";
+ html.setStyle(layerData.iconSpan, 'background-image', backgroundImageUrl);
+ }
+ }
+ }));
+ },
+
+ _getCheckBoxValue: function(checkBox) {
+ return checkBox.getStatus() ? checkBox.getValue() : false;
+ },
+
+ _clearLayerState: function(layerState) {
+ var newLayerState = {};
+ if(layerState) {
+ this.layerStructure.traversal(lang.hitch(this, function(layerNode) {
+ if(layerState[layerNode.id]) {
+ newLayerState[layerNode.id] = {
+ selected: layerState[layerNode.id].selected
+ };
+ }
+ }));
+ }
+ return newLayerState;
+ },
+
+
+ _selectOrDeselectLayer: function(layerId, isSelect) {
+ var layerData = this._layerDatas[layerId];
+ if(layerData) {
+ layerData.checkBox.setValue(isSelect);
+ this._onCheckBoxChange(layerData);
+ }
+ },
+
+ selectLayer: function(layerId) {
+ this._selectOrDeselectLayer(layerId, true);
+ },
+
+ deselectLayer: function(layerId) {
+ this._selectOrDeselectLayer(layerId, false);
+ },
+
+ // layerState: {
+ // id: {
+ // selected: true/false
+ // }
+ // }
+ getState: function() {
+ var layerState = lang.clone(this.layerState);
+
+ for (var id in this._layerDatas) {
+ if(this._layerDatas.hasOwnProperty(id) && (typeof this._layerDatas[id] !== 'function')) {
+ var layerData = this._layerDatas[id];
+ var checkBox = layerData.checkBox;
+ if(this._getCheckBoxValue(checkBox)) {
+ layerState[id] = {selected: true};
+ } else {
+ layerState[id] = {selected: false};
+ }
+ }
+ }
+ return layerState;
+ },
+
+ // layerState: {
+ // id: {
+ // selected: true/false
+ // }
+ // }
+ restoreState: function(layerState) {
+ this.layerState = this._clearLayerState(layerState);
+ for (var id in this._layerDatas) {
+ if(this._layerDatas.hasOwnProperty(id) &&
+ (typeof this._layerDatas[id] !== 'function')) {
+ var layerData = this._layerDatas[id];
+ var checkBox = layerData && layerData.checkBox;
+ var state = this.layerState[id];
+ if(state) {
+ checkBox.setValue(state.selected);
+ } else {
+ checkBox.setValue(this.layerStateController.getState(layerData.layerNode));
+ }
+ }
+ }
+ this.layerStateController.restoreState(this.layerState, this.layerStructure);
+ },
+
+ setViewMode: function(viewMode) {
+ for (var id in this._layerDatas) {
+ if(this._layerDatas.hasOwnProperty(id) &&
+ (typeof this._layerDatas[id] !== 'function')) {
+ var layerData = this._layerDatas[id];
+ var checkBox = layerData && layerData.checkBox;
+ if(viewMode === true) {
+ this.viewMode = true;
+ checkBox.setStatus(false);
+ } else {
+ this.viewMode = false;
+ checkBox.setStatus(true);
+ }
+ }
+ }
+ },
+
+ getSelectedLayerNodes: function() {
+ // some selected layers may have not been loaded.
+ var selectedLayerNodes = [];
+ var layerState = this.getState();
+ for (var id in layerState) {
+ if(layerState.hasOwnProperty(id) && (typeof layerState[id] !== 'function')) {
+ if(layerState[id].selected) {
+ var layerNode = this.layerStructure.getNodeById(id);
+ if(layerNode) {
+ selectedLayerNodes.push(layerNode);
+ }
+ }
+ }
+ }
+ return selectedLayerNodes;
+ },
+
+ getLoadedLayerNodes: function() {
+ var loadedLayerNodes = [];
+ for(var id in this._layerDatas) {
+ if(this._layerDatas.hasOwnProperty(id) && (typeof this._layerDatas[id] !== 'function')) {
+ var layerNode = this.layerStructure.getNodeById(id);
+ if(layerNode) {
+ loadedLayerNodes.push(layerNode);
+ }
+ }
+ }
+ return loadedLayerNodes;
+ },
+
+ getLayerAssociateDomNodesById: function(layerId) {
+ var domNodes = null;
+ var layerData = this._layerDatas[layerId];
+ if(layerData) {
+ domNodes = {
+ collapseIcon: layerData.collapseSpan,
+ checkBox: layerData.checkBox.domNode,
+ layerTypeIcon: layerData.iconSpan
+ };
+ }
+ return domNodes;
+ },
+
+ //compatible with the LayerChooserFromMap
+ //return an array, each element has 'name', 'url' and 'layerInfo' attribute
+ getSelectedItems: function(){
+ var handledItems = [];
+ handledItems = array.map(this.getSelectedLayerNodes(), function(layerNode) {
+ return {
+ name: layerNode.title,
+ url: layerNode.getUrl(),
+ layerInfo: layerNode._layerInfo
+ };
+ }, this);
+ return handledItems;
+ },
+
+ //compatible with the LayerChooserFromMap
+ //return an array, each element has 'name', 'url' and 'layerInfo' attribute
+ getAllItems: function(){
+ var handledItems = [];
+ return handledItems;
+ },
+
+
+ _clear:function(){
+ // clear this._layerDatas
+ this._layerDatas = {};
+
+ // clear this._eventHandles
+ array.forEach(this._eventHandles, function(eventHandle) {
+ eventHandle.remove();
+ }, this);
+ this._eventHandles = [];
+
+ // clear tree
+ html.empty(this.treeUl);
+ },
+
+ destroy: function(){
+ this._clear();
+
+ if(this.map) {
+ this.layerStructure.destroy();
+ }
+
+ if(this.shelter){
+ this.shelter.destroy();
+ this.shelter = null;
+ }
+
+ this.inherited(arguments);
+ },
+
+ /*****************************
+ * Events
+ *****************************/
+ _onCollapse: function(layerData) {
+ var displayOfSubLayerUl = html.getStyle(layerData.subLayerNodeUl, 'display');
+ var collapsed = (displayOfSubLayerUl === "none") ? true : false;
+ if(collapsed) {
+ html.setStyle(layerData.subLayerNodeUl, 'display', 'block');
+ html.addClass(layerData.collapseSpan, 'opened');
+ } else {
+ html.setStyle(layerData.subLayerNodeUl, 'display', 'none');
+ html.removeClass(layerData.collapseSpan, 'opened');
+ }
+
+ this._setIconImage(layerData, collapsed);
+
+ if(!layerData.hasBeenOpened) {
+ this._createLayerNodes(layerData.layerNode.getSubNodes(), layerData.subLayerNodeUl);
+ layerData.hasBeenOpened = true;
+ }
+
+ },
+
+ _onCheckBoxChange: function(layerData, evt) {
+ this.layerStateController.setState(layerData.layerNode, this._getCheckBoxValue(layerData.checkBox));
+ this.emit('selection-change', layerData.layerNode, this._getCheckBoxValue(layerData.checkBox));
+ this._onTreeClick(layerData, evt);
+ },
+
+ _onLayerInfosChanged: function() {
+ /*jshint unused: false*/
+ // need to filter the layer.
+ this._createTree();
+ this.emit('update');
+ },
+
+ _onLayerInfosIsShowInMapChanged: function(){
+ /*jshint unused: false*/
+ // need to filter the layer.
+ this._createTree();
+ this.emit('update');
+ },
+
+ //to be override
+ //send 'tree-click' event for compatible with the LayerChooserFromMap
+ _onTreeClick: function(layerData, evt){
+ /*jshint unused: false*/
+ var item = {
+ name: layerData.layerNode.title || "",
+ parent: null,
+ layerInfo: layerData.layerNode._layerInfo,
+ type: null,
+ layerClass: null,
+ id: null,
+ isLeaf: layerData.layerNode.isLeaf(),
+ hasChildren: layerData.layerNode.isLeaf() ? false : true
+ };
+ this.emit('tree-click', item, null, evt);
+ }
+ });
+
+ LayerChooser.LayerStateController = declare(null, {
+ // get state for single layer
+ getState: function(layerNode) {
+ /*jshint unused: false*/
+ return true;
+ },
+
+ // set state for single layer
+ setState: function(layerNode, selected) {
+ /*jshint unused: false*/
+ return this;
+ },
+
+ restoreState: function(layerState, layerStructure) {
+ /*jshint unused: false*/
+ return this;
+ }
+
+ });
+
+ LayerChooser.LayerVisibilityStateController = declare(LayerChooser.LayerStateController, {
+ getState: function(layerNode) {
+ return layerNode.isToggledOn();
+ },
+
+ setState: function(layerNode, selected) {
+ /*jshint unused: false*/
+ layerNode.toggle();
+ return this;
+ },
+
+ restoreState: function(layerState, layerStructure) {
+ var options = {layerOptions: {}};
+
+ for (var id in layerState) {
+ if(layerState.hasOwnProperty(id) &&
+ (typeof layerState[id] !== 'function')) {
+ var state = layerState[id];
+ options.layerOptions[id] = {visible: state.selected};
+ }
+ }
+
+ layerStructure.restoreState(options);
+ return this;
+ }
+ });
+ LayerChooser.layerVisibilityStateController = new LayerChooser.LayerVisibilityStateController();
+
+ LayerChooser.LayerLegendStateController = declare(LayerChooser.LayerStateController, {
+ getState: function(layerNode) {
+ //return layerNode.isToggledOnLegendFromWebMap();
+ return layerNode.isShowLegend();
+ }
+ });
+ LayerChooser.layerLegendStateController = new LayerChooser.LayerLegendStateController();
+
+ return LayerChooser;
+ });
diff --git a/app/jimu.js/dijit/LayerChooserFromMapWithDropbox.js b/app/jimu.js/dijit/LayerChooserFromMapWithDropbox.js
index 45e37a8..7d8d87d 100644
--- a/app/jimu.js/dijit/LayerChooserFromMapWithDropbox.js
+++ b/app/jimu.js/dijit/LayerChooserFromMapWithDropbox.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@ define([
'dojo/_base/lang',
'dojo/_base/html',
'dojo/on',
+ 'dojo/keys',
'dojo/Evented',
'dojo/Deferred',
'dijit/popup',
@@ -27,7 +28,8 @@ define([
'dojo/text!./templates/LayerChooserFromMapWithDropbox.html',
'jimu/LayerInfos/LayerInfos'
],
- function(declare, lang, html, on, Evented, Deferred, dojoPopup, _WidgetBase, _TemplatedMixin, template, LayerInfos) {
+ function(declare, lang, html, on, keys, Evented, Deferred, dojoPopup,
+ _WidgetBase, _TemplatedMixin, template, LayerInfos) {
return declare([_WidgetBase, _TemplatedMixin, Evented], {
templateString: template,
@@ -49,6 +51,11 @@ define([
//events:
//selection-change
+ postMixInProperties: function() {
+ this.inherited(arguments);
+ this.nls = window.jimuNls.queryableLayerSource;
+ },
+
postCreate: function() {
this.inherited(arguments);
this.layerInfosObj = LayerInfos.getInstanceSync();
@@ -58,6 +65,13 @@ define([
this.own(on(this.layerChooser, 'tree-click', lang.hitch(this, this._onTreeClick)));
this.own(on(this.layerChooser, 'update', lang.hitch(this, this._onLayerChooserUpdate)));
this.own(on(document.body, 'click', lang.hitch(this, this._onBodyClicked)));
+
+ //escape to hide layer chooser
+ this.own(on(this.layerChooser.domNode, 'keydown', lang.hitch(this, function(evt){
+ if(evt.keyCode === keys.ESCAPE){
+ this.hideLayerChooser();
+ }
+ })));
},
destroy: function(){
@@ -130,10 +144,17 @@ define([
if(this._isLayerChooserShow){
this.hideLayerChooser();
}else{
+ this.isActive = true;
this.showLayerChooser();
}
},
+ _onDropDownKeydown: function(evt){
+ if(evt.keyCode === keys.ENTER){
+ this._onDropDownClick(evt);
+ }
+ },
+
_getSelectedItems: function(){
var items = this.layerChooser.getSelectedItems();
return items;
@@ -144,7 +165,7 @@ define([
// if (width < 200) {
// width = 200;
// }
- this.layerChooser.domNode.style.width = width + 2 + "px";
+ this.layerChooser.domNode.style.minWidth = width + 2 + "px";
dojoPopup.open({
parent: this,
@@ -155,6 +176,7 @@ define([
var popupDom = this.layerChooser.domNode.parentNode;
if (popupDom) {
html.addClass(popupDom, 'jimu-layer-chooser-from-map-withdropbox-popup');
+ this.layerChooser.tree.domNode.focus();
}
this._isLayerChooserShow = true;
},
@@ -162,6 +184,10 @@ define([
hideLayerChooser: function() {
dojoPopup.close(this.layerChooser);
this._isLayerChooserShow = false;
+ if(this.isActive){
+ this.dropDownBtn.focus();
+ this.isActive = false;
+ }
},
_onLayerChooserUpdate: function(){
@@ -184,6 +210,7 @@ define([
this.hideLayerChooser();
var title = lang.getObject("layerInfo.title", false, this._selectedItem) || "";
this.layerNameNode.innerHTML = title;
+ html.setAttr(this.layerNameNode, 'title', title);
var layer = lang.getObject("layerInfo.layerObject", false, this._selectedItem);
if(isChanged){
@@ -197,4 +224,4 @@ define([
this._onSelectNewItem(selectedItem);
}
});
- });
\ No newline at end of file
+ });
diff --git a/app/jimu.js/dijit/LoadingIndicator.js b/app/jimu.js/dijit/LoadingIndicator.js
index a028261..4616751 100644
--- a/app/jimu.js/dijit/LoadingIndicator.js
+++ b/app/jimu.js/dijit/LoadingIndicator.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@ define(['dojo/_base/declare',
],
function(declare, _WidgetBase, domStyle, domConstruct) {
return declare(_WidgetBase, {
- 'baseClass': 'jimu-loading-indicator',
+ 'baseClass': 'jimu-loading-indicator jimu-agol-loading',
declaredClass: 'jimu.dijit.LoadingIndicator',
hidden:false,
@@ -35,8 +35,8 @@ function(declare, _WidgetBase, domStyle, domConstruct) {
}
domStyle.set(this.domNode, {width: '100%', height: '100%'});
- var str = '
';
+ var str = '
';
domConstruct.place(str, this.domNode);
},
@@ -44,14 +44,20 @@ function(declare, _WidgetBase, domStyle, domConstruct) {
if(!this.domNode){
return;
}
- domStyle.set(this.domNode, 'display', 'block');
+ if(this.hidden){
+ domStyle.set(this.domNode, 'display', 'block');
+ this.hidden = false;
+ }
},
hide:function(){
if(!this.domNode){
return;
}
- domStyle.set(this.domNode, 'display', 'none');
+ if(!this.hidden){
+ domStyle.set(this.domNode, 'display', 'none');
+ this.hidden = true;
+ }
}
});
});
\ No newline at end of file
diff --git a/app/jimu.js/dijit/LoadingShelter.js b/app/jimu.js/dijit/LoadingShelter.js
index 50c888b..4be330b 100644
--- a/app/jimu.js/dijit/LoadingShelter.js
+++ b/app/jimu.js/dijit/LoadingShelter.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@ define(['dojo/_base/declare',
],
function(declare, _WidgetBase, _TemplatedMixin, template, html) {
return declare([_WidgetBase, _TemplatedMixin], {
- 'baseClass': 'jimu-loading-shelter',
+ 'baseClass': 'jimu-loading-shelter jimu-agol-loading',
declaredClass: 'jimu.dijit.LoadingShelter',
templateString: template,
loadingText:null,
@@ -39,9 +39,8 @@ function(declare, _WidgetBase, _TemplatedMixin, template, html) {
html.setStyle(this.domNode, 'display', 'none');
}
html.setStyle(this.domNode, {width: '100%', height: '100%'});
- this.loadingImg.src = require.toUrl('jimu') + '/images/loading2.gif';
if(!this.showLoading){
- html.setStyle(this.imgDiv, 'display', 'none');
+ html.setStyle(this.loadingNode, 'display', 'none');
}
if(typeof this.loadingText === 'string'){
this.textNode.innerHTML = this.loadingText;
diff --git a/app/jimu.js/dijit/Message.js b/app/jimu.js/dijit/Message.js
index afcf31c..b2d59b9 100644
--- a/app/jimu.js/dijit/Message.js
+++ b/app/jimu.js/dijit/Message.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -42,8 +42,12 @@ define(['dojo/_base/declare',
maxWidth: 350,
maxHeight: 180,
+ customZIndex: null, //optional
+
postMixInProperties: function() {
this.content = this.message;
+ //register msg popup when app starts because cursor needs to focus it from other widget's first node.
+ window.currentMsgPopup = this;
},
_createTitleNode: function(){
@@ -56,9 +60,16 @@ define(['dojo/_base/declare',
innerHTML: this.titleLabel || ' '
}, this.titleNode);
this.closeBtnNode = html.create('div', {
- 'class': 'close-btn jimu-float-trailing'
+ 'class': 'close-btn jimu-icon jimu-icon-close jimu-float-trailing',
+ 'tabindex': 0
}, this.titleNode);
this.own(on(this.closeBtnNode, 'click', lang.hitch(this, this.close)));
+ this.own(on(this.closeBtnNode, 'keydown', lang.hitch(this, function(evt){
+ if(evt.keyCode === keys.ENTER){
+ this.close();
+ this.focusLastActiveNode();
+ }
+ })));
}
},
@@ -77,5 +88,6 @@ define(['dojo/_base/declare',
html.setStyle(this.domNode, 'zIndex', count + baseIndex + 1);
html.setStyle(this.overlayNode, 'zIndex', count + baseIndex);
}
+
});
});
\ No newline at end of file
diff --git a/app/jimu.js/dijit/PageUtils.js b/app/jimu.js/dijit/PageUtils.js
index e1860bd..eb8e6ec 100644
--- a/app/jimu.js/dijit/PageUtils.js
+++ b/app/jimu.js/dijit/PageUtils.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@ define([
* that template is used (eg: A3, A4, Letter etc), and for all other cases,
* where a matching template is not available, the "MAP_ONLY" template is used.
*/
- mo.PageSizes = { // to store the object containing page size like AO, A1, A2...
+ mo.PageSizes = { // to store the object containing page size like A0, A1, A2...
//Considered portrait sizes
"A0": {
"Height": 46.80, "Width": 33.10,
@@ -48,13 +48,18 @@ define([
"Height": 8.30, "Width": 5.80,
"SizeName": window.jimuNls.report.a5, "MapLayout": "MAP_ONLY" },
- "ANSI_A": {
+ "Letter_ANSI_A": {
"Height": 11.00, "Width": 8.50,
- "SizeName": window.jimuNls.report.ansi_a, "MapLayout": "Letter ANSI A"},
- "ANSI_B": {
+ "SizeName": window.jimuNls.report.letter + " " + window.jimuNls.report.ansi_a,
+ "MapLayout": "Letter ANSI A"
+ },
+
+ "Tabloid_ANSI_B": {
"Height": 17.00, "Width": 11.00,
- "SizeName": window.jimuNls.report.ansi_b, "MapLayout": "Tabloid ANSI B"
+ "SizeName": window.jimuNls.report.tabloid + " " + window.jimuNls.report.ansi_b,
+ "MapLayout": "Tabloid ANSI B"
},
+
"ANSI_C": {
"Height": 22.00, "Width": 17.00,
"SizeName": window.jimuNls.report.ansi_c, "MapLayout": "MAP_ONLY" },
@@ -65,26 +70,15 @@ define([
"Height": 44.00, "Width": 34.00,
"SizeName": window.jimuNls.report.ansi_e, "MapLayout": "MAP_ONLY" },
- "Letter": {
- "Height": 11.00, "Width": 8.50,
- "SizeName": window.jimuNls.report.letter, "MapLayout": "Letter ANSI A"
- },
-
"Legal": {
"Height": 14.00, "Width": 8.50,
"SizeName": window.jimuNls.report.legal, "MapLayout": "MAP_ONLY" },
- "Tabloid": {
- "Height": 17.00, "Width": 11.00,
- "SizeName": window.jimuNls.report.tabloid, "MapLayout": "Tabloid ANSI B"
- },
-
"Custom": window.jimuNls.common.custom
};
/**
* This function is used to get the report page size in pixels
- * @memberOf Screening/report/PageUtils
*/
mo.getPageSizeInPixels = function (sizeInInches, dpi) {
var sizeInPixels = {
diff --git a/app/jimu.js/dijit/Popup.js b/app/jimu.js/dijit/Popup.js
index 5baacde..2daaa4a 100644
--- a/app/jimu.js/dijit/Popup.js
+++ b/app/jimu.js/dijit/Popup.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,12 +14,15 @@
// limitations under the License.
///////////////////////////////////////////////////////////////////////////
-define(['dojo/_base/declare',
+define([
+ 'dojo/_base/declare',
'dojo/_base/lang',
+ 'dojo/Evented',
'dojo/_base/array',
'dojo/_base/html',
'dojo/_base/fx',
'dojo/on',
+ 'dojo/keys',
'dojo/sniff',
'dojo/touch',
'dojo/query',
@@ -27,11 +30,11 @@ define(['dojo/_base/declare',
'dijit/_WidgetBase',
'jimu/utils'
],
- function(declare, lang, array, html, baseFx, on, has, touch,
+ function(declare, lang, Evented, array, html, baseFx, on, keys, has, touch,
query, Move, _WidgetBase, jimuUtils) {
var count = 0;
/* global jimuConfig */
- return declare(_WidgetBase, {
+ return declare([_WidgetBase, Evented], {
//summary:
// show a popup window
declaredClass: 'jimu.dijit.Popup',
@@ -48,6 +51,8 @@ define(['dojo/_base/declare',
// this popup parent dom node
container: null,
+ customZIndex: null, //custom z-index
+
//buttons: Object[]
// this is the object format
/*=====
@@ -73,13 +78,31 @@ define(['dojo/_base/declare',
//If this function return false, the popup will not close
onClose: null,
- _fixedHeight: false,
+ _fixedHeight: false, //it's true only when height is numberical value.
// the height of Popup depends on the height of content
autoHeight: false,
+ isResize: true,
+
+ // the width of Popup depends on the windows.w.
+ // Its range is (0,1]
+ horizontalWidthRate: 0,
+
maxHeight: 800,
maxWidth: 1024,
+ //optional
+ enableMoveable: true,
+ hasTitle: true, //if false, no title bar and close btn
+ contentHasNoMargin: false, //no margin on content except margin-bottom is 3px.
+ hasOverlay: true, //if has overlay
+ moveToCenter: true,
+ //it works when moveToCenter is false. eg: {left: 1px, top: 1px, width: 100, height: 100}
+ //left and top are required, width and height are optional.
+ customPosition: null,
+ hiddenAfterInit: false,
+
+ useFocusLogic: true,
constructor: function() {
this.buttons = [];
@@ -89,7 +112,14 @@ define(['dojo/_base/declare',
this.container = jimuConfig.layoutId;
},
+ focusLastActiveNode: function(){
+ if(this.focusedNodeBeforeOpen && this.useFocusLogic){
+ this.focusedNodeBeforeOpen.focus();
+ }
+ },
+
postCreate: function() {
+ this.focusedNodeBeforeOpen = document.activeElement;
this._preProcessing();
this.inherited(arguments);
@@ -99,33 +129,51 @@ define(['dojo/_base/declare',
// this.domNode.tabIndex = 1;
// init dom node
this._initDomNode();
+ this._addStylesByHeightType();
//position the popup
- this._positioning();
+ this._calcAndSetPosition();
html.place(this.domNode, this.container);
- setTimeout(lang.hitch(this, function() {
- this._moveToMiddle();
+ //although this function only works when autoHeight is true.
+ //but we need it to trigger event 'popupHasInitedSuccessfully', so keep this setTimeout
+ // if(this.autoHeight){
+ setTimeout(lang.hitch(this, function() { //tolerance height
+ this._calcAndSetPosition(true, false);
+
+ //init focusable nodes
+ this.initFocusNodes();
}), 50);
- // this._moveToMiddle();
+ // }else{
+ // this._calcAndSetPosition(true, false);
+ // }
// this._limitButtonsMaxWidth();
- this.own(on(window, 'resize', lang.hitch(this, function() {
- if (this._fixedHeight || this.autoHeight) {
- this._calculatePosition();
+ if(this.isResize){
+ this.own(on(window, 'resize', lang.hitch(this, function() {
+ this._calcAndSetPosition(true, true);
+ })));
+ }
- this._moveToMiddle();
- return;
- }
- this._positioning();
- })));
+ if(this.hasOverlay){
+ this.overlayNode = html.create('div', {
+ 'class': 'jimu-overlay'
+ }, this.container);
+ }
- this.overlayNode = html.create('div', {
- 'class': 'jimu-overlay'
- }, this.container);
+ if(this.customZIndex || this.customZIndex === 0){//numberical value could be 0.
+ html.setStyle(this.domNode, 'zIndex', this.customZIndex + 1);
+ if(this.overlayNode){
+ html.setStyle(this.overlayNode, 'zIndex', this.customZIndex);
+ }
+ }else{
+ this._increaseZIndex();
+ }
- this._increaseZIndex();
+ if(this.hiddenAfterInit){
+ this.hide();
+ }
baseFx.animateProperty({
node: this.domNode,
@@ -135,10 +183,113 @@ define(['dojo/_base/declare',
duration: 200
}).play();
- this.domNode.focus();
+
+ html.setAttr(this.domNode, 'role', 'application');
+ this.own(on(this.domNode, 'keydown', lang.hitch(this, function(evt) {
+ if (evt.keyCode === keys.ESCAPE) {
+ this.close();
+ }
+ jimuUtils.preventMapNavigation(evt);
+ })));
+ },
+
+ initFocusNodes: function(){
+ if(this.useFocusLogic){
+ this.firstFocusNode = this._getFirstFocusNode();
+ this.lastFocusNode = this._getLastFocusNode();
+ if(this.firstFocusNode){
+ this.own(on(this.firstFocusNode, 'keydown', lang.hitch(this, function(evt) {
+ if(evt.shiftKey && evt.keyCode === keys.TAB) {
+ evt.preventDefault();
+ this.firstFocusNode.focus();
+ }
+ })));
+ this.firstFocusNode.focus();
+ }
+ if(this.lastFocusNode){
+ this.own(on(this.lastFocusNode, 'keydown', lang.hitch(this, function(evt) {
+ if(!evt.shiftKey && evt.keyCode === keys.TAB) {
+ evt.preventDefault();
+ this.firstFocusNode.focus();
+ }
+ })));
+ }
+ }
+ },
+
+ _getFirstFocusNode: function(){
+ var firstNode = this.closeBtnNode;
+ if(!firstNode){
+ if (typeof this.content !== 'string') {
+ var focusableNodes;
+ if(this.content.domNode) {
+ focusableNodes = jimuUtils.getFocusNodesInDom(this.content.domNode);
+ }else if (this.content.nodeType === 1) {
+ focusableNodes = jimuUtils.getFocusNodesInDom(this.content);
+ }
+ if(focusableNodes.length > 0 ){
+ firstNode = focusableNodes[0];
+ }else if(this.buttons.length){
+ firstNode = this._getFirstBtn();
+ }
+ }else if(this.buttons.length){
+ firstNode = this._getFirstBtn();
+ }
+ }
+ return firstNode;
+ },
+
+ _getLastFocusNode: function(){
+ var lastNode = this._getLastBtn();
+ if(!lastNode){
+ if(this.content && typeof this.content !== 'string') {
+ var focusableNodes;
+ if(this.content.domNode) {
+ focusableNodes = jimuUtils.getFocusNodesInDom(this.content.domNode);
+ }else if (this.content.nodeType === 1) {
+ focusableNodes = jimuUtils.getFocusNodesInDom(this.content);
+ }
+ if(focusableNodes.length > 0 ){
+ lastNode = focusableNodes[focusableNodes.length - 1];
+ }else{
+ lastNode = this.closeBtnNode;
+ }
+ }else{
+ lastNode = this.closeBtnNode;
+ }
+ }
+ return lastNode;
+ },
+
+ _getFirstBtn: function(){
+ var firstBtn = null;
+ var btns = query('.jimu-btn', this.buttonContainer);
+ for(var i = 0; i <= btns.length - 1; i++) {
+ if(html.getStyle(btns[i], 'display') !== 'none'){
+ firstBtn = btns[i];
+ break;
+ }
+ }
+ return firstBtn;
+ },
+
+ _getLastBtn: function(){
+ var lastBtn = null;
+ var btns = query('.jimu-btn', this.buttonContainer);
+ for(var i = btns.length - 1; i >= 0; i--) {
+ if(html.getStyle(btns[i], 'display') !== 'none'){
+ lastBtn = btns[i];
+ break;
+ }
+ }
+ return lastBtn;
},
_preProcessing: function() {
+ if (typeof this.width !== 'number') {
+ this.width = this.maxWidth;
+ }
+
if (typeof this.height === 'number') {
this._fixedHeight = true;
this.autoHeight = false;
@@ -158,7 +309,8 @@ define(['dojo/_base/declare',
innerHTML: this.titleLabel || ' '
}, this.titleNode);
this.closeBtnNode = html.create('div', {
- 'class': 'close-btn jimu-icon jimu-icon-close jimu-float-trailing'
+ 'class': 'close-btn jimu-icon jimu-icon-close jimu-float-trailing',
+ 'tabindex': 0
}, this.titleNode);
var eventName = null;
@@ -168,10 +320,17 @@ define(['dojo/_base/declare',
eventName = 'click';
}
this.own(on(this.closeBtnNode, eventName, lang.hitch(this, this.close)));
+ this.own(on(this.closeBtnNode, 'keydown', lang.hitch(this, function(evt){
+ if(evt.keyCode === keys.ENTER){
+ this.close();
+ }
+ })));
},
_initDomNode: function() {
- this._createTitleNode();
+ if(this.hasTitle){
+ this._createTitleNode();
+ }
this.contentContainerNode = html.create('div', {
'class': 'content'
@@ -196,7 +355,8 @@ define(['dojo/_base/declare',
html.setStyle(this.buttonContainer, 'display', 'none');
}
- for (var i = this.buttons.length - 1; i > -1; i--) {
+ // for (var i = this.buttons.length - 1; i > -1; i--) {
+ for(var i = 0; i <= this.buttons.length - 1; i++) {
this._createButton(this.buttons[i]);
if (this.buttons[i].disable) {
this.disableButton(i);
@@ -279,39 +439,109 @@ define(['dojo/_base/declare',
return footerBox;
},
- _calculatePosition: function() {
+ _calcAndSetPosition: function(ifSendEvent, ifResize) {
+ var selfBox = html.getMarginBox(this.domNode);
+
+ //because this method is called async, so the container may be destoryed before this.
+ if(typeof this.container === 'string' && !html.byId(this.container)){
+ return;
+ }
var box = html.getContentBox(this.container);
var headerBox = this._getHeaderBox(),
footerBox = this._getFooterBox();
var flexHeight = box.h - headerBox.h - footerBox.h - 40;
- var initHeight = 0;
- if (this._fixedHeight) {
- initHeight = this.height;
- } else if (this.autoHeight) {
- initHeight = flexHeight - 100 * 2; // tolerance
- } else {
- this.height = flexHeight > this.maxHeight ? this.maxHeight : flexHeight;
- initHeight = this.height;
+
+ var width = 0, height = 0;
+ if(this.customPosition && this.customPosition.height){
+ this.height = this.customPosition.height;
+ height = (typeof this.height === 'number') ? this.height + 'px' : this.height;
+ }else{
+ if (this._fixedHeight) {
+ //use flexH when height is out of bounds
+ this.height = this.height > flexHeight ? flexHeight : this.height;
+ } else if (this.autoHeight) {
+ var selfBoxH = selfBox.h > flexHeight ? flexHeight : selfBox.h;//out of bounds
+ this.height = selfBoxH || flexHeight - 100 * 2; // tolerance
+ } else {
+ this.height = flexHeight > this.maxHeight ? this.maxHeight : flexHeight;
+ }
+ height = this.height + 'px';
+ }
+
+ if(this.customPosition && this.customPosition.width){
+ this.width = this.customPosition.width;
+ width = (typeof this.width === 'number') ? this.width + 'px' : this.width;
+ }else{
+ // this.width = this.width || this.maxWidth;
+ // _calculateWidth
+ if (typeof this.horizontalWidthRate === 'number' && this.horizontalWidthRate > 0) {
+ var popupWidth = (html.getMarginBox(window.document.body).w) * this.horizontalWidthRate;
+ popupWidth = popupWidth > this.maxWidth ? popupWidth : this.maxWidth;
+ this.width = popupWidth;
+ }else{
+ this.width = this.width || this.maxWidth;
+ }
+ width = this.width + 'px';
+ }
+
+ var left = 0, top = 0;
+ if(this.customPosition){
+ left = (typeof this.customPosition.left === 'number') ?
+ this.customPosition.left + 'px' : this.customPosition.left;
+ top = (typeof this.customPosition.top === 'number') ?
+ this.customPosition.top + 'px' : this.customPosition.top;
+ }else if(this.moveToCenter){
+ top = (flexHeight - this.height) / 2 + headerBox.h + 20;
+ top = top < headerBox.h ? headerBox.h : top;
+ left = (box.w - this.width) / 2 + 'px';
+ top = top + 'px';
+ }
+
+ html.setStyle(this.domNode, {
+ width: width,
+ height: this.autoHeight ? 'auto' : height,
+ left: left,
+ top: top
+ });
+
+ if(this.enableMoveable){
+ this._moveableNode(this.width, 100);
+ }
+
+ // console.log("calc popup's position");
+ if(!this.moveToCenter && ifSendEvent && html.getStyle(this.domNode, 'display') === 'block'){
+ this.emit('popupHasInitedSuccessfully', ifResize);
}
+ },
+
+ setDomNodeStyls: function(stylesObj){
+ html.setStyle(this.domNode, stylesObj);
+ },
- var top = (flexHeight - initHeight) / 2 + headerBox.h + 20;
- top = top < headerBox.h ? headerBox.h : top;
+ setCustomPosition: function(left, top, width, height) {
+ this.width = width || this.width || this.maxWidth;
+ this.height = height || this.height || this.maxHeight;
- this.width = this.width || this.maxWidth;
- var left = (box.w - this.width) / 2;
+ left = (typeof left === 'number') ? left + 'px' : left;
+ top = (typeof top === 'number') ? top + 'px' : top;
+ width = (typeof this.width === 'number') ? this.width + 'px' : this.width;
+ height = (typeof this.height === 'number') ? this.height + 'px' : this.height;
html.setStyle(this.domNode, {
- left: left + 'px',
- top: top + 'px',
- width: this.width + 'px'
+ left: left,
+ top: top,
+ width: width,
+ height: this.autoHeight ? 'auto' : height
});
},
- _calculateHeight: function() {
+ _addStylesByHeightType: function() {
if (!this.autoHeight) { // position: absolute
- html.setStyle(this.domNode, 'height', this.height + 'px');
html.addClass(this.contentContainerNode, 'content-absolute');
+ if(!this.hasTitle){
+ html.addClass(this.contentContainerNode, 'no-popup-title-content-absolute');
+ }
html.addClass(this.buttonContainer, 'button-container-absolute');
if (this.buttons.length === 0) {
@@ -320,7 +550,6 @@ define(['dojo/_base/declare',
});
}
} else { // position: static
- html.setStyle(this.domNode, 'height', 'auto');
html.addClass(this.contentContainerNode, 'content-static');
if (this.buttons.length === 0) {
@@ -330,42 +559,17 @@ define(['dojo/_base/declare',
}
}
- this._moveableNode(this.width, 100);
- },
-
- _moveToMiddle: function() {
- if (this.autoHeight) {
- var selfBox = html.getMarginBox(this.domNode);
- var box = html.getContentBox(this.container);
- var headerBox = this._getHeaderBox(),
- footerBox = this._getFooterBox();
-
- var flexHeight = box.h - headerBox.h - footerBox.h - 40;
- var initHeight = 0;
- initHeight = selfBox.h || flexHeight - 100 * 2; // tolerance
-
- var top = (flexHeight - initHeight) / 2 + headerBox.h + 20;
- top = top < headerBox.h ? headerBox.h : top;
-
- var left = (box.w - this.width) / 2;
-
- html.setStyle(this.domNode, {
- left: left + 'px',
- top: top + 'px',
- width: this.width + 'px'
- });
+ if(this.contentHasNoMargin){
+ html.addClass(this.contentContainerNode, 'content-fill-Popup');
}
},
- _positioning: function() {
- this._calculatePosition();
- this._calculateHeight();
- },
-
_increaseZIndex: function() {
var baseIndex = 200;
html.setStyle(this.domNode, 'zIndex', count + baseIndex + 1);
- html.setStyle(this.overlayNode, 'zIndex', count + baseIndex);
+ if(this.overlayNode){
+ html.setStyle(this.overlayNode, 'zIndex', count + baseIndex);
+ }
count++;
},
@@ -381,6 +585,20 @@ define(['dojo/_base/declare',
html.setStyle(mover.node, 'opacity', 1);
},
+ show: function(){
+ if(this.overlayNode){
+ html.setStyle(this.overlayNode, 'display', 'block');
+ }
+ html.setStyle(this.domNode, 'display', 'block');
+ },
+
+ hide: function(){
+ if(this.overlayNode){
+ html.setStyle(this.overlayNode, 'display', 'none');
+ }
+ html.setStyle(this.domNode, 'display', 'none');
+ },
+
close: function() {
if (this.onClose && this.onClose() === false) {
return;
@@ -389,9 +607,13 @@ define(['dojo/_base/declare',
var parent = this.domNode.parentNode;
var cloneNode = lang.clone(this.domNode);
html.setStyle(this.domNode, 'display', 'none');
- html.destroy(this.overlayNode);
+ if(this.overlayNode){
+ html.destroy(this.overlayNode);
+ }
this.destroy();
- this.moveable.destroy();
+ if(this.moveable) {
+ this.moveable.destroy();
+ }
html.place(cloneNode, parent);
baseFx.animateProperty({
@@ -404,6 +626,10 @@ define(['dojo/_base/declare',
html.destroy(cloneNode);
}
}).play();
+
+ this.focusLastActiveNode();
+
+ window.currentMsgPopup = null;
},
addButton: function(btn) {
@@ -421,20 +647,22 @@ define(['dojo/_base/declare',
'class': 'jimu-btn jimu-popup-action-btn jimu-float-trailing jimu-trailing-margin1 ' +
appendedClasses,
'innerHTML': button.label,
+ 'tabindex': 0,
'title': button.title || button.label
}, this.buttonContainer);
- this.enabledButtons.unshift(node);
+ this.enabledButtons.push(node);
var disableNode = html.create('div', {
'class': 'jimu-btn jimu-state-disabled jimu-float-trailing jimu-trailing-margin1 ' +
appendedClasses,
'title': button.title || button.label,
'innerHTML': button.label,
+ 'tabindex': 0,
'style': {
display: 'none'
}
}, this.buttonContainer);
- this.disabledButtons.unshift(disableNode);
+ this.disabledButtons.push(disableNode);
this.own(on(node, 'click', lang.hitch(this, function(evt) {
//we don't close popup because that maybe the
@@ -445,23 +673,16 @@ define(['dojo/_base/declare',
this.close();
}
})));
- // var existKey = false;
- // if (typeof button.key === 'number') {
- // for (var attr in keys) {
- // if (keys[attr] === button.key) {
- // existKey = true;
- // break;
- // }
- // }
- // }
- // if (existKey) {
- // this.own(on(this.domNode, 'keydown', lang.hitch(this, function(event) {
- // var keyCode = event.keyCode !== undefined ? event.keyCode : event.which;
- // if (keyCode === button.key && this.pauseKeys.indexOf(keyCode) === -1) {
- // node.click();
- // }
- // })));
- // }
+
+ this.own(on(node, 'keydown', lang.hitch(this, function(evt) {
+ if(evt.keyCode === 13){
+ if (button.onClick) {
+ button.onClick(evt);
+ } else {
+ this.close();
+ }
+ }
+ })));
},
setButtonProps: function(idx, props) {
@@ -566,6 +787,21 @@ define(['dojo/_base/declare',
html.setStyle(itm, 'display', 'none');
}));
}
+ },
+
+ //custom resize popup's width and height
+ resize: function(size){
+ // console.log('function - resize');
+ if(size){
+ this.width = size.w;
+ this.height = size.h;
+ }
+
+ this._calcAndSetPosition();
+
+ if (this.content && this.content.domNode && this.content.resize){
+ this.content.resize();
+ }
}
});
});
\ No newline at end of file
diff --git a/app/jimu.js/dijit/PopupConfig.js b/app/jimu.js/dijit/PopupConfig.js
index 7ac2f70..e94292e 100644
--- a/app/jimu.js/dijit/PopupConfig.js
+++ b/app/jimu.js/dijit/PopupConfig.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/app/jimu.js/dijit/QRCode.js b/app/jimu.js/dijit/QRCode.js
index 2277b87..836ea0d 100644
--- a/app/jimu.js/dijit/QRCode.js
+++ b/app/jimu.js/dijit/QRCode.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/app/jimu.js/dijit/QueryableLayerChooserFromMap.js b/app/jimu.js/dijit/QueryableLayerChooserFromMap.js
index e606bd6..5336a64 100644
--- a/app/jimu.js/dijit/QueryableLayerChooserFromMap.js
+++ b/app/jimu.js/dijit/QueryableLayerChooserFromMap.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -15,15 +15,21 @@
///////////////////////////////////////////////////////////////////////////
define([
+ 'dojo/_base/lang',
+ 'dojo/_base/html',
'dojo/_base/declare',
- './LayerChooserFromMap',
- 'dojo/_base/html'
+ './LayerChooserFromMap'
],
-function(declare, LayerChooserFromMap, html) {
+function(lang, html, declare, LayerChooserFromMap) {
return declare([LayerChooserFromMap], {
baseClass: 'jimu-queryable-layer-chooser-from-map',
declaredClass: 'jimu.dijit.QueryableLayerChooserFromMap',
+ //options:
+ showImageLayer: true,
+ mustSupportStatistics: false,
+ ignoreVirtualLayer: false,
+
//public methods:
//getSelectedItems return [{name, url, layerInfo}]
@@ -32,7 +38,28 @@ function(declare, LayerChooserFromMap, html) {
postMixInProperties:function(){
this.inherited(arguments);
- this.filter = LayerChooserFromMap.createQueryableLayerFilter();
+
+ if(this.showImageLayer){
+ this.filter = LayerChooserFromMap.createQueryableLayerFilter(this.mustSupportStatistics);
+ }else{
+ this.filter = LayerChooserFromMap.createFeaturelayerFilter(
+ ['point', 'polyline', 'polygon'], false, true, this.mustSupportStatistics
+ );
+ }
+
+ if(this.ignoreVirtualLayer){
+ this.filter = LayerChooserFromMap.andCombineFilters(
+ [this.filter, lang.hitch(this, this._ignoreVirtualLayerFilter)]
+ );
+ }
+ },
+
+ _ignoreVirtualLayerFilter: function(layerInfo){
+ return layerInfo.getLayerType().then(function(layerType) {
+ var virtualLayer = layerType === 'ArcGISDynamicMapServiceLayer' ||
+ layerType === 'ArcGISTiledMapServiceLayer' || layerType === 'GroupLayer';
+ return !virtualLayer;
+ });
},
postCreate: function(){
diff --git a/app/jimu.js/dijit/QueryableLayerSource.js b/app/jimu.js/dijit/QueryableLayerSource.js
index e923f4f..f070ccd 100644
--- a/app/jimu.js/dijit/QueryableLayerSource.js
+++ b/app/jimu.js/dijit/QueryableLayerSource.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -15,96 +15,24 @@
///////////////////////////////////////////////////////////////////////////
define([
+ 'dojo/on',
+ 'dojo/Evented',
+ 'dojo/_base/lang',
+ 'dojo/_base/html',
'dojo/_base/declare',
'dijit/_WidgetBase',
'dijit/_TemplatedMixin',
'dijit/_WidgetsInTemplateMixin',
'dojo/text!./templates/QueryableLayerSource.html',
- 'dojo/_base/lang',
- 'dojo/_base/html',
- 'dojo/on',
- 'dojo/Evented',
- 'jimu/dijit/QueryableLayerChooserFromMap',
+ 'dijit/form/RadioButton',
+ 'jimu/dijit/_QueryableLayerChooserWithButtons',
'jimu/dijit/QueryableServiceChooserFromPortal',
'jimu/dijit/_QueryableServiceChooserContent',
'jimu/portalUrlUtils'
],
-function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
- template, lang, html, on, Evented, QueryableLayerChooserFromMap,
- QueryableServiceChooserFromPortal, _QueryableServiceChooserContent, portalUrlUtils) {
-
- //define private dijit QueryableLayerChooserWithButtons
- var baseClassArr = [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, Evented];
- var QueryableLayerChooserWithButtons = declare(baseClassArr, {
- baseClass: 'jimu-layer-chooser-with-buttons jimu-queryable-layer-chooser-with-buttons',
- declaredClass: 'jimu.dijit.QueryableLayerChooserWithButtons',
- templateString: '
',
-
- queryableLayerChooserArgs: null,
-
- //events:
- //ok
- //cancel
-
- //public methods:
- //getSelectedItems
-
- postMixInProperties: function(){
- this.nls = lang.clone(window.jimuNls.common);
- },
-
- postCreate: function(){
- this.inherited(arguments);
- var args = this.queryableLayerChooserArgs;
- this.queryableLayerChooserFromMap = new QueryableLayerChooserFromMap(args);
- this.queryableLayerChooserFromMap.placeAt(this.chooserContainer);
- html.setStyle(this.queryableLayerChooserFromMap.domNode, {
- width: '100%',
- height: '100%'
- });
-
- this.own(on(this.queryableLayerChooserFromMap, 'tree-click', lang.hitch(this, function(){
- var items = this.getSelectedItems();
- if(items.length > 0){
- html.removeClass(this.btnOk, 'jimu-state-disabled');
- }
- else{
- html.addClass(this.btnOk, 'jimu-state-disabled');
- }
- })));
-
- this.own(on(this.btnOk, 'click', lang.hitch(this, function(){
- var items = this.getSelectedItems();
- if(items.length > 0){
- this.emit('ok', items);
- }
- })));
-
- this.own(on(this.btnCancel, 'click', lang.hitch(this, function(){
- this.emit('cancel');
- })));
- },
-
- getSelectedItems: function(){
- return this.queryableLayerChooserFromMap.getSelectedItems();
- },
-
- startup: function(){
- this.inherited(arguments);
- this.queryableLayerChooserFromMap.startup();
- }
- });
+function(on, Evented, lang, html, declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, template,
+ RadioBtn, QueryableLayerChooserWithButtons, QueryableServiceChooserFromPortal, _QueryableServiceChooserContent,
+ portalUrlUtils) {
return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, Evented], {
templateString: template,
@@ -117,12 +45,13 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
//QueryableLayerChooserFromMap options
createMapResponse: null,
+ mustSupportStatistics: false,
//QueryableServiceChooserFromPortal options
portalUrl: null,
//public methods:
- //getSelectedItems
+ //getSelectedItems: return items, [{name,url,definition, /*optional*/ portalUrl, /*optional*/ itemId}]
//getSelectedRadioType
//events:
@@ -191,10 +120,10 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
width: '100%',
height: '100%'
},
- queryableLayerChooserArgs:{
- multiple: this.multiple,
- createMapResponse: this.createMapResponse
- }
+ multiple: this.multiple,
+ createMapResponse: this.createMapResponse,
+ mustSupportStatistics: this.mustSupportStatistics,
+ onlyShowWebMapLayers: true
};
this.queryableLayerChooserFromMap = new QueryableLayerChooserWithButtons(args1);
this.queryableLayerChooserFromMap.operationTip = this.nls.selectLayer;
@@ -278,18 +207,44 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
},
_initRadios: function(){
- var name = "queryableLayerSourceRadios_" + this._getRandomString();
- this.mapRadio.name = name;
- html.setAttr(this.mapRadio, 'id', "mapRadio_" + this._getRandomString());
- html.setAttr(this.mapLabel, 'for', this.mapRadio.id);
-
- this.portalRadio.name = name;
- html.setAttr(this.portalRadio, 'id', "portalRadio_" + this._getRandomString());
- html.setAttr(this.portalLabel, 'for', this.portalRadio.id);
-
- this.urlRadio.name = name;
- html.setAttr(this.urlRadio, 'id', "urlRadio_" + this._getRandomString());
- html.setAttr(this.urlLabel, 'for', this.urlRadio.id);
+ var group = "queryableLayerSourceRadios_" + this._getRandomString();
+ var radioChangeHandler = lang.hitch(this, this._onRadioClicked);
+
+ this.mapRadio = new RadioBtn({
+ name: group,
+ style:"margin-bottom: 1px;",
+ checked: true
+ });
+ this.own(on(this.mapRadio, 'change', radioChangeHandler));
+ this.mapRadio.placeAt(this.mapTd, 'first');
+
+ this.portalRadio = new RadioBtn({
+ name: group,
+ style:"margin-bottom: 1px;",
+ checked: false
+ });
+ this.own(on(this.portalRadio, 'change', radioChangeHandler));
+ this.portalRadio.placeAt(this.portalTd, 'first');
+
+ this.urlRadio = new RadioBtn({
+ name: group,
+ style:"margin-bottom: 1px;",
+ checked: false
+ });
+ this.own(on(this.urlRadio, 'change', radioChangeHandler));
+ this.urlRadio.placeAt(this.urlTd, 'first');
+
+ this.own(on(this.mapLabel, 'click', lang.hitch(this, function(){
+ this.mapRadio.set('checked', true);
+ })));
+
+ this.own(on(this.portalLabel, 'click', lang.hitch(this, function(){
+ this.portalRadio.set('checked', true);
+ })));
+
+ this.own(on(this.urlLabel, 'click', lang.hitch(this, function(){
+ this.urlRadio.set('checked', true);
+ })));
},
_getRandomString: function(){
diff --git a/app/jimu.js/dijit/QueryableServiceBrowser.js b/app/jimu.js/dijit/QueryableServiceBrowser.js
index 30247ce..a74ab75 100644
--- a/app/jimu.js/dijit/QueryableServiceBrowser.js
+++ b/app/jimu.js/dijit/QueryableServiceBrowser.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/app/jimu.js/dijit/QueryableServiceChooserFromPortal.js b/app/jimu.js/dijit/QueryableServiceChooserFromPortal.js
index 196d6e9..62f1998 100644
--- a/app/jimu.js/dijit/QueryableServiceChooserFromPortal.js
+++ b/app/jimu.js/dijit/QueryableServiceChooserFromPortal.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -119,8 +119,13 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, templat
},
_onBtnOkClicked: function(){
+ var portalItem = this.selector.getSelectedItem();
var items = this.getSelectedItems();
- if(items.length > 0){
+ if(portalItem && items.length > 0){
+ array.forEach(items, lang.hitch(this, function(item){
+ item.portalUrl = portalItem.portalUrl;
+ item.itemId = portalItem.id;
+ }));
this.emit('ok', items);
}
},
diff --git a/app/jimu.js/dijit/RadioBtn.js b/app/jimu.js/dijit/RadioBtn.js
index 7226283..5778f9c 100644
--- a/app/jimu.js/dijit/RadioBtn.js
+++ b/app/jimu.js/dijit/RadioBtn.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/app/jimu.js/dijit/RelationshipConfig.js b/app/jimu.js/dijit/RelationshipConfig.js
index e27fcd7..0e4562b 100644
--- a/app/jimu.js/dijit/RelationshipConfig.js
+++ b/app/jimu.js/dijit/RelationshipConfig.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/app/jimu.js/dijit/RendererChooser.js b/app/jimu.js/dijit/RendererChooser.js
index 1411ce3..34b0881 100644
--- a/app/jimu.js/dijit/RendererChooser.js
+++ b/app/jimu.js/dijit/RendererChooser.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -34,6 +34,7 @@ define([
'esri/renderers/ClassBreaksRenderer',
'esri/symbols/jsonUtils',
'esri/symbols/SimpleMarkerSymbol',
+ 'jimu/dijit/CheckBox',
'dijit/form/Select',
'dijit/form/ComboBox',
'dijit/form/NumberSpinner',
@@ -43,7 +44,7 @@ define([
function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
template, lang, html, array, on, query, gfx, Color,
symbolUtils, rendererUtils, SimpleRenderer, UniqueValueRenderer,
- ClassBreaksRenderer, jsonUtils, SimpleMarkerSymbol) {
+ ClassBreaksRenderer, jsonUtils, SimpleMarkerSymbol, CheckBox) {
return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
templateString: template,
@@ -112,6 +113,7 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
_selectedUniqueValueTr:null,
_selectedClassBreakTr:null,
_isDrawing:false,
+ _showOthersSymbol: true,
_jimuUrl:window.location.protocol + "//" + window.location.host + require.toUrl("jimu"),
postMixInProperties:function(){
@@ -126,12 +128,16 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
this.inherited(arguments);
this._initFields();
this.own(on(this.rendererSelect, 'change', lang.hitch(this, this._onRendererSelectChange)));
- this.own(on(this.btnDefaultSym, 'click', lang.hitch(this, this._showDefaultSymbol)));
this.own(on(this.defaultSymbolChooser, 'change', lang.hitch(this, this._onDefaultSymbolChange)));
this.own(on(this.selectedSymbolChooser, 'change', lang.hitch(this, this._onSelectedSymbolChange)));
this._bindUniqueSettingEvents();
this._bindClassBreaksEvents();
if(this.renderer){
+ if (!this.renderer.defaultSymbol) {
+ this._showOthersSymbol = false;
+ } else {
+ this._showOthersSymbol = true;
+ }
this.showByRenderer(this.renderer);
}
else if(this.type){
@@ -167,6 +173,10 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
this.renderer = renderer;
this.type = null;
var defaultSymbol = this.renderer && (this.renderer.defaultSymbol || this.renderer.symbol);
+ if (!defaultSymbol && this.renderer && this.renderer.infos && this.renderer.infos.length > 0) {
+ // Take the first one as default symbol, since some functionality doesn't work without this.
+ defaultSymbol = this.renderer.infos[0].symbol;
+ }
this._setDefaultSymbol(defaultSymbol);
this._updateRendererSelect();
@@ -230,23 +240,44 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
}
},
+ _getDefaultSymbolTr: function() {
+ var value = this.rendererSelect.get('value');
+ var targetNode;
+ if (value === 'unique') {
+ targetNode = this.uniqueSysTbody;
+ } else if (value === 'color' || value === 'size') {
+ targetNode = this.classBreaksTbody;
+ }
+ if (!targetNode) {
+ return null;
+ }
+ var symbolTrs = query('.default-symbol-tr', targetNode);
+ if (symbolTrs.length === 0) {
+ return null;
+ }
+ return symbolTrs[0];
+ },
+
_onDefaultSymbolChange: function(newSymbol){
- html.empty(this.defaultSymPreviewDiv);
- if(newSymbol){
- var symbolNode = null;
- if(symbolUtils.isSimpleLineSymbol(newSymbol) ||
- symbolUtils.isCartographicLineSymbol(newSymbol)){
- symbolNode = symbolUtils.createSymbolNode(newSymbol, {
- width: 80,
- height: 30
- });
- }
- else{
- symbolNode = symbolUtils.createSymbolNode(newSymbol);
- }
+ var tr = this._getDefaultSymbolTr();
+ if(tr){
+ tr.symbol = newSymbol;
+ var symbolDiv = query('.symbol-div', tr)[0];
+ this._drawSymbolPreview(symbolDiv, newSymbol);
+ }
+ },
- if(symbolNode){
- html.place(symbolNode, this.defaultSymPreviewDiv);
+ _setDefaultSymbolStatus: function(status) {
+ var tr = this._getDefaultSymbolTr();
+ if(tr){
+ if (tr.checkbox.getStatus() !== status) {
+ if (status) {
+ tr.checkbox.setStatus(status);
+ } else {
+ this._showOthersSymbol = true;
+ tr.checkbox.setValue(true);
+ tr.checkbox.setStatus(status);
+ }
}
}
},
@@ -291,6 +322,7 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
_onRendererSelectChange:function(){
var value = this.rendererSelect.get('value');
+ this._showDefaultSymbol();
if(value === 'simple'){
html.setStyle(this.fieldSelectTr, 'display', 'none');
html.setStyle(this.colorBlockTr, 'display', 'none');
@@ -299,7 +331,6 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
html.setStyle(this.classCountTr, 'display', 'none');
html.setStyle(this.uniqueSetting, 'display', 'none');
html.setStyle(this.classBreaksSetting, 'display', 'none');
- html.setStyle(this.defaultSymPreview, 'display', 'none');
html.setStyle(this.symbolSizeDomainTr, 'display', 'none');
}
else if(value === 'unique'){
@@ -310,7 +341,6 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
html.setStyle(this.classCountTr, 'display', 'none');
html.setStyle(this.uniqueSetting, 'display', 'block');
html.setStyle(this.classBreaksSetting, 'display', 'none');
- html.setStyle(this.defaultSymPreview, 'display', 'block');
html.setStyle(this.symbolSizeDomainTr, 'display', 'none');
this._updateUniqueValueDivVisibility();
}
@@ -321,7 +351,6 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
html.setStyle(this.domainTr, 'display', 'table-row');
html.setStyle(this.colorBarTr, 'display', 'table-row');
html.setStyle(this.uniqueSetting, 'display', 'none');
- html.setStyle(this.defaultSymPreview, 'display', 'block');
html.setStyle(this.symbolSizeDomainTr, 'display', 'none');
this._updateClassBreaksSettingVisibility();
}
@@ -332,7 +361,6 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
html.setStyle(this.domainTr, 'display', 'table-row');
html.setStyle(this.classCountTr, 'display', 'table-row');
html.setStyle(this.uniqueSetting, 'display', 'none');
- html.setStyle(this.defaultSymPreview, 'display', 'block');
html.setStyle(this.symbolSizeDomainTr, 'display', 'table-row');
this._updateClassBreaksSettingVisibility();
}
@@ -493,12 +521,13 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
array.forEach(renderer.infos, lang.hitch(this, function(info){
this._addUniqueValueTr(info.symbol, info.value, info.label || info.value);
}));
+ this._addDefaultValueTr(this.uniqueSysTbody);
},
_getUniqueValueRenderer:function(){
var defaultSym = this.defaultSymbolChooser.getSymbol();
var field = this.fieldComboBox.get('value');
- var renderer = new UniqueValueRenderer(defaultSym, field);
+ var renderer = new UniqueValueRenderer(this._showOthersSymbol ? defaultSym : null, field);
var trs = query('.unique-symbol-tr', this.uniqueSysTbody);
array.forEach(trs, lang.hitch(this, function(tr){
renderer.addValue({
@@ -571,6 +600,7 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
var color = colors[colorIndex];
var symbol = this._getUniqueSymbol(color);
this._addUniqueValueTr(symbol, uniqueValue, uniqueValue);
+ this._setDefaultSymbolStatus(true);
}
this.uniqueEditValue.value = '';
},
@@ -590,7 +620,12 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
'' +
'';
var trDom = html.toDom(s);
- html.place(trDom, this.uniqueSysTbody);
+ var defaultSymbolTr = query('.default-symbol-tr', this.uniqueSysTbody);
+ if (defaultSymbolTr.length > 0) {
+ html.place(trDom, defaultSymbolTr[0], 'before');
+ } else {
+ html.place(trDom, this.uniqueSysTbody);
+ }
this._updateUniqueSymTableStyle();
var symbolDiv = query('.symbol-div', trDom)[0];
var labelDiv = query('.label-div', trDom)[0];
@@ -617,7 +652,7 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
},
_selectUniqueValueTr:function(tr){
- query('.unique-symbol-tr', this.uniqueSysTbody).removeClass('selected');
+ query('tr', this.uniqueSysTbody).removeClass('selected');
html.addClass(tr, 'selected');
this._selectedUniqueValueTr = tr;
this.uniqueSelectedValue.value = tr.value;
@@ -664,9 +699,16 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
},
_updateUniqueValueDivVisibility:function(){
- var trs = query('.unique-symbol-tr', this.uniqueSysTbody);
- var display = trs.length === 0 ? 'none' : 'block';
- html.setStyle(this.uniqueValueDiv, 'display', display);
+ var trs = query('tr', this.uniqueSysTbody);
+ if (trs.length === 0) {
+ this._addDefaultValueTr(this.uniqueSysTbody);
+ this._setDefaultSymbolStatus(false);
+ } else if (trs.length === 1 && html.hasClass(trs[0], 'default-symbol-tr')) {
+ this._setDefaultSymbolStatus(false);
+ }
+ trs.removeClass('selected');
+ query('.default-symbol-tr', this.uniqueSysTbody).addClass('selected');
+ html.setStyle(this.uniqueValueDiv, 'display', 'block');
},
/* class breaks renderer */
@@ -704,6 +746,7 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
}));
this.minDomain.set('value', min);
this.maxDomain.set('value', max);
+ this._addDefaultValueTr(this.classBreaksTbody);
if(this.type === 'marker'){
var minSymSize = Infinity, maxSymSize = -Infinity;
@@ -728,7 +771,7 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
_getClassBreaksRenderer:function(){
var defaultSym = this.defaultSymbolChooser.getSymbol();
var field = this.fieldComboBox.get('value');
- var renderer = new ClassBreaksRenderer(defaultSym, field);
+ var renderer = new ClassBreaksRenderer(this._showOthersSymbol ? defaultSym : null, field);
var trs = query('.class-breaks-tr', this.classBreaksTbody);
array.forEach(trs, lang.hitch(this, function(tr){
renderer.addBreak({
@@ -761,7 +804,7 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
this.selectedTo.set('value', to);
}
var tr = this._selectedClassBreakTr;
- if(tr){
+ if(tr && (tr.from !== from || tr.to !== to)){ // update label only when range changed
tr.from = from;
tr.to = to;
var label = from + " — " + to;
@@ -833,11 +876,12 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
var label = from + " — " + to;
this._addClassBreaksTr(symbols[i], from, to, label);
}
+ this._addDefaultValueTr(this.classBreaksTbody);
this._updateClassBreaksSettingVisibility();
},
_selectClassBreaksTr:function(tr){
- var trs = query('.class-breaks-tr', this.classBreaksTbody);
+ var trs = query('tr', this.classBreaksTbody);
trs.removeClass('selected');
html.addClass(tr, 'selected');
this._selectedClassBreakTr = tr;
@@ -865,7 +909,12 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
'' +
'';
var tr = html.toDom(s);
- html.place(tr, this.classBreaksTbody);
+ var defaultSymbolTr = query('.default-symbol-tr', this.classBreaksTbody);
+ if (defaultSymbolTr.length > 0) {
+ html.place(tr, defaultSymbolTr[0], 'before');
+ } else {
+ html.place(tr, this.classBreaksTbody);
+ }
tr.symbol = symbol;
tr.from = from;
tr.to = to;
@@ -891,12 +940,64 @@ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin,
html.setStyle(this.classBreaksSetting, 'display', 'block');
},
+ _addDefaultValueTr:function(targetNode){
+ var node = query('.default-symbol-tr', targetNode);
+ if (node.length > 0) {
+ return;
+ }
+ var s = '', symbol = this.defaultSymbolChooser.getSymbol(), label = this.nls.defaultSymbol;
+ s = '
' +
+ '' +
+ '' +
+ ' | ' +
+ '' +
+ '' +
+ ' | ' +
+ '' +
+ '' +
+ ' | ' +
+ '
';
+ var trDom = html.toDom(s);
+ html.place(trDom, targetNode);
+ var symbolDiv = query('.symbol-div', trDom)[0];
+ var labelDiv = query('.label-div', trDom)[0];
+ var checkDiv = query('.check-div', trDom)[0];
+ html.setAttr(checkDiv, 'title', this.nls.othersSymbolTip);
+ var checkbox = new CheckBox({
+ checked: this._showOthersSymbol
+ });
+ checkbox.placeAt(checkDiv);
+ checkbox.startup();
+ labelDiv.innerHTML = this.nls.othersSymbol;
+ this.own(on(trDom, 'click', lang.hitch(this, function(){
+ var trs = query('tr', targetNode);
+ trs.removeClass('selected');
+ html.addClass(trDom, 'selected');
+ this._showDefaultSymbol();
+ })));
+ this.own(on(checkbox, 'change', lang.hitch(this, function(checked){
+ this._showOthersSymbol = checked;
+ })));
+ this._drawSymbolPreview(symbolDiv, symbol);
+ trDom.symbol = symbol;
+ trDom.label = label;
+ trDom.checkbox = checkbox;
+ html.setStyle(this.uniqueValueDiv, 'display', 'block');
+ },
+
_updateClassBreaksTableStyle:function(){},
_updateClassBreaksSettingVisibility:function(){
- var trs = query('.class-breaks-tr', this.classBreaksTbody);
- var display = trs.length === 0 ? 'none' : 'block';
- html.setStyle(this.classBreaksSetting, 'display', display);
+ var trs = query('tr', this.classBreaksTbody);
+ if (trs.length === 0) {
+ this._addDefaultValueTr(this.classBreaksTbody);
+ this._setDefaultSymbolStatus(false);
+ } else if (trs.length === 1 && html.hasClass(trs[0], 'default-symbol-tr')) {
+ this._setDefaultSymbolStatus(false);
+ }
+ trs.removeClass('selected');
+ query('.default-symbol-tr', this.classBreaksTbody).addClass('selected');
+ html.setStyle(this.classBreaksSetting, 'display', 'block');
},
//color
diff --git a/app/jimu.js/dijit/Report.js b/app/jimu.js/dijit/Report.js
index 797c6c2..853f7da 100644
--- a/app/jimu.js/dijit/Report.js
+++ b/app/jimu.js/dijit/Report.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -13,9 +13,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////////
+/**
+ * For additional guidance please refer : http://links.esri.com/WAB/ReportDijit
+ */
define([
'dojo/_base/declare',
'jimu/BaseWidget',
+ 'jimu/utils',
'dojo/Evented',
'./PageUtils',
'dojo/text!./templates/ReportTemplate.html',
@@ -27,12 +31,14 @@ define([
'dojo/dom-style',
'dojo/dom',
'dojo/string',
+ 'dojo/on',
'esri/tasks/PrintParameters',
'esri/tasks/PrintTemplate',
'esri/tasks/PrintTask'
], function (
declare,
BaseWidget,
+ jimuUtils,
Evented,
PageUtils,
ReportTemplate,
@@ -44,6 +50,7 @@ define([
domStyle,
dom,
string,
+ on,
PrintParameters,
PrintTemplate,
PrintTask
@@ -53,14 +60,16 @@ define([
_printService: null, // to store the object of print service
_printWindow: null, // to store the object of print window
_sizeInPixels: {}, // to store size of report layout in pixels
- _shownUnableToPrintMapMsg: false, // When multiple maps are failed to print we need to show msg only once, this flag will help in showing msg only once
+ _windowOpenedTimer: null, // to store the interval object which checks whether print window is closed
+ // When multiple maps are failed to print we need to show msg only once,
+ // this flag will help in showing msg only once
+ _shownUnableToPrintMapMsg: false,
//options:
printTaskUrl: null, // to store the print task URL
reportLogo: "", // to store path to report logo
reportLayout: {}, // to store the report layout
- tableCols: 3, // to store table columns
- alignNumbersToRight: false, // to store the default number alignment
+ maxNoOfCols: 3, // to store table columns
styleSheets: [], // to store the external stylesheets
styleText: "", // to store style text
@@ -90,13 +99,7 @@ define([
"orientation": PageUtils.Orientation.Portrait
};
this.inherited(arguments);
- if (this._validateParameters(this.reportLayout)) {
- //mixin the user defined properties for reportLayout
- this.reportLayout = lang.mixin(defaultReportLayout, this.reportLayout);
- }
- else {
- this.reportLayout = defaultReportLayout;
- }
+ this.setReportLayout(this.reportLayout, defaultReportLayout);
//Set report page layout dpi to 96
this.reportLayout.dpi = 96;
//if print task url is defined use it and create print task object
@@ -105,12 +108,29 @@ define([
}
},
+ /**
+ * This function is used to set the report layout as per the configuration
+ */
+ setReportLayout: function (newLayout, defaultReportLayout) {
+ //if default report layout is not set, use current layout as default
+ if (!defaultReportLayout) {
+ defaultReportLayout = this.reportLayout;
+ }
+ //validate and mixin the new layout parameters
+ if (this._validateParameters(newLayout)) {
+ //mixin the user defined properties for reportLayout
+ this.reportLayout = lang.mixin(defaultReportLayout, newLayout);
+ }
+ else {
+ this.reportLayout = defaultReportLayout;
+ }
+ },
+
/**
* This function is used to set the map layout in printTemplate object
* according to selected page size in report size parameter
- * @memberOf Screening/report/report
*/
- _setMapLayout: function (printTemplate) {
+ setMapLayout: function (printTemplate) {
var mapLayout;
//if map layout is valid use that else default to "MAP_ONLY"
if (this.reportLayout.pageSize.MapLayout) {
@@ -134,7 +154,18 @@ define([
printTemplate.exportOptions.height = this._sizeInPixels.Height;
}
} else {
- mapLayout += " " + this.reportLayout.orientation.Type;
+ // orientation should only be added for default layout
+ if (mapLayout && PageUtils.PageSizes[mapLayout]) {
+ mapLayout += " " + this.reportLayout.orientation.Type;
+ } else {
+ var defaultPageSizeMapLayoutArr = [];
+ Object.keys(PageUtils.PageSizes).forEach(function (key) {
+ defaultPageSizeMapLayoutArr.push(PageUtils.PageSizes[key].MapLayout);
+ });
+ if (defaultPageSizeMapLayoutArr.indexOf(mapLayout) > -1) {
+ mapLayout += " " + this.reportLayout.orientation.Type;
+ }
+ }
}
printTemplate.layout = mapLayout;
return printTemplate;
@@ -143,7 +174,6 @@ define([
/**
* This function is used to validate report size parameter
* by detecting whether it is standard or custom
- * @memberOf Screening/report/report
*/
_validateParameters: function () {
//if page is custom use custom sizes provided by the user
@@ -155,7 +185,6 @@ define([
/**
* This function is used to create the print task service
- * @memberOf Screening/report/report
*/
_createPrintTask: function () {
this._printService = new PrintTask(this.printTaskUrl, { async: !1 });
@@ -163,7 +192,6 @@ define([
/**
* This function is used to create the parameters needed for printing map image in report
- * @memberOf Screening/report/report
*/
_createPrintMapParameters: function (mapParams) {
var printParams, printTemplate, format;
@@ -182,37 +210,63 @@ define([
printTemplate.format = "jpg";
}
} else {
- printTemplate = this._setMapLayout(printTemplate);
- printTemplate.layoutOptions = {};
+ printTemplate = this.setMapLayout(printTemplate);
+ printTemplate.layoutOptions = {
+ customTextElements: [{
+ Date: ""
+ }]
+ };
printTemplate.preserveScale = false;
printTemplate.showAttribution = true;
printTemplate.format = "jpg";
}
printParams = new PrintParameters();
printParams.map = mapParams.map;
- printParams.outSpatialReference = mapParams.map.spatialReference;
printParams.template = printTemplate;
return printParams;
},
/**
* This function is used to print the report details
- * @memberOf Screening/report/report
*/
print: function (reportTitle, printData) {
- var a, b;
+ var a, b, userAgent;
if (this._printService) {
this._shownUnableToPrintMapMsg = false;
- //close if prev window is available
- if (this._printWindow) {
- this._printWindow.close();
- }
a = screen.width / 2;
b = screen.height / 1.5;
- a = "toolbar\x3dno, location\x3dno, directories\x3dno, status\x3dyes, menubar\x3dno," +
- "scrollbars\x3dyes, resizable\x3dyes, width\x3d" + a + ", height\x3d" + b + ", top\x3d" +
- (screen.height / 2 - b / 2) + ", left\x3d" + (screen.width / 2 - a / 2);
+ // in ie11 when window is set to open in new window we need to provide spec,
+ // else scroll-bar wont be visible and max button will be disabled
+ if ((jimuUtils.has('ie') === 11)) {
+ a = "toolbar\x3dno, location\x3dno, directories\x3dno, status\x3dyes, menubar\x3dno," +
+ "scrollbars\x3dyes, resizable\x3dyes, width\x3d" + a + ", height\x3d" + b + ", top\x3d" +
+ (screen.height / 2 - b / 2) + ", left\x3d" + (screen.width / 2 - a / 2);
+ } else {
+ // to open report in new tab, specs should be null for other browser
+ a = null;
+ }
+ // detects browser in which application is running
+ userAgent = jimuUtils.detectUserAgent();
+ // in firefox only first time browser switches control to report tab.
+ // hence to switch it every time we need to close it first
+ if ((userAgent.browser.hasOwnProperty("firefox") && userAgent.browser.firefox) ||
+ (userAgent.os.hasOwnProperty("ipad") && userAgent.os.ipad) ||
+ (userAgent.os.hasOwnProperty("iphone") && userAgent.os.iphone)) {
+ if (this._printWindow) {
+ this._printWindow.close();
+ }
+ }
this._printWindow = window.open("", "report", a, true);
+ if (this._windowOpenedTimer) {
+ clearInterval(this._windowOpenedTimer);
+ }
+ this._windowOpenedTimer = setInterval(lang.hitch(this, function () {
+ if (this._printWindow.closed) {
+ clearInterval(this._windowOpenedTimer);
+ this.emit("report-window-closed");
+ }
+ }), 500);
+ this._printWindow.focus();
setTimeout(lang.hitch(this, function () {
Window.withDoc(this._printWindow.document,
lang.hitch(this, function () {
@@ -223,8 +277,9 @@ define([
if (window.isRTL) {
domClass.add(dom.byId("reportBody"), "jimu-rtl");
}
- //load external css
- if (this.styleSheets && this.styleSheets.length > 0) {
+ //load external css if available
+ if ((this.styleSheets && this.styleSheets.length > 0) ||
+ (this.styleText && this.styleText !== '')) {
this._addExternalStyleSheets();
}
//Set preview page size
@@ -252,23 +307,26 @@ define([
/**
* This function is used to add external stylesheet needed for printing report
- * @memberOf Screening/report/report
*/
_addExternalStyleSheets: function () {
var headNode = dom.byId("reportHead");
- array.forEach(this.styleSheets, lang.hitch(this, function (styleSheetURL) {
- domConstruct.create("link",
- { "rel": "stylesheet", "type": "text/css", "href": styleSheetURL }, headNode);
- }));
- if (this.styleText) {
- domConstruct.create("style",
- { "type": "text/css", innerHTML: this.styleText }, headNode);
+ if (headNode) {
+ //add external style sheets.
+ array.forEach(this.styleSheets, lang.hitch(this, function (styleSheetURL) {
+ domConstruct.create("link",
+ { "rel": "stylesheet", "type": "text/css", "href": styleSheetURL }, headNode);
+ }));
+ //add external style text if any
+ //Note: external style text will be added at the end so that they have the precedence.
+ if (this.styleText) {
+ domConstruct.create("style",
+ { "type": "text/css", innerHTML: this.styleText }, headNode);
+ }
}
},
/**
* This function is used to set the report page size
- * @memberOf Screening/report/report
*/
_setPageSize: function () {
var sizeInInches, sizeInPixels, pageWidthInPixels, domNode;
@@ -296,7 +354,6 @@ define([
/**
* This function is used to set the report data
- * @memberOf Screening/report/report
*/
_setReportData: function (printData) {
var htmlDataDiv = dom.byId("reportData");
@@ -321,6 +378,8 @@ define([
reportData.data.map.setExtent(reportData.extent);
}
this._executePrintTask(reportData, domNode, errorButtonNode);
+ } else if (reportData.type === "note") {
+ this._createReportNote(domNode, reportData);
}
}));
}
@@ -328,31 +387,56 @@ define([
/**
* This function is used to set the report footnote message
- * @memberOf Screening/report/report
*/
_setFootNotes: function () {
- var footNotesDiv = dom.byId("footNotes");
+ var formattedFootNotes, footNotesDiv;
+ footNotesDiv = dom.byId("footNotes");
if (footNotesDiv && this.footNotes) {
- footNotesDiv.innerHTML = this.footNotes;
+ //Format value so that url in value will appear as link.
+ formattedFootNotes = jimuUtils.sanitizeHTML(this.footNotes ? this.footNotes : '');
+ footNotesDiv.innerHTML = jimuUtils.fieldFormatter.getFormattedUrl(formattedFootNotes);
}
},
/**
* This function is used to set the report logo
- * @memberOf Screening/report/report
*/
_setReportLogo: function () {
- var reportLogoNode = dom.byId("reportLogo");
+ var reportLogoNode, reportMain, printTitle, reportHeader;
+ reportLogoNode = dom.byId("reportLogo");
if (reportLogoNode && this.reportLogo) {
domClass.remove(reportLogoNode, "esriCTHidden");
reportLogoNode.src = this.reportLogo;
+ reportHeader = dom.byId("reportHeader");
+ reportMain = dom.byId("reportMain");
+ printTitle = dom.byId("printTitleDiv");
+ //reposition report title in rtl mode
+ if (window.isRTL) {
+ domConstruct.place(printTitle, reportHeader, "first");
+ }
+ //based on logo width, set the width of reportTitle
+ //max 50% of page width will be considered for logo
+ if (reportMain && printTitle) {
+ if (reportLogoNode.complete) {
+ //In IE 'load' property doesn't work when image loads from cache
+ domStyle.set(printTitle, {
+ "width": (reportMain.clientWidth - reportLogoNode.clientWidth - 51) + "px"
+ });
+ }
+ this.own(on(reportLogoNode, "load", lang.hitch(this, function () {
+ // IE specific, as image doesn't load immediately hence using setTimeout
+ setTimeout(lang.hitch(this, function () {
+ domStyle.set(printTitle, {
+ "width": (reportMain.clientWidth - reportLogoNode.clientWidth - 51) + "px"
+ });
+ }), 300);
+ })));
+ }
}
-
},
/**
* This function is used to set the report title
- * @memberOf Screening/report/report
*/
_setReportTitle: function (reportTitle) {
var reportTitleDiv = dom.byId("reportTitle");
@@ -361,21 +445,55 @@ define([
}
},
+ /**
+ * This function is used to set the report title
+ */
+ _createReportNote: function (node, reportData) {
+ var textArea, reportTitle = "", titleNode, notesParagraph;
+ if (reportData.title) {
+ reportTitle = reportData.title;
+ }
+ //add title to the notes section
+ titleNode = this._addSectionTitle(reportTitle, node);
+ domClass.add(titleNode, "esriCTNotesTitle");
+ //create textarea for entering notes
+ textArea = domConstruct.create("textarea", {
+ "class": "esriCTReportNotes",
+ "placeholder": this.nls.notesHint,
+ "rows": 5
+ }, node);
+ //create paragraph for entering notes
+ notesParagraph = domConstruct.create("p", {
+ "class": "esriCTReportNotesParagraph"
+ }, node);
+ domClass.add(node, "esriCTNotesContainer");
+ //set value to the default text
+ if (reportData.defaultText) {
+ textArea.value = reportData.defaultText;
+ }
+ //updates the size of text area as user enters any text in it
+ //also set the entered value in paragraph which is used to display notes in print mode
+ this.own(on(textArea, "keydown, change", function () {
+ textArea.style.height = 'auto';
+ notesParagraph.innerHTML = jimuUtils.sanitizeHTML(textArea.value ? textArea.value : '');
+ textArea.style.height = textArea.scrollHeight + 'px';
+ }));
+ },
+
/**
* This function is used to set the report size message like
* dimension, page size & orientation
- * @memberOf Screening/report/report
*/
_setReportSizeMessage: function () {
var reportBarMsg, pageDimensions, sizeInInches, format;
- //Get configured size in case of 'Custom' page laypout else use predefined pageSize
+ //Get configured size in case of 'Custom' page layout else use predefined pageSize
//In case of Custom page layout size name will be empty else use configured page size name
if (this.reportLayout.pageSize === PageUtils.PageSizes.Custom && this.reportLayout.size) {
sizeInInches = this.reportLayout.size;
- format = this.reportLayout.pageSize;
+ format = this.reportLayout.pageSize;
} else {
sizeInInches = this.reportLayout.pageSize;
- format = this.reportLayout.pageSize.SizeName;
+ format = this.reportLayout.pageSize.SizeName ? this.reportLayout.pageSize.SizeName : this.reportLayout.SizeName;
}
//according to orientation set the height & width of the page
if (this.reportLayout.orientation.Type === PageUtils.Orientation.Landscape.Type &&
@@ -396,7 +514,6 @@ define([
/**
* This function is used to set the label of print and close button
- * @memberOf Screening/report/report
*/
_setButtonLabels: function () {
//Set Report button title and label
@@ -412,34 +529,39 @@ define([
/**
* This function is used to execute print task that is
* use to display the map and aoi in the map section
- * @memberOf Screening/report/report
*/
_executePrintTask: function (mapParams, parentNode, errorNode) {
var printParams;
printParams = this._createPrintMapParameters(mapParams);
this._printService.execute(printParams,
lang.hitch(this, function (printResult) {
+ var mapImg;
if (parentNode) {
domClass.remove(parentNode, "esriCTReportMapWait");
- domConstruct.create("img", {
+ mapImg = domConstruct.create("img", {
"src": printResult.url,
"class": "esriCTReportMapImg"
}, parentNode);
+ //if orientation is landscape add landscapeMap class
+ if (this.reportLayout.orientation.Type === PageUtils.Orientation.Landscape.Type) {
+ domClass.add(mapImg, "esriCTReportLandscapeMapImg");
+ }
}
+ this.emit("report-export-task-completed");
}), lang.hitch(this, function () {
- domClass.replace(parentNode, "esriCTReportMapFail", "esriCTReportMapWait");
+ domClass.replace(parentNode,
+ "esriCTReportMapFail", "esriCTPageBreak esriCTReportMapWait");
//Only show map failed message once
if (!this._shownUnableToPrintMapMsg) {
this._shownUnableToPrintMapMsg = true;
errorNode.click();
}
+ this.emit("report-export-task-failed");
}));
},
/**
- * This function is used to render the HTML data in print report like
- * table of layer names & field data
- * @memberOf Screening/report/report
+ * This function is used to render the HTML data in print report
*/
_renderHTMLData: function (parentNode, reportData) {
var htmlContainer;
@@ -452,50 +574,66 @@ define([
/**
* This function is used to add title to different sections in print report
- * @memberOf Screening/report/report
*/
_addSectionTitle: function (title, titleParent) {
- domConstruct.create("div", {
- "innerHTML": title,
- "class": title ? "esriCTSectionTitle" : ""
+ var titleNode;
+ var sanitizedTitle = jimuUtils.sanitizeHTML(title ? title : '');
+ titleNode = domConstruct.create("div", {
+ "innerHTML": sanitizedTitle,
+ "class": sanitizedTitle ? "esriCTSectionTitle" : ""
}, titleParent);
+ return titleNode;
},
/**
* This function is used to create the format of report table
- * @memberOf Screening/report/report
*/
_formatAndRenderTables: function (tableParentNode, reportData) {
var tableInfo = reportData.data;
- var i, j, colsTempArray, rowsTempArray, chunk = this.tableCols;
+ var i, j, colsTempArray, rowsTempArray, chunk = this.maxNoOfCols;
//table cols can be overridden by setting in the table data properties
- if (tableInfo.tableCols) {
- chunk = tableInfo.tableCols;
+ if (tableInfo.maxNoOfCols) {
+ chunk = tableInfo.maxNoOfCols;
+ }
+ if (tableInfo.cols.length > chunk) {
+ var remainingCols = tableInfo.cols.length - chunk;
+ if (remainingCols <= 2) {
+ chunk = tableInfo.cols.length;
+ }
}
for (i = 0, j = tableInfo.cols.length; i < j; i += chunk) {
var newTableInfo = { cols: [], rows: [] };
+ var sliceLength = i + chunk;
+ var breakLoop = false;
if (i === 0) {
newTableInfo.title = reportData.title;
} else {
newTableInfo.title = "";
}
- colsTempArray = tableInfo.cols.slice(i, i + chunk);
+ var remainingCols1 = tableInfo.cols.length - (sliceLength);
+ if (remainingCols1 <= 2 && remainingCols1 > 0) {
+ sliceLength += remainingCols1;
+ breakLoop = true;
+ }
+ colsTempArray = tableInfo.cols.slice(i, sliceLength);
rowsTempArray = [];
for (var k = 0; k < tableInfo.rows.length; k++) {
- rowsTempArray.push(tableInfo.rows[k].slice(i, i + chunk));
+ rowsTempArray.push(tableInfo.rows[k].slice(i, sliceLength));
}
newTableInfo.cols = colsTempArray;
newTableInfo.rows = rowsTempArray;
this._renderTable(
domConstruct.create("div", {}, tableParentNode),
newTableInfo, reportData.data.showRowIndex);
+ if (breakLoop) {
+ break;
+ }
}
},
/**
* This function is used to create the UI of report dynamically like
* table of layer names & field data & set the data in it
- * @memberOf Screening/report/report
*/
_renderTable: function (tableParentNode, tableInfo, showRowIndex) {
var table, tableBody, tableHeaderRow;
@@ -518,13 +656,15 @@ define([
var tableRow;
tableRow = domConstruct.create("tr", {}, tableBody);
if (showRowIndex) {
- domConstruct.create("td", { "innerHTML": index + 1 }, tableRow);
+ domConstruct.create("td", {
+ "innerHTML": index + 1,
+ "style": { "word-wrap": "normal" } //to always show entire number avoid break-word
+ }, tableRow);
}
array.forEach(eachRow, lang.hitch(this, function (rowValue) {
- var colData = domConstruct.create("td", { "innerHTML": rowValue }, tableRow);
- if (this.alignNumbersToRight && !isNaN(parseFloat(rowValue))) {
- domClass.add(colData, "esriCTNumber");
- }
+ //Format value so that url in value will appear as link.
+ var formattedRowValue = jimuUtils.fieldFormatter.getFormattedUrl(rowValue);
+ domConstruct.create("td", { "innerHTML": formattedRowValue }, tableRow);
}));
}));
}
diff --git a/app/jimu.js/dijit/Search.js b/app/jimu.js/dijit/Search.js
index 5ea6408..513a0e7 100644
--- a/app/jimu.js/dijit/Search.js
+++ b/app/jimu.js/dijit/Search.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -17,10 +17,11 @@
define(['dojo/_base/declare',
'dojo/_base/html',
'dojo/string',
+ 'dojo/keys',
'dijit/_WidgetBase',
'dijit/_TemplatedMixin'
],
-function(declare, html, string, _WidgetBase, _TemplatedMixin) {
+function(declare, html, string, keys, _WidgetBase, _TemplatedMixin) {
return declare([_WidgetBase, _TemplatedMixin], {
baseClass: 'jimu-search',
declaredClass: 'jimu.dijit.Search',
@@ -63,8 +64,9 @@ function(declare, html, string, _WidgetBase, _TemplatedMixin) {
},
_onKeyDown: function(evt){
+ this.doChange();
var keyNum = evt.keyCode !== undefined ? evt.keyCode : evt.which;
- if (keyNum === 13) {
+ if (keyNum === keys.ENTER) {
this.doSearch();
}
evt.stopPropagation();
@@ -78,6 +80,12 @@ function(declare, html, string, _WidgetBase, _TemplatedMixin) {
_onBtnClick: function(){
this.doSearch();
+ },
+
+ doChange: function(){
+ if(this.onChange){
+ this.onChange(this.getValue());
+ }
}
});
});
\ No newline at end of file
diff --git a/app/jimu.js/dijit/SearchDistance.js b/app/jimu.js/dijit/SearchDistance.js
index 7553c71..dbce01a 100644
--- a/app/jimu.js/dijit/SearchDistance.js
+++ b/app/jimu.js/dijit/SearchDistance.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/app/jimu.js/dijit/ServiceURLComboBox.js b/app/jimu.js/dijit/ServiceURLComboBox.js
index c24d6b7..78acfd7 100644
--- a/app/jimu.js/dijit/ServiceURLComboBox.js
+++ b/app/jimu.js/dijit/ServiceURLComboBox.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/app/jimu.js/dijit/ServiceURLInput.js b/app/jimu.js/dijit/ServiceURLInput.js
index b945502..ee71ff8 100644
--- a/app/jimu.js/dijit/ServiceURLInput.js
+++ b/app/jimu.js/dijit/ServiceURLInput.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/app/jimu.js/dijit/ShareLink.js b/app/jimu.js/dijit/ShareLink.js
index 93a759a..3adc214 100644
--- a/app/jimu.js/dijit/ShareLink.js
+++ b/app/jimu.js/dijit/ShareLink.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -21,7 +21,9 @@ define(['dojo/_base/declare',
'dojo/_base/lang',
'dojo/_base/array',
"dojo/dom-class",
+ 'dojo/_base/html',
'dojo/on',
+ 'dojo/keys',
'dojo/topic',
"dojo/query",
"jimu/utils",
@@ -37,6 +39,8 @@ define(['dojo/_base/declare',
'esri/request',
'esri/tasks/query',
'esri/tasks/QueryTask',
+ 'esri/symbols/jsonUtils',
+ 'esri/InfoTemplate',
"esri/symbols/PictureMarkerSymbol",
"esri/graphic",
"esri/layers/GraphicsLayer",
@@ -45,23 +49,22 @@ define(['dojo/_base/declare',
"dijit/form/TextBox",
"dijit/form/Textarea",
"dijit/form/RadioButton",
- "dijit/form/Select",
"dijit/form/CheckBox",
- "dijit/form/NumberTextBox",
"dijit/form/SimpleTextarea",
"dijit/form/ValidationTextBox"
],
- function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, lang, array, dojoClass,
- on, topic, dojoQuery, jimuUtils, shareUtils, dojoConfig, dojoCookie,
- template, dojoString, Select, NumberTextBox, domAttr, Deferred, esriRequest, EsriQuery, QueryTask,
+ function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, lang, array, dojoClass, html,
+ on, keys, topic, dojoQuery, jimuUtils, shareUtils, dojoConfig, dojoCookie,
+ template, dojoString, Select, NumberTextBox, domAttr, Deferred,
+ esriRequest, EsriQuery, QueryTask, symbolJsonUtils, InfoTemplate,
PictureMarkerSymbol, Graphic, GraphicsLayer, FeaturelayerChooserFromMap, LayerChooserFromMapWithDropbox) {
- /*global escape*/
var so = declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
templateString: template,
declaredClass: "jimu.dijit.ShareLink",
- bitlyUrl: "http://api.bit.ly/v3/shorten?login=arcgisdev&apiKey=R_18b3867d45854ba98d9e0e7c20dbf6d3",
- bitlyUrlSSL: "https://api-ssl.bitly.com/v3/shorten?login=arcgisdev" +
- "&apiKey=R_18b3867d45854ba98d9e0e7c20dbf6d3",
+ //bitlyUrl: "http://api.bit.ly/v3/shorten?login=arcgisdev&apiKey=R_18b3867d45854ba98d9e0e7c20dbf6d3",
+ //bitlyUrlSSL: "https://api-ssl.bitly.com/v3/shorten?login=arcgisdev" +
+ //"&apiKey=R_18b3867d45854ba98d9e0e7c20dbf6d3",
+ bitlyUrl: "https://arcg.is/prod/shorten",
share: {
shareEmailSubject: "",
shareTwitterTxt: "",
@@ -73,6 +76,7 @@ define(['dojo/_base/declare',
_hasZoomLevelMarkerAdded: false,
_hasMapScaleMarkerAdded: false,
_hasAddMarkerMarkerAdded: false,
+ HAS_INIT_URL: false,//flag for have got shortLink OR fail to fetch shortLink
//https://developers.arcgis.com/web-appbuilder/guide/app-url-parameters-for-dev.htm
postMixInProperties: function() {
@@ -126,6 +130,21 @@ define(['dojo/_base/declare',
// })));
this._initOptions();
this._initOptionsEvent();
+
+ var shareLinkOptionsWrapper = dojoQuery(".shareLinkOptionsWrapper", this.domNode);
+ this.own(on(shareLinkOptionsWrapper, "keydown", lang.hitch(this, function(evt){
+ if(evt.keyCode === keys.ESCAPE){
+ evt.stopPropagation();
+ this.backBtn.focus();
+ }
+ })));
+ this.own(on(this.preview, "keydown", lang.hitch(this, function(evt){
+ if(!evt.shiftKey && evt.keyCode === keys.TAB){
+ evt.preventDefault();
+ this.backBtn.focus();
+ }
+ })));
+
},
destroy: function() {
this._cleanMarkerStatus();
@@ -242,6 +261,15 @@ define(['dojo/_base/declare',
} else {
domAttr.set(this.backBtn, "title", window.jimuNls.common.back);
this.own(on(this.backBtn, "click", lang.hitch(this, this._toggleLinkOptions)));
+ this.own(on(this.backBtn, "keydown", lang.hitch(this, function(evt){
+ if(evt.keyCode === keys.ENTER || evt.keyCode === keys.ESCAPE){
+ this._toggleLinkOptions();
+ this.linkOptions.focus();
+ }else if(evt.shiftKey && evt.keyCode === keys.TAB){
+ evt.preventDefault();
+ this.preview.textbox.focus();
+ }
+ })));
}
//socialNetworkLinks
if (false === this._isShowSocialMediaLinks) {
@@ -252,12 +280,22 @@ define(['dojo/_base/declare',
dojoClass.toggle(this.shareTips, "displaynone");
}
this.own(on(this.linkOptions, "click", lang.hitch(this, this._toggleLinkOptions)));
+ this.own(on(this.linkOptions, "keydown", lang.hitch(this, this._toggleLinkOptionsKeydown)));
this._setInputsClicktoSelect(this._linkUrlTextBox);
//this.own(on(this.emailShare, "click", lang.hitch(this, this._toEmail)));
this.own(on(this.googlePlusShare, "click", lang.hitch(this, this._toGooglePlus)));
+ this.own(on(this.googlePlusShare, "keydown", lang.hitch(this, this._toGooglePlusKeyDown)));
this._setInputsClicktoSelect(this._embedCodeTextArea);
+ this.own(on(this.MoreOptionsContainer, "keydown", lang.hitch(this, function(evt){
+ if(evt.keyCode === keys.ESCAPE){
+ evt.stopPropagation();
+ this._moreOptionsExpandCollapse();
+ this.MoreOptions.focus();
+ }
+ })));
+
this._sizeOptions = new Select({
options: [{
label: this.nls.smallSize,
@@ -303,6 +341,13 @@ define(['dojo/_base/declare',
dojoClass.remove(this.CustomSizeContainer, "disable");
}
}.bind(this)));
+ this.own(on(this._sizeOptions, "keydown", function(evt) {
+ if (evt.shiftKey && evt.keyCode === keys.TAB) {
+ evt.preventDefault();
+ this._moreOptionsExpandCollapse();
+ this.MoreOptions.focus();
+ }
+ }.bind(this)));
//widthTextBox
this._widthTextBox = new NumberTextBox({
"class": "sizeTextBox inputsText",
@@ -336,10 +381,21 @@ define(['dojo/_base/declare',
this._updateEmbedCodeFrameSize();
}
}.bind(this)));
+ this.own(on(this._heightTextBox, "keydown", function(evt) {
+ if (!evt.shiftKey && evt.keyCode === keys.TAB) {
+ evt.preventDefault();
+ this._moreOptionsExpandCollapse();
+ this.MoreOptions.focus();
+ }
+ }.bind(this)));
+
this.mobileLayout.set("value", this.share.DEFAULT_MOBILE_LAYOUT);
//hide findLocation
- this.updateShareLinkOptionsUI({isShowFindLocation: this._isShowFindLocation});
+ //var isShowUseOrg = !!(this._isOnline && this._isSharedToPublic);
+ this.updateShareLinkOptionsUI({
+ isShowFindLocation: this._isShowFindLocation
+ });
this._setInputsClicktoSelect(this.preview);
},
@@ -422,7 +478,10 @@ define(['dojo/_base/declare',
//token
var token = "";
try {
- token = JSON.parse(dojoCookie("esri_auth")).token;
+ var cookie = dojoCookie("esri_auth");
+ if(cookie){
+ token = JSON.parse(cookie).token;
+ }
} catch (err) {
console.log("ShareLink can't parse Auth:" + err);
}
@@ -472,7 +531,13 @@ define(['dojo/_base/declare',
//outline radios
var shareRadios = dojoQuery(".shareRadios", this.domNode);
- this.own(on(shareRadios, "change", lang.hitch(this, function(results) {
+ // this.own(on(shareRadios, "change", lang.hitch(this, function(results) {
+ // var src = results.srcElement || results.target;
+ // this.optionSrc = domAttr.get(src, "data-id");
+ // console.log("==>radios change");
+ // this.updateUrl();
+ // })));
+ this.own(on(shareRadios, "click", lang.hitch(this, function(results) {
var src = results.srcElement || results.target;
this.optionSrc = domAttr.get(src, "data-id");
this.updateUrl();
@@ -524,6 +589,8 @@ define(['dojo/_base/declare',
})));
},
_onMarkersClick: function(results) {
+ shareUtils.disableWebMapPopup(this.map);
+
this._unselectMarkerBtn();
this._selectMarkerBtn(results);
@@ -547,6 +614,8 @@ define(['dojo/_base/declare',
this._unselectMarkerBtn();
this.updateUrl(param);
this._showPopup();
+
+ shareUtils.enableWebMapPopup(this.map);
},
_hidePopup: function() {
@@ -761,27 +830,40 @@ define(['dojo/_base/declare',
this._updateResUrls(param);
this._updateLinkOptionsUI();
- this.preview.set("value", this._fixUrlIfIsOnline(this.resultUrl));
+ if (true === this.config.useOrgUrl) {
+ //keep raw url(org url)
+ } else {
+ //false OR undefined
+ this.resultUrl = this._fixUrlIfIsOnline(this.resultUrl);
+ }
+
+ this.preview.set("value", this.resultUrl);
if (param === null) {
this._generateShortenUrl();//init
}
+
+ this._updateEmailHref();
},
_generateShortenUrl: function() {
var url = this.preview.get("value");
try {
if (this.isUseShortenUrl()) {
- this.shortenUrl(url, this.bitlyUrl, this.bitlyUrlSSL).then(lang.hitch(this, function(res) {
+ this.shortenUrl(url, this.bitlyUrl).then(lang.hitch(this, function(res) {
this._useShortenUrl(res);
+ this.HAS_INIT_URL = true;
}), lang.hitch(this, function(res) {
this._useLengthenUrl(url, res);
+ this.HAS_INIT_URL = true;
}));
} else {
this._useLengthenUrl(url);
+ this.HAS_INIT_URL = true;
}
} catch (err) {
console.error(err);
+ this.HAS_INIT_URL = true;
}
},
_useShortenUrl: function(shortenedUrl) {
@@ -799,10 +881,15 @@ define(['dojo/_base/declare',
},
_toFacebook: function() {
- var a = "http://www.facebook.com/sharer/sharer.php?s\x3d100\x26" +//p[url]\x3d
+ var a = "http://www.facebook.com/sharer/sharer.php?" +
"u=" + encodeURIComponent(this._linkUrlTextBox.get('value')) +
"&t=" + encodeURIComponent(jimuUtils.stripHTML(this.socialNetworkTitle(this._appTitle)));
- window.open(a, "_blank");
+ window.open(a, "", "toolbar=0,status=0,width=626,height=436");
+ },
+ _toFacebookKeyDown: function(evt) {
+ if(evt.keyCode === keys.ENTER){
+ this._toFacebook();
+ }
},
_toTwitter: function() {
var shareStr = dojoString.substitute(this.share.shareTwitterTxt, {
@@ -811,26 +898,51 @@ define(['dojo/_base/declare',
var url = this._linkUrlTextBox.get('value');
//var title = "&text=" + this.socialNetworkTitle(this._appTitle);
window.open("http://twitter.com/home?status\x3d" +
- encodeURIComponent(shareStr + url + "\n@ArcGISOnline"), "_blank");
+ encodeURIComponent(shareStr + url + "\n@ArcGISOnline"), "", "toolbar=0,status=0,width=626,height=436");
+ },
+ _toTwitterKeyDown: function(evt) {
+ if(evt.keyCode === keys.ENTER){
+ this._toTwitter();
+ }
},
- _toEmail: function() {
+ //_toEmail: function() {
+ // var a = "mailto:?subject\x3d" + dojoString.substitute(this.share.shareEmailSubject, {
+ // appTitle: jimuUtils.stripHTML(this._appTitle)
+ // }),
+ // previewUrl = this.preview.get('value');
+ // a = a + ("\x26body\x3d" + encodeURIComponent(this.nls.shareEmailTxt1) +
+ // "%0D%0A%0D%0A" + jimuUtils.stripHTML(this._appTitle));
+ // a = a + ("%0D%0A" + encodeURIComponent(previewUrl));
+ // a = a + ("%0D%0A%0D%0A" + encodeURIComponent(this.nls.shareEmailTxt2));
+ // a = a + ("%0D%0A%0D%0A" + encodeURIComponent(this.nls.shareEmailTxt3));
+ // window.top.location.href = a;
+ //},
+ _updateEmailHref: function () {
var a = "mailto:?subject\x3d" + dojoString.substitute(this.share.shareEmailSubject, {
- appTitle: jimuUtils.stripHTML(this._appTitle)
- }),
+ appTitle: jimuUtils.stripHTML(this._appTitle)
+ }),
previewUrl = this.preview.get('value');
a = a + ("\x26body\x3d" + encodeURIComponent(this.nls.shareEmailTxt1) +
"%0D%0A%0D%0A" + jimuUtils.stripHTML(this._appTitle));
a = a + ("%0D%0A" + encodeURIComponent(previewUrl));
a = a + ("%0D%0A%0D%0A" + encodeURIComponent(this.nls.shareEmailTxt2));
a = a + ("%0D%0A%0D%0A" + encodeURIComponent(this.nls.shareEmailTxt3));
- window.top.location.href = a;
+
+ html.setAttr(this.emailShare, 'href', a);
},
_toGooglePlus: function() {
var link = this._linkUrlTextBox.get('value');
var url = 'http://plus.google.com/share?url=' + encodeURIComponent(link);
- window.open(url, "_blank");
+ window.open(url, "", "toolbar=0,status=0,width=626,height=436");
+ },
+ _toGooglePlusKeyDown: function(evt){
+ if(evt.keyCode === keys.ENTER){
+ this._toGooglePlus();
+ }
},
_toggleLinkOptions: function() {
+ shareUtils.enableWebMapPopup(this.map);
+
var parentNode = this.domNode.parentNode || this.domNode.parentElement;
var shareOptionsWrapper = dojoQuery(".shareOptionsWrapper", parentNode);
var shareUrlsWrapper = dojoQuery(".shareUrlsWrapper", this.domNode);
@@ -852,10 +964,33 @@ define(['dojo/_base/declare',
dojoClass.toggle(shareUrlsWrapper[0], "displaynone");
dojoClass.toggle(shareLinkOptionsWrapper[0], "displaynone");
},
+ _toggleLinkOptionsKeydown: function(evt){
+ if(evt.keyCode === keys.ENTER){
+ this._toggleLinkOptions();
+ //focus current selected option when opening linkOptions
+ if(this._isShareLinkOptionsShow()){
+ var radios = dojoQuery(".shareRadios input", this.shareOptionsRadios);
+ for (var i = 0, len = radios.length; i < len; i++) {
+ var radio = radios[i];
+ if(radio.checked){
+ radio.focus();
+ }
+ }
+ }
+ }
+ },
_moreOptionsExpandCollapse: function() {
dojoClass.toggle(this.MoreOptionsContainer, "displaynone");
dojoClass.toggle(this.MoreOptionsIcon, "rotate");
},
+ _moreOptionsExpandCollapseKeyDown: function(evt){
+ if(evt.keyCode === keys.ENTER){
+ this._moreOptionsExpandCollapse();
+ if(!html.hasClass(this.MoreOptionsContainer, 'displaynone')){
+ this._sizeOptions.focus();
+ }
+ }
+ },
_setInputsClicktoSelect: function(dijit) {
domAttr.set(dijit, "onclick", "this.select()");
domAttr.set(dijit, "onmouseup", "return false;");
@@ -870,14 +1005,11 @@ define(['dojo/_base/declare',
}
},
// calls handler(shortenedUrl) on success
- shortenUrl: function(url, bitlyUrl, bitlyUrlSSL) {
+ shortenUrl: function(url, bitlyUrl) {
var def = new Deferred();
- var uri = bitlyUrl;
- if (location.protocol === "https:") {
- uri = bitlyUrlSSL;
- }
- uri += "&longUrl=" + escape(url) + "&format=json";
+ var uri = shareUtils.addQueryParamToUrl(bitlyUrl, "longUrl", url, true);
+ uri = shareUtils.addQueryParamToUrl(uri, "format", "json", true);
esriRequest({
url: uri,
@@ -914,9 +1046,16 @@ define(['dojo/_base/declare',
getMapExtent: function(map) {
var accuracy = 1E4;
var extent = map.extent;
+ var sr = "";
+ if (extent.spatialReference.wkid) {
+ sr = extent.spatialReference.wkid;
+ } else if (!extent.spatialReference.wkid && extent.spatialReference.wkt) {
+ sr = "wkt=" + extent.spatialReference.wkt;
+ }
+
return null !== extent ? this._roundValue(extent.xmin, accuracy) + "," +
this._roundValue(extent.ymin, accuracy) + "," + this._roundValue(extent.xmax, accuracy) + "," +
- this._roundValue(extent.ymax, accuracy) + "," + extent.spatialReference.wkid : "";
+ this._roundValue(extent.ymax, accuracy) + "," + sr : "";
},
_roundValue: function(a, b) {
@@ -969,22 +1108,81 @@ define(['dojo/_base/declare',
},
//add and remove marker ,when click marker icon in linkOptions
- _addGraphicsLayer: function() {
+ _addGraphicsLayer: function () {
if (!window.isBuilder && typeof this._graphicsLayer === "undefined") {
- this._graphicsLayer = new GraphicsLayer();
- this.map.addLayer(this._graphicsLayer);
+ if (this.map.getLayer("marker-feature-action-layer")) {
+ this._graphicsLayer = this.map.getLayer("marker-feature-action-layer");
+ } else {
+ this._graphicsLayer = new GraphicsLayer({ id: "marker-feature-action-layer" });
+ this.map.addLayer(this._graphicsLayer);
+ }
}
},
_removeGraphicsLayer: function() {
if (!window.isBuilder && typeof this._graphicsLayer !== "undefined") {
+ //close popup
+ if (this.map.infoWindow && this.map.infoWindow.features &&
+ this.map.infoWindow.features[0] === this._markerGraphic) {
+ this.map.infoWindow.hide();
+ }
+ //clean text
+ if (this._markerGraphic && this._markerGraphic._textSymbol) {
+ this._graphicsLayer.remove(this._markerGraphic._textSymbol);
+ }
+
this._graphicsLayer.remove(this._markerGraphic);
this._markerGraphic = null;
}
},
- _addGraphicsLayerMarker: function(evt) {
+ _addGraphicsLayerMarker: function (evt) {
if (!window.isBuilder && typeof this._graphicsLayer !== "undefined") {
- this._markerGraphic = this._getMarkerGraphic(evt.mapPoint);
- this._graphicsLayer.add(this._markerGraphic);
+ if (this.optionSrc !== "addMarker") {
+ this._markerGraphic = this._getMarkerGraphic(evt.mapPoint);
+ this._graphicsLayer.add(this._markerGraphic);
+ } else {
+ //1
+ var infoTemplate = new InfoTemplate('', (this.addMarker_title.get("value") || ""));
+ //template.isIncludeShareUrl
+ //2
+ var markerSymbol = symbolJsonUtils.fromJson({
+ "type": "esriPMS",
+ "url": require.toUrl('jimu') + "/images/EsriBluePinCircle26.png",
+ "contentType": "image/png"
+ });
+ markerSymbol.width = 26;
+ markerSymbol.height = 26;
+ markerSymbol.setOffset(0, 12);
+ this._markerGraphic = new Graphic(evt.mapPoint, markerSymbol, null, infoTemplate);
+ this._graphicsLayer.add(this._markerGraphic);
+
+ //3
+ var textSymbol = symbolJsonUtils.fromJson({
+ "color": [0, 0, 0, 255],
+ "type": "esriTS",
+ "verticalAlignment": "baseline",
+ "horizontalAlignment": "left",
+ "angle": 0,
+ "xoffset": 0,
+ "yoffset": 0,
+ "rotated": false,
+ "kerning": true,
+ "font": {
+ "size": 12,
+ "style": "normal",
+ "weight": "bold",
+ "family": "Arial"
+ },
+ "text": this.addMarker_label.get("value") || ""
+ });
+ if (textSymbol) {
+ textSymbol.xoffset = markerSymbol.width / 2;
+ textSymbol.yoffset = markerSymbol.height / 2 + markerSymbol.yoffset;
+ var textG = new Graphic(evt.mapPoint, textSymbol);
+ this._graphicsLayer.add(textG);
+
+ this._markerGraphic._textSymbol = textG;
+ }
+ }
}
},
_getMarkerGraphic: function(mapPoint) {
diff --git a/app/jimu.js/dijit/ShareOptions.js b/app/jimu.js/dijit/ShareOptions.js
index 2ab4217..cae9855 100644
--- a/app/jimu.js/dijit/ShareOptions.js
+++ b/app/jimu.js/dijit/ShareOptions.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/app/jimu.js/dijit/SimpleTable.js b/app/jimu.js/dijit/SimpleTable.js
index a2e5077..e13703e 100644
--- a/app/jimu.js/dijit/SimpleTable.js
+++ b/app/jimu.js/dijit/SimpleTable.js
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// Copyright © 2014 - 2016 Esri. All Rights Reserved.
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
//
// Licensed under the Apache License Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -26,10 +26,11 @@ define([
'dojo/query',
'dijit/registry',
'jimu/utils',
- 'jimu/dijit/CheckBox'
+ 'jimu/dijit/CheckBox',
+ 'dijit/form/Select'
],
function(declare, _WidgetBase, _TemplatedMixin, Evented, lang, html, array, on, query, registry,
- jimuUtils, CheckBox) {
+ jimuUtils, CheckBox, Select) {
return declare([_WidgetBase, _TemplatedMixin, Evented], {
baseClass: 'jimu-simple-table',
@@ -37,7 +38,7 @@ define([
templateString: '
' +
'
' +
'
' +
- '
' +
'' +
'' +
'' +
'
' +
- '
' +
'' +
'' +
@@ -72,6 +73,7 @@ define([
autoHeight: true, //if true, automatically calculate the height
selectable: false,
fields: null,
+ singleClickEdit: false,
/*
//fieldInfo's attributes:
//name:field name
@@ -94,6 +96,8 @@ define([
//create //function
//setValue //function
//getValue //function
+ //if dropdown
+ //options: an array of objects in the format of: {label: value, name: value}
*/
//public methods:
@@ -387,9 +391,10 @@ define([
td = this._createCheckboxTd(tr, fieldMeta, fieldData);
} else if (type === "empty") {
td = this._createEmptyTd(tr, fieldMeta);
- }
- else if(type === "extension"){
+ } else if(type === "extension") {
td = this._createExtensionTd(tr, fieldMeta, fieldData);
+ } else if(type === "dropdown") {
+ td = this._createDropdownTd(tr, fieldMeta, fieldData);
}
if(fieldMeta.hidden){
html.addClass(td, 'hidden-column');
@@ -461,14 +466,22 @@ define([
},
_updateHeight: function(){
- if(this.autoHeight){
- var rows = this.getRows();
+ var rows = this.getRows();
+ //main height
+ if (this.autoHeight) {
var trCount = rows.length > 0 ? rows.length : 1;
// var count = trCount + 1;
- var height = this._headHeight + this._rowHeight * trCount + 1;
+ var height = this._headHeight + (this._rowHeight ) * trCount + 1;
html.setStyle(this.domNode, 'height', height + 'px');
// this.bodyDiv.style.overflowY = 'hidden';
}
+ //background row-ines height for issue #10727
+ if (rows && rows.length > 0 && this.bodyTableDiv) {
+ var size = html.getMarginSize(rows[0]);
+ if (size && size.h) {
+ html.setStyle(this.bodyTableDiv, "backgroundSize", "1px " + size.h + "px");
+ }
+ }
},
_updateRowClassName: function() {
@@ -561,12 +574,18 @@ define([
editableDiv.title = editableDiv.innerText || editableDiv.innerHTML;
}
editableInput.value = editableDiv.innerHTML;
- this.own(on(editableDiv, 'dblclick', lang.hitch(this, function(event) {
- event.stopPropagation();
+ var editEvent = this.singleClickEdit ? 'click' : 'dblclick'; //default event is dbl-click
+ this.own(on(editableDiv, editEvent, lang.hitch(this, function (event) {
+ if (!this.singleClickEdit) {
+ event.stopPropagation();//for row-select evevt, after click
+ }
editableInput.value = editableDiv.innerText || editableDiv.innerHTML;
html.setStyle(editableDiv, 'display', 'none');
html.setStyle(editableInput, 'display', 'inline');
editableInput.focus();
+ if (editableInput.select) {
+ editableInput.select();
+ }
})));
this.own(on(editableInput, 'blur', lang.hitch(this, function() {
editableInput.value = lang.trim(editableInput.value);
@@ -594,7 +613,7 @@ define([
},
_createRadioTd: function(tr, fieldMeta, fieldData) {
- var tdStr = ' | ';
+ var tdStr = ' | ';
var td = html.toDom(tdStr);
html.addClass(td, 'simple-table-cell');
html.place(td, tr);
@@ -768,6 +787,23 @@ define([
return td;
},
+ _createDropdownTd: function(tr, fieldMeta, fieldData){
+ var td = html.create('td', {
+ 'class': fieldMeta.name
+ }, tr);
+ html.addClass(td, 'simple-table-cell');
+ html.addClass(td, 'dropdown-td');
+ if (fieldMeta['class']) {
+ html.addClass(td, fieldMeta['class']);
+ }
+ var dropdown = new Select({
+ options: fieldData
+ });
+ dropdown.placeAt(td);
+
+ return td;
+ },
+
//tr is row you want to edit
//rowData is like {name1:value1, name2: value2...}
editRow: function(tr, rowData) {
@@ -818,9 +854,10 @@ define([
this._editRadio(td, fieldMeta, fieldData);
} else if (type === 'checkbox') {
this._editCheckbox(td, fieldMeta, fieldData);
- }
- else if(type === 'extension'){
+ } else if (type === 'extension') {
this._editExtension(td, fieldMeta, fieldData);
+ } else if (type === 'dropdown') {
+ this._editDropdown(td, fieldMeta, fieldData);
}
}));
result.success = true;
@@ -877,6 +914,13 @@ define([
}
},
+ _editDropdown: function(td, fieldMeta, fieldData) {
+ /*jshint unused: false*/
+ var dom = query('.dijitSelect', td)[0];
+ var dropdown = registry.byNode(dom);
+ dropdown.set('value', fieldData);
+ },
+
_getAllRows: function(){
return query('.simple-table-row', this.tbody);
},
@@ -972,11 +1016,14 @@ define([
}else{
rowData[name] = null;
}
- }
- else if(type === 'extension'){
+ } else if (type === 'extension') {
if(fieldMeta.getValue && typeof fieldMeta.getValue === 'function'){
rowData[name] = fieldMeta.getValue(td, fieldMeta);
}
+ } else if(type === 'dropdown') {
+ var dijitDom = query('.dijitSelect', td)[0];
+ var dropdown = registry.byNode(dijitDom);
+ rowData[name] = dropdown.get('value');
}
}
}));
diff --git a/app/jimu.js/dijit/SnapShot.js b/app/jimu.js/dijit/SnapShot.js
new file mode 100644
index 0000000..057230e
--- /dev/null
+++ b/app/jimu.js/dijit/SnapShot.js
@@ -0,0 +1,523 @@
+///////////////////////////////////////////////////////////////////////////
+// Copyright © 2014 - 2018 Esri. All Rights Reserved.
+//
+// Licensed under the Apache License Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+///////////////////////////////////////////////////////////////////////////
+
+define([
+ 'dojo/_base/declare',
+ 'dojo/_base/lang',
+ 'dojo/_base/array',
+ 'dojo/Deferred',
+ 'dojo/DeferredList',
+ 'jimu/utils',
+ 'esri/request',
+ 'esri/geometry/webMercatorUtils',
+ 'esri/geometry/Polygon',
+ 'esri/geometry/Polyline',
+ 'jimu/portalUtils',
+ 'jimu/tokenUtils',
+ 'jimu/dijit/Message'
+],
+ function (declare, lang, array, Deferred, DeferredList, utils, esriRequest,
+ webMercatorUtils, Polygon, Polyline, portalUtils, tokenUtils, Message) {
+ var Snapshot = declare('Snapshot', null, {
+ _portal: null,
+ _portalUrl: "",
+ _layerArray: [],
+ _originMapId: "",
+ _originAppId: "",
+ _credential: null,
+
+ name: "",
+ appendTimeStamp: null,
+ baseMap: null,
+ tags: "",
+ description: "",
+ shareWith: null,
+ logo: "",
+ time: null,
+
+ //options
+ //shareWith: {everyone: bool, org: bool, groups: "comma seperated list of group IDs"},
+ // shareWith is expected to follow "share item (as item owner)" props
+ // http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Share_Item_as_item_owner/02r30000007s000000/
+ //folderOptions: folderOptions will be passed to CreateFolder in the _createFolder function
+ // http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Create_Folder/02r300000074000000/
+ //mapTitle: str,
+ //mapExtent: {},
+ //data: [{
+ // graphics: [