diff --git a/css/popup.css b/css/popup.css index 913ff37..3d70042 100644 --- a/css/popup.css +++ b/css/popup.css @@ -140,6 +140,35 @@ a.domain { text-decoration:none; cursor: default; } +.comment { + display: none; +} +ol[data-commentspage="true"] .comment { + display: block; +} +ol[data-commentspage="true"] button.cancel { + display: none; +} +.comment fieldset { + margin: 12px 0 0; + padding: 0; + border: 0; +} +.comment textarea { + display: block; + width: 100%; + margin: 0; + padding: 0; + border: 0; + box-shadow: inset 0px 0px 2px black; + font: normal small verdana, arial, helvetica, sans-serif; +} +.comment button { + margin: 5px 5px 0 0; +} +.comment .status { + color: red; +} .morelink { display:block; text-align:center; diff --git a/js/common.js b/js/common.js index 4ef4026..c60ef67 100644 --- a/js/common.js +++ b/js/common.js @@ -587,6 +587,21 @@ RedditAPI.prototype.reportPost = function (e) { e.srcElement.parentNode.innerHTML = 'reported!'; }; +/** + * Submits a comment. + * @alias RedditAPI.submitComment(event) + * @param {Object} event The event object. + * @return {Boolean} Returns true. + * @method + */ +RedditAPI.prototype.submitComment = function (e) { + var listItem, fullName; + + listItem = e.srcElement.parentNode.parentNode.parentNode; + fullName = listItem.id; + e.srcElement.parentNode.getElementsByClassName('status')[0].innerHTML = 'Not yet programmed. ID: ' + fullName; +}; + reddit = new RedditAPI('www.reddit.com'); /** @@ -648,11 +663,11 @@ Popup.prototype.createListHTML = function (url) { throw 'Cannot create list HTML for a non-cached URL.'; } - listHTML = '