Revision: 2260
Author:
se.m...@gmail.com
Date: Mon Nov 26 04:25:26 2012
Log: Animation facet
http://code.google.com/p/simile-widgets/source/detail?r=2260
Added:
/exhibit/trunk/src/webapp/api/extensions/animation
/exhibit/trunk/src/webapp/api/extensions/animation/animation-extension-bundle-debug.js
/exhibit/trunk/src/webapp/api/extensions/animation/animation-extension-bundle.css
/exhibit/trunk/src/webapp/api/extensions/animation/animation-extension-bundle.js
/exhibit/trunk/src/webapp/api/extensions/animation/animation-extension.js
/exhibit/trunk/src/webapp/api/extensions/animation/scripts
/exhibit/trunk/src/webapp/api/extensions/animation/scripts/animation-facet.js
/exhibit/trunk/src/webapp/api/extensions/animation/scripts/animation-inline.js
/exhibit/trunk/src/webapp/api/extensions/animation/scripts/animation-slideshare.js
/exhibit/trunk/src/webapp/api/extensions/animation/scripts/animation-youtube.js
/exhibit/trunk/src/webapp/api/extensions/animation/scripts/swfobject.js
/exhibit/trunk/src/webapp/api/extensions/animation/styles
/exhibit/trunk/src/webapp/api/extensions/animation/styles/animation-facet.css
Modified:
/exhibit/trunk/build.xml
/exhibit/trunk/src/webapp/api/exhibit-bundle-debug.js
/exhibit/trunk/src/webapp/api/extensions/data-editor/scripts/data-editor.js
/exhibit/trunk/src/webapp/api/extensions/map/map-extension-bundle-debug.js
/exhibit/trunk/src/webapp/api/extensions/map/map-extension-bundle.js
/exhibit/trunk/src/webapp/api/locales/no/exhibit-no-bundle.js
=======================================
--- /dev/null
+++
/exhibit/trunk/src/webapp/api/extensions/animation/animation-extension-bundle-debug.js
Mon Nov 26 04:25:26 2012
@@ -0,0 +1,907 @@
+
+
+/* animation-facet.js */
+Exhibit.AnimationFacet=function(containerElmt,uiContext){this._div=containerElmt;
+this._uiContext=uiContext;
+this._expression=null;
+this._mode=Exhibit.AnimationFacet.MODE_NONE;
+this._listModePeriods=null;
+this._listModeCurrentPeriods=[];
+this._rangeModePrecision=null;
+this._rangeModeMaxRange={min:null,max:null};
+this._rangeModeCurrentRange={min:null,max:null};
+this._dateModeInterval=null;
+this._settings={};
+this._ui=null;
+};
+Exhibit.AnimationFacet.DAY="day";
+Exhibit.AnimationFacet.MONTH="month";
+Exhibit.AnimationFacet.YEAR="year";
+Exhibit.AnimationFacet.MODE_NONE=0;
+Exhibit.AnimationFacet.MODE_LIST=1;
+Exhibit.AnimationFacet.MODE_RANGE=2;
+Exhibit.AnimationFacet.MODE_DATE=3;
+Exhibit.AnimationFacet.DEBUG1=false;
+Exhibit.AnimationFacet.PLAY_PNG="iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wDGw42NiWo9VwAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAADtJREFUKM+VjzEKACAAAu+i/3+5lpYgQgU3DxVgHUfyEbYFvqDBHFvgAhsAgEGpWWRNAdMG00mmH0yObCp4Bx5kUSOtAAAAAElFTkSuQmCC";
+Exhibit.AnimationFacet.PAUSE_PNG="iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wDGw43G3lsmGgAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAAB1JREFUKM9jZGBg+M+ACRihNIYcEwOJYFTDSNEAAI/YAhcjCBZEAAAAAElFTkSuQmCC";
+Exhibit.AnimationFacet._getNextAnimationUnique=function(){if(!Exhibit.AnimationFacet._animationCounter){Exhibit.AnimationFacet._animationCounter=0;
+}var r=Exhibit.AnimationFacet._animationCounter;
+Exhibit.AnimationFacet._animationCounter++;
+return r;
+};
+Exhibit.AnimationFacet._settingSpecs={"facetLabel":{type:"text"},"showLabel":{type:"boolean",defaultValue:true},"type":{type:"text",defaultValue:"default"},"width":{type:"text"},"height":{type:"text"},"formatter":{type:"text",defaultValue:null},"startTime":{type:"int",defaultValue:0},"duration":{type:"int",defaultValue:60}};
+Exhibit.AnimationFacet.create=function(configuration,containerElmt,uiContext){if(Exhibit.AnimationFacet.DEBUG1){console.log("create",configuration,containerElmt,uiContext);
+}var uiContext=Exhibit.UIContext.create(configuration,uiContext);
+var facet=new Exhibit.AnimationFacet(containerElmt,uiContext);
+Exhibit.AnimationFacet._configure(facet,configuration);
+facet._initializeUI();
+uiContext.getCollection().addFacet(facet);
+return facet;
+};
+Exhibit.AnimationFacet.createFromDOM=function(configElmt,containerElmt,uiContext){if(Exhibit.AnimationFacet.DEBUG1){console.log("createFromDOM",configElmt,containerElmt,uiContext);
+}var uiContext=Exhibit.UIContext.createFromDOM(configElmt,uiContext);
+var facet=new
Exhibit.AnimationFacet(containerElmt!=null?containerElmt:configElmt,uiContext);
+Exhibit.SettingsUtilities.collectSettingsFromDOM(configElmt,Exhibit.AnimationFacet._settingSpecs,facet._settings);
+try{var expressionString=Exhibit.getAttribute(configElmt,"expression");
+if(expressionString!=null&&expressionString.length>0){facet._expression=Exhibit.ExpressionParser.parse(expressionString);
+}if(facet._expression==null){SimileAjax.Debug.exception(e2,"AnimationFacet:
no
expression specified; using .label");
+facet._expression=".label";
+}var selections=Exhibit.getAttribute(configElmt,"selections");
+if(selections!=null&&selections.length>0){try{facet._listModePeriods=eval(selections);
+facet._mode=Exhibit.AnimationFacet.MODE_LIST;
+}catch(e2){SimileAjax.Debug.exception(e2,"AnimationFacet: Selections needs
to be valid JSON structure");
+}}else{try{var
sequence=Exhibit.getAttribute(configElmt,"selectionSequence");
+var dur=facet._settings.duration;
+if(!dur){dur=60;
+}if(sequence!=null&&sequence.length>0){var a=sequence.split(",");
+var b=[];
+var d=Math.floor(dur/a.length);
+for(var i=0;
+i<a.length;
+i++){b.push({from:i*d,to:i*d+d,select:[$.trim(a[i])]});
+}}facet._listModePeriods=b;
+facet._mode=Exhibit.AnimationFacet.MODE_LIST;
+}catch(e2){SimileAjax.Debug.exception(e2,"AnimationFacet: Selection
sequence or duration is invalid");
+}}var precision=Exhibit.getAttribute(configElmt,"precision");
+if(precision!=null&&precision.length>0){try{facet._rangeModePrecision=parseInt(precision);
+facet._mode=Exhibit.AnimationFacet.MODE_RANGE;
+}catch(e2){SimileAjax.Debug.exception(e2,"AnimationFacet: Precision needs
to be integer");
+}}var datePrecision=Exhibit.getAttribute(configElmt,"datePrecision");
+if(datePrecision!=null&&datePrecision.length>0){try{var
arr=[Exhibit.AnimationFacet.DAY,Exhibit.AnimationFacet.MONTH,Exhibit.AnimationFacet.YEAR];
+for(var i=0;
+i<arr.length;
+i++){if(datePrecision.toLowerCase()==arr[i]){facet._dateModeInterval=arr[i];
+facet._mode=Exhibit.AnimationFacet.MODE_DATE;
+}}}catch(e2){SimileAjax.Debug.exception(e2,"AnimationFacet: Date precision
needs to be year, month or day");
+}}if(facet._mode==Exhibit.AnimationFacet.MODE_NONE){SimileAjax.Debug.exception(e2,"AnimationFacet:
need
to define either ex:selections, ex:precision or ex:datePrecision");
+}}catch(e){SimileAjax.Debug.exception(e,"AnimationFacet: Error processing
configuration of animation facet");
+}Exhibit.AnimationFacet._configure(facet);
+facet._initializeUI();
+uiContext.getCollection().addFacet(facet);
+return facet;
+};
+Exhibit.AnimationFacet._configure=function(facet,configuration){if(Exhibit.AnimationFacet.DEBUG1){console.log("_configure",facet,configuration);
+}if(!("facetLabel" in
facet._settings)){facet._settings.facetLabel="Animation facet";
+if(facet._expression!=null&&facet._expression.isPath()){var
segment=facet._expression.getPath().getLastSegment();
+var property=facet._uiContext.getDatabase().getProperty(segment.property);
+if(property!=null){facet._settings.facetLabel=segment.forward?property.getLabel():property.getReverseLabel();
+}}}if("formatter" in facet._settings){var
formatter=facet._settings.formatter;
+if(formatter!=null&&formatter.length>0){try{facet._formatter=eval(formatter);
+}catch(e){SimileAjax.Debug.log(e);
+}}}if(facet._mode==Exhibit.AnimationFacet.MODE_LIST){facet._cache=new
Exhibit.FacetUtilities.Cache(facet._uiContext.getDatabase(),facet._uiContext.getCollection(),facet._expression);
+}else{if(facet._mode==Exhibit.AnimationFacet.MODE_RANGE){var r;
+var database=facet._uiContext.getDatabase();
+if(facet._expression.getPath()){var path=facet._expression.getPath();
+var propertyID=path.getLastSegment().property;
+var property=database.getProperty(propertyID);
+r=property.getRangeIndex();
+}else{var expression=facet._expression;
+r=new
Exhibit.Database._RangeIndex(facet._uiContext.getCollection().getAllItems(),function(item,f){expression.evaluateOnItem(item,database).values.visit(function(value){if(typeof
value!="number"){value=parseFloat(value);
+}if(!isNaN(value)){f(value);
+}});
+});
+}facet._rangeModeMaxRange={min:facet._minRangePrecision(r.getMin()),max:facet._maxRangePrecision(r.getMax())};
+var database=facet._uiContext.getDatabase();
+var
getter=function(item,f){facet._expression.evaluateOnItem(item,database).values.visit(function(value){if(typeof
value!="number"){value=parseFloat(value);
+}if(!isNaN(value)){f(value);
+}});
+};
+facet._rangeIndex=new
Exhibit.Database._RangeIndex(facet._uiContext.getCollection().getAllItems(),getter);
+}else{if(facet._mode==Exhibit.AnimationFacet.MODE_DATE){}}}};
+Exhibit.AnimationFacet.prototype.dispose=function(){if(Exhibit.AnimationFacet.DEBUG1){console.log("dispose");
+}this._ui.dispose();
+if(this._cache){this._cache.dispose();
+this._cache=null;
+}if(this._rangeIndex){this._rangeIndex=null;
+}this._uiContext.getCollection().removeFacet(this);
+this._uiContext=null;
+this._div.innerHTML="";
+this._div=null;
+this._expression=null;
+this._settings=null;
+this._listModePeriods=null;
+this._listModeCurrentPeriods=null;
+this._listModeValueSet=null;
+this._rangeModeMaxRange=null;
+this._rangeModeCurrentRange=null;
+};
+Exhibit.AnimationFacet.prototype.hasRestrictions=function(){if(Exhibit.AnimationFacet.DEBUG1){console.log("hasRestrictions");
+}if(this._mode==Exhibit.AnimationFacet.MODE_LIST){return
this._listModeCurrentPeriods.length>0;
+}else{if(this._mode==Exhibit.AnimationFacet.MODE_RANGE){var
min=(this._rangeModeCurrentRange.min!=null&&this._rangeModeCurrentRange.min!=this._rangeModeMaxRange.min);
+var
max=(this._rangeModeCurrentRange.max!=null&&this._rangeModeCurrentRange.max!=this._rangeModeMaxRange.max);
+return(min||max);
+}else{if(this._mode==Exhibit.AnimationFacet.MODE_DATE){return false;
+}else{return false;
+}}}};
+Exhibit.AnimationFacet.prototype.restrict=function(items){if(Exhibit.AnimationFacet.DEBUG1){console.log("restrict",items);
+}if(this._mode==Exhibit.AnimationFacet.MODE_LIST){if(this._listModeCurrentPeriods.length==0){return
items;
+}else{var valueSet=new Exhibit.Set();
+for(var i=0;
+i<this._listModeCurrentPeriods.length;
+i++){var p=this._listModeCurrentPeriods[i];
+for(var j=0;
+j<p.select.length;
+j++){valueSet.add(p.select[j]);
+}}return this._cache.getItemsFromValues(valueSet,items);
+}}else{if(this._mode==Exhibit.AnimationFacet.MODE_RANGE){var
min=this._rangeModeCurrentRange.min;
+var max=this._rangeModeCurrentRange.max;
+if(this._expression.isPath()){var path=this._expression.getPath();
+var database=this._uiContext.getDatabase();
+return path.rangeBackward(min,max,false,items,database).values;
+}else{return this._rangeIndex.getSubjectsInRange(min,max,false,null,items);
+}}else{if(this._mode==Exhibit.AnimationFacet.MODE_DATE){}}}};
+Exhibit.AnimationFacet.prototype.clearAllRestrictions=function(){if(Exhibit.AnimationFacet.DEBUG1){console.log("clearAllRestrictions");
+}Exhibit.AnimationFacet.testRemoteLog();
+if(this.hasRestrictions()){if(this._mode==Exhibit.AnimationFacet.MODE_LIST){this._listModeCurrentPeriods=[];
+}else{if(this._mode==Exhibit.AnimationFacet.MODE_RANGE){this._rangeModeCurrentRange.min=this._rangeModeMaxRange.min;
+this._rangeModeCurrentRange.max=this._rangeModeMaxRange.max;
+}}var
preUpdateSize=SimileAjax.RemoteLog.logActive?this._uiContext.getCollection().countRestrictedItems():0;
+this._notifyCollection();
+var
postUpdateSize=SimileAjax.RemoteLog.logActive?this._uiContext.getCollection().countRestrictedItems():0;
+var
totalSize=SimileAjax.RemoteLog.logActive?this._uiContext.getCollection().countAllItems():0;
+SimileAjax.RemoteLog.possiblyLog({facetType:"AnimationFacet",facetLabel:this._settings.facetLabel,operation:"clearAllRestrictions",exhibitSize:totalSize,preUpdateSize:preUpdateSize,postUpdateSize:postUpdateSize});
+}};
+Exhibit.AnimationFacet.prototype.applyRestrictions=function(restrictions){};
+Exhibit.AnimationFacet.prototype.setSelection=function(value,selected){};
+Exhibit.AnimationFacet.prototype.update=function(items){if(Exhibit.AnimationFacet.DEBUG1){console.log("update",items);
+}};
+Exhibit.AnimationFacet.prototype._notifyCollection=function(){if(Exhibit.AnimationFacet.DEBUG1){console.log("_notifyCollection");
+}this._uiContext.getCollection().onFacetUpdated(this);
+};
+Exhibit.AnimationFacet.prototype._initializeUI=function(){if(Exhibit.AnimationFacet.DEBUG1){console.log("_initializeUI");
+}switch(this._settings["type"]){case"youtube":this._ui=new
Exhibit.AnimationFacet.YouTube(this);
+break;
+case"slideshare":this._ui=new Exhibit.AnimationFacet.SlideShare(this);
+break;
+case"inline":this._ui=new Exhibit.AnimationFacet.Inline(this);
+break;
+case"default":default:this._ui=new Exhibit.AnimationFacet.DefaultUI(this);
+break;
+}this._ui.setDuration(this._settings.duration);
+var html=this._ui.initUI();
+$(this._div).html(html);
+this._ui.postInitUI();
+};
+Exhibit.AnimationFacet.prototype._clearSelections=function(){if(Exhibit.AnimationFacet.DEBUG1){console.log("_clearSelections");
+}var state={};
+var self=this;
+SimileAjax.History.addLengthyAction(function(){state.restrictions=self.clearAllRestrictions();
+},function(){self.applyRestrictions(state.restrictions);
+},String.substitute(Exhibit.FacetUtilities.l10n["facetClearSelectionsActionTitle"],[this._settings.facetLabel]));
+};
+Exhibit.AnimationFacet.testRemoteLog=function(){if(!SimileAjax["RemoteLog"]){SimileAjax.RemoteLog={logActive:false};
+SimileAjax.RemoteLog.possiblyLog=function(a){};
+}};
+Exhibit.AnimationFacet.prototype.updateModeParams=function(secs){if(this._mode==Exhibit.AnimationFacet.MODE_LIST){var
periods=[];
+for(var i=0;
+i<this._listModePeriods.length;
+i++){var p=this._listModePeriods[i];
+if(secs>=p.from&&secs<
p.to){periods.push(p);
+}}var rebuild=false;
+if(periods.length!=this._listModeCurrentPeriods.length){rebuild=true;
+}else{for(var i=0;
+i<this._listModeCurrentPeriods.length;
+i++){if(periods[i]!=this._listModeCurrentPeriods[i]){rebuild=true;
+break;
+}}}if(rebuild){this._listModeCurrentPeriods=periods;
+this._notifyCollection();
+}}else{if(this._mode==Exhibit.AnimationFacet.MODE_RANGE){var
rng=this._rangeModeMaxRange.max-this._rangeModeMaxRange.min;
+var pos=secs/this._ui.getDuration();
+var val=Math.floor(this._rangeModeMaxRange.min+rng*pos);
+var min=this._minRangePrecision(val);
+var max=this._maxRangePrecision(val);
+if(this._rangeModeCurrentRange.min!=min||
this._rangeModeCurrentRange.max!=max){this._rangeModeCurrentRange.min=min;
+this._rangeModeCurrentRange.max=max;
+this._notifyCollection();
+}}else{if(this._mode==Exhibit.AnimationFacet.MODE_DATE){}}}};
+Exhibit.AnimationFacet.prototype._minRangePrecision=function(v){var
pr=this._rangeModePrecision;
+v-=((v>=0)?v%pr:pr-Math.abs(v%pr));
+return v;
+};
+Exhibit.AnimationFacet.prototype._maxRangePrecision=function(v){var
pr=this._rangeModePrecision;
+v+=((v>=0)?pr-v%pr:Math.abs(v%pr));
+return v;
+};
+Exhibit.AnimationFacet.Labels=function(facet,secs,config){if(facet._mode==Exhibit.AnimationFacet.MODE_LIST){if(config==undefined){config={base:0,showAsSeconds:false,inclusiveBounds:false};
+}var f=(config.showAsSeconds)?function(secs){return secs+config.base;
+}:function(secs){var m=Math.floor(secs/60);
+var s=Math.ceil(secs%60);
+return m+":"+(s<10?"0":"")+s;
+};
+this.timeLabel=f(secs);
+this.lowerLabel=f(0);
+this.upperLabel=f(facet._ui.getDuration()-(config.inclusiveBounds?1:0));
+}else{if(facet._mode==Exhibit.AnimationFacet.MODE_RANGE){var
rng=facet._rangeModeMaxRange.max-facet._rangeModeMaxRange.min;
+var pos=secs/facet._ui.getDuration();
+this.timeLabel=Math.floor(facet._rangeModeMaxRange.min+rng*pos);
+this.lowerLabel=facet._rangeModeMaxRange.min;
+this.upperLabel=facet._rangeModeMaxRange.max;
+}else{this.timeLabel="?";
+this.lowerLabel="Lower";
+this.upperLabel="Upper";
+}}};
+Exhibit.AnimationFacet.DefaultUI=function(facet){this._duration=0;
+this._dom=null;
+this._facet=facet;
+this._currentTimePosition=0;
+this._animationStartTime=0;
+this._animationStartPosition=0;
+this._animationFrameDelay=100;
+this._animationPlaying=false;
+this._dragging=false;
+this._animationGlueFunc="__animation_glue__"+Exhibit.AnimationFacet._getNextAnimationUnique();
+var self=this;
+Exhibit.AnimationFacet.DefaultUI[this._animationGlueFunc]=function(){self._animate();
+};
+};
+Exhibit.AnimationFacet.DefaultUI.prototype.dispose=function(){this._dom=null;
+};
+Exhibit.AnimationFacet.DefaultUI.prototype.setDuration=function(secs){this._duration=secs;
+};
+Exhibit.AnimationFacet.DefaultUI.prototype.getDuration=function(){return
this._duration;
+};
+Exhibit.AnimationFacet.DefaultUI.prototype.initUI=function(){var
labels=new Exhibit.AnimationFacet.Labels(this._facet,0);
+var settings=this._facet._settings;
+var cssHeight=settings["height"]?" height:"+settings["height"]:"10px";
+var html='<div><div class="exhibit-facet-header"
style="position:Relative;"><span class="exhibit-facet-header-filterControl"
style="position:Absolute; display:Inline-Block; vertical-align:Middle;
right:0px; top:0px; text-align:Right; white-space:NoWrap;"><span
class="exhibit-facet-animation-button"></span> <input type="checkbox"
class="exhibit-facet-animation-tickbox"
/></span>'+((settings["showLabel"])?'<span
class="exhibit-facet-header-title">'+settings["facetLabel"]+"</span>":"")+'</div><div
class="exhibit-facet-animation-shaft-container"><div
class="exhibit-facet-animation-shaft" style="position:Relative;
width:100%;'+cssHeight+'"><div
class="exhibit-facet-animation-shaft-markers"
style="'+cssHeight+'"></div><div
class="exhibit-facet-animation-shaft-thumb"
style="position:Absolute;'+cssHeight+'"></div></div></div><div
class="exhibit-facet-animation-labels" style="position:Relative;
height:1em;"><div style="position:Absolute;
left:0px;">'+labels.lowerLabel+'</div><div style="position:Absolute;
right:0px;">'+labels.upperLabel+'</div><div
class="exhibit-facet-animation-labels-time"
style="text-align:Center"></div></div></div>';
+var el=$(html);
+this._dom={elmt:el.get()[0],shaft:$(".exhibit-facet-animation-shaft",el).get()[0],thumb:$(".exhibit-facet-animation-shaft-thumb",el).get()[0],time:$(".exhibit-facet-animation-labels-time",el).get()[0],button:$(".exhibit-facet-animation-button",el).get()[0],tickbox:$("input.exhibit-facet-animation-tickbox",el).get()[0],markers:$(".exhibit-facet-animation-shaft-markers",el).get()[0]};
+var self=this;
+$(this._dom.shaft).mousedown(function(ev){if(ev.which==1){ev.preventDefault();
+self._dragging=true;
+}});
+$(document).mousemove(function(ev){if(self._dragging&&ev.which==1){ev.preventDefault();
+var x=ev.pageX-$(self._dom.shaft).offset().left;
+self._updateThumbUI(x,false);
+}}).mouseup(function(ev){if(self._dragging&&ev.which==1){ev.preventDefault();
+var x=ev.pageX-$(self._dom.shaft).offset().left;
+if(!self._updateThumbUI(x,true)){self._animationStartTime=(new
Date()).getTime();
+self._animationStartPosition=x;
+}self._dragging=false;
+}});
+$(this._dom.tickbox).click(function(ev){var $this=$(this);
+if($this.attr("checked")){self._facet.updateModeParams(self._currentTimePosition);
+}else{self._facet.clearAllRestrictions();
+}});
+this._showPlayButton(true);
+return this._dom.elmt;
+};
+Exhibit.AnimationFacet.DefaultUI.prototype.postInitUI=function(){this._updateThumbUI(0,false);
+};
+Exhibit.AnimationFacet.DefaultUI.prototype._showPlayButton=function(b){var
self=this;
+$(this._dom.button).html('<img
src="data:image/png;base64,'+Exhibit.AnimationFacet[b?"PLAY_PNG":"PAUSE_PNG"]+'"
/>');
+$("img",this._dom.button).click(b?function(ev){self._animateStart();
+}:function(ev){self._animateStop();
+});
+$(this._dom.tickbox).attr("disabled",!b);
+};
+Exhibit.AnimationFacet.DefaultUI.prototype._updateThumbUI=function(x,considerRestrict){var
w=$(this._dom.shaft).width();
+var ended=(x>w-1);
+x=(x<0)?0:x;
+x=(x>w-1)?w-1:x;
+var th=$(this._dom.thumb);
+th.css("left",(x-th.width()/2)+"px");
+this._currentTimePosition=Math.floor(this._duration*(x/w*1));
+var labels=new
Exhibit.AnimationFacet.Labels(this._facet,this._currentTimePosition);
+$(this._dom.time).html(labels.timeLabel);
+if(considerRestrict){this._facet.updateModeParams(this._currentTimePosition);
+$(this._dom.tickbox).attr("checked",this._facet.hasRestrictions()?"checked":"");
+}return ended;
+};
+Exhibit.AnimationFacet.DefaultUI.prototype._animateStart=function(){this._animationPlaying=true;
+this._animationStartTime=(new Date()).getTime();
+this._animationStartPosition=($(this._dom.thumb).offset().left)-($(this._dom.shaft).offset().left)+($(this._dom.thumb).width()/2);
+this._showPlayButton(false);
+setTimeout("Exhibit.AnimationFacet.DefaultUI."+this._animationGlueFunc+"()",this._animationFrameDelay);
+};
+Exhibit.AnimationFacet.DefaultUI.prototype._animateStop=function(){this._animationPlaying=false;
+this._showPlayButton(true);
+};
+Exhibit.AnimationFacet.DefaultUI.prototype._animate=function(){var
timeElapsed=(new Date()).getTime()-this._animationStartTime;
+var sh_w=$(this._dom.shaft).width();
+var pixelsPerMillisecond=sh_w/(this._duration*1000);
+var distanceTravelled=timeElapsed*pixelsPerMillisecond;
+var pos=this._animationStartPosition+distanceTravelled;
+var ended=false;
+if(!this._dragging){ended=this._updateThumbUI(pos,true);
+}if(this._animationPlaying){if(!ended){setTimeout("Exhibit.AnimationFacet.DefaultUI."+this._animationGlueFunc+"()",this._animationFrameDelay);
+}else{this._animateStop();
+this._updateThumbUI(0,false);
+this._facet.clearAllRestrictions();
+}}};
+Exhibit.AnimationFacet.__augment=function(obj){for(var f in
obj){if(f.indexOf("_X_")>=0){continue;
+}if(typeof obj[f]=="function"){obj["_X_"+f]=obj[f];
+obj[f]=function(){var ret=obj["_X_"+f].apply(obj,arguments);
+return ret;
+};
+}}};
+
+
+/* animation-inline.js */
+Exhibit.AnimationFacet._settingSpecs["inlineshowplay"]={type:"boolean",defaultValue:true};
+Exhibit.AnimationFacet._settingSpecs["inlinemodernstyle"]={type:"boolean",defaultValue:false};
+Exhibit.AnimationFacet.Inline=function(facet){this._duration=0;
+this._dom=null;
+this._facet=facet;
+this._animationStartTime=0;
+this._animationStartPosition=0;
+this._animationFrameDelay=100;
+this._animationPlaying=false;
+this._dragging=false;
+this._animationGlueFunc="__animation_glue__"+Exhibit.AnimationFacet._getNextAnimationUnique();
+var self=this;
+Exhibit.AnimationFacet.Inline[this._animationGlueFunc]=function(){self._animate();
+};
+};
+Exhibit.AnimationFacet.Inline.PLAY_PNG="iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAAXNSR0IArs4c6QAAAAZiS0dEAMkAyQDJYYDmDgAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wJBw06OtKSuKQAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAAVxJREFUKM+dk89KAlEUxn83fAxh3qSFT+HONrlyE25mV+3O20T0D6KEQgwtC5mNJCLq6KhMiuhCZ+Fp4U0TRKy7ufcc+H3ng/NdRORCRA75xzEiovadA85d133eFz4ASCaTxOPxBPAkIo/7OokBOI6D4zg0m03y+XzC9/2EiOSAU9d18zttZ7PZjWar1aJQKNDpdAAegbNtIkZENJPJ2Mp21WCAdrtFsVQiCAKAB+uksAGnj9NrEECXQvbC933K5TL9fh/g3jp5MSKiR6nUilmpGgMoqmCskN/2qVQqhGEIcBIDmEfRehwKan7cY4But4vneQyHQ4A7u9LiEp7NwSib3iEIAqrVKqPRCODWQqWNVUXR3E4y6EIZDAbUap+Mx2OAGwu9bt3zLIpgoYRfIfV6nclkor+gt50h6fd6NBoNptOpAtcWKu+VMM/zFLiy0Pu+2Y4Blxb6+Ouv+gZldbw7tlbjQQAAAABJRU5ErkJggg==";
+Exhibit.AnimationFacet.Inline.PAUSE_PNG="iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAAXNSR0IArs4c6QAAAAZiS0dEAMkAyQDJYYDmDgAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wJBw4TAryQIYgAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAAP9JREFUKM99kt1xg0AMhD95aCHjspxuoASoybzThtNFbO1FebgfYAzWw83N7Wm10srGcQxOYhgG+4R3AH3fvwHTNLX7Gd4BpPQHnBYgpQQYEOXcVJYcyqNtOMZxJOMiCAx7l+2ekysYtlfh7phRqq9xqcxJwuW4HEkAfN9urbK7kDvy/G+tLLVettxf12tLXkcSRJZRem6y61wy6K9nTnY14rC1964xH8Tv85VJisxDn+XKom0v/ufxWKdd4NjgOTk5UXqyjZPLslCtjMhYGNTPxSrxKc7wS5UtCVexo8xgGIbWc8VcanvRrMLidENTmTbsF6UDmOf7R9n3eT58/wfel7gwBDKMLAAAAABJRU5ErkJggg==";
+Exhibit.AnimationFacet.Inline.THUMB_PNG="iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAAXNSR0IArs4c6QAAAAZiS0dEAMwAzADM38FfGgAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wIFAsaGOk3cJEAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAAgpJREFUKM+dkz9OG0EYxX8zOxvJiMiDwQYbS4QQ2lRIMQoSDRAuwAFSUeQCewSuQJUDcISUSLELKsoAKeKVRdaWEVpEpJ1/KXaxUJQ0mW70vd8370lvBH+ck5OTj8ARsAU0gClwAZwlSfL5uVY8g94Cp0DvzeYmGxuvaTZbTMZjbm6+c3X1DWAAHCdJcjmDK/CL1rq1836HzmoHFUUIKQFwzjEajTg/P+fu7i4D9pMkuZTVw6da69b+wQEr7RWiKEKpmDiOiZVCRYp2u83hh0O01q3KIVGV8dPu7i6NhQZRHBEphVKKOH6BEBBCIPiAkAKt61xfX3f39vZ+SOBobe0Vi4uLBIAAVGLnLd5DCB5fTllaarK+vg5wJIGtbneV4EMp8h7nHNZZTGEwpsA5h3cO78t5t9sF2FJAo16v47xDOomQorRKQCIJhHKhtbMFekEDNBQwnU6nzdpcrYQBPMjII4SoUgS8c1jncM4xmUwAphK4SNMUZx3WWIy1GGswxlCYorReFBhjsNZinSUdpgAXEjhL05TxZFzmNBZjSvgp8+xuDNnPjOFwCHD2VJL+y/n53rvtHnO1OYSURELO+hdCmfvx1yOD/oA8zwdJkmw/leQ4f3jIBv0BWZZhi8qyMRRFgSkKsiyj/7VPnucZcPzPbnc6HZaXl9Fac39/z+3tLaPR6O/d/t9f9RsoTTP4+32UigAAAABJRU5ErkJggg==";
+Exhibit.AnimationFacet.Inline.SHAFT_PNG="iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAAXNSR0IArs4c6QAAAAZiS0dEAIgAiACIdJABBgAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wIFAsiBOqpkCUAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAAbZJREFUKM+dk81uGjEUhT+PPd3WDT8TKBLQNG/ArpHYTJM8Eo/AQ7FDKqRpXqAhVdCgERqqUETSxQy2s5iBkDbNond1fe1zjn3uteCP6Pf7/Ct6vd6ztXgJ9PH4mKOjD1QqVX4uFtzc/OD6+vtfJGIfqLXm5NMJ9fd1lJQIzwPAGEMcxwyHQ5bL5Y7A27Jprfl8esph7RApJUr5+L6PrxRKKmq1Gudn52itdzeQW9Vut8vBuwOkL5FKoZTC998gBDjncNYhPIHWb5lMJoRhmCs3my1KpRIOwAHFYWM3WAvOWWy+S7lcod1uA6AAN53eMp3e8nq4fX9zcBAEhe8CnCtcFLmOcOAEooDmiWNbUK12C+GeuHcnd4htnlO6vS6ri/GFaDQadDodlFRIJZFS4nneDuScxVqLMYaN2XD59ZIoilAAs9mMZqtJpVzBOoe1NgdvX1vUjDEsFguiKMpbNRgMCMOQX3dLqkEVKSW2cNvaJ0VjDA+/H7j6dkWaps+HZH1/z3g0JkkSNmlGmqVkWUaapmRpSpIkjL6MWK/Xr892vV4nCAK01qxWK+bzOXEcvzzb//urHgE3adNcFxKl0AAAAABJRU5ErkJggg==";
+Exhibit.AnimationFacet.Inline.prototype.dispose=function(){this._dom=null;
+};
+Exhibit.AnimationFacet.Inline.prototype.setDuration=function(secs){this._duration=secs;
+};
+Exhibit.AnimationFacet.Inline.prototype.getDuration=function(){return
this._duration;
+};
+Exhibit.AnimationFacet.Inline.prototype.initUI=function(){var labels=new
Exhibit.AnimationFacet.Labels(this._facet,0);
+var settings=this._facet._settings;
+var showPlay=settings["inlineshowplay"];
+var html=null;
+if(!settings["inlinemodernstyle"]){var cssWidth=settings["width"]?"
width:"+settings["width"]+";":"width:100px;";
+var cssHeight=settings["height"]?" height:"+settings["height"]+";":"
height:10px;";
+var html="<span>"+((showPlay)?'<span
class="exhibit-facet-animation-button"></span>':"")+'<div
style="display:Inline-Block; margin-left:5px;
margin-right:5px;'+cssWidth+'"
class="exhibit-facet-animation-shaft-container"><div
class="exhibit-facet-animation-shaft" style="position:Relative;
width:100%;'+cssHeight+'"><div class="exhibit-facet-animation-shaft-thumb"
style="position:Absolute;'+cssHeight+'"></div></div></div></span>';
+}else{var cssWidth=settings["width"]?"
width:"+settings["width"]+";":"width:100px;";
+var _1="border:None; height:15px;
background-image:url(data:image/png;base64,"+Exhibit.AnimationFacet.Inline.SHAFT_PNG+");
background-repeat:Repeat-X;";
+var _2="border:None; width:15px; height:15px;
background-image:url(data:image/png;base64,"+Exhibit.AnimationFacet.Inline.THUMB_PNG+");
background-repeat:None;";
+var html="<span>"+((showPlay)?'<span
class="exhibit-facet-animation-button"></span>':"")+'<div
style="display:Inline-Block; border:None; margin-left:8px;
margin-right:8px;'+cssWidth+'"
class="exhibit-facet-animation-shaft-container"><div
class="exhibit-facet-animation-shaft" style="position:Relative;
width:100%; '+_1+'"><div class="exhibit-facet-animation-shaft-thumb"
style="position:Absolute; '+_2+'"></div></div></div></span>';
+}var el=$(html);
+this._dom={elmt:el.get()[0],shaft:$(".exhibit-facet-animation-shaft",el).get()[0],thumb:$(".exhibit-facet-animation-shaft-thumb",el).get()[0],button:$(".exhibit-facet-animation-button",el).get()[0]};
+var self=this;
+$(this._dom.shaft).mousedown(function(ev){if(ev.which==1){ev.preventDefault();
+self._dragging=true;
+}});
+$(document).mousemove(function(ev){if(self._dragging&&ev.which==1){ev.preventDefault();
+var x=ev.pageX-$(self._dom.shaft).offset().left;
+self._updateThumbUI(x,false);
+}}).mouseup(function(ev){if(self._dragging&&ev.which==1){ev.preventDefault();
+var x=ev.pageX-$(self._dom.shaft).offset().left;
+if(!self._updateThumbUI(x,true)){self._animationStartTime=(new
Date()).getTime();
+self._animationStartPosition=x;
+}self._dragging=false;
+}});
+this._showPlayButton(true);
+return this._dom.elmt;
+};
+Exhibit.AnimationFacet.Inline.prototype.postInitUI=function(){this._updateThumbUI(0,false);
+};
+Exhibit.AnimationFacet.Inline.prototype._showPlayButton=function(b){var
self=this;
+var
obj=(this._facet._settings["inlinemodernstyle"])?Exhibit.AnimationFacet.Inline:Exhibit.AnimationFacet;
+$(this._dom.button).html('<img
src="data:image/png;base64,'+obj[b?"PLAY_PNG":"PAUSE_PNG"]+'" />');
+$("img",this._dom.button).click(b?function(ev){self._animateStart();
+}:function(ev){self._animateStop();
+});
+};
+Exhibit.AnimationFacet.Inline.prototype._updateThumbUI=function(x,considerRestrict){var
w=$(this._dom.shaft).width();
+var ended=(x>w-1);
+x=(x<0)?0:x;
+x=(x>w-1)?w-1:x;
+var th=$(this._dom.thumb);
+th.css("left",(x-th.width()/2)+"px");
+var t=Math.floor(this._duration*(x/w*1));
+if(considerRestrict){this._facet.updateModeParams(t);
+}return ended;
+};
+Exhibit.AnimationFacet.Inline.prototype._animateStart=function(){this._animationPlaying=true;
+this._animationStartTime=(new Date()).getTime();
+this._animationStartPosition=($(this._dom.thumb).offset().left)-($(this._dom.shaft).offset().left)+($(this._dom.thumb).width()/2);
+this._showPlayButton(false);
+setTimeout("Exhibit.AnimationFacet.Inline."+this._animationGlueFunc+"()",this._animationFrameDelay);
+};
+Exhibit.AnimationFacet.Inline.prototype._animateStop=function(){this._animationPlaying=false;
+this._showPlayButton(true);
+};
+Exhibit.AnimationFacet.Inline.prototype._animate=function(){var
timeElapsed=(new Date()).getTime()-this._animationStartTime;
+var sh_w=$(this._dom.shaft).width();
+var pixelsPerMillisecond=sh_w/(this._duration*1000);
+var distanceTravelled=timeElapsed*pixelsPerMillisecond;
+var pos=this._animationStartPosition+distanceTravelled;
+var ended=false;
+if(!this._dragging){ended=this._updateThumbUI(pos,true);
+}if(this._animationPlaying){if(!ended){setTimeout("Exhibit.AnimationFacet.Inline."+this._animationGlueFunc+"()",this._animationFrameDelay);
+}else{this._animateStop();
+this._updateThumbUI(0,false);
+this._facet.clearAllRestrictions();
+}}};
+
+
+/* animation-slideshare.js */
+Exhibit.AnimationFacet._settingSpecs["sswidth"]={type:"int",defaultValue:598};
+Exhibit.AnimationFacet._settingSpecs["ssheight"]={type:"int",defaultValue:480};
+Exhibit.AnimationFacet._settingSpecs["ssslides"]={type:"text",defaultValue:"simile-exhibit-vgsom-12312308"};
+Exhibit.AnimationFacet._settingSpecs["sslabelfromone"]={type:"boolean",defaultValue:false};
+Exhibit.AnimationFacet._settingSpecs["ssshowtrack"]={type:"boolean",defaultValue:true};
+Exhibit.AnimationFacet.SlideShare=function(facet){this._duration=-1;
+this._facet=facet;
+this._playerId="ExhibitAnimationFacetSlideShare__slideshare__"+Exhibit.AnimationFacet._getNextAnimationUnique();
+this._playerObj=null;
+this._lastSlide=-1;
+this._$tickbox=null;
+this._hideTickbox=false;
+this._animationFrameDelay=100;
+this._animationPlaying=false;
+var
fn="__animation_glue__"+Exhibit.AnimationFacet._getNextAnimationUnique();
+this._animationGlueFunc="Exhibit.AnimationFacet.SlideShare."+fn+"()";
+var self=this;
+Exhibit.AnimationFacet.SlideShare[fn]=function(){self._animate();
+};
+};
+Exhibit.AnimationFacet.SlideShare._mapVideoObjectToPlayerId={};
+Exhibit.AnimationFacet.SlideShare.prototype.dispose=function(){this._facet=null;
+this._playerObj=null;
+this._playerId=null;
+};
+Exhibit.AnimationFacet.SlideShare.prototype.setDuration=function(secs){};
+Exhibit.AnimationFacet.SlideShare.prototype.getDuration=function(){if(this._duration<0){var
c=this._playerObj.getCurrentSlide();
+this._playerObj.last();
+this._duration=this._playerObj.getCurrentSlide();
+this._playerObj.jumpTo(c);
+}return this._duration;
+};
+Exhibit.AnimationFacet.SlideShare.prototype.initUI=function(){var
settings=this._facet._settings;
+this._hideTickbox=!settings["showLabel"];
+var html='<span style="display:Inline-Block; position:Relative;"><input
type="checkbox" class="exhibit-facet-animation-tickbox"
style="display:Block; position:Absolute; right:0px; top:0px;" /><div
class="exhibit-facet-header">'+((settings["showLabel"])?'<span
class="exhibit-facet-header-title">'+settings["facetLabel"]+"</span>":"")+'</div><div
style="width:'+settings["sswidth"]+"px;
height:"+settings["ssheight"]+'px;"><div
id="'+this._playerId+'"></div></div>'+(settings["ssshowtrack"]?'<div
style="width:'+settings["sswidth"]+'px;"><div
class="exhibit-facet-animation-bar-container"><div
class="exhibit-facet-animation-bar" style="position:Relative;
width:0px;"></div></div><div class="exhibit-facet-animation-labels"
style="position:Relative; height:1em;"><div style="position:Absolute;
left:0px;">—</div><div style="position:Absolute;
right:0px;">—</div><div class="exhibit-facet-animation-labels-time"
style="text-align:Center"></div></div></div>':"")+"</span>";
+$el=$(html);
+var self=this;
+this._$tickbox=$($("input.exhibit-facet-animation-tickbox",$el).get()[0]);
+if(!settings["showLabel"]){this._$tickbox.css("right","5px").css("top","5px").css("margin","0px");
+}this._$tickbox.click(function(ev){var $this=$(this);
+if($this.attr("checked")){self._facet.updateModeParams(self._playerObj.getCurrentSlide()-1);
+}else{self._facet.clearAllRestrictions();
+}});
+return $el;
+};
+Exhibit.AnimationFacet.SlideShare.prototype.postInitUI=function(){var
settings=this._facet._settings;
+var self=this;
+var ssURL="
http://static.slidesharecdn.com/swf/ssplayer2.swf";
+var flashVars={doc:settings["ssslides"],startSlide:1,rel:0};
+swfobject.embedSWF(ssURL,this._playerId,settings["sswidth"],settings["ssheight"],"8",null,flashVars,{allowScriptAccess:"always",wmode:"transparent",allowfullscreen:"true"},{id:this._playerId},function(ev){if(ev.success){self._playerObj=$("#"+self._playerId).get()[0];
+setTimeout(self._animationGlueFunc,self._animationFrameDelay);
+}else{}});
+Exhibit.AnimationFacet.SlideShare._mapVideoObjectToPlayerId[this._playerId]=this;
+};
+Exhibit.AnimationFacet.SlideShare.prototype._animate=function(){if(this._playerObj.getCurrentSlide){var
slide=this._playerObj.getCurrentSlide()-1;
+if(slide!=this._lastSlide){this._lastSlide=slide;
+this._updateLabels(slide);
+this._facet.updateModeParams(slide);
+this._$tickbox.attr("checked",this._facet.hasRestrictions()?"checked":"");
+}}else{}setTimeout(this._animationGlueFunc,this._animationFrameDelay);
+};
+Exhibit.AnimationFacet.SlideShare.prototype._updateLabels=function(secs){if(!this._facet._settings["ssshowtrack"]){return ;
+}var dur=this.getDuration();
+if(dur==0){return ;
+}var
config={base:this._facet._settings["sslabelfromone"],showAsSeconds:true,inclusiveBounds:true};
+var labels=new
Exhibit.AnimationFacet.Labels(this._facet,Math.floor(secs),config);
+var labs=$(".exhibit-facet-animation-labels
div",this._facet._div).each(function(idx){switch(idx){case
0:$(this).html(labels.lowerLabel);
+break;
+case 1:$(this).html(labels.upperLabel);
+break;
+case 2:$(this).html(labels.timeLabel);
+break;
+}});
+var barCon=$(".exhibit-facet-animation-bar-container",this._facet._div);
+var bar=$(".exhibit-facet-animation-bar",barCon);
+var w=barCon.width();
+var r=(1*w/dur);
+bar.css("width",Math.floor(secs*r)+"px");
+};
+
+
+/* animation-youtube.js */
+Exhibit.AnimationFacet._settingSpecs["ytwidth"]={type:"int",defaultValue:280};
+Exhibit.AnimationFacet._settingSpecs["ytheight"]={type:"int",defaultValue:170};
+Exhibit.AnimationFacet._settingSpecs["ytvideo"]={type:"text",defaultValue:"ILGK83V6h9s"};
+Exhibit.AnimationFacet._settingSpecs["ytshowtrack"]={type:"boolean",defaultValue:true};
+
Exhibit.AnimationFacet.YouTube=function(facet){this._duration=0;
+this._facet=facet;
+this._playerId="__youtube__"+Exhibit.AnimationFacet._getNextAnimationUnique();
+this._divId="ExhibitAnimationFacetYouTube"+this._playerId;
+this._playerObj=null;
+this._$tickbox=null;
+this._hideTickbox=false;
+this._animationFrameDelay=100;
+this._animationPlaying=false;
+var
fn="__animation_glue__"+Exhibit.AnimationFacet._getNextAnimationUnique();
+this._animationGlueFunc="
Exhibit.AnimationFacet.YouTube."+fn+"()";
+var self=this;
+
Exhibit.AnimationFacet.YouTube[fn]=function(){self._animate();
+};
+};
+Exhibit.AnimationFacet.YouTube.YT_UNSTARTED=-1;
+Exhibit.AnimationFacet.YouTube.YT_ENDED=0;
+Exhibit.AnimationFacet.YouTube.YT_PLAYING=1;
+Exhibit.AnimationFacet.YouTube.YT_PAUSED=2;
+Exhibit.AnimationFacet.YouTube.YT_BUFFERING=3;
+Exhibit.AnimationFacet.YouTube.YT_CUED=5;
+Exhibit.AnimationFacet.YouTube._mapVideoObjectToPlayerId={};
+Exhibit.AnimationFacet.YouTube.prototype.dispose=function(){this._facet=null;
+this._playerObj=null;
+this._divId=null;
+this._playerId=null;
+};
+Exhibit.AnimationFacet.YouTube.prototype.setDuration=function(secs){};
+Exhibit.AnimationFacet.YouTube.prototype.getDuration=function(){return
this._playerObj.getDuration();
+};
+Exhibit.AnimationFacet.YouTube.prototype.initUI=function(){var
settings=this._facet._settings;
+this._hideTickbox=!settings["showLabel"];
+var html='<span style="display:Inline-Block; position:Relative;"><input
type="checkbox" class="exhibit-facet-animation-tickbox"
style="display:Block; position:Absolute; right:0px; top:0px;" /><div
class="exhibit-facet-header">'+((settings["showLabel"])?'<span
class="exhibit-facet-header-title">'+settings["facetLabel"]+"</span>":"")+'</div><div
style="width:'+settings["ytwidth"]+"px;
height:"+settings["ytheight"]+'px;"><div
id="'+this._divId+'"></div></div>'+(settings["ytshowtrack"]?'<div
style="width:'+settings["ytwidth"]+'px;"><div
class="exhibit-facet-animation-bar-container"><div
class="exhibit-facet-animation-bar" style="position:Relative;
width:0px;"></div></div><div class="exhibit-facet-animation-labels"
style="position:Relative; height:1em;"><div style="position:Absolute;
left:0px;">—</div><div style="position:Absolute;
right:0px;">—</div><div class="exhibit-facet-animation-labels-time"
style="text-align:Center"></div></div></div>':"")+"</span>";
+$el=$(html);
+var self=this;
+this._$tickbox=$($("input.exhibit-facet-animation-tickbox",$el).get()[0]);
+if(!settings["showLabel"]){this._$tickbox.css("right","5px").css("top","5px").css("margin","0px");
+}this._$tickbox.click(function(ev){var $this=$(this);
+if($this.attr("checked")){self._facet.updateModeParams(self._playerObj.getCurrentTime());
+}else{self._facet.clearAllRestrictions();
+}});
+return $el;
+};
+Exhibit.AnimationFacet.YouTube.prototype.postInitUI=function(){var
settings=this._facet._settings;
+var ytURL="
http://www.youtube.com/v/";
+swfobject.embedSWF(ytURL+settings["ytvideo"]+"?version=3&enablejsapi=1&title=Video+facet&autohide=2&color=white&egm=0&border=0&iv_load_policy=3&modestbranding=1&rel=0&showinfo=0&fs=0&playerapiid="+this._playerId,this._divId,settings["ytwidth"],settings["ytheight"],"8",null,null,{allowScriptAccess:"always",wmode:"transparent",allowfullscreen:"true"},{id:this._playerId});
+Exhibit.AnimationFacet.YouTube._mapVideoObjectToPlayerId[this._playerId]=this;
+};
+Exhibit.AnimationFacet.YouTube.prototype._animate=function(){if(this._animationPlaying){this._update();
+setTimeout(this._animationGlueFunc,this._animationFrameDelay);
+}};
+Exhibit.AnimationFacet.YouTube.prototype._onStateChange=function(state){switch(state){case
Exhibit.AnimationFacet.YouTube.YT_PLAYING:this._animationPlaying=true;
+this._disableTickbox(true);
+this._update();
+setTimeout(this._animationGlueFunc,this._animationFrameDelay);
+break;
+case Exhibit.AnimationFacet.YouTube.YT_PAUSED:this._animationPlaying=false;
+this._disableTickbox(false);
+this._update();
+break;
+case Exhibit.AnimationFacet.YouTube.YT_ENDED:this._animationPlaying=false;
+this._disableTickbox(false);
+this._updateLabels(0);
+this._facet.clearAllRestrictions();
+break;
+}};
+Exhibit.AnimationFacet.YouTube.prototype._disableTickbox=function(b){this._$tickbox.attr("disabled",b);
+if(this._hideTickbox){this._$tickbox.css("display",(b?"None":"Inline"));
+}};
+Exhibit.AnimationFacet.YouTube.prototype._update=function(secs){var
secs=(secs==undefined)?this._playerObj.getCurrentTime():secs;
+this._updateLabels(secs);
+this._facet.updateModeParams(secs);
+this._$tickbox.attr("checked",this._facet.hasRestrictions()?"checked":"");
+};
+Exhibit.AnimationFacet.YouTube.prototype._updateLabels=function(secs){if(!this._facet._settings["ytshowtrack"]){return ;
+}var dur=this.getDuration();
+if(dur==0){return ;
+}var labels=new
Exhibit.AnimationFacet.Labels(this._facet,Math.floor(secs));
+var labs=$(".exhibit-facet-animation-labels
div",this._facet._div).each(function(idx){switch(idx){case
0:$(this).html(labels.lowerLabel);
+break;
+case 1:$(this).html(labels.upperLabel);
+break;
+case 2:$(this).html(labels.timeLabel);
+break;
+}});
+var barCon=$(".exhibit-facet-animation-bar-container",this._facet._div);
+var bar=$(".exhibit-facet-animation-bar",barCon);
+var w=barCon.width();
+var r=(1*w/dur);
+bar.css("width",Math.floor(secs*r)+"px");
+};
+function onYouTubePlayerReady(pid){var
self=Exhibit.AnimationFacet.YouTube._mapVideoObjectToPlayerId[pid];
+var n="__EVENT_HANDLER__"+pid;
+
Exhibit.AnimationFacet.YouTube[n]=function(state){self._onStateChange(state);
+};
+self._playerObj=document.getElementById(pid);
+self._playerObj.addEventListener("onStateChange","
Exhibit.AnimationFacet.YouTube."+n);
+}
+
+/* swfobject.js */
+var swfobject=function(){var D="undefined",r="object",S="Shockwave
Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var
aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof
j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;
+if(typeof t.plugins!=D&&typeof
t.plugins[S]==r){ab=t.plugins[S].description;
+if(ab&&!(typeof
t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;
+X=false;
+ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");
+ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);
+ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);
+ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0;
+}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);
+if(ad){ab=ad.GetVariable("$version");
+if(ab){X=true;
+ab=ab.split(" ")[1].split(",");
+ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)];
+}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac};
+}(),k=function(){if(!M.w3){return ;
+}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof
j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f();
+}if(!J){if(typeof
j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false);
+}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);
+f();
+}});
+if(O==top){(function(){if(J){return ;
+}try{j.documentElement.doScroll("left");
+}catch(X){setTimeout(arguments.callee,0);
+return ;
+}f();
+})();
+}}if(M.wk){(function(){if(J){return ;
+}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);
+return ;
+}f();
+})();
+}s(f);
+}}();
+function f(){if(J){return ;
+}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));
+Z.parentNode.removeChild(Z);
+}catch(aa){return ;
+}J=true;
+var X=U.length;
+for(var Y=0;
+Y<X;
+Y++){U[Y]();
+}}function K(X){if(J){X();
+}else{U[U.length]=X;
+}}function s(Y){if(typeof
O.addEventListener!=D){O.addEventListener("load",Y,false);
+}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false);
+}else{if(typeof O.attachEvent!=D){i(O,"onload",Y);
+}else{if(typeof O.onload=="function"){var X=O.onload;
+O.onload=function(){X();
+Y();
+};
+}else{O.onload=Y;
+}}}}}function h(){if(T){V();
+}else{H();
+}}function V(){var X=j.getElementsByTagName("body")[0];
+var aa=C(r);
+aa.setAttribute("type",q);
+var Z=X.appendChild(aa);
+if(Z){var Y=0;
+(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");
+if(ab){ab=ab.split(" ")[1].split(",");
+M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)];
+}}else{if(Y<10){Y++;
+setTimeout(arguments.callee,10);
+return ;
+}}X.removeChild(aa);
+Z=null;
+H();
+})();
+}else{H();
+}}function H(){var ag=o.length;
+if(ag>0){for(var af=0;
+af<ag;
+af++){var Y=o[af].id;
+var ab=o[af].callbackFn;
+var aa={success:false,id:Y};
+if(M.pv[0]>0){var ae=c(Y);
+if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);
+if(ab){aa.success=true;
+aa.ref=z(Y);
+ab(aa);
+}}else{if(o[af].expressInstall&&A()){var ai={};
+ai.data=o[af].expressInstall;
+ai.width=ae.getAttribute("width")||"0";
+ai.height=ae.getAttribute("height")||"0";
+if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class");
+}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align");
+}var ah={};
+var X=ae.getElementsByTagName("param");
+var ac=X.length;
+for(var ad=0;
+ad<ac;
+ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value");
+}}P(ai,ah,Y,ab);
+}else{p(ae);
+if(ab){ab(aa);
+}}}}}else{w(Y,true);
+if(ab){var Z=z(Y);
+if(Z&&typeof Z.SetVariable!=D){aa.success=true;
+aa.ref=Z;
+}ab(aa);
+}}}}}function z(aa){var X=null;
+var Y=c(aa);
+if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y;
+}else{var Z=Y.getElementsByTagName(r)[0];
+if(Z){X=Z;
+}}}return X;
+}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312);
+}function P(aa,ab,X,Z){a=true;
+E=Z||null;
+B={success:false,id:X};
+var ae=c(X);
+if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);
+Q=null;
+}else{l=ae;
+Q=X;
+}
aa.id=R;
+if(typeof aa.width==D||
(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310";
+}if(typeof aa.height==D||
(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137";
+}j.title=j.title.slice(0,47)+" - Flash Player Installation";
+var
ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;
+if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac;
+}else{ab.flashvars=ac;
+}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");
+X+="SWFObjectNew";
+Y.setAttribute("id",X);
+ae.parentNode.insertBefore(Y,ae);
+ae.style.display="none";
+(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae);
+}else{setTimeout(arguments.callee,10);
+}})();
+}u(aa,ab,X);
+}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");
+Y.parentNode.insertBefore(X,Y);
+X.parentNode.replaceChild(g(Y),X);
+Y.style.display="none";
+(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y);
+}else{setTimeout(arguments.callee,10);
+}})();
+}else{Y.parentNode.replaceChild(g(Y),Y);
+}}function g(ab){var aa=C("div");
+if(M.win&&M.ie){aa.innerHTML=ab.innerHTML;
+}else{var Y=ab.getElementsByTagName(r)[0];
+if(Y){var ad=Y.childNodes;
+if(ad){var X=ad.length;
+for(var Z=0;
+Z<X;
+Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true));
+}}}}}return aa;
+}function u(ai,ag,Y){var X,aa=c(Y);
+if(M.wk&&M.wk<312){return X;
+}if(aa){if(typeof
ai.id==D){
ai.id=Y;
+}if(M.ie&&M.win){var ah="";
+for(var ae in
ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae];
+}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"';
+}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"';
+}}}}}var af="";
+for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param
name="'+ad+'" value="'+ag[ad]+'" />';
+}}aa.outerHTML='<object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";
+N[N.length]=
ai.id;
+X=c(
ai.id);
+}else{var Z=C(r);
+Z.setAttribute("type",q);
+for(var ac in
ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac]);
+}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac]);
+}}}}for(var ab in
ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab]);
+}}aa.parentNode.replaceChild(Z,aa);
+X=Z;
+}}return X;
+}function e(Z,X,Y){var aa=C("param");
+aa.setAttribute("name",X);
+aa.setAttribute("value",Y);
+Z.appendChild(aa);
+}function y(Y){var X=c(Y);
+if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";
+(function(){if(X.readyState==4){b(Y);
+}else{setTimeout(arguments.callee,10);
+}})();
+}else{X.parentNode.removeChild(X);
+}}}function b(Z){var Y=c(Z);
+if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null;
+}}Y.parentNode.removeChild(Y);
+}}function c(Z){var X=null;
+try{X=j.getElementById(Z);
+}catch(Y){}return X;
+}function C(X){return j.createElement(X);
+}function i(Z,X,Y){Z.attachEvent(X,Y);
+I[I.length]=[Z,X,Y];
+}function F(Z){var Y=M.pv,X=Z.split(".");
+X[0]=parseInt(X[0],10);
+X[1]=parseInt(X[1],10)||0;
+X[2]=parseInt(X[2],10)||0;
+return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||
(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false;
+}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return ;
+}var aa=j.getElementsByTagName("head")[0];
+if(!aa){return ;
+}var X=(ad&&typeof ad=="string")?ad:"screen";
+if(ab){n=null;
+G=null;
+}if(!n||G!=X){var Z=C("style");
+Z.setAttribute("type","text/css");
+Z.setAttribute("media",X);
+n=aa.appendChild(Z);
+if(M.ie&&M.win&&typeof
j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1];
+}G=X;
+}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y);
+}}else{if(n&&typeof
j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"));
+}}}function w(Z,X){if(!m){return ;
+}var Y=X?"visible":"hidden";
+if(J&&c(Z)){c(Z).style.visibility=Y;
+}else{v("#"+Z,"visibility:"+Y);
+}}function L(Y){var Z=/[\\\"<>\.;]/;
+var X=Z.exec(Y)!=null;
+return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y;
+}var
d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var
ac=I.length;
+for(var ab=0;
+ab<ac;
+ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2]);
+}var Z=N.length;
+for(var aa=0;
+aa<Z;
+aa++){y(N[aa]);
+}for(var Y in M){M[Y]=null;
+}M=null;
+for(var X in swfobject){swfobject[X]=null;
+}swfobject=null;
+});
+}}();
+return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};
+Y.id=ab;
+Y.swfVersion=X;
+Y.expressInstall=aa;
+Y.callbackFn=Z;
+o[o.length]=Y;
+w(ab,false);
+}else{if(Z){Z({success:false,id:ab});
+}}},getObjectById:function(X){if(M.w3){return z(X);
+}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var
X={success:false,id:ah};
+if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);
+K(function(){ae+="";
+ag+="";
+var aj={};
+if(af&&typeof af===r){for(var al in af){aj[al]=af[al];
+}}aj.data=ab;
+aj.width=ae;
+aj.height=ag;
+var am={};
+if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak];
+}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof
am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai];
+}else{am.flashvars=ai+"="+Z[ai];
+}}}if(F(Y)){var an=u(aj,am,ah);
+if(
aj.id==ah){w(ah,true);
+}X.success=true;
+X.ref=an;
+}else{if(aa&&A()){aj.data=aa;
+P(aj,am,ah,ac);
+return ;
+}else{w(ah,true);
+}}if(ac){ac(X);
+}});
+}else{if(ac){ac(X);
+}}},switchOffAutoHideShow:function(){m=false;
+},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]};
+},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return
u(Z,Y,X);
+}else{return undefined;
+}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y);
+}},removeSWF:function(X){if(M.w3){y(X);
+}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X);
+}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var
Z=j.location.search||j.location.hash;
+if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1];
+}if(aa==null){return L(Z);
+}var Y=Z.split("&");
+for(var X=0;
+X<Y.length;
+X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return
L(Y[X].substring((Y[X].indexOf("=")+1)));
+}}}return"";
+},expressInstallCallback:function(){if(a){var X=c(R);
+if(X&&l){X.parentNode.replaceChild(l,X);
+if(Q){w(Q,true);
+if(M.ie&&M.win){l.style.display="block";
+}}if(E){E(B);
+}}a=false;
+}}};
+}();
=======================================
--- /dev/null
+++
/exhibit/trunk/src/webapp/api/extensions/animation/animation-extension-bundle.css
Mon Nov 26 04:25:26 2012
@@ -0,0 +1,40 @@
+.exhibit-facet-animation-shaft-container {
+ border: 1px Solid #DDDDDD;
+ padding: 1px;
+}
+
+.exhibit-facet-animation-shaft-container .exhibit-facet-animation-shaft {
+ height: 15px;
+}
+
+.exhibit-facet-animation-shaft-container .exhibit-facet-animation-shaft-markers
div
{
+ background-color: #DDDDDD;
+ top: 2px;
+ height: 11px;
+}
+
+.exhibit-facet-animation-shaft-container .exhibit-facet-animation-shaft-thumb
{
+ width: 10px; height: 13px;
+ background-color: White;
+ border: 1px Solid Black;
+}
+
+.exhibit-facet-animation-labels {
+ /*font-size: 75%;*/
+ color: #AAAAAA;
+}
+
+.exhibit-facet-animation-bar-container {
+ width: 100%;
+ background-color: #DDDDDD;
+ margin-top: 0.25em;
+}
+
+.exhibit-facet-animation-bar-container .exhibit-facet-animation-bar {
+ height: 5px;
+ background-color: Black;
+}
+
+.exhibit-facet-animation-labels .exhibit-facet-animation-labels-time {
+ color: Black;
+}
=======================================
--- /dev/null
+++
/exhibit/trunk/src/webapp/api/extensions/animation/animation-extension-bundle.js
Mon Nov 26 04:25:26 2012
@@ -0,0 +1,907 @@
+
+
+/* animation-facet.js */
+Exhibit.AnimationFacet=function(B,A){this._div=B;
+this._uiContext=A;
+this._expression=null;
+this._mode=Exhibit.AnimationFacet.MODE_NONE;
+this._listModePeriods=null;
+this._listModeCurrentPeriods=[];
+this._rangeModePrecision=null;
+this._rangeModeMaxRange={min:null,max:null};
+this._rangeModeCurrentRange={min:null,max:null};
+this._dateModeInterval=null;
+this._settings={};
+this._ui=null;
+};
+Exhibit.AnimationFacet.DAY="day";
+Exhibit.AnimationFacet.MONTH="month";
+Exhibit.AnimationFacet.YEAR="year";
+Exhibit.AnimationFacet.MODE_NONE=0;
+Exhibit.AnimationFacet.MODE_LIST=1;
+Exhibit.AnimationFacet.MODE_RANGE=2;
+Exhibit.AnimationFacet.MODE_DATE=3;
+Exhibit.AnimationFacet.DEBUG1=false;
+Exhibit.AnimationFacet.PLAY_PNG="iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wDGw42NiWo9VwAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAADtJREFUKM+VjzEKACAAAu+i/3+5lpYgQgU3DxVgHUfyEbYFvqDBHFvgAhsAgEGpWWRNAdMG00mmH0yObCp4Bx5kUSOtAAAAAElFTkSuQmCC";
+Exhibit.AnimationFacet.PAUSE_PNG="iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wDGw43G3lsmGgAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAAB1JREFUKM9jZGBg+M+ACRihNIYcEwOJYFTDSNEAAI/YAhcjCBZEAAAAAElFTkSuQmCC";
+Exhibit.AnimationFacet._getNextAnimationUnique=function(){if(!Exhibit.AnimationFacet._animationCounter){Exhibit.AnimationFacet._animationCounter=0;
+}var A=Exhibit.AnimationFacet._animationCounter;
+Exhibit.AnimationFacet._animationCounter++;
+return A;
+};
+Exhibit.AnimationFacet._settingSpecs={"facetLabel":{type:"text"},"showLabel":{type:"boolean",defaultValue:true},"type":{type:"text",defaultValue:"default"},"width":{type:"text"},"height":{type:"text"},"formatter":{type:"text",defaultValue:null},"startTime":{type:"int",defaultValue:0},"duration":{type:"int",defaultValue:60}};
+Exhibit.AnimationFacet.create=function(D,B,A){if(Exhibit.AnimationFacet.DEBUG1){console.log("create",D,B,A);
+}var A=Exhibit.UIContext.create(D,A);
+var C=new Exhibit.AnimationFacet(B,A);
+Exhibit.AnimationFacet._configure(C,D);
+C._initializeUI();
+A.getCollection().addFacet(C);
+return C;
+};
+Exhibit.AnimationFacet.createFromDOM=function(configElmt,containerElmt,uiContext){if(Exhibit.AnimationFacet.DEBUG1){console.log("createFromDOM",configElmt,containerElmt,uiContext);
+}var uiContext=Exhibit.UIContext.createFromDOM(configElmt,uiContext);
+var facet=new
Exhibit.AnimationFacet(containerElmt!=null?containerElmt:configElmt,uiContext);
+Exhibit.SettingsUtilities.collectSettingsFromDOM(configElmt,Exhibit.AnimationFacet._settingSpecs,facet._settings);
+try{var expressionString=Exhibit.getAttribute(configElmt,"expression");
+if(expressionString!=null&&expressionString.length>0){facet._expression=Exhibit.ExpressionParser.parse(expressionString);
+}if(facet._expression==null){SimileAjax.Debug.exception(e2,"AnimationFacet:
no
expression specified; using .label");
+facet._expression=".label";
+}var selections=Exhibit.getAttribute(configElmt,"selections");
+if(selections!=null&&selections.length>0){try{facet._listModePeriods=eval(selections);
+facet._mode=Exhibit.AnimationFacet.MODE_LIST;
+}catch(e2){SimileAjax.Debug.exception(e2,"AnimationFacet: Selections needs
to be valid JSON structure");
+}}else{try{var
sequence=Exhibit.getAttribute(configElmt,"selectionSequence");
+var dur=facet._settings.duration;
+if(!dur){dur=60;
+}if(sequence!=null&&sequence.length>0){var a=sequence.split(",");
+var b=[];
+var d=Math.floor(dur/a.length);
+for(var i=0;
+i<a.length;
+i++){b.push({from:i*d,to:i*d+d,select:[$.trim(a[i])]});
+}}facet._listModePeriods=b;
+facet._mode=Exhibit.AnimationFacet.MODE_LIST;
+}catch(e2){SimileAjax.Debug.exception(e2,"AnimationFacet: Selection
sequence or duration is invalid");
+}}var precision=Exhibit.getAttribute(configElmt,"precision");
+if(precision!=null&&precision.length>0){try{facet._rangeModePrecision=parseInt(precision);
+facet._mode=Exhibit.AnimationFacet.MODE_RANGE;
+}catch(e2){SimileAjax.Debug.exception(e2,"AnimationFacet: Precision needs
to be integer");
+}}var datePrecision=Exhibit.getAttribute(configElmt,"datePrecision");
+if(datePrecision!=null&&datePrecision.length>0){try{var
arr=[Exhibit.AnimationFacet.DAY,Exhibit.AnimationFacet.MONTH,Exhibit.AnimationFacet.YEAR];
+for(var i=0;
+i<arr.length;
+i++){if(datePrecision.toLowerCase()==arr[i]){facet._dateModeInterval=arr[i];
+facet._mode=Exhibit.AnimationFacet.MODE_DATE;
+}}}catch(e2){SimileAjax.Debug.exception(e2,"AnimationFacet: Date precision
needs to be year, month or day");
+}}if(facet._mode==Exhibit.AnimationFacet.MODE_NONE){SimileAjax.Debug.exception(e2,"AnimationFacet:
need
to define either ex:selections, ex:precision or ex:datePrecision");
+}}catch(e){SimileAjax.Debug.exception(e,"AnimationFacet: Error processing
configuration of animation facet");
+}Exhibit.AnimationFacet._configure(facet);
+facet._initializeUI();
+uiContext.getCollection().addFacet(facet);
+return facet;
+};
+Exhibit.AnimationFacet._configure=function(facet,configuration){if(Exhibit.AnimationFacet.DEBUG1){console.log("_configure",facet,configuration);
+}if(!("facetLabel" in
facet._settings)){facet._settings.facetLabel="Animation facet";
+if(facet._expression!=null&&facet._expression.isPath()){var
segment=facet._expression.getPath().getLastSegment();
+var property=facet._uiContext.getDatabase().getProperty(segment.property);
+if(property!=null){facet._settings.facetLabel=segment.forward?property.getLabel():property.getReverseLabel();
+}}}if("formatter" in facet._settings){var
formatter=facet._settings.formatter;
+if(formatter!=null&&formatter.length>0){try{facet._formatter=eval(formatter);
+}catch(e){SimileAjax.Debug.log(e);
+}}}if(facet._mode==Exhibit.AnimationFacet.MODE_LIST){facet._cache=new
Exhibit.FacetUtilities.Cache(facet._uiContext.getDatabase(),facet._uiContext.getCollection(),facet._expression);
+}else{if(facet._mode==Exhibit.AnimationFacet.MODE_RANGE){var r;
+var database=facet._uiContext.getDatabase();
+if(facet._expression.getPath()){var path=facet._expression.getPath();
+var propertyID=path.getLastSegment().property;
+var property=database.getProperty(propertyID);
+r=property.getRangeIndex();
+}else{var expression=facet._expression;
+r=new
Exhibit.Database._RangeIndex(facet._uiContext.getCollection().getAllItems(),function(item,f){expression.evaluateOnItem(item,database).values.visit(function(value){if(typeof
value!="number"){value=parseFloat(value);
+}if(!isNaN(value)){f(value);
+}});
+});
+}facet._rangeModeMaxRange={min:facet._minRangePrecision(r.getMin()),max:facet._maxRangePrecision(r.getMax())};
+var database=facet._uiContext.getDatabase();
+var
getter=function(item,f){facet._expression.evaluateOnItem(item,database).values.visit(function(value){if(typeof
value!="number"){value=parseFloat(value);
+}if(!isNaN(value)){f(value);
+}});
+};
+facet._rangeIndex=new
Exhibit.Database._RangeIndex(facet._uiContext.getCollection().getAllItems(),getter);
+}else{if(facet._mode==Exhibit.AnimationFacet.MODE_DATE){}}}};
+Exhibit.AnimationFacet.prototype.dispose=function(){if(Exhibit.AnimationFacet.DEBUG1){console.log("dispose");
+}this._ui.dispose();
+if(this._cache){this._cache.dispose();
+this._cache=null;
+}if(this._rangeIndex){this._rangeIndex=null;
+}this._uiContext.getCollection().removeFacet(this);
+this._uiContext=null;
+this._div.innerHTML="";
+this._div=null;
+this._expression=null;
+this._settings=null;
+this._listModePeriods=null;
+this._listModeCurrentPeriods=null;
+this._listModeValueSet=null;
+this._rangeModeMaxRange=null;
+this._rangeModeCurrentRange=null;
+};
+Exhibit.AnimationFacet.prototype.hasRestrictions=function(){if(Exhibit.AnimationFacet.DEBUG1){console.log("hasRestrictions");
+}if(this._mode==Exhibit.AnimationFacet.MODE_LIST){return
this._listModeCurrentPeriods.length>0;
+}else{if(this._mode==Exhibit.AnimationFacet.MODE_RANGE){var
B=(this._rangeModeCurrentRange.min!=null&&this._rangeModeCurrentRange.min!=this._rangeModeMaxRange.min);
+var
A=(this._rangeModeCurrentRange.max!=null&&this._rangeModeCurrentRange.max!=this._rangeModeMaxRange.max);
+return(B||A);
+}else{if(this._mode==Exhibit.AnimationFacet.MODE_DATE){return false;
+}else{return false;
+}}}};
+Exhibit.AnimationFacet.prototype.restrict=function(E){if(Exhibit.AnimationFacet.DEBUG1){console.log("restrict",E);
+}if(this._mode==Exhibit.AnimationFacet.MODE_LIST){if(this._listModeCurrentPeriods.length==0){return
E;
+}else{var H=new Exhibit.Set();
+for(var D=0;
+D<this._listModeCurrentPeriods.length;
+D++){var A=this._listModeCurrentPeriods[D];
+for(var C=0;
+C<A.select.length;
+C++){H.add(A.select[C]);
+}}return this._cache.getItemsFromValues(H,E);
+}}else{if(this._mode==Exhibit.AnimationFacet.MODE_RANGE){var
B=this._rangeModeCurrentRange.min;
+var F=this._rangeModeCurrentRange.max;
+if(this._expression.isPath()){var I=this._expression.getPath();
+var G=this._uiContext.getDatabase();
+return I.rangeBackward(B,F,false,E,G).values;
+}else{return this._rangeIndex.getSubjectsInRange(B,F,false,null,E);
+}}else{if(this._mode==Exhibit.AnimationFacet.MODE_DATE){}}}};
+Exhibit.AnimationFacet.prototype.clearAllRestrictions=function(){if(Exhibit.AnimationFacet.DEBUG1){console.log("clearAllRestrictions");
+}Exhibit.AnimationFacet.testRemoteLog();
+if(this.hasRestrictions()){if(this._mode==Exhibit.AnimationFacet.MODE_LIST){this._listModeCurrentPeriods=[];
+}else{if(this._mode==Exhibit.AnimationFacet.MODE_RANGE){this._rangeModeCurrentRange.min=this._rangeModeMaxRange.min;
+this._rangeModeCurrentRange.max=this._rangeModeMaxRange.max;
+}}var
C=SimileAjax.RemoteLog.logActive?this._uiContext.getCollection().countRestrictedItems():0;
+this._notifyCollection();
+var
A=SimileAjax.RemoteLog.logActive?this._uiContext.getCollection().countRestrictedItems():0;
+var
B=SimileAjax.RemoteLog.logActive?this._uiContext.getCollection().countAllItems():0;
+SimileAjax.RemoteLog.possiblyLog({facetType:"AnimationFacet",facetLabel:this._settings.facetLabel,operation:"clearAllRestrictions",exhibitSize:B,preUpdateSize:C,postUpdateSize:A});
+}};
+Exhibit.AnimationFacet.prototype.applyRestrictions=function(A){};
+Exhibit.AnimationFacet.prototype.setSelection=function(B,A){};
+Exhibit.AnimationFacet.prototype.update=function(A){if(Exhibit.AnimationFacet.DEBUG1){console.log("update",A);
+}};
+Exhibit.AnimationFacet.prototype._notifyCollection=function(){if(Exhibit.AnimationFacet.DEBUG1){console.log("_notifyCollection");
+}this._uiContext.getCollection().onFacetUpdated(this);
+};
+Exhibit.AnimationFacet.prototype._initializeUI=function(){if(Exhibit.AnimationFacet.DEBUG1){console.log("_initializeUI");
+}switch(this._settings["type"]){case"youtube":this._ui=new
Exhibit.AnimationFacet.YouTube(this);
+break;
+case"slideshare":this._ui=new Exhibit.AnimationFacet.SlideShare(this);
+break;
+case"inline":this._ui=new Exhibit.AnimationFacet.Inline(this);
+break;
+case"default":default:this._ui=new Exhibit.AnimationFacet.DefaultUI(this);
+break;
+}this._ui.setDuration(this._settings.duration);
+var A=this._ui.initUI();
+$(this._div).html(A);
+this._ui.postInitUI();
+};
+Exhibit.AnimationFacet.prototype._clearSelections=function(){if(Exhibit.AnimationFacet.DEBUG1){console.log("_clearSelections");
+}var B={};
+var A=this;
+SimileAjax.History.addLengthyAction(function(){B.restrictions=A.clearAllRestrictions();
+},function(){A.applyRestrictions(B.restrictions);
+},String.substitute(Exhibit.FacetUtilities.l10n["facetClearSelectionsActionTitle"],[this._settings.facetLabel]));
+};
+Exhibit.AnimationFacet.testRemoteLog=function(){if(!SimileAjax["RemoteLog"]){SimileAjax.RemoteLog={logActive:false};
+SimileAjax.RemoteLog.possiblyLog=function(A){};
+}};
+Exhibit.AnimationFacet.prototype.updateModeParams=function(F){if(this._mode==Exhibit.AnimationFacet.MODE_LIST){var
J=[];
+for(var E=0;
+E<this._listModePeriods.length;
+E++){var B=this._listModePeriods[E];
+if(F>=B.from&&F<B.to){J.push(B);
+}}var G=false;
+if(J.length!=this._listModeCurrentPeriods.length){G=true;
+}else{for(var E=0;
+E<this._listModeCurrentPeriods.length;
+E++){if(J[E]!=this._listModeCurrentPeriods[E]){G=true;
+break;
+}}}if(G){this._listModeCurrentPeriods=J;
+this._notifyCollection();
+}}else{if(this._mode==Exhibit.AnimationFacet.MODE_RANGE){var
A=this._rangeModeMaxRange.max-this._rangeModeMaxRange.min;
+var I=F/this._ui.getDuration();
+var C=Math.floor(this._rangeModeMaxRange.min+A*I);
+var D=this._minRangePrecision(C);
+var H=this._maxRangePrecision(C);
+if(this._rangeModeCurrentRange.min!=D||
this._rangeModeCurrentRange.max!=H){this._rangeModeCurrentRange.min=D;
+this._rangeModeCurrentRange.max=H;
+this._notifyCollection();
+}}else{if(this._mode==Exhibit.AnimationFacet.MODE_DATE){}}}};
+Exhibit.AnimationFacet.prototype._minRangePrecision=function(A){var
B=this._rangeModePrecision;
+A-=((A>=0)?A%B:B-Math.abs(A%B));
+return A;
+};
+Exhibit.AnimationFacet.prototype._maxRangePrecision=function(A){var
B=this._rangeModePrecision;
+A+=((A>=0)?B-A%B:Math.abs(A%B));
+return A;
+};
+Exhibit.AnimationFacet.Labels=function(F,C,B){if(F._mode==Exhibit.AnimationFacet.MODE_LIST){if(B==undefined){B={base:0,showAsSeconds:false,inclusiveBounds:false};
+}var D=(B.showAsSeconds)?function(G){return G+B.base;
+}:function(H){var G=Math.floor(H/60);
+var I=Math.ceil(H%60);
+return G+":"+(I<10?"0":"")+I;
+};
+this.timeLabel=D(C);
+this.lowerLabel=D(0);
+this.upperLabel=D(F._ui.getDuration()-(B.inclusiveBounds?1:0));
+}else{if(F._mode==Exhibit.AnimationFacet.MODE_RANGE){var
A=F._rangeModeMaxRange.max-F._rangeModeMaxRange.min;
+var E=C/F._ui.getDuration();
+this.timeLabel=Math.floor(F._rangeModeMaxRange.min+A*E);
+this.lowerLabel=F._rangeModeMaxRange.min;
+this.upperLabel=F._rangeModeMaxRange.max;
+}else{this.timeLabel="?";
+this.lowerLabel="Lower";
+this.upperLabel="Upper";
+}}};
+Exhibit.AnimationFacet.DefaultUI=function(B){this._duration=0;
+this._dom=null;
+this._facet=B;
+this._currentTimePosition=0;
+this._animationStartTime=0;
+this._animationStartPosition=0;
+this._animationFrameDelay=100;
+this._animationPlaying=false;
+this._dragging=false;
+this._animationGlueFunc="__animation_glue__"+Exhibit.AnimationFacet._getNextAnimationUnique();
+var A=this;
+Exhibit.AnimationFacet.DefaultUI[this._animationGlueFunc]=function(){A._animate();
+};
+};
+Exhibit.AnimationFacet.DefaultUI.prototype.dispose=function(){this._dom=null;
+};
+Exhibit.AnimationFacet.DefaultUI.prototype.setDuration=function(A){this._duration=A;
+};
+Exhibit.AnimationFacet.DefaultUI.prototype.getDuration=function(){return
this._duration;
+};
+Exhibit.AnimationFacet.DefaultUI.prototype.initUI=function(){var F=new
Exhibit.AnimationFacet.Labels(this._facet,0);
+var E=this._facet._settings;
+var B=E["height"]?" height:"+E["height"]:"10px";
+var C='<div><div class="exhibit-facet-header"
style="position:Relative;"><span class="exhibit-facet-header-filterControl"
style="position:Absolute; display:Inline-Block; vertical-align:Middle;
right:0px; top:0px; text-align:Right; white-space:NoWrap;"><span
class="exhibit-facet-animation-button"></span> <input type="checkbox"
class="exhibit-facet-animation-tickbox" /></span>'+((E["showLabel"])?'<span
class="exhibit-facet-header-title">'+E["facetLabel"]+"</span>":"")+'</div><div
class="exhibit-facet-animation-shaft-container"><div
class="exhibit-facet-animation-shaft" style="position:Relative;
width:100%;'+B+'"><div class="exhibit-facet-animation-shaft-markers"
style="'+B+'"></div><div class="exhibit-facet-animation-shaft-thumb"
style="position:Absolute;'+B+'"></div></div></div><div
class="exhibit-facet-animation-labels" style="position:Relative;
height:1em;"><div style="position:Absolute;
left:0px;">'+F.lowerLabel+'</div><div style="position:Absolute;
right:0px;">'+F.upperLabel+'</div><div
class="exhibit-facet-animation-labels-time"
style="text-align:Center"></div></div></div>';
+var D=$(C);
+this._dom={elmt:D.get()[0],shaft:$(".exhibit-facet-animation-shaft",D).get()[0],thumb:$(".exhibit-facet-animation-shaft-thumb",D).get()[0],time:$(".exhibit-facet-animation-labels-time",D).get()[0],button:$(".exhibit-facet-animation-button",D).get()[0],tickbox:$("input.exhibit-facet-animation-tickbox",D).get()[0],markers:$(".exhibit-facet-animation-shaft-markers",D).get()[0]};
+var A=this;
+$(this._dom.shaft).mousedown(function(G){if(G.which==1){G.preventDefault();
+A._dragging=true;
+}});
+$(document).mousemove(function(H){if(A._dragging&&H.which==1){H.preventDefault();
+var G=H.pageX-$(A._dom.shaft).offset().left;
+A._updateThumbUI(G,false);
+}}).mouseup(function(H){if(A._dragging&&H.which==1){H.preventDefault();
+var G=H.pageX-$(A._dom.shaft).offset().left;
+if(!A._updateThumbUI(G,true)){A._animationStartTime=(new Date()).getTime();
+A._animationStartPosition=G;
+}A._dragging=false;
+}});
+$(this._dom.tickbox).click(function(G){var H=$(this);
+if(H.attr("checked")){A._facet.updateModeParams(A._currentTimePosition);
+}else{A._facet.clearAllRestrictions();
+}});
+this._showPlayButton(true);
+return this._dom.elmt;
+};
+Exhibit.AnimationFacet.DefaultUI.prototype.postInitUI=function(){this._updateThumbUI(0,false);
+};
+Exhibit.AnimationFacet.DefaultUI.prototype._showPlayButton=function(A){var
B=this;
+$(this._dom.button).html('<img
src="data:image/png;base64,'+Exhibit.AnimationFacet[A?"PLAY_PNG":"PAUSE_PNG"]+'"
/>');
+$("img",this._dom.button).click(A?function(C){B._animateStart();
+}:function(C){B._animateStop();
+});
+$(this._dom.tickbox).attr("disabled",!A);
+};
+Exhibit.AnimationFacet.DefaultUI.prototype._updateThumbUI=function(A,C){var
B=$(this._dom.shaft).width();
+var F=(A>B-1);
+A=(A<0)?0:A;
+A=(A>B-1)?B-1:A;
+var D=$(this._dom.thumb);
+D.css("left",(A-D.width()/2)+"px");
+this._currentTimePosition=Math.floor(this._duration*(A/B*1));
+var E=new
Exhibit.AnimationFacet.Labels(this._facet,this._currentTimePosition);
+$(this._dom.time).html(E.timeLabel);
+if(C){this._facet.updateModeParams(this._currentTimePosition);
+$(this._dom.tickbox).attr("checked",this._facet.hasRestrictions()?"checked":"");
+}return F;
+};
+Exhibit.AnimationFacet.DefaultUI.prototype._animateStart=function(){this._animationPlaying=true;
+this._animationStartTime=(new Date()).getTime();
+this._animationStartPosition=($(this._dom.thumb).offset().left)-($(this._dom.shaft).offset().left)+($(this._dom.thumb).width()/2);
+this._showPlayButton(false);
+setTimeout("Exhibit.AnimationFacet.DefaultUI."+this._animationGlueFunc+"()",this._animationFrameDelay);
+};
+Exhibit.AnimationFacet.DefaultUI.prototype._animateStop=function(){this._animationPlaying=false;
+this._showPlayButton(true);
+};
+Exhibit.AnimationFacet.DefaultUI.prototype._animate=function(){var D=(new
Date()).getTime()-this._animationStartTime;
+var B=$(this._dom.shaft).width();
+var A=B/(this._duration*1000);
+var C=D*A;
+var F=this._animationStartPosition+C;
+var E=false;
+if(!this._dragging){E=this._updateThumbUI(F,true);
+}if(this._animationPlaying){if(!E){setTimeout("Exhibit.AnimationFacet.DefaultUI."+this._animationGlueFunc+"()",this._animationFrameDelay);
+}else{this._animateStop();
+this._updateThumbUI(0,false);
+this._facet.clearAllRestrictions();
+}}};
+Exhibit.AnimationFacet.__augment=function(B){for(var A in
B){if(A.indexOf("_X_")>=0){continue;
+}if(typeof B[A]=="function"){B["_X_"+A]=B[A];
+B[A]=function(){var C=B["_X_"+A].apply(B,arguments);
+return C;
+};
+}}};
+
+
+/* animation-inline.js */
+Exhibit.AnimationFacet._settingSpecs["inlineshowplay"]={type:"boolean",defaultValue:true};
+Exhibit.AnimationFacet._settingSpecs["inlinemodernstyle"]={type:"boolean",defaultValue:false};
+Exhibit.AnimationFacet.Inline=function(B){this._duration=0;
+this._dom=null;
+this._facet=B;
+this._animationStartTime=0;
+this._animationStartPosition=0;
+this._animationFrameDelay=100;
+this._animationPlaying=false;
+this._dragging=false;
+this._animationGlueFunc="__animation_glue__"+Exhibit.AnimationFacet._getNextAnimationUnique();
+var A=this;
+Exhibit.AnimationFacet.Inline[this._animationGlueFunc]=function(){A._animate();
+};
+};
+Exhibit.AnimationFacet.Inline.PLAY_PNG="iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAAXNSR0IArs4c6QAAAAZiS0dEAMkAyQDJYYDmDgAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wJBw06OtKSuKQAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAAVxJREFUKM+dk89KAlEUxn83fAxh3qSFT+HONrlyE25mV+3O20T0D6KEQgwtC5mNJCLq6KhMiuhCZ+Fp4U0TRKy7ufcc+H3ng/NdRORCRA75xzEiovadA85d133eFz4ASCaTxOPxBPAkIo/7OokBOI6D4zg0m03y+XzC9/2EiOSAU9d18zttZ7PZjWar1aJQKNDpdAAegbNtIkZENJPJ2Mp21WCAdrtFsVQiCAKAB+uksAGnj9NrEECXQvbC933K5TL9fh/g3jp5MSKiR6nUilmpGgMoqmCskN/2qVQqhGEIcBIDmEfRehwKan7cY4But4vneQyHQ4A7u9LiEp7NwSib3iEIAqrVKqPRCODWQqWNVUXR3E4y6EIZDAbUap+Mx2OAGwu9bt3zLIpgoYRfIfV6nclkor+gt50h6fd6NBoNptOpAtcWKu+VMM/zFLiy0Pu+2Y4Blxb6+Ouv+gZldbw7tlbjQQAAAABJRU5ErkJggg==";
+Exhibit.AnimationFacet.Inline.PAUSE_PNG="iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAAXNSR0IArs4c6QAAAAZiS0dEAMkAyQDJYYDmDgAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wJBw4TAryQIYgAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAAP9JREFUKM99kt1xg0AMhD95aCHjspxuoASoybzThtNFbO1FebgfYAzWw83N7Wm10srGcQxOYhgG+4R3AH3fvwHTNLX7Gd4BpPQHnBYgpQQYEOXcVJYcyqNtOMZxJOMiCAx7l+2ekysYtlfh7phRqq9xqcxJwuW4HEkAfN9urbK7kDvy/G+tLLVettxf12tLXkcSRJZRem6y61wy6K9nTnY14rC1964xH8Tv85VJisxDn+XKom0v/ufxWKdd4NjgOTk5UXqyjZPLslCtjMhYGNTPxSrxKc7wS5UtCVexo8xgGIbWc8VcanvRrMLidENTmTbsF6UDmOf7R9n3eT58/wfel7gwBDKMLAAAAABJRU5ErkJggg==";
+Exhibit.AnimationFacet.Inline.THUMB_PNG="iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAAXNSR0IArs4c6QAAAAZiS0dEAMwAzADM38FfGgAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wIFAsaGOk3cJEAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAAgpJREFUKM+dkz9OG0EYxX8zOxvJiMiDwQYbS4QQ2lRIMQoSDRAuwAFSUeQCewSuQJUDcISUSLELKsoAKeKVRdaWEVpEpJ1/KXaxUJQ0mW70vd8370lvBH+ck5OTj8ARsAU0gClwAZwlSfL5uVY8g94Cp0DvzeYmGxuvaTZbTMZjbm6+c3X1DWAAHCdJcjmDK/CL1rq1836HzmoHFUUIKQFwzjEajTg/P+fu7i4D9pMkuZTVw6da69b+wQEr7RWiKEKpmDiOiZVCRYp2u83hh0O01q3KIVGV8dPu7i6NhQZRHBEphVKKOH6BEBBCIPiAkAKt61xfX3f39vZ+SOBobe0Vi4uLBIAAVGLnLd5DCB5fTllaarK+vg5wJIGtbneV4EMp8h7nHNZZTGEwpsA5h3cO78t5t9sF2FJAo16v47xDOomQorRKQCIJhHKhtbMFekEDNBQwnU6nzdpcrYQBPMjII4SoUgS8c1jncM4xmUwAphK4SNMUZx3WWIy1GGswxlCYorReFBhjsNZinSUdpgAXEjhL05TxZFzmNBZjSvgp8+xuDNnPjOFwCHD2VJL+y/n53rvtHnO1OYSURELO+hdCmfvx1yOD/oA8zwdJkmw/leQ4f3jIBv0BWZZhi8qyMRRFgSkKsiyj/7VPnucZcPzPbnc6HZaXl9Fac39/z+3tLaPR6O/d/t9f9RsoTTP4+32UigAAAABJRU5ErkJggg==";
+Exhibit.AnimationFacet.Inline.SHAFT_PNG="iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAAXNSR0IArs4c6QAAAAZiS0dEAIgAiACIdJABBgAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wIFAsiBOqpkCUAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAAbZJREFUKM+dk81uGjEUhT+PPd3WDT8TKBLQNG/ArpHYTJM8Eo/AQ7FDKqRpXqAhVdCgERqqUETSxQy2s5iBkDbNond1fe1zjn3uteCP6Pf7/Ct6vd6ztXgJ9PH4mKOjD1QqVX4uFtzc/OD6+vtfJGIfqLXm5NMJ9fd1lJQIzwPAGEMcxwyHQ5bL5Y7A27Jprfl8esph7RApJUr5+L6PrxRKKmq1Gudn52itdzeQW9Vut8vBuwOkL5FKoZTC998gBDjncNYhPIHWb5lMJoRhmCs3my1KpRIOwAHFYWM3WAvOWWy+S7lcod1uA6AAN53eMp3e8nq4fX9zcBAEhe8CnCtcFLmOcOAEooDmiWNbUK12C+GeuHcnd4htnlO6vS6ri/GFaDQadDodlFRIJZFS4nneDuScxVqLMYaN2XD59ZIoilAAs9mMZqtJpVzBOoe1NgdvX1vUjDEsFguiKMpbNRgMCMOQX3dLqkEVKSW2cNvaJ0VjDA+/H7j6dkWaps+HZH1/z3g0JkkSNmlGmqVkWUaapmRpSpIkjL6MWK/Xr892vV4nCAK01qxWK+bzOXEcvzzb//urHgE3adNcFxKl0AAAAABJRU5ErkJggg==";
+Exhibit.AnimationFacet.Inline.prototype.dispose=function(){this._dom=null;
+};
+Exhibit.AnimationFacet.Inline.prototype.setDuration=function(A){this._duration=A;
+};
+Exhibit.AnimationFacet.Inline.prototype.getDuration=function(){return
this._duration;
+};
+Exhibit.AnimationFacet.Inline.prototype.initUI=function(){var D=new
Exhibit.AnimationFacet.Labels(this._facet,0);
+var B=this._facet._settings;
+var J=B["inlineshowplay"];
+var C=null;
+if(!B["inlinemodernstyle"]){var G=B["width"]?"
width:"+B["width"]+";":"width:100px;";
+var E=B["height"]?" height:"+B["height"]+";":" height:10px;";
+var C="<span>"+((J)?'<span
class="exhibit-facet-animation-button"></span>':"")+'<div
style="display:Inline-Block; margin-left:5px; margin-right:5px;'+G+'"
class="exhibit-facet-animation-shaft-container"><div
class="exhibit-facet-animation-shaft" style="position:Relative;
width:100%;'+E+'"><div class="exhibit-facet-animation-shaft-thumb"
style="position:Absolute;'+E+'"></div></div></div></span>';
+}else{var G=B["width"]?" width:"+B["width"]+";":"width:100px;";
+var H="border:None; height:15px;
background-image:url(data:image/png;base64,"+Exhibit.AnimationFacet.Inline.SHAFT_PNG+");
background-repeat:Repeat-X;";
+var F="border:None; width:15px; height:15px;
background-image:url(data:image/png;base64,"+Exhibit.AnimationFacet.Inline.THUMB_PNG+");
background-repeat:None;";
+var C="<span>"+((J)?'<span
class="exhibit-facet-animation-button"></span>':"")+'<div
style="display:Inline-Block; border:None; margin-left:8px;
margin-right:8px;'+G+'"
class="exhibit-facet-animation-shaft-container"><div
class="exhibit-facet-animation-shaft" style="position:Relative;
width:100%; '+H+'"><div class="exhibit-facet-animation-shaft-thumb"
style="position:Absolute; '+F+'"></div></div></div></span>';
+}var A=$(C);
+this._dom={elmt:A.get()[0],shaft:$(".exhibit-facet-animation-shaft",A).get()[0],thumb:$(".exhibit-facet-animation-shaft-thumb",A).get()[0],button:$(".exhibit-facet-animation-button",A).get()[0]};
+var I=this;
+$(this._dom.shaft).mousedown(function(K){if(K.which==1){K.preventDefault();
+I._dragging=true;
+}});
+$(document).mousemove(function(L){if(I._dragging&&L.which==1){L.preventDefault();
+var K=L.pageX-$(I._dom.shaft).offset().left;
+I._updateThumbUI(K,false);
+}}).mouseup(function(L){if(I._dragging&&L.which==1){L.preventDefault();
+var K=L.pageX-$(I._dom.shaft).offset().left;
+if(!I._updateThumbUI(K,true)){I._animationStartTime=(new Date()).getTime();
+I._animationStartPosition=K;
+}I._dragging=false;
+}});
+this._showPlayButton(true);
+return this._dom.elmt;
+};
+Exhibit.AnimationFacet.Inline.prototype.postInitUI=function(){this._updateThumbUI(0,false);
+};
+Exhibit.AnimationFacet.Inline.prototype._showPlayButton=function(A){var
B=this;
+var
C=(this._facet._settings["inlinemodernstyle"])?Exhibit.AnimationFacet.Inline:Exhibit.AnimationFacet;
+$(this._dom.button).html('<img
src="data:image/png;base64,'+C[A?"PLAY_PNG":"PAUSE_PNG"]+'" />');
+$("img",this._dom.button).click(A?function(D){B._animateStart();
+}:function(D){B._animateStop();
+});
+};
+Exhibit.AnimationFacet.Inline.prototype._updateThumbUI=function(A,D){var
B=$(this._dom.shaft).width();
+var F=(A>B-1);
+A=(A<0)?0:A;
+A=(A>B-1)?B-1:A;
+var E=$(this._dom.thumb);
+E.css("left",(A-E.width()/2)+"px");
+var C=Math.floor(this._duration*(A/B*1));
+if(D){this._facet.updateModeParams(C);
+}return F;
+};
+Exhibit.AnimationFacet.Inline.prototype._animateStart=function(){this._animationPlaying=true;
+this._animationStartTime=(new Date()).getTime();
+this._animationStartPosition=($(this._dom.thumb).offset().left)-($(this._dom.shaft).offset().left)+($(this._dom.thumb).width()/2);
+this._showPlayButton(false);
+setTimeout("Exhibit.AnimationFacet.Inline."+this._animationGlueFunc+"()",this._animationFrameDelay);
+};
+Exhibit.AnimationFacet.Inline.prototype._animateStop=function(){this._animationPlaying=false;
+this._showPlayButton(true);
+};
+Exhibit.AnimationFacet.Inline.prototype._animate=function(){var D=(new
Date()).getTime()-this._animationStartTime;
+var B=$(this._dom.shaft).width();
+var A=B/(this._duration*1000);
+var C=D*A;
+var F=this._animationStartPosition+C;
+var E=false;
+if(!this._dragging){E=this._updateThumbUI(F,true);
+}if(this._animationPlaying){if(!E){setTimeout("Exhibit.AnimationFacet.Inline."+this._animationGlueFunc+"()",this._animationFrameDelay);
+}else{this._animateStop();
+this._updateThumbUI(0,false);
+this._facet.clearAllRestrictions();
+}}};
+
+
+/* animation-slideshare.js */
+Exhibit.AnimationFacet._settingSpecs["sswidth"]={type:"int",defaultValue:598};
+Exhibit.AnimationFacet._settingSpecs["ssheight"]={type:"int",defaultValue:480};
+Exhibit.AnimationFacet._settingSpecs["ssslides"]={type:"text",defaultValue:"simile-exhibit-vgsom-12312308"};
+Exhibit.AnimationFacet._settingSpecs["sslabelfromone"]={type:"boolean",defaultValue:false};
+Exhibit.AnimationFacet._settingSpecs["ssshowtrack"]={type:"boolean",defaultValue:true};
+Exhibit.AnimationFacet.SlideShare=function(C){this._duration=-1;
+this._facet=C;
+this._playerId="ExhibitAnimationFacetSlideShare__slideshare__"+Exhibit.AnimationFacet._getNextAnimationUnique();
+this._playerObj=null;
+this._lastSlide=-1;
+this._$tickbox=null;
+this._hideTickbox=false;
+this._animationFrameDelay=100;
+this._animationPlaying=false;
+var
B="__animation_glue__"+Exhibit.AnimationFacet._getNextAnimationUnique();
+this._animationGlueFunc="Exhibit.AnimationFacet.SlideShare."+B+"()";
+var A=this;
+Exhibit.AnimationFacet.SlideShare[B]=function(){A._animate();
+};
+};
+Exhibit.AnimationFacet.SlideShare._mapVideoObjectToPlayerId={};
+Exhibit.AnimationFacet.SlideShare.prototype.dispose=function(){this._facet=null;
+this._playerObj=null;
+this._playerId=null;
+};
+Exhibit.AnimationFacet.SlideShare.prototype.setDuration=function(A){};
+Exhibit.AnimationFacet.SlideShare.prototype.getDuration=function(){if(this._duration<0){var
A=this._playerObj.getCurrentSlide();
+this._playerObj.last();
+this._duration=this._playerObj.getCurrentSlide();
+this._playerObj.jumpTo(A);
+}return this._duration;
+};
+Exhibit.AnimationFacet.SlideShare.prototype.initUI=function(){var
C=this._facet._settings;
+this._hideTickbox=!C["showLabel"];
+var B='<span style="display:Inline-Block; position:Relative;"><input
type="checkbox" class="exhibit-facet-animation-tickbox"
style="display:Block; position:Absolute; right:0px; top:0px;" /><div
class="exhibit-facet-header">'+((C["showLabel"])?'<span
class="exhibit-facet-header-title">'+C["facetLabel"]+"</span>":"")+'</div><div
style="width:'+C["sswidth"]+"px; height:"+C["ssheight"]+'px;"><div
id="'+this._playerId+'"></div></div>'+(C["ssshowtrack"]?'<div
style="width:'+C["sswidth"]+'px;"><div
class="exhibit-facet-animation-bar-container"><div
class="exhibit-facet-animation-bar" style="position:Relative;
width:0px;"></div></div><div class="exhibit-facet-animation-labels"
style="position:Relative; height:1em;"><div style="position:Absolute;
left:0px;">—</div><div style="position:Absolute;
right:0px;">—</div><div class="exhibit-facet-animation-labels-time"
style="text-align:Center"></div></div></div>':"")+"</span>";
+$el=$(B);
+var A=this;
+this._$tickbox=$($("input.exhibit-facet-animation-tickbox",$el).get()[0]);
+if(!C["showLabel"]){this._$tickbox.css("right","5px").css("top","5px").css("margin","0px");
+}this._$tickbox.click(function(D){var E=$(this);
+if(E.attr("checked")){A._facet.updateModeParams(A._playerObj.getCurrentSlide()-1);
+}else{A._facet.clearAllRestrictions();
+}});
+return $el;
+};
+Exhibit.AnimationFacet.SlideShare.prototype.postInitUI=function(){var
C=this._facet._settings;
+var A=this;
+var B="
http://static.slidesharecdn.com/swf/ssplayer2.swf";
+var D={doc:C["ssslides"],startSlide:1,rel:0};
+swfobject.embedSWF(B,this._playerId,C["sswidth"],C["ssheight"],"8",null,D,{allowScriptAccess:"always",wmode:"transparent",allowfullscreen:"true"},{id:this._playerId},function(E){if(E.success){A._playerObj=$("#"+A._playerId).get()[0];
+setTimeout(A._animationGlueFunc,A._animationFrameDelay);
+}else{}});
+Exhibit.AnimationFacet.SlideShare._mapVideoObjectToPlayerId[this._playerId]=this;
+};
+Exhibit.AnimationFacet.SlideShare.prototype._animate=function(){if(this._playerObj.getCurrentSlide){var
A=this._playerObj.getCurrentSlide()-1;
+if(A!=this._lastSlide){this._lastSlide=A;
+this._updateLabels(A);
+this._facet.updateModeParams(A);
+this._$tickbox.attr("checked",this._facet.hasRestrictions()?"checked":"");
+}}else{}setTimeout(this._animationGlueFunc,this._animationFrameDelay);
+};
+Exhibit.AnimationFacet.SlideShare.prototype._updateLabels=function(F){if(!this._facet._settings["ssshowtrack"]){return ;
+}var C=this.getDuration();
+if(C==0){return ;
+}var
D={base:this._facet._settings["sslabelfromone"],showAsSeconds:true,inclusiveBounds:true};
+var E=new Exhibit.AnimationFacet.Labels(this._facet,Math.floor(F),D);
+var H=$(".exhibit-facet-animation-labels
div",this._facet._div).each(function(J){switch(J){case
0:$(this).html(E.lowerLabel);
+break;
+case 1:$(this).html(E.upperLabel);
+break;
+case 2:$(this).html(E.timeLabel);
+break;
+}});
+var B=$(".exhibit-facet-animation-bar-container",this._facet._div);
+var G=$(".exhibit-facet-animation-bar",B);
+var I=B.width();
+var A=(1*I/C);
+G.css("width",Math.floor(F*A)+"px");
+};
+
+
+/* animation-youtube.js */
+Exhibit.AnimationFacet._settingSpecs["ytwidth"]={type:"int",defaultValue:280};
+Exhibit.AnimationFacet._settingSpecs["ytheight"]={type:"int",defaultValue:170};
+Exhibit.AnimationFacet._settingSpecs["ytvideo"]={type:"text",defaultValue:"ILGK83V6h9s"};
+Exhibit.AnimationFacet._settingSpecs["ytshowtrack"]={type:"boolean",defaultValue:true};
+
Exhibit.AnimationFacet.YouTube=function(C){this._duration=0;
+this._facet=C;
+this._playerId="__youtube__"+Exhibit.AnimationFacet._getNextAnimationUnique();
+this._divId="ExhibitAnimationFacetYouTube"+this._playerId;
+this._playerObj=null;
+this._$tickbox=null;
+this._hideTickbox=false;
+this._animationFrameDelay=100;
+this._animationPlaying=false;
+var
B="__animation_glue__"+Exhibit.AnimationFacet._getNextAnimationUnique();
+this._animationGlueFunc="
Exhibit.AnimationFacet.YouTube."+B+"()";
+var A=this;
+
Exhibit.AnimationFacet.YouTube[B]=function(){A._animate();
+};
+};
+Exhibit.AnimationFacet.YouTube.YT_UNSTARTED=-1;
+Exhibit.AnimationFacet.YouTube.YT_ENDED=0;
+Exhibit.AnimationFacet.YouTube.YT_PLAYING=1;
+Exhibit.AnimationFacet.YouTube.YT_PAUSED=2;
+Exhibit.AnimationFacet.YouTube.YT_BUFFERING=3;
+Exhibit.AnimationFacet.YouTube.YT_CUED=5;
+Exhibit.AnimationFacet.YouTube._mapVideoObjectToPlayerId={};
+Exhibit.AnimationFacet.YouTube.prototype.dispose=function(){this._facet=null;
+this._playerObj=null;
+this._divId=null;
+this._playerId=null;
+};
+Exhibit.AnimationFacet.YouTube.prototype.setDuration=function(A){};
+Exhibit.AnimationFacet.YouTube.prototype.getDuration=function(){return
this._playerObj.getDuration();
+};
+Exhibit.AnimationFacet.YouTube.prototype.initUI=function(){var
C=this._facet._settings;
+this._hideTickbox=!C["showLabel"];
+var B='<span style="display:Inline-Block; position:Relative;"><input
type="checkbox" class="exhibit-facet-animation-tickbox"
style="display:Block; position:Absolute; right:0px; top:0px;" /><div
class="exhibit-facet-header">'+((C["showLabel"])?'<span
class="exhibit-facet-header-title">'+C["facetLabel"]+"</span>":"")+'</div><div
style="width:'+C["ytwidth"]+"px; height:"+C["ytheight"]+'px;"><div
id="'+this._divId+'"></div></div>'+(C["ytshowtrack"]?'<div
style="width:'+C["ytwidth"]+'px;"><div
class="exhibit-facet-animation-bar-container"><div
class="exhibit-facet-animation-bar" style="position:Relative;
width:0px;"></div></div><div class="exhibit-facet-animation-labels"
style="position:Relative; height:1em;"><div style="position:Absolute;
left:0px;">—</div><div style="position:Absolute;
right:0px;">—</div><div class="exhibit-facet-animation-labels-time"
style="text-align:Center"></div></div></div>':"")+"</span>";
+$el=$(B);
+var A=this;
+this._$tickbox=$($("input.exhibit-facet-animation-tickbox",$el).get()[0]);
+if(!C["showLabel"]){this._$tickbox.css("right","5px").css("top","5px").css("margin","0px");
+}this._$tickbox.click(function(D){var E=$(this);
+if(E.attr("checked")){A._facet.updateModeParams(A._playerObj.getCurrentTime());
+}else{A._facet.clearAllRestrictions();
+}});
+return $el;
+};
+Exhibit.AnimationFacet.YouTube.prototype.postInitUI=function(){var
B=this._facet._settings;
+var A="
http://www.youtube.com/v/";
+swfobject.embedSWF(A+B["ytvideo"]+"?version=3&enablejsapi=1&title=Video+facet&autohide=2&color=white&egm=0&border=0&iv_load_policy=3&modestbranding=1&rel=0&showinfo=0&fs=0&playerapiid="+this._playerId,this._divId,B["ytwidth"],B["ytheight"],"8",null,null,{allowScriptAccess:"always",wmode:"transparent",allowfullscreen:"true"},{id:this._playerId});
+Exhibit.AnimationFacet.YouTube._mapVideoObjectToPlayerId[this._playerId]=this;
+};
+Exhibit.AnimationFacet.YouTube.prototype._animate=function(){if(this._animationPlaying){this._update();
+setTimeout(this._animationGlueFunc,this._animationFrameDelay);
+}};
+Exhibit.AnimationFacet.YouTube.prototype._onStateChange=function(A){switch(A){case
Exhibit.AnimationFacet.YouTube.YT_PLAYING:this._animationPlaying=true;
+this._disableTickbox(true);
+this._update();
+setTimeout(this._animationGlueFunc,this._animationFrameDelay);
+break;
+case Exhibit.AnimationFacet.YouTube.YT_PAUSED:this._animationPlaying=false;
+this._disableTickbox(false);
+this._update();
+break;
+case Exhibit.AnimationFacet.YouTube.YT_ENDED:this._animationPlaying=false;
+this._disableTickbox(false);
+this._updateLabels(0);
+this._facet.clearAllRestrictions();
+break;
+}};
+Exhibit.AnimationFacet.YouTube.prototype._disableTickbox=function(A){this._$tickbox.attr("disabled",A);
+if(this._hideTickbox){this._$tickbox.css("display",(A?"None":"Inline"));
+}};
+Exhibit.AnimationFacet.YouTube.prototype._update=function(A){var
A=(A==undefined)?this._playerObj.getCurrentTime():A;
+this._updateLabels(A);
+this._facet.updateModeParams(A);
+this._$tickbox.attr("checked",this._facet.hasRestrictions()?"checked":"");
+};
+Exhibit.AnimationFacet.YouTube.prototype._updateLabels=function(B){if(!this._facet._settings["ytshowtrack"]){return ;
+}var C=this.getDuration();
+if(C==0){return ;
+}var H=new Exhibit.AnimationFacet.Labels(this._facet,Math.floor(B));
+var F=$(".exhibit-facet-animation-labels
div",this._facet._div).each(function(I){switch(I){case
0:$(this).html(H.lowerLabel);
+break;
+case 1:$(this).html(H.upperLabel);
+break;
+case 2:$(this).html(H.timeLabel);
+break;
+}});
+var G=$(".exhibit-facet-animation-bar-container",this._facet._div);
+var E=$(".exhibit-facet-animation-bar",G);
+var A=G.width();
+var D=(1*A/C);
+E.css("width",Math.floor(B*D)+"px");
+};
+function onYouTubePlayerReady(B){var
A=Exhibit.AnimationFacet.YouTube._mapVideoObjectToPlayerId[B];
+var C="__EVENT_HANDLER__"+B;
+
Exhibit.AnimationFacet.YouTube[C]=function(D){A._onStateChange(D);
+};
+A._playerObj=document.getElementById(B);
+A._playerObj.addEventListener("onStateChange","
Exhibit.AnimationFacet.YouTube."+C);
+}
+
+/* swfobject.js */
+var swfobject=function(){var AQ="undefined",Ac="object",AB="Shockwave
Flash",X="ShockwaveFlash.ShockwaveFlash",Ad="application/x-shockwave-flash",AC="SWFObjectExprInst",AW="onreadystatechange",AF=window,Ak=document,Aa=navigator,AA=false,Z=[Am],Af=[],AG=[],AL=[],Ai,AD,AP,AS,AK=false,At=false,Ag,AN,Ah=true,AH=function(){var
A=typeof Ak.getElementById!=AQ&&typeof Ak.getElementsByTagName!=AQ&&typeof
Ak.createElement!=AQ,E=Aa.userAgent.toLowerCase(),C=Aa.platform.toLowerCase(),H=C?/win/.test(C):/win/.test(E),J=C?/mac/.test(C):/mac/.test(E),G=/webkit/.test(E)?parseFloat(E.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,D=!+"\v1",F=[0,0,0],K=null;
+if(typeof Aa.plugins!=AQ&&typeof
Aa.plugins[AB]==Ac){K=Aa.plugins[AB].description;
+if(K&&!(typeof
Aa.mimeTypes!=AQ&&Aa.mimeTypes[Ad]&&!Aa.mimeTypes[Ad].enabledPlugin)){AA=true;
+D=false;
+K=K.replace(/^.*\s+(\S+\s+\S+$)/,"$1");
+F[0]=parseInt(K.replace(/^(.*)\..*$/,"$1"),10);
+F[1]=parseInt(K.replace(/^.*\.(.*)\s.*$/,"$1"),10);
+F[2]=/[a-zA-Z]/.test(K)?parseInt(K.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0;
+}}else{if(typeof AF.ActiveXObject!=AQ){try{var I=new ActiveXObject(X);
+if(I){K=I.GetVariable("$version");
+if(K){D=true;
+K=K.split(" ")[1].split(",");
+F=[parseInt(K[0],10),parseInt(K[1],10),parseInt(K[2],10)];
+}}}catch(B){}}}return{w3:A,pv:F,wk:G,ie:D,win:H,mac:J};
+}(),Aj=function(){if(!AH.w3){return ;
+}if((typeof Ak.readyState!=AQ&&Ak.readyState=="complete")||(typeof
Ak.readyState==AQ&&(Ak.getElementsByTagName("body")[0]||Ak.body))){Ao();
+}if(!AK){if(typeof
Ak.addEventListener!=AQ){Ak.addEventListener("DOMContentLoaded",Ao,false);
+}if(AH.ie&&AH.win){Ak.attachEvent(AW,function(){if(Ak.readyState=="complete"){Ak.detachEvent(AW,arguments.callee);
+Ao();
+}});
+if(AF==top){(function(){if(AK){return ;
+}try{Ak.documentElement.doScroll("left");
+}catch(A){setTimeout(arguments.callee,0);
+return ;
+}Ao();
+})();
+}}if(AH.wk){(function(){if(AK){return ;
+}if(!/loaded|complete/.test(Ak.readyState)){setTimeout(arguments.callee,0);
+return ;
+}Ao();
+})();
+}Ab(Ao);
+}}();
+function Ao(){if(AK){return ;
+}try{var B=Ak.getElementsByTagName("body")[0].appendChild(AR("span"));
+B.parentNode.removeChild(B);
+}catch(A){return ;
+}AK=true;
+var D=Z.length;
+for(var C=0;
+C<D;
+C++){Z[C]();
+}}function AJ(A){if(AK){A();
+}else{Z[Z.length]=A;
+}}function Ab(A){if(typeof
AF.addEventListener!=AQ){AF.addEventListener("load",A,false);
+}else{if(typeof
Ak.addEventListener!=AQ){Ak.addEventListener("load",A,false);
+}else{if(typeof AF.attachEvent!=AQ){Al(AF,"onload",A);
+}else{if(typeof AF.onload=="function"){var B=AF.onload;
+AF.onload=function(){B();
+A();
+};
+}else{AF.onload=A;
+}}}}}function Am(){if(AA){Y();
+}else{AM();
+}}function Y(){var D=Ak.getElementsByTagName("body")[0];
+var B=AR(Ac);
+B.setAttribute("type",Ad);
+var A=D.appendChild(B);
+if(A){var C=0;
+(function(){if(typeof A.GetVariable!=AQ){var E=A.GetVariable("$version");
+if(E){E=E.split(" ")[1].split(",");
+AH.pv=[parseInt(E[0],10),parseInt(E[1],10),parseInt(E[2],10)];
+}}else{if(C<10){C++;
+setTimeout(arguments.callee,10);
+return ;
+}}D.removeChild(B);
+A=null;
+AM();
+})();
+}else{AM();
+}}function AM(){var G=Af.length;
+if(G>0){for(var H=0;
+H<G;
+H++){var C=Af[H].id;
+var L=Af[H].callbackFn;
+var A={success:false,id:C};
+if(AH.pv[0]>0){var I=Ar(C);
+if(I){if(AO(Af[H].swfVersion)&&!(AH.wk&&AH.wk<312)){AX(C,true);
+if(L){A.success=true;
+A.ref=AU(C);
+L(A);
+}}else{if(Af[H].expressInstall&&AT()){var E={};
+E.data=Af[H].expressInstall;
+E.width=I.getAttribute("width")||"0";
+E.height=I.getAttribute("height")||"0";
+if(I.getAttribute("class")){E.styleclass=I.getAttribute("class");
+}if(I.getAttribute("align")){E.align=I.getAttribute("align");
+}var F={};
+var D=I.getElementsByTagName("param");
+var K=D.length;
+for(var J=0;
+J<K;
+J++){if(D[J].getAttribute("name").toLowerCase()!="movie"){F[D[J].getAttribute("name")]=D[J].getAttribute("value");
+}}AE(E,F,C,L);
+}else{Ae(I);
+if(L){L(A);
+}}}}}else{AX(C,true);
+if(L){var B=AU(C);
+if(B&&typeof B.SetVariable!=AQ){A.success=true;
+A.ref=B;
+}L(A);
+}}}}}function AU(B){var D=null;
+var C=Ar(B);
+if(C&&C.nodeName=="OBJECT"){if(typeof C.SetVariable!=AQ){D=C;
+}else{var A=C.getElementsByTagName(Ac)[0];
+if(A){D=A;
+}}}return D;
+}function AT(){return !At&&AO("6.0.65")&&(AH.win||
AH.mac)&&!(AH.wk&&AH.wk<312);
+}function AE(F,D,H,E){At=true;
+AP=E||null;
+AS={success:false,id:H};
+var A=Ar(H);
+if(A){if(A.nodeName=="OBJECT"){Ai=An(A);
+AD=null;
+}else{Ai=A;
+AD=H;
+}F.id=AC;
+if(typeof F.width==AQ||
(!/%$/.test(F.width)&&parseInt(F.width,10)<310)){F.width="310";
+}if(typeof F.height==AQ||
(!/%$/.test(F.height)&&parseInt(F.height,10)<137)){F.height="137";
+}Ak.title=Ak.title.slice(0,47)+" - Flash Player Installation";
+var
B=AH.ie&&AH.win?"ActiveX":"PlugIn",C="MMredirectURL="+AF.location.toString().replace(/&/g,"%26")+"&MMplayerType="+B+"&MMdoctitle="+Ak.title;
+if(typeof D.flashvars!=AQ){D.flashvars+="&"+C;
+}else{D.flashvars=C;
+}if(AH.ie&&AH.win&&A.readyState!=4){var G=AR("div");
+H+="SWFObjectNew";
+G.setAttribute("id",H);
+A.parentNode.insertBefore(G,A);
+A.style.display="none";
+(function(){if(A.readyState==4){A.parentNode.removeChild(A);
+}else{setTimeout(arguments.callee,10);
+}})();
+}AZ(F,D,H);
+}}function Ae(A){if(AH.ie&&AH.win&&A.readyState!=4){var B=AR("div");
+A.parentNode.insertBefore(B,A);
+B.parentNode.replaceChild(An(A),B);
+A.style.display="none";
+(function(){if(A.readyState==4){A.parentNode.removeChild(A);
+}else{setTimeout(arguments.callee,10);
+}})();
+}else{A.parentNode.replaceChild(An(A),A);
+}}function An(B){var D=AR("div");
+if(AH.win&&AH.ie){D.innerHTML=B.innerHTML;
+}else{var E=B.getElementsByTagName(Ac)[0];
+if(E){var A=E.childNodes;
+if(A){var F=A.length;
+for(var C=0;
+C<F;
+C++){if(!(A[C].nodeType==1&&A[C].nodeName=="PARAM")&&!(A[C].nodeType==8)){D.appendChild(A[C].cloneNode(true));
+}}}}}return D;
+}function AZ(E,G,C){var D,A=Ar(C);
+if(AH.wk&&AH.wk<312){return D;
+}if(A){if(typeof E.id==AQ){E.id=C;
+}if(AH.ie&&AH.win){var F="";
+for(var I in
E){if(E[I]!=Object.prototype[I]){if(I.toLowerCase()=="data"){G.movie=E[I];
+}else{if(I.toLowerCase()=="styleclass"){F+=' class="'+E[I]+'"';
+}else{if(I.toLowerCase()!="classid"){F+=" "+I+'="'+E[I]+'"';
+}}}}}var H="";
+for(var J in G){if(G[J]!=Object.prototype[J]){H+='<param name="'+J+'"
value="'+G[J]+'" />';
+}}A.outerHTML='<object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+F+">"+H+"</object>";
+AG[AG.length]=E.id;
+D=Ar(E.id);
+}else{var B=AR(Ac);
+B.setAttribute("type",Ad);
+for(var K in
E){if(E[K]!=Object.prototype[K]){if(K.toLowerCase()=="styleclass"){B.setAttribute("class",E[K]);
+}else{if(K.toLowerCase()!="classid"){B.setAttribute(K,E[K]);
+}}}}for(var L in
G){if(G[L]!=Object.prototype[L]&&L.toLowerCase()!="movie"){Ap(B,L,G[L]);
+}}A.parentNode.replaceChild(B,A);
+D=B;
+}}return D;
+}function Ap(B,D,C){var A=AR("param");
+A.setAttribute("name",D);
+A.setAttribute("value",C);
+B.appendChild(A);
+}function AV(A){var B=Ar(A);
+if(B&&B.nodeName=="OBJECT"){if(AH.ie&&AH.win){B.style.display="none";
+(function(){if(B.readyState==4){As(A);
+}else{setTimeout(arguments.callee,10);
+}})();
+}else{B.parentNode.removeChild(B);
+}}}function As(A){var B=Ar(A);
+if(B){for(var C in B){if(typeof B[C]=="function"){B[C]=null;
+}}B.parentNode.removeChild(B);
+}}function Ar(A){var C=null;
+try{C=Ak.getElementById(A);
+}catch(B){}return C;
+}function AR(A){return Ak.createElement(A);
+}function Al(A,C,B){A.attachEvent(C,B);
+AL[AL.length]=[A,C,B];
+}function AO(A){var B=AH.pv,C=A.split(".");
+C[0]=parseInt(C[0],10);
+C[1]=parseInt(C[1],10)||0;
+C[2]=parseInt(C[2],10)||0;
+return(B[0]>C[0]||(B[0]==C[0]&&B[1]>C[1])||
(B[0]==C[0]&&B[1]==C[1]&&B[2]>=C[2]))?true:false;
+}function AY(B,F,A,C){if(AH.ie&&AH.mac){return ;
+}var E=Ak.getElementsByTagName("head")[0];
+if(!E){return ;
+}var G=(A&&typeof A=="string")?A:"screen";
+if(C){Ag=null;
+AN=null;
+}if(!Ag||AN!=G){var D=AR("style");
+D.setAttribute("type","text/css");
+D.setAttribute("media",G);
+Ag=E.appendChild(D);
+if(AH.ie&&AH.win&&typeof
Ak.styleSheets!=AQ&&Ak.styleSheets.length>0){Ag=Ak.styleSheets[Ak.styleSheets.length-1];
+}AN=G;
+}if(AH.ie&&AH.win){if(Ag&&typeof Ag.addRule==Ac){Ag.addRule(B,F);
+}}else{if(Ag&&typeof
Ak.createTextNode!=AQ){Ag.appendChild(Ak.createTextNode(B+" {"+F+"}"));
+}}}function AX(A,C){if(!Ah){return ;
+}var B=C?"visible":"hidden";
+if(AK&&Ar(A)){Ar(A).style.visibility=B;
+}else{AY("#"+A,"visibility:"+B);
+}}function AI(B){var A=/[\\\"<>\.;]/;
+var C=A.exec(B)!=null;
+return C&&typeof encodeURIComponent!=AQ?encodeURIComponent(B):B;
+}var
Aq=function(){if(AH.ie&&AH.win){window.attachEvent("onunload",function(){var
A=AL.length;
+for(var B=0;
+B<A;
+B++){AL[B][0].detachEvent(AL[B][1],AL[B][2]);
+}var D=AG.length;
+for(var C=0;
+C<D;
+C++){AV(AG[C]);
+}for(var E in AH){AH[E]=null;
+}AH=null;
+for(var F in swfobject){swfobject[F]=null;
+}swfobject=null;
+});
+}}();
+return{registerObject:function(A,E,C,B){if(AH.w3&&A&&E){var D={};
+D.id=A;
+D.swfVersion=E;
+D.expressInstall=C;
+D.callbackFn=B;
+Af[Af.length]=D;
+AX(A,false);
+}else{if(B){B({success:false,id:A});
+}}},getObjectById:function(A){if(AH.w3){return AU(A);
+}},embedSWF:function(K,E,H,F,C,A,B,I,G,J){var D={success:false,id:E};
+if(AH.w3&&!(AH.wk&&AH.wk<312)&&K&&E&&H&&F&&C){AX(E,false);
+AJ(function(){H+="";
+F+="";
+var Q={};
+if(G&&typeof G===Ac){for(var O in G){Q[O]=G[O];
+}}Q.data=K;
+Q.width=H;
+Q.height=F;
+var N={};
+if(I&&typeof I===Ac){for(var P in I){N[P]=I[P];
+}}if(B&&typeof B===Ac){for(var L in B){if(typeof
N.flashvars!=AQ){N.flashvars+="&"+L+"="+B[L];
+}else{N.flashvars=L+"="+B[L];
+}}}if(AO(C)){var M=AZ(Q,N,E);
+if(Q.id==E){AX(E,true);
+}D.success=true;
+D.ref=M;
+}else{if(A&&AT()){Q.data=A;
+AE(Q,N,E,J);
+return ;
+}else{AX(E,true);
+}}if(J){J(D);
+}});
+}else{if(J){J(D);
+}}},switchOffAutoHideShow:function(){Ah=false;
+},ua:AH,getFlashPlayerVersion:function(){return{major:AH.pv[0],minor:AH.pv[1],release:AH.pv[2]};
+},hasFlashPlayerVersion:AO,createSWF:function(A,B,C){if(AH.w3){return
AZ(A,B,C);
+}else{return undefined;
+}},showExpressInstall:function(B,A,D,C){if(AH.w3&&AT()){AE(B,A,D,C);
+}},removeSWF:function(A){if(AH.w3){AV(A);
+}},createCSS:function(B,A,C,D){if(AH.w3){AY(B,A,C,D);
+}},addDomLoadEvent:AJ,addLoadEvent:Ab,getQueryParamValue:function(B){var
A=Ak.location.search||Ak.location.hash;
+if(A){if(/\?/.test(A)){A=A.split("?")[1];
+}if(B==null){return AI(A);
+}var C=A.split("&");
+for(var D=0;
+D<C.length;
+D++){if(C[D].substring(0,C[D].indexOf("="))==B){return
AI(C[D].substring((C[D].indexOf("=")+1)));
+}}}return"";
+},expressInstallCallback:function(){if(At){var A=Ar(AC);
+if(A&&Ai){A.parentNode.replaceChild(Ai,A);
+if(AD){AX(AD,true);
+if(AH.ie&&AH.win){Ai.style.display="block";
+}}if(AP){AP(AS);
+}}At=false;
+}}};
+}();
=======================================
--- /dev/null
+++
/exhibit/trunk/src/webapp/api/extensions/animation/animation-extension.js
Mon Nov 26 04:25:26 2012
@@ -0,0 +1,81 @@
+/*==================================================
+ * Simile Exhibit Animation Facet Extension
+ *==================================================
+ */
+
+(function() {
+ if (typeof(Exhibit)=="undefined")
+ alert("cannot load extensions before Exhibit");
+
+ var isCompiled = ("Exhibit_AnimationExtension_isCompiled" in window) &&
+ window.Exhibit_AnimationExtension_isCompiled;
+
+ Exhibit.AnimationExtension = {
+ params: {
+ bundle: true,
+ service: "none"
+ }
+ };
+
+ var javascriptFiles = [
+ "animation-facet.js",
+ "animation-inline.js" ,
+ "swfobject.js",
+ "animation-youtube.js" ,
+ "animation-slideshare.js"
+ ];
+ var cssFiles = [
+ "animation-facet.css"
+ ];
+
+ var paramTypes = { bundle: Boolean };
+ // Where is our base?
+ if (typeof Exhibit_AnimationExtension_urlPrefix == "string") {
+ // Check Exhibit_AnimationExtension_parameters
+ Exhibit.AnimationExtension.urlPrefix =
Exhibit_AnimationExtension_urlPrefix;
+ if ("Exhibit_AnimationExtension_parameters" in window) {
+ SimileAjax.parseURLParameters(Exhibit_AnimationExtension_parameters,
+ Exhibit.AnimationExtension.params,
+ paramTypes);
+ }
+ } else {
+ // Look for JS file
+ var url = SimileAjax.findScript(document, "/animation-extension.js");
+ if (url == null) {
+ SimileAjax.Debug.exception(new Error("Failed to derive URL prefix for
Simile Exhibit Animation Extension code files"));
+ return;
+ }
+ Exhibit.AnimationExtension.urlPrefix = url.substr(0,
url.indexOf("animation-extension.js"));
+ SimileAjax.parseURLParameters(url, Exhibit.AnimationExtension.params,
paramTypes);
+ }
+
+ var scriptURLs = [];
+ var cssURLs = [];
+
+ /*if ((Exhibit.AnimationExtension.params.service == "google") &&
+ !("google" in window && "maps" in
window.google)) {
+ scriptURLs.push("
http://maps.googleapis.com/maps/api/js?sensor=false");
+ } else if (Exhibit.AnimationExtension.params.service == "openlayers") {
+ scriptURLs.push("
http://www.openlayers.org/api/OpenLayers.js");
+
scriptURLs.push("
http://www.openstreetmap.org/openlayers/OpenStreetMap.js");
+ } else {
+
scriptURLs.push("
http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=5");
+ }*/
+
+ if (Exhibit.AnimationExtension.params.bundle) {
+ scriptURLs.push(Exhibit.AnimationExtension.urlPrefix
+ "animation-extension-bundle.js");
+ cssURLs.push(Exhibit.AnimationExtension.urlPrefix
+ "animation-extension-bundle.css");
+ } else {
+ SimileAjax.prefixURLs(scriptURLs, Exhibit.AnimationExtension.urlPrefix
+ "scripts/", javascriptFiles);
+ SimileAjax.prefixURLs(cssURLs, Exhibit.AnimationExtension.urlPrefix
+ "styles/", cssFiles);
+ }
+
+ for (var i = 0; i < Exhibit.locales.length; i++) {
+ scriptURLs.push(Exhibit.AnimationExtension.urlPrefix + "locales/" +
Exhibit.locales[i] + "/animation-locale.js");
+ };
+
+ if (!isCompiled) {
+ SimileAjax.includeJavascriptFiles(document, "", scriptURLs);
+ SimileAjax.includeCssFiles(document, "", cssURLs);
+ }
+})();
=======================================
--- /dev/null
+++
/exhibit/trunk/src/webapp/api/extensions/animation/scripts/animation-facet.js
Mon Nov 26 04:25:26 2012
@@ -0,0 +1,1008 @@
+/*==================================================
+ * Exhibit.AnimationFacet
+ *==================================================
+ */
+
+/* --------------------------------------------------------------------
+ * Constructor
+ * -------------------------------------------------------------------- */
+Exhibit.AnimationFacet = function(containerElmt, uiContext) {
+ this._div = containerElmt; // UI <div>
+ this._uiContext = uiContext;
+
+ this._expression = null; // Created from ex:expression using
Exhibit.ExpressionParser.parse()
+
+ // ---Mode---
+ // Facet can operate in three modes (see below).
+ this._mode = Exhibit.AnimationFacet.MODE_NONE;
+
+ // List mode : acts like a ListFacet, uses a structure (_listModePeriods)
+ // to set specific values at different periods.
+ this._listModePeriods = null; // When in list mode, which passages map
to which facet values { from:<sec> , to:<sec> select:[a,b,c] }
+ this._listModeCurrentPeriods = []; // Which periods are currently 'in
play'
+
+ // Range mode : acts like a SliderFacet, the _rangeModePrecision
determines how
+ // the data is grouped, and how often the facet changes value. So
precision of
+ // 100 will group data as 'centuries', and call _notifyCollection
accordingly.
+ // Data must be numberic.
+ this._rangeModePrecision = null; // When range mode, interval to group
values on
+ this._rangeModeMaxRange = {min:null , max:null}; // Max range,
lowered/raised to precision boundary
+ this._rangeModeCurrentRange = {min:null , max:null}; // Current value,
low/raise to prec. boundary
+
+ // Date mode : acts like range mode, except groups are based on days,
months
+ // or years. Data must be dates.
+ this._dateModeInterval = null;
+
+ this._settings = {}; // Settings from HTML
+
+ this._ui = null;
+
+ // _formatter = code from evaluating in _configure()
+ // _cache = list mode: cache of database, collection and expression
+ // _rangeIndex = used in range mode
+};
+
+/* --------------------------------------------------------------------
+ * Constants etc.
+ * -------------------------------------------------------------------- */
+
+// Date mode
+Exhibit.AnimationFacet.DAY = 'day';
+Exhibit.AnimationFacet.MONTH = 'month';
+Exhibit.AnimationFacet.YEAR = 'year';
+
+// Data filtering mode
+Exhibit.AnimationFacet.MODE_NONE = 0;
+Exhibit.AnimationFacet.MODE_LIST = 1;
+Exhibit.AnimationFacet.MODE_RANGE = 2;
+Exhibit.AnimationFacet.MODE_DATE = 3;
+
+// Debug
+Exhibit.AnimationFacet.DEBUG1 = false;
+
+//
http://www.opinionatedgeek.com/dotnet/tools/base64encode/
+Exhibit.AnimationFacet.PLAY_PNG
= "iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wDGw42NiWo9VwAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAADtJREFUKM+VjzEKACAAAu+i/3+5lpYgQgU3DxVgHUfyEbYFvqDBHFvgAhsAgEGpWWRNAdMG00mmH0yObCp4Bx5kUSOtAAAAAElFTkSuQmCC";
+Exhibit.AnimationFacet.PAUSE_PNG
= "iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wDGw43G3lsmGgAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAAB1JREFUKM9jZGBg+M+ACRihNIYcEwOJYFTDSNEAAI/YAhcjCBZEAAAAAElFTkSuQmCC";
+
+// Used to build unique function names for JavaScript timer
+Exhibit.AnimationFacet._getNextAnimationUnique = function() {
+ if(!Exhibit.AnimationFacet._animationCounter) {
+ Exhibit.AnimationFacet._animationCounter = 0;
+ }
+ var r = Exhibit.AnimationFacet._animationCounter;
+ Exhibit.AnimationFacet._animationCounter++;
+ return r;
+}
+
+/* ex:xxx attributes in HTML */
+Exhibit.AnimationFacet._settingSpecs = {
+ "facetLabel": { type: "text" },
+ "showLabel": { type: "boolean" , defaultValue: true },
+ "type": { type: "text", defaultValue: "default" },
+ "width": { type: "text" },
+ "height": { type: "text" },
+ "formatter": { type: "text", defaultValue: null}, // FIXME: keep this in?
+ "startTime": { type: "int", defaultValue: 0 }, // FIXME: unsupported
+ "duration": { type: "int", defaultValue: 60 }
+};
+// selections List mode <struct>
+// precision Range mode <int>
+// datePrecision Date mode ["year"|"month"|"day"]
+// expression
+
+
+/* --------------------------------------------------------------------
+ * Creation, configure and dispose.
+ * -------------------------------------------------------------------- */
+
+/**
+ * Manufacture object.
+ */
+Exhibit.AnimationFacet.create = function(configuration, containerElmt,
uiContext) {
+ if(Exhibit.AnimationFacet.DEBUG1)
console.log('create',configuration,containerElmt,uiContext);
+
+ var uiContext = Exhibit.UIContext.create(configuration, uiContext);
+ var facet = new Exhibit.AnimationFacet(containerElmt, uiContext);
+
+ Exhibit.AnimationFacet._configure(facet, configuration);
+
+ facet._initializeUI();
+ uiContext.getCollection().addFacet(facet);
+
+ return facet;
+};
+
+/**
+ * Create facet using <div>'s attributes.
+ * configElmt = <div>
+ */
+Exhibit.AnimationFacet.createFromDOM = function(configElmt, containerElmt,
uiContext) {
+ if(Exhibit.AnimationFacet.DEBUG1)
console.log('createFromDOM',configElmt,containerElmt,uiContext);
+
+ // Look for ex:configuration in <div>, otherwise returns {} (empty Object)
+ // FIXME: Legacy code?
+ /*var configuration = Exhibit.getConfigurationFromDOM(configElmt);*/
+ // Create Exhibit context for this facet
+ var uiContext = Exhibit.UIContext.createFromDOM(configElmt, uiContext);
+ // Create facet
+ var facet = new Exhibit.AnimationFacet(
+ containerElmt != null ? containerElmt : configElmt,
+ uiContext
+ );
+
+ // Use _settingSpecs to extract _settings from <div>. As the UI gets a
+ // chance to extend this with bespoke settings, don't pass in the
original...
+ /*var ss = {}
+ for(var k in Exhibit.AnimationFacet._settingSpecs) {
+ ss[k] = Exhibit.AnimationFacet._settingSpecs[k]
+ }
+ facet._ui.extendSettingSpecs(ss); // Want to add some more..?
+ Exhibit.SettingsUtilities.collectSettingsFromDOM(configElmt, ss,
facet._settings);*/
+ Exhibit.SettingsUtilities.collectSettingsFromDOM(configElmt,
Exhibit.AnimationFacet._settingSpecs, facet._settings);
+
+ // Configure using ex:xxx attrs in <div>
+ try {
+ // Parse ex:expression to _expression
+ var expressionString = Exhibit.getAttribute(configElmt, "expression");
+ if (expressionString != null && expressionString.length > 0) {
+ facet._expression = Exhibit.ExpressionParser.parse(expressionString);
+ }
+ if(facet._expression == null) {
+ SimileAjax.Debug.exception(e2, "AnimationFacet: no expression
specified; using .label");
+ facet._expression = '.label';
+ }
+
+ // List mode
+ var selections = Exhibit.getAttribute(configElmt, "selections");
+ if(selections!=null && selections.length>0) {
+ try {
+ facet._listModePeriods = eval(selections);
+ facet._mode = Exhibit.AnimationFacet.MODE_LIST;
+ } catch(e2) {
+ SimileAjax.Debug.exception(e2, "AnimationFacet: Selections needs to be
valid JSON structure");
+ }
+ } else {
+ // ex:selectionSequence
+ try {
+ var sequence = Exhibit.getAttribute(configElmt, "selectionSequence");
+ var dur = facet._settings.duration;
+ if(!dur) { dur = 60; }
+ if(sequence!=null && sequence.length>0) {
+ var a = sequence.split(',');
+ var b = [];
+ var d = Math.floor(dur/a.length);
+ for(var i=0;i<a.length;i++) {
+ b.push({
+ from: i*d ,
+ to: i*d+d ,
+ select: [ $.trim(a[i]) ]
+ });
+ }
+ }
+ facet._listModePeriods = b;
+ facet._mode = Exhibit.AnimationFacet.MODE_LIST;
+ } catch(e2) {
+ SimileAjax.Debug.exception(e2, "AnimationFacet: Selection sequence or
duration is invalid");
+ }
+ }
+ // Range mode
+ var precision = Exhibit.getAttribute(configElmt,"precision");
+ if(precision!=null && precision.length>0) {
+ try {
+ facet._rangeModePrecision = parseInt(precision);
+ facet._mode = Exhibit.AnimationFacet.MODE_RANGE;
+ } catch(e2) {
+ SimileAjax.Debug.exception(e2, "AnimationFacet: Precision needs to be
integer");
+ }
+ }
+ // Date mode
+ var datePrecision = Exhibit.getAttribute(configElmt,"datePrecision");
+ if(datePrecision!=null && datePrecision.length>0) {
+ try {
+ var arr = [
Exhibit.AnimationFacet.DAY,Exhibit.AnimationFacet.MONTH,Exhibit.AnimationFacet.YEAR
];
+ for(var i=0;i<arr.length;i++) {
+ if(datePrecision.toLowerCase() == arr[i]) {
+ facet._dateModeInterval = arr[i];
+ facet._mode = Exhibit.AnimationFacet.MODE_DATE;
+ }
+ }
+ } catch(e2) {
+ SimileAjax.Debug.exception(e2, "AnimationFacet: Date precision needs
to be year, month or day");
+ }
+ }
+ // Error?
+ if(facet._mode == Exhibit.AnimationFacet.MODE_NONE) {
+ SimileAjax.Debug.exception(e2, "AnimationFacet: need to define either
ex:selections, ex:precision or ex:datePrecision");
+ }
+ } catch (e) {
+ SimileAjax.Debug.exception(e, "AnimationFacet: Error processing
configuration of animation facet");
+ }
+ // Apply _settings
+ // FIXME: configuration appears to be legacy code.
+ Exhibit.AnimationFacet._configure(facet/*, configuration*/);
+
+ facet._initializeUI();
+ uiContext.getCollection().addFacet(facet);
+
+ return facet;
+};
+
+/**
+ * Configure facet using ex:configuration object returned by
Exhibit.getConfigurationFromDOM() .
+ */
+Exhibit.AnimationFacet._configure = function(facet, configuration) {
+ if(Exhibit.AnimationFacet.DEBUG1)
console.log('_configure',facet,configuration);
+
+ // Use _settingSpecs to extract _settings from configuration object
(created from ex:configuration)
+ // FIXME: is this legacy code, or is ex:configuration still a valid attr?
+ /*Exhibit.SettingsUtilities.collectSettings(configuration,
Exhibit.AnimationFacet._settingSpecs, facet._settings);*/
+
+ // FIXME: Why is this needed? 'configuration' is a JSON structure in
ex:configuration.
+ // Surely other ex:xxx attrs are better?
+ /*if ("expression" in configuration) {
+ facet._expression =
Exhibit.ExpressionParser.parse(configuration.expression);
+ }
+ if ("selection" in configuration) {
+ var selection = configuration.selection;
+ for (var i = 0; i < selection.length; i++) {
+ facet._valueSet.add(selection[i]);
+ }
+ }*/
+
+ // If facetLabel is missing, try to use ex:expression
+ if (!("facetLabel" in facet._settings)) {
+ facet._settings.facetLabel = "Animation facet";
+ if (facet._expression != null && facet._expression.isPath()) {
+ var segment = facet._expression.getPath().getLastSegment();
+ var property =
facet._uiContext.getDatabase().getProperty(segment.property);
+ if (property != null) {
+ facet._settings.facetLabel = segment.forward ? property.getLabel() :
property.getReverseLabel();
+ }
+ }
+ }
+
+ if ("formatter" in facet._settings) {
+ var formatter = facet._settings.formatter;
+ if (formatter != null && formatter.length > 0) {
+ try {
+ facet._formatter = eval(formatter);
+ } catch (e) {
+ SimileAjax.Debug.log(e);
+ }
+ }
+ }
+
+ // Mode specific config
+ if(facet._mode == Exhibit.AnimationFacet.MODE_LIST) {
+ // Create cache based on database, collection and expression
+ facet._cache = new Exhibit.FacetUtilities.Cache(
+ facet._uiContext.getDatabase(),
+ facet._uiContext.getCollection(),
+ facet._expression
+ );
+ } else if(facet._mode == Exhibit.AnimationFacet.MODE_RANGE) {
+ // Put min down, and max up, to precision boundaries.
+ var r;
+ var database = facet._uiContext.getDatabase();
+ if(facet._expression.getPath()){
+ var path = facet._expression.getPath();
+ var propertyID = path.getLastSegment().property;
+ var property = database.getProperty(propertyID);
+ r = property.getRangeIndex();
+ } else {
+ var expression = facet._expression;
+ r = new Exhibit.Database._RangeIndex(
+ facet._uiContext.getCollection().getAllItems(),
+ function(item, f) {
+ expression.evaluateOnItem(item,database).values.visit(
+ function(value) {
+ if(typeof value != "number") { value = parseFloat(value); }
+ if(!isNaN(value)) { f(value); }
+ }
+ );
+ }
+ );
+ }
+ facet._rangeModeMaxRange = {
+ min: facet._minRangePrecision(r.getMin()) ,
+ max: facet._maxRangePrecision(r.getMax())
+ };
+ // Build range index (FIXME: can this be optimised into above?)
+ var database = facet._uiContext.getDatabase();
+ var getter = function(item, f) {
+ facet._expression.evaluateOnItem(item,
database).values.visit(function(value) {
+ if (typeof value != "number") { value = parseFloat(value); }
+ if (!isNaN(value)) { f(value); }
+ });
+ };
+ facet._rangeIndex = new Exhibit.Database._RangeIndex(
+ facet._uiContext.getCollection().getAllItems(),
+ getter
+ );
+ } else if(facet._mode == Exhibit.AnimationFacet.MODE_DATE) {
+ }
+}
+
+/**
+ * Free resources.
+ */
+Exhibit.AnimationFacet.prototype.dispose = function() {
+ if(Exhibit.AnimationFacet.DEBUG1) console.log('dispose');
+
+ this._ui.dispose();
+
+ if(this._cache) {
+ this._cache.dispose();
+ this._cache = null;
+ }
+ if(this._rangeIndex) {
+ this._rangeIndex = null;
+ }
+
+ this._uiContext.getCollection().removeFacet(this);
+ this._uiContext = null;
+
+ this._div.innerHTML = "";
+ this._div = null;
+
+ this._expression = null;
+ this._settings = null;
+
+ this._listModePeriods = null;
+ this._listModeCurrentPeriods = null;
+ this._listModeValueSet = null;
+ this._rangeModeMaxRange = null;
+ this._rangeModeCurrentRange = null;
+};
+
+/* --------------------------------------------------------------------
+ * Filter and restrict.
+ * -------------------------------------------------------------------- */
+
+/**
+ * Called when Exhibit is re-evaluating. True usually triggers a
+ * call to restrict(), otherwise straight to update().
+ */
+Exhibit.AnimationFacet.prototype.hasRestrictions = function() {
+ if(Exhibit.AnimationFacet.DEBUG1) console.log('hasRestrictions');
+
+ if(this._mode == Exhibit.AnimationFacet.MODE_LIST) {
+ return this._listModeCurrentPeriods.length > 0;
+ } else if(this._mode == Exhibit.AnimationFacet.MODE_RANGE) {
+ var min = (this._rangeModeCurrentRange.min!=null &&
this._rangeModeCurrentRange.min!=this._rangeModeMaxRange.min);
+ var max = (this._rangeModeCurrentRange.max!=null &&
this._rangeModeCurrentRange.max!=this._rangeModeMaxRange.max);
+ return (min||max);
+ } else if(this._mode == Exhibit.AnimationFacet.MODE_DATE) {
+ // TODO
+ return false;
+ } else {
+ return false;
+ }
+};
+
+/**
+ * If hasRestrictions() is true, this is called to perform filtering.
+ * Typically update() is called after this.
+ */
+Exhibit.AnimationFacet.prototype.restrict = function(items) {
+ if(Exhibit.AnimationFacet.DEBUG1) console.log('restrict',items);
+
+ if(this._mode == Exhibit.AnimationFacet.MODE_LIST) {
+ // Build list of items based on periods currently 'selected'
+ if (this._listModeCurrentPeriods.length == 0) {
+ return items;
+ } else {
+ var valueSet = new Exhibit.Set();
+ for(var i=0;i<this._listModeCurrentPeriods.length;i++) {
+ var p = this._listModeCurrentPeriods[i];
+ for(var j=0;j<p.select.length;j++) { valueSet.add(p.select[j]); }
+ }
+ return this._cache.getItemsFromValues(valueSet, items);
+ }
+ } else if(this._mode == Exhibit.AnimationFacet.MODE_RANGE) {
+ var min = this._rangeModeCurrentRange.min;
+ var max = this._rangeModeCurrentRange.max;
+ if(this._expression.isPath()){
+ var path = this._expression.getPath();
+ var database = this._uiContext.getDatabase();
+ // Ret: { valueType:'item'|prop value type , values:Exhibit.Set ,
count:set.size }
+ return path.rangeBackward(min,max , false, items, database).values; //
max,min,inclusive,filter,database
+ } else {
+ // Ret: Exhibit.Set
+ return this._rangeIndex.getSubjectsInRange(min,max , false, null,
items);
+ }
+ } else if(this._mode == Exhibit.AnimationFacet.MODE_DATE) {
+ // TODO
+ }
+};
+
+/**
+ * Clear restrictions.
+ */
+Exhibit.AnimationFacet.prototype.clearAllRestrictions = function() {
+ if(Exhibit.AnimationFacet.DEBUG1) console.log('clearAllRestrictions');
+ Exhibit.AnimationFacet.testRemoteLog();
+
+ // Remember current settings, so we can return them
+ if(this.hasRestrictions()) {
+ if(this._mode == Exhibit.AnimationFacet.MODE_LIST) {
+ this._listModeCurrentPeriods = [];
+ } else if(this._mode == Exhibit.AnimationFacet.MODE_RANGE) {
+ this._rangeModeCurrentRange.min = this._rangeModeMaxRange.min;
+ this._rangeModeCurrentRange.max = this._rangeModeMaxRange.max;
+ }
+
+ // Record pre for logging
+ var preUpdateSize = SimileAjax.RemoteLog.logActive ?
this._uiContext.getCollection().countRestrictedItems() : 0;
+ // Update collection
+ this._notifyCollection();
+ // Record post for logging
+ var postUpdateSize = SimileAjax.RemoteLog.logActive ?
this._uiContext.getCollection().countRestrictedItems() : 0;
+ var totalSize = SimileAjax.RemoteLog.logActive ?
this._uiContext.getCollection().countAllItems() : 0;
+
+ SimileAjax.RemoteLog.possiblyLog({
+ facetType:"AnimationFacet",
+ facetLabel:this._settings.facetLabel,
+ operation:"clearAllRestrictions",
+ exhibitSize:totalSize,
+ preUpdateSize:preUpdateSize,
+ postUpdateSize:postUpdateSize
+ });
+ }
+};
+
+/**
+ * Add values to current filter.
+ * restrictions: list of values to add to current filter
+ */
+Exhibit.AnimationFacet.prototype.applyRestrictions =
function(restrictions) {
+ /*
+ if(Exhibit.AnimationFacet.DEBUG1)
console.log('applyRestrictions',restrictions);
+ Exhibit.AnimationFacet.testRemoteLog();
+
+ // Rememeber for logging
+ var oldRestrictionSize = SimileAjax.RemoteLog.logActive ?
this._valueSet.size() : 0;
+
+ this._valueSet = new Exhibit.Set();
+ for (var i = 0; i < restrictions.selection.length; i++) {
+ this._valueSet.add(restrictions.selection[i]);
+ }
+ this._selectMissing = restrictions.selectMissing;
+
+ // Record pre for logging
+ var newRestrictionSize = SimileAjax.RemoteLog.logActive ?
this._valueSet.size() : 0;
+ var preUpdateSize = SimileAjax.RemoteLog.logActive ?
this._uiContext.getCollection().countRestrictedItems() : 0;
+ // Update collection
+ this._notifyCollection();
+ // Record post for logging
+ var postUpdateSize = SimileAjax.RemoteLog.logActive ?
this._uiContext.getCollection().countRestrictedItems() : 0;
+ var totalSize = SimileAjax.RemoteLog.logActive ?
this._uiContext.getCollection().countAllItems() : 0;
+
+ var restricted = "";
+ if (newRestrictionSize > 0) {
+ arr = Array();
+ for (k in this._valueSet._hash) {
+ arr.push(k);
+ }
+ restricted = arr.join("##");
+ }
+
+ SimileAjax.RemoteLog.possiblyLog({
+ facetType:"AnimationFacet",
+ facetLabel:this._settings.facetLabel,
+ operation:"applyRestrictions",
+ exhibitSize:totalSize,
+ selectedValues:restricted,
+ preUpdateSize:preUpdateSize,
+ postUpdateSize:postUpdateSize,
+ oldRestrictionSize:oldRestrictionSize,
+ newRestrictionSize:newRestrictionSize
+ });
+ */
+};
+
+/**
+ * Add or remove a selection value.
+ */
+Exhibit.AnimationFacet.prototype.setSelection = function(value, selected) {
+ /*if(Exhibit.AnimationFacet.DEBUG1)
console.log('setSelection',value,selected);
+ Exhibit.AnimationFacet.testRemoteLog();
+
+ var oldRestrictionSize = SimileAjax.RemoteLog.logActive ?
this._valueSet.size() : 0;
+
+ if (selected) {
+ this._valueSet.add(value);
+ } else {
+ this._valueSet.remove(value);
+ }
+
+ var newRestrictionSize = SimileAjax.RemoteLog.logActive ?
this._listModeValueSet.size() : 0;
+ var preUpdateSize = SimileAjax.RemoteLog.logActive ?
this._uiContext.getCollection().countRestrictedItems() : 0;
+ this._notifyCollection();
+ var postUpdateSize = SimileAjax.RemoteLog.logActive ?
this._uiContext.getCollection().countRestrictedItems() : 0;
+ var totalSize = SimileAjax.RemoteLog.logActive ?
this._uiContext.getCollection().countAllItems() : 0;
+
+ var restricted = "";
+ if (newRestrictionSize > 0) {
+ arr = Array();
+ for (k in this._valueSet._hash) {
+ arr.push(k);
+ }
+ restricted = arr.join("##");
+ }
+
+ SimileAjax.RemoteLog.possiblyLog({
+ facetType:"AnimationFacet",
+ facetLabel:this._settings.facetLabel,
+ operation:"setSelection",
+ value:value,
+ selected:selected,
+ exhibitSize:totalSize,
+ selectedValues:restricted,
+ preUpdateSize:preUpdateSize,
+ postUpdateSize:postUpdateSize,
+ oldRestrictionSize:oldRestrictionSize,
+ newRestrictionSize:newRestrictionSize
+ });*/
+}
+
+
+/**
+ * Update UI.
+ */
+Exhibit.AnimationFacet.prototype.update = function(items) {
+ if(Exhibit.AnimationFacet.DEBUG1) console.log('update',items);
+ //this._updateMarkers(this._computeFacetListMode(items));
+};
+
+/*Exhibit.AnimationFacet.prototype._computeFacetListMode = function(items)
{
+ var database = this._uiContext.getDatabase();
+ var r = this._cache.getValueCountsFromItems(items);
+ var entries = r.entries;
+
+ // FIXME: This entries structure is ultimately passed to _updateMarkers,
which
+ // expects a Exhibit.Set -- fudge it by adding necessary functions.
+ entries.contains = function(v) {
+ for(var i=0;i<this.length;i++) {
+ if(this[i].value == v) { return true; }
+ }
+ return false;
+ }
+ entries.size = function() {
+ return this.length;
+ }
+
+ return entries;
+}*/
+
+
+Exhibit.AnimationFacet.prototype._notifyCollection = function() {
+ if(Exhibit.AnimationFacet.DEBUG1) console.log('_notifyCollection');
+ this._uiContext.getCollection().onFacetUpdated(this);
+};
+
+/** Build UI. */
+Exhibit.AnimationFacet.prototype._initializeUI = function() {
+ if(Exhibit.AnimationFacet.DEBUG1) console.log('_initializeUI');
+
+ // Create UI implementation.
+ switch(this._settings['type']) {
+ case 'youtube' :
+ this._ui = new
Exhibit.AnimationFacet.YouTube(this);
+ break;
+ case 'slideshare' :
+ this._ui = new Exhibit.AnimationFacet.SlideShare(this);
+ break;
+ case 'inline' :
+ this._ui = new Exhibit.AnimationFacet.Inline(this);
+ break;
+ case 'default' : default:
+ this._ui = new Exhibit.AnimationFacet.DefaultUI(this);
+ break;
+ }
+ // Playback expression
+ this._ui.setDuration(this._settings.duration);
+
+ var html = this._ui.initUI(); // Create
+ $(this._div).html(html); // Install
+ this._ui.postInitUI(); // Post install
+}
+
+/** Clear restrictions, spawned as thread. */
+Exhibit.AnimationFacet.prototype._clearSelections = function() {
+ if(Exhibit.AnimationFacet.DEBUG1) console.log('_clearSelections');
+ var state = {};
+ var self = this;
+ SimileAjax.History.addLengthyAction(
+ function() { state.restrictions = self.clearAllRestrictions(); },
+ function() { self.applyRestrictions(state.restrictions); },
+ String.substitute(
+ Exhibit.FacetUtilities.l10n["facetClearSelectionsActionTitle"],
+ [ this._settings.facetLabel ])
+ );
+};
+
+/*
+Exhibit.AnimationFacet.prototype.exportFacetSelection = function() {
+ if(Exhibit.AnimationFacet.DEBUG1) console.log('exportFacetSelection');
+ var s = [];
+ this._valueSet.visit(function(v) {
+ s.push(v);
+ });
+ if (s.length > 0) {
+ return s.join(',');
+ }
+};
+Exhibit.AnimationFacet.prototype.importFacetSelection = function(settings)
{
+ var self = this;
+
+ self.applyRestrictions({ selection: settings.split(','), selectMissing:
self._selectMissing });
+}
+
+/* This is a hack to enable facet for work in 2.2.0 */
+Exhibit.AnimationFacet.testRemoteLog = function() {
+ if(!SimileAjax['RemoteLog']) {
+ SimileAjax.RemoteLog = { logActive: false }
+ SimileAjax.RemoteLog.possiblyLog = function(a) {}
+ }
+}
+
+/* Accepts secs from slider; figures out if _notifyCollection must be
+ called to update Exhibit. */
+Exhibit.AnimationFacet.prototype.updateModeParams = function(secs) {
+ // Build set from values in periods covering 'secs' time
+ if(this._mode == Exhibit.AnimationFacet.MODE_LIST) {
+ // console.log('++ List mode');
+ // Work through _listModePeriods, looking for matches
+ var periods = [];
+ for(var i=0;i<this._listModePeriods.length;i++) {
+ var p = this._listModePeriods[i];
+ if(secs>=p.from && secs<
p.to) { periods.push(p); }
+ }
+ // Do we need to notify collection (triggering a fresh restriction?)
+ var rebuild = false;
+ if(periods.length != this._listModeCurrentPeriods.length) {
+ rebuild=true;
+ } else {
+ for(var i=0;i<this._listModeCurrentPeriods.length;i++) {
+ if(periods[i] != this._listModeCurrentPeriods[i]) {
+ rebuild=true;
+ break;
+ }
+ }
+ }
+ // console.log(periods,rebuild);
+ if(rebuild) {
+ this._listModeCurrentPeriods = periods;
+ this._notifyCollection();
+ }
+ } else if(this._mode == Exhibit.AnimationFacet.MODE_RANGE) {
+ // Translate secs into value within range
+ var rng = this._rangeModeMaxRange.max - this._rangeModeMaxRange.min;
+ var pos = secs / this._ui.getDuration();
+ var val = Math.floor(this._rangeModeMaxRange.min + rng*pos);
+ // Translate val into lower and upper bound, using precision
+ var min = this._minRangePrecision(val);
+ var max = this._maxRangePrecision(val);
+ if(this._rangeModeCurrentRange.min!=min ||
this._rangeModeCurrentRange.max!=max) {
+ this._rangeModeCurrentRange.min = min;
+ this._rangeModeCurrentRange.max = max;
+ this._notifyCollection();
+ }
+ } else if(this._mode == Exhibit.AnimationFacet.MODE_DATE) {
+ // TODO
+ }
+}
+/*Exhibit.AnimationFacet.prototype._updateMarkers = function(vset) {
+ var d = this._ui.getDuration();
+ var w = $(this._dom.shaft).width();
+ var toPixels = function(secs) { return Math.floor((w/d) * secs); }
+ var h = '';
+ var showAll = vset.size()==0;
+ switch(this._mode) {
+ case Exhibit.AnimationFacet.MODE_LIST :
+ for(var i=0;i<this._listModePeriods.length;i++) {
+ var s = this._listModePeriods[i];
+ for(var j=0;j<s.select.length;j++) {
+ if(showAll || vset.contains(s.select[j])) {
+ h = h + '<div style="position:Absolute; left:'+toPixels(s.from)+'px;
width:'+toPixels(s.to-s.from)+'px;"></div>';
+ break;
+ }
+ }
+ }
+ break;
+ case Exhibit.AnimationFacet.MODE_RANGE :
+ break;
+ case Exhibit.AnimationFacet.MODE_DATE :
+ break;
+ }
+ $(this._dom.markers).empty().append(h);
+}*/
+
+/* Lower value (inc neg) to range boundary, using precision. */
+Exhibit.AnimationFacet.prototype._minRangePrecision = function(v) {
+ var pr = this._rangeModePrecision; // Say pr=100 ...
+ v -= ((v>=0) ? v%pr : pr-Math.abs(v%pr)); // ... -5 becomes -100, 5
becomes 0
+ return v;
+}
+/* Raise value (inc neg) to range boundary, using precision. */
+Exhibit.AnimationFacet.prototype._maxRangePrecision = function(v) {
+ var pr = this._rangeModePrecision; // Say pr=100 ...
+ v += ((v>=0) ? pr-v%pr : Math.abs(v%pr)); // ... -5 becomes 0, 5 becomes
100
+ return v;
+}
+
+/*
+ * Label object.
+ * Different modes label the standard time bar in different ways.
+ * config:
+ * base - the numbering system doesn't have to start at 0
+ * (useful for slideshare, where slides labeled from 1 not 0)
+ * secs - flag, false means numbers formated as mm:ss
+ * inclusiveBounds - upper label shifted down to become inclusive
+ * end time rather than duration (so 3:00 becames 2:59). Handy
+ * for slideshare where upper label should be last slide number.
+ */
+Exhibit.AnimationFacet.Labels = function(facet,secs,config) {
+ if(facet._mode == Exhibit.AnimationFacet.MODE_LIST) {
+ if(config == undefined) {
+ config = { base:0 , showAsSeconds:false , inclusiveBounds:false };
+ }
+ var f = (config.showAsSeconds) ?
+ function(secs) {
+ return secs + config.base;
+ } :
+ function(secs) {
+ var m = Math.floor(secs/60);
+ var s = Math.ceil(secs%60);
+ return m+':'+(s<10?'0':'')+s;
+ };
+ this.timeLabel = f(secs);
+ this.lowerLabel = f(0);
+ this.upperLabel = f(facet._ui.getDuration() -
(config.inclusiveBounds?1:0) );
+ } else if(facet._mode == Exhibit.AnimationFacet.MODE_RANGE) {
+ var rng = facet._rangeModeMaxRange.max - facet._rangeModeMaxRange.min;
+ var pos = secs / facet._ui.getDuration();
+ this.timeLabel = Math.floor(facet._rangeModeMaxRange.min + rng*pos);
+ this.lowerLabel = facet._rangeModeMaxRange.min;
+ this.upperLabel = facet._rangeModeMaxRange.max;
+ //} else if(facet._mode == Exhibit.AnimationFacet.MODE_DATE) {
+ } else {
+ this.timeLabel = '?';
+ this.lowerLabel = 'Lower';
+ this.upperLabel = 'Upper';
+ }
+}
+
+/* --------------------------------------------------------------------
+ * Default UI
+ * -------------------------------------------------------------------- */
+
+/** Constructor. */
+Exhibit.AnimationFacet.DefaultUI = function(facet) {
+ this._duration = 0; // Duration, from _settings (in seconds)
+ this._dom = null; // Handy DOM bits inside <div>
+ this._facet = facet; // Parent
+
+ this._currentTimePosition = 0;
+
+ this._animationStartTime = 0; // Millis when animation began (or
restarted on drag)
+ this._animationStartPosition = 0; // Pixels
+ this._animationFrameDelay = 100; // Animate every 250 millis
+ this._animationPlaying = false; // Playing or paused?
+ this._dragging = false; // Thumb being dragged?
+ // Timed callback: odd behaviour using setInterval(obj.func) -- func is
called
+ // with 'this' set to 'window' not 'obj'. This is a work around.
+ this._animationGlueFunc
= '__animation_glue__'+Exhibit.AnimationFacet._getNextAnimationUnique();
+ var self = this;
+ Exhibit.AnimationFacet.DefaultUI[this._animationGlueFunc] = function() {
+ self._animate();
+ }
+}
+
+/** Destructor. */
+Exhibit.AnimationFacet.DefaultUI.prototype.dispose = function() {
+ this._dom = null;
+}
+
+/** This is called to give UI's the ability to extend _settingSpecs. */
+/*Exhibit.AnimationFacet.DefaultUI.prototype.extendSettingSpecs =
function(specs) {
+}*/
+
+/** Set duration, in seconds. Impl's can ignore this, if they get their
duration from media. */
+Exhibit.AnimationFacet.DefaultUI.prototype.setDuration = function(secs) {
+ this._duration = secs;
+}
+
+/** Duration, in seconds. */
+Exhibit.AnimationFacet.DefaultUI.prototype.getDuration = function() {
+ return this._duration;
+}
+
+/** Initialise UI, returning HTML. This HTML is then displayed, and
postInitUI() called. */
+Exhibit.AnimationFacet.DefaultUI.prototype.initUI = function() {
+ var labels = new Exhibit.AnimationFacet.Labels(this._facet,0);
+
+ // Build UI
+ var settings = this._facet._settings;
+ var cssHeight = settings['height'] ? '
height:'+settings['height'] : '10px';
+ var html =
+ '<div>'+
+ '<div class="exhibit-facet-header" style="position:Relative;">'+
+ '<span class="exhibit-facet-header-filterControl"
style="position:Absolute; display:Inline-Block; vertical-align:Middle;
right:0px; top:0px; text-align:Right; white-space:NoWrap;">'+ // FIXME:
width should be inherit, if not for IE8 bug
+ '<span class="exhibit-facet-animation-button"></span> '+
+ '<input type="checkbox" class="exhibit-facet-animation-tickbox" />'+
+ '</span>'+
+ ((settings['showLabel']) ? '<span
class="exhibit-facet-header-title">'+settings['facetLabel']+'</span>' : '')+
+ '</div>'+
+ '<div class="exhibit-facet-animation-shaft-container">'+
+ '<div class="exhibit-facet-animation-shaft" style="position:Relative;
width:100%;'+cssHeight+'">'+
+ '<div class="exhibit-facet-animation-shaft-markers"
style="'+cssHeight+'"></div>'+
+ '<div class="exhibit-facet-animation-shaft-thumb"
style="position:Absolute;'+cssHeight+'"></div>'+
+ '</div>'+
+ '</div>'+
+ '<div class="exhibit-facet-animation-labels" style="position:Relative;
height:1em;">'+
+ '<div style="position:Absolute;
left:0px;">'+labels.lowerLabel+'</div>'+
+ '<div style="position:Absolute;
right:0px;">'+labels.upperLabel+'</div>'+
+ '<div class="exhibit-facet-animation-labels-time"
style="text-align:Center"></div>'+
+ '</div>'+
+ '</div>';
+
+ // Build node, and store handy refs inside structure
+ var el = $(html);
+ this._dom = {
+ elmt: el.get()[0] ,
+ shaft: $('.exhibit-facet-animation-shaft',el).get()[0] ,
+ thumb: $('.exhibit-facet-animation-shaft-thumb',el).get()[0] ,
+ time: $('.exhibit-facet-animation-labels-time',el).get()[0] ,
+ button: $('.exhibit-facet-animation-button',el).get()[0] ,
+ tickbox: $('input.exhibit-facet-animation-tickbox',el).get()[0] ,
+ markers: $('.exhibit-facet-animation-shaft-markers',el).get()[0]
+ };
+
+ // UI event code starts
+ var self = this;
+ $(this._dom.shaft) // Attach mouse down to shaft
+ .mousedown(function(ev) {
+ if(ev.which==1) {
+ ev.preventDefault();
+ self._dragging = true;
+ }
+ });
+ $(document) // Attach movement and up to document as a whole
+ .mousemove(function(ev) {
+ if(self._dragging && ev.which==1) {
+ ev.preventDefault();
+ var x = ev.pageX - $(self._dom.shaft).offset().left;
+ self._updateThumbUI(x,false);
+ }
+ })
+ .mouseup(function(ev) {
+ if(self._dragging && ev.which==1) {
+ ev.preventDefault();
+ var x = ev.pageX - $(self._dom.shaft).offset().left;
+ if(!self._updateThumbUI(x,true)) { // true if x off end of shaft
+ self._animationStartTime = (new Date()).getTime();
+ self._animationStartPosition = x;
+ }
+ self._dragging = false;
+ }
+ });
+ // Tickbox -- activate or deactivate filtering
+ $(this._dom.tickbox).click(function(ev) {
+ var $this = $(this);
+ if($this.attr('checked')) {
+ self._facet.updateModeParams(self._currentTimePosition);
+ } else {
+ self._facet.clearAllRestrictions();
+ }
+ });
+ // UI event code ends
+ this._showPlayButton(true);
+ // Install;
+ //$(this._facet._div).html(this._dom.elmt);
+ return this._dom.elmt;
+}
+
+/** Some UIs may need to do some work after the HTML is displayed on page.
*/
+Exhibit.AnimationFacet.DefaultUI.prototype.postInitUI = function() {
+ this._updateThumbUI(0,false);
+}
+
+/* Show either play or pause button. */
+Exhibit.AnimationFacet.DefaultUI.prototype._showPlayButton = function(b) {
+ var self = this;
+ $(this._dom.button).html(
+ '<img src="data:image/png;base64,'+
+ Exhibit.AnimationFacet[b?'PLAY_PNG':'PAUSE_PNG']+
+ '" />'
+ );
+ $('img',this._dom.button).click(
+ b ?
+ function(ev) { self._animateStart(); } :
+ function(ev) { self._animateStop(); }
+ );
+ // Tickbox
+ $(this._dom.tickbox).attr('disabled',!b);
+}
+/* Update UI, and possibly cause Exhibit to re-evaluate. */
+Exhibit.AnimationFacet.DefaultUI.prototype._updateThumbUI =
function(x,considerRestrict) {
+ // Update thumb position
+ var w = $(this._dom.shaft).width();
+ var ended = (x>w-1);
+ x = (x<0) ? 0 : x; // Lower bound
+ x = (x>w-1) ? w-1 : x; // Upper bound
+ var th = $(this._dom.thumb);
+ th.css('left',(x-th.width()/2)+'px');
+ // What's the time (mister wolf)..?
+ this._currentTimePosition = Math.floor(this._duration * (x/w*1.0));
+ var labels = new
Exhibit.AnimationFacet.Labels(this._facet,this._currentTimePosition);
+ $(this._dom.time).html(labels.timeLabel);
+ // Look into possibly updating exhibit
+ if(considerRestrict) {
+ this._facet.updateModeParams(this._currentTimePosition);
+ // Update tickbox
+
$(this._dom.tickbox).attr('checked',this._facet.hasRestrictions()?'checked':'');
+ }
+ return ended;
+}
+
+/** Start animation. */
+Exhibit.AnimationFacet.DefaultUI.prototype._animateStart = function() {
+ this._animationPlaying = true;
+ this._animationStartTime = (new Date()).getTime();
+ this._animationStartPosition =
+ ($(this._dom.thumb).offset().left) - // Thumb
+ ($(this._dom.shaft).offset().left) + // Shaft
+ ($(this._dom.thumb).width()/2); // Middle of thumb
+ this._showPlayButton(false);
+
setTimeout('Exhibit.AnimationFacet.DefaultUI.'+this._animationGlueFunc+"()",this._animationFrameDelay);
+}
+/** Stop/pause animation. */
+Exhibit.AnimationFacet.DefaultUI.prototype._animateStop = function() {
+ this._animationPlaying = false;
+ this._showPlayButton(true);
+}
+/** Timed function called to animate. */
+Exhibit.AnimationFacet.DefaultUI.prototype._animate = function() {
+ // Where should the thumb be this frame?
+ var timeElapsed = (new Date()).getTime()-this._animationStartTime;
+ var sh_w = $(this._dom.shaft).width();
+ var pixelsPerMillisecond = sh_w/(this._duration*1000.0);
+ var distanceTravelled = timeElapsed * pixelsPerMillisecond;
+ var pos = this._animationStartPosition + distanceTravelled;
+ var ended = false;
+ // Don't to timer update of UI if dragging thumb
+ if(!this._dragging) {
+ ended = this._updateThumbUI(pos,true);
+ }
+ // If thumb didn't hit end of shaft, schedule next timer event
+ if(this._animationPlaying) {
+ if(!ended) {
+
setTimeout('Exhibit.AnimationFacet.DefaultUI.'+this._animationGlueFunc+"()",this._animationFrameDelay);
+ } else {
+ this._animateStop();
+ this._updateThumbUI(0,false);
+ this._facet.clearAllRestrictions();
+ }
+ }
+}
+
+
+/* --------------------------------------------------------------------
+ * Debug
+ * -------------------------------------------------------------------- */
+
+Exhibit.AnimationFacet.__augment = function(obj) {
+ for(var f in obj) {
+ if(f.indexOf('_X_')>=0) { continue; }
***The diff for this file has been truncated for email.***
=======================================
--- /dev/null
+++
/exhibit/trunk/src/webapp/api/extensions/animation/scripts/animation-inline.js
Mon Nov 26 04:25:26 2012
@@ -0,0 +1,214 @@
+/* --------------------------------------------------------------------
+ * Default UI
+ * -------------------------------------------------------------------- */
+
+Exhibit.AnimationFacet._settingSpecs['inlineshowplay'] = {
type:"boolean" , defaultValue:true };
+Exhibit.AnimationFacet._settingSpecs['inlinemodernstyle'] = {
type:"boolean" , defaultValue:false };
+
+/** Constructor. */
+Exhibit.AnimationFacet.Inline = function(facet) {
+ this._duration = 0; // Duration, from _settings (in seconds)
+ this._dom = null; // Handy DOM bits inside <div>
+ this._facet = facet; // Parent
+
+ this._animationStartTime = 0; // Millis when animation began (or
restarted on drag)
+ this._animationStartPosition = 0; // Pixels
+ this._animationFrameDelay = 100; // Animate every 250 millis
+ this._animationPlaying = false; // Playing or paused?
+ this._dragging = false; // Thumb being dragged?
+ // JavaScript timers need come code to eval, making it hard to point to
functions
+ // inside specific objects. Create a unique function at
Exhibit.AnimationFacet
+ // level, and use it to redirect timer calls.
+ this._animationGlueFunc
= '__animation_glue__'+Exhibit.AnimationFacet._getNextAnimationUnique();
+ var self = this;
+ Exhibit.AnimationFacet.Inline[this._animationGlueFunc] = function() {
+ self._animate();
+ }
+}
+
+//
http://www.opinionatedgeek.com/dotnet/tools/base64encode/
+Exhibit.AnimationFacet.Inline.PLAY_PNG
= "iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAAXNSR0IArs4c6QAAAAZiS0dEAMkAyQDJYYDmDgAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wJBw06OtKSuKQAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAAVxJREFUKM+dk89KAlEUxn83fAxh3qSFT+HONrlyE25mV+3O20T0D6KEQgwtC5mNJCLq6KhMiuhCZ+Fp4U0TRKy7ufcc+H3ng/NdRORCRA75xzEiovadA85d133eFz4ASCaTxOPxBPAkIo/7OokBOI6D4zg0m03y+XzC9/2EiOSAU9d18zttZ7PZjWar1aJQKNDpdAAegbNtIkZENJPJ2Mp21WCAdrtFsVQiCAKAB+uksAGnj9NrEECXQvbC933K5TL9fh/g3jp5MSKiR6nUilmpGgMoqmCskN/2qVQqhGEIcBIDmEfRehwKan7cY4But4vneQyHQ4A7u9LiEp7NwSib3iEIAqrVKqPRCODWQqWNVUXR3E4y6EIZDAbUap+Mx2OAGwu9bt3zLIpgoYRfIfV6nclkor+gt50h6fd6NBoNptOpAtcWKu+VMM/zFLiy0Pu+2Y4Blxb6+Ouv+gZldbw7tlbjQQAAAABJRU5ErkJggg==";
+Exhibit.AnimationFacet.Inline.PAUSE_PNG
= "iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAAXNSR0IArs4c6QAAAAZiS0dEAMkAyQDJYYDmDgAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wJBw4TAryQIYgAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAAP9JREFUKM99kt1xg0AMhD95aCHjspxuoASoybzThtNFbO1FebgfYAzWw83N7Wm10srGcQxOYhgG+4R3AH3fvwHTNLX7Gd4BpPQHnBYgpQQYEOXcVJYcyqNtOMZxJOMiCAx7l+2ekysYtlfh7phRqq9xqcxJwuW4HEkAfN9urbK7kDvy/G+tLLVettxf12tLXkcSRJZRem6y61wy6K9nTnY14rC1964xH8Tv85VJisxDn+XKom0v/ufxWKdd4NjgOTk5UXqyjZPLslCtjMhYGNTPxSrxKc7wS5UtCVexo8xgGIbWc8VcanvRrMLidENTmTbsF6UDmOf7R9n3eT58/wfel7gwBDKMLAAAAABJRU5ErkJggg==";
+Exhibit.AnimationFacet.Inline.THUMB_PNG
= "iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAAXNSR0IArs4c6QAAAAZiS0dEAMwAzADM38FfGgAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wIFAsaGOk3cJEAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAAgpJREFUKM+dkz9OG0EYxX8zOxvJiMiDwQYbS4QQ2lRIMQoSDRAuwAFSUeQCewSuQJUDcISUSLELKsoAKeKVRdaWEVpEpJ1/KXaxUJQ0mW70vd8370lvBH+ck5OTj8ARsAU0gClwAZwlSfL5uVY8g94Cp0DvzeYmGxuvaTZbTMZjbm6+c3X1DWAAHCdJcjmDK/CL1rq1836HzmoHFUUIKQFwzjEajTg/P+fu7i4D9pMkuZTVw6da69b+wQEr7RWiKEKpmDiOiZVCRYp2u83hh0O01q3KIVGV8dPu7i6NhQZRHBEphVKKOH6BEBBCIPiAkAKt61xfX3f39vZ+SOBobe0Vi4uLBIAAVGLnLd5DCB5fTllaarK+vg5wJIGtbneV4EMp8h7nHNZZTGEwpsA5h3cO78t5t9sF2FJAo16v47xDOomQorRKQCIJhHKhtbMFekEDNBQwnU6nzdpcrYQBPMjII4SoUgS8c1jncM4xmUwAphK4SNMUZx3WWIy1GGswxlCYorReFBhjsNZinSUdpgAXEjhL05TxZFzmNBZjSvgp8+xuDNnPjOFwCHD2VJL+y/n53rvtHnO1OYSURELO+hdCmfvx1yOD/oA8zwdJkmw/leQ4f3jIBv0BWZZhi8qyMRRFgSkKsiyj/7VPnucZcPzPbnc6HZaXl9Fac39/z+3tLaPR6O/d/t9f9RsoTTP4+32UigAAAABJRU5ErkJggg==";
+Exhibit.AnimationFacet.Inline.SHAFT_PNG
= "iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAAXNSR0IArs4c6QAAAAZiS0dEAIgAiACIdJABBgAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wIFAsiBOqpkCUAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAAbZJREFUKM+dk81uGjEUhT+PPd3WDT8TKBLQNG/ArpHYTJM8Eo/AQ7FDKqRpXqAhVdCgERqqUETSxQy2s5iBkDbNond1fe1zjn3uteCP6Pf7/Ct6vd6ztXgJ9PH4mKOjD1QqVX4uFtzc/OD6+vtfJGIfqLXm5NMJ9fd1lJQIzwPAGEMcxwyHQ5bL5Y7A27Jprfl8esph7RApJUr5+L6PrxRKKmq1Gudn52itdzeQW9Vut8vBuwOkL5FKoZTC998gBDjncNYhPIHWb5lMJoRhmCs3my1KpRIOwAHFYWM3WAvOWWy+S7lcod1uA6AAN53eMp3e8nq4fX9zcBAEhe8CnCtcFLmOcOAEooDmiWNbUK12C+GeuHcnd4htnlO6vS6ri/GFaDQadDodlFRIJZFS4nneDuScxVqLMYaN2XD59ZIoilAAs9mMZqtJpVzBOoe1NgdvX1vUjDEsFguiKMpbNRgMCMOQX3dLqkEVKSW2cNvaJ0VjDA+/H7j6dkWaps+HZH1/z3g0JkkSNmlGmqVkWUaapmRpSpIkjL6MWK/Xr892vV4nCAK01qxWK+bzOXEcvzzb//urHgE3adNcFxKl0AAAAABJRU5ErkJggg==";
+
+/** Destructor. */
+Exhibit.AnimationFacet.Inline.prototype.dispose = function() {
+ this._dom = null;
+}
+
+/** This is called to give UI's the ability to extend _settingSpecs. */
+/*Exhibit.AnimationFacet.Inline.prototype.extendSettingSpecs =
function(specs) {
+}*/
+
+/** Set duration, in seconds. Impl's can ignore this, if they get their
duration from media. */
+Exhibit.AnimationFacet.Inline.prototype.setDuration = function(secs) {
+ this._duration = secs;
+}
+
+/** Duration, in seconds. */
+Exhibit.AnimationFacet.Inline.prototype.getDuration = function() {
+ return this._duration;
+}
+
+/** Initialise UI, returning HTML. This HTML is then displayed, and
postInitUI() called. */
+Exhibit.AnimationFacet.Inline.prototype.initUI = function() {
+ var labels = new Exhibit.AnimationFacet.Labels(this._facet,0);
+
+ // Build UI
+ var settings = this._facet._settings;
+ var showPlay = settings['inlineshowplay'];
+ var html = null;
+ if(!settings['inlinemodernstyle']) {
+ var cssWidth = settings['width'] ? '
width:'+settings['width']+';' : 'width:100px;';
+ var cssHeight = settings['height'] ? '
height:'+settings['height']+';' : ' height:10px;';
+ var html =
+ '<span>'+
+ ((showPlay) ? '<span
class="exhibit-facet-animation-button"></span>' : '')+
+ '<div style="display:Inline-Block; margin-left:5px;
margin-right:5px;'+cssWidth+'"
class="exhibit-facet-animation-shaft-container">'+
+ '<div class="exhibit-facet-animation-shaft" style="position:Relative;
width:100%;'+cssHeight+'">'+
+ '<div class="exhibit-facet-animation-shaft-thumb"
style="position:Absolute;'+cssHeight+'"></div>'+
+ '</div>'+
+ '</div>'+
+ '</span>';
+ } else {
+ var cssWidth = settings['width'] ? '
width:'+settings['width']+';' : 'width:100px;';
+ var _1 =
+ "border:None; height:15px; "+
+
"background-image:url(data:image/png;base64,"+Exhibit.AnimationFacet.Inline.SHAFT_PNG+"); "+
+ "background-repeat:Repeat-X;";
+ var _2 =
+ "border:None; width:15px; height:15px; "+
+
"background-image:url(data:image/png;base64,"+Exhibit.AnimationFacet.Inline.THUMB_PNG+"); "
+
+ "background-repeat:None;";
+ var html =
+ '<span>'+
+ ((showPlay) ? '<span
class="exhibit-facet-animation-button"></span>' : '')+
+ '<div style="display:Inline-Block; border:None; margin-left:8px;
margin-right:8px;'+cssWidth+'"
class="exhibit-facet-animation-shaft-container">'+
+ '<div class="exhibit-facet-animation-shaft" style="position:Relative;
width:100%; '+_1+'">'+
+ '<div class="exhibit-facet-animation-shaft-thumb"
style="position:Absolute; '+_2+'"></div>'+
+ '</div>'+
+ '</div>'+
+ '</span>';
+ }
+
+ // Build node, and store handy refs inside structure
+ var el = $(html);
+ this._dom = {
+ elmt: el.get()[0] ,
+ shaft: $('.exhibit-facet-animation-shaft',el).get()[0] ,
+ thumb: $('.exhibit-facet-animation-shaft-thumb',el).get()[0] ,
+ button: $('.exhibit-facet-animation-button',el).get()[0]
+ };
+
+ // UI event code starts
+ var self = this;
+ $(this._dom.shaft) // Attach mouse down to shaft
+ .mousedown(function(ev) {
+ if(ev.which==1) {
+ ev.preventDefault();
+ self._dragging = true;
+ }
+ });
+ $(document) // Attach movement and up to document as a whole
+ .mousemove(function(ev) {
+ if(self._dragging && ev.which==1) {
+ ev.preventDefault();
+ var x = ev.pageX - $(self._dom.shaft).offset().left;
+ self._updateThumbUI(x,false);
+ }
+ })
+ .mouseup(function(ev) {
+ if(self._dragging && ev.which==1) {
+ ev.preventDefault();
+ var x = ev.pageX - $(self._dom.shaft).offset().left;
+ if(!self._updateThumbUI(x,true)) { // true if x off end of shaft
+ self._animationStartTime = (new Date()).getTime();
+ self._animationStartPosition = x;
+ }
+ self._dragging = false;
+ }
+ });
+ // UI event code ends
+ this._showPlayButton(true);
+ // Install;
+ //$(this._facet._div).html(this._dom.elmt);
+ return this._dom.elmt;
+}
+
+/** Some UIs may need to do some work after the HTML is displayed on page.
*/
+Exhibit.AnimationFacet.Inline.prototype.postInitUI = function() {
+ this._updateThumbUI(0,false);
+}
+
+/* Show either play or pause button. */
+Exhibit.AnimationFacet.Inline.prototype._showPlayButton = function(b) {
+ var self = this;
+ var obj = (this._facet._settings['inlinemodernstyle']) ?
Exhibit.AnimationFacet.Inline : Exhibit.AnimationFacet;
+ $(this._dom.button).html(
+ '<img src="data:image/png;base64,' + obj[b?'PLAY_PNG':'PAUSE_PNG'] + '"
/>'
+ );
+ $('img',this._dom.button).click(
+ b ?
+ function(ev) { self._animateStart(); } :
+ function(ev) { self._animateStop(); }
+ );
+}
+/* Update UI, and possibly cause Exhibit to re-evaluate. */
+Exhibit.AnimationFacet.Inline.prototype._updateThumbUI =
function(x,considerRestrict) {
+ // Update thumb position
+ var w = $(this._dom.shaft).width();
+ var ended = (x>w-1);
+ x = (x<0) ? 0 : x; // Lower bound
+ x = (x>w-1) ? w-1 : x; // Upper bound
+ var th = $(this._dom.thumb);
+ th.css('left',(x-th.width()/2)+'px');
+ // What's the time (mister wolf)..?
+ var t = Math.floor(this._duration * (x/w*1.0));
+ // Look into possibly updating exhibit
+ if(considerRestrict) {
+ this._facet.updateModeParams(t);
+ }
+ return ended;
+}
+
+/** Start animation. */
+Exhibit.AnimationFacet.Inline.prototype._animateStart = function() {
+ this._animationPlaying = true;
+ this._animationStartTime = (new Date()).getTime();
+ this._animationStartPosition =
+ ($(this._dom.thumb).offset().left) - // Thumb
+ ($(this._dom.shaft).offset().left) + // Shaft
+ ($(this._dom.thumb).width()/2); // Middle of thumb
+ this._showPlayButton(false);
+
setTimeout('Exhibit.AnimationFacet.Inline.'+this._animationGlueFunc+"()",this._animationFrameDelay);
+}
+/** Stop/pause animation. */
+Exhibit.AnimationFacet.Inline.prototype._animateStop = function() {
+ this._animationPlaying = false;
+ this._showPlayButton(true);
+}
+/** Timed function called to animate. */
+Exhibit.AnimationFacet.Inline.prototype._animate = function() {
+ // Where should the thumb be this frame?
+ var timeElapsed = (new Date()).getTime()-this._animationStartTime;
+ var sh_w = $(this._dom.shaft).width();
+ var pixelsPerMillisecond = sh_w/(this._duration*1000.0);
+ var distanceTravelled = timeElapsed * pixelsPerMillisecond;
+ var pos = this._animationStartPosition + distanceTravelled;
+ var ended = false;
+ // Don't to timer update of UI if dragging thumb
+ if(!this._dragging) {
+ ended = this._updateThumbUI(pos,true);
+ }
+ // If thumb didn't hit end of shaft, schedule next timer event
+ if(this._animationPlaying) {
+ if(!ended) {
+
setTimeout('Exhibit.AnimationFacet.Inline.'+this._animationGlueFunc+"()",this._animationFrameDelay);
+ } else {
+ this._animateStop();
+ this._updateThumbUI(0,false);
+ this._facet.clearAllRestrictions();
+ }
+ }
+}
=======================================
--- /dev/null
+++
/exhibit/trunk/src/webapp/api/extensions/animation/scripts/animation-slideshare.js
Mon Nov 26 04:25:26 2012
@@ -0,0 +1,195 @@
+/*==================================================
+ * Exhibit.AnimationFacet, SlideShare
+ *==================================================
+ */
+
+/*
+ * Note: the current version of the Slideshare JavaScript API has no
support
+ * for events, meaning polling is required to find out when the current
slide
+ * had changed.
+ * Note 2: at this time, there does not appear to be an approved way to
use the
+ * HTML5 SlideShare player in this way.
+ */
+
+Exhibit.AnimationFacet._settingSpecs['sswidth'] = { type:"int" ,
defaultValue:598 };
+Exhibit.AnimationFacet._settingSpecs['ssheight'] = { type:"int" ,
defaultValue:480 };
+Exhibit.AnimationFacet._settingSpecs['ssslides'] = { type:"text" ,
defaultValue:"simile-exhibit-vgsom-12312308" };
+Exhibit.AnimationFacet._settingSpecs['sslabelfromone'] = {
type:"boolean" , defaultValue:false };
+Exhibit.AnimationFacet._settingSpecs['ssshowtrack'] = { type:"boolean" ,
defaultValue:true };
+
+/** Constructor. */
+Exhibit.AnimationFacet.SlideShare = function(facet) {
+ this._duration = -1; // Duration, from slides
+ this._facet = facet; // Parent
+
+ this._playerId
= "ExhibitAnimationFacetSlideShare__slideshare__"+Exhibit.AnimationFacet._getNextAnimationUnique();
// ID of this player
+ this._playerObj = null; // SlideShare player object
+ this._lastSlide = -1; // Keep track of the last slide shown
+
+ this._$tickbox = null;
+ this._hideTickbox = false;
+
+ this._animationFrameDelay = 100; // Animate every 250 millis
+ this._animationPlaying = false; // Playing or paused?
+ // JavaScript timers need come code to eval, making it hard to point to
functions
+ // inside specific objects. Create a unique function at
Exhibit.AnimationFacet
+ // level, and use it to redirect timer calls.
+ var fn
= '__animation_glue__'+Exhibit.AnimationFacet._getNextAnimationUnique();
+ this._animationGlueFunc = 'Exhibit.AnimationFacet.SlideShare.'+fn+'()';
+ var self = this;
+ Exhibit.AnimationFacet.SlideShare[fn] = function() {
+ self._animate();
+ }
+}
+
+// Map individual instances of player by ID, so this can be found in
non-object scope
+Exhibit.AnimationFacet.SlideShare._mapVideoObjectToPlayerId = {};
+
+/** Destructor. */
+Exhibit.AnimationFacet.SlideShare.prototype.dispose = function() {
+ this._facet = null;
+ this._playerObj = null;
+ this._playerId = null;
+}
+
+/** Set duration, in seconds. Impl's can ignore this, if they get their
duration from media. */
+Exhibit.AnimationFacet.SlideShare.prototype.setDuration = function(secs) {}
+
+/** Duration, in seconds (really 'slides'). */
+Exhibit.AnimationFacet.SlideShare.prototype.getDuration = function() {
+ if(this._duration < 0) {
+ var c = this._playerObj.getCurrentSlide();
+ this._playerObj.last();
+ this._duration = this._playerObj.getCurrentSlide();
+ this._playerObj.jumpTo(c);
+ }
+ return this._duration;
+}
+
+/** Initialise UI, returning HTML. This HTML is then displayed, and
postInitUI() called. */
+Exhibit.AnimationFacet.SlideShare.prototype.initUI = function() {
+ var settings = this._facet._settings;
+ // If the label isn't displayed, the tickbox will appear over the YT
video itself. So
+ // make it disappear when not enabled.
+ this._hideTickbox = !settings['showLabel'];
+
+ var html =
+ '<span style="display:Inline-Block; position:Relative;">'+
+ '<input type="checkbox" class="exhibit-facet-animation-tickbox" '+
+ 'style="display:Block; position:Absolute; right:0px; top:0px;" />'+
+ '<div class="exhibit-facet-header">'+
+ ((settings['showLabel']) ? '<span
class="exhibit-facet-header-title">'+settings['facetLabel']+'</span>' : '')+
+ '</div>'+
+ '<div style="width:'+settings['sswidth']+'px;
height:'+settings['ssheight']+'px;">'+
+ '<div id="'+this._playerId+'"></div>'+
+ '</div>'+
+
+ (settings['ssshowtrack'] ?
+ '<div style="width:'+settings['sswidth']+'px;">'+
+ '<div class="exhibit-facet-animation-bar-container">'+
+ '<div class="exhibit-facet-animation-bar" style="position:Relative;
width:0px;">'+
+ /*'<div class="exhibit-facet-animation-shaft-markers"
style="'+cssHeight+'"></div>'+*/
+ '</div>'+
+ '</div>'+
+ '<div class="exhibit-facet-animation-labels"
style="position:Relative; height:1em;">'+
+ '<div style="position:Absolute; left:0px;">—</div>'+
+ '<div style="position:Absolute; right:0px;">—</div>'+
+ '<div class="exhibit-facet-animation-labels-time"
style="text-align:Center"></div>'+
+ '</div>'+
+ '</div>'
+ :'') +
+ '</span>';
+ $el = $(html);
+
+ // Tickbox
+ var self = this;
+ this._$tickbox =
$($('input.exhibit-facet-animation-tickbox',$el).get()[0]);
+ if(!settings['showLabel']) {
this._$tickbox.css('right','5px').css('top','5px').css('margin','0px'); }
+ this._$tickbox.click(function(ev) {
+ var $this = $(this);
+ if($this.attr('checked')) {
+ self._facet.updateModeParams(self._playerObj.getCurrentSlide()-1); //
Starts at 1, so deduct 1
+ } else {
+ self._facet.clearAllRestrictions();
+ }
+ });
+
+ return $el;
+}
+
+/** Some UIs may need to do some work after the HTML is displayed on page.
*/
+Exhibit.AnimationFacet.SlideShare.prototype.postInitUI = function() {
+ var settings = this._facet._settings;
+ var self = this;
+
+ var ssURL = '
http://static.slidesharecdn.com/swf/ssplayer2.swf';
+ var flashVars = {
+ doc: settings['ssslides'] ,
+ startSlide: 1 ,
+ rel: 0
+ };
+ swfobject.embedSWF(
+ ssURL,
+ this._playerId, // Div ID
+ settings['sswidth'], settings['ssheight'], // Width, height
+ "8", // Flash version
+ null, // Express install SWF (optional)
+ flashVars, // FlashVars (optional)
+ { allowScriptAccess: "always" ,
+ wmode: 'transparent' ,
+ allowfullscreen: 'true' }, // Params for embedSWF Flash code
+ { id: this._playerId } , // Attrs for embedSWF HTML code
+ function(ev) {
+ if(ev.success) {
+ // Kick off update 'thread'
+ self._playerObj = $('#'+self._playerId).get()[0];
+ setTimeout(self._animationGlueFunc,self._animationFrameDelay);
+ } else {
+ // Failure
+ }
+ }
+ );
+
Exhibit.AnimationFacet.SlideShare._mapVideoObjectToPlayerId[this._playerId]
= this;
+}
+
+/** Timed function called to animate. */
+Exhibit.AnimationFacet.SlideShare.prototype._animate = function() {
+ if(this._playerObj.getCurrentSlide) {
+ var slide = this._playerObj.getCurrentSlide()-1; // Starts at 1, so
deduct 1
+ if(slide != this._lastSlide) {
+ this._lastSlide = slide;
+ this._updateLabels(slide);
+ this._facet.updateModeParams(slide);
+
this._$tickbox.attr('checked',this._facet.hasRestrictions()?'checked':'');
+ }
+ } else {
+ }
+ setTimeout(this._animationGlueFunc,this._animationFrameDelay);
+}
+
+Exhibit.AnimationFacet.SlideShare.prototype._updateLabels = function(secs)
{
+ if(!this._facet._settings['ssshowtrack']) { return; }
+
+ var dur = this.getDuration();
+ if(dur==0) { return; }
+
+ var config = {
+ base: this._facet._settings['sslabelfromone'] ,
+ showAsSeconds:true ,
+ inclusiveBounds:true
+ };
+ var labels = new
Exhibit.AnimationFacet.Labels(this._facet,Math.floor(secs),config);
+ var labs = $('.exhibit-facet-animation-labels
div',this._facet._div).each(function(idx) {
+ switch(idx) {
+ case 0: $(this).html(labels.lowerLabel); break;
+ case 1: $(this).html(labels.upperLabel); break;
+ case 2: $(this).html(labels.timeLabel); break;
+ }
+ });
+
+ var barCon = $('.exhibit-facet-animation-bar-container',this._facet._div);
+ var bar = $('.exhibit-facet-animation-bar',barCon);
+ var w = barCon.width(); // Pixels width
+ var r = (1.0 * w / dur); // Pixels per second of duration
+ bar.css('width',Math.floor(secs*r)+'px');
+}
=======================================
--- /dev/null
+++
/exhibit/trunk/src/webapp/api/extensions/animation/scripts/animation-youtube.js
Mon Nov 26 04:25:26 2012
@@ -0,0 +1,234 @@
+/*==================================================
+ * Exhibit.AnimationFacet, YouTube
+ *==================================================
+ */
+
+Exhibit.AnimationFacet._settingSpecs['ytwidth'] = { type:"int" ,
defaultValue:280 };
+Exhibit.AnimationFacet._settingSpecs['ytheight'] = { type:"int" ,
defaultValue:170 };
+Exhibit.AnimationFacet._settingSpecs['ytvideo'] = { type:"text" ,
defaultValue:"ILGK83V6h9s" };
+Exhibit.AnimationFacet._settingSpecs['ytshowtrack'] = { type:"boolean" ,
defaultValue:true };
+
+/** Constructor. */
+
Exhibit.AnimationFacet.YouTube = function(facet) {
+ this._duration = 0; // Duration, from _settings (in seconds)
+ this._facet = facet; // Parent
+
+ this._playerId
= "__youtube__"+Exhibit.AnimationFacet._getNextAnimationUnique(); // ID of
this player
+ this._divId = "ExhibitAnimationFacetYouTube"+this._playerId; // <div> to
inject player into
+ this._playerObj = null; // YouTube player object
+
+ this._$tickbox = null;
+ this._hideTickbox = false;
+
+ this._animationFrameDelay = 100; // Animate every 250 millis
+ this._animationPlaying = false; // Playing or paused?
+ // JavaScript timers need come code to eval, making it hard to point to
functions
+ // inside specific objects. Create a unique function at
Exhibit.AnimationFacet
+ // level, and use it to redirect timer calls.
+ var fn
= '__animation_glue__'+Exhibit.AnimationFacet._getNextAnimationUnique();
+ this._animationGlueFunc = 'Exhibit.AnimationFacet.YouTube.'+fn+'()';
+ var self = this;
+
Exhibit.AnimationFacet.YouTube[fn] = function() {
+ self._animate();
+ }
+}
+
+/* YouTube constants. */
+Exhibit.AnimationFacet.YouTube.YT_UNSTARTED = -1;
+Exhibit.AnimationFacet.YouTube.YT_ENDED = 0;
+Exhibit.AnimationFacet.YouTube.YT_PLAYING = 1;
+Exhibit.AnimationFacet.YouTube.YT_PAUSED = 2;
+Exhibit.AnimationFacet.YouTube.YT_BUFFERING = 3;
+Exhibit.AnimationFacet.YouTube.YT_CUED = 5;
+
+// Map individual instances of player by ID, so this can be found in
non-object scope
+Exhibit.AnimationFacet.YouTube._mapVideoObjectToPlayerId = {};
+
+/** Destructor. */
+Exhibit.AnimationFacet.YouTube.prototype.dispose = function() {
+ this._facet = null;
+ this._playerObj = null;
+ this._divId = null;
+ this._playerId = null;
+}
+
+// 560x340 640x385 853x505 1280x745
+
+/** Set duration, in seconds. Impl's can ignore this, if they get their
duration from media. */
+Exhibit.AnimationFacet.YouTube.prototype.setDuration = function(secs) {}
+
+/** Duration, in seconds. */
+Exhibit.AnimationFacet.YouTube.prototype.getDuration = function() {
+ return this._playerObj.getDuration();
+}
+
+/** Initialise UI, returning HTML. This HTML is then displayed, and
postInitUI() called. */
+Exhibit.AnimationFacet.YouTube.prototype.initUI = function() {
+ //var labels = new Exhibit.AnimationFacet.Labels(this._facet,0);
+ var settings = this._facet._settings;
+ // If the label isn't displayed, the tickbox will appear over the YT
video itself. So
+ // make it disappear when not enabled.
+ this._hideTickbox = !settings['showLabel'];
+
+ var html =
+ '<span style="display:Inline-Block; position:Relative;">'+
+ '<input type="checkbox" class="exhibit-facet-animation-tickbox" '+
+ 'style="display:Block; position:Absolute; right:0px; top:0px;" />'+
+ '<div class="exhibit-facet-header">'+
+ ((settings['showLabel']) ? '<span
class="exhibit-facet-header-title">'+settings['facetLabel']+'</span>' : '')+
+ '</div>'+
+ '<div style="width:'+settings['ytwidth']+'px;
height:'+settings['ytheight']+'px;">'+
+ '<div id="'+this._divId+'"></div>'+
+ '</div>'+
+
+ (settings['ytshowtrack'] ?
+ '<div style="width:'+settings['ytwidth']+'px;">'+
+ '<div class="exhibit-facet-animation-bar-container">'+
+ '<div class="exhibit-facet-animation-bar" style="position:Relative;
width:0px;">'+
+ /*'<div class="exhibit-facet-animation-shaft-markers"
style="'+cssHeight+'"></div>'+*/
+ '</div>'+
+ '</div>'+
+ '<div class="exhibit-facet-animation-labels"
style="position:Relative; height:1em;">'+
+ '<div style="position:Absolute; left:0px;">—</div>'+
+ '<div style="position:Absolute; right:0px;">—</div>'+
+ '<div class="exhibit-facet-animation-labels-time"
style="text-align:Center"></div>'+
+ '</div>'+
+ '</div>'
+ :'') +
+ '</span>';
+ $el = $(html);
+
+ // Tickbox
+ var self = this;
+ this._$tickbox =
$($('input.exhibit-facet-animation-tickbox',$el).get()[0]);
+ if(!settings['showLabel']) {
this._$tickbox.css('right','5px').css('top','5px').css('margin','0px'); }
+ this._$tickbox.click(function(ev) {
+ var $this = $(this);
+ if($this.attr('checked')) {
+ self._facet.updateModeParams(self._playerObj.getCurrentTime());
+ } else {
+ self._facet.clearAllRestrictions();
+ }
+ });
+
+ return $el;
+}
+
+/** Some UIs may need to do some work after the HTML is displayed on page.
*/
+Exhibit.AnimationFacet.YouTube.prototype.postInitUI = function() {
+ var settings = this._facet._settings;
+
+ var ytURL = '
http://www.youtube.com/v/';
+ swfobject.embedSWF(
+ ytURL+
+ settings['ytvideo']+ // ID of YouTube video
+ "?version=3"+ // V3 of API
+ "&enablejsapi=1"+ // Allow script access
+ "&title=Video+facet"+ // Title banner
+ "&autohide=2"+ // Show or hide controls?
+ "&color=white"+ // Progress bar colour
+ "&egm=0"+ // Enhanced genie menu?
+ "&border=0"+ // Border around player?
+ "&iv_load_policy=3"+ // Show annotations? (1=yes, 3=no)
+ "&modestbranding=1"+ // Show YouTube logo?
+ //"&probably_logged_in=0"+ // Get rid of 'watch later' button
+ "&rel=0"+ // Load related vidoes?
+ "&showinfo=0"+ // Show info before start (title)
+ "&fs=0"+ // Full screen allowed?
+ "&playerapiid="+this._playerId, // Player ID
+ this._divId, // Div ID
+ settings['ytwidth'], settings['ytheight'], // Width, height
+ "8", // Flash version
+ null, // Express install SWF (optional)
+ null, // FlashVars (optional)
+ { allowScriptAccess: "always" ,
+ wmode: 'transparent' ,
+ allowfullscreen: 'true' }, // Params for embedSWF Flash code
+ { id: this._playerId } // Attrs for embedSWF HTML code
+ );
+ Exhibit.AnimationFacet.YouTube._mapVideoObjectToPlayerId[this._playerId]
= this;
+}
+
+/** Timed function called to animate. */
+Exhibit.AnimationFacet.YouTube.prototype._animate = function() {
+ if(this._animationPlaying) {
+ this._update();
+ setTimeout(this._animationGlueFunc,this._animationFrameDelay);
+ }
+}
+
+/** Events end up here (see onYouTubePlayerReady()). */
+Exhibit.AnimationFacet.YouTube.prototype._onStateChange = function(state) {
+ switch(state) {
+ case Exhibit.AnimationFacet.YouTube.YT_PLAYING :
+ //this._animationLastTime = (new Date()).getTime();
+ this._animationPlaying = true;
+ this._disableTickbox(true);
+ this._update();
+ setTimeout(this._animationGlueFunc,this._animationFrameDelay);
+ break;
+ case Exhibit.AnimationFacet.YouTube.YT_PAUSED :
+ this._animationPlaying = false;
+ this._disableTickbox(false);
+ this._update();
+ break;
+ case Exhibit.AnimationFacet.YouTube.YT_ENDED :
+ this._animationPlaying = false;
+ this._disableTickbox(false);
+ this._updateLabels(0);
+ this._facet.clearAllRestrictions();
+ break;
+ }
+}
+
+Exhibit.AnimationFacet.YouTube.prototype._disableTickbox = function(b) {
+ this._$tickbox.attr('disabled',b);
+ if(this._hideTickbox) {
+ this._$tickbox.css('display',(b?'None':'Inline'));
+ }
+}
+
+Exhibit.AnimationFacet.YouTube.prototype._update = function(secs) {
+ var secs = (secs==undefined) ? this._playerObj.getCurrentTime() : secs;
+ this._updateLabels(secs);
+ this._facet.updateModeParams(secs);
+ this._$tickbox.attr('checked',this._facet.hasRestrictions()?'checked':'');
+}
+
+Exhibit.AnimationFacet.YouTube.prototype._updateLabels = function(secs) {
+ if(!this._facet._settings['ytshowtrack']) { return; }
+
+ var dur = this.getDuration();
+ if(dur==0) { return; }
+
+ var labels = new
Exhibit.AnimationFacet.Labels(this._facet,Math.floor(secs));
+ var labs = $('.exhibit-facet-animation-labels
div',this._facet._div).each(function(idx) {
+ switch(idx) {
+ case 0: $(this).html(labels.lowerLabel); break;
+ case 1: $(this).html(labels.upperLabel); break;
+ case 2: $(this).html(labels.timeLabel); break;
+ }
+ });
+
+ var barCon = $('.exhibit-facet-animation-bar-container',this._facet._div);
+ var bar = $('.exhibit-facet-animation-bar',barCon);
+ var w = barCon.width(); // Pixels width
+ var r = (1.0 * w / dur); // Pixels per second of duration
+ bar.css('width',Math.floor(secs*r)+'px');
+}
+
+/**
+ * Called by YT when video player is ready. Creates a redirect for
+ * event handling callbacks.
+ */
+function onYouTubePlayerReady(pid) {
+ var self = Exhibit.AnimationFacet.YouTube._mapVideoObjectToPlayerId[pid];
+ // Redirect Exhibit.AnimationFacet.YouTube.__EVENT_HANDLER__<pid>() to
obj._onStateChange()
+ // Create a new function which redirects to a prototype function.
+ var n = '__EVENT_HANDLER__'+pid;
+
Exhibit.AnimationFacet.YouTube[n] = function(state) {
+ self._onStateChange(state);
+ }
+ self._playerObj = document.getElementById(pid);
+
self._playerObj.addEventListener('onStateChange','Exhibit.AnimationFacet.YouTube.'+n);
+}
=======================================
--- /dev/null
+++ /exhibit/trunk/src/webapp/api/extensions/animation/scripts/swfobject.js
Mon Nov 26 04:25:26 2012
@@ -0,0 +1,4 @@
+/* SWFObject v2.2 <
http://code.google.com/p/swfobject/>
+ is released under the MIT License
<
http://www.opensource.org/licenses/mit-license.php>
+*/
+var swfobject=function(){var D="undefined",r="object",S="Shockwave
Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var
aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof
j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof
t.plugins!=D&&typeof
t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof
t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof
O.ActiveXObject!=D){try{var ad=new
ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof
j.readyState!=D&&j.readyState=="complete")||(typeof
j.readyState==D&&(j.getElementsByTagName("body")[0]||
j.body))){f()}if(!J){if(typeof
j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|
complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function
f(){if(J){return}try{var
Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var
X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function
K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof
O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof
j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof
O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var
X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function
h(){if(T){V()}else{H()}}function V(){var
X=j.getElementsByTagName("body")[0];var
aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var
Y=0;(function(){if(typeof Z.GetVariable!=D){var
ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function
H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var
ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var
ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var
ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")|
|"0";ai.height=ae.getAttribute("height")|
|"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var
ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var
ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var
Z=z(Y);if(Z&&typeof
Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var
X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof
Y.SetVariable!=D){X=Y}else{var
Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function
A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function
P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var
ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}
aa.id=R;if(typeof
aa.width==D||
(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof
aa.height==D||
(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+"
- Flash Player Installation";var
ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof
ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var
Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function
p(Y){if(M.ie&&M.win&&Y.readyState!=4){var
X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function
g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var
Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var
X=ad.length;for(var
Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return
aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return
X}if(aa){if(typeof
ai.id==D){
ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae
in
ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+='
class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var
af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param
name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=
ai.id;X=c(
ai.id)}else{var
Z=C(r);Z.setAttribute("type",q);for(var ac in
ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var
ab in
ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return
X}function e(Z,X,Y){var
aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function
y(Y){var
X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function
b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof
Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var
X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return
j.createElement(X)}function
i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var
Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||
0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||
(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function
v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var
aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof
ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var
Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof
j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof
n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof
j.createTextNode!=D){n.appendChild(j.createTextNode(ac+"
{"+Y+"}"))}}}function w(Z,X){if(!m){return}var
Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function
L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof
encodeURIComponent!=D?encodeURIComponent(Y):Y}var
d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var
ac=I.length;for(var
ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var
Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in
M){M[Y]=null}M=null;for(var X in
swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var
Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return
z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var
X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var
aj={};if(af&&typeof af===r){for(var al in
af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var
am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof
Z===r){for(var ai in Z){if(typeof
am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var
an=u(aj,am,ah);if(
aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return
u(Z,Y,X)}else{return
undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var
Z=j.location.search||
j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return
L(Z)}var Y=Z.split("&");for(var
X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return
L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var
X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();
=======================================
--- /dev/null
+++
/exhibit/trunk/src/webapp/api/extensions/animation/styles/animation-facet.css
Mon Nov 26 04:25:26 2012
@@ -0,0 +1,40 @@
+.exhibit-facet-animation-shaft-container {
+ border: 1px Solid #DDDDDD;
+ padding: 1px;
+}
+
+.exhibit-facet-animation-shaft-container .exhibit-facet-animation-shaft {
+ height: 15px;
+}
+
+.exhibit-facet-animation-shaft-container .exhibit-facet-animation-shaft-markers
div
{
+ background-color: #DDDDDD;
+ top: 2px;
+ height: 11px;
+}
+
+.exhibit-facet-animation-shaft-container .exhibit-facet-animation-shaft-thumb
{
+ width: 10px; height: 13px;
+ background-color: White;
+ border: 1px Solid Black;
+}
+
+.exhibit-facet-animation-labels {
+ /*font-size: 75%;*/
+ color: #AAAAAA;
+}
+
+.exhibit-facet-animation-bar-container {
+ width: 100%;
+ background-color: #DDDDDD;
+ margin-top: 0.25em;
+}
+
+.exhibit-facet-animation-bar-container .exhibit-facet-animation-bar {
+ height: 5px;
+ background-color: Black;
+}
+
+.exhibit-facet-animation-labels .exhibit-facet-animation-labels-time {
+ color: Black;
+}
=======================================
--- /exhibit/trunk/build.xml Wed Sep 7 08:23:16 2011
+++ /exhibit/trunk/build.xml Mon Nov 26 04:25:26 2012
@@ -94,6 +94,11 @@
<param name="obfuscate" value="${obfuscate}" />
<param name="suffix" value="${suffix}" />
</antcall>
+ <antcall target="bundle-extension">
+ <param name="extension" value="animation" />
+ <param name="obfuscate" value="${obfuscate}" />
+ <param name="suffix" value="${suffix}" />
+ </antcall>
</target>
<target name="bundle-ajax" depends="tasks">
=======================================
--- /exhibit/trunk/src/webapp/api/exhibit-bundle-debug.js Mon Feb 27
10:32:20 2012
+++ /exhibit/trunk/src/webapp/api/exhibit-bundle-debug.js Mon Nov 26
04:25:26 2012
@@ -2086,15 +2086,6 @@
};
-/* microdata.js */
-Exhibit.MicrodataImporter={};
-Exhibit.MicrodataImporter.parse=function(content,link){var
labelProp=Exhibit.getAttribute(link,"labelProperty");
-var $=SimileAjax.jQuery;
-var items=[];
-$("[itemscope]",content).each();
-};
-
-
/* rdfa-importer.js */
var RDFA=new Object();
RDFA.url="
http://www.w3.org/2006/07/SWD/RDFa/impl/js/20070301/rdfa.js";
=======================================
---
/exhibit/trunk/src/webapp/api/extensions/data-editor/scripts/data-editor.js
Wed Feb 15 08:52:10 2012
+++
/exhibit/trunk/src/webapp/api/extensions/data-editor/scripts/data-editor.js
Mon Nov 26 04:25:26 2012
@@ -267,6 +267,7 @@
var overlay = $('#'+markerId);
if(overlay.attr('title')=='select') { return; }
var xy = jq.position();
+ // FIXME: 2012-04-26 : these two lines were commented out! Weird!
var w = jq.outerWidth(true); // Width / height inc. margins and padding.
var h = jq.outerHeight(true);
overlay.removeClass('exhibitDataEditSelectorOff').addClass('exhibitDataEditSelectorOn')
=======================================
---
/exhibit/trunk/src/webapp/api/extensions/map/map-extension-bundle-debug.js
Sat Jan 28 22:02:22 2012
+++
/exhibit/trunk/src/webapp/api/extensions/map/map-extension-bundle-debug.js
Mon Nov 26 04:25:26 2012
@@ -530,7 +530,7 @@
uiContext.getCollection().addListener(this._listener);
};
Exhibit.OLMapView.contexts={};
-Exhibit.OLMapView._settingSpecs={"latlngOrder":{type:"enum",defaultValue:"latlng",choices:["latlng","lnglat"]},"latlngPairSeparator":{type:"text",defaultValue:";"},"center":{type:"float",defaultValue:null,dimensions:2},"zoom":{type:"float",defaultValue:null},"scrollWheelZoom":{type:"boolean",defaultValue:true},"scaleControl":{type:"boolean",defaultValue:true},"overviewControl":{type:"boolean",defaultValue:false},"type":{type:"enum",defaultValue:"osm",choices:["osm","wms","gmap","gsat","ghyb","gter","vmap","vsat","vhyb","ymap","ysat","yhyb"]},"bubbleTip":{type:"enum",defaultValue:"top",choices:["top","bottom"]},"mapHeight":{type:"int",defaultValue:400},"mapConstructor":{type:"function",defaultValue:null},"projection":{type:"function",defaultValue:null},"color":{type:"text",defaultValue:"#FF9000"},"colorCoder":{type:"text",defaultValue:null},"sizeCoder":{type:"text",defaultValue:null},"iconCoder":{type:"text",defaultValue:null},"selectCoordinator":{type:"text",defaultValue:null},"iconSize":{type:"int",defaultValue:0},"iconFit":{type:"text",defaultValue:"smaller"},"iconScale":{type:"float",defaultValue:1},"iconOffsetX":{type:"float",defaultValue:0},"iconOffsetY":{type:"float",defaultValue:0},"shape":{type:"text",defaultValue:"circle"},"shapeWidth":{type:"int",defaultValue:24},"shapeHeight":{type:"int",defaultValue:24},"shapeAlpha":{type:"float",defaultValue:0.7},"pin":{type:"boolean",defaultValue:true},"pinHeight":{type:"int",defaultValue:6},"pinWidth":{type:"int",defaultValue:6},"borderOpacity":{type:"float",defaultValue:0.5},"borderWidth":{type:"int",defaultValue:1},"borderColor":{type:"text",defaultValue:null},"opacity":{type:"float",defaultValue:0.7},"sizeLegendLabel":{type:"text",defaultValue:null},"colorLegendLabel":{type:"text",defaultValue:null},"iconLegendLabel":{type:"text",defaultValue:null},"markerScale":{type:"text",defaultValue:null},"showHeader":{type:"boolean",defaultValue:true},"showSummary":{type:"boolean",defaultValue:true},"showFooter":{type:"boolean",defaultValue:true},"showToolbox":{type:"boolean",defaultValue:true},"osmURL":{type:"text",defaultValue:"
http://tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png"},"wmsURL":{type:"text",defaultValue:"
http://labs.metacarta.com/wms/vmap0"}};
+Exhibit.OLMapView._settingSpecs={"latlngOrder":{type:"enum",defaultValue:"latlng",choices:["latlng","lnglat"]},"latlngPairSeparator":{type:"text",defaultValue:";"},"center":{type:"float",defaultValue:null,dimensions:2},"zoom":{type:"float",defaultValue:null},"scrollWheelZoom":{type:"boolean",defaultValue:true},"scaleControl":{type:"boolean",defaultValue:true},"overviewControl":{type:"boolean",defaultValue:false},"type":{type:"enum",defaultValue:"osm",choices:["osm","wms","gmap","gsat","ghyb","gter","vmap","vsat","vhyb","ymap","ysat","yhyb"]},"bubbleTip":{type:"enum",defaultValue:"top",choices:["top","bottom"]},"mapHeight":{type:"int",defaultValue:400},"mapConstructor":{type:"function",defaultValue:null},"projection":{type:"function",defaultValue:null},"color":{type:"text",defaultValue:"#FF9000"},"colorCoder":{type:"text",defaultValue:null},"sizeCoder":{type:"text",defaultValue:null},"iconCoder":{type:"text",defaultValue:null},"selectCoordinator":{type:"text",defaultValue:null},"iconSize":{type:"int",defaultValue:0},"iconFit":{type:"text",defaultValue:"smaller"},"iconScale":{type:"float",defaultValue:1},"iconOffsetX":{type:"float",defaultValue:0},"iconOffsetY":{type:"float",defaultValue:0},"shape":{type:"text",defaultValue:"circle"},"shapeWidth":{type:"int",defaultValue:24},"shapeHeight":{type:"int",defaultValue:24},"shapeAlpha":{type:"float",defaultValue:0.7},"pin":{type:"boolean",defaultValue:true},"pinHeight":{type:"int",defaultValue:6},"pinWidth":{type:"int",defaultValue:6},"borderOpacity":{type:"float",defaultValue:0.5},"borderWidth":{type:"int",defaultValue:1},"borderColor":{type:"text",defaultValue:null},"opacity":{type:"float",defaultValue:0.7},"sizeLegendLabel":{type:"text",defaultValue:null},"colorLegendLabel":{type:"text",defaultValue:null},"iconLegendLabel":{type:"text",defaultValue:null},"markerScale":{type:"text",defaultValue:null},"showHeader":{type:"boolean",defaultValue:true},"showSummary":{type:"boolean",defaultValue:true},"showFooter":{type:"boolean",defaultValue:true},"showToolbox":{type:"boolean",defaultValue:true},"osmURL":{type:"text",defaultValue:"
http://tile.openstreetmap.org/${z}/${x}/${y}.png"},"wmsURL":{type:"text",defaultValue:"
http://labs.metacarta.com/wms/vmap0"}};
Exhibit.OLMapView._accessorSpecs=[{accessorName:"getProxy",attributeName:"proxy"},{accessorName:"getLatlng",alternatives:[{bindings:[{attributeName:"latlng",types:["float","float"],bindingNames:["lat","lng"]},{attributeName:"maxAutoZoom",type:"float",bindingName:"maxAutoZoom",optional:true}]},{bindings:[{attributeName:"lat",type:"float",bindingName:"lat"},{attributeName:"lng",type:"float",bindingName:"lng"},{attributeName:"maxAutoZoom",type:"float",bindingName:"maxAutoZoom",optional:true}]}]},{accessorName:"getPolygon",attributeName:"polygon",type:"text"},{accessorName:"getPolyline",attributeName:"polyline",type:"text"},{accessorName:"getColorKey",attributeName:"marker",type:"text"},{accessorName:"getColorKey",attributeName:"colorKey",type:"text"},{accessorName:"getSizeKey",attributeName:"sizeKey",type:"text"},{accessorName:"getIconKey",attributeName:"iconKey",type:"text"},{accessorName:"getIcon",attributeName:"icon",type:"url"}];
Exhibit.OLMapView._initialize=function(){var links=[];
var heads=document.documentElement.getElementsByTagName("head");
=======================================
--- /exhibit/trunk/src/webapp/api/extensions/map/map-extension-bundle.js
Sat Jan 28 22:02:22 2012
+++ /exhibit/trunk/src/webapp/api/extensions/map/map-extension-bundle.js
Mon Nov 26 04:25:26 2012
@@ -530,7 +530,7 @@
B.getCollection().addListener(this._listener);
};
Exhibit.OLMapView.contexts={};
-Exhibit.OLMapView._settingSpecs={"latlngOrder":{type:"enum",defaultValue:"latlng",choices:["latlng","lnglat"]},"latlngPairSeparator":{type:"text",defaultValue:";"},"center":{type:"float",defaultValue:null,dimensions:2},"zoom":{type:"float",defaultValue:null},"scrollWheelZoom":{type:"boolean",defaultValue:true},"scaleControl":{type:"boolean",defaultValue:true},"overviewControl":{type:"boolean",defaultValue:false},"type":{type:"enum",defaultValue:"osm",choices:["osm","wms","gmap","gsat","ghyb","gter","vmap","vsat","vhyb","ymap","ysat","yhyb"]},"bubbleTip":{type:"enum",defaultValue:"top",choices:["top","bottom"]},"mapHeight":{type:"int",defaultValue:400},"mapConstructor":{type:"function",defaultValue:null},"projection":{type:"function",defaultValue:null},"color":{type:"text",defaultValue:"#FF9000"},"colorCoder":{type:"text",defaultValue:null},"sizeCoder":{type:"text",defaultValue:null},"iconCoder":{type:"text",defaultValue:null},"selectCoordinator":{type:"text",defaultValue:null},"iconSize":{type:"int",defaultValue:0},"iconFit":{type:"text",defaultValue:"smaller"},"iconScale":{type:"float",defaultValue:1},"iconOffsetX":{type:"float",defaultValue:0},"iconOffsetY":{type:"float",defaultValue:0},"shape":{type:"text",defaultValue:"circle"},"shapeWidth":{type:"int",defaultValue:24},"shapeHeight":{type:"int",defaultValue:24},"shapeAlpha":{type:"float",defaultValue:0.7},"pin":{type:"boolean",defaultValue:true},"pinHeight":{type:"int",defaultValue:6},"pinWidth":{type:"int",defaultValue:6},"borderOpacity":{type:"float",defaultValue:0.5},"borderWidth":{type:"int",defaultValue:1},"borderColor":{type:"text",defaultValue:null},"opacity":{type:"float",defaultValue:0.7},"sizeLegendLabel":{type:"text",defaultValue:null},"colorLegendLabel":{type:"text",defaultValue:null},"iconLegendLabel":{type:"text",defaultValue:null},"markerScale":{type:"text",defaultValue:null},"showHeader":{type:"boolean",defaultValue:true},"showSummary":{type:"boolean",defaultValue:true},"showFooter":{type:"boolean",defaultValue:true},"showToolbox":{type:"boolean",defaultValue:true},"osmURL":{type:"text",defaultValue:"
http://tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png"},"wmsURL":{type:"text",defaultValue:"
http://labs.metacarta.com/wms/vmap0"}};
+Exhibit.OLMapView._settingSpecs={"latlngOrder":{type:"enum",defaultValue:"latlng",choices:["latlng","lnglat"]},"latlngPairSeparator":{type:"text",defaultValue:";"},"center":{type:"float",defaultValue:null,dimensions:2},"zoom":{type:"float",defaultValue:null},"scrollWheelZoom":{type:"boolean",defaultValue:true},"scaleControl":{type:"boolean",defaultValue:true},"overviewControl":{type:"boolean",defaultValue:false},"type":{type:"enum",defaultValue:"osm",choices:["osm","wms","gmap","gsat","ghyb","gter","vmap","vsat","vhyb","ymap","ysat","yhyb"]},"bubbleTip":{type:"enum",defaultValue:"top",choices:["top","bottom"]},"mapHeight":{type:"int",defaultValue:400},"mapConstructor":{type:"function",defaultValue:null},"projection":{type:"function",defaultValue:null},"color":{type:"text",defaultValue:"#FF9000"},"colorCoder":{type:"text",defaultValue:null},"sizeCoder":{type:"text",defaultValue:null},"iconCoder":{type:"text",defaultValue:null},"selectCoordinator":{type:"text",defaultValue:null},"iconSize":{type:"int",defaultValue:0},"iconFit":{type:"text",defaultValue:"smaller"},"iconScale":{type:"float",defaultValue:1},"iconOffsetX":{type:"float",defaultValue:0},"iconOffsetY":{type:"float",defaultValue:0},"shape":{type:"text",defaultValue:"circle"},"shapeWidth":{type:"int",defaultValue:24},"shapeHeight":{type:"int",defaultValue:24},"shapeAlpha":{type:"float",defaultValue:0.7},"pin":{type:"boolean",defaultValue:true},"pinHeight":{type:"int",defaultValue:6},"pinWidth":{type:"int",defaultValue:6},"borderOpacity":{type:"float",defaultValue:0.5},"borderWidth":{type:"int",defaultValue:1},"borderColor":{type:"text",defaultValue:null},"opacity":{type:"float",defaultValue:0.7},"sizeLegendLabel":{type:"text",defaultValue:null},"colorLegendLabel":{type:"text",defaultValue:null},"iconLegendLabel":{type:"text",defaultValue:null},"markerScale":{type:"text",defaultValue:null},"showHeader":{type:"boolean",defaultValue:true},"showSummary":{type:"boolean",defaultValue:true},"showFooter":{type:"boolean",defaultValue:true},"showToolbox":{type:"boolean",defaultValue:true},"osmURL":{type:"text",defaultValue:"
http://tile.openstreetmap.org/${z}/${x}/${y}.png"},"wmsURL":{type:"text",defaultValue:"
http://labs.metacarta.com/wms/vmap0"}};
Exhibit.OLMapView._accessorSpecs=[{accessorName:"getProxy",attributeName:"proxy"},{accessorName:"getLatlng",alternatives:[{bindings:[{attributeName:"latlng",types:["float","float"],bindingNames:["lat","lng"]},{attributeName:"maxAutoZoom",type:"float",bindingName:"maxAutoZoom",optional:true}]},{bindings:[{attributeName:"lat",type:"float",bindingName:"lat"},{attributeName:"lng",type:"float",bindingName:"lng"},{attributeName:"maxAutoZoom",type:"float",bindingName:"maxAutoZoom",optional:true}]}]},{accessorName:"getPolygon",attributeName:"polygon",type:"text"},{accessorName:"getPolyline",attributeName:"polyline",type:"text"},{accessorName:"getColorKey",attributeName:"marker",type:"text"},{accessorName:"getColorKey",attributeName:"colorKey",type:"text"},{accessorName:"getSizeKey",attributeName:"sizeKey",type:"text"},{accessorName:"getIconKey",attributeName:"iconKey",type:"text"},{accessorName:"getIcon",attributeName:"icon",type:"url"}];
Exhibit.OLMapView._initialize=function(){var B=[];
var F=document.documentElement.getElementsByTagName("head");
=======================================
--- /exhibit/trunk/src/webapp/api/locales/no/exhibit-no-bundle.js Tue Nov
30 22:53:18 2010
+++ /exhibit/trunk/src/webapp/api/locales/no/exhibit-no-bundle.js Mon Nov
26 04:25:26 2012
@@ -24,7 +24,7 @@
Exhibit.l10n.missingSortKey="(mangler)";
Exhibit.l10n.notApplicableSortKey="(n/a)";
Exhibit.l10n.itemLinkLabel="lenke";
-Exhibit.l10n.busyIndicatorMessage="Søker...";
+Exhibit.l10n.busyIndicatorMessage="Søker...";
Exhibit.l10n.showDocumentationMessage="Vi vil vise dokumentasjon etter
denne meldinga.";
Exhibit.l10n.showJavascriptValidationMessage="Vi vil forklare feilen etter
denne meldinga.";
Exhibit.l10n.showJsonValidationMessage="Vi vil forklare feilen etter denne
meldinga.";
@@ -36,7 +36,7 @@
Exhibit.l10n.exportButtonLabel="Eksporter";
Exhibit.l10n.exportAllButtonLabel="Eksporter alle";
Exhibit.l10n.exportDialogBoxCloseButtonLabel="Lukk";
-Exhibit.l10n.exportDialogBoxPrompt="Kopier koden til utklippstavlen. Trykk
ESC for å fjerne denne dialogboksen.";
+Exhibit.l10n.exportDialogBoxPrompt="Kopier koden til utklippstavlen. Trykk
ESC for å fjerne denne dialogboksen.";
Exhibit.l10n.focusDialogBoxCloseButtonLabel="Lukk";
Exhibit.l10n.rdfXmlExporterLabel="RDF/XML";
Exhibit.l10n.smwExporterLabel="Semantisk wikitext";
@@ -176,5 +176,5 @@
/* views-l10n.js */
if(!("l10n" in Exhibit.ViewUtilities)){Exhibit.ViewUtilities.l10n={};
}Exhibit.ViewUtilities.l10n.unplottableMessageFormatter=function(B,A,C){var
D=A.length;
-return String.substitute("<a class='exhibit-action
exhibit-views-unplottableCount' href='javascript:void'
id='unplottableCountLink'>%0</a> av <class
class='exhibit-views-totalCount'>%1</span> kunne ikke vises på
kart.",[D==1?(D+" treff"):(D+" treff"),B]);
+return String.substitute("<a class='exhibit-action
exhibit-views-unplottableCount' href='javascript:void'
id='unplottableCountLink'>%0</a> av <class
class='exhibit-views-totalCount'>%1</span> kunne ikke vises på
kart.",[D==1?(D+" treff"):(D+" treff"),B]);
};