Skip to content

Instantly share code, notes, and snippets.

@tenpaiyomi
Created April 7, 2017 17:56
Show Gist options
  • Save tenpaiyomi/3b1cd1fd4866ae191bc18af0a281e835 to your computer and use it in GitHub Desktop.
Save tenpaiyomi/3b1cd1fd4866ae191bc18af0a281e835 to your computer and use it in GitHub Desktop.
/*! 10FootWaveSDK 2017-04-07 */
TFW.feeds={},TFW.feeds.Weather={getData:function(a,b,c){var d="http://app.10footwave.com/weather/"+TFW.device.latitude()+","+TFW.device.latitude()+"/FORECASTIO.json";$.get(d,function(c){var d=c.currently,e=[];if("daily"==a){var f=c.daily;f.shift(),$(f).slice(0,5).each(function(){e.push(this)})}else{var g=c.hourly;g.shift(),$([0,2,4,6,8]).each(function(){e.push(g[this])})}b(d,e)}).fail(function(){void 0!==c?c():(logger.error("[TFW.template.loadItemsFromFeed] Error loading "+d),TFW.playlist.advance())})}},TFW.feeds.Twitter={getTweets:function(){}},TFW.feeds.Facebook={getPagePosts:function(){}},TFW.feeds.RSS={getItems:function(){}},TFW.utils={},TFW.utils.Display={setBackgroundImage:function(a,b){$(a).css("background-image",'url("'+b+'")')}},TFW.content={getBackgroundSegmentProperty:function(a,b){var c=TFW.playlist.getSegmentProperty(a,TFW.playlist.data.background_segment);return void 0!==c?c:b},brandBackgroundImage:function(){var a=TFW.content.getBackgroundSegmentProperty("brandBackgroundImageFiles");if(void 0!==a){var b=parseInt(TFW.content.getBackgroundSegmentProperty("backgroundImage"));return new Asset(a[b])}},brandThemeImage:function(){var a=TFW.content.getBackgroundSegmentProperty("brandThemeImageFiles");if(void 0!==a){var b=parseInt(TFW.content.getBackgroundSegmentProperty("brand"));return new Asset(a[b])}},brandLogoImage:function(){var a=TFW.content.getBackgroundSegmentProperty("brandLogoImageFiles");if(void 0!==a){var b=parseInt(TFW.content.getBackgroundSegmentProperty("logoImage"));return new Asset(a[b])}},brandLogoNudge:function(){var a=TFW.content.getBackgroundSegmentProperty("logoNudge");if(void 0!==a)return a.split(",")},mainContentPosition:function(){var a=TFW.content.getBackgroundSegmentProperty("mainContentPosition");if(void 0!==a)return a.split(",")},mainContentSize:function(){var a=TFW.content.getBackgroundSegmentProperty("mainContentSize");if(void 0!==a)return a.split(",")},rotatingImages:function(){var a=TFW.content.getBackgroundSegmentProperty("rotatingImages");if(void 0!==a){var b=[];return $.each(a,function(a,c){b.push(new Asset(c))}),b}},rotatingImageDuration:function(){var a=TFW.content.getBackgroundSegmentProperty("rotatingImageDuration");if(void 0!==a)return parseInt(a)},getProperty:function(a,b){var c=TFW.layout.currentSegment,d=c.custom_properties.find(function(b){return b.name==a});return void 0!==d?TFW.content._processPropertyValue(d.value,d.editor_type):b},_getFilenameForUrl:function(a){return MFS.staticPath(a.substring(a.lastIndexOf("/")+1))},_processPropertyValue:function(a,b){return 1==b?TFW.content._getFilenameForUrl(a):3==b?($.each(a,function(b,c){a[b]=TFW.content._getFilenameForUrl(c)}),a):a}},TFW.device={dst:function(){return TFW.grabber.Device.profile.dst},latitude:function(){return TFW.grabber.Device.profile.latitude},longitude:function(){return TFW.grabber.Device.profile.longitude},timeZone:function(){return TFW.grabber.Device.profile.time_zone},utcOffset:function(){return TFW.grabber.Device.profile.utc_offset},zipCode:function(){return TFW.grabber.Device.profile.zip_code}};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment