Skip to content

Commit

Permalink
Swipe 1.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cooney committed Mar 3, 2017
1 parent 4f52793 commit a52a540
Show file tree
Hide file tree
Showing 17 changed files with 4,454 additions and 3,695 deletions.
2 changes: 1 addition & 1 deletion Swipe/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "StorytellingSwipe",
"version": "1.9.3",
"version": "1.10.0",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-clean": "~0.4.0",
Expand Down
32 changes: 30 additions & 2 deletions Swipe/src/app/storymaps/core/Core.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,50 @@ html, body {
font-family: 'open_sansregular';
src: url('../../../resources/font/OpenSans-Regular-webfont.eot');
src: url('../../../resources/font/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),
url('../../../resources/font/OpenSans-Regular-webfont.woff2') format('woff2'),
url('../../../resources/font/OpenSans-Regular-webfont.woff') format('woff'),
url('../../../resources/font/OpenSans-Regular-webfont.ttf') format('truetype'),
url('../../../resources/font/OpenSans-Regular-webfont.svg#open_sansregular') format('svg');
font-weight: normal;
font-style: normal;
unicode-range: U+0370-03FF, U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}

@font-face {
font-family: 'open_sanssemibold';
src: url('../../../resources/font/OpenSans-Semibold-webfont.eot');
src: url('../../../resources/font/OpenSans-Semibold-webfont.eot?#iefix') format('embedded-opentype'),
url('../../../resources/font/OpenSans-Semibold-webfont.woff2') format('woff2'),
url('../../../resources/font/OpenSans-Semibold-webfont.woff') format('woff'),
url('../../../resources/font/OpenSans-Semibold-webfont.ttf') format('truetype'),
url('../../../resources/font/OpenSans-Semibold-webfont.svg#open_sanssemibold') format('svg');
font-weight: bold;
font-style: normal;
unicode-range: U+0370-03FF, U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}

/*
* Open Sans extended (cyrillic, cyrillic-ext, latin-ext, greek-ext, vietnamese)
*/

@font-face {
font-family: 'open_sans';
src: url('../../../resources/font/opensans-all/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),
url('../../../resources/font/opensans-all/OpenSans-Regular-webfont.woff2') format('woff2'),
url('../../../resources/font/opensans-all/OpenSans-Regular-webfont.woff') format('woff'),
url('../../../resources/font/opensans-all/OpenSans-Regular-webfont.svg#open_sanssemibold') format('svg');
font-weight: normal;
font-style: normal;
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
font-family: 'open_sans';
src: url('../../../resources/font/opensans-all/OpenSans-Semibold-webfont.eot?#iefix') format('embedded-opentype'),
url('../../../resources/font/opensans-all/OpenSans-Semibold-webfont.woff2') format('woff2'),
url('../../../resources/font/opensans-all/OpenSans-Semibold-webfont.woff') format('woff'),
url('../../../resources/font/opensans-all/OpenSans-Semibold-webfont.svg#open_sanssemibold') format('svg');
font-weight: bold;
font-style: normal;
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}

body {
Expand Down
35 changes: 23 additions & 12 deletions Swipe/src/app/storymaps/swipe/ui/MapSwipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ define(["dojo/dnd/move",
within: true
});

on(node, mouse.enter, function(){
on(node, 'mouseover', function(){
$("#swipeImg").css("background", "url(resources/icons/sprite-icons.png)-536px -1152px");
});

on(node, mouse.leave, function(){
on(node, 'mouseout', function(){
$("#swipeImg").css("background", "url(resources/icons/sprite-icons.png)-536px -1254px");
});

Expand Down Expand Up @@ -322,16 +322,27 @@ define(["dojo/dnd/move",

if(isGraphics){
rightval = app.mainMap.width;
var tr = clipDiv.getTransform();
// if we got the transform object
if (tr) {
// if layer is offset x
if (tr.hasOwnProperty('dx')) {
leftval += -(tr.dx);
var layer = app.mainMap.getLayer(_layers[0])._div;
var tr;
var values;
if($(layer.parent.rawNode).css('transform')){
tr = $(layer.parent.rawNode).css('transform');
values = tr.match(/-?[\d\.]+/g);
// if we got the transform object
if (tr && values) {
// if layer is offset x
leftval += -(parseInt(values[4]));
// if layer is offset y
topval += -(parseInt(values[5]));
}
// if layer is offset y
if (tr.hasOwnProperty('dy')) {
topval += -(tr.dy);
else if(clipDiv.getTransform()){
var ieTr = clipDiv.getTransform();
if (ieTr.hasOwnProperty('dx')) {
leftval += -(ieTr.dx);
}
if (tr.hasOwnProperty('dy')) {
topval += -(ieTr.dy);
}
}
}

Expand Down Expand Up @@ -706,7 +717,7 @@ define(["dojo/dnd/move",
app.popup[targetPopup].show(_pointTest);
app.popup[targetPopup ? 0 : 1].hide();
$('.esriPopup').css('visibility', 'hidden');
$('.esriPopup').eq(targetPopup).css('visibility', 'visible')
$('.esriPopup').eq(targetPopup).css('visibility', 'visible');
//Can we use targetPopup in place of mapIndex?
if( mapIndex != null )
setMobilePopup(mapIndex, (app.popup[mapIndex].features || [null])[0]);
Expand Down
35 changes: 22 additions & 13 deletions Swipe/src/app/storymaps/swipe/ui/SpyGlass.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ define(["dojo/_base/declare",
}

if(!_popup){
app.popup[1]._highlighted._graphicsLayer.graphics[0].hide();

if(app.popup[1])
app.popup[1]._highlighted._graphicsLayer.graphics[0].hide();
return;
}
var seriesPanelHeight = parseInt($('#seriesPanel').css('height'));
Expand Down Expand Up @@ -202,7 +202,7 @@ define(["dojo/_base/declare",
var scroll = e[(!has("mozilla") ? "wheelDelta" : "detail")] * (!has("mozilla") ? 1 : -1);
var mapLevel = parseInt(dom.byId("mainMap0").getAttribute("data-zoom"));
var wheelDelta = !has("mozilla") ? 120 : 3;
var mapZoom = scroll/wheelDelta;
var mapZoom = parseInt(scroll/wheelDelta);
app.mainMap.setZoom(mapLevel + mapZoom);
});

Expand Down Expand Up @@ -388,20 +388,29 @@ define(["dojo/_base/declare",

var layer = app.mainMap.getLayer(_layers[0])._div;
var tr;
if(layer.getTransform)
tr = layer.getTransform();
// if we got the transform object
if (tr) {
// if layer is offset x
if (tr.hasOwnProperty('dx')) {
leftval += -(tr.dx);
var values;
if($(layer.parent.rawNode).css('transform')){
tr = $(layer.parent.rawNode).css('transform');
values = tr.match(/-?[\d\.]+/g);
// if we got the transform object
if (tr && values) {
// if layer is offset x
leftval += -(parseInt(values[4]));
// if layer is offset y
topval += -(parseInt(values[5]));
}
// if layer is offset y
if (tr.hasOwnProperty('dy')) {
topval += -(tr.dy);
else if(layer.getTransform()){
var ieTr = layer.getTransform();
if (ieTr.hasOwnProperty('dx')) {
leftval += -(ieTr.dx);
}
if (tr.hasOwnProperty('dy')) {
topval += -(ieTr.dy);
}
}
}


layer.setClip({
x: leftval + 9,
y: topval + 9,
Expand Down
9 changes: 5 additions & 4 deletions Swipe/src/app/storymaps/swipe/ui/desktop/SidePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ define(["storymaps/swipe/core/WebApplicationData",
if (_isLegend == false && _isDescription == false && _isSeries == false) {
$("#sidePanelTabImg").css('display', 'none');
$('#sidePanelUnderTabImg').css('display', 'none');
$('#sidePanel').css('display', 'none');
return;
}

Expand Down Expand Up @@ -283,19 +284,19 @@ define(["storymaps/swipe/core/WebApplicationData",
left: (direction=="in") ? - 355 : 0,
queue: false
}, 750);

$(".mapCommandLocation").animate({
left: (direction=="in") ? 20 : 375,
queue: false
}, 750);

if ( app.autoplay ) {
$("#autoplay").animate({
left: (direction=="in") ? '50%' : 355 + (($(window).width() - 355) / 2),
queue: false
}, 750);
}

if (app.mode == "TWO_LAYERS" || _layout == "spyglass") {
$("#mainMap0_zoom_slider").animate({
left: (direction == "in") ? 20 : 375,
Expand Down Expand Up @@ -334,7 +335,7 @@ define(["storymaps/swipe/core/WebApplicationData",
left: (direction=="up") ? 20 : 370,
queue: false
}, 750);

if ( app.autoplay ) {
$("#autoplay").animate({
left: (direction=="up") ? '50%' : 355 + (($(window).width() - 355) / 2),
Expand Down
21 changes: 16 additions & 5 deletions Swipe/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,18 @@
</script>

<script type="text/javascript">
var version = '1.9.3';
var version = '1.10.0';
var isProduction = false;
// IE 9 and below are not compatible with script async attribute.
var canUseAsyncAttr = true;

var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
if(msie > 0){
var version = parseFloat(navigator.appVersion.split("MSIE")[1]);
if(version <= 9)
canUseAsyncAttr = false;
}

function loadJS(url, isExternal)
{
Expand All @@ -152,7 +162,8 @@
var ref = window.document.getElementsByTagName('script')[0];
var script = window.document.createElement('script');
script.src = url;
script.async = false;
if(canUseAsyncAttr)
script.async = false;
ref.parentNode.insertBefore(script, ref);
}

Expand All @@ -170,8 +181,8 @@
document.getElementsByTagName("head")[0].appendChild(el);
}

loadCSS("//js.arcgis.com/3.19/esri/css/esri.css", true);
loadCSS("//js.arcgis.com/3.19/dijit/themes/claro/claro.css", true);
loadCSS("//js.arcgis.com/3.20/esri/css/esri.css", true);
loadCSS("//js.arcgis.com/3.20/dijit/themes/claro/claro.css", true);

if( isProduction ) {
loadCSS("app/swipe-min.css");
Expand Down Expand Up @@ -897,7 +908,7 @@ <h3 class="modal-title"></h3>
</table>
</div>

<script type="text/javascript" src="//js.arcgis.com/3.19/init.js"></script>
<script type="text/javascript" src="//js.arcgis.com/3.20/init.js"></script>
<script type="text/javascript">
loadJS('app/swipe-config.js');

Expand Down
Binary file modified Swipe/src/resources/font/OpenSans-Regular-webfont.eot
Binary file not shown.
Loading

0 comments on commit a52a540

Please sign in to comment.