Skip to content

Commit

Permalink
v3.2-
Browse files Browse the repository at this point in the history
   - 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
  • Loading branch information
freginold authored Jan 26, 2017
1 parent d95150e commit 28dff3d
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 29 deletions.
54 changes: 52 additions & 2 deletions _note.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -141,6 +142,10 @@ button[disabled]:hover {
.optButton {
margin-bottom: 2px;
}
.btn-spacer {
display: block;
margin-top: 0.8em;
}
#noteList {
display: block;
margin: 5px;
Expand Down Expand Up @@ -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;
}
25 changes: 18 additions & 7 deletions _note.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand All @@ -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
Expand All @@ -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')) {
Expand Down Expand Up @@ -583,7 +585,7 @@ function goEdit(itemObj) {
uneditedString = itemObj.innerText;
if (!!editing) { showNotes(currentNote); }
editing = true;
var editBoxHTML = "<form name='editForm' onsubmit='event.returnValue=false;SubmitEdit(editBox.value);' action='#'><input type='text' size=50 id='editBox' /><input type='submit' style='color: green; margin-left: 2px;' value='Change' /><input type='button' style='color: red; margin-left: 2px;' value='Cancel' onclick='canceledEdit();' /></form>";
var editBoxHTML = "<form name='editForm' onsubmit='event.returnValue=false;SubmitEdit(editBox.value);' action='#'><input type='text' size=50 id='editBox' /><input type='submit' style='color: green; margin-left: 2px;' value='&#10004; Change' /><input type='button' style='color: red; margin-left: 2px;' value='&#10008; Cancel' onclick='canceledEdit();' /></form>";
document.getElementById(itemToEdit).innerHTML = editBoxHTML;
checkCoords(); // to set editBox size right away
document.getElementById('editBox').value = uneditedString;
Expand Down Expand Up @@ -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 ----------
Expand Down Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion _note.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""

Expand Down Expand Up @@ -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 --------------

Expand Down
43 changes: 24 additions & 19 deletions note.hta
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Scroll = no
Icon = "note_icon.ico"
navigable = no
version = "3.1.4"
version = "3.2"
>
<title>Note</title>
<link href='_note.css' rel='stylesheet' type='text/css'>
Expand Down Expand Up @@ -42,7 +42,7 @@
<td>
<input type='text' size=100 id='inputBox' />
</td><td>
<input type='submit' class='smallFont' value='Add at Bottom' /><br />
<input type='submit' class='smallFont' value='Add to Bottom' /><br />
</td></tr><tr><td></td><td>
<input type='button' class='smallFont' value='Insert Above ...' onclick='insertItem();' />
</td>
Expand All @@ -54,21 +54,21 @@
<br />
<table><tr>
<td class='optionsColumn'>
<h4>Background Color:</h4>
<label><input type='radio' name='bg' class='optionInput' value='gray' /> Gray &nbsp;<span class='goItalic'>(default)</span></label><br />
<label><input type='radio' name='bg' class='optionInput' value='yellow' /> Yellow</label><br />
<label><input type='radio' name='bg' class='optionInput' value='white' /> White</label><br />
<label><input type='radio' name='bg' class='optionInput' value='pink' /> Pink</label><br />
<label><input type='radio' name='bg' class='optionInput' value='green' /> Green</label><br />
<label><input type='radio' name='bg' class='optionInput' value='blue' /> Blue</label><br />
<label><input type='radio' name='bg' class='optionInput' value='orange' /> Orange</label><br />
<label><input type='radio' name='bg' class='optionInput' value='charcoal' /> Charcoal <span class='smallFont'>(w/ white text)</span></label><br />
<label><input type='radio' name='bg' class='optionInput' value='forestgreen' /> Forest Green <span class='smallFont'>(w/ white text)</span></label><br />
<label><input type='radio' name='bg' class='optionInput' value='brown' /> Brown <span class='smallFont'>(w/ white text)</span></label><br />
<label><input type='radio' name='bg' class='optionInput' value='black' /> Black <span class='smallFont'>(w/ white text)</span></label>
<h3>Background Color:</h3>
<label id='ltgrayL'><input type='radio' name='bg' class='optionInput' value='gray' /> Light Gray &nbsp;<span class='goItalic'>(default)</span> </label><br />
<label id='yellowL'><input type='radio' name='bg' class='optionInput' value='yellow' /> Yellow </label><br />
<label id='whiteL'><input type='radio' name='bg' class='optionInput' value='white' /> White </label><br />
<label id='pinkL'><input type='radio' name='bg' class='optionInput' value='pink' /> Pink </label><br />
<label id='ltgreenL'><input type='radio' name='bg' class='optionInput' value='green' /> Light Green </label><br />
<label id='ltblueL'><input type='radio' name='bg' class='optionInput' value='blue' /> Light Blue </label><br />
<label id='orangeL'><input type='radio' name='bg' class='optionInput' value='orange' /> Orange </label><br />
<label id='charcoalL'><input type='radio' name='bg' class='optionInput' value='charcoal' /> Charcoal </label><br />
<label id='fgreenL'><input type='radio' name='bg' class='optionInput' value='forestgreen' /> Forest Green </label><br />
<label id='brownL'><input type='radio' name='bg' class='optionInput' value='brown' /> Brown </label><br />
<label id='blackL'><input type='radio' name='bg' class='optionInput' value='black' /> Black </label>
</td>
<td class='optionsColumn'>
<h4>Note Font:</h4>
<h3>Note Font:</h3>
<label><input type='radio' name='font' id='localFontCheckBox0' class='optionInput' value='uf0' />
<div id='localFontDiv0' class='localFontDiv'> <span class='smallFont'>Choose any local font:</span>
<form name='localFontForm0' class='localFontForm' id='localFontForm0' onsubmit='setLocalFont(0);' action='#' >
Expand Down Expand Up @@ -115,8 +115,8 @@
</label>
<label class='sans'><input type='radio' name='font' class='optionInput' id='sansRadio' value='p1' /> Sans Serif</label><br />
<label class='serif'><input type='radio' name='font' class='optionInput' value='p2' /> Serif &nbsp;<span class='goItalic'>(default)</span></label>
<br /><br />
<h4>Note Font Size:</h4>
<br /><br /><br />
<h3>Note Font Size:</h3>
<label class='smallFont'><input type='radio' name='textSize' class='optionInput' value='small'> Small</label><br />
<label class='mediumFont'><input type='radio' name='textSize' class='optionInput' value='medium'> Medium &nbsp;<span class='goItalic'>(default)</span></label><br />
<label class='largeFont'><input type='radio' name='textSize' class='optionInput' value='large'> Large</label>
Expand All @@ -125,12 +125,17 @@
<input type='radio' name='screenPos' class='optionInput' value='mm'>
<input type='radio' name='screenPos' class='optionInput' value='cc'>
<button class='optButton' id='undeleteButton' onclick='Undelete()' disabled=true>Restore last deleted item</button><br />
<span class='btn-spacer'></span>
<button class='optButton' id='screenPosResetButton' onclick='resetPos();'>Reset Window Position</button><br />
<button class='optButton' id='screenSizeResetButton' onclick='resetSize();'>Reset Window Size</button><br />
<span class='btn-spacer'></span>
<button class='optButton' id='backupButton' onclick='dispBackupDiv();'>Backup...</button><br />
<h4>Status Bar:</h4>
<br /><br />
<h3>Status Bar:</h3>
<label><input type='radio' name='statusOption' class='optionInput' value='Hide' /> Hide</label><br />
<label><input type='radio' name='statusOption' class='optionInput' value='Show' /> Show&nbsp;<span class='goItalic'>(default)</span></label>
<label><input type='radio' name='statusOption' class='optionInput' value='Show' /> Show&nbsp;<span class='goItalic'>(default)</span></label><br />
<br /><br />
<button class='optButton' id='defaultButton' onclick='resetDefault();'>Restore All Default Settings</button>
</td>
</tr></table>
</div>
Expand Down

0 comments on commit 28dff3d

Please sign in to comment.