/** * Hosted by Overblog.com (JFG Networks) * All rights reserved 2011-2012 */ YUI.add("widget-htmlparser",function(e,t){var n=e.Widget,r=e.Node,i=e.Lang,s="srcNode",o="contentBox";n.HTML_PARSER={},n._buildCfg={aggregates:["HTML_PARSER"]},n.ATTRS[s]={value:null,setter:r.one,getter:"_getSrcNode",writeOnce:!0},e.mix(n.prototype,{_getSrcNode:function(e){return e||this.get(o)},_applyParsedConfig:function(t,n,r){return r?e.mix(n,r,!1):n},_applyParser:function(t){var n=this,r=this._getNodeToParse(),s=n._getHtmlParser(),o,u;s&&r&&e.Object.each(s,function(e,t,s){u=null,i.isFunction(e)?u=e.call(n,r):i.isArray(e)?(u=r.all(e[0]),u.isEmpty()&&(u=null)):u=r.one(e),u!==null&&u!==undefined&&(o=o||{},o[t]=u)}),t=n._applyParsedConfig(r,t,o)},_getNodeToParse:function(){var e=this.get("srcNode");return this._cbFromTemplate?null:e},_getHtmlParser:function(){var t=this._getClasses(),n={},r,i;for(r=t.length-1;r>=0;r--)i=t[r].HTML_PARSER,i&&e.mix(n,i,!0);return n}})},"@VERSION@",{requires:["widget-base"]}); YUI.add("widget-skin",function(e,t){var n="boundingBox",r="contentBox",i="skin",s=e.ClassNameManager.getClassName;e.Widget.prototype.getSkinName=function(){var e=this.get(r)||this.get(n),t=new RegExp("\\b"+s(i)+"-(\\S+)"),o;return e&&e.ancestor(function(e){return o=e.get("className").match(t),o}),o?o[1]:null}},"@VERSION@",{requires:["widget-base"]}); YUI.add("widget-uievents",function(e,t){var n="boundingBox",r=e.Widget,i="render",s=e.Lang,o=":",u=e.Widget._uievts=e.Widget._uievts||{};e.mix(r.prototype,{_destroyUIEvents:function(){var t=e.stamp(this,!0);e.each(u,function(n,r){n.instances[t]&&(delete n.instances[t],e.Object.isEmpty(n.instances)&&(n.handle.detach(),u[r]&&delete u[r]))})},UI_EVENTS:e.Node.DOM_EVENTS,_getUIEventNode:function(){return this.get(n)},_createUIEvent:function(t){var n=this._getUIEventNode(),i=e.stamp(n)+t,s=u[i],o;s||(o=n.delegate(t,function(e){var t=r.getByNode(this);t&&t._filterUIEvent(e)&&t.fire(e.type,{domEvent:e})},"."+e.Widget.getClassName()),u[i]=s={instances:{},handle:o}),s.instances[e.stamp(this)]=1},_filterUIEvent:function(e){return e.currentTarget.compareTo(e.container)||e.container.compareTo(this._getUIEventNode())},_getUIEvent:function(e){if(s.isString(e)){var t=this.parseType(e)[1],n,r;return t&&(n=t.indexOf(o),n>-1&&(t=t.substring(n+o.length)),this.UI_EVENTS[t]&&(r=t)),r}},_initUIEvent:function(e){var t=this._getUIEvent(e),n=this._uiEvtsInitQueue||{};t&&!n[t]&&(this._uiEvtsInitQueue=n[t]=1,this.after(i,function(){this._createUIEvent(t),delete this._uiEvtsInitQueue[t]}))},on:function(e){return this._initUIEvent(e),r.superclass.on.apply(this,arguments)},publish:function(e,t){var n=this._getUIEvent(e);return n&&t&&t.defaultFn&&this._initUIEvent(n),r.superclass.publish.apply(this,arguments)}},!0)},"@VERSION@",{requires:["node-event-delegate","widget-base"]}); YUI.add("ob-add-comment-widget",function(c){var b="ob-iframe-addcomment",a=function(d){a.superclass.constructor.apply(this,arguments)};c.AddCommentWidget=c.extend(a,c.Widget,{renderUI:function(){var e=this.get("contentBox").getComputedStyle("width"),f=c.config.host.comment+"/"+this.get("lang")+"/addcomment/"+this.get("id_blog")+"/"+this.get("id_post")+"/"+this.get("id_comment"),d=c.Node.create('');if(this.get("id_comment")){d.addClass(b+"-"+this.get("id_comment"))}if(e<="325px"){d.setStyle("height","244px")}else{if(e<="490px"){d.setStyle("height","220px")}}this.get("contentBox").append(d)}},{NAME:"AddCommentWidget",ATTRS:{id_blog:{value:null},id_post:{value:null},id_comment:{value:"",setter:function(d){var e;if(c.Lang.isNumber(d)){e=d}else{e=0}return e}},lang:{value:"en"}}})},"1.0",{requires:["widget"]}); YUI.add("ob-comments-app-view",function(c){var b="ob-ctn-add-comment",a=function(){a.superclass.constructor.apply(this,arguments)};c.CommentsAppView=c.extend(a,c.View,{_commentsListView:null,_addCommentWidget:null,render:function(){this.get("container").addClass("ob-commentsList");if(c.config.blogconfig.settings.allowed){this.get("container").append(c.Node.create('
'));this._addCommentWidget=new c.AddCommentWidget({srcNode:"."+b,id_blog:this.get("id_blog"),id_post:this.get("id_post"),lang:c.config.blogconfig.lang});this._addCommentWidget.render()}this._commentsListView=new c.CommentsListView({id_blog:this.get("id_blog"),id_post:this.get("id_post"),comment_tpl:this.get("comment_tpl")});this.get("container").append(this._commentsListView.render().get("container"))}},{NAME:"CommentsAppView",ATTRS:{id_blog:{value:null},id_post:{value:null},comment_tpl:{value:""}}})},"1.0",{requires:["view","ob-comments-list-view","ob-add-comment-widget"]}); YUI.add("ob-comments",function(a){a.on("domready",function(){var b=a.one("#comment-item-template"),c,d,e;if(b){c=b.get("innerHTML"),d,e=new a.CommentsAppView({id_blog:a.config.blogconfig.id_blog,id_post:a.config.blogconfig.id_post,comment_tpl:c});b.insert(e.get("container"),"after");b.remove(true);d=a.one(".ob-commentsList");if(d){a.one(".ob-commentsList").remove(true)}e.render()}})},"1",{requires:["jsonp","node","ob-comments-app-view"]});