Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removed changes from other branch
  • Loading branch information
Joshua Steiner committed Sep 27, 2012
commit 5b0dd2259864e59658a99a7e34631e6b5fa37ced
16 changes: 8 additions & 8 deletions js/zerobin.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ function displayMessages(key, comments) {
try { // Try to decrypt the paste.
var cleartext = zeroDecipher(key, comments[0].data);
} catch(err) {
$('pre#cleartext').hide();
$('div#cleartext').hide();
$('button#clonebutton').hide();
showError('Could not decrypt data (Wrong key ?)');
return;
}
setElementText($('pre#cleartext'), cleartext);
urls2links($('pre#cleartext')); // Convert URLs to clickable links.
setElementText($('div#cleartext'), cleartext);
urls2links($('div#cleartext')); // Convert URLs to clickable links.

// Display paste expiration.
if (comments[0].meta.expire_date) $('div#remainingtime').removeClass('foryoureyesonly').text('This document will expire in '+secondsToHuman(comments[0].meta.remaining_time)+'.').show();
Expand Down Expand Up @@ -264,8 +264,8 @@ function send_data() {
var url = scriptLocation() + "?" + data.id + '#' + randomkey;
showStatus('');
$('div#pastelink').html('Your paste is <a href="' + url + '">' + url + '</a>').show();
setElementText($('pre#cleartext'), $('textarea#message').val());
urls2links($('pre#cleartext'));
setElementText($('div#cleartext'), $('textarea#message').val());
urls2links($('div#cleartext'));
showStatus('');
prettyPrint();
}
Expand Down Expand Up @@ -293,7 +293,7 @@ function stateNewPaste() {
$('div#pastelink').hide();
$('textarea#message').text('');
$('textarea#message').show();
$('pre#cleartext').hide();
$('div#cleartext').hide();
$('div#message').focus();
$('div#discussion').hide();
}
Expand All @@ -319,7 +319,7 @@ function stateExistingPaste() {
$('button#newbutton').show();
$('div#pastelink').hide();
$('textarea#message').hide();
$('pre#cleartext').show();
$('div#cleartext').show();
}

/**
Expand All @@ -328,7 +328,7 @@ function stateExistingPaste() {
function clonePaste() {
stateNewPaste();
showStatus('');
$('textarea#message').text($('pre#cleartext').text());
$('textarea#message').text($('div#cleartext').text());
}

/**
Expand Down
5 changes: 2 additions & 3 deletions tpl/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
<head>
<title>ZeroBin</title>
<link type="text/css" rel="stylesheet" href="css/zerobin.css?{$VERSION|rawurlencode}#" />
<link type="text/css" rel="stylesheet" href="../lib/google-code-prettify/prettify.css" />
<script src="js/jquery.js#"></script>
<script src="js/sjcl.js#"></script>
<script src="js/base64.js#"></script>
<script src="js/rawdeflate.js#"></script>
<script src="js/rawinflate.js#"></script>
<script src="js/zerobin.js?{$VERSION|rawurlencode}#"></script>
<script src="lib/google-code-prettify/prettify.js#"></script>

<!--[if lt IE 10]>
<style> body {padding-left:60px;padding-right:60px;} div#ienotice {display:block;} </style>
<![endif]-->
Expand Down Expand Up @@ -63,7 +62,7 @@ <h3>{$VERSION}</h3>
</div>
</div>
<div id="pastelink" style="display:none;"></div>
<pre id="cleartext" class="prettyprint" style="display:none;"></pre>
<div id="cleartext" class="prettyprint" style="display:none;"></div>
<textarea id="message" name="message" cols="80" rows="25" style="display:none;"></textarea>
<div id="discussion" style="display:none;">
<h4>Discussion</h4>
Expand Down