From 0760ac80d4c13173e25475276e7233fd86a7fe1e Mon Sep 17 00:00:00 2001 From: Nistor Mihai Date: Thu, 21 May 2015 14:00:59 +0300 Subject: [PATCH] Squashed 'plugins/embed/' changes from 2f2eb27..6b1e7d6 6b1e7d6 feature: rhrnt theme added description of the blog. git-subtree-dir: plugins/embed git-subtree-split: 6b1e7d6e43f8f793fcea6459b2bc8f342567cdfe --- gui-resources/scripts/js/build/themes/rhrnt-section.js | 2 +- gui-resources/scripts/js/build/themes/rhrnt.js | 2 +- gui-themes/themes/rhrnt-section/container.dust | 5 +++++ gui-themes/themes/rhrnt/container.dust | 5 +++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/gui-resources/scripts/js/build/themes/rhrnt-section.js b/gui-resources/scripts/js/build/themes/rhrnt-section.js index 2302c18b5..d97e2f403 100644 --- a/gui-resources/scripts/js/build/themes/rhrnt-section.js +++ b/gui-resources/scripts/js/build/themes/rhrnt-section.js @@ -1,2 +1,2 @@ liveblog.define("plugins",{}),function(a,i){"function"==typeof liveblog.define&&liveblog.define.amd?liveblog.define("moment-timezone",["moment"],i):"object"==typeof exports?module.exports=i(require("moment")):i(a.moment)}(this,function(a){function i(a){return a>96?a-87:a>64?a-29:a-48}function e(a){var e,t=0,n=a.split("."),r=n[0],o=n[1]||"",c=1,s=0,A=1;for(45===a.charCodeAt(0)&&(t=1,A=-1),t;te;e++)a[e]=Math.round((a[e-1]||0)+6e4*a[e]);a[i-1]=1/0}function r(a,i){var e,t=[];for(e=0;e#')}return a.register("themeBase/plugins/permanent-link",i),i}(),{render:function(i,e){return a.render("themeBase/plugins/permanent-link",i,e)}}}),liveblog.define("plugins/permanent-link",["plugins","lib/utils","dust","lib/helpers/visibility-toggle","tmpl!themeBase/item/base","tmpl!themeBase/plugins/permanent-link"],function(a,i,e,t){return i.isClient?(a.permalink=function(){i.dispatcher.on("after-render.post-view",function(a){e.renderThemed("themeBase/plugins/permanent-link",{},function(i,e){a.$('[data-gimme="post.permanent-link-placeholder"]').html(e)});var i="";a.permalink&&"function"==typeof a.permalink&&(i=a.permalink(),a.$('[data-gimme="post.share-permalink"]').val(i),a.$('[data-gimme="post.permalink"]').attr("href",i))}),i.dispatcher.on("initialize.post-view",function(a){a.clientEvents({'click [data-gimme="post.permalink"]':"permalinkAction"}),a.permalinkAction=function(a){a.preventDefault(); -var i=this.$('[data-gimme="post.share-permalink"]');if(t(i)){var e=this.$('[data-gimme^="post.share"][data-gimme!="post.share-permalink"]');t(e,!1),i.trigger("focus")}},a.clientEvents({'click [data-gimme="post.share-permalink"]':"permalinkInput",'focus [data-gimme="post.share-permalink"]':"permalinkInput"}),a.permalinkInput=function(i){a.$(i.target).select()},a.delegateEvents()})},a.permalink):void 0}),function(){var a=[].indexOf||function(a){for(var i=0,e=this.length;e>i;i++)if(i in this&&this[i]===a)return i;return-1},i=[].slice;!function(a,i){return"function"==typeof liveblog.define&&liveblog.define.amd?liveblog.define("waypoints",["jquery"],function(e){return i(e,a)}):i(a.jQuery,a)}(window,function(e,t){var n,r,o,c,s,A,l,u,f,m,p,d,g,h,b,T;return n=e(t),u=a.call(t,"ontouchstart")>=0,c={horizontal:{},vertical:{}},s=1,l={},A="waypoints-context-id",p="resize.waypoints",d="scroll.waypoints",g=1,h="waypoints-waypoint-ids",b="waypoint",T="waypoints",r=function(){function a(a){var i=this;this.$element=a,this.element=a[0],this.didResize=!1,this.didScroll=!1,this.id="context"+s++,this.oldScroll={x:a.scrollLeft(),y:a.scrollTop()},this.waypoints={horizontal:{},vertical:{}},this.element[A]=this.id,l[this.id]=this,a.bind(d,function(){var a;return i.didScroll||u?void 0:(i.didScroll=!0,a=function(){return i.doScroll(),i.didScroll=!1},t.setTimeout(a,e[T].settings.scrollThrottle))}),a.bind(p,function(){var a;return i.didResize?void 0:(i.didResize=!0,a=function(){return e[T]("refresh"),i.didResize=!1},t.setTimeout(a,e[T].settings.resizeThrottle))})}return a.prototype.doScroll=function(){var a,i=this;return a={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}},!u||a.vertical.oldScroll&&a.vertical.newScroll||e[T]("refresh"),e.each(a,function(a,t){var n,r,o;return o=[],r=t.newScroll>t.oldScroll,n=r?t.forward:t.backward,e.each(i.waypoints[a],function(a,i){var e,n;return t.oldScroll<(e=i.offset)&&e<=t.newScroll?o.push(i):t.newScroll<(n=i.offset)&&n<=t.oldScroll?o.push(i):void 0}),o.sort(function(a,i){return a.offset-i.offset}),r||o.reverse(),e.each(o,function(a,i){return i.options.continuous||a===o.length-1?i.trigger([n]):void 0})}),this.oldScroll={x:a.horizontal.newScroll,y:a.vertical.newScroll}},a.prototype.refresh=function(){var a,i,t,n=this;return t=e.isWindow(this.element),i=this.$element.offset(),this.doScroll(),a={horizontal:{contextOffset:t?0:i.left,contextScroll:t?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:t?0:i.top,contextScroll:t?0:this.oldScroll.y,contextDimension:t?e[T]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}},e.each(a,function(a,i){return e.each(n.waypoints[a],function(a,t){var n,r,o,c,s;return n=t.options.offset,o=t.offset,r=e.isWindow(t.element)?0:t.$element.offset()[i.offsetProp],e.isFunction(n)?n=n.apply(t.element):"string"==typeof n&&(n=parseFloat(n),t.options.offset.indexOf("%")>-1&&(n=Math.ceil(i.contextDimension*n/100))),t.offset=r-i.contextOffset+i.contextScroll-n,t.options.onlyOnScroll&&null!=o||!t.enabled?void 0:null!==o&&o<(c=i.oldScroll)&&c<=t.offset?t.trigger([i.backward]):null!==o&&o>(s=i.oldScroll)&&s>=t.offset?t.trigger([i.forward]):null===o&&i.oldScroll>=t.offset?t.trigger([i.forward]):void 0})})},a.prototype.checkEmpty=function(){return e.isEmptyObject(this.waypoints.horizontal)&&e.isEmptyObject(this.waypoints.vertical)?(this.$element.unbind([p,d].join(" ")),delete l[this.id]):void 0},a}(),o=function(){function a(a,i,t){var n,r;"bottom-in-view"===t.offset&&(t.offset=function(){var a;return a=e[T]("viewportHeight"),e.isWindow(i.element)||(a=i.$element.height()),a-e(this).outerHeight()}),this.$element=a,this.element=a[0],this.axis=t.horizontal?"horizontal":"vertical",this.callback=t.handler,this.context=i,this.enabled=t.enabled,this.id="waypoints"+g++,this.offset=null,this.options=t,i.waypoints[this.axis][this.id]=this,c[this.axis][this.id]=this,n=null!=(r=this.element[h])?r:[],n.push(this.id),this.element[h]=n}return a.prototype.trigger=function(a){return this.enabled?(null!=this.callback&&this.callback.apply(this.element,a),this.options.triggerOnce?this.destroy():void 0):void 0},a.prototype.disable=function(){return this.enabled=!1},a.prototype.enable=function(){return this.context.refresh(),this.enabled=!0},a.prototype.destroy=function(){return delete c[this.axis][this.id],delete this.context.waypoints[this.axis][this.id],this.context.checkEmpty()},a.getWaypointsByElement=function(a){var i,t;return(t=a[h])?(i=e.extend({},c.horizontal,c.vertical),e.map(t,function(a){return i[a]})):[]},a}(),m={init:function(a,i){var t;return i=e.extend({},e.fn[b].defaults,i),null==(t=i.handler)&&(i.handler=a),this.each(function(){var a,t,n,c;return a=e(this),n=null!=(c=i.context)?c:e.fn[b].defaults.context,e.isWindow(n)||(n=a.closest(n)),n=e(n),t=l[n[0][A]],t||(t=new r(n)),new o(a,t,i)}),e[T]("refresh"),this},disable:function(){return m._invoke.call(this,"disable")},enable:function(){return m._invoke.call(this,"enable")},destroy:function(){return m._invoke.call(this,"destroy")},prev:function(a,i){return m._traverse.call(this,a,i,function(a,i,e){return i>0?a.push(e[i-1]):void 0})},next:function(a,i){return m._traverse.call(this,a,i,function(a,i,e){return ia.oldScroll.y})},left:function(a){return null==a&&(a=t),f._filter(a,"horizontal",function(a,i){return i.offset<=a.oldScroll.x})},right:function(a){return null==a&&(a=t),f._filter(a,"horizontal",function(a,i){return i.offset>a.oldScroll.x})},enable:function(){return f._invoke("enable")},disable:function(){return f._invoke("disable")},destroy:function(){return f._invoke("destroy")},extendFn:function(a,i){return m[a]=i},_invoke:function(a){var i;return i=e.extend({},c.vertical,c.horizontal),e.each(i,function(i,e){return e[a](),!0})},_filter:function(a,i,t){var n,r;return(n=l[e(a)[0][A]])?(r=[],e.each(n.waypoints[i],function(a,i){return t(n,i)?r.push(i):void 0}),r.sort(function(a,i){return a.offset-i.offset}),e.map(r,function(a){return a.element})):[]}},e[T]=function(){var a,e;return e=arguments[0],a=2<=arguments.length?i.call(arguments,1):[],f[e]?f[e].apply(null,a):f.aggregate.call(null,e)},e[T].settings={resizeThrottle:100,scrollThrottle:30},n.on("load.waypoints",function(){return e[T]("refresh")})})}.call(this),liveblog.require.config({paths:{twitterWidgets:"//platform.twitter.com/widgets"},shim:{twitterWidgets:{exports:"twttr"}}}),liveblog.define("plugins/twitter-widgets",["underscore","backbone","plugins","dust","lib/utils"],function(a,i,e,t,n){return e["twitter-widgets"]=function(){if(n.isClient){n.dispatcher.on("before-render.post-view",function(a){"source/twitter"===a.model.get("item")&&(a.parentView()._twitterPosts||(a.parentView()._twitterPosts=[]),a.parentView()._twitterPosts.push(a))}),n.dispatcher.on("add-all.posts-view",function(a){i(a)});var i=function(i){i._twitterPosts&&liveblog.require(["twitterWidgets","waypoints"],function(e){e.ready(function(){a.each(i._twitterPosts,function(a){a.$el.waypoint(function(){var i=a.model.get("Meta").id_str;e.widgets.createTweet(i,a.$el.find(".post-content-full").get(0),function(){a.$el.find(".post-core-content").remove()},{cards:"all"})},{triggerOnce:!0,offset:"120%",context:i.el})}),i._twitterPosts=[]})},function(){})}}},e["twitter-widgets"]}),liveblog.define("plugins/pagination",["plugins","lib/utils"],function(a,i){return a.pagination=function(){i.dispatcher.once("initialize.posts-view",function(a){a.collection.clearPaginationParams(),liveblog.limit&&(a.collection.syncParams.pagination.limit=parseInt(liveblog.limit,10)),a.flags.loadingNextPage=!1,a.updateNextPageOffset=function(){this.collection.syncParams.pagination.offset=this.collection.length},a.topPage=function(){return delete this.collection.syncParams.pagination["order.end"],this.collection.syncParams.pagination.offset=0,this.collection.fetchPage({reset:!0})},a.nextPage=function(){if(!this.flags.loadingNextPage&&this.hasNextPage()){i.dispatcher.trigger("loading.posts-view",this),this.flags.loadingNextPage=!0,this.updateNextPageOffset();var a=this;return this.collection.fetchPage().done(function(){a.flags.loadingNextPage=!1,i.dispatcher.trigger("loaded.posts-view",a)})}},a.hasNextPage=function(){return this.collection.length').helper("i18n",i,{},{msgid:"Load more posts ..."}).write("")}function s(a,i){return i=i.shiftBlocks(l),a.write('')}function A(a,i){return i=i.shiftBlocks(l),a.write('data-gimme="posts.nextPage"')}a.register("themeBase/plugins/after-button-pagination",i);var l={itemClass:t,main:n,loadNext:c,loadingNext:s,additionalAttributes:A};return i}(),{render:function(i,e){return a.render("themeBase/plugins/after-button-pagination",i,e)}}}),liveblog.define("tmpl!themeBase/plugins/before-button-pagination",["dust"],function(a){return function(){function i(a,i){return i=i.shiftBlocks(l),a.partial(e,i,null)}function e(a,i){return i=i.shiftBlocks(l),a.reference(i.get(["baseItem"],!1),i,"h")}function t(a,i){return i=i.shiftBlocks(l),a.write("load-next")}function n(a,i){return i=i.shiftBlocks(l),a.block(i.getBlock("loadNext"),i,{block:r},null).block(i.getBlock("loadingNext"),i,{block:o},null)}function r(a,i){return i=i.shiftBlocks(l),a}function o(a,i){return i=i.shiftBlocks(l),a}function c(a,i){return i=i.shiftBlocks(l),a.write('Load top posts')}function s(a,i){return i=i.shiftBlocks(l),a.write('')}function A(a,i){return i=i.shiftBlocks(l),a.write('data-gimme="posts.beforePage"')}a.register("themeBase/plugins/before-button-pagination",i);var l={itemClass:t,main:n,loadNext:c,loadingNext:s,additionalAttributes:A};return i}(),{render:function(i,e){return a.render("themeBase/plugins/before-button-pagination",i,e)}}}),liveblog.define("plugins/button-pagination",["backbone","plugins","plugins/pagination","dust","lib/utils","lib/helpers/display-toggle","tmpl!themeBase/item/base","tmpl!themeBase/plugins/after-button-pagination","tmpl!themeBase/plugins/before-button-pagination"],function(a,i,e,t,n,r){return delete i.pagination,i["button-pagination"]=function(i){e(i),n.dispatcher.on("initialize.blog-view",function(a){a.clientEvents({'click [data-gimme="posts.to-top"]':"toTop"}),a.toTop=function(){var a=this.$el.offset();window.scrollTo(a.left,a.top)}}),n.dispatcher.once("add-all.posts-view",function(i){var e={};e.baseItem=t.themed("themeBase/item/base"),0===i.$('[data-gimme="posts.beforePage"]').length&&t.renderThemed("themeBase/plugins/before-button-pagination",e,function(e,t){var n=a.$(t);r(n,!1),i.$el.prepend(n)}),0===i.$('[data-gimme="posts.nextPage"]').length&&t.renderThemed("themeBase/plugins/after-button-pagination",e,function(e,t){var n=a.$(t);r(n,!1),i.$el.append(n)})}),n.dispatcher.once("add-all.posts-view",function(a){a.checkNextPage(),a.checkTopPage()}),n.dispatcher.once("initialize.posts-view",function(a){a.clientEvents({'click [data-gimme="posts.nextPage"]':"buttonNextPage",'click [data-gimme="posts.beforePage"]':"buttonTopPage"}),a.checkTopPage=function(){r(this.$('[data-gimme="posts.beforePage"]'),this.hasTopPage())},a.checkNextPage=function(){r(this.$('[data-gimme="posts.nextPage"]'),this.hasNextPage()),n.dispatcher.trigger("pagination-next-updated.posts-view",this)},a.buttonNextPage=function(){a.flags.buttonNextPage=!0;var i=a.$('[data-gimme="posts.nextPage"]');i.addClass("loading"),a.nextPage().done(function(){a.flags.buttonNextPage=!1,i.removeClass("loading"),a.checkNextPage()})},a.buttonTopPage=function(){var i=a.$('[data-gimme="posts.beforePage"]');i.addClass("loading"),a.flags.topPage=!1,a.topPage().done(function(){i.removeClass("loading"),r(i,!1),a.checkNextPage()})}})},i["button-pagination"]}),liveblog.define("tmpl!theme/container",["dust"],function(a){return function(){function i(a,i){return i=i.shiftBlocks(s),a.partial("themeBase/container",i,null)}function e(a,i){return i=i.shiftBlocks(s),a}function t(a,i){return i=i.shiftBlocks(s),a}function n(a,i){return i=i.shiftBlocks(s),a.block(i.getBlock("status"),i,{block:r},null).block(i.getBlock("statusNewPost"),i,{block:o},null)}function r(a,i){return i=i.shiftBlocks(s),a}function o(a,i){return i=i.shiftBlocks(s),a}function c(a,i){return i=i.shiftBlocks(s),a}a.register("theme/container",i);var s={headerContainer:e,userComment:t,contentTop:n,contentBottom:c};return i}(),{render:function(i,e){return a.render("theme/container",i,e)}}}),liveblog.define("tmpl!theme/item/base",["dust"],function(a){return function(){function i(a,i){return i=i.shiftBlocks(A),a.partial("themeBase/item/base",i,null)}function e(a,i){return i=i.shiftBlocks(A),a.block(i.getBlock("userAvatar"),i,{block:t},null).block(i.getBlock("verificationLabel"),i,{block:n},null).block(i.getBlock("postDateContainer"),i,{block:r},null).block(i.getBlock("userNameContainer"),i,{block:o},null).block(i.getBlock("shareContainer"),i,{block:c},null)}function t(a,i){return i=i.shiftBlocks(A),a}function n(a,i){return i=i.shiftBlocks(A),a}function r(a,i){return i=i.shiftBlocks(A),a}function o(a,i){return i=i.shiftBlocks(A),a}function c(a,i){return i=i.shiftBlocks(A),a}function s(a,i){return i=i.shiftBlocks(A),a}a.register("theme/item/base",i);var A={header:e,contentSideContainer:s};return i}(),{render:function(i,e){return a.render("theme/item/base",i,e)}}}),liveblog.define("themeFile",["plugins/wrappup-toggle","plugins/permanent-link","plugins/twitter-widgets","plugins/button-pagination","tmpl!theme/container","tmpl!theme/item/base","css!theme/liveblog"],function(){return{plugins:["wrappup-toggle","permanent-link","twitter-widgets","button-pagination"]}}); \ No newline at end of file +var i=this.$('[data-gimme="post.share-permalink"]');if(t(i)){var e=this.$('[data-gimme^="post.share"][data-gimme!="post.share-permalink"]');t(e,!1),i.trigger("focus")}},a.clientEvents({'click [data-gimme="post.share-permalink"]':"permalinkInput",'focus [data-gimme="post.share-permalink"]':"permalinkInput"}),a.permalinkInput=function(i){a.$(i.target).select()},a.delegateEvents()})},a.permalink):void 0}),function(){var a=[].indexOf||function(a){for(var i=0,e=this.length;e>i;i++)if(i in this&&this[i]===a)return i;return-1},i=[].slice;!function(a,i){return"function"==typeof liveblog.define&&liveblog.define.amd?liveblog.define("waypoints",["jquery"],function(e){return i(e,a)}):i(a.jQuery,a)}(window,function(e,t){var n,r,o,c,s,A,l,u,f,m,p,d,g,h,b,T;return n=e(t),u=a.call(t,"ontouchstart")>=0,c={horizontal:{},vertical:{}},s=1,l={},A="waypoints-context-id",p="resize.waypoints",d="scroll.waypoints",g=1,h="waypoints-waypoint-ids",b="waypoint",T="waypoints",r=function(){function a(a){var i=this;this.$element=a,this.element=a[0],this.didResize=!1,this.didScroll=!1,this.id="context"+s++,this.oldScroll={x:a.scrollLeft(),y:a.scrollTop()},this.waypoints={horizontal:{},vertical:{}},this.element[A]=this.id,l[this.id]=this,a.bind(d,function(){var a;return i.didScroll||u?void 0:(i.didScroll=!0,a=function(){return i.doScroll(),i.didScroll=!1},t.setTimeout(a,e[T].settings.scrollThrottle))}),a.bind(p,function(){var a;return i.didResize?void 0:(i.didResize=!0,a=function(){return e[T]("refresh"),i.didResize=!1},t.setTimeout(a,e[T].settings.resizeThrottle))})}return a.prototype.doScroll=function(){var a,i=this;return a={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}},!u||a.vertical.oldScroll&&a.vertical.newScroll||e[T]("refresh"),e.each(a,function(a,t){var n,r,o;return o=[],r=t.newScroll>t.oldScroll,n=r?t.forward:t.backward,e.each(i.waypoints[a],function(a,i){var e,n;return t.oldScroll<(e=i.offset)&&e<=t.newScroll?o.push(i):t.newScroll<(n=i.offset)&&n<=t.oldScroll?o.push(i):void 0}),o.sort(function(a,i){return a.offset-i.offset}),r||o.reverse(),e.each(o,function(a,i){return i.options.continuous||a===o.length-1?i.trigger([n]):void 0})}),this.oldScroll={x:a.horizontal.newScroll,y:a.vertical.newScroll}},a.prototype.refresh=function(){var a,i,t,n=this;return t=e.isWindow(this.element),i=this.$element.offset(),this.doScroll(),a={horizontal:{contextOffset:t?0:i.left,contextScroll:t?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:t?0:i.top,contextScroll:t?0:this.oldScroll.y,contextDimension:t?e[T]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}},e.each(a,function(a,i){return e.each(n.waypoints[a],function(a,t){var n,r,o,c,s;return n=t.options.offset,o=t.offset,r=e.isWindow(t.element)?0:t.$element.offset()[i.offsetProp],e.isFunction(n)?n=n.apply(t.element):"string"==typeof n&&(n=parseFloat(n),t.options.offset.indexOf("%")>-1&&(n=Math.ceil(i.contextDimension*n/100))),t.offset=r-i.contextOffset+i.contextScroll-n,t.options.onlyOnScroll&&null!=o||!t.enabled?void 0:null!==o&&o<(c=i.oldScroll)&&c<=t.offset?t.trigger([i.backward]):null!==o&&o>(s=i.oldScroll)&&s>=t.offset?t.trigger([i.forward]):null===o&&i.oldScroll>=t.offset?t.trigger([i.forward]):void 0})})},a.prototype.checkEmpty=function(){return e.isEmptyObject(this.waypoints.horizontal)&&e.isEmptyObject(this.waypoints.vertical)?(this.$element.unbind([p,d].join(" ")),delete l[this.id]):void 0},a}(),o=function(){function a(a,i,t){var n,r;"bottom-in-view"===t.offset&&(t.offset=function(){var a;return a=e[T]("viewportHeight"),e.isWindow(i.element)||(a=i.$element.height()),a-e(this).outerHeight()}),this.$element=a,this.element=a[0],this.axis=t.horizontal?"horizontal":"vertical",this.callback=t.handler,this.context=i,this.enabled=t.enabled,this.id="waypoints"+g++,this.offset=null,this.options=t,i.waypoints[this.axis][this.id]=this,c[this.axis][this.id]=this,n=null!=(r=this.element[h])?r:[],n.push(this.id),this.element[h]=n}return a.prototype.trigger=function(a){return this.enabled?(null!=this.callback&&this.callback.apply(this.element,a),this.options.triggerOnce?this.destroy():void 0):void 0},a.prototype.disable=function(){return this.enabled=!1},a.prototype.enable=function(){return this.context.refresh(),this.enabled=!0},a.prototype.destroy=function(){return delete c[this.axis][this.id],delete this.context.waypoints[this.axis][this.id],this.context.checkEmpty()},a.getWaypointsByElement=function(a){var i,t;return(t=a[h])?(i=e.extend({},c.horizontal,c.vertical),e.map(t,function(a){return i[a]})):[]},a}(),m={init:function(a,i){var t;return i=e.extend({},e.fn[b].defaults,i),null==(t=i.handler)&&(i.handler=a),this.each(function(){var a,t,n,c;return a=e(this),n=null!=(c=i.context)?c:e.fn[b].defaults.context,e.isWindow(n)||(n=a.closest(n)),n=e(n),t=l[n[0][A]],t||(t=new r(n)),new o(a,t,i)}),e[T]("refresh"),this},disable:function(){return m._invoke.call(this,"disable")},enable:function(){return m._invoke.call(this,"enable")},destroy:function(){return m._invoke.call(this,"destroy")},prev:function(a,i){return m._traverse.call(this,a,i,function(a,i,e){return i>0?a.push(e[i-1]):void 0})},next:function(a,i){return m._traverse.call(this,a,i,function(a,i,e){return ia.oldScroll.y})},left:function(a){return null==a&&(a=t),f._filter(a,"horizontal",function(a,i){return i.offset<=a.oldScroll.x})},right:function(a){return null==a&&(a=t),f._filter(a,"horizontal",function(a,i){return i.offset>a.oldScroll.x})},enable:function(){return f._invoke("enable")},disable:function(){return f._invoke("disable")},destroy:function(){return f._invoke("destroy")},extendFn:function(a,i){return m[a]=i},_invoke:function(a){var i;return i=e.extend({},c.vertical,c.horizontal),e.each(i,function(i,e){return e[a](),!0})},_filter:function(a,i,t){var n,r;return(n=l[e(a)[0][A]])?(r=[],e.each(n.waypoints[i],function(a,i){return t(n,i)?r.push(i):void 0}),r.sort(function(a,i){return a.offset-i.offset}),e.map(r,function(a){return a.element})):[]}},e[T]=function(){var a,e;return e=arguments[0],a=2<=arguments.length?i.call(arguments,1):[],f[e]?f[e].apply(null,a):f.aggregate.call(null,e)},e[T].settings={resizeThrottle:100,scrollThrottle:30},n.on("load.waypoints",function(){return e[T]("refresh")})})}.call(this),liveblog.require.config({paths:{twitterWidgets:"//platform.twitter.com/widgets"},shim:{twitterWidgets:{exports:"twttr"}}}),liveblog.define("plugins/twitter-widgets",["underscore","backbone","plugins","dust","lib/utils"],function(a,i,e,t,n){return e["twitter-widgets"]=function(){if(n.isClient){n.dispatcher.on("before-render.post-view",function(a){"source/twitter"===a.model.get("item")&&(a.parentView()._twitterPosts||(a.parentView()._twitterPosts=[]),a.parentView()._twitterPosts.push(a))}),n.dispatcher.on("add-all.posts-view",function(a){i(a)});var i=function(i){i._twitterPosts&&liveblog.require(["twitterWidgets","waypoints"],function(e){e.ready(function(){a.each(i._twitterPosts,function(a){a.$el.waypoint(function(){var i=a.model.get("Meta").id_str;e.widgets.createTweet(i,a.$el.find(".post-content-full").get(0),function(){a.$el.find(".post-core-content").remove()},{cards:"all"})},{triggerOnce:!0,offset:"120%",context:i.el})}),i._twitterPosts=[]})},function(){})}}},e["twitter-widgets"]}),liveblog.define("plugins/pagination",["plugins","lib/utils"],function(a,i){return a.pagination=function(){i.dispatcher.once("initialize.posts-view",function(a){a.collection.clearPaginationParams(),liveblog.limit&&(a.collection.syncParams.pagination.limit=parseInt(liveblog.limit,10)),a.flags.loadingNextPage=!1,a.updateNextPageOffset=function(){this.collection.syncParams.pagination.offset=this.collection.length},a.topPage=function(){return delete this.collection.syncParams.pagination["order.end"],this.collection.syncParams.pagination.offset=0,this.collection.fetchPage({reset:!0})},a.nextPage=function(){if(!this.flags.loadingNextPage&&this.hasNextPage()){i.dispatcher.trigger("loading.posts-view",this),this.flags.loadingNextPage=!0,this.updateNextPageOffset();var a=this;return this.collection.fetchPage().done(function(){a.flags.loadingNextPage=!1,i.dispatcher.trigger("loaded.posts-view",a)})}},a.hasNextPage=function(){return this.collection.length').helper("i18n",i,{},{msgid:"Load more posts ..."}).write("")}function s(a,i){return i=i.shiftBlocks(l),a.write('')}function A(a,i){return i=i.shiftBlocks(l),a.write('data-gimme="posts.nextPage"')}a.register("themeBase/plugins/after-button-pagination",i);var l={itemClass:t,main:n,loadNext:c,loadingNext:s,additionalAttributes:A};return i}(),{render:function(i,e){return a.render("themeBase/plugins/after-button-pagination",i,e)}}}),liveblog.define("tmpl!themeBase/plugins/before-button-pagination",["dust"],function(a){return function(){function i(a,i){return i=i.shiftBlocks(l),a.partial(e,i,null)}function e(a,i){return i=i.shiftBlocks(l),a.reference(i.get(["baseItem"],!1),i,"h")}function t(a,i){return i=i.shiftBlocks(l),a.write("load-next")}function n(a,i){return i=i.shiftBlocks(l),a.block(i.getBlock("loadNext"),i,{block:r},null).block(i.getBlock("loadingNext"),i,{block:o},null)}function r(a,i){return i=i.shiftBlocks(l),a}function o(a,i){return i=i.shiftBlocks(l),a}function c(a,i){return i=i.shiftBlocks(l),a.write('Load top posts')}function s(a,i){return i=i.shiftBlocks(l),a.write('')}function A(a,i){return i=i.shiftBlocks(l),a.write('data-gimme="posts.beforePage"')}a.register("themeBase/plugins/before-button-pagination",i);var l={itemClass:t,main:n,loadNext:c,loadingNext:s,additionalAttributes:A};return i}(),{render:function(i,e){return a.render("themeBase/plugins/before-button-pagination",i,e)}}}),liveblog.define("plugins/button-pagination",["backbone","plugins","plugins/pagination","dust","lib/utils","lib/helpers/display-toggle","tmpl!themeBase/item/base","tmpl!themeBase/plugins/after-button-pagination","tmpl!themeBase/plugins/before-button-pagination"],function(a,i,e,t,n,r){return delete i.pagination,i["button-pagination"]=function(i){e(i),n.dispatcher.on("initialize.blog-view",function(a){a.clientEvents({'click [data-gimme="posts.to-top"]':"toTop"}),a.toTop=function(){var a=this.$el.offset();window.scrollTo(a.left,a.top)}}),n.dispatcher.once("add-all.posts-view",function(i){var e={};e.baseItem=t.themed("themeBase/item/base"),0===i.$('[data-gimme="posts.beforePage"]').length&&t.renderThemed("themeBase/plugins/before-button-pagination",e,function(e,t){var n=a.$(t);r(n,!1),i.$el.prepend(n)}),0===i.$('[data-gimme="posts.nextPage"]').length&&t.renderThemed("themeBase/plugins/after-button-pagination",e,function(e,t){var n=a.$(t);r(n,!1),i.$el.append(n)})}),n.dispatcher.once("add-all.posts-view",function(a){a.checkNextPage(),a.checkTopPage()}),n.dispatcher.once("initialize.posts-view",function(a){a.clientEvents({'click [data-gimme="posts.nextPage"]':"buttonNextPage",'click [data-gimme="posts.beforePage"]':"buttonTopPage"}),a.checkTopPage=function(){r(this.$('[data-gimme="posts.beforePage"]'),this.hasTopPage())},a.checkNextPage=function(){r(this.$('[data-gimme="posts.nextPage"]'),this.hasNextPage()),n.dispatcher.trigger("pagination-next-updated.posts-view",this)},a.buttonNextPage=function(){a.flags.buttonNextPage=!0;var i=a.$('[data-gimme="posts.nextPage"]');i.addClass("loading"),a.nextPage().done(function(){a.flags.buttonNextPage=!1,i.removeClass("loading"),a.checkNextPage()})},a.buttonTopPage=function(){var i=a.$('[data-gimme="posts.beforePage"]');i.addClass("loading"),a.flags.topPage=!1,a.topPage().done(function(){i.removeClass("loading"),r(i,!1),a.checkNextPage()})}})},i["button-pagination"]}),liveblog.define("tmpl!theme/container",["dust"],function(a){return function(){function i(a,i){return i=i.shiftBlocks(l),a.partial("themeBase/container",i,null)}function e(a,i){return i=i.shiftBlocks(l),a.write('
').block(i.getBlock("header"),i,{block:t},null).write("
")}function t(a,i){return i=i.shiftBlocks(l),a.block(i.getBlock("blogDescription"),i,{block:n},null)}function n(a,i){return i=i.shiftBlocks(l),a}function r(a,i){return i=i.shiftBlocks(l),a}function o(a,i){return i=i.shiftBlocks(l),a.block(i.getBlock("status"),i,{block:c},null).block(i.getBlock("statusNewPost"),i,{block:s},null)}function c(a,i){return i=i.shiftBlocks(l),a}function s(a,i){return i=i.shiftBlocks(l),a}function A(a,i){return i=i.shiftBlocks(l),a}a.register("theme/container",i);var l={headerContainer:e,userComment:r,contentTop:o,contentBottom:A};return i}(),{render:function(i,e){return a.render("theme/container",i,e)}}}),liveblog.define("tmpl!theme/item/base",["dust"],function(a){return function(){function i(a,i){return i=i.shiftBlocks(A),a.partial("themeBase/item/base",i,null)}function e(a,i){return i=i.shiftBlocks(A),a.block(i.getBlock("userAvatar"),i,{block:t},null).block(i.getBlock("verificationLabel"),i,{block:n},null).block(i.getBlock("postDateContainer"),i,{block:r},null).block(i.getBlock("userNameContainer"),i,{block:o},null).block(i.getBlock("shareContainer"),i,{block:c},null)}function t(a,i){return i=i.shiftBlocks(A),a}function n(a,i){return i=i.shiftBlocks(A),a}function r(a,i){return i=i.shiftBlocks(A),a}function o(a,i){return i=i.shiftBlocks(A),a}function c(a,i){return i=i.shiftBlocks(A),a}function s(a,i){return i=i.shiftBlocks(A),a}a.register("theme/item/base",i);var A={header:e,contentSideContainer:s};return i}(),{render:function(i,e){return a.render("theme/item/base",i,e)}}}),liveblog.define("themeFile",["plugins/wrappup-toggle","plugins/permanent-link","plugins/twitter-widgets","plugins/button-pagination","tmpl!theme/container","tmpl!theme/item/base","css!theme/liveblog"],function(){return{plugins:["wrappup-toggle","permanent-link","twitter-widgets","button-pagination"]}}); \ No newline at end of file diff --git a/gui-resources/scripts/js/build/themes/rhrnt.js b/gui-resources/scripts/js/build/themes/rhrnt.js index a0d59b40c..604b9cc14 100644 --- a/gui-resources/scripts/js/build/themes/rhrnt.js +++ b/gui-resources/scripts/js/build/themes/rhrnt.js @@ -1,2 +1,2 @@ liveblog.define("plugins",{}),function(e,i){"function"==typeof liveblog.define&&liveblog.define.amd?liveblog.define("moment-timezone",["moment"],i):"object"==typeof exports?module.exports=i(require("moment")):i(e.moment)}(this,function(e){function i(e){return e>96?e-87:e>64?e-29:e-48}function a(e){var a,t=0,n=e.split("."),r=n[0],o=n[1]||"",c=1,s=0,l=1;for(45===e.charCodeAt(0)&&(t=1,l=-1),t;ta;a++)e[a]=Math.round((e[a-1]||0)+6e4*e[a]);e[i-1]=1/0}function r(e,i){var a,t=[];for(a=0;a#') -}return e.register("themeBase/plugins/permanent-link",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/permanent-link",i,a)}}}),liveblog.define("plugins/permanent-link",["plugins","lib/utils","dust","lib/helpers/visibility-toggle","tmpl!themeBase/item/base","tmpl!themeBase/plugins/permanent-link"],function(e,i,a,t){return i.isClient?(e.permalink=function(){i.dispatcher.on("after-render.post-view",function(e){a.renderThemed("themeBase/plugins/permanent-link",{},function(i,a){e.$('[data-gimme="post.permanent-link-placeholder"]').html(a)});var i="";e.permalink&&"function"==typeof e.permalink&&(i=e.permalink(),e.$('[data-gimme="post.share-permalink"]').val(i),e.$('[data-gimme="post.permalink"]').attr("href",i))}),i.dispatcher.on("initialize.post-view",function(e){e.clientEvents({'click [data-gimme="post.permalink"]':"permalinkAction"}),e.permalinkAction=function(e){e.preventDefault();var i=this.$('[data-gimme="post.share-permalink"]');if(t(i)){var a=this.$('[data-gimme^="post.share"][data-gimme!="post.share-permalink"]');t(a,!1),i.trigger("focus")}},e.clientEvents({'click [data-gimme="post.share-permalink"]':"permalinkInput",'focus [data-gimme="post.share-permalink"]':"permalinkInput"}),e.permalinkInput=function(i){e.$(i.target).select()},e.delegateEvents()})},e.permalink):void 0}),liveblog.define("lib/helpers/format-commentator",["underscore","lib/gettext"],function(e,i){return function(e){return e=e.replace("commentator",""),i.sprintf(i.gettext("%(full_name)s commentator"),{full_name:e})}}),liveblog.define("lib/helpers/adjust-server-post",["underscore"],function(){return function(e){var i="infomercial";return"advertisement"===e.Type.Key&&(e.Type.Key=i),"advertisement"===e.Author.Source.Name&&(e.Author.Source.Name=i),"smsblog"===e.Author.Source.Type.Key&&(e.Author.Source.IsModifiable="False",e.Author.Source.Name="sms"),e.Author.Source&&"embed"===e.Author.Source.Name&&(e.Author.Source.IsModifiable="False",e.Author.Source.Name="comments"),e}}),liveblog.define("models/comment",["underscore","backbone-custom","models/base-model","collections/posts","lib/utils"],function(e,i,a){return a.extend({setUrlRoot:function(e){this.urlRoot=e}})}),liveblog.define("plugins/user-comments-popup",["underscore","backbone-custom","views/base-view","lib/helpers/display-toggle","models/comment"],function(e,i,a,t,n){return a.extend({messageDisplayTime:5e3,initialize:function(){this.clientEvents({'click [data-gimme="blog.comment"]':"togglePopup","click #comment-message-btn":"showAfterMessage","click .button.cancel":"togglePopup","click .button.send":"send"}),this.popup=this.$('[data-gimme="blog.comment-box-holder"]'),t(this.popup,!1),this.popup_message=this.$('[data-gimme="blog.comment-box-message"]'),t(this.popup_message,!1),this.username=this.$('[data-gimme="blog.comment-nickname"]'),this.text=this.$('[data-gimme="blog.comment-text"]'),this.resetInput(),this.backdropel=this.$('[data-gimme="blog.comment-backdrop"]'),this.backdropel.data("show-status",0),this.lbpostlist=this.backdropel.parent()},togglePopup:function(e){var i=this,a=i.backdropel.data("show-status");switch(e.preventDefault(),a){case 0:t(i.popup,!0),i.backdropel.data("show-status",1),t(i.backdropel,!0),i.lbpostlist.addClass("comment-active"),i.blogview.stopPoller();break;case 1:i.backdropel.data("show-status",0).hide(),t(i.popup_message,!1),i.resetInput(),i.lbpostlist.removeClass("comment-active"),t(i.popup,!1),i.blogview.starPoller();break;case 2:t(i.popup_message,!1),i.resetInput(),i.lbpostlist.removeClass("comment-active"),t(i.popup,!1),i.blogview.starPoller()}},send:function(e){e.preventDefault();var i=this;if(this.isValid()){var a=new n,t={UserName:this.username.val(),CommentText:this.text.val()};a.setUrlRoot(this.model.get("CommentPost").href),a.save(t,{success:function(){i.showAfterMessage(e),i.resetInput()},error:function(){i.showAfterMessage(e),i.resetInput()},crossDomain:!0,type:"post"})}},resetInput:function(){this.username.val(""),this.text.val(""),t(this.$(".error"),!1)},showAfterMessage:function(){var e=this;e.backdropel.data("show-status",2),t(e.backdropel,!0),t(e.popup),e.backdropel.data("show-status",1),t(this.popup_message,!0),setTimeout(function(){t(e.popup_message,!1),e.backdropel.data("show-status",0),t(e.backdropel,!1),e.blogview.starPoller()},e.messageDisplayTime)},isValid:function(){return this.username.val()?t(this.username.next(".error"),!1):t(this.username.next(".error"),!0),this.text.val()?t(this.text.next(".error"),!1):t(this.text.next(".error"),!0),0===this.$(".error:visible").length}})}),liveblog.define("tmpl!themeBase/plugins/user-comment-message",["dust"],function(e){return function(){function i(e,i){return e.write('
').helper("i18n",i,{},{msgid:"Your message was sent for approval"}).write("
")}return e.register("themeBase/plugins/user-comment-message",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/user-comment-message",i,a)}}}),liveblog.define("tmpl!themeBase/plugins/user-comment-backdrop",["dust"],function(e){return function(){function i(e){return e.write('
')}return e.register("themeBase/plugins/user-comment-backdrop",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/user-comment-backdrop",i,a)}}}),liveblog.define("tmpl!themeBase/plugins/user-comment-action",["dust"],function(e){return function(){function i(e,i){return e.write('").helper("i18n",i,{},{msgid:"comment"}).write("")}function a(e){return e.write(' style="display:none" ')}function t(e){return e.write(' style="display:block" ')}return e.register("themeBase/plugins/user-comment-action",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/user-comment-action",i,a)}}}),liveblog.define("tmpl!themeBase/plugins/user-comment",["dust"],function(e){return function(){function i(e,i){return e.write('
').helper("i18n",i,{},{msgid:"Please fill in your Nickname."}).write('
').helper("i18n",i,{},{msgid:"Please fill in your Comment text."}).write('
').helper("i18n",i,{},{msgid:"Please fill in text from image."}).write('
")}return e.register("themeBase/plugins/user-comment",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/user-comment",i,a)}}}),liveblog.define("plugins/user-comments",["plugins","plugins/user-comments-popup","lib/utils","dust","lib/helpers/display-toggle","tmpl!themeBase/plugins/user-comment-message","tmpl!themeBase/plugins/user-comment-backdrop","tmpl!themeBase/plugins/user-comment-action","tmpl!themeBase/plugins/user-comment"],function(e,i,a,t,n){return e["user-comments"]=function(e){a.dispatcher.on("config-update.blog-view",function(e){n(e.$('[data-gimme="blog.comment"]'),e.model.get("EmbedConfig").UserComments)}),a.dispatcher.on("conditional-render.blog-view",function(r){if(t.renderThemed("themeBase/plugins/user-comment-action",{UserComments:r.model.get("EmbedConfig").UserComments},function(e,i){r.$('[data-gimme="blog.comment-action"]').html(i)}),n(r.$('[data-gimme="blog.comment"]'),e.UserComments),t.renderThemed("themeBase/plugins/user-comment",{},function(e,i){r.$('[data-gimme="blog.comment-box"]').html(i)}),t.renderThemed("themeBase/plugins/user-comment-message",{},function(e,i){r.$('[data-gimme="blog.comment-box-message"]').html(i)}),t.renderThemed("themeBase/plugins/user-comment-backdrop",{},function(e,i){r.$('[data-gimme="blog.comment-box-backdrop"]').html(i)}),a.isClient){new i({el:r.el,blogview:r,model:r.model})}})},e["user-comments"]}),function(){var e=[].indexOf||function(e){for(var i=0,a=this.length;a>i;i++)if(i in this&&this[i]===e)return i;return-1},i=[].slice;!function(e,i){return"function"==typeof liveblog.define&&liveblog.define.amd?liveblog.define("waypoints",["jquery"],function(a){return i(a,e)}):i(e.jQuery,e)}(window,function(a,t){var n,r,o,c,s,l,u,A,m,f,p,d,g,h,b,T;return n=a(t),A=e.call(t,"ontouchstart")>=0,c={horizontal:{},vertical:{}},s=1,u={},l="waypoints-context-id",p="resize.waypoints",d="scroll.waypoints",g=1,h="waypoints-waypoint-ids",b="waypoint",T="waypoints",r=function(){function e(e){var i=this;this.$element=e,this.element=e[0],this.didResize=!1,this.didScroll=!1,this.id="context"+s++,this.oldScroll={x:e.scrollLeft(),y:e.scrollTop()},this.waypoints={horizontal:{},vertical:{}},this.element[l]=this.id,u[this.id]=this,e.bind(d,function(){var e;return i.didScroll||A?void 0:(i.didScroll=!0,e=function(){return i.doScroll(),i.didScroll=!1},t.setTimeout(e,a[T].settings.scrollThrottle))}),e.bind(p,function(){var e;return i.didResize?void 0:(i.didResize=!0,e=function(){return a[T]("refresh"),i.didResize=!1},t.setTimeout(e,a[T].settings.resizeThrottle))})}return e.prototype.doScroll=function(){var e,i=this;return e={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}},!A||e.vertical.oldScroll&&e.vertical.newScroll||a[T]("refresh"),a.each(e,function(e,t){var n,r,o;return o=[],r=t.newScroll>t.oldScroll,n=r?t.forward:t.backward,a.each(i.waypoints[e],function(e,i){var a,n;return t.oldScroll<(a=i.offset)&&a<=t.newScroll?o.push(i):t.newScroll<(n=i.offset)&&n<=t.oldScroll?o.push(i):void 0}),o.sort(function(e,i){return e.offset-i.offset}),r||o.reverse(),a.each(o,function(e,i){return i.options.continuous||e===o.length-1?i.trigger([n]):void 0})}),this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.refresh=function(){var e,i,t,n=this;return t=a.isWindow(this.element),i=this.$element.offset(),this.doScroll(),e={horizontal:{contextOffset:t?0:i.left,contextScroll:t?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:t?0:i.top,contextScroll:t?0:this.oldScroll.y,contextDimension:t?a[T]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}},a.each(e,function(e,i){return a.each(n.waypoints[e],function(e,t){var n,r,o,c,s;return n=t.options.offset,o=t.offset,r=a.isWindow(t.element)?0:t.$element.offset()[i.offsetProp],a.isFunction(n)?n=n.apply(t.element):"string"==typeof n&&(n=parseFloat(n),t.options.offset.indexOf("%")>-1&&(n=Math.ceil(i.contextDimension*n/100))),t.offset=r-i.contextOffset+i.contextScroll-n,t.options.onlyOnScroll&&null!=o||!t.enabled?void 0:null!==o&&o<(c=i.oldScroll)&&c<=t.offset?t.trigger([i.backward]):null!==o&&o>(s=i.oldScroll)&&s>=t.offset?t.trigger([i.forward]):null===o&&i.oldScroll>=t.offset?t.trigger([i.forward]):void 0})})},e.prototype.checkEmpty=function(){return a.isEmptyObject(this.waypoints.horizontal)&&a.isEmptyObject(this.waypoints.vertical)?(this.$element.unbind([p,d].join(" ")),delete u[this.id]):void 0},e}(),o=function(){function e(e,i,t){var n,r;"bottom-in-view"===t.offset&&(t.offset=function(){var e;return e=a[T]("viewportHeight"),a.isWindow(i.element)||(e=i.$element.height()),e-a(this).outerHeight()}),this.$element=e,this.element=e[0],this.axis=t.horizontal?"horizontal":"vertical",this.callback=t.handler,this.context=i,this.enabled=t.enabled,this.id="waypoints"+g++,this.offset=null,this.options=t,i.waypoints[this.axis][this.id]=this,c[this.axis][this.id]=this,n=null!=(r=this.element[h])?r:[],n.push(this.id),this.element[h]=n}return e.prototype.trigger=function(e){return this.enabled?(null!=this.callback&&this.callback.apply(this.element,e),this.options.triggerOnce?this.destroy():void 0):void 0},e.prototype.disable=function(){return this.enabled=!1},e.prototype.enable=function(){return this.context.refresh(),this.enabled=!0},e.prototype.destroy=function(){return delete c[this.axis][this.id],delete this.context.waypoints[this.axis][this.id],this.context.checkEmpty()},e.getWaypointsByElement=function(e){var i,t;return(t=e[h])?(i=a.extend({},c.horizontal,c.vertical),a.map(t,function(e){return i[e]})):[]},e}(),f={init:function(e,i){var t;return i=a.extend({},a.fn[b].defaults,i),null==(t=i.handler)&&(i.handler=e),this.each(function(){var e,t,n,c;return e=a(this),n=null!=(c=i.context)?c:a.fn[b].defaults.context,a.isWindow(n)||(n=e.closest(n)),n=a(n),t=u[n[0][l]],t||(t=new r(n)),new o(e,t,i)}),a[T]("refresh"),this},disable:function(){return f._invoke.call(this,"disable")},enable:function(){return f._invoke.call(this,"enable")},destroy:function(){return f._invoke.call(this,"destroy")},prev:function(e,i){return f._traverse.call(this,e,i,function(e,i,a){return i>0?e.push(a[i-1]):void 0})},next:function(e,i){return f._traverse.call(this,e,i,function(e,i,a){return ie.oldScroll.y})},left:function(e){return null==e&&(e=t),m._filter(e,"horizontal",function(e,i){return i.offset<=e.oldScroll.x})},right:function(e){return null==e&&(e=t),m._filter(e,"horizontal",function(e,i){return i.offset>e.oldScroll.x})},enable:function(){return m._invoke("enable")},disable:function(){return m._invoke("disable")},destroy:function(){return m._invoke("destroy")},extendFn:function(e,i){return f[e]=i},_invoke:function(e){var i;return i=a.extend({},c.vertical,c.horizontal),a.each(i,function(i,a){return a[e](),!0})},_filter:function(e,i,t){var n,r;return(n=u[a(e)[0][l]])?(r=[],a.each(n.waypoints[i],function(e,i){return t(n,i)?r.push(i):void 0}),r.sort(function(e,i){return e.offset-i.offset}),a.map(r,function(e){return e.element})):[]}},a[T]=function(){var e,a;return a=arguments[0],e=2<=arguments.length?i.call(arguments,1):[],m[a]?m[a].apply(null,e):m.aggregate.call(null,a)},a[T].settings={resizeThrottle:100,scrollThrottle:30},n.on("load.waypoints",function(){return a[T]("refresh")})})}.call(this),liveblog.require.config({paths:{twitterWidgets:"//platform.twitter.com/widgets"},shim:{twitterWidgets:{exports:"twttr"}}}),liveblog.define("plugins/twitter-widgets",["underscore","backbone","plugins","dust","lib/utils"],function(e,i,a,t,n){return a["twitter-widgets"]=function(){if(n.isClient){n.dispatcher.on("before-render.post-view",function(e){"source/twitter"===e.model.get("item")&&(e.parentView()._twitterPosts||(e.parentView()._twitterPosts=[]),e.parentView()._twitterPosts.push(e))}),n.dispatcher.on("add-all.posts-view",function(e){i(e)});var i=function(i){i._twitterPosts&&liveblog.require(["twitterWidgets","waypoints"],function(a){a.ready(function(){e.each(i._twitterPosts,function(e){e.$el.waypoint(function(){var i=e.model.get("Meta").id_str;a.widgets.createTweet(i,e.$el.find(".post-content-full").get(0),function(){e.$el.find(".post-core-content").remove()},{cards:"all"})},{triggerOnce:!0,offset:"120%",context:i.el})}),i._twitterPosts=[]})},function(){})}}},a["twitter-widgets"]}),liveblog.define("lib/helpers/fixed-encodeURIComponent",[],function(){return function(e){return encodeURIComponent(e).replace(/'/g,"%27").replace(/!/g,"%21").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/~/g,"%7E")}}),liveblog.define("config/social-share-plugin",{urls:{pin:"//pinterest.com/pin/create/button/?url=%s&media=%s&description=%s",twt:"//twitter.com/home?status=%s %s: %s",lin:"//www.linkedin.com/shareArticle?mini=true&url=%s&title=%s&summary=%s",ggl:"//plus.google.com/share?url=%s&t=",email:"mailto:?to=&subject=%s&body=%s",fb:"//www.facebook.com/sharer.php?s=100&p[title]=%s&p[summary]=%s&p[url]=%s%s",fbImageComp:"&p[images][%s]=%s"},shareWindowSize:{pin:{h:400,w:700},twt:{h:400,w:570},lin:{h:400,w:570},ggl:{h:400,w:570},email:{h:1024,w:768},fb:{h:400,w:570}}}),liveblog.define("tmpl!themeBase/plugins/social-share-anchor",["dust"],function(e){return function(){function i(e,i){return e.write('').helper("i18n",i,{},{msgid:"Share"}).write("")}return e.register("themeBase/plugins/social-share-anchor",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/social-share-anchor",i,a)}}}),liveblog.define("tmpl!themeBase/plugins/social-share",["dust"],function(e){return function(){function i(e,i){return e.write('')}function a(e,i){return e.write('')}return e.register("themeBase/plugins/social-share",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/social-share",i,a)}}}),liveblog.define("plugins/social-share",["backbone","underscore","plugins","lib/utils","dust","lib/gettext","lib/helpers/fixed-encodeURIComponent","lib/helpers/visibility-toggle","config/social-share-plugin","tmpl!themeBase/plugins/social-share-anchor","tmpl!themeBase/plugins/social-share"],function(e,i,a,t,n,r,o,c,s){t.isClient&&(a["social-share"]=function(){t.dispatcher.on("after-render.post-view",function(e){n.renderThemed("themeBase/plugins/social-share-anchor",{},function(i,a){e.$('[data-gimme="post.social-share-placeholder"]').html(a)})}),t.dispatcher.on("initialize.post-view",function(e){e.clientEvents({'click [data-gimme="post.social"]':"share"}),e.share=function(e){e.preventDefault();var i=this,t=a(i);i.socialShareUrls=l(t),n.renderThemed("themeBase/plugins/social-share",u(t),function(e,a){i.$('[data-gimme="post.social-share-placeholder"]').append(a)}),A(i);var r=i.$('[data-gimme="post.share-social"]'),o=i.$('[data-gimme^="post.share"]');"hidden"===r.css("visibility")&&c(o,!1),c(r)},e.openShareWindow=function(e){e.preventDefault();var i=this.$(e.target).data("gimme"),a=s.shareWindowSize[i].h,t=s.shareWindowSize[i].w,n=this.socialShareUrls[i],r="resizable, height="+a+", width="+t,o=window.open(n,"",r);return o.focus(),!1}});var a=function(i){var a=i.parentView().parentView().model,t=o(a.get("Title")),n=o(i.$(".result-content .result-text:last").text()),c="";i.permalink&&"function"==typeof i.permalink&&(c=o(i.permalink()));var l=i.$(".result-content img:first").attr("src");l||(l=e.$("img:first").attr("src"));var u="";i.$(".result-content img").each(function(i){u+=r.sprintf(s.fbURLImageComp,[i,e.$(this).attr("src")])});var A={pin:[c,l,t],twt:[r.gettext("Now reading"),t,c],lin:[c,t,n],ggl:[c],email:[r.gettext("Check out this Live Blog"),c],fb:[t,n,c,u]};return A},l=function(e){var a={};return delete e.email,i.each(e,function(i,t){a[t]=r.sprintf(s.urls[t],e[t])}),a},u=function(e){var i={};return i.emailurl=r.sprintf(s.urls.email,e.email),i},A=function(e){var a={};i.each(e.socialShareUrls,function(e,i){a['click [data-gimme="'+i+'"]']="openShareWindow"}),e.clientEvents(a),e.delegateEvents()}})}),liveblog.define("plugins/pagination",["plugins","lib/utils"],function(e,i){return e.pagination=function(){i.dispatcher.once("initialize.posts-view",function(e){e.collection.clearPaginationParams(),liveblog.limit&&(e.collection.syncParams.pagination.limit=parseInt(liveblog.limit,10)),e.flags.loadingNextPage=!1,e.updateNextPageOffset=function(){this.collection.syncParams.pagination.offset=this.collection.length},e.topPage=function(){return delete this.collection.syncParams.pagination["order.end"],this.collection.syncParams.pagination.offset=0,this.collection.fetchPage({reset:!0})},e.nextPage=function(){if(!this.flags.loadingNextPage&&this.hasNextPage()){i.dispatcher.trigger("loading.posts-view",this),this.flags.loadingNextPage=!0,this.updateNextPageOffset();var e=this;return this.collection.fetchPage().done(function(){e.flags.loadingNextPage=!1,i.dispatcher.trigger("loaded.posts-view",e)})}},e.hasNextPage=function(){return this.collection.length').helper("i18n",i,{},{msgid:"Load more posts ..."}).write("")}function s(e,i){return i=i.shiftBlocks(u),e.write('')}function l(e,i){return i=i.shiftBlocks(u),e.write('data-gimme="posts.nextPage"')}e.register("themeBase/plugins/after-button-pagination",i);var u={itemClass:t,main:n,loadNext:c,loadingNext:s,additionalAttributes:l};return i}(),{render:function(i,a){return e.render("themeBase/plugins/after-button-pagination",i,a)}}}),liveblog.define("tmpl!themeBase/plugins/before-button-pagination",["dust"],function(e){return function(){function i(e,i){return i=i.shiftBlocks(u),e.partial(a,i,null)}function a(e,i){return i=i.shiftBlocks(u),e.reference(i.get(["baseItem"],!1),i,"h")}function t(e,i){return i=i.shiftBlocks(u),e.write("load-next")}function n(e,i){return i=i.shiftBlocks(u),e.block(i.getBlock("loadNext"),i,{block:r},null).block(i.getBlock("loadingNext"),i,{block:o},null)}function r(e,i){return i=i.shiftBlocks(u),e}function o(e,i){return i=i.shiftBlocks(u),e}function c(e,i){return i=i.shiftBlocks(u),e.write('Load top posts')}function s(e,i){return i=i.shiftBlocks(u),e.write('')}function l(e,i){return i=i.shiftBlocks(u),e.write('data-gimme="posts.beforePage"')}e.register("themeBase/plugins/before-button-pagination",i);var u={itemClass:t,main:n,loadNext:c,loadingNext:s,additionalAttributes:l};return i}(),{render:function(i,a){return e.render("themeBase/plugins/before-button-pagination",i,a)}}}),liveblog.define("plugins/button-pagination",["backbone","plugins","plugins/pagination","dust","lib/utils","lib/helpers/display-toggle","tmpl!themeBase/item/base","tmpl!themeBase/plugins/after-button-pagination","tmpl!themeBase/plugins/before-button-pagination"],function(e,i,a,t,n,r){return delete i.pagination,i["button-pagination"]=function(i){a(i),n.dispatcher.on("initialize.blog-view",function(e){e.clientEvents({'click [data-gimme="posts.to-top"]':"toTop"}),e.toTop=function(){var e=this.$el.offset();window.scrollTo(e.left,e.top)}}),n.dispatcher.once("add-all.posts-view",function(i){var a={};a.baseItem=t.themed("themeBase/item/base"),0===i.$('[data-gimme="posts.beforePage"]').length&&t.renderThemed("themeBase/plugins/before-button-pagination",a,function(a,t){var n=e.$(t);r(n,!1),i.$el.prepend(n)}),0===i.$('[data-gimme="posts.nextPage"]').length&&t.renderThemed("themeBase/plugins/after-button-pagination",a,function(a,t){var n=e.$(t);r(n,!1),i.$el.append(n)})}),n.dispatcher.once("add-all.posts-view",function(e){e.checkNextPage(),e.checkTopPage()}),n.dispatcher.once("initialize.posts-view",function(e){e.clientEvents({'click [data-gimme="posts.nextPage"]':"buttonNextPage",'click [data-gimme="posts.beforePage"]':"buttonTopPage"}),e.checkTopPage=function(){r(this.$('[data-gimme="posts.beforePage"]'),this.hasTopPage())},e.checkNextPage=function(){r(this.$('[data-gimme="posts.nextPage"]'),this.hasNextPage()),n.dispatcher.trigger("pagination-next-updated.posts-view",this)},e.buttonNextPage=function(){e.flags.buttonNextPage=!0;var i=e.$('[data-gimme="posts.nextPage"]');i.addClass("loading"),e.nextPage().done(function(){e.flags.buttonNextPage=!1,i.removeClass("loading"),e.checkNextPage()})},e.buttonTopPage=function(){var i=e.$('[data-gimme="posts.beforePage"]');i.addClass("loading"),e.flags.topPage=!1,e.topPage().done(function(){i.removeClass("loading"),r(i,!1),e.checkNextPage()})}})},i["button-pagination"]}),liveblog.define("tmpl!theme/container",["dust"],function(e){return function(){function i(e,i){return i=i.shiftBlocks(n),e.partial("themeBase/container",i,null)}function a(e,i){return i=i.shiftBlocks(n),e}function t(e,i){return i=i.shiftBlocks(n),e}e.register("theme/container",i);var n={headerContainer:a,contentBottomContainer:t};return i}(),{render:function(i,a){return e.render("theme/container",i,a)}}}),liveblog.define("tmpl!theme/item/base",["dust"],function(e){return function(){function i(e,i){return i=i.shiftBlocks(h),e.partial("themeBase/item/base",i,null)}function a(e,i){return i=i.shiftBlocks(h),e}function t(e,i){return i=i.shiftBlocks(h),e.write('
').block(i.getBlock("header"),i,{block:n},null).write("
").block(i.getBlock("contentMainBody"),i,{block:l},null).write("
")}function n(e,i){return i=i.shiftBlocks(h),e.block(i.getBlock("verificationLabel"),i,{block:r},null).block(i.getBlock("postDateContainer"),i,{block:o},null).block(i.getBlock("userNameContainer"),i,{block:c},null).block(i.getBlock("shareContainer"),i,{block:s},null)}function r(e,i){return i=i.shiftBlocks(h),e}function o(e,i){return i=i.shiftBlocks(h),e}function c(e,i){return i=i.shiftBlocks(h),e}function s(e,i){return i=i.shiftBlocks(h),e}function l(e,i){return i=i.shiftBlocks(h),e.block(i.getBlock("commentBefore"),i,{block:u},null).block(i.getBlock("contentMainFull"),i,{block:A},null).block(i.getBlock("commentAfter"),i,{block:g},null)}function u(e,i){return i=i.shiftBlocks(h),e}function A(e,i){return i=i.shiftBlocks(h),e.write('
').block(i.getBlock("contentFull"),i,{block:m},null).write("
")}function m(e,i){return i=i.shiftBlocks(h),e.block(i.getBlock("contentCoreContainer"),i,{block:f},null).block(i.getBlock("contentAttrContainer"),i,{block:d},null)}function f(e,i){return i=i.shiftBlocks(h),e.write('
').block(i.getBlock("contentCore"),i,{block:p},null).write("
")}function p(e,i){return i=i.shiftBlocks(h),e}function d(e,i){return i=i.shiftBlocks(h),e}function g(e,i){return i=i.shiftBlocks(h),e}e.register("theme/item/base",i);var h={headerContainer:a,contentMainContainer:t};return i}(),{render:function(i,a){return e.render("theme/item/base",i,a)}}}),liveblog.define("themeFile",["plugins/wrappup-toggle","plugins/post-hash","plugins/permanent-link","plugins/user-comments","plugins/twitter-widgets","plugins/social-share","plugins/button-pagination","tmpl!theme/container","tmpl!theme/item/base","css!theme/liveblog"],function(){return{plugins:["wrappup-toggle","post-hash","permanent-link","user-comments","twitter-widgets","social-share","button-pagination"]}}); \ No newline at end of file +}return e.register("themeBase/plugins/permanent-link",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/permanent-link",i,a)}}}),liveblog.define("plugins/permanent-link",["plugins","lib/utils","dust","lib/helpers/visibility-toggle","tmpl!themeBase/item/base","tmpl!themeBase/plugins/permanent-link"],function(e,i,a,t){return i.isClient?(e.permalink=function(){i.dispatcher.on("after-render.post-view",function(e){a.renderThemed("themeBase/plugins/permanent-link",{},function(i,a){e.$('[data-gimme="post.permanent-link-placeholder"]').html(a)});var i="";e.permalink&&"function"==typeof e.permalink&&(i=e.permalink(),e.$('[data-gimme="post.share-permalink"]').val(i),e.$('[data-gimme="post.permalink"]').attr("href",i))}),i.dispatcher.on("initialize.post-view",function(e){e.clientEvents({'click [data-gimme="post.permalink"]':"permalinkAction"}),e.permalinkAction=function(e){e.preventDefault();var i=this.$('[data-gimme="post.share-permalink"]');if(t(i)){var a=this.$('[data-gimme^="post.share"][data-gimme!="post.share-permalink"]');t(a,!1),i.trigger("focus")}},e.clientEvents({'click [data-gimme="post.share-permalink"]':"permalinkInput",'focus [data-gimme="post.share-permalink"]':"permalinkInput"}),e.permalinkInput=function(i){e.$(i.target).select()},e.delegateEvents()})},e.permalink):void 0}),liveblog.define("lib/helpers/format-commentator",["underscore","lib/gettext"],function(e,i){return function(e){return e=e.replace("commentator",""),i.sprintf(i.gettext("%(full_name)s commentator"),{full_name:e})}}),liveblog.define("lib/helpers/adjust-server-post",["underscore"],function(){return function(e){var i="infomercial";return"advertisement"===e.Type.Key&&(e.Type.Key=i),"advertisement"===e.Author.Source.Name&&(e.Author.Source.Name=i),"smsblog"===e.Author.Source.Type.Key&&(e.Author.Source.IsModifiable="False",e.Author.Source.Name="sms"),e.Author.Source&&"embed"===e.Author.Source.Name&&(e.Author.Source.IsModifiable="False",e.Author.Source.Name="comments"),e}}),liveblog.define("models/comment",["underscore","backbone-custom","models/base-model","collections/posts","lib/utils"],function(e,i,a){return a.extend({setUrlRoot:function(e){this.urlRoot=e}})}),liveblog.define("plugins/user-comments-popup",["underscore","backbone-custom","views/base-view","lib/helpers/display-toggle","models/comment"],function(e,i,a,t,n){return a.extend({messageDisplayTime:5e3,initialize:function(){this.clientEvents({'click [data-gimme="blog.comment"]':"togglePopup","click #comment-message-btn":"showAfterMessage","click .button.cancel":"togglePopup","click .button.send":"send"}),this.popup=this.$('[data-gimme="blog.comment-box-holder"]'),t(this.popup,!1),this.popup_message=this.$('[data-gimme="blog.comment-box-message"]'),t(this.popup_message,!1),this.username=this.$('[data-gimme="blog.comment-nickname"]'),this.text=this.$('[data-gimme="blog.comment-text"]'),this.resetInput(),this.backdropel=this.$('[data-gimme="blog.comment-backdrop"]'),this.backdropel.data("show-status",0),this.lbpostlist=this.backdropel.parent()},togglePopup:function(e){var i=this,a=i.backdropel.data("show-status");switch(e.preventDefault(),a){case 0:t(i.popup,!0),i.backdropel.data("show-status",1),t(i.backdropel,!0),i.lbpostlist.addClass("comment-active"),i.blogview.stopPoller();break;case 1:i.backdropel.data("show-status",0).hide(),t(i.popup_message,!1),i.resetInput(),i.lbpostlist.removeClass("comment-active"),t(i.popup,!1),i.blogview.starPoller();break;case 2:t(i.popup_message,!1),i.resetInput(),i.lbpostlist.removeClass("comment-active"),t(i.popup,!1),i.blogview.starPoller()}},send:function(e){e.preventDefault();var i=this;if(this.isValid()){var a=new n,t={UserName:this.username.val(),CommentText:this.text.val()};a.setUrlRoot(this.model.get("CommentPost").href),a.save(t,{success:function(){i.showAfterMessage(e),i.resetInput()},error:function(){i.showAfterMessage(e),i.resetInput()},crossDomain:!0,type:"post"})}},resetInput:function(){this.username.val(""),this.text.val(""),t(this.$(".error"),!1)},showAfterMessage:function(){var e=this;e.backdropel.data("show-status",2),t(e.backdropel,!0),t(e.popup),e.backdropel.data("show-status",1),t(this.popup_message,!0),setTimeout(function(){t(e.popup_message,!1),e.backdropel.data("show-status",0),t(e.backdropel,!1),e.blogview.starPoller()},e.messageDisplayTime)},isValid:function(){return this.username.val()?t(this.username.next(".error"),!1):t(this.username.next(".error"),!0),this.text.val()?t(this.text.next(".error"),!1):t(this.text.next(".error"),!0),0===this.$(".error:visible").length}})}),liveblog.define("tmpl!themeBase/plugins/user-comment-message",["dust"],function(e){return function(){function i(e,i){return e.write('
').helper("i18n",i,{},{msgid:"Your message was sent for approval"}).write("
")}return e.register("themeBase/plugins/user-comment-message",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/user-comment-message",i,a)}}}),liveblog.define("tmpl!themeBase/plugins/user-comment-backdrop",["dust"],function(e){return function(){function i(e){return e.write('
')}return e.register("themeBase/plugins/user-comment-backdrop",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/user-comment-backdrop",i,a)}}}),liveblog.define("tmpl!themeBase/plugins/user-comment-action",["dust"],function(e){return function(){function i(e,i){return e.write('").helper("i18n",i,{},{msgid:"comment"}).write("")}function a(e){return e.write(' style="display:none" ')}function t(e){return e.write(' style="display:block" ')}return e.register("themeBase/plugins/user-comment-action",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/user-comment-action",i,a)}}}),liveblog.define("tmpl!themeBase/plugins/user-comment",["dust"],function(e){return function(){function i(e,i){return e.write('
').helper("i18n",i,{},{msgid:"Please fill in your Nickname."}).write('
').helper("i18n",i,{},{msgid:"Please fill in your Comment text."}).write('
').helper("i18n",i,{},{msgid:"Please fill in text from image."}).write('
")}return e.register("themeBase/plugins/user-comment",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/user-comment",i,a)}}}),liveblog.define("plugins/user-comments",["plugins","plugins/user-comments-popup","lib/utils","dust","lib/helpers/display-toggle","tmpl!themeBase/plugins/user-comment-message","tmpl!themeBase/plugins/user-comment-backdrop","tmpl!themeBase/plugins/user-comment-action","tmpl!themeBase/plugins/user-comment"],function(e,i,a,t,n){return e["user-comments"]=function(e){a.dispatcher.on("config-update.blog-view",function(e){n(e.$('[data-gimme="blog.comment"]'),e.model.get("EmbedConfig").UserComments)}),a.dispatcher.on("conditional-render.blog-view",function(r){if(t.renderThemed("themeBase/plugins/user-comment-action",{UserComments:r.model.get("EmbedConfig").UserComments},function(e,i){r.$('[data-gimme="blog.comment-action"]').html(i)}),n(r.$('[data-gimme="blog.comment"]'),e.UserComments),t.renderThemed("themeBase/plugins/user-comment",{},function(e,i){r.$('[data-gimme="blog.comment-box"]').html(i)}),t.renderThemed("themeBase/plugins/user-comment-message",{},function(e,i){r.$('[data-gimme="blog.comment-box-message"]').html(i)}),t.renderThemed("themeBase/plugins/user-comment-backdrop",{},function(e,i){r.$('[data-gimme="blog.comment-box-backdrop"]').html(i)}),a.isClient){new i({el:r.el,blogview:r,model:r.model})}})},e["user-comments"]}),function(){var e=[].indexOf||function(e){for(var i=0,a=this.length;a>i;i++)if(i in this&&this[i]===e)return i;return-1},i=[].slice;!function(e,i){return"function"==typeof liveblog.define&&liveblog.define.amd?liveblog.define("waypoints",["jquery"],function(a){return i(a,e)}):i(e.jQuery,e)}(window,function(a,t){var n,r,o,c,s,l,u,A,m,f,p,d,g,h,b,T;return n=a(t),A=e.call(t,"ontouchstart")>=0,c={horizontal:{},vertical:{}},s=1,u={},l="waypoints-context-id",p="resize.waypoints",d="scroll.waypoints",g=1,h="waypoints-waypoint-ids",b="waypoint",T="waypoints",r=function(){function e(e){var i=this;this.$element=e,this.element=e[0],this.didResize=!1,this.didScroll=!1,this.id="context"+s++,this.oldScroll={x:e.scrollLeft(),y:e.scrollTop()},this.waypoints={horizontal:{},vertical:{}},this.element[l]=this.id,u[this.id]=this,e.bind(d,function(){var e;return i.didScroll||A?void 0:(i.didScroll=!0,e=function(){return i.doScroll(),i.didScroll=!1},t.setTimeout(e,a[T].settings.scrollThrottle))}),e.bind(p,function(){var e;return i.didResize?void 0:(i.didResize=!0,e=function(){return a[T]("refresh"),i.didResize=!1},t.setTimeout(e,a[T].settings.resizeThrottle))})}return e.prototype.doScroll=function(){var e,i=this;return e={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}},!A||e.vertical.oldScroll&&e.vertical.newScroll||a[T]("refresh"),a.each(e,function(e,t){var n,r,o;return o=[],r=t.newScroll>t.oldScroll,n=r?t.forward:t.backward,a.each(i.waypoints[e],function(e,i){var a,n;return t.oldScroll<(a=i.offset)&&a<=t.newScroll?o.push(i):t.newScroll<(n=i.offset)&&n<=t.oldScroll?o.push(i):void 0}),o.sort(function(e,i){return e.offset-i.offset}),r||o.reverse(),a.each(o,function(e,i){return i.options.continuous||e===o.length-1?i.trigger([n]):void 0})}),this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.refresh=function(){var e,i,t,n=this;return t=a.isWindow(this.element),i=this.$element.offset(),this.doScroll(),e={horizontal:{contextOffset:t?0:i.left,contextScroll:t?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:t?0:i.top,contextScroll:t?0:this.oldScroll.y,contextDimension:t?a[T]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}},a.each(e,function(e,i){return a.each(n.waypoints[e],function(e,t){var n,r,o,c,s;return n=t.options.offset,o=t.offset,r=a.isWindow(t.element)?0:t.$element.offset()[i.offsetProp],a.isFunction(n)?n=n.apply(t.element):"string"==typeof n&&(n=parseFloat(n),t.options.offset.indexOf("%")>-1&&(n=Math.ceil(i.contextDimension*n/100))),t.offset=r-i.contextOffset+i.contextScroll-n,t.options.onlyOnScroll&&null!=o||!t.enabled?void 0:null!==o&&o<(c=i.oldScroll)&&c<=t.offset?t.trigger([i.backward]):null!==o&&o>(s=i.oldScroll)&&s>=t.offset?t.trigger([i.forward]):null===o&&i.oldScroll>=t.offset?t.trigger([i.forward]):void 0})})},e.prototype.checkEmpty=function(){return a.isEmptyObject(this.waypoints.horizontal)&&a.isEmptyObject(this.waypoints.vertical)?(this.$element.unbind([p,d].join(" ")),delete u[this.id]):void 0},e}(),o=function(){function e(e,i,t){var n,r;"bottom-in-view"===t.offset&&(t.offset=function(){var e;return e=a[T]("viewportHeight"),a.isWindow(i.element)||(e=i.$element.height()),e-a(this).outerHeight()}),this.$element=e,this.element=e[0],this.axis=t.horizontal?"horizontal":"vertical",this.callback=t.handler,this.context=i,this.enabled=t.enabled,this.id="waypoints"+g++,this.offset=null,this.options=t,i.waypoints[this.axis][this.id]=this,c[this.axis][this.id]=this,n=null!=(r=this.element[h])?r:[],n.push(this.id),this.element[h]=n}return e.prototype.trigger=function(e){return this.enabled?(null!=this.callback&&this.callback.apply(this.element,e),this.options.triggerOnce?this.destroy():void 0):void 0},e.prototype.disable=function(){return this.enabled=!1},e.prototype.enable=function(){return this.context.refresh(),this.enabled=!0},e.prototype.destroy=function(){return delete c[this.axis][this.id],delete this.context.waypoints[this.axis][this.id],this.context.checkEmpty()},e.getWaypointsByElement=function(e){var i,t;return(t=e[h])?(i=a.extend({},c.horizontal,c.vertical),a.map(t,function(e){return i[e]})):[]},e}(),f={init:function(e,i){var t;return i=a.extend({},a.fn[b].defaults,i),null==(t=i.handler)&&(i.handler=e),this.each(function(){var e,t,n,c;return e=a(this),n=null!=(c=i.context)?c:a.fn[b].defaults.context,a.isWindow(n)||(n=e.closest(n)),n=a(n),t=u[n[0][l]],t||(t=new r(n)),new o(e,t,i)}),a[T]("refresh"),this},disable:function(){return f._invoke.call(this,"disable")},enable:function(){return f._invoke.call(this,"enable")},destroy:function(){return f._invoke.call(this,"destroy")},prev:function(e,i){return f._traverse.call(this,e,i,function(e,i,a){return i>0?e.push(a[i-1]):void 0})},next:function(e,i){return f._traverse.call(this,e,i,function(e,i,a){return ie.oldScroll.y})},left:function(e){return null==e&&(e=t),m._filter(e,"horizontal",function(e,i){return i.offset<=e.oldScroll.x})},right:function(e){return null==e&&(e=t),m._filter(e,"horizontal",function(e,i){return i.offset>e.oldScroll.x})},enable:function(){return m._invoke("enable")},disable:function(){return m._invoke("disable")},destroy:function(){return m._invoke("destroy")},extendFn:function(e,i){return f[e]=i},_invoke:function(e){var i;return i=a.extend({},c.vertical,c.horizontal),a.each(i,function(i,a){return a[e](),!0})},_filter:function(e,i,t){var n,r;return(n=u[a(e)[0][l]])?(r=[],a.each(n.waypoints[i],function(e,i){return t(n,i)?r.push(i):void 0}),r.sort(function(e,i){return e.offset-i.offset}),a.map(r,function(e){return e.element})):[]}},a[T]=function(){var e,a;return a=arguments[0],e=2<=arguments.length?i.call(arguments,1):[],m[a]?m[a].apply(null,e):m.aggregate.call(null,a)},a[T].settings={resizeThrottle:100,scrollThrottle:30},n.on("load.waypoints",function(){return a[T]("refresh")})})}.call(this),liveblog.require.config({paths:{twitterWidgets:"//platform.twitter.com/widgets"},shim:{twitterWidgets:{exports:"twttr"}}}),liveblog.define("plugins/twitter-widgets",["underscore","backbone","plugins","dust","lib/utils"],function(e,i,a,t,n){return a["twitter-widgets"]=function(){if(n.isClient){n.dispatcher.on("before-render.post-view",function(e){"source/twitter"===e.model.get("item")&&(e.parentView()._twitterPosts||(e.parentView()._twitterPosts=[]),e.parentView()._twitterPosts.push(e))}),n.dispatcher.on("add-all.posts-view",function(e){i(e)});var i=function(i){i._twitterPosts&&liveblog.require(["twitterWidgets","waypoints"],function(a){a.ready(function(){e.each(i._twitterPosts,function(e){e.$el.waypoint(function(){var i=e.model.get("Meta").id_str;a.widgets.createTweet(i,e.$el.find(".post-content-full").get(0),function(){e.$el.find(".post-core-content").remove()},{cards:"all"})},{triggerOnce:!0,offset:"120%",context:i.el})}),i._twitterPosts=[]})},function(){})}}},a["twitter-widgets"]}),liveblog.define("lib/helpers/fixed-encodeURIComponent",[],function(){return function(e){return encodeURIComponent(e).replace(/'/g,"%27").replace(/!/g,"%21").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/~/g,"%7E")}}),liveblog.define("config/social-share-plugin",{urls:{pin:"//pinterest.com/pin/create/button/?url=%s&media=%s&description=%s",twt:"//twitter.com/home?status=%s %s: %s",lin:"//www.linkedin.com/shareArticle?mini=true&url=%s&title=%s&summary=%s",ggl:"//plus.google.com/share?url=%s&t=",email:"mailto:?to=&subject=%s&body=%s",fb:"//www.facebook.com/sharer.php?s=100&p[title]=%s&p[summary]=%s&p[url]=%s%s",fbImageComp:"&p[images][%s]=%s"},shareWindowSize:{pin:{h:400,w:700},twt:{h:400,w:570},lin:{h:400,w:570},ggl:{h:400,w:570},email:{h:1024,w:768},fb:{h:400,w:570}}}),liveblog.define("tmpl!themeBase/plugins/social-share-anchor",["dust"],function(e){return function(){function i(e,i){return e.write('').helper("i18n",i,{},{msgid:"Share"}).write("")}return e.register("themeBase/plugins/social-share-anchor",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/social-share-anchor",i,a)}}}),liveblog.define("tmpl!themeBase/plugins/social-share",["dust"],function(e){return function(){function i(e,i){return e.write('')}function a(e,i){return e.write('')}return e.register("themeBase/plugins/social-share",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/social-share",i,a)}}}),liveblog.define("plugins/social-share",["backbone","underscore","plugins","lib/utils","dust","lib/gettext","lib/helpers/fixed-encodeURIComponent","lib/helpers/visibility-toggle","config/social-share-plugin","tmpl!themeBase/plugins/social-share-anchor","tmpl!themeBase/plugins/social-share"],function(e,i,a,t,n,r,o,c,s){t.isClient&&(a["social-share"]=function(){t.dispatcher.on("after-render.post-view",function(e){n.renderThemed("themeBase/plugins/social-share-anchor",{},function(i,a){e.$('[data-gimme="post.social-share-placeholder"]').html(a)})}),t.dispatcher.on("initialize.post-view",function(e){e.clientEvents({'click [data-gimme="post.social"]':"share"}),e.share=function(e){e.preventDefault();var i=this,t=a(i);i.socialShareUrls=l(t),n.renderThemed("themeBase/plugins/social-share",u(t),function(e,a){i.$('[data-gimme="post.social-share-placeholder"]').append(a)}),A(i);var r=i.$('[data-gimme="post.share-social"]'),o=i.$('[data-gimme^="post.share"]');"hidden"===r.css("visibility")&&c(o,!1),c(r)},e.openShareWindow=function(e){e.preventDefault();var i=this.$(e.target).data("gimme"),a=s.shareWindowSize[i].h,t=s.shareWindowSize[i].w,n=this.socialShareUrls[i],r="resizable, height="+a+", width="+t,o=window.open(n,"",r);return o.focus(),!1}});var a=function(i){var a=i.parentView().parentView().model,t=o(a.get("Title")),n=o(i.$(".result-content .result-text:last").text()),c="";i.permalink&&"function"==typeof i.permalink&&(c=o(i.permalink()));var l=i.$(".result-content img:first").attr("src");l||(l=e.$("img:first").attr("src"));var u="";i.$(".result-content img").each(function(i){u+=r.sprintf(s.fbURLImageComp,[i,e.$(this).attr("src")])});var A={pin:[c,l,t],twt:[r.gettext("Now reading"),t,c],lin:[c,t,n],ggl:[c],email:[r.gettext("Check out this Live Blog"),c],fb:[t,n,c,u]};return A},l=function(e){var a={};return delete e.email,i.each(e,function(i,t){a[t]=r.sprintf(s.urls[t],e[t])}),a},u=function(e){var i={};return i.emailurl=r.sprintf(s.urls.email,e.email),i},A=function(e){var a={};i.each(e.socialShareUrls,function(e,i){a['click [data-gimme="'+i+'"]']="openShareWindow"}),e.clientEvents(a),e.delegateEvents()}})}),liveblog.define("plugins/pagination",["plugins","lib/utils"],function(e,i){return e.pagination=function(){i.dispatcher.once("initialize.posts-view",function(e){e.collection.clearPaginationParams(),liveblog.limit&&(e.collection.syncParams.pagination.limit=parseInt(liveblog.limit,10)),e.flags.loadingNextPage=!1,e.updateNextPageOffset=function(){this.collection.syncParams.pagination.offset=this.collection.length},e.topPage=function(){return delete this.collection.syncParams.pagination["order.end"],this.collection.syncParams.pagination.offset=0,this.collection.fetchPage({reset:!0})},e.nextPage=function(){if(!this.flags.loadingNextPage&&this.hasNextPage()){i.dispatcher.trigger("loading.posts-view",this),this.flags.loadingNextPage=!0,this.updateNextPageOffset();var e=this;return this.collection.fetchPage().done(function(){e.flags.loadingNextPage=!1,i.dispatcher.trigger("loaded.posts-view",e)})}},e.hasNextPage=function(){return this.collection.length').helper("i18n",i,{},{msgid:"Load more posts ..."}).write("")}function s(e,i){return i=i.shiftBlocks(u),e.write('')}function l(e,i){return i=i.shiftBlocks(u),e.write('data-gimme="posts.nextPage"')}e.register("themeBase/plugins/after-button-pagination",i);var u={itemClass:t,main:n,loadNext:c,loadingNext:s,additionalAttributes:l};return i}(),{render:function(i,a){return e.render("themeBase/plugins/after-button-pagination",i,a)}}}),liveblog.define("tmpl!themeBase/plugins/before-button-pagination",["dust"],function(e){return function(){function i(e,i){return i=i.shiftBlocks(u),e.partial(a,i,null)}function a(e,i){return i=i.shiftBlocks(u),e.reference(i.get(["baseItem"],!1),i,"h")}function t(e,i){return i=i.shiftBlocks(u),e.write("load-next")}function n(e,i){return i=i.shiftBlocks(u),e.block(i.getBlock("loadNext"),i,{block:r},null).block(i.getBlock("loadingNext"),i,{block:o},null)}function r(e,i){return i=i.shiftBlocks(u),e}function o(e,i){return i=i.shiftBlocks(u),e}function c(e,i){return i=i.shiftBlocks(u),e.write('Load top posts')}function s(e,i){return i=i.shiftBlocks(u),e.write('')}function l(e,i){return i=i.shiftBlocks(u),e.write('data-gimme="posts.beforePage"')}e.register("themeBase/plugins/before-button-pagination",i);var u={itemClass:t,main:n,loadNext:c,loadingNext:s,additionalAttributes:l};return i}(),{render:function(i,a){return e.render("themeBase/plugins/before-button-pagination",i,a)}}}),liveblog.define("plugins/button-pagination",["backbone","plugins","plugins/pagination","dust","lib/utils","lib/helpers/display-toggle","tmpl!themeBase/item/base","tmpl!themeBase/plugins/after-button-pagination","tmpl!themeBase/plugins/before-button-pagination"],function(e,i,a,t,n,r){return delete i.pagination,i["button-pagination"]=function(i){a(i),n.dispatcher.on("initialize.blog-view",function(e){e.clientEvents({'click [data-gimme="posts.to-top"]':"toTop"}),e.toTop=function(){var e=this.$el.offset();window.scrollTo(e.left,e.top)}}),n.dispatcher.once("add-all.posts-view",function(i){var a={};a.baseItem=t.themed("themeBase/item/base"),0===i.$('[data-gimme="posts.beforePage"]').length&&t.renderThemed("themeBase/plugins/before-button-pagination",a,function(a,t){var n=e.$(t);r(n,!1),i.$el.prepend(n)}),0===i.$('[data-gimme="posts.nextPage"]').length&&t.renderThemed("themeBase/plugins/after-button-pagination",a,function(a,t){var n=e.$(t);r(n,!1),i.$el.append(n)})}),n.dispatcher.once("add-all.posts-view",function(e){e.checkNextPage(),e.checkTopPage()}),n.dispatcher.once("initialize.posts-view",function(e){e.clientEvents({'click [data-gimme="posts.nextPage"]':"buttonNextPage",'click [data-gimme="posts.beforePage"]':"buttonTopPage"}),e.checkTopPage=function(){r(this.$('[data-gimme="posts.beforePage"]'),this.hasTopPage())},e.checkNextPage=function(){r(this.$('[data-gimme="posts.nextPage"]'),this.hasNextPage()),n.dispatcher.trigger("pagination-next-updated.posts-view",this)},e.buttonNextPage=function(){e.flags.buttonNextPage=!0;var i=e.$('[data-gimme="posts.nextPage"]');i.addClass("loading"),e.nextPage().done(function(){e.flags.buttonNextPage=!1,i.removeClass("loading"),e.checkNextPage()})},e.buttonTopPage=function(){var i=e.$('[data-gimme="posts.beforePage"]');i.addClass("loading"),e.flags.topPage=!1,e.topPage().done(function(){i.removeClass("loading"),r(i,!1),e.checkNextPage()})}})},i["button-pagination"]}),liveblog.define("tmpl!theme/container",["dust"],function(e){return function(){function i(e,i){return i=i.shiftBlocks(o),e.partial("themeBase/container",i,null)}function a(e,i){return i=i.shiftBlocks(o),e.write('
').block(i.getBlock("header"),i,{block:t},null).write("
")}function t(e,i){return i=i.shiftBlocks(o),e.block(i.getBlock("blogDescription"),i,{block:n},null)}function n(e,i){return i=i.shiftBlocks(o),e}function r(e,i){return i=i.shiftBlocks(o),e}e.register("theme/container",i);var o={headerContainer:a,contentBottomContainer:r};return i}(),{render:function(i,a){return e.render("theme/container",i,a)}}}),liveblog.define("tmpl!theme/item/base",["dust"],function(e){return function(){function i(e,i){return i=i.shiftBlocks(h),e.partial("themeBase/item/base",i,null)}function a(e,i){return i=i.shiftBlocks(h),e}function t(e,i){return i=i.shiftBlocks(h),e.write('
').block(i.getBlock("header"),i,{block:n},null).write("
").block(i.getBlock("contentMainBody"),i,{block:l},null).write("
")}function n(e,i){return i=i.shiftBlocks(h),e.block(i.getBlock("verificationLabel"),i,{block:r},null).block(i.getBlock("postDateContainer"),i,{block:o},null).block(i.getBlock("userNameContainer"),i,{block:c},null).block(i.getBlock("shareContainer"),i,{block:s},null)}function r(e,i){return i=i.shiftBlocks(h),e}function o(e,i){return i=i.shiftBlocks(h),e}function c(e,i){return i=i.shiftBlocks(h),e}function s(e,i){return i=i.shiftBlocks(h),e}function l(e,i){return i=i.shiftBlocks(h),e.block(i.getBlock("commentBefore"),i,{block:u},null).block(i.getBlock("contentMainFull"),i,{block:A},null).block(i.getBlock("commentAfter"),i,{block:g},null)}function u(e,i){return i=i.shiftBlocks(h),e}function A(e,i){return i=i.shiftBlocks(h),e.write('
').block(i.getBlock("contentFull"),i,{block:m},null).write("
")}function m(e,i){return i=i.shiftBlocks(h),e.block(i.getBlock("contentCoreContainer"),i,{block:f},null).block(i.getBlock("contentAttrContainer"),i,{block:d},null)}function f(e,i){return i=i.shiftBlocks(h),e.write('
').block(i.getBlock("contentCore"),i,{block:p},null).write("
")}function p(e,i){return i=i.shiftBlocks(h),e}function d(e,i){return i=i.shiftBlocks(h),e}function g(e,i){return i=i.shiftBlocks(h),e}e.register("theme/item/base",i);var h={headerContainer:a,contentMainContainer:t};return i}(),{render:function(i,a){return e.render("theme/item/base",i,a)}}}),liveblog.define("themeFile",["plugins/wrappup-toggle","plugins/post-hash","plugins/permanent-link","plugins/user-comments","plugins/twitter-widgets","plugins/social-share","plugins/button-pagination","tmpl!theme/container","tmpl!theme/item/base","css!theme/liveblog"],function(){return{plugins:["wrappup-toggle","post-hash","permanent-link","user-comments","twitter-widgets","social-share","button-pagination"]}}); \ No newline at end of file diff --git a/gui-themes/themes/rhrnt-section/container.dust b/gui-themes/themes/rhrnt-section/container.dust index 41f88cd7b..1f101696a 100644 --- a/gui-themes/themes/rhrnt-section/container.dust +++ b/gui-themes/themes/rhrnt-section/container.dust @@ -1,6 +1,11 @@ {>"themeBase/container"/} { + {+header} + {+blogDescription}{/blogDescription} + {/header} + {/headerContainer} {"themeBase/container"/} { + {+header} + {+blogDescription}{/blogDescription} + {/header} + {/headerContainer} {