diff --git a/_locales/en_US/messages.json b/_locales/en_US/messages.json index a8f5b8e..e98a3c7 100644 --- a/_locales/en_US/messages.json +++ b/_locales/en_US/messages.json @@ -400,6 +400,18 @@ "orangered_action": { "message": "Click here to be taken to your inbox." }, + "url": { + "message": "url" + }, + "popular_choices": { + "message": "popular choices" + }, + "title": { + "message": "title" + }, + "suggest_title": { + "message": "suggest title" + }, "tab_preferences": { "message": "Preferences" }, diff --git a/css/popup.css b/css/popup.css index 37146a5..7150e57 100644 --- a/css/popup.css +++ b/css/popup.css @@ -204,4 +204,52 @@ ol[data-commentspage="true"] button.cancel { .morelink:hover .nub, .mlhn { background-image:url('/pix/sprite.png'); background-position:-4px -43px; -} \ No newline at end of file +} +#submit fieldset { + background-color: #CEE3F8; + border: 0; + border-radius: 4px; + padding: 5px 10px 10px 10px; + margin: 0 0 10px 0; + width:500px; + font-size: small; +} +#submit input[type="text"] { + width: 492px; + padding: 3px; + margin: 0 0 5px; + border: 1px solid gray; + height: 22px; +} +#submit input, #submit label { + display: block; + font-size: large; + margin: 0 0 5px; +} +#submit #your_label { + font-weight: normal; + display: block; + margin: 5px 0 0; +} +#submit #your_reddits { + list-style: none; + margin: 0; + padding: 0; +} +#submit #your_reddits li { + display: inline-block; + padding-right: 8px; + line-height: 125%; +} +#submit #your_reddits li a { + color: #369; + text-decoration: none; +} +#submit #submit_submit { + display: inline; + font-size: small; + margin-right: 10px; +} +#submit .status { + color: red; +} diff --git a/html/background.html b/html/background.html index b33169f..7182c66 100644 --- a/html/background.html +++ b/html/background.html @@ -16,6 +16,10 @@ button.setBadgeDefaults(); chrome.tabs.onUpdated.addListener(background.prepareBrowserAction); background.watchMail(); + reddit.apiTransmit('GET', 'http://' + reddit.domain + '/reddits/mine.json', null, function (response) { + cache.set('reddits', response.data.children); + console.log(cache.get('reddits')); + }); } window.onload = initBackground; diff --git a/html/popup.html b/html/popup.html index bacc95a..f526151 100644 --- a/html/popup.html +++ b/html/popup.html @@ -17,7 +17,7 @@ document.getElementById('body').innerHTML = popup.createListHTML(currTab.url); document.getElementById('body').style.width = settings.get('popupWidth') + 'px'; } else { - document.getElementById('body').innerHTML = popup.createSubmitForm(currTab.url); + document.getElementById('body').innerHTML = popup.createSubmitForm(currTab); } }); } diff --git a/js/common.js b/js/common.js index 416c098..07dcca9 100644 --- a/js/common.js +++ b/js/common.js @@ -954,13 +954,43 @@ Popup.prototype.createListHTML = function (url) { /** * Create the HTML for a submission form. - * @alias Popup.createSubmitForm(url) - * @param {String} url The URL of the page to create the HTML for. + * @alias Popup.createSubmitForm(tab) + * @param {String} tab The Google Chrome Tab object. * @return {String} Returns the generated Form. * @method */ -Popup.prototype.createSubmitForm = function (url) { - return 'Submit form not yet programmed.'; +Popup.prototype.createSubmitForm = function (tab) { + var submitHTML, redditCache; + + redditCache = cache.get('reddits'); + submitHTML = '
'; + + return submitHTML; } /**