I can't seem to find a way to change the text of the Report It button. There's no way to do it in the configure menus of the app, and I can't find any reference to it in any JS or HTML file in the app's source code. I'm pretty sure this app is using JS API 3.x.
The image here is of the app I'm working on in the local server, but here's an earlier version of it from AGOL: https://willcountygis.maps.arcgis.com/apps/CrowdsourceReporter/index.html?appid=b3c9cb95a838496ea499ef64dd14a11c
How about line 93 of the resources.js file?
crowdsource-reporter-master\js\nls\resources.js
Jared,
Have you searched the js files for "submitButton"?
Robert,
No luck. I've searched "SubmitButton", "Report It" and other variations of that but I can't access that button anywhere in the js files. I found reference to it in the CSS, however. That's how I was able to put the chevron in it.
You can find the text in the apps main.js in these lines of code:
<SPAN class="keyword token">var</SPAN> submitButtonText<SPAN class="punctuation token">,</SPAN> submitButtonColor<SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>config <SPAN class="operator token">&&</SPAN> lang<SPAN class="punctuation token">.</SPAN><SPAN class="token function">trim</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>config<SPAN class="punctuation token">.</SPAN>submitReportButtonText<SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">===</SPAN> <SPAN class="string token">""</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> submitButtonText <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>config<SPAN class="punctuation token">.</SPAN>i18n<SPAN class="punctuation token">.</SPAN>main<SPAN class="punctuation token">.</SPAN>submitReportButtonText<SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="keyword token">else</SPAN> <SPAN class="punctuation token">{</SPAN> submitButtonText <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>config<SPAN class="punctuation token">.</SPAN>submitReportButtonText<SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> domAttr<SPAN class="punctuation token">.</SPAN><SPAN class="keyword token">set</SPAN><SPAN class="punctuation token">(</SPAN>dom<SPAN class="punctuation token">.</SPAN><SPAN class="token function">byId</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"submitFromMapText"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"innerHTML"</SPAN><SPAN class="punctuation token">,</SPAN> submitButtonText<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Line 3 is where the Report It is coming from. So all you need to do is add (or change if it already exists) the submitReportButtonText in the apps config\defaults.js
The "submitReportButtonText" is for the other "submit" button. I already had that changed to "Fill Out Questionnaire" in config/defaults.js.
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.