1
0
mirror of https://github.com/Tygs/0bin.git synced 2023-08-10 21:13:00 +03:00

Add delete paste

This commit is contained in:
ksamuel
2020-08-11 16:37:03 +02:00
parent e13cead89b
commit 6843a19fa8
12 changed files with 202 additions and 169 deletions

View File

@@ -16,8 +16,8 @@
<input type="file" class="hide-upload" id="file-upload" @change="handleUpload($event.target.files)">
</p>
<form class="well" method="post" action="/paste/create">
<p class="paste-option">
<form class="well" method="post" action="/paste/create" @submit.prevent="encryptAndSendPaste()">
<p class=" paste-option">
<label for="expiration">Expiration:</label>
<select id="expiration" name="expiration" v-model="newPaste.expiration">
<option value="burn_after_reading">Burn after reading</option>
@@ -25,14 +25,14 @@
<option value="1_month">1 month</option>
<option value="never">Never</option>
</select>
<button type="submit" class="btn btn-primary" @click="encryptAndSendPaste($event)">Submit</button>
<button type="submit" class="btn btn-primary" ">Submit</button>
</p>
<p>
<div class="progress progress-striped active" v-show="isLoading">
<div class=" progress progress-striped active" v-show="isLoading">
<div class="bar"></div>
</div>
<textarea rows="10" style="width:100%;" class="input-xlarge" id="content" name="content" autofocus
v-on:keydown.ctrl.enter="encryptAndSendPaste($event)"></textarea>
</div>
<textarea rows="10" style="width:100%;" class="input-xlarge" id="content" name="content" autofocus
v-on:keydown.prevent.ctrl.enter="encryptAndSendPaste()"></textarea>
</p>
<p class="paste-option down" v-if="displayBottomToolBar">
<label for="expiration">Expiration:</label>
@@ -42,7 +42,7 @@
<option value="1_month">1 month</option>
<option value="never">Never</option>
</select>
<button type="submit" class="btn btn-primary" @click="encryptAndSendPaste($event)">Submit</button>
<button type="submit" class="btn btn-primary">Submit</button>
</p>
</form>

View File

@@ -12,11 +12,11 @@
<link rel="shortcut icon" href="/favicon.ico">
%if settings.COMPRESSED_STATIC_FILES:
<link href="/static/css/style.min.css?{{ settings.VERSION }}" rel="stylesheet" />
<link href="/static/css/style.min.css?{{ VERSION }}" rel="stylesheet" />
%else:
<link href="/static/css/prettify.css" rel="stylesheet" />
<link href="/static/css/bootstrap.css" rel="stylesheet">
<link href="/static/css/style.css?{{ settings.VERSION }}" rel="stylesheet">
<link href="/static/css/style.css?{{ VERSION }}" rel="stylesheet">
%end
<!-- Le HTML5 shim, for IE7-8 support of HTML5 elements -->
@@ -109,7 +109,7 @@
<p :class="'alert alert-' + msg.type" v-for="msg in messages">
<a class="close" data-dismiss="alert" href="#" @click="$event.target.parentNode.remove()">×</a>
<a class="close" data-dismiss="alert" href="#" @click.prevent="$event.target.parentNode.remove()">×</a>
<strong class="title" v-if="msg.title" v-html="msg.title"></strong>
<span class="message" v-html="msg.content"></span>
<a v-if="msg.action.message" href="#"
@@ -156,10 +156,10 @@
<script src="/static/js/vue.js"></script>
%if settings.COMPRESSED_STATIC_FILES:
<script src="/static/js/main.min.js?{{ settings.VERSION }}"></script>
<script src="/static/js/main.min.js?{{ VERSION }}"></script>
%else:
<script src="/static/js/sjcl.js"></script>
<script src="/static/js/behavior.js?{{ settings.VERSION }}"></script>
<script src="/static/js/behavior.js?{{ VERSION }}"></script>
%end
<script type="text/javascript">
@@ -168,7 +168,7 @@
</script>
%if settings.COMPRESSED_STATIC_FILES:
<script src="/static/js/additional.min.js?{{ settings.VERSION }}"></script>
<script src="/static/js/additional.min.js?{{ VERSION }}"></script>
%else:
<script src="/static/js/lzw.js"></script>

View File

