hoodcms 6.0.10 → 6.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/js/admin.js +2 -2
- package/dist/js/app.js +1 -1
- package/dist/js/app.property.js +1 -1
- package/dist/js/core/Editors.js +5 -5
- package/dist/js/login.js +1 -1
- package/package.json +2 -2
- package/src/js/admin.js +6 -6
- package/src/js/admin.js.map +1 -1
- package/src/js/app.js +1 -1
- package/src/js/app.property.js +1 -1
- package/src/js/login.js +1 -1
- package/src/ts/core/Editors.ts +5 -5
package/dist/js/admin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* hoodcms v6.0.
|
|
2
|
+
* hoodcms v6.0.12
|
|
3
3
|
* A fully customisable content management system built in ASP.NET Core 5 & Bootstrap 5.
|
|
4
4
|
* Written by George Whysall, 2022
|
|
5
5
|
* Released under the GPL-3.0 License.
|
|
@@ -19,6 +19,6 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
19
19
|
PERFORMANCE OF THIS SOFTWARE.
|
|
20
20
|
***************************************************************************** */
|
|
21
21
|
var extendStatics=function(t,e){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e;}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);},extendStatics(t,e)};function __extends(t,e){function r(){this.constructor=t;}extendStatics(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r);}var __assign=function(){return __assign=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},__assign.apply(this,arguments)};"function"!=typeof Object.create&&(Object.create=function(t){function o(){}return o.prototype=t,new o}),function(t,o,i,s){var n={_positionClasses:["bottom-left","bottom-right","top-right","top-left","bottom-center","top-center","mid-center"],_defaultIcons:["success","error","info","warning"],init:function(o,i){this.prepareOptions(o,t.toast.options),this.process();},prepareOptions:function(o,i){var s={};"string"==typeof o||o instanceof Array?s.text=o:s=o,this.options=t.extend({},i,s);},process:function(){this.setup(),this.addToDom(),this.position(),this.bindToast(),this.animate();},setup:function(){var o="";if(this._toastEl=this._toastEl||t("<div></div>",{class:"jq-toast-single"}),o+='<span class="jq-toast-loader"></span>',this.options.allowToastClose&&(o+='<span class="close-jq-toast-single">×</span>'),this.options.text instanceof Array){this.options.heading&&(o+='<h2 class="jq-toast-heading">'+this.options.heading+"</h2>"),o+='<ul class="jq-toast-ul">';for(var i=0;i<this.options.text.length;i++)o+='<li class="jq-toast-li" id="jq-toast-item-'+i+'">'+this.options.text[i]+"</li>";o+="</ul>";}else this.options.heading&&(o+='<h2 class="jq-toast-heading">'+this.options.heading+"</h2>"),o+=this.options.text;this._toastEl.html(o),!1!==this.options.bgColor&&this._toastEl.css("background-color",this.options.bgColor),!1!==this.options.textColor&&this._toastEl.css("color",this.options.textColor),this.options.textAlign&&this._toastEl.css("text-align",this.options.textAlign),!1!==this.options.icon&&(this._toastEl.addClass("jq-has-icon"),-1!==t.inArray(this.options.icon,this._defaultIcons)&&this._toastEl.addClass("jq-icon-"+this.options.icon)),!1!==this.options.class&&this._toastEl.addClass(this.options.class);},position:function(){"string"==typeof this.options.position&&-1!==t.inArray(this.options.position,this._positionClasses)?"bottom-center"===this.options.position?this._container.css({left:t(o).outerWidth()/2-this._container.outerWidth()/2,bottom:20}):"top-center"===this.options.position?this._container.css({left:t(o).outerWidth()/2-this._container.outerWidth()/2,top:20}):"mid-center"===this.options.position?this._container.css({left:t(o).outerWidth()/2-this._container.outerWidth()/2,top:t(o).outerHeight()/2-this._container.outerHeight()/2}):this._container.addClass(this.options.position):"object"==typeof this.options.position?this._container.css({top:this.options.position.top?this.options.position.top:"auto",bottom:this.options.position.bottom?this.options.position.bottom:"auto",left:this.options.position.left?this.options.position.left:"auto",right:this.options.position.right?this.options.position.right:"auto"}):this._container.addClass("bottom-left");},bindToast:function(){var t=this;this._toastEl.on("afterShown",(function(){t.processLoader();})),this._toastEl.find(".close-jq-toast-single").on("click",(function(o){o.preventDefault(),"fade"===t.options.showHideTransition?(t._toastEl.trigger("beforeHide"),t._toastEl.fadeOut((function(){t._toastEl.trigger("afterHidden");}))):"slide"===t.options.showHideTransition?(t._toastEl.trigger("beforeHide"),t._toastEl.slideUp((function(){t._toastEl.trigger("afterHidden");}))):(t._toastEl.trigger("beforeHide"),t._toastEl.hide((function(){t._toastEl.trigger("afterHidden");})));})),"function"==typeof this.options.beforeShow&&this._toastEl.on("beforeShow",(function(){t.options.beforeShow();})),"function"==typeof this.options.afterShown&&this._toastEl.on("afterShown",(function(){t.options.afterShown();})),"function"==typeof this.options.beforeHide&&this._toastEl.on("beforeHide",(function(){t.options.beforeHide();})),"function"==typeof this.options.afterHidden&&this._toastEl.on("afterHidden",(function(){t.options.afterHidden();}));},addToDom:function(){var o=t(".jq-toast-wrap");if(0===o.length?(o=t("<div></div>",{class:"jq-toast-wrap"}),t("body").append(o)):(!this.options.stack||isNaN(parseInt(this.options.stack,10)))&&o.empty(),o.find(".jq-toast-single:hidden").remove(),o.append(this._toastEl),this.options.stack&&!isNaN(parseInt(this.options.stack),10)){var i=o.find(".jq-toast-single").length-this.options.stack;i>0&&t(".jq-toast-wrap").find(".jq-toast-single").slice(0,i).remove();}this._container=o;},canAutoHide:function(){return !1!==this.options.hideAfter&&!isNaN(parseInt(this.options.hideAfter,10))},processLoader:function(){if(!this.canAutoHide()||!1===this.options.loader)return !1;var t=this._toastEl.find(".jq-toast-loader"),o=(this.options.hideAfter-400)/1e3+"s",i=this.options.loaderBg,s=t.attr("style")||"";s=s.substring(0,s.indexOf("-webkit-transition")),s+="-webkit-transition: width "+o+" ease-in; -o-transition: width "+o+" ease-in; transition: width "+o+" ease-in; background-color: "+i+";",t.attr("style",s).addClass("jq-toast-loaded");},animate:function(){var t=this;if(this._toastEl.hide(),this._toastEl.trigger("beforeShow"),"fade"===this.options.showHideTransition.toLowerCase()?this._toastEl.fadeIn((function(){t._toastEl.trigger("afterShown");})):"slide"===this.options.showHideTransition.toLowerCase()?this._toastEl.slideDown((function(){t._toastEl.trigger("afterShown");})):this._toastEl.show((function(){t._toastEl.trigger("afterShown");})),this.canAutoHide()){t=this;o.setTimeout((function(){"fade"===t.options.showHideTransition.toLowerCase()?(t._toastEl.trigger("beforeHide"),t._toastEl.fadeOut((function(){t._toastEl.trigger("afterHidden");}))):"slide"===t.options.showHideTransition.toLowerCase()?(t._toastEl.trigger("beforeHide"),t._toastEl.slideUp((function(){t._toastEl.trigger("afterHidden");}))):(t._toastEl.trigger("beforeHide"),t._toastEl.hide((function(){t._toastEl.trigger("afterHidden");})));}),this.options.hideAfter);}},reset:function(o){"all"===o?t(".jq-toast-wrap").remove():this._toastEl.remove();},update:function(t){this.prepareOptions(t,this.options),this.setup(),this.bindToast();}};t.toast=function(t){var o=Object.create(n);return o.init(t,this),{reset:function(t){o.reset(t);},update:function(t){o.update(t);}}},t.toast.options={text:"",heading:"",showHideTransition:"fade",allowToastClose:!0,hideAfter:3e3,loader:!0,loaderBg:"#9EC600",stack:5,position:"bottom-left",bgColor:!1,textColor:!1,textAlign:"left",icon:!1,beforeShow:function(){},afterShown:function(){},beforeHide:function(){},afterHidden:function(){}};}(jQuery,window);var BootstrapSwal=swal__default["default"].mixin({customClass:{confirmButton:"btn btn-success m-1 px-3",cancelButton:"btn btn-danger m-1 px-3"},buttonsStyling:!1}),Alerts=function(){function o(){}return o.log=function(o,t){if(void 0===t&&(t="message"),document.body.classList.contains("dev-mode"))switch(t){case"error":console.error(o);break;case"message":console.log(o);break;case"warning":console.warn(o);break;case"info":console.info(o);}},o.error=function(o,t,e){void 0===t&&(t=null),void 0===e&&(e=null),$.toast({heading:t,text:o,icon:"error",position:"bottom-left",loader:!1,bgColor:"#d0100b",textColor:"white",hideAfter:e});},o.warning=function(o,t,e){void 0===t&&(t=null),void 0===e&&(e=null),$.toast({heading:t,text:o,icon:"error",position:"bottom-left",loader:!1,bgColor:"#ef9007",textColor:"white",hideAfter:e});},o.message=function(o,t,e){void 0===t&&(t=null),void 0===e&&(e=null),$.toast({heading:t,text:o,icon:"error",position:"bottom-left",loader:!1,bgColor:"#222222",textColor:"white",hideAfter:e});},o.success=function(o,t,e){void 0===t&&(t=null),void 0===e&&(e=null),$.toast({heading:t,text:o,icon:"error",position:"bottom-left",loader:!1,bgColor:"#28a745",textColor:"white",hideAfter:e});},o.alert=function(t,e,n,i){switch(void 0===e&&(e=null),void 0===n&&(n="info"),void 0===i&&(i=1e4),n){case"error":o.error(t,e,i);break;case"warning":o.warning(t,e,i);break;case"info":o.message(t,e,i);break;case"success":o.success(t,e,i);}},o.sweetAlert=function(o,t){BootstrapSwal.fire(o).then((function(o){t(o);}));},o.confirm=function(t,e){o.sweetAlert(__assign(__assign({},{showCancelButton:!0,footer:null,title:"Are you sure?",html:"Are you sure you want to do this?",confirmButtonText:"Ok",cancelButtonText:"Cancel"}),t),e);},o.prompt=function(t,e){o.sweetAlert(__assign(__assign({},{input:"text",inputAttributes:{autocapitalize:"off"},showCancelButton:!0,icon:"info",footer:'<span class="text-warning"><i class="fa fa-exclamation-triangle"></i> This cannot be undone.</span>',confirmButtonText:"Ok",cancelButtonText:"Cancel"}),t),e);},o.prototype.log=function(t,e){void 0===e&&(e="message"),o.log(t,e);},o.prototype.error=function(t,e,n){void 0===e&&(e=null),void 0===n&&(n=null),o.error(t,e,n);},o.prototype.warning=function(t,e,n){void 0===e&&(e=null),void 0===n&&(n=null),o.warning(t,e,n);},o.prototype.message=function(t,e,n){void 0===e&&(e=null),void 0===n&&(n=null),o.message(t,e,n);},o.prototype.success=function(t,e,n){void 0===e&&(e=null),void 0===n&&(n=null),o.success(t,e,n);},o.prototype.alert=function(t,e,n,i){void 0===n&&(n="info"),void 0===i&&(i=1e4),o.alert(t,t,n,i);},o.prototype.sweetAlert=function(t,e){o.sweetAlert(t,e);},o.prototype.confirm=function(t,e){o.confirm(t,e);},o.prototype.prompt=function(t,e){o.prompt(t,e);},o}();var ColorPickers=function(){function t(){}return t.prototype.loadColorPickers=function(t){void 0===t&&(t=".color-picker");var o=function(t,o,r){var n=$(r._root.button).parent().data("target");$(r._root.button).parent().css({"background-color":t.toHEXA().toString()});for(var a=r.getColor().toHEXA(),e="",i=a.length-1;i>=0;i--)e=a[i]+e;$(n).val("#"+e),$(n).change();};$(t).each((function(t,n){var a=!0;"true"==$(this).data("opacity")&&(a=!1);Pickr__default["default"].create({el:n.children[0],appClass:"custom-class",theme:"monolith",useAsButton:!0,default:$(this).data("default")||"none",lockOpacity:a,defaultRepresentation:"HEXA",position:"bottom-end",components:{opacity:!0,hue:!0,interaction:{hex:!1,rgba:!1,hsva:!1,input:!0,clear:!0}}}).on("init",(function(t){var r=$(t._root.button).parent().data("target"),n=$(r).val();$(t._root.button).parent().on("click",$.proxy((function(){this.show();}),t)),$(r).on("click",$.proxy((function(){this.show();}),t)),n&&(t.setColor(n),o(t.getColor(),0,t));})).on("clear",(function(t){var r=$(t._root.button).parent().data("target");t.setColor("transparent"),o(t.getColor(),0,t),$(r).val(""),$(r).change();})).on("change",o);}));},t}();var Inline=function(){function o(){}return o.load=function(n,r){var t,e=$(n);e.addClass("loading"),r.onLoad&&r.onLoad(n);var l=e.data("url");$.get(l,(function(o){r.onRender&&(o=r.onRender(o,n)),e.html(o),e.removeClass("loading"),r.onComplete&&r.onComplete(o,n);})).fail(null!==(t=r.onError)&&void 0!==t?t:o.handleError);},o.task=function(n,r,t,e){void 0===t&&(t=null),void 0===e&&(e=null),r&&r.classList.add("loading"),$.get(n,(function(o){r&&r.classList.remove("loading"),t&&t(o,r);})).fail(null!=e?e:o.handleError);},o.post=function(n,r,t,e){void 0===t&&(t=null),void 0===e&&(e=null),r&&r.classList.add("loading"),$.post(n,(function(o){r&&r.classList.remove("loading"),t&&t(o,r);})).fail(null!=e?e:o.handleError);},o.handleError=function(o,n,r){500===o.status?Alerts.error("There was an error processing the content, please contact an administrator if this continues.","Error "+o.status,1e4):404===o.status?Alerts.error("The content could not be found.","Error "+o.status,1e4):401===o.status&&(Alerts.error("You are not allowed to view this resource, are you logged in correctly?","Error "+o.status,1e4),window.location=window.location);},o}();var DataList=function(){function e(e,t){if(this.element=e,this.element.hoodDataList=this,void 0!==e&&null!=e){if(this.options=__assign(__assign({},this.options),t),$(this.element).hasClass("query")){var a=null;if(a=new RegExp("^(?:[a-z]+:)?//","i").test(this.element.dataset.url)?new URL(this.element.dataset.url):new URL(window.location.origin+this.element.dataset.url),"URLSearchParams"in window){var n=new URLSearchParams(window.location.search),i=new URLSearchParams(a.search);n.forEach((function(e,t,a){i.set(t,e);})),"0"==i.get("page")&&i.set("page","1"),a.search=i.toString();}else a.search=window.location.search;var r=a.pathname+a.search;$(this.element).attr("data-url",r),$(this.element).data("url",r);}if(!$(this.element).hasClass("refresh-only")){var s=document.createElement("a");s.href=$(this.element).data("url"),this.reload(new URL(s.href));}$(this.element).on("click",".pagination a, a.hood-inline-list-target",function(e){e.preventDefault();var t=document.createElement("a");t.href=e.currentTarget.href;var a=document.createElement("a");a.href=$(this.element).data("url"),a.search=t.search,this.reload(new URL(a.href));}.bind(this)),$("body").on("submit",'form.inline[data-target="#'.concat(this.element.id,'"]'),function(e){e.preventDefault();var t=$(e.currentTarget),a=document.createElement("a");a.href=$(this.element).data("url"),a.search="?"+t.serialize(),this.reload(new URL(a.href));}.bind(this));}else Alerts.log("Could not DataList to element, element does not exist.","error");}return e.prototype.reload=function(e){if(void 0===e&&(e=null),e){if(history.pushState&&$(this.element).hasClass("query")){var t=window.location.protocol+"//"+window.location.host+window.location.pathname+(e.href.contains("?")?"?"+e.href.substring(e.href.indexOf("?")+1):"");window.history.pushState({path:t},"",t);}$(this.element).data("url",e);}Inline.load(this.element,__assign({},this.options));},e}();
|
|
22
|
-
var Response=function(){function e(){}return e.process=function(e,s){void 0===s&&(s=5e3),e.success?Alerts.success(e.message,e.title,s):Alerts.error(e.errors,e.title,s);},e}();var ModalController=function(){function t(t){void 0===t&&(t=null),this.isOpen=!1,this.options={closePrevious:!0},this.options=__assign(__assign({},this.options),t);}return t.prototype.show=function(t,o){this.options.onLoad&&this.options.onLoad(this.element),this.isOpen||(this.isOpen=!0,$.get(t,function(t){this.modal&&this.options.closePrevious&&this.close(),this.options.onRender&&(t=this.options.onRender(this.element,t)),this.element=this.createElementFromHTML(t),this.element.classList.add("hood-inline-modal"),$("body").append(this.element),this.modal=new bootstrap.Modal(this.element,{}),this.modal.show(),this.element.addEventListener("shown.bs.modal",function(){$(document).off("focusin.modal");}.bind(this)),this.element.addEventListener("hidden.bs.modal",function(){this.options.onHidden&&this.options.onHidden(this.element),this.dispose(),this.isOpen=!1;}.bind(this)),this.options.onComplete&&this.options.onComplete(this.element);}.bind(this)).fail(function(t,o,i){this.isOpen=!1,this.options.onError&&this.options.onError(t,o,i),Inline.handleError(t,o,i);}.bind(this)));},t.prototype.close=function(){this.modal&&this.modal.hide();},t.prototype.dispose=function(){this.modal.dispose(),this.element.remove();},t.prototype.createElementFromHTML=function(t){var o=document.createElement("div");return o.innerHTML=t.trim(),o.firstChild},t}();var Validator=function(){function t(t,i){if(this.options={errorAlert:"There are errors on the form, please check your answers and try again.",useAjax:!0},this.element=t,this.element){this.options.serializationFunction=function(){return $(this.element).serialize()}.bind(this),this.options=__assign(__assign({},this.options),i),this.element.addEventListener("submit",function(t){t.preventDefault(),t.stopImmediatePropagation(),this.submitForm();}.bind(this));var e='[data-submit="#'+this.element.id+'"]',n=$(e);n&&n.on("click",function(t){t.preventDefault(),t.stopImmediatePropagation(),$(t.currentTarget).data("exit")&&($(this.element).find("input#exit").remove(),$("<input id='exit' />").attr("type","hidden").attr("name","exit").attr("value","true").appendTo(this.element)),this.submitForm();}.bind(this));}}return t.prototype.submitForm=function(){var t;if(this.element.classList.add("was-validated"),this.element.checkValidity()){this.element.classList.add("loading");var i=this.element.querySelector("input[type=checkbox]");if(i&&Array.prototype.slice.call(i).forEach((function(t){$(this).is(":checked")&&$(this).val("true");})),this.options.onSubmit&&this.options.onSubmit(this),this.options.useAjax){var e=this.options.serializationFunction();$.post(this.element.action,e,function(t){this.options.onComplete&&this.options.onComplete(t,this);}.bind(this)).fail(null!==(t=this.options.onError)&&void 0!==t?t:Inline.handleError).always(function(){this.element.classList.remove("loading");}.bind(this));}else this.element.submit();}else this.options.errorAlert&&Alerts.error(this.options.errorAlert,null,5e3);},t}();var MediaService=function(){function e(e,t){this.options={action:"show",size:"large"},this.galleryInitialised=!1,this.selectedMedia=new Array,this.element=e,this.element&&(this.options=__assign(__assign({},this.options),t),$("body").off("click",".media-delete",this.delete.bind(this)),$("body").on("click",".media-delete",this.delete.bind(this)),$(this.element).on("click",".media-item",this.action.bind(this)),$(this.element).on("click",".media-create-directory",this.createDirectory.bind(this)),$(this.element).on("click",".media-delete-directory",this.deleteDirectory.bind(this)),this.media=new DataList(this.element,{onLoad:this.options.onListLoad,onError:this.options.onError,onRender:this.options.onListRender,onComplete:function(e,t){this.initUploader(),"gallery"!=this.options.action||this.galleryInitialised||($("#media-select-modal .modal-footer").removeClass("d-none"),$("#media-select-modal .modal-footer").on("click",this.galleryAdd.bind(this)),this.galleryInitialised=!0),this.options.onListComplete&&this.options.onListComplete(e,t);}.bind(this)}));}return e.prototype.initUploader=function(){if(this.uploadButton=document.getElementById("media-add"),this.uploader=document.getElementById("media-upload"),this.uploadButton&&this.uploader){this.progressArea=document.getElementById("media-progress"),this.progressText=$('<div class="progress-text text-muted mb-3"><i class="fa fa-info-circle me-2"></i>Uploading file <span></span>...</div>'),this.progress=$('<div class="progress"><div class= "progress-bar progress-bar-striped" role="progressbar" style="width:0%" aria-valuenow="10" aria-valuemin="0" aria-valuemax="100" ></div></div>'),this.progressText.appendTo(this.progressArea),this.progress.appendTo(this.progressArea);var e=null;$("#media-upload").dropzone({url:$("#media-upload").data("url")+"?directoryId="+$("#media-list > #upload-directory-id").val(),thumbnailWidth:80,thumbnailHeight:80,parallelUploads:5,paramName:"files",acceptedFiles:$("#media-upload").data("types")||".png,.jpg,.jpeg,.gif,.pdf",autoProcessQueue:!0,previewsContainer:!1,clickable:"#media-add",dictDefaultMessage:'<span><i class="fa fa-cloud-upload fa-4x"></i><br />Drag and drop files here, or simply click me!</div>',dictResponseError:"Error while uploading file!",init:function(){e=this;}}),e.on("error",function(e,t){Alerts.warning(t);}.bind(this)),e.on("success",function(e,t){Response.process(t);}.bind(this)),e.on("addedfile",function(e){this.progress.find(".progress-bar").css({width:"0%"}),this.progressText.find("span").html("0%");}.bind(this)),e.on("totaluploadprogress",function(e,t,i){this.progress.find(".progress-bar").css({width:e+"%"}),this.progressText.find("span").html(Math.round(e)+"% - "+i.formatKilobytes()+" / "+t.formatKilobytes());}.bind(this)),e.on("sending",function(e){this.progressArea.classList.remove("collapse"),this.progress.find(".progress-bar").css({width:"0%"}),this.progressText.find("span").html("0%");}.bind(this)),e.on("complete",function(e){this.media.reload();}.bind(this)),e.on("queuecomplete",function(){this.progressArea.classList.add("collapse"),this.media.reload();}.bind(this));}},e.prototype.createDirectory=function(e){e.preventDefault(),e.stopPropagation();var t=new ModalController({onComplete:function(){var e=document.getElementById("content-directories-edit-form");new Validator(e,{onComplete:function(e){Response.process(e,5e3),e.success&&(this.media.reload(),t.close());}.bind(this)});}.bind(this)});t.show($(e.currentTarget).attr("href"),this.element);},e.prototype.deleteDirectory=function(e){e.preventDefault(),e.stopPropagation(),Alerts.confirm({},function(t){t.isConfirmed&&Inline.post(e.currentTarget.href,e.currentTarget,function(e,t){if(Response.process(e,5e3),e.data.length>0){var i=document.createElement("a");i.href=$(this.element).data("url"),i.search="?dir=".concat(e.data[0]),this.media.reload(new URL(i.href));}}.bind(this));}.bind(this));},e.prototype.uploadUrl=function(){return $("#media-upload").data("url")+"?directoryId="+$("#media-list > #upload-directory-id").val()},e.prototype.action=function(e){e.preventDefault(),e.stopPropagation();var t=$(e.currentTarget).data("json");switch(this.options.action){case"select":this.select(t,e);break;case"insert":this.insert(t,e);break;case"attach":this.attach(t,e);break;case"gallery":this.galleryClick(t,e);break;default:this.show(t,e);}},e.prototype.show=function(e,t){this.currentBlade=new ModalController,this.currentBlade.show($(t.target).data("blade"),t.target);},e.prototype.select=function(t,i){if(Alerts.log("[MediaService.select] Selecting media object id ".concat(t.id," - ").concat(t.filename," and inserting ").concat(this.options.size," url to target: ").concat(this.options.target)),this.options.target){var o=$(this.options.target);switch(this.options.size){case"thumb":o.val(t.thumbUrl);break;case"small":o.val(t.smallUrl);break;case"medium":o.val(t.mediumUrl);break;case"large":o.val(t.largeUrl);break;case"full":o.val(t.url);}}this.options.refresh&&e.refresh(t,this.options.refresh),this.options.onAction&&this.options.onAction(t);},e.prototype.insert=function(e,t){Alerts.log("[MediaService.insert] Selecting media object id ".concat(e.id," - ").concat(e.filename," and inserting ").concat(this.options.size," image to target editor: ").concat(this.options.target)),this.options.targetEditor.insertContent('<img alt="'+e.filename+'" src="'+e.url+'" class="img-fluid" />'),this.options.onAction&&this.options.onAction(e);},e.prototype.attach=function(t,i){Alerts.log("[MediaService.attach] Attaching media object id ".concat(t.id," - ").concat(t.filename," to url: ").concat(this.options.url)),$.post(this.options.url,{mediaId:t.id},function(i){Response.process(i,5e3),e.refresh(i.media,this.options.refresh),this.options.onAction&&this.options.onAction(t);}.bind(this));},e.prototype.galleryClick=function(e,t){this.isMediaSelected(e)?(Alerts.log("[MediaService.galleryClick] Removing media from selection - id ".concat(e.id," - ").concat(e.filename,".}")),this.selectedMedia=this.selectedMedia.filter((function(t){return t.id!==e.id})),$(t.currentTarget).parents(".media-item").removeClass("active")):(Alerts.log("[MediaService.galleryClick] Adding to selected media objects - id ".concat(e.id," - ").concat(e.filename,".")),this.selectedMedia.push(e),$(t.currentTarget).parents(".media-item").addClass("active"));},e.prototype.galleryAdd=function(e){e.preventDefault(),e.stopPropagation(),Alerts.log("[MediaService.galleryAdd] Adding ".concat(this.selectedMedia.length," selected media objects to url: ").concat(this.options.url));var t=this.selectedMedia.map((function(e){return e.id}));$.post(this.options.url,{media:t},function(e){Response.process(e),document.getElementById(this.options.target).hoodDataList.reload(),this.options.onAction&&this.options.onAction(e.media);}.bind(this));},e.prototype.isMediaSelected=function(e){var t=!1;return this.selectedMedia.forEach((function(i,o,s){i.id==e.id&&(t=!0);})),t},e.refresh=function(e,t){var i=e.icon;if("Image"===e.genericFileType&&(i=e.mediumUrl),t){var o=$(t);o.css({"background-image":"url("+i+")"}),o.find("img").attr("src",i),o.removeClass("loading");}},e.prototype.delete=function(e){e.preventDefault(),e.stopPropagation(),Alerts.confirm({html:"This file will be permanently deleted, are you sure?"},function(t){t.isConfirmed&&Inline.post(e.currentTarget.href,e.currentTarget,function(e){Response.process(e,5e3),this.media.reload(),this.currentBlade&&this.currentBlade.close();}.bind(this));}.bind(this));},e}();var MediaModal=function(){function e(){$("body").on("click","[data-hood-media=attach],[data-hood-media=select],[data-hood-media=gallery]",this.load.bind(this)),$("body").on("click","[data-hood-media=clear]",this.clear.bind(this)),$("[data-hood-media=gallery]").each(this.initGallery.bind(this));}return e.prototype.initGallery=function(e,t){var i=document.getElementById(t.dataset.hoodMediaTarget);i&&new DataList(i,{onComplete:function(e,t){Alerts.log("Finished loading gallery media list.","info");}.bind(this)});},e.prototype.load=function(e){e.preventDefault(),e.stopPropagation(),this.element=e.currentTarget,this.modal&&this.modal.isOpen||(this.modal=new ModalController({onComplete:function(e){this.list=document.getElementById("media-list"),this.service=new MediaService(this.list,{action:this.element.dataset.hoodMedia,url:this.element.dataset.hoodMediaUrl,refresh:this.element.dataset.hoodMediaRefresh,target:this.element.dataset.hoodMediaTarget,size:this.element.dataset.hoodMediaSize,beforeAction:function(e,t){}.bind(this),onAction:function(e,t){this.modal.close();}.bind(this),onListLoad:function(e){},onListRender:function(e){return e},onListComplete:function(e){},onError:function(e,t,i){}});}.bind(this)}),this.modal.show($(e.currentTarget).data("hood-media-list"),e.currentTarget));},e.prototype.clear=function(e){e.preventDefault(),e.stopPropagation(),Alerts.confirm({},function(t){t.isConfirmed&&Inline.post(e.currentTarget.href,e.currentTarget,function(t){Response.process(t,5e3),MediaService.refresh(t.media,e.currentTarget.dataset.hoodMediaRefresh);}.bind(this));}.bind(this));},e}();var Editors=function(){function e(e){this.options={linkClasses:[{title:"None",value:""},{title:"Button link",value:"btn btn-default"},{title:"Theme coloured button link",value:"btn btn-primary"},{title:"Popup image/video",value:"colorbox-iframe"},{title:"Button popup link",value:"btn btn-default colorbox-iframe"},{title:"Theme coloured button popup link",value:"btn btn-primary colorbox-iframe"},{title:"Large link",value:"font-lg"},{title:"Large button link",value:"btn btn-default btn-lg"},{title:"Large theme coloured button link",value:"btn btn-primary btn-lg"},{title:"Large popup image/video",value:"font-lg colorbox-iframe"},{title:"Large Button popup link",value:"btn btn-default btn-lg colorbox-iframe"},{title:"Theme coloured button popup link",value:"btn btn-primary btn-lg colorbox-iframe"}],imageClasses:[{title:"None",value:""},{title:"Full Width",value:"user-image full"},{title:"Left Aligned",value:"user-image left"},{title:"Centered",value:"user-image center"},{title:"Right Aligned",value:"user-image right"},{title:"Inline with text, top aligned",value:"user-image inline top"},{title:"Inline with text, middle aligned",value:"user-image inline"},{title:"Inline with text, bottom aligned",value:"user-image inline bottom"},{title:"Pulled Left",value:"user-image pull-left"},{title:"Pulled Right",value:"user-image pull-right"}]},this.options=__assign(__assign({},this.options),e);}return e.prototype.richTextEditors=function(){tinymce__default["default"].init({selector:".tinymce-full",height:150,menubar:!1,plugins:["advlist autolink lists link image charmap print preview anchor media","searchreplace visualblocks code fullscreen","insertdatetime media contextmenu paste code textcolor"],toolbar:"fullscreen | styleselect forecolor backcolor | hoodimage link media image | bold italic | alignleft aligncenter alignright | bullist numlist | table | undo redo",link_class_list:this.options.linkClasses,image_class_list:this.options.imageClasses,setup:this.setupCommands.bind(this),image_dimensions:!1,content_css:["/dist/css/editor.css"]}),tinymce__default["default"].init({selector:".tinymce-simple",height:150,plugins:["advlist autolink lists link image charmap print preview anchor media","searchreplace visualblocks code fullscreen","insertdatetime media contextmenu paste code"],menubar:!1,toolbar:"fullscreen | bold italic | bullist numlist | undo redo | link",link_class_list:this.options.linkClasses,image_class_list:this.options.imageClasses,setup:this.setupCommands.bind(this),image_dimensions:!1}),tinymce__default["default"].init({selector:".tinymce-full-content",height:500,menubar:!1,plugins:["advlist autolink lists link image charmap print preview anchor media","searchreplace visualblocks code fullscreen","insertdatetime media contextmenu paste code textcolor"],toolbar:"fullscreen | styleselect forecolor backcolor | hoodimage link media image | bold italic | alignleft aligncenter alignright | bullist numlist | table | undo redo",link_class_list:this.options.linkClasses,image_class_list:this.options.imageClasses,setup:this.setupCommands.bind(this),image_dimensions:!1}),tinymce__default["default"].init({selector:".tinymce-simple-content",height:500,plugins:["advlist autolink lists link image charmap print preview anchor media","searchreplace visualblocks code fullscreen","insertdatetime media contextmenu paste code"],menubar:!1,toolbar:"fullscreen | bold italic | bullist numlist | undo redo | link",link_class_list:this.options.linkClasses,image_class_list:this.options.imageClasses,image_dimensions:!1});},e.prototype.setupCommands=function(e){this.currentEditor=$("#"+e.id),this.currentEditor.data("hoodMediaList")&&e.ui.registry.addButton("hoodimage",{text:"Insert image...",icon:"image",onAction:function(t){this.mediaModal=new ModalController({onComplete:function(t){this.list=document.getElementById("media-list"),this.service=new MediaService(this.list,{action:"insert",url:this.currentEditor.data("hoodMediaList"),targetEditor:e,size:this.currentEditor.data("hoodMediaSize"),beforeAction:function(e,t){}.bind(this),onAction:function(e,t){this.mediaModal.close();}.bind(this),onListLoad:function(e){},onListRender:function(e){return e},onListComplete:function(e){},onError:function(e,t,i){}});}.bind(this)}),this.mediaModal.show(this.currentEditor.data("hoodMediaList"),t.currentTarget);}.bind(this)});},e}();var Handlers=function(){function t(){}return t.prototype.initDefaultHandlers=function(){this.checkboxToCsvInput(),this.iconSelector(),this.initSelectValues(),this.scrollHandlers(),this.selectText(),this.setValueOnClick(),this.submitOnChange();},t.prototype.initSelectValues=function(t){void 0===t&&(t="body"),$(t).find("select[data-selected]").each(this.initSelectValuesHandler);},t.prototype.initSelectValuesHandler=function(t,e){var o=$(this).data("selected");if("undefined"!==o&&""!==o){var a=String(o);$(this).val(a);}},t.prototype.iconSelector=function(t){void 0===t&&(t="body"),$(t).find("[data-hood-icon]").each(this.iconSelectorHandler);},t.prototype.iconSelectorHandler=function(t,e){var o=$(this),a=o.find("input[data-hood-icon-input]"),n=o.find("[data-hood-icon-display]"),i=o.find(".collapse");o.find("[data-hood-icon-key][data-hood-icon-value]").on("click",(function(){o.find("[data-hood-icon-key][data-hood-icon-value]").removeClass("active"),$(this).addClass("active");var t=$(this).data("hoodIconKey"),e=$(this).data("hoodIconValue");$(this),n.html(e),a.val(t),i&&i.removeClass("show");}));},t.prototype.selectText=function(t){void 0===t&&(t="body"),$(t).on("click",".select-text",this.selectTextHandler);},t.prototype.selectTextHandler=function(){var t=$(this);t.select(),t.mouseup((function(){return t.unbind("mouseup"),!1}));},t.prototype.scrollHandlers=function(t){void 0===t&&(t="body"),$(t).on("click",".scroll-top, .scroll-to-top",this.scrollTop),$(t).on("click",".scroll-target, .scroll-to-target",this.scrollTarget),$(t).on("click",".scroll-target-direct, .scroll-to-target-direct",this.scrollTargetDirect);},t.prototype.scrollTop=function(t){return t&&t.preventDefault(),$("html, body").animate({scrollTop:0},800),!1},t.prototype.scrollTarget=function(t){t&&t.preventDefault();var e=$(this).attr("href").split("#")[0];if(e===window.location.pathname||""===e){var o=this.hash,a=$(o),n=$("header.header"),i=0;n&&(i=n.height()),$(this).data("offset")?$("html, body").stop().animate({scrollTop:a.offset().top-$(this).data("offset")},900,"swing"):$("html, body").stop().animate({scrollTop:a.offset().top-i},900,"swing");}},t.prototype.scrollTargetDirect=function(){var t=$("body").scrollTop(),e=$($(this).attr("href")).offset().top;return $("html, body").animate({scrollTop:e},Math.abs(e-t)),!1},t.prototype.checkboxToCsvInput=function(t){void 0===t&&(t="body"),$(t).on("change","input[type=checkbox][data-hood-csv-input]",this.checkboxToCsvInputHandler);},t.prototype.checkboxToCsvInputHandler=function(t){t&&t.preventDefault();var e=new Array;$('input[data-hood-csv-input="'+$(this).data("hoodCsvInput")+'"]').each((function(){$(this).is(":checked")&&e.push($(this).val());}));var o="#"+$(this).data("input"),a=JSON.stringify(e);$(o).val(a);},t.prototype.submitOnChange=function(t){void 0===t&&(t="body"),$(t).on("change",".submit-on-change",this.submitOnChangeHandler);},t.prototype.submitOnChangeHandler=function(t){t&&t.preventDefault(),$(this).parents("form").submit();},t.prototype.setValueOnClick=function(t){void 0===t&&(t="body"),$(t).on("click",".click-select[data-target][data-value]",this.setValueOnClickHandler);},t.prototype.setValueOnClickHandler=function(){var t=$(this),e="#"+t.data("target");$(e).val(t.data("value")),$(e).trigger("change"),$('.click-select.clean[data-target="'+t.data("target")+'"]').each((function(){$(this).removeClass("active");})),$('.click-select.clean[data-target="'+t.data("target")+'"][data-value="'+t.data("value")+'"]').each((function(){$(this).addClass("active");}));},t}();var Uploader=function(){function e(){($(".image-uploader").length||$(".gallery-uploader").length)&&($(".upload-progress-bar").hide(),$(".image-uploader").each(this.singleImage),$(".gallery-uploader").each(this.gallery));}return e.prototype.refreshImage=function(e,r){$(e.data("preview")).css({"background-image":"url("+r.media.smallUrl+")"}),$(e.data("preview")).find("img").attr("src",r.media.smallUrl);},e.prototype.singleImage=function(){var e="#"+$(this).attr("id"),r=$(e),a="#"+$(this).attr("json"),l=null;r.dropzone({url:r.data("url"),maxFiles:1,paramName:"file",parallelUploads:1,acceptedFiles:r.data("types")||".png,.jpg,.jpeg,.gif",autoProcessQueue:!0,previewsContainer:!1,clickable:e,init:function(){l=this;}}),l.on("addedfile",(function(){})),l.on("totaluploadprogress",(function(r){$(".upload-progress-bar."+e.replace("#","")+" .progress-bar").css({width:r+"%"});})),l.on("sending",(function(a){$(".upload-progress-bar."+e.replace("#","")).show(),$(r.data("preview")).addClass("loading");})),l.on("queuecomplete",(function(r){$(".upload-progress-bar."+e.replace("#","")).hide();})),l.on("success",(function(e,o){o.success?(o.media&&($(a).val(JSON.stringify(o.media)),$(r.data("preview")).css({"background-image":"url("+o.media.smallUrl+")"}),$(r.data("preview")).find("img").attr("src",o.media.smallUrl)),Alerts.success("New image added!")):Alerts.error("There was a problem adding the image: "+o.error),l.removeFile(e),$(r.data("preview")).removeClass("loading");}));},e.prototype.gallery=function(){var e="#"+$(this).attr("id"),r=$(e),a=document.querySelector(e+"-template");a.id="";var l=a.parentNode.innerHTML;a.parentNode.removeChild(a);var o=null;r.dropzone({url:r.data("url"),thumbnailWidth:80,thumbnailHeight:80,parallelUploads:5,previewTemplate:l,paramName:"files",acceptedFiles:r.data("types")||".png,.jpg,.jpeg,.gif",autoProcessQueue:!0,previewsContainer:"#previews",clickable:".fileinput-button",init:function(){o=this;}}),$(e+" .cancel").hide(),o.on("addedfile",(function(r){$(r.previewElement.querySelector(".complete")).hide(),$(r.previewElement.querySelector(".cancel")).show(),$(e+" .cancel").show();})),o.on("totaluploadprogress",(function(e,r,a){document.querySelector("#total-progress .progress-bar").style.width=e+"%";})),o.on("sending",(function(e){document.querySelector("#total-progress").style.opacity="1";})),o.on("complete",(function(e){$(e.previewElement.querySelector(".cancel")).hide(),$(e.previewElement.querySelector(".progress")).hide(),$(e.previewElement.querySelector(".complete")).show(),console.error("Uploader.Gallery.Dropzone.OnComplete - Inline.Refresh('.gallery') is not implemented.");})),o.on("queuecomplete",(function(r){document.querySelector("#total-progress").style.opacity="0",$(e+" .cancel").hide();})),o.on("success",(function(e,r){console.error("Uploader.Gallery.Dropzone.OnSuccess - Inline.Refresh('.gallery') is not implemented."),r.success?Alerts.success("New images added!"):Alerts.error("There was a problem adding the profile image: "+r.error);})),$(".actions .cancel").click((function(){o.removeAllFiles(!0);}));},e}();var HoodApi=function(){function t(){this.alerts=new Alerts,this.handlers=new Handlers,this.uploader=new Uploader;}return t.prototype.initialise=function(){this.setupLoaders(),this.handlers.initDefaultHandlers(),this.initContactForms();},t.prototype.setupLoaders=function(){$("body").on("loader-show",(function(){document.body.classList.add("loading");})),$("body").on("loader-hide",(function(){document.body.classList.remove("loading");}));},t.prototype.initGoogleMaps=function(t){void 0===t&&(t=".google-map"),$(t).each((function(){var t=new google.maps.LatLng($(this).data("lat"),$(this).data("long"));console.log("Loading map at: "+$(this).data("lat")+", "+$(this).data("long"));var o=new google.maps.Map(this,{zoom:$(this).data("zoom")||15,center:t,scrollwheel:!1});new google.maps.Marker({position:t,map:o,title:$(this).data("marker")});$(window).on("resize",(function(){google.maps.event.trigger(o,"resize");})),google.maps.event.trigger(o,"resize");}));},t.prototype.initContactForms=function(t){void 0===t&&(t=".contact-form");var o=$(t);o.find(".thank-you").hide(),o.find(".form-content").show();var e=$(t)[0];new Validator(e,{onComplete:function(t){t.success?(o.attr("data-redirect")&&(window.location.href=o.attr("data-redirect")),o.attr("data-alert-message")&&Alerts.success(o.attr("data-alert-message")),o.find(".form").hide(),o.find(".thank-you").show()):o.attr("data-alert-error")?Alerts.error(o.attr("data-alert-error")):(console.error(t.errors),Alerts.error("There are errors on the form, please check your answers and try again."));}.bind(this)});},t}();var Loader=function(){function e(){new CustomEvent("loader-show"),new CustomEvent("loader-hide");}return e.show=function(){$("body").trigger("loader-show");},e.hide=function(){$("body").trigger("loader-hide");},e}();new Loader;var RandomStringGenerator=function(){function t(t){this.options={specials:"!@#$&*",alpha:"abcdefghijklmnopqrstuvwxyz",numeric:"0123456789",numSpecial:2},this.options=__assign(__assign({},this.options),t);}return t.prototype.generate=function(t){for(var o="",n=Math.ceil((t-this.options.numSpecial)/2),i=0;i<n;i++)o+=this.options.alpha.charAt(Math.floor(Math.random()*this.options.alpha.length)),o+=this.options.numeric.charAt(Math.floor(Math.random()*this.options.numeric.length));for(var a=0;a<this.options.numSpecial;a++)o+=this.options.specials.charAt(Math.floor(Math.random()*this.options.specials.length));return o=o.split("").sort((function(){return .5-Math.random()})).join("")},t}();$.fn.exists=function(){return $(this).length},$.fn.restrictToSlug=function(t){void 0===t&&(t=/[^0-9a-zA-Z]*/g);var n=$(this),e=function(){var n=$(this).val(),e=n.replace(t,"");n!==e&&$(this).val(e);};n.on("keyup",e),n.on("paste",e),n.on("change",e);},$.fn.restrictToPageSlug=function(t){void 0===t&&(t=/[^0-9a-zA-Z-//]*/g);var n=$(this),e=function(){var n=$(this).val(),e=n.replace(t,"");if((e.match(new RegExp("/","g"))||[]).length>4){var a=e.lastIndexOf("/");e=e.substring(0,a)+e.substring(a+1),Alerts.warning("You can only have up to 4 '/' characters in a url slug.");}n!==e&&$(this).val(e);};n.on("keyup",e),n.on("paste",e),n.on("change",e);},$.fn.restrictToMetaSlug=function(t){void 0===t&&(t=/[^0-9a-zA-Z.]*/g);var n=$(this),e=function(){var n=$(this).val(),e=n.replace(t,"");if((e.match(new RegExp(".","g"))||[]).length>1){var a=e.lastIndexOf(".");e=e.substring(0,a)+e.substring(a+1),Alerts.warning("You can only have up to 1 '.' characters in a meta slug.");}n!==e&&$(this).val(e);};n.on("keyup",e),n.on("paste",e),n.on("change",e);},$.fn.characterCounter=function(){var t=$(this),n=function(){var t=$(this).data("counter"),n=Number($(this).attr("maxlength")),e=$(this).val().length;$(t).text(n-e);var a="text-success";n-e<n/10&&(a="text-danger"),$(t).parent().removeClass("text-success").removeClass("text-danger").addClass(a);};t.on("keyup",n),t.on("paste",n),t.on("change",n);},$.fn.warningAlert=function(){$(this).on("click",(function(t){t.preventDefault();return Alerts.confirm({title:$(t.currentTarget).data("title"),html:$(t.currentTarget).data("warning"),footer:$(t.currentTarget).data("footer"),icon:"warning"},(function(n){if(n.isConfirmed){var e=$(t.currentTarget).attr("href");window.location.href=e;}})),!1}));};
|
|
22
|
+
var Response=function(){function e(){}return e.process=function(e,s){void 0===s&&(s=5e3),e.success?Alerts.success(e.message,e.title,s):Alerts.error(e.errors,e.title,s);},e}();var ModalController=function(){function t(t){void 0===t&&(t=null),this.isOpen=!1,this.options={closePrevious:!0},this.options=__assign(__assign({},this.options),t);}return t.prototype.show=function(t,o){this.options.onLoad&&this.options.onLoad(this.element),this.isOpen||(this.isOpen=!0,$.get(t,function(t){this.modal&&this.options.closePrevious&&this.close(),this.options.onRender&&(t=this.options.onRender(this.element,t)),this.element=this.createElementFromHTML(t),this.element.classList.add("hood-inline-modal"),$("body").append(this.element),this.modal=new bootstrap.Modal(this.element,{}),this.modal.show(),this.element.addEventListener("shown.bs.modal",function(){$(document).off("focusin.modal");}.bind(this)),this.element.addEventListener("hidden.bs.modal",function(){this.options.onHidden&&this.options.onHidden(this.element),this.dispose(),this.isOpen=!1;}.bind(this)),this.options.onComplete&&this.options.onComplete(this.element);}.bind(this)).fail(function(t,o,i){this.isOpen=!1,this.options.onError&&this.options.onError(t,o,i),Inline.handleError(t,o,i);}.bind(this)));},t.prototype.close=function(){this.modal&&this.modal.hide();},t.prototype.dispose=function(){this.modal.dispose(),this.element.remove();},t.prototype.createElementFromHTML=function(t){var o=document.createElement("div");return o.innerHTML=t.trim(),o.firstChild},t}();var Validator=function(){function t(t,i){if(this.options={errorAlert:"There are errors on the form, please check your answers and try again.",useAjax:!0},this.element=t,this.element){this.options.serializationFunction=function(){return $(this.element).serialize()}.bind(this),this.options=__assign(__assign({},this.options),i),this.element.addEventListener("submit",function(t){t.preventDefault(),t.stopImmediatePropagation(),this.submitForm();}.bind(this));var e='[data-submit="#'+this.element.id+'"]',n=$(e);n&&n.on("click",function(t){t.preventDefault(),t.stopImmediatePropagation(),$(t.currentTarget).data("exit")&&($(this.element).find("input#exit").remove(),$("<input id='exit' />").attr("type","hidden").attr("name","exit").attr("value","true").appendTo(this.element)),this.submitForm();}.bind(this));}}return t.prototype.submitForm=function(){var t;if(this.element.classList.add("was-validated"),this.element.checkValidity()){this.element.classList.add("loading");var i=this.element.querySelector("input[type=checkbox]");if(i&&Array.prototype.slice.call(i).forEach((function(t){$(this).is(":checked")&&$(this).val("true");})),this.options.onSubmit&&this.options.onSubmit(this),this.options.useAjax){var e=this.options.serializationFunction();$.post(this.element.action,e,function(t){this.options.onComplete&&this.options.onComplete(t,this);}.bind(this)).fail(null!==(t=this.options.onError)&&void 0!==t?t:Inline.handleError).always(function(){this.element.classList.remove("loading");}.bind(this));}else this.element.submit();}else this.options.errorAlert&&Alerts.error(this.options.errorAlert,null,5e3);},t}();var MediaService=function(){function e(e,t){this.options={action:"show",size:"large"},this.galleryInitialised=!1,this.selectedMedia=new Array,this.element=e,this.element&&(this.options=__assign(__assign({},this.options),t),$("body").off("click",".media-delete",this.delete.bind(this)),$("body").on("click",".media-delete",this.delete.bind(this)),$(this.element).on("click",".media-item",this.action.bind(this)),$(this.element).on("click",".media-create-directory",this.createDirectory.bind(this)),$(this.element).on("click",".media-delete-directory",this.deleteDirectory.bind(this)),this.media=new DataList(this.element,{onLoad:this.options.onListLoad,onError:this.options.onError,onRender:this.options.onListRender,onComplete:function(e,t){this.initUploader(),"gallery"!=this.options.action||this.galleryInitialised||($("#media-select-modal .modal-footer").removeClass("d-none"),$("#media-select-modal .modal-footer").on("click",this.galleryAdd.bind(this)),this.galleryInitialised=!0),this.options.onListComplete&&this.options.onListComplete(e,t);}.bind(this)}));}return e.prototype.initUploader=function(){if(this.uploadButton=document.getElementById("media-add"),this.uploader=document.getElementById("media-upload"),this.uploadButton&&this.uploader){this.progressArea=document.getElementById("media-progress"),this.progressText=$('<div class="progress-text text-muted mb-3"><i class="fa fa-info-circle me-2"></i>Uploading file <span></span>...</div>'),this.progress=$('<div class="progress"><div class= "progress-bar progress-bar-striped" role="progressbar" style="width:0%" aria-valuenow="10" aria-valuemin="0" aria-valuemax="100" ></div></div>'),this.progressText.appendTo(this.progressArea),this.progress.appendTo(this.progressArea);var e=null;$("#media-upload").dropzone({url:$("#media-upload").data("url")+"?directoryId="+$("#media-list > #upload-directory-id").val(),thumbnailWidth:80,thumbnailHeight:80,parallelUploads:5,paramName:"files",acceptedFiles:$("#media-upload").data("types")||".png,.jpg,.jpeg,.gif,.pdf",autoProcessQueue:!0,previewsContainer:!1,clickable:"#media-add",dictDefaultMessage:'<span><i class="fa fa-cloud-upload fa-4x"></i><br />Drag and drop files here, or simply click me!</div>',dictResponseError:"Error while uploading file!",init:function(){e=this;}}),e.on("error",function(e,t){Alerts.warning(t);}.bind(this)),e.on("success",function(e,t){Response.process(t);}.bind(this)),e.on("addedfile",function(e){this.progress.find(".progress-bar").css({width:"0%"}),this.progressText.find("span").html("0%");}.bind(this)),e.on("totaluploadprogress",function(e,t,i){this.progress.find(".progress-bar").css({width:e+"%"}),this.progressText.find("span").html(Math.round(e)+"% - "+i.formatKilobytes()+" / "+t.formatKilobytes());}.bind(this)),e.on("sending",function(e){this.progressArea.classList.remove("collapse"),this.progress.find(".progress-bar").css({width:"0%"}),this.progressText.find("span").html("0%");}.bind(this)),e.on("complete",function(e){this.media.reload();}.bind(this)),e.on("queuecomplete",function(){this.progressArea.classList.add("collapse"),this.media.reload();}.bind(this));}},e.prototype.createDirectory=function(e){e.preventDefault(),e.stopPropagation();var t=new ModalController({onComplete:function(){var e=document.getElementById("content-directories-edit-form");new Validator(e,{onComplete:function(e){Response.process(e,5e3),e.success&&(this.media.reload(),t.close());}.bind(this)});}.bind(this)});t.show($(e.currentTarget).attr("href"),this.element);},e.prototype.deleteDirectory=function(e){e.preventDefault(),e.stopPropagation(),Alerts.confirm({},function(t){t.isConfirmed&&Inline.post(e.currentTarget.href,e.currentTarget,function(e,t){if(Response.process(e,5e3),e.data.length>0){var i=document.createElement("a");i.href=$(this.element).data("url"),i.search="?dir=".concat(e.data[0]),this.media.reload(new URL(i.href));}}.bind(this));}.bind(this));},e.prototype.uploadUrl=function(){return $("#media-upload").data("url")+"?directoryId="+$("#media-list > #upload-directory-id").val()},e.prototype.action=function(e){e.preventDefault(),e.stopPropagation();var t=$(e.currentTarget).data("json");switch(this.options.action){case"select":this.select(t,e);break;case"insert":this.insert(t,e);break;case"attach":this.attach(t,e);break;case"gallery":this.galleryClick(t,e);break;default:this.show(t,e);}},e.prototype.show=function(e,t){this.currentBlade=new ModalController,this.currentBlade.show($(t.target).data("blade"),t.target);},e.prototype.select=function(t,i){if(Alerts.log("[MediaService.select] Selecting media object id ".concat(t.id," - ").concat(t.filename," and inserting ").concat(this.options.size," url to target: ").concat(this.options.target)),this.options.target){var o=$(this.options.target);switch(this.options.size){case"thumb":o.val(t.thumbUrl);break;case"small":o.val(t.smallUrl);break;case"medium":o.val(t.mediumUrl);break;case"large":o.val(t.largeUrl);break;case"full":o.val(t.url);}}this.options.refresh&&e.refresh(t,this.options.refresh),this.options.onAction&&this.options.onAction(t);},e.prototype.insert=function(e,t){Alerts.log("[MediaService.insert] Selecting media object id ".concat(e.id," - ").concat(e.filename," and inserting ").concat(this.options.size," image to target editor: ").concat(this.options.target)),this.options.targetEditor.insertContent('<img alt="'+e.filename+'" src="'+e.url+'" class="img-fluid" />'),this.options.onAction&&this.options.onAction(e);},e.prototype.attach=function(t,i){Alerts.log("[MediaService.attach] Attaching media object id ".concat(t.id," - ").concat(t.filename," to url: ").concat(this.options.url)),$.post(this.options.url,{mediaId:t.id},function(i){Response.process(i,5e3),e.refresh(i.media,this.options.refresh),this.options.onAction&&this.options.onAction(t);}.bind(this));},e.prototype.galleryClick=function(e,t){this.isMediaSelected(e)?(Alerts.log("[MediaService.galleryClick] Removing media from selection - id ".concat(e.id," - ").concat(e.filename,".}")),this.selectedMedia=this.selectedMedia.filter((function(t){return t.id!==e.id})),$(t.currentTarget).parents(".media-item").removeClass("active")):(Alerts.log("[MediaService.galleryClick] Adding to selected media objects - id ".concat(e.id," - ").concat(e.filename,".")),this.selectedMedia.push(e),$(t.currentTarget).parents(".media-item").addClass("active"));},e.prototype.galleryAdd=function(e){e.preventDefault(),e.stopPropagation(),Alerts.log("[MediaService.galleryAdd] Adding ".concat(this.selectedMedia.length," selected media objects to url: ").concat(this.options.url));var t=this.selectedMedia.map((function(e){return e.id}));$.post(this.options.url,{media:t},function(e){Response.process(e),document.getElementById(this.options.target).hoodDataList.reload(),this.options.onAction&&this.options.onAction(e.media);}.bind(this));},e.prototype.isMediaSelected=function(e){var t=!1;return this.selectedMedia.forEach((function(i,o,s){i.id==e.id&&(t=!0);})),t},e.refresh=function(e,t){var i=e.icon;if("Image"===e.genericFileType&&(i=e.mediumUrl),t){var o=$(t);o.css({"background-image":"url("+i+")"}),o.find("img").attr("src",i),o.removeClass("loading");}},e.prototype.delete=function(e){e.preventDefault(),e.stopPropagation(),Alerts.confirm({html:"This file will be permanently deleted, are you sure?"},function(t){t.isConfirmed&&Inline.post(e.currentTarget.href,e.currentTarget,function(e){Response.process(e,5e3),this.media.reload(),this.currentBlade&&this.currentBlade.close();}.bind(this));}.bind(this));},e}();var MediaModal=function(){function e(){$("body").on("click","[data-hood-media=attach],[data-hood-media=select],[data-hood-media=gallery]",this.load.bind(this)),$("body").on("click","[data-hood-media=clear]",this.clear.bind(this)),$("[data-hood-media=gallery]").each(this.initGallery.bind(this));}return e.prototype.initGallery=function(e,t){var i=document.getElementById(t.dataset.hoodMediaTarget);i&&new DataList(i,{onComplete:function(e,t){Alerts.log("Finished loading gallery media list.","info");}.bind(this)});},e.prototype.load=function(e){e.preventDefault(),e.stopPropagation(),this.element=e.currentTarget,this.modal&&this.modal.isOpen||(this.modal=new ModalController({onComplete:function(e){this.list=document.getElementById("media-list"),this.service=new MediaService(this.list,{action:this.element.dataset.hoodMedia,url:this.element.dataset.hoodMediaUrl,refresh:this.element.dataset.hoodMediaRefresh,target:this.element.dataset.hoodMediaTarget,size:this.element.dataset.hoodMediaSize,beforeAction:function(e,t){}.bind(this),onAction:function(e,t){this.modal.close();}.bind(this),onListLoad:function(e){},onListRender:function(e){return e},onListComplete:function(e){},onError:function(e,t,i){}});}.bind(this)}),this.modal.show($(e.currentTarget).data("hood-media-list"),e.currentTarget));},e.prototype.clear=function(e){e.preventDefault(),e.stopPropagation(),Alerts.confirm({},function(t){t.isConfirmed&&Inline.post(e.currentTarget.href,e.currentTarget,function(t){Response.process(t,5e3),MediaService.refresh(t.media,e.currentTarget.dataset.hoodMediaRefresh);}.bind(this));}.bind(this));},e}();var Editors=function(){function e(e){this.options={linkClasses:[{title:"None",value:""},{title:"Button link",value:"btn btn-default"},{title:"Theme coloured button link",value:"btn btn-primary"},{title:"Popup image/video",value:"colorbox-iframe"},{title:"Button popup link",value:"btn btn-default colorbox-iframe"},{title:"Theme coloured button popup link",value:"btn btn-primary colorbox-iframe"},{title:"Large link",value:"font-lg"},{title:"Large button link",value:"btn btn-default btn-lg"},{title:"Large theme coloured button link",value:"btn btn-primary btn-lg"},{title:"Large popup image/video",value:"font-lg colorbox-iframe"},{title:"Large Button popup link",value:"btn btn-default btn-lg colorbox-iframe"},{title:"Theme coloured button popup link",value:"btn btn-primary btn-lg colorbox-iframe"}],imageClasses:[{title:"None",value:""},{title:"Full Width",value:"user-image full"},{title:"Left Aligned",value:"user-image left"},{title:"Centered",value:"user-image center"},{title:"Right Aligned",value:"user-image right"},{title:"Inline with text, top aligned",value:"user-image inline top"},{title:"Inline with text, middle aligned",value:"user-image inline"},{title:"Inline with text, bottom aligned",value:"user-image inline bottom"},{title:"Pulled Left",value:"user-image pull-left"},{title:"Pulled Right",value:"user-image pull-right"}]},this.options=__assign(__assign({},this.options),e);}return e.prototype.richTextEditors=function(){tinymce__default["default"].init({selector:".tinymce-full",height:150,menubar:!1,plugins:["advlist autolink lists link image charmap print preview anchor media","searchreplace visualblocks code fullscreen","insertdatetime media contextmenu paste textcolor"],toolbar:"fullscreen code | styleselect forecolor backcolor | hoodimage link media image | bold italic | alignleft aligncenter alignright | bullist numlist | table | undo redo",link_class_list:this.options.linkClasses,image_class_list:this.options.imageClasses,setup:this.setupCommands.bind(this),image_dimensions:!1,content_css:["/dist/css/editor.css"]}),tinymce__default["default"].init({selector:".tinymce-simple",height:150,plugins:["advlist autolink lists link image charmap print preview anchor media","searchreplace visualblocks code fullscreen","insertdatetime media contextmenu paste code"],menubar:!1,toolbar:"fullscreen | bold italic | bullist numlist | undo redo | link",link_class_list:this.options.linkClasses,image_class_list:this.options.imageClasses,setup:this.setupCommands.bind(this),image_dimensions:!1}),tinymce__default["default"].init({selector:".tinymce-full-content",height:500,menubar:!1,plugins:["advlist autolink lists link image charmap print preview anchor media","searchreplace visualblocks code fullscreen","insertdatetime media contextmenu paste textcolor"],toolbar:"fullscreen code | styleselect forecolor backcolor | hoodimage link media image | bold italic | alignleft aligncenter alignright | bullist numlist | table | undo redo",link_class_list:this.options.linkClasses,image_class_list:this.options.imageClasses,setup:this.setupCommands.bind(this),image_dimensions:!1}),tinymce__default["default"].init({selector:".tinymce-simple-content",height:500,plugins:["advlist autolink lists link image charmap print preview anchor media","searchreplace visualblocks code fullscreen","insertdatetime media contextmenu paste"],menubar:!1,toolbar:"fullscreen | bold italic | bullist numlist | undo redo | link",link_class_list:this.options.linkClasses,image_class_list:this.options.imageClasses,image_dimensions:!1});},e.prototype.setupCommands=function(e){this.currentEditor=$("#"+e.id),this.currentEditor.data("hoodMediaList")&&e.ui.registry.addButton("hoodimage",{text:"Insert image...",icon:"image",onAction:function(t){this.mediaModal=new ModalController({onComplete:function(t){this.list=document.getElementById("media-list"),this.service=new MediaService(this.list,{action:"insert",url:this.currentEditor.data("hoodMediaList"),targetEditor:e,size:this.currentEditor.data("hoodMediaSize"),beforeAction:function(e,t){}.bind(this),onAction:function(e,t){this.mediaModal.close();}.bind(this),onListLoad:function(e){},onListRender:function(e){return e},onListComplete:function(e){},onError:function(e,t,i){}});}.bind(this)}),this.mediaModal.show(this.currentEditor.data("hoodMediaList"),t.currentTarget);}.bind(this)});},e}();var Handlers=function(){function t(){}return t.prototype.initDefaultHandlers=function(){this.checkboxToCsvInput(),this.iconSelector(),this.initSelectValues(),this.scrollHandlers(),this.selectText(),this.setValueOnClick(),this.submitOnChange();},t.prototype.initSelectValues=function(t){void 0===t&&(t="body"),$(t).find("select[data-selected]").each(this.initSelectValuesHandler);},t.prototype.initSelectValuesHandler=function(t,e){var o=$(this).data("selected");if("undefined"!==o&&""!==o){var a=String(o);$(this).val(a);}},t.prototype.iconSelector=function(t){void 0===t&&(t="body"),$(t).find("[data-hood-icon]").each(this.iconSelectorHandler);},t.prototype.iconSelectorHandler=function(t,e){var o=$(this),a=o.find("input[data-hood-icon-input]"),n=o.find("[data-hood-icon-display]"),i=o.find(".collapse");o.find("[data-hood-icon-key][data-hood-icon-value]").on("click",(function(){o.find("[data-hood-icon-key][data-hood-icon-value]").removeClass("active"),$(this).addClass("active");var t=$(this).data("hoodIconKey"),e=$(this).data("hoodIconValue");$(this),n.html(e),a.val(t),i&&i.removeClass("show");}));},t.prototype.selectText=function(t){void 0===t&&(t="body"),$(t).on("click",".select-text",this.selectTextHandler);},t.prototype.selectTextHandler=function(){var t=$(this);t.select(),t.mouseup((function(){return t.unbind("mouseup"),!1}));},t.prototype.scrollHandlers=function(t){void 0===t&&(t="body"),$(t).on("click",".scroll-top, .scroll-to-top",this.scrollTop),$(t).on("click",".scroll-target, .scroll-to-target",this.scrollTarget),$(t).on("click",".scroll-target-direct, .scroll-to-target-direct",this.scrollTargetDirect);},t.prototype.scrollTop=function(t){return t&&t.preventDefault(),$("html, body").animate({scrollTop:0},800),!1},t.prototype.scrollTarget=function(t){t&&t.preventDefault();var e=$(this).attr("href").split("#")[0];if(e===window.location.pathname||""===e){var o=this.hash,a=$(o),n=$("header.header"),i=0;n&&(i=n.height()),$(this).data("offset")?$("html, body").stop().animate({scrollTop:a.offset().top-$(this).data("offset")},900,"swing"):$("html, body").stop().animate({scrollTop:a.offset().top-i},900,"swing");}},t.prototype.scrollTargetDirect=function(){var t=$("body").scrollTop(),e=$($(this).attr("href")).offset().top;return $("html, body").animate({scrollTop:e},Math.abs(e-t)),!1},t.prototype.checkboxToCsvInput=function(t){void 0===t&&(t="body"),$(t).on("change","input[type=checkbox][data-hood-csv-input]",this.checkboxToCsvInputHandler);},t.prototype.checkboxToCsvInputHandler=function(t){t&&t.preventDefault();var e=new Array;$('input[data-hood-csv-input="'+$(this).data("hoodCsvInput")+'"]').each((function(){$(this).is(":checked")&&e.push($(this).val());}));var o="#"+$(this).data("input"),a=JSON.stringify(e);$(o).val(a);},t.prototype.submitOnChange=function(t){void 0===t&&(t="body"),$(t).on("change",".submit-on-change",this.submitOnChangeHandler);},t.prototype.submitOnChangeHandler=function(t){t&&t.preventDefault(),$(this).parents("form").submit();},t.prototype.setValueOnClick=function(t){void 0===t&&(t="body"),$(t).on("click",".click-select[data-target][data-value]",this.setValueOnClickHandler);},t.prototype.setValueOnClickHandler=function(){var t=$(this),e="#"+t.data("target");$(e).val(t.data("value")),$(e).trigger("change"),$('.click-select.clean[data-target="'+t.data("target")+'"]').each((function(){$(this).removeClass("active");})),$('.click-select.clean[data-target="'+t.data("target")+'"][data-value="'+t.data("value")+'"]').each((function(){$(this).addClass("active");}));},t}();var Uploader=function(){function e(){($(".image-uploader").length||$(".gallery-uploader").length)&&($(".upload-progress-bar").hide(),$(".image-uploader").each(this.singleImage),$(".gallery-uploader").each(this.gallery));}return e.prototype.refreshImage=function(e,r){$(e.data("preview")).css({"background-image":"url("+r.media.smallUrl+")"}),$(e.data("preview")).find("img").attr("src",r.media.smallUrl);},e.prototype.singleImage=function(){var e="#"+$(this).attr("id"),r=$(e),a="#"+$(this).attr("json"),l=null;r.dropzone({url:r.data("url"),maxFiles:1,paramName:"file",parallelUploads:1,acceptedFiles:r.data("types")||".png,.jpg,.jpeg,.gif",autoProcessQueue:!0,previewsContainer:!1,clickable:e,init:function(){l=this;}}),l.on("addedfile",(function(){})),l.on("totaluploadprogress",(function(r){$(".upload-progress-bar."+e.replace("#","")+" .progress-bar").css({width:r+"%"});})),l.on("sending",(function(a){$(".upload-progress-bar."+e.replace("#","")).show(),$(r.data("preview")).addClass("loading");})),l.on("queuecomplete",(function(r){$(".upload-progress-bar."+e.replace("#","")).hide();})),l.on("success",(function(e,o){o.success?(o.media&&($(a).val(JSON.stringify(o.media)),$(r.data("preview")).css({"background-image":"url("+o.media.smallUrl+")"}),$(r.data("preview")).find("img").attr("src",o.media.smallUrl)),Alerts.success("New image added!")):Alerts.error("There was a problem adding the image: "+o.error),l.removeFile(e),$(r.data("preview")).removeClass("loading");}));},e.prototype.gallery=function(){var e="#"+$(this).attr("id"),r=$(e),a=document.querySelector(e+"-template");a.id="";var l=a.parentNode.innerHTML;a.parentNode.removeChild(a);var o=null;r.dropzone({url:r.data("url"),thumbnailWidth:80,thumbnailHeight:80,parallelUploads:5,previewTemplate:l,paramName:"files",acceptedFiles:r.data("types")||".png,.jpg,.jpeg,.gif",autoProcessQueue:!0,previewsContainer:"#previews",clickable:".fileinput-button",init:function(){o=this;}}),$(e+" .cancel").hide(),o.on("addedfile",(function(r){$(r.previewElement.querySelector(".complete")).hide(),$(r.previewElement.querySelector(".cancel")).show(),$(e+" .cancel").show();})),o.on("totaluploadprogress",(function(e,r,a){document.querySelector("#total-progress .progress-bar").style.width=e+"%";})),o.on("sending",(function(e){document.querySelector("#total-progress").style.opacity="1";})),o.on("complete",(function(e){$(e.previewElement.querySelector(".cancel")).hide(),$(e.previewElement.querySelector(".progress")).hide(),$(e.previewElement.querySelector(".complete")).show(),console.error("Uploader.Gallery.Dropzone.OnComplete - Inline.Refresh('.gallery') is not implemented.");})),o.on("queuecomplete",(function(r){document.querySelector("#total-progress").style.opacity="0",$(e+" .cancel").hide();})),o.on("success",(function(e,r){console.error("Uploader.Gallery.Dropzone.OnSuccess - Inline.Refresh('.gallery') is not implemented."),r.success?Alerts.success("New images added!"):Alerts.error("There was a problem adding the profile image: "+r.error);})),$(".actions .cancel").click((function(){o.removeAllFiles(!0);}));},e}();var HoodApi=function(){function t(){this.alerts=new Alerts,this.handlers=new Handlers,this.uploader=new Uploader;}return t.prototype.initialise=function(){this.setupLoaders(),this.handlers.initDefaultHandlers(),this.initContactForms();},t.prototype.setupLoaders=function(){$("body").on("loader-show",(function(){document.body.classList.add("loading");})),$("body").on("loader-hide",(function(){document.body.classList.remove("loading");}));},t.prototype.initGoogleMaps=function(t){void 0===t&&(t=".google-map"),$(t).each((function(){var t=new google.maps.LatLng($(this).data("lat"),$(this).data("long"));console.log("Loading map at: "+$(this).data("lat")+", "+$(this).data("long"));var o=new google.maps.Map(this,{zoom:$(this).data("zoom")||15,center:t,scrollwheel:!1});new google.maps.Marker({position:t,map:o,title:$(this).data("marker")});$(window).on("resize",(function(){google.maps.event.trigger(o,"resize");})),google.maps.event.trigger(o,"resize");}));},t.prototype.initContactForms=function(t){void 0===t&&(t=".contact-form");var o=$(t);o.find(".thank-you").hide(),o.find(".form-content").show();var e=$(t)[0];new Validator(e,{onComplete:function(t){t.success?(o.attr("data-redirect")&&(window.location.href=o.attr("data-redirect")),o.attr("data-alert-message")&&Alerts.success(o.attr("data-alert-message")),o.find(".form").hide(),o.find(".thank-you").show()):o.attr("data-alert-error")?Alerts.error(o.attr("data-alert-error")):(console.error(t.errors),Alerts.error("There are errors on the form, please check your answers and try again."));}.bind(this)});},t}();var Loader=function(){function e(){new CustomEvent("loader-show"),new CustomEvent("loader-hide");}return e.show=function(){$("body").trigger("loader-show");},e.hide=function(){$("body").trigger("loader-hide");},e}();new Loader;var RandomStringGenerator=function(){function t(t){this.options={specials:"!@#$&*",alpha:"abcdefghijklmnopqrstuvwxyz",numeric:"0123456789",numSpecial:2},this.options=__assign(__assign({},this.options),t);}return t.prototype.generate=function(t){for(var o="",n=Math.ceil((t-this.options.numSpecial)/2),i=0;i<n;i++)o+=this.options.alpha.charAt(Math.floor(Math.random()*this.options.alpha.length)),o+=this.options.numeric.charAt(Math.floor(Math.random()*this.options.numeric.length));for(var a=0;a<this.options.numSpecial;a++)o+=this.options.specials.charAt(Math.floor(Math.random()*this.options.specials.length));return o=o.split("").sort((function(){return .5-Math.random()})).join("")},t}();$.fn.exists=function(){return $(this).length},$.fn.restrictToSlug=function(t){void 0===t&&(t=/[^0-9a-zA-Z]*/g);var n=$(this),e=function(){var n=$(this).val(),e=n.replace(t,"");n!==e&&$(this).val(e);};n.on("keyup",e),n.on("paste",e),n.on("change",e);},$.fn.restrictToPageSlug=function(t){void 0===t&&(t=/[^0-9a-zA-Z-//]*/g);var n=$(this),e=function(){var n=$(this).val(),e=n.replace(t,"");if((e.match(new RegExp("/","g"))||[]).length>4){var a=e.lastIndexOf("/");e=e.substring(0,a)+e.substring(a+1),Alerts.warning("You can only have up to 4 '/' characters in a url slug.");}n!==e&&$(this).val(e);};n.on("keyup",e),n.on("paste",e),n.on("change",e);},$.fn.restrictToMetaSlug=function(t){void 0===t&&(t=/[^0-9a-zA-Z.]*/g);var n=$(this),e=function(){var n=$(this).val(),e=n.replace(t,"");if((e.match(new RegExp(".","g"))||[]).length>1){var a=e.lastIndexOf(".");e=e.substring(0,a)+e.substring(a+1),Alerts.warning("You can only have up to 1 '.' characters in a meta slug.");}n!==e&&$(this).val(e);};n.on("keyup",e),n.on("paste",e),n.on("change",e);},$.fn.characterCounter=function(){var t=$(this),n=function(){var t=$(this).data("counter"),n=Number($(this).attr("maxlength")),e=$(this).val().length;$(t).text(n-e);var a="text-success";n-e<n/10&&(a="text-danger"),$(t).parent().removeClass("text-success").removeClass("text-danger").addClass(a);};t.on("keyup",n),t.on("paste",n),t.on("change",n);},$.fn.warningAlert=function(){$(this).on("click",(function(t){t.preventDefault();return Alerts.confirm({title:$(t.currentTarget).data("title"),html:$(t.currentTarget).data("warning"),footer:$(t.currentTarget).data("footer"),icon:"warning"},(function(n){if(n.isConfirmed){var e=$(t.currentTarget).attr("href");window.location.href=e;}})),!1}));};
|
|
23
23
|
Number.prototype.formatCurrency=function(t){return t+" "+this.toFixed(2).replace(/./g,(function(t,e,r){return e>0&&"."!==t&&(r.length-e)%3==0?","+t:t}))},Number.prototype.formatKilobytes=function(){return (this/1024).toFixed(0).replace(/./g,(function(t,e,r){return e>0&&"."!==t&&(r.length-e)%3==0?","+t:t}))+"Kb"},Number.prototype.formatMegabytes=function(){var t=this/1024;return (t/=1024).toFixed(0).replace(/./g,(function(t,e,r){return e>0&&"."!==t&&(r.length-e)%3==0?","+t:t}))+"Mb"};String.prototype.htmlEncode=function(){return $("<div/>").text(this).html()},String.prototype.htmlDecode=function(){return $("<div/>").html(this).text()},String.prototype.contains=function(t){return -1!==this.indexOf(t)},String.prototype.pick=function(t,r){var o,n="";o=void 0===r?t:t+Math.floor(Math.random()*(r-t));for(var e=0;e<o;e++)n+=this.charAt(Math.floor(Math.random()*this.length));return n},String.prototype.shuffle=function(){var t,r,o=this.split(""),n=o.length;if(n)for(;--n;)t=o[r=Math.floor(Math.random()*(n+1))],o[r]=o[n],o[n]=t;return o.join("")},String.prototype.toSeoUrl=function(){var t=this.replace(/[^a-zA-Z0-9]/g," ").replace(/\s+/g,"-").toLowerCase();"-"===t.charAt(0)&&(t=t.substring(1));var r=t.length-1;return "-"===t.charAt(r)&&(t=t.substring(0,r)),t};var ContentController=function(){function t(){this.manage(),$("body").on("click",".content-create",this.create.bind(this)),$("body").on("click",".content-delete",this.delete.bind(this)),$("body").on("click",".content-set-status",this.setStatus.bind(this)),$("body").on("click",".content-categories-delete",this.deleteCategory.bind(this)),$("body").on("click",".content-categories-create,.content-categories-edit",this.createOrEditCategory.bind(this)),$("body").on("change",".content-categories-check",this.toggleCategory.bind(this)),$("body").on("click",".content-media-delete",this.removeMedia.bind(this)),$("body").on("keyup","#Slug",(function(){var t=$(this).val();$(".slug-display").html(t);}));}return t.prototype.manage=function(){this.element=document.getElementById("content-list"),this.element&&(this.list=new DataList(this.element,{onComplete:function(t,e){Alerts.log("Finished loading content list.","info");}.bind(this)})),this.categoryElement=document.getElementById("content-categories-list"),this.categoryElement&&(this.categoryList=new DataList(this.categoryElement,{onComplete:function(t,e){Alerts.log("Finished loading category list.","info");}.bind(this)}));},t.prototype.create=function(t){t.preventDefault(),t.stopPropagation();var e=new ModalController({onComplete:function(){var t=document.getElementById("content-create-form");new Validator(t,{onComplete:function(t){Response.process(t,5e3),this.list&&this.list.reload(),t.success&&e.close();}.bind(this)});}.bind(this)});e.show($(t.currentTarget).attr("href"),this.element);},t.prototype.delete=function(t){t.preventDefault(),t.stopPropagation(),Alerts.confirm({title:"Are you sure?",html:"The content will be permanently removed."},function(e){e.isConfirmed&&Inline.post(t.currentTarget.href,t.currentTarget,function(e){Response.process(e,5e3),this.list&&this.list.reload(),t.currentTarget.dataset.redirect&&(Alerts.message("Just taking you back to the content list.","Redirecting..."),setTimeout((function(){window.location=t.currentTarget.dataset.redirect;}),1500));}.bind(this));}.bind(this));},t.prototype.setStatus=function(t){t.preventDefault(),t.stopPropagation(),Alerts.confirm({title:"Are you sure?",html:"The change will happen immediately."},function(e){e.isConfirmed&&Inline.post(t.currentTarget.href,t.currentTarget,function(t){Response.process(t,5e3),this.list&&this.list.reload();}.bind(this));}.bind(this));},t.prototype.clone=function(t){t.preventDefault(),t.stopPropagation(),Alerts.confirm({title:"Are you sure?",html:"This will duplicate the content and everything inside it."},function(e){e.isConfirmed&&Inline.post(t.currentTarget.href,t.currentTarget,function(t){Response.process(t,5e3),this.list&&this.list.reload();}.bind(this));}.bind(this));},t.prototype.createOrEditCategory=function(t){t.preventDefault(),t.stopPropagation();var e=new ModalController({onComplete:function(){var t=document.getElementById("content-categories-edit-form");new Validator(t,{onComplete:function(t){Response.process(t,5e3),this.list&&this.list.reload(),t.success&&(this.categoryList.reload(),e.close());}.bind(this)});}.bind(this)});e.show($(t.currentTarget).attr("href"),this.element);},t.prototype.deleteCategory=function(t){t.preventDefault(),t.stopPropagation(),Alerts.confirm({},function(e){e.isConfirmed&&Inline.post(t.currentTarget.href,t.currentTarget,function(t){Response.process(t,5e3),this.categoryList.reload();}.bind(this));}.bind(this));},t.prototype.toggleCategory=function(t){t.preventDefault(),t.stopPropagation(),$.post($(t.currentTarget).data("url"),{categoryId:$(t.currentTarget).val(),add:$(t.currentTarget).is(":checked")},function(t){Response.process(t,5e3),this.categoryList&&this.categoryList.reload();}.bind(this));},t.prototype.removeMedia=function(t){t.preventDefault(),t.stopPropagation(),Alerts.confirm({title:"Are you sure?",html:"The media will be removed from the property, but will still be in the media collection."},function(e){e.isConfirmed&&Inline.post(t.currentTarget.href,t.currentTarget,function(t){Response.process(t,5e3);var e=document.getElementById("content-gallery-list");e.hoodDataList&&e.hoodDataList.reload();}.bind(this));}.bind(this));},t}();var ContentTypeController=function(){function t(){this.manage(),$("body").on("click",".content-type-create",this.create.bind(this)),$("body").on("click",".content-type-delete",this.delete.bind(this)),$("body").on("click",".content-type-set-status",this.setStatus.bind(this)),$("body").on("click",".content-custom-field-create",this.createField.bind(this)),$("body").on("click",".content-custom-field-delete",this.deleteField.bind(this)),$("body").on("keyup","#Slug",(function(){var t=$(this).val();$(".slug-display").html(t);}));}return t.prototype.manage=function(){this.element=document.getElementById("content-type-list"),this.element&&(this.list=new DataList(this.element,{onComplete:function(t,e){Alerts.log("Finished loading content type list.","info");}.bind(this)})),this.fieldsElement=document.getElementById("content-custom-field-list"),this.fieldsElement&&(this.fieldsList=new DataList(this.fieldsElement,{onComplete:function(t,e){Alerts.log("Finished loading content type list.","info");}.bind(this)}));},t.prototype.create=function(t){t.preventDefault(),t.stopPropagation();var e=new ModalController({onComplete:function(){var t=document.getElementById("content-type-create-form");new Validator(t,{onComplete:function(t){Response.process(t,5e3),this.list&&this.list.reload(),t.success&&e.close();}.bind(this)});}.bind(this)});e.show($(t.currentTarget).attr("href"),this.element);},t.prototype.delete=function(t){t.preventDefault(),t.stopPropagation(),Alerts.confirm({title:"Are you sure?",html:"The content type will be permanently removed. Content will remain, but will be unusable and marked as the old content type."},function(e){e.isConfirmed&&Inline.post(t.currentTarget.href,t.currentTarget,function(e){Response.process(e,5e3),this.list&&this.list.reload(),t.currentTarget.dataset.redirect&&(Alerts.message("Just taking you back to the content list.","Redirecting..."),setTimeout((function(){window.location=t.currentTarget.dataset.redirect;}),1500));}.bind(this));}.bind(this));},t.prototype.setStatus=function(t){t.preventDefault(),t.stopPropagation(),Alerts.confirm({title:"Are you sure?",html:"The change will happen immediately."},function(e){e.isConfirmed&&Inline.post(t.currentTarget.href,t.currentTarget,function(t){Response.process(t,5e3),this.list&&this.list.reload();}.bind(this));}.bind(this));},t.prototype.createField=function(t){t.preventDefault(),t.stopPropagation();var e=new ModalController({onComplete:function(){var t=document.getElementById("content-custom-field-create-form");new Validator(t,{onComplete:function(t){Response.process(t,5e3),this.fieldsList&&this.fieldsList.reload(),t.success&&e.close();}.bind(this)});}.bind(this)});e.show($(t.currentTarget).attr("href"),this.element);},t.prototype.deleteField=function(t){t.preventDefault(),t.stopPropagation(),Alerts.confirm({title:"Are you sure?",html:"The field will be permanently removed. However fields will still be attached to content."},function(e){e.isConfirmed&&Inline.post(t.currentTarget.href,t.currentTarget,function(t){Response.process(t,5e3),this.fieldsList&&this.fieldsList.reload();}.bind(this));}.bind(this));},t}();var HomeController=function(){function t(){if($("#admin-chart-area").length){var t=this;t.LoadChart(),$("body").on("change","#history",(function(){t.LoadChart();}));}}return t.prototype.LoadChart=function(){var t=this;$.get("/admin/stats/",(function(o){$("#admin-chart-area").empty(),$("#admin-chart-area").html('<canvas id="admin-stats-chart"></canvas>'),t.LoadStats(o),t.DrawChart(o);}));},t.prototype.DrawChart=function(t){var o,e=[],a="#fabd07",r="#20c997",n="#fd7e14",s=[],i=[];t.content.months.forEach((function(t){i.push(t.value),s.push(t.key);})),e.push({label:"New Content",data:i,borderColor:a,backgroundColor:a,pointBackgroundColor:a,pointBorderColor:"#ffffff"}),i=[],t.users.months.forEach((function(t){i.push(t.value);})),e.push({label:"New Users",data:i,borderColor:n,backgroundColor:n,pointBackgroundColor:n,pointBorderColor:"#ffffff"}),i=[],t.properties.months.forEach((function(t){i.push(t.value);})),e.push({label:"New Properties",data:i,borderColor:r,backgroundColor:r,pointBackgroundColor:r,pointBorderColor:"#ffffff"}),o=s,this.canvas=document.getElementById("admin-stats-chart"),this.ctx=this.canvas.getContext("2d"),this.chart=new chart_js.Chart(this.ctx,{type:"bar",data:{labels:o,datasets:e},options:{responsive:!0,maintainAspectRatio:!1,scales:{ticks:{beginAtZero:!0}}}});},t.prototype.LoadStats=function(t){if(t.content&&($(".content-totalPosts").text(t.content.totalPosts),$(".content-totalPublished").text(t.content.totalPublished),t.content.byType))for(var o=0;o<t.content.byType.length;o++)$(".content-"+t.content.byType[o].name+"-total").text(t.content.byType[o].total);t.users&&($(".users-totalUsers").text(t.users.totalUsers),$(".users-totalAdmins").text(t.users.totalAdmins)),t.properties&&($(".properties-totalPosts").text(t.properties.totalProperties),$(".properties-totalPublished").text(t.properties.totalPublished));},t}();var LogsController=function(){this.element=document.getElementById("log-list"),this.element&&(this.list=new DataList(this.element,{onComplete:function(t,e){Alerts.log("Finished loading logs list.","info");}.bind(this)}));};var MediaController=function(){function i(){this.manage();}return i.prototype.manage=function(){this.list=document.getElementById("media-list"),this.service=new MediaService(this.list,{action:"show",onAction:function(i){Alerts.log("Showing media object id ".concat(i.id," - ").concat(i.filename));}.bind(this),onListLoad:function(){Alerts.log("Commencing media list fetch.");},onError:function(i,t,e){Alerts.log("Error loading media list: ".concat(t));},onListRender:function(i){return Alerts.log("Fetched media list data."),i},onListComplete:function(){Alerts.log("Finished loading media list...","info");}});},i}();var PropertyController=function(){function t(){this.manage(),$("body").on("click",".property-create",this.create.bind(this)),$("body").on("click",".property-delete",this.delete.bind(this)),$("body").on("click",".property-set-status",this.setStatus.bind(this)),$("body").on("click",".property-media-delete",this.removeMedia.bind(this)),$("body").on("click",".property-floorplan-delete",this.removeMedia.bind(this)),$("body").on("keyup","#Slug",(function(){var t=$(this).val();$(".slug-display").html(t);}));}return t.prototype.manage=function(){this.element=document.getElementById("property-list"),this.element&&(this.list=new DataList(this.element,{onComplete:function(t,e){Alerts.log("Finished loading property list.","info");}.bind(this)}));},t.prototype.create=function(t){t.preventDefault(),t.stopPropagation();var e=new ModalController({onComplete:function(){var t=document.getElementById("property-create-form");new Validator(t,{onComplete:function(t){Response.process(t,5e3),this.list&&this.list.reload(),t.success&&e.close();}.bind(this)});}.bind(this)});e.show($(t.currentTarget).attr("href"),this.element);},t.prototype.delete=function(t){t.preventDefault(),t.stopPropagation(),Alerts.confirm({title:"Are you sure?",html:"The property will be permanently removed."},function(e){e.isConfirmed&&Inline.post(t.currentTarget.href,t.currentTarget,function(e){Response.process(e,5e3),this.list&&this.list.reload(),t.currentTarget.dataset.redirect&&(Alerts.message("Just taking you back to the property list.","Redirecting..."),setTimeout((function(){window.location=t.currentTarget.dataset.redirect;}),1500));}.bind(this));}.bind(this));},t.prototype.setStatus=function(t){t.preventDefault(),t.stopPropagation(),Alerts.confirm({title:"Are you sure?",html:"The change will happen immediately."},function(e){e.isConfirmed&&Inline.post(t.currentTarget.href,t.currentTarget,function(t){Response.process(t,5e3),this.list&&this.list.reload();}.bind(this));}.bind(this));},t.prototype.removeMedia=function(t){t.preventDefault(),t.stopPropagation(),Alerts.confirm({title:"Are you sure?",html:"The media will be removed from the property, but will still be in the media collection."},function(e){e.isConfirmed&&Inline.post(t.currentTarget.href,t.currentTarget,function(t){Response.process(t,5e3);var e=document.getElementById("property-gallery-list");e.hoodDataList&&e.hoodDataList.reload();var o=document.getElementById("property-floorplan-list");o&&o.hoodDataList&&o.hoodDataList.reload();}.bind(this));}.bind(this));},t}();var PropertyImporter=function(){function r(){$("#import-property-start").length>0&&(this.update(),$("#import-property-start").click(function(){$.ajax({url:$("#import-property-start").data("url"),type:"POST",error:Inline.handleError,success:function(){this.update();}.bind(this)});}.bind(this)),$("#import-property-cancel").click(function(){$.ajax({url:$("#import-property-cancel").data("url"),type:"POST",error:Inline.handleError,success:function(){this.update();}.bind(this)});}.bind(this)));}return r.prototype.update=function(){$.ajax({url:$("#import-property-status").data("url"),type:"POST",error:Inline.handleError,success:function(r){r.importer.running?(this.showInfo(),clearInterval(this.updateInterval),this.updateInterval=window.setTimeout(this.update,250)):(clearInterval(this.updateInterval),this.hideInfo()),$(".tp").html(r.importer.total.toString()),$("#pu").html(r.importer.updated.toString()),$("#pa").html(r.importer.added.toString()),$("#pp").html(r.importer.processed.toString()),$("#pd").html(r.importer.deleted.toString()),$("#ToAdd").html(r.importer.toAdd.toString()),$("#ToUpdate").html(r.importer.toUpdate.toString()),$("#ToDelete").html(r.importer.toDelete.toString()),$("#pt").html(r.importer.statusMessage.toString());var t=Math.round(100*r.ftp.complete)/100;$("#fp").html(t.toString()),$("#ft").html(r.ftp.statusMessage);var e=Math.round(100*r.importer.complete)/100;if($(".pc").html(e.toString()),$("#progressbar").css({width:r.importer.complete+"%"}),r.importer.errors.length){for(var o="",p=r.importer.errors.length-1;p>=0;p--)o+='<div class="text-danger">'+r.importer.errors[p]+"</div>";$("#import-property-errors").html(o);}else $("#import-property-errors").html("<div>No errors reported.</div>");if(r.importer.warnings.length){for(var i="",n=r.importer.warnings.length-1;n>=0;n--)i+='<div class="text-warning">'+r.importer.warnings[n]+"</div>";$("#import-property-warnings").html(i);}else $("#import-property-warnings").html("<div>No warnings reported.</div>");}.bind(this)});},r.prototype.hideInfo=function(){$("#import-property-start").removeAttr("disabled"),$("#import-property-cancel").attr("disabled","disabled"),$("#import-property-progress").removeClass("d-block"),$("#import-property-progress").addClass("d-none");},r.prototype.showInfo=function(){$("#import-property-cancel").removeAttr("disabled"),$("#import-property-start").attr("disabled","disabled"),$("#import-property-progress").addClass("d-block"),$("#import-property-progress").removeClass("d-none");},r}();var ThemesController=function(){function e(){$("body").on("click",".activate-theme",this.activate.bind(this)),this.element=document.getElementById("themes-list"),this.element&&(this.list=new DataList(this.element,{onComplete:function(e,t){Alerts.log("Finished loading users list.","info");}.bind(this)}));}return e.prototype.activate=function(e){e.preventDefault(),e.stopPropagation(),Alerts.confirm({title:"Are you sure?",html:"The site will change themes, and the selected theme will be live right away."},function(t){t.isConfirmed&&Inline.post(e.currentTarget.href,e.currentTarget,function(e){Response.process(e,5e3),setTimeout(function(){this.list&&this.list.reload();}.bind(this),2e3);}.bind(this));}.bind(this));},e}();var UsersController=function(){function e(){this.initLists(),$("body").on("click",".user-create",this.create.bind(this)),$("body").on("click",".user-delete",this.delete.bind(this)),$("body").on("change","#user-create-form #GeneratePassword",this.generatePassword),$("body").on("change",".user-role-check",this.toggleUserRole),$("body").on("click",".user-reset-password",this.resetPassword),$("body").on("click",".user-notes-add",this.addNote.bind(this)),$("body").on("click",".user-notes-delete",this.deleteNote.bind(this));}return e.prototype.initLists=function(){this.element=document.getElementById("user-list"),this.element&&(this.list=new DataList(this.element,{onComplete:function(e,t){Alerts.log("Finished loading users list.","info");}.bind(this)})),this.notesEl=document.getElementById("user-notes"),this.notesEl&&(this.notesList=new DataList(this.notesEl,{onComplete:function(e,t){Alerts.log("Finished loading user notes list.","info");}.bind(this)}));},e.prototype.create=function(e){e.preventDefault(),e.stopPropagation();var t=new ModalController({onComplete:function(){var e=document.getElementById("user-create-form");new Validator(e,{onComplete:function(e){Response.process(e,5e3),this.list&&this.list.reload(),e.success&&t.close();}.bind(this)});}.bind(this)});t.show($(e.currentTarget).attr("href"),this.element);},e.prototype.delete=function(e){e.preventDefault(),e.stopPropagation(),Alerts.confirm({title:"Are you sure?",html:"The user will be permanently removed."},function(t){t.isConfirmed&&Inline.post(e.currentTarget.href,e.currentTarget,function(t){Response.process(t,5e3),this.list&&this.list.reload(),e.currentTarget.dataset.redirect&&(Alerts.message("Just taking you back to the content list.","Redirecting..."),setTimeout((function(){window.location=e.currentTarget.dataset.redirect;}),1500));}.bind(this));}.bind(this));},e.prototype.generatePassword=function(){if($(this).is(":checked")){var e=new RandomStringGenerator({numSpecial:1});$("#user-create-form #Password").val(e.generate(8)),$("#user-create-form #Password").attr("type","text");}else $("#user-create-form #Password").val(""),$("#user-create-form #Password").attr("type","password");},e.prototype.toggleUserRole=function(){$(this).is(":checked")?$.post($(this).data("url"),{role:$(this).val(),add:!0},(function(e){Response.process(e);})):$.post($(this).data("url"),{role:$(this).val(),add:!1},(function(e){Response.process(e);}));},e.prototype.resetPassword=function(e){e.preventDefault(),e.stopPropagation(),Alerts.prompt({title:"Reset Password",html:"Please enter a new password for the user...",preConfirm:function(e){return !1!==e&&(""===e?(swal__default["default"].showValidationMessage("You didn't supply a new password, we can't reset the password without it!"),!1):void 0)}},function(t){if(t.isDismissed)return !1;$.post(e.currentTarget.href,{password:t.value},(function(e){Response.process(e,5e3);}));}.bind(this));},e.prototype.addNote=function(e){e.preventDefault(),e.stopPropagation(),Alerts.prompt({title:"Add a note",html:"Enter and store a note about this user.",input:"textarea",preConfirm:function(e){return !1!==e&&(""===e?(swal__default["default"].showValidationMessage("You didn't enter a note!"),!1):void 0)}},function(t){if(t.isDismissed)return !1;$.post(e.currentTarget.href,{note:t.value},function(e){Response.process(e,5e3),this.notesList&&this.notesList.reload();}.bind(this));}.bind(this));},e.prototype.deleteNote=function(e){e.preventDefault(),e.stopPropagation(),Alerts.confirm({title:"Are you sure?",html:"The note will be permanently removed."},function(t){t.isConfirmed&&Inline.post(e.currentTarget.href,e.currentTarget,function(e){Response.process(e,5e3),this.notesList&&this.notesList.reload();}.bind(this));}.bind(this));},e}();var Admin=function(o){function r(){var r=o.call(this)||this;return r.editors=new Editors,r.colorPickers=new ColorPickers,r.mediaModal=new MediaModal,r.handlers.initDefaultHandlers(),r.home=new HomeController,r.media=new MediaController,r.content=new ContentController,r.contentType=new ContentTypeController,r.logs=new LogsController,r.property=new PropertyController,r.propertyImporter=new PropertyImporter,r.themes=new ThemesController,r.users=new UsersController,r.editors.richTextEditors(),r.colorPickers.loadColorPickers(),$("#page-tabs").length>0&&r.checkAndLoadTabs("#page-tabs"),$(".restrict-to-slug").restrictToSlug(),$(".restrict-to-page-slug").restrictToPageSlug(),$(".restrict-to-meta-slug").restrictToMetaSlug(),$(".character-counter").characterCounter(),$(".character-counter").trigger("change"),$(".warning-alert").warningAlert(),$(".mobile-sidebar-toggle").on("click",(function(){$("nav.sidebar").toggleClass("open");})),$(".right-sidebar-toggle").on("click",(function(){$("#right-sidebar").toggleClass("sidebar-open");})),$(".alert.auto-dismiss").fadeTo(5e3,500).slideUp(500,(function(){$(".alert.auto-dismiss").slideUp(500);})),r}return __extends(r,o),r.prototype.checkAndLoadTabs=function(o){$(o+' a[data-bs-toggle="tab"]').on("shown.bs.tab",(function(r){var e=JSON.parse(localStorage.getItem("tabs-"+o))||{};e["tab-"+$(o).data("hoodTabs")]=$(r.target).attr("href"),localStorage.setItem("tabs-"+o,JSON.stringify(e));}));var r=(JSON.parse(localStorage.getItem("tabs-"+o))||{})["tab-"+$(o).data("hoodTabs")],e=$(o+' a[data-bs-toggle="tab"]')[0];r&&(e=document.querySelector(o+' a[href="'+r+'"]')),new bootstrap__namespace.Tab(e).show();},r}(HoodApi);window.hood=new Admin;}));
|
|
24
24
|
if (typeof this !== 'undefined' && this.hood){ this.hoodCMS = this.Hood = this.hoodCMS = this.HoodCMS = this.hood }
|
package/dist/js/app.js
CHANGED
package/dist/js/app.property.js
CHANGED
package/dist/js/core/Editors.js
CHANGED
|
@@ -41,9 +41,9 @@ export class Editors {
|
|
|
41
41
|
plugins: [
|
|
42
42
|
'advlist autolink lists link image charmap print preview anchor media',
|
|
43
43
|
'searchreplace visualblocks code fullscreen',
|
|
44
|
-
'insertdatetime media contextmenu paste
|
|
44
|
+
'insertdatetime media contextmenu paste textcolor'
|
|
45
45
|
],
|
|
46
|
-
toolbar: "fullscreen | styleselect forecolor backcolor | hoodimage link media image | bold italic | alignleft aligncenter alignright | bullist numlist | table | undo redo",
|
|
46
|
+
toolbar: "fullscreen code | styleselect forecolor backcolor | hoodimage link media image | bold italic | alignleft aligncenter alignright | bullist numlist | table | undo redo",
|
|
47
47
|
link_class_list: this.options.linkClasses,
|
|
48
48
|
image_class_list: this.options.imageClasses,
|
|
49
49
|
setup: this.setupCommands.bind(this),
|
|
@@ -74,9 +74,9 @@ export class Editors {
|
|
|
74
74
|
plugins: [
|
|
75
75
|
'advlist autolink lists link image charmap print preview anchor media',
|
|
76
76
|
'searchreplace visualblocks code fullscreen',
|
|
77
|
-
'insertdatetime media contextmenu paste
|
|
77
|
+
'insertdatetime media contextmenu paste textcolor'
|
|
78
78
|
],
|
|
79
|
-
toolbar: "fullscreen | styleselect forecolor backcolor | hoodimage link media image | bold italic | alignleft aligncenter alignright | bullist numlist | table | undo redo",
|
|
79
|
+
toolbar: "fullscreen code | styleselect forecolor backcolor | hoodimage link media image | bold italic | alignleft aligncenter alignright | bullist numlist | table | undo redo",
|
|
80
80
|
link_class_list: this.options.linkClasses,
|
|
81
81
|
image_class_list: this.options.imageClasses,
|
|
82
82
|
setup: this.setupCommands.bind(this),
|
|
@@ -88,7 +88,7 @@ export class Editors {
|
|
|
88
88
|
plugins: [
|
|
89
89
|
'advlist autolink lists link image charmap print preview anchor media',
|
|
90
90
|
'searchreplace visualblocks code fullscreen',
|
|
91
|
-
'insertdatetime media contextmenu paste
|
|
91
|
+
'insertdatetime media contextmenu paste'
|
|
92
92
|
],
|
|
93
93
|
menubar: false,
|
|
94
94
|
toolbar: 'fullscreen | bold italic | bullist numlist | undo redo | link',
|
package/dist/js/login.js
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hoodcms",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.12",
|
|
4
4
|
"description": "A fully customisable content management system built in ASP.NET Core 5 & Bootstrap 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hood",
|
|
7
7
|
"hoodcms",
|
|
8
8
|
"visual-studio",
|
|
9
9
|
"netcore",
|
|
10
|
-
"
|
|
10
|
+
"net6.0",
|
|
11
11
|
"efcore",
|
|
12
12
|
"ef",
|
|
13
13
|
"dotnet",
|
package/src/js/admin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* hoodcms v6.0.
|
|
2
|
+
* hoodcms v6.0.12
|
|
3
3
|
* A fully customisable content management system built in ASP.NET Core 5 & Bootstrap 5.
|
|
4
4
|
* Written by George Whysall, 2022
|
|
5
5
|
* Released under the GPL-3.0 License.
|
|
@@ -1036,9 +1036,9 @@
|
|
|
1036
1036
|
plugins: [
|
|
1037
1037
|
'advlist autolink lists link image charmap print preview anchor media',
|
|
1038
1038
|
'searchreplace visualblocks code fullscreen',
|
|
1039
|
-
'insertdatetime media contextmenu paste
|
|
1039
|
+
'insertdatetime media contextmenu paste textcolor'
|
|
1040
1040
|
],
|
|
1041
|
-
toolbar: "fullscreen | styleselect forecolor backcolor | hoodimage link media image | bold italic | alignleft aligncenter alignright | bullist numlist | table | undo redo",
|
|
1041
|
+
toolbar: "fullscreen code | styleselect forecolor backcolor | hoodimage link media image | bold italic | alignleft aligncenter alignright | bullist numlist | table | undo redo",
|
|
1042
1042
|
link_class_list: this.options.linkClasses,
|
|
1043
1043
|
image_class_list: this.options.imageClasses,
|
|
1044
1044
|
setup: this.setupCommands.bind(this),
|
|
@@ -1069,9 +1069,9 @@
|
|
|
1069
1069
|
plugins: [
|
|
1070
1070
|
'advlist autolink lists link image charmap print preview anchor media',
|
|
1071
1071
|
'searchreplace visualblocks code fullscreen',
|
|
1072
|
-
'insertdatetime media contextmenu paste
|
|
1072
|
+
'insertdatetime media contextmenu paste textcolor'
|
|
1073
1073
|
],
|
|
1074
|
-
toolbar: "fullscreen | styleselect forecolor backcolor | hoodimage link media image | bold italic | alignleft aligncenter alignright | bullist numlist | table | undo redo",
|
|
1074
|
+
toolbar: "fullscreen code | styleselect forecolor backcolor | hoodimage link media image | bold italic | alignleft aligncenter alignright | bullist numlist | table | undo redo",
|
|
1075
1075
|
link_class_list: this.options.linkClasses,
|
|
1076
1076
|
image_class_list: this.options.imageClasses,
|
|
1077
1077
|
setup: this.setupCommands.bind(this),
|
|
@@ -1083,7 +1083,7 @@
|
|
|
1083
1083
|
plugins: [
|
|
1084
1084
|
'advlist autolink lists link image charmap print preview anchor media',
|
|
1085
1085
|
'searchreplace visualblocks code fullscreen',
|
|
1086
|
-
'insertdatetime media contextmenu paste
|
|
1086
|
+
'insertdatetime media contextmenu paste'
|
|
1087
1087
|
],
|
|
1088
1088
|
menubar: false,
|
|
1089
1089
|
toolbar: 'fullscreen | bold italic | bullist numlist | undo redo | link',
|