diff --git a/js/privatebin.js b/js/privatebin.js
index 85c71b6..6322c0e 100644
--- a/js/privatebin.js
+++ b/js/privatebin.js
@@ -135,26 +135,25 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
};
/**
- * set text of a DOM element (required for IE),
+ * set text of a jQuery element (required for IE),
*
* @name helper.setElementText
* @function
- * @param {Object} element - a DOM element
+ * @param {jQuery} $element - a jQuery element
* @param {string} text - the text to enter
- * @this is equivalent to element.text(text)
* @TODO check for XSS attacks, usually no CSS can prevent them so this looks weird on the first look
*/
- me.setElementText = function(element, text)
+ me.setElementText = function($element, text)
{
// For IE<10: Doesn't support white-space:pre-wrap; so we have to do this...
if ($('#oldienotice').is(':visible')) {
var html = me.htmlEntities(text).replace(/\n/ig, '\r\n
');
- element.html('
' + html + ''); + $element.html('
' + html + ''); } // for other (sane) browsers: else { - element.text(text); + $element.text(text); } }; @@ -163,19 +162,19 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) { * * @name helper.setMessage * @function - * @param {Object} element - a jQuery wrapped DOM element + * @param {jQuery} $element - a jQuery wrapped DOM element * @param {string} message - the message to append */ - me.setMessage = function(element, message) + me.setMessage = function($element, message) { - var content = element.contents(); + var content = $element.contents(); if (content.length > 0) { content[content.length - 1].nodeValue = ' ' + message; } else { - me.setElementText(element, message); + me.setElementText($element, message); } }; @@ -931,63 +930,68 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) { { $comments.html(''); + var $divComment; + // iterate over comments for (var i = 0; i < paste.comments.length; ++i) { var $place = $comments, comment = paste.comments[i], - commenttext = filter.decipher(key, password, comment.data), - // if parent comment exists, display below (CSS will automatically shift it to the right) - cname = '#comment_' + comment.parentid, - divComment = $('