Skip to content
Browse files

Bump to 0.1.0.charliehorse.

Also update the compiled frontend JS.
  • Loading branch information...
1 parent 49f6a96 commit d375126fcaa855cd30e173c5d16b6836ecd795bd @bamnet bamnet committed Mar 21, 2013
Showing with 111 additions and 107 deletions.
  1. +3 −3 lib/concerto/version.rb
  2. +96 −95 public/frontend_js/frontend.js
  3. +12 −9 public/frontend_js/frontend_debug.js
View
6 lib/concerto/version.rb
@@ -1,9 +1,9 @@
module Concerto
module VERSION
MAJOR = 0
- MINOR = 0
- TINY = 3
- PRE = 'bravochicken'
+ MINOR = 1
+ TINY = 0
+ PRE = 'charliehorse'
STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
end
View
191 public/frontend_js/frontend.js
96 additions, 95 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
21 public/frontend_js/frontend_debug.js
@@ -710,7 +710,9 @@ goog.async.Delay.prototype.doAction_=function(){this.id_=0;this.listener_&&this.
concerto.frontend.Content.prototype.startLoad=function(){this.logger_.info("Content "+this.id+" is starting to load.");this.start_=new goog.date.DateTime;this.setupTimer();this.dispatchEvent(concerto.frontend.Content.EventType.START_LOAD);this.load_()};concerto.frontend.Content.prototype.applyStyles=function(a){goog.style.setStyle(this.div_,a)};concerto.frontend.Content.prototype.load_=function(){this.finishLoad()};
concerto.frontend.Content.prototype.finishLoad=function(){this.end_=new goog.date.DateTime;var a=this.end_.getMilliseconds()-this.start_.getMilliseconds();this.logger_.info("Content "+this.id+" is done loading. Took: "+a+"ms.");this.dispatchEvent(concerto.frontend.Content.EventType.FINISH_LOAD)};concerto.frontend.Content.prototype.render=function(){this.logger_.info("Content "+this.id+" is being rendered.");this.div=this.div_};
concerto.frontend.Content.prototype.setupTimer=function(){this.timer_=new goog.async.Delay(this.finishTimer,1E3*this.duration,this);goog.events.listen(this,concerto.frontend.Content.EventType.COMPLETE_RENDER,this.startTimer,!1,this)};concerto.frontend.Content.prototype.startTimer=function(){this.timer_.start()};concerto.frontend.Content.prototype.finishTimer=function(){this.dispatchEvent(concerto.frontend.Content.EventType.DISPLAY_END)};
-concerto.frontend.Content.EventType={START_LOAD:goog.events.getUniqueId("start_load"),FINISH_LOAD:goog.events.getUniqueId("finish_load"),START_RENDER:goog.events.getUniqueId("start_render"),COMPLETE_RENDER:goog.events.getUniqueId("complete_render"),STOP_RENDER:goog.events.getUniqueId("stop_render"),FINISH_RENDER:goog.events.getUniqueId("finish_render"),DISPLAY_END:goog.events.getUniqueId("display_end")};concerto.frontend.Content.Ticker=function(a){concerto.frontend.Content.call(this,a);this.text=a.render_details.data};goog.inherits(concerto.frontend.Content.Ticker,concerto.frontend.Content);concerto.frontend.ContentTypeRegistry.Ticker=concerto.frontend.Content.Ticker;concerto.frontend.Content.Ticker.prototype.load_=function(){goog.dom.setTextContent(this.div_,this.text);this.finishLoad()};concerto.frontend.Content.HtmlText=function(a){concerto.frontend.Content.call(this,a);this.html=a.render_details.data};goog.inherits(concerto.frontend.Content.HtmlText,concerto.frontend.Content);concerto.frontend.ContentTypeRegistry.HtmlText=concerto.frontend.Content.HtmlText;concerto.frontend.Content.HtmlText.prototype.load_=function(){this.div_.innerHTML=this.html;this.finishLoad()};goog.events.EventHandler=function(a){goog.Disposable.call(this);this.handler_=a;this.keys_=[]};goog.inherits(goog.events.EventHandler,goog.Disposable);goog.events.EventHandler.typeArray_=[];goog.events.EventHandler.prototype.listen=function(a,b,c,d,e){goog.isArray(b)||(goog.events.EventHandler.typeArray_[0]=b,b=goog.events.EventHandler.typeArray_);for(var f=0;f<b.length;f++){var g=goog.events.listen(a,b[f],c||this,d||!1,e||this.handler_||this);this.keys_.push(g)}return this};
+concerto.frontend.Content.EventType={START_LOAD:goog.events.getUniqueId("start_load"),FINISH_LOAD:goog.events.getUniqueId("finish_load"),START_RENDER:goog.events.getUniqueId("start_render"),COMPLETE_RENDER:goog.events.getUniqueId("complete_render"),STOP_RENDER:goog.events.getUniqueId("stop_render"),FINISH_RENDER:goog.events.getUniqueId("finish_render"),DISPLAY_END:goog.events.getUniqueId("display_end")};concerto.frontend.Helpers={};concerto.frontend.Helpers.Autofit=function(a,b,c){b=new goog.math.Size(b,c);c=100;var d=a.cloneNode(!0);goog.style.showElement(d,!1);document.body.appendChild(d);for(goog.style.setStyle(d,"fontSize",c+"px");1<c&&!goog.style.getSize(d).fitsInside(b);)goog.style.setStyle(d,"fontSize",--c+"px");document.body.removeChild(d);delete d;goog.style.setStyle(a,"fontSize",c+"px");return a};concerto.frontend.Content.Ticker=function(a){concerto.frontend.Content.call(this,a);this.text=a.render_details.data;this.field_height_=a.field.size.height;this.field_width_=a.field.size.width};goog.inherits(concerto.frontend.Content.Ticker,concerto.frontend.Content);concerto.frontend.ContentTypeRegistry.Ticker=concerto.frontend.Content.Ticker;
+concerto.frontend.Content.Ticker.prototype.load_=function(){goog.dom.setTextContent(this.div_,this.text);this.div_=concerto.frontend.Helpers.Autofit(this.div_,this.field_width_,this.field_height_);console.log(this.div_);this.finishLoad()};concerto.frontend.Content.HtmlText=function(a){concerto.frontend.Content.call(this,a);this.field_height_=a.field.size.height;this.field_width_=a.field.size.width;this.html=a.render_details.data};goog.inherits(concerto.frontend.Content.HtmlText,concerto.frontend.Content);concerto.frontend.ContentTypeRegistry.HtmlText=concerto.frontend.Content.HtmlText;
+concerto.frontend.Content.HtmlText.prototype.load_=function(){this.div_.innerHTML=this.html;this.div_=concerto.frontend.Helpers.Autofit(this.div_,this.field_width_,this.field_height_);this.finishLoad()};goog.events.EventHandler=function(a){goog.Disposable.call(this);this.handler_=a;this.keys_=[]};goog.inherits(goog.events.EventHandler,goog.Disposable);goog.events.EventHandler.typeArray_=[];goog.events.EventHandler.prototype.listen=function(a,b,c,d,e){goog.isArray(b)||(goog.events.EventHandler.typeArray_[0]=b,b=goog.events.EventHandler.typeArray_);for(var f=0;f<b.length;f++){var g=goog.events.listen(a,b[f],c||this,d||!1,e||this.handler_||this);this.keys_.push(g)}return this};
goog.events.EventHandler.prototype.listenOnce=function(a,b,c,d,e){if(goog.isArray(b))for(var f=0;f<b.length;f++)this.listenOnce(a,b[f],c,d,e);else a=goog.events.listenOnce(a,b,c||this,d,e||this.handler_||this),this.keys_.push(a);return this};goog.events.EventHandler.prototype.listenWithWrapper=function(a,b,c,d,e){b.listen(a,c,d,e||this.handler_||this,this);return this};goog.events.EventHandler.prototype.getListenerCount=function(){return this.keys_.length};
goog.events.EventHandler.prototype.unlisten=function(a,b,c,d,e){if(goog.isArray(b))for(var f=0;f<b.length;f++)this.unlisten(a,b[f],c,d,e);else if(a=goog.events.getListener(a,b,c||this,d,e||this.handler_||this))a=a.key,goog.events.unlistenByKey(a),goog.array.remove(this.keys_,a);return this};goog.events.EventHandler.prototype.unlistenWithWrapper=function(a,b,c,d,e){b.unlisten(a,c,d,e||this.handler_||this,this);return this};
goog.events.EventHandler.prototype.removeAll=function(){goog.array.forEach(this.keys_,goog.events.unlistenByKey);this.keys_.length=0};goog.events.EventHandler.prototype.disposeInternal=function(){goog.events.EventHandler.superClass_.disposeInternal.call(this);this.removeAll()};goog.events.EventHandler.prototype.handleEvent=function(a){throw Error("EventHandler.handleEvent not implemented");};goog.net={};goog.net.EventType={COMPLETE:"complete",SUCCESS:"success",ERROR:"error",ABORT:"abort",READY:"ready",READY_STATE_CHANGE:"readystatechange",TIMEOUT:"timeout",INCREMENTAL_DATA:"incrementaldata",PROGRESS:"progress"};goog.net.ImageLoader=function(a){goog.events.EventTarget.call(this);this.imageIdToUrlMap_={};this.imageIdToImageMap_={};this.handler_=new goog.events.EventHandler(this);this.parent_=a};goog.inherits(goog.net.ImageLoader,goog.events.EventTarget);goog.net.ImageLoader.IMAGE_LOAD_EVENTS_=[goog.userAgent.IE?goog.net.EventType.READY_STATE_CHANGE:goog.events.EventType.LOAD,goog.net.EventType.ABORT,goog.net.EventType.ERROR];
@@ -741,8 +743,8 @@ goog.i18n.DateTimeFormat.prototype.formatQuarter_=function(a,b){var c=Math.floor
goog.i18n.DateTimeFormat.prototype.formatSeconds_=function(a,b){return this.localizeNumbers_(goog.string.padNumber(b.getSeconds(),a))};goog.i18n.DateTimeFormat.prototype.formatTimeZoneRFC_=function(a,b,c){c=c||goog.i18n.TimeZone.createTimeZone(b.getTimezoneOffset());return 4>a?c.getRFCTimeZoneString(b):this.localizeNumbers_(c.getGMTString(b))};
goog.i18n.DateTimeFormat.prototype.formatTimeZone_=function(a,b,c){c=c||goog.i18n.TimeZone.createTimeZone(b.getTimezoneOffset());return 4>a?c.getShortName(b):c.getLongName(b)};goog.i18n.DateTimeFormat.prototype.formatTimeZoneId_=function(a,b){b=b||goog.i18n.TimeZone.createTimeZone(a.getTimezoneOffset());return b.getTimeZoneId()};
goog.i18n.DateTimeFormat.prototype.formatField_=function(a,b,c,d,e){var f=a.length;switch(a.charAt(0)){case "G":return this.formatEra_(f,c);case "y":return this.formatYear_(f,c);case "M":return this.formatMonth_(f,c);case "k":return this.format24Hours_(f,d);case "S":return this.formatFractionalSeconds_(f,d);case "E":return this.formatDayOfWeek_(f,c);case "a":return this.formatAmPm_(f,d);case "h":return this.format1To12Hours_(f,d);case "K":return this.format0To11Hours_(f,d);case "H":return this.format0To23Hours_(f,
-d);case "c":return this.formatStandaloneDay_(f,c);case "L":return this.formatStandaloneMonth_(f,c);case "Q":return this.formatQuarter_(f,c);case "d":return this.formatDate_(f,c);case "m":return this.formatMinutes_(f,d);case "s":return this.formatSeconds_(f,d);case "v":return this.formatTimeZoneId_(b,e);case "z":return this.formatTimeZone_(f,b,e);case "Z":return this.formatTimeZoneRFC_(f,b,e);default:return""}};concerto.frontend.Content.ClientTime=function(a){concerto.frontend.Content.call(this,a);this.timezone=a.timezone};goog.inherits(concerto.frontend.Content.ClientTime,concerto.frontend.Content);concerto.frontend.ContentTypeRegistry.TimeDisplay=concerto.frontend.Content.ClientTime;
-concerto.frontend.Content.ClientTime.prototype.load_=function(){var a=new goog.date.DateTime,b=new goog.i18n.DateTimeFormat(goog.i18n.DateTimeFormat.Format.MEDIUM_DATE),c=new goog.i18n.DateTimeFormat(goog.i18n.DateTimeFormat.Format.SHORT_TIME),a=b.format(a,this.timezone)+" "+c.format(a,this.timezone);goog.dom.setTextContent(this.div_,a);this.finishLoad()};concerto.frontend.Content.RemoteVideo=function(a){concerto.frontend.Content.call(this,a);this.field_height_=a.field.size.height;this.field_width_=a.field.size.width;this.iframe=null;this.video_url=a.render_details.path;this.duration+=1};goog.inherits(concerto.frontend.Content.RemoteVideo,concerto.frontend.Content);concerto.frontend.ContentTypeRegistry.RemoteVideo=concerto.frontend.Content.RemoteVideo;
+d);case "c":return this.formatStandaloneDay_(f,c);case "L":return this.formatStandaloneMonth_(f,c);case "Q":return this.formatQuarter_(f,c);case "d":return this.formatDate_(f,c);case "m":return this.formatMinutes_(f,d);case "s":return this.formatSeconds_(f,d);case "v":return this.formatTimeZoneId_(b,e);case "z":return this.formatTimeZone_(f,b,e);case "Z":return this.formatTimeZoneRFC_(f,b,e);default:return""}};concerto.frontend.Content.ClientTime=function(a){concerto.frontend.Content.call(this,a);this.field_height_=a.field.size.height;this.field_width_=a.field.size.width;this.timezone=a.timezone};goog.inherits(concerto.frontend.Content.ClientTime,concerto.frontend.Content);concerto.frontend.ContentTypeRegistry.ClientTime=concerto.frontend.Content.ClientTime;
+concerto.frontend.Content.ClientTime.prototype.load_=function(){var a=new goog.date.DateTime,b=new goog.i18n.DateTimeFormat(goog.i18n.DateTimeFormat.Format.MEDIUM_DATE),c=new goog.i18n.DateTimeFormat(goog.i18n.DateTimeFormat.Format.SHORT_TIME),a=b.format(a,this.timezone)+" "+c.format(a,this.timezone);goog.dom.setTextContent(this.div_,a);this.div_=concerto.frontend.Helpers.Autofit(this.div_,this.field_width_,this.field_height_);this.finishLoad()};concerto.frontend.Content.RemoteVideo=function(a){concerto.frontend.Content.call(this,a);this.field_height_=a.field.size.height;this.field_width_=a.field.size.width;this.iframe=null;this.video_url=a.render_details.path;this.duration+=1};goog.inherits(concerto.frontend.Content.RemoteVideo,concerto.frontend.Content);concerto.frontend.ContentTypeRegistry.RemoteVideo=concerto.frontend.Content.RemoteVideo;
concerto.frontend.Content.RemoteVideo.prototype.load_=function(){this.iframe=goog.dom.createElement("iframe");this.iframe.src=this.video_url;this.iframe.frameborder=0;goog.style.setSize(this.iframe,"100%","100%");goog.style.setStyle(this.iframe,"border",0);goog.dom.appendChild(this.div_,this.iframe);this.finishLoad()};concerto.frontend.ContentTypes={};goog.structs.Queue=function(){this.elements_=[]};goog.structs.Queue.prototype.head_=0;goog.structs.Queue.prototype.tail_=0;goog.structs.Queue.prototype.enqueue=function(a){this.elements_[this.tail_++]=a};goog.structs.Queue.prototype.dequeue=function(){if(this.head_!=this.tail_){var a=this.elements_[this.head_];delete this.elements_[this.head_];this.head_++;return a}};goog.structs.Queue.prototype.peek=function(){return this.head_==this.tail_?void 0:this.elements_[this.head_]};
goog.structs.Queue.prototype.getCount=function(){return this.tail_-this.head_};goog.structs.Queue.prototype.isEmpty=function(){return 0==this.tail_-this.head_};goog.structs.Queue.prototype.clear=function(){this.tail_=this.head_=this.elements_.length=0};goog.structs.Queue.prototype.contains=function(a){return goog.array.contains(this.elements_,a)};
goog.structs.Queue.prototype.remove=function(a){a=goog.array.indexOf(this.elements_,a);if(0>a)return!1;a==this.head_?this.dequeue():(goog.array.removeAt(this.elements_,a),this.tail_--);return!0};goog.structs.Queue.prototype.getValues=function(){return this.elements_.slice(this.head_,this.tail_)};goog.functions={};goog.functions.constant=function(a){return function(){return a}};goog.functions.FALSE=goog.functions.constant(!1);goog.functions.TRUE=goog.functions.constant(!0);goog.functions.NULL=goog.functions.constant(null);goog.functions.identity=function(a,b){return a};goog.functions.error=function(a){return function(){throw Error(a);}};goog.functions.lock=function(a,b){b=b||0;return function(){return a.apply(this,Array.prototype.slice.call(arguments,0,b))}};
@@ -809,14 +811,15 @@ goog.fx.dom.bgColorFadeIn=function(a,b,c,d){function e(){a.style.backgroundColor
goog.fx.dom.ColorTransform=function(a,b,c,d,e){if(3!=b.length||3!=c.length)throw Error("Start and end points must be 3D");goog.fx.dom.PredefinedEffect.apply(this,arguments)};goog.inherits(goog.fx.dom.ColorTransform,goog.fx.dom.PredefinedEffect);goog.fx.dom.ColorTransform.prototype.updateStyle=function(){for(var a=[],b=0;b<this.coords.length;b++)a[b]=Math.round(this.coords[b]);a="rgb("+a.join(",")+")";this.element.style.color=a};concerto.frontend.Transition=function(a,b,c){goog.events.EventTarget.call(this);this.field=a;this.current_content_=b||null;this.next_content_=c||null};goog.inherits(concerto.frontend.Transition,goog.events.EventTarget);concerto.frontend.Transition.prototype.go=function(){goog.isDefAndNotNull(this.current_content_)?this.out_():goog.isDefAndNotNull(this.next_content_)&&this.in_()};
concerto.frontend.Transition.prototype.out_=function(){this.current_content_.dispatchEvent(concerto.frontend.Content.EventType.STOP_RENDER);this.outDone_()};concerto.frontend.Transition.prototype.outDone_=function(){goog.dom.removeNode(this.current_content_.div);this.current_content_.dispatchEvent(concerto.frontend.Content.EventType.FINISH_RENDER);goog.isDefAndNotNull(this.next_content_)&&this.in_()};
concerto.frontend.Transition.prototype.in_=function(){this.next_content_.dispatchEvent(concerto.frontend.Content.EventType.START_RENDER);this.field.inject(this.next_content_.div);this.inDone_()};concerto.frontend.Transition.prototype.inDone_=function(){this.next_content_.dispatchEvent(concerto.frontend.Content.EventType.COMPLETE_RENDER)};concerto.frontend.Transition.Fade=function(a,b,c){this.duration=500;concerto.frontend.Transition.call(this,a,b,c)};goog.inherits(concerto.frontend.Transition.Fade,concerto.frontend.Transition);concerto.frontend.Transition.Fade.prototype.out_=function(){this.current_content_.dispatchEvent(concerto.frontend.Content.EventType.STOP_RENDER);var a=new goog.fx.dom.FadeOutAndHide(this.current_content_.div,this.duration);goog.events.listen(a,goog.fx.Animation.EventType.END,this.outDone_,!1,this);a.play()};
-concerto.frontend.Transition.Fade.prototype.in_=function(){this.next_content_.dispatchEvent(concerto.frontend.Content.EventType.START_RENDER);this.next_content_.div.style.display="none";this.field.inject(this.next_content_.div);var a=new goog.fx.dom.FadeInAndShow(this.next_content_.div,this.duration);goog.events.listen(a,goog.fx.Animation.EventType.END,this.inDone_,!1,this);a.play()};concerto.frontend.Field=function(a,b,c,d){goog.events.EventTarget.call(this);this.position=a;this.id=b;this.content_url=c;this.current_content_=this.prev_content_=null;this.next_contents_=new goog.structs.Queue;this.auto_advance_=!0;this.transition_=d||concerto.frontend.Transition.Fade;this.connection_=this.position.template.screen.connection;this.createDiv();this.nextContent()};goog.inherits(concerto.frontend.Field,goog.events.EventTarget);concerto.frontend.Field.prototype.logger_=goog.debug.Logger.getLogger("concerto.frontend.Field");
-concerto.frontend.Field.prototype.createDiv=function(){if(!goog.isDefAndNotNull(this.div_)){var a=goog.dom.createDom("div",{id:"field_"+this.id,"class":"field"});goog.style.setSize(a,"100%","100%");this.position.inject(a);this.div_=a}};concerto.frontend.Field.prototype.inject=function(a){goog.dom.appendChild(this.div_,a)};
-concerto.frontend.Field.prototype.loadContent=function(a){var b=a||null;this.logger_.info("Field "+this.id+" is looking for new content.");this.connection_.send("field"+this.id,this.content_url,"GET","",null,1,goog.bind(function(a){a=a.target;if(!a.isSuccess())return this.logger_.warning("Unable to fetch content. "+a.getLastError()),setTimeout(goog.bind(function(){this.nextContent(!0)},this),10);a=a.getResponseJson();if(!a.length)return this.logger_.info("No content to display here."),setTimeout(goog.bind(function(){this.nextContent(!0)},
-this),10);goog.array.forEach(a,goog.bind(function(a){a.field={size:this.position.getSize()};a.type in concerto.frontend.ContentTypeRegistry?(a=new concerto.frontend.ContentTypeRegistry[a.type](a),this.next_contents_.enqueue(a),goog.events.listen(a,concerto.frontend.Content.EventType.FINISH_LOAD,this.showContent,!1,this),goog.events.listen(a,concerto.frontend.Content.EventType.DISPLAY_END,this.autoAdvance,!1,this)):this.logger_.warning("Unable to find "+a.type+" renderer for content "+a.id)},this));
-b&&!this.next_contents_.isEmpty()&&this.next_contents_.peek().startLoad()},this))};concerto.frontend.Field.prototype.showContent=function(){this.logger_.info("Field "+this.id+" is showing new content.");var a=this.next_contents_.dequeue();a.applyStyles(this.position.getContentStyles());a.render();(new this.transition_(this,this.current_content_,a)).go();this.prev_content=this.current_content_;this.current_content_=a};
+concerto.frontend.Transition.Fade.prototype.in_=function(){this.next_content_.dispatchEvent(concerto.frontend.Content.EventType.START_RENDER);this.next_content_.div.style.display="none";this.field.inject(this.next_content_.div);var a=new goog.fx.dom.FadeInAndShow(this.next_content_.div,this.duration);goog.events.listen(a,goog.fx.Animation.EventType.END,this.inDone_,!1,this);a.play()};concerto.frontend.Field=function(a,b,c,d,e){goog.events.EventTarget.call(this);this.position=a;this.id=b;this.name=c;this.content_url=d;this.current_content_=this.prev_content_=null;this.next_contents_=new goog.structs.Queue;this.auto_advance_=!0;this.transition_=e||concerto.frontend.Transition.Fade;this.connection_=this.position.template.screen.connection;this.createDiv();this.nextContent()};goog.inherits(concerto.frontend.Field,goog.events.EventTarget);
+concerto.frontend.Field.prototype.logger_=goog.debug.Logger.getLogger("concerto.frontend.Field");concerto.frontend.Field.prototype.createDiv=function(){if(!goog.isDefAndNotNull(this.div_)){var a=goog.dom.createDom("div",{id:"field_"+this.id,"class":"field"});goog.style.setSize(a,"100%","100%");this.position.inject(a);this.div_=a}};concerto.frontend.Field.prototype.inject=function(a){goog.dom.appendChild(this.div_,a)};
+concerto.frontend.Field.prototype.loadContent=function(a){var b=a||null;this.logger_.info("Field "+this.id+" is looking for new content.");"Time"==this.name?(a={duration:15,id:0,name:"System Time",type:"ClientTime",render_details:{data:null},field:{size:this.position.getSize()}},a=new concerto.frontend.ContentTypeRegistry.ClientTime(a),this.next_contents_.enqueue(a),goog.events.listen(a,concerto.frontend.Content.EventType.FINISH_LOAD,this.showContent,!1,this),goog.events.listen(a,concerto.frontend.Content.EventType.DISPLAY_END,
+this.autoAdvance,!1,this),this.next_contents_.peek().startLoad()):this.connection_.send("field"+this.id,this.content_url,"GET","",null,1,goog.bind(function(a){a=a.target;if(!a.isSuccess())return this.logger_.warning("Unable to fetch content. "+a.getLastError()),setTimeout(goog.bind(function(){this.nextContent(!0)},this),10);a=a.getResponseJson();if(!a.length)return this.logger_.info("No content to display here."),setTimeout(goog.bind(function(){this.nextContent(!0)},this),10);goog.array.forEach(a,
+goog.bind(function(a){a.field={size:this.position.getSize()};a.type in concerto.frontend.ContentTypeRegistry?(a=new concerto.frontend.ContentTypeRegistry[a.type](a),this.next_contents_.enqueue(a),goog.events.listen(a,concerto.frontend.Content.EventType.FINISH_LOAD,this.showContent,!1,this),goog.events.listen(a,concerto.frontend.Content.EventType.DISPLAY_END,this.autoAdvance,!1,this)):this.logger_.warning("Unable to find "+a.type+" renderer for content "+a.id)},this));b&&!this.next_contents_.isEmpty()&&
+this.next_contents_.peek().startLoad()},this))};concerto.frontend.Field.prototype.showContent=function(){this.logger_.info("Field "+this.id+" is showing new content.");var a=this.next_contents_.dequeue();a.applyStyles(this.position.getContentStyles());a.render();(new this.transition_(this,this.current_content_,a)).go();this.prev_content=this.current_content_;this.current_content_=a};
concerto.frontend.Field.prototype.nextContent=function(a){a=a||!1;this.logger_.info("Field "+this.id+" would like a new piece of content (error state: "+a+" ).");this.next_contents_.isEmpty()?(this.logger_.info("Field "+this.id+" needs to look for more content."),a?(a=concerto.frontend.Field.ERROR_DELAY,this.logger_.info("In error state, sleeping for "+a+" seconds."),setTimeout(goog.bind(function(){this.loadContent(!0)},this),1E3*a)):this.loadContent(!0)):this.next_contents_.peek().startLoad()};
concerto.frontend.Field.prototype.autoAdvance=function(){this.auto_advance_?(this.logger_.info("Field "+this.id+" is auto-advancing."),this.nextContent()):this.logger_.info("Field "+this.id+" is not advancing.")};concerto.frontend.Field.ERROR_DELAY=goog.math.uniformRandom(10,60);concerto.frontend.Position=function(a,b){this.id=null;this.template=a;this.div_=b||this.createDiv_()};concerto.frontend.Position.prototype.logger_=goog.debug.Logger.getLogger("concerto.frontend.Position");concerto.frontend.Position.prototype.createDiv_=function(){var a=goog.dom.createDom("div",{id:"position_"+this.id,"class":"position"});goog.style.setStyle(a,"position","absolute");this.template.inject(a);return a};
-concerto.frontend.Position.prototype.load=function(a){this.id=a.id;this.bottom_=parseFloat(a.bottom);this.left_=parseFloat(a.left);this.right_=parseFloat(a.right);this.top_=parseFloat(a.top);this.style_=a.style;this.field_id=a.field_id;this.draw();this.field=new concerto.frontend.Field(this,this.field_id,a.field_contents_path);this.setProperties()};
+concerto.frontend.Position.prototype.load=function(a){this.id=a.id;this.bottom_=parseFloat(a.bottom);this.left_=parseFloat(a.left);this.right_=parseFloat(a.right);this.top_=parseFloat(a.top);this.style_=a.style;this.draw();this.field=new concerto.frontend.Field(this,a.field.id,a.field.name,a.field_contents_path);this.setProperties()};
concerto.frontend.Position.prototype.draw=function(){goog.style.setPosition(this.div_,100*this.left_+"%",100*this.top_+"%");goog.style.setSize(this.div_,100*(this.right_-this.left_)+"%",100*(this.bottom_-this.top_)+"%")};concerto.frontend.Position.prototype.getSize=function(){return goog.style.getSize(this.div_)};concerto.frontend.Position.prototype.inject=function(a){goog.dom.appendChild(this.div_,a)};
concerto.frontend.Position.prototype.setProperties=function(){goog.dom.setProperties(this.div_,{id:"position_"+this.id,"class":"position"});goog.style.setStyle(this.div_,concerto.frontend.Position.DEFAULT_STYLES)};
concerto.frontend.Position.prototype.getContentStyles=function(){var a=goog.style.parseStyleAttribute(this.style_),a=goog.object.filter(a,function(a,b,e){return!goog.array.contains(concerto.frontend.Position.LOCKED_STYLES,b.toLowerCase())}),b={};goog.object.extend(b,concerto.frontend.Position.DEFAULT_CONTENT_STYLES);goog.object.extend(b,a);return b};concerto.frontend.Position.LOCKED_STYLES="overflow width height top left bottom right".split(" ");concerto.frontend.Position.DEFAULT_STYLES={overflow:"hidden"};

0 comments on commit d375126

Please sign in to comment.
Something went wrong with that request. Please try again.