From 76b8384e9e2b0b7dca52fcd53b68eb26ea6e2e95 Mon Sep 17 00:00:00 2001 From: Nistor Mihai Date: Tue, 9 Sep 2014 17:57:27 +0300 Subject: [PATCH] Squashed 'plugins/embed/' changes from ea2a31a..e0fa3af e0fa3af Merge pull request #249 from liveblog/devel ed7ce8b Merge pull request #248 from nistormihai/devel 53395b6 LB-1958 setup coverage for mocha 38dd924 LB-1706 As STT, I want my production instances to be on 2.0 stable 5fc38ef LB-1510 New post notifications 67ad0dd LB-1958: setup coverage for mocha a79a63a Merge pull request #246 from actionless/LB-1642-e2e daaacc9 tests: e2e: small clean-up d5d24e9 fix(tests: e2e: post update) 60595f9 tests: e2e: added test for post update git-subtree-dir: plugins/embed git-subtree-split: e0fa3af59a09b9402a9b8e105c45f2af2b6a0a70 --- .travis.yml | 5 +- Gruntfile.js | 4 +- gui-resources/scripts/js/build/main.js | 16 +++--- .../js/build/themes/aamulehti/desktop.js | 5 +- .../js/build/themes/ksml-light/desktop.js | 5 +- .../scripts/js/build/themes/ksml/desktop.js | 5 +- .../js/build/themes/sasa-light/desktop.js | 4 +- .../scripts/js/build/themes/sasa/desktop.js | 5 +- .../js/build/themes/satakansa/desktop.js | 5 +- .../js/build/themes/stt-fnb/desktop.js | 3 +- .../scripts/js/build/themes/stt-fnb/mobile.js | 3 +- .../scripts/js/build/themes/stt-fnb/quirks.js | 3 +- gui-resources/scripts/js/views/posts.js | 3 + gui-themes/themes/aamulehti/desktop.js | 8 ++- gui-themes/themes/ksml-light/desktop.js | 8 ++- gui-themes/themes/ksml/desktop.js | 8 ++- gui-themes/themes/sasa-light/desktop.js | 4 +- gui-themes/themes/sasa/desktop.js | 8 ++- gui-themes/themes/satakansa/desktop.js | 8 ++- gui-themes/themes/stt-fnb/desktop.js | 4 +- gui-themes/themes/stt-fnb/mobile.js | 4 +- gui-themes/themes/stt-fnb/quirks.js | 4 +- package.json | 1 + spec/embed_spec.js | 57 ++++++++++++++----- spec/helpers/liveblog_posts.js | 21 +++++++ 25 files changed, 138 insertions(+), 63 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1d3823b2b..24b3bf6cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,4 @@ before_script: cache: - node_modules - - gui-resources/scripts/js/bower_components - -after_success: - - grunt coveralls + - gui-resources/scripts/js/bower_components \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index 547039afd..ab73683c0 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -73,12 +73,10 @@ module.exports = function(grunt) { } }); - grunt.loadNpmTasks('grunt-karma-coveralls'); - grunt.registerTask('hint', ['jshint:all', 'jscs:all']); grunt.registerTask('test', ['karma:once', 'mochaTest:all']); grunt.registerTask('build', ['hint', 'less:all', 'requirejs']); - grunt.registerTask('ci:travis', ['hint', 'karma:travis', 'mochaTest:all']); + grunt.registerTask('ci:travis', ['hint', 'karma:travis', 'mochaTest:all', 'coveralls']); grunt.registerTask('ci:bamboo', ['karma:bamboo', 'mochaTest:bamboo']); grunt.registerTask('default', ['githooks', 'server']); }; diff --git a/gui-resources/scripts/js/build/main.js b/gui-resources/scripts/js/build/main.js index f97622878..3df2e602e 100644 --- a/gui-resources/scripts/js/build/main.js +++ b/gui-resources/scripts/js/build/main.js @@ -1,15 +1,15 @@ -var liveblog;!function(){if(!liveblog||!liveblog.requirejs){liveblog?require=liveblog:liveblog={};var requirejs,require,define;!function(global){function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){if(e){var n;for(n=0;n-1&&(!e[n]||!t(e[n],n,e));n-=1);}}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){var n;for(n in e)if(hasProp(e,n)&&t(e[n],n))break}function mixin(e,t,n,r){return t&&eachProp(t,function(t,i){(n||!hasProp(e,i))&&(!r||"object"!=typeof t||!t||isArray(t)||isFunction(t)||t instanceof RegExp?e[i]=t:(e[i]||(e[i]={}),mixin(e[i],t,n,r)))}),e}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(e){throw e}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),function(e){t=t[e]}),t}function makeError(e,t,n,r){var i=new Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e);return i.requireType=e,i.requireModules=r,n&&(i.originalError=n),i}function newContext(e){function t(e){var t,n;for(t=0;t0&&(e.splice(t-1,2),t-=2)}}function n(e,n,r){var i,a,o,s,l,u,c,d,f,h,p,m,_=n&&n.split("/"),g=L.map,y=g&&g["*"];if(e&&(e=e.split("/"),c=e.length-1,L.nodeIdCompat&&jsSuffixRegExp.test(e[c])&&(e[c]=e[c].replace(jsSuffixRegExp,"")),"."===e[0].charAt(0)&&_&&(m=_.slice(0,_.length-1),e=m.concat(e)),t(e),e=e.join("/")),r&&g&&(_||y)){o=e.split("/");e:for(s=o.length;s>0;s-=1){if(u=o.slice(0,s).join("/"),_)for(l=_.length;l>0;l-=1)if(a=getOwn(g,_.slice(0,l).join("/")),a&&(a=getOwn(a,u))){d=a,f=s;break e}!h&&y&&getOwn(y,u)&&(h=getOwn(y,u),p=s)}!d&&h&&(d=h,f=p),d&&(o.splice(0,f,d),e=o.join("/"))}return i=getOwn(L.pkgs,e),i?i:e}function r(e){isBrowser&&each(scripts(),function(t){return t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===b.contextName?(t.parentNode.removeChild(t),!0):void 0})}function i(e){var t=getOwn(L.paths,e);return t&&isArray(t)&&t.length>1?(t.shift(),b.require.undef(e),b.makeRequire(null,{skipMap:!0})([e]),!0):void 0}function a(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function o(e,t,r,i){var o,s,l,u,c=null,d=t?t.name:null,f=e,h=!0,p="";return e||(h=!1,e="_@r"+(C+=1)),u=a(e),c=u[0],e=u[1],c&&(c=n(c,d,i),s=getOwn(x,c)),e&&(c?p=s&&s.normalize?s.normalize(e,function(e){return n(e,d,i)}):n(e,d,i):(p=n(e,d,i),u=a(p),c=u[0],p=u[1],r=!0,o=b.nameToUrl(p))),l=!c||s||r?"":"_unnormalized"+(B+=1),{prefix:c,name:p,parentMap:t,unnormalized:!!l,url:o,originalName:f,isDefine:h,id:(c?c+"!"+p:p)+l}}function s(e){var t=e.id,n=getOwn(T,t);return n||(n=T[t]=new b.Module(e)),n}function l(e,t,n){var r=e.id,i=getOwn(T,r);!hasProp(x,r)||i&&!i.defineEmitComplete?(i=s(e),i.error&&"error"===t?n(i.error):i.on(t,n)):"defined"===t&&n(x[r])}function u(e,t){var n=e.requireModules,r=!1;t?t(e):(each(n,function(t){var n=getOwn(T,t);n&&(n.error=e,n.events.error&&(r=!0,n.emit("error",e)))}),r||req.onError(e))}function c(){globalDefQueue.length&&(apsp.apply(Y,[Y.length,0].concat(globalDefQueue)),globalDefQueue=[])}function d(e){delete T[e],delete w[e]}function f(e,t,n){var r=e.map.id;e.error?e.emit("error",e.error):(t[r]=!0,each(e.depMaps,function(r,i){var a=r.id,o=getOwn(T,a);!o||e.depMatched[i]||n[a]||(getOwn(t,a)?(e.defineDep(i,x[a]),e.check()):f(o,t,n))}),n[r]=!0)}function h(){var e,t,n=1e3*L.waitSeconds,a=n&&b.startTime+n<(new Date).getTime(),o=[],s=[],l=!1,c=!0;if(!y){if(y=!0,eachProp(w,function(e){var n=e.map,u=n.id;if(e.enabled&&(n.isDefine||s.push(e),!e.error))if(!e.inited&&a)i(u)?(t=!0,l=!0):(o.push(u),r(u));else if(!e.inited&&e.fetched&&n.isDefine&&(l=!0,!n.prefix))return c=!1}),a&&o.length)return e=makeError("timeout","Load timeout for modules: "+o,null,o),e.contextName=b.contextName,u(e);c&&each(s,function(e){f(e,{},{})}),a&&!t||!l||!isBrowser&&!isWebWorker||k||(k=setTimeout(function(){k=0,h()},50)),y=!1}}function p(e){hasProp(x,e[0])||s(o(e[0],null,!0)).init(e[1],e[2])}function m(e,t,n,r){e.detachEvent&&!isOpera?r&&e.detachEvent(r,t):e.removeEventListener(n,t,!1)}function _(e){var t=e.currentTarget||e.srcElement;return m(t,b.onScriptLoad,"load","onreadystatechange"),m(t,b.onScriptError,"error"),{node:t,id:t&&t.getAttribute("data-requiremodule")}}function g(){var e;for(c();Y.length;){if(e=Y.shift(),null===e[0])return u(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));p(e)}}var y,v,b,M,k,L={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},T={},w={},A={},Y=[],x={},D={},S={},C=1,B=1;return M={require:function(e){return e.require?e.require:e.require=b.makeRequire(e.map)},exports:function(e){return e.usingExports=!0,e.map.isDefine?e.exports?x[e.map.id]=e.exports:e.exports=x[e.map.id]={}:void 0},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return getOwn(L.config,e.map.id)||{}},exports:e.exports||(e.exports={})}}},v=function(e){this.events=getOwn(A,e.id)||{},this.map=e,this.shim=getOwn(L.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},v.prototype={init:function(e,t,n,r){r=r||{},this.inited||(this.factory=t,n?this.on("error",n):this.events.error&&(n=bind(this,function(e){this.emit("error",e)})),this.depMaps=e&&e.slice(0),this.errback=n,this.inited=!0,this.ignore=r.ignore,r.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=t)},fetch:function(){if(!this.fetched){this.fetched=!0,b.startTime=(new Date).getTime();var e=this.map;return this.shim?void b.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()})):e.prefix?this.callPlugin():this.load()}},load:function(){var e=this.map.url;D[e]||(D[e]=!0,b.load(this.map.id,e))},check:function(){if(this.enabled&&!this.enabling){var e,t,n=this.map.id,r=this.depExports,i=this.exports,a=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(a)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{i=b.execCb(n,a,r,i)}catch(o){e=o}else i=b.execCb(n,a,r,i);if(this.map.isDefine&&void 0===i&&(t=this.module,t?i=t.exports:this.usingExports&&(i=this.exports)),e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?"define":"require",u(this.error=e)}else i=a;this.exports=i,this.map.isDefine&&!this.ignore&&(x[n]=i,req.onResourceLoad&&req.onResourceLoad(b,this.map,this.depMaps)),d(n),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else this.fetch()}},callPlugin:function(){var e=this.map,t=e.id,r=o(e.prefix);this.depMaps.push(r),l(r,"defined",bind(this,function(r){var i,a,c,f=getOwn(S,this.map.id),h=this.map.name,p=this.map.parentMap?this.map.parentMap.name:null,m=b.makeRequire(e.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(r.normalize&&(h=r.normalize(h,function(e){return n(e,p,!0)})||""),a=o(e.prefix+"!"+h,this.map.parentMap),l(a,"defined",bind(this,function(e){this.init([],function(){return e},null,{enabled:!0,ignore:!0})})),c=getOwn(T,a.id),void(c&&(this.depMaps.push(a),this.events.error&&c.on("error",bind(this,function(e){this.emit("error",e)})),c.enable()))):f?(this.map.url=b.nameToUrl(f),void this.load()):(i=bind(this,function(e){this.init([],function(){return e},null,{enabled:!0})}),i.error=bind(this,function(e){this.inited=!0,this.error=e,e.requireModules=[t],eachProp(T,function(e){0===e.map.id.indexOf(t+"_unnormalized")&&d(e.map.id)}),u(e)}),i.fromText=bind(this,function(n,r){var a=e.name,l=o(a),c=useInteractive;r&&(n=r),c&&(useInteractive=!1),s(l),hasProp(L.config,t)&&(L.config[a]=L.config[t]);try{req.exec(n)}catch(d){return u(makeError("fromtexteval","fromText eval for "+t+" failed: "+d,d,[t]))}c&&(useInteractive=!0),this.depMaps.push(l),b.completeLoad(a),m([a],i)}),void r.load(e.name,m,i,L))})),b.enable(r,this),this.pluginMaps[r.id]=r},enable:function(){w[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,t){var n,r,i;if("string"==typeof e){if(e=o(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[t]=e,i=getOwn(M,e.id))return void(this.depExports[t]=i(this));this.depCount+=1,l(e,"defined",bind(this,function(e){this.defineDep(t,e),this.check()})),this.errback&&l(e,"error",bind(this,this.errback))}n=e.id,r=T[n],hasProp(M,n)||!r||r.enabled||b.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var t=getOwn(T,e.id);t&&!t.enabled&&b.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,t){var n=this.events[e];n||(n=this.events[e]=[]),n.push(t)},emit:function(e,t){each(this.events[e],function(e){e(t)}),"error"===e&&delete this.events[e]}},b={config:L,contextName:e,registry:T,defined:x,urlFetched:D,defQueue:Y,Module:v,makeModuleMap:o,nextTick:req.nextTick,onError:u,configure:function(e){e.baseUrl&&"/"!==e.baseUrl.charAt(e.baseUrl.length-1)&&(e.baseUrl+="/");var t=L.shim,n={paths:!0,bundles:!0,config:!0,map:!0};eachProp(e,function(e,t){n[t]?(L[t]||(L[t]={}),mixin(L[t],e,!0,!0)):L[t]=e}),e.bundles&&eachProp(e.bundles,function(e,t){each(e,function(e){e!==t&&(S[e]=t)})}),e.shim&&(eachProp(e.shim,function(e,n){isArray(e)&&(e={deps:e}),!e.exports&&!e.init||e.exportsFn||(e.exportsFn=b.makeShimExports(e)),t[n]=e}),L.shim=t),e.packages&&each(e.packages,function(e){var t,n;e="string"==typeof e?{name:e}:e,n=e.name,t=e.location,t&&(L.paths[n]=e.location),L.pkgs[n]=e.name+"/"+(e.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}),eachProp(T,function(e,t){e.inited||e.map.unnormalized||(e.map=o(t))}),(e.deps||e.callback)&&b.require(e.deps||[],e.callback)},makeShimExports:function(e){function t(){var t;return e.init&&(t=e.init.apply(global,arguments)),t||e.exports&&getGlobal(e.exports)}return t},makeRequire:function(t,i){function a(n,r,l){var c,d,f;return i.enableBuildCallback&&r&&isFunction(r)&&(r.__requireJsBuild=!0),"string"==typeof n?isFunction(r)?u(makeError("requireargs","Invalid require call"),l):t&&hasProp(M,n)?M[n](T[t.id]):req.get?req.get(b,n,t,a):(d=o(n,t,!1,!0),c=d.id,hasProp(x,c)?x[c]:u(makeError("notloaded",'Module name "'+c+'" has not been loaded yet for context: '+e+(t?"":". Use require([])")))):(g(),b.nextTick(function(){g(),f=s(o(null,t)),f.skipMap=i.skipMap,f.init(n,r,l,{enabled:!0}),h()}),a)}return i=i||{},mixin(a,{isBrowser:isBrowser,toUrl:function(e){var r,i=e.lastIndexOf("."),a=e.split("/")[0],o="."===a||".."===a;return-1!==i&&(!o||i>1)&&(r=e.substring(i,e.length),e=e.substring(0,i)),b.nameToUrl(n(e,t&&t.id,!0),r,!0)},defined:function(e){return hasProp(x,o(e,t,!1,!0).id)},specified:function(e){return e=o(e,t,!1,!0).id,hasProp(x,e)||hasProp(T,e)}}),t||(a.undef=function(e){c();var n=o(e,t,!0),i=getOwn(T,e);r(e),delete x[e],delete D[n.url],delete A[e],eachReverse(Y,function(t,n){t[0]===e&&Y.splice(n,1)}),i&&(i.events.defined&&(A[e]=i.events),d(e))}),a},enable:function(e){var t=getOwn(T,e.id);t&&s(e).enable()},completeLoad:function(e){var t,n,r,a=getOwn(L.shim,e)||{},o=a.exports;for(c();Y.length;){if(n=Y.shift(),null===n[0]){if(n[0]=e,t)break;t=!0}else n[0]===e&&(t=!0);p(n)}if(r=getOwn(T,e),!t&&!hasProp(x,e)&&r&&!r.inited){if(!(!L.enforceDefine||o&&getGlobal(o)))return i(e)?void 0:u(makeError("nodefine","No define call for "+e,null,[e]));p([e,a.deps||[],a.exportsFn])}h()},nameToUrl:function(e,t,n){var r,i,a,o,s,l,u,c=getOwn(L.pkgs,e);if(c&&(e=c),u=getOwn(S,e))return b.nameToUrl(u,t,n);if(req.jsExtRegExp.test(e))s=e+(t||"");else{for(r=L.paths,i=e.split("/"),a=i.length;a>0;a-=1)if(o=i.slice(0,a).join("/"),l=getOwn(r,o)){isArray(l)&&(l=l[0]),i.splice(0,a,l);break}s=i.join("/"),s+=t||(/^data\:|\?/.test(s)||n?"":".js"),s=("/"===s.charAt(0)||s.match(/^[\w\+\.\-]+:/)?"":L.baseUrl)+s}return L.urlArgs?s+((-1===s.indexOf("?")?"?":"&")+L.urlArgs):s},load:function(e,t){req.load(b,e,t)},execCb:function(e,t,n,r){return t.apply(r,n)},onScriptLoad:function(e){if("load"===e.type||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var t=_(e);b.completeLoad(t.id)}},onScriptError:function(e){var t=_(e);return i(t.id)?void 0:u(makeError("scripterror","Script error for: "+t.id,e,[t.id]))}},b.require=b.makeRequire(),b}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState?interactiveScript:(eachReverse(scripts(),function(e){return"interactive"===e.readyState?interactiveScript=e:void 0}),interactiveScript)}var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.1.13",commentRegExp=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,ap=Array.prototype,apsp=ap.splice,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;if("undefined"==typeof define){if("undefined"!=typeof requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}"undefined"==typeof require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(e,t,n,r){var i,a,o=defContextName;return isArray(e)||"string"==typeof e||(a=e,isArray(t)?(e=t,t=n,n=r):e=[]),a&&a.context&&(o=a.context),i=getOwn(contexts,o),i||(i=contexts[o]=req.s.newContext(o)),a&&i.configure(a),i.require(e,t,n)},req.config=function(e){return req(e)},req.nextTick="undefined"!=typeof setTimeout?function(e){setTimeout(e,4)}:function(e){e()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],function(e){req[e]=function(){var t=contexts[defContextName];return t.require[e].apply(t,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(e){var t=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return t.type=e.scriptType||"text/javascript",t.charset="utf-8",t.async=!0,t},req.load=function(e,t,n){var r,i=e&&e.config||{};if(isBrowser)return r=req.createNode(i,t,n),r.setAttribute("data-requirecontext",e.contextName),r.setAttribute("data-requiremodule",t),!r.attachEvent||r.attachEvent.toString&&r.attachEvent.toString().indexOf("[native code")<0||isOpera?(r.addEventListener("load",e.onScriptLoad,!1),r.addEventListener("error",e.onScriptError,!1)):(useInteractive=!0,r.attachEvent("onreadystatechange",e.onScriptLoad)),r.src=n,currentlyAddingScript=r,baseElement?head.insertBefore(r,baseElement):head.appendChild(r),currentlyAddingScript=null,r;if(isWebWorker)try{importScripts(n),e.completeLoad(t)}catch(a){e.onError(makeError("importscripts","importScripts failed for "+t+" at "+n,a,[t]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(e){return head||(head=e.parentNode),dataMain=e.getAttribute("data-main"),dataMain?(mainScript=dataMain,cfg.baseUrl||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0):void 0}),define=function(e,t,n){var r,i;"string"!=typeof e&&(n=t,t=e,e=null),isArray(t)||(n=t,t=null),!t&&isFunction(n)&&(t=[],n.length&&(n.toString().replace(commentRegExp,"").replace(cjsRequireRegExp,function(e,n){t.push(n)}),t=(1===n.length?["require"]:["require","exports","module"]).concat(t))),useInteractive&&(r=currentlyAddingScript||getInteractiveScript(),r&&(e||(e=r.getAttribute("data-requiremodule")),i=contexts[r.getAttribute("data-requirecontext")])),(i?i.defQueue:globalDefQueue).push([e,t,n])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)}}(this),liveblog.requirejs=requirejs,liveblog.require=require,liveblog.define=define}}(),liveblog.define("require-lib",function(){}),function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t=e.length,n=at.type(e);return"function"===n||at.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function r(e,t,n){if(at.isFunction(t))return at.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return at.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(ht.test(t))return at.filter(t,e,n);t=at.filter(t,e)}return at.grep(e,function(e){return at.inArray(e,t)>=0!==n})}function i(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function a(e){var t=Mt[e]={};return at.each(e.match(bt)||[],function(e,n){t[n]=!0}),t}function o(){mt.addEventListener?(mt.removeEventListener("DOMContentLoaded",s,!1),e.removeEventListener("load",s,!1)):(mt.detachEvent("onreadystatechange",s),e.detachEvent("onload",s))}function s(){(mt.addEventListener||"load"===event.type||"complete"===mt.readyState)&&(o(),at.ready())}function l(e,t,n){if(void 0===n&&1===e.nodeType){var r="data-"+t.replace(At,"-$1").toLowerCase();if(n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:wt.test(n)?at.parseJSON(n):n}catch(i){}at.data(e,t,n)}else n=void 0}return n}function u(e){var t;for(t in e)if(("data"!==t||!at.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function c(e,t,n,r){if(at.acceptData(e)){var i,a,o=at.expando,s=e.nodeType,l=s?at.cache:e,u=s?e[o]:e[o]&&o;if(u&&l[u]&&(r||l[u].data)||void 0!==n||"string"!=typeof t)return u||(u=s?e[o]=$.pop()||at.guid++:o),l[u]||(l[u]=s?{}:{toJSON:at.noop}),("object"==typeof t||"function"==typeof t)&&(r?l[u]=at.extend(l[u],t):l[u].data=at.extend(l[u].data,t)),a=l[u],r||(a.data||(a.data={}),a=a.data),void 0!==n&&(a[at.camelCase(t)]=n),"string"==typeof t?(i=a[t],null==i&&(i=a[at.camelCase(t)])):i=a,i}}function d(e,t,n){if(at.acceptData(e)){var r,i,a=e.nodeType,o=a?at.cache:e,s=a?e[at.expando]:at.expando;if(o[s]){if(t&&(r=n?o[s]:o[s].data)){at.isArray(t)?t=t.concat(at.map(t,at.camelCase)):t in r?t=[t]:(t=at.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;for(;i--;)delete r[t[i]];if(n?!u(r):!at.isEmptyObject(r))return}(n||(delete o[s].data,u(o[s])))&&(a?at.cleanData([e],!0):rt.deleteExpando||o!=o.window?delete o[s]:o[s]=null)}}}function f(){return!0}function h(){return!1}function p(){try{return mt.activeElement}catch(e){}}function m(e){var t=Pt.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function _(e,t){var n,r,i=0,a=typeof e.getElementsByTagName!==Tt?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==Tt?e.querySelectorAll(t||"*"):void 0;if(!a)for(a=[],n=e.childNodes||e;null!=(r=n[i]);i++)!t||at.nodeName(r,t)?a.push(r):at.merge(a,_(r,t));return void 0===t||t&&at.nodeName(e,t)?at.merge([e],a):a}function g(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}function y(e,t){return at.nodeName(e,"table")&&at.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function v(e){return e.type=(null!==at.find.attr(e,"type"))+"/"+e.type,e}function b(e){var t=$t.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function M(e,t){for(var n,r=0;null!=(n=e[r]);r++)at._data(n,"globalEval",!t||at._data(t[r],"globalEval"))}function k(e,t){if(1===t.nodeType&&at.hasData(e)){var n,r,i,a=at._data(e),o=at._data(t,a),s=a.events;if(s){delete o.handle,o.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)at.event.add(t,n,s[n][r])}o.data&&(o.data=at.extend({},o.data))}}function L(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!rt.noCloneEvent&&t[at.expando]){i=at._data(t);for(r in i.events)at.removeEvent(t,r,i.handle);t.removeAttribute(at.expando)}"script"===n&&t.text!==e.text?(v(t).text=e.text,b(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),rt.html5Clone&&e.innerHTML&&!at.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function T(t,n){var r=at(n.createElement(t)).appendTo(n.body),i=e.getDefaultComputedStyle?e.getDefaultComputedStyle(r[0]).display:at.css(r[0],"display");return r.detach(),i}function w(e){var t=mt,n=en[e];return n||(n=T(e,t),"none"!==n&&n||(Zt=(Zt||at("')}function m(e,t){return t=t.shiftBlocks(g),e.reference(t.getPath(!1,["Meta","description"]),t,"h")}function _(e,t){return t=t.shiftBlocks(g),e.write("youtube.com")}e.register("themeBase/item/source/youtube",t);var g={itemClass:n,contentCore:r,contentExternal:o,externalInfo:c,externalInfoTitle:f,externalInfoTitleSrc:h,externalIframe:p,externalTextContainer:m,contentAttrName:_};return t}(),{render:function(t,n){return e.render("themeBase/item/source/youtube",t,n)}}}),liveblog.define("tmpl!themeBase/item/source/flickr",["dust"],function(e){return function(){function t(e,t){return t=t.shiftBlocks(f),e.partial("themeBase/item/source/base",t,null)}function n(e,t){return t=t.shiftBlocks(f),e.write("flickr")}function r(e,t){return t=t.shiftBlocks(f),e.block(t.getBlock("contentExternalContainer"),t,{block:i},null).block(t.getBlock("contentAttr"),t,{block:a},null)}function i(e,t){return t=t.shiftBlocks(f),e}function a(e,t){return t=t.shiftBlocks(f),e}function o(e,t){return t=t.shiftBlocks(f),e.block(t.getBlock("extenalImageContainer"),t,{block:s},null)}function s(e,t){return t=t.shiftBlocks(f),e}function l(e,t){return t=t.shiftBlocks(f),e.write("http://farm").reference(t.getPath(!1,["Meta","farm"]),t,"h").write(".staticflickr.com/").reference(t.getPath(!1,["Meta","server"]),t,"h").write("/").reference(t.getPath(!1,["Meta","id"]),t,"h").write("_").reference(t.getPath(!1,["Meta","secret"]),t,"h").write(".jpg")}function u(e,t){return t=t.shiftBlocks(f),e.write("http://farm").reference(t.getPath(!1,["Meta","farm"]),t,"h").write(".staticflickr.com/").reference(t.getPath(!1,["Meta","server"]),t,"h").write("/").reference(t.getPath(!1,["Meta","id"]),t,"h").write("_").reference(t.getPath(!1,["Meta","secret"]),t,"h").write(".jpg")}function c(e,t){return t=t.shiftBlocks(f),e.reference(t.getPath(!1,["Meta","title"]),t,"h")}function d(e,t){return t=t.shiftBlocks(f),e.write("flickr.com")}e.register("themeBase/item/source/flickr",t);var f={itemClass:n,contentCore:r,contentExternal:o,externalImageLink:l,externalImageSrc:u,externalImageAlt:c,contentAttrName:d};return t}(),{render:function(t,n){return e.render("themeBase/item/source/flickr",t,n)}}}),liveblog.define("tmpl!themeBase/item/source/comments",["dust"],function(e){return function(){function t(e,t){return t=t.shiftBlocks(d),e.partial("themeBase/item/source/base",t,null)}function n(e,t){return t=t.shiftBlocks(d),e.write("usercomments")}function r(e,t){return t=t.shiftBlocks(d),e.block(t.getBlock("contenteBaseBefore"),t,{block:i},null).block(t.getBlock("contentText"),t,{block:a},null)}function i(e,t){return t=t.shiftBlocks(d),e}function a(e,t){return t=t.shiftBlocks(d),e}function o(e,t){return t=t.shiftBlocks(d),e.block(t.getBlock("createdDateContainer"),t,{block:s},null)}function s(e,t){return t=t.shiftBlocks(d),e}function l(e,t){return t=t.shiftBlocks(d),e.exists(t.getPath(!1,["Meta","AuthorName"]),t,{"else":u,block:c},null)}function u(e,t){return t=t.shiftBlocks(d),e.reference(t.get(["AuthorName"],!1),t,"h")}function c(e,t){return t=t.shiftBlocks(d),e.reference(t.getPath(!1,["Meta","AuthorName"]),t,"h")}e.register("themeBase/item/source/comments",t);var d={itemClass:n,contentCore:r,postDateContainer:o,publisherName:l};return t}(),{render:function(t,n){return e.render("themeBase/item/source/comments",t,n)}}}),liveblog.define("tmpl!themeBase/item/source/soundcloud",["dust"],function(e){return function(){function t(e,t){return t=t.shiftBlocks(c),e.partial("themeBase/item/source/base",t,null)}function n(e,t){return t=t.shiftBlocks(c),e.write("soundcloud")}function r(e,t){return t=t.shiftBlocks(c),e.block(t.getBlock("contentExternalContainer"),t,{block:i},null).block(t.getBlock("contentAttr"),t,{block:a},null)}function i(e,t){return t=t.shiftBlocks(c),e}function a(e,t){return t=t.shiftBlocks(c),e}function o(e,t){return t=t.shiftBlocks(c),e.block(t.getBlock("externalIframeContainer"),t,{block:s},null)}function s(e,t){return t=t.shiftBlocks(c),e}function l(e,t){return t=t.shiftBlocks(c),e.write('')}function u(e,t){return t=t.shiftBlocks(c),e.write("soundcloud.com")}e.register("themeBase/item/source/soundcloud",t);var c={itemClass:n,contentCore:r,contentExternal:o,externalIframe:l,contentAttrName:u};return t}(),{render:function(t,n){return e.render("themeBase/item/source/soundcloud",t,n)}}}),liveblog.define("tmpl!themeBase/item/source/instagram",["dust"],function(e){return function(){function t(e,t){return t=t.shiftBlocks(p),e.partial("themeBase/item/source/base",t,null)}function n(e,t){return t=t.shiftBlocks(p),e.write("instagram")}function r(e,t){return t=t.shiftBlocks(p),e.block(t.getBlock("contentExternalContainer"),t,{block:i},null).block(t.getBlock("contentAttr"),t,{block:a},null)}function i(e,t){return t=t.shiftBlocks(p),e}function a(e,t){return t=t.shiftBlocks(p),e}function o(e,t){return t=t.shiftBlocks(p),e.block(t.getBlock("extenalImageContainer"),t,{block:s},null).block(t.getBlock("externalTextContainer"),t,{block:l},null)}function s(e,t){return t=t.shiftBlocks(p),e}function l(e,t){return t=t.shiftBlocks(p),e}function u(e,t){return t=t.shiftBlocks(p),e.reference(t.getPath(!1,["Meta","images","standard_resolution","url"]),t,"h")}function c(e,t){return t=t.shiftBlocks(p),e.reference(t.getPath(!1,["Meta","images","standard_resolution","url"]),t,"h")}function d(e,t){return t=t.shiftBlocks(p),e.reference(t.getPath(!1,["Meta","caption","text"]),t,"h",["trim50"])}function f(e,t){return t=t.shiftBlocks(p),e.reference(t.getPath(!1,["Meta","caption","text"]),t,"h")}function h(e,t){return t=t.shiftBlocks(p),e.write("instagram.com")}e.register("themeBase/item/source/instagram",t);var p={itemClass:n,contentCore:r,contentExternal:o,externalImageLink:u,externalImageSrc:c,externalImageAlt:d,externalText:f,contentAttrName:h};return t}(),{render:function(t,n){return e.render("themeBase/item/source/instagram",t,n)}}}),liveblog.define("tmpl!themeBase/item/source/sms",["dust"],function(e){return function(){function t(e,t){return t=t.shiftBlocks(u),e.partial("themeBase/item/source/base",t,null)}function n(e,t){return t=t.shiftBlocks(u),e.write("sms")}function r(e,t){return t=t.shiftBlocks(u),e.block(t.getBlock("contenteBaseBefore"),t,{block:i},null).block(t.getBlock("contentText"),t,{block:a},null)}function i(e,t){return t=t.shiftBlocks(u),e}function a(e,t){return t=t.shiftBlocks(u),e}function o(e,t){return t=t.shiftBlocks(u),e.block(t.getBlock("createdDateContainer"),t,{block:s},null)}function s(e,t){return t=t.shiftBlocks(u),e}function l(e,t){return t=t.shiftBlocks(u),e.reference(t.getPath(!1,["Meta","Creator","Name"]),t,"h")}e.register("themeBase/item/source/sms",t);var u={itemClass:n,contentCore:r,postDateContainer:o,publisherName:l};return t}(),{render:function(t,n){return e.render("themeBase/item/source/sms",t,n)}}}),liveblog.define("tmpl!themeBase/plugins/user-comment",["dust"],function(e){return function(){function t(e,t){return e.write('
').helper("i18n",t,{},{msgid:"Please fill in your Nickname."}).write('
').helper("i18n",t,{},{msgid:"Please fill in your Comment text."}).write('
').helper("i18n",t,{},{msgid:"Please fill in text from image."}).write('
")}return e.register("themeBase/plugins/user-comment",t),t}(),{render:function(t,n){return e.render("themeBase/plugins/user-comment",t,n)}}}),liveblog.define("views/post-templates",["tmpl!themeBase/item/base","tmpl!themeBase/item/posttype/base","tmpl!themeBase/item/posttype/normal","tmpl!themeBase/item/posttype/image","tmpl!themeBase/item/posttype/wrapup","tmpl!themeBase/item/posttype/quote","tmpl!themeBase/item/posttype/link","tmpl!themeBase/item/posttype/infomercial","tmpl!themeBase/item/source/base","tmpl!themeBase/item/source/infomercial","tmpl!themeBase/item/source/google","tmpl!themeBase/item/source/google/web","tmpl!themeBase/item/source/google/news","tmpl!themeBase/item/source/google/images","tmpl!themeBase/item/source/twitter","tmpl!themeBase/item/source/facebook","tmpl!themeBase/item/source/youtube","tmpl!themeBase/item/source/flickr","tmpl!themeBase/item/source/comments","tmpl!themeBase/item/source/soundcloud","tmpl!themeBase/item/source/instagram","tmpl!themeBase/item/source/sms","tmpl!themeBase/plugins/user-comment"],function(){}),liveblog.define("views/post",["underscore","lib/utils","views/base-view","lib/lodash/defaults-deep","views/post-templates"],function(e,t,n){return n.extend({el:!1,initialize:function(){e.defaultsDeep(this,this.propertiesObj),this.order=parseFloat(this.model.get("Order")),t.dispatcher.trigger("initialize.post-view",this),this.setTemplate("themeBase/item/"+this.model.get("item")),this.listenTo(this.model,"change:CId",this.update)},update:function(){this.model.hasChanged("Order")||this.model.hasChanged("DeletedOn")||this.model.hasChanged("isPublished")||this.render()},serialize:function(){var e=this.model.toJSON();return e.baseItem=this.themedTemplate("themeBase/item/base"),this.permalink&&"function"==typeof this.permalink&&(e.permalink=this.permalink()),e},alreadyRendered:function(){this.fakeViewRendering(),t.dispatcher.trigger("before-render.post-view",this),t.dispatcher.trigger("after-render.post-view",this)},beforeRender:function(){t.dispatcher.trigger("before-render.post-view",this)},afterRender:function(){t.dispatcher.trigger("after-render.post-view",this)}})}),liveblog.define("tmpl!themeBase/posts-list",["dust"],function(e){return function(){function t(e){return e.write('
    ')}return e.register("themeBase/posts-list",t),t}(),{render:function(t,n){return e.render("themeBase/posts-list",t,n)}}}),liveblog.define("views/posts",["underscore","lib/utils","views/base-view","views/post","tmpl!themeBase/posts-list"],function(e,t,n,r){return n.extend({el:!1,rootSel:'[data-gimme="posts.list"]',postRootDataAttr:"data-gimme-postid",postRootSel:function(e){return e?"["+this.postRootDataAttr+'="'+e+'"]':"["+this.postRootDataAttr+"]"},flags:{autoRender:!0},pendingCounter:0,initialize:function(){t.dispatcher.trigger("initialize.posts-view",this),e.bindAll(this,"insertPostView","orderViews","_postViewIndex","_insertPostViewAt","_insertPostViewAtFirstPos"),this.setTemplate("themeBase/posts-list"),t.isClient&&(this.listenTo(this.collection,"reset",this.setViewOnReset),this.listenTo(this.collection,"add",this.checkPending),this.listenTo(this.collection,"remove",this.removePost),this.listenTo(this.collection,"change:Order",this.reorderPost),this.listenTo(this.collection,"change:DeletedOn",this.removePostFromCollection),this.listenTo(this.collection,"change:IsPublished",this.removePostFromCollection)),this.collection.fetchPage({reset:!0})},beforeRender:function(){this.collection.forEach(this.insertPostView,this)},afterRender:function(){t.dispatcher.trigger("after-render.posts-view",this)},setViewOnReset:function(){this.fakeViewRendering();var e=this.$el.children(this.postRootSel());if(0===e.length)return void this.render();var n=this;e.each(function(e,t){var r,i=n.$(t),a=i.attr(n.postRootDataAttr),o=i.data("gimme-cid").toString(),s=n.collection.get(a);s&&o===s.get("CId")?(r=n.insertPostView(s,{el:n.postRootSel(a)}),r.alreadyRendered()):i.remove()}),this.collection.forEach(this.addPostIfMissing,this),t.dispatcher.trigger("add-all.posts-view",this)},addPostIfMissing:function(e){var t=this._postViewIndex(e.id);-1===t&&this.addPost(e)},removePostFromCollection:function(t){return e.isUndefined(t.get("DeletedOn"))&&"False"!==t.get("IsPublished")?!1:(this.collection.remove(t),!0)},renderPending:function(){var e=this;this.collection.each(function(t){t.get("pending")&&(e.addPost(t),t.set("pending",!1),e.pendingCounter--)}),t.dispatcher.trigger("rendered-pending.posts-view",this),t.dispatcher.trigger("update-pending.posts-view",this)},checkPending:function(e){!this.flags.autoRender&&e.get("updateItem")?(e.set("pending",!0),this.pendingCounter++,t.dispatcher.trigger("update-pending.posts-view",this)):this.addPost(e)},addPost:function(e){if(!this.removePostFromCollection(e)){var n=this.insertPostView(e);this.orderViews(),n.render(),t.dispatcher.trigger("add-all.posts-view",this)}},removePost:function(e){var n=this,r=e.get("pending");r?(this.pendingCounter--,t.dispatcher.trigger("update-pending.posts-view",this)):this.removeView(function(t){return t.$el.is(n.postRootSel(e.id))?t:void 0})},reorderPost:function(e,t){if(this.onlyOrderHasChanged(e)){this.views[""][this._postViewIndex(e.id)].order=parseFloat(t),this.orderViews();var n=this._postViewIndex(e.id),r=this.$(this.postRootSel(e.id)).detach();this._insertPostViewAt(this.$el,r,n)}else this.removePost(e),this.addPost(e)},insert:function(e,n){if(e.is(":empty"))e.append(n),t.dispatcher.trigger("add-all.posts-view",this);else{var r=this._postViewIndex(n.attr(this.postRootDataAttr));this._insertPostViewAt(e,n,r)}},insertPostView:function(t,n){var i=e.extend({model:t},n),a=new r(i);return this.insertView("",a),a},orderViews:function(){this.views[""]=e.sortBy(this.views[""],"order").reverse()},onlyOrderHasChanged:function(t){return e.size(t.changedAttributes())>2&&t.hasChanged("CId")&&t.hasChanged("Order")},firstPost:function(){return this.views[""][0]},_postViewIndex:function(t){if(!this.views[""])return-1;var n=e.map(this.views[""],function(e){return e.model.id});return e.indexOf(n,t)},_insertPostViewAt:function(e,t,n){if(0===n)this._insertPostViewAtFirstPos(e,t);else if(n>0){var r=this.views[""][n-1].model.id;e.children(this.postRootSel(r)).after(t)}},_insertPostViewAtFirstPos:function(e,t){var n=e.children(this.postRootSel()).first();if(0!==n.length)n.before(t);else{var r=e.children('[data-gimme="posts.beforePage"]');0!==r.length?r.after(t):e.append(t)}}})}),liveblog.define("lib/helpers/display-toggle",["underscore"],function(e){var t=function(t,n){var r="";r=e.isUndefined(n)?"block"===t.css("display")?"none":"block":n?"block":"none",t.css("display",r)};return t}),liveblog.define("tmpl!themeBase/container",["dust"],function(e){return function(){function t(e,t){return t=t.shiftBlocks(U),e.block(t.getBlock("mainContainer"),t,{block:n},null)}function n(e,t){return t=t.shiftBlocks(U),e.write('
    ').block(t.getBlock("main"),t,{block:i},null).write("
    ")}function r(e,t){return t=t.shiftBlocks(U),e}function i(e,t){return t=t.shiftBlocks(U),e.write('
    ').block(t.getBlock("headerContainer"),t,{block:a},null).block(t.getBlock("contentContainer"),t,{block:c},null).block(t.getBlock("footerContainer"),t,{block:D},null).write("
    ")}function a(e,t){return t=t.shiftBlocks(U),e.write('
    ').block(t.getBlock("header"),t,{block:o},null).write("
    ")}function o(e,t){return t=t.shiftBlocks(U),e.block(t.getBlock("blogTitle"),t,{block:s},null).block(t.getBlock("blogDescription"),t,{block:l},null).block(t.getBlock("blogMedia"),t,{block:u},null)}function s(e,t){return t=t.shiftBlocks(U),e}function l(e,t){return t=t.shiftBlocks(U),e}function u(e,t){return t=t.shiftBlocks(U),e}function c(e,t){return t=t.shiftBlocks(U),e.write('
    ').block(t.getBlock("userComment"),t,{block:d},null).block(t.getBlock("content"),t,{block:m},null).write("
    ")}function d(e,t){return t=t.shiftBlocks(U),e.block(t.getBlock("userCommentBox"),t,{block:f},null).block(t.getBlock("userCommentBoxMessage"),t,{block:h},null).block(t.getBlock("userCommentBackdrop"),t,{block:p},null)}function f(e,t){return t=t.shiftBlocks(U),e}function h(e,t){return t=t.shiftBlocks(U),e}function p(e,t){return t=t.shiftBlocks(U),e}function m(e,t){return t=t.shiftBlocks(U),e.block(t.getBlock("contentTopContainer"),t,{block:_},null).block(t.getBlock("contentMiddleContainer"),t,{block:k},null).block(t.getBlock("contentBottomContainer"),t,{block:w},null)}function _(e,t){return t=t.shiftBlocks(U),e.write('
    ').block(t.getBlock("contentTop"),t,{block:g},null).write("
    ")}function g(e,t){return t=t.shiftBlocks(U),e.block(t.getBlock("status"),t,{block:y},null).block(t.getBlock("statusNewPost"),t,{block:v},null).block(t.getBlock("actionTotop"),t,{block:b},null).block(t.getBlock("actionUserComment"),t,{block:M},null)}function y(e,t){return t=t.shiftBlocks(U),e}function v(e,t){return t=t.shiftBlocks(U),e}function b(e,t){return t=t.shiftBlocks(U),e}function M(e,t){return t=t.shiftBlocks(U),e}function k(e,t){return t=t.shiftBlocks(U),e.write('
    ').block(t.getBlock("contentMiddle"),t,{block:L},null).write("
    ")}function L(e,t){return t=t.shiftBlocks(U),e.block(t.getBlock("postsList"),t,{block:T},null)}function T(e,t){return t=t.shiftBlocks(U),e}function w(e,t){return t=t.shiftBlocks(U),e.write('
    ').block(t.getBlock("contentBottom"),t,{block:A},null).write("
    ")}function A(e,t){return t=t.shiftBlocks(U),e.block(t.getBlock("actionUserComment"),t,{block:Y},null).block(t.getBlock("actionTotop"),t,{block:x},null)}function Y(e,t){return t=t.shiftBlocks(U),e}function x(e,t){return t=t.shiftBlocks(U),e}function D(e,t){return t=t.shiftBlocks(U),e.write('")}function S(e,t){return t=t.shiftBlocks(U),e}function C(e,t){return t=t.shiftBlocks(U),e.write('

    ').reference(t.get(["Title"],!1),t,"h",["s"]).write("

    ")}function B(e,t){return t=t.shiftBlocks(U),e.write('
    ')}function E(e,t){return t=t.shiftBlocks(U),e.write(' style="display:none" ')}function j(e,t){return t=t.shiftBlocks(U),e.write(' style="display:block" ')}function N(e,t){return t=t.shiftBlocks(U),e.write('

    ').reference(t.get(["Description"],!1),t,"h",["s"]).write("

    ")}function O(e,t){return t=t.shiftBlocks(U),e.write('

    ')}function P(e,t){return t=t.shiftBlocks(U),e.write('

    ')}function z(e,t){return t=t.shiftBlocks(U),e.write('').helper("i18n",t,{},{msgid:"to top"}).write("")}function W(e,t){return t=t.shiftBlocks(U),e.write('
    ')}function q(e,t){return t=t.shiftBlocks(U),e.write('
    ')}function F(e,t){return t=t.shiftBlocks(U),e.write('
    ')}function I(e,t){return t=t.shiftBlocks(U),e.write('
    ')}function H(e,t){return t=t.shiftBlocks(U),e.write('
    ').section(t.getPath(!1,["Plugins","posts","list"]),t,{block:R},null).write("
    ")}function R(e,t){return t=t.shiftBlocks(U),e.partial(G,t,null)}function G(e,t){return t=t.shiftBlocks(U),e.reference(t.getPath(!0,[]),t,"h")}e.register("themeBase/container",t);var U={blogTitle:C,blogMedia:B,blogDescription:N,status:O,statusNewPost:P,actionTotop:z,actionUserComment:W,userCommentBox:q,userCommentBoxMessage:F,userCommentBackdrop:I,postsList:H};return t}(),{render:function(t,n){return e.render("themeBase/container",t,n)}}}),liveblog.define("views/blog",["views/base-view","views/posts","lib/utils","lib/helpers/display-toggle","underscore","tmpl!themeBase/container"],function(e,t,n,r,i){return e.extend({el:!1,rootSel:'[data-gimme="blog.view"]',initialize:function(){n.dispatcher.trigger("initialize.blog-view",this),this.setTemplate("themeBase/container"),this.listenTo(this.model,"change",this.update);var e=this.model.get("publishedPosts"),r=t.prototype.rootSel,i=this.$(r);if(n.isClient&&0!==i.length){var a=new t({collection:e,el:r});this.setView('[data-gimme="posts.view"]',a)}else this.setView('[data-gimme="posts.view"]',new t({collection:e}))},conditionalRender:function(){0===this.$el.parent().find(this.rootSel).length?this.render():this.update(),n.dispatcher.trigger("conditional-render.blog-view",this)},afterRender:function(){n.dispatcher.trigger("after-render.blog-view",this)},beforeRender:function(){n.dispatcher.trigger("before-render.blog-view",this)},update:function(){var e=this.model.get("EmbedConfig")||{};i.isUndefined(e.MediaToggle)||r(this.$('[data-gimme="blog.media-toggle"]'),e.MediaToggle),e.MediaUrl&&this.$('[data-gimme="blog.media-url"]').attr("href",e.MediaUrl),e.MediaImage&&this.$('[data-gimme="blog.media-image"]').attr("src",e.MediaImage),this.$('[data-gimme="blog.title"]').html(this.model.get("Title")),this.$('[data-gimme="blog.description"]').html(this.model.get("Description")),i.isEmpty(e)||n.dispatcher.trigger("config-update.blog-view",this)},serialize:function(){return this.model.toJSON()},stopPoller:function(){this.model.stopPolling(),this.model.get("publishedPosts").stopPolling()},starPoller:function(){this.model.startPolling(),this.model.get("publishedPosts").startPolling()}})}),liveblog.define("lib/backbone/model-collection-common",{syncParams:{headers:{},data:{}}}),liveblog.define("lib/poller",["underscore"],function(e){var t={defaultPollSettings:{pollInterval:null,poller:null,pollOptions:{}},startPolling:function(){for(var e in this.defaultPollSettings)this[e]||(this[e]=this.defaultPollSettings[e]);this._delayedPoll()},stopPolling:function(){clearInterval(this.timeoutId),this.timeoutId=null,this.xhr&&this.xhr.abort&&(this.xhr.abort(),this.xhr=null)},_poll:function(){if(this.pollInterval&&this.poller&&"function"==typeof this.poller){var t=this,n=e.extend(this.pollOptions,{success:function(){t._delayedPoll()},error:function(){t.stopPolling()}});this.xhr=this.poller(n)}},_delayedPoll:function(){if(this.pollInterval){var t=e.bind(this._poll,this);this.timeoutId=e.delay(t,this.pollInterval)}}};return t}),liveblog.define("models/base-model",["underscore","backbone-custom","lib/backbone/model-collection-common","lib/poller"],function(e,t,n,r){return t.Model.extend(e.extend({idAttribute:"Id",poller:function(e){this.fetch(e)}},n,r))}),liveblog.define("config/defaultPaginationParams",{offset:0,limit:15}),liveblog.define("collections/base-collection",["underscore","backbone-custom","lib/backbone/model-collection-common","lib/poller","config/defaultPaginationParams"],function(e,t,n,r,i){return t.Collection.extend(e.extend({filterProps:{total:0},clearPaginationParams:function(){var t=this.defaultPaginationParams||i;this.syncParams.pagination=e.extend(this.syncParams.pagination,t)},fetchPage:function(t){t=t||{};var n=this.syncParams.pagination||{};return t.data=e.extend(n,t.data),this.fetch(t)},fetchUpdates:function(t){t=t||{};var n=this.syncParams.updates||{};return t.data=e.extend(n,t.data),this.fetch(t)},poller:function(e){this.fetchUpdates(e)}},n,r))}),liveblog.define("lib/helpers/trim-tag",[],function(){var e=function(e,t){var n=function(e,t){for(var n=function(e,t){"string"!=typeof t&&(t="");var n=t.length,r=e.length;return 0===t.indexOf(e)&&(t=t.substr(r,n)),t.substr(n-r,n)===e&&(t=t.substr(0,n-r)),t},r=t,i=0;;){if(i++,r=n(e,t),r===t)break;if(t=r,i>100)break}return r};if("string"==typeof e)t=n(e,t); -else for(var r=0;r","
    ","
    "],r.before),after:n(["
    ","
    ","
    "],r.after)}),r}})}),liveblog.define("collections/posts",["underscore","collections/base-collection","models/post","lib/utils"],function(e,t,n,r){return t.extend({model:n,syncParams:{headers:{"X-Filter":"PublishedOn, DeletedOn, Order, Id, CId, Content, CreatedOn, Type, AuthorName, Author.Source.Name, Author.Source.IsModifiable, AuthorImage, Meta, IsPublished, Creator.FullName, Author.Source.Type.Key"},data:{thumbSize:"medium"},pagination:{},updates:{}},pollInterval:1e4,url:function(){return liveblog.servers.rest+"/resources/LiveDesk/Blog/"+this.blogId+"/Post/Published"},initialize:function(e,t){t.blogId&&(this.blogId=t.blogId),this.minPostOrder=0,r.isClient&&this.startPolling()},parse:function(t,n){return t.PostList=e.isUndefined(n.data["cId.since"])?this.newPageDataParse(t,n):this.updateDataParse(t,n),t.PostList},updateDataParse:function(t){if(t.lastCId&&this.updateLastCId(parseInt(t.lastCId,10)),t.PostList.length){var n=this;t.PostList=t.PostList.filter(function(e){return e.Order?parseFloat(e.Order)>=n.minPostOrder:!0}),e.each(t.PostList,function(e){e.updateItem=!0})}return t.PostList},newPageDataParse:function(t){if(e.isUndefined(this.lastCId())){var n=e.isUndefined(t.lastCId)?0:parseInt(t.lastCId,10);this.updateLastCId(n)}if(this.filterProps.total=parseInt(t.total,10),t.PostList.length){var r=e.min(t.PostList,function(e){return parseFloat(e.Order)});this.minPostOrder=parseFloat(r.Order)}return t.PostList},lastCId:function(){return this.syncParams.updates["cId.since"]},updateLastCId:function(e){this.syncParams.updates["cId.since"]=e}})}),liveblog.define("models/blog",["underscore","models/base-model","collections/posts","lib/utils"],function(e,t,n,r){return t.extend({syncParams:{headers:{"X-Filter":"Description, Title, EmbedConfig, Language.Code"},updates:{}},pollInterval:1e4,urlRoot:function(){return liveblog.servers.rest+"/resources/LiveDesk/Blog/"},initialize:function(){this.set("publishedPosts",new n([],{blogId:this.id})),r.isClient&&this.startPolling()},poller:function(t){delete t.data;var n,i=this;r.dispatcher.trigger("before-poller.blog-model",i),n=this.fetch(t),e.has(n,"done")&&n.done(function(){r.dispatcher.trigger("after-poller.blog-model",i)})},parse:function(t){return e.isString(t.EmbedConfig)&&(t.EmbedConfig=JSON.parse(t.EmbedConfig)),e.isUndefined(t.EmbedConfig)&&(t.EmbedConfig={}),t}})}),liveblog.define("lib/require-global",["underscore"],function(e){return e.isFunction(liveblog.require)?liveblog.require:require}),liveblog.define("plugins",{}),liveblog.define("lib/helpers/find-environment",["lib/utils"],function(e){return function(){if(e.isServer)return"desktop";if(e.isClient){var t="desktop",n=0;n&&"CSS1Compat"!==document.compatMode&&(t="quirks");var r=!1;return function(e){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(r=!0)}(navigator.userAgent||navigator.vendor||window.opera),r&&(t="mobile"),Boolean(navigator.userAgent.match(/(Large Screen)|GoogleTV/i))&&(t="big-screen"),t}}}),liveblog.define("i18n",["underscore","backbone-custom","lib/gettext","moment"],function(e,t,n,r){var i={},a=function(){var t={"post-date":"llll","closed-date":"llll","status-time":"HH:mm","pretty-day-time":"HH:mm","pretty-hour-time":"HH:mm","pretty-week-time":"HH:mm","pretty-week-date":"llll","pretty-month-date":"llll"},i={},a={sr:"rs"},o=a[liveblog.language]?a[liveblog.language]:liveblog.language,s=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"],l={};r.lang(o),e.each(s,function(e){n.pgettext("moment",e)!==e&&(l[e]=n.pgettext("moment",e).split("_"))}),r.lang(o,l),e.each(t,function(e,t){n.pgettext("moment",t)===t&&(i["moment:"+t]=["",e,""])}),n.loadMessages(i)};return{pluginBuilder:"lib/require/i18n-builder",load:function(r,o,s,l){liveblog.language||(liveblog.language=liveblog.fallback.language);var u=liveblog.servers.rest+"/content/cache/locale/plugin-"+r+"-"+liveblog.language+".json",c=liveblog.servers.rest+"/resources/Admin/Plugin/"+r+"/JSONLocale/"+liveblog.language,d=o.toUrl(u),f=o.toUrl(c),h={url:d,dataType:"json",cached:!0,tryCount:0,retryLimit:2,success:function(t){l.isBuild?(i[r]=t,s(t)):(n.loadMessages(e.values(t)[0]),a(),s(t)),s(t)},error:function(e,n,r){this.errorTimeout(e,n,r)||(h.url=f,h.cached=!1,h.error=this.errorTimeout,t.ajax(h))},errorTimeout:function(e,n){return"timeout"===n?(this.tryCount++,this.tryCount<=this.retryLimit?(t.ajax(this),!0):(console&&console.log("We have tried "+this.retryLimit+" times and it is still not working. We give in. Sorry."),!1)):this.cached?!1:(s({}),!0)}};t.ajax(h)},write:function(e,t,n){if(t in i){var r=i[t];n('define("'+e+"!"+t+'", function(){ return '+r+";});\n")}}}}),liveblog.define("load-theme",["lib/require-global","module","underscore","lib/utils"],function(e,t,n,r){var i=function(){e.undef("theme"),e.undef("themeFile")};return function(e,a){e=e||{theme:"default"},a=a||function(){};var o=function(t){n.each(t,function(t){t(e)}),a()},s=liveblog.min?t.config().buildPath:t.config().themesPath,l=function(e){return n.isArray(e)&&(e=e.join("/")),s+e};liveblog.min&&(liveblog.paths.build=t.config().buildPath,liveblog.paths.themes=t.config().themesPath),liveblog.theme=liveblog.theme?liveblog.theme:e.theme,e.language&&!liveblog.language&&(liveblog.language=e.language),liveblog.requirejs.config({paths:{theme:l(liveblog.theme),themeFile:l(liveblog.theme)}}),i(),liveblog.require(["plugins","themeFile","lib/helpers/find-environment","i18n!livedesk_embed"],function(e,t,n){if(t&&t.environments){if(!liveblog.environment){var a=n();liveblog.environment=t.environments[a]?t.environments[a]:t.environments["default"]}i(),liveblog.requirejs.config({paths:{theme:l([liveblog.theme,liveblog.environment]),themeFile:l([liveblog.theme,liveblog.environment])}}),liveblog.requirejs(["plugins","themeFile"],function(e){o(e)},function(){i(),r.dispatcher.trigger("sub-theme-file.request-failed")})}else o(e)},function(){i(),r.dispatcher.trigger("theme-file.request-failed")})}}),liveblog.define("router",["underscore","backbone-custom","views/blog","models/blog","load-theme"],function(e,t,n,r,i){return t.Router.extend({routes:{"*path":"default"},"default":function(){if(liveblog.id){var a=new r({Id:liveblog.id});a.fetch({success:function(){var r=a.get("EmbedConfig");e.has(a.get("Language"),"Code")&&(r.language=a.get("Language").Code),i(r,function(){var e,r='[data-gimme="blog.view"]',i=t.$(r);e=new n(0!==i.length?{el:r,model:a}:{el:liveblog.el,model:a}),e.conditionalRender()})}})}}})}),liveblog.require.config({config:{"load-theme":{themesPath:"../../themes/",buildPath:"./build/themes/"}},paths:{jquery:"bower_components/jquery/dist/jquery",json2:"bower_components/json2/json2","dustjs-linkedin":"node_modules/dustjs-linkedin/dist/dust-full","dustjs-helpers":"node_modules/dustjs-helpers/dist/dust-helpers",dust:"lib/dust",jed:"node_modules/jed/jed","lodash.compat":"node_modules/lodash/dist/lodash.compat",backbone:"node_modules/backbone/backbone","backbone-custom":"lib/backbone/backbone-custom","backbone.layoutmanager":"node_modules/backbone.layoutmanager/backbone.layoutmanager",moment:"node_modules/moment/min/moment-with-langs","moment-timezone":"bower_components/moment-timezone/builds/moment-timezone-with-data-2010-2020",waypoints:"bower_components/jquery-waypoints/waypoints",themeBase:"../../themes/base",tmpl:"lib/require/tmpl",i18n:"lib/require/i18n",css:"lib/require/css"},shim:{json2:{exports:"JSON"},"dustjs-linkedin":{exports:"dust"},"dustjs-helpers":{deps:["dustjs-linkedin"]}},map:{"*":{underscore:"lib/lodash-private",lodash:"lib/lodash-private",jquery:"lib/jquery-private",backbone:"lib/backbone-private"},"lib/jquery-private":{jquery:"jquery"},"lib/backbone-private":{backbone:"backbone"},"lib/lodash-private":{lodash:"lodash.compat"}}}),liveblog.require(["jquery","backbone","lib/jquery/xdomainrequest"],function(e,t){e(function(){liveblog.require(["router"],function(e){new e;t.history.start({pushState:!1})})})}),liveblog.define("main",function(){}),liveblog.define("plugins/css",["plugins","lib/utils"],function(e,t){var n=function(){n.hasData()&&t.dispatcher.once("after-render.layout-view",function(e){e.$('[data-gimme="liveblog-layout"]').prepend(n.getData())})};return n._data="",n.setData=function(e){n._data=e},n.getData=function(){return n._data},n.hasData=function(){return""!==n._data?!0:!1},e.css=n,e.css}),liveblog.define("css",["lib/utils","plugins/css","backbone"],function(e,t,n){var r,i={};if(i.normalize=function(e,t){return".css"===e.substr(e.length-4,4)&&(e=e.substr(0,e.length-4)),t(e)},i.pluginBuilder="lib/require/css-builder",e.isClient){var a=document.getElementsByTagName("head")[0],o=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)/)||0,s=!1,l=!0;o[1]||o[7]?s=parseInt(o[1],10)<6||parseInt(o[7],10)<=9:o[2]?l=!1:o[4]&&(s=parseInt(o[4],10)<18);var u,c,d,f=function(){u=document.createElement("style"),a.appendChild(u),c=u.styleSheet||u.sheet},h=0,p=[],m=function(e){h++,32===h&&(f(),h=0),c.addImport(e),u.onload=_},_=function(){d();var e=p.shift();return e?(d=e[1],void m(e[0])):void(d=null)},g=function(e,t){if(c&&c.addImport||f(),c&&c.addImport)d?p.push([e,t]):(m(e),d=t);else{u.textContent='@import "'+e+'";';var n=setInterval(function(){try{u.sheet.cssRules,clearInterval(n),t()}catch(e){}},10)}},y=function(e,t){var n=document.createElement("link");if(n.type="text/css",n.rel="stylesheet",l)n.onload=function(){n.onload=function(){},setTimeout(t,7)};else var r=setInterval(function(){for(var e=0;e'),o()),e.isClient){var c=n.$('link[href="'+u+'"]').length;c?o():(s?g:y)(u,o)}},i}); \ No newline at end of file +}function o(e,t){return t=t.shiftBlocks(y),e.block(t.getBlock("extenalImageContainer"),t,{block:s},null).block(t.getBlock("externalInfoContainer"),t,{block:l},null).block(t.getBlock("externalTextContainer"),t,{block:u},null)}function s(e,t){return t=t.shiftBlocks(y),e}function l(e,t){return t=t.shiftBlocks(y),e}function u(e,t){return t=t.shiftBlocks(y),e}function c(e,t){return t=t.shiftBlocks(y),e.block(t.getBlock("externalInfoTitleContainer"),t,{block:d},null)}function d(e,t){return t=t.shiftBlocks(y),e}function f(e,t){return t=t.shiftBlocks(y),e.reference(t.getPath(!1,["Meta","originalContextUrl"]),t,"h")}function h(e,t){return t=t.shiftBlocks(y),e.reference(t.getPath(!1,["Meta","url"]),t,"h")}function p(e,t){return t=t.shiftBlocks(y),e.reference(t.getPath(!1,["Meta","visibleUrl"]),t,"h")}function m(e,t){return t=t.shiftBlocks(y),e.reference(t.getPath(!1,["Meta","title"]),t,"h",["s"])}function _(e,t){return t=t.shiftBlocks(y),e.reference(t.getPath(!1,["Meta","originalContextUrl"]),t,"h")}function g(e,t){return t=t.shiftBlocks(y),e.reference(t.get(["Content"],!1),t,"h",["s"])}e.register("themeBase/item/source/google/images",t);var y={itemClassAdditional:n,contentCore:r,contentExternal:o,externalInfo:c,externalImageLink:f,externalImageSrc:h,externalImageAlt:p,externalInfoTitle:m,externalInfoTitleSrc:_,externalText:g};return t}(),{render:function(t,n){return e.render("themeBase/item/source/google/images",t,n)}}}),liveblog.define("tmpl!themeBase/item/source/twitter",["dust"],function(e){return function(){function t(e,t){return t=t.shiftBlocks(M),e.partial("themeBase/item/source/base",t,null)}function n(e,t){return t=t.shiftBlocks(M),e.write("twitter")}function r(e,t){return t=t.shiftBlocks(M),e.block(t.getBlock("contentExternalContainer"),t,{block:i},null).block(t.getBlock("contentAttr"),t,{block:a},null)}function i(e,t){return t=t.shiftBlocks(M),e}function a(e,t){return t=t.shiftBlocks(M),e}function o(e,t){return t=t.shiftBlocks(M),e.block(t.getBlock("externalAvatar"),t,{block:s},null).block(t.getBlock("externalInfoContainer"),t,{block:l},null).block(t.getBlock("externalTextContainer"),t,{block:u},null).block(t.getBlock("externalTwitterActions"),t,{block:c},null)}function s(e,t){return t=t.shiftBlocks(M),e}function l(e,t){return t=t.shiftBlocks(M),e}function u(e,t){return t=t.shiftBlocks(M),e}function c(e,t){return t=t.shiftBlocks(M),e}function d(e,t){return t=t.shiftBlocks(M),e.block(t.getBlock("externalInfoTitleContainer"),t,{block:f},null).block(t.getBlock("externalInfoUser"),t,{block:h},null)}function f(e,t){return t=t.shiftBlocks(M),e}function h(e,t){return t=t.shiftBlocks(M),e}function p(e,t){return t=t.shiftBlocks(M),e.reference(t.getPath(!1,["Meta","from_user_name"]),t,"h")}function m(e,t){return t=t.shiftBlocks(M),e.write("http://twitter.com/").reference(t.getPath(!1,["Meta","from_user"]),t,"h")}function _(e,t){return t=t.shiftBlocks(M),e.reference(t.getPath(!1,["Meta","text"]),t,"h",["twitter_all","s"])}function g(e,t){return t=t.shiftBlocks(M),e.write("@").reference(t.getPath(!1,["Meta","from_user"]),t,"h").write("")}function y(e,t){return t=t.shiftBlocks(M),e.reference(t.getPath(!1,["Meta","user","profile_image_url"]),t,"h")}function v(e,t){return t=t.shiftBlocks(M),e.write('")}function b(e,t){return t=t.shiftBlocks(M),e.write("twitter.com")}e.register("themeBase/item/source/twitter",t);var M={itemClass:n,contentCore:r,contentExternal:o,externalInfo:d,externalInfoTitle:p,externalInfoTitleSrc:m,externalText:_,externalInfoUser:g,externalAvatarSrc:y,externalTwitterActions:v,contentAttrName:b};return t}(),{render:function(t,n){return e.render("themeBase/item/source/twitter",t,n)}}}),liveblog.define("tmpl!themeBase/item/source/facebook",["dust"],function(e){return function(){function t(e,t){return t=t.shiftBlocks(g),e.partial("themeBase/item/source/base",t,null)}function n(e,t){return t=t.shiftBlocks(g),e.write("facebook")}function r(e,t){return t=t.shiftBlocks(g),e.block(t.getBlock("contentExternalContainer"),t,{block:i},null).block(t.getBlock("contentAttr"),t,{block:a},null)}function i(e,t){return t=t.shiftBlocks(g),e}function a(e,t){return t=t.shiftBlocks(g),e}function o(e,t){return t=t.shiftBlocks(g),e.block(t.getBlock("externalAvatar"),t,{block:s},null).block(t.getBlock("externalInfoContainer"),t,{block:l},null).block(t.getBlock("externalTextContainer"),t,{block:u},null)}function s(e,t){return t=t.shiftBlocks(g),e}function l(e,t){return t=t.shiftBlocks(g),e}function u(e,t){return t=t.shiftBlocks(g),e}function c(e,t){return t=t.shiftBlocks(g),e.block(t.getBlock("externalInfoTitleContainer"),t,{block:d},null)}function d(e,t){return t=t.shiftBlocks(g),e}function f(e,t){return t=t.shiftBlocks(g),e.reference(t.getPath(!1,["Meta","from","name"]),t,"h")}function h(e,t){return t=t.shiftBlocks(g),e.reference(t.getPath(!1,["Meta","permalink"]),t,"h")}function p(e,t){return t=t.shiftBlocks(g),e.reference(t.getPath(!1,["Meta","message"]),t,"h",["s"])}function m(e,t){return t=t.shiftBlocks(g),e.write("facebook.com")}function _(e,t){return t=t.shiftBlocks(g),e.write("//graph.facebook.com/").reference(t.getPath(!1,["Meta","from","id"]),t,"h").write("/picture")}e.register("themeBase/item/source/facebook",t);var g={itemClass:n,contentCore:r,contentExternal:o,externalInfo:c,externalInfoTitle:f,externalInfoTitleSrc:h,externalText:p,contentAttrName:m,externalAvatarSrc:_};return t}(),{render:function(t,n){return e.render("themeBase/item/source/facebook",t,n)}}}),liveblog.define("tmpl!themeBase/item/source/youtube",["dust"],function(e){return function(){function t(e,t){return t=t.shiftBlocks(g),e.partial("themeBase/item/source/base",t,null)}function n(e,t){return t=t.shiftBlocks(g),e.write("youtube")}function r(e,t){return t=t.shiftBlocks(g),e.block(t.getBlock("contentExternalContainer"),t,{block:i},null).block(t.getBlock("contentAttr"),t,{block:a},null)}function i(e,t){return t=t.shiftBlocks(g),e}function a(e,t){return t=t.shiftBlocks(g),e}function o(e,t){return t=t.shiftBlocks(g),e.block(t.getBlock("externalIframeContainer"),t,{block:s},null).block(t.getBlock("externalTextContainer"),t,{block:l},null).block(t.getBlock("externalInfoContainer"),t,{block:u},null)}function s(e,t){return t=t.shiftBlocks(g),e}function l(e,t){return t=t.shiftBlocks(g),e}function u(e,t){return t=t.shiftBlocks(g),e}function c(e,t){return t=t.shiftBlocks(g),e.block(t.getBlock("externalInfoTitleContainer"),t,{block:d},null)}function d(e,t){return t=t.shiftBlocks(g),e}function f(e,t){return t=t.shiftBlocks(g),e.reference(t.getPath(!1,["Meta","title"]),t,"h",["s"])}function h(e,t){return t=t.shiftBlocks(g),e.write("//youtube.com/watch?v=").reference(t.getPath(!1,["Meta","id"]),t,"h")}function p(e,t){return t=t.shiftBlocks(g),e.write('')}function m(e,t){return t=t.shiftBlocks(g),e.reference(t.getPath(!1,["Meta","description"]),t,"h")}function _(e,t){return t=t.shiftBlocks(g),e.write("youtube.com")}e.register("themeBase/item/source/youtube",t);var g={itemClass:n,contentCore:r,contentExternal:o,externalInfo:c,externalInfoTitle:f,externalInfoTitleSrc:h,externalIframe:p,externalTextContainer:m,contentAttrName:_};return t}(),{render:function(t,n){return e.render("themeBase/item/source/youtube",t,n)}}}),liveblog.define("tmpl!themeBase/item/source/flickr",["dust"],function(e){return function(){function t(e,t){return t=t.shiftBlocks(f),e.partial("themeBase/item/source/base",t,null)}function n(e,t){return t=t.shiftBlocks(f),e.write("flickr")}function r(e,t){return t=t.shiftBlocks(f),e.block(t.getBlock("contentExternalContainer"),t,{block:i},null).block(t.getBlock("contentAttr"),t,{block:a},null)}function i(e,t){return t=t.shiftBlocks(f),e}function a(e,t){return t=t.shiftBlocks(f),e}function o(e,t){return t=t.shiftBlocks(f),e.block(t.getBlock("extenalImageContainer"),t,{block:s},null)}function s(e,t){return t=t.shiftBlocks(f),e}function l(e,t){return t=t.shiftBlocks(f),e.write("http://farm").reference(t.getPath(!1,["Meta","farm"]),t,"h").write(".staticflickr.com/").reference(t.getPath(!1,["Meta","server"]),t,"h").write("/").reference(t.getPath(!1,["Meta","id"]),t,"h").write("_").reference(t.getPath(!1,["Meta","secret"]),t,"h").write(".jpg")}function u(e,t){return t=t.shiftBlocks(f),e.write("http://farm").reference(t.getPath(!1,["Meta","farm"]),t,"h").write(".staticflickr.com/").reference(t.getPath(!1,["Meta","server"]),t,"h").write("/").reference(t.getPath(!1,["Meta","id"]),t,"h").write("_").reference(t.getPath(!1,["Meta","secret"]),t,"h").write(".jpg")}function c(e,t){return t=t.shiftBlocks(f),e.reference(t.getPath(!1,["Meta","title"]),t,"h")}function d(e,t){return t=t.shiftBlocks(f),e.write("flickr.com")}e.register("themeBase/item/source/flickr",t);var f={itemClass:n,contentCore:r,contentExternal:o,externalImageLink:l,externalImageSrc:u,externalImageAlt:c,contentAttrName:d};return t}(),{render:function(t,n){return e.render("themeBase/item/source/flickr",t,n)}}}),liveblog.define("tmpl!themeBase/item/source/comments",["dust"],function(e){return function(){function t(e,t){return t=t.shiftBlocks(d),e.partial("themeBase/item/source/base",t,null)}function n(e,t){return t=t.shiftBlocks(d),e.write("usercomments")}function r(e,t){return t=t.shiftBlocks(d),e.block(t.getBlock("contenteBaseBefore"),t,{block:i},null).block(t.getBlock("contentText"),t,{block:a},null)}function i(e,t){return t=t.shiftBlocks(d),e}function a(e,t){return t=t.shiftBlocks(d),e}function o(e,t){return t=t.shiftBlocks(d),e.block(t.getBlock("createdDateContainer"),t,{block:s},null)}function s(e,t){return t=t.shiftBlocks(d),e}function l(e,t){return t=t.shiftBlocks(d),e.exists(t.getPath(!1,["Meta","AuthorName"]),t,{"else":u,block:c},null)}function u(e,t){return t=t.shiftBlocks(d),e.reference(t.get(["AuthorName"],!1),t,"h")}function c(e,t){return t=t.shiftBlocks(d),e.reference(t.getPath(!1,["Meta","AuthorName"]),t,"h")}e.register("themeBase/item/source/comments",t);var d={itemClass:n,contentCore:r,postDateContainer:o,publisherName:l};return t}(),{render:function(t,n){return e.render("themeBase/item/source/comments",t,n)}}}),liveblog.define("tmpl!themeBase/item/source/soundcloud",["dust"],function(e){return function(){function t(e,t){return t=t.shiftBlocks(c),e.partial("themeBase/item/source/base",t,null)}function n(e,t){return t=t.shiftBlocks(c),e.write("soundcloud")}function r(e,t){return t=t.shiftBlocks(c),e.block(t.getBlock("contentExternalContainer"),t,{block:i},null).block(t.getBlock("contentAttr"),t,{block:a},null)}function i(e,t){return t=t.shiftBlocks(c),e}function a(e,t){return t=t.shiftBlocks(c),e}function o(e,t){return t=t.shiftBlocks(c),e.block(t.getBlock("externalIframeContainer"),t,{block:s},null)}function s(e,t){return t=t.shiftBlocks(c),e}function l(e,t){return t=t.shiftBlocks(c),e.write('')}function u(e,t){return t=t.shiftBlocks(c),e.write("soundcloud.com")}e.register("themeBase/item/source/soundcloud",t);var c={itemClass:n,contentCore:r,contentExternal:o,externalIframe:l,contentAttrName:u};return t}(),{render:function(t,n){return e.render("themeBase/item/source/soundcloud",t,n)}}}),liveblog.define("tmpl!themeBase/item/source/instagram",["dust"],function(e){return function(){function t(e,t){return t=t.shiftBlocks(p),e.partial("themeBase/item/source/base",t,null)}function n(e,t){return t=t.shiftBlocks(p),e.write("instagram")}function r(e,t){return t=t.shiftBlocks(p),e.block(t.getBlock("contentExternalContainer"),t,{block:i},null).block(t.getBlock("contentAttr"),t,{block:a},null)}function i(e,t){return t=t.shiftBlocks(p),e}function a(e,t){return t=t.shiftBlocks(p),e}function o(e,t){return t=t.shiftBlocks(p),e.block(t.getBlock("extenalImageContainer"),t,{block:s},null).block(t.getBlock("externalTextContainer"),t,{block:l},null)}function s(e,t){return t=t.shiftBlocks(p),e}function l(e,t){return t=t.shiftBlocks(p),e}function u(e,t){return t=t.shiftBlocks(p),e.reference(t.getPath(!1,["Meta","images","standard_resolution","url"]),t,"h")}function c(e,t){return t=t.shiftBlocks(p),e.reference(t.getPath(!1,["Meta","images","standard_resolution","url"]),t,"h")}function d(e,t){return t=t.shiftBlocks(p),e.reference(t.getPath(!1,["Meta","caption","text"]),t,"h",["trim50"])}function f(e,t){return t=t.shiftBlocks(p),e.reference(t.getPath(!1,["Meta","caption","text"]),t,"h")}function h(e,t){return t=t.shiftBlocks(p),e.write("instagram.com")}e.register("themeBase/item/source/instagram",t);var p={itemClass:n,contentCore:r,contentExternal:o,externalImageLink:u,externalImageSrc:c,externalImageAlt:d,externalText:f,contentAttrName:h};return t}(),{render:function(t,n){return e.render("themeBase/item/source/instagram",t,n)}}}),liveblog.define("tmpl!themeBase/item/source/sms",["dust"],function(e){return function(){function t(e,t){return t=t.shiftBlocks(u),e.partial("themeBase/item/source/base",t,null)}function n(e,t){return t=t.shiftBlocks(u),e.write("sms")}function r(e,t){return t=t.shiftBlocks(u),e.block(t.getBlock("contenteBaseBefore"),t,{block:i},null).block(t.getBlock("contentText"),t,{block:a},null)}function i(e,t){return t=t.shiftBlocks(u),e}function a(e,t){return t=t.shiftBlocks(u),e}function o(e,t){return t=t.shiftBlocks(u),e.block(t.getBlock("createdDateContainer"),t,{block:s},null)}function s(e,t){return t=t.shiftBlocks(u),e}function l(e,t){return t=t.shiftBlocks(u),e.reference(t.getPath(!1,["Meta","Creator","Name"]),t,"h")}e.register("themeBase/item/source/sms",t);var u={itemClass:n,contentCore:r,postDateContainer:o,publisherName:l};return t}(),{render:function(t,n){return e.render("themeBase/item/source/sms",t,n)}}}),liveblog.define("tmpl!themeBase/plugins/user-comment",["dust"],function(e){return function(){function t(e,t){return e.write('
    ').helper("i18n",t,{},{msgid:"Please fill in your Nickname."}).write('
    ').helper("i18n",t,{},{msgid:"Please fill in your Comment text."}).write('
    ').helper("i18n",t,{},{msgid:"Please fill in text from image."}).write('
    ")}return e.register("themeBase/plugins/user-comment",t),t}(),{render:function(t,n){return e.render("themeBase/plugins/user-comment",t,n)}}}),liveblog.define("views/post-templates",["tmpl!themeBase/item/base","tmpl!themeBase/item/posttype/base","tmpl!themeBase/item/posttype/normal","tmpl!themeBase/item/posttype/image","tmpl!themeBase/item/posttype/wrapup","tmpl!themeBase/item/posttype/quote","tmpl!themeBase/item/posttype/link","tmpl!themeBase/item/posttype/infomercial","tmpl!themeBase/item/source/base","tmpl!themeBase/item/source/infomercial","tmpl!themeBase/item/source/google","tmpl!themeBase/item/source/google/web","tmpl!themeBase/item/source/google/news","tmpl!themeBase/item/source/google/images","tmpl!themeBase/item/source/twitter","tmpl!themeBase/item/source/facebook","tmpl!themeBase/item/source/youtube","tmpl!themeBase/item/source/flickr","tmpl!themeBase/item/source/comments","tmpl!themeBase/item/source/soundcloud","tmpl!themeBase/item/source/instagram","tmpl!themeBase/item/source/sms","tmpl!themeBase/plugins/user-comment"],function(){}),liveblog.define("views/post",["underscore","lib/utils","views/base-view","lib/lodash/defaults-deep","views/post-templates"],function(e,t,n){return n.extend({el:!1,initialize:function(){e.defaultsDeep(this,this.propertiesObj),this.order=parseFloat(this.model.get("Order")),t.dispatcher.trigger("initialize.post-view",this),this.setTemplate("themeBase/item/"+this.model.get("item")),this.listenTo(this.model,"change:CId",this.update)},update:function(){this.model.hasChanged("Order")||this.model.hasChanged("DeletedOn")||this.model.hasChanged("isPublished")||this.render()},serialize:function(){var e=this.model.toJSON();return e.baseItem=this.themedTemplate("themeBase/item/base"),this.permalink&&"function"==typeof this.permalink&&(e.permalink=this.permalink()),e},alreadyRendered:function(){this.fakeViewRendering(),t.dispatcher.trigger("before-render.post-view",this),t.dispatcher.trigger("after-render.post-view",this)},beforeRender:function(){t.dispatcher.trigger("before-render.post-view",this)},afterRender:function(){t.dispatcher.trigger("after-render.post-view",this)}})}),liveblog.define("tmpl!themeBase/posts-list",["dust"],function(e){return function(){function t(e){return e.write('
      ')}return e.register("themeBase/posts-list",t),t}(),{render:function(t,n){return e.render("themeBase/posts-list",t,n)}}}),liveblog.define("views/posts",["underscore","lib/utils","views/base-view","views/post","tmpl!themeBase/posts-list"],function(e,t,n,r){return n.extend({el:!1,rootSel:'[data-gimme="posts.list"]',postRootDataAttr:"data-gimme-postid",postRootSel:function(e){return e?"["+this.postRootDataAttr+'="'+e+'"]':"["+this.postRootDataAttr+"]"},flags:{autoRender:!0},pendingCounter:0,initialize:function(){t.dispatcher.trigger("initialize.posts-view",this),e.bindAll(this,"insertPostView","orderViews","_postViewIndex","_insertPostViewAt","_insertPostViewAtFirstPos"),this.setTemplate("themeBase/posts-list"),t.isClient&&(this.listenTo(this.collection,"reset",this.setViewOnReset),this.listenTo(this.collection,"add",this.checkPending),this.listenTo(this.collection,"remove",this.removePost),this.listenTo(this.collection,"change:Order",this.reorderPost),this.listenTo(this.collection,"change:DeletedOn",this.removePostFromCollection),this.listenTo(this.collection,"change:IsPublished",this.removePostFromCollection)),this.collection.fetchPage({reset:!0})},beforeRender:function(){this.collection.forEach(this.insertPostView,this)},afterRender:function(){t.dispatcher.trigger("after-render.posts-view",this)},setViewOnReset:function(){this.fakeViewRendering();var e=this.$el.children(this.postRootSel());if(0===e.length)return void this.render();var n=this;e.each(function(e,t){var r,i=n.$(t),a=i.attr(n.postRootDataAttr),o=i.data("gimme-cid").toString(),s=n.collection.get(a);s&&o===s.get("CId")?(r=n.insertPostView(s,{el:n.postRootSel(a)}),r.alreadyRendered()):i.remove()}),this.collection.forEach(this.addPostIfMissing,this),t.dispatcher.trigger("add-all.posts-view",this)},addPostIfMissing:function(e){var t=this._postViewIndex(e.id);-1===t&&this.addPost(e)},removePostFromCollection:function(t){return e.isUndefined(t.get("DeletedOn"))&&"False"!==t.get("IsPublished")?!1:(this.collection.remove(t),!0)},renderPending:function(){var e=this;this.collection.each(function(t){t.get("pending")&&(e.addPost(t),t.set("pending",!1),e.pendingCounter--)}),t.dispatcher.trigger("rendered-pending.posts-view",this),t.dispatcher.trigger("update-pending.posts-view",this)},checkPending:function(e){this.removePostFromCollection(e)||(!this.flags.autoRender&&e.get("updateItem")?(e.set("pending",!0),this.pendingCounter++,t.dispatcher.trigger("update-pending.posts-view",this)):this.addPost(e))},addPost:function(e){if(!this.removePostFromCollection(e)){var n=this.insertPostView(e);this.orderViews(),n.render(),t.dispatcher.trigger("add-all.posts-view",this)}},removePost:function(e){var n=this,r=e.get("pending");r?(this.pendingCounter--,t.dispatcher.trigger("update-pending.posts-view",this)):this.removeView(function(t){return t.$el.is(n.postRootSel(e.id))?t:void 0})},reorderPost:function(e,t){if(this.onlyOrderHasChanged(e)){this.views[""][this._postViewIndex(e.id)].order=parseFloat(t),this.orderViews();var n=this._postViewIndex(e.id),r=this.$(this.postRootSel(e.id)).detach();this._insertPostViewAt(this.$el,r,n)}else this.removePost(e),this.addPost(e)},insert:function(e,n){if(e.is(":empty"))e.append(n),t.dispatcher.trigger("add-all.posts-view",this);else{var r=this._postViewIndex(n.attr(this.postRootDataAttr));this._insertPostViewAt(e,n,r)}},insertPostView:function(t,n){var i=e.extend({model:t},n),a=new r(i);return this.insertView("",a),a},orderViews:function(){this.views[""]=e.sortBy(this.views[""],"order").reverse()},onlyOrderHasChanged:function(t){return e.size(t.changedAttributes())>2&&t.hasChanged("CId")&&t.hasChanged("Order")},firstPost:function(){return this.views[""][0]},_postViewIndex:function(t){if(!this.views[""])return-1;var n=e.map(this.views[""],function(e){return e.model.id});return e.indexOf(n,t)},_insertPostViewAt:function(e,t,n){if(0===n)this._insertPostViewAtFirstPos(e,t);else if(n>0){var r=this.views[""][n-1].model.id;e.children(this.postRootSel(r)).after(t)}},_insertPostViewAtFirstPos:function(e,t){var n=e.children(this.postRootSel()).first();if(0!==n.length)n.before(t);else{var r=e.children('[data-gimme="posts.beforePage"]');0!==r.length?r.after(t):e.append(t)}}})}),liveblog.define("lib/helpers/display-toggle",["underscore"],function(e){var t=function(t,n){var r="";r=e.isUndefined(n)?"block"===t.css("display")?"none":"block":n?"block":"none",t.css("display",r)};return t}),liveblog.define("tmpl!themeBase/container",["dust"],function(e){return function(){function t(e,t){return t=t.shiftBlocks(U),e.block(t.getBlock("mainContainer"),t,{block:n},null)}function n(e,t){return t=t.shiftBlocks(U),e.write('
      ').block(t.getBlock("main"),t,{block:i},null).write("
      ")}function r(e,t){return t=t.shiftBlocks(U),e}function i(e,t){return t=t.shiftBlocks(U),e.write('
      ').block(t.getBlock("headerContainer"),t,{block:a},null).block(t.getBlock("contentContainer"),t,{block:c},null).block(t.getBlock("footerContainer"),t,{block:D},null).write("
      ")}function a(e,t){return t=t.shiftBlocks(U),e.write('
      ').block(t.getBlock("header"),t,{block:o},null).write("
      ")}function o(e,t){return t=t.shiftBlocks(U),e.block(t.getBlock("blogTitle"),t,{block:s},null).block(t.getBlock("blogDescription"),t,{block:l},null).block(t.getBlock("blogMedia"),t,{block:u},null)}function s(e,t){return t=t.shiftBlocks(U),e}function l(e,t){return t=t.shiftBlocks(U),e}function u(e,t){return t=t.shiftBlocks(U),e}function c(e,t){return t=t.shiftBlocks(U),e.write('
      ').block(t.getBlock("userComment"),t,{block:d},null).block(t.getBlock("content"),t,{block:m},null).write("
      ")}function d(e,t){return t=t.shiftBlocks(U),e.block(t.getBlock("userCommentBox"),t,{block:f},null).block(t.getBlock("userCommentBoxMessage"),t,{block:h},null).block(t.getBlock("userCommentBackdrop"),t,{block:p},null)}function f(e,t){return t=t.shiftBlocks(U),e}function h(e,t){return t=t.shiftBlocks(U),e}function p(e,t){return t=t.shiftBlocks(U),e}function m(e,t){return t=t.shiftBlocks(U),e.block(t.getBlock("contentTopContainer"),t,{block:_},null).block(t.getBlock("contentMiddleContainer"),t,{block:k},null).block(t.getBlock("contentBottomContainer"),t,{block:w},null)}function _(e,t){return t=t.shiftBlocks(U),e.write('
      ').block(t.getBlock("contentTop"),t,{block:g},null).write("
      ")}function g(e,t){return t=t.shiftBlocks(U),e.block(t.getBlock("status"),t,{block:y},null).block(t.getBlock("statusNewPost"),t,{block:v},null).block(t.getBlock("actionTotop"),t,{block:b},null).block(t.getBlock("actionUserComment"),t,{block:M},null)}function y(e,t){return t=t.shiftBlocks(U),e}function v(e,t){return t=t.shiftBlocks(U),e}function b(e,t){return t=t.shiftBlocks(U),e}function M(e,t){return t=t.shiftBlocks(U),e}function k(e,t){return t=t.shiftBlocks(U),e.write('
      ').block(t.getBlock("contentMiddle"),t,{block:L},null).write("
      ")}function L(e,t){return t=t.shiftBlocks(U),e.block(t.getBlock("postsList"),t,{block:T},null)}function T(e,t){return t=t.shiftBlocks(U),e}function w(e,t){return t=t.shiftBlocks(U),e.write('
      ').block(t.getBlock("contentBottom"),t,{block:A},null).write("
      ")}function A(e,t){return t=t.shiftBlocks(U),e.block(t.getBlock("actionUserComment"),t,{block:Y},null).block(t.getBlock("actionTotop"),t,{block:x},null)}function Y(e,t){return t=t.shiftBlocks(U),e}function x(e,t){return t=t.shiftBlocks(U),e}function D(e,t){return t=t.shiftBlocks(U),e.write('")}function S(e,t){return t=t.shiftBlocks(U),e}function C(e,t){return t=t.shiftBlocks(U),e.write('

      ').reference(t.get(["Title"],!1),t,"h",["s"]).write("

      ")}function B(e,t){return t=t.shiftBlocks(U),e.write('
      ')}function E(e,t){return t=t.shiftBlocks(U),e.write(' style="display:none" ')}function j(e,t){return t=t.shiftBlocks(U),e.write(' style="display:block" ')}function N(e,t){return t=t.shiftBlocks(U),e.write('

      ').reference(t.get(["Description"],!1),t,"h",["s"]).write("

      ")}function O(e,t){return t=t.shiftBlocks(U),e.write('

      ')}function P(e,t){return t=t.shiftBlocks(U),e.write('

      ')}function z(e,t){return t=t.shiftBlocks(U),e.write('').helper("i18n",t,{},{msgid:"to top"}).write("")}function W(e,t){return t=t.shiftBlocks(U),e.write('
      ')}function q(e,t){return t=t.shiftBlocks(U),e.write('
      ')}function F(e,t){return t=t.shiftBlocks(U),e.write('
      ')}function I(e,t){return t=t.shiftBlocks(U),e.write('
      ')}function H(e,t){return t=t.shiftBlocks(U),e.write('
      ').section(t.getPath(!1,["Plugins","posts","list"]),t,{block:R},null).write("
      ")}function R(e,t){return t=t.shiftBlocks(U),e.partial(G,t,null)}function G(e,t){return t=t.shiftBlocks(U),e.reference(t.getPath(!0,[]),t,"h")}e.register("themeBase/container",t);var U={blogTitle:C,blogMedia:B,blogDescription:N,status:O,statusNewPost:P,actionTotop:z,actionUserComment:W,userCommentBox:q,userCommentBoxMessage:F,userCommentBackdrop:I,postsList:H};return t}(),{render:function(t,n){return e.render("themeBase/container",t,n)}}}),liveblog.define("views/blog",["views/base-view","views/posts","lib/utils","lib/helpers/display-toggle","underscore","tmpl!themeBase/container"],function(e,t,n,r,i){return e.extend({el:!1,rootSel:'[data-gimme="blog.view"]',initialize:function(){n.dispatcher.trigger("initialize.blog-view",this),this.setTemplate("themeBase/container"),this.listenTo(this.model,"change",this.update);var e=this.model.get("publishedPosts"),r=t.prototype.rootSel,i=this.$(r);if(n.isClient&&0!==i.length){var a=new t({collection:e,el:r});this.setView('[data-gimme="posts.view"]',a)}else this.setView('[data-gimme="posts.view"]',new t({collection:e}))},conditionalRender:function(){0===this.$el.parent().find(this.rootSel).length?this.render():this.update(),n.dispatcher.trigger("conditional-render.blog-view",this)},afterRender:function(){n.dispatcher.trigger("after-render.blog-view",this)},beforeRender:function(){n.dispatcher.trigger("before-render.blog-view",this)},update:function(){var e=this.model.get("EmbedConfig")||{};i.isUndefined(e.MediaToggle)||r(this.$('[data-gimme="blog.media-toggle"]'),e.MediaToggle),e.MediaUrl&&this.$('[data-gimme="blog.media-url"]').attr("href",e.MediaUrl),e.MediaImage&&this.$('[data-gimme="blog.media-image"]').attr("src",e.MediaImage),this.$('[data-gimme="blog.title"]').html(this.model.get("Title")),this.$('[data-gimme="blog.description"]').html(this.model.get("Description")),i.isEmpty(e)||n.dispatcher.trigger("config-update.blog-view",this)},serialize:function(){return this.model.toJSON()},stopPoller:function(){this.model.stopPolling(),this.model.get("publishedPosts").stopPolling()},starPoller:function(){this.model.startPolling(),this.model.get("publishedPosts").startPolling()}})}),liveblog.define("lib/backbone/model-collection-common",{syncParams:{headers:{},data:{}}}),liveblog.define("lib/poller",["underscore"],function(e){var t={defaultPollSettings:{pollInterval:null,poller:null,pollOptions:{}},startPolling:function(){for(var e in this.defaultPollSettings)this[e]||(this[e]=this.defaultPollSettings[e]);this._delayedPoll()},stopPolling:function(){clearInterval(this.timeoutId),this.timeoutId=null,this.xhr&&this.xhr.abort&&(this.xhr.abort(),this.xhr=null)},_poll:function(){if(this.pollInterval&&this.poller&&"function"==typeof this.poller){var t=this,n=e.extend(this.pollOptions,{success:function(){t._delayedPoll()},error:function(){t.stopPolling()}});this.xhr=this.poller(n)}},_delayedPoll:function(){if(this.pollInterval){var t=e.bind(this._poll,this);this.timeoutId=e.delay(t,this.pollInterval)}}};return t}),liveblog.define("models/base-model",["underscore","backbone-custom","lib/backbone/model-collection-common","lib/poller"],function(e,t,n,r){return t.Model.extend(e.extend({idAttribute:"Id",poller:function(e){this.fetch(e)}},n,r))}),liveblog.define("config/defaultPaginationParams",{offset:0,limit:15}),liveblog.define("collections/base-collection",["underscore","backbone-custom","lib/backbone/model-collection-common","lib/poller","config/defaultPaginationParams"],function(e,t,n,r,i){return t.Collection.extend(e.extend({filterProps:{total:0},clearPaginationParams:function(){var t=this.defaultPaginationParams||i;this.syncParams.pagination=e.extend(this.syncParams.pagination,t)},fetchPage:function(t){t=t||{};var n=this.syncParams.pagination||{};return t.data=e.extend(n,t.data),this.fetch(t)},fetchUpdates:function(t){t=t||{};var n=this.syncParams.updates||{};return t.data=e.extend(n,t.data),this.fetch(t)},poller:function(e){this.fetchUpdates(e)}},n,r))}),liveblog.define("lib/helpers/trim-tag",[],function(){var e=function(e,t){var n=function(e,t){for(var n=function(e,t){"string"!=typeof t&&(t="");var n=t.length,r=e.length;return 0===t.indexOf(e)&&(t=t.substr(r,n)),t.substr(n-r,n)===e&&(t=t.substr(0,n-r)),t},r=t,i=0;;){if(i++,r=n(e,t),r===t)break;if(t=r,i>100)break}return r +};if("string"==typeof e)t=n(e,t);else for(var r=0;r","
      ","
      "],r.before),after:n(["
      ","
      ","
      "],r.after)}),r}})}),liveblog.define("collections/posts",["underscore","collections/base-collection","models/post","lib/utils"],function(e,t,n,r){return t.extend({model:n,syncParams:{headers:{"X-Filter":"PublishedOn, DeletedOn, Order, Id, CId, Content, CreatedOn, Type, AuthorName, Author.Source.Name, Author.Source.IsModifiable, AuthorImage, Meta, IsPublished, Creator.FullName, Author.Source.Type.Key"},data:{thumbSize:"medium"},pagination:{},updates:{}},pollInterval:1e4,url:function(){return liveblog.servers.rest+"/resources/LiveDesk/Blog/"+this.blogId+"/Post/Published"},initialize:function(e,t){t.blogId&&(this.blogId=t.blogId),this.minPostOrder=0,r.isClient&&this.startPolling()},parse:function(t,n){return t.PostList=e.isUndefined(n.data["cId.since"])?this.newPageDataParse(t,n):this.updateDataParse(t,n),t.PostList},updateDataParse:function(t){if(t.lastCId&&this.updateLastCId(parseInt(t.lastCId,10)),t.PostList.length){var n=this;t.PostList=t.PostList.filter(function(e){return e.Order?parseFloat(e.Order)>=n.minPostOrder:!0}),e.each(t.PostList,function(e){e.updateItem=!0})}return t.PostList},newPageDataParse:function(t){if(e.isUndefined(this.lastCId())){var n=e.isUndefined(t.lastCId)?0:parseInt(t.lastCId,10);this.updateLastCId(n)}if(this.filterProps.total=parseInt(t.total,10),t.PostList.length){var r=e.min(t.PostList,function(e){return parseFloat(e.Order)});this.minPostOrder=parseFloat(r.Order)}return t.PostList},lastCId:function(){return this.syncParams.updates["cId.since"]},updateLastCId:function(e){this.syncParams.updates["cId.since"]=e}})}),liveblog.define("models/blog",["underscore","models/base-model","collections/posts","lib/utils"],function(e,t,n,r){return t.extend({syncParams:{headers:{"X-Filter":"Description, Title, EmbedConfig, Language.Code"},updates:{}},pollInterval:1e4,urlRoot:function(){return liveblog.servers.rest+"/resources/LiveDesk/Blog/"},initialize:function(){this.set("publishedPosts",new n([],{blogId:this.id})),r.isClient&&this.startPolling()},poller:function(t){delete t.data;var n,i=this;r.dispatcher.trigger("before-poller.blog-model",i),n=this.fetch(t),e.has(n,"done")&&n.done(function(){r.dispatcher.trigger("after-poller.blog-model",i)})},parse:function(t){return e.isString(t.EmbedConfig)&&(t.EmbedConfig=JSON.parse(t.EmbedConfig)),e.isUndefined(t.EmbedConfig)&&(t.EmbedConfig={}),t}})}),liveblog.define("lib/require-global",["underscore"],function(e){return e.isFunction(liveblog.require)?liveblog.require:require}),liveblog.define("plugins",{}),liveblog.define("lib/helpers/find-environment",["lib/utils"],function(e){return function(){if(e.isServer)return"desktop";if(e.isClient){var t="desktop",n=0;n&&"CSS1Compat"!==document.compatMode&&(t="quirks");var r=!1;return function(e){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(r=!0)}(navigator.userAgent||navigator.vendor||window.opera),r&&(t="mobile"),Boolean(navigator.userAgent.match(/(Large Screen)|GoogleTV/i))&&(t="big-screen"),t}}}),liveblog.define("i18n",["underscore","backbone-custom","lib/gettext","moment"],function(e,t,n,r){var i={},a=function(){var t={"post-date":"llll","closed-date":"llll","status-time":"HH:mm","pretty-day-time":"HH:mm","pretty-hour-time":"HH:mm","pretty-week-time":"HH:mm","pretty-week-date":"llll","pretty-month-date":"llll"},i={},a={sr:"rs"},o=a[liveblog.language]?a[liveblog.language]:liveblog.language,s=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"],l={};r.lang(o),e.each(s,function(e){n.pgettext("moment",e)!==e&&(l[e]=n.pgettext("moment",e).split("_"))}),r.lang(o,l),e.each(t,function(e,t){n.pgettext("moment",t)===t&&(i["moment:"+t]=["",e,""])}),n.loadMessages(i)};return{pluginBuilder:"lib/require/i18n-builder",load:function(r,o,s,l){liveblog.language||(liveblog.language=liveblog.fallback.language);var u=liveblog.servers.rest+"/content/cache/locale/plugin-"+r+"-"+liveblog.language+".json",c=liveblog.servers.rest+"/resources/Admin/Plugin/"+r+"/JSONLocale/"+liveblog.language,d=o.toUrl(u),f=o.toUrl(c),h={url:d,dataType:"json",cached:!0,tryCount:0,retryLimit:2,success:function(t){l.isBuild?(i[r]=t,s(t)):(n.loadMessages(e.values(t)[0]),a(),s(t)),s(t)},error:function(e,n,r){this.errorTimeout(e,n,r)||(h.url=f,h.cached=!1,h.error=this.errorTimeout,t.ajax(h))},errorTimeout:function(e,n){return"timeout"===n?(this.tryCount++,this.tryCount<=this.retryLimit?(t.ajax(this),!0):(console&&console.log("We have tried "+this.retryLimit+" times and it is still not working. We give in. Sorry."),!1)):this.cached?!1:(s({}),!0)}};t.ajax(h)},write:function(e,t,n){if(t in i){var r=i[t];n('define("'+e+"!"+t+'", function(){ return '+r+";});\n")}}}}),liveblog.define("load-theme",["lib/require-global","module","underscore","lib/utils"],function(e,t,n,r){var i=function(){e.undef("theme"),e.undef("themeFile")};return function(e,a){e=e||{theme:"default"},a=a||function(){};var o=function(t){n.each(t,function(t){t(e)}),a()},s=liveblog.min?t.config().buildPath:t.config().themesPath,l=function(e){return n.isArray(e)&&(e=e.join("/")),s+e};liveblog.min&&(liveblog.paths.build=t.config().buildPath,liveblog.paths.themes=t.config().themesPath),liveblog.theme=liveblog.theme?liveblog.theme:e.theme,e.language&&!liveblog.language&&(liveblog.language=e.language),liveblog.requirejs.config({paths:{theme:l(liveblog.theme),themeFile:l(liveblog.theme)}}),i(),liveblog.require(["plugins","themeFile","lib/helpers/find-environment","i18n!livedesk_embed"],function(e,t,n){if(t&&t.environments){if(!liveblog.environment){var a=n();liveblog.environment=t.environments[a]?t.environments[a]:t.environments["default"]}i(),liveblog.requirejs.config({paths:{theme:l([liveblog.theme,liveblog.environment]),themeFile:l([liveblog.theme,liveblog.environment])}}),liveblog.requirejs(["plugins","themeFile"],function(e){o(e)},function(){i(),r.dispatcher.trigger("sub-theme-file.request-failed")})}else o(e)},function(){i(),r.dispatcher.trigger("theme-file.request-failed")})}}),liveblog.define("router",["underscore","backbone-custom","views/blog","models/blog","load-theme"],function(e,t,n,r,i){return t.Router.extend({routes:{"*path":"default"},"default":function(){if(liveblog.id){var a=new r({Id:liveblog.id});a.fetch({success:function(){var r=a.get("EmbedConfig");e.has(a.get("Language"),"Code")&&(r.language=a.get("Language").Code),i(r,function(){var e,r='[data-gimme="blog.view"]',i=t.$(r);e=new n(0!==i.length?{el:r,model:a}:{el:liveblog.el,model:a}),e.conditionalRender()})}})}}})}),liveblog.require.config({config:{"load-theme":{themesPath:"../../themes/",buildPath:"./build/themes/"}},paths:{jquery:"bower_components/jquery/dist/jquery",json2:"bower_components/json2/json2","dustjs-linkedin":"node_modules/dustjs-linkedin/dist/dust-full","dustjs-helpers":"node_modules/dustjs-helpers/dist/dust-helpers",dust:"lib/dust",jed:"node_modules/jed/jed","lodash.compat":"node_modules/lodash/dist/lodash.compat",backbone:"node_modules/backbone/backbone","backbone-custom":"lib/backbone/backbone-custom","backbone.layoutmanager":"node_modules/backbone.layoutmanager/backbone.layoutmanager",moment:"node_modules/moment/min/moment-with-langs","moment-timezone":"bower_components/moment-timezone/builds/moment-timezone-with-data-2010-2020",waypoints:"bower_components/jquery-waypoints/waypoints",themeBase:"../../themes/base",tmpl:"lib/require/tmpl",i18n:"lib/require/i18n",css:"lib/require/css"},shim:{json2:{exports:"JSON"},"dustjs-linkedin":{exports:"dust"},"dustjs-helpers":{deps:["dustjs-linkedin"]}},map:{"*":{underscore:"lib/lodash-private",lodash:"lib/lodash-private",jquery:"lib/jquery-private",backbone:"lib/backbone-private"},"lib/jquery-private":{jquery:"jquery"},"lib/backbone-private":{backbone:"backbone"},"lib/lodash-private":{lodash:"lodash.compat"}}}),liveblog.require(["jquery","backbone","lib/jquery/xdomainrequest"],function(e,t){e(function(){liveblog.require(["router"],function(e){new e;t.history.start({pushState:!1})})})}),liveblog.define("main",function(){}),liveblog.define("plugins/css",["plugins","lib/utils"],function(e,t){var n=function(){n.hasData()&&t.dispatcher.once("after-render.layout-view",function(e){e.$('[data-gimme="liveblog-layout"]').prepend(n.getData())})};return n._data="",n.setData=function(e){n._data=e},n.getData=function(){return n._data},n.hasData=function(){return""!==n._data?!0:!1},e.css=n,e.css}),liveblog.define("css",["lib/utils","plugins/css","backbone"],function(e,t,n){var r,i={};if(i.normalize=function(e,t){return".css"===e.substr(e.length-4,4)&&(e=e.substr(0,e.length-4)),t(e)},i.pluginBuilder="lib/require/css-builder",e.isClient){var a=document.getElementsByTagName("head")[0],o=window.navigator.userAgent.match(/Trident\/([^ ;]*)|AppleWebKit\/([^ ;]*)|Opera\/([^ ;]*)|rv\:([^ ;]*)(.*?)Gecko\/([^ ;]*)|MSIE\s([^ ;]*)/)||0,s=!1,l=!0;o[1]||o[7]?s=parseInt(o[1],10)<6||parseInt(o[7],10)<=9:o[2]?l=!1:o[4]&&(s=parseInt(o[4],10)<18);var u,c,d,f=function(){u=document.createElement("style"),a.appendChild(u),c=u.styleSheet||u.sheet},h=0,p=[],m=function(e){h++,32===h&&(f(),h=0),c.addImport(e),u.onload=_},_=function(){d();var e=p.shift();return e?(d=e[1],void m(e[0])):void(d=null)},g=function(e,t){if(c&&c.addImport||f(),c&&c.addImport)d?p.push([e,t]):(m(e),d=t);else{u.textContent='@import "'+e+'";';var n=setInterval(function(){try{u.sheet.cssRules,clearInterval(n),t()}catch(e){}},10)}},y=function(e,t){var n=document.createElement("link");if(n.type="text/css",n.rel="stylesheet",l)n.onload=function(){n.onload=function(){},setTimeout(t,7)};else var r=setInterval(function(){for(var e=0;e'),o()),e.isClient){var c=n.$('link[href="'+u+'"]').length;c?o():(s?g:y)(u,o)}},i}); \ No newline at end of file diff --git a/gui-resources/scripts/js/build/themes/aamulehti/desktop.js b/gui-resources/scripts/js/build/themes/aamulehti/desktop.js index 691209d25..77c667b23 100644 --- a/gui-resources/scripts/js/build/themes/aamulehti/desktop.js +++ b/gui-resources/scripts/js/build/themes/aamulehti/desktop.js @@ -1,2 +1,3 @@ -liveblog.define("plugins",{}),liveblog.define("plugins/pagination",["plugins","lib/utils"],function(e,a){return e.pagination=function(){a.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()){a.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,a.dispatcher.trigger("loaded.posts-view",e)})}},e.hasNextPage=function(){return this.collection.length96?e-87:e>64?e-29:e-48}function i(e){var i,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;ti;i++)e[i]=Math.round((e[i-1]||0)+6e4*e[i]);e[a-1]=1/0}function r(e,a){var i,t=[];for(i=0;i').helper("i18n",a,{},{msgid:"Load more posts ..."}).write("")}function s(e,a){return a=a.shiftBlocks(u),e.write('')}function l(e,a){return a=a.shiftBlocks(u),e.write('data-gimme="posts.nextPage"')}e.register("themeBase/plugins/after-button-pagination",a); -var u={itemClass:t,main:n,loadNext:c,loadingNext:s,additionalAttributes:l};return a}(),{render:function(a,i){return e.render("themeBase/plugins/after-button-pagination",a,i)}}}),liveblog.define("tmpl!themeBase/plugins/before-button-pagination",["dust"],function(e){return function(){function a(e,a){return a=a.shiftBlocks(u),e.partial(i,a,null)}function i(e,a){return a=a.shiftBlocks(u),e.reference(a.get(["baseItem"],!1),a,"h")}function t(e,a){return a=a.shiftBlocks(u),e.write("load-next")}function n(e,a){return a=a.shiftBlocks(u),e.block(a.getBlock("loadNext"),a,{block:r},null).block(a.getBlock("loadingNext"),a,{block:o},null)}function r(e,a){return a=a.shiftBlocks(u),e}function o(e,a){return a=a.shiftBlocks(u),e}function c(e,a){return a=a.shiftBlocks(u),e.write('Load top posts')}function s(e,a){return a=a.shiftBlocks(u),e.write('')}function l(e,a){return a=a.shiftBlocks(u),e.write('data-gimme="posts.beforePage"')}e.register("themeBase/plugins/before-button-pagination",a);var u={itemClass:t,main:n,loadNext:c,loadingNext:s,additionalAttributes:l};return a}(),{render:function(a,i){return e.render("themeBase/plugins/before-button-pagination",a,i)}}}),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,a,i,t,n,r){return delete a.pagination,a["button-pagination"]=function(a){i(a),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(a){var i={};i.baseItem=t.themed("themeBase/item/base"),0===a.$('[data-gimme="posts.beforePage"]').length&&t.renderThemed("themeBase/plugins/before-button-pagination",i,function(i,t){var n=e.$(t);r(n,!1),a.$el.prepend(n)}),0===a.$('[data-gimme="posts.nextPage"]').length&&t.renderThemed("themeBase/plugins/after-button-pagination",i,function(i,t){var n=e.$(t);r(n,!1),a.$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 a=e.$('[data-gimme="posts.nextPage"]');a.addClass("loading"),e.nextPage().done(function(){e.flags.buttonNextPage=!1,a.removeClass("loading"),e.checkNextPage()})},e.buttonTopPage=function(){var a=e.$('[data-gimme="posts.beforePage"]');a.addClass("loading"),e.flags.topPage=!1,e.topPage().done(function(){a.removeClass("loading"),r(a,!1),e.checkNextPage()})}})},a["button-pagination"]}),function(){var e=[].indexOf||function(e){for(var a=0,i=this.length;i>a;a++)if(a in this&&this[a]===e)return a;return-1},a=[].slice;!function(e,a){return"function"==typeof liveblog.define&&liveblog.define.amd?liveblog.define("waypoints",["jquery"],function(i){return a(i,e)}):a(e.jQuery,e)}(window,function(i,t){var n,r,o,c,s,l,u,A,m,f,p,d,g,h,b,T;return n=i(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 a=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 a.didScroll||A?void 0:(a.didScroll=!0,e=function(){return a.doScroll(),a.didScroll=!1},t.setTimeout(e,i[T].settings.scrollThrottle))}),e.bind(p,function(){var e;return a.didResize?void 0:(a.didResize=!0,e=function(){return i[T]("refresh"),a.didResize=!1},t.setTimeout(e,i[T].settings.resizeThrottle))})}return e.prototype.doScroll=function(){var e,a=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||i[T]("refresh"),i.each(e,function(e,t){var n,r,o;return o=[],r=t.newScroll>t.oldScroll,n=r?t.forward:t.backward,i.each(a.waypoints[e],function(e,a){var i,n;return t.oldScroll<(i=a.offset)&&i<=t.newScroll?o.push(a):t.newScroll<(n=a.offset)&&n<=t.oldScroll?o.push(a):void 0}),o.sort(function(e,a){return e.offset-a.offset}),r||o.reverse(),i.each(o,function(e,a){return a.options.continuous||e===o.length-1?a.trigger([n]):void 0})}),this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.refresh=function(){var e,a,t,n=this;return t=i.isWindow(this.element),a=this.$element.offset(),this.doScroll(),e={horizontal:{contextOffset:t?0:a.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:a.top,contextScroll:t?0:this.oldScroll.y,contextDimension:t?i[T]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}},i.each(e,function(e,a){return i.each(n.waypoints[e],function(e,t){var n,r,o,c,s;return n=t.options.offset,o=t.offset,r=i.isWindow(t.element)?0:t.$element.offset()[a.offsetProp],i.isFunction(n)?n=n.apply(t.element):"string"==typeof n&&(n=parseFloat(n),t.options.offset.indexOf("%")>-1&&(n=Math.ceil(a.contextDimension*n/100))),t.offset=r-a.contextOffset+a.contextScroll-n,t.options.onlyOnScroll&&null!=o||!t.enabled?void 0:null!==o&&o<(c=a.oldScroll)&&c<=t.offset?t.trigger([a.backward]):null!==o&&o>(s=a.oldScroll)&&s>=t.offset?t.trigger([a.forward]):null===o&&a.oldScroll>=t.offset?t.trigger([a.forward]):void 0})})},e.prototype.checkEmpty=function(){return i.isEmptyObject(this.waypoints.horizontal)&&i.isEmptyObject(this.waypoints.vertical)?(this.$element.unbind([p,d].join(" ")),delete u[this.id]):void 0},e}(),o=function(){function e(e,a,t){var n,r;"bottom-in-view"===t.offset&&(t.offset=function(){var e;return e=i[T]("viewportHeight"),i.isWindow(a.element)||(e=a.$element.height()),e-i(this).outerHeight()}),this.$element=e,this.element=e[0],this.axis=t.horizontal?"horizontal":"vertical",this.callback=t.handler,this.context=a,this.enabled=t.enabled,this.id="waypoints"+g++,this.offset=null,this.options=t,a.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 a,t;return(t=e[h])?(a=i.extend({},c.horizontal,c.vertical),i.map(t,function(e){return a[e]})):[]},e}(),f={init:function(e,a){var t;return a=i.extend({},i.fn[b].defaults,a),null==(t=a.handler)&&(a.handler=e),this.each(function(){var e,t,n,c;return e=i(this),n=null!=(c=a.context)?c:i.fn[b].defaults.context,i.isWindow(n)||(n=e.closest(n)),n=i(n),t=u[n[0][l]],t||(t=new r(n)),new o(e,t,a)}),i[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,a){return f._traverse.call(this,e,a,function(e,a,i){return a>0?e.push(i[a-1]):void 0})},next:function(e,a){return f._traverse.call(this,e,a,function(e,a,i){return ae.oldScroll.y})},left:function(e){return null==e&&(e=t),m._filter(e,"horizontal",function(e,a){return a.offset<=e.oldScroll.x})},right:function(e){return null==e&&(e=t),m._filter(e,"horizontal",function(e,a){return a.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,a){return f[e]=a},_invoke:function(e){var a;return a=i.extend({},c.vertical,c.horizontal),i.each(a,function(a,i){return i[e](),!0})},_filter:function(e,a,t){var n,r;return(n=u[i(e)[0][l]])?(r=[],i.each(n.waypoints[a],function(e,a){return t(n,a)?r.push(a):void 0}),r.sort(function(e,a){return e.offset-a.offset}),i.map(r,function(e){return e.element})):[]}},i[T]=function(){var e,i;return i=arguments[0],e=2<=arguments.length?a.call(arguments,1):[],m[i]?m[i].apply(null,e):m.aggregate.call(null,i)},i[T].settings={resizeThrottle:100,scrollThrottle:30},n.on("load.waypoints",function(){return i[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,a,i,t,n){return i["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){a(e)});var a=function(a){a._twitterPosts&&liveblog.require(["twitterWidgets","waypoints"],function(i){i.ready(function(){e.each(a._twitterPosts,function(e){e.$el.waypoint(function(){var a=e.model.get("Meta").id_str;i.widgets.createTweet(a,e.$el.find(".post-content-full").get(0),function(){e.$el.find(".post-core-content").remove()},{cards:"all"})},{triggerOnce:!0,offset:"120%",context:a.el})}),a._twitterPosts=[]})},function(){})}}},i["twitter-widgets"]}),liveblog.define("lib/helpers/escape-RegExp",[],function(){var e=function(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")};return e}),liveblog.define("plugins/post-hash",["plugins","lib/utils","lib/helpers/escape-RegExp"],function(e,a,i){e["post-hash"]=function(){var e,t="liveblog.item.id",n=liveblog.hashmark?liveblog.hashmark:"?";e=a.isClient?window.location.href:liveblog.locationHref||"/",a.dispatcher.on("initialize.post-view",function(a){a.permalink=function(r){var o=r&&r.hashMark?r.hashMark:n,c=!1,s=t+"="+parseFloat(a.model.get("Order"));if(-1===e.indexOf(o))c=e+o+s;else if(-1!==e.indexOf(t+"=")){var l=new RegExp(i(t)+"=[^&#]*");c=e.replace(l,s)}else c=e+"&"+s;return c}}),a.dispatcher.on("initialize.posts-view",function(a){var i=e.indexOf(t+"=");-1!==i&&(a.collection.syncParams.pagination["order.end"]=parseFloat(e.substr(i+t.length+1)),a.flags.hasTopPage=!0,a.flags.autoRender=!1)})}}),liveblog.define("lib/helpers/visibility-toggle",[],function(){var e=function(e,a){var i="";return i=void 0!==a?a?"visible":"hidden":"visible"===e.css("visibility")?"hidden":"visible",e.css("visibility",i),"visible"===i?!0:!1};return e}),liveblog.define("tmpl!themeBase/plugins/permanent-link",["dust"],function(e){return function(){function a(e){return e.write('')}return e.register("themeBase/plugins/permanent-link",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/permanent-link",a,i)}}}),liveblog.define("plugins/permanent-link",["plugins","lib/utils","dust","lib/helpers/visibility-toggle","tmpl!themeBase/item/base","tmpl!themeBase/plugins/permanent-link"],function(e,a,i,t){return a.isClient?(e.permalink=function(){a.dispatcher.on("after-render.post-view",function(e){i.renderThemed("themeBase/plugins/permanent-link",{},function(a,i){e.$('[data-gimme="post.permanent-link-placeholder"]').html(i)});var a="";e.permalink&&"function"==typeof e.permalink&&(a=e.permalink(),e.$('[data-gimme="post.share-permalink"]').val(a),e.$('[data-gimme="post.permalink"]').attr("href",a))}),a.dispatcher.on("initialize.post-view",function(e){e.clientEvents({'click [data-gimme="post.permalink"]':"permalinkAction"}),e.permalinkAction=function(e){e.preventDefault();var a=this.$('[data-gimme="post.share-permalink"]');if(t(a)){var i=this.$('[data-gimme^="post.share"][data-gimme!="post.share-permalink"]');t(i,!1),a.trigger("focus")}},e.clientEvents({'click [data-gimme="post.share-permalink"]':"permalinkInput",'focus [data-gimme="post.share-permalink"]':"permalinkInput"}),e.permalinkInput=function(a){e.$(a.target).select()},e.delegateEvents()})},e.permalink):void 0}),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 a(e,a){return e.write('').helper("i18n",a,{},{msgid:"Share"}).write("")}return e.register("themeBase/plugins/social-share-anchor",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/social-share-anchor",a,i)}}}),liveblog.define("tmpl!themeBase/plugins/social-share",["dust"],function(e){return function(){function a(e,a){return e.write('')}function i(e,a){return e.write('')}return e.register("themeBase/plugins/social-share",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/social-share",a,i)}}}),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,a,i,t,n,r,o,c,s){t.isClient&&(i["social-share"]=function(){t.dispatcher.on("after-render.post-view",function(e){n.renderThemed("themeBase/plugins/social-share-anchor",{},function(a,i){e.$('[data-gimme="post.social-share-placeholder"]').html(i)})}),t.dispatcher.on("initialize.post-view",function(e){e.clientEvents({'click [data-gimme="post.social"]':"share"}),e.share=function(e){e.preventDefault();var a=this,t=i(a);a.socialShareUrls=l(t),n.renderThemed("themeBase/plugins/social-share",u(t),function(e,i){a.$('[data-gimme="post.social-share-placeholder"]').append(i)}),A(a);var r=a.$('[data-gimme="post.share-social"]'),o=a.$('[data-gimme^="post.share"]');"hidden"===r.css("visibility")&&c(o,!1),c(r)},e.openShareWindow=function(e){e.preventDefault();var a=this.$(e.target).data("gimme"),i=s.shareWindowSize[a].h,t=s.shareWindowSize[a].w,n=this.socialShareUrls[a],r="resizable, height="+i+", width="+t,o=window.open(n,"",r);return o.focus(),!1}});var i=function(a){var i=a.parentView().parentView().model,t=o(i.get("Title")),n=o(a.$(".result-content .result-text:last").text()),c="";a.permalink&&"function"==typeof a.permalink&&(c=o(a.permalink()));var l=a.$(".result-content img:first").attr("src");l||(l=e.$("img:first").attr("src"));var u="";a.$(".result-content img").each(function(a){u+=r.sprintf(s.fbURLImageComp,[a,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 i={};return delete e.email,a.each(e,function(a,t){i[t]=r.sprintf(s.urls[t],e[t])}),i},u=function(e){var a={};return a.emailurl=r.sprintf(s.urls.email,e.email),a},A=function(e){var i={};a.each(e.socialShareUrls,function(e,a){i['click [data-gimme="'+a+'"]']="openShareWindow"}),e.clientEvents(i),e.delegateEvents()}})}),liveblog.define("plugins/wrappup-toggle",["backbone","underscore","plugins","lib/utils","dust"],function(e,a,i,t){var n={hide:"slideUp",show:"slideDown"};t.isClient&&t.dispatcher.once("initialize.posts-view",function(e){e.clientEvents({'click [data-gimme="post.wrapup"]':"wrapupToggle"}),e.wrapupToggle=function(a){var i=e.$(a.target).closest('[data-gimme="post.wrapup"]'),t=i.attr("data-wrapup-open");i.hasClass(t)?(i.removeClass(t),i.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.hide]()):(i.addClass(t),i.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.show]())}})}),liveblog.define("lib/helpers/format-commentator",["underscore","lib/gettext"],function(e,a){return function(e){return e=e.replace("commentator",""),a.sprintf(a.gettext("%(full_name)s commentator"),{full_name:e})}}),liveblog.define("lib/helpers/adjust-server-post",["underscore"],function(){return function(e){var a="infomercial";return"advertisement"===e.Type.Key&&(e.Type.Key=a),"advertisement"===e.Author.Source.Name&&(e.Author.Source.Name=a),"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,a,i){return i.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,a,i,t,n){return i.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 a=this,i=a.backdropel.data("show-status");switch(e.preventDefault(),i){case 0:t(a.popup,!0),a.backdropel.data("show-status",1),t(a.backdropel,!0),a.lbpostlist.addClass("comment-active"),a.blogview.stopPoller();break;case 1:a.backdropel.data("show-status",0).hide(),t(a.popup_message,!1),a.resetInput(),a.lbpostlist.removeClass("comment-active"),t(a.popup,!1),a.blogview.starPoller();break;case 2:t(a.popup_message,!1),a.resetInput(),a.lbpostlist.removeClass("comment-active"),t(a.popup,!1),a.blogview.starPoller()}},send:function(e){e.preventDefault();var a=this;if(this.isValid()){var i=new n,t={UserName:this.username.val(),CommentText:this.text.val()};i.setUrlRoot(this.model.get("CommentPost").href),i.save(t,{success:function(){a.showAfterMessage(e),a.resetInput()},error:function(){a.showAfterMessage(e),a.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 a(e,a){return e.write('
      ').helper("i18n",a,{},{msgid:"Your message was sent for approval"}).write("
      ")}return e.register("themeBase/plugins/user-comment-message",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/user-comment-message",a,i)}}}),liveblog.define("tmpl!themeBase/plugins/user-comment-backdrop",["dust"],function(e){return function(){function a(e){return e.write('
      ')}return e.register("themeBase/plugins/user-comment-backdrop",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/user-comment-backdrop",a,i)}}}),liveblog.define("tmpl!themeBase/plugins/user-comment-action",["dust"],function(e){return function(){function a(e,a){return e.write('").helper("i18n",a,{},{msgid:"comment"}).write("")}function i(e){return e.write(' style="display:none" ')}function t(e){return e.write(' style="display:block" ')}return e.register("themeBase/plugins/user-comment-action",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/user-comment-action",a,i)}}}),liveblog.define("tmpl!themeBase/plugins/user-comment",["dust"],function(e){return function(){function a(e,a){return e.write('
      ').helper("i18n",a,{},{msgid:"Please fill in your Nickname."}).write('
      ').helper("i18n",a,{},{msgid:"Please fill in your Comment text."}).write('
      ').helper("i18n",a,{},{msgid:"Please fill in text from image."}).write('
      ")}return e.register("themeBase/plugins/user-comment",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/user-comment",a,i)}}}),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,a,i,t,n){return e["user-comments"]=function(e){i.dispatcher.on("config-update.blog-view",function(e){n(e.$('[data-gimme="blog.comment"]'),e.model.get("EmbedConfig").UserComments)}),i.dispatcher.on("conditional-render.blog-view",function(r){if(t.renderThemed("themeBase/plugins/user-comment-action",{UserComments:r.model.get("EmbedConfig").UserComments},function(e,a){r.$('[data-gimme="blog.comment-action"]').html(a)}),n(r.$('[data-gimme="blog.comment"]'),e.UserComments),t.renderThemed("themeBase/plugins/user-comment",{},function(e,a){r.$('[data-gimme="blog.comment-box"]').html(a)}),t.renderThemed("themeBase/plugins/user-comment-message",{},function(e,a){r.$('[data-gimme="blog.comment-box-message"]').html(a)}),t.renderThemed("themeBase/plugins/user-comment-backdrop",{},function(e,a){r.$('[data-gimme="blog.comment-box-backdrop"]').html(a)}),i.isClient){new a({el:r.el,blogview:r,model:r.model})}})},e["user-comments"]}),liveblog.define("tmpl!theme/container",["dust"],function(e){return function(){function a(e,a){return a=a.shiftBlocks(o),e.partial("themeBase/container",a,null)}function i(e,a){return a=a.shiftBlocks(o),e.write('
      ').block(a.getBlock("header"),a,{block:t},null).write("
      ")}function t(e,a){return a=a.shiftBlocks(o),e.block(a.getBlock("blogMedia"),a,{block:n},null)}function n(e,a){return a=a.shiftBlocks(o),e}function r(e,a){return a=a.shiftBlocks(o),e}e.register("theme/container",a);var o={headerContainer:i,contentBottomContainer:r};return a}(),{render:function(a,i){return e.render("theme/container",a,i)}}}),liveblog.define("tmpl!theme/item/base",["dust"],function(e){return function(){function a(e,a){return a=a.shiftBlocks(s),e.partial("themeBase/item/base",a,null)}function i(e,a){return a=a.shiftBlocks(s),e}function t(e,a){return a=a.shiftBlocks(s),e.block(a.getBlock("postDateContainer"),a,{block:n},null).block(a.getBlock("userAvatar"),a,{block:r},null).block(a.getBlock("userNameContainer"),a,{block:o},null).block(a.getBlock("shareContainer"),a,{block:c},null)}function n(e,a){return a=a.shiftBlocks(s),e}function r(e,a){return a=a.shiftBlocks(s),e}function o(e,a){return a=a.shiftBlocks(s),e}function c(e,a){return a=a.shiftBlocks(s),e}e.register("theme/item/base",a);var s={headerContainer:i,contentSide:t};return a}(),{render:function(a,i){return e.render("theme/item/base",a,i)}}}),liveblog.define("themeFile",["css!theme/liveblog","plugins/button-pagination","plugins/twitter-widgets","plugins/post-hash","plugins/permanent-link","plugins/social-share","plugins/wrappup-toggle","plugins/user-comments","tmpl!theme/container","tmpl!theme/item/base"],function(){return{plugins:["button-pagination","twitter-widgets","post-hash","permanent-link","social-share","wrappup-toggle","user-comments"]}}); \ No newline at end of file +liveblog.define("plugins",{}),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.length96?e-87:e>64?e-29:e-48}function a(e){var a,t=0,n=e.split("."),r=n[0],o=n[1]||"",s=1,c=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').helper("i18n",i,{},{msgid:"Load more posts ..."}).write("")}function c(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:s,loadingNext:c,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 s(e,i){return i=i.shiftBlocks(u),e.write('Load top posts')}function c(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:s,loadingNext:c,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!themeBase/plugins/pending-items-message",["dust"],function(e){return function(){function i(e){return e.write('')}return e.register("themeBase/plugins/pending-items-message",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/pending-items-message",i,a)}}}),liveblog.define("plugins/pending-messages",["lib/gettext","plugins","lib/utils","dust","tmpl!themeBase/item/base","tmpl!themeBase/plugins/pending-items-message"],function(e,i,a,t){return i.pendingMessages=function(){var i={};a.dispatcher.once("initialize.blog-view",function(e){i=e}),a.dispatcher.once("after-render.blog-view",function(e){t.renderThemed("themeBase/plugins/pending-items-message",{},function(i,a){e.$('[data-gimme="posts.pending-message-placeholder"]').html(a)})}),a.isClient&&(a.dispatcher.once("initialize.posts-view",function(e){e.pauseAutoRender=function(){this.flags.autoRender=!1},e.resumeAutoRender=function(){this.flags.autoRender=!0},i.$el.on("click",'[data-gimme="posts.pending-message"],[data-gimme="posts.pending-message-holder"]',function(){e.renderPending()})}),a.dispatcher.on("update-pending.posts-view",function(a){var t="",n=a.pendingCounter;n>0&&(t=e.sprintf(e.ngettext("one new post","%(count)s new posts",n),{count:n})),i.$('[data-gimme="posts.pending-message"]').html(t).toggle(n>0),i.$('[data-gimme="posts.pending-message-holder"]').toggle(n>0)}))},i.pendingMessages}),liveblog.define("config/scroll-pagination-plugin",{scrollHeight:500,nextPageTriggerOffset:-200}),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,s,c,l,u,A,m,p,f,d,g,h,b,T;return n=a(t),A=e.call(t,"ontouchstart")>=0,s={horizontal:{},vertical:{}},c=1,u={},l="waypoints-context-id",f="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"+c++,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(f,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,s,c;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<(s=i.oldScroll)&&s<=t.offset?t.trigger([i.backward]):null!==o&&o>(c=i.oldScroll)&&c>=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([f,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,s[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 s[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({},s.horizontal,s.vertical),a.map(t,function(e){return i[e]})):[]},e}(),p={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,s;return e=a(this),n=null!=(s=i.context)?s: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 p._invoke.call(this,"disable")},enable:function(){return p._invoke.call(this,"enable")},destroy:function(){return p._invoke.call(this,"destroy")},prev:function(e,i){return p._traverse.call(this,e,i,function(e,i,a){return i>0?e.push(a[i-1]):void 0})},next:function(e,i){return p._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 p[e]=i},_invoke:function(e){var i;return i=a.extend({},s.vertical,s.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.define("plugins/scroll-pagination",["plugins","plugins/button-pagination","plugins/pending-messages","config/scroll-pagination-plugin","lib/utils"],function(e,i,a,t,n){return delete e["button-pagination"],delete e["pending-messages"],e["scroll-pagination"]=function(e){i(e),a(e),n.dispatcher.once("add-all.posts-view",function(e){e.$el.css("overflow-y","auto").css("overflow-x","auto").css("height",t.scrollHeight+"px")}),n.isClient&&(n.dispatcher.on("initialize.blog-view",function(e){r(e)}),n.dispatcher.on("pagination-next-updated.posts-view",function(e){e.hasNextPage()&&o(e,e.$('[data-gimme="posts.nextPage"]'))}),n.dispatcher.once("pagination-next-updated.posts-view",function(e){s(e)}));var r=function(e){e.clientEvents({'click [data-gimme="posts.to-top"]':"toTop",'click [data-gimme="posts.pending-message"]':"toTop"}),e.toTop=function(e){e.preventDefault(),this.$('[data-gimme="posts.list"]').scrollTop(0)}},o=function(e,i){liveblog.require(["waypoints"],function(){i.waypoint(function(){e.buttonNextPage()},{continuous:!1,triggerOnce:!0,offset:"100%",context:e.el})})},s=function(e){var i=e.$('[data-gimme="posts.beforePage"]');liveblog.require(["waypoints"],function(){i.waypoint(function(a){"down"===a&&(e.pauseAutoRender(),i.waypoint("destroy"),c(e))},{continuous:!1,offset:t.nextPageTriggerOffset,context:e.el})})},c=function(e){var i=e.firstPost().$el;liveblog.require(["waypoints"],function(){i.waypoint(function(a){"up"===a&&(e.renderPending(),e.resumeAutoRender(),i.waypoint("destroy"),s(e))},{continuous:!1,offset:-1,context:e.el})})}},e["scroll-pagination"]}),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/escape-RegExp",[],function(){var e=function(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")};return e}),liveblog.define("plugins/post-hash",["plugins","lib/utils","lib/helpers/escape-RegExp"],function(e,i,a){e["post-hash"]=function(){var e,t="liveblog.item.id",n=liveblog.hashmark?liveblog.hashmark:"?";e=i.isClient?window.location.href:liveblog.locationHref||"/",i.dispatcher.on("initialize.post-view",function(i){i.permalink=function(r){var o=r&&r.hashMark?r.hashMark:n,s=!1,c=t+"="+parseFloat(i.model.get("Order"));if(-1===e.indexOf(o))s=e+o+c;else if(-1!==e.indexOf(t+"=")){var l=new RegExp(a(t)+"=[^&#]*");s=e.replace(l,c)}else s=e+"&"+c;return s}}),i.dispatcher.on("initialize.posts-view",function(i){var a=e.indexOf(t+"=");-1!==a&&(i.collection.syncParams.pagination["order.end"]=parseFloat(e.substr(a+t.length+1)),i.flags.hasTopPage=!0,i.flags.autoRender=!1)})}}),liveblog.define("lib/helpers/visibility-toggle",[],function(){var e=function(e,i){var a="";return a=void 0!==i?i?"visible":"hidden":"visible"===e.css("visibility")?"hidden":"visible",e.css("visibility",a),"visible"===a?!0:!1};return e}),liveblog.define("tmpl!themeBase/plugins/permanent-link",["dust"],function(e){return function(){function i(e){return e.write('')}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/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,s,c){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")&&s(o,!1),s(r)},e.openShareWindow=function(e){e.preventDefault();var i=this.$(e.target).data("gimme"),a=c.shareWindowSize[i].h,t=c.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()),s="";i.permalink&&"function"==typeof i.permalink&&(s=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(c.fbURLImageComp,[i,e.$(this).attr("src")])});var A={pin:[s,l,t],twt:[r.gettext("Now reading"),t,s],lin:[s,t,n],ggl:[s],email:[r.gettext("Check out this Live Blog"),s],fb:[t,n,s,u]};return A},l=function(e){var a={};return delete e.email,i.each(e,function(i,t){a[t]=r.sprintf(c.urls[t],e[t])}),a},u=function(e){var i={};return i.emailurl=r.sprintf(c.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/wrappup-toggle",["backbone","underscore","plugins","lib/utils","dust"],function(e,i,a,t){var n={hide:"slideUp",show:"slideDown"};t.isClient&&t.dispatcher.once("initialize.posts-view",function(e){e.clientEvents({'click [data-gimme="post.wrapup"]':"wrapupToggle"}),e.wrapupToggle=function(i){var a=e.$(i.target).closest('[data-gimme="post.wrapup"]'),t=a.attr("data-wrapup-open");a.hasClass(t)?(a.removeClass(t),a.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.hide]()):(a.addClass(t),a.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.show]())}})}),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"]}),liveblog.define("plugins/status",["backbone","plugins","lib/utils","lib/gettext","moment"],function(e,i,a,t,n){return a.isClient?(i.status=function(){a.dispatcher.on("initialize.blog-view",function(e){a.dispatcher.on("after-poller.blog-model conditional-render.blog-view",function(){var i=t.sprintf('',n().milliseconds(),n().format(t.pgettext("moment","status-time")));e.$('[data-gimme="blog.status"]').html(t.sprintf(t.gettext("updated at %s"),i))}),a.dispatcher.on("before-poller.blog-model",function(){e.$('[data-gimme="blog.status"]').html(t.gettext("updating..."))})})},i.status):void 0}),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("blogMedia"),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(c),e.partial("themeBase/item/base",i,null)}function a(e,i){return i=i.shiftBlocks(c),e}function t(e,i){return i=i.shiftBlocks(c),e.block(i.getBlock("postDateContainer"),i,{block:n},null).block(i.getBlock("userAvatar"),i,{block:r},null).block(i.getBlock("userNameContainer"),i,{block:o},null).block(i.getBlock("shareContainer"),i,{block:s},null)}function n(e,i){return i=i.shiftBlocks(c),e}function r(e,i){return i=i.shiftBlocks(c),e}function o(e,i){return i=i.shiftBlocks(c),e}function s(e,i){return i=i.shiftBlocks(c),e +}e.register("theme/item/base",i);var c={headerContainer:a,contentSide:t};return i}(),{render:function(i,a){return e.render("theme/item/base",i,a)}}}),liveblog.define("themeFile",["css!theme/liveblog","plugins/scroll-pagination","plugins/twitter-widgets","plugins/post-hash","plugins/permanent-link","plugins/social-share","plugins/wrappup-toggle","plugins/user-comments","plugins/status","tmpl!theme/container","tmpl!theme/item/base"],function(){return{plugins:["scroll-pagination","twitter-widgets","post-hash","permanent-link","social-share","wrappup-toggle","user-comments","status"]}}); \ No newline at end of file diff --git a/gui-resources/scripts/js/build/themes/ksml-light/desktop.js b/gui-resources/scripts/js/build/themes/ksml-light/desktop.js index 691209d25..77c667b23 100644 --- a/gui-resources/scripts/js/build/themes/ksml-light/desktop.js +++ b/gui-resources/scripts/js/build/themes/ksml-light/desktop.js @@ -1,2 +1,3 @@ -liveblog.define("plugins",{}),liveblog.define("plugins/pagination",["plugins","lib/utils"],function(e,a){return e.pagination=function(){a.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()){a.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,a.dispatcher.trigger("loaded.posts-view",e)})}},e.hasNextPage=function(){return this.collection.length96?e-87:e>64?e-29:e-48}function i(e){var i,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;ti;i++)e[i]=Math.round((e[i-1]||0)+6e4*e[i]);e[a-1]=1/0}function r(e,a){var i,t=[];for(i=0;i').helper("i18n",a,{},{msgid:"Load more posts ..."}).write("")}function s(e,a){return a=a.shiftBlocks(u),e.write('')}function l(e,a){return a=a.shiftBlocks(u),e.write('data-gimme="posts.nextPage"')}e.register("themeBase/plugins/after-button-pagination",a); -var u={itemClass:t,main:n,loadNext:c,loadingNext:s,additionalAttributes:l};return a}(),{render:function(a,i){return e.render("themeBase/plugins/after-button-pagination",a,i)}}}),liveblog.define("tmpl!themeBase/plugins/before-button-pagination",["dust"],function(e){return function(){function a(e,a){return a=a.shiftBlocks(u),e.partial(i,a,null)}function i(e,a){return a=a.shiftBlocks(u),e.reference(a.get(["baseItem"],!1),a,"h")}function t(e,a){return a=a.shiftBlocks(u),e.write("load-next")}function n(e,a){return a=a.shiftBlocks(u),e.block(a.getBlock("loadNext"),a,{block:r},null).block(a.getBlock("loadingNext"),a,{block:o},null)}function r(e,a){return a=a.shiftBlocks(u),e}function o(e,a){return a=a.shiftBlocks(u),e}function c(e,a){return a=a.shiftBlocks(u),e.write('Load top posts')}function s(e,a){return a=a.shiftBlocks(u),e.write('')}function l(e,a){return a=a.shiftBlocks(u),e.write('data-gimme="posts.beforePage"')}e.register("themeBase/plugins/before-button-pagination",a);var u={itemClass:t,main:n,loadNext:c,loadingNext:s,additionalAttributes:l};return a}(),{render:function(a,i){return e.render("themeBase/plugins/before-button-pagination",a,i)}}}),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,a,i,t,n,r){return delete a.pagination,a["button-pagination"]=function(a){i(a),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(a){var i={};i.baseItem=t.themed("themeBase/item/base"),0===a.$('[data-gimme="posts.beforePage"]').length&&t.renderThemed("themeBase/plugins/before-button-pagination",i,function(i,t){var n=e.$(t);r(n,!1),a.$el.prepend(n)}),0===a.$('[data-gimme="posts.nextPage"]').length&&t.renderThemed("themeBase/plugins/after-button-pagination",i,function(i,t){var n=e.$(t);r(n,!1),a.$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 a=e.$('[data-gimme="posts.nextPage"]');a.addClass("loading"),e.nextPage().done(function(){e.flags.buttonNextPage=!1,a.removeClass("loading"),e.checkNextPage()})},e.buttonTopPage=function(){var a=e.$('[data-gimme="posts.beforePage"]');a.addClass("loading"),e.flags.topPage=!1,e.topPage().done(function(){a.removeClass("loading"),r(a,!1),e.checkNextPage()})}})},a["button-pagination"]}),function(){var e=[].indexOf||function(e){for(var a=0,i=this.length;i>a;a++)if(a in this&&this[a]===e)return a;return-1},a=[].slice;!function(e,a){return"function"==typeof liveblog.define&&liveblog.define.amd?liveblog.define("waypoints",["jquery"],function(i){return a(i,e)}):a(e.jQuery,e)}(window,function(i,t){var n,r,o,c,s,l,u,A,m,f,p,d,g,h,b,T;return n=i(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 a=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 a.didScroll||A?void 0:(a.didScroll=!0,e=function(){return a.doScroll(),a.didScroll=!1},t.setTimeout(e,i[T].settings.scrollThrottle))}),e.bind(p,function(){var e;return a.didResize?void 0:(a.didResize=!0,e=function(){return i[T]("refresh"),a.didResize=!1},t.setTimeout(e,i[T].settings.resizeThrottle))})}return e.prototype.doScroll=function(){var e,a=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||i[T]("refresh"),i.each(e,function(e,t){var n,r,o;return o=[],r=t.newScroll>t.oldScroll,n=r?t.forward:t.backward,i.each(a.waypoints[e],function(e,a){var i,n;return t.oldScroll<(i=a.offset)&&i<=t.newScroll?o.push(a):t.newScroll<(n=a.offset)&&n<=t.oldScroll?o.push(a):void 0}),o.sort(function(e,a){return e.offset-a.offset}),r||o.reverse(),i.each(o,function(e,a){return a.options.continuous||e===o.length-1?a.trigger([n]):void 0})}),this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.refresh=function(){var e,a,t,n=this;return t=i.isWindow(this.element),a=this.$element.offset(),this.doScroll(),e={horizontal:{contextOffset:t?0:a.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:a.top,contextScroll:t?0:this.oldScroll.y,contextDimension:t?i[T]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}},i.each(e,function(e,a){return i.each(n.waypoints[e],function(e,t){var n,r,o,c,s;return n=t.options.offset,o=t.offset,r=i.isWindow(t.element)?0:t.$element.offset()[a.offsetProp],i.isFunction(n)?n=n.apply(t.element):"string"==typeof n&&(n=parseFloat(n),t.options.offset.indexOf("%")>-1&&(n=Math.ceil(a.contextDimension*n/100))),t.offset=r-a.contextOffset+a.contextScroll-n,t.options.onlyOnScroll&&null!=o||!t.enabled?void 0:null!==o&&o<(c=a.oldScroll)&&c<=t.offset?t.trigger([a.backward]):null!==o&&o>(s=a.oldScroll)&&s>=t.offset?t.trigger([a.forward]):null===o&&a.oldScroll>=t.offset?t.trigger([a.forward]):void 0})})},e.prototype.checkEmpty=function(){return i.isEmptyObject(this.waypoints.horizontal)&&i.isEmptyObject(this.waypoints.vertical)?(this.$element.unbind([p,d].join(" ")),delete u[this.id]):void 0},e}(),o=function(){function e(e,a,t){var n,r;"bottom-in-view"===t.offset&&(t.offset=function(){var e;return e=i[T]("viewportHeight"),i.isWindow(a.element)||(e=a.$element.height()),e-i(this).outerHeight()}),this.$element=e,this.element=e[0],this.axis=t.horizontal?"horizontal":"vertical",this.callback=t.handler,this.context=a,this.enabled=t.enabled,this.id="waypoints"+g++,this.offset=null,this.options=t,a.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 a,t;return(t=e[h])?(a=i.extend({},c.horizontal,c.vertical),i.map(t,function(e){return a[e]})):[]},e}(),f={init:function(e,a){var t;return a=i.extend({},i.fn[b].defaults,a),null==(t=a.handler)&&(a.handler=e),this.each(function(){var e,t,n,c;return e=i(this),n=null!=(c=a.context)?c:i.fn[b].defaults.context,i.isWindow(n)||(n=e.closest(n)),n=i(n),t=u[n[0][l]],t||(t=new r(n)),new o(e,t,a)}),i[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,a){return f._traverse.call(this,e,a,function(e,a,i){return a>0?e.push(i[a-1]):void 0})},next:function(e,a){return f._traverse.call(this,e,a,function(e,a,i){return ae.oldScroll.y})},left:function(e){return null==e&&(e=t),m._filter(e,"horizontal",function(e,a){return a.offset<=e.oldScroll.x})},right:function(e){return null==e&&(e=t),m._filter(e,"horizontal",function(e,a){return a.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,a){return f[e]=a},_invoke:function(e){var a;return a=i.extend({},c.vertical,c.horizontal),i.each(a,function(a,i){return i[e](),!0})},_filter:function(e,a,t){var n,r;return(n=u[i(e)[0][l]])?(r=[],i.each(n.waypoints[a],function(e,a){return t(n,a)?r.push(a):void 0}),r.sort(function(e,a){return e.offset-a.offset}),i.map(r,function(e){return e.element})):[]}},i[T]=function(){var e,i;return i=arguments[0],e=2<=arguments.length?a.call(arguments,1):[],m[i]?m[i].apply(null,e):m.aggregate.call(null,i)},i[T].settings={resizeThrottle:100,scrollThrottle:30},n.on("load.waypoints",function(){return i[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,a,i,t,n){return i["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){a(e)});var a=function(a){a._twitterPosts&&liveblog.require(["twitterWidgets","waypoints"],function(i){i.ready(function(){e.each(a._twitterPosts,function(e){e.$el.waypoint(function(){var a=e.model.get("Meta").id_str;i.widgets.createTweet(a,e.$el.find(".post-content-full").get(0),function(){e.$el.find(".post-core-content").remove()},{cards:"all"})},{triggerOnce:!0,offset:"120%",context:a.el})}),a._twitterPosts=[]})},function(){})}}},i["twitter-widgets"]}),liveblog.define("lib/helpers/escape-RegExp",[],function(){var e=function(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")};return e}),liveblog.define("plugins/post-hash",["plugins","lib/utils","lib/helpers/escape-RegExp"],function(e,a,i){e["post-hash"]=function(){var e,t="liveblog.item.id",n=liveblog.hashmark?liveblog.hashmark:"?";e=a.isClient?window.location.href:liveblog.locationHref||"/",a.dispatcher.on("initialize.post-view",function(a){a.permalink=function(r){var o=r&&r.hashMark?r.hashMark:n,c=!1,s=t+"="+parseFloat(a.model.get("Order"));if(-1===e.indexOf(o))c=e+o+s;else if(-1!==e.indexOf(t+"=")){var l=new RegExp(i(t)+"=[^&#]*");c=e.replace(l,s)}else c=e+"&"+s;return c}}),a.dispatcher.on("initialize.posts-view",function(a){var i=e.indexOf(t+"=");-1!==i&&(a.collection.syncParams.pagination["order.end"]=parseFloat(e.substr(i+t.length+1)),a.flags.hasTopPage=!0,a.flags.autoRender=!1)})}}),liveblog.define("lib/helpers/visibility-toggle",[],function(){var e=function(e,a){var i="";return i=void 0!==a?a?"visible":"hidden":"visible"===e.css("visibility")?"hidden":"visible",e.css("visibility",i),"visible"===i?!0:!1};return e}),liveblog.define("tmpl!themeBase/plugins/permanent-link",["dust"],function(e){return function(){function a(e){return e.write('')}return e.register("themeBase/plugins/permanent-link",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/permanent-link",a,i)}}}),liveblog.define("plugins/permanent-link",["plugins","lib/utils","dust","lib/helpers/visibility-toggle","tmpl!themeBase/item/base","tmpl!themeBase/plugins/permanent-link"],function(e,a,i,t){return a.isClient?(e.permalink=function(){a.dispatcher.on("after-render.post-view",function(e){i.renderThemed("themeBase/plugins/permanent-link",{},function(a,i){e.$('[data-gimme="post.permanent-link-placeholder"]').html(i)});var a="";e.permalink&&"function"==typeof e.permalink&&(a=e.permalink(),e.$('[data-gimme="post.share-permalink"]').val(a),e.$('[data-gimme="post.permalink"]').attr("href",a))}),a.dispatcher.on("initialize.post-view",function(e){e.clientEvents({'click [data-gimme="post.permalink"]':"permalinkAction"}),e.permalinkAction=function(e){e.preventDefault();var a=this.$('[data-gimme="post.share-permalink"]');if(t(a)){var i=this.$('[data-gimme^="post.share"][data-gimme!="post.share-permalink"]');t(i,!1),a.trigger("focus")}},e.clientEvents({'click [data-gimme="post.share-permalink"]':"permalinkInput",'focus [data-gimme="post.share-permalink"]':"permalinkInput"}),e.permalinkInput=function(a){e.$(a.target).select()},e.delegateEvents()})},e.permalink):void 0}),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 a(e,a){return e.write('').helper("i18n",a,{},{msgid:"Share"}).write("")}return e.register("themeBase/plugins/social-share-anchor",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/social-share-anchor",a,i)}}}),liveblog.define("tmpl!themeBase/plugins/social-share",["dust"],function(e){return function(){function a(e,a){return e.write('')}function i(e,a){return e.write('')}return e.register("themeBase/plugins/social-share",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/social-share",a,i)}}}),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,a,i,t,n,r,o,c,s){t.isClient&&(i["social-share"]=function(){t.dispatcher.on("after-render.post-view",function(e){n.renderThemed("themeBase/plugins/social-share-anchor",{},function(a,i){e.$('[data-gimme="post.social-share-placeholder"]').html(i)})}),t.dispatcher.on("initialize.post-view",function(e){e.clientEvents({'click [data-gimme="post.social"]':"share"}),e.share=function(e){e.preventDefault();var a=this,t=i(a);a.socialShareUrls=l(t),n.renderThemed("themeBase/plugins/social-share",u(t),function(e,i){a.$('[data-gimme="post.social-share-placeholder"]').append(i)}),A(a);var r=a.$('[data-gimme="post.share-social"]'),o=a.$('[data-gimme^="post.share"]');"hidden"===r.css("visibility")&&c(o,!1),c(r)},e.openShareWindow=function(e){e.preventDefault();var a=this.$(e.target).data("gimme"),i=s.shareWindowSize[a].h,t=s.shareWindowSize[a].w,n=this.socialShareUrls[a],r="resizable, height="+i+", width="+t,o=window.open(n,"",r);return o.focus(),!1}});var i=function(a){var i=a.parentView().parentView().model,t=o(i.get("Title")),n=o(a.$(".result-content .result-text:last").text()),c="";a.permalink&&"function"==typeof a.permalink&&(c=o(a.permalink()));var l=a.$(".result-content img:first").attr("src");l||(l=e.$("img:first").attr("src"));var u="";a.$(".result-content img").each(function(a){u+=r.sprintf(s.fbURLImageComp,[a,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 i={};return delete e.email,a.each(e,function(a,t){i[t]=r.sprintf(s.urls[t],e[t])}),i},u=function(e){var a={};return a.emailurl=r.sprintf(s.urls.email,e.email),a},A=function(e){var i={};a.each(e.socialShareUrls,function(e,a){i['click [data-gimme="'+a+'"]']="openShareWindow"}),e.clientEvents(i),e.delegateEvents()}})}),liveblog.define("plugins/wrappup-toggle",["backbone","underscore","plugins","lib/utils","dust"],function(e,a,i,t){var n={hide:"slideUp",show:"slideDown"};t.isClient&&t.dispatcher.once("initialize.posts-view",function(e){e.clientEvents({'click [data-gimme="post.wrapup"]':"wrapupToggle"}),e.wrapupToggle=function(a){var i=e.$(a.target).closest('[data-gimme="post.wrapup"]'),t=i.attr("data-wrapup-open");i.hasClass(t)?(i.removeClass(t),i.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.hide]()):(i.addClass(t),i.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.show]())}})}),liveblog.define("lib/helpers/format-commentator",["underscore","lib/gettext"],function(e,a){return function(e){return e=e.replace("commentator",""),a.sprintf(a.gettext("%(full_name)s commentator"),{full_name:e})}}),liveblog.define("lib/helpers/adjust-server-post",["underscore"],function(){return function(e){var a="infomercial";return"advertisement"===e.Type.Key&&(e.Type.Key=a),"advertisement"===e.Author.Source.Name&&(e.Author.Source.Name=a),"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,a,i){return i.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,a,i,t,n){return i.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 a=this,i=a.backdropel.data("show-status");switch(e.preventDefault(),i){case 0:t(a.popup,!0),a.backdropel.data("show-status",1),t(a.backdropel,!0),a.lbpostlist.addClass("comment-active"),a.blogview.stopPoller();break;case 1:a.backdropel.data("show-status",0).hide(),t(a.popup_message,!1),a.resetInput(),a.lbpostlist.removeClass("comment-active"),t(a.popup,!1),a.blogview.starPoller();break;case 2:t(a.popup_message,!1),a.resetInput(),a.lbpostlist.removeClass("comment-active"),t(a.popup,!1),a.blogview.starPoller()}},send:function(e){e.preventDefault();var a=this;if(this.isValid()){var i=new n,t={UserName:this.username.val(),CommentText:this.text.val()};i.setUrlRoot(this.model.get("CommentPost").href),i.save(t,{success:function(){a.showAfterMessage(e),a.resetInput()},error:function(){a.showAfterMessage(e),a.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 a(e,a){return e.write('
      ').helper("i18n",a,{},{msgid:"Your message was sent for approval"}).write("
      ")}return e.register("themeBase/plugins/user-comment-message",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/user-comment-message",a,i)}}}),liveblog.define("tmpl!themeBase/plugins/user-comment-backdrop",["dust"],function(e){return function(){function a(e){return e.write('
      ')}return e.register("themeBase/plugins/user-comment-backdrop",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/user-comment-backdrop",a,i)}}}),liveblog.define("tmpl!themeBase/plugins/user-comment-action",["dust"],function(e){return function(){function a(e,a){return e.write('").helper("i18n",a,{},{msgid:"comment"}).write("")}function i(e){return e.write(' style="display:none" ')}function t(e){return e.write(' style="display:block" ')}return e.register("themeBase/plugins/user-comment-action",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/user-comment-action",a,i)}}}),liveblog.define("tmpl!themeBase/plugins/user-comment",["dust"],function(e){return function(){function a(e,a){return e.write('
      ').helper("i18n",a,{},{msgid:"Please fill in your Nickname."}).write('
      ').helper("i18n",a,{},{msgid:"Please fill in your Comment text."}).write('
      ').helper("i18n",a,{},{msgid:"Please fill in text from image."}).write('
      ")}return e.register("themeBase/plugins/user-comment",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/user-comment",a,i)}}}),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,a,i,t,n){return e["user-comments"]=function(e){i.dispatcher.on("config-update.blog-view",function(e){n(e.$('[data-gimme="blog.comment"]'),e.model.get("EmbedConfig").UserComments)}),i.dispatcher.on("conditional-render.blog-view",function(r){if(t.renderThemed("themeBase/plugins/user-comment-action",{UserComments:r.model.get("EmbedConfig").UserComments},function(e,a){r.$('[data-gimme="blog.comment-action"]').html(a)}),n(r.$('[data-gimme="blog.comment"]'),e.UserComments),t.renderThemed("themeBase/plugins/user-comment",{},function(e,a){r.$('[data-gimme="blog.comment-box"]').html(a)}),t.renderThemed("themeBase/plugins/user-comment-message",{},function(e,a){r.$('[data-gimme="blog.comment-box-message"]').html(a)}),t.renderThemed("themeBase/plugins/user-comment-backdrop",{},function(e,a){r.$('[data-gimme="blog.comment-box-backdrop"]').html(a)}),i.isClient){new a({el:r.el,blogview:r,model:r.model})}})},e["user-comments"]}),liveblog.define("tmpl!theme/container",["dust"],function(e){return function(){function a(e,a){return a=a.shiftBlocks(o),e.partial("themeBase/container",a,null)}function i(e,a){return a=a.shiftBlocks(o),e.write('
      ').block(a.getBlock("header"),a,{block:t},null).write("
      ")}function t(e,a){return a=a.shiftBlocks(o),e.block(a.getBlock("blogMedia"),a,{block:n},null)}function n(e,a){return a=a.shiftBlocks(o),e}function r(e,a){return a=a.shiftBlocks(o),e}e.register("theme/container",a);var o={headerContainer:i,contentBottomContainer:r};return a}(),{render:function(a,i){return e.render("theme/container",a,i)}}}),liveblog.define("tmpl!theme/item/base",["dust"],function(e){return function(){function a(e,a){return a=a.shiftBlocks(s),e.partial("themeBase/item/base",a,null)}function i(e,a){return a=a.shiftBlocks(s),e}function t(e,a){return a=a.shiftBlocks(s),e.block(a.getBlock("postDateContainer"),a,{block:n},null).block(a.getBlock("userAvatar"),a,{block:r},null).block(a.getBlock("userNameContainer"),a,{block:o},null).block(a.getBlock("shareContainer"),a,{block:c},null)}function n(e,a){return a=a.shiftBlocks(s),e}function r(e,a){return a=a.shiftBlocks(s),e}function o(e,a){return a=a.shiftBlocks(s),e}function c(e,a){return a=a.shiftBlocks(s),e}e.register("theme/item/base",a);var s={headerContainer:i,contentSide:t};return a}(),{render:function(a,i){return e.render("theme/item/base",a,i)}}}),liveblog.define("themeFile",["css!theme/liveblog","plugins/button-pagination","plugins/twitter-widgets","plugins/post-hash","plugins/permanent-link","plugins/social-share","plugins/wrappup-toggle","plugins/user-comments","tmpl!theme/container","tmpl!theme/item/base"],function(){return{plugins:["button-pagination","twitter-widgets","post-hash","permanent-link","social-share","wrappup-toggle","user-comments"]}}); \ No newline at end of file +liveblog.define("plugins",{}),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.length96?e-87:e>64?e-29:e-48}function a(e){var a,t=0,n=e.split("."),r=n[0],o=n[1]||"",s=1,c=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').helper("i18n",i,{},{msgid:"Load more posts ..."}).write("")}function c(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:s,loadingNext:c,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 s(e,i){return i=i.shiftBlocks(u),e.write('Load top posts')}function c(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:s,loadingNext:c,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!themeBase/plugins/pending-items-message",["dust"],function(e){return function(){function i(e){return e.write('')}return e.register("themeBase/plugins/pending-items-message",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/pending-items-message",i,a)}}}),liveblog.define("plugins/pending-messages",["lib/gettext","plugins","lib/utils","dust","tmpl!themeBase/item/base","tmpl!themeBase/plugins/pending-items-message"],function(e,i,a,t){return i.pendingMessages=function(){var i={};a.dispatcher.once("initialize.blog-view",function(e){i=e}),a.dispatcher.once("after-render.blog-view",function(e){t.renderThemed("themeBase/plugins/pending-items-message",{},function(i,a){e.$('[data-gimme="posts.pending-message-placeholder"]').html(a)})}),a.isClient&&(a.dispatcher.once("initialize.posts-view",function(e){e.pauseAutoRender=function(){this.flags.autoRender=!1},e.resumeAutoRender=function(){this.flags.autoRender=!0},i.$el.on("click",'[data-gimme="posts.pending-message"],[data-gimme="posts.pending-message-holder"]',function(){e.renderPending()})}),a.dispatcher.on("update-pending.posts-view",function(a){var t="",n=a.pendingCounter;n>0&&(t=e.sprintf(e.ngettext("one new post","%(count)s new posts",n),{count:n})),i.$('[data-gimme="posts.pending-message"]').html(t).toggle(n>0),i.$('[data-gimme="posts.pending-message-holder"]').toggle(n>0)}))},i.pendingMessages}),liveblog.define("config/scroll-pagination-plugin",{scrollHeight:500,nextPageTriggerOffset:-200}),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,s,c,l,u,A,m,p,f,d,g,h,b,T;return n=a(t),A=e.call(t,"ontouchstart")>=0,s={horizontal:{},vertical:{}},c=1,u={},l="waypoints-context-id",f="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"+c++,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(f,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,s,c;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<(s=i.oldScroll)&&s<=t.offset?t.trigger([i.backward]):null!==o&&o>(c=i.oldScroll)&&c>=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([f,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,s[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 s[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({},s.horizontal,s.vertical),a.map(t,function(e){return i[e]})):[]},e}(),p={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,s;return e=a(this),n=null!=(s=i.context)?s: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 p._invoke.call(this,"disable")},enable:function(){return p._invoke.call(this,"enable")},destroy:function(){return p._invoke.call(this,"destroy")},prev:function(e,i){return p._traverse.call(this,e,i,function(e,i,a){return i>0?e.push(a[i-1]):void 0})},next:function(e,i){return p._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 p[e]=i},_invoke:function(e){var i;return i=a.extend({},s.vertical,s.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.define("plugins/scroll-pagination",["plugins","plugins/button-pagination","plugins/pending-messages","config/scroll-pagination-plugin","lib/utils"],function(e,i,a,t,n){return delete e["button-pagination"],delete e["pending-messages"],e["scroll-pagination"]=function(e){i(e),a(e),n.dispatcher.once("add-all.posts-view",function(e){e.$el.css("overflow-y","auto").css("overflow-x","auto").css("height",t.scrollHeight+"px")}),n.isClient&&(n.dispatcher.on("initialize.blog-view",function(e){r(e)}),n.dispatcher.on("pagination-next-updated.posts-view",function(e){e.hasNextPage()&&o(e,e.$('[data-gimme="posts.nextPage"]'))}),n.dispatcher.once("pagination-next-updated.posts-view",function(e){s(e)}));var r=function(e){e.clientEvents({'click [data-gimme="posts.to-top"]':"toTop",'click [data-gimme="posts.pending-message"]':"toTop"}),e.toTop=function(e){e.preventDefault(),this.$('[data-gimme="posts.list"]').scrollTop(0)}},o=function(e,i){liveblog.require(["waypoints"],function(){i.waypoint(function(){e.buttonNextPage()},{continuous:!1,triggerOnce:!0,offset:"100%",context:e.el})})},s=function(e){var i=e.$('[data-gimme="posts.beforePage"]');liveblog.require(["waypoints"],function(){i.waypoint(function(a){"down"===a&&(e.pauseAutoRender(),i.waypoint("destroy"),c(e))},{continuous:!1,offset:t.nextPageTriggerOffset,context:e.el})})},c=function(e){var i=e.firstPost().$el;liveblog.require(["waypoints"],function(){i.waypoint(function(a){"up"===a&&(e.renderPending(),e.resumeAutoRender(),i.waypoint("destroy"),s(e))},{continuous:!1,offset:-1,context:e.el})})}},e["scroll-pagination"]}),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/escape-RegExp",[],function(){var e=function(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")};return e}),liveblog.define("plugins/post-hash",["plugins","lib/utils","lib/helpers/escape-RegExp"],function(e,i,a){e["post-hash"]=function(){var e,t="liveblog.item.id",n=liveblog.hashmark?liveblog.hashmark:"?";e=i.isClient?window.location.href:liveblog.locationHref||"/",i.dispatcher.on("initialize.post-view",function(i){i.permalink=function(r){var o=r&&r.hashMark?r.hashMark:n,s=!1,c=t+"="+parseFloat(i.model.get("Order"));if(-1===e.indexOf(o))s=e+o+c;else if(-1!==e.indexOf(t+"=")){var l=new RegExp(a(t)+"=[^&#]*");s=e.replace(l,c)}else s=e+"&"+c;return s}}),i.dispatcher.on("initialize.posts-view",function(i){var a=e.indexOf(t+"=");-1!==a&&(i.collection.syncParams.pagination["order.end"]=parseFloat(e.substr(a+t.length+1)),i.flags.hasTopPage=!0,i.flags.autoRender=!1)})}}),liveblog.define("lib/helpers/visibility-toggle",[],function(){var e=function(e,i){var a="";return a=void 0!==i?i?"visible":"hidden":"visible"===e.css("visibility")?"hidden":"visible",e.css("visibility",a),"visible"===a?!0:!1};return e}),liveblog.define("tmpl!themeBase/plugins/permanent-link",["dust"],function(e){return function(){function i(e){return e.write('')}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/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,s,c){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")&&s(o,!1),s(r)},e.openShareWindow=function(e){e.preventDefault();var i=this.$(e.target).data("gimme"),a=c.shareWindowSize[i].h,t=c.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()),s="";i.permalink&&"function"==typeof i.permalink&&(s=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(c.fbURLImageComp,[i,e.$(this).attr("src")])});var A={pin:[s,l,t],twt:[r.gettext("Now reading"),t,s],lin:[s,t,n],ggl:[s],email:[r.gettext("Check out this Live Blog"),s],fb:[t,n,s,u]};return A},l=function(e){var a={};return delete e.email,i.each(e,function(i,t){a[t]=r.sprintf(c.urls[t],e[t])}),a},u=function(e){var i={};return i.emailurl=r.sprintf(c.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/wrappup-toggle",["backbone","underscore","plugins","lib/utils","dust"],function(e,i,a,t){var n={hide:"slideUp",show:"slideDown"};t.isClient&&t.dispatcher.once("initialize.posts-view",function(e){e.clientEvents({'click [data-gimme="post.wrapup"]':"wrapupToggle"}),e.wrapupToggle=function(i){var a=e.$(i.target).closest('[data-gimme="post.wrapup"]'),t=a.attr("data-wrapup-open");a.hasClass(t)?(a.removeClass(t),a.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.hide]()):(a.addClass(t),a.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.show]())}})}),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"]}),liveblog.define("plugins/status",["backbone","plugins","lib/utils","lib/gettext","moment"],function(e,i,a,t,n){return a.isClient?(i.status=function(){a.dispatcher.on("initialize.blog-view",function(e){a.dispatcher.on("after-poller.blog-model conditional-render.blog-view",function(){var i=t.sprintf('',n().milliseconds(),n().format(t.pgettext("moment","status-time")));e.$('[data-gimme="blog.status"]').html(t.sprintf(t.gettext("updated at %s"),i))}),a.dispatcher.on("before-poller.blog-model",function(){e.$('[data-gimme="blog.status"]').html(t.gettext("updating..."))})})},i.status):void 0}),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("blogMedia"),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(c),e.partial("themeBase/item/base",i,null)}function a(e,i){return i=i.shiftBlocks(c),e}function t(e,i){return i=i.shiftBlocks(c),e.block(i.getBlock("postDateContainer"),i,{block:n},null).block(i.getBlock("userAvatar"),i,{block:r},null).block(i.getBlock("userNameContainer"),i,{block:o},null).block(i.getBlock("shareContainer"),i,{block:s},null)}function n(e,i){return i=i.shiftBlocks(c),e}function r(e,i){return i=i.shiftBlocks(c),e}function o(e,i){return i=i.shiftBlocks(c),e}function s(e,i){return i=i.shiftBlocks(c),e +}e.register("theme/item/base",i);var c={headerContainer:a,contentSide:t};return i}(),{render:function(i,a){return e.render("theme/item/base",i,a)}}}),liveblog.define("themeFile",["css!theme/liveblog","plugins/scroll-pagination","plugins/twitter-widgets","plugins/post-hash","plugins/permanent-link","plugins/social-share","plugins/wrappup-toggle","plugins/user-comments","plugins/status","tmpl!theme/container","tmpl!theme/item/base"],function(){return{plugins:["scroll-pagination","twitter-widgets","post-hash","permanent-link","social-share","wrappup-toggle","user-comments","status"]}}); \ No newline at end of file diff --git a/gui-resources/scripts/js/build/themes/ksml/desktop.js b/gui-resources/scripts/js/build/themes/ksml/desktop.js index e4cce6438..b372b2e9d 100644 --- a/gui-resources/scripts/js/build/themes/ksml/desktop.js +++ b/gui-resources/scripts/js/build/themes/ksml/desktop.js @@ -1,2 +1,3 @@ -liveblog.define("plugins",{}),liveblog.define("plugins/pagination",["plugins","lib/utils"],function(e,a){return e.pagination=function(){a.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()){a.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,a.dispatcher.trigger("loaded.posts-view",e)})}},e.hasNextPage=function(){return this.collection.length96?e-87:e>64?e-29:e-48}function i(e){var i,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;ti;i++)e[i]=Math.round((e[i-1]||0)+6e4*e[i]);e[a-1]=1/0}function r(e,a){var i,t=[];for(i=0;i').helper("i18n",a,{},{msgid:"Load more posts ..."}).write("")}function s(e,a){return a=a.shiftBlocks(u),e.write('')}function l(e,a){return a=a.shiftBlocks(u),e.write('data-gimme="posts.nextPage"')}e.register("themeBase/plugins/after-button-pagination",a); -var u={itemClass:t,main:n,loadNext:c,loadingNext:s,additionalAttributes:l};return a}(),{render:function(a,i){return e.render("themeBase/plugins/after-button-pagination",a,i)}}}),liveblog.define("tmpl!themeBase/plugins/before-button-pagination",["dust"],function(e){return function(){function a(e,a){return a=a.shiftBlocks(u),e.partial(i,a,null)}function i(e,a){return a=a.shiftBlocks(u),e.reference(a.get(["baseItem"],!1),a,"h")}function t(e,a){return a=a.shiftBlocks(u),e.write("load-next")}function n(e,a){return a=a.shiftBlocks(u),e.block(a.getBlock("loadNext"),a,{block:r},null).block(a.getBlock("loadingNext"),a,{block:o},null)}function r(e,a){return a=a.shiftBlocks(u),e}function o(e,a){return a=a.shiftBlocks(u),e}function c(e,a){return a=a.shiftBlocks(u),e.write('Load top posts')}function s(e,a){return a=a.shiftBlocks(u),e.write('')}function l(e,a){return a=a.shiftBlocks(u),e.write('data-gimme="posts.beforePage"')}e.register("themeBase/plugins/before-button-pagination",a);var u={itemClass:t,main:n,loadNext:c,loadingNext:s,additionalAttributes:l};return a}(),{render:function(a,i){return e.render("themeBase/plugins/before-button-pagination",a,i)}}}),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,a,i,t,n,r){return delete a.pagination,a["button-pagination"]=function(a){i(a),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(a){var i={};i.baseItem=t.themed("themeBase/item/base"),0===a.$('[data-gimme="posts.beforePage"]').length&&t.renderThemed("themeBase/plugins/before-button-pagination",i,function(i,t){var n=e.$(t);r(n,!1),a.$el.prepend(n)}),0===a.$('[data-gimme="posts.nextPage"]').length&&t.renderThemed("themeBase/plugins/after-button-pagination",i,function(i,t){var n=e.$(t);r(n,!1),a.$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 a=e.$('[data-gimme="posts.nextPage"]');a.addClass("loading"),e.nextPage().done(function(){e.flags.buttonNextPage=!1,a.removeClass("loading"),e.checkNextPage()})},e.buttonTopPage=function(){var a=e.$('[data-gimme="posts.beforePage"]');a.addClass("loading"),e.flags.topPage=!1,e.topPage().done(function(){a.removeClass("loading"),r(a,!1),e.checkNextPage()})}})},a["button-pagination"]}),function(){var e=[].indexOf||function(e){for(var a=0,i=this.length;i>a;a++)if(a in this&&this[a]===e)return a;return-1},a=[].slice;!function(e,a){return"function"==typeof liveblog.define&&liveblog.define.amd?liveblog.define("waypoints",["jquery"],function(i){return a(i,e)}):a(e.jQuery,e)}(window,function(i,t){var n,r,o,c,s,l,u,A,m,p,f,d,g,h,b,T;return n=i(t),A=e.call(t,"ontouchstart")>=0,c={horizontal:{},vertical:{}},s=1,u={},l="waypoints-context-id",f="resize.waypoints",d="scroll.waypoints",g=1,h="waypoints-waypoint-ids",b="waypoint",T="waypoints",r=function(){function e(e){var a=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 a.didScroll||A?void 0:(a.didScroll=!0,e=function(){return a.doScroll(),a.didScroll=!1},t.setTimeout(e,i[T].settings.scrollThrottle))}),e.bind(f,function(){var e;return a.didResize?void 0:(a.didResize=!0,e=function(){return i[T]("refresh"),a.didResize=!1},t.setTimeout(e,i[T].settings.resizeThrottle))})}return e.prototype.doScroll=function(){var e,a=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||i[T]("refresh"),i.each(e,function(e,t){var n,r,o;return o=[],r=t.newScroll>t.oldScroll,n=r?t.forward:t.backward,i.each(a.waypoints[e],function(e,a){var i,n;return t.oldScroll<(i=a.offset)&&i<=t.newScroll?o.push(a):t.newScroll<(n=a.offset)&&n<=t.oldScroll?o.push(a):void 0}),o.sort(function(e,a){return e.offset-a.offset}),r||o.reverse(),i.each(o,function(e,a){return a.options.continuous||e===o.length-1?a.trigger([n]):void 0})}),this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.refresh=function(){var e,a,t,n=this;return t=i.isWindow(this.element),a=this.$element.offset(),this.doScroll(),e={horizontal:{contextOffset:t?0:a.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:a.top,contextScroll:t?0:this.oldScroll.y,contextDimension:t?i[T]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}},i.each(e,function(e,a){return i.each(n.waypoints[e],function(e,t){var n,r,o,c,s;return n=t.options.offset,o=t.offset,r=i.isWindow(t.element)?0:t.$element.offset()[a.offsetProp],i.isFunction(n)?n=n.apply(t.element):"string"==typeof n&&(n=parseFloat(n),t.options.offset.indexOf("%")>-1&&(n=Math.ceil(a.contextDimension*n/100))),t.offset=r-a.contextOffset+a.contextScroll-n,t.options.onlyOnScroll&&null!=o||!t.enabled?void 0:null!==o&&o<(c=a.oldScroll)&&c<=t.offset?t.trigger([a.backward]):null!==o&&o>(s=a.oldScroll)&&s>=t.offset?t.trigger([a.forward]):null===o&&a.oldScroll>=t.offset?t.trigger([a.forward]):void 0})})},e.prototype.checkEmpty=function(){return i.isEmptyObject(this.waypoints.horizontal)&&i.isEmptyObject(this.waypoints.vertical)?(this.$element.unbind([f,d].join(" ")),delete u[this.id]):void 0},e}(),o=function(){function e(e,a,t){var n,r;"bottom-in-view"===t.offset&&(t.offset=function(){var e;return e=i[T]("viewportHeight"),i.isWindow(a.element)||(e=a.$element.height()),e-i(this).outerHeight()}),this.$element=e,this.element=e[0],this.axis=t.horizontal?"horizontal":"vertical",this.callback=t.handler,this.context=a,this.enabled=t.enabled,this.id="waypoints"+g++,this.offset=null,this.options=t,a.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 a,t;return(t=e[h])?(a=i.extend({},c.horizontal,c.vertical),i.map(t,function(e){return a[e]})):[]},e}(),p={init:function(e,a){var t;return a=i.extend({},i.fn[b].defaults,a),null==(t=a.handler)&&(a.handler=e),this.each(function(){var e,t,n,c;return e=i(this),n=null!=(c=a.context)?c:i.fn[b].defaults.context,i.isWindow(n)||(n=e.closest(n)),n=i(n),t=u[n[0][l]],t||(t=new r(n)),new o(e,t,a)}),i[T]("refresh"),this},disable:function(){return p._invoke.call(this,"disable")},enable:function(){return p._invoke.call(this,"enable")},destroy:function(){return p._invoke.call(this,"destroy")},prev:function(e,a){return p._traverse.call(this,e,a,function(e,a,i){return a>0?e.push(i[a-1]):void 0})},next:function(e,a){return p._traverse.call(this,e,a,function(e,a,i){return ae.oldScroll.y})},left:function(e){return null==e&&(e=t),m._filter(e,"horizontal",function(e,a){return a.offset<=e.oldScroll.x})},right:function(e){return null==e&&(e=t),m._filter(e,"horizontal",function(e,a){return a.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,a){return p[e]=a},_invoke:function(e){var a;return a=i.extend({},c.vertical,c.horizontal),i.each(a,function(a,i){return i[e](),!0})},_filter:function(e,a,t){var n,r;return(n=u[i(e)[0][l]])?(r=[],i.each(n.waypoints[a],function(e,a){return t(n,a)?r.push(a):void 0}),r.sort(function(e,a){return e.offset-a.offset}),i.map(r,function(e){return e.element})):[]}},i[T]=function(){var e,i;return i=arguments[0],e=2<=arguments.length?a.call(arguments,1):[],m[i]?m[i].apply(null,e):m.aggregate.call(null,i)},i[T].settings={resizeThrottle:100,scrollThrottle:30},n.on("load.waypoints",function(){return i[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,a,i,t,n){return i["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){a(e)});var a=function(a){a._twitterPosts&&liveblog.require(["twitterWidgets","waypoints"],function(i){i.ready(function(){e.each(a._twitterPosts,function(e){e.$el.waypoint(function(){var a=e.model.get("Meta").id_str;i.widgets.createTweet(a,e.$el.find(".post-content-full").get(0),function(){e.$el.find(".post-core-content").remove()},{cards:"all"})},{triggerOnce:!0,offset:"120%",context:a.el})}),a._twitterPosts=[]})},function(){})}}},i["twitter-widgets"]}),liveblog.define("lib/helpers/escape-RegExp",[],function(){var e=function(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")};return e}),liveblog.define("plugins/post-hash",["plugins","lib/utils","lib/helpers/escape-RegExp"],function(e,a,i){e["post-hash"]=function(){var e,t="liveblog.item.id",n=liveblog.hashmark?liveblog.hashmark:"?";e=a.isClient?window.location.href:liveblog.locationHref||"/",a.dispatcher.on("initialize.post-view",function(a){a.permalink=function(r){var o=r&&r.hashMark?r.hashMark:n,c=!1,s=t+"="+parseFloat(a.model.get("Order"));if(-1===e.indexOf(o))c=e+o+s;else if(-1!==e.indexOf(t+"=")){var l=new RegExp(i(t)+"=[^&#]*");c=e.replace(l,s)}else c=e+"&"+s;return c}}),a.dispatcher.on("initialize.posts-view",function(a){var i=e.indexOf(t+"=");-1!==i&&(a.collection.syncParams.pagination["order.end"]=parseFloat(e.substr(i+t.length+1)),a.flags.hasTopPage=!0,a.flags.autoRender=!1)})}}),liveblog.define("lib/helpers/visibility-toggle",[],function(){var e=function(e,a){var i="";return i=void 0!==a?a?"visible":"hidden":"visible"===e.css("visibility")?"hidden":"visible",e.css("visibility",i),"visible"===i?!0:!1};return e}),liveblog.define("tmpl!themeBase/plugins/permanent-link",["dust"],function(e){return function(){function a(e){return e.write('')}return e.register("themeBase/plugins/permanent-link",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/permanent-link",a,i)}}}),liveblog.define("plugins/permanent-link",["plugins","lib/utils","dust","lib/helpers/visibility-toggle","tmpl!themeBase/item/base","tmpl!themeBase/plugins/permanent-link"],function(e,a,i,t){return a.isClient?(e.permalink=function(){a.dispatcher.on("after-render.post-view",function(e){i.renderThemed("themeBase/plugins/permanent-link",{},function(a,i){e.$('[data-gimme="post.permanent-link-placeholder"]').html(i)});var a="";e.permalink&&"function"==typeof e.permalink&&(a=e.permalink(),e.$('[data-gimme="post.share-permalink"]').val(a),e.$('[data-gimme="post.permalink"]').attr("href",a))}),a.dispatcher.on("initialize.post-view",function(e){e.clientEvents({'click [data-gimme="post.permalink"]':"permalinkAction"}),e.permalinkAction=function(e){e.preventDefault();var a=this.$('[data-gimme="post.share-permalink"]');if(t(a)){var i=this.$('[data-gimme^="post.share"][data-gimme!="post.share-permalink"]');t(i,!1),a.trigger("focus")}},e.clientEvents({'click [data-gimme="post.share-permalink"]':"permalinkInput",'focus [data-gimme="post.share-permalink"]':"permalinkInput"}),e.permalinkInput=function(a){e.$(a.target).select()},e.delegateEvents()})},e.permalink):void 0}),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 a(e,a){return e.write('').helper("i18n",a,{},{msgid:"Share"}).write("")}return e.register("themeBase/plugins/social-share-anchor",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/social-share-anchor",a,i)}}}),liveblog.define("tmpl!themeBase/plugins/social-share",["dust"],function(e){return function(){function a(e,a){return e.write('')}function i(e,a){return e.write('')}return e.register("themeBase/plugins/social-share",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/social-share",a,i)}}}),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,a,i,t,n,r,o,c,s){t.isClient&&(i["social-share"]=function(){t.dispatcher.on("after-render.post-view",function(e){n.renderThemed("themeBase/plugins/social-share-anchor",{},function(a,i){e.$('[data-gimme="post.social-share-placeholder"]').html(i)})}),t.dispatcher.on("initialize.post-view",function(e){e.clientEvents({'click [data-gimme="post.social"]':"share"}),e.share=function(e){e.preventDefault();var a=this,t=i(a);a.socialShareUrls=l(t),n.renderThemed("themeBase/plugins/social-share",u(t),function(e,i){a.$('[data-gimme="post.social-share-placeholder"]').append(i)}),A(a);var r=a.$('[data-gimme="post.share-social"]'),o=a.$('[data-gimme^="post.share"]');"hidden"===r.css("visibility")&&c(o,!1),c(r)},e.openShareWindow=function(e){e.preventDefault();var a=this.$(e.target).data("gimme"),i=s.shareWindowSize[a].h,t=s.shareWindowSize[a].w,n=this.socialShareUrls[a],r="resizable, height="+i+", width="+t,o=window.open(n,"",r);return o.focus(),!1}});var i=function(a){var i=a.parentView().parentView().model,t=o(i.get("Title")),n=o(a.$(".result-content .result-text:last").text()),c="";a.permalink&&"function"==typeof a.permalink&&(c=o(a.permalink()));var l=a.$(".result-content img:first").attr("src");l||(l=e.$("img:first").attr("src"));var u="";a.$(".result-content img").each(function(a){u+=r.sprintf(s.fbURLImageComp,[a,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 i={};return delete e.email,a.each(e,function(a,t){i[t]=r.sprintf(s.urls[t],e[t])}),i},u=function(e){var a={};return a.emailurl=r.sprintf(s.urls.email,e.email),a},A=function(e){var i={};a.each(e.socialShareUrls,function(e,a){i['click [data-gimme="'+a+'"]']="openShareWindow"}),e.clientEvents(i),e.delegateEvents()}})}),liveblog.define("plugins/wrappup-toggle",["backbone","underscore","plugins","lib/utils","dust"],function(e,a,i,t){var n={hide:"slideUp",show:"slideDown"};t.isClient&&t.dispatcher.once("initialize.posts-view",function(e){e.clientEvents({'click [data-gimme="post.wrapup"]':"wrapupToggle"}),e.wrapupToggle=function(a){var i=e.$(a.target).closest('[data-gimme="post.wrapup"]'),t=i.attr("data-wrapup-open");i.hasClass(t)?(i.removeClass(t),i.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.hide]()):(i.addClass(t),i.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.show]())}})}),liveblog.define("lib/helpers/format-commentator",["underscore","lib/gettext"],function(e,a){return function(e){return e=e.replace("commentator",""),a.sprintf(a.gettext("%(full_name)s commentator"),{full_name:e})}}),liveblog.define("lib/helpers/adjust-server-post",["underscore"],function(){return function(e){var a="infomercial";return"advertisement"===e.Type.Key&&(e.Type.Key=a),"advertisement"===e.Author.Source.Name&&(e.Author.Source.Name=a),"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,a,i){return i.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,a,i,t,n){return i.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 a=this,i=a.backdropel.data("show-status");switch(e.preventDefault(),i){case 0:t(a.popup,!0),a.backdropel.data("show-status",1),t(a.backdropel,!0),a.lbpostlist.addClass("comment-active"),a.blogview.stopPoller();break;case 1:a.backdropel.data("show-status",0).hide(),t(a.popup_message,!1),a.resetInput(),a.lbpostlist.removeClass("comment-active"),t(a.popup,!1),a.blogview.starPoller();break;case 2:t(a.popup_message,!1),a.resetInput(),a.lbpostlist.removeClass("comment-active"),t(a.popup,!1),a.blogview.starPoller()}},send:function(e){e.preventDefault();var a=this;if(this.isValid()){var i=new n,t={UserName:this.username.val(),CommentText:this.text.val()};i.setUrlRoot(this.model.get("CommentPost").href),i.save(t,{success:function(){a.showAfterMessage(e),a.resetInput()},error:function(){a.showAfterMessage(e),a.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 a(e,a){return e.write('
      ').helper("i18n",a,{},{msgid:"Your message was sent for approval"}).write("
      ")}return e.register("themeBase/plugins/user-comment-message",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/user-comment-message",a,i)}}}),liveblog.define("tmpl!themeBase/plugins/user-comment-backdrop",["dust"],function(e){return function(){function a(e){return e.write('
      ')}return e.register("themeBase/plugins/user-comment-backdrop",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/user-comment-backdrop",a,i)}}}),liveblog.define("tmpl!themeBase/plugins/user-comment-action",["dust"],function(e){return function(){function a(e,a){return e.write('").helper("i18n",a,{},{msgid:"comment"}).write("")}function i(e){return e.write(' style="display:none" ')}function t(e){return e.write(' style="display:block" ')}return e.register("themeBase/plugins/user-comment-action",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/user-comment-action",a,i)}}}),liveblog.define("tmpl!themeBase/plugins/user-comment",["dust"],function(e){return function(){function a(e,a){return e.write('
      ').helper("i18n",a,{},{msgid:"Please fill in your Nickname."}).write('
      ').helper("i18n",a,{},{msgid:"Please fill in your Comment text."}).write('
      ').helper("i18n",a,{},{msgid:"Please fill in text from image."}).write('
      ")}return e.register("themeBase/plugins/user-comment",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/user-comment",a,i)}}}),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,a,i,t,n){return e["user-comments"]=function(e){i.dispatcher.on("config-update.blog-view",function(e){n(e.$('[data-gimme="blog.comment"]'),e.model.get("EmbedConfig").UserComments)}),i.dispatcher.on("conditional-render.blog-view",function(r){if(t.renderThemed("themeBase/plugins/user-comment-action",{UserComments:r.model.get("EmbedConfig").UserComments},function(e,a){r.$('[data-gimme="blog.comment-action"]').html(a)}),n(r.$('[data-gimme="blog.comment"]'),e.UserComments),t.renderThemed("themeBase/plugins/user-comment",{},function(e,a){r.$('[data-gimme="blog.comment-box"]').html(a)}),t.renderThemed("themeBase/plugins/user-comment-message",{},function(e,a){r.$('[data-gimme="blog.comment-box-message"]').html(a)}),t.renderThemed("themeBase/plugins/user-comment-backdrop",{},function(e,a){r.$('[data-gimme="blog.comment-box-backdrop"]').html(a)}),i.isClient){new a({el:r.el,blogview:r,model:r.model})}})},e["user-comments"]}),liveblog.define("tmpl!theme/container",["dust"],function(e){return function(){function a(e,a){return a=a.shiftBlocks(t),e.partial("themeBase/container",a,null)}function i(e,a){return a=a.shiftBlocks(t),e}e.register("theme/container",a);var t={contentBottomContainer:i};return a}(),{render:function(a,i){return e.render("theme/container",a,i)}}}),liveblog.define("tmpl!theme/item/base",["dust"],function(e){return function(){function a(e,a){return a=a.shiftBlocks(s),e.partial("themeBase/item/base",a,null)}function i(e,a){return a=a.shiftBlocks(s),e}function t(e,a){return a=a.shiftBlocks(s),e.block(a.getBlock("postDateContainer"),a,{block:n},null).block(a.getBlock("userAvatar"),a,{block:r},null).block(a.getBlock("userNameContainer"),a,{block:o},null).block(a.getBlock("shareContainer"),a,{block:c},null)}function n(e,a){return a=a.shiftBlocks(s),e}function r(e,a){return a=a.shiftBlocks(s),e}function o(e,a){return a=a.shiftBlocks(s),e}function c(e,a){return a=a.shiftBlocks(s),e}e.register("theme/item/base",a);var s={headerContainer:i,contentSide:t};return a}(),{render:function(a,i){return e.render("theme/item/base",a,i)}}}),liveblog.define("themeFile",["css!theme/liveblog","plugins/button-pagination","plugins/twitter-widgets","plugins/post-hash","plugins/permanent-link","plugins/social-share","plugins/wrappup-toggle","plugins/user-comments","tmpl!theme/container","tmpl!theme/item/base"],function(){return{plugins:["button-pagination","twitter-widgets","post-hash","permanent-link","social-share","wrappup-toggle","user-comments"]}}); \ No newline at end of file +liveblog.define("plugins",{}),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.length96?e-87:e>64?e-29:e-48}function a(e){var a,t=0,n=e.split("."),r=n[0],o=n[1]||"",s=1,c=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').helper("i18n",i,{},{msgid:"Load more posts ..."}).write("")}function c(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:s,loadingNext:c,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 s(e,i){return i=i.shiftBlocks(u),e.write('Load top posts')}function c(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:s,loadingNext:c,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!themeBase/plugins/pending-items-message",["dust"],function(e){return function(){function i(e){return e.write('')}return e.register("themeBase/plugins/pending-items-message",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/pending-items-message",i,a)}}}),liveblog.define("plugins/pending-messages",["lib/gettext","plugins","lib/utils","dust","tmpl!themeBase/item/base","tmpl!themeBase/plugins/pending-items-message"],function(e,i,a,t){return i.pendingMessages=function(){var i={};a.dispatcher.once("initialize.blog-view",function(e){i=e}),a.dispatcher.once("after-render.blog-view",function(e){t.renderThemed("themeBase/plugins/pending-items-message",{},function(i,a){e.$('[data-gimme="posts.pending-message-placeholder"]').html(a)})}),a.isClient&&(a.dispatcher.once("initialize.posts-view",function(e){e.pauseAutoRender=function(){this.flags.autoRender=!1},e.resumeAutoRender=function(){this.flags.autoRender=!0},i.$el.on("click",'[data-gimme="posts.pending-message"],[data-gimme="posts.pending-message-holder"]',function(){e.renderPending()})}),a.dispatcher.on("update-pending.posts-view",function(a){var t="",n=a.pendingCounter;n>0&&(t=e.sprintf(e.ngettext("one new post","%(count)s new posts",n),{count:n})),i.$('[data-gimme="posts.pending-message"]').html(t).toggle(n>0),i.$('[data-gimme="posts.pending-message-holder"]').toggle(n>0)}))},i.pendingMessages}),liveblog.define("config/scroll-pagination-plugin",{scrollHeight:500,nextPageTriggerOffset:-200}),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,s,c,l,u,A,m,p,f,d,g,h,b,T;return n=a(t),A=e.call(t,"ontouchstart")>=0,s={horizontal:{},vertical:{}},c=1,u={},l="waypoints-context-id",f="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"+c++,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(f,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,s,c;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<(s=i.oldScroll)&&s<=t.offset?t.trigger([i.backward]):null!==o&&o>(c=i.oldScroll)&&c>=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([f,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,s[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 s[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({},s.horizontal,s.vertical),a.map(t,function(e){return i[e]})):[]},e}(),p={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,s;return e=a(this),n=null!=(s=i.context)?s: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 p._invoke.call(this,"disable")},enable:function(){return p._invoke.call(this,"enable")},destroy:function(){return p._invoke.call(this,"destroy")},prev:function(e,i){return p._traverse.call(this,e,i,function(e,i,a){return i>0?e.push(a[i-1]):void 0})},next:function(e,i){return p._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 p[e]=i},_invoke:function(e){var i;return i=a.extend({},s.vertical,s.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.define("plugins/scroll-pagination",["plugins","plugins/button-pagination","plugins/pending-messages","config/scroll-pagination-plugin","lib/utils"],function(e,i,a,t,n){return delete e["button-pagination"],delete e["pending-messages"],e["scroll-pagination"]=function(e){i(e),a(e),n.dispatcher.once("add-all.posts-view",function(e){e.$el.css("overflow-y","auto").css("overflow-x","auto").css("height",t.scrollHeight+"px")}),n.isClient&&(n.dispatcher.on("initialize.blog-view",function(e){r(e)}),n.dispatcher.on("pagination-next-updated.posts-view",function(e){e.hasNextPage()&&o(e,e.$('[data-gimme="posts.nextPage"]'))}),n.dispatcher.once("pagination-next-updated.posts-view",function(e){s(e)}));var r=function(e){e.clientEvents({'click [data-gimme="posts.to-top"]':"toTop",'click [data-gimme="posts.pending-message"]':"toTop"}),e.toTop=function(e){e.preventDefault(),this.$('[data-gimme="posts.list"]').scrollTop(0)}},o=function(e,i){liveblog.require(["waypoints"],function(){i.waypoint(function(){e.buttonNextPage()},{continuous:!1,triggerOnce:!0,offset:"100%",context:e.el})})},s=function(e){var i=e.$('[data-gimme="posts.beforePage"]');liveblog.require(["waypoints"],function(){i.waypoint(function(a){"down"===a&&(e.pauseAutoRender(),i.waypoint("destroy"),c(e))},{continuous:!1,offset:t.nextPageTriggerOffset,context:e.el})})},c=function(e){var i=e.firstPost().$el;liveblog.require(["waypoints"],function(){i.waypoint(function(a){"up"===a&&(e.renderPending(),e.resumeAutoRender(),i.waypoint("destroy"),s(e))},{continuous:!1,offset:-1,context:e.el})})}},e["scroll-pagination"]}),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/escape-RegExp",[],function(){var e=function(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")};return e}),liveblog.define("plugins/post-hash",["plugins","lib/utils","lib/helpers/escape-RegExp"],function(e,i,a){e["post-hash"]=function(){var e,t="liveblog.item.id",n=liveblog.hashmark?liveblog.hashmark:"?";e=i.isClient?window.location.href:liveblog.locationHref||"/",i.dispatcher.on("initialize.post-view",function(i){i.permalink=function(r){var o=r&&r.hashMark?r.hashMark:n,s=!1,c=t+"="+parseFloat(i.model.get("Order"));if(-1===e.indexOf(o))s=e+o+c;else if(-1!==e.indexOf(t+"=")){var l=new RegExp(a(t)+"=[^&#]*");s=e.replace(l,c)}else s=e+"&"+c;return s}}),i.dispatcher.on("initialize.posts-view",function(i){var a=e.indexOf(t+"=");-1!==a&&(i.collection.syncParams.pagination["order.end"]=parseFloat(e.substr(a+t.length+1)),i.flags.hasTopPage=!0,i.flags.autoRender=!1)})}}),liveblog.define("lib/helpers/visibility-toggle",[],function(){var e=function(e,i){var a="";return a=void 0!==i?i?"visible":"hidden":"visible"===e.css("visibility")?"hidden":"visible",e.css("visibility",a),"visible"===a?!0:!1};return e}),liveblog.define("tmpl!themeBase/plugins/permanent-link",["dust"],function(e){return function(){function i(e){return e.write('')}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/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,s,c){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")&&s(o,!1),s(r)},e.openShareWindow=function(e){e.preventDefault();var i=this.$(e.target).data("gimme"),a=c.shareWindowSize[i].h,t=c.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()),s="";i.permalink&&"function"==typeof i.permalink&&(s=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(c.fbURLImageComp,[i,e.$(this).attr("src")])});var A={pin:[s,l,t],twt:[r.gettext("Now reading"),t,s],lin:[s,t,n],ggl:[s],email:[r.gettext("Check out this Live Blog"),s],fb:[t,n,s,u]};return A},l=function(e){var a={};return delete e.email,i.each(e,function(i,t){a[t]=r.sprintf(c.urls[t],e[t])}),a},u=function(e){var i={};return i.emailurl=r.sprintf(c.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/wrappup-toggle",["backbone","underscore","plugins","lib/utils","dust"],function(e,i,a,t){var n={hide:"slideUp",show:"slideDown"};t.isClient&&t.dispatcher.once("initialize.posts-view",function(e){e.clientEvents({'click [data-gimme="post.wrapup"]':"wrapupToggle"}),e.wrapupToggle=function(i){var a=e.$(i.target).closest('[data-gimme="post.wrapup"]'),t=a.attr("data-wrapup-open");a.hasClass(t)?(a.removeClass(t),a.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.hide]()):(a.addClass(t),a.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.show]())}})}),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"]}),liveblog.define("plugins/status",["backbone","plugins","lib/utils","lib/gettext","moment"],function(e,i,a,t,n){return a.isClient?(i.status=function(){a.dispatcher.on("initialize.blog-view",function(e){a.dispatcher.on("after-poller.blog-model conditional-render.blog-view",function(){var i=t.sprintf('',n().milliseconds(),n().format(t.pgettext("moment","status-time")));e.$('[data-gimme="blog.status"]').html(t.sprintf(t.gettext("updated at %s"),i))}),a.dispatcher.on("before-poller.blog-model",function(){e.$('[data-gimme="blog.status"]').html(t.gettext("updating..."))})})},i.status):void 0}),liveblog.define("tmpl!theme/container",["dust"],function(e){return function(){function i(e,i){return i=i.shiftBlocks(t),e.partial("themeBase/container",i,null)}function a(e,i){return i=i.shiftBlocks(t),e}e.register("theme/container",i);var t={contentBottomContainer:a};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(c),e.partial("themeBase/item/base",i,null)}function a(e,i){return i=i.shiftBlocks(c),e}function t(e,i){return i=i.shiftBlocks(c),e.block(i.getBlock("postDateContainer"),i,{block:n},null).block(i.getBlock("userAvatar"),i,{block:r},null).block(i.getBlock("userNameContainer"),i,{block:o},null).block(i.getBlock("shareContainer"),i,{block:s},null)}function n(e,i){return i=i.shiftBlocks(c),e}function r(e,i){return i=i.shiftBlocks(c),e}function o(e,i){return i=i.shiftBlocks(c),e}function s(e,i){return i=i.shiftBlocks(c),e}e.register("theme/item/base",i);var c={headerContainer:a,contentSide:t};return i}(),{render:function(i,a){return e.render("theme/item/base",i,a)}}}),liveblog.define("themeFile",["css!theme/liveblog","plugins/scroll-pagination","plugins/twitter-widgets","plugins/post-hash","plugins/permanent-link","plugins/social-share","plugins/wrappup-toggle","plugins/user-comments","plugins/status","tmpl!theme/container","tmpl!theme/item/base"],function(){return{plugins:["scroll-pagination","twitter-widgets","post-hash","permanent-link","social-share","wrappup-toggle","user-comments","status"]} +}); \ No newline at end of file diff --git a/gui-resources/scripts/js/build/themes/sasa-light/desktop.js b/gui-resources/scripts/js/build/themes/sasa-light/desktop.js index fe6d92db7..9047c0e24 100644 --- a/gui-resources/scripts/js/build/themes/sasa-light/desktop.js +++ b/gui-resources/scripts/js/build/themes/sasa-light/desktop.js @@ -1,3 +1,3 @@ liveblog.define("plugins",{}),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.length96?e-87:e>64?e-29:e-48}function a(e){var a,t=0,n=e.split("."),r=n[0],o=n[1]||"",s=1,c=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').helper("i18n",i,{},{msgid:"Load more posts ..."}).write("")}function c(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:s,loadingNext:c,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 s(e,i){return i=i.shiftBlocks(u),e.write('Load top posts')}function c(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:s,loadingNext:c,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!themeBase/plugins/pending-items-message",["dust"],function(e){return function(){function i(e){return e.write('')}return e.register("themeBase/plugins/pending-items-message",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/pending-items-message",i,a)}}}),liveblog.define("plugins/pending-messages",["lib/gettext","plugins","lib/utils","dust","tmpl!themeBase/item/base","tmpl!themeBase/plugins/pending-items-message"],function(e,i,a,t){return i.pendingMessages=function(){var i={};a.dispatcher.once("initialize.blog-view",function(e){i=e}),a.dispatcher.once("after-render.blog-view",function(e){t.renderThemed("themeBase/plugins/pending-items-message",{},function(i,a){e.$('[data-gimme="posts.pending-message-placeholder"]').html(a)})}),a.isClient&&(a.dispatcher.once("initialize.posts-view",function(e){e.pauseAutoRender=function(){this.flags.autoRender=!1},e.resumeAutoRender=function(){this.flags.autoRender=!0},i.$el.on("click",'[data-gimme="posts.pending-message"],[data-gimme="posts.pending-message-holder"]',function(){e.renderPending()})}),a.dispatcher.on("update-pending.posts-view",function(a){var t="",n=a.pendingCounter;n>0&&(t=e.sprintf(e.ngettext("one new post","%(count)s new posts",n),{count:n})),i.$('[data-gimme="posts.pending-message"]').html(t).toggle(n>0),i.$('[data-gimme="posts.pending-message-holder"]').toggle(n>0)}))},i.pendingMessages}),liveblog.define("config/scroll-pagination-plugin",{scrollHeight:500,nextPageTriggerOffset:-200}),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,s,c,l,u,A,m,p,f,d,g,h,b,T;return n=a(t),A=e.call(t,"ontouchstart")>=0,s={horizontal:{},vertical:{}},c=1,u={},l="waypoints-context-id",f="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"+c++,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(f,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,s,c;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<(s=i.oldScroll)&&s<=t.offset?t.trigger([i.backward]):null!==o&&o>(c=i.oldScroll)&&c>=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([f,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,s[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 s[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({},s.horizontal,s.vertical),a.map(t,function(e){return i[e]})):[]},e}(),p={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,s;return e=a(this),n=null!=(s=i.context)?s: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 p._invoke.call(this,"disable")},enable:function(){return p._invoke.call(this,"enable")},destroy:function(){return p._invoke.call(this,"destroy")},prev:function(e,i){return p._traverse.call(this,e,i,function(e,i,a){return i>0?e.push(a[i-1]):void 0})},next:function(e,i){return p._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 p[e]=i},_invoke:function(e){var i;return i=a.extend({},s.vertical,s.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.define("plugins/scroll-pagination",["plugins","plugins/button-pagination","plugins/pending-messages","config/scroll-pagination-plugin","lib/utils"],function(e,i,a,t,n){return delete e["button-pagination"],delete e["pending-messages"],e["scroll-pagination"]=function(e){i(e),a(e),n.dispatcher.once("add-all.posts-view",function(e){e.$el.css("overflow-y","auto").css("overflow-x","auto").css("height",t.scrollHeight+"px")}),n.isClient&&(n.dispatcher.on("initialize.blog-view",function(e){r(e)}),n.dispatcher.on("pagination-next-updated.posts-view",function(e){e.hasNextPage()&&o(e,e.$('[data-gimme="posts.nextPage"]'))}),n.dispatcher.once("pagination-next-updated.posts-view",function(e){s(e)}));var r=function(e){e.clientEvents({'click [data-gimme="posts.to-top"]':"toTop",'click [data-gimme="posts.pending-message"]':"toTop"}),e.toTop=function(e){e.preventDefault(),this.$('[data-gimme="posts.list"]').scrollTop(0)}},o=function(e,i){liveblog.require(["waypoints"],function(){i.waypoint(function(){e.buttonNextPage()},{continuous:!1,triggerOnce:!0,offset:"100%",context:e.el})})},s=function(e){var i=e.$('[data-gimme="posts.beforePage"]');liveblog.require(["waypoints"],function(){i.waypoint(function(a){"down"===a&&(e.pauseAutoRender(),i.waypoint("destroy"),c(e))},{continuous:!1,offset:t.nextPageTriggerOffset,context:e.el})})},c=function(e){var i=e.firstPost().$el;liveblog.require(["waypoints"],function(){i.waypoint(function(a){"up"===a&&(e.renderPending(),e.resumeAutoRender(),i.waypoint("destroy"),s(e))},{continuous:!1,offset:-1,context:e.el})})}},e["scroll-pagination"]}),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/escape-RegExp",[],function(){var e=function(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")};return e}),liveblog.define("plugins/post-hash",["plugins","lib/utils","lib/helpers/escape-RegExp"],function(e,i,a){e["post-hash"]=function(){var e,t="liveblog.item.id",n=liveblog.hashmark?liveblog.hashmark:"?";e=i.isClient?window.location.href:liveblog.locationHref||"/",i.dispatcher.on("initialize.post-view",function(i){i.permalink=function(r){var o=r&&r.hashMark?r.hashMark:n,s=!1,c=t+"="+parseFloat(i.model.get("Order"));if(-1===e.indexOf(o))s=e+o+c;else if(-1!==e.indexOf(t+"=")){var l=new RegExp(a(t)+"=[^&#]*");s=e.replace(l,c)}else s=e+"&"+c;return s}}),i.dispatcher.on("initialize.posts-view",function(i){var a=e.indexOf(t+"=");-1!==a&&(i.collection.syncParams.pagination["order.end"]=parseFloat(e.substr(a+t.length+1)),i.flags.hasTopPage=!0,i.flags.autoRender=!1)})}}),liveblog.define("lib/helpers/visibility-toggle",[],function(){var e=function(e,i){var a="";return a=void 0!==i?i?"visible":"hidden":"visible"===e.css("visibility")?"hidden":"visible",e.css("visibility",a),"visible"===a?!0:!1};return e}),liveblog.define("tmpl!themeBase/plugins/permanent-link",["dust"],function(e){return function(){function i(e){return e.write('')}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/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,s,c){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")&&s(o,!1),s(r)},e.openShareWindow=function(e){e.preventDefault();var i=this.$(e.target).data("gimme"),a=c.shareWindowSize[i].h,t=c.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()),s="";i.permalink&&"function"==typeof i.permalink&&(s=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(c.fbURLImageComp,[i,e.$(this).attr("src")])});var A={pin:[s,l,t],twt:[r.gettext("Now reading"),t,s],lin:[s,t,n],ggl:[s],email:[r.gettext("Check out this Live Blog"),s],fb:[t,n,s,u]};return A},l=function(e){var a={};return delete e.email,i.each(e,function(i,t){a[t]=r.sprintf(c.urls[t],e[t])}),a},u=function(e){var i={};return i.emailurl=r.sprintf(c.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/wrappup-toggle",["backbone","underscore","plugins","lib/utils","dust"],function(e,i,a,t){var n={hide:"slideUp",show:"slideDown"};t.isClient&&t.dispatcher.once("initialize.posts-view",function(e){e.clientEvents({'click [data-gimme="post.wrapup"]':"wrapupToggle"}),e.wrapupToggle=function(i){var a=e.$(i.target).closest('[data-gimme="post.wrapup"]'),t=a.attr("data-wrapup-open");a.hasClass(t)?(a.removeClass(t),a.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.hide]()):(a.addClass(t),a.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.show]())}})}),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"]}),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("blogMedia"),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(c),e.partial("themeBase/item/base",i,null)}function a(e,i){return i=i.shiftBlocks(c),e}function t(e,i){return i=i.shiftBlocks(c),e.block(i.getBlock("postDateContainer"),i,{block:n},null).block(i.getBlock("userAvatar"),i,{block:r},null).block(i.getBlock("userNameContainer"),i,{block:o},null).write('').block(i.getBlock("shareContainer"),i,{block:s},null)}function n(e,i){return i=i.shiftBlocks(c),e}function r(e,i){return i=i.shiftBlocks(c),e}function o(e,i){return i=i.shiftBlocks(c),e}function s(e,i){return i=i.shiftBlocks(c),e}e.register("theme/item/base",i);var c={headerContainer:a,contentSide:t};return i}(),{render:function(i,a){return e.render("theme/item/base",i,a)}}}),liveblog.define("themeFile",["css!theme/liveblog","plugins/scroll-pagination","plugins/twitter-widgets","plugins/post-hash","plugins/permanent-link","plugins/social-share","plugins/wrappup-toggle","plugins/user-comments","tmpl!theme/container","tmpl!theme/item/base"],function(){return{plugins:["scroll-pagination","twitter-widgets","post-hash","permanent-link","social-share","wrappup-toggle","user-comments"]} -}); \ No newline at end of file +var u={itemClass:t,main:n,loadNext:s,loadingNext:c,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 s(e,i){return i=i.shiftBlocks(u),e.write('Load top posts')}function c(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:s,loadingNext:c,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!themeBase/plugins/pending-items-message",["dust"],function(e){return function(){function i(e){return e.write('')}return e.register("themeBase/plugins/pending-items-message",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/pending-items-message",i,a)}}}),liveblog.define("plugins/pending-messages",["lib/gettext","plugins","lib/utils","dust","tmpl!themeBase/item/base","tmpl!themeBase/plugins/pending-items-message"],function(e,i,a,t){return i.pendingMessages=function(){var i={};a.dispatcher.once("initialize.blog-view",function(e){i=e}),a.dispatcher.once("after-render.blog-view",function(e){t.renderThemed("themeBase/plugins/pending-items-message",{},function(i,a){e.$('[data-gimme="posts.pending-message-placeholder"]').html(a)})}),a.isClient&&(a.dispatcher.once("initialize.posts-view",function(e){e.pauseAutoRender=function(){this.flags.autoRender=!1},e.resumeAutoRender=function(){this.flags.autoRender=!0},i.$el.on("click",'[data-gimme="posts.pending-message"],[data-gimme="posts.pending-message-holder"]',function(){e.renderPending()})}),a.dispatcher.on("update-pending.posts-view",function(a){var t="",n=a.pendingCounter;n>0&&(t=e.sprintf(e.ngettext("one new post","%(count)s new posts",n),{count:n})),i.$('[data-gimme="posts.pending-message"]').html(t).toggle(n>0),i.$('[data-gimme="posts.pending-message-holder"]').toggle(n>0)}))},i.pendingMessages}),liveblog.define("config/scroll-pagination-plugin",{scrollHeight:500,nextPageTriggerOffset:-200}),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,s,c,l,u,A,m,p,f,d,g,h,b,T;return n=a(t),A=e.call(t,"ontouchstart")>=0,s={horizontal:{},vertical:{}},c=1,u={},l="waypoints-context-id",f="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"+c++,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(f,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,s,c;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<(s=i.oldScroll)&&s<=t.offset?t.trigger([i.backward]):null!==o&&o>(c=i.oldScroll)&&c>=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([f,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,s[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 s[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({},s.horizontal,s.vertical),a.map(t,function(e){return i[e]})):[]},e}(),p={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,s;return e=a(this),n=null!=(s=i.context)?s: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 p._invoke.call(this,"disable")},enable:function(){return p._invoke.call(this,"enable")},destroy:function(){return p._invoke.call(this,"destroy")},prev:function(e,i){return p._traverse.call(this,e,i,function(e,i,a){return i>0?e.push(a[i-1]):void 0})},next:function(e,i){return p._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 p[e]=i},_invoke:function(e){var i;return i=a.extend({},s.vertical,s.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.define("plugins/scroll-pagination",["plugins","plugins/button-pagination","plugins/pending-messages","config/scroll-pagination-plugin","lib/utils"],function(e,i,a,t,n){return delete e["button-pagination"],delete e["pending-messages"],e["scroll-pagination"]=function(e){i(e),a(e),n.dispatcher.once("add-all.posts-view",function(e){e.$el.css("overflow-y","auto").css("overflow-x","auto").css("height",t.scrollHeight+"px")}),n.isClient&&(n.dispatcher.on("initialize.blog-view",function(e){r(e)}),n.dispatcher.on("pagination-next-updated.posts-view",function(e){e.hasNextPage()&&o(e,e.$('[data-gimme="posts.nextPage"]'))}),n.dispatcher.once("pagination-next-updated.posts-view",function(e){s(e)}));var r=function(e){e.clientEvents({'click [data-gimme="posts.to-top"]':"toTop",'click [data-gimme="posts.pending-message"]':"toTop"}),e.toTop=function(e){e.preventDefault(),this.$('[data-gimme="posts.list"]').scrollTop(0)}},o=function(e,i){liveblog.require(["waypoints"],function(){i.waypoint(function(){e.buttonNextPage()},{continuous:!1,triggerOnce:!0,offset:"100%",context:e.el})})},s=function(e){var i=e.$('[data-gimme="posts.beforePage"]');liveblog.require(["waypoints"],function(){i.waypoint(function(a){"down"===a&&(e.pauseAutoRender(),i.waypoint("destroy"),c(e))},{continuous:!1,offset:t.nextPageTriggerOffset,context:e.el})})},c=function(e){var i=e.firstPost().$el;liveblog.require(["waypoints"],function(){i.waypoint(function(a){"up"===a&&(e.renderPending(),e.resumeAutoRender(),i.waypoint("destroy"),s(e))},{continuous:!1,offset:-1,context:e.el})})}},e["scroll-pagination"]}),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/escape-RegExp",[],function(){var e=function(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")};return e}),liveblog.define("plugins/post-hash",["plugins","lib/utils","lib/helpers/escape-RegExp"],function(e,i,a){e["post-hash"]=function(){var e,t="liveblog.item.id",n=liveblog.hashmark?liveblog.hashmark:"?";e=i.isClient?window.location.href:liveblog.locationHref||"/",i.dispatcher.on("initialize.post-view",function(i){i.permalink=function(r){var o=r&&r.hashMark?r.hashMark:n,s=!1,c=t+"="+parseFloat(i.model.get("Order"));if(-1===e.indexOf(o))s=e+o+c;else if(-1!==e.indexOf(t+"=")){var l=new RegExp(a(t)+"=[^&#]*");s=e.replace(l,c)}else s=e+"&"+c;return s}}),i.dispatcher.on("initialize.posts-view",function(i){var a=e.indexOf(t+"=");-1!==a&&(i.collection.syncParams.pagination["order.end"]=parseFloat(e.substr(a+t.length+1)),i.flags.hasTopPage=!0,i.flags.autoRender=!1)})}}),liveblog.define("lib/helpers/visibility-toggle",[],function(){var e=function(e,i){var a="";return a=void 0!==i?i?"visible":"hidden":"visible"===e.css("visibility")?"hidden":"visible",e.css("visibility",a),"visible"===a?!0:!1};return e}),liveblog.define("tmpl!themeBase/plugins/permanent-link",["dust"],function(e){return function(){function i(e){return e.write('')}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/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,s,c){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")&&s(o,!1),s(r)},e.openShareWindow=function(e){e.preventDefault();var i=this.$(e.target).data("gimme"),a=c.shareWindowSize[i].h,t=c.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()),s="";i.permalink&&"function"==typeof i.permalink&&(s=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(c.fbURLImageComp,[i,e.$(this).attr("src")])});var A={pin:[s,l,t],twt:[r.gettext("Now reading"),t,s],lin:[s,t,n],ggl:[s],email:[r.gettext("Check out this Live Blog"),s],fb:[t,n,s,u]};return A},l=function(e){var a={};return delete e.email,i.each(e,function(i,t){a[t]=r.sprintf(c.urls[t],e[t])}),a},u=function(e){var i={};return i.emailurl=r.sprintf(c.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/wrappup-toggle",["backbone","underscore","plugins","lib/utils","dust"],function(e,i,a,t){var n={hide:"slideUp",show:"slideDown"};t.isClient&&t.dispatcher.once("initialize.posts-view",function(e){e.clientEvents({'click [data-gimme="post.wrapup"]':"wrapupToggle"}),e.wrapupToggle=function(i){var a=e.$(i.target).closest('[data-gimme="post.wrapup"]'),t=a.attr("data-wrapup-open");a.hasClass(t)?(a.removeClass(t),a.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.hide]()):(a.addClass(t),a.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.show]())}})}),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"]}),liveblog.define("plugins/status",["backbone","plugins","lib/utils","lib/gettext","moment"],function(e,i,a,t,n){return a.isClient?(i.status=function(){a.dispatcher.on("initialize.blog-view",function(e){a.dispatcher.on("after-poller.blog-model conditional-render.blog-view",function(){var i=t.sprintf('',n().milliseconds(),n().format(t.pgettext("moment","status-time")));e.$('[data-gimme="blog.status"]').html(t.sprintf(t.gettext("updated at %s"),i))}),a.dispatcher.on("before-poller.blog-model",function(){e.$('[data-gimme="blog.status"]').html(t.gettext("updating..."))})})},i.status):void 0}),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("blogMedia"),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(c),e.partial("themeBase/item/base",i,null)}function a(e,i){return i=i.shiftBlocks(c),e}function t(e,i){return i=i.shiftBlocks(c),e.block(i.getBlock("postDateContainer"),i,{block:n},null).block(i.getBlock("userAvatar"),i,{block:r},null).block(i.getBlock("userNameContainer"),i,{block:o},null).write('').block(i.getBlock("shareContainer"),i,{block:s},null)}function n(e,i){return i=i.shiftBlocks(c),e}function r(e,i){return i=i.shiftBlocks(c),e}function o(e,i){return i=i.shiftBlocks(c),e +}function s(e,i){return i=i.shiftBlocks(c),e}e.register("theme/item/base",i);var c={headerContainer:a,contentSide:t};return i}(),{render:function(i,a){return e.render("theme/item/base",i,a)}}}),liveblog.define("themeFile",["css!theme/liveblog","plugins/scroll-pagination","plugins/twitter-widgets","plugins/post-hash","plugins/permanent-link","plugins/social-share","plugins/wrappup-toggle","plugins/user-comments","plugins/status","tmpl!theme/container","tmpl!theme/item/base"],function(){return{plugins:["scroll-pagination","twitter-widgets","post-hash","permanent-link","social-share","wrappup-toggle","user-comments","status"]}}); \ No newline at end of file diff --git a/gui-resources/scripts/js/build/themes/sasa/desktop.js b/gui-resources/scripts/js/build/themes/sasa/desktop.js index 4a3f0a163..8c92c1a0c 100644 --- a/gui-resources/scripts/js/build/themes/sasa/desktop.js +++ b/gui-resources/scripts/js/build/themes/sasa/desktop.js @@ -1,2 +1,3 @@ -liveblog.define("plugins",{}),liveblog.define("plugins/pagination",["plugins","lib/utils"],function(e,a){return e.pagination=function(){a.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()){a.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,a.dispatcher.trigger("loaded.posts-view",e)})}},e.hasNextPage=function(){return this.collection.length96?e-87:e>64?e-29:e-48}function i(e){var i,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;ti;i++)e[i]=Math.round((e[i-1]||0)+6e4*e[i]);e[a-1]=1/0}function r(e,a){var i,t=[];for(i=0;i').helper("i18n",a,{},{msgid:"Load more posts ..."}).write("")}function s(e,a){return a=a.shiftBlocks(u),e.write('')}function l(e,a){return a=a.shiftBlocks(u),e.write('data-gimme="posts.nextPage"')}e.register("themeBase/plugins/after-button-pagination",a); -var u={itemClass:t,main:n,loadNext:c,loadingNext:s,additionalAttributes:l};return a}(),{render:function(a,i){return e.render("themeBase/plugins/after-button-pagination",a,i)}}}),liveblog.define("tmpl!themeBase/plugins/before-button-pagination",["dust"],function(e){return function(){function a(e,a){return a=a.shiftBlocks(u),e.partial(i,a,null)}function i(e,a){return a=a.shiftBlocks(u),e.reference(a.get(["baseItem"],!1),a,"h")}function t(e,a){return a=a.shiftBlocks(u),e.write("load-next")}function n(e,a){return a=a.shiftBlocks(u),e.block(a.getBlock("loadNext"),a,{block:r},null).block(a.getBlock("loadingNext"),a,{block:o},null)}function r(e,a){return a=a.shiftBlocks(u),e}function o(e,a){return a=a.shiftBlocks(u),e}function c(e,a){return a=a.shiftBlocks(u),e.write('Load top posts')}function s(e,a){return a=a.shiftBlocks(u),e.write('')}function l(e,a){return a=a.shiftBlocks(u),e.write('data-gimme="posts.beforePage"')}e.register("themeBase/plugins/before-button-pagination",a);var u={itemClass:t,main:n,loadNext:c,loadingNext:s,additionalAttributes:l};return a}(),{render:function(a,i){return e.render("themeBase/plugins/before-button-pagination",a,i)}}}),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,a,i,t,n,r){return delete a.pagination,a["button-pagination"]=function(a){i(a),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(a){var i={};i.baseItem=t.themed("themeBase/item/base"),0===a.$('[data-gimme="posts.beforePage"]').length&&t.renderThemed("themeBase/plugins/before-button-pagination",i,function(i,t){var n=e.$(t);r(n,!1),a.$el.prepend(n)}),0===a.$('[data-gimme="posts.nextPage"]').length&&t.renderThemed("themeBase/plugins/after-button-pagination",i,function(i,t){var n=e.$(t);r(n,!1),a.$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 a=e.$('[data-gimme="posts.nextPage"]');a.addClass("loading"),e.nextPage().done(function(){e.flags.buttonNextPage=!1,a.removeClass("loading"),e.checkNextPage()})},e.buttonTopPage=function(){var a=e.$('[data-gimme="posts.beforePage"]');a.addClass("loading"),e.flags.topPage=!1,e.topPage().done(function(){a.removeClass("loading"),r(a,!1),e.checkNextPage()})}})},a["button-pagination"]}),function(){var e=[].indexOf||function(e){for(var a=0,i=this.length;i>a;a++)if(a in this&&this[a]===e)return a;return-1},a=[].slice;!function(e,a){return"function"==typeof liveblog.define&&liveblog.define.amd?liveblog.define("waypoints",["jquery"],function(i){return a(i,e)}):a(e.jQuery,e)}(window,function(i,t){var n,r,o,c,s,l,u,A,m,p,f,d,g,h,b,T;return n=i(t),A=e.call(t,"ontouchstart")>=0,c={horizontal:{},vertical:{}},s=1,u={},l="waypoints-context-id",f="resize.waypoints",d="scroll.waypoints",g=1,h="waypoints-waypoint-ids",b="waypoint",T="waypoints",r=function(){function e(e){var a=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 a.didScroll||A?void 0:(a.didScroll=!0,e=function(){return a.doScroll(),a.didScroll=!1},t.setTimeout(e,i[T].settings.scrollThrottle))}),e.bind(f,function(){var e;return a.didResize?void 0:(a.didResize=!0,e=function(){return i[T]("refresh"),a.didResize=!1},t.setTimeout(e,i[T].settings.resizeThrottle))})}return e.prototype.doScroll=function(){var e,a=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||i[T]("refresh"),i.each(e,function(e,t){var n,r,o;return o=[],r=t.newScroll>t.oldScroll,n=r?t.forward:t.backward,i.each(a.waypoints[e],function(e,a){var i,n;return t.oldScroll<(i=a.offset)&&i<=t.newScroll?o.push(a):t.newScroll<(n=a.offset)&&n<=t.oldScroll?o.push(a):void 0}),o.sort(function(e,a){return e.offset-a.offset}),r||o.reverse(),i.each(o,function(e,a){return a.options.continuous||e===o.length-1?a.trigger([n]):void 0})}),this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.refresh=function(){var e,a,t,n=this;return t=i.isWindow(this.element),a=this.$element.offset(),this.doScroll(),e={horizontal:{contextOffset:t?0:a.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:a.top,contextScroll:t?0:this.oldScroll.y,contextDimension:t?i[T]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}},i.each(e,function(e,a){return i.each(n.waypoints[e],function(e,t){var n,r,o,c,s;return n=t.options.offset,o=t.offset,r=i.isWindow(t.element)?0:t.$element.offset()[a.offsetProp],i.isFunction(n)?n=n.apply(t.element):"string"==typeof n&&(n=parseFloat(n),t.options.offset.indexOf("%")>-1&&(n=Math.ceil(a.contextDimension*n/100))),t.offset=r-a.contextOffset+a.contextScroll-n,t.options.onlyOnScroll&&null!=o||!t.enabled?void 0:null!==o&&o<(c=a.oldScroll)&&c<=t.offset?t.trigger([a.backward]):null!==o&&o>(s=a.oldScroll)&&s>=t.offset?t.trigger([a.forward]):null===o&&a.oldScroll>=t.offset?t.trigger([a.forward]):void 0})})},e.prototype.checkEmpty=function(){return i.isEmptyObject(this.waypoints.horizontal)&&i.isEmptyObject(this.waypoints.vertical)?(this.$element.unbind([f,d].join(" ")),delete u[this.id]):void 0},e}(),o=function(){function e(e,a,t){var n,r;"bottom-in-view"===t.offset&&(t.offset=function(){var e;return e=i[T]("viewportHeight"),i.isWindow(a.element)||(e=a.$element.height()),e-i(this).outerHeight()}),this.$element=e,this.element=e[0],this.axis=t.horizontal?"horizontal":"vertical",this.callback=t.handler,this.context=a,this.enabled=t.enabled,this.id="waypoints"+g++,this.offset=null,this.options=t,a.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 a,t;return(t=e[h])?(a=i.extend({},c.horizontal,c.vertical),i.map(t,function(e){return a[e]})):[]},e}(),p={init:function(e,a){var t;return a=i.extend({},i.fn[b].defaults,a),null==(t=a.handler)&&(a.handler=e),this.each(function(){var e,t,n,c;return e=i(this),n=null!=(c=a.context)?c:i.fn[b].defaults.context,i.isWindow(n)||(n=e.closest(n)),n=i(n),t=u[n[0][l]],t||(t=new r(n)),new o(e,t,a)}),i[T]("refresh"),this},disable:function(){return p._invoke.call(this,"disable")},enable:function(){return p._invoke.call(this,"enable")},destroy:function(){return p._invoke.call(this,"destroy")},prev:function(e,a){return p._traverse.call(this,e,a,function(e,a,i){return a>0?e.push(i[a-1]):void 0})},next:function(e,a){return p._traverse.call(this,e,a,function(e,a,i){return ae.oldScroll.y})},left:function(e){return null==e&&(e=t),m._filter(e,"horizontal",function(e,a){return a.offset<=e.oldScroll.x})},right:function(e){return null==e&&(e=t),m._filter(e,"horizontal",function(e,a){return a.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,a){return p[e]=a},_invoke:function(e){var a;return a=i.extend({},c.vertical,c.horizontal),i.each(a,function(a,i){return i[e](),!0})},_filter:function(e,a,t){var n,r;return(n=u[i(e)[0][l]])?(r=[],i.each(n.waypoints[a],function(e,a){return t(n,a)?r.push(a):void 0}),r.sort(function(e,a){return e.offset-a.offset}),i.map(r,function(e){return e.element})):[]}},i[T]=function(){var e,i;return i=arguments[0],e=2<=arguments.length?a.call(arguments,1):[],m[i]?m[i].apply(null,e):m.aggregate.call(null,i)},i[T].settings={resizeThrottle:100,scrollThrottle:30},n.on("load.waypoints",function(){return i[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,a,i,t,n){return i["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){a(e)});var a=function(a){a._twitterPosts&&liveblog.require(["twitterWidgets","waypoints"],function(i){i.ready(function(){e.each(a._twitterPosts,function(e){e.$el.waypoint(function(){var a=e.model.get("Meta").id_str;i.widgets.createTweet(a,e.$el.find(".post-content-full").get(0),function(){e.$el.find(".post-core-content").remove()},{cards:"all"})},{triggerOnce:!0,offset:"120%",context:a.el})}),a._twitterPosts=[]})},function(){})}}},i["twitter-widgets"]}),liveblog.define("lib/helpers/escape-RegExp",[],function(){var e=function(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")};return e}),liveblog.define("plugins/post-hash",["plugins","lib/utils","lib/helpers/escape-RegExp"],function(e,a,i){e["post-hash"]=function(){var e,t="liveblog.item.id",n=liveblog.hashmark?liveblog.hashmark:"?";e=a.isClient?window.location.href:liveblog.locationHref||"/",a.dispatcher.on("initialize.post-view",function(a){a.permalink=function(r){var o=r&&r.hashMark?r.hashMark:n,c=!1,s=t+"="+parseFloat(a.model.get("Order"));if(-1===e.indexOf(o))c=e+o+s;else if(-1!==e.indexOf(t+"=")){var l=new RegExp(i(t)+"=[^&#]*");c=e.replace(l,s)}else c=e+"&"+s;return c}}),a.dispatcher.on("initialize.posts-view",function(a){var i=e.indexOf(t+"=");-1!==i&&(a.collection.syncParams.pagination["order.end"]=parseFloat(e.substr(i+t.length+1)),a.flags.hasTopPage=!0,a.flags.autoRender=!1)})}}),liveblog.define("lib/helpers/visibility-toggle",[],function(){var e=function(e,a){var i="";return i=void 0!==a?a?"visible":"hidden":"visible"===e.css("visibility")?"hidden":"visible",e.css("visibility",i),"visible"===i?!0:!1};return e}),liveblog.define("tmpl!themeBase/plugins/permanent-link",["dust"],function(e){return function(){function a(e){return e.write('')}return e.register("themeBase/plugins/permanent-link",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/permanent-link",a,i)}}}),liveblog.define("plugins/permanent-link",["plugins","lib/utils","dust","lib/helpers/visibility-toggle","tmpl!themeBase/item/base","tmpl!themeBase/plugins/permanent-link"],function(e,a,i,t){return a.isClient?(e.permalink=function(){a.dispatcher.on("after-render.post-view",function(e){i.renderThemed("themeBase/plugins/permanent-link",{},function(a,i){e.$('[data-gimme="post.permanent-link-placeholder"]').html(i)});var a="";e.permalink&&"function"==typeof e.permalink&&(a=e.permalink(),e.$('[data-gimme="post.share-permalink"]').val(a),e.$('[data-gimme="post.permalink"]').attr("href",a))}),a.dispatcher.on("initialize.post-view",function(e){e.clientEvents({'click [data-gimme="post.permalink"]':"permalinkAction"}),e.permalinkAction=function(e){e.preventDefault();var a=this.$('[data-gimme="post.share-permalink"]');if(t(a)){var i=this.$('[data-gimme^="post.share"][data-gimme!="post.share-permalink"]');t(i,!1),a.trigger("focus")}},e.clientEvents({'click [data-gimme="post.share-permalink"]':"permalinkInput",'focus [data-gimme="post.share-permalink"]':"permalinkInput"}),e.permalinkInput=function(a){e.$(a.target).select()},e.delegateEvents()})},e.permalink):void 0}),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 a(e,a){return e.write('').helper("i18n",a,{},{msgid:"Share"}).write("")}return e.register("themeBase/plugins/social-share-anchor",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/social-share-anchor",a,i)}}}),liveblog.define("tmpl!themeBase/plugins/social-share",["dust"],function(e){return function(){function a(e,a){return e.write('')}function i(e,a){return e.write('')}return e.register("themeBase/plugins/social-share",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/social-share",a,i)}}}),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,a,i,t,n,r,o,c,s){t.isClient&&(i["social-share"]=function(){t.dispatcher.on("after-render.post-view",function(e){n.renderThemed("themeBase/plugins/social-share-anchor",{},function(a,i){e.$('[data-gimme="post.social-share-placeholder"]').html(i)})}),t.dispatcher.on("initialize.post-view",function(e){e.clientEvents({'click [data-gimme="post.social"]':"share"}),e.share=function(e){e.preventDefault();var a=this,t=i(a);a.socialShareUrls=l(t),n.renderThemed("themeBase/plugins/social-share",u(t),function(e,i){a.$('[data-gimme="post.social-share-placeholder"]').append(i)}),A(a);var r=a.$('[data-gimme="post.share-social"]'),o=a.$('[data-gimme^="post.share"]');"hidden"===r.css("visibility")&&c(o,!1),c(r)},e.openShareWindow=function(e){e.preventDefault();var a=this.$(e.target).data("gimme"),i=s.shareWindowSize[a].h,t=s.shareWindowSize[a].w,n=this.socialShareUrls[a],r="resizable, height="+i+", width="+t,o=window.open(n,"",r);return o.focus(),!1}});var i=function(a){var i=a.parentView().parentView().model,t=o(i.get("Title")),n=o(a.$(".result-content .result-text:last").text()),c="";a.permalink&&"function"==typeof a.permalink&&(c=o(a.permalink()));var l=a.$(".result-content img:first").attr("src");l||(l=e.$("img:first").attr("src"));var u="";a.$(".result-content img").each(function(a){u+=r.sprintf(s.fbURLImageComp,[a,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 i={};return delete e.email,a.each(e,function(a,t){i[t]=r.sprintf(s.urls[t],e[t])}),i},u=function(e){var a={};return a.emailurl=r.sprintf(s.urls.email,e.email),a},A=function(e){var i={};a.each(e.socialShareUrls,function(e,a){i['click [data-gimme="'+a+'"]']="openShareWindow"}),e.clientEvents(i),e.delegateEvents()}})}),liveblog.define("plugins/wrappup-toggle",["backbone","underscore","plugins","lib/utils","dust"],function(e,a,i,t){var n={hide:"slideUp",show:"slideDown"};t.isClient&&t.dispatcher.once("initialize.posts-view",function(e){e.clientEvents({'click [data-gimme="post.wrapup"]':"wrapupToggle"}),e.wrapupToggle=function(a){var i=e.$(a.target).closest('[data-gimme="post.wrapup"]'),t=i.attr("data-wrapup-open");i.hasClass(t)?(i.removeClass(t),i.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.hide]()):(i.addClass(t),i.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.show]())}})}),liveblog.define("lib/helpers/format-commentator",["underscore","lib/gettext"],function(e,a){return function(e){return e=e.replace("commentator",""),a.sprintf(a.gettext("%(full_name)s commentator"),{full_name:e})}}),liveblog.define("lib/helpers/adjust-server-post",["underscore"],function(){return function(e){var a="infomercial";return"advertisement"===e.Type.Key&&(e.Type.Key=a),"advertisement"===e.Author.Source.Name&&(e.Author.Source.Name=a),"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,a,i){return i.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,a,i,t,n){return i.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 a=this,i=a.backdropel.data("show-status");switch(e.preventDefault(),i){case 0:t(a.popup,!0),a.backdropel.data("show-status",1),t(a.backdropel,!0),a.lbpostlist.addClass("comment-active"),a.blogview.stopPoller();break;case 1:a.backdropel.data("show-status",0).hide(),t(a.popup_message,!1),a.resetInput(),a.lbpostlist.removeClass("comment-active"),t(a.popup,!1),a.blogview.starPoller();break;case 2:t(a.popup_message,!1),a.resetInput(),a.lbpostlist.removeClass("comment-active"),t(a.popup,!1),a.blogview.starPoller()}},send:function(e){e.preventDefault();var a=this;if(this.isValid()){var i=new n,t={UserName:this.username.val(),CommentText:this.text.val()};i.setUrlRoot(this.model.get("CommentPost").href),i.save(t,{success:function(){a.showAfterMessage(e),a.resetInput()},error:function(){a.showAfterMessage(e),a.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 a(e,a){return e.write('
      ').helper("i18n",a,{},{msgid:"Your message was sent for approval"}).write("
      ")}return e.register("themeBase/plugins/user-comment-message",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/user-comment-message",a,i)}}}),liveblog.define("tmpl!themeBase/plugins/user-comment-backdrop",["dust"],function(e){return function(){function a(e){return e.write('
      ')}return e.register("themeBase/plugins/user-comment-backdrop",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/user-comment-backdrop",a,i)}}}),liveblog.define("tmpl!themeBase/plugins/user-comment-action",["dust"],function(e){return function(){function a(e,a){return e.write('").helper("i18n",a,{},{msgid:"comment"}).write("")}function i(e){return e.write(' style="display:none" ')}function t(e){return e.write(' style="display:block" ')}return e.register("themeBase/plugins/user-comment-action",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/user-comment-action",a,i)}}}),liveblog.define("tmpl!themeBase/plugins/user-comment",["dust"],function(e){return function(){function a(e,a){return e.write('
      ').helper("i18n",a,{},{msgid:"Please fill in your Nickname."}).write('
      ').helper("i18n",a,{},{msgid:"Please fill in your Comment text."}).write('
      ').helper("i18n",a,{},{msgid:"Please fill in text from image."}).write('
      ")}return e.register("themeBase/plugins/user-comment",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/user-comment",a,i)}}}),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,a,i,t,n){return e["user-comments"]=function(e){i.dispatcher.on("config-update.blog-view",function(e){n(e.$('[data-gimme="blog.comment"]'),e.model.get("EmbedConfig").UserComments)}),i.dispatcher.on("conditional-render.blog-view",function(r){if(t.renderThemed("themeBase/plugins/user-comment-action",{UserComments:r.model.get("EmbedConfig").UserComments},function(e,a){r.$('[data-gimme="blog.comment-action"]').html(a)}),n(r.$('[data-gimme="blog.comment"]'),e.UserComments),t.renderThemed("themeBase/plugins/user-comment",{},function(e,a){r.$('[data-gimme="blog.comment-box"]').html(a)}),t.renderThemed("themeBase/plugins/user-comment-message",{},function(e,a){r.$('[data-gimme="blog.comment-box-message"]').html(a)}),t.renderThemed("themeBase/plugins/user-comment-backdrop",{},function(e,a){r.$('[data-gimme="blog.comment-box-backdrop"]').html(a)}),i.isClient){new a({el:r.el,blogview:r,model:r.model})}})},e["user-comments"]}),liveblog.define("tmpl!theme/container",["dust"],function(e){return function(){function a(e,a){return a=a.shiftBlocks(t),e.partial("themeBase/container",a,null)}function i(e,a){return a=a.shiftBlocks(t),e}e.register("theme/container",a);var t={contentBottomContainer:i};return a}(),{render:function(a,i){return e.render("theme/container",a,i)}}}),liveblog.define("tmpl!theme/item/base",["dust"],function(e){return function(){function a(e,a){return a=a.shiftBlocks(s),e.partial("themeBase/item/base",a,null)}function i(e,a){return a=a.shiftBlocks(s),e}function t(e,a){return a=a.shiftBlocks(s),e.block(a.getBlock("postDateContainer"),a,{block:n},null).block(a.getBlock("userAvatar"),a,{block:r},null).block(a.getBlock("userNameContainer"),a,{block:o},null).write('').block(a.getBlock("shareContainer"),a,{block:c},null)}function n(e,a){return a=a.shiftBlocks(s),e}function r(e,a){return a=a.shiftBlocks(s),e}function o(e,a){return a=a.shiftBlocks(s),e}function c(e,a){return a=a.shiftBlocks(s),e}e.register("theme/item/base",a);var s={headerContainer:i,contentSide:t};return a}(),{render:function(a,i){return e.render("theme/item/base",a,i)}}}),liveblog.define("themeFile",["css!theme/liveblog","plugins/button-pagination","plugins/twitter-widgets","plugins/post-hash","plugins/permanent-link","plugins/social-share","plugins/wrappup-toggle","plugins/user-comments","tmpl!theme/container","tmpl!theme/item/base"],function(){return{plugins:["button-pagination","twitter-widgets","post-hash","permanent-link","social-share","wrappup-toggle","user-comments"]}}); \ No newline at end of file +liveblog.define("plugins",{}),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.length96?e-87:e>64?e-29:e-48}function a(e){var a,t=0,n=e.split("."),r=n[0],o=n[1]||"",s=1,c=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').helper("i18n",i,{},{msgid:"Load more posts ..."}).write("")}function c(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:s,loadingNext:c,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 s(e,i){return i=i.shiftBlocks(u),e.write('Load top posts')}function c(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:s,loadingNext:c,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!themeBase/plugins/pending-items-message",["dust"],function(e){return function(){function i(e){return e.write('')}return e.register("themeBase/plugins/pending-items-message",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/pending-items-message",i,a)}}}),liveblog.define("plugins/pending-messages",["lib/gettext","plugins","lib/utils","dust","tmpl!themeBase/item/base","tmpl!themeBase/plugins/pending-items-message"],function(e,i,a,t){return i.pendingMessages=function(){var i={};a.dispatcher.once("initialize.blog-view",function(e){i=e}),a.dispatcher.once("after-render.blog-view",function(e){t.renderThemed("themeBase/plugins/pending-items-message",{},function(i,a){e.$('[data-gimme="posts.pending-message-placeholder"]').html(a)})}),a.isClient&&(a.dispatcher.once("initialize.posts-view",function(e){e.pauseAutoRender=function(){this.flags.autoRender=!1},e.resumeAutoRender=function(){this.flags.autoRender=!0},i.$el.on("click",'[data-gimme="posts.pending-message"],[data-gimme="posts.pending-message-holder"]',function(){e.renderPending()})}),a.dispatcher.on("update-pending.posts-view",function(a){var t="",n=a.pendingCounter;n>0&&(t=e.sprintf(e.ngettext("one new post","%(count)s new posts",n),{count:n})),i.$('[data-gimme="posts.pending-message"]').html(t).toggle(n>0),i.$('[data-gimme="posts.pending-message-holder"]').toggle(n>0)}))},i.pendingMessages}),liveblog.define("config/scroll-pagination-plugin",{scrollHeight:500,nextPageTriggerOffset:-200}),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,s,c,l,u,A,m,p,f,d,g,h,b,T;return n=a(t),A=e.call(t,"ontouchstart")>=0,s={horizontal:{},vertical:{}},c=1,u={},l="waypoints-context-id",f="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"+c++,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(f,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,s,c;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<(s=i.oldScroll)&&s<=t.offset?t.trigger([i.backward]):null!==o&&o>(c=i.oldScroll)&&c>=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([f,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,s[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 s[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({},s.horizontal,s.vertical),a.map(t,function(e){return i[e]})):[]},e}(),p={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,s;return e=a(this),n=null!=(s=i.context)?s: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 p._invoke.call(this,"disable")},enable:function(){return p._invoke.call(this,"enable")},destroy:function(){return p._invoke.call(this,"destroy")},prev:function(e,i){return p._traverse.call(this,e,i,function(e,i,a){return i>0?e.push(a[i-1]):void 0})},next:function(e,i){return p._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 p[e]=i},_invoke:function(e){var i;return i=a.extend({},s.vertical,s.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.define("plugins/scroll-pagination",["plugins","plugins/button-pagination","plugins/pending-messages","config/scroll-pagination-plugin","lib/utils"],function(e,i,a,t,n){return delete e["button-pagination"],delete e["pending-messages"],e["scroll-pagination"]=function(e){i(e),a(e),n.dispatcher.once("add-all.posts-view",function(e){e.$el.css("overflow-y","auto").css("overflow-x","auto").css("height",t.scrollHeight+"px")}),n.isClient&&(n.dispatcher.on("initialize.blog-view",function(e){r(e)}),n.dispatcher.on("pagination-next-updated.posts-view",function(e){e.hasNextPage()&&o(e,e.$('[data-gimme="posts.nextPage"]'))}),n.dispatcher.once("pagination-next-updated.posts-view",function(e){s(e)}));var r=function(e){e.clientEvents({'click [data-gimme="posts.to-top"]':"toTop",'click [data-gimme="posts.pending-message"]':"toTop"}),e.toTop=function(e){e.preventDefault(),this.$('[data-gimme="posts.list"]').scrollTop(0)}},o=function(e,i){liveblog.require(["waypoints"],function(){i.waypoint(function(){e.buttonNextPage()},{continuous:!1,triggerOnce:!0,offset:"100%",context:e.el})})},s=function(e){var i=e.$('[data-gimme="posts.beforePage"]');liveblog.require(["waypoints"],function(){i.waypoint(function(a){"down"===a&&(e.pauseAutoRender(),i.waypoint("destroy"),c(e))},{continuous:!1,offset:t.nextPageTriggerOffset,context:e.el})})},c=function(e){var i=e.firstPost().$el;liveblog.require(["waypoints"],function(){i.waypoint(function(a){"up"===a&&(e.renderPending(),e.resumeAutoRender(),i.waypoint("destroy"),s(e))},{continuous:!1,offset:-1,context:e.el})})}},e["scroll-pagination"]}),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/escape-RegExp",[],function(){var e=function(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")};return e}),liveblog.define("plugins/post-hash",["plugins","lib/utils","lib/helpers/escape-RegExp"],function(e,i,a){e["post-hash"]=function(){var e,t="liveblog.item.id",n=liveblog.hashmark?liveblog.hashmark:"?";e=i.isClient?window.location.href:liveblog.locationHref||"/",i.dispatcher.on("initialize.post-view",function(i){i.permalink=function(r){var o=r&&r.hashMark?r.hashMark:n,s=!1,c=t+"="+parseFloat(i.model.get("Order"));if(-1===e.indexOf(o))s=e+o+c;else if(-1!==e.indexOf(t+"=")){var l=new RegExp(a(t)+"=[^&#]*");s=e.replace(l,c)}else s=e+"&"+c;return s}}),i.dispatcher.on("initialize.posts-view",function(i){var a=e.indexOf(t+"=");-1!==a&&(i.collection.syncParams.pagination["order.end"]=parseFloat(e.substr(a+t.length+1)),i.flags.hasTopPage=!0,i.flags.autoRender=!1)})}}),liveblog.define("lib/helpers/visibility-toggle",[],function(){var e=function(e,i){var a="";return a=void 0!==i?i?"visible":"hidden":"visible"===e.css("visibility")?"hidden":"visible",e.css("visibility",a),"visible"===a?!0:!1};return e}),liveblog.define("tmpl!themeBase/plugins/permanent-link",["dust"],function(e){return function(){function i(e){return e.write('')}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/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,s,c){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")&&s(o,!1),s(r)},e.openShareWindow=function(e){e.preventDefault();var i=this.$(e.target).data("gimme"),a=c.shareWindowSize[i].h,t=c.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()),s="";i.permalink&&"function"==typeof i.permalink&&(s=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(c.fbURLImageComp,[i,e.$(this).attr("src")])});var A={pin:[s,l,t],twt:[r.gettext("Now reading"),t,s],lin:[s,t,n],ggl:[s],email:[r.gettext("Check out this Live Blog"),s],fb:[t,n,s,u]};return A},l=function(e){var a={};return delete e.email,i.each(e,function(i,t){a[t]=r.sprintf(c.urls[t],e[t])}),a},u=function(e){var i={};return i.emailurl=r.sprintf(c.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/wrappup-toggle",["backbone","underscore","plugins","lib/utils","dust"],function(e,i,a,t){var n={hide:"slideUp",show:"slideDown"};t.isClient&&t.dispatcher.once("initialize.posts-view",function(e){e.clientEvents({'click [data-gimme="post.wrapup"]':"wrapupToggle"}),e.wrapupToggle=function(i){var a=e.$(i.target).closest('[data-gimme="post.wrapup"]'),t=a.attr("data-wrapup-open");a.hasClass(t)?(a.removeClass(t),a.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.hide]()):(a.addClass(t),a.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.show]())}})}),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"]}),liveblog.define("plugins/status",["backbone","plugins","lib/utils","lib/gettext","moment"],function(e,i,a,t,n){return a.isClient?(i.status=function(){a.dispatcher.on("initialize.blog-view",function(e){a.dispatcher.on("after-poller.blog-model conditional-render.blog-view",function(){var i=t.sprintf('',n().milliseconds(),n().format(t.pgettext("moment","status-time")));e.$('[data-gimme="blog.status"]').html(t.sprintf(t.gettext("updated at %s"),i))}),a.dispatcher.on("before-poller.blog-model",function(){e.$('[data-gimme="blog.status"]').html(t.gettext("updating..."))})})},i.status):void 0}),liveblog.define("tmpl!theme/container",["dust"],function(e){return function(){function i(e,i){return i=i.shiftBlocks(t),e.partial("themeBase/container",i,null)}function a(e,i){return i=i.shiftBlocks(t),e}e.register("theme/container",i);var t={contentBottomContainer:a};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(c),e.partial("themeBase/item/base",i,null)}function a(e,i){return i=i.shiftBlocks(c),e}function t(e,i){return i=i.shiftBlocks(c),e.block(i.getBlock("postDateContainer"),i,{block:n},null).block(i.getBlock("userAvatar"),i,{block:r},null).block(i.getBlock("userNameContainer"),i,{block:o},null).write('').block(i.getBlock("shareContainer"),i,{block:s},null)}function n(e,i){return i=i.shiftBlocks(c),e}function r(e,i){return i=i.shiftBlocks(c),e}function o(e,i){return i=i.shiftBlocks(c),e}function s(e,i){return i=i.shiftBlocks(c),e}e.register("theme/item/base",i);var c={headerContainer:a,contentSide:t};return i}(),{render:function(i,a){return e.render("theme/item/base",i,a)}}}),liveblog.define("themeFile",["css!theme/liveblog","plugins/scroll-pagination","plugins/twitter-widgets","plugins/post-hash","plugins/permanent-link","plugins/social-share","plugins/wrappup-toggle","plugins/user-comments","plugins/status","tmpl!theme/container","tmpl!theme/item/base"],function(){return{plugins:["scroll-pagination","twitter-widgets","post-hash","permanent-link","social-share","wrappup-toggle","user-comments","status"]} +}); \ No newline at end of file diff --git a/gui-resources/scripts/js/build/themes/satakansa/desktop.js b/gui-resources/scripts/js/build/themes/satakansa/desktop.js index 691209d25..77c667b23 100644 --- a/gui-resources/scripts/js/build/themes/satakansa/desktop.js +++ b/gui-resources/scripts/js/build/themes/satakansa/desktop.js @@ -1,2 +1,3 @@ -liveblog.define("plugins",{}),liveblog.define("plugins/pagination",["plugins","lib/utils"],function(e,a){return e.pagination=function(){a.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()){a.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,a.dispatcher.trigger("loaded.posts-view",e)})}},e.hasNextPage=function(){return this.collection.length96?e-87:e>64?e-29:e-48}function i(e){var i,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;ti;i++)e[i]=Math.round((e[i-1]||0)+6e4*e[i]);e[a-1]=1/0}function r(e,a){var i,t=[];for(i=0;i').helper("i18n",a,{},{msgid:"Load more posts ..."}).write("")}function s(e,a){return a=a.shiftBlocks(u),e.write('')}function l(e,a){return a=a.shiftBlocks(u),e.write('data-gimme="posts.nextPage"')}e.register("themeBase/plugins/after-button-pagination",a); -var u={itemClass:t,main:n,loadNext:c,loadingNext:s,additionalAttributes:l};return a}(),{render:function(a,i){return e.render("themeBase/plugins/after-button-pagination",a,i)}}}),liveblog.define("tmpl!themeBase/plugins/before-button-pagination",["dust"],function(e){return function(){function a(e,a){return a=a.shiftBlocks(u),e.partial(i,a,null)}function i(e,a){return a=a.shiftBlocks(u),e.reference(a.get(["baseItem"],!1),a,"h")}function t(e,a){return a=a.shiftBlocks(u),e.write("load-next")}function n(e,a){return a=a.shiftBlocks(u),e.block(a.getBlock("loadNext"),a,{block:r},null).block(a.getBlock("loadingNext"),a,{block:o},null)}function r(e,a){return a=a.shiftBlocks(u),e}function o(e,a){return a=a.shiftBlocks(u),e}function c(e,a){return a=a.shiftBlocks(u),e.write('Load top posts')}function s(e,a){return a=a.shiftBlocks(u),e.write('')}function l(e,a){return a=a.shiftBlocks(u),e.write('data-gimme="posts.beforePage"')}e.register("themeBase/plugins/before-button-pagination",a);var u={itemClass:t,main:n,loadNext:c,loadingNext:s,additionalAttributes:l};return a}(),{render:function(a,i){return e.render("themeBase/plugins/before-button-pagination",a,i)}}}),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,a,i,t,n,r){return delete a.pagination,a["button-pagination"]=function(a){i(a),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(a){var i={};i.baseItem=t.themed("themeBase/item/base"),0===a.$('[data-gimme="posts.beforePage"]').length&&t.renderThemed("themeBase/plugins/before-button-pagination",i,function(i,t){var n=e.$(t);r(n,!1),a.$el.prepend(n)}),0===a.$('[data-gimme="posts.nextPage"]').length&&t.renderThemed("themeBase/plugins/after-button-pagination",i,function(i,t){var n=e.$(t);r(n,!1),a.$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 a=e.$('[data-gimme="posts.nextPage"]');a.addClass("loading"),e.nextPage().done(function(){e.flags.buttonNextPage=!1,a.removeClass("loading"),e.checkNextPage()})},e.buttonTopPage=function(){var a=e.$('[data-gimme="posts.beforePage"]');a.addClass("loading"),e.flags.topPage=!1,e.topPage().done(function(){a.removeClass("loading"),r(a,!1),e.checkNextPage()})}})},a["button-pagination"]}),function(){var e=[].indexOf||function(e){for(var a=0,i=this.length;i>a;a++)if(a in this&&this[a]===e)return a;return-1},a=[].slice;!function(e,a){return"function"==typeof liveblog.define&&liveblog.define.amd?liveblog.define("waypoints",["jquery"],function(i){return a(i,e)}):a(e.jQuery,e)}(window,function(i,t){var n,r,o,c,s,l,u,A,m,f,p,d,g,h,b,T;return n=i(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 a=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 a.didScroll||A?void 0:(a.didScroll=!0,e=function(){return a.doScroll(),a.didScroll=!1},t.setTimeout(e,i[T].settings.scrollThrottle))}),e.bind(p,function(){var e;return a.didResize?void 0:(a.didResize=!0,e=function(){return i[T]("refresh"),a.didResize=!1},t.setTimeout(e,i[T].settings.resizeThrottle))})}return e.prototype.doScroll=function(){var e,a=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||i[T]("refresh"),i.each(e,function(e,t){var n,r,o;return o=[],r=t.newScroll>t.oldScroll,n=r?t.forward:t.backward,i.each(a.waypoints[e],function(e,a){var i,n;return t.oldScroll<(i=a.offset)&&i<=t.newScroll?o.push(a):t.newScroll<(n=a.offset)&&n<=t.oldScroll?o.push(a):void 0}),o.sort(function(e,a){return e.offset-a.offset}),r||o.reverse(),i.each(o,function(e,a){return a.options.continuous||e===o.length-1?a.trigger([n]):void 0})}),this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},e.prototype.refresh=function(){var e,a,t,n=this;return t=i.isWindow(this.element),a=this.$element.offset(),this.doScroll(),e={horizontal:{contextOffset:t?0:a.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:a.top,contextScroll:t?0:this.oldScroll.y,contextDimension:t?i[T]("viewportHeight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}},i.each(e,function(e,a){return i.each(n.waypoints[e],function(e,t){var n,r,o,c,s;return n=t.options.offset,o=t.offset,r=i.isWindow(t.element)?0:t.$element.offset()[a.offsetProp],i.isFunction(n)?n=n.apply(t.element):"string"==typeof n&&(n=parseFloat(n),t.options.offset.indexOf("%")>-1&&(n=Math.ceil(a.contextDimension*n/100))),t.offset=r-a.contextOffset+a.contextScroll-n,t.options.onlyOnScroll&&null!=o||!t.enabled?void 0:null!==o&&o<(c=a.oldScroll)&&c<=t.offset?t.trigger([a.backward]):null!==o&&o>(s=a.oldScroll)&&s>=t.offset?t.trigger([a.forward]):null===o&&a.oldScroll>=t.offset?t.trigger([a.forward]):void 0})})},e.prototype.checkEmpty=function(){return i.isEmptyObject(this.waypoints.horizontal)&&i.isEmptyObject(this.waypoints.vertical)?(this.$element.unbind([p,d].join(" ")),delete u[this.id]):void 0},e}(),o=function(){function e(e,a,t){var n,r;"bottom-in-view"===t.offset&&(t.offset=function(){var e;return e=i[T]("viewportHeight"),i.isWindow(a.element)||(e=a.$element.height()),e-i(this).outerHeight()}),this.$element=e,this.element=e[0],this.axis=t.horizontal?"horizontal":"vertical",this.callback=t.handler,this.context=a,this.enabled=t.enabled,this.id="waypoints"+g++,this.offset=null,this.options=t,a.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 a,t;return(t=e[h])?(a=i.extend({},c.horizontal,c.vertical),i.map(t,function(e){return a[e]})):[]},e}(),f={init:function(e,a){var t;return a=i.extend({},i.fn[b].defaults,a),null==(t=a.handler)&&(a.handler=e),this.each(function(){var e,t,n,c;return e=i(this),n=null!=(c=a.context)?c:i.fn[b].defaults.context,i.isWindow(n)||(n=e.closest(n)),n=i(n),t=u[n[0][l]],t||(t=new r(n)),new o(e,t,a)}),i[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,a){return f._traverse.call(this,e,a,function(e,a,i){return a>0?e.push(i[a-1]):void 0})},next:function(e,a){return f._traverse.call(this,e,a,function(e,a,i){return ae.oldScroll.y})},left:function(e){return null==e&&(e=t),m._filter(e,"horizontal",function(e,a){return a.offset<=e.oldScroll.x})},right:function(e){return null==e&&(e=t),m._filter(e,"horizontal",function(e,a){return a.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,a){return f[e]=a},_invoke:function(e){var a;return a=i.extend({},c.vertical,c.horizontal),i.each(a,function(a,i){return i[e](),!0})},_filter:function(e,a,t){var n,r;return(n=u[i(e)[0][l]])?(r=[],i.each(n.waypoints[a],function(e,a){return t(n,a)?r.push(a):void 0}),r.sort(function(e,a){return e.offset-a.offset}),i.map(r,function(e){return e.element})):[]}},i[T]=function(){var e,i;return i=arguments[0],e=2<=arguments.length?a.call(arguments,1):[],m[i]?m[i].apply(null,e):m.aggregate.call(null,i)},i[T].settings={resizeThrottle:100,scrollThrottle:30},n.on("load.waypoints",function(){return i[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,a,i,t,n){return i["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){a(e)});var a=function(a){a._twitterPosts&&liveblog.require(["twitterWidgets","waypoints"],function(i){i.ready(function(){e.each(a._twitterPosts,function(e){e.$el.waypoint(function(){var a=e.model.get("Meta").id_str;i.widgets.createTweet(a,e.$el.find(".post-content-full").get(0),function(){e.$el.find(".post-core-content").remove()},{cards:"all"})},{triggerOnce:!0,offset:"120%",context:a.el})}),a._twitterPosts=[]})},function(){})}}},i["twitter-widgets"]}),liveblog.define("lib/helpers/escape-RegExp",[],function(){var e=function(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")};return e}),liveblog.define("plugins/post-hash",["plugins","lib/utils","lib/helpers/escape-RegExp"],function(e,a,i){e["post-hash"]=function(){var e,t="liveblog.item.id",n=liveblog.hashmark?liveblog.hashmark:"?";e=a.isClient?window.location.href:liveblog.locationHref||"/",a.dispatcher.on("initialize.post-view",function(a){a.permalink=function(r){var o=r&&r.hashMark?r.hashMark:n,c=!1,s=t+"="+parseFloat(a.model.get("Order"));if(-1===e.indexOf(o))c=e+o+s;else if(-1!==e.indexOf(t+"=")){var l=new RegExp(i(t)+"=[^&#]*");c=e.replace(l,s)}else c=e+"&"+s;return c}}),a.dispatcher.on("initialize.posts-view",function(a){var i=e.indexOf(t+"=");-1!==i&&(a.collection.syncParams.pagination["order.end"]=parseFloat(e.substr(i+t.length+1)),a.flags.hasTopPage=!0,a.flags.autoRender=!1)})}}),liveblog.define("lib/helpers/visibility-toggle",[],function(){var e=function(e,a){var i="";return i=void 0!==a?a?"visible":"hidden":"visible"===e.css("visibility")?"hidden":"visible",e.css("visibility",i),"visible"===i?!0:!1};return e}),liveblog.define("tmpl!themeBase/plugins/permanent-link",["dust"],function(e){return function(){function a(e){return e.write('')}return e.register("themeBase/plugins/permanent-link",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/permanent-link",a,i)}}}),liveblog.define("plugins/permanent-link",["plugins","lib/utils","dust","lib/helpers/visibility-toggle","tmpl!themeBase/item/base","tmpl!themeBase/plugins/permanent-link"],function(e,a,i,t){return a.isClient?(e.permalink=function(){a.dispatcher.on("after-render.post-view",function(e){i.renderThemed("themeBase/plugins/permanent-link",{},function(a,i){e.$('[data-gimme="post.permanent-link-placeholder"]').html(i)});var a="";e.permalink&&"function"==typeof e.permalink&&(a=e.permalink(),e.$('[data-gimme="post.share-permalink"]').val(a),e.$('[data-gimme="post.permalink"]').attr("href",a))}),a.dispatcher.on("initialize.post-view",function(e){e.clientEvents({'click [data-gimme="post.permalink"]':"permalinkAction"}),e.permalinkAction=function(e){e.preventDefault();var a=this.$('[data-gimme="post.share-permalink"]');if(t(a)){var i=this.$('[data-gimme^="post.share"][data-gimme!="post.share-permalink"]');t(i,!1),a.trigger("focus")}},e.clientEvents({'click [data-gimme="post.share-permalink"]':"permalinkInput",'focus [data-gimme="post.share-permalink"]':"permalinkInput"}),e.permalinkInput=function(a){e.$(a.target).select()},e.delegateEvents()})},e.permalink):void 0}),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 a(e,a){return e.write('').helper("i18n",a,{},{msgid:"Share"}).write("")}return e.register("themeBase/plugins/social-share-anchor",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/social-share-anchor",a,i)}}}),liveblog.define("tmpl!themeBase/plugins/social-share",["dust"],function(e){return function(){function a(e,a){return e.write('')}function i(e,a){return e.write('')}return e.register("themeBase/plugins/social-share",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/social-share",a,i)}}}),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,a,i,t,n,r,o,c,s){t.isClient&&(i["social-share"]=function(){t.dispatcher.on("after-render.post-view",function(e){n.renderThemed("themeBase/plugins/social-share-anchor",{},function(a,i){e.$('[data-gimme="post.social-share-placeholder"]').html(i)})}),t.dispatcher.on("initialize.post-view",function(e){e.clientEvents({'click [data-gimme="post.social"]':"share"}),e.share=function(e){e.preventDefault();var a=this,t=i(a);a.socialShareUrls=l(t),n.renderThemed("themeBase/plugins/social-share",u(t),function(e,i){a.$('[data-gimme="post.social-share-placeholder"]').append(i)}),A(a);var r=a.$('[data-gimme="post.share-social"]'),o=a.$('[data-gimme^="post.share"]');"hidden"===r.css("visibility")&&c(o,!1),c(r)},e.openShareWindow=function(e){e.preventDefault();var a=this.$(e.target).data("gimme"),i=s.shareWindowSize[a].h,t=s.shareWindowSize[a].w,n=this.socialShareUrls[a],r="resizable, height="+i+", width="+t,o=window.open(n,"",r);return o.focus(),!1}});var i=function(a){var i=a.parentView().parentView().model,t=o(i.get("Title")),n=o(a.$(".result-content .result-text:last").text()),c="";a.permalink&&"function"==typeof a.permalink&&(c=o(a.permalink()));var l=a.$(".result-content img:first").attr("src");l||(l=e.$("img:first").attr("src"));var u="";a.$(".result-content img").each(function(a){u+=r.sprintf(s.fbURLImageComp,[a,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 i={};return delete e.email,a.each(e,function(a,t){i[t]=r.sprintf(s.urls[t],e[t])}),i},u=function(e){var a={};return a.emailurl=r.sprintf(s.urls.email,e.email),a},A=function(e){var i={};a.each(e.socialShareUrls,function(e,a){i['click [data-gimme="'+a+'"]']="openShareWindow"}),e.clientEvents(i),e.delegateEvents()}})}),liveblog.define("plugins/wrappup-toggle",["backbone","underscore","plugins","lib/utils","dust"],function(e,a,i,t){var n={hide:"slideUp",show:"slideDown"};t.isClient&&t.dispatcher.once("initialize.posts-view",function(e){e.clientEvents({'click [data-gimme="post.wrapup"]':"wrapupToggle"}),e.wrapupToggle=function(a){var i=e.$(a.target).closest('[data-gimme="post.wrapup"]'),t=i.attr("data-wrapup-open");i.hasClass(t)?(i.removeClass(t),i.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.hide]()):(i.addClass(t),i.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.show]())}})}),liveblog.define("lib/helpers/format-commentator",["underscore","lib/gettext"],function(e,a){return function(e){return e=e.replace("commentator",""),a.sprintf(a.gettext("%(full_name)s commentator"),{full_name:e})}}),liveblog.define("lib/helpers/adjust-server-post",["underscore"],function(){return function(e){var a="infomercial";return"advertisement"===e.Type.Key&&(e.Type.Key=a),"advertisement"===e.Author.Source.Name&&(e.Author.Source.Name=a),"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,a,i){return i.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,a,i,t,n){return i.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 a=this,i=a.backdropel.data("show-status");switch(e.preventDefault(),i){case 0:t(a.popup,!0),a.backdropel.data("show-status",1),t(a.backdropel,!0),a.lbpostlist.addClass("comment-active"),a.blogview.stopPoller();break;case 1:a.backdropel.data("show-status",0).hide(),t(a.popup_message,!1),a.resetInput(),a.lbpostlist.removeClass("comment-active"),t(a.popup,!1),a.blogview.starPoller();break;case 2:t(a.popup_message,!1),a.resetInput(),a.lbpostlist.removeClass("comment-active"),t(a.popup,!1),a.blogview.starPoller()}},send:function(e){e.preventDefault();var a=this;if(this.isValid()){var i=new n,t={UserName:this.username.val(),CommentText:this.text.val()};i.setUrlRoot(this.model.get("CommentPost").href),i.save(t,{success:function(){a.showAfterMessage(e),a.resetInput()},error:function(){a.showAfterMessage(e),a.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 a(e,a){return e.write('
      ').helper("i18n",a,{},{msgid:"Your message was sent for approval"}).write("
      ")}return e.register("themeBase/plugins/user-comment-message",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/user-comment-message",a,i)}}}),liveblog.define("tmpl!themeBase/plugins/user-comment-backdrop",["dust"],function(e){return function(){function a(e){return e.write('
      ')}return e.register("themeBase/plugins/user-comment-backdrop",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/user-comment-backdrop",a,i)}}}),liveblog.define("tmpl!themeBase/plugins/user-comment-action",["dust"],function(e){return function(){function a(e,a){return e.write('").helper("i18n",a,{},{msgid:"comment"}).write("")}function i(e){return e.write(' style="display:none" ')}function t(e){return e.write(' style="display:block" ')}return e.register("themeBase/plugins/user-comment-action",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/user-comment-action",a,i)}}}),liveblog.define("tmpl!themeBase/plugins/user-comment",["dust"],function(e){return function(){function a(e,a){return e.write('
      ').helper("i18n",a,{},{msgid:"Please fill in your Nickname."}).write('
      ').helper("i18n",a,{},{msgid:"Please fill in your Comment text."}).write('
      ').helper("i18n",a,{},{msgid:"Please fill in text from image."}).write('
      ")}return e.register("themeBase/plugins/user-comment",a),a}(),{render:function(a,i){return e.render("themeBase/plugins/user-comment",a,i)}}}),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,a,i,t,n){return e["user-comments"]=function(e){i.dispatcher.on("config-update.blog-view",function(e){n(e.$('[data-gimme="blog.comment"]'),e.model.get("EmbedConfig").UserComments)}),i.dispatcher.on("conditional-render.blog-view",function(r){if(t.renderThemed("themeBase/plugins/user-comment-action",{UserComments:r.model.get("EmbedConfig").UserComments},function(e,a){r.$('[data-gimme="blog.comment-action"]').html(a)}),n(r.$('[data-gimme="blog.comment"]'),e.UserComments),t.renderThemed("themeBase/plugins/user-comment",{},function(e,a){r.$('[data-gimme="blog.comment-box"]').html(a)}),t.renderThemed("themeBase/plugins/user-comment-message",{},function(e,a){r.$('[data-gimme="blog.comment-box-message"]').html(a)}),t.renderThemed("themeBase/plugins/user-comment-backdrop",{},function(e,a){r.$('[data-gimme="blog.comment-box-backdrop"]').html(a)}),i.isClient){new a({el:r.el,blogview:r,model:r.model})}})},e["user-comments"]}),liveblog.define("tmpl!theme/container",["dust"],function(e){return function(){function a(e,a){return a=a.shiftBlocks(o),e.partial("themeBase/container",a,null)}function i(e,a){return a=a.shiftBlocks(o),e.write('
      ').block(a.getBlock("header"),a,{block:t},null).write("
      ")}function t(e,a){return a=a.shiftBlocks(o),e.block(a.getBlock("blogMedia"),a,{block:n},null)}function n(e,a){return a=a.shiftBlocks(o),e}function r(e,a){return a=a.shiftBlocks(o),e}e.register("theme/container",a);var o={headerContainer:i,contentBottomContainer:r};return a}(),{render:function(a,i){return e.render("theme/container",a,i)}}}),liveblog.define("tmpl!theme/item/base",["dust"],function(e){return function(){function a(e,a){return a=a.shiftBlocks(s),e.partial("themeBase/item/base",a,null)}function i(e,a){return a=a.shiftBlocks(s),e}function t(e,a){return a=a.shiftBlocks(s),e.block(a.getBlock("postDateContainer"),a,{block:n},null).block(a.getBlock("userAvatar"),a,{block:r},null).block(a.getBlock("userNameContainer"),a,{block:o},null).block(a.getBlock("shareContainer"),a,{block:c},null)}function n(e,a){return a=a.shiftBlocks(s),e}function r(e,a){return a=a.shiftBlocks(s),e}function o(e,a){return a=a.shiftBlocks(s),e}function c(e,a){return a=a.shiftBlocks(s),e}e.register("theme/item/base",a);var s={headerContainer:i,contentSide:t};return a}(),{render:function(a,i){return e.render("theme/item/base",a,i)}}}),liveblog.define("themeFile",["css!theme/liveblog","plugins/button-pagination","plugins/twitter-widgets","plugins/post-hash","plugins/permanent-link","plugins/social-share","plugins/wrappup-toggle","plugins/user-comments","tmpl!theme/container","tmpl!theme/item/base"],function(){return{plugins:["button-pagination","twitter-widgets","post-hash","permanent-link","social-share","wrappup-toggle","user-comments"]}}); \ No newline at end of file +liveblog.define("plugins",{}),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.length96?e-87:e>64?e-29:e-48}function a(e){var a,t=0,n=e.split("."),r=n[0],o=n[1]||"",s=1,c=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').helper("i18n",i,{},{msgid:"Load more posts ..."}).write("")}function c(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:s,loadingNext:c,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 s(e,i){return i=i.shiftBlocks(u),e.write('Load top posts')}function c(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:s,loadingNext:c,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!themeBase/plugins/pending-items-message",["dust"],function(e){return function(){function i(e){return e.write('')}return e.register("themeBase/plugins/pending-items-message",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/pending-items-message",i,a)}}}),liveblog.define("plugins/pending-messages",["lib/gettext","plugins","lib/utils","dust","tmpl!themeBase/item/base","tmpl!themeBase/plugins/pending-items-message"],function(e,i,a,t){return i.pendingMessages=function(){var i={};a.dispatcher.once("initialize.blog-view",function(e){i=e}),a.dispatcher.once("after-render.blog-view",function(e){t.renderThemed("themeBase/plugins/pending-items-message",{},function(i,a){e.$('[data-gimme="posts.pending-message-placeholder"]').html(a)})}),a.isClient&&(a.dispatcher.once("initialize.posts-view",function(e){e.pauseAutoRender=function(){this.flags.autoRender=!1},e.resumeAutoRender=function(){this.flags.autoRender=!0},i.$el.on("click",'[data-gimme="posts.pending-message"],[data-gimme="posts.pending-message-holder"]',function(){e.renderPending()})}),a.dispatcher.on("update-pending.posts-view",function(a){var t="",n=a.pendingCounter;n>0&&(t=e.sprintf(e.ngettext("one new post","%(count)s new posts",n),{count:n})),i.$('[data-gimme="posts.pending-message"]').html(t).toggle(n>0),i.$('[data-gimme="posts.pending-message-holder"]').toggle(n>0)}))},i.pendingMessages}),liveblog.define("config/scroll-pagination-plugin",{scrollHeight:500,nextPageTriggerOffset:-200}),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,s,c,l,u,A,m,p,f,d,g,h,b,T;return n=a(t),A=e.call(t,"ontouchstart")>=0,s={horizontal:{},vertical:{}},c=1,u={},l="waypoints-context-id",f="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"+c++,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(f,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,s,c;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<(s=i.oldScroll)&&s<=t.offset?t.trigger([i.backward]):null!==o&&o>(c=i.oldScroll)&&c>=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([f,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,s[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 s[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({},s.horizontal,s.vertical),a.map(t,function(e){return i[e]})):[]},e}(),p={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,s;return e=a(this),n=null!=(s=i.context)?s: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 p._invoke.call(this,"disable")},enable:function(){return p._invoke.call(this,"enable")},destroy:function(){return p._invoke.call(this,"destroy")},prev:function(e,i){return p._traverse.call(this,e,i,function(e,i,a){return i>0?e.push(a[i-1]):void 0})},next:function(e,i){return p._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 p[e]=i},_invoke:function(e){var i;return i=a.extend({},s.vertical,s.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.define("plugins/scroll-pagination",["plugins","plugins/button-pagination","plugins/pending-messages","config/scroll-pagination-plugin","lib/utils"],function(e,i,a,t,n){return delete e["button-pagination"],delete e["pending-messages"],e["scroll-pagination"]=function(e){i(e),a(e),n.dispatcher.once("add-all.posts-view",function(e){e.$el.css("overflow-y","auto").css("overflow-x","auto").css("height",t.scrollHeight+"px")}),n.isClient&&(n.dispatcher.on("initialize.blog-view",function(e){r(e)}),n.dispatcher.on("pagination-next-updated.posts-view",function(e){e.hasNextPage()&&o(e,e.$('[data-gimme="posts.nextPage"]'))}),n.dispatcher.once("pagination-next-updated.posts-view",function(e){s(e)}));var r=function(e){e.clientEvents({'click [data-gimme="posts.to-top"]':"toTop",'click [data-gimme="posts.pending-message"]':"toTop"}),e.toTop=function(e){e.preventDefault(),this.$('[data-gimme="posts.list"]').scrollTop(0)}},o=function(e,i){liveblog.require(["waypoints"],function(){i.waypoint(function(){e.buttonNextPage()},{continuous:!1,triggerOnce:!0,offset:"100%",context:e.el})})},s=function(e){var i=e.$('[data-gimme="posts.beforePage"]');liveblog.require(["waypoints"],function(){i.waypoint(function(a){"down"===a&&(e.pauseAutoRender(),i.waypoint("destroy"),c(e))},{continuous:!1,offset:t.nextPageTriggerOffset,context:e.el})})},c=function(e){var i=e.firstPost().$el;liveblog.require(["waypoints"],function(){i.waypoint(function(a){"up"===a&&(e.renderPending(),e.resumeAutoRender(),i.waypoint("destroy"),s(e))},{continuous:!1,offset:-1,context:e.el})})}},e["scroll-pagination"]}),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/escape-RegExp",[],function(){var e=function(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")};return e}),liveblog.define("plugins/post-hash",["plugins","lib/utils","lib/helpers/escape-RegExp"],function(e,i,a){e["post-hash"]=function(){var e,t="liveblog.item.id",n=liveblog.hashmark?liveblog.hashmark:"?";e=i.isClient?window.location.href:liveblog.locationHref||"/",i.dispatcher.on("initialize.post-view",function(i){i.permalink=function(r){var o=r&&r.hashMark?r.hashMark:n,s=!1,c=t+"="+parseFloat(i.model.get("Order"));if(-1===e.indexOf(o))s=e+o+c;else if(-1!==e.indexOf(t+"=")){var l=new RegExp(a(t)+"=[^&#]*");s=e.replace(l,c)}else s=e+"&"+c;return s}}),i.dispatcher.on("initialize.posts-view",function(i){var a=e.indexOf(t+"=");-1!==a&&(i.collection.syncParams.pagination["order.end"]=parseFloat(e.substr(a+t.length+1)),i.flags.hasTopPage=!0,i.flags.autoRender=!1)})}}),liveblog.define("lib/helpers/visibility-toggle",[],function(){var e=function(e,i){var a="";return a=void 0!==i?i?"visible":"hidden":"visible"===e.css("visibility")?"hidden":"visible",e.css("visibility",a),"visible"===a?!0:!1};return e}),liveblog.define("tmpl!themeBase/plugins/permanent-link",["dust"],function(e){return function(){function i(e){return e.write('')}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/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,s,c){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")&&s(o,!1),s(r)},e.openShareWindow=function(e){e.preventDefault();var i=this.$(e.target).data("gimme"),a=c.shareWindowSize[i].h,t=c.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()),s="";i.permalink&&"function"==typeof i.permalink&&(s=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(c.fbURLImageComp,[i,e.$(this).attr("src")])});var A={pin:[s,l,t],twt:[r.gettext("Now reading"),t,s],lin:[s,t,n],ggl:[s],email:[r.gettext("Check out this Live Blog"),s],fb:[t,n,s,u]};return A},l=function(e){var a={};return delete e.email,i.each(e,function(i,t){a[t]=r.sprintf(c.urls[t],e[t])}),a},u=function(e){var i={};return i.emailurl=r.sprintf(c.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/wrappup-toggle",["backbone","underscore","plugins","lib/utils","dust"],function(e,i,a,t){var n={hide:"slideUp",show:"slideDown"};t.isClient&&t.dispatcher.once("initialize.posts-view",function(e){e.clientEvents({'click [data-gimme="post.wrapup"]':"wrapupToggle"}),e.wrapupToggle=function(i){var a=e.$(i.target).closest('[data-gimme="post.wrapup"]'),t=a.attr("data-wrapup-open");a.hasClass(t)?(a.removeClass(t),a.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.hide]()):(a.addClass(t),a.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.show]())}})}),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"]}),liveblog.define("plugins/status",["backbone","plugins","lib/utils","lib/gettext","moment"],function(e,i,a,t,n){return a.isClient?(i.status=function(){a.dispatcher.on("initialize.blog-view",function(e){a.dispatcher.on("after-poller.blog-model conditional-render.blog-view",function(){var i=t.sprintf('',n().milliseconds(),n().format(t.pgettext("moment","status-time")));e.$('[data-gimme="blog.status"]').html(t.sprintf(t.gettext("updated at %s"),i))}),a.dispatcher.on("before-poller.blog-model",function(){e.$('[data-gimme="blog.status"]').html(t.gettext("updating..."))})})},i.status):void 0}),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("blogMedia"),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(c),e.partial("themeBase/item/base",i,null)}function a(e,i){return i=i.shiftBlocks(c),e}function t(e,i){return i=i.shiftBlocks(c),e.block(i.getBlock("postDateContainer"),i,{block:n},null).block(i.getBlock("userAvatar"),i,{block:r},null).block(i.getBlock("userNameContainer"),i,{block:o},null).block(i.getBlock("shareContainer"),i,{block:s},null)}function n(e,i){return i=i.shiftBlocks(c),e}function r(e,i){return i=i.shiftBlocks(c),e}function o(e,i){return i=i.shiftBlocks(c),e}function s(e,i){return i=i.shiftBlocks(c),e +}e.register("theme/item/base",i);var c={headerContainer:a,contentSide:t};return i}(),{render:function(i,a){return e.render("theme/item/base",i,a)}}}),liveblog.define("themeFile",["css!theme/liveblog","plugins/scroll-pagination","plugins/twitter-widgets","plugins/post-hash","plugins/permanent-link","plugins/social-share","plugins/wrappup-toggle","plugins/user-comments","plugins/status","tmpl!theme/container","tmpl!theme/item/base"],function(){return{plugins:["scroll-pagination","twitter-widgets","post-hash","permanent-link","social-share","wrappup-toggle","user-comments","status"]}}); \ No newline at end of file diff --git a/gui-resources/scripts/js/build/themes/stt-fnb/desktop.js b/gui-resources/scripts/js/build/themes/stt-fnb/desktop.js index 83ae7c98c..517c2edc9 100644 --- a/gui-resources/scripts/js/build/themes/stt-fnb/desktop.js +++ b/gui-resources/scripts/js/build/themes/stt-fnb/desktop.js @@ -1,2 +1,3 @@ liveblog.define("plugins",{}),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.length96?e-87:e>64?e-29:e-48}function a(e){var a,t=0,n=e.split("."),r=n[0],o=n[1]||"",s=1,c=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').helper("i18n",i,{},{msgid:"Load more posts ..."}).write("")}function c(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:s,loadingNext:c,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 s(e,i){return i=i.shiftBlocks(u),e.write('Load top posts')}function c(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:s,loadingNext:c,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!themeBase/plugins/pending-items-message",["dust"],function(e){return function(){function i(e){return e.write('')}return e.register("themeBase/plugins/pending-items-message",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/pending-items-message",i,a)}}}),liveblog.define("plugins/pending-messages",["lib/gettext","plugins","lib/utils","dust","tmpl!themeBase/item/base","tmpl!themeBase/plugins/pending-items-message"],function(e,i,a,t){return i.pendingMessages=function(){var i={};a.dispatcher.once("initialize.blog-view",function(e){i=e}),a.dispatcher.once("after-render.blog-view",function(e){t.renderThemed("themeBase/plugins/pending-items-message",{},function(i,a){e.$('[data-gimme="posts.pending-message-placeholder"]').html(a)})}),a.isClient&&(a.dispatcher.once("initialize.posts-view",function(e){e.pauseAutoRender=function(){this.flags.autoRender=!1},e.resumeAutoRender=function(){this.flags.autoRender=!0},i.$el.on("click",'[data-gimme="posts.pending-message"],[data-gimme="posts.pending-message-holder"]',function(){e.renderPending()})}),a.dispatcher.on("update-pending.posts-view",function(a){var t="",n=a.pendingCounter;n>0&&(t=e.sprintf(e.ngettext("one new post","%(count)s new posts",n),{count:n})),i.$('[data-gimme="posts.pending-message"]').html(t).toggle(n>0),i.$('[data-gimme="posts.pending-message-holder"]').toggle(n>0)}))},i.pendingMessages}),liveblog.define("config/scroll-pagination-plugin",{scrollHeight:500,nextPageTriggerOffset:-200}),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,s,c,l,u,A,m,p,f,d,g,h,b,T;return n=a(t),A=e.call(t,"ontouchstart")>=0,s={horizontal:{},vertical:{}},c=1,u={},l="waypoints-context-id",f="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"+c++,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(f,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,s,c;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<(s=i.oldScroll)&&s<=t.offset?t.trigger([i.backward]):null!==o&&o>(c=i.oldScroll)&&c>=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([f,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,s[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 s[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({},s.horizontal,s.vertical),a.map(t,function(e){return i[e]})):[]},e}(),p={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,s;return e=a(this),n=null!=(s=i.context)?s: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 p._invoke.call(this,"disable")},enable:function(){return p._invoke.call(this,"enable")},destroy:function(){return p._invoke.call(this,"destroy")},prev:function(e,i){return p._traverse.call(this,e,i,function(e,i,a){return i>0?e.push(a[i-1]):void 0})},next:function(e,i){return p._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 p[e]=i},_invoke:function(e){var i;return i=a.extend({},s.vertical,s.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.define("plugins/scroll-pagination",["plugins","plugins/button-pagination","plugins/pending-messages","config/scroll-pagination-plugin","lib/utils"],function(e,i,a,t,n){return delete e["button-pagination"],delete e["pending-messages"],e["scroll-pagination"]=function(e){i(e),a(e),n.dispatcher.once("add-all.posts-view",function(e){e.$el.css("overflow-y","auto").css("overflow-x","auto").css("height",t.scrollHeight+"px")}),n.isClient&&(n.dispatcher.on("initialize.blog-view",function(e){r(e)}),n.dispatcher.on("pagination-next-updated.posts-view",function(e){e.hasNextPage()&&o(e,e.$('[data-gimme="posts.nextPage"]'))}),n.dispatcher.once("pagination-next-updated.posts-view",function(e){s(e)}));var r=function(e){e.clientEvents({'click [data-gimme="posts.to-top"]':"toTop",'click [data-gimme="posts.pending-message"]':"toTop"}),e.toTop=function(e){e.preventDefault(),this.$('[data-gimme="posts.list"]').scrollTop(0)}},o=function(e,i){liveblog.require(["waypoints"],function(){i.waypoint(function(){e.buttonNextPage()},{continuous:!1,triggerOnce:!0,offset:"100%",context:e.el})})},s=function(e){var i=e.$('[data-gimme="posts.beforePage"]');liveblog.require(["waypoints"],function(){i.waypoint(function(a){"down"===a&&(e.pauseAutoRender(),i.waypoint("destroy"),c(e))},{continuous:!1,offset:t.nextPageTriggerOffset,context:e.el})})},c=function(e){var i=e.firstPost().$el;liveblog.require(["waypoints"],function(){i.waypoint(function(a){"up"===a&&(e.renderPending(),e.resumeAutoRender(),i.waypoint("destroy"),s(e))},{continuous:!1,offset:-1,context:e.el})})}},e["scroll-pagination"]}),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/escape-RegExp",[],function(){var e=function(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")};return e}),liveblog.define("plugins/post-hash",["plugins","lib/utils","lib/helpers/escape-RegExp"],function(e,i,a){e["post-hash"]=function(){var e,t="liveblog.item.id",n=liveblog.hashmark?liveblog.hashmark:"?";e=i.isClient?window.location.href:liveblog.locationHref||"/",i.dispatcher.on("initialize.post-view",function(i){i.permalink=function(r){var o=r&&r.hashMark?r.hashMark:n,s=!1,c=t+"="+parseFloat(i.model.get("Order"));if(-1===e.indexOf(o))s=e+o+c;else if(-1!==e.indexOf(t+"=")){var l=new RegExp(a(t)+"=[^&#]*");s=e.replace(l,c)}else s=e+"&"+c;return s}}),i.dispatcher.on("initialize.posts-view",function(i){var a=e.indexOf(t+"=");-1!==a&&(i.collection.syncParams.pagination["order.end"]=parseFloat(e.substr(a+t.length+1)),i.flags.hasTopPage=!0,i.flags.autoRender=!1)})}}),liveblog.define("lib/helpers/visibility-toggle",[],function(){var e=function(e,i){var a="";return a=void 0!==i?i?"visible":"hidden":"visible"===e.css("visibility")?"hidden":"visible",e.css("visibility",a),"visible"===a?!0:!1};return e}),liveblog.define("tmpl!themeBase/plugins/permanent-link",["dust"],function(e){return function(){function i(e){return e.write('')}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/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,s,c){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")&&s(o,!1),s(r)},e.openShareWindow=function(e){e.preventDefault();var i=this.$(e.target).data("gimme"),a=c.shareWindowSize[i].h,t=c.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()),s="";i.permalink&&"function"==typeof i.permalink&&(s=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(c.fbURLImageComp,[i,e.$(this).attr("src")])});var A={pin:[s,l,t],twt:[r.gettext("Now reading"),t,s],lin:[s,t,n],ggl:[s],email:[r.gettext("Check out this Live Blog"),s],fb:[t,n,s,u]};return A},l=function(e){var a={};return delete e.email,i.each(e,function(i,t){a[t]=r.sprintf(c.urls[t],e[t])}),a},u=function(e){var i={};return i.emailurl=r.sprintf(c.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/wrappup-toggle",["backbone","underscore","plugins","lib/utils","dust"],function(e,i,a,t){var n={hide:"slideUp",show:"slideDown"};t.isClient&&t.dispatcher.once("initialize.posts-view",function(e){e.clientEvents({'click [data-gimme="post.wrapup"]':"wrapupToggle"}),e.wrapupToggle=function(i){var a=e.$(i.target).closest('[data-gimme="post.wrapup"]'),t=a.attr("data-wrapup-open");a.hasClass(t)?(a.removeClass(t),a.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.hide]()):(a.addClass(t),a.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.show]())}})}),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"]}),liveblog.define("tmpl!theme/container",["dust"],function(e){return function(){function i(e,i){return i=i.shiftBlocks(t),e.partial("themeBase/container",i,null)}function a(e,i){return i=i.shiftBlocks(t),e}e.register("theme/container",i);var t={contentBottomContainer:a};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(c),e.partial("themeBase/item/base",i,null)}function a(e,i){return i=i.shiftBlocks(c),e}function t(e,i){return i=i.shiftBlocks(c),e.block(i.getBlock("postDateContainer"),i,{block:n},null).block(i.getBlock("userAvatar"),i,{block:r},null).block(i.getBlock("userNameContainer"),i,{block:o},null).write('').block(i.getBlock("shareContainer"),i,{block:s},null)}function n(e,i){return i=i.shiftBlocks(c),e}function r(e,i){return i=i.shiftBlocks(c),e}function o(e,i){return i=i.shiftBlocks(c),e}function s(e,i){return i=i.shiftBlocks(c),e}e.register("theme/item/base",i);var c={headerContainer:a,contentSide:t};return i}(),{render:function(i,a){return e.render("theme/item/base",i,a)}}}),liveblog.define("themeFile",["css!theme/liveblog","plugins/scroll-pagination","plugins/twitter-widgets","plugins/post-hash","plugins/permanent-link","plugins/social-share","plugins/wrappup-toggle","plugins/user-comments","tmpl!theme/container","tmpl!theme/item/base"],function(){return{plugins:["scroll-pagination","twitter-widgets","post-hash","permanent-link","social-share","wrappup-toggle","user-comments"]}}); \ No newline at end of file +var u={itemClass:t,main:n,loadNext:s,loadingNext:c,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 s(e,i){return i=i.shiftBlocks(u),e.write('Load top posts')}function c(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:s,loadingNext:c,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!themeBase/plugins/pending-items-message",["dust"],function(e){return function(){function i(e){return e.write('')}return e.register("themeBase/plugins/pending-items-message",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/pending-items-message",i,a)}}}),liveblog.define("plugins/pending-messages",["lib/gettext","plugins","lib/utils","dust","tmpl!themeBase/item/base","tmpl!themeBase/plugins/pending-items-message"],function(e,i,a,t){return i.pendingMessages=function(){var i={};a.dispatcher.once("initialize.blog-view",function(e){i=e}),a.dispatcher.once("after-render.blog-view",function(e){t.renderThemed("themeBase/plugins/pending-items-message",{},function(i,a){e.$('[data-gimme="posts.pending-message-placeholder"]').html(a)})}),a.isClient&&(a.dispatcher.once("initialize.posts-view",function(e){e.pauseAutoRender=function(){this.flags.autoRender=!1},e.resumeAutoRender=function(){this.flags.autoRender=!0},i.$el.on("click",'[data-gimme="posts.pending-message"],[data-gimme="posts.pending-message-holder"]',function(){e.renderPending()})}),a.dispatcher.on("update-pending.posts-view",function(a){var t="",n=a.pendingCounter;n>0&&(t=e.sprintf(e.ngettext("one new post","%(count)s new posts",n),{count:n})),i.$('[data-gimme="posts.pending-message"]').html(t).toggle(n>0),i.$('[data-gimme="posts.pending-message-holder"]').toggle(n>0)}))},i.pendingMessages}),liveblog.define("config/scroll-pagination-plugin",{scrollHeight:500,nextPageTriggerOffset:-200}),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,s,c,l,u,A,m,p,f,d,g,h,b,T;return n=a(t),A=e.call(t,"ontouchstart")>=0,s={horizontal:{},vertical:{}},c=1,u={},l="waypoints-context-id",f="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"+c++,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(f,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,s,c;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<(s=i.oldScroll)&&s<=t.offset?t.trigger([i.backward]):null!==o&&o>(c=i.oldScroll)&&c>=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([f,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,s[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 s[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({},s.horizontal,s.vertical),a.map(t,function(e){return i[e]})):[]},e}(),p={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,s;return e=a(this),n=null!=(s=i.context)?s: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 p._invoke.call(this,"disable")},enable:function(){return p._invoke.call(this,"enable")},destroy:function(){return p._invoke.call(this,"destroy")},prev:function(e,i){return p._traverse.call(this,e,i,function(e,i,a){return i>0?e.push(a[i-1]):void 0})},next:function(e,i){return p._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 p[e]=i},_invoke:function(e){var i;return i=a.extend({},s.vertical,s.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.define("plugins/scroll-pagination",["plugins","plugins/button-pagination","plugins/pending-messages","config/scroll-pagination-plugin","lib/utils"],function(e,i,a,t,n){return delete e["button-pagination"],delete e["pending-messages"],e["scroll-pagination"]=function(e){i(e),a(e),n.dispatcher.once("add-all.posts-view",function(e){e.$el.css("overflow-y","auto").css("overflow-x","auto").css("height",t.scrollHeight+"px")}),n.isClient&&(n.dispatcher.on("initialize.blog-view",function(e){r(e)}),n.dispatcher.on("pagination-next-updated.posts-view",function(e){e.hasNextPage()&&o(e,e.$('[data-gimme="posts.nextPage"]'))}),n.dispatcher.once("pagination-next-updated.posts-view",function(e){s(e)}));var r=function(e){e.clientEvents({'click [data-gimme="posts.to-top"]':"toTop",'click [data-gimme="posts.pending-message"]':"toTop"}),e.toTop=function(e){e.preventDefault(),this.$('[data-gimme="posts.list"]').scrollTop(0)}},o=function(e,i){liveblog.require(["waypoints"],function(){i.waypoint(function(){e.buttonNextPage()},{continuous:!1,triggerOnce:!0,offset:"100%",context:e.el})})},s=function(e){var i=e.$('[data-gimme="posts.beforePage"]');liveblog.require(["waypoints"],function(){i.waypoint(function(a){"down"===a&&(e.pauseAutoRender(),i.waypoint("destroy"),c(e))},{continuous:!1,offset:t.nextPageTriggerOffset,context:e.el})})},c=function(e){var i=e.firstPost().$el;liveblog.require(["waypoints"],function(){i.waypoint(function(a){"up"===a&&(e.renderPending(),e.resumeAutoRender(),i.waypoint("destroy"),s(e))},{continuous:!1,offset:-1,context:e.el})})}},e["scroll-pagination"]}),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/escape-RegExp",[],function(){var e=function(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")};return e}),liveblog.define("plugins/post-hash",["plugins","lib/utils","lib/helpers/escape-RegExp"],function(e,i,a){e["post-hash"]=function(){var e,t="liveblog.item.id",n=liveblog.hashmark?liveblog.hashmark:"?";e=i.isClient?window.location.href:liveblog.locationHref||"/",i.dispatcher.on("initialize.post-view",function(i){i.permalink=function(r){var o=r&&r.hashMark?r.hashMark:n,s=!1,c=t+"="+parseFloat(i.model.get("Order"));if(-1===e.indexOf(o))s=e+o+c;else if(-1!==e.indexOf(t+"=")){var l=new RegExp(a(t)+"=[^&#]*");s=e.replace(l,c)}else s=e+"&"+c;return s}}),i.dispatcher.on("initialize.posts-view",function(i){var a=e.indexOf(t+"=");-1!==a&&(i.collection.syncParams.pagination["order.end"]=parseFloat(e.substr(a+t.length+1)),i.flags.hasTopPage=!0,i.flags.autoRender=!1)})}}),liveblog.define("lib/helpers/visibility-toggle",[],function(){var e=function(e,i){var a="";return a=void 0!==i?i?"visible":"hidden":"visible"===e.css("visibility")?"hidden":"visible",e.css("visibility",a),"visible"===a?!0:!1};return e}),liveblog.define("tmpl!themeBase/plugins/permanent-link",["dust"],function(e){return function(){function i(e){return e.write('')}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/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,s,c){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")&&s(o,!1),s(r)},e.openShareWindow=function(e){e.preventDefault();var i=this.$(e.target).data("gimme"),a=c.shareWindowSize[i].h,t=c.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()),s="";i.permalink&&"function"==typeof i.permalink&&(s=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(c.fbURLImageComp,[i,e.$(this).attr("src")])});var A={pin:[s,l,t],twt:[r.gettext("Now reading"),t,s],lin:[s,t,n],ggl:[s],email:[r.gettext("Check out this Live Blog"),s],fb:[t,n,s,u]};return A},l=function(e){var a={};return delete e.email,i.each(e,function(i,t){a[t]=r.sprintf(c.urls[t],e[t])}),a},u=function(e){var i={};return i.emailurl=r.sprintf(c.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/wrappup-toggle",["backbone","underscore","plugins","lib/utils","dust"],function(e,i,a,t){var n={hide:"slideUp",show:"slideDown"};t.isClient&&t.dispatcher.once("initialize.posts-view",function(e){e.clientEvents({'click [data-gimme="post.wrapup"]':"wrapupToggle"}),e.wrapupToggle=function(i){var a=e.$(i.target).closest('[data-gimme="post.wrapup"]'),t=a.attr("data-wrapup-open");a.hasClass(t)?(a.removeClass(t),a.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.hide]()):(a.addClass(t),a.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.show]())}})}),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"]}),liveblog.define("plugins/status",["backbone","plugins","lib/utils","lib/gettext","moment"],function(e,i,a,t,n){return a.isClient?(i.status=function(){a.dispatcher.on("initialize.blog-view",function(e){a.dispatcher.on("after-poller.blog-model conditional-render.blog-view",function(){var i=t.sprintf('',n().milliseconds(),n().format(t.pgettext("moment","status-time")));e.$('[data-gimme="blog.status"]').html(t.sprintf(t.gettext("updated at %s"),i))}),a.dispatcher.on("before-poller.blog-model",function(){e.$('[data-gimme="blog.status"]').html(t.gettext("updating..."))})})},i.status):void 0}),liveblog.define("tmpl!theme/container",["dust"],function(e){return function(){function i(e,i){return i=i.shiftBlocks(t),e.partial("themeBase/container",i,null)}function a(e,i){return i=i.shiftBlocks(t),e}e.register("theme/container",i);var t={contentBottomContainer:a};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(c),e.partial("themeBase/item/base",i,null)}function a(e,i){return i=i.shiftBlocks(c),e}function t(e,i){return i=i.shiftBlocks(c),e.block(i.getBlock("postDateContainer"),i,{block:n},null).block(i.getBlock("userAvatar"),i,{block:r},null).block(i.getBlock("userNameContainer"),i,{block:o},null).write('').block(i.getBlock("shareContainer"),i,{block:s},null)}function n(e,i){return i=i.shiftBlocks(c),e}function r(e,i){return i=i.shiftBlocks(c),e}function o(e,i){return i=i.shiftBlocks(c),e}function s(e,i){return i=i.shiftBlocks(c),e}e.register("theme/item/base",i);var c={headerContainer:a,contentSide:t};return i}(),{render:function(i,a){return e.render("theme/item/base",i,a)}}}),liveblog.define("themeFile",["css!theme/liveblog","plugins/scroll-pagination","plugins/twitter-widgets","plugins/post-hash","plugins/permanent-link","plugins/social-share","plugins/wrappup-toggle","plugins/user-comments","plugins/status","tmpl!theme/container","tmpl!theme/item/base"],function(){return{plugins:["scroll-pagination","twitter-widgets","post-hash","permanent-link","social-share","wrappup-toggle","user-comments","status"]} +}); \ No newline at end of file diff --git a/gui-resources/scripts/js/build/themes/stt-fnb/mobile.js b/gui-resources/scripts/js/build/themes/stt-fnb/mobile.js index 2483ed97b..98cb574fb 100644 --- a/gui-resources/scripts/js/build/themes/stt-fnb/mobile.js +++ b/gui-resources/scripts/js/build/themes/stt-fnb/mobile.js @@ -1,2 +1,3 @@ liveblog.define("plugins",{}),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.length96?e-87:e>64?e-29:e-48}function a(e){var a,t=0,n=e.split("."),r=n[0],o=n[1]||"",s=1,c=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').helper("i18n",i,{},{msgid:"Load more posts ..."}).write("")}function c(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:s,loadingNext:c,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 s(e,i){return i=i.shiftBlocks(u),e.write('Load top posts')}function c(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:s,loadingNext:c,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!themeBase/plugins/pending-items-message",["dust"],function(e){return function(){function i(e){return e.write('')}return e.register("themeBase/plugins/pending-items-message",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/pending-items-message",i,a)}}}),liveblog.define("plugins/pending-messages",["lib/gettext","plugins","lib/utils","dust","tmpl!themeBase/item/base","tmpl!themeBase/plugins/pending-items-message"],function(e,i,a,t){return i.pendingMessages=function(){var i={};a.dispatcher.once("initialize.blog-view",function(e){i=e}),a.dispatcher.once("after-render.blog-view",function(e){t.renderThemed("themeBase/plugins/pending-items-message",{},function(i,a){e.$('[data-gimme="posts.pending-message-placeholder"]').html(a)})}),a.isClient&&(a.dispatcher.once("initialize.posts-view",function(e){e.pauseAutoRender=function(){this.flags.autoRender=!1},e.resumeAutoRender=function(){this.flags.autoRender=!0},i.$el.on("click",'[data-gimme="posts.pending-message"],[data-gimme="posts.pending-message-holder"]',function(){e.renderPending()})}),a.dispatcher.on("update-pending.posts-view",function(a){var t="",n=a.pendingCounter;n>0&&(t=e.sprintf(e.ngettext("one new post","%(count)s new posts",n),{count:n})),i.$('[data-gimme="posts.pending-message"]').html(t).toggle(n>0),i.$('[data-gimme="posts.pending-message-holder"]').toggle(n>0)}))},i.pendingMessages}),liveblog.define("config/scroll-pagination-plugin",{scrollHeight:500,nextPageTriggerOffset:-200}),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,s,c,l,u,A,m,p,f,d,g,h,b,T;return n=a(t),A=e.call(t,"ontouchstart")>=0,s={horizontal:{},vertical:{}},c=1,u={},l="waypoints-context-id",f="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"+c++,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(f,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,s,c;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<(s=i.oldScroll)&&s<=t.offset?t.trigger([i.backward]):null!==o&&o>(c=i.oldScroll)&&c>=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([f,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,s[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 s[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({},s.horizontal,s.vertical),a.map(t,function(e){return i[e]})):[]},e}(),p={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,s;return e=a(this),n=null!=(s=i.context)?s: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 p._invoke.call(this,"disable")},enable:function(){return p._invoke.call(this,"enable")},destroy:function(){return p._invoke.call(this,"destroy")},prev:function(e,i){return p._traverse.call(this,e,i,function(e,i,a){return i>0?e.push(a[i-1]):void 0})},next:function(e,i){return p._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 p[e]=i},_invoke:function(e){var i;return i=a.extend({},s.vertical,s.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.define("plugins/scroll-pagination",["plugins","plugins/button-pagination","plugins/pending-messages","config/scroll-pagination-plugin","lib/utils"],function(e,i,a,t,n){return delete e["button-pagination"],delete e["pending-messages"],e["scroll-pagination"]=function(e){i(e),a(e),n.dispatcher.once("add-all.posts-view",function(e){e.$el.css("overflow-y","auto").css("overflow-x","auto").css("height",t.scrollHeight+"px")}),n.isClient&&(n.dispatcher.on("initialize.blog-view",function(e){r(e)}),n.dispatcher.on("pagination-next-updated.posts-view",function(e){e.hasNextPage()&&o(e,e.$('[data-gimme="posts.nextPage"]'))}),n.dispatcher.once("pagination-next-updated.posts-view",function(e){s(e)}));var r=function(e){e.clientEvents({'click [data-gimme="posts.to-top"]':"toTop",'click [data-gimme="posts.pending-message"]':"toTop"}),e.toTop=function(e){e.preventDefault(),this.$('[data-gimme="posts.list"]').scrollTop(0)}},o=function(e,i){liveblog.require(["waypoints"],function(){i.waypoint(function(){e.buttonNextPage()},{continuous:!1,triggerOnce:!0,offset:"100%",context:e.el})})},s=function(e){var i=e.$('[data-gimme="posts.beforePage"]');liveblog.require(["waypoints"],function(){i.waypoint(function(a){"down"===a&&(e.pauseAutoRender(),i.waypoint("destroy"),c(e))},{continuous:!1,offset:t.nextPageTriggerOffset,context:e.el})})},c=function(e){var i=e.firstPost().$el;liveblog.require(["waypoints"],function(){i.waypoint(function(a){"up"===a&&(e.renderPending(),e.resumeAutoRender(),i.waypoint("destroy"),s(e))},{continuous:!1,offset:-1,context:e.el})})}},e["scroll-pagination"]}),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/escape-RegExp",[],function(){var e=function(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")};return e}),liveblog.define("plugins/post-hash",["plugins","lib/utils","lib/helpers/escape-RegExp"],function(e,i,a){e["post-hash"]=function(){var e,t="liveblog.item.id",n=liveblog.hashmark?liveblog.hashmark:"?";e=i.isClient?window.location.href:liveblog.locationHref||"/",i.dispatcher.on("initialize.post-view",function(i){i.permalink=function(r){var o=r&&r.hashMark?r.hashMark:n,s=!1,c=t+"="+parseFloat(i.model.get("Order"));if(-1===e.indexOf(o))s=e+o+c;else if(-1!==e.indexOf(t+"=")){var l=new RegExp(a(t)+"=[^&#]*");s=e.replace(l,c)}else s=e+"&"+c;return s}}),i.dispatcher.on("initialize.posts-view",function(i){var a=e.indexOf(t+"=");-1!==a&&(i.collection.syncParams.pagination["order.end"]=parseFloat(e.substr(a+t.length+1)),i.flags.hasTopPage=!0,i.flags.autoRender=!1)})}}),liveblog.define("lib/helpers/visibility-toggle",[],function(){var e=function(e,i){var a="";return a=void 0!==i?i?"visible":"hidden":"visible"===e.css("visibility")?"hidden":"visible",e.css("visibility",a),"visible"===a?!0:!1};return e}),liveblog.define("tmpl!themeBase/plugins/permanent-link",["dust"],function(e){return function(){function i(e){return e.write('')}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/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,s,c){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")&&s(o,!1),s(r)},e.openShareWindow=function(e){e.preventDefault();var i=this.$(e.target).data("gimme"),a=c.shareWindowSize[i].h,t=c.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()),s="";i.permalink&&"function"==typeof i.permalink&&(s=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(c.fbURLImageComp,[i,e.$(this).attr("src")])});var A={pin:[s,l,t],twt:[r.gettext("Now reading"),t,s],lin:[s,t,n],ggl:[s],email:[r.gettext("Check out this Live Blog"),s],fb:[t,n,s,u]};return A},l=function(e){var a={};return delete e.email,i.each(e,function(i,t){a[t]=r.sprintf(c.urls[t],e[t])}),a},u=function(e){var i={};return i.emailurl=r.sprintf(c.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/wrappup-toggle",["backbone","underscore","plugins","lib/utils","dust"],function(e,i,a,t){var n={hide:"slideUp",show:"slideDown"};t.isClient&&t.dispatcher.once("initialize.posts-view",function(e){e.clientEvents({'click [data-gimme="post.wrapup"]':"wrapupToggle"}),e.wrapupToggle=function(i){var a=e.$(i.target).closest('[data-gimme="post.wrapup"]'),t=a.attr("data-wrapup-open");a.hasClass(t)?(a.removeClass(t),a.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.hide]()):(a.addClass(t),a.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.show]())}})}),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"]}),liveblog.define("tmpl!theme/container",["dust"],function(e){return function(){function i(e,i){return i=i.shiftBlocks(t),e.partial("themeBase/container",i,null)}function a(e,i){return i=i.shiftBlocks(t),e.write('class="mobile"')}e.register("theme/container",i);var t={additionalAttributes:a};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(u),e.partial("themeBase/item/base",i,null)}function a(e,i){return i=i.shiftBlocks(u),e.block(i.getBlock("userAvatar"),i,{block:t},null).block(i.getBlock("userNameContainer"),i,{block:r},null).block(i.getBlock("postDateContainer"),i,{block:o},null)}function t(e,i){return i=i.shiftBlocks(u),e.block(i.getBlock("publisherAvatar"),i,{block:n},null)}function n(e,i){return i=i.shiftBlocks(u),e}function r(e,i){return i=i.shiftBlocks(u),e}function o(e,i){return i=i.shiftBlocks(u),e}function s(e,i){return i=i.shiftBlocks(u),e}function c(e,i){return i=i.shiftBlocks(u),e.block(i.getBlock("shareContainer"),i,{block:l},null)}function l(e,i){return i=i.shiftBlocks(u),e}e.register("theme/item/base",i);var u={header:a,contentSide:s,footer:c};return i}(),{render:function(i,a){return e.render("theme/item/base",i,a)}}}),liveblog.define("themeFile",["css!theme/liveblog","plugins/scroll-pagination","plugins/twitter-widgets","plugins/post-hash","plugins/permanent-link","plugins/social-share","plugins/wrappup-toggle","plugins/user-comments","tmpl!theme/container","tmpl!theme/item/base"],function(){return{plugins:["scroll-pagination","twitter-widgets","post-hash","permanent-link","social-share","wrappup-toggle","user-comments"]}}); \ No newline at end of file +var u={itemClass:t,main:n,loadNext:s,loadingNext:c,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 s(e,i){return i=i.shiftBlocks(u),e.write('Load top posts')}function c(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:s,loadingNext:c,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!themeBase/plugins/pending-items-message",["dust"],function(e){return function(){function i(e){return e.write('')}return e.register("themeBase/plugins/pending-items-message",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/pending-items-message",i,a)}}}),liveblog.define("plugins/pending-messages",["lib/gettext","plugins","lib/utils","dust","tmpl!themeBase/item/base","tmpl!themeBase/plugins/pending-items-message"],function(e,i,a,t){return i.pendingMessages=function(){var i={};a.dispatcher.once("initialize.blog-view",function(e){i=e}),a.dispatcher.once("after-render.blog-view",function(e){t.renderThemed("themeBase/plugins/pending-items-message",{},function(i,a){e.$('[data-gimme="posts.pending-message-placeholder"]').html(a)})}),a.isClient&&(a.dispatcher.once("initialize.posts-view",function(e){e.pauseAutoRender=function(){this.flags.autoRender=!1},e.resumeAutoRender=function(){this.flags.autoRender=!0},i.$el.on("click",'[data-gimme="posts.pending-message"],[data-gimme="posts.pending-message-holder"]',function(){e.renderPending()})}),a.dispatcher.on("update-pending.posts-view",function(a){var t="",n=a.pendingCounter;n>0&&(t=e.sprintf(e.ngettext("one new post","%(count)s new posts",n),{count:n})),i.$('[data-gimme="posts.pending-message"]').html(t).toggle(n>0),i.$('[data-gimme="posts.pending-message-holder"]').toggle(n>0)}))},i.pendingMessages}),liveblog.define("config/scroll-pagination-plugin",{scrollHeight:500,nextPageTriggerOffset:-200}),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,s,c,l,u,A,m,p,f,d,g,h,b,T;return n=a(t),A=e.call(t,"ontouchstart")>=0,s={horizontal:{},vertical:{}},c=1,u={},l="waypoints-context-id",f="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"+c++,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(f,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,s,c;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<(s=i.oldScroll)&&s<=t.offset?t.trigger([i.backward]):null!==o&&o>(c=i.oldScroll)&&c>=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([f,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,s[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 s[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({},s.horizontal,s.vertical),a.map(t,function(e){return i[e]})):[]},e}(),p={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,s;return e=a(this),n=null!=(s=i.context)?s: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 p._invoke.call(this,"disable")},enable:function(){return p._invoke.call(this,"enable")},destroy:function(){return p._invoke.call(this,"destroy")},prev:function(e,i){return p._traverse.call(this,e,i,function(e,i,a){return i>0?e.push(a[i-1]):void 0})},next:function(e,i){return p._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 p[e]=i},_invoke:function(e){var i;return i=a.extend({},s.vertical,s.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.define("plugins/scroll-pagination",["plugins","plugins/button-pagination","plugins/pending-messages","config/scroll-pagination-plugin","lib/utils"],function(e,i,a,t,n){return delete e["button-pagination"],delete e["pending-messages"],e["scroll-pagination"]=function(e){i(e),a(e),n.dispatcher.once("add-all.posts-view",function(e){e.$el.css("overflow-y","auto").css("overflow-x","auto").css("height",t.scrollHeight+"px")}),n.isClient&&(n.dispatcher.on("initialize.blog-view",function(e){r(e)}),n.dispatcher.on("pagination-next-updated.posts-view",function(e){e.hasNextPage()&&o(e,e.$('[data-gimme="posts.nextPage"]'))}),n.dispatcher.once("pagination-next-updated.posts-view",function(e){s(e)}));var r=function(e){e.clientEvents({'click [data-gimme="posts.to-top"]':"toTop",'click [data-gimme="posts.pending-message"]':"toTop"}),e.toTop=function(e){e.preventDefault(),this.$('[data-gimme="posts.list"]').scrollTop(0)}},o=function(e,i){liveblog.require(["waypoints"],function(){i.waypoint(function(){e.buttonNextPage()},{continuous:!1,triggerOnce:!0,offset:"100%",context:e.el})})},s=function(e){var i=e.$('[data-gimme="posts.beforePage"]');liveblog.require(["waypoints"],function(){i.waypoint(function(a){"down"===a&&(e.pauseAutoRender(),i.waypoint("destroy"),c(e))},{continuous:!1,offset:t.nextPageTriggerOffset,context:e.el})})},c=function(e){var i=e.firstPost().$el;liveblog.require(["waypoints"],function(){i.waypoint(function(a){"up"===a&&(e.renderPending(),e.resumeAutoRender(),i.waypoint("destroy"),s(e))},{continuous:!1,offset:-1,context:e.el})})}},e["scroll-pagination"]}),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/escape-RegExp",[],function(){var e=function(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")};return e}),liveblog.define("plugins/post-hash",["plugins","lib/utils","lib/helpers/escape-RegExp"],function(e,i,a){e["post-hash"]=function(){var e,t="liveblog.item.id",n=liveblog.hashmark?liveblog.hashmark:"?";e=i.isClient?window.location.href:liveblog.locationHref||"/",i.dispatcher.on("initialize.post-view",function(i){i.permalink=function(r){var o=r&&r.hashMark?r.hashMark:n,s=!1,c=t+"="+parseFloat(i.model.get("Order"));if(-1===e.indexOf(o))s=e+o+c;else if(-1!==e.indexOf(t+"=")){var l=new RegExp(a(t)+"=[^&#]*");s=e.replace(l,c)}else s=e+"&"+c;return s}}),i.dispatcher.on("initialize.posts-view",function(i){var a=e.indexOf(t+"=");-1!==a&&(i.collection.syncParams.pagination["order.end"]=parseFloat(e.substr(a+t.length+1)),i.flags.hasTopPage=!0,i.flags.autoRender=!1)})}}),liveblog.define("lib/helpers/visibility-toggle",[],function(){var e=function(e,i){var a="";return a=void 0!==i?i?"visible":"hidden":"visible"===e.css("visibility")?"hidden":"visible",e.css("visibility",a),"visible"===a?!0:!1};return e}),liveblog.define("tmpl!themeBase/plugins/permanent-link",["dust"],function(e){return function(){function i(e){return e.write('')}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/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,s,c){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")&&s(o,!1),s(r)},e.openShareWindow=function(e){e.preventDefault();var i=this.$(e.target).data("gimme"),a=c.shareWindowSize[i].h,t=c.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()),s="";i.permalink&&"function"==typeof i.permalink&&(s=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(c.fbURLImageComp,[i,e.$(this).attr("src")])});var A={pin:[s,l,t],twt:[r.gettext("Now reading"),t,s],lin:[s,t,n],ggl:[s],email:[r.gettext("Check out this Live Blog"),s],fb:[t,n,s,u]};return A},l=function(e){var a={};return delete e.email,i.each(e,function(i,t){a[t]=r.sprintf(c.urls[t],e[t])}),a},u=function(e){var i={};return i.emailurl=r.sprintf(c.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/wrappup-toggle",["backbone","underscore","plugins","lib/utils","dust"],function(e,i,a,t){var n={hide:"slideUp",show:"slideDown"};t.isClient&&t.dispatcher.once("initialize.posts-view",function(e){e.clientEvents({'click [data-gimme="post.wrapup"]':"wrapupToggle"}),e.wrapupToggle=function(i){var a=e.$(i.target).closest('[data-gimme="post.wrapup"]'),t=a.attr("data-wrapup-open");a.hasClass(t)?(a.removeClass(t),a.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.hide]()):(a.addClass(t),a.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.show]())}})}),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"]}),liveblog.define("plugins/status",["backbone","plugins","lib/utils","lib/gettext","moment"],function(e,i,a,t,n){return a.isClient?(i.status=function(){a.dispatcher.on("initialize.blog-view",function(e){a.dispatcher.on("after-poller.blog-model conditional-render.blog-view",function(){var i=t.sprintf('',n().milliseconds(),n().format(t.pgettext("moment","status-time")));e.$('[data-gimme="blog.status"]').html(t.sprintf(t.gettext("updated at %s"),i))}),a.dispatcher.on("before-poller.blog-model",function(){e.$('[data-gimme="blog.status"]').html(t.gettext("updating..."))})})},i.status):void 0}),liveblog.define("tmpl!theme/container",["dust"],function(e){return function(){function i(e,i){return i=i.shiftBlocks(t),e.partial("themeBase/container",i,null)}function a(e,i){return i=i.shiftBlocks(t),e.write('class="mobile"')}e.register("theme/container",i);var t={additionalAttributes:a};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(u),e.partial("themeBase/item/base",i,null)}function a(e,i){return i=i.shiftBlocks(u),e.block(i.getBlock("userAvatar"),i,{block:t},null).block(i.getBlock("userNameContainer"),i,{block:r},null).block(i.getBlock("postDateContainer"),i,{block:o},null)}function t(e,i){return i=i.shiftBlocks(u),e.block(i.getBlock("publisherAvatar"),i,{block:n},null)}function n(e,i){return i=i.shiftBlocks(u),e}function r(e,i){return i=i.shiftBlocks(u),e}function o(e,i){return i=i.shiftBlocks(u),e}function s(e,i){return i=i.shiftBlocks(u),e}function c(e,i){return i=i.shiftBlocks(u),e.block(i.getBlock("shareContainer"),i,{block:l},null)}function l(e,i){return i=i.shiftBlocks(u),e}e.register("theme/item/base",i);var u={header:a,contentSide:s,footer:c};return i}(),{render:function(i,a){return e.render("theme/item/base",i,a) +}}}),liveblog.define("themeFile",["css!theme/liveblog","plugins/scroll-pagination","plugins/twitter-widgets","plugins/post-hash","plugins/permanent-link","plugins/social-share","plugins/wrappup-toggle","plugins/user-comments","plugins/status","tmpl!theme/container","tmpl!theme/item/base"],function(){return{plugins:["scroll-pagination","twitter-widgets","post-hash","permanent-link","social-share","wrappup-toggle","user-comments","status"]}}); \ No newline at end of file diff --git a/gui-resources/scripts/js/build/themes/stt-fnb/quirks.js b/gui-resources/scripts/js/build/themes/stt-fnb/quirks.js index e415aae40..4df5a382d 100644 --- a/gui-resources/scripts/js/build/themes/stt-fnb/quirks.js +++ b/gui-resources/scripts/js/build/themes/stt-fnb/quirks.js @@ -1,2 +1,3 @@ liveblog.define("plugins",{}),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.length96?e-87:e>64?e-29:e-48}function a(e){var a,t=0,n=e.split("."),r=n[0],o=n[1]||"",s=1,c=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').helper("i18n",i,{},{msgid:"Load more posts ..."}).write("")}function c(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:s,loadingNext:c,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 s(e,i){return i=i.shiftBlocks(u),e.write('Load top posts')}function c(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:s,loadingNext:c,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!themeBase/plugins/pending-items-message",["dust"],function(e){return function(){function i(e){return e.write('')}return e.register("themeBase/plugins/pending-items-message",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/pending-items-message",i,a)}}}),liveblog.define("plugins/pending-messages",["lib/gettext","plugins","lib/utils","dust","tmpl!themeBase/item/base","tmpl!themeBase/plugins/pending-items-message"],function(e,i,a,t){return i.pendingMessages=function(){var i={};a.dispatcher.once("initialize.blog-view",function(e){i=e}),a.dispatcher.once("after-render.blog-view",function(e){t.renderThemed("themeBase/plugins/pending-items-message",{},function(i,a){e.$('[data-gimme="posts.pending-message-placeholder"]').html(a)})}),a.isClient&&(a.dispatcher.once("initialize.posts-view",function(e){e.pauseAutoRender=function(){this.flags.autoRender=!1},e.resumeAutoRender=function(){this.flags.autoRender=!0},i.$el.on("click",'[data-gimme="posts.pending-message"],[data-gimme="posts.pending-message-holder"]',function(){e.renderPending()})}),a.dispatcher.on("update-pending.posts-view",function(a){var t="",n=a.pendingCounter;n>0&&(t=e.sprintf(e.ngettext("one new post","%(count)s new posts",n),{count:n})),i.$('[data-gimme="posts.pending-message"]').html(t).toggle(n>0),i.$('[data-gimme="posts.pending-message-holder"]').toggle(n>0)}))},i.pendingMessages}),liveblog.define("config/scroll-pagination-plugin",{scrollHeight:500,nextPageTriggerOffset:-200}),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,s,c,l,u,A,m,p,f,d,g,h,b,T;return n=a(t),A=e.call(t,"ontouchstart")>=0,s={horizontal:{},vertical:{}},c=1,u={},l="waypoints-context-id",f="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"+c++,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(f,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,s,c;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<(s=i.oldScroll)&&s<=t.offset?t.trigger([i.backward]):null!==o&&o>(c=i.oldScroll)&&c>=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([f,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,s[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 s[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({},s.horizontal,s.vertical),a.map(t,function(e){return i[e]})):[]},e}(),p={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,s;return e=a(this),n=null!=(s=i.context)?s: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 p._invoke.call(this,"disable")},enable:function(){return p._invoke.call(this,"enable")},destroy:function(){return p._invoke.call(this,"destroy")},prev:function(e,i){return p._traverse.call(this,e,i,function(e,i,a){return i>0?e.push(a[i-1]):void 0})},next:function(e,i){return p._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 p[e]=i},_invoke:function(e){var i;return i=a.extend({},s.vertical,s.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.define("plugins/scroll-pagination",["plugins","plugins/button-pagination","plugins/pending-messages","config/scroll-pagination-plugin","lib/utils"],function(e,i,a,t,n){return delete e["button-pagination"],delete e["pending-messages"],e["scroll-pagination"]=function(e){i(e),a(e),n.dispatcher.once("add-all.posts-view",function(e){e.$el.css("overflow-y","auto").css("overflow-x","auto").css("height",t.scrollHeight+"px")}),n.isClient&&(n.dispatcher.on("initialize.blog-view",function(e){r(e)}),n.dispatcher.on("pagination-next-updated.posts-view",function(e){e.hasNextPage()&&o(e,e.$('[data-gimme="posts.nextPage"]'))}),n.dispatcher.once("pagination-next-updated.posts-view",function(e){s(e)}));var r=function(e){e.clientEvents({'click [data-gimme="posts.to-top"]':"toTop",'click [data-gimme="posts.pending-message"]':"toTop"}),e.toTop=function(e){e.preventDefault(),this.$('[data-gimme="posts.list"]').scrollTop(0)}},o=function(e,i){liveblog.require(["waypoints"],function(){i.waypoint(function(){e.buttonNextPage()},{continuous:!1,triggerOnce:!0,offset:"100%",context:e.el})})},s=function(e){var i=e.$('[data-gimme="posts.beforePage"]');liveblog.require(["waypoints"],function(){i.waypoint(function(a){"down"===a&&(e.pauseAutoRender(),i.waypoint("destroy"),c(e))},{continuous:!1,offset:t.nextPageTriggerOffset,context:e.el})})},c=function(e){var i=e.firstPost().$el;liveblog.require(["waypoints"],function(){i.waypoint(function(a){"up"===a&&(e.renderPending(),e.resumeAutoRender(),i.waypoint("destroy"),s(e))},{continuous:!1,offset:-1,context:e.el})})}},e["scroll-pagination"]}),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/escape-RegExp",[],function(){var e=function(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")};return e}),liveblog.define("plugins/post-hash",["plugins","lib/utils","lib/helpers/escape-RegExp"],function(e,i,a){e["post-hash"]=function(){var e,t="liveblog.item.id",n=liveblog.hashmark?liveblog.hashmark:"?";e=i.isClient?window.location.href:liveblog.locationHref||"/",i.dispatcher.on("initialize.post-view",function(i){i.permalink=function(r){var o=r&&r.hashMark?r.hashMark:n,s=!1,c=t+"="+parseFloat(i.model.get("Order"));if(-1===e.indexOf(o))s=e+o+c;else if(-1!==e.indexOf(t+"=")){var l=new RegExp(a(t)+"=[^&#]*");s=e.replace(l,c)}else s=e+"&"+c;return s}}),i.dispatcher.on("initialize.posts-view",function(i){var a=e.indexOf(t+"=");-1!==a&&(i.collection.syncParams.pagination["order.end"]=parseFloat(e.substr(a+t.length+1)),i.flags.hasTopPage=!0,i.flags.autoRender=!1)})}}),liveblog.define("lib/helpers/visibility-toggle",[],function(){var e=function(e,i){var a="";return a=void 0!==i?i?"visible":"hidden":"visible"===e.css("visibility")?"hidden":"visible",e.css("visibility",a),"visible"===a?!0:!1};return e}),liveblog.define("tmpl!themeBase/plugins/permanent-link",["dust"],function(e){return function(){function i(e){return e.write('')}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/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,s,c){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")&&s(o,!1),s(r)},e.openShareWindow=function(e){e.preventDefault();var i=this.$(e.target).data("gimme"),a=c.shareWindowSize[i].h,t=c.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()),s="";i.permalink&&"function"==typeof i.permalink&&(s=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(c.fbURLImageComp,[i,e.$(this).attr("src")])});var A={pin:[s,l,t],twt:[r.gettext("Now reading"),t,s],lin:[s,t,n],ggl:[s],email:[r.gettext("Check out this Live Blog"),s],fb:[t,n,s,u]};return A},l=function(e){var a={};return delete e.email,i.each(e,function(i,t){a[t]=r.sprintf(c.urls[t],e[t])}),a},u=function(e){var i={};return i.emailurl=r.sprintf(c.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/wrappup-toggle",["backbone","underscore","plugins","lib/utils","dust"],function(e,i,a,t){var n={hide:"slideUp",show:"slideDown"};t.isClient&&t.dispatcher.once("initialize.posts-view",function(e){e.clientEvents({'click [data-gimme="post.wrapup"]':"wrapupToggle"}),e.wrapupToggle=function(i){var a=e.$(i.target).closest('[data-gimme="post.wrapup"]'),t=a.attr("data-wrapup-open");a.hasClass(t)?(a.removeClass(t),a.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.hide]()):(a.addClass(t),a.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.show]())}})}),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"]}),liveblog.define("tmpl!theme/container",["dust"],function(e){return function(){function i(e,i){return i=i.shiftBlocks(t),e.partial("themeBase/container",i,null)}function a(e,i){return i=i.shiftBlocks(t),e.write('class="quirks"')}e.register("theme/container",i);var t={additionalAttributes:a};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(r),e.partial("themeBase/item/base",i,null)}function a(e,i){return i=i.shiftBlocks(r),e.exists(i.get(["AuthorImage"],!1),i,{"else":t,block:n},null)}function t(e,i){return i=i.shiftBlocks(r),e.write('
      ')}function n(e,i){return i=i.shiftBlocks(r),e.write('
      ')}e.register("theme/item/base",i);var r={userAvatar:a};return i}(),{render:function(i,a){return e.render("theme/item/base",i,a)}}}),liveblog.define("themeFile",["css!theme/liveblog","plugins/scroll-pagination","plugins/twitter-widgets","plugins/post-hash","plugins/permanent-link","plugins/social-share","plugins/wrappup-toggle","plugins/user-comments","tmpl!theme/container","tmpl!theme/item/base"],function(){return{plugins:["scroll-pagination","twitter-widgets","post-hash","permanent-link","social-share","wrappup-toggle","user-comments"]}}); \ No newline at end of file +var u={itemClass:t,main:n,loadNext:s,loadingNext:c,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 s(e,i){return i=i.shiftBlocks(u),e.write('Load top posts')}function c(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:s,loadingNext:c,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!themeBase/plugins/pending-items-message",["dust"],function(e){return function(){function i(e){return e.write('')}return e.register("themeBase/plugins/pending-items-message",i),i}(),{render:function(i,a){return e.render("themeBase/plugins/pending-items-message",i,a)}}}),liveblog.define("plugins/pending-messages",["lib/gettext","plugins","lib/utils","dust","tmpl!themeBase/item/base","tmpl!themeBase/plugins/pending-items-message"],function(e,i,a,t){return i.pendingMessages=function(){var i={};a.dispatcher.once("initialize.blog-view",function(e){i=e}),a.dispatcher.once("after-render.blog-view",function(e){t.renderThemed("themeBase/plugins/pending-items-message",{},function(i,a){e.$('[data-gimme="posts.pending-message-placeholder"]').html(a)})}),a.isClient&&(a.dispatcher.once("initialize.posts-view",function(e){e.pauseAutoRender=function(){this.flags.autoRender=!1},e.resumeAutoRender=function(){this.flags.autoRender=!0},i.$el.on("click",'[data-gimme="posts.pending-message"],[data-gimme="posts.pending-message-holder"]',function(){e.renderPending()})}),a.dispatcher.on("update-pending.posts-view",function(a){var t="",n=a.pendingCounter;n>0&&(t=e.sprintf(e.ngettext("one new post","%(count)s new posts",n),{count:n})),i.$('[data-gimme="posts.pending-message"]').html(t).toggle(n>0),i.$('[data-gimme="posts.pending-message-holder"]').toggle(n>0)}))},i.pendingMessages}),liveblog.define("config/scroll-pagination-plugin",{scrollHeight:500,nextPageTriggerOffset:-200}),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,s,c,l,u,A,m,p,f,d,g,h,b,T;return n=a(t),A=e.call(t,"ontouchstart")>=0,s={horizontal:{},vertical:{}},c=1,u={},l="waypoints-context-id",f="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"+c++,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(f,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,s,c;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<(s=i.oldScroll)&&s<=t.offset?t.trigger([i.backward]):null!==o&&o>(c=i.oldScroll)&&c>=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([f,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,s[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 s[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({},s.horizontal,s.vertical),a.map(t,function(e){return i[e]})):[]},e}(),p={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,s;return e=a(this),n=null!=(s=i.context)?s: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 p._invoke.call(this,"disable")},enable:function(){return p._invoke.call(this,"enable")},destroy:function(){return p._invoke.call(this,"destroy")},prev:function(e,i){return p._traverse.call(this,e,i,function(e,i,a){return i>0?e.push(a[i-1]):void 0})},next:function(e,i){return p._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 p[e]=i},_invoke:function(e){var i;return i=a.extend({},s.vertical,s.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.define("plugins/scroll-pagination",["plugins","plugins/button-pagination","plugins/pending-messages","config/scroll-pagination-plugin","lib/utils"],function(e,i,a,t,n){return delete e["button-pagination"],delete e["pending-messages"],e["scroll-pagination"]=function(e){i(e),a(e),n.dispatcher.once("add-all.posts-view",function(e){e.$el.css("overflow-y","auto").css("overflow-x","auto").css("height",t.scrollHeight+"px")}),n.isClient&&(n.dispatcher.on("initialize.blog-view",function(e){r(e)}),n.dispatcher.on("pagination-next-updated.posts-view",function(e){e.hasNextPage()&&o(e,e.$('[data-gimme="posts.nextPage"]'))}),n.dispatcher.once("pagination-next-updated.posts-view",function(e){s(e)}));var r=function(e){e.clientEvents({'click [data-gimme="posts.to-top"]':"toTop",'click [data-gimme="posts.pending-message"]':"toTop"}),e.toTop=function(e){e.preventDefault(),this.$('[data-gimme="posts.list"]').scrollTop(0)}},o=function(e,i){liveblog.require(["waypoints"],function(){i.waypoint(function(){e.buttonNextPage()},{continuous:!1,triggerOnce:!0,offset:"100%",context:e.el})})},s=function(e){var i=e.$('[data-gimme="posts.beforePage"]');liveblog.require(["waypoints"],function(){i.waypoint(function(a){"down"===a&&(e.pauseAutoRender(),i.waypoint("destroy"),c(e))},{continuous:!1,offset:t.nextPageTriggerOffset,context:e.el})})},c=function(e){var i=e.firstPost().$el;liveblog.require(["waypoints"],function(){i.waypoint(function(a){"up"===a&&(e.renderPending(),e.resumeAutoRender(),i.waypoint("destroy"),s(e))},{continuous:!1,offset:-1,context:e.el})})}},e["scroll-pagination"]}),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/escape-RegExp",[],function(){var e=function(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")};return e}),liveblog.define("plugins/post-hash",["plugins","lib/utils","lib/helpers/escape-RegExp"],function(e,i,a){e["post-hash"]=function(){var e,t="liveblog.item.id",n=liveblog.hashmark?liveblog.hashmark:"?";e=i.isClient?window.location.href:liveblog.locationHref||"/",i.dispatcher.on("initialize.post-view",function(i){i.permalink=function(r){var o=r&&r.hashMark?r.hashMark:n,s=!1,c=t+"="+parseFloat(i.model.get("Order"));if(-1===e.indexOf(o))s=e+o+c;else if(-1!==e.indexOf(t+"=")){var l=new RegExp(a(t)+"=[^&#]*");s=e.replace(l,c)}else s=e+"&"+c;return s}}),i.dispatcher.on("initialize.posts-view",function(i){var a=e.indexOf(t+"=");-1!==a&&(i.collection.syncParams.pagination["order.end"]=parseFloat(e.substr(a+t.length+1)),i.flags.hasTopPage=!0,i.flags.autoRender=!1)})}}),liveblog.define("lib/helpers/visibility-toggle",[],function(){var e=function(e,i){var a="";return a=void 0!==i?i?"visible":"hidden":"visible"===e.css("visibility")?"hidden":"visible",e.css("visibility",a),"visible"===a?!0:!1};return e}),liveblog.define("tmpl!themeBase/plugins/permanent-link",["dust"],function(e){return function(){function i(e){return e.write('')}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/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,s,c){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")&&s(o,!1),s(r)},e.openShareWindow=function(e){e.preventDefault();var i=this.$(e.target).data("gimme"),a=c.shareWindowSize[i].h,t=c.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()),s="";i.permalink&&"function"==typeof i.permalink&&(s=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(c.fbURLImageComp,[i,e.$(this).attr("src")])});var A={pin:[s,l,t],twt:[r.gettext("Now reading"),t,s],lin:[s,t,n],ggl:[s],email:[r.gettext("Check out this Live Blog"),s],fb:[t,n,s,u]};return A},l=function(e){var a={};return delete e.email,i.each(e,function(i,t){a[t]=r.sprintf(c.urls[t],e[t])}),a},u=function(e){var i={};return i.emailurl=r.sprintf(c.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/wrappup-toggle",["backbone","underscore","plugins","lib/utils","dust"],function(e,i,a,t){var n={hide:"slideUp",show:"slideDown"};t.isClient&&t.dispatcher.once("initialize.posts-view",function(e){e.clientEvents({'click [data-gimme="post.wrapup"]':"wrapupToggle"}),e.wrapupToggle=function(i){var a=e.$(i.target).closest('[data-gimme="post.wrapup"]'),t=a.attr("data-wrapup-open");a.hasClass(t)?(a.removeClass(t),a.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.hide]()):(a.addClass(t),a.nextUntil('[data-gimme="post.wrapup"],[data-gimme="posts.nextPage"]')[n.show]())}})}),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"]}),liveblog.define("plugins/status",["backbone","plugins","lib/utils","lib/gettext","moment"],function(e,i,a,t,n){return a.isClient?(i.status=function(){a.dispatcher.on("initialize.blog-view",function(e){a.dispatcher.on("after-poller.blog-model conditional-render.blog-view",function(){var i=t.sprintf('',n().milliseconds(),n().format(t.pgettext("moment","status-time")));e.$('[data-gimme="blog.status"]').html(t.sprintf(t.gettext("updated at %s"),i))}),a.dispatcher.on("before-poller.blog-model",function(){e.$('[data-gimme="blog.status"]').html(t.gettext("updating..."))})})},i.status):void 0}),liveblog.define("tmpl!theme/container",["dust"],function(e){return function(){function i(e,i){return i=i.shiftBlocks(t),e.partial("themeBase/container",i,null)}function a(e,i){return i=i.shiftBlocks(t),e.write('class="quirks"')}e.register("theme/container",i);var t={additionalAttributes:a};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(r),e.partial("themeBase/item/base",i,null)}function a(e,i){return i=i.shiftBlocks(r),e.exists(i.get(["AuthorImage"],!1),i,{"else":t,block:n},null)}function t(e,i){return i=i.shiftBlocks(r),e.write('
      ')}function n(e,i){return i=i.shiftBlocks(r),e.write('
      ')}e.register("theme/item/base",i);var r={userAvatar:a};return i}(),{render:function(i,a){return e.render("theme/item/base",i,a)}}}),liveblog.define("themeFile",["css!theme/liveblog","plugins/scroll-pagination","plugins/twitter-widgets","plugins/post-hash","plugins/permanent-link","plugins/social-share","plugins/wrappup-toggle","plugins/user-comments","plugins/status","tmpl!theme/container","tmpl!theme/item/base"],function(){return{plugins:["scroll-pagination","twitter-widgets","post-hash","permanent-link","social-share","wrappup-toggle","user-comments","status"]} +}); \ No newline at end of file diff --git a/gui-resources/scripts/js/views/posts.js b/gui-resources/scripts/js/views/posts.js index 844d0f8fa..5b0dbcf07 100644 --- a/gui-resources/scripts/js/views/posts.js +++ b/gui-resources/scripts/js/views/posts.js @@ -143,6 +143,9 @@ define([ // Render `post` if `flag.autoRender: true` or if loading the next page, // otherwise add it as a pending post. checkPending: function(post) { + if (this.removePostFromCollection(post)) { + return; + } // `post.get('updateItem')` returns false for next page loading. if (!this.flags.autoRender && post.get('updateItem')) { post.set('pending', true); diff --git a/gui-themes/themes/aamulehti/desktop.js b/gui-themes/themes/aamulehti/desktop.js index c19fe666e..b39e92d81 100644 --- a/gui-themes/themes/aamulehti/desktop.js +++ b/gui-themes/themes/aamulehti/desktop.js @@ -2,25 +2,27 @@ define([ 'css!theme/liveblog', - 'plugins/button-pagination', + 'plugins/scroll-pagination', 'plugins/twitter-widgets', 'plugins/post-hash', 'plugins/permanent-link', 'plugins/social-share', 'plugins/wrappup-toggle', 'plugins/user-comments', + 'plugins/status', 'tmpl!theme/container', 'tmpl!theme/item/base' ], function() { return { plugins: [ - 'button-pagination', + 'scroll-pagination', 'twitter-widgets', 'post-hash', 'permanent-link', 'social-share', 'wrappup-toggle', - 'user-comments' + 'user-comments', + 'status' ] }; }); diff --git a/gui-themes/themes/ksml-light/desktop.js b/gui-themes/themes/ksml-light/desktop.js index c19fe666e..b39e92d81 100644 --- a/gui-themes/themes/ksml-light/desktop.js +++ b/gui-themes/themes/ksml-light/desktop.js @@ -2,25 +2,27 @@ define([ 'css!theme/liveblog', - 'plugins/button-pagination', + 'plugins/scroll-pagination', 'plugins/twitter-widgets', 'plugins/post-hash', 'plugins/permanent-link', 'plugins/social-share', 'plugins/wrappup-toggle', 'plugins/user-comments', + 'plugins/status', 'tmpl!theme/container', 'tmpl!theme/item/base' ], function() { return { plugins: [ - 'button-pagination', + 'scroll-pagination', 'twitter-widgets', 'post-hash', 'permanent-link', 'social-share', 'wrappup-toggle', - 'user-comments' + 'user-comments', + 'status' ] }; }); diff --git a/gui-themes/themes/ksml/desktop.js b/gui-themes/themes/ksml/desktop.js index c19fe666e..b39e92d81 100644 --- a/gui-themes/themes/ksml/desktop.js +++ b/gui-themes/themes/ksml/desktop.js @@ -2,25 +2,27 @@ define([ 'css!theme/liveblog', - 'plugins/button-pagination', + 'plugins/scroll-pagination', 'plugins/twitter-widgets', 'plugins/post-hash', 'plugins/permanent-link', 'plugins/social-share', 'plugins/wrappup-toggle', 'plugins/user-comments', + 'plugins/status', 'tmpl!theme/container', 'tmpl!theme/item/base' ], function() { return { plugins: [ - 'button-pagination', + 'scroll-pagination', 'twitter-widgets', 'post-hash', 'permanent-link', 'social-share', 'wrappup-toggle', - 'user-comments' + 'user-comments', + 'status' ] }; }); diff --git a/gui-themes/themes/sasa-light/desktop.js b/gui-themes/themes/sasa-light/desktop.js index 5747aed7a..b39e92d81 100644 --- a/gui-themes/themes/sasa-light/desktop.js +++ b/gui-themes/themes/sasa-light/desktop.js @@ -9,6 +9,7 @@ define([ 'plugins/social-share', 'plugins/wrappup-toggle', 'plugins/user-comments', + 'plugins/status', 'tmpl!theme/container', 'tmpl!theme/item/base' ], function() { @@ -20,7 +21,8 @@ define([ 'permanent-link', 'social-share', 'wrappup-toggle', - 'user-comments' + 'user-comments', + 'status' ] }; }); diff --git a/gui-themes/themes/sasa/desktop.js b/gui-themes/themes/sasa/desktop.js index c19fe666e..b39e92d81 100644 --- a/gui-themes/themes/sasa/desktop.js +++ b/gui-themes/themes/sasa/desktop.js @@ -2,25 +2,27 @@ define([ 'css!theme/liveblog', - 'plugins/button-pagination', + 'plugins/scroll-pagination', 'plugins/twitter-widgets', 'plugins/post-hash', 'plugins/permanent-link', 'plugins/social-share', 'plugins/wrappup-toggle', 'plugins/user-comments', + 'plugins/status', 'tmpl!theme/container', 'tmpl!theme/item/base' ], function() { return { plugins: [ - 'button-pagination', + 'scroll-pagination', 'twitter-widgets', 'post-hash', 'permanent-link', 'social-share', 'wrappup-toggle', - 'user-comments' + 'user-comments', + 'status' ] }; }); diff --git a/gui-themes/themes/satakansa/desktop.js b/gui-themes/themes/satakansa/desktop.js index c19fe666e..b39e92d81 100644 --- a/gui-themes/themes/satakansa/desktop.js +++ b/gui-themes/themes/satakansa/desktop.js @@ -2,25 +2,27 @@ define([ 'css!theme/liveblog', - 'plugins/button-pagination', + 'plugins/scroll-pagination', 'plugins/twitter-widgets', 'plugins/post-hash', 'plugins/permanent-link', 'plugins/social-share', 'plugins/wrappup-toggle', 'plugins/user-comments', + 'plugins/status', 'tmpl!theme/container', 'tmpl!theme/item/base' ], function() { return { plugins: [ - 'button-pagination', + 'scroll-pagination', 'twitter-widgets', 'post-hash', 'permanent-link', 'social-share', 'wrappup-toggle', - 'user-comments' + 'user-comments', + 'status' ] }; }); diff --git a/gui-themes/themes/stt-fnb/desktop.js b/gui-themes/themes/stt-fnb/desktop.js index 5747aed7a..b39e92d81 100644 --- a/gui-themes/themes/stt-fnb/desktop.js +++ b/gui-themes/themes/stt-fnb/desktop.js @@ -9,6 +9,7 @@ define([ 'plugins/social-share', 'plugins/wrappup-toggle', 'plugins/user-comments', + 'plugins/status', 'tmpl!theme/container', 'tmpl!theme/item/base' ], function() { @@ -20,7 +21,8 @@ define([ 'permanent-link', 'social-share', 'wrappup-toggle', - 'user-comments' + 'user-comments', + 'status' ] }; }); diff --git a/gui-themes/themes/stt-fnb/mobile.js b/gui-themes/themes/stt-fnb/mobile.js index 5747aed7a..b39e92d81 100644 --- a/gui-themes/themes/stt-fnb/mobile.js +++ b/gui-themes/themes/stt-fnb/mobile.js @@ -9,6 +9,7 @@ define([ 'plugins/social-share', 'plugins/wrappup-toggle', 'plugins/user-comments', + 'plugins/status', 'tmpl!theme/container', 'tmpl!theme/item/base' ], function() { @@ -20,7 +21,8 @@ define([ 'permanent-link', 'social-share', 'wrappup-toggle', - 'user-comments' + 'user-comments', + 'status' ] }; }); diff --git a/gui-themes/themes/stt-fnb/quirks.js b/gui-themes/themes/stt-fnb/quirks.js index 5747aed7a..b39e92d81 100644 --- a/gui-themes/themes/stt-fnb/quirks.js +++ b/gui-themes/themes/stt-fnb/quirks.js @@ -9,6 +9,7 @@ define([ 'plugins/social-share', 'plugins/wrappup-toggle', 'plugins/user-comments', + 'plugins/status', 'tmpl!theme/container', 'tmpl!theme/item/base' ], function() { @@ -20,7 +21,8 @@ define([ 'permanent-link', 'social-share', 'wrappup-toggle', - 'user-comments' + 'user-comments', + 'status' ] }; }); diff --git a/package.json b/package.json index 52740a4c0..f2827960f 100644 --- a/package.json +++ b/package.json @@ -77,6 +77,7 @@ "karma-requirejs": "^0.2.1", "karma-sinon-chai": "^0.1.5", "mocha": "^1.18.2", + "mocha-lcov-reporter": "0.0.1", "phantomjs": "^1.9.7-15", "protractor": "^0.23.1", "protractor-screenshot-reporter": "~0.0.4", diff --git a/spec/embed_spec.js b/spec/embed_spec.js index 965e186d4..ab6d6277d 100644 --- a/spec/embed_spec.js +++ b/spec/embed_spec.js @@ -1,8 +1,11 @@ -/*global describe, beforeEach, expect, it, element, by, jasmine */ +/*global describe, beforeEach, expect, it, element, by */ +var randomText = require('./helpers/utils.js').UUIDv4; var gotoUri = require('./helpers/liveblog_frontend').gotoUri; var uploadFixtures = require('./helpers/liveblog_fixtures').uploadFixtures; -var postCreateAndPublish = require('./helpers/liveblog_posts.js').postCreateAndPublish; +var liveblogBackend = require('./helpers/liveblog_posts.js'); +var postCreateAndPublish = liveblogBackend.postCreateAndPublish; +var postEdit = liveblogBackend.postEdit; // Protractor Params: var pp = protractor.getInstance().params; @@ -37,29 +40,55 @@ describe('Embed', function() { }); }); - it(' is updates to show just added post', function() { + it(' is updating to show just added post', function() { + var postContent = randomText(); postCreateAndPublish({ - postContent: 'test123' + postContent: postContent }); - console.log( - '[POST] published:' + jasmine.pp(Date()) - ); browser.wait(function() { return browser.isElementPresent( by.cssContainingText( 'div.liveblog-content p.post-text', - 'test123' + postContent ) ); - }, pp.maxTimeout) - .then(function() { - console.log( - '[POST] displayed:' + jasmine.pp(Date()) - ); - }); + }, pp.maxTimeout); expect(true).toBe(true); }, pp.maxTimeout); + it(' is updating to show just edited post', function() { + var postContent = randomText(), + newContent = randomText(), + postId; + postCreateAndPublish({ + postContent: postContent + }, function(e, r, j, id) { + postId = id; + }); + browser.wait(function() { + return browser.isElementPresent( + by.cssContainingText( + 'div.liveblog-content p.post-text', + postContent + ) + ); + }, pp.maxTimeout) + .then(function() { + postEdit({ + postId: postId, + newContent: newContent + }); + browser.wait(function() { + return browser.isElementPresent( + by.cssContainingText( + 'div.liveblog-content p.post-text', + newContent + ) + ); + }, pp.maxTimeout); + expect(true).toBe(true); + }); + }, pp.maxTimeout * 2); }); }); diff --git a/spec/helpers/liveblog_posts.js b/spec/helpers/liveblog_posts.js index 6250bdd62..096730385 100644 --- a/spec/helpers/liveblog_posts.js +++ b/spec/helpers/liveblog_posts.js @@ -7,6 +7,7 @@ var utils = require('./utils'); var getIdFromHref = utils.getIdFromHref; exports.postCreate = postCreate; +exports.postEdit = postEdit; exports.postPublish = postPublish; exports.postCreateAndPublish = postCreateAndPublish; @@ -29,6 +30,26 @@ function postCreate(args, callback) { }); } +function postEdit(args, callback) { + callback = callback || function() {}; + args = args || {}; + var newContent = args.newContent || 'Test post', + blogId = args.blogId || protractor.getInstance().params.blogId, + postId = args.postId; + if (!postId) { + throw Error('No postId provided'); + } + backendRequestAuth({ + method: 'PUT', + uri: '/my/LiveDesk/Blog/' + blogId + '/Post/' + postId, + json: { + 'Content': newContent + } + }, function(e, r, j) { + callback(e, r, j); + }); +} + function postPublish(args, callback) { args = args || {}; callback = callback || function() {};