diff --git a/Source/Chronozoom.UI/cz.merged.js b/Source/Chronozoom.UI/cz.merged.js index 34b8865a..e5b72ec6 100644 --- a/Source/Chronozoom.UI/cz.merged.js +++ b/Source/Chronozoom.UI/cz.merged.js @@ -4934,9 +4934,9 @@ var CZ; //adding edit and copy button if (CZ.Authoring.isEnabled) { var imageSize = (titleTop - infodot.y) * 0.75; - var editButton = VCContent.addImage(infodot, layerid, id + "__edit", time - imageSize / 2, infodot.y + imageSize * 0.2, imageSize, imageSize, "/images/edit.svg"); - var copyButton = VCContent.addImage(infodot, layerid, id + "__copy", time - imageSize / 2 - imageSize * 1.3, infodot.y + imageSize * 0.2, imageSize, imageSize, "/images/copy.svg"); - + var copyButton = VCContent.addImage(infodot, layerid, id + "__copy", time - imageSize, infodot.y + imageSize * 0.2, imageSize, imageSize, "/images/copy.svg"); + var editButton = VCContent.addImage(infodot, layerid, id + "__edit", time, infodot.y + imageSize * 0.2, imageSize, imageSize, "/images/edit.svg"); + editButton.reactsOnMouse = true; copyButton.reactsOnMouse = true; @@ -21189,4 +21189,4 @@ var CZ; })(CZ.HomePageViewModel || (CZ.HomePageViewModel = {})); var HomePageViewModel = CZ.HomePageViewModel; -})(CZ || (CZ = {})); +})(CZ || (CZ = {})); \ No newline at end of file diff --git a/Source/Chronozoom.UI/czmin.merged.js b/Source/Chronozoom.UI/czmin.merged.js index f4126394..dc609c6d 100644 --- a/Source/Chronozoom.UI/czmin.merged.js +++ b/Source/Chronozoom.UI/czmin.merged.js @@ -3311,7 +3311,7 @@ var CZ; this.pasteButton.onmousehover = function (event) { this.vc.element.css('cursor', 'pointer'); - this.vc.element.attr('title', 'Paste Timeline'); + this.vc.element.attr('title', 'Paste Timeline/Exhibit'); this.parent.settings.strokeStyle = "yellow"; } @@ -3325,8 +3325,11 @@ var CZ; this.pasteButton.onmouseclick = function (event) { var newTimeline = localStorage.getItem('ExportedTimeline'); + var newExhibit = localStorage.getItem('ExportedExhibit'); - if ((localStorage.getItem('ExportedSchemaVersion') == constants.schemaVersion) && newTimeline != null) + var sameDbSchema = localStorage.getItem('ExportedSchemaVersion') == constants.schemaVersion; + + if (sameDbSchema && newTimeline != null) { // timeline from same db schema version is on "clipboard" so attempt "paste" CZ.Service.importTimelines(this.parent.guid, newTimeline).then(function (importMessage) @@ -3334,6 +3337,14 @@ var CZ; CZ.Authoring.showMessageWindow(importMessage); }); } + else if (sameDbSchema && newExhibit != null) + { + // exhibit from same db schema version is on "clipboard" so attempt "paste" + CZ.Service.importExhibit(this.parent.guid, newExhibit).then(function (importMessage) + { + CZ.Authoring.showMessageWindow(importMessage); + }); + } else { // unable to paste as nothing suitable is on "clipboard" so inform user @@ -3380,7 +3391,8 @@ var CZ; CZ.Service.exportTimelines(this.parent.guid).then(function (exportData) { localStorage.setItem('ExportedSchemaVersion', constants.schemaVersion); - localStorage.setItem('ExportedTimeline', JSON.stringify(exportData)); + localStorage.setItem('ExportedTimeline', JSON.stringify(exportData)); + localStorage.removeItem('ExportedExhibit'); CZ.Authoring.showMessageWindow('"' + exportData[0].timeline.title + '" has been copied to your clip-board. You can paste this into a different timeline.'); }); } @@ -4919,12 +4931,14 @@ var CZ; numberOfLines: 2 }, titleWidth); - //adding edit button + //adding edit and copy button if (CZ.Authoring.isEnabled) { var imageSize = (titleTop - infodot.y) * 0.75; - var editButton = VCContent.addImage(infodot, layerid, id + "__edit", time - imageSize / 2, infodot.y + imageSize * 0.2, imageSize, imageSize, "/images/edit.svg"); - + var copyButton = VCContent.addImage(infodot, layerid, id + "__copy", time - imageSize, infodot.y + imageSize * 0.2, imageSize, imageSize, "/images/copy.svg"); + var editButton = VCContent.addImage(infodot, layerid, id + "__edit", time, infodot.y + imageSize * 0.2, imageSize, imageSize, "/images/edit.svg"); + editButton.reactsOnMouse = true; + copyButton.reactsOnMouse = true; editButton.onmouseclick = function () { CZ.Authoring.isActive = true; @@ -4933,6 +4947,17 @@ var CZ; return true; }; + copyButton.onmouseclick = function () { + CZ.Service.exportExhibit(this.parent.guid).then(function (exportData) { + localStorage.setItem('ExportedSchemaVersion', constants.schemaVersion); + localStorage.setItem('ExportedExhibit', JSON.stringify(exportData)); + localStorage.removeItem('ExportedTimeline'); + CZ.Authoring.showMessageWindow('"' + exportData.title + '" has been copied to your clip-board. You can paste this into a different timeline.'); + }); + return true; + }; + + editButton.onmouseenter = function () { this.vc.element.css('cursor', 'pointer'); @@ -4946,6 +4971,18 @@ var CZ; this.vc.element.attr('title', ''); infodot.settings.strokeStyle = CZ.Settings.infoDotBorderColor; }; + + copyButton.onmouseenter = function () { + this.vc.element.css('cursor', 'pointer'); + this.vc.element.attr('title', 'Copy Exhibit to Clipboard'); + infodot.settings.strokeStyle = "yellow"; + }; + + copyButton.onmouseleave = function () { + this.vc.element.css('cursor', 'default'); + this.vc.element.attr('title', ''); + infodot.settings.strokeStyle = CZ.Settings.infoDotBorderColor; + }; } var biblBottom = vyc + centralSquareSize + 63.0 / 450 * 2 * radv; @@ -10129,6 +10166,59 @@ var CZ; } Service.importTimelines = importTimelines; + // .../export/exhibit/{exhibitId} + function exportExhibit(exhibitId) { + if (typeof exhibitId === 'undefined') { + throw 'exportExhibit(exhibitId) requires a parameter.'; + } + if (/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(exhibitId) == false) { + if (exhibitId != "00000000-0000-0000-0000-000000000000") + throw 'exportExhibit(exhibitId) has an invalid parameter. The provided parameter must be a GUID.'; + } + CZ.Authoring.resetSessionTimer(); + var request = new Request(_serviceUrl); + request.addToPath('export'); + request.addToPath('exhibit'); + request.addToPath(exhibitId); + return $.ajax + ({ + type: 'GET', + cache: false, + url: request.url, + dataType: 'json' + }); + } + Service.exportExhibit = exportExhibit; + + // .../import/exhibit/{intoTimelineId} + function importExhibit(intoTimelineId, newExhibit) { + if (typeof intoTimelineId === 'undefined' || typeof newExhibit === 'undefined') { + throw 'importExhibit(intoTimelineId, newExhibit) is missing a parameter.'; + } + if (/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(intoTimelineId) == false) { + if (intoTimelineId != "00000000-0000-0000-0000-000000000000") + throw 'importExhibit(intoTimelineId, newExhibit) has an invalid intoTimelineId parameter. This must be a GUID.'; + } + if (typeof newExhibit !== 'string') { + throw 'importExhibit(intoTimelineId, newExhibit) has an invalid newTimelineTree parameter. This must be a JSON.stringify string.'; + } + CZ.Authoring.resetSessionTimer(); + var request = new Request(_serviceUrl); + request.addToPath('import'); + request.addToPath('exhibit'); + request.addToPath(intoTimelineId); + return $.ajax + ({ + type: 'PUT', + cache: false, + url: request.url, + contentType: 'application/json', + dataType: 'json', + data: newExhibit // should already be JSON.stringified + }); + } + Service.importExhibit = importExhibit; + // .../import/collection function importCollection(collectionTree) { diff --git a/Source/Chronozoom.UI/scripts/vccontent.js b/Source/Chronozoom.UI/scripts/vccontent.js index 04a94d3e..d11cf0eb 100644 --- a/Source/Chronozoom.UI/scripts/vccontent.js +++ b/Source/Chronozoom.UI/scripts/vccontent.js @@ -2797,9 +2797,9 @@ var CZ; //adding edit and copy button if (CZ.Authoring.isEnabled) { var imageSize = (titleTop - infodot.y) * 0.75; - var editButton = VCContent.addImage(infodot, layerid, id + "__edit", time - imageSize / 2, infodot.y + imageSize * 0.2, imageSize, imageSize, "/images/edit.svg"); - var copyButton = VCContent.addImage(infodot, layerid, id + "__copy", time - imageSize / 2 - imageSize * 1.3, infodot.y + imageSize * 0.2, imageSize, imageSize, "/images/copy.svg"); - + var copyButton = VCContent.addImage(infodot, layerid, id + "__copy", time - imageSize, infodot.y + imageSize * 0.2, imageSize, imageSize, "/images/copy.svg"); + var editButton = VCContent.addImage(infodot, layerid, id + "__edit", time, infodot.y + imageSize * 0.2, imageSize, imageSize, "/images/edit.svg"); + editButton.reactsOnMouse = true; copyButton.reactsOnMouse = true; diff --git a/Source/Chronozoom.UI/scripts/vccontent.min.js b/Source/Chronozoom.UI/scripts/vccontent.min.js index 3d074188..ee0fdc3e 100644 --- a/Source/Chronozoom.UI/scripts/vccontent.min.js +++ b/Source/Chronozoom.UI/scripts/vccontent.min.js @@ -1,2 +1,2 @@ -var CZ;(function(n){(function(t){function b(t,i,r,u){var o=2*(n.Settings.contentScaleMargin&&u?n.Settings.contentScaleMargin:0),e=r.width-o,s,f,h,c;return e<0&&(e=r.width),s=i*t.width/e,f=r.height-o,f<0&&(f=r.height),h=i*t.height/f,c={centerX:t.x+t.width/2,centerY:t.y+t.height/2,scale:Math.max(s,h)},c}function i(n,t,i,r,u,f,e){this.vc=n;this.id=i;this.layerid=t;this.x=r;this.y=u;this.newY=u;this.width=f;this.height=e;this.newHeight=e;this.children=[];this.fadeIn=!1;this.isVisible=function(n){var t=this.x+this.width,i=this.y+this.height;return Math.max(this.x,n.Left)<=Math.min(t,n.Right)&&Math.max(this.y,n.Top)<=Math.min(i,n.Bottom)};this.isInside=function(n){return n.x>=this.x&&n.x<=this.x+this.width&&n.y>=this.y&&n.y<=this.y+this.height};this.render=function(){}}function u(n,i,r,u,f,e,o,s,h,c){return t.addChild(n,new et(n.vc,i,r,u,f,e,o,s,h,c),!1)}function d(n,i,r,u,f,e,o,s,h){return t.addChild(n,new ht(n.vc,i,r,u,f,e,o,s,h),!1)}function nt(n,i,r,u,f,e,o,s,h,c){return t.addChild(n,new ot(n.vc,i,r,u,f,o,s,h,c),!1)}function a(n){n.isRendered=!1;n.onIsRenderedChanged&&n.onIsRenderedChanged();for(var t=n.children.length;--t>=0;)n.children[t].isRendered&&a(n.children[t])}function v(t){for(var i,u=t.children.length,r=0;r0&&(this.vc.recentBreadCrumb==undefined||this.vc.breadCrumbs[n.breadCrumbs.length-1].vcElement.id!=this.vc.recentBreadCrumb.vcElement.id)?(this.vc.recentBreadCrumb=this.vc.breadCrumbs[n.breadCrumbs.length-1],this.vc.breadCrumbsChanged()):this.vc.breadCrumbs.length==0&&this.vc.recentBreadCrumb!=undefined&&(this.vc.recentBreadCrumb=undefined,this.vc.breadCrumbsChanged())}};this.prototype=new i(n,r,u,f,e,o,s)}function ut(n){var t=Math.max(n.x,n.y),r,i;if(t<=1)return 0;for(r=t&1?1:0,i=1;i<32;i++)t=t>>>1,t&1&&(r=r>0?i+1:i);return r}function e(n,r,u,f,e,o,s){var h,c,l;this.base=i;this.base(n,r,u,f,e,o,s);this.zoomLevel=0;this.prevContent=null;this.newContent=null;this.asyncContent=null;this.lastRenderTime=0;h=this;this.changeZoomLevel=function(){return null};c=function(n){h.lastRenderTime=new Date;h.prevContent=h.content;h.content=n.content;t.addChild(h,h.content,!1);h.prevContent&&(h.prevContent.opacity||(h.prevContent.opacity=1),h.content.opacity=0);h.zoomLevel=n.zoomLevel};l=function(){h.asyncContent&&(c(h.asyncContent),h.asyncContent=null,delete this.onLoad,h.vc.requestInvalidate())};this.render=function(n,i,r,u){var s,e,a,v;if(!this.asyncContent&&(this.prevContent||(s=ut(u),this.zoomLevel!=s&&(e=this.changeZoomLevel(this.zoomLevel,s),e&&(e.content.isLoading?(this.asyncContent=e,e.content.onLoad=l):c(e)))),this.prevContent)){a=new Date;v=a.getTime()-h.lastRenderTime;h.lastRenderTime=a.getTime();var y=v/1600,o=!1,f=this.prevContent.opacity;f=Math.max(0,f-y);f!=this.prevContent.opacity&&(o=!0);f==0?(t.removeChild(this,this.prevContent.id),this.prevContent=null):this.prevContent.opacity=f;f=this.content.opacity;f=Math.min(1,f+y);o||f==this.content.opacity||(o=!0);this.content.opacity=f;o&&this.vc.requestInvalidate()}};this.onIsRenderedChanged=function(){typeof this.removeWhenInvisible!="undefined"&&this.removeWhenInvisible&&(this.isRendered||(this.asyncContent&&(this.asyncContent=null),this.prevContent&&(t.removeChild(this,this.prevContent.id),this.prevContent=null),this.newContent&&(t.removeChild(this,this.newContent.id),this.newContent.content.onLoad=null,this.newContent=null),this.content&&(t.removeChild(this,this.content.id),this.content=null),this.zoomLevel=0))};this.prototype=new i(n,r,u,f,e,o,s)}function o(n,t,r,u,f,e,o){this.base=i;this.base(n,t,r,u,f,e,o);this.render=function(){};this.prototype=new i(n,t,r,u,f,e,o)}function s(t,r,u,f,e,o,s,h){this.base=i;this.base(t,r,u,f,e,o,s);this.settings=h;this.type="rectangle";this.render=function(n,t,i,r,u){var e=i.pointVirtualToScreen(this.x,this.y),o=i.pointVirtualToScreen(this.x+this.width,this.y+this.height),s=Math.max(0,e.x),h=Math.max(0,e.y),c=Math.min(i.width,o.x),l=Math.min(i.height,o.y),v,a,y,f;s0&&(this.settings.showFromCirca&&n.setLineDash&&n.setLineDash([6,3]),n.beginPath(),n.moveTo(e.x,h-f),n.lineTo(e.x,l+f),n.stroke(),n.setLineDash&&n.setLineDash([])),e.y>0&&(n.beginPath(),n.moveTo(s-f,e.y),n.lineTo(c+f,e.y),n.stroke()),o.xn.x+n.width||this.y+this.heightn.y+n.height)};this.contains=function(n){return n.x>this.x&&n.x+n.widththis.y&&n.y+n.height=n.Settings.minTimelineWidth};this.prototype=new i(t,r,u,f,e,o,s)}function ft(i,r,e,o,h,c,l,a,v){var y=this;this.base=s;this.base(i,r,e,o,h,c,l);this.guid=v.guid;this.type="timeline";this.isBuffered=v.isBuffered;this.settings=a;this.parent=undefined;this.currentlyObservedTimelineEvent=i.currentlyObservedTimelineEvent;this.settings.outline=!0;this.type="timeline";this.endDate=v.endDate;this.FromIsCirca=v.FromIsCirca||!1;this.ToIsCirca=v.ToIsCirca||!1;this.backgroundUrl=v.backgroundUrl||"";this.aspectRatio=v.aspectRatio||null;this.settings.showFromCirca=this.FromIsCirca;this.settings.showToCirca=this.ToIsCirca;this.settings.showInfinite=v.endDate==9999;var g=v.timeEnd-v.timeStart,p=v.titleRect?v.titleRect.height:n.Settings.timelineHeaderSize*v.height,k=v.titleRect&&(n.Authoring.isEnabled||n.Settings.isAuthorized)?v.titleRect.width:0,w=v.titleRect?v.titleRect.marginLeft:n.Settings.timelineHeaderMargin*v.height,b=v.titleRect?v.titleRect.marginTop:(1-n.Settings.timelineHeaderMargin)*v.height-p,d=v.top+b+p/2;this.titleObject=u(this,r,e+"__header__",n.Authoring.isEnabled?v.timeStart+w+p:v.timeStart+w,v.top+b,d,p,v.header,{fontName:n.Settings.timelineHeaderFontName,fillStyle:n.Settings.timelineHeaderFontColor,textBaseline:"middle"},k);this.title=this.titleObject.text;this.regime=v.regime;this.settings.gradientOpacity=0;this.settings.gradientFillStyle=n.Settings.timelineGradientFillStyle?n.Settings.timelineGradientFillStyle:v.gradientFillStyle||v.strokeStyle?v.strokeStyle:n.Settings.timelineBorderColor;this.reactsOnMouse=!0;this.tooltipEnabled=!0;this.tooltipIsShown=!1;y.backgroundUrl&&(y.backgroundImg=new wt(y.vc,r,e+"__background__",y.backgroundUrl,y.x,y.y,y.width,y.height),y.settings.gradientOpacity=0,y.settings.fillStyle=undefined);this.onmouseclick=function(n){return f(this,n,1)};this.onmousehover=function(){if(this.vc.currentlyHoveredTimeline!=null&&this.vc.currentlyHoveredTimeline.id!=e)try{this.vc.currentlyHoveredInfodot.id}catch(i){n.Common.stopAnimationTooltip();this.vc.currentlyHoveredTimeline.tooltipIsShown=!1}if(this.vc.currentlyHoveredTimeline=this,this.settings.strokeStyle=n.Settings.timelineHoveredBoxBorderColor,this.settings.lineWidth=n.Settings.timelineHoveredLineWidth,this.titleObject.settings.fillStyle=n.Settings.timelineHoveredHeaderFontColor,this.settings.hoverAnimationDelta=n.Settings.timelineHoverAnimation,this.vc.requestInvalidate(),this.titleObject.initialized==!1){var t=this.vc.getViewport();this.titleObject.screenFontSize=n.Settings.timelineHeaderSize*t.heightVirtualToScreen(this.height)}if(this.tooltipEnabled=this.titleObject.screenFontSize<=n.Settings.timelineTooltipMaxHeaderSize?!0:!1,n.Common.tooltipMode!="infodot"){if(n.Common.tooltipMode="timeline",this.tooltipEnabled==!1){n.Common.stopAnimationTooltip();this.tooltipIsShown=!1;return}if(this.tooltipIsShown==!1){switch(this.regime){case"Cosmos":$(".bubbleInfo").attr("id","cosmosRegimeBox");break;case"Earth":$(".bubbleInfo").attr("id","earthRegimeBox");break;case"Life":$(".bubbleInfo").attr("id","lifeRegimeBox");break;case"Pre-history":$(".bubbleInfo").attr("id","prehistoryRegimeBox");break;case"Humanity":$(".bubbleInfo").attr("id","humanityRegimeBox")}$(".bubbleInfo span").text(this.title);this.panelWidth=$(".bubbleInfo").outerWidth();this.panelHeight=$(".bubbleInfo").outerHeight();this.tooltipIsShown=!0;n.Common.animationTooltipRunning=$(".bubbleInfo").fadeIn()}}};this.onmouseunhover=function(){this.vc.currentlyHoveredTimeline!=null&&this.vc.currentlyHoveredTimeline.id==e&&(this.vc.currentlyHoveredTimeline=null,this.tooltipIsShown==!0&&n.Common.tooltipMode=="timeline"&&(n.Common.tooltipMode="default",n.Common.stopAnimationTooltip(),$(".bubbleInfo").attr("id","defaultBox"),this.tooltipIsShown=!1));this.settings.strokeStyle=v.strokeStyle?v.strokeStyle:n.Settings.timelineBorderColor;this.settings.lineWidth=n.Settings.timelineLineWidth;this.titleObject.settings.fillStyle=n.Settings.timelineHeaderFontColor;this.settings.hoverAnimationDelta=-n.Settings.timelineHoverAnimation;this.vc.requestInvalidate()};this.base_render=this.render;this.render=function(u,f,o,s,h){var c,l,p;this.titleObject.initialized=!1;this.settings.hoverAnimationDelta&&(this.settings.gradientOpacity=Math.min(1,Math.max(0,this.settings.gradientOpacity+this.settings.hoverAnimationDelta)));typeof y.backgroundImg!="undefined"&&y.backgroundImg.render(u,f,o,s,1);y.base_render(u,f,o,s,h);c=this.x+this.width-1*this.titleObject.height;l=this.titleObject.y+.15*this.titleObject.height;typeof this.tweetBtn=="undefined"&&this.titleObject.width!==0&&(this.tweetBtn=t.addImage(this,r,e+"__tweet",c,l,.7*this.titleObject.height,.7*this.titleObject.height,"/images/icon_twitter_canvas.svg"),this.tweetBtn.reactsOnMouse=!0,this.tweetBtn.onmouseclick=function(){function i(t){t.id!=="__root__"&&(n="/"+t.id+n,i(t.parent))}var t=null,n="";if(i(this.parent),n=window.location.origin+window.location.pathname+"#"+n,t=$.ajax({async:!1,timeout:5e3,type:"GET",url:"http://to.ly/api.php?json=1&longurl="+encodeURIComponent(n)+"&callback=?"}).responseText,t!==null)try{t=JSON.parse(t.slice(2,-1)).shorturl;n=t}catch(r){}window.open("http://twitter.com/share?url="+encodeURIComponent(n)+"&hashtags=chronozoom&text="+encodeURIComponent(this.parent.title+" - "))},this.tweetBtn.onmousehover=function(){this.vc.element.css("cursor","pointer");this.vc.element.attr("title","Share on Twitter")},this.tweetBtn.onmouseunhover=function(){this.vc.element.css("cursor","default");this.vc.element.attr("title","")},this.tweetBtn.onRemove=function(){this.onmousehover=undefined;this.onmouseunhover=undefined;this.onmouseclick=undefined});n.Settings.isAuthorized===!0&&typeof this.favoriteBtn=="undefined"&&this.titleObject.width!==0&&(c-=this.titleObject.height,this.favoriteBtn=t.addImage(this,r,e+"__favorite",c,l,.7*this.titleObject.height,.7*this.titleObject.height,"/images/star.svg"),this.favoriteBtn.reactsOnMouse=!0,this.favoriteBtn.onmouseclick=function(){var t=this;return n.Settings.favoriteTimelines.indexOf(this.parent.guid)!==-1?(n.Service.deleteUserFavorite(this.parent.guid).then(function(){n.Authoring.showMessageWindow('"'+t.parent.title+'" was removed from your favorite timelines.',"Timeline removed from favorites")},function(){console.log("[ERROR] /deleteUserFavorite with guid "+t.parent.guid+" failed.")}),n.Settings.favoriteTimelines.splice(n.Settings.favoriteTimelines.indexOf(this.parent.guid),1)):n.Service.putUserFavorite(this.parent.guid).then(function(){n.Settings.favoriteTimelines.push(t.parent.guid);n.Authoring.showMessageWindow('"'+t.parent.title+'" was added to your favorite timelines.',"Favorite timeline added")},function(){console.log("[ERROR] /putUserFavorite with guid + "+t.parent.guid+" failed.")}),!0},this.favoriteBtn.onmousehover=function(){this.vc.element.css("cursor","pointer");this.vc.element.attr("title","Add to or Remove from Favorites");this.parent.settings.strokeStyle="yellow"},this.favoriteBtn.onmouseunhover=function(){this.vc.element.css("cursor","default");this.vc.element.attr("title","");this.parent.settings.strokeStyle=v.strokeStyle?v.strokeStyle:n.Settings.timelineBorderColor},this.favoriteBtn.onRemove=function(){this.onmousehover=undefined;this.onmouseunhover=undefined;this.onmouseclick=undefined});n.Authoring.isEnabled===!0&&typeof this.pasteButton=="undefined"&&this.titleObject.width!==0&&(c-=this.titleObject.height,this.pasteButton=t.addImage(this,r,e+"__paste",c,l,.7*this.titleObject.height,.7*this.titleObject.height,"/images/paste.svg"),this.pasteButton.reactsOnMouse=!0,this.pasteButton.onmousehover=function(){this.vc.element.css("cursor","pointer");this.vc.element.attr("title","Paste Timeline/Exhibit");this.parent.settings.strokeStyle="yellow"},this.pasteButton.onmouseunhover=function(){this.vc.element.css("cursor","default");this.vc.element.attr("title","");this.parent.settings.strokeStyle=v.strokeStyle?v.strokeStyle:n.Settings.timelineBorderColor},this.pasteButton.onmouseclick=function(){var t=localStorage.getItem("ExportedTimeline"),i=localStorage.getItem("ExportedExhibit"),r=localStorage.getItem("ExportedSchemaVersion")==constants.schemaVersion;r&&t!=null?n.Service.importTimelines(this.parent.guid,t).then(function(t){n.Authoring.showMessageWindow(t)}):r&&i!=null?n.Service.importExhibit(this.parent.guid,i).then(function(t){n.Authoring.showMessageWindow(t)}):n.Authoring.showMessageWindow("Please copy a timeline to your ChronoZoom clip-board first.","Unable to Paste Timeline")},this.pasteButton.onRemove=function(){this.onmousehover=undefined;this.onmouseunhover=undefined;this.onmouseclick=undefined});typeof this.copyButton=="undefined"&&this.titleObject.width!==0&&(c-=this.titleObject.height,this.copyButton=t.addImage(this,r,e+"__copy",c,l,.7*this.titleObject.height,.7*this.titleObject.height,"/images/copy.svg"),this.copyButton.reactsOnMouse=!0,this.copyButton.onmousehover=function(){this.vc.element.css("cursor","pointer");this.vc.element.attr("title","Copy Timeline");this.parent.settings.strokeStyle="yellow"},this.copyButton.onmouseunhover=function(){this.vc.element.css("cursor","default");this.vc.element.attr("title","");this.parent.settings.strokeStyle=v.strokeStyle?v.strokeStyle:n.Settings.timelineBorderColor},this.copyButton.onmouseclick=function(){n.Service.exportTimelines(this.parent.guid).then(function(t){localStorage.setItem("ExportedSchemaVersion",constants.schemaVersion);localStorage.setItem("ExportedTimeline",JSON.stringify(t));localStorage.removeItem("ExportedExhibit");n.Authoring.showMessageWindow('"'+t[0].timeline.title+'" has been copied to your clip-board. You can paste this into a different timeline.')})},this.copyButton.onRemove=function(){this.onmousehover=undefined;this.onmouseunhover=undefined;this.onmouseclick=undefined});n.Authoring.isEnabled&&typeof this.editButton=="undefined"&&this.titleObject.width!==0&&(this.editButton=t.addImage(this,r,e+"__edit",this.x+this.titleObject.height*.15,this.titleObject.y,this.titleObject.height,this.titleObject.height,"/images/edit.svg"),this.editButton.reactsOnMouse=!0,this.editButton.onmouseclick=function(){return n.Common.vc.virtualCanvas("getHoveredInfodot").x==undefined&&(n.Authoring.isActive=!0,n.Authoring.mode="editTimeline",n.Authoring.selectedTimeline=this.parent),!0},this.editButton.onmousehover=function(){this.vc.element.css("cursor","pointer");this.vc.element.attr("title","Edit Timeline");this.parent.settings.strokeStyle="yellow"},this.editButton.onmouseunhover=function(){this.vc.element.css("cursor","default");this.vc.element.attr("title","");this.parent.settings.strokeStyle=v.strokeStyle?v.strokeStyle:n.Settings.timelineBorderColor},this.editButton.onRemove=function(){this.onmousehover=undefined;this.onmouseunhover=undefined;this.onmouseclick=undefined});this.settings.hoverAnimationDelta&&(this.settings.gradientOpacity==0||this.settings.gradientOpacity==1?this.settings.hoverAnimationDelta=undefined:this.vc.requestInvalidate());var a=o.pointVirtualToScreen(this.x,this.y),w={x:a.x+s.x,y:a.y+s.y},b=o.visible.centerX-n.Settings.timelineCenterOffsetAcceptableImplicity<=this.x+this.width&&o.visible.centerX+n.Settings.timelineCenterOffsetAcceptableImplicity>=this.x&&o.visible.centerY-n.Settings.timelineCenterOffsetAcceptableImplicity<=this.y+this.height&&o.visible.centerY+n.Settings.timelineCenterOffsetAcceptableImplicity>=this.y,k=a.xo.width-n.Settings.timelineBreadCrumbBorderOffset||a.yo.height-n.Settings.timelineBreadCrumbBorderOffset;if(k&&b){if(p=i.breadCrumbs.length,p>1&&i.breadCrumbs[p-1].vcElement.parent.id==this.parent.id)return;i.breadCrumbs.push({vcElement:this})}};this.prototype=new s(i,r,e,o,h,c,l,a)}function y(t,r,u,f,e,o,s){this.base=i;this.base(t,r,u,f-o,e-o,2*o,2*o);this.settings=s;this.isObservedNow=!1;this.type="circle";this.render=function(n,t,i,r,u){var f=this.width/2,o=this.x+f,s=this.y+f,e=i.pointVirtualToScreen(o,s),h=i.widthVirtualToScreen(f);this.settings.showCirca&&n.setLineDash&&n.setLineDash([6,3]);n.globalAlpha=u;n.beginPath();n.arc(e.x,e.y,h,0,Math.PI*2,!0);this.settings.strokeStyle&&(n.strokeStyle=this.settings.strokeStyle,n.lineWidth=this.settings.lineWidth?this.settings.isLineWidthVirtual?i.widthVirtualToScreen(this.settings.lineWidth):this.settings.lineWidth:1,n.stroke());this.settings.fillStyle&&(n.fillStyle=this.settings.fillStyle,n.fill());n.setLineDash&&n.setLineDash([])};this.isInside=function(t){var i=n.Common.sqr(t.x-f)+n.Common.sqr(t.y-this.y-this.height/2);return i<=o*o};this.prototype=new i(t,r,u,f-o/2,e-o/2,o,o)}function g(n,t,i,r,u,f){var o=$.browser,h=o.msie&&parseInt(o.version,10)>=9;if(h)t.font=u+"pt "+f,t.fillText(n,i,r);else{var s=12,c=u,e=c/s;t.scale(e,e);t.font=s+"pt "+f;t.fillText(n,i/e,r/e);t.scale(1/e,1/e)}}function et(n,t,r,u,f,e,o,s,h,c){this.base=i;this.base(n,t,r,u,f,c?c:0,o);this.text=s;this.baseline=e;this.newBaseline=e;this.settings=h;this.opacity=h.opacity||0;this.type="text";typeof this.settings.textBaseline!="undefined"&&this.settings.textBaseline==="middle"&&(this.newBaseline=this.newY+this.newHeight/2);this.initialized=!1;this.screenFontSize=0;this.render=function(n,t,i,r,u){var e=i.pointVirtualToScreen(this.x,this.newY),y=i.pointVirtualToScreen(this.x,this.newBaseline).y,f,h,k,p,o,tt,it,ut,s,w,b;if(n.globalAlpha=u,n.fillStyle=this.settings.fillStyle,f=r.y,h=1.5,this.screenFontSize!=f&&(this.screenFontSize=f),!this.initialized){if(this.settings.wrapText){for(k=this.settings.numberOfLines?this.settings.numberOfLines:1,this.settings.numberOfLines=k,f=r.y/k/h;;){n.font=f+"pt "+this.settings.fontName;var rt=this.text.split("\n"),d=0,nt=[];for(p=0;pr.x&&c>0?(nt.push(l),c=0,d+=f*h,o--,l=""):(l===""?l=a[o]:l+=" "+a[o],c=tt),a.length==1&&v.width>r.x)for(it=v.width;it>r.x;)f/=1.5,it/=1.5;nt.push(l);d+=f*h}if(d>r.y)f/=1.5;else{this.text=nt;ut=i.heightScreenToVirtual(f);this.settings.fontSizeVirtual=ut;break}}this.screenFontSize=f}else n.font=f+"pt "+this.settings.fontName,this.screenFontSize=f,this.width==0?(s=n.measureText(this.text),r.x=s.width,this.width=i.widthScreenToVirtual(s.width)):(s=n.measureText(this.text),s.width>r.x?(this.height=this.width*r.y/s.width,this.settings.textBaseline==="middle"&&(this.newY=this.newBaseline-this.newHeight/2),f=i.heightVirtualToScreen(this.height),this.screenFontSize=f):typeof this.settings.adjustWidth&&this.settings.adjustWidth&&(w=i.widthScreenToVirtual(s.width),this.settings.textAlign==="center"?this.x=this.x+(this.width-w)/2:this.settings.textAlign==="right"&&(this.x=this.x+this.width-w),this.width=w,e=i.pointVirtualToScreen(this.x,this.newY),r.x=i.widthVirtualToScreen(this.width)));this.initialized=!0}if(this.settings.textAlign&&(n.textAlign=this.settings.textAlign,this.settings.textAlign==="center"?e.x=e.x+r.x/2:this.settings.textAlign==="right"&&(e.x=e.x+r.x)),this.settings.wrapText)for(f=i.heightVirtualToScreen(this.settings.fontSizeVirtual),this.screenFontSize=f,n.textBaseline="middle",y=e.y+f*h/2,b=0;b0?(i=this.x+this.width,Math.max(this.x,n.Left)<=Math.min(i,n.Right)&&Math.max(this.y,n.Top)<=Math.min(t,n.Bottom)):Math.max(this.y,n.Top)<=Math.min(t,n.Bottom)};this.prototype=new i(n,t,r,u,f,c?c:0,o)}function ot(n,t,r,u,f,e,o,s,h){this.base=i;this.base(n,t,r,u,f,e*10,e);this.settings=h;this.text=o;this.render=function(n,t,i,r){function e(n,t,i,r,u,f){var h,c;if(f=f||0,f<=0){n.fillText(t,i,r);return}for(var o=t.split(" "),s=0,e=1;o.length>0&&e<=o.length;)h=o.slice(0,e).join(" "),c=n.measureText(h).width,c>f?(e==1&&(e=2),n.fillText(o.slice(0,e-1).join(" "),i,r+u*s),s++,o=o.splice(e-1),e=1):e++;e>0&&n.fillText(o.join(" "),i,r+u*s)}var f=i.pointVirtualToScreen(this.x,this.y),u;n.fillStyle=h.fillStyle;n.font=r.y+"pt "+h.fontName;n.textBaseline="top";u=i.heightVirtualToScreen(this.height);e(n,this.text,f.x,f.y,u,s*u)};this.prototype=new i(n,t,r,u,f,e*10,e)}function h(t,r,u,f,e,o,s,h,c){var l;this.base=i;this.base(t,r,u,e,o,s,h);this.onload=c;this.isLoading=!0;l=new Image;this.img=l;this.img.isLoaded=!1;var a=this,v=function(){var i,n,r,u,t;l.isLoading=!1;l.isRemoved?(delete l.isRemoved,delete l.isLoaded):(l.naturalHeight&&(i=a.width/a.height,n=l.naturalWidth/l.naturalHeight,i>n?(r=n*a.height,t=(a.width-r)/2,a.x+=t,a.width=r):i=0;)if(this.imageSources[l].zoomLevel<=e)return this.imageSources[l].zoomLevel===r?null:{zoomLevel:this.imageSources[l].zoomLevel,content:new h(n,t,i+"@"+this.imageSources[l].zoomLevel,this.imageSources[l].imageSource,u,f,o,s,c)};return null};this.prototype=new e(n,t,i,u,f,o,s)}function r(n,t,r,u,f,e,o,s){this.base=i;this.base(n,t,r,u,f,e,o);this.initializeContent=function(n){this.content=n;n&&(n.style.position="absolute",n.style.overflow="hidden",n.style.zIndex=s)};this.onIsRenderedChanged=function(){this.content&&(this.isRendered?(this.content.isAdded||(this.vc.element[0].appendChild(this.content),this.content.isAdded=!0),this.content.style.display="block"):this.content.style.display="none")};this.render=function(n,t,i,r,u){if(this.content){var f=i.pointVirtualToScreen(this.x,this.y),w=i.height,b=i.width,a=0,v=0,y=r.y,p=r.x,s=0,h=w,c=f.y,l=f.y+r.y,e=Math.max(s,c),o=Math.min(h,l);e<=o&&(a=e-f.y,y=o-f.y);s=0;h=b;c=f.x;l=f.x+r.x;e=Math.max(s,c);o=Math.min(h,l);e<=o&&(v=e-f.x,p=o-f.x);this.content.style.left=f.x+"px";this.content.style.top=f.y+"px";this.content.style.width=r.x+"px";this.content.style.height=r.y+"px";this.content.style.clip="rect("+a+"px,"+p+"px,"+y+"px,"+v+"px)";this.content.style.opacity=u;this.content.style.filter="alpha(opacity="+u*100+")"}};this.onRemove=function(){if(this.content)try{this.content.isAdded&&(this.content.src&&(this.content.src=""),this.vc.element[0].removeChild(this.content),this.content.isAdded=!1)}catch(n){alert(n.Description)}};this.prototype=new i(n,t,r,u,f,e,o)}function ht(t,i,u,f,e,o,s,h,c){var l,a;this.base=r;this.base(t,i,u,f,e,o,s,c);l=$("
<\/div>",{id:"citext_"+u,"class":"contentItemDescription"}).appendTo(t);l[0].addEventListener("mousemove",n.Common.preventbubble,!1);l[0].addEventListener("mousedown",n.Common.preventbubble,!1);l[0].addEventListener("DOMMouseScroll",n.Common.preventbubble,!1);l[0].addEventListener("mousewheel",n.Common.preventbubble,!1);a=$("
<\/div>");a.html(marked(h)).appendTo(l);this.initializeContent(l[0]);this.render=function(t,i,r,u,f){var e=u.y/n.Settings.contentItemDescriptionNumberOfLines;l.css("font-size",e+"px");this.prototype.render.call(this,t,i,r,u,f)};this.onRemove=function(){this.prototype.onRemove.call(this);l[0].removeEventListener("mousemove",n.Common.preventbubble,!1);l[0].removeEventListener("mouseup",n.Common.preventbubble,!1);l[0].removeEventListener("mousedown",n.Common.preventbubble,!1);l[0].removeEventListener("DOMMouseScroll",n.Common.preventbubble,!1);l[0].removeEventListener("mousewheel",n.Common.preventbubble,!1);l=undefined};this.prototype=new r(t,i,u,f,e,o,s,c)}function ct(n,t,i,u,f,e,o,s,h){var l="http://docs.google.com/viewer?url=",c;this.base=r;this.base(n,t,i,f,e,o,s,h);c=document.createElement("iframe");c.setAttribute("id",i);u.match("/^"+l+"/")||(u=l+u);u+=u.indexOf("?")==-1?"?&embedded=true&wmode=opaque":"&embedded=true&wmode=opaque";c.setAttribute("src",u);c.setAttribute("visible","true");c.setAttribute("controls","true");this.initializeContent(c);this.prototype=new r(n,t,i,f,e,o,s,h)}function lt(n,t,i,u,f,e,o,s,h){this.base=r;this.base(n,t,i,f,e,o,s,h);var c=document.createElement("iframe");c.setAttribute("id",i);u+=u.indexOf("?")==-1?"?wmode=opaque":"&wmode=opaque";c.setAttribute("src",u);c.setAttribute("visible","true");c.setAttribute("controls","true");this.initializeContent(c);this.prototype=new r(n,t,i,f,e,o,s,h)}function at(n,t,i,u,f,e,o,s,h){this.base=r;this.base(n,t,i,f,e,o,s,h);var c=document.createElement("audio");c.setAttribute("id",i);c.setAttribute("src",u);c.setAttribute("visible","true");c.setAttribute("controls","true");this.initializeContent(c);this.prototype=new r(n,t,i,f,e,o,s,h)}function vt(n,t,i,u,f,e,o,s,h){this.base=r;this.base(n,t,i,f,e,o,s,h);var c=document.createElement("iframe");c.setAttribute("id",i);c.setAttribute("src",u);this.initializeContent(c);this.prototype=new r(n,t,i,f,e,o,s,h)}function yt(n,t,i,u,f,e,o,s,h){this.base=r;this.base(n,t,i,f,e,o,s,h);var l=u.split(" "),c=document.createElement("iframe");c.setAttribute("id",i);c.setAttribute("src",l[0]);c.setAttribute("scrolling","no");c.setAttribute("frameborder","0");c.setAttribute("sandbox","allow-forms allow-scripts");this.initializeContent(c);this.render=function(n,t,i,r,u){if(this.content){var s=i.pointVirtualToScreen(this.x,this.y),f=parseFloat(l[1]),e=parseFloat(l[2]),o=r.x/f;e/f>r.y/r.x&&(o=r.y/e);this.content.style.left=s.x+r.x/2+"px";this.content.style.top=s.y+r.y/2+"px";this.content.style.marginLeft=-f/2+"px";this.content.style.marginTop=-e/2+"px";this.content.style.width=f+"px";this.content.style.height=e+"px";this.content.style.opacity=u;this.content.style.filter="alpha(opacity="+u*100+")";this.content.style.webkitTransform="scale("+o+")";this.content.style.msTransform="scale("+o+")";this.content.style.MozTransform="scale("+o+")"}};this.prototype=new r(n,t,i,f,e,o,s,h)}function pt(i,u,f,e,o,s,h,c,l,a,v){var y=this,p;this.base=r;this.base(i,f,e,s,h,c,l,a);this.onload=v;this.nAttempts=0;this.timeoutHandles=[];p=document.createElement("div");p.setAttribute("id",e);p.setAttribute("style","color: white");this.initializeContent(p);this.viewer=new Seadragon.Viewer(p);this.viewer.elmt.addEventListener("mousemove",n.Common.preventbubble,!1);this.viewer.elmt.addEventListener("mousedown",n.Common.preventbubble,!1);this.viewer.elmt.addEventListener("DOMMouseScroll",n.Common.preventbubble,!1);this.viewer.elmt.addEventListener("mousewheel",n.Common.preventbubble,!1);this.viewer.addEventListener("open",function(){y.onload&&y.onload();y.vc.requestInvalidate()});this.viewer.addEventListener("resize",function(n){y.viewer.setDashboardEnabled(n.elmt.clientWidth>250)});this.onSuccess=function(t){var i,r;if(t.error){y.showFallbackImage();return}if(i=t.content,i.ready){for(r=0;r0?c*o+f.x:f.x,p=l>0?l*s+f.y:f.y,g=a*o,nt=v*s;n.globalAlpha=u;a===1&&v===1&&(y=Math.max(0,f.x),p=Math.max(0,f.y),g=Math.min(k,e.x)-y,nt=Math.min(d,e.y)-p);h.img.naturalWidth&&h.img.naturalHeight&&n.drawImage(h.img,ft,et,a,v,y,p,g,nt)}};h.onRemove=function(){h.img.removeEventListener("load",c,!1)};h.prototype=new i(n,t,r,f,e,o,s)}function bt(i,r,u,f){var e=f.timeEnd-f.timeStart;return t.addChild(i,new ft(i.vc,r,u,f.timeStart,f.top,e,f.height,{strokeStyle:f.strokeStyle?f.strokeStyle:n.Settings.timelineStrokeStyle,lineWidth:n.Settings.timelineLineWidth,fillStyle:n.Settings.timelineColor?n.Settings.timelineColor:f.fillStyle,opacity:typeof f.opacity!="undefined"?f.opacity:1},f),!0)}function c(i,r,s,c,l,a,v,y){var it;this.base=e;this.base(i,r,s,c,l,a,v);this.guid=y.id;this.type="contentItem";this.contentItem=y;var rt=v*n.Settings.contentItemTopTitleHeight*.8,b=v*n.Settings.contentItemMediaHeight,ut=n.Settings.contentItemFontHeight*v,p=a*n.Settings.contentItemContentWidth,w=(a-p)/2,g=v*n.Settings.contentItemVerticalMargin,et=l+g,ft=g*.4,ot=et+b+ft,st=c+a-w,nt=v*n.Settings.contentItemSourceHeight*.8,ht=ot+g+nt,tt=t.addRectangle(this,r,s+"__rect__",c,l,a,v,{strokeStyle:n.Settings.contentItemBoundingBoxBorderColor,lineWidth:n.Settings.contentItemBoundingBoxBorderWidth*a,fillStyle:n.Settings.contentItemBoundingBoxFillColor,isLineWidthVirtual:!0});this.reactsOnMouse=!0;this.onmouseenter=function(){tt.settings.strokeStyle=n.Settings.contentItemBoundingHoveredBoxBorderColor;this.vc.currentlyHoveredContentItem=this;this.vc.requestInvalidate()};this.onmouseleave=function(){tt.settings.strokeStyle=n.Settings.contentItemBoundingBoxBorderColor;this.vc.currentlyHoveredContentItem=null;this.isMouseIn=!1;this.vc.requestInvalidate()};this.onmouseclick=function(n){return f(this,n,1)};it=this;this.changeZoomLevel=function(f,e){var lt=it.newY,et=lt+g,bt=et+b+ft,at=bt+g+nt,dt,vt,yt,gt,pt,wt,ct,ht,st,ni,ti;if(e>=n.Settings.contentItemShowContentZoomLevel){if(f>=n.Settings.contentItemShowContentZoomLevel)return null;var l=new o(i,r,s+"__content",c,lt,a,v),ot=s+"__media__",kt=null;return this.contentItem.mediaType.toLowerCase()==="image"||this.contentItem.mediaType.toLowerCase()==="picture"?kt=t.addImage(l,r,ot,c+w,et,p,b,this.contentItem.uri):this.contentItem.mediaType.toLowerCase()==="deepimage"?kt=t.addSeadragonImage(l,r,ot,c+w,et,p,b,n.Settings.mediaContentElementZIndex,this.contentItem.uri):this.contentItem.mediaType.toLowerCase()==="video"?t.addVideo(l,r,ot,this.contentItem.uri,c+w,et,p,b,n.Settings.mediaContentElementZIndex):this.contentItem.mediaType.toLowerCase()==="audio"?(et+=n.Settings.contentItemAudioTopMargin*v,b=v*n.Settings.contentItemAudioHeight,k(l,r,ot,this.contentItem.uri,c+w,et,p,b,n.Settings.mediaContentElementZIndex)):this.contentItem.mediaType.toLowerCase()==="pdf"?t.addPdf(l,r,ot,this.contentItem.uri,c+w,et,p,b,n.Settings.mediaContentElementZIndex):this.contentItem.mediaType.toLowerCase()==="skydrive-document"?t.addSkydriveDocument(l,r,ot,this.contentItem.uri,c+w,et,p,b,n.Settings.mediaContentElementZIndex):this.contentItem.mediaType.toLowerCase()==="skydrive-image"?t.addSkydriveImage(l,r,ot,this.contentItem.uri,c+w,et,p,b,n.Settings.mediaContentElementZIndex):n.Extensions.mediaTypeIsExtension(y.mediaType)&&t.addExtension(y.mediaType,l,r,ot,c+w,et,p,b,n.Settings.mediaContentElementZIndex,this.contentItem.uri),dt=this.contentItem.title,u(l,r,s+"__title__",c+w,at,at+rt/2,.9*rt,dt,{fontName:n.Settings.contentItemHeaderFontName,fillStyle:n.Settings.contentItemHeaderFontColor,textBaseline:"middle",textAlign:"center",opacity:1,wrapText:!0,numberOfLines:1},p),vt=this.contentItem.attribution,yt=this.contentItem.mediaSource,vt&&(gt=function(t,f,e){var o=u(l,r,s+"__source__",t,e,e+nt/2,.9*nt,vt,{fontName:n.Settings.contentItemHeaderFontName,fillStyle:n.Settings.contentItemSourceFontColor,textBaseline:"middle",textAlign:"right",opacity:1,adjustWidth:!0},f);yt&&(o.reactsOnMouse=!0,o.onmouseclick=function(){return i.element.css("cursor","default"),window.open(yt),!0},o.onmouseenter=function(){this.settings.fillStyle=n.Settings.contentItemSourceHoveredFontColor;this.vc.requestInvalidate();this.vc.element.css("cursor","pointer")},o.onmouseleave=function(){this.settings.fillStyle=n.Settings.contentItemSourceFontColor;this.vc.requestInvalidate();this.vc.element.css("cursor","default")})},gt(c+w,p,bt)),pt=at+rt+g,wt=d(l,r,s+"__description__",c+w,pt,p,ut,this.contentItem.description,30,{}),n.Authoring.isEnabled&&(ct=(l.y+l.height-wt.y-wt.height)*.75,ht=t.addImage(l,r,s+"__edit",l.x+l.width-1.25*ct,pt+ut,ct,ct,"/images/edit.svg"),ht.reactsOnMouse=!0,ht.onmouseclick=function(){return n.Authoring.isActive=!0,n.Authoring.mode="editContentItem",n.Authoring.contentItemMode="editContentItem",n.Authoring.selectedExhibit=it.parent.parent.parent,n.Authoring.selectedContentItem=it.contentItem,!0},ht.onmouseenter=function(){this.vc.element.css("cursor","pointer");this.vc.element.attr("title","Edit Artifact");tt.settings.strokeStyle="yellow"},ht.onmouseleave=function(){this.vc.element.css("cursor","default");this.vc.element.attr("title","");tt.settings.strokeStyle=n.Settings.contentItemBoundingHoveredBoxBorderColor}),{zoomLevel:n.Settings.contentItemShowContentZoomLevel,content:l}}if(st=e,st>=n.Settings.contentItemThumbnailMaxLevel){if(f>=n.Settings.contentItemThumbnailMaxLevel&&f0)return null;st=n.Settings.contentItemThumbnailMinLevel}return ni=1<t.order?1:0}),g=0;g=n.Settings.infodotShowContentThumbZoomLevel&&e=n.Settings.infodotShowContentThumbZoomLevel&&f0&&(l=new o(i,r,s+"__contentItems",d.x,d.newY,2*k,2*k),g=p(b.contentItems,c,ut,k,i,r),g))for(nt=0;nt=n.Settings.infodotShowContentZoomLevel){if(f>=n.Settings.infodotShowContentZoomLevel)return null;if(b.tooltipEnabled=!1,b.tooltipIsShown==!0&&(n.Common.stopAnimationTooltip(),b.tooltipIsShown=!1),l=null,b.contentItems.length>0&&(l=new o(i,r,s+"__contentItems",d.x,d.y,2*k,2*k),g=p(b.contentItems,c,ut,k,i,r),g))for(nt=0;nt0))return null;if(y>=n.Settings.contentItemThumbnailMaxLevel){if(f>=n.Settings.contentItemThumbnailMaxLevel&&f=1&&o<=3?v.push(new c(f,e,s.id,ot,r+u*ut[(o-1)%3],b,k,s)):o>=4&&o<=6?v.push(new c(f,e,s.id,st,r+u*ft[(o-1)%3],b,k,s)):o>=7&&o<=9&&v.push(new c(f,e,s.id,i+u*et[(o-1)%3],ht,b,k,s));return v}function w(n,t){if(n==0)return null;var r=.05*t,i,u,f,e;return n%2==0?(i=-r/2-t,u=r/2,n==4)?(f=i-t-r,e=u+r+t,[f,i,u,e]):[i,u]:(i=-t/2,n>1)?(u=t/2+r,f=i-t-r,[f,i,u]):[i]}var l=$.Event("elementclick"),f,k,tt;t.getVisibleForElement=b;f=function(n,t,i){var r=n.vc.getViewport(),u=b(n,i,r,!0);return l.newvisible=u,l.element=n,n.vc.element.trigger(l),!0};t.CanvasElement=i;t.addRectangle=function(n,i,r,u,f,e,o,h){return t.addChild(n,new s(n.vc,i,r,u,f,e,o,h),!1)};t.addCircle=function(n,i,r,u,f,e,o,s){return t.addChild(n,new y(n.vc,i,r,u,f,e,o),s)};t.addImage=function(n,i,r,u,f,e,o,s,c){if(e<=0||o<=0)throw"Image size must be positive";return t.addChild(n,new h(n.vc,i,r,s,u,f,e,o,c),!1)};t.addLodImage=function(n,i,r,u,f,e,o,s,h){if(e<=0||o<=0)throw"Image size must be positive";return t.addChild(n,new st(n.vc,i,r,s,u,f,e,o,h),!1)};t.addSeadragonImage=function(n,i,r,u,f,e,o,s,h,c){if(e<=0||o<=0)throw"Image size must be positive";return t.addChild(n,new pt(n.vc,n,i,r,h,u,f,e,o,s,c),!1)};t.addExtension=function(i,r,u,f,e,o,s,h,c,l,a){if(s<=0||h<=0)throw"Extension size must be positive";var v=n.Extensions.getInitializer(i);return t.addChild(r,v(r.vc,r,u,f,l,e,o,s,h,c,a),!1)};t.addVideo=function(n,i,r,u,f,e,o,s,h){return t.addChild(n,new lt(n.vc,i,r,u,f,e,o,s,h),!1)};t.addPdf=function(n,i,r,u,f,e,o,s,h){return t.addChild(n,new ct(n.vc,i,r,u,f,e,o,s,h),!1)};k=function(n,i,r,u,f,e,o,s,h){return t.addChild(n,new at(n.vc,i,r,u,f,e,o,s,h),!1)};t.addSkydriveDocument=function(n,i,r,u,f,e,o,s,h){return t.addChild(n,new vt(n.vc,i,r,u,f,e,o,s,h),!1)};t.addSkydriveImage=function(n,i,r,u,f,e,o,s,h){return u.indexOf("https://onedrive.live.com/download?resid=")===0?t.addImage(n,i,r,f,e,o,s,u,null):t.addChild(n,new yt(n.vc,i,r,u,f,e,o,s,h),!1)};t.addText=u;t.addScrollText=d;t.addMultiLineText=nt;t.render=function(i,r,u,f,e){var o,c,h,l,s;if(!i.isVisible(u)){i.isRendered&&a(i);return}if(o=f.vectorVirtualToScreen(i.width,i.height),o.y<=n.Settings.renderThreshold||i.width!=0&&o.x<=n.Settings.renderThreshold){i.isRendered&&a(i);return}for(c=r[i.layerid],i.opacity!=null&&(e*=i.opacity),i.isRendered!=undefined&&i.isRendered||(i.isRendered=!0,i.onIsRenderedChanged&&i.onIsRenderedChanged()),i.render(c,u,f,o,e),h=i.children,l=h.length,s=0;s=n.x&&t.x+t.width<=n.x+n.width&&t.y>=n.y&&t.y+t.height<=n.y+n.height;return n.children.push(t),t.parent=n,t};t.removeChild=function(t,i){for(var r,f=t.children.length,u=0;u=this.x&&n.x<=this.x+this.width&&n.y>=this.y&&n.y<=this.y+this.height};this.render=function(){}}function u(n,i,r,u,f,e,o,s,h,c){return t.addChild(n,new et(n.vc,i,r,u,f,e,o,s,h,c),!1)}function d(n,i,r,u,f,e,o,s,h){return t.addChild(n,new ht(n.vc,i,r,u,f,e,o,s,h),!1)}function nt(n,i,r,u,f,e,o,s,h,c){return t.addChild(n,new ot(n.vc,i,r,u,f,o,s,h,c),!1)}function a(n){n.isRendered=!1;n.onIsRenderedChanged&&n.onIsRenderedChanged();for(var t=n.children.length;--t>=0;)n.children[t].isRendered&&a(n.children[t])}function v(t){for(var i,u=t.children.length,r=0;r0&&(this.vc.recentBreadCrumb==undefined||this.vc.breadCrumbs[n.breadCrumbs.length-1].vcElement.id!=this.vc.recentBreadCrumb.vcElement.id)?(this.vc.recentBreadCrumb=this.vc.breadCrumbs[n.breadCrumbs.length-1],this.vc.breadCrumbsChanged()):this.vc.breadCrumbs.length==0&&this.vc.recentBreadCrumb!=undefined&&(this.vc.recentBreadCrumb=undefined,this.vc.breadCrumbsChanged())}};this.prototype=new i(n,r,u,f,e,o,s)}function ut(n){var t=Math.max(n.x,n.y),r,i;if(t<=1)return 0;for(r=t&1?1:0,i=1;i<32;i++)t=t>>>1,t&1&&(r=r>0?i+1:i);return r}function e(n,r,u,f,e,o,s){var h,c,l;this.base=i;this.base(n,r,u,f,e,o,s);this.zoomLevel=0;this.prevContent=null;this.newContent=null;this.asyncContent=null;this.lastRenderTime=0;h=this;this.changeZoomLevel=function(){return null};c=function(n){h.lastRenderTime=new Date;h.prevContent=h.content;h.content=n.content;t.addChild(h,h.content,!1);h.prevContent&&(h.prevContent.opacity||(h.prevContent.opacity=1),h.content.opacity=0);h.zoomLevel=n.zoomLevel};l=function(){h.asyncContent&&(c(h.asyncContent),h.asyncContent=null,delete this.onLoad,h.vc.requestInvalidate())};this.render=function(n,i,r,u){var s,e,a,v;if(!this.asyncContent&&(this.prevContent||(s=ut(u),this.zoomLevel!=s&&(e=this.changeZoomLevel(this.zoomLevel,s),e&&(e.content.isLoading?(this.asyncContent=e,e.content.onLoad=l):c(e)))),this.prevContent)){a=new Date;v=a.getTime()-h.lastRenderTime;h.lastRenderTime=a.getTime();var y=v/1600,o=!1,f=this.prevContent.opacity;f=Math.max(0,f-y);f!=this.prevContent.opacity&&(o=!0);f==0?(t.removeChild(this,this.prevContent.id),this.prevContent=null):this.prevContent.opacity=f;f=this.content.opacity;f=Math.min(1,f+y);o||f==this.content.opacity||(o=!0);this.content.opacity=f;o&&this.vc.requestInvalidate()}};this.onIsRenderedChanged=function(){typeof this.removeWhenInvisible!="undefined"&&this.removeWhenInvisible&&(this.isRendered||(this.asyncContent&&(this.asyncContent=null),this.prevContent&&(t.removeChild(this,this.prevContent.id),this.prevContent=null),this.newContent&&(t.removeChild(this,this.newContent.id),this.newContent.content.onLoad=null,this.newContent=null),this.content&&(t.removeChild(this,this.content.id),this.content=null),this.zoomLevel=0))};this.prototype=new i(n,r,u,f,e,o,s)}function o(n,t,r,u,f,e,o){this.base=i;this.base(n,t,r,u,f,e,o);this.render=function(){};this.prototype=new i(n,t,r,u,f,e,o)}function s(t,r,u,f,e,o,s,h){this.base=i;this.base(t,r,u,f,e,o,s);this.settings=h;this.type="rectangle";this.render=function(n,t,i,r,u){var e=i.pointVirtualToScreen(this.x,this.y),o=i.pointVirtualToScreen(this.x+this.width,this.y+this.height),s=Math.max(0,e.x),h=Math.max(0,e.y),c=Math.min(i.width,o.x),l=Math.min(i.height,o.y),v,a,y,f;s0&&(this.settings.showFromCirca&&n.setLineDash&&n.setLineDash([6,3]),n.beginPath(),n.moveTo(e.x,h-f),n.lineTo(e.x,l+f),n.stroke(),n.setLineDash&&n.setLineDash([])),e.y>0&&(n.beginPath(),n.moveTo(s-f,e.y),n.lineTo(c+f,e.y),n.stroke()),o.xn.x+n.width||this.y+this.heightn.y+n.height)};this.contains=function(n){return n.x>this.x&&n.x+n.widththis.y&&n.y+n.height=n.Settings.minTimelineWidth};this.prototype=new i(t,r,u,f,e,o,s)}function ft(i,r,e,o,h,c,l,a,v){var y=this;this.base=s;this.base(i,r,e,o,h,c,l);this.guid=v.guid;this.type="timeline";this.isBuffered=v.isBuffered;this.settings=a;this.parent=undefined;this.currentlyObservedTimelineEvent=i.currentlyObservedTimelineEvent;this.settings.outline=!0;this.type="timeline";this.endDate=v.endDate;this.FromIsCirca=v.FromIsCirca||!1;this.ToIsCirca=v.ToIsCirca||!1;this.backgroundUrl=v.backgroundUrl||"";this.aspectRatio=v.aspectRatio||null;this.offsetY=v.offsetY;this.Height=v.Height;this.settings.showFromCirca=this.FromIsCirca;this.settings.showToCirca=this.ToIsCirca;this.settings.showInfinite=v.endDate==9999;var g=v.timeEnd-v.timeStart,p=v.titleRect?v.titleRect.height:n.Settings.timelineHeaderSize*v.height,k=v.titleRect&&(n.Authoring.isEnabled||n.Settings.isAuthorized)?v.titleRect.width:0,w=v.titleRect?v.titleRect.marginLeft:n.Settings.timelineHeaderMargin*v.height,b=v.titleRect?v.titleRect.marginTop:(1-n.Settings.timelineHeaderMargin)*v.height-p,d=v.top+b+p/2;this.titleObject=u(this,r,e+"__header__",n.Authoring.isEnabled?v.timeStart+w+p:v.timeStart+w,v.top+b,d,p,v.header,{fontName:n.Settings.timelineHeaderFontName,fillStyle:n.Settings.timelineHeaderFontColor,textBaseline:"middle"},k);this.title=this.titleObject.text;this.regime=v.regime;this.settings.gradientOpacity=0;this.settings.gradientFillStyle=n.Settings.timelineGradientFillStyle?n.Settings.timelineGradientFillStyle:v.gradientFillStyle||v.strokeStyle?v.strokeStyle:n.Settings.timelineBorderColor;this.reactsOnMouse=!0;this.tooltipEnabled=!0;this.tooltipIsShown=!1;y.backgroundUrl&&(y.backgroundImg=new wt(y.vc,r,e+"__background__",y.backgroundUrl,y.x,y.y,y.width,y.height),y.settings.gradientOpacity=0,y.settings.fillStyle=undefined);this.onmouseclick=function(n){return f(this,n,1)};this.onmousehover=function(){if(this.vc.currentlyHoveredTimeline!=null&&this.vc.currentlyHoveredTimeline.id!=e)try{this.vc.currentlyHoveredInfodot.id}catch(i){n.Common.stopAnimationTooltip();this.vc.currentlyHoveredTimeline.tooltipIsShown=!1}if(this.vc.currentlyHoveredTimeline=this,this.settings.strokeStyle=n.Settings.timelineHoveredBoxBorderColor,this.settings.lineWidth=n.Settings.timelineHoveredLineWidth,this.titleObject.settings.fillStyle=n.Settings.timelineHoveredHeaderFontColor,this.settings.hoverAnimationDelta=n.Settings.timelineHoverAnimation,this.vc.requestInvalidate(),this.titleObject.initialized==!1){var t=this.vc.getViewport();this.titleObject.screenFontSize=n.Settings.timelineHeaderSize*t.heightVirtualToScreen(this.height)}if(this.tooltipEnabled=this.titleObject.screenFontSize<=n.Settings.timelineTooltipMaxHeaderSize?!0:!1,n.Common.tooltipMode!="infodot"){if(n.Common.tooltipMode="timeline",this.tooltipEnabled==!1){n.Common.stopAnimationTooltip();this.tooltipIsShown=!1;return}if(this.tooltipIsShown==!1){switch(this.regime){case"Cosmos":$(".bubbleInfo").attr("id","cosmosRegimeBox");break;case"Earth":$(".bubbleInfo").attr("id","earthRegimeBox");break;case"Life":$(".bubbleInfo").attr("id","lifeRegimeBox");break;case"Pre-history":$(".bubbleInfo").attr("id","prehistoryRegimeBox");break;case"Humanity":$(".bubbleInfo").attr("id","humanityRegimeBox")}$(".bubbleInfo span").text(this.title);this.panelWidth=$(".bubbleInfo").outerWidth();this.panelHeight=$(".bubbleInfo").outerHeight();this.tooltipIsShown=!0;n.Common.animationTooltipRunning=$(".bubbleInfo").fadeIn()}}};this.onmouseunhover=function(){this.vc.currentlyHoveredTimeline!=null&&this.vc.currentlyHoveredTimeline.id==e&&(this.vc.currentlyHoveredTimeline=null,this.tooltipIsShown==!0&&n.Common.tooltipMode=="timeline"&&(n.Common.tooltipMode="default",n.Common.stopAnimationTooltip(),$(".bubbleInfo").attr("id","defaultBox"),this.tooltipIsShown=!1));this.settings.strokeStyle=v.strokeStyle?v.strokeStyle:n.Settings.timelineBorderColor;this.settings.lineWidth=n.Settings.timelineLineWidth;this.titleObject.settings.fillStyle=n.Settings.timelineHeaderFontColor;this.settings.hoverAnimationDelta=-n.Settings.timelineHoverAnimation;this.vc.requestInvalidate()};this.base_render=this.render;this.render=function(u,f,o,s,h){var c,l,p;this.titleObject.initialized=!1;this.settings.hoverAnimationDelta&&(this.settings.gradientOpacity=Math.min(1,Math.max(0,this.settings.gradientOpacity+this.settings.hoverAnimationDelta)));typeof y.backgroundImg!="undefined"&&y.backgroundImg.render(u,f,o,s,1);y.base_render(u,f,o,s,h);c=this.x+this.width-1*this.titleObject.height;l=this.titleObject.y+.15*this.titleObject.height;typeof this.tweetBtn=="undefined"&&this.titleObject.width!==0&&(this.tweetBtn=t.addImage(this,r,e+"__tweet",c,l,.7*this.titleObject.height,.7*this.titleObject.height,"/images/icon_twitter_canvas.svg"),this.tweetBtn.reactsOnMouse=!0,this.tweetBtn.onmouseclick=function(){function i(t){t.id!=="__root__"&&(n="/"+t.id+n,i(t.parent))}var t=null,n="";if(i(this.parent),n=window.location.origin+window.location.pathname+"#"+n,t=$.ajax({async:!1,timeout:5e3,type:"GET",url:"http://to.ly/api.php?json=1&longurl="+encodeURIComponent(n)+"&callback=?"}).responseText,t!==null)try{t=JSON.parse(t.slice(2,-1)).shorturl;n=t}catch(r){}window.open("http://twitter.com/share?url="+encodeURIComponent(n)+"&hashtags=chronozoom&text="+encodeURIComponent(this.parent.title+" - "))},this.tweetBtn.onmousehover=function(){this.vc.element.css("cursor","pointer");this.vc.element.attr("title","Share on Twitter")},this.tweetBtn.onmouseunhover=function(){this.vc.element.css("cursor","default");this.vc.element.attr("title","")},this.tweetBtn.onRemove=function(){this.onmousehover=undefined;this.onmouseunhover=undefined;this.onmouseclick=undefined});n.Settings.isAuthorized===!0&&typeof this.favoriteBtn=="undefined"&&this.titleObject.width!==0&&(c-=this.titleObject.height,this.favoriteBtn=t.addImage(this,r,e+"__favorite",c,l,.7*this.titleObject.height,.7*this.titleObject.height,"/images/star.svg"),this.favoriteBtn.reactsOnMouse=!0,this.favoriteBtn.onmouseclick=function(){var t=this;return n.Settings.favoriteTimelines.indexOf(this.parent.guid)!==-1?(n.Service.deleteUserFavorite(this.parent.guid).then(function(){n.Authoring.showMessageWindow('"'+t.parent.title+'" was removed from your favorite timelines.',"Timeline removed from favorites")},function(){console.log("[ERROR] /deleteUserFavorite with guid "+t.parent.guid+" failed.")}),n.Settings.favoriteTimelines.splice(n.Settings.favoriteTimelines.indexOf(this.parent.guid),1)):n.Service.putUserFavorite(this.parent.guid).then(function(){n.Settings.favoriteTimelines.push(t.parent.guid);n.Authoring.showMessageWindow('"'+t.parent.title+'" was added to your favorite timelines.',"Favorite timeline added")},function(){console.log("[ERROR] /putUserFavorite with guid + "+t.parent.guid+" failed.")}),!0},this.favoriteBtn.onmousehover=function(){this.vc.element.css("cursor","pointer");this.vc.element.attr("title","Add to or Remove from Favorites");this.parent.settings.strokeStyle="yellow"},this.favoriteBtn.onmouseunhover=function(){this.vc.element.css("cursor","default");this.vc.element.attr("title","");this.parent.settings.strokeStyle=v.strokeStyle?v.strokeStyle:n.Settings.timelineBorderColor},this.favoriteBtn.onRemove=function(){this.onmousehover=undefined;this.onmouseunhover=undefined;this.onmouseclick=undefined});n.Authoring.isEnabled===!0&&typeof this.pasteButton=="undefined"&&this.titleObject.width!==0&&(c-=this.titleObject.height,this.pasteButton=t.addImage(this,r,e+"__paste",c,l,.7*this.titleObject.height,.7*this.titleObject.height,"/images/paste.svg"),this.pasteButton.reactsOnMouse=!0,this.pasteButton.onmousehover=function(){this.vc.element.css("cursor","pointer");this.vc.element.attr("title","Paste Timeline/Exhibit");this.parent.settings.strokeStyle="yellow"},this.pasteButton.onmouseunhover=function(){this.vc.element.css("cursor","default");this.vc.element.attr("title","");this.parent.settings.strokeStyle=v.strokeStyle?v.strokeStyle:n.Settings.timelineBorderColor},this.pasteButton.onmouseclick=function(){var t=localStorage.getItem("ExportedTimeline"),i=localStorage.getItem("ExportedExhibit"),r=localStorage.getItem("ExportedSchemaVersion")==constants.schemaVersion;r&&t!=null?n.Service.importTimelines(this.parent.guid,t).then(function(t){n.Authoring.showMessageWindow(t)}):r&&i!=null?n.Service.importExhibit(this.parent.guid,i).then(function(t){n.Authoring.showMessageWindow(t)}):n.Authoring.showMessageWindow("Please copy a timeline to your ChronoZoom clip-board first.","Unable to Paste Timeline")},this.pasteButton.onRemove=function(){this.onmousehover=undefined;this.onmouseunhover=undefined;this.onmouseclick=undefined});typeof this.copyButton=="undefined"&&this.titleObject.width!==0&&(c-=this.titleObject.height,this.copyButton=t.addImage(this,r,e+"__copy",c,l,.7*this.titleObject.height,.7*this.titleObject.height,"/images/copy.svg"),this.copyButton.reactsOnMouse=!0,this.copyButton.onmousehover=function(){this.vc.element.css("cursor","pointer");this.vc.element.attr("title","Copy Timeline");this.parent.settings.strokeStyle="yellow"},this.copyButton.onmouseunhover=function(){this.vc.element.css("cursor","default");this.vc.element.attr("title","");this.parent.settings.strokeStyle=v.strokeStyle?v.strokeStyle:n.Settings.timelineBorderColor},this.copyButton.onmouseclick=function(){n.Service.exportTimelines(this.parent.guid).then(function(t){localStorage.setItem("ExportedSchemaVersion",constants.schemaVersion);localStorage.setItem("ExportedTimeline",JSON.stringify(t));localStorage.removeItem("ExportedExhibit");n.Authoring.showMessageWindow('"'+t[0].timeline.title+'" has been copied to your clip-board. You can paste this into a different timeline.')})},this.copyButton.onRemove=function(){this.onmousehover=undefined;this.onmouseunhover=undefined;this.onmouseclick=undefined});n.Authoring.isEnabled&&typeof this.editButton=="undefined"&&this.titleObject.width!==0&&(this.editButton=t.addImage(this,r,e+"__edit",this.x+this.titleObject.height*.15,this.titleObject.y,this.titleObject.height,this.titleObject.height,"/images/edit.svg"),this.editButton.reactsOnMouse=!0,this.editButton.onmouseclick=function(){return n.Common.vc.virtualCanvas("getHoveredInfodot").x==undefined&&(n.Authoring.isActive=!0,n.Authoring.mode="editTimeline",n.Authoring.selectedTimeline=this.parent),!0},this.editButton.onmousehover=function(){this.vc.element.css("cursor","pointer");this.vc.element.attr("title","Edit Timeline");this.parent.settings.strokeStyle="yellow"},this.editButton.onmouseunhover=function(){this.vc.element.css("cursor","default");this.vc.element.attr("title","");this.parent.settings.strokeStyle=v.strokeStyle?v.strokeStyle:n.Settings.timelineBorderColor},this.editButton.onRemove=function(){this.onmousehover=undefined;this.onmouseunhover=undefined;this.onmouseclick=undefined});this.settings.hoverAnimationDelta&&(this.settings.gradientOpacity==0||this.settings.gradientOpacity==1?this.settings.hoverAnimationDelta=undefined:this.vc.requestInvalidate());var a=o.pointVirtualToScreen(this.x,this.y),w={x:a.x+s.x,y:a.y+s.y},b=o.visible.centerX-n.Settings.timelineCenterOffsetAcceptableImplicity<=this.x+this.width&&o.visible.centerX+n.Settings.timelineCenterOffsetAcceptableImplicity>=this.x&&o.visible.centerY-n.Settings.timelineCenterOffsetAcceptableImplicity<=this.y+this.height&&o.visible.centerY+n.Settings.timelineCenterOffsetAcceptableImplicity>=this.y,k=a.xo.width-n.Settings.timelineBreadCrumbBorderOffset||a.yo.height-n.Settings.timelineBreadCrumbBorderOffset;if(k&&b){if(p=i.breadCrumbs.length,p>1&&i.breadCrumbs[p-1].vcElement.parent.id==this.parent.id)return;i.breadCrumbs.push({vcElement:this})}};this.prototype=new s(i,r,e,o,h,c,l,a)}function y(t,r,u,f,e,o,s){this.base=i;this.base(t,r,u,f-o,e-o,2*o,2*o);this.settings=s;this.isObservedNow=!1;this.type="circle";this.render=function(n,t,i,r,u){var f=this.width/2,o=this.x+f,s=this.y+f,e=i.pointVirtualToScreen(o,s),h=i.widthVirtualToScreen(f);this.settings.showCirca&&n.setLineDash&&n.setLineDash([6,3]);n.globalAlpha=u;n.beginPath();n.arc(e.x,e.y,h,0,Math.PI*2,!0);this.settings.strokeStyle&&(n.strokeStyle=this.settings.strokeStyle,n.lineWidth=this.settings.lineWidth?this.settings.isLineWidthVirtual?i.widthVirtualToScreen(this.settings.lineWidth):this.settings.lineWidth:1,n.stroke());this.settings.fillStyle&&(n.fillStyle=this.settings.fillStyle,n.fill());n.setLineDash&&n.setLineDash([])};this.isInside=function(t){var i=n.Common.sqr(t.x-f)+n.Common.sqr(t.y-this.y-this.height/2);return i<=o*o};this.prototype=new i(t,r,u,f-o/2,e-o/2,o,o)}function g(n,t,i,r,u,f){var o=$.browser,h=o.msie&&parseInt(o.version,10)>=9;if(h)t.font=u+"pt "+f,t.fillText(n,i,r);else{var s=12,c=u,e=c/s;t.scale(e,e);t.font=s+"pt "+f;t.fillText(n,i/e,r/e);t.scale(1/e,1/e)}}function et(n,t,r,u,f,e,o,s,h,c){this.base=i;this.base(n,t,r,u,f,c?c:0,o);this.text=s;this.baseline=e;this.newBaseline=e;this.settings=h;this.opacity=h.opacity||0;this.type="text";typeof this.settings.textBaseline!="undefined"&&this.settings.textBaseline==="middle"&&(this.newBaseline=this.newY+this.newHeight/2);this.initialized=!1;this.screenFontSize=0;this.render=function(n,t,i,r,u){var e=i.pointVirtualToScreen(this.x,this.newY),y=i.pointVirtualToScreen(this.x,this.newBaseline).y,f,h,k,p,o,tt,it,ut,s,w,b;if(n.globalAlpha=u,n.fillStyle=this.settings.fillStyle,f=r.y,h=1.5,this.screenFontSize!=f&&(this.screenFontSize=f),!this.initialized){if(this.settings.wrapText){for(k=this.settings.numberOfLines?this.settings.numberOfLines:1,this.settings.numberOfLines=k,f=r.y/k/h;;){n.font=f+"pt "+this.settings.fontName;var rt=this.text.split("\n"),d=0,nt=[];for(p=0;pr.x&&c>0?(nt.push(l),c=0,d+=f*h,o--,l=""):(l===""?l=a[o]:l+=" "+a[o],c=tt),a.length==1&&v.width>r.x)for(it=v.width;it>r.x;)f/=1.5,it/=1.5;nt.push(l);d+=f*h}if(d>r.y)f/=1.5;else{this.text=nt;ut=i.heightScreenToVirtual(f);this.settings.fontSizeVirtual=ut;break}}this.screenFontSize=f}else n.font=f+"pt "+this.settings.fontName,this.screenFontSize=f,this.width==0?(s=n.measureText(this.text),r.x=s.width,this.width=i.widthScreenToVirtual(s.width)):(s=n.measureText(this.text),s.width>r.x?(this.height=this.width*r.y/s.width,this.settings.textBaseline==="middle"&&(this.newY=this.newBaseline-this.newHeight/2),f=i.heightVirtualToScreen(this.height),this.screenFontSize=f):typeof this.settings.adjustWidth&&this.settings.adjustWidth&&(w=i.widthScreenToVirtual(s.width),this.settings.textAlign==="center"?this.x=this.x+(this.width-w)/2:this.settings.textAlign==="right"&&(this.x=this.x+this.width-w),this.width=w,e=i.pointVirtualToScreen(this.x,this.newY),r.x=i.widthVirtualToScreen(this.width)));this.initialized=!0}if(this.settings.textAlign&&(n.textAlign=this.settings.textAlign,this.settings.textAlign==="center"?e.x=e.x+r.x/2:this.settings.textAlign==="right"&&(e.x=e.x+r.x)),this.settings.wrapText)for(f=i.heightVirtualToScreen(this.settings.fontSizeVirtual),this.screenFontSize=f,n.textBaseline="middle",y=e.y+f*h/2,b=0;b0?(i=this.x+this.width,Math.max(this.x,n.Left)<=Math.min(i,n.Right)&&Math.max(this.y,n.Top)<=Math.min(t,n.Bottom)):Math.max(this.y,n.Top)<=Math.min(t,n.Bottom)};this.prototype=new i(n,t,r,u,f,c?c:0,o)}function ot(n,t,r,u,f,e,o,s,h){this.base=i;this.base(n,t,r,u,f,e*10,e);this.settings=h;this.text=o;this.render=function(n,t,i,r){function e(n,t,i,r,u,f){var h,c;if(f=f||0,f<=0){n.fillText(t,i,r);return}for(var o=t.split(" "),s=0,e=1;o.length>0&&e<=o.length;)h=o.slice(0,e).join(" "),c=n.measureText(h).width,c>f?(e==1&&(e=2),n.fillText(o.slice(0,e-1).join(" "),i,r+u*s),s++,o=o.splice(e-1),e=1):e++;e>0&&n.fillText(o.join(" "),i,r+u*s)}var f=i.pointVirtualToScreen(this.x,this.y),u;n.fillStyle=h.fillStyle;n.font=r.y+"pt "+h.fontName;n.textBaseline="top";u=i.heightVirtualToScreen(this.height);e(n,this.text,f.x,f.y,u,s*u)};this.prototype=new i(n,t,r,u,f,e*10,e)}function h(t,r,u,f,e,o,s,h,c){var l;this.base=i;this.base(t,r,u,e,o,s,h);this.onload=c;this.isLoading=!0;l=new Image;this.img=l;this.img.isLoaded=!1;var a=this,v=function(){var i,n,r,u,t;l.isLoading=!1;l.isRemoved?(delete l.isRemoved,delete l.isLoaded):(l.naturalHeight&&(i=a.width/a.height,n=l.naturalWidth/l.naturalHeight,i>n?(r=n*a.height,t=(a.width-r)/2,a.x+=t,a.width=r):i=0;)if(this.imageSources[l].zoomLevel<=e)return this.imageSources[l].zoomLevel===r?null:{zoomLevel:this.imageSources[l].zoomLevel,content:new h(n,t,i+"@"+this.imageSources[l].zoomLevel,this.imageSources[l].imageSource,u,f,o,s,c)};return null};this.prototype=new e(n,t,i,u,f,o,s)}function r(n,t,r,u,f,e,o,s){this.base=i;this.base(n,t,r,u,f,e,o);this.initializeContent=function(n){this.content=n;n&&(n.style.position="absolute",n.style.overflow="hidden",n.style.zIndex=s)};this.onIsRenderedChanged=function(){this.content&&(this.isRendered?(this.content.isAdded||(this.vc.element[0].appendChild(this.content),this.content.isAdded=!0),this.content.style.display="block"):this.content.style.display="none")};this.render=function(n,t,i,r,u){if(this.content){var f=i.pointVirtualToScreen(this.x,this.y),w=i.height,b=i.width,a=0,v=0,y=r.y,p=r.x,s=0,h=w,c=f.y,l=f.y+r.y,e=Math.max(s,c),o=Math.min(h,l);e<=o&&(a=e-f.y,y=o-f.y);s=0;h=b;c=f.x;l=f.x+r.x;e=Math.max(s,c);o=Math.min(h,l);e<=o&&(v=e-f.x,p=o-f.x);this.content.style.left=f.x+"px";this.content.style.top=f.y+"px";this.content.style.width=r.x+"px";this.content.style.height=r.y+"px";this.content.style.clip="rect("+a+"px,"+p+"px,"+y+"px,"+v+"px)";this.content.style.opacity=u;this.content.style.filter="alpha(opacity="+u*100+")"}};this.onRemove=function(){if(this.content)try{this.content.isAdded&&(this.content.src&&(this.content.src=""),this.vc.element[0].removeChild(this.content),this.content.isAdded=!1)}catch(n){alert(n.Description)}};this.prototype=new i(n,t,r,u,f,e,o)}function ht(t,i,u,f,e,o,s,h,c){var l,a;this.base=r;this.base(t,i,u,f,e,o,s,c);l=$("
<\/div>",{id:"citext_"+u,"class":"contentItemDescription"}).appendTo(t);l[0].addEventListener("mousemove",n.Common.preventbubble,!1);l[0].addEventListener("mousedown",n.Common.preventbubble,!1);l[0].addEventListener("DOMMouseScroll",n.Common.preventbubble,!1);l[0].addEventListener("mousewheel",n.Common.preventbubble,!1);a=$("
<\/div>");a.html(marked(h)).appendTo(l);this.initializeContent(l[0]);this.render=function(t,i,r,u,f){var e=u.y/n.Settings.contentItemDescriptionNumberOfLines;l.css("font-size",e+"px");this.prototype.render.call(this,t,i,r,u,f)};this.onRemove=function(){this.prototype.onRemove.call(this);l[0].removeEventListener("mousemove",n.Common.preventbubble,!1);l[0].removeEventListener("mouseup",n.Common.preventbubble,!1);l[0].removeEventListener("mousedown",n.Common.preventbubble,!1);l[0].removeEventListener("DOMMouseScroll",n.Common.preventbubble,!1);l[0].removeEventListener("mousewheel",n.Common.preventbubble,!1);l=undefined};this.prototype=new r(t,i,u,f,e,o,s,c)}function ct(n,t,i,u,f,e,o,s,h){var l="http://docs.google.com/viewer?url=",c;this.base=r;this.base(n,t,i,f,e,o,s,h);c=document.createElement("iframe");c.setAttribute("id",i);u.match("/^"+l+"/")||(u=l+u);u+=u.indexOf("?")==-1?"?&embedded=true&wmode=opaque":"&embedded=true&wmode=opaque";c.setAttribute("src",u);c.setAttribute("visible","true");c.setAttribute("controls","true");this.initializeContent(c);this.prototype=new r(n,t,i,f,e,o,s,h)}function lt(n,t,i,u,f,e,o,s,h){this.base=r;this.base(n,t,i,f,e,o,s,h);var c=document.createElement("iframe");c.setAttribute("id",i);u+=u.indexOf("?")==-1?"?wmode=opaque":"&wmode=opaque";c.setAttribute("src",u);c.setAttribute("visible","true");c.setAttribute("controls","true");this.initializeContent(c);this.prototype=new r(n,t,i,f,e,o,s,h)}function at(n,t,i,u,f,e,o,s,h){this.base=r;this.base(n,t,i,f,e,o,s,h);var c=document.createElement("audio");c.setAttribute("id",i);c.setAttribute("src",u);c.setAttribute("visible","true");c.setAttribute("controls","true");this.initializeContent(c);this.prototype=new r(n,t,i,f,e,o,s,h)}function vt(n,t,i,u,f,e,o,s,h){this.base=r;this.base(n,t,i,f,e,o,s,h);var c=document.createElement("iframe");c.setAttribute("id",i);c.setAttribute("src",u);this.initializeContent(c);this.prototype=new r(n,t,i,f,e,o,s,h)}function yt(n,t,i,u,f,e,o,s,h){this.base=r;this.base(n,t,i,f,e,o,s,h);var l=u.split(" "),c=document.createElement("iframe");c.setAttribute("id",i);c.setAttribute("src",l[0]);c.setAttribute("scrolling","no");c.setAttribute("frameborder","0");c.setAttribute("sandbox","allow-forms allow-scripts");this.initializeContent(c);this.render=function(n,t,i,r,u){if(this.content){var s=i.pointVirtualToScreen(this.x,this.y),f=parseFloat(l[1]),e=parseFloat(l[2]),o=r.x/f;e/f>r.y/r.x&&(o=r.y/e);this.content.style.left=s.x+r.x/2+"px";this.content.style.top=s.y+r.y/2+"px";this.content.style.marginLeft=-f/2+"px";this.content.style.marginTop=-e/2+"px";this.content.style.width=f+"px";this.content.style.height=e+"px";this.content.style.opacity=u;this.content.style.filter="alpha(opacity="+u*100+")";this.content.style.webkitTransform="scale("+o+")";this.content.style.msTransform="scale("+o+")";this.content.style.MozTransform="scale("+o+")"}};this.prototype=new r(n,t,i,f,e,o,s,h)}function pt(i,u,f,e,o,s,h,c,l,a,v){var y=this,p;this.base=r;this.base(i,f,e,s,h,c,l,a);this.onload=v;this.nAttempts=0;this.timeoutHandles=[];p=document.createElement("div");p.setAttribute("id",e);p.setAttribute("style","color: white");this.initializeContent(p);this.viewer=new Seadragon.Viewer(p);this.viewer.elmt.addEventListener("mousemove",n.Common.preventbubble,!1);this.viewer.elmt.addEventListener("mousedown",n.Common.preventbubble,!1);this.viewer.elmt.addEventListener("DOMMouseScroll",n.Common.preventbubble,!1);this.viewer.elmt.addEventListener("mousewheel",n.Common.preventbubble,!1);this.viewer.addEventListener("open",function(){y.onload&&y.onload();y.vc.requestInvalidate()});this.viewer.addEventListener("resize",function(n){y.viewer.setDashboardEnabled(n.elmt.clientWidth>250)});this.onSuccess=function(t){var i,r;if(t.error){y.showFallbackImage();return}if(i=t.content,i.ready){for(r=0;r0?c*o+f.x:f.x,p=l>0?l*s+f.y:f.y,g=a*o,nt=v*s;n.globalAlpha=u;a===1&&v===1&&(y=Math.max(0,f.x),p=Math.max(0,f.y),g=Math.min(k,e.x)-y,nt=Math.min(d,e.y)-p);h.img.naturalWidth&&h.img.naturalHeight&&n.drawImage(h.img,ft,et,a,v,y,p,g,nt)}};h.onRemove=function(){h.img.removeEventListener("load",c,!1)};h.prototype=new i(n,t,r,f,e,o,s)}function bt(i,r,u,f){var e=f.timeEnd-f.timeStart;return t.addChild(i,new ft(i.vc,r,u,f.timeStart,f.top,e,f.height,{strokeStyle:f.strokeStyle?f.strokeStyle:n.Settings.timelineStrokeStyle,lineWidth:n.Settings.timelineLineWidth,fillStyle:n.Settings.timelineColor?n.Settings.timelineColor:f.fillStyle,opacity:typeof f.opacity!="undefined"?f.opacity:1},f),!0)}function c(i,r,s,c,l,a,v,y){var it;this.base=e;this.base(i,r,s,c,l,a,v);this.guid=y.id;this.type="contentItem";this.contentItem=y;var rt=v*n.Settings.contentItemTopTitleHeight*.8,b=v*n.Settings.contentItemMediaHeight,ut=n.Settings.contentItemFontHeight*v,p=a*n.Settings.contentItemContentWidth,w=(a-p)/2,g=v*n.Settings.contentItemVerticalMargin,et=l+g,ft=g*.4,ot=et+b+ft,st=c+a-w,nt=v*n.Settings.contentItemSourceHeight*.8,ht=ot+g+nt,tt=t.addRectangle(this,r,s+"__rect__",c,l,a,v,{strokeStyle:n.Settings.contentItemBoundingBoxBorderColor,lineWidth:n.Settings.contentItemBoundingBoxBorderWidth*a,fillStyle:n.Settings.contentItemBoundingBoxFillColor,isLineWidthVirtual:!0});this.reactsOnMouse=!0;this.onmouseenter=function(){tt.settings.strokeStyle=n.Settings.contentItemBoundingHoveredBoxBorderColor;this.vc.currentlyHoveredContentItem=this;this.vc.requestInvalidate()};this.onmouseleave=function(){tt.settings.strokeStyle=n.Settings.contentItemBoundingBoxBorderColor;this.vc.currentlyHoveredContentItem=null;this.isMouseIn=!1;this.vc.requestInvalidate()};this.onmouseclick=function(n){return f(this,n,1)};it=this;this.changeZoomLevel=function(f,e){var lt=it.newY,et=lt+g,bt=et+b+ft,at=bt+g+nt,dt,vt,yt,gt,pt,wt,ct,ht,st,ni,ti;if(e>=n.Settings.contentItemShowContentZoomLevel){if(f>=n.Settings.contentItemShowContentZoomLevel)return null;var l=new o(i,r,s+"__content",c,lt,a,v),ot=s+"__media__",kt=null;return this.contentItem.mediaType.toLowerCase()==="image"||this.contentItem.mediaType.toLowerCase()==="picture"?kt=t.addImage(l,r,ot,c+w,et,p,b,this.contentItem.uri):this.contentItem.mediaType.toLowerCase()==="deepimage"?kt=t.addSeadragonImage(l,r,ot,c+w,et,p,b,n.Settings.mediaContentElementZIndex,this.contentItem.uri):this.contentItem.mediaType.toLowerCase()==="video"?t.addVideo(l,r,ot,this.contentItem.uri,c+w,et,p,b,n.Settings.mediaContentElementZIndex):this.contentItem.mediaType.toLowerCase()==="audio"?(et+=n.Settings.contentItemAudioTopMargin*v,b=v*n.Settings.contentItemAudioHeight,k(l,r,ot,this.contentItem.uri,c+w,et,p,b,n.Settings.mediaContentElementZIndex)):this.contentItem.mediaType.toLowerCase()==="pdf"?t.addPdf(l,r,ot,this.contentItem.uri,c+w,et,p,b,n.Settings.mediaContentElementZIndex):this.contentItem.mediaType.toLowerCase()==="skydrive-document"?t.addSkydriveDocument(l,r,ot,this.contentItem.uri,c+w,et,p,b,n.Settings.mediaContentElementZIndex):this.contentItem.mediaType.toLowerCase()==="skydrive-image"?t.addSkydriveImage(l,r,ot,this.contentItem.uri,c+w,et,p,b,n.Settings.mediaContentElementZIndex):n.Extensions.mediaTypeIsExtension(y.mediaType)&&t.addExtension(y.mediaType,l,r,ot,c+w,et,p,b,n.Settings.mediaContentElementZIndex,this.contentItem.uri),dt=this.contentItem.title,u(l,r,s+"__title__",c+w,at,at+rt/2,.9*rt,dt,{fontName:n.Settings.contentItemHeaderFontName,fillStyle:n.Settings.contentItemHeaderFontColor,textBaseline:"middle",textAlign:"center",opacity:1,wrapText:!0,numberOfLines:1},p),vt=this.contentItem.attribution,yt=this.contentItem.mediaSource,vt&&(gt=function(t,f,e){var o=u(l,r,s+"__source__",t,e,e+nt/2,.9*nt,vt,{fontName:n.Settings.contentItemHeaderFontName,fillStyle:n.Settings.contentItemSourceFontColor,textBaseline:"middle",textAlign:"right",opacity:1,adjustWidth:!0},f);yt&&(o.reactsOnMouse=!0,o.onmouseclick=function(){return i.element.css("cursor","default"),window.open(yt),!0},o.onmouseenter=function(){this.settings.fillStyle=n.Settings.contentItemSourceHoveredFontColor;this.vc.requestInvalidate();this.vc.element.css("cursor","pointer")},o.onmouseleave=function(){this.settings.fillStyle=n.Settings.contentItemSourceFontColor;this.vc.requestInvalidate();this.vc.element.css("cursor","default")})},gt(c+w,p,bt)),pt=at+rt+g,wt=d(l,r,s+"__description__",c+w,pt,p,ut,this.contentItem.description,30,{}),n.Authoring.isEnabled&&(ct=(l.y+l.height-wt.y-wt.height)*.75,ht=t.addImage(l,r,s+"__edit",l.x+l.width-1.25*ct,pt+ut,ct,ct,"/images/edit.svg"),ht.reactsOnMouse=!0,ht.onmouseclick=function(){return n.Authoring.isActive=!0,n.Authoring.mode="editContentItem",n.Authoring.contentItemMode="editContentItem",n.Authoring.selectedExhibit=it.parent.parent.parent,n.Authoring.selectedContentItem=it.contentItem,!0},ht.onmouseenter=function(){this.vc.element.css("cursor","pointer");this.vc.element.attr("title","Edit Artifact");tt.settings.strokeStyle="yellow"},ht.onmouseleave=function(){this.vc.element.css("cursor","default");this.vc.element.attr("title","");tt.settings.strokeStyle=n.Settings.contentItemBoundingHoveredBoxBorderColor}),{zoomLevel:n.Settings.contentItemShowContentZoomLevel,content:l}}if(st=e,st>=n.Settings.contentItemThumbnailMaxLevel){if(f>=n.Settings.contentItemThumbnailMaxLevel&&f0)return null;st=n.Settings.contentItemThumbnailMinLevel}return ni=1<t.order?1:0}),g=0;g=n.Settings.infodotShowContentThumbZoomLevel&&e=n.Settings.infodotShowContentThumbZoomLevel&&f0&&(l=new o(i,r,s+"__contentItems",d.x,d.newY,2*k,2*k),y=p(b.contentItems,c,ut,k,i,r),y))for(g=0;g=n.Settings.infodotShowContentZoomLevel){if(f>=n.Settings.infodotShowContentZoomLevel)return null;if(b.tooltipEnabled=!1,b.tooltipIsShown==!0&&(n.Common.stopAnimationTooltip(),b.tooltipIsShown=!1),l=null,b.contentItems.length>0&&(l=new o(i,r,s+"__contentItems",d.x,d.y,2*k,2*k),y=p(b.contentItems,c,ut,k,i,r),y))for(g=0;g0))return null;if(v>=n.Settings.contentItemThumbnailMaxLevel){if(f>=n.Settings.contentItemThumbnailMaxLevel&&f=1&&o<=3?v.push(new c(f,e,s.id,ot,r+u*ut[(o-1)%3],b,k,s)):o>=4&&o<=6?v.push(new c(f,e,s.id,st,r+u*ft[(o-1)%3],b,k,s)):o>=7&&o<=9&&v.push(new c(f,e,s.id,i+u*et[(o-1)%3],ht,b,k,s));return v}function w(n,t){if(n==0)return null;var r=.05*t,i,u,f,e;return n%2==0?(i=-r/2-t,u=r/2,n==4)?(f=i-t-r,e=u+r+t,[f,i,u,e]):[i,u]:(i=-t/2,n>1)?(u=t/2+r,f=i-t-r,[f,i,u]):[i]}var l=$.Event("elementclick"),f,k,tt;t.getVisibleForElement=b;f=function(n,t,i){var r=n.vc.getViewport(),u=b(n,i,r,!0);return l.newvisible=u,l.element=n,n.vc.element.trigger(l),!0};t.CanvasElement=i;t.addRectangle=function(n,i,r,u,f,e,o,h){return t.addChild(n,new s(n.vc,i,r,u,f,e,o,h),!1)};t.addCircle=function(n,i,r,u,f,e,o,s){return t.addChild(n,new y(n.vc,i,r,u,f,e,o),s)};t.addImage=function(n,i,r,u,f,e,o,s,c){if(e<=0||o<=0)throw"Image size must be positive";return t.addChild(n,new h(n.vc,i,r,s,u,f,e,o,c),!1)};t.addLodImage=function(n,i,r,u,f,e,o,s,h){if(e<=0||o<=0)throw"Image size must be positive";return t.addChild(n,new st(n.vc,i,r,s,u,f,e,o,h),!1)};t.addSeadragonImage=function(n,i,r,u,f,e,o,s,h,c){if(e<=0||o<=0)throw"Image size must be positive";return t.addChild(n,new pt(n.vc,n,i,r,h,u,f,e,o,s,c),!1)};t.addExtension=function(i,r,u,f,e,o,s,h,c,l,a){if(s<=0||h<=0)throw"Extension size must be positive";var v=n.Extensions.getInitializer(i);return t.addChild(r,v(r.vc,r,u,f,l,e,o,s,h,c,a),!1)};t.addVideo=function(n,i,r,u,f,e,o,s,h){return t.addChild(n,new lt(n.vc,i,r,u,f,e,o,s,h),!1)};t.addPdf=function(n,i,r,u,f,e,o,s,h){return t.addChild(n,new ct(n.vc,i,r,u,f,e,o,s,h),!1)};k=function(n,i,r,u,f,e,o,s,h){return t.addChild(n,new at(n.vc,i,r,u,f,e,o,s,h),!1)};t.addSkydriveDocument=function(n,i,r,u,f,e,o,s,h){return t.addChild(n,new vt(n.vc,i,r,u,f,e,o,s,h),!1)};t.addSkydriveImage=function(n,i,r,u,f,e,o,s,h){return u.indexOf("https://onedrive.live.com/download?resid=")===0?t.addImage(n,i,r,f,e,o,s,u,null):t.addChild(n,new yt(n.vc,i,r,u,f,e,o,s,h),!1)};t.addText=u;t.addScrollText=d;t.addMultiLineText=nt;t.render=function(i,r,u,f,e){var o,c,h,l,s;if(!i.isVisible(u)){i.isRendered&&a(i);return}if(o=f.vectorVirtualToScreen(i.width,i.height),o.y<=n.Settings.renderThreshold||i.width!=0&&o.x<=n.Settings.renderThreshold){i.isRendered&&a(i);return}for(c=r[i.layerid],i.opacity!=null&&(e*=i.opacity),i.isRendered!=undefined&&i.isRendered||(i.isRendered=!0,i.onIsRenderedChanged&&i.onIsRenderedChanged()),i.render(c,u,f,o,e),h=i.children,l=h.length,s=0;s=n.x&&t.x+t.width<=n.x+n.width&&t.y>=n.y&&t.y+t.height<=n.y+n.height;return n.children.push(t),t.parent=n,t};t.removeChild=function(t,i){for(var r,f=t.children.length,u=0;u