/* START Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.Scripts.CommentsCountControlBinder.js */ Type.registerNamespace("Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend"); Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsCountControlBinder=function(){Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsCountControlBinder.initializeBase(this); this._serviceUrl=null; this._ninetyNinePlusText=null; this._commentsText=null; this._commentText=null; this._leaveCommentText=null; }; Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsCountControlBinder.prototype={initialize:function(){Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsCountControlBinder.callBaseMethod(this,"initialize"); this._getCommentsCounts(); },dispose:function(){Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsCountControlBinder.callBaseMethod(this,"dispose"); },_collectThreadIds:function(){var commmentsCounterControls=jQuery(".sfcommentsCounterWrp"); var uniqueKeys={}; for(var i=0; i0&¤tCount<100){currentCountFormatted=currentCount; }else{if(currentCount>=100){currentCountFormatted=that.get_ninetyNinePlusText(); }}if(displayMode==="FullText"&¤tCount==1){currentCountFormatted+=" "+that.get_commentText().toLowerCase(); }else{if(displayMode==="FullText"&¤tCount>1){currentCountFormatted+=" "+that.get_commentsText().toLowerCase(); }}jQuery(commentsCounterControl).html(currentCountFormatted); if(displayMode==="IconOnly"){that._setImages(currentCount,commentsCounterControl); }}); }},_setImages:function(count,counterControl){if(counterControl.length===0){return; }else{if(count&&count!=0){jQuery(counterControl).removeClass("sfcommentsEmpty"); }else{jQuery(counterControl).addClass("sfcommentsEmpty"); }}},_getCommentsCounts:function(){var threadKeys=this._collectThreadIds(); var getCountUrl=String.format(this.get_serviceUrl()+"/comments/count?ThreadKey={0}",threadKeys); jQuery.ajax({type:"GET",url:getCountUrl,contentType:"application/json",cache:false,accepts:{text:"application/json"},processData:false,success:jQuery.proxy(this._setCommentsCounts,this)}); },get_serviceUrl:function(){return this._serviceUrl; },set_serviceUrl:function(value){this._serviceUrl=value; },get_ninetyNinePlusText:function(){return this._ninetyNinePlusText; },set_ninetyNinePlusText:function(value){this._ninetyNinePlusText=value; },get_commentsText:function(){return this._commentsText; },set_commentsText:function(value){this._commentsText=value; },get_commentText:function(){return this._commentText; },set_commentText:function(value){this._commentText=value; },get_leaveCommentText:function(){return this._leaveCommentText; },set_leaveCommentText:function(value){this._leaveCommentText=value; }}; Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsCountControlBinder.registerClass("Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsCountControlBinder",Sys.Component); /* END Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.Scripts.CommentsCountControlBinder.js */ /* START Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.Scripts.CommentsRestClient.js */ Type.registerNamespace("Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend"); Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsRestClient=function(serviceUrl){Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsRestClient.initializeBase(this); if(serviceUrl.substr(serviceUrl.length-1)!="/"){serviceUrl=serviceUrl+"/"; }this._rootServiceUrl=serviceUrl; }; Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsRestClient.prototype={initialize:function(){Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsRestClient.callBaseMethod(this,"initialize"); },dispose:function(){Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsRestClient.callBaseMethod(this,"dispose"); },getComment:function(commentKey,onSuccess){var requestUrl=(this.get_rootServiceUrl()+String.format("comments/{0}",commentKey)); jQuery.ajax({type:"GET",accepts:{text:"application/json"},url:requestUrl,dataType:"text",dataFilter:function(data){return Sys.Serialization.JavaScriptSerializer.deserialize(data); },cache:false,processData:false,success:onSuccess}); },getComments:function(threadKey,language,olderThan,newerThan,sortDescending,take,onSuccess,onError,onComplete){var params=this._getQueryString(threadKey,language,olderThan,newerThan,sortDescending,take); var requestUrl=this.get_rootServiceUrl()+"comments/"+params; jQuery.ajax({type:"GET",url:requestUrl,dataType:"text",dataFilter:function(data){return Sys.Serialization.JavaScriptSerializer.deserialize(data); },accepts:{text:"application/json"},cache:false,processData:false,success:onSuccess,error:onError,complete:onComplete}); },getCommentsCount:function(threadKey,status,onSuccess){var getCountUrl=this.get_rootServiceUrl()+String.format("comments/count?ThreadKey={0}",threadKey); if(status){getCountUrl+="&Status="+status; }jQuery.ajax({type:"GET",url:getCountUrl,contentType:"application/json",cache:false,async:false,processData:false,success:onSuccess}); },createComment:function(item,onSuccess,onError,onComplete){jQuery.ajax({type:"POST",url:this.get_rootServiceUrl()+"comments",contentType:"application/json",data:Telerik.Sitefinity.JSON.stringify(item),dataType:"text",dataFilter:function(data){return Sys.Serialization.JavaScriptSerializer.deserialize(data); },accepts:{text:"application/json"},cache:false,processData:false,success:onSuccess,error:onError,complete:onComplete}); },updateComment:function(item,onSuccess,onError,onComplete){jQuery.ajax({type:"PUT",url:this.get_rootServiceUrl()+"comments/",contentType:"application/json",accepts:{text:"application/json"},data:Telerik.Sitefinity.JSON.stringify(item),dataType:"text",dataFilter:function(data){return Sys.Serialization.JavaScriptSerializer.deserialize(data); },cache:false,processData:false,success:onSuccess,error:onError,complete:onComplete}); },updateComments:function(commentKeys,status,onSuccess,onError,onComplete){var requestUrl=this.get_rootServiceUrl()+"comments/list/"; jQuery.ajax({type:"PUT",url:requestUrl,contentType:"application/json",data:Telerik.Sitefinity.JSON.stringify({Key:commentKeys,Status:status}),cache:false,processData:false,success:onSuccess,error:onError,complete:onComplete}); },deleteComment:function(commentKey,onSuccess,onError,onComplete){var requestUrl=this.get_rootServiceUrl()+"comments/"+commentKey; jQuery.ajax({type:"DELETE",url:requestUrl,contentType:"application/json",cache:false,processData:false,success:onSuccess,error:onError,complete:onComplete}); },deleteComments:function(commentKeys,onSuccess,onError,onComplete){var requestUrl=this.get_rootServiceUrl()+"comments/list/"; jQuery.ajax({type:"DELETE",url:requestUrl,contentType:"application/json",data:Telerik.Sitefinity.JSON.stringify({Key:commentKeys}),cache:false,processData:false,success:onSuccess,error:onError,complete:onComplete}); },getThreads:function(item,siteId,onSuccess,onError,onComplete){var url=this.get_rootServiceUrl()+"threads/filter"; if(siteId){url+="?sf_site="+siteId; }jQuery.ajax({type:"POST",url:url,contentType:"application/json",data:Telerik.Sitefinity.JSON.stringify(item),dataType:"text",dataFilter:function(data){return Sys.Serialization.JavaScriptSerializer.deserialize(data); },async:false,accepts:{text:"application/json"},cache:false,processData:false,success:onSuccess,error:onError,complete:onComplete}); },getCaptcha:function(onSuccess,onError,onComplete){var requestUrl=this.get_rootServiceUrl(); jQuery.ajax({type:"GET",url:requestUrl+"captcha",contentType:"application/json",cache:false,processData:false,accepts:{text:"application/json"},success:onSuccess,error:onError,complete:onComplete}); },_getQueryString:function(threadKey,language,olderThan,newerThan,sortDescending,take){var params="?"; if(threadKey){params+=String.format("ThreadKey={0}&",threadKey); }if(language){params+=String.format("Language={0}&",language); }if(olderThan){params+=String.format("OlderThan={0}&",olderThan); }if(newerThan){params+=String.format("NewerThan={0}&",newerThan); }if(sortDescending){params+=String.format("SortDescending={0}&",sortDescending); }if(take){params+=String.format("Take={0}",take); }var lastChar=params.charAt(params.length-1); if(lastChar==="&"||lastChar==="?"){params.substring(0,params.length-1); }return params; },get_rootServiceUrl:function(){return this._rootServiceUrl; },set_rootServiceUrl:function(value){this._rootServiceUrl=value; if(this._rootServiceUrl.substr(-1)!="/"){this._rootServiceUrl=this._rootServiceUrl+"/"; }}}; Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsRestClient.registerClass("Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsRestClient",Sys.Component); /* END Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.Scripts.CommentsRestClient.js */ /* START Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.Scripts.CommentsWidget.js */ Type.registerNamespace("Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend"); Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsWidget=function(element){Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsWidget.initializeBase(this,[element]); this._submitCommentForm=null; this._commentsListViewForm=null; this._serviceUrl=null; this._loginServiceUrl=null; this._leaveCommentAnchor=null; this._clientLabelManager=null; this._threadKey=null; this._threadIsClosed=null; this._commentsRestClient=null; this._countAll=0; this._language=null; this._onLoadDelegate=null; this.commentsRestClientCommon; this._requiresApprovalSetting=null; this._requiredApprovalMessageLabel=null; this._reviewSubmittedSuccessfullyMessageLabel=null; this._commentsNotificationSubscriptionControl=null; this._requiresCaptchaSetting=null; this._commentsAverageRatingControlBinder=null; this._enableRatings=null; }; Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsWidget.prototype={initialize:function(){Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsWidget.callBaseMethod(this,"initialize"); this.commentsRestClientCommon=new Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsRestClient(this.get_serviceUrl()); this.set_commentsRestClient(this.commentsRestClientCommon); this.get_commentsListViewForm().set_commentsRestClient(this.commentsRestClientCommon); if(!this.get_threadIsClosed()){this._leaveCommentAnchor=this.get_commentsListViewForm().get_leaveCommentAnchor(); this._leaveCommentClickDelegate=Function.createDelegate(this,this._scrollToItem); $addHandler(this._leaveCommentAnchor,"click",this._leaveCommentClickDelegate); }else{this._leaveCommentAnchor=this.get_commentsListViewForm().get_leaveCommentAnchor(); jQuery(this._leaveCommentAnchor).hide(); }this._onLoadDelegate=Function.createDelegate(this,this._onLoadHandler); Sys.Application.add_load(this._onLoadDelegate); this.set_countAll(this.get_commentsListViewForm().get_initalCommentsCount()); if(this.get_commentsListViewForm().get_loadMoreCommentsAnchor()!==null){this.get_commentsListViewForm().add_updateLabels(jQuery.proxy(this._updateLoadMoreCommentsLinksVisibility,this)); }this._updateLeaveCommentsLinkVisibility(); this._updateSortLinkVisibility(); this.changeFormsVisibility(); },dispose:function(){if(this.get_submitCommentForm()){if(this.get_submitCommentForm().get_submitAuthenticatedCommentForm()){this.get_submitCommentForm().get_submitAuthenticatedCommentForm().remove_submitSuccess(this._refreshCommentsAll); }if(this.get_submitCommentForm().get_submitUnAuthenticatedCommentForm()){this.get_submitCommentForm().get_submitUnAuthenticatedCommentForm().remove_submitSuccess(this._refreshCommentsAll); }if(this._leaveCommentClickDelegate){if(this._leaveCommentAnchor){$removeHandler(this._leaveCommentAnchor,"click",this._leaveCommentClickDelegate); }delete this._leaveCommentClickDelegate; }}if(this._onLoadDelegate){Sys.Application.remove_load(this._onLoadDelegate); delete this._onLoadDelegate; }if(this.get_commentsListViewForm().get_loadMoreCommentsAnchor()!==null){this.get_commentsListViewForm().remove_updateLabels(this._updateLoadMoreCommentsLinksVisibility); }Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsWidget.callBaseMethod(this,"dispose"); },changeFormsVisibility:function(){var that=this; var submitForm=this.get_submitCommentForm(); var onSuccess=function(data){if(submitForm){jQuery.proxy(submitForm.setFormViewMode(data.IsAuthenticated),submitForm); that.setCaptchaVisibility(data.IsAuthenticated); }if(that.get_commentsNotificationSubscriptionControl()){if(!data.IsAuthenticated){jQuery(that.get_commentsNotificationSubscriptionControl().get_element()).hide(); }else{that.get_commentsNotificationSubscriptionControl().init(); }}}; var onError=function(){that.showAuthenticatedForm=false; that.showUnAuthenticatedForm=false; if(submitForm){jQuery(submitForm.get_submitCommentForm()).hide(); jQuery(submitForm.get_loginLink()).hide(); }}; var requestUrl=(this.get_loginServiceUrl()+String.format("/is-authenticated")); jQuery.ajax({type:"GET",url:requestUrl,contentType:"application/json",accepts:{text:"application/json"},cache:false,success:onSuccess,error:onError}); },setCaptchaVisibility:function(isAuthenticated){var submitForm=this.get_submitCommentForm(); if(isAuthenticated==true){jQuery.proxy(submitForm.setCaptchaViewMode(false)); }else{submitForm.setCaptchaViewMode(this._requiresCaptchaSetting); }},_onLoadHandler:function(){if(this.get_submitCommentForm()){this.get_submitCommentForm().add_submitSuccess(jQuery.proxy(this._refreshCommentsAll,this)); }},_refreshCommentsAll:function(sender,args){if(this.get_requiresApprovalSetting()){jQuery(this.get_requiredApprovalMessageLabel()).show(); }else{if(this.get_enableRatings()){jQuery(this.get_reviewSubmittedSuccessfullyMessageLabel()).show(); }}this._refreshCommentsList(sender,args); this.get_commentsRestClient().getCommentsCount([this.get_threadKey()],null,jQuery.proxy(this._updateCommentsCount,this)); },_refreshCommentsList:function(sender,args){this.get_commentsListViewForm().addNewComment(args); },_scrollToItem:function(sender,args){jQuery("html,body").animate({scrollTop:jQuery(this.get_submitCommentForm().get_element()).offset().top},300); },_updateCommentsCount:function(data,textStatus,jqXHR){this.set_countAll(data.Items[0].Count); if(this.get_commentsListViewForm().get_loadMoreCommentsAnchor()!==null){this._updateLoadMoreCommentsLinksVisibility(); }if(data.Items[0].Count==0){return; }this._updateLeaveCommentsLinkVisibility(); this._updateSortLinkVisibility(); var counterFields=jQuery(".sfcommentsCounterWrp[threadKey = '"+this.get_threadKey()+"'],.sfcommentsTitle[threadKey = '"+this.get_threadKey()+"']"); var commentsCountLabelText; var singleCommentCountLabelFormatText=this.get_clientLabelManager().getLabel("CommentsResources","CommentCount"); var commentsCountLabelFormatText=this.get_clientLabelManager().getLabel("CommentsResources","CommentsCount"); if(this.get_enableRatings()==true){singleCommentCountLabelFormatText=this.get_clientLabelManager().getLabel("CommentsResources","ReviewCount"); commentsCountLabelFormatText=this.get_clientLabelManager().getLabel("CommentsResources","ReviewsCount"); }for(var i=0; i1){commentsCountLabelText=String.format(commentsCountLabelFormatText,data.Items[0].Count); }}}$(counterFields[i]).html(commentsCountLabelText); }if(this.get_commentsAverageRatingControlBinder()){this.get_commentsAverageRatingControlBinder().getCommentsThreadRatings(); }},_updateLeaveCommentsLinkVisibility:function(){if(this.get_countAll()==0||this.get_threadIsClosed()||this.get_submitCommentForm()==null||!this.get_submitCommentForm()._isVisible()){jQuery(this._leaveCommentAnchor).hide(); }else{jQuery(this._leaveCommentAnchor).show(); }},_updateSortLinkVisibility:function(){if(this.get_countAll()<=1){jQuery(this.get_element()).find(".sfcommentsOrderFilterWrp").hide(); }else{jQuery(this.get_element()).find(".sfcommentsOrderFilterWrp").show(); }},_updateLoadMoreCommentsLinksVisibility:function(){var count=this.get_countAll(); if(count>this.get_commentsListViewForm().get_currentCommentsCount()){jQuery(this.get_commentsListViewForm().get_loadMoreCommentsAnchor()).show(); }else{jQuery(this.get_commentsListViewForm().get_loadMoreCommentsAnchor()).hide(); }},get_submitCommentForm:function(){return this._submitCommentForm; },set_submitCommentForm:function(value){this._submitCommentForm=value; },get_commentsListViewForm:function(){return this._commentsListViewForm; },set_commentsListViewForm:function(value){this._commentsListViewForm=value; },get_serviceUrl:function(){return this._serviceUrl; },set_serviceUrl:function(value){this._serviceUrl=value; },get_loginServiceUrl:function(){return this._loginServiceUrl; },set_loginServiceUrl:function(value){this._loginServiceUrl=value; },get_threadKey:function(){return encodeURIComponent(this._threadKey); },set_threadKey:function(value){this._threadKey=value; },get_threadIsClosed:function(){return this._threadIsClosed; },set_threadIsClosed:function(value){this._threadIsClosed=value; },get_clientLabelManager:function(){return this._clientLabelManager; },set_clientLabelManager:function(value){this._clientLabelManager=value; },get_commentsRestClient:function(){return this._commentsRestClient; },set_commentsRestClient:function(value){this._commentsRestClient=value; },get_countAll:function(){return this._countAll; },set_countAll:function(value){this._countAll=value; },get_language:function(){return this._language; },set_language:function(value){this._language=value; },get_requiredApprovalMessageLabel:function(){return this._requiredApprovalMessageLabel; },set_requiredApprovalMessageLabel:function(value){this._requiredApprovalMessageLabel=value; },get_reviewSubmittedSuccessfullyMessageLabel:function(){return this._reviewSubmittedSuccessfullyMessageLabel; },set_reviewSubmittedSuccessfullyMessageLabel:function(value){this._reviewSubmittedSuccessfullyMessageLabel=value; },get_requiresApprovalSetting:function(){return this._requiresApprovalSetting; },set_requiresApprovalSetting:function(value){this._requiresApprovalSetting=value; },get_commentsNotificationSubscriptionControl:function(){return this._commentsNotificationSubscriptionControl; },set_commentsNotificationSubscriptionControl:function(value){this._commentsNotificationSubscriptionControl=value; },get_requiresCaptchaSetting:function(){return this._requiresCaptchaSetting; },set_requiresCaptchaSetting:function(value){this._requiresCaptchaSetting=value; },get_commentsAverageRatingControlBinder:function(){return this._commentsAverageRatingControlBinder; },set_commentsAverageRatingControlBinder:function(value){this._commentsAverageRatingControlBinder=value; },get_enableRatings:function(){return this._enableRatings; },set_enableRatings:function(value){this._enableRatings=value; }}; Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsWidget.registerClass("Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsWidget",Sys.UI.Control); /* END Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.Scripts.CommentsWidget.js */ /* START Telerik.Sitefinity.Web.UI.Components.Scripts.ClientLabelManager.js */ Type.registerNamespace("Telerik.Sitefinity.Web.UI"); Telerik.Sitefinity.Web.UI.ClientLabelManager=function(element){this._dictionary=null; Telerik.Sitefinity.Web.UI.ClientLabelManager.initializeBase(this,[element]); }; Telerik.Sitefinity.Web.UI.ClientLabelManager.prototype={initialize:function(){this._dictionary=Sys.Serialization.JavaScriptSerializer.deserialize(this._dictionary); Telerik.Sitefinity.Web.UI.ClientLabelManager.callBaseMethod(this,"initialize"); },dispose:function(){Telerik.Sitefinity.Web.UI.ClientLabelManager.callBaseMethod(this,"dispose"); },getLabel:function(classId,key){if(classId==null||classId==""){return key; }return this._dictionary[classId+key]; },getConstant:function(name){if(name==null||name==""){return""; }return this._dictionary[name]; }}; Telerik.Sitefinity.Web.UI.ClientLabelManager.registerClass("Telerik.Sitefinity.Web.UI.ClientLabelManager",Sys.UI.Control); /* END Telerik.Sitefinity.Web.UI.Components.Scripts.ClientLabelManager.js */ /* START Telerik.Sitefinity.Resources.Scripts.Rating.rating.js */ jQuery.fn.rating = function (options) { var container = jQuery(this); var settings = { maxValue: 5, // max number of stars value: 0, // number of selected stars reviewCount: null, // number of reviews reviewCountNavigateUrl: null, // the href if the review count should be a link readOnly: false, label: null, displayMode: "IconOnly", //can be also ShortText which looks like *** (3.4), MediumText which looks like *** (3.4) out of 15 reviews and FullText which looks like Average Rating: *** (3.4) out of 15 reviews closingText: null, //closing text like **** out of 15 reviews closingTextNavigateUrl: null }; if (options) { jQuery.extend(settings, options); } normalizeInput(settings); if (settings.readOnly) { container.addClass("sfRatingReadOnly"); } //show leading label text if need if (settings.label) { container.html("" + settings.label + ""); } else { container.html(""); } //show the value as stars $(this).data("value", settings.value); var starsWrapper = jQuery('
'); container.append(starsWrapper); if (settings.value != null) { for (var i = 0; i < settings.maxValue ; i++) { var $div = jQuery('
'); $divA = jQuery('' + i + ''); $div.append($divA); $div.appendTo(starsWrapper); } //add the rating value to the markup if (settings.displayMode === "ShortText" || settings.displayMode === "MediumText" || settings.displayMode === "FullText") { container.append("(" + settings.value.toFixed(2) + ")"); } } if (settings.reviewCount) { if (settings.reviewCountNavigateUrl) { container.append("" + settings.reviewCount + ""); } else { container.append("" + settings.reviewCount + ""); } } if (settings.closingText) { if (settings.closingTextNavigateUrl) { container.append("" + settings.closingText + ""); } else { container.append("" + settings.closingText + ""); } } var stars = starsWrapper.children('.star'); //handle not readOnly rating if (!settings.readOnly) { stars.mouseover(function () { starsRenderer.drain(); starsRenderer.fill(this); }).mouseout(function () { starsRenderer.drain(); starsRenderer.reset(); }).focus(function () { starsRenderer.drain(); starsRenderer.fill(this); }).blur(function () { starsRenderer.drain(); starsRenderer.reset(); }); stars.click(function () { settings.value = parseInt(jQuery(this).children('a').html()) + 1; starsRenderer.drain(); starsRenderer.reset(); }); } //re-renderer which shows which stars are active, hovered and so on. var starsRenderer = { fill: function (el) { // fill to the current mouse position. var index = stars.index(el) + 1; stars.children('a').css('width', '100%').slice(0, index).addClass('hover').end(); }, drain: function () { // drain all the stars. stars.children('a').removeClass('on').removeClass('hover').end(); }, reset: function () { // Reset the stars to the default index. stars.children('a').slice(0, settings.value).addClass('on').end(); } }; starsRenderer.reset(); // Public methods this.get_value = function () { return settings.value; } this.set_value = function (newValue) { settings.value = newValue; starsRenderer.drain(); starsRenderer.reset(); container.children('.sfRatingAbsolute').html("(" + settings.value.toFixed(2) + ")"); } // Private methods function normalizeInput(settings) { if (typeof settings.maxValue == 'string' || settings.maxValue instanceof String) settings.maxValue = settings.maxValue.replace(',', '.'); if (typeof settings.value == 'string' || settings.value instanceof String) settings.value = settings.value.replace(',', '.'); if (typeof settings.reviewCountNavigateUrl == 'string' || settings.reviewCountNavigateUrl instanceof String) settings.reviewCountNavigateUrl = settings.reviewCountNavigateUrl.replace(/\"/g, '\"'); if (typeof settings.closingTextNavigateUrl == 'string' || settings.closingTextNavigateUrl instanceof String) settings.closingTextNavigateUrl = settings.closingTextNavigateUrl.replace(/\"/g, '\"'); } return (this); }; /* END Telerik.Sitefinity.Resources.Scripts.Rating.rating.js */ /* START Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.Scripts.CommentsListView.js */ Type.registerNamespace("Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend"); Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsListView=function(element){Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsListView.initializeBase(this,[element]); this._serviceUrl=null; this._loadMoreCommentsAnchor=null; this._currentCommentsCount=null; this._initalCommentsCount=null; this._loadMoreCommentsSize=null; this._newestOnTopAnchor=null; this._oldestOnTopAnchor=null; this._commentsCountLabel=null; this._leaveCommentAnchor=null; this._sortAscDate=null; this._latestDate=null; this._oldestDate=null; this.sortDescending=true; this._clientLabelManager=null; this._threadKey=null; this._currentLanguage=null; this._visibleCommentsStatuses=null; this._isLoading=false; this._alwaysUseUtc=false; }; Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsListView.prototype={initialize:function(){Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsListView.callBaseMethod(this,"initialize"); if(this.get_sortAscDate()){this.sortDescending=false; jQuery(this.get_newestOnTopAnchor()).show(); jQuery(this.get_oldestOnTopAnchor()).hide(); }else{jQuery(this.get_newestOnTopAnchor()).hide(); }this._initializeKendo(); var safeThreadAttrName=unescape(this.get_threadKey()); jQuery(this.get_commentsCountLabel()).attr("threadKey",safeThreadAttrName); this._initializeRating(); if(this.get_loadMoreCommentsAnchor()!==null){if(this.get_initalCommentsCount()>this.get_currentCommentsCount()){jQuery(this.get_loadMoreCommentsAnchor()).show(); }else{jQuery(this.get_loadMoreCommentsAnchor()).hide(); }this._loadMoreClickDelegate=Function.createDelegate(this,this._loadMoreClickHandler); $addHandler(this.get_loadMoreCommentsAnchor(),"click",this._loadMoreClickDelegate); }this._newestOnTopClickDelegate=Function.createDelegate(this,this._changeSortOrderClickHandler); $addHandler(this.get_newestOnTopAnchor(),"click",this._newestOnTopClickDelegate); this._oldestOnTopClickDelegate=Function.createDelegate(this,this._changeSortOrderClickHandler); $addHandler(this.get_oldestOnTopAnchor(),"click",this._oldestOnTopClickDelegate); },dispose:function(){if(this._newestOnTopClickDelegate){if(this.get_newestOnTopAnchor()){$removeHandler(this.get_newestOnTopAnchor(),"click",this._newestOnTopClickDelegate); }delete this._newestOnTopClickDelegate; }if(this._oldestOnTopClickDelegate){if(this.get_oldestOnTopAnchor()){$removeHandler(this.get_oldestOnTopAnchor(),"click",this._oldestOnTopClickDelegate); }delete this._oldestOnTopClickDelegate; }if(this._loadMoreClickDelegate){if(this.get_loadMoreCommentsAnchor()){$removeHandler(this.get_loadMoreCommentsAnchor(),"click",this._loadMoreClickDelegate); }delete this._loadMoreClickDelegate; }Telerik.Sitefinity.Modules.Comments.Web.UI.Frontend.CommentsListView.callBaseMethod(this,"dispose"); },_initializeKendo:function(){jQuery(this.get_commentsKendoListView()).kendoListView({template:jQuery.proxy(kendo.template(jQuery("#commentsKendoListViewTemplate").html()),this)}); },_initializeRating:function(){jQuery(this._element).find(".sfRating").each(function(){var currentRating=jQuery(this).html(); currentRating=currentRating.replace(/,/g,"."); if(jQuery.isNumeric(currentRating)){jQuery(this).rating({value:currentRating,readOnly:true}); }}); },_dataSourceChanged:function(e){this._updateTimeInterval(); },_updateTimeInterval:function(){var currentData=jQuery(jQuery(this.get_commentsKendoListView()).data().kendoListView.dataSource.data()); if(currentData.length==0){return; }if(this.get_sortAscDate()){this._latestDate=currentData.last()[0].DateCreated; this._oldestDate=currentData.first()[0].DateCreated; }else{this._latestDate=currentData.first()[0].DateCreated; this._oldestDate=currentData.last()[0].DateCreated; }},add_updateLabels:function(delegate){this.get_events().addHandler("updateLabels",delegate); },remove_updateLabels:function(delegate){this.get_events().removeHandler("updateLabels",delegate); },raise_updateLabels:function(){if(typeof this.get_events=="function"){var h=this.get_events().getHandler("updateLabels"); if(h){h(this,Sys.EventArgs.Empty); }return Sys.EventArgs.Empty; }},addNewComment:function(comment){if(jQuery.inArray(comment.Status,this.get_visibleCommentsStatuses())==-1){return; }var currentDataSource=jQuery(this.get_commentsKendoListView()).data().kendoListView.dataSource; if(currentDataSource.transport.options||this.get_sortAscDate()){currentDataSource.total(currentDataSource.total()+1); if(currentDataSource.data().length'); if(data.isInline){wrapperDiv.addClass("sfInlineBlock"); }$this.wrap(wrapperDiv); var lblWatermarkText=$('