Skip to content

Commit

Permalink
update template
Browse files Browse the repository at this point in the history
  • Loading branch information
driskull committed Jun 28, 2017
1 parent f3eec73 commit c7ecb4d
Show file tree
Hide file tree
Showing 44 changed files with 148 additions and 40 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ The template can be configured using the following options:
1. To deploy this application, download the template from Portal/ArcGIS Online and unzip it.
2. Copy the unzipped folder containing the web app template files, such as index.html, to your web server. You can rename the folder to change the URL through which users will access the application. By default the URL to the app will be `http://<Your Web Server>/<app folder name>/index.html`
3. Change the sharing host, found in defaults.js inside the config folder for the application, to the sharing URL for ArcGIS Online or Portal. For ArcGIS Online users, keep the default value of www.arcgis.com or specify the name of your organization.
- ArcGIS Online Example: `"sharinghost": location.protocol + "//" + “<your organization name>.maps.arcgis.com`
- Portal Example where `arcgis` is the name of the Web Adaptor: `"sharinghost": location.protocol + "//" + "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 `"//js.arcgis.com/3.20"` and replace this portion of the reference with the url to your local install.
- For example: `"//webadaptor.domain.com/arcgis/jsapi/jsapi"` where `arcgis` is the name of your Web Adaptor.
- 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.21"` 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.
5. Copy a map or group ID from Portal/ArcGIS Online and replace the default web map ID in the application’s index.html page. You can now run the application on your web server or customize the application further.

