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
+6
View File
@@ -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."
},
+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;
+20
View File
@@ -1241,6 +1241,26 @@ Popup.prototype.createSubmitForm = function (tab) {
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()