Skip to content

Commit

Permalink
Merge pull request #33 from selab-hs/develop
Browse files Browse the repository at this point in the history
release v1.0.6
  • Loading branch information
InJun2 authored Jul 25, 2024
2 parents c681e19 + 1566b02 commit 67620d5
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version='1.0.6-SNAPSHOT'
version='1.0.6'
4 changes: 4 additions & 0 deletions src/main/resources/static/css/layout/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
padding: 20px;
}

.sidebar h2 {
margin-bottom: 50px;
}

.sidebar a {
color: white;
text-decoration: none;
Expand Down
15 changes: 15 additions & 0 deletions src/main/resources/static/css/shortener/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,19 @@ html, body {

input[type="text"] {
width: 100%;
}

#copyButtonContainer {
display: none;
}

.btn-custom-green {
background-color: #A5DF00;
border-color: #A5DF00;
color: white;
}

.btn-custom-green:hover {
background-color: #77dd77;
border-color: #77dd77;
}
15 changes: 15 additions & 0 deletions src/main/resources/static/css/shortener/main_member.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,19 @@ html, body {

input[type="text"] {
width: 100%;
}

#copyButtonContainer {
display: none;
}

.btn-custom-green {
background-color: #A5DF00;
border-color: #A5DF00;
color: white;
}

.btn-custom-green:hover {
background-color: #77dd77;
border-color: #77dd77;
}
16 changes: 16 additions & 0 deletions src/main/resources/static/js/shortener/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
function copyToClipboard(text) {
const tempInput = document.createElement('input');
tempInput.value = text;
document.body.appendChild(tempInput);
tempInput.select();
document.execCommand('copy');
document.body.removeChild(tempInput);
}

$(document).ready(function () {
if (window.localStorage.getItem("X-READYS-AUTH-TOKEN") != null) {
location.href = "/member_home";
Expand Down Expand Up @@ -66,11 +75,18 @@ $(document).ready(function () {
'<a class="form-control" href="/' + response.data.replace("https://readys.link/", "") + '" target="_blank">URL: ' + response.data + '</a>' +
'</div>';
$('.form-group').after(alertSuccess);

$('#copyButtonContainer').show();
$('#copyButton').off('click').on('click', function () {
copyToClipboard(response.data);
alert('URL copied to clipboard');
});
},
error: function (response) {
$('.alert').remove();
const alertError = '<div class="alert alert-danger mt-4">' + JSON.parse(response.responseText).reason + '</div>';
$('.form-group').after(alertError);
$('#copyButtonContainer').hide();
}
});
});
Expand Down
16 changes: 16 additions & 0 deletions src/main/resources/static/js/shortener/main_member.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
function copyToClipboard(text) {
const tempInput = document.createElement('input');
tempInput.value = text;
document.body.appendChild(tempInput);
tempInput.select();
document.execCommand('copy');
document.body.removeChild(tempInput);
}

document.addEventListener("DOMContentLoaded", function () {
if (window.localStorage.getItem("X-READYS-AUTH-TOKEN") == null) {
location.href = "/main";
Expand Down Expand Up @@ -68,11 +77,18 @@ document.addEventListener("DOMContentLoaded", function () {
'<a class="form-control" href="/' + response.data.replace("https://readys.link/", "") + '" target="_blank">URL: ' + response.data + '</a>' +
'</div>';
$('.form-group').after(alertSuccess);

$('#copyButtonContainer').show();
$('#copyButton').off('click').on('click', function () {
copyToClipboard(response.data);
alert('URL copied to clipboard');
});
},
error: function (response) {
$('.alert').remove();
const alertError = '<div class="alert alert-danger mt-4">' + JSON.parse(response.responseText).reason + '</div>';
$('.form-group').after(alertError);
$('#copyButtonContainer').hide();
}
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/access_shortcode_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<title>Shortcode Dashboard</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"/>
<link rel="stylesheet" href="/css/shortener/access_shortcode.css" type="text/css"/>
<link rel="stylesheet" href="/css/layout/layout.css" type="text/css"/>
<script src="/js/layout/layout.js"></script>
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/templates/main_member_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ <h3 class="form-signin-heading text-center">URL Shortener</h3>
</div>
<button type="submit" class="btn btn-lg btn-success btn-block">Shorten URL</button>
</form>
<div id="copyButtonContainer" class="mt-3">
<button id="copyButton" class="btn btn-lg btn-custom-green btn-block">Copy URL</button>
</div>
</div>
</div>
</body>
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/templates/main_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ <h3 class="form-signin-heading text-center">URL Shortener</h3>
</div>
<button type="submit" class="btn btn-lg btn-success btn-block">Shorten URL</button>
</form>
<div id="copyButtonContainer" class="mt-3">
<button id="copyButton" class="btn btn-lg btn-custom-green btn-block">Copy URL</button>
</div>
</div>
</div>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<title>System Action Log Board</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"/>
<link rel="stylesheet" href="/css/shortener/system_action_log_board.css" type="text/css"/>
<link rel="stylesheet" href="/css/layout/layout.css" type="text/css"/>
<script src="/js/layout/layout.js"></script>
Expand Down

0 comments on commit 67620d5

Please sign in to comment.