'+html+''); @@ -184,27 +184,27 @@ function displayMessages(key, comments) { try { // Try to decrypt the paste. var cleartext = zeroDecipher(key, comments[0].data); } catch(err) { - $('div#cleartext').addClass('hidden'); - $('div#prettymessage').addClass('hidden'); - $('button#clonebutton').addClass('hidden'); + $('#cleartext').addClass('hidden'); + $('#prettymessage').addClass('hidden'); + $('#clonebutton').addClass('hidden'); showError('Could not decrypt data (Wrong key ?)'); return; } - setElementText($('div#cleartext'), cleartext); - setElementText($('pre#prettyprint'), cleartext); - urls2links($('div#cleartext')); // Convert URLs to clickable links. + setElementText($('#cleartext'), cleartext); + setElementText($('#prettyprint'), cleartext); + urls2links($('#cleartext')); // Convert URLs to clickable links. prettyPrint(); // 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)+'.').removeClass('hidden'); + if (comments[0].meta.expire_date) $('#remainingtime').removeClass('foryoureyesonly').text('This document will expire in '+secondsToHuman(comments[0].meta.remaining_time)+'.').removeClass('hidden'); if (comments[0].meta.burnafterreading) { - $('div#remainingtime').addClass('foryoureyesonly').text('FOR YOUR EYES ONLY. Don\'t close this window, this message can\'t be displayed again.').removeClass('hidden'); - $('button#clonebutton').addClass('hidden'); // Discourage cloning (as it can't really be prevented). + $('#remainingtime').addClass('foryoureyesonly').text('FOR YOUR EYES ONLY. Don\'t close this window, this message can\'t be displayed again.').removeClass('hidden'); + $('#clonebutton').addClass('hidden'); // Discourage cloning (as it can't really be prevented). } // If the discussion is opened on this paste, display it. if (comments[0].meta.opendiscussion) { - $('div#comments').html(''); + $('#comments').html(''); // For each comment. for (var i = 1; i < comments.length; i++) { var comment=comments[i]; @@ -212,9 +212,9 @@ function displayMessages(key, comments) { try { cleartext = zeroDecipher(key, comment.data); } catch(err) { } - var place = $('div#comments'); + var place = $('#comments'); // If parent comment exists, display below (CSS will automatically shift it right.) - var cname = 'div#comment_'+comment.meta.parentid + var cname = '#comment_'+comment.meta.parentid // If the element exists in page if ($(cname).length) { @@ -242,8 +242,8 @@ function displayMessages(key, comments) { place.append(divComment); } - $('div#comments').append(''); - $('div#discussion').removeClass('hidden'); + $('#comments').append(''); + $('#discussion').removeClass('hidden'); } } @@ -260,12 +260,12 @@ function open_reply(source, commentid) { + '
'+paste+''); newDoc.close(); @@ -455,7 +455,7 @@ function clonePaste() { history.replaceState(document.title, document.title, scriptLocation()); showStatus(''); - $('textarea#message').text($('div#cleartext').text()); + $('#message').text($('#cleartext').text()); } /** @@ -464,7 +464,7 @@ function clonePaste() { function newPaste() { stateNewPaste(); showStatus(''); - $('textarea#message').text(''); + $('#message').text(''); } /** @@ -472,8 +472,8 @@ function newPaste() { * (We use the same function for paste and reply to comments) */ function showError(message) { - $('div#status').addClass('errorMessage').text(message); - $('div#replystatus').addClass('errorMessage').text(message); + $('#status').addClass('errorMessage').text(message); + $('#replystatus').addClass('errorMessage').text(message); } /** @@ -484,22 +484,22 @@ function showError(message) { * @param boolean spin (optional) : tell if the "spinning" animation should be displayed. */ function showStatus(message, spin) { - $('div#replystatus').removeClass('errorMessage'); - $('div#replystatus').text(message); + $('#replystatus').removeClass('errorMessage'); + $('#replystatus').text(message); if (!message) { - $('div#status').html(' '); + $('#status').html(' '); return; } if (message == '') { - $('div#status').html(' '); + $('#status').html(' '); return; } - $('div#status').removeClass('errorMessage'); - $('div#status').text(message); + $('#status').removeClass('errorMessage'); + $('#status').text(message); if (spin) { var img = ''; - $('div#status').prepend(img); - $('div#replystatus').prepend(img); + $('#status').prepend(img); + $('#replystatus').prepend(img); } } @@ -549,28 +549,28 @@ $(function() { $('#noscript').hide(); // If "burn after reading" is checked, disable discussion. - $('input#burnafterreading').change(function() { + $('#burnafterreading').change(function() { if ($(this).is(':checked') ) { - $('div#opendisc').addClass('buttondisabled'); - $('input#opendiscussion').attr({checked: false}); - $('input#opendiscussion').attr('disabled',true); + $('#opendisc').addClass('buttondisabled'); + $('#opendiscussion').attr({checked: false}); + $('#opendiscussion').attr('disabled',true); } else { - $('div#opendisc').removeClass('buttondisabled'); - $('input#opendiscussion').removeAttr('disabled'); + $('#opendisc').removeClass('buttondisabled'); + $('#opendiscussion').removeAttr('disabled'); } }); // Display status returned by php code if any (eg. Paste was properly deleted.) - if ($('div#status').text().length > 0) { - showStatus($('div#status').text(),false); + if ($('#status').text().length > 0) { + showStatus($('#status').text(),false); return; } - $('div#status').html(' '); // Keep line height even if content empty. + $('#status').html(' '); // Keep line height even if content empty. // Display an existing paste - if ($('div#cipherdata').text().length > 1) { + if ($('#cipherdata').text().length > 1) { // Missing decryption key in URL ? if (window.location.hash.length == 0) { showError('Cannot decrypt paste: Decryption key missing in URL (Did you use a redirector or an URL shortener which strips part of the URL ?)'); @@ -578,7 +578,7 @@ $(function() { } // List of messages to display - var messages = jQuery.parseJSON($('div#cipherdata').text()); + var messages = jQuery.parseJSON($('#cipherdata').text()); // Show proper elements on screen. stateExistingPaste(); @@ -586,8 +586,8 @@ $(function() { displayMessages(pageKey(), messages); } // Display error message from php code. - else if ($('div#errormessage').text().length>1) { - showError($('div#errormessage').text()); + else if ($('#errormessage').text().length>1) { + showError($('#errormessage').text()); } // Create a new paste. else { diff --git a/tpl/bootstrap.html b/tpl/bootstrap.html new file mode 100644 index 0000000..77ea3e7 --- /dev/null +++ b/tpl/bootstrap.html @@ -0,0 +1,144 @@ + + + + + + + +