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

added clone option

This commit is contained in:
max 2012-04-29 00:55:00 +07:00
parent af3d088ea4
commit 685e6f6984
6 changed files with 199 additions and 33 deletions

View File

@ -41,10 +41,7 @@ body {
.paste-option {
float:right;
}
#paste-content {
background-color:white;
}
select {
width: 135px;
@ -63,6 +60,11 @@ ul, ol {
margin: 0;
}
li {
margin-left: -4px;
}
p {
margin: 0 0 20px;
}
@ -85,6 +87,11 @@ p {
list-style-type: none;
}
#paste-content {
background-color: white;
}
form textarea {
overflow-y:auto;
}
@ -93,6 +100,10 @@ button.btn, input[type="submit"].btn {
margin-left: 5px;
}
.submit-form {
display: none;
}
.well {
padding-bottom: 40px;
padding-right: 17px;
@ -141,6 +152,6 @@ ol.linenums span:first-child {
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;
list-style-type: decimal;
background: inherit;
}

118
static/css/sunburst.css Normal file
View File

@ -0,0 +1,118 @@
/*
* Derived from einaros's Sons of Obsidian theme at
* http://studiostyl.es/schemes/son-of-obsidian by
* Alex Ford of CodeTunnel:
* http://CodeTunnel.com/blog/post/71/google-code-prettify-obsidian-theme
*/
.str
{
color: #EC7600;
}
.kwd
{
color: #93C763;
}
.com
{
color: #66747B;
}
.typ
{
color: #678CB1;
}
.lit
{
color: #FACD22;
}
.pun
{
color: #F1F2F3;
}
.pln
{
color: #F1F2F3;
}
.tag
{
color: #8AC763;
}
.atn
{
color: #E0E2E4;
}
.atv
{
color: #EC7600;
}
.dec
{
color: purple;
}
pre.prettyprint
{
border: 0px solid #888;
}
ol.linenums
{
margin-top: 0;
margin-bottom: 0;
}
.prettyprint {
background: #000;
}
li.L0, li.L1, li.L2, li.L3, li.L4, li.L5, li.L6, li.L7, li.L8, li.L9
{
color: #555;
list-style-type: decimal;
}
li.L1, li.L3, li.L5, li.L7, li.L9 {
background: #111;
}
@media print
{
.str
{
color: #060;
}
.kwd
{
color: #006;
font-weight: bold;
}
.com
{
color: #600;
font-style: italic;
}
.typ
{
color: #404;
font-weight: bold;
}
.lit
{
color: #044;
}
.pun
{
color: #440;
}
.pln
{
color: #000;
}
.tag
{
color: #006;
font-weight: bold;
}
.atn
{
color: #404;
}
.atv
{
color: #060;
}
}

View File

@ -65,10 +65,12 @@ zerobin = {
{
if (localStorage.getItem(i).split(';')[0].split(' ')[0] == zerobin.get_date()){
var display_date = localStorage.getItem(i).split(';')[0].split(' ')[1];
var on_at = 'at ';
}else{
var display_date = zerobin.get_date();
var on_at = 'on ';
}
pastes = pastes + '<li><a class="items" href="' + localStorage.getItem(i).split(';')[1] + '">' + display_date + '</a></li>';
pastes = pastes + '<li><a class="items" href="' + localStorage.getItem(i).split(';')[1] + '">' + on_at + display_date + '</a></li>';
}
if (!pastes){
return '<i class="grey">Your previous pastes will be saved in your browser <a href="http://www.w3.org/TR/webstorage/">localStorage</a>.</i>';
@ -150,6 +152,21 @@ $('#content').live('keyup change', function(){
$('.previous-pastes .items').html(zerobin.get_pastes());
/* clone a paste */
$('.btn-clone').click(function(e){
e.preventDefault();
content_clone = '' ;
$("#paste-content li").each(function(index) {
content_clone = content_clone + $(this).text() + '\n';
});
$('.submit-form').show();
$('.paste-form').hide();
$('#content').val(content_clone);
$('#content').resize();
});
});

View File

@ -8,7 +8,7 @@
content="0bin is a client-side-encrypted
pastebin with a burn after reading feature">
<link rel="shortcut icon" href="/static/ico/favicon.ico">
<link rel="shortcut icon" href="/static/ico/favicon.ico">
<link href="/static/css/prettify.css" rel="stylesheet" />
<link href="/static/css/bootstrap.css" rel="stylesheet">
<link href="/static/css/style.css" rel="stylesheet">

View File

@ -1,5 +1,4 @@
<form class="well" method="post" action="/paste/create">
<p class="paste-option">
<label for="expiration" >Expiration:</label>
<select id="expiration" name="expiration">
@ -10,14 +9,12 @@
</select>
<button type="submit" class="btn btn-primary">Submit</button>
<p>
<p>
<textarea rows="10" style="width:100%;"
class="input-xlarge"
id="content" name="content"></textarea>
</p>
</form>
%rebase base

View File

@ -13,29 +13,52 @@
%end
%end
<div class="well">
<form action="/" method="get" accept-charset="utf-8">
<p>
<a href="#">Download</a>
<span class="paste-option btn-group top">
<button class="btn"><i class="icon-camera"></i>&nbsp;Clone</button>
<button class="btn">New Paste</button>
</span>
</p>
<div class="well paste-form">
<form action="/" method="get" accept-charset="utf-8">
<p>
<a href="#">Download</a>
<span class="paste-option btn-group top">
<button class="btn btn-clone"><i class="icon-camera"></i>&nbsp;Clone</button>
<button class="btn">New Paste</button>
</span>
</p>
<p>
<pre id="paste-content" class="prettyprint linenums">
<code>
{{ paste.content }}
</code>
</pre>
</p>
<p>
<pre id="paste-content" class="prettyprint linenums">
<code>
{{ paste.content }}
</code>
</pre>
</p>
<p class="paste-option btn-group bottom">
<button class="btn"><i class="icon-camera"></i>&nbsp;Clone</button>
<button class="btn">New Paste</button>
</p>
<p class="paste-option btn-group bottom">
<button class="btn btn-clone"><i class="icon-camera"></i>&nbsp;Clone</button>
<button class="btn">New Paste</button>
</p>
</form>
</form>
</div>
<!-- For cloning -->
<span class="submit-form">
<form class="well" method="post" action="/paste/create">
<p class="paste-option">
<label for="expiration" >Expiration:</label>
<select id="expiration" name="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>
<button type="submit" class="btn btn-primary">Submit</button>
<p>
<p>
<textarea rows="10" style="width:100%;"
class="input-xlarge"
id="content" name="content"></textarea>
</p>
</form>
</span>
%rebase base