From 2175abbc80f7585db6d9fd05a750949f269c9684 Mon Sep 17 00:00:00 2001 From: lunaticbum Date: Fri, 21 Mar 2025 17:15:55 +0900 Subject: [PATCH] ... --- build.gradle.kts | 2 + .../lunaticbum/back/lun/configs/AppConfig.kt | 9 +- .../back/lun/configs/BumsInterceptor.kt | 5 + .../back/lun/controllers/BlogController.kt | 130 +++++++++++------- .../kr/lunaticbum/back/lun/model/Post.kt | 1 + .../back/lun/model/ResponceResult.kt | 1 + src/main/resources/static/assets/css/main.css | 55 ++++++++ src/main/resources/static/css/blog.css | 6 +- src/main/resources/static/css/common.css | 2 +- src/main/resources/static/js/blog.js | 4 +- src/main/resources/static/js/common.js | 104 +++++++++++++- .../templates/content/blog/editor.html | 43 +++--- .../templates/content/blog/posts.html | 45 ++---- .../templates/content/blog/viewer.html | 14 +- .../resources/templates/content/home.html | 9 +- .../resources/templates/content/licenses.html | 12 +- .../resources/templates/fragments/header.html | 14 +- .../templates/layout/default_layout.html | 20 +++ 18 files changed, 341 insertions(+), 135 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 4df0e68..753ea36 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -56,6 +56,8 @@ dependencies { implementation ("org.seleniumhq.selenium:selenium-java:4.10.0") implementation ("org.commonmark:commonmark:0.18.0") + implementation ("net.coobird:thumbnailator:0.4.14") + implementation ("com.drewnoakes:metadata-extractor:2.19.0") implementation("org.springframework.boot:spring-boot-starter-security") diff --git a/src/main/kotlin/kr/lunaticbum/back/lun/configs/AppConfig.kt b/src/main/kotlin/kr/lunaticbum/back/lun/configs/AppConfig.kt index 71c4208..8af2989 100644 --- a/src/main/kotlin/kr/lunaticbum/back/lun/configs/AppConfig.kt +++ b/src/main/kotlin/kr/lunaticbum/back/lun/configs/AppConfig.kt @@ -1,12 +1,12 @@ package kr.lunaticbum.back.lun.configs -import io.qdrant.client.QdrantClient -import org.springframework.ai.ollama.api.OllamaApi import org.springframework.beans.factory.annotation.Value import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration +import org.springframework.http.CacheControl import org.springframework.web.servlet.config.annotation.InterceptorRegistry import org.springframework.web.servlet.config.annotation.WebMvcConfigurer +import java.time.Duration @Configuration @@ -17,12 +17,15 @@ class AppConfig : WebMvcConfigurer { @Value("\${resource.location}") private val resourceLocation: String? = null + val cacheControl: CacheControl = CacheControl.maxAge(Duration.ofDays(365)) + @Bean fun authInterceptor(): BumsInterceptor { return BumsInterceptor() } override fun addResourceHandlers(registry: org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry) { - registry.addResourceHandler(resourceHandler).addResourceLocations(resourceLocation) + + registry.addResourceHandler(resourceHandler).addResourceLocations(resourceLocation).setCacheControl(cacheControl) } override fun addInterceptors(registry: InterceptorRegistry) { diff --git a/src/main/kotlin/kr/lunaticbum/back/lun/configs/BumsInterceptor.kt b/src/main/kotlin/kr/lunaticbum/back/lun/configs/BumsInterceptor.kt index 0b9a8b2..88421a2 100644 --- a/src/main/kotlin/kr/lunaticbum/back/lun/configs/BumsInterceptor.kt +++ b/src/main/kotlin/kr/lunaticbum/back/lun/configs/BumsInterceptor.kt @@ -4,6 +4,9 @@ import com.google.gson.Gson import jakarta.servlet.http.Cookie import jakarta.servlet.http.HttpServletRequest import jakarta.servlet.http.HttpServletResponse +import kr.lunaticbum.back.lun.configs.GlobalEnvironment.Companion.ApiKeyWordKey +import kr.lunaticbum.back.lun.configs.GlobalEnvironment.Companion.EncType11 +import kr.lunaticbum.back.lun.configs.GlobalEnvironment.Companion.EncTypeKey import kr.lunaticbum.back.lun.model.UserManager import kr.lunaticbum.back.lun.service.JwtService import org.springframework.beans.factory.annotation.Autowired @@ -98,6 +101,8 @@ class BumsInterceptor : HandlerInterceptor { (it.getAttribute(WRITE_PERMISSION_KEY) as? Boolean)?.let { permission -> if (permission) { modelAndView?.modelMap?.put(WRITE_PERMISSION_KEY,"OK") + modelAndView?.modelMap?.put(EncTypeKey, EncType11) + modelAndView?.modelMap?.put(ApiKeyWordKey,"Def") } } } diff --git a/src/main/kotlin/kr/lunaticbum/back/lun/controllers/BlogController.kt b/src/main/kotlin/kr/lunaticbum/back/lun/controllers/BlogController.kt index b124c56..b711842 100644 --- a/src/main/kotlin/kr/lunaticbum/back/lun/controllers/BlogController.kt +++ b/src/main/kotlin/kr/lunaticbum/back/lun/controllers/BlogController.kt @@ -16,6 +16,7 @@ import kr.lunaticbum.back.lun.model.* import kr.lunaticbum.back.lun.service.JwtService import kr.lunaticbum.back.lun.utils.LogService import kr.lunaticbum.back.lun.utils.getFileExtension +import net.coobird.thumbnailator.Thumbnails import org.commonmark.node.Node import org.commonmark.parser.Parser import org.commonmark.renderer.html.HtmlRenderer @@ -25,13 +26,11 @@ import org.springframework.beans.factory.annotation.Autowired import org.springframework.beans.factory.annotation.Value import org.springframework.core.io.Resource import org.springframework.core.io.UrlResource -import org.springframework.data.domain.Pageable import org.springframework.http.MediaType import org.springframework.http.ResponseEntity import org.springframework.web.bind.annotation.* import org.springframework.web.multipart.MultipartFile import org.springframework.web.reactive.function.client.WebClient -import reactor.kotlin.core.publisher.toMono import java.io.* import java.net.URLDecoder import java.text.SimpleDateFormat @@ -219,16 +218,54 @@ class BlogController() { val firstImg: Element? = doc.select("img")?.first() val imgSrc: String = firstImg?.attr("src") ?: "" it.image = imgSrc + it.thumb = imgSrc.replaceBeforeLast(".", "_thumbnail.") + generateThumbnail(imgSrc.split("/").last(), 200) it.html = doc.text() } it.title = if ((it.title?.length ?: 0) >= 1) it.title else "" } - }.chunked(2)) + }) }catch (ex: Exception){ex.printStackTrace()} return vm } + fun generateThumbnail(originalPath: String, targetWidth: Int) { + try { + val originalFile = File("$uploadPath${File.separator}$originalPath") + + // 썸네일 경로 생성 (예: /upload/uuid.jpg → /upload/uuid_thumbnail.jpg) + val thumbnailPath = originalFile.path + .replaceBeforeLast(".", "_thumbnail.") + + + val thumbnailFile = File(thumbnailPath) + // 썸네일 이미 존재하면 종료 + if (thumbnailFile.exists()) { + println("썸네일 이미 존재: $thumbnailPath") + return + } + + + // 원본 파일 존재 확인 + if (!originalFile.exists()) { + println("원본 파일 없음: $originalPath") + return + } + + // 썸네일 생성 (가로 기준 비율 유지) + Thumbnails.of(originalFile) + .width(targetWidth) + .keepAspectRatio(true) + .toFile(thumbnailPath) + + println("썸네일 생성 완료: $thumbnailPath") + } catch (e: IOException) { + println("썸네일 생성 실패: ${e.message}") + } + } + + @GetMapping("recent") fun recent() : ResultMV{ val vm = ResultMV("content/blog/viewer") @@ -271,80 +308,75 @@ class BlogController() { } @PostMapping("post/imageUpload") - fun postImage(@RequestPart("file") upload: MultipartFile, res: HttpServletResponse, req: HttpServletRequest) : ResponseEntity { + fun postImage(@RequestPart("file") upload: MultipartFile, res: HttpServletResponse, req: HttpServletRequest): ResponseEntity { var lResultCode = 0 - var lResultMsg = "Suscces" - var out: OutputStream? = null - var printWriter: PrintWriter? = null - var targetFile : File? = null - logService.log("imgUploadPath ${upload.originalFilename}") - res.characterEncoding = "utf-8" - res.contentType = "text/html;charset=utf-8" - var uuid = UUID.randomUUID() + var lResultMsg = "Success" + var out: FileOutputStream? = null + var targetFile: File? = null + + val uuid = UUID.randomUUID() val extension: String = getFileExtension(upload.originalFilename) ?: "" + try { - - logService.log("imgUploadPath ${uuid.toString()}") - val bytes = upload.bytes - var f = File(uploadPath) -// logService.log("imgUploadPath ${f.parentFile.parentFile.parentFile.parentFile.absoluteFile}") -// logService.log("imgUploadPath ${f.parentFile.parentFile.parentFile.absoluteFile}") -// logService.log("imgUploadPath ${f.parentFile.parentFile.absoluteFile}") -// logService.log("imgUploadPath ${f.parentFile.absoluteFile}") - logService.log("imgUploadPath ${f.exists()}") - logService.log("imgUploadPath ${f.absolutePath}") - if (f.exists() == false) f.mkdirs() - // 실제 이미지 저장 경로 - val imgUploadPath = (uploadPath + File.separator + uuid).toString() + "." + extension - logService.log("imgUploadPath $imgUploadPath") - targetFile = File(imgUploadPath) - if(targetFile.parentFile.exists() == false)targetFile.parentFile.mkdirs() + val f = File(uploadPath) + if (!f.exists()) f.mkdirs() - // 이미지 저장 - out = FileOutputStream(imgUploadPath) + // 원본 이미지 저장 경로 + val originalImagePath = "$uploadPath${File.separator}$uuid.$extension" + logService.log("Original image path: $originalImagePath") + + // 썸네일 저장 경로 + val thumbnailPath = "$uploadPath${File.separator}${uuid}_thumbnail.$extension" + logService.log("Thumbnail path: $thumbnailPath") + + targetFile = File(originalImagePath) + if (!targetFile.parentFile.exists()) targetFile.parentFile.mkdirs() + + // 원본 이미지 저장 + out = FileOutputStream(originalImagePath) out.write(bytes) out.flush() - // ckEditor 로 전송 -// printWriter = res.writer -// val callback = req.getParameter("CKEditorFuncNum") -// val fileUrl = "/blog/post/image/$uuid.$extension" + // 썸네일 생성 및 저장 + Thumbnails.of(originalImagePath) + .width(200) // 가로 크기를 설정 + .keepAspectRatio(true) + .toFile(thumbnailPath) -// printWriter.println( -// ("") -// ) -// -// printWriter.flush() - logService.log("imgUploadPath $imgUploadPath") - logService.log("imgUploadPath ${File(imgUploadPath).exists()}") - val metadata: Metadata? = ImageMetadataReader.readMetadata(File(imgUploadPath)) + logService.log("Original image saved: ${File(originalImagePath).exists()}") + logService.log("Thumbnail saved: ${File(thumbnailPath).exists()}") + + // 메타데이터 읽기 (원본 이미지에서) + val metadata: Metadata? = ImageMetadataReader.readMetadata(File(originalImagePath)) metadata?.let { it.directories?.forEach { directory -> logService.log(directory.name) - logService.log(directory.tags.map { tag -> logService.log("tag.tagName >>> ${tag.tagName} || tag.description ${tag.description}")}.joinToString(" \n")) + logService.log(directory.tags.map { tag -> + logService.log("tag.tagName >>> ${tag.tagName} || tag.description ${tag.description}") + }.joinToString(" \n")) } } + } catch (e: IOException) { e.printStackTrace() + lResultCode = 1 + lResultMsg = "Error: ${e.message}" } finally { try { out?.close() - printWriter?.close() } catch (e: IOException) { e.printStackTrace() } } - val responce = ResponseEntity.ok().contentType(MediaType.APPLICATION_JSON).body(FileSaveResult().apply { + return ResponseEntity.ok().contentType(MediaType.APPLICATION_JSON).body(FileSaveResult().apply { this.resultCode = lResultCode this.resultMsg = lResultMsg this.fileName = "$uuid.$extension" + this.thumbnailName = "${uuid}_thumbnail.$extension" }) - return responce } + } \ No newline at end of file diff --git a/src/main/kotlin/kr/lunaticbum/back/lun/model/Post.kt b/src/main/kotlin/kr/lunaticbum/back/lun/model/Post.kt index d8533ad..5f6ac6c 100644 --- a/src/main/kotlin/kr/lunaticbum/back/lun/model/Post.kt +++ b/src/main/kotlin/kr/lunaticbum/back/lun/model/Post.kt @@ -36,6 +36,7 @@ class Post { var html : String? = null var image : String? = null + var thumb : String? = null var writer : String? = null var writeTime : Long = 0 diff --git a/src/main/kotlin/kr/lunaticbum/back/lun/model/ResponceResult.kt b/src/main/kotlin/kr/lunaticbum/back/lun/model/ResponceResult.kt index c066272..bb0980e 100644 --- a/src/main/kotlin/kr/lunaticbum/back/lun/model/ResponceResult.kt +++ b/src/main/kotlin/kr/lunaticbum/back/lun/model/ResponceResult.kt @@ -18,4 +18,5 @@ open class LoginResult : ResponceResult() { @Getter class FileSaveResult : ResponceResult() { var fileName : String? = null + var thumbnailName : String? = null } \ No newline at end of file diff --git a/src/main/resources/static/assets/css/main.css b/src/main/resources/static/assets/css/main.css index 37ceb8c..32eaf81 100644 --- a/src/main/resources/static/assets/css/main.css +++ b/src/main/resources/static/assets/css/main.css @@ -3384,4 +3384,59 @@ button.small, text-align: left; } +} + +/*Login Popup*/ +.login_overlay { + display: none; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); + z-index: 1000; +} + +.login_popup { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + background-color: white; + padding: 20px; + border-radius: 5px; + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); +} + +.login_form { + display: none; +} + +.login_form h2 { + margin-top: 0; +} + +.login_form input { + display: block; + width: 100%; + margin-bottom: 10px; + padding: 5px; +} + +/*.login_form button {*/ +/* width: 100%;*/ +/* padding: 10px;*/ +/* background-color: #4CAF50;*/ +/* color: white;*/ +/* border: none;*/ +/* cursor: pointer;*/ +/*}*/ + +.login_close { + position: absolute; + top: 10px; + right: 10px; + font-size: 20px; + cursor: pointer; } \ No newline at end of file diff --git a/src/main/resources/static/css/blog.css b/src/main/resources/static/css/blog.css index 8307132..221b63b 100644 --- a/src/main/resources/static/css/blog.css +++ b/src/main/resources/static/css/blog.css @@ -48,9 +48,9 @@ border-radius: 10px; background: #00000044; } -#title_field { -font-size: 20px; -} +/*#title_field {*/ +/*font-size: 20px;*/ +/*}*/ .pop_layer .pop_container { padding: 20px 25px; diff --git a/src/main/resources/static/css/common.css b/src/main/resources/static/css/common.css index c8fbced..b024ccf 100644 --- a/src/main/resources/static/css/common.css +++ b/src/main/resources/static/css/common.css @@ -167,4 +167,4 @@ footer { height: 5vh; min-height: 5vh; position: relative; -} \ No newline at end of file +} diff --git a/src/main/resources/static/js/blog.js b/src/main/resources/static/js/blog.js index f1e74cb..f366fff 100644 --- a/src/main/resources/static/js/blog.js +++ b/src/main/resources/static/js/blog.js @@ -16,8 +16,8 @@ let baseData = { 'writeTime' : 0, } -function goToEditor(path,id,sk) { - location.href = path + id+"?token="+sk; +function goToEditor(id) { + location.href = getMainPath() + '/blog/editor/' + id; } diff --git a/src/main/resources/static/js/common.js b/src/main/resources/static/js/common.js index 2bff7d7..d6c639f 100644 --- a/src/main/resources/static/js/common.js +++ b/src/main/resources/static/js/common.js @@ -1,4 +1,10 @@ - +document.addEventListener('DOMContentLoaded', function() { + const loginForm = document.getElementById('loginFormElement'); + loginForm.addEventListener('submit', function(e) { + e.preventDefault(); // 기본 폼 제출 동작 방지 + submitLoginForm(); + }); +}); onload = function() { history.replaceState({}, null, location.pathname); // var accToken = get_cookie("access") @@ -8,6 +14,31 @@ onload = function() { document.cookie = "access=; expires=Thu, 01 Jan 1970 00:00:01 GMT;" document.cookie = "refresh=; expires=Thu, 01 Jan 1970 00:00:01 GMT;" document.cookie = "CLEAR=; expires=Thu, 01 Jan 1970 00:00:01 GMT;" + + var currentList = [{"page":["posts"],"id":"menu_posts"},{"page":["licenses"],"id":"menu_drop"},{"page":["licenses"],"id":"menu_drop"}] + if(location.pathname.length > 1) { + // 1. 모든 'current' 클래스를 가진 요소를 선택하고 제거 + // const currentElements = document.querySelectorAll('.current'); + // currentElements.forEach(element => { + // element.classList.remove('current'); + // }); + currentList.forEach(element => { + element.page.forEach((page, index) => { + console.log(location.pathname); + if (location.pathname.includes(page)) { + const targetElement = document.getElementById(element.id); + if (targetElement) { + targetElement.classList.add('current'); + } + } + }) + }) + } else { + const targetElement = document.getElementById('menu_home'); + if (targetElement) { + targetElement.classList.add('current'); + } + } } // onbeforeunload = function () { // var accToken = get_cookie("access") @@ -260,4 +291,75 @@ function layer_popup(el){ function urldecode(t){ return decodeURI(t) +} + +function openLoginPopup(formType) { + + document.getElementById('overlay').style.display = 'block'; + document.getElementById('loginForm').style.display = formType === 'login' ? 'block' : 'none'; + document.getElementById('signupForm').style.display = formType === 'signup' ? 'block' : 'none'; + + if(formType === 'login') { + const loginIdInput = document.getElementById('loginId'); + loginIdInput.focus(); + } +} + +function closePopup() { + document.getElementById('overlay').style.display = 'none'; +} +// +// function submitForm(formType) { +// alert(formType === 'login' ? '로그인 시도' : '회원가입 시도'); +// closePopup(); +// } + + +function submitLoginForm() { + // const id = document.getElementById('loginId').value; + // const password = document.getElementById('loginPassword').value; + let user_id = document.getElementById('loginId') + let user_pw = document.getElementById('loginPassword') + let data = { + 'user_id': user_id.value, + 'user_pw': user_pw.value, + } + postLogin(getMainPath()+"/user/login.ajax",user_pw.data,JSON.stringify(data),user_pw.data, function (data) { + closePopup() + if (data.isOk) { + document.cookie = "access=" + data.token.split(";")[0]+";" + window.sessionStorage.setItem("REFRESH",data.refresh.split(";")[0]) + document.location.replace(location.href) + } else { + if (data.resultCode === 7100) { + if(confirm(`너 누구임 정보 없는데?!\n${data.resultMsg}[${data.resultCode}]\n가입 할래!?`)){ + document.location.replace(getMainPath() + "/user/join") + } + } else { + alert(`너 누구임?!\n${data.resultMsg}[${data.resultCode}]`) + } + } + }) + + // AJAX 요청 + // fetch('/login', { + // method: 'POST', + // headers: { + // 'Content-Type': 'application/json', + // }, + // body: JSON.stringify({ id, password }), + // }) + // .then(response => response.json()) + // .then(data => { + // if (data.success) { + // alert('로그인 성공!'); + // // 로그인 성공 후 처리 (예: 페이지 리다이렉트) + // } else { + // alert('로그인 실패: ' + data.message); + // } + // }) + // .catch(error => { + // console.error('Error:', error); + // alert('로그인 중 오류가 발생했습니다.'); + // }); } \ No newline at end of file diff --git a/src/main/resources/templates/content/blog/editor.html b/src/main/resources/templates/content/blog/editor.html index a50e786..5ff7f4c 100644 --- a/src/main/resources/templates/content/blog/editor.html +++ b/src/main/resources/templates/content/blog/editor.html @@ -23,30 +23,19 @@ baseData.firstPostLon = [[${srcPost.firstPostLon}]]; baseData.writeTime = [[${srcPost.writeTime}]]; getLocation() - var style = getComputedStyle(document.body) - console.log(style.getPropertyValue('--ContentVerticalMargin')) - console.log(window.c) - console.log(style.getPropertyValue('--FooterHeight')) - console.log(style.getPropertyValue('--TopHeight')) - document.querySelector("#title_field").value = baseData.title - var editorHeght = ( - document.querySelector('#main_layer').getBoundingClientRect().height - - ( - Number(style.getPropertyValue('--ButtonHegit').replace("px","") * 3) - + Number(style.getPropertyValue('--TopHeight').replace("px","")) - ) - ) - + // var style = getComputedStyle(document.body) + // console.log(style.getPropertyValue('--ContentVerticalMargin')) + // console.log(window.c) + // console.log(style.getPropertyValue('--FooterHeight')) + // console.log(style.getPropertyValue('--TopHeight')) editor = new toastui.Editor({ el: document.querySelector('#editor'), previewStyle: 'tab', - height: editorHeght + 'px', + height: '900px', width:'95%', - theme:'dark', usageStatistics : false, toolbar:null, initialValue:baseData.content, - theme:"dark", initialEditType:"wysiwyg", hooks: { addImageBlobHook: (blob, callback) => { @@ -84,24 +73,32 @@ -
+ +
+ +
+
+

+

+
+
+
+
+ +

권한이 없는 뎁쇼?!

- - -
-

-
+
diff --git a/src/main/resources/templates/content/blog/posts.html b/src/main/resources/templates/content/blog/posts.html index 088b82d..e734c57 100644 --- a/src/main/resources/templates/content/blog/posts.html +++ b/src/main/resources/templates/content/blog/posts.html @@ -14,17 +14,6 @@ let onChange = () => {console.log(editor.getMarkdown())} document.addEventListener("DOMContentLoaded", onLoaded); function onLoaded() { - // 1. 모든 'current' 클래스를 가진 요소를 선택하고 제거 - const currentElements = document.querySelectorAll('.current'); - currentElements.forEach(element => { - element.classList.remove('current'); - }); - - // 2. 특정 조건에 맞는 요소에 'current' 클래스 추가 (예: ID가 'targetElement'인 요소) - const targetElement = document.getElementById('menu_posts'); - if (targetElement) { - targetElement.classList.add('current'); - } } @@ -65,30 +54,16 @@
-
-

Two Sidebar

-

Yup. Two sidebars at the same time.

-
- - - -

Phasellus quam turpis, feugiat sit amet ornare in, hendrerit in lectus. - Praesent semper mod quis eget mi. Etiam eu ante risus. Aliquam erat volutpat. - Aliquam luctus et mattis lectus sit amet pulvinar. Nam turpis nisi - consequat etiam lorem ipsum dolor sit amet nullam.

- -

And Yet Another Subheading

-

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas ac quam risus, at tempus - justo. Sed dictum rutrum massa eu volutpat. Quisque vitae hendrerit sem. Pellentesque lorem felis, - ultricies a bibendum id, bibendum sit amet nisl. Mauris et lorem quam. Maecenas rutrum imperdiet - rhoncus dui quis euismod. Maecenas lorem tellus, congue et condimentum ac, ullamcorper non sapien. - Donec sagittis massa et leo semper a scelerisque metus faucibus. Morbi congue mattis mi. - Phasellus sed nisl vitae risus tristique volutpat. Cras rutrum commodo luctus.

- -

Phasellus odio risus, faucibus et viverra vitae, eleifend ac purus. Praesent mattis, enim - quis hendrerit porttitor, sapien tortor viverra magna, sit amet rhoncus nisl lacus nec arcu. - Maecenas tortor mauris, consectetur pellentesque dapibus eget, tincidunt vitae arcu. - Vestibulum purus augue, tincidunt sit amet iaculis id, porta eu purus.

+
+ +
+ +
+

+

+
+
+
diff --git a/src/main/resources/templates/content/blog/viewer.html b/src/main/resources/templates/content/blog/viewer.html index 25f0ca2..e5b1faf 100644 --- a/src/main/resources/templates/content/blog/viewer.html +++ b/src/main/resources/templates/content/blog/viewer.html @@ -30,12 +30,22 @@ initialValue:baseData.content, }); } + function loadEditor() { + goToEditor([[${srcPost.id}]]); + }
-
-
+ +
+
+

