submit again functionality with to Popup.replaceWithSubmitForm()

This commit is contained in:
Kerrick Long
2012-04-30 10:09:54 -05:00
parent 2d8a5cccd9
commit 6089dcff5b
3 changed files with 35 additions and 4 deletions
+9 -3
View File
@@ -2,12 +2,12 @@
"just_now": {
"message": "just now",
"description": "Describe that something just happened."
},
"a_minute_ago": {
"message": "a minute ago",
"description": "Describe that something happened a minute ago."
},
"a_minute_from_now": {
"message": "a minute from now",
@@ -291,6 +291,12 @@
"button_hide": {
"message": "hide this form"
},
"submit_again": {
"message": "submit again"
},
"cancel_submission": {
"message": "cancel submission"
},
"error_empty": {
"message": "There needs to be something here."
},
@@ -476,7 +482,7 @@
"content": "Mostly Harmless"
}
}
},
"group_orangered_notifications": {
"message": "$ORANGERED$ Notifications",
+5
View File
@@ -206,6 +206,11 @@ ol[data-commentspage="true"] button.cancel {
background-image:url('/pix/sprite.png');
background-position:-4px -43px;
}
.close-button {
position: absolute;
right: 8px;
bottom: 10px;
}
#submit fieldset {
background-color: #CEE3F8;
border: 0;
+21 -1
View File
@@ -1237,10 +1237,30 @@ Popup.prototype.createSubmitForm = function (tab) {
submitHTML += '<input type="button" id="submit_submit" onclick="reddit.submitLink(event, \'' + tab.id + '\')" value="' + chrome.i18n.getMessage('submit_page') + '" />';
submitHTML += '<span class="status"></span>'
submitHTML += '</form>';
return submitHTML;
}
/**
* Replace the contents of the popup with a submit form.
* @alias Popup.replaceWithSubmitForm()
* @return {Boolean} Returns true.
* @method
*/
Popup.prototype.replaceWithSubmitForm = function () {
var close;
chrome.tabs.getSelected(null, function(currTab) {
document.getElementById('body').style.width = '';
document.getElementById('body').innerHTML = popup.createSubmitForm(currTab);
close = document.createElement('button');
close = document.body.appendChild(close);
close.innerHTML = chrome.i18n.getMessage('cancel_submission');
close.className = 'close-button';
close.setAttribute('onclick', 'window.close()');
});
};
/**
* Show stale posts.
* @alias Popup.showStalePosts()