@@ -4,7 +4,7 @@
<input type="file" class="hide-upload" id="file-upload" @change="handleUpload($event.target.files)">
</p>
<form class="well" method="post" action="/paste/create">
<form class="well" method="post" action="/paste/create" @submit.prevent="encryptAndSendPaste()">
<p class="paste-option">
<label for="expiration">Expiration:</label>
<select id="expiration" name="expiration" v-model="newPaste.expiration">
@@ -13,14 +13,14 @@
<option value="1_month">1 month</option>
<option value="never">Never</option>
</select>
<button type="submit" class="btn btn-primary" @click="encryptAndSendPaste($event)">Submit</button>
<button type="submit" class="btn btn-primary">Submit</button>
</p>
<p>
<div class="progress progress-striped active" v-show="isLoading">
<div class="bar"></div>
</div>
<textarea rows="10" style="width:100%" class="input-xlarge" id="content" name="content" autofocus
v-on:keydown.ctrl.enter="encryptAndSendPaste($event)"></textarea>
v-on:keydown.prevent.ctrl.enter="encryptAndSendPaste()"></textarea>
</p>
<p class="paste-option down" v-if="displayBottomToolBar">
@@ -31,7 +31,7 @@
<option value="1_month">1 month</option>
<option value="never">Never</option>
</select>
<button type="submit" class="btn btn-primary" @click="encryptAndSendPaste($event)">Submit</button>
<button type="submit" class="btn btn-primary">Submit</button>
</p>
</form>

View File

@@ -1,7 +1,7 @@
%if "burn_after_reading" in str(paste.expiration):
%if keep_alive:
<p class="alert alert-info">
<a class="close" data-dismiss="alert" href="#" @click="$event.target.parentNode.remove()">×</a>
<a class="close" data-dismiss="alert" href="#" @click.prevent="$event.target.parentNode.remove()">×</a>
<strong class="title">Ok!</strong>
<span class="message">
This paste will be deleted the next time it is read.
@@ -9,7 +9,7 @@
</p>
%else:
<p class="alert">
<a class="close" data-dismiss="alert" href="#" @click="$event.target.parentNode.remove()">×</a>
<a class="close" data-dismiss="alert" href="#" @click.prevent="$event.target.parentNode.remove()">×</a>
<strong class="title">Warning!</strong>
<span class="message">
This paste has self-destructed. If you close this window,
@@ -54,6 +54,10 @@
</pre>
</p>
<p v-if="currentPaste.ownerKey">
<button type="button" class="btn btn-danger" @click="handleDeletePaste()">Delete this paste</button>
</p>
<p class="paste-option btn-group bottom">
<button class="btn btn-clone" @click.prevent="handleClone()"><i class="icon-camera"></i>&nbsp;Clone</button>
@@ -69,7 +73,7 @@
<!-- For cloning -->
<div class="submit-form clone">
<form class="well" method="post" action="/paste/create">
<form class="well" method="post" action="/paste/create" @submit.prevent="encryptAndSendPaste()">
<p class="paste-option">
<label for="expiration">Expiration:</label>
<select id="expiration" name="expiration" v-model="newPaste.expiration">
@@ -78,7 +82,7 @@
<option value="1_month">1 month</option>
<option value="never">Never</option>
</select>
<button type="submit" class="btn btn-primary" @click="encryptAndSendPaste($event)">Submit</button>
<button type="submit" class="btn btn-primary">Submit</button>
<button class="btn btn-danger" @click.prevent="handleCancelClone()">Cancel clone</button>
</p>
@@ -87,7 +91,7 @@
<div class="bar"></div>
</div>
<textarea rows="10" style="width:100%;" class="input-xlarge" id="content" name="content" autofocus
v-on:keydown.ctrl.enter="encryptAndSendPaste($event)"></textarea>
v-on:keydown.prevent.ctrl.enter="encryptAndSendPaste()"></textarea>
</div>
<p class="paste-option down" v-if="displayBottomToolBar">
@@ -98,7 +102,7 @@
<option value="1_month">1 month</option>
<option value="never">Never</option>
</select>
<button type="submit" class="btn btn-primary" @click="encryptAndSendPaste($event)">Submit</button>
<button type="submit" class="btn btn-primary">Submit</button>
</p>
</form>
</div>