Journal javascript: Difference between revisions
No edit summary |
m (Text replacement - "--" to " — ") |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
: | [[File:2017-05-17 8-13-16.png|thumb|300px]] | ||
[[File:2017-05-17 8-16-28.png|thumb|300px]] | |||
I have been keeping an occasional journal on my private wiki since the summer of 2013. | |||
- | Each year is one page. | ||
Each day is a secondary heading ("== day of the week, day of month, month =="). | |||
I got tired of doing the secondary headings by hand. | |||
So I cobbled together a little javascript. | |||
It puts today's date in the first heading of the page, as above. | |||
Today's date in the heading is a link. If I have made a journal entry today, the link will take me to the beginning of the entry. | |||
If I haven't made an entry today, then I click on the link marked by three asterisks: [[#*|***]] | |||
That link takes me to the bottom of the page, where my javascript has set up the markup I need to start an entry for the day. | |||
I mark and copy the markup. | |||
Then I click on the "[Edit]" link next to the asterisk. | |||
Then I go to the top of the edit window and paste the marked-up text to start the new section of the journal. | |||
As you can see from the second thumbnail, I like to keep some favorite prayers at the top of the page. If I scroll down to pray them, I don't want to have to scroll back up to find the link to the day's entry or the asterisk link. So I have those two links after the prayers. | |||
— — | |||
<div align="center" id="midlink"></div> | <div align="center" id="midlink"></div> | ||
<div align="center">[[#*|***]]</div> | <div align="center">[[#*|***]]</div> | ||
- | — — | ||
== Wednesday, 17 May == | |||
And now I have a new entry in my journal. | |||
It's hidden because it is in the next section of the wiki. | |||
[http://moleski.net/mxm/journal-tutorial.mp4 Here is a video tutorial] showing how the system works. | |||
== * == | == * == | ||
__NOTOC__ | |||
<html> | <html> | ||
<div id="skeleton"></div> | <div id="skeleton"></div> | ||
Line 23: | Line 58: | ||
skelpara = document.getElementById("firstHeading"); | skelpara = document.getElementById("firstHeading"); | ||
var tmpskel = skelpara.innerHTML; | var tmpskel = skelpara.innerHTML; | ||
skelpara.innerHTML = tmpskel + ' | skelpara.innerHTML = tmpskel + ' — ' + skel; | ||
skelpara = document.getElementById("midlink"); | skelpara = document.getElementById("midlink"); | ||
Line 31: | Line 66: | ||
</html> | </html> | ||
[[Category:Wiki]] | [[Category:Wiki Wisdom]] |
Latest revision as of 11:04, 10 December 2022
I have been keeping an occasional journal on my private wiki since the summer of 2013.
Each year is one page.
Each day is a secondary heading ("== day of the week, day of month, month ==").
I got tired of doing the secondary headings by hand.
So I cobbled together a little javascript.
It puts today's date in the first heading of the page, as above.
Today's date in the heading is a link. If I have made a journal entry today, the link will take me to the beginning of the entry.
If I haven't made an entry today, then I click on the link marked by three asterisks: ***
That link takes me to the bottom of the page, where my javascript has set up the markup I need to start an entry for the day.
I mark and copy the markup.
Then I click on the "[Edit]" link next to the asterisk.
Then I go to the top of the edit window and paste the marked-up text to start the new section of the journal.
As you can see from the second thumbnail, I like to keep some favorite prayers at the top of the page. If I scroll down to pray them, I don't want to have to scroll back up to find the link to the day's entry or the asterisk link. So I have those two links after the prayers.
— —
— —
Wednesday, 17 May
And now I have a new entry in my journal.
It's hidden because it is in the next section of the wiki.
Here is a video tutorial showing how the system works.
*