Skip to content

Commit

Permalink
release updates
Browse files Browse the repository at this point in the history
  • Loading branch information
driskull committed Dec 17, 2020
1 parent 4edfec1 commit 054d293
Show file tree
Hide file tree
Showing 581 changed files with 36,501 additions and 204,705 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The GeoForm template can be accessed via the ArcGIS template gallery or item det
- ArcGIS Online Example: `"sharinghost": "https://" + “<your organization name>.maps.arcgis.com`
- Portal Example where `arcgis` is the name of the Web Adaptor: `"sharinghost": "https://" + "webadaptor.domain.com/arcgis"`

4. If you are using Portal or a local install of the ArcGIS API for JavaScript, change all references to the ArcGIS API for JavaScript in index.html to refer to your local copy of the API. Search for the references containing `"https://js.arcgis.com/3.33"` and replace this portion of the reference with the url to your local install.
4. If you are using Portal or a local install of the ArcGIS API for JavaScript, change all references to the ArcGIS API for JavaScript in index.html to refer to your local copy of the API. Search for the references containing `"https://js.arcgis.com/3.35"` and replace this portion of the reference with the url to your local install.

- For example: `"https://webadaptor.domain.com/arcgis/jsapi/jsapi"` where `arcgis` is the name of your Web Adaptor.

