...
This commit is contained in:
@@ -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 @@
|
||||
</script>
|
||||
</th:block>
|
||||
<th:block layout:fragment="content" id="content">
|
||||
<div id="main_layer">
|
||||
|
||||
<section class="wrapper style2" >
|
||||
<th:block th:if="${PERMISSION == 'OK'}">
|
||||
<div class="container" >
|
||||
<header class="major">
|
||||
<h3><label for="title_field"><input id="title_field" th:value="${srcPost.title}"></label></h3>
|
||||
<p th:text="${#temporals.format(T(java.time.Instant).ofEpochMilli(srcPost.writeTime).atZone(T(java.time.ZoneId).systemDefault()).toLocalDateTime(), 'yyyy-MM-dd HH:mm:ss')}"></p>
|
||||
</header>
|
||||
</div>
|
||||
</th:block>
|
||||
</section>
|
||||
|
||||
<section class="wrapper style2">
|
||||
<th:block th:if="${PERMISSION != 'OK'}">
|
||||
<h1>권한이 없는 뎁쇼?!</h1>
|
||||
</th:block>
|
||||
<th:block th:if="${PERMISSION == 'OK'}">
|
||||
|
||||
<label for="title_field"></label><input id="title_field" class="write_option">
|
||||
|
||||
<div id="editor" ></div>
|
||||
<div class="write_controllbox">
|
||||
|
||||
<div class="write_option btn-example" to="#popLayer1" onclick="openPopup(this)" ></div>
|
||||
<div class="write_option btn-example" to="#popLayer2" onclick="openPopup(this)" id="hashtag_field"></div>
|
||||
<label for="location_field"></label><input class="write_option" readonly id="location_field"/>
|
||||
</div>
|
||||
<h1><button id="save" class="write_option" style="width: 100%; position: relative" onclick="save()">저장하셈</button></h1>
|
||||
</th:block>
|
||||
</div>
|
||||
</section>
|
||||
</th:block>
|
||||
<th:block layout:fragment="popup_layer">
|
||||
<div id="popLayer1" class="pop_layer">
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
@@ -65,30 +54,16 @@
|
||||
<div class="col-6 col-12-narrower imp-narrower">
|
||||
<div id="content">
|
||||
<article>
|
||||
<header>
|
||||
<h2>Two Sidebar</h2>
|
||||
<p>Yup. Two sidebars at the same time.</p>
|
||||
</header>
|
||||
|
||||
<span class="image featured"><img src="images/banner.jpg" alt="" /></span>
|
||||
|
||||
<p>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.</p>
|
||||
|
||||
<h3>And Yet Another Subheading</h3>
|
||||
<p>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.</p>
|
||||
|
||||
<p>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.</p>
|
||||
<section class="col-6 col-12-narrower imp-narrower" th:each="post : ${Posts}">
|
||||
<!-- <span th:text="${cell}"></span>-->
|
||||
<div class="box post" onclick="goToViewer(this)" th:data="${post.id}">
|
||||
<a href="#" class="image left"><img th:src="${#strings.length(post.image) > 0} ? ${post.image} : 'images/pic01.jpg'" alt="" /></a>
|
||||
<div class="inner">
|
||||
<h3 th:text="${#strings.length(post.title) > 0} ? ${post.title} : ('untitled[' + ${#temporals.format(T(java.time.Instant).ofEpochMilli(post.writeTime).atZone(T(java.time.ZoneId).systemDefault()).toLocalDateTime(), 'yyyy-MM-dd HH:mm:ss')} + ']')"></h3>
|
||||
<p th:text="${#strings.abbreviate(post.html, 80)}" class="ellipsis"></p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</article>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -30,12 +30,22 @@
|
||||
initialValue:baseData.content,
|
||||
});
|
||||
}
|
||||
function loadEditor() {
|
||||
goToEditor([[${srcPost.id}]]);
|
||||
}
|
||||
</script>
|
||||
</th:block>
|
||||
<th:block layout:fragment="content" id="content">
|
||||
<section class="wrapper style2">
|
||||
<div class="container">
|
||||
<header class="major" >
|
||||
|
||||
<div class="container" th:if="${PERMISSION == 'OK'}" onclick="loadEditor()">
|
||||
<header class="major">
|
||||
<h2 id="title_layer" th:text="${srcPost.title}">A gigantic heading you can use for whatever</h2>
|
||||
<p th:text="${#temporals.format(T(java.time.Instant).ofEpochMilli(srcPost.writeTime).atZone(T(java.time.ZoneId).systemDefault()).toLocalDateTime(), 'yyyy-MM-dd HH:mm:ss')}"></p>
|
||||
</header>
|
||||
</div>
|
||||
<div class="container" th:if="${PERMISSION != 'OK'}" onclick="openLoginPopup('login')">
|
||||
<header class="major">
|
||||
<h2 id="title_layer" th:text="${srcPost.title}">A gigantic heading you can use for whatever</h2>
|
||||
<p th:text="${#temporals.format(T(java.time.Instant).ofEpochMilli(srcPost.writeTime).atZone(T(java.time.ZoneId).systemDefault()).toLocalDateTime(), 'yyyy-MM-dd HH:mm:ss')}"></p>
|
||||
</header>
|
||||
|
||||
Reference in New Issue
Block a user