Sindbad~EG File Manager
!function l(s,n,d){function a(t,e){if(!n[t]){if(!s[t]){var i="function"==typeof require&&require;if(!e&&i)return i(t,!0);if(o)return o(t,!0);throw(i=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",i}i=n[t]={exports:{}},s[t][0].call(i.exports,function(e){return a(s[t][1][e]||e)},i,i.exports,l,s,n,d)}return n[t].exports}for(var o="function"==typeof require&&require,e=0;e<d.length;e++)a(d[e]);return a}({1:[function(e,t,i){"use strict";var l=n(e("./profile")),s=n(e("./search"));function n(e){return e&&e.__esModule?e:{default:e}}document.addEventListener("DOMContentLoaded",()=>{l.default.init(),s.default.init()})},{"./profile":3,"./search":4}],2:[function(e,t,n){!function(i){!function(){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var h=e("undefined"!=typeof window?window._:void 0!==i?i._:null),s=e("undefined"!=typeof window?window.jQuery:void 0!==i?i.jQuery:null),$="undefined"!=typeof window?window.peepso:void 0!==i?i.peepso:null,m="undefined"!=typeof window?window.peepsodata:void 0!==i?i.peepsodata:null;function e(e){return e&&e.__esModule?e:{default:e}}const l=m.sections&&m.sections.profile&&m.sections.profile.textSaveAllErrorNotice;class t{constructor(e){this.$container=(0,s.default)(e),this.$btnEditAll=this.$container.find(".ps-js-btn-edit-all"),this.$btnSaveAll=this.$container.find(".ps-js-btn-save-all").hide(),this.$fields=this.$container.find(".ps-js-profile-item").filter(function(){return!(0,s.default)(this).find(".ps-js-profile-separator").length}),this.$fields.length||this.$btnEditAll.hide(),this.$fields.each((e,t)=>this.fieldInit(t)),this.fieldChanged=[],this.fieldChangedHandler=e=>!!this.fieldChanged.length||e,$.observer.addFilter("beforeunload",this.fieldChangedHandler,10,1),this.$btnEditAll.on("click",()=>this.fieldsEditAll()),this.$btnSaveAll.on("click",()=>this.fieldsSaveAll())}fieldInit(e){(0,s.default)(e).on("click",".ps-js-btn-edit",()=>this.fieldEdit(e)).on("click",".ps-js-btn-cancel",()=>this.fieldEditCancel(e)).on("click",".ps-js-btn-save",()=>this.fieldEditSave(e))}fieldGetData(e){let i=(0,s.default)(e).closest(".ps-js-profile-item"),l;if(i.length&&(l=i.data(),!l.$field)){let e=i.find(".ps-list-info-content-form"),t=e.find("input[type=text],input[type=checkbox],input[type=radio],textarea,select");l={$field:i,$label:i.find(".ps-list-info-content-text"),$form:i.find(".ps-list-info-content-form"),$error:i.find(".ps-list-info-content-error"),$validation:i.find(".ps-js-validation"),$inputs:t,$btnEdit:i.find(".ps-js-btn-edit"),$btnCancel:e.find(".ps-js-btn-cancel"),$btnSave:e.find(".ps-js-btn-save"),id:t.data("id"),type:this.fieldGetType(t),value:this.fieldGetValue(t)},i.data(l)}return l}fieldGetType(e){let t=e.eq(0),i=t.prop("tagName").toLowerCase(),l=t.attr("type")||"";return-1<["select","textarea"].indexOf(i)?l=i:"text"===l&&t.hasClass("datepicker")&&(l="datepicker"),l}fieldGetValue(e){let t=this.fieldGetType(e),i,l;return i="checkbox"===t?(i=e.filter(":checked").map((e,t)=>t.value),JSON.stringify([...i])):"radio"===t?e.filter(":checked").val():"datepicker"===t?(l=e.val(),i=e.data("value"),{value:i,formatted:l}):"text"===t?e.val().trim():e.val(),i}fieldSetValue(e,i){var t=this.fieldGetType(e);"checkbox"===t?(i=JSON.parse(i),e.each((e,t)=>{t.checked=-1<i.indexOf(t.value)})):"radio"===t?e.each((e,t)=>{t.checked=t.value===i}):"datepicker"===t?(e.val(i.formatted),e.data("value",i.value)):e.val(i)}fieldEdit(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1];let i=this.fieldGetData(e),{$label:l,$form:s,$error:n,$validation:d,$inputs:a,id:o,type:r}=i;"text"===r&&a.off("keydown").on("keydown",e=>{13===e.keyCode&&(e.preventDefault(),e.stopPropagation(),this.fieldEditSave(e.target))});let f=()=>{};if(-1<["text","textarea"].indexOf(r)){let t=a.next(".ps-js-counter");t.length&&(t.show(),f=h.default.throttle(e=>t.html(e),500),f(a.val().length))}a.off("input.ps-field").on("input.ps-field",e=>{-1===this.fieldChanged.indexOf(o)&&this.fieldChanged.push(o),f(e.target.value.length)}),l.hide(),s.show(),n.hide(),d.addClass("ps-alert--neutral").removeClass("ps-alert--abort"),t||-1===["checkbox","radio"].indexOf(r)&&a.focus()}fieldEditCancel(e){let t=this.fieldGetData(e),{$label:i,$form:l,$error:s,$inputs:n,id:d,value:a}=t;this.fieldSetValue(n,a),i.show(),l.hide(),s.hide();e=this.fieldChanged.indexOf(d);-1<e&&this.fieldChanged.splice(e,1)}fieldEditSave(e){let s=this.fieldGetData(e),{$field:n,$label:l,$form:d,$error:a,$inputs:o,$btnCancel:r,$btnSave:f,id:h,type:u}=s,p=f.find("img"),c=this.fieldGetValue(o);o.attr("disabled","disabled"),f.add(r).attr("disabled","disabled"),p.show(),"datepicker"===u&&(c=c.value),c=$.observer.applyFilters("profile_field_save",c,o);let v=e=>{let t=e["display_value"],i=l.find(".ps-list-info-content-data");s.value=c,void 0!==t?(t=$.observer.applyFilters("peepso_parse_content",t),i.html(t)):"select"===u?i.html(o.find("option:selected").text()):i.html(o.val()),l.show(),d.hide(),a.hide(),n.addClass("ps-list-info-success"),setTimeout(()=>n.removeClass("ps-list-info-success"),1e3),$.observer.doAction("profile_field_updated",s,e),$.hooks.doAction("profile_completeness_updated",m.userid,e);e=this.fieldChanged.indexOf(h);-1<e&&this.fieldChanged.splice(e,1)};return new $.Promise((e,t)=>{let i=!1;$.modules.user.updateField(m.userid,h,c).then(v).catch(e=>{(t=>{let e=s["$validation"],i=[];if(e.addClass("ps-alert--neutral").removeClass("ps-alert--abort"),t)for(var l in t){let e=d.find(".ps-js-validation-"+l);e.length?e.addClass("ps-alert--abort").removeClass("ps-alert--neutral"):i.push(t[l])}i.length?(i=i.join("<br>"),a.html(i).show()):a.hide(),n.addClass("ps-list-info-error"),setTimeout(()=>n.removeClass("ps-list-info-error"),1e3)})(e),i=!0}).then(()=>{o.removeAttr("disabled"),f.add(r).removeAttr("disabled"),p.hide(),i?t(n[0]):e()})})}fieldsEditAll(){this.$btnEditAll.hide(),this.$btnSaveAll.show(),this.$fields.each((e,t)=>{this.fieldEdit(t,"nofocus")})}fieldsSaveAll(){this.$btnSaveAll.attr("disabled","disabled");let i=[];this.$fields.each((e,t)=>{i.push(this.fieldEditSave(t))}),$.Promise.all(i.map(e=>e.catch(e=>e))).then(e=>{var t=e.filter(e=>e);this.$btnSaveAll.removeAttr("disabled"),t.length?(e=(0,s.default)(t[0]).offset().top-window.innerHeight/2,t=h.default.debounce(()=>alert(l),200),(0,s.default)("html, body").animate({scrollTop:e},1e3,t)):(this.$btnSaveAll.hide(),this.$btnEditAll.show())})}}n.default={init(){var e=document.querySelectorAll('[data-ps-section="profile/about"]');e.length&&[...e].forEach(e=>new t(e))}}}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var l=(e=e("./about"))&&e.__esModule?e:{default:e};i.default={init:function(){l.default.init()}}},{"./about":2}],4:[function(e,t,f){!function(r){!function(){"use strict";Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;var d=(i="undefined"!=typeof window?window.jQuery:void 0!==r?r.jQuery:null)&&i.__esModule?i:{default:i},e="undefined"!=typeof window?window._:void 0!==r?r._:null,n="undefined"!=typeof window?window.peepso:void 0!==r?r.peepso:null,t="undefined"!=typeof window?window.peepsodata:void 0!==r?r.peepsodata:null;var i=t.sections.search||{};const a=t.rest_url,o=+i.show_empty_sections;let l=0;class s{constructor(e){this.uniqueId=++l,this.$container=(0,d.default)(e),this.$query=this.$container.find("input.ps-js-query"),this.$loading=this.$container.find(".ps-js-loading").hide(),this.$results=this.$container.find(".ps-js-result").hide(),this.tplSection=(0,n.template)(this.$container.find(".ps-js-template-section").text().trim()),this.tplItems=(0,n.template)(this.$container.find(".ps-js-template-items").text().trim()),this.tplEmpty=(0,n.template)(this.$container.find(".ps-js-template-empty").text().trim()),this.$query.on("input",e=>{this.$query.val().trim()?(this.$results.hide(),this.$loading.show(),this.searchWithDelay()):(this.$results.hide(),this.$loading.hide())}),this.$query.val().trim()&&this.$query.triggerHandler("input")}search(){let e=this.$query.val().trim(),t=a+"search",i=t+"_"+this.uniqueId,l={query:e},s;if(!e)return this.$loading.hide(),void this.$results.hide();s=n.modules.request.get(i,t,l),s.then(e=>{this.render(e),this.$loading.hide(),this.$results.show()}).catch(()=>{this.$loading.hide()})}searchWithDelay(){this.searchWithDelay=(0,e.debounce)(this.search,1e3),this.searchWithDelay()}render(e){let t=e.results,i=e.meta.sections,l=!!o,s="";if(t)for(const n in t){let e=d.default.extend({},i[n],{type:n});t.hasOwnProperty(n)&&t[n].length?(e.html=this.tplItems({results:t[n],type:n}),l=!0):e.html=this.tplEmpty(),s+=this.tplSection(e)}l||(s=this.tplEmpty()),this.$results.html(s)}}f.default={init:function(){(0,d.default)(".ps-js-section-search").each(function(){new s(this)})}}}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1]);
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists