This commit is contained in:
2025-08-05 11:24:23 +09:00
parent cfcbf3c819
commit d6ea6dc154
20 changed files with 306 additions and 89 deletions
@@ -91,3 +91,8 @@ resource.location=.
server.forward-headers-strategy=framework
#>>>>>>> ab915d0a416c69708f1df1ad76d7a14c779c1f59
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
logging.level.org.hibernate.SQL=DEBUG
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
+1 -1
View File
@@ -39,7 +39,7 @@
$(
'<div id="titleBar">' +
'<a href="#navPanel" class="toggle"></a>' +
'<span class="title">' + $('#logo').html() + '</span>' +
'<span class="title" onclick="javascript:gotoHome()">' + $('#logo').html() + '</span>' +
'</div>'
)
.appendTo($body);
+6 -6
View File
@@ -13,13 +13,13 @@ html {
background: black;
}
#where{
table-layout: fixed;
}
/*#where{*/
/* table-layout: fixed;*/
/*}*/
.where_item {
display: table-cell;
}
/*.where_item {*/
/* display: table-cell;*/
/*}*/
body {
user-select: none;
-webkit-user-select: none;
+18 -18
View File
@@ -1,18 +1,18 @@
.layer {
height: 100%;
place-content: space-between;
place-items: stretch;
display: grid;
gap: 10px;
grid-auto-rows: minmax(200px, auto);
grid-template-columns: repeat(auto-fill, minmax(200px, auto));
width: 100%;
}
.where_item {
justify-content: space-between;
flex-wrap: wrap;
flex-direction: row;
width: 100%;
border-radius: 10px;
background: #F0F0F524;
}
/*.layer {*/
/* height: 100%;*/
/* place-content: space-between;*/
/* place-items: stretch;*/
/* display: grid;*/
/* gap: 10px;*/
/* grid-auto-rows: minmax(200px, auto);*/
/* grid-template-columns: repeat(auto-fill, minmax(200px, auto));*/
/* width: 100%;*/
/*}*/
/*!*.where_item {*!*/
/*!* justify-content: space-between;*!*/
/*!* flex-wrap: wrap;*!*/
/*!* flex-direction: row;*!*/
/*!* width: 100%;*!*/
/*!* border-radius: 10px;*!*/
/*!* background: #F0F0F524;*!*/
/*!*}*!*/
+71
View File
@@ -4,6 +4,68 @@ document.addEventListener('DOMContentLoaded', function() {
e.preventDefault(); // 기본 폼 제출 동작 방지
submitLoginForm();
});
if (document.querySelector(".rank_of_view")) {
fetch('blog/rankOfViews.bjx')
.then(response => response.json())
.then(data => {
const ul = document.querySelector('.rank_of_view');
ul.innerHTML = ''; // 기존 리스트 지움
ul.style.listStyle = 'none'; // 불릿 제거
ul.style.paddingLeft = '0'; // 들여쓰기 제거 (선택사항)
// data가 ['제목1', '제목2', ...] 형식이라고 가정
data.posts.forEach(item => {
const date = new Date(item.writeTime);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const formatted = `${year}/${month}/${day}`;
const li = document.createElement('li');
const a = document.createElement('a');
a.id = item.id;
a.href = `${getMainPath()}/blog/viewer/${item.id}`;
a.textContent = `${item.title}[${year}/${month}/${day}]`
li.appendChild(a);
ul.appendChild(li);
});
})
.catch(error => {
console.error('받아오기 실패:', error);
}
);
}
if (document.querySelector(".recent_posts")) {
fetch('blog/recentOfPost.bjx')
.then(response => response.json())
.then(data => {
const ul = document.querySelector('.recent_posts');
ul.innerHTML = ''; // 기존 리스트 지움
ul.style.listStyle = 'none'; // 불릿 제거
ul.style.paddingLeft = '0'; // 들여쓰기 제거 (선택사항)
// data가 ['제목1', '제목2', ...] 형식이라고 가정
data.posts.forEach(item => {
const date = new Date(item.writeTime);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const formatted = `${year}/${month}/${day}`;
const li = document.createElement('li');
const a = document.createElement('a');
a.id = item.id;
a.href = `${getMainPath()}/blog/viewer/${item.id}`;
a.textContent = `${item.title}[${year}/${month}/${day}]`
li.appendChild(a);
ul.appendChild(li);
});
})
.catch(error => {
console.error('받아오기 실패:', error);
}
);
}
});
onload = function() {
history.replaceState({}, null, location.pathname);
@@ -213,6 +275,11 @@ function logout() {
form.submit();
}
function gotoHome() {
console.log(`location.port >> ${location.port}`)
location.href = getMainPath()+"/home.bs"
}
function gotoLogin() {
console.log(`location.port >> ${location.port}`)
location.href = getMainPath()+"/login.bs"
@@ -222,6 +289,10 @@ function gotoJoin() {
document.location.replace(getMainPath() + "/user/join.bs")
}
function goToViewer(item) {
location.href = getMainPath() + "/blog/viewer/" + item.id
}
function goToView(path,id) {
location.href = path + id;
}
@@ -57,8 +57,8 @@
<article>
<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.thumb) > 0} ? ${post.thumb} : 'images/pic01.jpg'" alt="" /></a>
<div class="box post" onclick="goToViewer(this)" th:id="${post.id}">
<a href="javascript:goToViewer(this)" th:id="${post.id}" th:data="${post.id}" class="image left"><img th:src="${#strings.length(post.thumb) > 0} ? ${post.thumb} : '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>
@@ -11,11 +11,7 @@
<script type="text/javascript" th:src="@{/js/test.js}"></script>
<link th:href="@{/css/toast-ui-dark.css}" rel="stylesheet" />
<script th:inline="javascript">
// document.addEventListener("DOMContentLoaded", onLoaded);
function goToViewer(item) {
let uploadUrl = getMainPath() + "/blog/viewer/"+item.attributes['data'].value;
location.href = uploadUrl
}
</script>
</th:block>
<th:block layout:fragment="content" id="content">
@@ -51,7 +47,7 @@
<div class="row" th:each="row : ${Posts}">
<section class="col-6 col-12-narrower" th:each="post : ${row}">
<!-- <span th:text="${cell}"></span>-->
<div class="box post" onclick="goToViewer(this)" th:data="${post.id}">
<div class="box post" onclick="goToViewer(this)" th:id="${post.id}">
<a href="#" class="image left"><img th:src="${#strings.length(post.thumb) > 0} ? ${post.thumb} : '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>
@@ -12,10 +12,6 @@
<link th:href="@{/css/toast-ui-dark.css}" rel="stylesheet" />
<script th:inline="javascript">
document.addEventListener("DOMContentLoaded", onLoaded);
function goToViewer(item) {
let uploadUrl = getMainPath() + "/blog/viewer/"+item.attributes['data'].value;
location.href = uploadUrl
}
</script>
</th:block>
<th:block layout:fragment="content" id="content">
@@ -12,10 +12,7 @@
<link th:href="@{/css/toast-ui-dark.css}" rel="stylesheet" />
<script th:inline="javascript">
document.addEventListener("DOMContentLoaded", onLoaded);
function goToViewer(item) {
let uploadUrl = getMainPath() + "/blog/viewer/"+item.attributes['data'].value;
location.href = uploadUrl
}
</script>
</th:block>
<th:block layout:fragment="content" id="content">
@@ -11,12 +11,13 @@
<div id="main_layer">
<div class="layer">
<th:block id="where" th:each="location : ${locations}">
<div class="where_item">
<label th:text="${location.timeString}"/><br/>
<label th:text="${location.mAddressLines}"/><br/>
<label th:text="${location.mCountryName}"/><br/>
<label th:text="${#numbers.formatDecimal(location.mLatitude, 1, 3)}"/><br/>
<label th:text="${#numbers.formatDecimal(location.mLongitude, 1, 3)}"/><br/>
<div class="where_item" style="font-family: monospace; white-space: nowrap;">
<span th:text="${location.timeString}"></span> |
<span th:text="${location.mAddressLines}"></span> |
<span th:text="${location.bettween}"></span> |
<span th:text="${#numbers.formatDecimal(location.mLatitude, 1, 3)}"></span> |
<span th:text="${#numbers.formatDecimal(location.mLongitude, 1, 3)}"></span> |
<span th:text="${location.mCountryName}"></span>
</div>
</th:block>
</div>
@@ -11,11 +11,7 @@
<script type="text/javascript" th:src="@{/js/test.js}"></script>
<link th:href="@{/css/toast-ui-dark.css}" rel="stylesheet" />
<script th:inline="javascript">
document.addEventListener("DOMContentLoaded", onLoaded);
function goToViewer(item) {
let uploadUrl = getMainPath() + "/blog/viewer/"+item.attributes['data'].value;
location.href = uploadUrl
}
</script>
</th:block>
<th:block layout:fragment="content" id="content">-->
@@ -11,11 +11,7 @@
<script type="text/javascript" th:src="@{/js/test.js}"></script>
<link th:href="@{/css/toast-ui-dark.css}" rel="stylesheet" />
<script th:inline="javascript">
document.addEventListener("DOMContentLoaded", onLoaded);
function goToViewer(item) {
let uploadUrl = getMainPath() + "/blog/viewer/"+item.attributes['data'].value;
location.href = uploadUrl
}
</script>
</th:block>
<th:block layout:fragment="content" id="content">
@@ -5,8 +5,8 @@
<div class="container">
<div class="row">
<section class="col-3 col-6-narrower col-12-mobilep">
<h3>Links to Stuff</h3>
<ul class="links">
<h3>Rank of Views</h3>
<ul class="rank_of_view" >
<li><a href="#">Mattis et quis rutrum</a></li>
<li><a href="#">Suspendisse amet varius</a></li>
<li><a href="#">Sed et dapibus quis</a></li>
@@ -17,8 +17,8 @@
</ul>
</section>
<section class="col-3 col-6-narrower col-12-mobilep">
<h3>More Links to Stuff</h3>
<ul class="links">
<h3>Recent of Posts</h3>
<ul class="recent_posts">
<li><a href="#">Duis neque nisi dapibus</a></li>
<li><a href="#">Sed et dapibus quis</a></li>
<li><a href="#">Rutrum accumsan sed</a></li>