Файловый менеджер - Редактировать - /home/lmsyaran/public_html/joomla5/plugins/fabrik_form/comment/comments-min.js
Назад
/*! Fabrik */ define(["jquery","fab/fabrik"],function(n,t){"use strict";return new Class({Implements:[Events],options:{formid:0,rowid:0,label:"",wysiwyg:!1},initialize:function(t,e){this.element=document.id(t),"null"!==typeOf(this.element)&&(this.options=n.extend(this.options,e),this.fx={},this.fx.toggleForms=$H(),this.spinner=new Spinner("fabrik-comments",{message:"loading"}),this.ajax={},this.ajax.deleteComment=new Request({url:"",method:"get",data:{option:"com_fabrik",format:"raw",task:"plugin.pluginAjax",plugin:"comment",method:"deleteComment",g:"form",formid:this.options.formid,rowid:this.options.rowid},onComplete:function(t){this.deleteComplete(t)}.bind(this)}),this.ajax.updateComment=new Request({url:"",method:"post",data:{option:"com_fabrik",format:"raw",task:"plugin.pluginAjax",plugin:"comment",method:"updateComment",g:"form",formid:this.options.formid,rowid:this.options.rowid}}),this.watchReply(),this.watchInput())},ajaxComplete:function(t){var e=20*(t=JSON.parse(t)).depth.toInt()+"px",n="comment_"+t.id,n=new Element("li",{id:n,styles:{"margin-left":e}}).set("html",t.content),e=("li"===this.currentLi.get("tag")?n.inject(this.currentLi,"after"):n.inject(this.currentLi),new Fx.Tween(n,{property:"opacity",duration:5e3}));e.set(0),e.start(0,100),this.watchReply(),"null"!==typeOf(t.message)&&window.alert(t.message.title,t.message.message),this.spinner.hide(),this.updateThumbs()},watchInput:function(){this.ajax.addComment=new Request({url:"index.php",method:"get",data:{option:"com_fabrik",format:"raw",task:"plugin.pluginAjax",plugin:"comment",method:"addComment",g:"form",formid:this.options.formid,rowid:this.options.rowid,label:this.options.label},onSuccess:function(t){this.ajaxComplete(t)}.bind(this),onError:function(t,e){fconsole(t+": "+e),this.spinner.hide()}.bind(this),onFailure:function(t){window.alert(t.statusText),this.spinner.hide()}.bind(this)});var e=this;n(".replyform button.submit").on("click",function(t){e.doInput(t)}),n(".replyform textarea").on("click",function(t){e.testInput(t)})},testInput:function(t){t.target.get("value")===Joomla.JText._("PLG_FORM_COMMENT_TYPE_A_COMMENT_HERE")&&(t.target.value="")},updateThumbs:function(){"null"!==typeOf(this.thumbs)&&(this.thumbs.removeEvents(),this.thumbs.addEvents())},doInput:function(t){this.spinner.show();var e=t.target.getParent(".replyform");if("master-comment-form"===e.id?0<(n=this.element.getElement("ul").getElements("li")).length?this.currentLi=n.pop():this.currentLi=this.element.getElement("ul"):this.currentLi=e.getParent("li"),"keydown"===t.type&&13!==t.keyCode.toInt())this.spinner.hide();else{this.options.wysiwyg&&"undefined"!=typeof tinyMCE&&tinyMCE.triggerSave();var n=e.getElement("textarea").get("value");if(t.preventDefault(),""===n)this.spinner.hide(),alert(Joomla.JText._("PLG_FORM_COMMENT_PLEASE_ENTER_A_COMMENT_BEFORE_POSTING"));else{t=e.getElement("input[name=name]");if(t){t=t.get("value");if(""===t)return this.spinner.hide(),void alert(Joomla.JText._("PLG_FORM_COMMENT_PLEASE_ENTER_A_NAME_BEFORE_POSTING"));this.ajax.addComment.options.data.name=t}t=e.getElements("input[name^=notify]").filter(function(t){return t.checked}),t=(this.ajax.addComment.options.data.notify=0<t.length?t[0].get("value"):"0",e.getElement("input[name=email]"));if(t)if(""===t.get("value"))return this.spinner.hide(),void window.alert(Joomla.JText._("PLG_FORM_COMMENT_ENTER_EMAIL_BEFORE_POSTNG"));var i,t=e.getElement("input[name=reply_to]").get("value");""===t&&(t=0),e.getElement("input[name=email]")&&(this.ajax.addComment.options.data.email=e.getElement("input[name=email]").get("value")),this.ajax.addComment.options.data.renderOrder=e.getElement("input[name=renderOrder]").get("value"),e.getElement("select[name=rating]")&&(this.ajax.addComment.options.data.rating=e.getElement("select[name=rating]").get("value")),e.getElement("input[name^=annonymous]")&&(i=e.getElements("input[name^=annonymous]").filter(function(t){return!0===t.checked}),this.ajax.addComment.options.data.annonymous=i[0].get("value")),this.ajax.addComment.options.data.reply_to=t,this.ajax.addComment.options.data.comment=n,this.ajax.addComment.send(),e.getElement("textarea").value=""}}},saveComment:function(t){var e=t.getParent(".comment").id.replace("comment-","");this.ajax.updateComment.options.data.comment_id=e,this.ajax.updateComment.options.data.comment=t.get("text"),this.ajax.updateComment.send()},watchReply:function(){this.spinner.resize(),this.element.getElements(".replybutton").each(function(t){t.removeEvents();var e,n,i=t.getParent().getParent().getNext();"null"===typeOf(i)&&(i=t.getParent(".comment").getElement(".replyform")),"null"!==typeOf(i)&&(this.options.wysiwyg?e=i:(n=t.getParent(".comment").getParent("li"),window.ie?e=new Fx.Slide(i,"opacity",{duration:5e3}):this.fx.toggleForms.has(n.id)?e=this.fx.toggleForms.get(n.id):(e=new Fx.Slide(i,"opacity",{duration:5e3}),this.fx.toggleForms.set(n.id,e))),e.hide(),t.addEvent("click",function(t){t.stop(),e.toggle()}.bind(this)))}.bind(this)),this.element.getElements(".del-comment").each(function(t){t.removeEvents(),t.addEvent("click",function(t){this.ajax.deleteComment.options.data.comment_id=t.target.getParent(".comment").id.replace("comment-",""),this.ajax.deleteComment.send(),this.updateThumbs(),t.stop()}.bind(this))}.bind(this)),this.options.admin&&this.element.getElements(".comment-content").each(function(i){i.removeEvents(),i.addEvent("click",function(t){i.inlineEdit({defaultval:"",type:"textarea",onComplete:function(t,e,n){this.saveComment(t)}.bind(this)});var e=t.target.getParent(),n=e.id.replace("comment-","");new Request({url:"",method:"get",data:{option:"com_fabrik",format:"raw",task:"plugin.pluginAjax",plugin:"comment",method:"getEmail",commentid:n,g:"form",formid:this.options.formid,rowid:this.options.rowid},onComplete:function(t){e.getElements(".info").dispose(),new Element("span",{class:"info"}).set("html",t).inject(e)}.bind(this)}).send(),t.stop()}.bind(this))}.bind(this))},deleteComplete:function(t){var e=document.id("comment_"+t);new Fx.Morph(e,{duration:1e3,transition:Fx.Transitions.Quart.easeOut}).start({opacity:0,height:0}).chain(function(){e.dispose()})}})});
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0.09 |
proxy
|
phpinfo
|
Настройка