From 281c9ff310521de87444f21bfc31738759623efd Mon Sep 17 00:00:00 2001 From: "Eugene W. Nourminsky" Date: Mon, 27 Jul 2015 21:40:36 +0300 Subject: [PATCH] Added https support for tours --- Source/Chronozoom.UI/cz.merged.js | 3 +++ Source/Chronozoom.UI/czmin.merged.js | 3 +++ Source/Chronozoom.UI/scripts/tours.js | 3 +++ Source/Chronozoom.UI/scripts/tours.min.js | 2 +- Source/Chronozoom.UI/scripts/tours.min.js.map | 4 ++-- 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Source/Chronozoom.UI/cz.merged.js b/Source/Chronozoom.UI/cz.merged.js index aefff756..200bd59f 100644 --- a/Source/Chronozoom.UI/cz.merged.js +++ b/Source/Chronozoom.UI/cz.merged.js @@ -7292,10 +7292,13 @@ var CZ; this.isTourPlayRequested = false; this.isAudioLoaded = false; this.isAudioEnabled = false; + if (!bookmarks || bookmarks.length == 0) { throw "Tour has no bookmarks"; } + this.audio = CZ.Service.MakeSecureUri(audio); + var self = this; this.thumbnailUrl = CZ.Settings.contentItemThumbnailBaseUri + id + '.jpg'; diff --git a/Source/Chronozoom.UI/czmin.merged.js b/Source/Chronozoom.UI/czmin.merged.js index 993d26b9..a1549a4c 100644 --- a/Source/Chronozoom.UI/czmin.merged.js +++ b/Source/Chronozoom.UI/czmin.merged.js @@ -7292,10 +7292,13 @@ var CZ; this.isTourPlayRequested = false; this.isAudioLoaded = false; this.isAudioEnabled = false; + if (!bookmarks || bookmarks.length == 0) { throw "Tour has no bookmarks"; } + this.audio = CZ.Service.MakeSecureUri(audio); + var self = this; this.thumbnailUrl = CZ.Settings.contentItemThumbnailBaseUri + id + '.jpg'; diff --git a/Source/Chronozoom.UI/scripts/tours.js b/Source/Chronozoom.UI/scripts/tours.js index 0200c603..748abf7d 100644 --- a/Source/Chronozoom.UI/scripts/tours.js +++ b/Source/Chronozoom.UI/scripts/tours.js @@ -125,10 +125,13 @@ var CZ; this.isTourPlayRequested = false; this.isAudioLoaded = false; this.isAudioEnabled = false; + if (!bookmarks || bookmarks.length == 0) { throw "Tour has no bookmarks"; } + this.audio = CZ.Service.MakeSecureUri(audio); + var self = this; this.thumbnailUrl = CZ.Settings.contentItemThumbnailBaseUri + id + '.jpg'; diff --git a/Source/Chronozoom.UI/scripts/tours.min.js b/Source/Chronozoom.UI/scripts/tours.min.js index dd803123..13960455 100644 --- a/Source/Chronozoom.UI/scripts/tours.min.js +++ b/Source/Chronozoom.UI/scripts/tours.min.js @@ -1,2 +1,2 @@ -var CZ;(function(n){(function(t){function k(){var n=window.location.hash.split("@");return n.length>1&&(n=n[1].split("&")[0].split("="),n.length===2&&n[0].toLowerCase()==="auto-tour")?(t.autoTourGUID=n[1],n[1]):""}function f(t){return n.UrlNav.navStringToVisible(t.url,n.Common.vc)}function d(){return t.tour!=undefined}function g(t){var i=n.UrlNav.navStringTovcElement(t,n.Common.vc.virtualCanvas("getLayerContent"));return i?i:null}function a(n,i){if(i==undefined&&(i=t.isNarrationOn),n!=undefined){t.tour=n;t.tour.tour_TourFinished.push(function(){et();r();c()});t.tour.toggleAudio(i);for(var u=0;ut.tours.length||typeof i.hash.params!="undefined"&&typeof i.hash.params.tour!="undefined"&&(t.tours==null&&y(),t.isTourWindowVisible&&w(),t.tour=t.tours[i.hash.params.tour-1],$(".touritem-selected").removeClass("touritem-selected","slow"),a(t.tour,!0),t.tour.audio&&(t.tour.audio.pause(),t.tour.audio.preload="none"),r())}function vt(t){var r=e(t),i=$("#message-window").find("textarea");n.Authoring.showMessageWindow("You can use the following web address to directly link to this tour. Try pressing Ctrl + C to copy it to your clipboard.",t.title+" URL");i.text(r).show().focus().select();setTimeout(function(){i.select()},1e3)}function e(n){return window.location.href.toLowerCase().split("#")[0]+"#@auto-tour="+n.id}function yt(n){return"http://www.facebook.com/sharer.php?u="+encodeURIComponent(e(n))}function pt(n){return"http://twitter.com/share?url="+encodeURIComponent(e(n))+"&hashtags=chronozoom&text="+encodeURIComponent(n.title+" - ")}var i,o,s;t.isTourWindowVisible=!1;var l=!1,u=!0;t.isNarrationOn=!0;t.tours;t.tour;t.autoTourGUID;t.tourBookmarkTransitionCompleted;t.tourBookmarkTransitionInterrupted;t.pauseTourAtAnyAnimation=!1;i=!1;t.TourEndMessage="Thank you for watching this tour!";t.tourCaptionFormContainer;t.tourCaptionForm;t.getAutoTourGUID=k;o=function(){function n(n,t,i,r){this.url=n;this.caption=t;this.lapseTime=i;this.text=r;this.duration=undefined;this.elapsed=0;this.text===null&&(this.text="")}return n}();t.TourBookmark=o;t.getBookmarkVisible=f;t.hasActiveTour=d;t.bookmarkUrlToElement=g;s=function(){function u(u,e,o,s,h,c,l,a,v){var y,w;if(this.id=u,this.title=e,this.bookmarks=o,this.zoomTo=s,this.vc=h,this.category=c,this.audio=l,this.sequenceNum=a,this.description=v,this.tour_BookmarkStarted=[],this.tour_BookmarkFinished=[],this.tour_TourStarted=[],this.tour_TourFinished=[],this.state="pause",this.currentPlace={type:"goto",bookmark:0,startTime:null,animationId:null},this.isTourPlayRequested=!1,this.isAudioLoaded=!1,this.isAudioEnabled=!1,!o||o.length==0)throw"Tour has no bookmarks";for(y=this,this.thumbnailUrl=n.Settings.contentItemThumbnailBaseUri+u+".jpg",o.sort(function(n,t){return n.lapseTime-t.lapseTime}),w=1;w0&&i&&window.console&&console.log("Tour "+y.title+" downloaded "+y.audioElement.buffered.end(y.audioElement.buffered.length-1)/y.audioElement.duration)}),y.audioElement.controls=!1,y.audioElement.autoplay=!1,y.audioElement.loop=!1,y.audioElement.volume=1,y.audioElement.preload="none",u=y.audio.substring(0,y.audio.length-3),t=0;t0)for(var t=0;t0)for(var t=0;t0)for(var n=0;n0)for(var n=0;n1&&(n=n[1].split("&")[0].split("="),n.length===2&&n[0].toLowerCase()==="auto-tour")?(t.autoTourGUID=n[1],n[1]):""}function f(t){return n.UrlNav.navStringToVisible(t.url,n.Common.vc)}function d(){return t.tour!=undefined}function g(t){var i=n.UrlNav.navStringTovcElement(t,n.Common.vc.virtualCanvas("getLayerContent"));return i?i:null}function a(n,i){if(i==undefined&&(i=t.isNarrationOn),n!=undefined){t.tour=n;t.tour.tour_TourFinished.push(function(){et();r();c()});t.tour.toggleAudio(i);for(var u=0;ut.tours.length||typeof i.hash.params!="undefined"&&typeof i.hash.params.tour!="undefined"&&(t.tours==null&&y(),t.isTourWindowVisible&&w(),t.tour=t.tours[i.hash.params.tour-1],$(".touritem-selected").removeClass("touritem-selected","slow"),a(t.tour,!0),t.tour.audio&&(t.tour.audio.pause(),t.tour.audio.preload="none"),r())}function vt(t){var r=e(t),i=$("#message-window").find("textarea");n.Authoring.showMessageWindow("You can use the following web address to directly link to this tour. Try pressing Ctrl + C to copy it to your clipboard.",t.title+" URL");i.text(r).show().focus().select();setTimeout(function(){i.select()},1e3)}function e(n){return window.location.href.toLowerCase().split("#")[0]+"#@auto-tour="+n.id}function yt(n){return"http://www.facebook.com/sharer.php?u="+encodeURIComponent(e(n))}function pt(n){return"http://twitter.com/share?url="+encodeURIComponent(e(n))+"&hashtags=chronozoom&text="+encodeURIComponent(n.title+" - ")}var i,o,s;t.isTourWindowVisible=!1;var l=!1,u=!0;t.isNarrationOn=!0;t.tours;t.tour;t.autoTourGUID;t.tourBookmarkTransitionCompleted;t.tourBookmarkTransitionInterrupted;t.pauseTourAtAnyAnimation=!1;i=!1;t.TourEndMessage="Thank you for watching this tour!";t.tourCaptionFormContainer;t.tourCaptionForm;t.getAutoTourGUID=k;o=function(){function n(n,t,i,r){this.url=n;this.caption=t;this.lapseTime=i;this.text=r;this.duration=undefined;this.elapsed=0;this.text===null&&(this.text="")}return n}();t.TourBookmark=o;t.getBookmarkVisible=f;t.hasActiveTour=d;t.bookmarkUrlToElement=g;s=function(){function u(u,e,o,s,h,c,l,a,v){var y,w;if(this.id=u,this.title=e,this.bookmarks=o,this.zoomTo=s,this.vc=h,this.category=c,this.audio=l,this.sequenceNum=a,this.description=v,this.tour_BookmarkStarted=[],this.tour_BookmarkFinished=[],this.tour_TourStarted=[],this.tour_TourFinished=[],this.state="pause",this.currentPlace={type:"goto",bookmark:0,startTime:null,animationId:null},this.isTourPlayRequested=!1,this.isAudioLoaded=!1,this.isAudioEnabled=!1,!o||o.length==0)throw"Tour has no bookmarks";for(this.audio=n.Service.MakeSecureUri(l),y=this,this.thumbnailUrl=n.Settings.contentItemThumbnailBaseUri+u+".jpg",o.sort(function(n,t){return n.lapseTime-t.lapseTime}),w=1;w0&&i&&window.console&&console.log("Tour "+y.title+" downloaded "+y.audioElement.buffered.end(y.audioElement.buffered.length-1)/y.audioElement.duration)}),y.audioElement.controls=!1,y.audioElement.autoplay=!1,y.audioElement.loop=!1,y.audioElement.volume=1,y.audioElement.preload="none",u=y.audio.substring(0,y.audio.length-3),t=0;t0)for(var t=0;t0)for(var t=0;t0)for(var n=0;n0)for(var n=0;n