From 28dff3d5d5502d6a993c623fb328e940d1989f3a Mon Sep 17 00:00:00 2001 From: freginold Date: Thu, 26 Jan 2017 06:57:05 -0500 Subject: [PATCH] v3.2- - added option to reset configuration back to default settings - added spacer element between some option buttons - added check and X icons to edit buttons - now shows available colors on options screen, instead of just listing them - increased size of options screen headings and space between options sections --- _note.css | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- _note.js | 25 ++++++++++++++++++------- _note.vbs | 11 ++++++++++- note.hta | 43 ++++++++++++++++++++++++------------------- 4 files changed, 104 insertions(+), 29 deletions(-) diff --git a/_note.css b/_note.css index 4c8fb88..b114f51 100644 --- a/_note.css +++ b/_note.css @@ -3,9 +3,10 @@ body { font-family: serif; color: black; } -h4 { - margin-bottom: 2px; +h3 { + margin-bottom: 5px; text-decoration: underline; + font-family: Georgia, Cambria, serif; } input[name=screenPos] { display: none; @@ -141,6 +142,10 @@ button[disabled]:hover { .optButton { margin-bottom: 2px; } +.btn-spacer { + display: block; + margin-top: 0.8em; +} #noteList { display: block; margin: 5px; @@ -237,3 +242,48 @@ button[disabled]:hover { font-size: 0.8em; font-family: serif; } + +#ltgrayL { + background-color: lightgray; + color: black; +} +#yellowL { + background-color: #f0f0b3; + color: black; +} +#whiteL { + background-color: #fefefe; + color: black; +} +#pinkL { + background-color: #ff90aa; + color: black; +} +#ltgreenL { + background-color: #bfe9bf; + color: black; +} +#ltblueL { + background-color: #a9d6df; + color: black; +} +#orangeL { + background-color: #ffcf5f; + color: black; +} +#charcoalL { + background-color: #555555; + color: #ffffff; +} +#fgreenL { + background-color: #228542; + color: #ffffff; +} +#brownL { + background-color: #a88042; + color: #ffffff; +} +#blackL { + background-color: #222222; + color: #eeeeee; +} diff --git a/_note.js b/_note.js index 0afd8b9..bdfef22 100644 --- a/_note.js +++ b/_note.js @@ -206,7 +206,6 @@ function saveOptions() { else { Opt9 = 'mm'; Opt10 = 0; Opt11 = 0; } if (document.getElementsByName('statusOption')[0].checked) { Opt12 = 'hide'; } else { Opt12 = 'show'; } - WriteOptions(); applyOptions(); showOptions(); @@ -501,7 +500,8 @@ function displayAbout() { } function checkCoords() { - // check current coordinates, also check current size to adjust div heights + // check current coordinates, also check window size to adjust element sizes + // check current app height to adjust div heights if ((screen.availHeight > 650) && (document.documentElement.clientHeight > 380)) { noteBody.style.height = document.documentElement.clientHeight - 350; optionsDiv.style.height = document.documentElement.clientHeight - 300; @@ -513,6 +513,7 @@ function checkCoords() { noteList.style.display = 'none'; statusBar.style.display = 'none'; } + // set noteBody width noteBody.style.width = document.documentElement.clientWidth * 0.96; if (opt12 == 'show') { // check if too thin for status bar @@ -524,6 +525,7 @@ function checkCoords() { else { statusBarText.style.visibility = 'visible'; } } } + // set inputBox length var tempSize = 100 - (((NoteWidth - document.documentElement.clientWidth) / NoteWidth) * 100); inputBox.size = tempSize; if (!!document.getElementById('editBox')) { @@ -583,7 +585,7 @@ function goEdit(itemObj) { uneditedString = itemObj.innerText; if (!!editing) { showNotes(currentNote); } editing = true; - var editBoxHTML = "
"; + var editBoxHTML = "
"; document.getElementById(itemToEdit).innerHTML = editBoxHTML; checkCoords(); // to set editBox size right away document.getElementById('editBox').value = uneditedString; @@ -765,8 +767,19 @@ function resetPos() { document.getElementById('screenPosResetButton').disabled = true; } -function showSize() { alert("O: " + Opt14 + " " + Opt15 + "\nDef: " + NoteWidth + " " + NoteHeight); } - // for testing +function resetDefault() { + // restore all settings back to default values + var beSure = confirm('Are you sure you want to reset all settings?\nAll options will go back to their default values.\ + \nThis change can not be undone.'); + if (!!beSure) { + DelOptionsFile(); + OptionsCorrupted(0); + resetPos(); + resetSize(); + applyOptions(); + showOptions(); + } +} // ----------- declare event handlers ---------- @@ -822,8 +835,6 @@ clearAll(); getOffset(); applyOptions(); getDefaultSize(); -//Opt14 = NoteWidth; -//Opt15 = NoteHeight; window.resizeTo(Opt14, Opt15); // set initial size correctSize(); // to get correct window size setPos(); // set initial position diff --git a/_note.vbs b/_note.vbs index a9dd4c9..69175d3 100644 --- a/_note.vbs +++ b/_note.vbs @@ -51,7 +51,7 @@ Const InvalidFNMsg1 = "Invalid File Name." Const InvalidFNMsg2 = "The following characters are prohibited:" NewFileWithPath = "" -NoteWidth = round(screen.availWidth/1.5) +NoteWidth = round(screen.availWidth/1.47) NoteHeight = round(screen.availHeight/1.31) EditedString = "" @@ -601,6 +601,15 @@ Function ShowDefaultBackup ShowDefaultBackup = fs.GetFolder(Opt13) & "\" End Function +Sub DelOptionsFile + ' delete config file to reset options back to default values + if fs.FileExists(OptionsFile) then + fs.DeleteFile(OptionsFile) + Else + msgbox "File Error: Operation could not be performed", 48 + End If +End Sub + ' ---------- execution -------------- diff --git a/note.hta b/note.hta index e5d46d0..6fc6210 100644 --- a/note.hta +++ b/note.hta @@ -9,7 +9,7 @@ Scroll = no Icon = "note_icon.ico" navigable = no - version = "3.1.4" + version = "3.2" > Note @@ -42,7 +42,7 @@ -
+
@@ -54,21 +54,21 @@
-

Background Color:

-
-
-
-
-
-
-
-
-
-
- +

Background Color:

+
+
+
+
+
+
+
+
+
+
+
-

Note Font:

+

Note Font: