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

merge new prettyffy

This commit is contained in:
papee 2020-08-12 11:41:02 +02:00
commit c34f9f77e7
6 changed files with 326 additions and 317 deletions

View File

@ -10,181 +10,181 @@
/* logo */
.brand {
font-size: 38px !important;
padding: 0 !important;
margin-left: 10%;
font-size: 38px !important;
padding: 0 !important;
margin-left: 10%;
}
.brand span {
font-size: 48px;
line-height: 0;
font-size: 48px;
line-height: 0;
}
.brand em {
display: inline;
color: #D40202;
font-size: 27px;
display: inline;
color: #D40202;
font-size: 27px;
}
.about {
line-height: 13px;
font-style: italic;
text-align: right;
padding-top: 9px;
margin-bottom: 0 !important;
line-height: 13px;
font-style: italic;
text-align: right;
padding-top: 9px;
margin-bottom: 0 !important;
}
.center {
text-align: center;
text-align: center;
}
.about span{
font-size: 10px;
.about span {
font-size: 10px;
}
/* body & other stuff */
body {
padding-bottom: 40px;
body {
padding-bottom: 40px;
}
.sidebar-nav {
padding: 9px 0;
padding: 9px 0;
}
select {
width: 135px;
width: 135px;
}
ul, ol {
padding: 0;
margin: 0;
ul,
ol {
padding: 0;
margin: 0;
}
li {
margin-left: -9px;
margin-left: -9px;
}
a {
color: #2ea1d7;
color: #2ea1d7;
}
a:hover {
color: #1888bc;
color: #1888bc;
}
p {
margin: 0 0 20px;
margin: 0 0 20px;
}
.grey {
color: #999;
color: #999;
}
.nav-list {
padding-right: 0px !important;
font-size: 12px;
padding-right: 0px !important;
font-size: 12px;
}
blockquote {
width: 630px;
float: left;
}
width: 630px;
float: left;
}
.alert .title {
display:block;
display: block;
}
.footer {
text-align: center;
bottom: 0px;
position: fixed;
height: 60px;
width: 100%;
display: block;
margin: 0px 0px 0px 0px;
padding: 8px 0 0 0;
left: 0;
background-color: #424141;
}
.footer {
text-align: center;
bottom: 0px;
position: fixed;
height: 60px;
width: 100%;
display: block;
margin: 0px 0px 0px 0px;
padding: 8px 0 0 0;
left: 0;
background-color: #424141;
}
/* Home */
.btn-group {
float:left;
float: left;
}
html.file-upload p.file-upload {
float: left;
margin: 22px 0px 0px 21px;
display: none;
float: left;
margin: 22px 0px 0px 21px;
display: none;
}
html.file-upload p.file-upload {
display:inherit;
display: inherit;
}
html.no-file-upload p.file-upload {
display:none;
display: none;
}
input.btn-upload {
position: relative;
left: -6px;
width: 100px;
z-index: 1;
margin-top: -13px;
position: relative;
left: -6px;
width: 100px;
z-index: 1;
margin-top: -13px;
}
input.hide-upload {
position: relative;
left: -110px;
-moz-opacity: 0;
filter: alpha(opacity=0);
opacity: 0 ;
z-index: 2;
width: 100px;
margin-top: -20px;
cursor: pointer;
cursor: hand;
height: 49px;
position: relative;
left: -110px;
-moz-opacity: 0;
filter: alpha(opacity=0);
opacity: 0;
z-index: 2;
width: 100px;
margin-top: -20px;
cursor: pointer;
cursor: hand;
height: 49px;
}
/* Paste Page */
#paste-content.linenums {
padding-left:0;
padding-left: 0;
}
.submit-form {
display:none;
}
a#clip-button.hover{
cursor:pointer;
text-decoration:underline;
display: none;
}
li.L0, li.L1, li.L2, li.L3, li.L4,
li.L5, li.L6, li.L7, li.L8, li.L9
{
list-style-type: decimal;
background: inherit;
a#clip-button.hover {
cursor: pointer;
text-decoration: underline;
}
li.L0,
li.L1,
li.L2,
li.L3,
li.L4,
li.L5,
li.L6,
li.L7,
li.L8,
li.L9 {
list-style-type: decimal;
background: inherit;
}
pre.prettyprint {
width: 100%;
min-height: 100px;
width: 100%;
min-height: 100px;
}
.prettyprint.linenums {
@ -195,8 +195,10 @@ pre.prettyprint {
/* Specify class=linenums on a pre to get line numbering */
ol.linenums {
margin: 0 0 0 55px; /* IE indents via margin-left */
margin: 0 0 0 55px;
/* IE indents via margin-left */
}
ol.linenums li {
/* color: #bebec5;
line-height: 18px;
@ -210,165 +212,162 @@ ol.linenums li {
}
pre {
/* font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, monospace, serif;
/* font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, monospace, serif;
line-height: 21px;
font-size: 12px; */
white-space: pre-wrap;
overflow: visible;
white-space: pre-wrap;
overflow: visible;
}
.kwd {
color: #66F;
color: #66F;
}
.pun, .opn, .clo {
color: #0A0;
.pun,
.opn,
.clo {
color: #0A0;
}
.lit {
color: #933;
color: #933;
}
.com {
color: #C0C;
color: #C0C;
}
/* Common css */
.form-control,
.form-control:focus,
.form-control:disabled,
.form-control:disabled,
.form-control[readonly],
#paste-content {
background-color: #375a7f;
color: #f9fafc;
border-radius: 3px;
background-color: #375a7f;
color: #f9fafc;
border-radius: 3px;
}
.form-group {
/* margin-bottom: 1rem; */
margin-bottom: 0;
/* margin-bottom: 1rem; */
margin-bottom: 0;
}
.select-date {
width: 320px;
float: right;
width: 320px;
float: right;
}
.select-date-clone {
width: 60%;
max-width: 320px;
width: 60%;
max-width: 320px;
}
.container-md {
margin-top: 20px;
padding-bottom: 80px;
}
margin-top: 20px;
padding-bottom: 80px;
}
form textarea {
overflow-y:auto;
min-height:250px;
}
overflow-y: auto;
min-height: 250px;
}
.legal {
margin: 0 auto;
width: 300px;
text-align: center;
margin-top: 30px;
margin: 0 auto;
width: 300px;
text-align: center;
margin-top: 30px;
}
#alert-template {
display: none;
display: none;
}
/** Progress bar */
.progress {
margin: 8px 0 8px 0;
height: 1.5rem;
display: none;
.progress {
margin: 8px 0 8px 0;
height: 1.5rem;
}
.progress .bar {
width: 25%;
padding: 12px;
text-align:left;
width: 25%;
padding: 12px;
text-align: left;
}
/* Previous paste list */
.progress-container {
margin: 8px 0 8px 0;
clear: both;
margin: 8px 0 8px 0;
clear: both;
}
.previous-pastes canvas {
display:block;
float:left;
margin-right:5px;
display: block;
float: left;
margin-right: 5px;
}
html.local-storage .no-local-storage {
display:none;
display: none;
}
html.no-local-storage .local-storage {
display:none;
display: none;
}
canvas {
border: 1px solid white;
border: 1px solid white;
}
.noscript {
text-align: center;
color: red;
font-weight: bold;
text-align: center;
color: red;
font-weight: bold;
}
#faq dt {
margin:2em 0 1em 0;
margin: 2em 0 1em 0;
}
#faq p {
margin:1em;
margin: 1em;
}
#force-coloration {
text-decoration:underline;
text-decoration: underline;
}
#expiration-tag {
float:right;
margin: 1em;
background:grey;
color:white;
font-size:0.8em;
padding:0 1ex;
opacity: 0.5;
filter: alpha(opacity=50);
font-weight:bold;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
float: right;
margin: 1em;
background: grey;
color: white;
font-size: 0.8em;
padding: 0 1ex;
opacity: 0.5;
filter: alpha(opacity=50);
font-weight: bold;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
}
#content.hover {
background-color: #eee;
background-color: #eee;
}
/* top Menu */
#topmenu {
display: none;
}
.topnav {
.topnav {
height: 60px;
background-color: #333;
background-color: #333;
}
.topnav .brand {
@ -381,17 +380,17 @@ canvas {
font-size: 17px;
width: 175px;
}
.topnav .tagline {
font-size: 0.9em;
padding: 8px;
float: left;
margin-left: 20px;
font-size: 0.9em;
padding: 8px;
float: left;
margin-left: 20px;
}
.topnav .tagline span{
font-style: italic;
.topnav .tagline span {
font-style: italic;
}
.topnav a.active {
background-color: #4CAF50;
@ -403,16 +402,17 @@ canvas {
}
.topnav .bi-list {
width: 2em;
height: 2em;
width: 2em;
height: 2em;
}
/* Styling the sub menu */
nav {
float: right;
margin: 18px;
float: right;
margin: 18px;
}
nav ul li {
float: left;
list-style: none;
@ -422,39 +422,40 @@ nav ul li a {
color: white;
background: #333333;
padding: 10px;
text-decoration: none;
text-decoration: none;
}
nav ul li a:hover {
background: #375A7F;
border-radius: 3px;
color: #FFF;
text-decoration: none;
background: #375A7F;
border-radius: 3px;
color: #FFF;
text-decoration: none;
}
.submenu {
position: relative;
}
.submenu ul {
position: absolute;
margin: 8px 0 0px 9px;
display: none;
width: -webkit-fill-available;
.submenu ul {
position: absolute;
margin: 8px 0 0px 9px;
display: none;
width: -webkit-fill-available;
z-index: 9999;
}
.submenu li{
.submenu li {
display: block;
background: #375A7F;
color: white;
float: none;
float: none;
}
/* Styling drop down links */
.submenu li a {
background: transparent;
padding:10px;
padding: 10px;
display: block;
}
@ -467,20 +468,26 @@ nav ul li a:hover {
display: block;
}
/* Responsive */
@media screen and (max-width: 800px) {
.topnav a:not(:first-child) {display: none;}
.topnav .tagline {display: none;}
.brand { margin-left: 1%;}
.topnav a:not(:first-child) {
display: none;
}
.topnav .tagline {
display: none;
}
.brand {
margin-left: 1%;
}
/* Fonts */
.btn {font-size: 0.77em;}
pre {font-size: 70%;}
.btn {
font-size: 0.77em;
}
pre {
font-size: 70%;
}
}

View File

@ -15,26 +15,25 @@ Vue.options.delimiters = ['{%', '%}'];
// Force focus for textarea (firefox hack)
setTimeout(function () {
document.querySelector('textarea').focus()
document.getElementById('content').focus()
}, 100)
// Parse obfuscaded emails and make them usable
const menu = new Vue({
el: "#menu-top",
methods: {
formatEmail: (email) => {
return "mailto:" + email.replace('__AT__', '@');
},
}
})
const app = new Vue({
el: '#wrap-content',
el: '#app',
data: {
previousPastes: [],
downloadLink: {},
displayBottomToolBar: false,
openPreviousPastesMenu: false,
isUploading: false,
currentPaste: {
ownerKey: '',
@ -77,7 +76,12 @@ const app = new Vue({
isLoading: false
},
methods: {
forceLoadPaste: (link) => {
formatEmail: (email) => {
return "mailto:" + email.replace('__AT__', '@');
},
forceLoad: (link) => {
window.location = link;
window.location.reload();
},
@ -115,7 +119,7 @@ const app = new Vue({
},
handleSendByEmail: (e) => {
e.target.href = 'mailto:friend@example.com?body=' + window.location.toString();
window.location = 'mailto:friend@example.com?body=' + window.location.toString();
},
handleDeletePaste: () => {
@ -130,8 +134,7 @@ const app = new Vue({
})
}).then(function (response) {
if (response.ok) {
window.location = "/";
window.reload()
app.forceLoad("/");
} else {
form.forEach((node) => node.disabled = false);
app.isLoading = false
@ -336,13 +339,13 @@ window.zerobin = {
if (doneCallback) {
doneCallback(content);
}
}, 250);
}, 50);
}, 250);
}, 50);
}, 250);
}, 50);
}, 250);
}, 50);
},
/** Base64 decoding + uncompress + decrypt, with callbacks before each operation,
@ -391,25 +394,25 @@ window.zerobin = {
errorCallback(err);
}
}, 250); /* "End of from bits to string" */
}, 50); /* "End of from bits to string" */
} catch (err) {
errorCallback(err);
}
}, 250); /* End of "from base 64 to bits" */
}, 50); /* End of "from base 64 to bits" */
} catch (err) {
errorCallback(err);
}
}, 250); /* End of "decompress" */
}, 50); /* End of "decompress" */
} catch (err) {
errorCallback(err);
}
}, 250); /* End of "decrypt" */
}, 50); /* End of "decrypt" */
},
/** Create a random base64-like string long enought to be suitable as

View File

@ -25,14 +25,14 @@
<option value="1_month">1 month</option>
<option value="never">Never</option>
</select>
<button type="submit" class="btn btn-primary" ">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.prevent.ctrl.enter="encryptAndSendPaste()"></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>

View File

@ -1,40 +1,49 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>0bin - encrypted pastebin</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description"
content="0bin is a client-side-encrypted
<head>
<meta charset="utf-8">
<title>0bin - encrypted pastebin</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="0bin is a client-side-encrypted
pastebin featuring burn after reading, history, and
a clipboard">
<link rel="shortcut icon" href="/favicon.ico">
<link rel="shortcut icon" href="/favicon.ico">
%if settings.COMPRESSED_STATIC_FILES:
<link href="/static/css/style.min.css?{{ VERSION }}"
rel="stylesheet" />
%else:
<link href="/static/css/prettify.css" rel="stylesheet" />
<link href="/static/css/desert.css" rel="stylesheet" />
<link href="/static/css/bootswatch.4.5.css" rel="stylesheet">
<link href="/static/css/style.css?{{ VERSION }}" rel="stylesheet">
%end
%if settings.COMPRESSED_STATIC_FILES:
<link href="/static/css/style.min.css?{{ VERSION }}" rel="stylesheet" />
%else:
<link href="/static/css/prettify.css" rel="stylesheet" />
<link href="/static/css/desert.css" rel="stylesheet" />
<link href="/static/css/bootswatch.4.5.css" rel="stylesheet">
<link href="/static/css/style.css?{{ VERSION }}" rel="stylesheet">
%end
</head>
</head>
<body>
<div class="topnav" >
<body>
<div id="app">
<div class="topnav">
<a class="brand" href="/"><span>ø</span>bin<em>.net</em></a>
<span class="tagline">"A client side encrypted PasteBin"<br><span>All pastes are AES256 encrypted, we cannot know what you paste...</span>
<span class="tagline">"A client side encrypted PasteBin"<br><span>All pastes are AES256 encrypted, we cannot know
what you paste...</span>
</span>
<nav >
<nav>
<ul>
<li class="submenu" ><a href="#" onclick="ToggleMenu()">Previous pastes +</a>
<ul class="previous-pastes" id="topmenu">
<li class="item active"><a href="#">No paste yet...</a></li>
<li class="submenu"><a href="#" @click="openPreviousPastesMenu = !openPreviousPastesMenu">Previous
pastes +</a>
<ul class="previous-pastes" id="topmenu" v-if="openPreviousPastesMenu"
@mouseleave="openPreviousPastesMenu =false">
<li class="item active" v-if="previousPastes.length === 0">
<a href="#">No paste yet...</a>
</li>
<li class="item active" v-for="paste in previousPastes">
<a :href="paste.link" @click="forceLoad(paste.link)">{% paste.displayDate %}.</a>
</li>
</ul>
</li>
</ul>
@ -43,23 +52,26 @@
</div>
<noscript class="container noscript">
<p>This pastebin uses client-side encryption. Therefore, it needs JavaScript enabled.</p>
<p>It seems like your browser doesn't have JavaScript enable.</p>
<p>Please enable JavaScript for this website or use a JavaScript-capable web browser.</p>
<p>This pastebin uses client-side encryption. Therefore, it needs JavaScript enabled.</p>
<p>It seems like your browser doesn't have JavaScript enable.</p>
<p>Please enable JavaScript for this website or use a JavaScript-capable web browser.</p>
</noscript>
<div class="container-md" id="wrap-content">
<div id='main' >{{!base}}</div>
<div class="container-md" id="wrap-content">
<div id='main'>{{!base}}</div>
</div>
<footer class="footer">
<a href="https://www.0bin.net/">Create a paste</a> - <a href="/faq/">Faq</a> - <a href="https://github.com/sametmax/0bin">Github</a>
<footer class="footer">
<a href="https://www.0bin.net/">Create a paste</a> - <a href="/faq/">Faq</a> - <a
href="https://github.com/sametmax/0bin">Github</a>
<br>
%if settings.DISPLAY_COUNTER:
<strong>{{ pastes_count }}</strong> pastes øbinned
%end
%if settings.DISPLAY_COUNTER:
<strong>{{ pastes_count }}</strong> pastes øbinned
%end
</footer>
</div>
<script src="/static/js/vue.js"></script>
%if settings.COMPRESSED_STATIC_FILES:
@ -74,31 +86,21 @@
</script>
%if settings.COMPRESSED_STATIC_FILES:
<script src="/static/js/additional.min.js?{{ settings.VERSION }}"></script>
%else:
<script src="/static/js/lzw.js"></script>
<script src="/static/js/prettify.min.js"></script>
%end
%if settings.COMPRESSED_STATIC_FILES:
<script src="/static/js/additional.min.js?{{ settings.VERSION }}"></script>
%else:
<script src="/static/js/lzw.js"></script>
<script src="/static/js/prettify.min.js"></script>
<script src="/static/js/ZeroClipboard.js"></script>
%end
<p id="alert-template" class="alert-primary">
<a class="close" data-dismiss="alert" href="#">×</a>
<strong class="title"></strong>
<span class="message"></span>
</p>
<script>
function ToggleMenu() {
var x = document.getElementById("topmenu");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
</script>
<p id="alert-template" class="alert-primary">
<a class="close" data-dismiss="alert" href="#">×</a>
<strong class="title"></strong>
<span class="message"></span>
</p>
</body>
</body>
</html>

View File

@ -1,25 +1,25 @@
<form class="well" method="post" action="/paste/create" @submit.prevent="encryptAndSendPaste()">
<div class="d-flex justify-content-between">
<div>
<label class="col-form-label">Upload text/img:</label>
<div class="file-upload" v-if="support.fileUpload">
<input type="button" class="btn btn-primary" :value="isUploading ? 'Uploading...': 'Upload file'"
:disabled="isUploading">
<input type="button" class="btn btn-primary" :value="isUploading ? 'Uploading...': 'Upload file'"
:disabled="isUploading">
<input type="file" class="hide-upload" id="file-upload" @change="handleUpload($event.target.files)">
</div>
</div>
</div>
<div class="form-group select-date paste-option">
<label class="col-form-label">Expiration:</label>
<div class="input-group">
<select id="expiration" name="expiration" class="custom-select" v-model="newPaste.expiration">
<div class="input-group">
<select id="expiration" name="expiration" class="custom-select" v-model="newPaste.expiration">
<option value="burn_after_reading">Burn after reading</option>
<option selected value="1_day">1 day</option>
<option value="1_month">1 month</option>
<option value="never">Never</option>
</select>
<div class="input-group-append">
<div class="input-group-append">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
@ -28,32 +28,29 @@
</div>
<div>
<div class="progress-bar progress-bar-striped progress" v-show="isLoading">
<div class="bar"></div>
<div class="progress" v-show="isLoading">
<div class="progress-bar progress-bar-striped" role="progressbar"></div>
</div>
<textarea rows="10" style="width:100%;"
class="form-control"
id="content" name="content" autofocus
<textarea rows="10" style="width:100%;" class="form-control" id="content" name="content" autofocus
@keydown.prevent.ctrl.enter="encryptAndSendPaste()"></textarea>
</div>
<div class="form-group select-date paste-option down" v-if="displayBottomToolBar">
<label class="col-form-label">Expiration:</label>
<div class="input-group">
<select id="expiration" name="expiration" class="custom-select" v-model="newPaste.expiration">
<option value="burn_after_reading">Burn after reading</option>
<option selected value="1_day">1 day</option>
<option value="1_month">1 month</option>
<option value="never">Never</option>
</select>
<div class="input-group-append">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
<div class="form-group select-date paste-option down" v-if="displayBottomToolBar">
<label class="col-form-label">Expiration:</label>
<div class="input-group">
<select id="expiration" name="expiration" class="custom-select" v-model="newPaste.expiration">
<option value="burn_after_reading">Burn after reading</option>
<option selected value="1_day">1 day</option>
<option value="1_month">1 month</option>
<option value="never">Never</option>
</select>
<div class="input-group-append">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</div>
</form>
% rebase("base", settings=settings, pastes_count=pastes_count)

View File

@ -46,8 +46,8 @@
</div>
<div class="progress-container">
<div class="progress progress-bar progress-bar-striped active" v-show="isLoading">
<div class="bar"></div>
<div class="progress active" v-show="isLoading">
<div class="progress-bar progress-bar-striped" role="progressbar"></div>
</div>
</div>
@ -113,8 +113,8 @@
</div>
<div class="progress-container progress-clone">
<div class="progress progress-bar progress-bar-striped active" v-show="isLoading">
<div class="bar"></div>
<div class="progress active" v-show="isLoading">
<div class="progress-bar progress-bar-striped" role="progressbar"></div>
</div>
</div>