Skip to content

Commit

Permalink
Merge pull request cmv#302 from cmv/widget-updates/identify
Browse files Browse the repository at this point in the history
Identify Widget: nls support
  • Loading branch information
DavidSpriggs committed Nov 15, 2014
2 parents 17228b6 + 34398ab commit ddd1618
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
11 changes: 7 additions & 4 deletions viewer/js/gis/dijit/Identify.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ define([
'esri/tasks/IdentifyParameters',
'esri/dijit/PopupTemplate',
'dojo/text!./Identify/templates/Identify.html',
'dojo/i18n!./Identify/nls/resource',

'dijit/form/Form',
'dijit/form/FilteringSelect',
'xstyle/css!./Identify/css/Identify.css'
], function (declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, MenuItem, lang, array, all, topic, Memory, IdentifyTask, IdentifyParameters, PopupTemplate, IdentifyTemplate) {
], function (declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, MenuItem, lang, array, all, topic, Memory, IdentifyTask, IdentifyParameters, PopupTemplate, IdentifyTemplate, i18n) {
return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
widgetsInTemplate: true,
templateString: IdentifyTemplate,
baseClass: 'gis_IdentifyDijit',
i18n: i18n,

mapClickMode: null,
identifies: {},
Expand Down Expand Up @@ -110,7 +113,7 @@ define([
this.mapRightClick = evt;
}));
this.mapRightClickMenu.addChild(new MenuItem({
label: 'Identify here',
label: this.i18n.rightClickMenuItem.label,
onClick: lang.hitch(this, 'handleRightClick')
}));
},
Expand Down Expand Up @@ -140,7 +143,7 @@ define([
}));

if (identifies.length > 0) {
this.map.infoWindow.setTitle('Identifying...');
this.map.infoWindow.setTitle( this.i18n.mapInfoWindow.identifyingTitle );
this.map.infoWindow.setContent('<div class="loading"></div>');
this.map.infoWindow.show(mapPoint);
all(identifies).then(lang.hitch(this, 'identifyCallback', identifiedlayers), lang.hitch(this, 'identifyError'));
Expand Down Expand Up @@ -408,7 +411,7 @@ define([
this.identifyLayerDijit.set('disabled', (identifyItems.length < 1));
if (identifyItems.length > 0) {
identifyItems.unshift({
name: '*** All Visible Layers ***',
name: this.i18n.labels.allVisibleLayers,
id: '***'
});
if (!id) {
Expand Down
14 changes: 14 additions & 0 deletions viewer/js/gis/dijit/Identify/nls/resource.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
define ({
root: {
labels: {
selectLayer: 'Choose "All Visible Layers" or a single layer for identify:',
allVisibleLayers: '*** All Visible Layers ***'
},
rightClickMenuItem: {
label: 'Identify here'
},
mapInfoWindow: {
identifyingTitle: 'Identifying...'
}
}
});
2 changes: 1 addition & 1 deletion viewer/js/gis/dijit/Identify/templates/Identify.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="gis_IdentifyDijit">
<div class="formContainer">
<div data-dojo-type="dijit/form/Form" data-dojo-attach-point="identifyFormDijit">
<label>Choose "All Visible Layers" or a<br/>single layer for identify:</label><br/>
<label>${i18n.labels.selectLayer}</label><br/>
<input type="select" data-dojo-type="dijit/form/FilteringSelect" data-dojo-props="name:'identifyLayer',autoComplete:true,required:true,searchAttr:'name',maxHeight:250,'class':'identifySelect'"
data-dojo-attach-point="identifyLayerDijit" />
</div>
Expand Down

0 comments on commit ddd1618

Please sign in to comment.