From 685e6f6984b1e09447006dfd1321bffdb9a72bce Mon Sep 17 00:00:00 2001 From: max Date: Sun, 29 Apr 2012 00:55:00 +0700 Subject: [PATCH] added clone option --- static/css/style.css | 23 ++++++-- static/css/sunburst.css | 118 ++++++++++++++++++++++++++++++++++++++++ static/js/behavior.js | 19 ++++++- views/base.tpl | 2 +- views/home.tpl | 5 +- views/paste.tpl | 65 +++++++++++++++------- 6 files changed, 199 insertions(+), 33 deletions(-) create mode 100644 static/css/sunburst.css diff --git a/static/css/style.css b/static/css/style.css index 4633b57..26acd58 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -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; } diff --git a/static/css/sunburst.css b/static/css/sunburst.css new file mode 100644 index 0000000..9f6228a --- /dev/null +++ b/static/css/sunburst.css @@ -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; + } +} \ No newline at end of file diff --git a/static/js/behavior.js b/static/js/behavior.js index e4dcc50..edb2f35 100644 --- a/static/js/behavior.js +++ b/static/js/behavior.js @@ -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 + '
  • ' + display_date + '
  • '; + pastes = pastes + '
  • ' + on_at + display_date + '
  • '; } if (!pastes){ return 'Your previous pastes will be saved in your browser localStorage.'; @@ -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(); + +}); + + }); diff --git a/views/base.tpl b/views/base.tpl index 3d9309a..13652f4 100644 --- a/views/base.tpl +++ b/views/base.tpl @@ -8,7 +8,7 @@ content="0bin is a client-side-encrypted pastebin with a burn after reading feature"> - + diff --git a/views/home.tpl b/views/home.tpl index 36da4a5..ca70732 100644 --- a/views/home.tpl +++ b/views/home.tpl @@ -1,5 +1,4 @@
    -

    -

    - -
    + %rebase base \ No newline at end of file diff --git a/views/paste.tpl b/views/paste.tpl index f62895d..071d588 100644 --- a/views/paste.tpl +++ b/views/paste.tpl @@ -13,29 +13,52 @@ %end %end -
    -
    -

    - Download - - - - -

    +
    + +

    + Download + + + + +

    -

    -

    -    
    -      {{ paste.content }}
    -    
    -  
    -

    +

    +

    +	    
    +	      {{ paste.content }}
    +	    
    +	  
    +

    -

    - - -

    +

    + + +

    - +
    + + + +
    +

    + + + +

    +

    + +

    +
    +
    + + %rebase base \ No newline at end of file