Expand Down
52 changes: 48 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
<link
rel="stylesheet"
type="text/css"
href="https://js.arcgis.com/3.33/esri/css/esri.css"
href="https://js.arcgis.com/3.35/esri/css/esri.css"
/>
<link
rel="stylesheet"
type="text/css"
href="https://js.arcgis.com/3.33/dijit/themes/claro/claro.css"
href="https://js.arcgis.com/3.35/dijit/themes/claro/claro.css"
/>
<link
rel="stylesheet"
Expand Down Expand Up @@ -76,6 +76,16 @@
</div>
</div>
<div id="fullscreen_container" class="fullscreen-container"></div>
<div id="geoform-ie-message" class="container hidden">
<div class="row">
<div class="col-md-12 col-lg-10 col-lg-offset-1" style="margin-top: 20px;">
<div class="alert alert-warning alert-dismissible" role="alert">
<button id="geoform-ie-message-close" type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span></button>
<div id="geoform-ie-message-text"></div>
</div>
</div>
</div>
</div>
<div id="parentContainter" class="app-content"></div>
<script type="text/javascript">
var webgl = location.search.match(/webgl=([\w-]+)/)
Expand Down Expand Up @@ -111,6 +121,11 @@
name: "vendor",
location: package_path + "/js/vendor",
},
{
name: "Sanitizer",
location: package_path + "/js/vendor/sanitizer",
main: "arcgis-html-sanitizer.min"
},
{
name: "views",
location: package_path + "/views",
Expand All @@ -122,7 +137,7 @@
dojoConfig.locale = RegExp.$1;
}
</script>
<script type="text/javascript" src="https://js.arcgis.com/3.33"></script>
<script type="text/javascript" src="https://js.arcgis.com/3.35"></script>
<script
type="text/javascript"
src="js/vendor/offline/offline.min.js"
Expand All @@ -144,6 +159,30 @@
// create my main application. Start placing your logic in the main.js file.
myTemplate.startup().then(
function (config) {
if (config && config.isIE) {
var containerId = "geoform-ie-message";
var closeId = containerId + "-close";
var textId = containerId + "-text";

var hide = localStorage.getItem(containerId) || false;
if (!hide) {
var englishMsg = "You are using a browser that is deprecated. Some parts of this application may not work optimally or at all in this browser. Support for this browser will be discontinued in the future. Please use the latest versions of Google Chrome, Mozilla Firefox, Apple Safari, or Microsoft Edge. For more information on browser support, see our documentation. Provide your feedback through";
var notificationMessage = englishMsg + "<a href='https://community.esri.com/community/gis/web-gis/arcgisonline'> GeoNet, the Esri Community </a>";

var messageNode = document.getElementById(containerId);
var closeNode = document.getElementById(closeId);
var textNode = document.getElementById(textId);

closeNode.setAttribute("aria-label", config.i18n.user.close);

messageNode.classList.remove("hidden");
textNode.innerHTML = notificationMessage;
closeNode.addEventListener("click", function () {
messageNode.classList.add("hidden");
localStorage.setItem(containerId, true);
});
}
}
//The config object contains the following properties: helper services, (optionally)
//i18n, appid, webmap and any custom values defined by the application.
//In this example we have one called theme.
Expand All @@ -169,7 +208,12 @@
},
function (error) {
// something went wrong. Let's report it.
myApp.reportError(error);
if (error && error.error && error.error === "application:origin-other") {
//display short org error
document.location.href = "../shared/origin/index.html?appUrl=" + error.appUrl;
} else {
myApp.reportError(error);
}
}
);
});
Expand Down
80 changes: 42 additions & 38 deletions js/builder/builder.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/*global $,define,document,require */
define([
"dojo/_base/declare",
"Sanitizer",
"application/sanitizerConfig",
"dojo/_base/declare",
"dojo/on",
"dojo/dom",
"esri/request",
Expand Down Expand Up @@ -28,9 +30,9 @@ define([
"dojo/Deferred",
"esri/basemaps",
"dijit/a11yclick",
"application/wrapper/builder-jquery-deps",
"dojo/domReady!"
], function (declare, on, dom, esriRequest, array, domConstruct, domAttr, query, domClass, domStyle, lang, string, all, number, modalTemplate, builderTemplate, BrowseIdDlg, ShareModal, localStorageHelper, signInHelper, nls, arcgisUtils, theme, pushpins, FeatureLayer, Deferred, esriBasemaps, a11yclick) {
], function (Sanitizer, sanitizerConfig, declare, on, dom, esriRequest, array, domConstruct, domAttr, query, domClass, domStyle, lang, string, all, number, modalTemplate, builderTemplate, BrowseIdDlg, ShareModal, localStorageHelper, signInHelper, nls, arcgisUtils, theme, pushpins, FeatureLayer, Deferred, esriBasemaps, a11yclick) {
var sanitizer = new Sanitizer(sanitizerConfig, true);
return declare([], {
nls: nls,
currentState: "webmap",
Expand Down Expand Up @@ -70,31 +72,33 @@ define([
},

startup: function () {
domClass.add(document.body, "bodyPaddingTop");
var def = new Deferred();
var signIn = new signInHelper(),
userInfo = {};
this.locationSearchOption = {
"enableMyLocation": true,
"enableSearch": true,
"enableLatLng": true,
"enableUSNG": false,
"enableMGRS": false,
"enableUTM": false
};
if (this.config && this.config.i18n && this.config.i18n.direction == "rtl") {
this._loadCSS();
}
signIn.createPortal().then(lang.hitch(this, function (loggedInUser) {
userInfo.username = loggedInUser.username;
userInfo.token = loggedInUser.credential.token;
userInfo.portal = signIn.getPortal();
this._initializeBuilder(this.config, userInfo, this.response);
this._setTabCaption();
domClass.remove(document.body, "app-loading");
def.resolve();
}), lang.hitch(this, function (error) {
def.reject(error);
require(["application/wrapper/builder-jquery-deps"], lang.hitch(this, function() {
domClass.add(document.body, "bodyPaddingTop");
var signIn = new signInHelper(),
userInfo = {};
this.locationSearchOption = {
"enableMyLocation": true,
"enableSearch": true,
"enableLatLng": true,
"enableUSNG": false,
"enableMGRS": false,
"enableUTM": false
};
if (this.config && this.config.i18n && this.config.i18n.direction == "rtl") {
this._loadCSS();
}
signIn.createPortal().then(lang.hitch(this, function (loggedInUser) {
userInfo.username = loggedInUser.username;
userInfo.token = loggedInUser.credential.token;
userInfo.portal = signIn.getPortal();
this._initializeBuilder(this.config, userInfo, this.response);
this._setTabCaption();
domClass.remove(document.body, "app-loading");
def.resolve();
}), lang.hitch(this, function (error) {
def.reject(error);
}));
}));
return def.promise;
},
Expand Down Expand Up @@ -164,11 +168,11 @@ define([
on(dom.byId("done"), a11yclick, lang.hitch(this, function () {
this._updateItem(true);
}));

on(dom.byId("jumbotronDisableOption"), a11yclick, lang.hitch(this, function () {
this.currentConfig.useSmallHeader = true;
}));

on(dom.byId("jumbotronEnableOption"), a11yclick, lang.hitch(this, function () {
this.currentConfig.useSmallHeader = false;
}));
Expand All @@ -178,14 +182,14 @@ define([
on(dom.byId("defaultExtent"), a11yclick, lang.hitch(this, function () {
this.currentConfig.defaultMapExtent = $('#defaultExtent')[0].checked;
}));

on(dom.byId("ShowHideLayerOption"), a11yclick, lang.hitch(this, function () {
this.currentConfig.showLayer = $('#ShowHideLayerOption')[0].checked;
}));
on(dom.byId("disableLogo"), a11yclick, lang.hitch(this, function () {
this.currentConfig.disableLogo = !this.currentConfig.disableLogo;
}));

on(dom.byId("enableBasemapToggle"), a11yclick, lang.hitch(this, function () {
this.currentConfig.enableBasemapToggle = $('#enableBasemapToggle')[0].checked;
if (this.currentConfig.enableBasemapToggle) {
Expand All @@ -194,15 +198,15 @@ define([
$('#basemapContainer').hide();
}
}));

on(dom.byId("locateOnLoad"), a11yclick, lang.hitch(this, function () {
this.currentConfig.locate = !this.currentConfig.locate;
}));

on(dom.byId("EnableOfflineSupport"), a11yclick, lang.hitch(this, function () {
this.currentConfig.enableOfflineSupport = !this.currentConfig.enableOfflineSupport;
}));

on(dom.byId("disableViewer"), a11yclick, lang.hitch(this, function () {
this.currentConfig.disableViewer = !this.currentConfig.disableViewer;
}));
Expand Down Expand Up @@ -547,11 +551,11 @@ define([
this.config.details.Title = this.response.item.title;
}
}
dom.byId("detailTitleInput").value = this.currentConfig.details.Title;
dom.byId("detailLogoInput").value = this.currentConfig.details.Logo;
dom.byId("detailDescriptionInput").innerHTML = this.currentConfig.details.Description;
dom.byId("submitButtonText").value = this.currentConfig.submitButtonText;
dom.byId("viewSubmissionsText").value = this.currentConfig.viewSubmissionsText;
dom.byId("detailTitleInput").value = sanitizer.sanitize(this.currentConfig.details.Title);
dom.byId("detailLogoInput").value = sanitizer.sanitize(this.currentConfig.details.Logo);
dom.byId("detailDescriptionInput").innerHTML = sanitizer.sanitize(this.currentConfig.details.Description);
dom.byId("submitButtonText").value = sanitizer.sanitize(this.currentConfig.submitButtonText);
dom.byId("viewSubmissionsText").value = sanitizer.sanitize(this.currentConfig.viewSubmissionsText);
$(document).ready(function () {
$('#detailDescriptionInput').summernote({
height: 200,
Expand Down
83 changes: 44 additions & 39 deletions js/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/*global $,define,document,require,moment */
/*jslint sloppy:true,nomen:true */
define([
"Sanitizer",
"application/sanitizerConfig",
"dojo/_base/declare",
"dojo/_base/kernel",
"dojo/_base/lang",
Expand Down Expand Up @@ -41,9 +43,10 @@ define([
"vendor/usng",
"dijit/a11yclick",
"dojo/NodeList-traverse",
"application/wrapper/main-jquery-deps",
"dojo/domReady!"
], function (
Sanitizer,
sanitizerConfig,
declare,
kernel,
lang,
Expand All @@ -67,6 +70,7 @@ define([
userTemplate,
nls, ProjectParameters, webMercatorUtils, Point, GraphicsLayer, ShareModal, localStorageHelper, Graphic, PictureMarkerSymbol, editToolbar, InfoTemplate, Popup, theme, pushpins, SearchSources, usng, a11yclick) {

var sanitizer = new Sanitizer(sanitizerConfig, true);
var NORTHING_OFFSET = 10000000.0; // (meters)

return declare([], {
Expand All @@ -89,41 +93,42 @@ define([
dateFormat: "LLL",

startup: function (config, appResponse, isPreview, node) {
require(["application/wrapper/main-jquery-deps"], lang.hitch(this, function(){
document.documentElement.lang = kernel.locale;

document.documentElement.lang = kernel.locale;

this._appResponse = appResponse;
var localStorageSupport = new localStorageHelper();
if (localStorageSupport.supportsStorage() && localStorage.getItem("geoform_config")) {
config = JSON.parse(localStorage.getItem("geoform_config"));
localStorage.clear();
}
// config will contain application and user defined info for the template such as i18n strings, the web map id
// and application id
// any url parameters and any application specific configuration information.
if (config) {
this.config = config;
// create localstorage helper
this.localStorageSupport = new localStorageHelper();
// modal i18n
var modalTemplateSub = string.substitute(modalTemplate, {
id: "myModal",
title: "",
labelId: "myModalLabel",
close: nls.user.close
});
// place modal code
domConstruct.place(modalTemplateSub, document.body, 'last');
//supply either the webmap id or, if available, the item info
if (isPreview) {
this._initPreview(node);
this._appResponse = appResponse;
var localStorageSupport = new localStorageHelper();
if (localStorageSupport.supportsStorage() && localStorage.getItem("geoform_config")) {
config = JSON.parse(localStorage.getItem("geoform_config"));
localStorage.clear();
}
// config will contain application and user defined info for the template such as i18n strings, the web map id
// and application id
// any url parameters and any application specific configuration information.
if (config) {
this.config = config;
// create localstorage helper
this.localStorageSupport = new localStorageHelper();
// modal i18n
var modalTemplateSub = string.substitute(modalTemplate, {
id: "myModal",
title: "",
labelId: "myModalLabel",
close: nls.user.close
});
// place modal code
domConstruct.place(modalTemplateSub, document.body, 'last');
//supply either the webmap id or, if available, the item info
if (isPreview) {
this._initPreview(node);
} else {
this._init();
}
} else {
this._init();
var error = new Error("Main:: Config is not defined");
this.reportError(error);
}
} else {
var error = new Error("Main:: Config is not defined");
this.reportError(error);
}
}));
},

_loadCSS: function () {
Expand Down Expand Up @@ -450,13 +455,13 @@ define([
}
// set title
if (appConfigurations.Title) {
appTitleNode.innerHTML = appConfigurations.Title;
appTitleNode.innerHTML = sanitizer.sanitize(appConfigurations.Title);
} else {
domClass.add(appTitleNode, "hide");
}
// set description
if (appConfigurations.Description) {
appDescNode.innerHTML = appConfigurations.Description;
appDescNode.innerHTML = sanitizer.sanitize(appConfigurations.Description);
} else {
domClass.add(appDescNode, "hide");
}
Expand Down Expand Up @@ -1541,8 +1546,8 @@ define([
this._setLayerDefaults();
// set configuration
this._setAppConfigurations(this.config.details);
domAttr.set(dom.byId('submitButton'), "innerHTML", this.config.submitButtonText ? this.config.submitButtonText : nls.user.submitButtonText);
domAttr.set(dom.byId('viewSubmissionsButton'), "innerHTML", this.config.viewSubmissionsText ? this.config.viewSubmissionsText : nls.user.btnViewSubmissions);
domAttr.set(dom.byId('submitButton'), "innerHTML", this.config.submitButtonText ? sanitizer.sanitize(this.config.submitButtonText) : nls.user.submitButtonText);
domAttr.set(dom.byId('viewSubmissionsButton'), "innerHTML", this.config.viewSubmissionsText ? sanitizer.sanitize(this.config.viewSubmissionsText) : nls.user.btnViewSubmissions);
// window title
if (this.config.details && this.config.details.Title) {
window.document.title = this.config.details.Title;
Expand Down Expand Up @@ -2627,7 +2632,7 @@ define([
className: "btn btn-default pull-left",
href: "#",
id: "viewSubmissionsOption",
innerHTML: this.config.viewSubmissionsText ? this.config.viewSubmissionsText : nls.user.btnViewSubmissions
innerHTML: this.config.viewSubmissionsText ? sanitizer.sanitize(this.config.viewSubmissionsText) : nls.user.btnViewSubmissions
}, query(".modal-footer")[0]);
if (this.config.disableViewer) {
domClass.add(dom.byId("viewSubmissionsOption"), "hidden");
Expand Down Expand Up @@ -2968,4 +2973,4 @@ define([
}
}
});
});
});
Loading

0 comments on commit 054d293

Please sign in to comment.