Skip to content

Commit

Permalink
MapTour 2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregory L'Azou committed Mar 4, 2014
1 parent 7be8184 commit b879bda
Show file tree
Hide file tree
Showing 46 changed files with 1,417 additions and 565 deletions.
30 changes: 27 additions & 3 deletions MapTour/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
pkg: grunt.file.readJSON('package.json'),

clean: {
deploy: ['deploy/'],
deploy: ['deploy/*'],
css: [
'deploy/app/Responsive.css',
'deploy/app/css/',
Expand Down Expand Up @@ -143,6 +143,21 @@
src:['*'],
dest: 'deploy/resources/bootstrap/'
}]
},
colorboxResources: {
files: [{
expand: true,
cwd: 'src/lib/colorbox/img/',
src:['*'],
dest: 'deploy/resources/colorbox/'
}]
},
readme: {
files: [{
expand: true,
src:['Readme.pdf', 'Readme.txt'],
dest: 'deploy/'
}]
}
},

Expand All @@ -168,6 +183,12 @@
search: '../img/',
replace: '../resources/bootstrap/',
flags: 'g'
},
{
name: 'Colorbox images path',
search: 'img/',
replace: '../resources/colorbox/',
flags: 'g'
}
]
},
Expand Down Expand Up @@ -207,7 +228,8 @@
server: {
options: {
port: 8080,
keepalive: true
keepalive: true,
hostname: '*'
}
}
},
Expand Down Expand Up @@ -277,7 +299,9 @@
'copy:config',
'copy:commonConfig',
'copy:bootstrapResources',
'copy:resources'
'copy:colorboxResources',
'copy:resources',
'copy:readme'
]);
};
})();
2 changes: 1 addition & 1 deletion MapTour/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "StorytellingMapTour",
"version": "2.2.1",
"version": "2.2.2",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-clean": "~0.4.0",
Expand Down
2 changes: 1 addition & 1 deletion MapTour/src/app/maptour-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ APPCFG = {
HEADER_LOGO_TARGET: "http://www.esri.com",
// Header top right link
HEADER_LINK_TEXT: "A story map",
HEADER_LINK_URL: "http://storymaps.esri.com/home/",
HEADER_LINK_URL: "http://storymaps.arcgis.com",
// Control display of Facebook and Twitter links
HEADER_SOCIAL: {
facebook: true,
Expand Down
39 changes: 28 additions & 11 deletions MapTour/src/app/storymaps/builder/Builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,14 @@ define(["esri/arcgis/Portal",
access: 'private'
}
);

// Not sure why but the JS API add those unnecessary properties that WPF runtime doesn't like at all
try {
delete webMapItem.itemData.operationalLayers[0].featureCollection.layers[0].id;
delete webMapItem.itemData.operationalLayers[0].featureCollection.layers[0].opacity;
delete webMapItem.itemData.operationalLayers[0].featureCollection.layers[0].visibility;
delete webMapItem.itemData.operationalLayers[0].featureCollection.layers[0].layerObject;
} catch(e){ }

app.portal.signIn().then(
function(){
Expand Down Expand Up @@ -307,6 +315,14 @@ define(["esri/arcgis/Portal",
// Save the webmap in the same folder than the app
if( app.data.getAppItem().ownerFolder )
webMapItem.item.ownerFolder = app.data.getAppItem().ownerFolder;

// Not sure why but the JS API add those unnecessary properties that WPF runtime doesn't like at all
try {
delete webMapItem.itemData.operationalLayers[0].featureCollection.layers[0].id;
delete webMapItem.itemData.operationalLayers[0].featureCollection.layers[0].opacity;
delete webMapItem.itemData.operationalLayers[0].featureCollection.layers[0].visibility;
delete webMapItem.itemData.operationalLayers[0].featureCollection.layers[0].layerObject;
} catch(e){ }

app.portal.signIn().then(
function(){
Expand Down Expand Up @@ -514,10 +530,10 @@ define(["esri/arcgis/Portal",

saveRq.then(
function(response){
app.basemapChanged = false;
if( app.data.sourceIsFS() ) {
FeatureServiceManager.saveFS(
function() {
app.basemapChanged = true;
nextFunction(response);
},
function(error) {
Expand All @@ -534,7 +550,6 @@ define(["esri/arcgis/Portal",
else if ( app.data.sourceIsFS() ) {
FeatureServiceManager.saveFS(
function() {
app.basemapChanged = true;
nextFunction({success: true});
},
function(error) {
Expand Down Expand Up @@ -566,27 +581,29 @@ define(["esri/arcgis/Portal",

function shareAppAndWebmap(sharingMode, callback)
{
// Kind of shitty
// Can only be used to add more privilege

// Looks like sharing to private imply a unshareItems request first
// => don't use it that code to share private without more test
if ( sharingMode != "public" && sharingMode != "account" )
sharingMode = "public";

// Looks like sharing to private imply a unshareItems request first
// Don't use it without more test

// Find items to share - only if they aren't already shared to the proper level
var targetItems = [];
if( sharingMode == "account" ) {
// Need to make sure that the items are not already public
if( app.data.getWebMapItem().item.access != "public" )
if( app.data.getWebMapItem().item.access == "private" && app.data.getWebMapItem().item.owner == app.portal.getPortalUser().username )
targetItems.push(app.data.getWebMapItem().item.id);
if ( app.data.getAppItem().access == "private" )
targetItems.push(app.data.getAppItem().id);
}
else {
if( app.data.getWebMapItem().item.access != "public" && app.data.getWebMapItem().item.owner == app.portal.getPortalUser().username )
targetItems.push(app.data.getWebMapItem().item.id);
if ( app.data.getAppItem().access != "public" )
targetItems.push(app.data.getAppItem().id);
}
else
targetItems = [app.data.getWebMapItem().item.id, app.data.getAppItem().id];

// Also update eventual FS if needed
// TODO: no check if user is the owner or not
if ( app.data.sourceIsFS() && app.data.getFSSourceLayerItemId() )
targetItems.push(app.data.getFSSourceLayerItemId());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ define([],
"type": "Web Mapping Application",
"typeKeywords": ["JavaScript", "Map", "Mapping Site", "Online Map", "Ready To Use", "selfConfigured", "Web Map", "Story Maps", "Map Tour"],
"description": null,
"tags": ["Map Tour"],
"tags": ["Story Map", "Map Tour"],
"snippet": null,
"thumbnail": "thumbnail/ago_downloaded.png",
"documentation": null,
Expand Down
12 changes: 9 additions & 3 deletions MapTour/src/app/storymaps/maptour/builder/PopupViewPicasa.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,15 @@ define(["storymaps/utils/PicasaConnector", "dojo/Deferred"],
$.each(data, function(i, album){
outHtml += '<option value="' + album.url + '">' + album.title + '</option>';
});
_container.find("#picasaListAlbum").html(outHtml);
_container.find("#picasaListAlbum").removeAttr("disabled");
_container.find(".signInMsg").html("");

if (data && data.length) {
_container.find("#picasaListAlbum").html(outHtml);
_container.find("#picasaListAlbum").removeAttr("disabled");
_container.find(".signInMsg").html("");
}
else {
_container.find(".signInMsg").addClass('error').html(i18n.viewer.viewPicasa.signInMsg3);
}
},
function() {
_container.find(".signInMsg").addClass('error').html(i18n.viewer.viewFlickr.signInMsg2);
Expand Down
14 changes: 14 additions & 0 deletions MapTour/src/app/storymaps/maptour/builder/SharePopup.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,20 @@
margin-bottom: 20px;
}

#sharePopup .share-warning {
display: none;
margin-top: 20px;
font-family:Arial, Helvetica, sans-serif;
font-weight:bold !important;
font-size:14px;
color:#c43d40 !important;
}

#sharePopup .share-warning a {
color: #C43D40;
font-weight:bold;
}

#sharePopup .footer {
margin-top: 30px;
}
Expand Down
35 changes: 28 additions & 7 deletions MapTour/src/app/storymaps/maptour/builder/SharePopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ define(["storymaps/utils/Helper"],
else {
var isPrivate = app.data.getAppItem().access == "private";
if ( isPrivate )
presentSharing(itemUrl, appUrl, function(){
presentSharing(itemUrl, appUrl, webmapUrl, function(){
presentShared(appUrl, itemUrl, webmapUrl, fsUrl, contentUrl);
});
else
Expand Down Expand Up @@ -61,7 +61,7 @@ define(["storymaps/utils/Helper"],
}

// Sharing screen
function presentSharing(itemUrl, appUrl, successCallback)
function presentSharing(itemUrl, appUrl, webmapUrl, successCallback)
{
container.find('.share .not-shared .header').html(i18n.viewer.share.sharePrivateHeader);

Expand All @@ -78,37 +78,58 @@ define(["storymaps/utils/Helper"],
});
}
else {
container.find('.btn-sharePublic').on('click', function() {
container.find('.btn-sharePublic').off('click').on('click', function() {
share("public", successCallback);
});
}

// Share with organization
if( app.portal && app.portal.isOrganization ) {
container.find('.not-shared .btn-shareOrga').html(i18n.viewer.share.sharePrivateBtn2);
container.find('.btn-shareOrga').on('click', function() {
container.find('.btn-shareOrga').off('click').on('click', function() {
share("account", successCallback);
});
}
else
container.find('.not-shared .btn-shareOrga').remove();

// If user is not webmap owner (and he hasn't disabled warning)
if ( app.data.getWebMapItem().item.owner != app.portal.getPortalUser().username ) {
var sharingStatus = null;

if (app.data.getWebMapItem().item.access == "account") {
sharingStatus = i18n.viewer.share.shareWarningWith1;
container.find('.not-shared .btn-sharePublic').addClass("disabled").off('click');
}
else if (app.data.getWebMapItem().item.access == "private") {
sharingStatus = i18n.viewer.share.shareWarningWith2;
container.find('.not-shared .btn-sharePublic, .not-shared .btn-shareOrga').addClass("disabled").off('click');
}

if( sharingStatus ) {
container.find('.share-warning').html(
i18n.viewer.share.shareWarning
.replace('%WITH%', sharingStatus)
.replace('%LINK%', webmapUrl)
).show();
}
}

container.find('.modal-footer .error').html(
i18n.viewer.share.sharePrivateErr
+ ' '
+ i18n.viewer.share.shareA1.toLowerCase()
.replace('%shareimg%', '<img src="resources/icons/builder-share-shareBtn.png" style="vertical-align: -5px;"/>')
.replace('%link1%', itemUrl)
+ '.'
);

container.find('.not-shared .btn-learnmore').html(i18n.viewer.initPopupHome.footer5);
container.find('.btn-learnmore').on('click', function() {
container.find('.btn-learnmore').off('click').on('click', function() {
app.builder.openHelpPopup(4);
});

container.find('.not-shared .btn-preview').html(i18n.viewer.share.sharePreviewAsUser);
container.find('.btn-preview').on('click', function() {
container.find('.btn-preview').off('click').on('click', function() {
window.open(appUrl,'_blank');
});
}
Expand Down
17 changes: 13 additions & 4 deletions MapTour/src/app/storymaps/maptour/core/TourData.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,16 @@ define(["storymaps/maptour/core/WebApplicationData",
this.userIsOrgaPublisher = function()
{
var user = app.portal ? app.portal.getPortalUser() : null;
return user && user.orgId && (user.role == 'org_admin' || user.role == 'org_publisher');
var hasCorrectRole = user && user.orgId && (user.role == 'org_admin' || user.role == 'org_publisher');

if ( ! hasCorrectRole )
return false;

// Org has custom role
if ( user.roleId && user.privileges )
return $.inArray("portal:publisher:publishFeatures", user.privileges) != -1;

return true;
};

this.isOrga = function()
Expand Down Expand Up @@ -447,7 +456,7 @@ define(["storymaps/maptour/core/WebApplicationData",
attributes[fields.getIconColorField()] = color;

if ( app.data.layerHasVideoField() )
attributes[fields.getIsVideoField()] = false;
attributes[fields.getIsVideoField()] = "false";

var newPoint = new Graphic(point, null, attributes);

Expand Down Expand Up @@ -478,7 +487,7 @@ define(["storymaps/maptour/core/WebApplicationData",
attributes[fields.getThumbField()] = thumbnailUrl;

if ( app.data.layerHasVideoField() )
attributes[fields.getIsVideoField()] = isVideo;
attributes[fields.getIsVideoField()] = "" + isVideo;

addTourPointUsingAttributes(point, attributes);

Expand Down Expand Up @@ -565,7 +574,7 @@ define(["storymaps/maptour/core/WebApplicationData",
attributes[fields.getIconColorField()] = color;

if ( app.data.layerHasVideoField() )
attributes[fields.getIsVideoField()] = false;
attributes[fields.getIsVideoField()] = "false";

var newPoint = new Graphic(point, null, attributes);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ define(["storymaps/maptour/core/WebApplicationData",
if( ! _fields.getIsVideoField() )
return;

_attributes[_fields.getIsVideoField()] = isVideo;
_attributes[_fields.getIsVideoField()] = "" + isVideo;
};

this.getOriginalGraphic = function()
Expand Down
1 change: 1 addition & 0 deletions MapTour/src/app/storymaps/maptour/ui/mobile/ListView.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

/* The scroll bar */


body.hasTouch .listWrapper > div:nth-child(2) {
display: none;
}
Expand Down
7 changes: 5 additions & 2 deletions MapTour/src/app/storymaps/ui/crossfader/CrossFader.css
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,16 @@ body.hasTouch .btn-fullscreen{
word-wrap: break-word;
}


#placard a {
#placard a {
color:#FFF;
font-family:Arial, Helvetica, sans-serif;
text-decoration: underline;
}

#placard ul {
padding-left: 40px;
}

#placard-bg {
width:100%;
margin-bottom: -5px;
Expand Down
Loading

0 comments on commit b879bda

Please sign in to comment.