Text of Incident Analysis Widget

3737
10
Jump to solution
08-03-2015 06:46 AM
LeiZhou1
Occasional Contributor

In the ESRI's new widget 'Incident Analysis', I need to change the Tab name ‘Locate Incident’ to other text, and also I need to change the radio button text at the bottom like ‘Incident’, ‘weather’, to other texts. I checked the config file, but did not see any labels that can be changed.   In the config file of widget, only weather can be adjusted. Thanks!

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Lei,

  The "Locate Incident" is right in the nls/Widget_ROOT.js and the Widget_en.js. the property is called "locate_incident".

The "Weather" tab label text in found in the config.json. Just look for "tabs" property and then the label property.

And unfortunately the label "Incident" is hard coded into the Widget.js

      this.config.tabs.splice(0, 0, {
        type: "incidents",
        label: "Incident",
        color: this.config.color
      });

View solution in original post

10 Replies
RobertScheitlin__GISP
MVP Emeritus

Lei,

   You would have to download the app and make changes to the IncidentAnalysis widgets nls/strings.js file and then host the app on your web server.

0 Kudos
LeiZhou1
Occasional Contributor

Yes, that's what I am going to do. But I have no clue what nls/string is. Is this string in the config.js file? Thanks!

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Lei,

  The "Locate Incident" is right in the nls/Widget_ROOT.js and the Widget_en.js. the property is called "locate_incident".

The "Weather" tab label text in found in the config.json. Just look for "tabs" property and then the label property.

And unfortunately the label "Incident" is hard coded into the Widget.js

      this.config.tabs.splice(0, 0, {
        type: "incidents",
        label: "Incident",
        color: this.config.color
      });
LeiZhou1
Occasional Contributor

May I ask what text editor tool you use? When I open the json file or widget.js file using Visual Studio, they have very strange format, like big chunk of codes all together. There are many codes in one line. Is there any method to adjust them? Thanks!

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Lei,

    The code looks like that because it has been minified. I use Adobe Brackets as my IDE and it has a beautify function that adds back line breaks to the code.

0 Kudos
LeiZhou1
Occasional Contributor

Thanks! I will try that. My code looks like this now:

0 Kudos
LeiZhou1
Occasional Contributor

Hi, Robert,

I tried this Brackets IDE, the codes look much better but it seems it's format is still block by block, instead of line by line. I did not find that function you mentioned, where do you find the function that adds back line breaks? Thanks!

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Lei,

   It is a plugin called Beautify. In Brackets IDE on the far right under the lightning bolt there is a lego block that brings up the plugin dialog. You can search for available plugins using the search box. I would suggest getting:

  1. Beautify (by Drew Hamlett)
  2. Code Folding (by Patrick Oladimeji)
  3. Interactive Linter (Miguel Castillo)
  4. Whitespace Normalizer (Dimitar Bonev)
RebeccaStrauch__GISP
MVP Emeritus

Thanks for the list of suggested plugins Robert.  I have used brackets for about a year, but never installed any of these before.  Should be a better and more powerful experience now!