Skip to content

Commit

Permalink
Swipe 1.15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cooney committed Jul 3, 2018
1 parent 8c735f2 commit f1cbc9f
Show file tree
Hide file tree
Showing 50 changed files with 4,823 additions and 356 deletions.
522 changes: 261 additions & 261 deletions Swipe/Gruntfile.js

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions Swipe/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "StorytellingSwipe",
"version": "1.14.0",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-clean": "~0.4.0",
"grunt-contrib-concat": "~0.2.0",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-requirejs": "~0.4.1",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-cssmin": "~0.6.1",
"grunt-regex-replace": "~0.2.5",
"grunt-rename": "~0.1.2",
"grunt-contrib-jshint": "~0.4.3"
}
}
{
"name": "StorytellingSwipe",
"version": "1.15.0",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-clean": "~0.4.0",
"grunt-contrib-concat": "~0.2.0",
"grunt-contrib-uglify": "~0.2.0",
"grunt-contrib-requirejs": "~0.4.1",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-cssmin": "~0.6.1",
"grunt-regex-replace": "~0.2.5",
"grunt-rename": "~0.1.2",
"grunt-contrib-jshint": "~0.4.3"
}
}
61 changes: 47 additions & 14 deletions Swipe/src/app/storymaps/builder/Builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,42 +91,75 @@ define(["esri/arcgis/Portal",
app.cleanApp = cleanApp;

// Show https-transition notification when app loads
if (!app.data.isOrga()) {
if (!app.isPortal) {
topic.subscribe('SWIPE_READY', function() {
var strings = i18n.viewer.httpsTransitionMessage;
var stringsSurvey = i18n.june2018SurveyMessage;
var stringsHttps = i18n.httpsTransitionNotification;
new BannerNotification({
id: "storymapsSurvey",
bannerMsg: stringsSurvey.bannerMsg,
primaryColor: '#1e8a87',
mainMsgHtml: '\
<h2>' + stringsSurvey.s1h1 + '</h2>\
<p>' + stringsSurvey.s1p1 + '</p>\
<p>' + stringsSurvey.s2p1 + '</p>\
',
actions: [
{
string: stringsSurvey.action1,
closeOnAction: true
},
{
primary: true,
string: stringsSurvey.action2,
closeOnAction: true,
action: function() {
window.open('https://links.esri.com/storymaps/june2018-survey');
}
}
],
cookie: {
domain: 'arcgis.com',
path: '/',
maxAge: 60 * 60 * 24 * 365
},
autohideAfter: new Date() > new Date(/*'July 31 2018'*/) ? 0 : 2
});
new BannerNotification({
id: "httpsTransitionMessage",
bannerMsg: strings.bannerMsg,
bannerMsg: i18n.viewer.httpsTransitionMessage.bannerMsg,
mainMsgHtml: '\
<h2>' + strings.s1h1 + '</h2>\
<p>' + strings.s1p1 + '</p>\
<p>' + strings.s1p2 + '</p>\
<h2>' + strings.s2h1 + '</h2>\
<p>' + strings.s2p1 + '</p>\
',
<h2>' + stringsHttps.s1h1 + '</h2>\
<p>' + stringsHttps.s1p1 + '</p>\
<p>' + stringsHttps.s1p2 + '</p>\
<h2>' + stringsHttps.s2h1 + '</h2>\
<p>' + stringsHttps.s2p1 + '</p>\
',
actions: [
{
primary: true,
string: strings.action1,
string: stringsHttps.action1,
closeOnAction: true
},
{
string: strings.action2,
string: stringsHttps.action2,
action: function() {
window.open('https://storymaps.arcgis.com/en/my-stories/');
}
},
{
string: strings.action3,
string: stringsHttps.action3,
action: function() {
window.open('https://links.esri.com/storymaps/web_security_faq');
}
}
],
cookie: {
domain: window.location.hostname,
domain: 'arcgis.com',
path: '/',
maxAge: 60 * 60 * 24 * 365
}
},
blockingNotifications: 'storymapsSurvey'
});
});
}
Expand Down
51 changes: 49 additions & 2 deletions Swipe/src/app/storymaps/core/Core.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ define(["esri/map",
"esri/arcgis/utils",
"esri/dijit/Legend",
"storymaps/utils/Helper",
"storymaps/utils/arcgis-html-sanitizer",
// Core
"storymaps/swipe/core/Config",
"storymaps/swipe/core/Data",
Expand All @@ -12,6 +13,8 @@ define(["esri/map",
"storymaps/ui/header/Header",
"storymaps/ui/mapCommand/MapCommand",
"storymaps/ui/SelectMapWidget/browse-dialog/js/BrowseIdDlg",
//Embed bar
"storymaps/ui/EmbedBar/EmbedBar",
// Utils
"dojo/has",
"esri/IdentityManager",
Expand All @@ -37,13 +40,15 @@ define(["esri/map",
arcgisUtils,
Legend,
Helper,
Sanitizer,
Config,
Data,
WebApplicationData,
SwipeHelper,
Header,
MapCommand,
BrowseIdDlg,
EmbedBar,
has,
IdentityManager,
ArcGISOAuthInfo,
Expand Down Expand Up @@ -141,6 +146,14 @@ define(["esri/map",
popup: [],
isPopup: false,
search: null,
sanitizer: new Sanitizer({
whiteList: {
ul: [],
li: [],
u: [],
font: ['face', 'size']
}
}, true),
// Builder
builder: builder,
isInBuilderMode: isInBuilderMode,
Expand Down Expand Up @@ -464,7 +477,12 @@ define(["esri/map",
},
callbackParamName: "callback",
load: function (response) {
WebApplicationData.set(response);
if(app.data.getAppItem().created > APPCFG.HTML_SANITIZER_DATE){
var sanitizedValues = app.sanitizer.sanitize(response);
WebApplicationData.set(sanitizedValues);
} else{
WebApplicationData.set(response);
}
},
error: function(){ }
});
Expand Down Expand Up @@ -958,6 +976,35 @@ define(["esri/map",
{
console.log("swipe.core.Core - initMap");

// Initialize Embed bar
var urlParams = esri.urlToObject(document.location.search).query || {};
var classicEmbedMode = urlParams.classicEmbedMode ? true : urlParams.classicEmbedMode === "" ? true : urlParams.classicembedmode ? true : urlParams.classicembedmode === "" ? true : false;
var isEsriLogo = app.data.getWebAppData().logoURL == null ? true : false;
var strings = i18n.embedBar;
lang.mixin(strings, {
open: i18n.swipe.share.shareLinkOpen,
close: i18n.viewer.bannerNotification.close,
shareFacebook: i18n.viewer.desktopView.facebookTooltip,
shareTwitter: i18n.viewer.desktopView.twitterTooltip
});

var shareElements = [$(".shareIcon")];

app.embedBar = new EmbedBar({
classicEmbedMode: classicEmbedMode,
strings: strings,
appCreationDate: app.data.getAppItem().created,
june2018ReleaseDate: APPCFG.JUNE_RELEASE_DATE,
isBuilder: app.isInBuilderMode,
isEsriLogo: isEsriLogo,
logoPath: "resources/icons/esri-logo-black.png",
logoElements: [$(".logo")],
taglineElements: [$(".msLink")],
shareElements: shareElements,
appTitle: app.data.getWebAppData().title,
bitlyCreds: [APPCFG.HEADER_SOCIAL.bitly.key, APPCFG.HEADER_SOCIAL.bitly.login]
});

var index = 0;

new MapCommand(
Expand Down Expand Up @@ -1118,7 +1165,7 @@ define(["esri/map",
var heightViewport = $("body").height();
var heightHeader = $("#header").height();
var heightSeriesPanel = $("#seriesPanel").height();
var heightMiddle = heightViewport - heightHeader - heightSeriesPanel;
var heightMiddle = heightViewport - heightHeader - heightSeriesPanel - (app.embedBar && app.embedBar.initiated ? 26 : 0);
if(isMobileView && heightSeriesPanel > 0)
heightMiddle -= ($('#footerMobile').height() - heightSeriesPanel);
app.header.resize(widthViewport);
Expand Down
2 changes: 2 additions & 0 deletions Swipe/src/app/storymaps/swipe/ui/desktop/SidePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ define(["storymaps/swipe/core/WebApplicationData",

this.checkDescription = function(fromSaveButton)
{
if(!app.isInBuilderMode)
return;
//Blur method from component isnt good, have to check for real change
setTimeout(function(){
//Blur method from component isnt good, have to check for real change
Expand Down
Loading

0 comments on commit f1cbc9f

Please sign in to comment.