Skip to content
This repository has been archived by the owner on Aug 20, 2021. It is now read-only.

Commit

Permalink
Added copy to clipboard feature, dockerized backend and cleaned the code
Browse files Browse the repository at this point in the history
  • Loading branch information
mrhakimov committed Mar 29, 2020
1 parent 844fad8 commit 98b8a69
Show file tree
Hide file tree
Showing 54 changed files with 201,639 additions and 34 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,5 @@ build/

### Secrets ###
src/main/resources
src/main/java/ru
frontend/node_modules
TODO.md

7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM openjdk:11.0.4

ADD target/easify-backend.jar easify-backend.jar

EXPOSE 8090

ENTRYPOINT ["java", "-jar", "easify-backend.jar"]
13 changes: 12 additions & 1 deletion frontend/public/css/mainPage.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ main {
main textarea {
padding: 5px;
width: 38.3rem;
height: 26rem;
height: 25rem;
border-radius: 5px;
}

Expand All @@ -42,3 +42,14 @@ main .request textarea {

main .response textarea {
}

.copyButton {
padding: 2px;
border: 2px solid #e7e7e7e;
background-color: white;
transition-duration: 0.4s;
}

.copyButton:hover {
background-color: #e7e7e7;
}
5 changes: 5 additions & 0 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<!--$.notify("Access granted", "success");-->
<!--$.notify("Do not press this button", "info");-->
<!--$.notify("Warning: Self-destruct in 3.. 2..", "warn");-->
<!--$.notify("BOOM!", "error");-->

<template>
<!--suppress HtmlUnknownTag -->
<body id="app">
Expand Down
12 changes: 1 addition & 11 deletions frontend/src/components/Header.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<!--suppress HtmlUnknownAnchorTarget -->
<template>
<header>
<a href="/"><img src="../assets/img/logo.png" alt="Codeforces" title="Codeforces" width="300px"/></a>
<!-- <div class="languages">-->
<!-- <a href="#"><img src="../assets/img/gb.png" alt="In English" title="In English"/></a>-->
<!-- <a href="#"><img src="../assets/img/ru.png" alt="In Russian" title="In Russian"/></a>-->
<!-- </div>-->
<a href="/"><img src="../assets/img/logo.png" alt="Easify" title="Easify" width="300px"/></a>
<div class="enter-or-register-box">
<template v-if="user">
{{user.login}}
Expand All @@ -18,12 +14,6 @@
<a href="#page=Register" @click="changePage('Register')">Register</a>
</template>
</div>
<!-- <nav>-->
<!-- <ul>-->
<!-- <li><a href="#page=Index" @click="changePage('Index')">Home</a></li>-->
<!-- <li><a href="#page=Users" @click="changePage('Users')">Users</a></li>-->
<!-- </ul>-->
<!-- </nav>-->
</header>
</template>

Expand Down
17 changes: 14 additions & 3 deletions frontend/src/components/middle/Index.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<template>
<div>
<div class="request"><textarea autofocus placeholder="Enter your text..." @change.prevent="onChange" v-model="text"></textarea></div>
<div class="response"><textarea>{{result}}</textarea></div>
<div class="request"><textarea autofocus placeholder="Enter your text..." @change.prevent="onChange"
v-model="text" required></textarea></div>
<div class="response"><textarea id="copyValue" v-model="result" readonly></textarea></div>
<button class="copyButton" @click.prevent="copyToClipboard()">Copy text</button>
</div>
</template>

<script>
export default {
data: function() {
data: function () {
return {
text: "",
result: ""
Expand All @@ -28,6 +30,15 @@
this.$root.$emit("onEasify", this.text);
}, changePage: function (page) {
this.$root.$emit("onChangePage", page);
}, copyToClipboard: function () {
let copyText = document.getElementById("copyValue");
copyText.select();
copyText.setSelectionRange(0, 99999); /*For mobile devices*/
$.notify("Do not press this button", "info");
alert("Copied!");
document.execCommand("copy");
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/jquery-3.4.1.min.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions frontend/src/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import Vue from 'vue'
import App from './App.vue'
import jquery from './jquery-3.4.1.min'
Vue.use(jquery);

import Notify from './notify'

Vue.use(Notify);

Vue.config.productionTip = false;

Expand Down
Loading

0 comments on commit 98b8a69

Please sign in to comment.