A gigantic heading you can use for whatever

+

+
+
+
+

A gigantic heading you can use for whatever

diff --git a/src/main/resources/templates/content/home.html b/src/main/resources/templates/content/home.html index 6f9a4e3..ff7f839 100644 --- a/src/main/resources/templates/content/home.html +++ b/src/main/resources/templates/content/home.html @@ -51,7 +51,7 @@
- +

@@ -73,7 +73,12 @@
-
+
+ +

글쓰기[Writing]

+

오직 주인장 만의 권한 임요. 그냥 내가 쓰기 편하게 여기 놔둔 메뉴임. 님들은 못씀요.
[Only the owner has the authority. This is just a menu that I put here for my convenience. You can't use it.]

+
+

글쓰기[Writing]

오직 주인장 만의 권한 임요. 그냥 내가 쓰기 편하게 여기 놔둔 메뉴임. 님들은 못씀요.
[Only the owner has the authority. This is just a menu that I put here for my convenience. You can't use it.]

diff --git a/src/main/resources/templates/content/licenses.html b/src/main/resources/templates/content/licenses.html index caeb6ec..c1702f2 100644 --- a/src/main/resources/templates/content/licenses.html +++ b/src/main/resources/templates/content/licenses.html @@ -14,10 +14,8 @@ let onChange = () => {console.log(editor.getMarkdown())} document.addEventListener("DOMContentLoaded", onLoaded); function onLoaded() { - var h = document.querySelector('#main_layer').getBoundingClientRect().height + 'px' editor = new toastui.Editor({ el: document.querySelector('#editor'), - height: '500px', width:'100%', viewer: true, usageStatistics : false, @@ -137,15 +135,15 @@ "> - **Embedded license files**: [jcl-over-slf4j-2.0.16.jar/META-INF/LICENSE.txt](jcl-over-slf4j-2.0.16.jar/META-INF/LICENSE.txt)\n" + "\n" + "\n" - , - theme:"dark", }); } -
-
-
+
+
+
+
+
diff --git a/src/main/resources/templates/fragments/header.html b/src/main/resources/templates/fragments/header.html index 2423360..d327d35 100644 --- a/src/main/resources/templates/fragments/header.html +++ b/src/main/resources/templates/fragments/header.html @@ -9,10 +9,14 @@ diff --git a/src/main/resources/templates/layout/default_layout.html b/src/main/resources/templates/layout/default_layout.html index bbcba32..17e396c 100644 --- a/src/main/resources/templates/layout/default_layout.html +++ b/src/main/resources/templates/layout/default_layout.html @@ -19,6 +19,26 @@
+