I took a look at the browser's debugging console, where it reports:
streams.html:13257 Uncaught TypeError: Cannot read property 'toString' of null
$tw.utils.error @ streams.html:13257
$:/plugins/sq/streams/selection-vars-tweak.js:29 Uncaught TypeError: Cannot read property 'toString' of null
at TimeoutWidget.Widget.invokeActionString ($:/plugins/sq/streams/selection-vars-tweak.js:29)
at eval (TiddlyTools/Time/action-timeout.js:40)
Here's a summary of what occurs:
- The TiddlyTools/Time/AutoSaver countdown timer is processed by the <<countdown_tick>> macro,
- which is defined in TiddlyTools/Time/CountDown and is called from TiddlyTools/Time/Ticker,
- which is invoked once per second by TiddlyTools/Time/action-timeout.js,
- which uses the TWCore "invokeActionString()" method.
which has been "hijacked" by the Streams plugin code contained in $:/plugins/sq/streams/selection-vars-tweak.js,
Take note of these two lines from $:/plugins/sq/streams/selection-vars-tweak.js:
if(activeElement && selection && (activeElement.tagName === "INPUT" || activeElement.tagName === "TEXTAREA")) {
variables["selectionStart"] = activeElement.selectionStart.toString();
This is where the error actually occurs.
The problem is that the code is checking for activeElement.tagName === "INPUT", which is OK when the activeElement has a "selectionStart" property. However, in the AutoSaver settings panel, the "confirm before saving" checkbox is also an HTML "input" element, but because it is not a *text* element, it has no "selectionStart" property. Thus, attempting to invoke "toString()" throws the "Uncaught TypeError: Cannot read property 'toString' of null" error that is reported in the browser's debugging console and by the TiddlyWiki RMOD ("Red Message of Death").
Often activeElement will return a HTMLInputElement or HTMLTextAreaElement object if it has the text selection at the time. If so, you can get more detail by using the object's selectionStart and selectionEnd properties. Other times the focused element might be a <select> element (menu) or an <input> element, of type "button", "checkbox", or "radio".
The fix is to change the code in $:/plugins/sq/streams/selection-vars-tweak.js to ensure that when the activeElement.tagName === "INPUT", the activeElement.type === "text", which would then exclude "button", "checkbox", or "radio" input elements.
Something like this will do the trick:
if(activeElement && selection && ((activeElement.tagName === "INPUT" && activeElement.type === "TEXT") || activeElement.tagName === "TEXTAREA")) {
If you edit the $:/plugins/sq/streams/selection-vars-tweak.js shadow tiddler and change the line of code as shown above, that will bypass the problem until Saq can provide an update to the Streams plugin.
-e