PageSourceSearch

https://www.dpartmnt.com.au/static/build/chunk-editing-edit-textarea.c35d7e6efb77d534.build.js

js dpartmnt.com.au collected 2026-10-04 23:42:03 UTC 8,620 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkkms=self.webpackChunkkms||[]).push([[3992,4072,4729,9697],{65641(e,t,s){s.d(t,{FB:()=>l,hq:()=>a,oO:()=>o});var i=s(85804),n=s(28974),r=["/vendor/ckeditor/plugins/kmsgallery/styles/gallery.css","/static/build/css/kms_css.css"];class o{constructor(e){this.element=e,this.editorReady=!1,this.loadTasks=[],e.classList.contains("rich-text-full-uploads")?(this._mode="full",this._secure_uploads=!0):e.classList.contains("rich-text-full")?(this._mode="full",this._secure_uploads=!1):e.classList.contains("rich-text-basic")?(this._mode="form",this._secure_uploads=!1):(this._mode=this.element.dataset.editorMode||"full",this._uploads=this.element.hasAttribute("data-editor-uploads")),this._secure_uploads=this.element.hasAttribute("data-editor-secure-uploads"),(0,i.u)().then(e=>{this.csrf_token=e,this.initialise()})}initialise(){this.loadTasks.forEach(e=>e())}get uploads(){return this._uploads}get secure_uploads(){return this._secure_uploads}set secure_uploads(e){this._secure_uploads=e}get mode(){return this._mode}getData(){return this.element.value}getHTML(){return this.element.value}setContent(e,t){this.editorReady?(this.element.style.display="none",this.setEditorContent(e,t)):this.loadTasks.push(()=>{this.element.style.display="none",this.setEditorContent(e,t)})}setEditorContent(){throw new Error("Child class must implement the method setEditorContent!")}destroy(){this.element.style.display=null,this.removeEditor()}removeEditor(){throw new Error("Child class must implement the method removeEditor!")}}class l{constructor(e,t){this.element=e,this.element.style.display="none",this.editorType=t,this.is_inline=!1,this.initialise()}getStyleSheetUrls(){var e=r;return this.element.dataset.editorStylesUrl?e.push(this.element.dataset.editorStylesUrl):e.push("/app/css/editor.css"),e}initialise(){this.createWrapper(),(0,n.R)(this.wrap.id,this.getStyleSheetUrls(),this.createEditor.bind(this))}createEditor(){this.editor=new this.editorType(this.element,this),this.editor.setContent(this.element.value,()=>{this.loader.remove()}),this.element.form.addEventListener("submit",()=>{this.element.value=this.editor.getData()})}createWrapper(){this.wrap||(this.wrap=document.createElement("div"),this.wrap.classList.add("console-edit-wrap"),this.wrap.id=Date.now().toString(36)+Math.random().toString(36).substring(2),this.element.parentNode.insertBefore(this.wrap,this.element),this.wrap.appendChild(this.element),this.editor_el=document.createElement("div"),this.wrap.appendChild(this.editor_el),this.loader=document.createElement("div"),this.loader.classList.add("light-bg
1-loader"),this.wrap.appendChild(this.loader))}}class a{constructor(e,t,s){this.element=e,this.editorType=t,this.editing=!1,this.is_inline=!0,this.content_processor=s,this.initialise()}getStyleSheetUrls(){return r}initialise(){this.wrapperHoverOn=this.wrapperHoverOn.bind(this),this.wrapperHoverOff=this.wrapperHoverOff.bind(this),this.edit=this.edit.bind(this),this.save=this.save.bind(this),this.cancel=this.cancel.bind(this),this.closeEdit=this.closeEdit.bind(this),this.createWrapper(),(0,n.R)(this.wrap.id,this.getStyleSheetUrls())}wrapperHoverOn(){this.editing||(this.wrap.style.boxShadow="0px 0px 10px 0px #000000",this.editControls.style.opacity=1)}wrapperHoverOff(){this.editing||(this.wrap.style.boxShadow="none",this.editControls.style.opacity=0)}createWrapper(){this.wrap||(this.wrap=document.createElement("div"),this.wrap.id=Date.now().toString(36)+Math.random().toString(36).substring(2),this.wrap.classList.add("inline-edit-wrap"),this.element.parentNode.insertBefore(this.wrap,this.element),this.wrap.appendChild(this.element),this.wrap.insertAdjacentHTML("beforeend",'<div class=\'inline-edit-controls\'><span class="edit"><img alt="editor edit icon" src="/static/frontend/img/edit.svg"/></span><span class="save" style="display:none">Save</span> <span class="cancel" style="display:none">Cancel</span></div>'),this.editControls=this.wrap.querySelector(".inline-edit-controls"),this.wrap.querySelector(".inline-edit-controls .edit").addEventListener("click",this.edit),this.wrap.querySelector(".inline-edit-controls .save").addEventListener("click",this.save),this.wrap.querySelector(".inline-edit-controls .cancel").addEventListener("click",this.cancel),this.wrap.addEventListener("mouseenter",this.wrapperHoverOn),this.wrap.addEventListener("mouseleave",this.wrapperHoverOff))}displayEditUI(){this.wrap.style.boxShadow="0px 0px 10px 0px #000000",this.editControls.style.opacity=1,this.editControls.querySelector(".edit").style.display="none",this.editControls.querySelector(".save").style.display="inline",this.editControls.querySelector(".cancel").style.display="inline"}hideEditUI(){this.wrap.style.boxShadow="none",this.editControls.style.opacity=0,this.element.contentEditable="false",this.editControls.querySelector(".edit").style.display="inline",this.editControls.querySelector(".save").style.display="none",this.editControls.querySelector(".cancel").style.display="none"}cancel(){this.closeEdit(),this.element.innerHTML=this.element.origHTML,this.content_processor(this.element)}closeEdit(){this.wrap.querySelector(".inline-edit-save")&&this.wrap.querySelector(".inline-edit-save").remove(),this.editor.destroy(),this.hideEditUI(),this.wrap.style.boxShadow="0px 0px 10px 0px #00cc00",setTimeout(()=>{this.wrap.style.boxShadow="none"},1e3),this.editing=!1}get content_url(){return`/console/content/${this.element.dataset.content_type}/update/${this.element.dataset.id}`}edit(){this.editing=!0,this.element.origHTML=this.element.innerHTML,this.displayEditUI(),fetch(this.content_url,{method:"get",headers:{Accept:"application/json"}}).then(e=>{if(e.ok)return e.json();throw new Error("Something went wrong")}).then(e=>{let t=e.content_version.content,s=e.content_version.content_src||t;this.edit_content_loaded(t,s)}).catch(function(e){console.log(e),alert("error loading content, please try again")})}save(){let e=new FormData;e.append("content_src",this.editor.getData()),e.append("content",this.editor.getHTML()),e.append("editor",this.element.dataset.editor),fetch(this.content_url,{method:"post",body:e,headers:{Accept:"application/json","X-CSRF":this.editor.csrf_token}}).then(e=>{if(e.ok)return e.json();throw new Error("Something went wrong")}).then(e=>{this.closeEdit(),this.element.innerHTML=e.processed_content,this.element.origsrc=e.content,this.content_processor(this.element)}).catch(function(e){console.log(e),alert("error saving content, please try again")})}edit_content_loaded(e,t){this.editor=new this.editorType(this.element,this),this.editor.setContent(t),console.debug(e,t)}}},70190(e,t,s){s.d(t,{EditorTextarea:()=>n});var i=s(65641);class n extends i.oO{constructor(e){super(e),this.element.style.display="none",this.editorEl=document.createElement("textarea"),this.editorEl.classList.add("editor-textarea"),this.editorEl.classList.add("form-control"),this.element.insertAdjacentElement("afterend",this.editorEl)}setEditorContent(e){this.editorEl.value=e}getData(){return this.editorEl.value}getHTML(){return this.editorEl.value}removeEditor(){this.element.style.display=null,this.editorEl.remove()}}},28974(e,t,s){function i(e,t){if(e instanceof CSSStyleRule){var s=e.selectorText.split(",").map(e=>function(e,t){var s=e.split(" ");return e.startsWith(":root")?s[0]="#"+t:s.unshift("#"+t),(s=s.filter(e=>
1!e.match(/^(html|body)$/i))).join(" ")}(e,t));return s.join(", ")+" {"+e.style.cssText+"}\r\n"}if(e instanceof CSSMediaRule){var n=[...e.cssRules].map(e=>i(e,t));return"@media "+e.media.mediaText+" {"+n.join(" ")+"}"}if(e instanceof CSSFontFaceRule)return e.cssText}s.d(t,{R:()=>o});let n=0;function r(e,t,s){var r=document.createElement("link");function o(){var t=r.sheet;if(t.cssRules){var o=[...t.cssRules].map(t=>i(t,e)).join(" ");r.remove();var l=document.createElement("style");l.innerHTML=o,l.id=e+"-"+n+"-styles",n++,document.head.appendChild(l)}document.getElementById(e).clientHeight,s&&s()}r.setAttribute("rel","stylesheet"),r.setAttribute("type","text/css"),r.setAttribute("media","(max-width: 0)"),r.setAttribute("href",t),r.setAttribute("crossorigin","anonymous"),document.head.appendChild(r),r.onload=o,r.onerror=function(){o(),alert("Error loading editor stylesheet. The editor display may not be correct."),console.error("Error loading stylesheet '"+t+"'.")}}function o(e,t,s){if(document.getElementById(e)){for(var i=s,n=t.length-1;n>0;n--)i=o(n,i);r(e,t[0],i)}else console.error("Element with ID '"+e+"' not found.");function o(s,i){return()=>{r(e,t[s],i)}}}}}]);
2//# sourceMappingURL=chunk-editing-edit-textarea.c35d7e6efb77d534.build.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.