Skip to content

Commit

Permalink
fixed collapsing spaces issue,
Browse files Browse the repository at this point in the history
also coded version # into HTA head
  • Loading branch information
freginold authored Aug 17, 2016
1 parent 40d2cd5 commit 10c05db
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion _note.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var xElEnd = "'>X</div>";
var noteFont = 'serif';
var fgColor = 'black';
var selectedFlag = [false, false, false, false];
var currentVer = 'Note v2.5\nPublic Domain';
var currentVer = 'Note v' + Note.version + '\nPublic Domain';
var noteText, currentNote, dummyVar, bgColor;


Expand Down
11 changes: 8 additions & 3 deletions _note.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
' ----- set up variables, constants, & objects ------

'Option Explicit
Dim fs, NewFileWithPath, rfile, afile, tfile, rofile, FileName, line
Dim Opt1, Opt2, Opt3, Opt4, Opt5, Opt6, Opt7, Opt8
Dim fs, NewFileWithPath, rfile, afile, tfile, rofile, line
Dim Opt1, Opt2, Opt3, Opt4, Opt5, Opt6, Opt7, Opt8, Opt9
Dim NoteWidth, NoteHeight, LeftXPos, RightXPos, MidXPos, TopYPos, MidYPos, BottomYPos

Set fs = CreateObject("Scripting.FileSystemObject")
Expand Down Expand Up @@ -96,6 +96,7 @@ End Function
Function HideStamp(line)
' if set to hide time stamp, get line starting after 1st >
Dim segments, x, i, tempLine
line = Replace(line, "> ", ">", 1, 1)
segments = Split(line, ">")
i = 0
tempLine = ""
Expand Down Expand Up @@ -126,6 +127,10 @@ Function GetLine(dummyVar)
Case false
line = rfile.Readline
if LCase(Opt1) = "hide" then line = HideStamp(line)
' preserve spacing but don't prevent line breaking
line = Replace(line, " ", "&emsp;&ensp;")
line = Replace(line, " ", "&emsp;")
line = Replace(line, " ", "&ensp;")
Case Else
line = EOFConst
End Select
Expand All @@ -134,7 +139,7 @@ End Function

Sub AddNote(TempText, NoteName)
' append TempText to note file
' *** change this function call to an if statement; if true, add VbCrLf
Dim Filename
FileName = NotesDir + NoteName + ".txt"
Set afile=fs.openTextFile(FileName, 8, true)
afile.WriteLine(VbLf & date & ", " & time & " > " & TempText)
Expand Down
2 changes: 2 additions & 0 deletions note.hta
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
<meta charset="utf-8" />
<HTA:Application
ApplicationName = Note
ID = Note
Border = Thick
SingleInstance = yes
Scroll = no
Icon = "note_icon.ico"
version = "2.5"
>
<title>Note</title>
<link href='_note.css' rel='stylesheet' type='text/css'>
Expand Down

0 comments on commit 10c05db

Please sign in to comment.