Creating WG Calendar Links with WGALINKS

The WGALINKS wizard was developed to enable WG coordinators to quickly create calendar links in an announcement, which will be communicated through the site notification system to users subscribed to the post.

It is activated by doing the following while editing a post:

  1. Enter the tag WGALINKS (contained in square brackets) into the text box
  2. Hit tab
  3. Fill out the wizard as instructed by the popups

If tab does not work, e.g. Safari browser, you can also click outside the composing window to trigger the wizard.

Once the wizard completes successfully, you may need to click out of the text box or enter another keystroke to have the preview pane update.

Provided this information is parsed as valid, it will create formatted HTML, links etc. with a place for you to enter further details (i.e. Agendas)

Once the post is saved, it will be placed into the site queue for notification. This could be anywhere 0-10mins so it is best to ensure the text is correct before saving so as to not rebroadcast the message to users.

Where is the code that controls this?

The code that controls the WGALINKS functionality is injected into the site HTML head tag via a theme component. This lives in Admin > Customise > Components > WGALINKS > EDIT CSS/HTML > HEAD

Direct Link: https://forum.access-hive.org.au/admin/customize/components/21/common/head_tag/edit

(You will require administrative rights to access/edit this section of the site).

The code is pure javascript with the exception of the moment.js library for date parsing.

Troubleshooting

The system should be fairly straightforward, however, certain browser settings may restrict some or all of the custom javascript that runs the link wizard.

The system outputs errors to the console - open your browser’s developer tools and navigate to console for further details.

Further issues, contact Ben S.

Safari uses ⟨TAB⟩ to navigate between elements on a webpage. This means it “swallows” the keypress and it doesn’t make it through to the web app, so the wizard doesn’t appear reliably. I have managed to get it to work in the past with some fiddling and repeated key presses, but failed most recently and had to resort to shudder Chrome.

Is there another key combo we can use to fire off the wizard?

A click outside the composing window should work. It worked for me and it should be more reliable.

1 Like

@ben I’ve changed the original post to be a wiki so it is editable later on. I don’t think we need to worry about anyone editing and making a mess for the fun of it.

Incidentally, the event listener is on the “onchange” method of the text box. As per standards, any act that vacates the editor should trigger the wizard, TAB or otherwise.

I can take a look at the DOM and see if there is a more reliable event that could be tracked.

Leave it with me.

Can we make this post public? Lots of community folks create event invite’s too

1 Like