diff --git a/README.md b/README.md index 587ef99..7c514d8 100644 --- a/README.md +++ b/README.md @@ -120,9 +120,18 @@ The published [Unicorn Theme](https://chrome.google.com/webstore/detail/unicorn- ### ext-darkedit-ntp *~12 users* -The published [DarkEdit New Tab](https://chrome.google.com/webstore/detail/darkedit-new-tab/lcjehgmglbjnagbdcbobefdbpeippiig) extension is available on the Chrome Web store. +The published [DarkEdit New Tab](https://chrome.google.com/webstore/detail/darkedit-new-tab/lcjehgmglbjnagbdcbobefdbpeippiig) extension is available on the Chrome Web Store. + +![darkedit-ntp-screenshot.png](/images/darkedit-ntp-screenshot.png?raw=true) + +### ext-newtab-memo + +The published [NewTab Memo](https://chrome.google.com/webstore/detail/newtab-memo/gmahiocgkhbehfpmdndjpppdehlccaoh) extension is available on the Chrome Web Store. + +![newtab-memo-screenshot-1.png](/images/newtab-memo-screenshot-1.png?raw=true) + +![newtab-memo-screenshot-2.png](/images/newtab-memo-screenshot-2.png?raw=true) -![darkedit-ntp-screenshot.png](/ext-darkedit-ntp/darkedit-ntp-screenshot.png?raw=true) ### Not Launched diff --git a/ext-newtab-memo/1.0.2/editor.js b/ext-newtab-memo/1.0.2/editor.js new file mode 100644 index 0000000..e8c2bca --- /dev/null +++ b/ext-newtab-memo/1.0.2/editor.js @@ -0,0 +1,107 @@ +/* editor.js +- Implement the memopad functionality in a Chrome browser new tab +- Allow saving, reseting, retrieving saved text +- Update memopad size settings according to changes set in the options + +*/ + +var storage = chrome.storage.local; + +var textarea = document.querySelector('textarea'); +var resetTextButton = document.querySelector('button.resetText'); +var saveTextButton = document.querySelector('button.saveText'); +var optionsButton = document.querySelector('button.optionsPage'); + +loadChanges(); +loadOptionChanges(); + +optionsButton.addEventListener('click', openOptions); +saveTextButton.addEventListener('click', saveChanges); +resetTextButton.addEventListener('click', resetChanges); + + +function saveChanges() { + var text = textarea.value; + + if (!text) { + alert("No text to save.") + } + else if (text) { + storage.set({'txt': text}); + } +} + +function resetChanges() { + // storage.clear would achieve the same thing. + storage.remove('txt'); + textarea.value = ''; +} + +function loadChanges() { + storage.get('txt', function(items) { + if (items.txt) { + textarea.value = items.txt; + } + }); + + adjustViewSize(); +} + +function openOptions() { + if (chrome.runtime.openOptionsPage) { + chrome.runtime.openOptionsPage(); + } + else { + window.open(chrome.runtime.getURL('options.html')) + } +} + +function loadOptionChanges() { + storage.get('css', function(items) { + if (items.css) { + // Load new CSS settings + document.getElementById("text-area").style = items.css; + document.getElementsByTagName("BODY")[0].style = items.css; + + adjustViewSize(); + } + }); +} + +function adjustViewSize() { + // Automatically adjust the textarea box depending on browser tab size + // Get the font size used in the text box + var textFontSizeLength = document.getElementById("text-area").style.fontSize.length; + // Slice out the "px" portion in the tail end + var textFontSizeRaw = document.getElementById("text-area").style.fontSize.slice(0, textFontSizeLength - 2); + // Split by "." and use the first number value as font size + var textFontSize = textFontSizeRaw.split(".")[0]; + + // For example, for font 12 = Approximating 1 row in Text area as 15 in height; font 10 = 13 + var adjustment_array = { + '8': 9.75, + '9': 11, + '10': 13, + '11': 14, + '12': 15, + '13': 16, + '14': 17, + '15': 18, + '16': 19.5, + '20': 24 + } + + if (adjustment_array[textFontSize]) { + var adjustment = adjustment_array[textFontSize]; + } else { + // Setting this as the default + adjustment = 15; + } + + var height = document.documentElement.clientHeight; + // Text box row formula; the "- 2" to leave room for Save, etc. buttons + document.getElementById("text-area").rows = ((height / adjustment) - 2); +} + + + diff --git a/ext-newtab-memo/1.0.2/icon-128.png b/ext-newtab-memo/1.0.2/icon-128.png new file mode 100644 index 0000000..a332761 Binary files /dev/null and b/ext-newtab-memo/1.0.2/icon-128.png differ diff --git a/ext-newtab-memo/1.0.2/icon-16.png b/ext-newtab-memo/1.0.2/icon-16.png new file mode 100644 index 0000000..0f6cea4 Binary files /dev/null and b/ext-newtab-memo/1.0.2/icon-16.png differ diff --git a/ext-newtab-memo/1.0.2/icon-48.png b/ext-newtab-memo/1.0.2/icon-48.png new file mode 100644 index 0000000..7b629d8 Binary files /dev/null and b/ext-newtab-memo/1.0.2/icon-48.png differ diff --git a/ext-newtab-memo/1.0.2/icon-mini.png b/ext-newtab-memo/1.0.2/icon-mini.png new file mode 100644 index 0000000..c6e6c21 Binary files /dev/null and b/ext-newtab-memo/1.0.2/icon-mini.png differ diff --git a/ext-newtab-memo/1.0.2/manifest.json b/ext-newtab-memo/1.0.2/manifest.json new file mode 100644 index 0000000..5ff353a --- /dev/null +++ b/ext-newtab-memo/1.0.2/manifest.json @@ -0,0 +1,23 @@ +{ + "name": "NewTab Memo", + "version": "1.0.2", + "description": "Transforms new tabs into memopads. Type, edit, and save.", + "chrome_url_overrides" : { + "newtab": "newTab.html" + }, + "browser_action": { + "default_icon": "icon-128.png", + "default_title": "NewTab Memopad", + "default_popup": "popup.html" + }, + "options_page": "options.html", + "permissions": [ + "storage" + ], + "manifest_version": 2, + "icons": { + "16": "icon-16.png", + "48": "icon-48.png", + "128": "icon-128.png" + } +} diff --git a/ext-newtab-memo/1.0.2/newTab.css b/ext-newtab-memo/1.0.2/newTab.css new file mode 100644 index 0000000..2ef5f96 --- /dev/null +++ b/ext-newtab-memo/1.0.2/newTab.css @@ -0,0 +1,49 @@ +/* Minimalist styling */ + +html { + /*background-color: gray;*/ + /*background-color: #404040;*/ + color: white; +} + +body { + background-color: #404040; + color: white; + font-family: monospace; + font-size: 14px; +} + +h2 { + color: white; + font-family: Monaco, monospace; +} + +h3 { + color: white; + font-family: Monaco, monospace; +} + +#text-area { + background-color: #404040; + border: none; + outline: none; + width: 100%; + + font-size: 12px; + font-family: monospace; + color: white; +} + +#button1 { + background-color: silver; + color: black; + border: none; + padding: 8px 15px; + text-align: center; + text-decoration: none; + display: inline-block; + font-size: 13px; + font-weight: bold; + font-family: monospace; +} + diff --git a/ext-newtab-memo/1.0.2/newTab.html b/ext-newtab-memo/1.0.2/newTab.html new file mode 100644 index 0000000..3b84f34 --- /dev/null +++ b/ext-newtab-memo/1.0.2/newTab.html @@ -0,0 +1,18 @@ + + + + + NewTab Memo + + +
+ + + + + + + + + + diff --git a/ext-newtab-memo/1.0.2/options.html b/ext-newtab-memo/1.0.2/options.html new file mode 100644 index 0000000..f8d0363 --- /dev/null +++ b/ext-newtab-memo/1.0.2/options.html @@ -0,0 +1,126 @@ + + + + + NewTab Memo - Options + +

 NewTab Memo Options

+ +
+ + + + + + + + + + + + + + + + + + + + + +

 Text Box and Page Options

Background Color: + + or + +
Text Color: + + or + +
Font Family: + + or + +
Font Size: + +
+
+ + + +
+ + + + diff --git a/ext-newtab-memo/1.0.2/options.js b/ext-newtab-memo/1.0.2/options.js new file mode 100644 index 0000000..ee40b0d --- /dev/null +++ b/ext-newtab-memo/1.0.2/options.js @@ -0,0 +1,75 @@ +/* options.js +- Handle optional customizations set by the user +- Allow reseting to the default settings + +*/ + +var storage = chrome.storage.local; + +var form = document.querySelector("form"); +var restoreDefaultsButton = document.querySelector('button.restoreDefaults'); + +form.addEventListener('submit', saveSettings); +restoreDefaultsButton.addEventListener('click', restoreDefaults); + + +function restoreDefaults() { + storage.remove('css'); + alert("Default settings restored."); +} + +function saveSettings() { + // Setting variables for CSS elements + // Choosing between the drop down or the custom input where needed + var newBackgroundColor1 = form.elements.bgColorCustom.value; + var newBackgroundColor2 = form.elements.bgColorSelect.value; + if (newBackgroundColor1) { + newBackgroundColor = newBackgroundColor1; + } else { + newBackgroundColor = newBackgroundColor2; + } + + var newTextColor1 = form.elements.textColorCustom.value; + var newTextColor2 = form.elements.textColorSelect.value; + if (newTextColor1) { + newTextColor = newTextColor1; + } else { + newTextColor = newTextColor2; + } + + var newFontFamily1 = form.elements.ftFamilyCustom.value; + var newFontFamily2 = form.elements.ftFamilySelect.value; + if (newFontFamily1) { + newFontFamily = newFontFamily1; + } else { + newFontFamily = newFontFamily2; + } + + var newFontSize = form.elements.ftSize.value + "px"; + + // Combine into single CSS statement + var newCSS = 'background-color: ' + newBackgroundColor + ';' + + 'color: ' + newTextColor + ';' + + 'font-family: ' + newFontFamily + ';' + + 'font-size: ' + newFontSize + ';'; + + // Storing CSS options + if (newBackgroundColor.length > 0 + || newTextColor.length > 0 + || newFontFamily.length > 0 + || newFontSize.length - 2 > 0) { + chrome.tabs.insertCSS({code: newCSS}, function() { + alert('Updated: ' + '\n' + + '- Background Color: ' + newBackgroundColor + '\n' + + '- Text Color: ' + newTextColor + '\n' + + '- Font Family: ' + newFontFamily + '\n' + + '- Font Size: ' + form.elements.ftSize.value + '\n' + )}); + storage.set({'css': newCSS}); + } +} + + + + + diff --git a/ext-newtab-memo/1.0.2/popup.html b/ext-newtab-memo/1.0.2/popup.html new file mode 100644 index 0000000..00b4bc0 --- /dev/null +++ b/ext-newtab-memo/1.0.2/popup.html @@ -0,0 +1,26 @@ + + + + + NewTab Memo + + + + + + + + + + + + +

NewTab Memo

Transforms new tabs into memopads:

+

Type,

+

Edit,

+

Save.

+
+
+ + + diff --git a/ext-newtab-memo/1.0.2/popup.js b/ext-newtab-memo/1.0.2/popup.js new file mode 100644 index 0000000..2266ab3 --- /dev/null +++ b/ext-newtab-memo/1.0.2/popup.js @@ -0,0 +1,23 @@ +/* editor.js +- Implement the memopad functionality in a Chrome browser new tab +- Allow saving, reseting, retrieving saved text +- Update memopad size settings according to changes set in the options + +*/ + +var storage = chrome.storage.local; + +var optionsButton2 = document.querySelector('button.optionsPage2'); + +optionsButton2.addEventListener('click', openOptions); + + +function openOptions() { + if (chrome.runtime.openOptionsPage) { + chrome.runtime.openOptionsPage(); + } + else { + window.open(chrome.runtime.getURL('options.html')) + } +} + diff --git a/ext-newtab-memo/crx/1.0.2.zip b/ext-newtab-memo/crx/1.0.2.zip new file mode 100644 index 0000000..9b3ec8f Binary files /dev/null and b/ext-newtab-memo/crx/1.0.2.zip differ diff --git a/ext-newtab-memo/promo/newtab-memo-screenshot-1.png b/ext-newtab-memo/promo/newtab-memo-screenshot-1.png new file mode 100644 index 0000000..16c35fe Binary files /dev/null and b/ext-newtab-memo/promo/newtab-memo-screenshot-1.png differ diff --git a/ext-newtab-memo/promo/newtab-memo-screenshot-2.png b/ext-newtab-memo/promo/newtab-memo-screenshot-2.png new file mode 100644 index 0000000..5d2a4b8 Binary files /dev/null and b/ext-newtab-memo/promo/newtab-memo-screenshot-2.png differ diff --git a/images/darkedit-ntp-screenshot.png b/images/darkedit-ntp-screenshot.png new file mode 100644 index 0000000..b58a6a0 Binary files /dev/null and b/images/darkedit-ntp-screenshot.png differ diff --git a/images/newtab-memo-screenshot-1.png b/images/newtab-memo-screenshot-1.png new file mode 100644 index 0000000..16c35fe Binary files /dev/null and b/images/newtab-memo-screenshot-1.png differ diff --git a/images/newtab-memo-screenshot-2.png b/images/newtab-memo-screenshot-2.png new file mode 100644 index 0000000..5d2a4b8 Binary files /dev/null and b/images/newtab-memo-screenshot-2.png differ