Journal javascript: Difference between revisions

From Cor ad Cor
Jump to navigation Jump to search
No edit summary
m (Text replacement - "--" to " — ")
 
(3 intermediate revisions by the same user not shown)
Line 27: Line 27:
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.
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.


== * ==
== * ==
Line 50: Line 58:
skelpara = document.getElementById("firstHeading");
skelpara = document.getElementById("firstHeading");
var tmpskel = skelpara.innerHTML;
var tmpskel = skelpara.innerHTML;
skelpara.innerHTML = tmpskel + ' -- ' + skel;
skelpara.innerHTML = tmpskel + ' —  ' + skel;


skelpara = document.getElementById("midlink");
skelpara = document.getElementById("midlink");

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.

*