-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
16 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
const t=window.location.pathname;document.addEventListener("DOMContentLoaded",(function(){var t=document.title;t=t.split("-",1),document.getElementById("page-title").innerText=t,"분리ㅅㄱ"==t&&(document.getElementById("navbar-mobile-arrow").style.display="none",document.getElementById("page-title").innerText="🪴")})),document.body.addEventListener("htmx:configRequest",(function(t){if(t.detail.headers.accept="text/html-partial","get"!==t.detail.verb){const e=document.querySelector("meta[name='_csrf_header']").getAttribute("content");t.detail.headers[e]=document.querySelector("meta[name='_csrf']").getAttribute("content")}})),("/"===t||t.startsWith("/dictionary"))&&import("./dictionary/algolia.mjs").then((t=>{t.init()})),t.startsWith("/community/")&&(import("./community/editorjs.umd.min.js").then((()=>{import("./community/editor.mjs").then((t=>{t.init()}))})),import("./community/jquery.timeago.min.js").then((()=>{import("./community/time-ago.mjs").then((t=>{t.init()}))}))),t.startsWith("/community/write")&&import("./community/post-color-changer.mjs").then((t=>{t.init()})); | ||
const t=window.location.pathname;if(document.addEventListener("DOMContentLoaded",(function(){var t=document.title;t=t.split("-",1),document.getElementById("page-title").innerText=t,"분리ㅅㄱ"==t&&(document.getElementById("navbar-mobile-arrow").style.display="none",document.getElementById("page-title").innerText="🪴")})),document.body.addEventListener("htmx:configRequest",(function(t){if(t.detail.headers.accept="text/html-partial","get"!==t.detail.verb){const e=document.querySelector("meta[name='_csrf_header']").getAttribute("content");t.detail.headers[e]=document.querySelector("meta[name='_csrf']").getAttribute("content")}})),("/"===t||t.startsWith("/dictionary"))&&import("./dictionary/algolia.mjs").then((t=>{t.init()})),t.startsWith("/community/")){let e=!t.endsWith("write");import("./community/editorjs.umd.min.js").then((()=>{import("./community/editor.mjs").then((t=>{t.init(e)}))})),import("./community/jquery.timeago.min.js").then((()=>{import("./community/time-ago.mjs").then((t=>{t.init()}))}))}t.startsWith("/community/write")&&import("./community/post-color-changer.mjs").then((t=>{t.init()})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
import e from"https://cdn.jsdelivr.net/npm/@editorjs/attaches/+esm";import t from"https://cdn.jsdelivr.net/npm/@editorjs/checklist/+esm";import n from"https://cdn.jsdelivr.net/npm/@editorjs/code/+esm";import o from"https://cdn.jsdelivr.net/npm/@editorjs/delimiter/+esm";import r from"https://cdn.jsdelivr.net/npm/@editorjs/embed/+esm";import i from"https://cdn.jsdelivr.net/npm/@editorjs/header/+esm";import d from"https://cdn.jsdelivr.net/npm/@editorjs/image/+esm";import s from"https://cdn.jsdelivr.net/npm/@editorjs/inline-code/+esm";import l from"https://cdn.jsdelivr.net/npm/@editorjs/link/+esm";import a from"https://cdn.jsdelivr.net/npm/@editorjs/list/+esm";import c from"https://cdn.jsdelivr.net/npm/@editorjs/marker/+esm";import m from"https://cdn.jsdelivr.net/npm/@editorjs/quote/+esm";import p from"https://cdn.jsdelivr.net/npm/@editorjs/raw/+esm";import u from"https://cdn.jsdelivr.net/npm/@editorjs/table/+esm";import h from"https://cdn.jsdelivr.net/npm/@editorjs/warning/+esm";export function init(){document.addEventListener("htmx:afterSwap",(function(){let f=document.getElementById("form").getAttribute("data-content"),g="true"===document.getElementById("form").getAttribute("data-edit"),v=(document.querySelector("meta[name='_csrf_header']").getAttribute("content"),document.querySelector("meta[name='_csrf']").getAttribute("content")),j=new EditorJS({holder:"editorjs",readOnly:g,tools:{checklist:{class:t,inlineToolbar:!0},code:{class:n,shortcut:"CMD+SHIFT+D"},delimiter:o,embed:r,header:{class:i,inlineToolbar:["link"],config:{placeholder:"Header"},shortcut:"CMD+SHIFT+H"},image:{class:d,config:{field:"file",additionalRequestHeaders:{"X-XSRF-TOKEN":v},endpoints:{byFile:"/api/editor/upload/file",byUrl:"/api/editor/upload/url"}}},attaches:{class:e,config:{field:"file",additionalRequestHeaders:{"X-XSRF-TOKEN":v},endpoint:"/api/editor/upload/file"}},inlineCode:{class:s,shortcut:"CMD+SHIFT+M"},linkTool:{class:l,additionalRequestHeaders:{"X-XSRF-TOKEN":v},config:{endpoint:"/api/editor/link-preview"}},list:{class:a,inlineToolbar:!0},marker:{class:c,shortcut:"CMD+SHIFT+M"},quote:{class:m,inlineToolbar:!0},raw:p,table:{class:u,inlineToolbar:!0},warning:h},onReady:function(){var e=JSON.parse(f);null!=e?j.render(e):(f=function(e){for(var t=e+"=",n=document.cookie.split(";"),o=0;o<n.length;o++){for(var r=n[o];" "==r.charAt(0);)r=r.substring(1,r.length);if(0==r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}return null}("editorjsContentBackup"),null!=f&&(e=JSON.parse(f),j.render(e)))},onChange:function(){j.save().then((function(e){!function(e,t,n){var o="";if(n){var r=new Date;r.setTime(r.getTime()+60*n*1e3),o="; expires="+r.toUTCString()}document.cookie=e+"="+encodeURIComponent(t||"")+o+"; path=/"}("editorjsContentBackup",JSON.stringify(e),1)})).catch((function(e){console.error("Saving error",e)}))},rendered:function(){},i18n:{messages:{ui:{blockTunes:{toggler:{"Click to tune":"옵션 확장","or drag to move":"또는 드래그하여 이동"}},inlineToolbar:{converter:{"Convert to":"변환하기"}},toolbar:{toolbox:{Add:"추가"}},popover:{Filter:"필터","Nothing found":"찾을 수 없습니다"}},toolNames:{Text:"텍스트",Heading:"제목",List:"리스트",Warning:"경고",Checklist:"체크리스트",Quote:"인용문",Code:"코드",Delimiter:"구분선","Raw HTML":"HTML",Table:"테이블",Link:"링크",Marker:"마커",Bold:"굵게",Italic:"기울임",InlineCode:"인라인 코드",Image:"이미지",Attachment:"첨부"},tools:{warning:{Title:"제목",Message:"메시지"},link:{"Add a link":"링크 추가"},stub:{"The block can not be displayed correctly.":"블록을 올바르게 표시할 수 없습니다."},image:{Caption:"캡션","Select an Image":"이미지 선택","With border":"테두리 추가","Stretch image":"이미지 확장","With background":"배경 추가"},code:{"Enter a code":"코드를 입력하세요"},linkTool:{Link:"링크","Couldn't fetch the link data":"링크 데이터를 가져올 수 없습니다","Couldn't get this link data, try the other one":"이 링크 데이터를 가져올 수 없습니다. 다른 링크를 시도하세요","Wrong response format from the server":"서버로부터 잘못된 응답 형식"},header:{Header:"헤딩"},paragraph:{"Enter something":"내용을 입력하세요"},list:{Ordered:"번호",Unordered:"글머리"},quote:{"Enter a quote":"인용절 입력","Enter a caption":"캡션 입력"},attachment:{"File upload failed":"파일을 올리지 못했습니다","Select file to upload":"파일을 선택하여 업로드"},table:{"With headings":"헤딩 추가","Without headings":"헤딩 삭제"}},blockTunes:{delete:{Delete:"삭제","Click to delete":"클릭하여 삭제"},moveUp:{"Move up":"위로 이동"},moveDown:{"Move down":"아래로 이동"}}}}}),b=document.getElementById("save-button");null!=b&&b.addEventListener("click",(function(){j.save().then((e=>{document.getElementById("editorjs-content").value=JSON.stringify(e,null,0)})).catch((e=>{console.error("Saving error",e)}))}))}))} | ||
import e from"https://cdn.jsdelivr.net/npm/@editorjs/attaches/+esm";import t from"https://cdn.jsdelivr.net/npm/@editorjs/checklist/+esm";import n from"https://cdn.jsdelivr.net/npm/@editorjs/code/+esm";import o from"https://cdn.jsdelivr.net/npm/@editorjs/delimiter/+esm";import r from"https://cdn.jsdelivr.net/npm/@editorjs/embed/+esm";import i from"https://cdn.jsdelivr.net/npm/@editorjs/header/+esm";import d from"https://cdn.jsdelivr.net/npm/@editorjs/image/+esm";import l from"https://cdn.jsdelivr.net/npm/@editorjs/inline-code/+esm";import s from"https://cdn.jsdelivr.net/npm/@editorjs/link/+esm";import a from"https://cdn.jsdelivr.net/npm/@editorjs/list/+esm";import m from"https://cdn.jsdelivr.net/npm/@editorjs/marker/+esm";import c from"https://cdn.jsdelivr.net/npm/@editorjs/quote/+esm";import p from"https://cdn.jsdelivr.net/npm/@editorjs/raw/+esm";import u from"https://cdn.jsdelivr.net/npm/@editorjs/table/+esm";import h from"https://cdn.jsdelivr.net/npm/@editorjs/warning/+esm";export function init(e){let t=document.querySelector("meta[name='_csrf']").getAttribute("content"),n=setInterval((function(){document.getElementById("editorjs")&&(f(e,t),document.addEventListener("htmx:afterSwap",(function(){f(e,t)})),clearInterval(n))}),10)}function f(f,g){let v=new EditorJS({holder:"editorjs",readOnly:f,tools:{checklist:{class:t,inlineToolbar:!0},code:{class:n,shortcut:"CMD+SHIFT+D"},delimiter:o,embed:r,header:{class:i,inlineToolbar:["link"],config:{placeholder:"Header"},shortcut:"CMD+SHIFT+H"},image:{class:d,config:{field:"file",additionalRequestHeaders:{"X-XSRF-TOKEN":g},endpoints:{byFile:"/api/editor/upload/file",byUrl:"/api/editor/upload/url"}}},attaches:{class:e,config:{field:"file",additionalRequestHeaders:{"X-XSRF-TOKEN":g},endpoint:"/api/editor/upload/file"}},inlineCode:{class:l,shortcut:"CMD+SHIFT+M"},linkTool:{class:s,additionalRequestHeaders:{"X-XSRF-TOKEN":g},config:{endpoint:"/api/editor/link-preview"}},list:{class:a,inlineToolbar:!0},marker:{class:m,shortcut:"CMD+SHIFT+M"},quote:{class:c,inlineToolbar:!0},raw:p,table:{class:u,inlineToolbar:!0},warning:h},onReady:function(){let e=document.getElementById("form").getAttribute("data-content"),t=JSON.parse(e);null!=t?v.render(t):null!=e&&(t=JSON.parse(e),v.render(t))},onChange:function(){1!=f&&v.save().then((function(e){})).catch((function(e){console.error("Saving error",e)}))},rendered:function(){},i18n:{messages:{ui:{blockTunes:{toggler:{"Click to tune":"옵션 확장","or drag to move":"또는 드래그하여 이동"}},inlineToolbar:{converter:{"Convert to":"변환하기"}},toolbar:{toolbox:{Add:"추가"}},popover:{Filter:"필터","Nothing found":"찾을 수 없습니다"}},toolNames:{Text:"텍스트",Heading:"제목",List:"리스트",Warning:"경고",Checklist:"체크리스트",Quote:"인용문",Code:"코드",Delimiter:"구분선","Raw HTML":"HTML",Table:"테이블",Link:"링크",Marker:"마커",Bold:"굵게",Italic:"기울임",InlineCode:"인라인 코드",Image:"이미지",Attachment:"첨부"},tools:{warning:{Title:"제목",Message:"메시지"},link:{"Add a link":"링크 추가"},stub:{"The block can not be displayed correctly.":"블록을 올바르게 표시할 수 없습니다."},image:{Caption:"캡션","Select an Image":"이미지 선택","With border":"테두리 추가","Stretch image":"이미지 확장","With background":"배경 추가"},code:{"Enter a code":"코드를 입력하세요"},linkTool:{Link:"링크","Couldn't fetch the link data":"링크 데이터를 가져올 수 없습니다","Couldn't get this link data, try the other one":"이 링크 데이터를 가져올 수 없습니다. 다른 링크를 시도하세요","Wrong response format from the server":"서버로부터 잘못된 응답 형식"},header:{Header:"헤딩"},paragraph:{"Enter something":"내용을 입력하세요"},list:{Ordered:"번호",Unordered:"글머리"},quote:{"Enter a quote":"인용절 입력","Enter a caption":"캡션 입력"},attachment:{"File upload failed":"파일을 올리지 못했습니다","Select file to upload":"파일을 선택하여 업로드"},table:{"With headings":"헤딩 추가","Without headings":"헤딩 삭제"}},blockTunes:{delete:{Delete:"삭제","Click to delete":"클릭하여 삭제"},moveUp:{"Move up":"위로 이동"},moveDown:{"Move down":"아래로 이동"}}}}}),j=document.getElementById("save-button");return null!=j&&j.addEventListener("click",(function(){v.save().then((e=>{document.getElementById("editorjs-content").value=JSON.stringify(e,null,0)})).catch((e=>{console.error("Saving error",e)}))})),v} |
2 changes: 1 addition & 1 deletion
2
app/src/main/resources/static/assets/js/community/post-color-changer.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export function init(){let t=document.getElementById("post-color"),e=document.querySelector(".card");null!=t&&t.addEventListener("input",(function(){e.style.backgroundColor=this.value}))} | ||
export function init(){document.addEventListener("htmx:afterSwap",(function(){let t=document.getElementById("post-color"),e=document.querySelector(".card");null!=t&&t.addEventListener("input",(function(){e.style.backgroundColor=this.value}))}))} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.