> **Note:** If your application edits features in a feature service, contains secure services or web maps that aren't shared publicly, or generate requests that exceed 200 characters, you may need to set up and use a proxy page. Common situations where you may exceed the URL length are using complex polygons as input to a task or specifying a spatial reference using well-known text (WKT). For details on installing and configuring a proxy page see [Using the proxy](https://developers.arcgis.com/javascript/jshelp/ags_proxy.html). If you do not have an Internet connection, you will need to access and deploy the ArcGIS API for JavaScript documentation from [developers.arcgis.com](https://developers.arcgis.com/).
Expand Down
2 changes: 1 addition & 1 deletion config/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ define({
//Enter the url to your organizations bing maps key if you want to use bing basemaps
"bingmapskey": "",
//Defaults to arcgis.com. Set this value to your portal or organization host name.
"sharinghost": location.protocol + "//" + "www.arcgis.com",
"sharinghost": "https://www.arcgis.com",
"units": null,
"helperServices": {
"geometry": {
Expand Down
22 changes: 11 additions & 11 deletions css/browseDialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,46 +38,46 @@
.soria .ui-state-active {
background-color: #fff;
}
.dgrid-row {
#browse-id-box .dgrid-row {
width: 125px;
float: left;
text-align: center;
padding: 1em 3px;
border: solid 1px #fff !important;
margin: 2px;
}
.dgrid-scroller {
#browse-id-box .dgrid-scroller {
overflow-y: auto !important;
}
.dgrid-pagination-links:hover {
#browse-id-box .dgrid-pagination-links:hover {
cursor: pointer;
}
.dgrid-pagination .dgrid-page-disabled {
#browse-id-box .dgrid-pagination .dgrid-page-disabled {
color: hsl(0, 0%, 67%) !important;
cursor: default;
}
.dgrid-page-link {
#browse-id-box .dgrid-page-link {
cursor: pointer;
}
.dgrid-active {
#browse-id-box .dgrid-active {
background-color: #fff;
}
.dgrid-selected {
#browse-id-box .dgrid-selected {
border-radius: 4px;
background-color: #fff;
border: solid 1px #BFD6EB !important;
}
.dgrid-row .dgrid-row-odd {
#browse-id-box .dgrid-row .dgrid-row-odd {
background-color: #fff;
}
.dgrid-row .dgrid-row-even {
#browse-id-box .dgrid-row .dgrid-row-even {
background-color: #fff;
}
.dgrid-row:hover {
#browse-id-box .dgrid-row:hover {
border-radius: 4px;
background-color: #E1F0FB !important;
}
;

.truncate {
white-space: nowrap;
overflow: hidden;
Expand Down
7 changes: 3 additions & 4 deletions dataBrowser.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<title>Data Browser</title>
<style>
html, body
Expand All @@ -21,8 +20,8 @@
</style>
</head>
<body class="claro">
<link rel="stylesheet" href="http://js.arcgis.com/3.20/dijit/themes/claro/claro.css" />
<link rel="stylesheet" href="http://js.arcgis.com/3.20/esri/css/esri.css" />
<link rel="stylesheet" href="http://js.arcgis.com/3.21/dijit/themes/claro/claro.css" />
<link rel="stylesheet" href="http://js.arcgis.com/3.21/esri/css/esri.css" />
<script type="text/javascript">
var package_path = window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/'));
var dojoConfig = {
Expand All @@ -39,7 +38,7 @@
dojoConfig.locale = RegExp.$1;
}
</script>
<script src="//js.arcgis.com/3.20"></script>
<script src="https://js.arcgis.com/3.21"></script>
<script type="text/javascript">
var dataBrowser;
require([
Expand Down
11 changes: 5 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
<title>Impact Summary Map</title>
<meta name="fragment" content="!">
<meta charset="utf-8" />
<!--Define the versions of IE that will be used to render the page. See Microsoft documentation for details. Optional.-->
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- Responsive -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="mobile-web-app-capable" content="yes">
Expand All @@ -23,10 +21,11 @@
<meta property="og:image" content="images/item.png" />
<meta property="og:site_name" content="esri" />
<!-- End Facebook -->
<!--Use protocol relative urls that way if the browser is viewing the page via HTTPS the js/css file will be requested using the HTTPS protocol-->
<link rel="stylesheet" type="text/css" href="//js.arcgis.com/3.20/esri/css/esri.css">
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Lato:300,400,700" />
<link rel="stylesheet" type="text/css" href="https://js.arcgis.com/3.21/esri/css/esri.css">
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Lato:300,400,700" />
<!--Load any application specific styles-->
<link rel="stylesheet" href="https://js.arcgis.com/3.21/dgrid/css/dgrid.css">
<link rel="stylesheet" href="https://js.arcgis.com/3.21/dgrid/css/skins/claro.css">
<link id="claroTheme" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="css/dijit.css" />
<link rel="stylesheet" type="text/css" href="css/fontello.css" />
Expand Down Expand Up @@ -111,7 +110,7 @@
dojoConfig.locale = RegExp.$1;
}
</script>
<script type="text/javascript" src="//js.arcgis.com/3.20"></script>
<script type="text/javascript" src="https://js.arcgis.com/3.21"></script>
<script type="text/javascript">
require([
"config/templateConfig",
Expand Down
2 changes: 1 addition & 1 deletion js/ShareDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ define([
urlObject.query.extent = null;
}
// create base url
url = window.location.protocol + '//' + window.location.host + window.location.pathname;
url = 'https://' + window.location.host + window.location.pathname;
// each param
for (var i in urlObject.query) {
if (urlObject.query[i]) {
Expand Down
44 changes: 40 additions & 4 deletions js/TemplateBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ define([
"application/BrowseIdDlg",
"application/EnrichLayer",
"esri/basemaps",
"esri/arcgis/utils"
"esri/arcgis/utils",
"esri/dijit/AppProxySettings"
],
function (
declare,
lang,
_WidgetBase,
ContentPane,
dom, on, number, string, query, array, domConstruct, domClass, Dialog, esriRequest, domAttr, domStyle, nls, topic, keys, Editor, TooltipDialog, popup, aspect, FullScreen, LinkDialog, ViewSource, BrowseIdDlg, EnrichLayer, esriBasemaps, arcgisUtils) {
dom, on, number, string, query, array, domConstruct, domClass, Dialog, esriRequest, domAttr, domStyle, nls, topic, keys, Editor, TooltipDialog, popup, aspect, FullScreen, LinkDialog, ViewSource, BrowseIdDlg, EnrichLayer, esriBasemaps, arcgisUtils, AppProxySettings) {
var Widget = declare([_WidgetBase], {
declaredClass: "application.TemplateBuilder",
//URL for updating Item
Expand Down Expand Up @@ -97,7 +98,7 @@ function (
_loadCSS: function () {
//Load claro css
if (dom.byId("claroTheme")) {
domAttr.set(dom.byId("claroTheme"), "href", location.protocol + "//js.arcgis.com/3.20/dijit/themes/claro/claro.css");
domAttr.set(dom.byId("claroTheme"), "href", "https://js.arcgis.com/3.21/dijit/themes/claro/claro.css");
}
domClass.add(document.body, "claro");
//Load browser dialog
Expand All @@ -109,11 +110,12 @@ function (
},

_showBuilderMode: function (builderNode) {
var buttonContainer, dataConfigurationButton, appSettingConfigurationButton, previewModeButton, saveButtonContainer,
var buttonContainer, dataConfigurationButton, appSettingConfigurationButton, previewModeButton, saveButtonContainer, appProxiesButton,
applicationSettingSaveButton, unsavedChangesText, browseParams;
buttonContainer = domConstruct.create("div", { "class": "esriButtonContainer" }, builderNode);
dataConfigurationButton = domConstruct.create("button", { innerHTML: nls.widgets.TemplateBuilder.dataConfigurationButtonText, "class": "esriButton" }, buttonContainer);
appSettingConfigurationButton = domConstruct.create("button", { "style": "margin-left:10px;", "class": "esriButton", innerHTML: nls.widgets.TemplateBuilder.applicationSettingText }, buttonContainer);
appProxiesButton = domConstruct.create("button", { "style": "margin-left:10px;", "class": "esriButton", innerHTML: nls.widgets.TemplateBuilder.appProxiesText }, buttonContainer);
previewModeButton = domConstruct.create("button", { "style": "margin-left:10px;", "class": "esriButton", innerHTML: nls.widgets.TemplateBuilder.exitBuilderButtonText }, buttonContainer);
saveButtonContainer = domConstruct.create("div", { "class": "esriSaveButtonContainer" }, builderNode);
applicationSettingSaveButton = domConstruct.create("button", { innerHTML: nls.widgets.TemplateBuilder.saveButtonText, "class": "esriButton esriSaveButton" }, saveButtonContainer);
Expand All @@ -131,6 +133,10 @@ function (
this._createConfigurationPanel(true);
}

on(appProxiesButton, "click", lang.hitch(this, function () {
this._createAppProxiesPanel();
}));

on(appSettingConfigurationButton, "click", lang.hitch(this, function () {
this._createAppSettingsPanel();
}));
Expand Down Expand Up @@ -191,6 +197,36 @@ function (
}
},

_createAppProxiesPanel: function(){
if (!this._proxiesDialog) {
var proxiesContainer;
proxiesContainer = domConstruct.create("div", { "class": "esriAppSettingPanelContainer claro","style": { "width":"500px", "height": "400px"} }, null);

domConstruct.create("p", {innerHTML: nls.widgets.TemplateBuilder.appProxiesDesc}, proxiesContainer);

var appProxyWidget = new AppProxySettings({
proxyManagerOptions: {
appid: this.config.appid
},
webmaps: [this.config.webmap]
}, domConstruct.create("div", {
id: "appProxyWidget"
}));
appProxyWidget.startup();
domConstruct.place(appProxyWidget.domNode, proxiesContainer);

//create dialog and show entire application settings
this._proxiesDialog = new Dialog({
title: nls.widgets.TemplateBuilder.appProxiesText,
"class": "esriDijitDialog",
draggable: false
});
this._proxiesDialog.setContent(proxiesContainer);
}

this._proxiesDialog.show();
},

/* This section creates Application setting dialog which will be used to configureentire application at one go */
//function to create Application settigns panel
//function creates Left,Right,Basemap and Bottom panel
Expand Down
1 change: 1 addition & 0 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ function (
},
editable: false,
usePopupManager: true,
layerMixins: this.config.layerMixins || [],
bingMapsKey: this.config.bingmapskey
}).then(lang.hitch(this, function (response) {
//Once the map is created we get access to the response which provides important info
Expand Down
2 changes: 2 additions & 0 deletions js/nls/TemplateBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ define({
"layerLabelText": "Layer",
"noLayerFoundText": "No Layer Found",
"selectLayer": "Select Layer",
"appProxiesText": "Subscriber Access",
"appProxiesDesc": "To allow public access via your subscription, check the appropriate boxes. Content marked as Premium Content will consume credits from your subscription.",
"applicationSettingText": "Application Settings",
"summaryAttrAscendingOrderTooltip": "Ascending",
"onStartLabel": "On Start",
Expand Down
2 changes: 2 additions & 0 deletions js/nls/ar/TemplateBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ define({
"layerLabelText": "الطبقة",
"noLayerFoundText": "لم يتم إيجاد الطبقة",
"selectLayer": "تحديد الطبقة",
"appProxiesText": "وصول المشترك",
"appProxiesDesc": "للسماح بالوصول العام عن طريق الاشتراك الخاص بك، قم بالتأشير على الخانات المناسبة. سوف يستهلك المحتوى ذات علامة محتوى مميز اعتمادات من الاشتراك الخاص بك.",
"applicationSettingText": "إعدادات التطبيق",
"summaryAttrAscendingOrderTooltip": "تصاعدي",
"onStartLabel": "عند البدء",
Expand Down
2 changes: 2 additions & 0 deletions js/nls/bs/TemplateBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ define({
"layerLabelText": "Sloj",
"noLayerFoundText": "Sloj nije pronađen",
"selectLayer": "Odabir sloja",
"appProxiesText": "Pretplatnički pristup",
"appProxiesDesc": "Za omogućivanje javnog pristupa putem vaše pretplate Označite odgovarajuće okvire. Sadržaj koji je označen kao premium trošit će kredite iz vaše pretplate.",
"applicationSettingText": "Postavke aplikacije",
"summaryAttrAscendingOrderTooltip": "Uzlazno",
"onStartLabel": "Na početku",
Expand Down
2 changes: 2 additions & 0 deletions js/nls/cs/TemplateBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ define({
"layerLabelText": "Vrstva",
"noLayerFoundText": "Nebyla nalezena žádná vrstva",
"selectLayer": "Vybrat vrstvu",
"appProxiesText": "Přístup pro předplatitele",
"appProxiesDesc": "Chcete-li povolit veřejný přístup prostřednictvím předplatného, zaškrtněte příslušná políčka. Obsah označený jako Prémiový obsah bude z vašeho předplatného čerpat kredity.",
"applicationSettingText": "Nastavení aplikace",
"summaryAttrAscendingOrderTooltip": "Vzestupně",
"onStartLabel": "Při spuštění",
Expand Down
2 changes: 2 additions & 0 deletions js/nls/da/TemplateBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ define({
"layerLabelText": "Lag",
"noLayerFoundText": "Ingen lag fundet",
"selectLayer": "Vælg lag",
"appProxiesText": "Abonnentadgang",
"appProxiesDesc": "Hvis du vil tillade offentlig adgang via dit abonnement, skal du markere de relevante felter. Indhold, der er markeret som Premium-indhold, vil forbruge credits fra dit abonnement.",
"applicationSettingText": "Applikationsindstillinger",
"summaryAttrAscendingOrderTooltip": "Stigende",
"onStartLabel": "Ved start",
Expand Down
2 changes: 2 additions & 0 deletions js/nls/de/TemplateBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ define({
"layerLabelText": "Layer",
"noLayerFoundText": "Kein Layer gefunden",
"selectLayer": "Layer auswählen",
"appProxiesText": "Abonnentenzugriff",
"appProxiesDesc": "Aktivieren Sie die entsprechenden Kontrollkästchen, um den Zugang der Öffentlichkeit über Ihre Subskription zuzulassen. Bei Inhalten, die als Premium-Inhalte gekennzeichnet sind, werden Credits von Ihrer Subskription verbraucht.",
"applicationSettingText": "Anwendungseinstellungen",
"summaryAttrAscendingOrderTooltip": "Aufsteigend",
"onStartLabel": "Beim Start",
Expand Down
2 changes: 2 additions & 0 deletions js/nls/el/TemplateBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ define({
"layerLabelText": "Θεματικό επίπεδο",
"noLayerFoundText": "Δεν βρέθηκε θεματικό επίπεδο",
"selectLayer": "Επιλογή θεματικού επιπέδου",
"appProxiesText": "Πρόσβαση συνδρομητή",
"appProxiesDesc": "Για να επιτρέπεται η δημόσια πρόσβαση μέσω της συνδρομής σας, επιλέξτε τα κατάλληλα πλαίσια. Το περιεχόμενο με την ένδειξη Premium Content θα καταναλώνει μονάδες από τη συνδρομή σας.",
"applicationSettingText": "Ρυθμίσεις εφαρμογής",
"summaryAttrAscendingOrderTooltip": "Αύξουσα",
"onStartLabel": "Κατά την εκκίνηση",
Expand Down
2 changes: 2 additions & 0 deletions js/nls/es/TemplateBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ define({
"layerLabelText": "Capa",
"noLayerFoundText": "No se ha encontrado ninguna capa",
"selectLayer": "Seleccionar capa",
"appProxiesText": "Acceso de suscriptor",
"appProxiesDesc": "Para permitir el acceso público a través de su suscripción, active las casillas adecuadas. El contenido marcado como Premium consumirá créditos de su suscripción.",
"applicationSettingText": "Configuración de la aplicación",
"summaryAttrAscendingOrderTooltip": "Ascendente",
"onStartLabel": "En el inicio",
Expand Down
2 changes: 2 additions & 0 deletions js/nls/et/TemplateBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ define({
"layerLabelText": "Kiht",
"noLayerFoundText": "Kihti ei leitud",
"selectLayer": "Vali kiht",
"appProxiesText": "Tellija juurdepääs",
"appProxiesDesc": "Teie tellimuse kaudu avaliku ligipääsu lubamiseks märkige vastavad märkeruudud. Kvaliteetsisu kasutab krediite teie tellimusest.",
"applicationSettingText": "Rakenduse seaded",
"summaryAttrAscendingOrderTooltip": "Kasvav",
"onStartLabel": "Käivitamisel",
Expand Down
2 changes: 2 additions & 0 deletions js/nls/fi/TemplateBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ define({
"layerLabelText": "Karttataso",
"noLayerFoundText": "Yhtään karttatasoa ei löytynyt",
"selectLayer": "Valitse karttataso",
"appProxiesText": "Tilaajakäyttöoikeus",
"appProxiesDesc": "Jos haluat sallia julkisen käytön tilauksesi kautta, valitse asianmukaiset valintaruudut. Sisältö, joka on merkitty Premium-sisällöksi, kuluttaa tilauksesi krediittejä.",
"applicationSettingText": "Sovelluksen asetukset",
"summaryAttrAscendingOrderTooltip": "Nouseva",
"onStartLabel": "Aloituksessa",
Expand Down
Loading

0 comments on commit c7ecb4d

Please sign in to comment.