PATH:
home
/
letacommog
/
morandas1
/
wp-content
/
plugins
/
wp-whatsapp-chat
/
assets
/
backend
/
js
(function(d){var e=0,k;var r=function(s){return s.is(".processing")||s.parents(".processing").length};var i=function(){d("#qlwapp_modal").addClass("processing")};var g=function(){d("#qlwapp_modal").removeClass("processing")};_.mixin({escapeHtml:function(s){return s.replace("&",/&/g).replace(/>/g,">").replace(/</g,"<").replace(/"/g,'"').replace(/'/g,"'")},});var f=Backbone.Model.extend({defaults:qlwapp_contact.args});var c=Backbone.View.extend({templates:{},initialize:function(s){this.templates.window=wp.template(s.subview)},render:function(){var s=this;s.$el.html(s.templates.window(s.attributes));return this}});var a=Backbone.View.extend({templates:{},initialize:function(s){this.templates.window=wp.template(s.subview)},render:function(){var s=this;s.$el.html(s.templates.window(s.attributes));return this}});var n=Backbone.View.extend({templates:{},initialize:function(s){this.templates.window=wp.template(s.subview)},render:function(){var s=this;s.$el.html(s.templates.window(s.attributes));return this}});var l=Backbone.View.extend({templates:{},initialize:function(s){this.templates.window=wp.template(s.subview)},render:function(){var s=this;s.$el.html(s.templates.window(s.attributes));return this}});var p=Backbone.View.extend({templates:{},initialize:function(s){this.templates.window=wp.template(s.subview)},render:function(){var s=this;s.$el.html(s.templates.window(s.attributes));return this}});var h=Backbone.View.extend({templates:{},initialize:function(s){this.templates.window=wp.template(s.subview)},render:function(){var s=this;s.$el.html(s.templates.window(s.attributes));return this}});var m=Backbone.View.extend({templates:{},initialize:function(s){this.templates.window=wp.template(s.subview)},render:function(){var s=this;s.$el.html(s.templates.window(s.attributes));return this}});var q=Backbone.View.extend({templates:{},initialize:function(s){this.templates.window=wp.template(s.subview)},render:function(){var s=this;s.$el.html(s.templates.window(s.attributes));return this}});var o=Backbone.View.extend({events:{"change input":"enable","change textarea":"enable","change select":"enable","click .media-modal-backdrop":"close","click .media-modal-close":"close","click .media-modal-prev":"edit","click .media-modal-next":"edit","change .media-modal-change":"change","change .media-modal-subview":"subview","submit .media-modal-form":"submit"},templates:{},initialize:function(){_.bindAll(this,"open","edit","change","subview","load","render","close","submit");this.init();this.open()},init:function(){this.templates.window=wp.template("qlwapp-modal-window")},LoadTemplate1:function(t){var s=Backbone.View.extend({templates:{},initialize:function(u){this.templates.window=wp.template(u.subview)},render:function(){var u=this;u.$el.html(u.templates.window(u.attributes));return this}});return s},assign:function(t,s){t.setElement(this.$(s)).render()},render:function(){var t=this;var s=this.$el.find("ul.wc-tabs li.active a").attr("href");t.$el.html(t.templates.window(t.model.attributes));this.header=new c({subview:"subview-header",attributes:t.model.attributes});this.footer=new a({subview:"subview-footer",attributes:t.model.attributes});this.tabs=new n({subview:"subview-tabs",attributes:t.model.attributes});this.contact=new l({subview:"subview-contact",attributes:t.model.attributes});this.contact_chat=new p({subview:"subview-contact-chat",attributes:t.model.attributes});this.info=new m({subview:"subview-contact-info",attributes:t.model.attributes});this.visibility=new h({subview:"subview-visibility",attributes:t.model.attributes});this.assign(this.header,"#panel-header");this.assign(this.footer,"#panel-footer");this.assign(this.tabs,"#panel-tabs");this.assign(this.contact,"#panel-contact");this.assign(this.contact_chat,"#subpanel-contact-chat");this.assign(this.info,"#panel-info");this.assign(this.visibility,"#panel-visibility");_.delay(function(){t.$el.trigger("qlwapp-enhanced-select");t.$el.trigger("qlwapp-tab-panels",s)},100)},load:function(){var s=this;i();d.ajax({url:ajaxurl,data:{action:"qlwapp_edit_contact",nonce:qlwapp_contact.nonce.qlwapp_edit_contact,contact_id:this.model.attributes.id},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){g()},error:function(){alert("Error!")},success:function(t){if(t.success){s.model.set(t.data);s.render()}else{alert(t.data)}}})},edit:function(w){w.preventDefault();var u=this,v=d(w.target),t=parseInt(d("#qlwapp_contacts_table tr[data-contact_id]").length),s=parseInt(u.model.get("order"));e++;if(k){clearTimeout(k)}k=setTimeout(function(){if(v.hasClass("media-modal-next")){s=Math.min(s+e,t)}else{s=Math.max(s-e,1)}u.model.set({id:parseInt(d("#qlwapp_contacts_table tr[data-contact_position="+s+"]").data("contact_id"))});e=0;u.load()},300)},open:function(s){d("body").addClass("modal-open").append(this.$el);if(this.model.attributes.id==undefined){_.delay(function(){g()},100);return}this.load()},update:function(v){v.preventDefault();var t=d(v.target),s=t.attr("name"),u=t.val();if(v.target.type==="checkbox"){u=t.prop("checked")===true?1:0}this.model.attributes[s]=u;this.model.changed[s]=u},change:function(s){s.preventDefault();this.update(s)},subview:function(s){this.contact_chat.render()},reload:function(s){if(this.$el.find("#qlwapp_modal").hasClass("reload")){location.reload();return}this.remove();return},close:function(s){s.preventDefault();this.undelegateEvents();d(document).off("focusin");this.$el.find("#qlwapp_modal").addClass("reload");this.reload(s);return},enable:function(s){d(".media-modal-submit").removeProp("disabled")},submit:function(v){v.preventDefault();var u=this,t=u.$el.find("#qlwapp_modal"),s=t.find(".attachment-details");d.ajax({url:ajaxurl,data:{action:"qlwapp_save_contact",nonce:qlwapp_contact.nonce.qlwapp_save_contact,contact_id:u.model.attributes.id,contact_data:d("form",this.$el).serialize()},dataType:"json",type:"POST",beforeSend:function(){d(".media-modal-submit").prop("disabled",true);s.addClass("save-waiting")},complete:function(){s.addClass("save-complete");s.removeClass("save-waiting")},error:function(){alert("Error!")},success:function(w){if(w.success){if(u.model.attributes.id==undefined){t.addClass("reload");u.reload(v);u.close(v)}}else{alert(w.data)}}});return false}});var b=Backbone.View.extend({initialize:function(v){var u=d(v.target),t=u.closest("[data-contact_id]").data("contact_id");var s=new f();s.set({id:t});new o({model:s}).render()}});var j=false;d(".qlwapp_settings_edit").on("click",function(s){s.preventDefault();if(!j){new b(s);j=true}});d("#qlwapp_contact_add").on("click",function(s){s.preventDefault();new b(s)});d(".qlwapp_settings_delete").on("click",function(v){v.preventDefault();var s=d("#qlwapp_delete_contact_nonce").val();var u=d(v.target),t=u.closest("[data-contact_id]").data("contact_id");if(!confirm(qlwapp_contact.message.contact_confirm_delete)){return false}else{d.ajax({url:ajaxurl,data:{action:"qlwapp_delete_contact",nonce:s,contact_id:t},dataType:"json",type:"POST",beforeSend:function(){},complete:function(){},error:function(w){console.log(w)},success:function(w){if(w.data){location.reload()}else{alert(w.data)}}})}});d("table#qlwapp_contacts_table tbody").sortable({items:"tr",cursor:"move",axis:"y",handle:"td.sort",scrollSensitivity:40,helper:function(s,t){t.children().each(function(){d(this).width(d(this).width())});t.css("left","0");return t},start:function(s,t){t.item.css("background-color","#f6f6f6")},stop:function(s,t){t.item.removeAttr("style");t.item.trigger("updateMoveButtons");t.item.trigger("updateSaveButton")}});d(document).on("updateSaveButton",function(){d("#qlwapp_contact_order").removeProp("disabled")});d(".wc-item-reorder-nav").find(".wc-move-up, .wc-move-down").on("click",function(){var x=d(this),s=x.closest("tr");x.focus();var w=x.is(".wc-move-up"),v=x.is(".wc-move-down");if(w){var u=s.prev("tr");if(u&&u.length){u.before(s)}}else{if(v){var t=s.next("tr");if(t&&t.length){t.after(s)}}}x.focus();x.closest("table").trigger("updateMoveButtons");x.closest("table").trigger("updateSaveButton")});d(".wc-item-reorder-nav").closest("table").on("updateMoveButtons",function(){var t=d(this),s=d(this).find("tbody tr:last"),u=d(this).find("tbody tr:first");t.find(".wc-item-reorder-nav .wc-move-disabled").removeClass("wc-move-disabled").attr({tabindex:"0","aria-hidden":"false"});u.find(".wc-item-reorder-nav .wc-move-up").addClass("wc-move-disabled").attr({tabindex:"-1","aria-hidden":"true"});s.find(".wc-item-reorder-nav .wc-move-down").addClass("wc-move-disabled").attr({tabindex:"-1","aria-hidden":"true"})});d("table#qlwapp_contacts_table tbody").trigger("updateMoveButtons");d(document).on("submit","#qlwapp_contacts_form",function(v){v.preventDefault();var s=d(this),u=s.find(".settings-save-status .spinner"),t=s.find(".settings-save-status .saved");d.ajax({url:ajaxurl,data:{action:"qlwapp_save_contact_order",nonce:qlwapp_contact.nonce.qlwapp_save_contact_order,contact_data:s.serialize()},dataType:"json",type:"POST",beforeSend:function(){u.addClass("is-active")},complete:function(){u.removeClass("is-active")},error:function(w){console.log(w)},success:function(w){t.addClass("is-active");d("#qlwapp_contact_order").prop("disabled",true);if(w.success){setTimeout(function(){t.removeClass("is-active")},1500)}else{alert(w.data)}}});return false});d(document).on("qlwapp-tab-panels",function(w,v){var u=d(w.target),t=u.find("ul.qlwapp-tabs"),s=t.find('a[href="'+v+'"]');t.show();t.find("a").click(function(y){y.preventDefault();var x=d(this).closest("div.panel-wrap");t.find("li",x).removeClass("active");d(this).parent().addClass("active");d("div.panel",x).hide();d(d(this).attr("href")).show()});if(s.length&&d(s.attr("href")).length){s.click()}else{t.find("li.active").find("a").click()}})})(jQuery);
[+]
..
[-] qlwapp-admin.js
[edit]
[-] select2.min.js
[edit]
[-] qlwapp-admin.min.js
[edit]
[-] qlwapp-admin-contact.min.js
[edit]
[-] qlwapp-admin-contact.js
[edit]