From 3a20fb1e3a41a032574d227a8c770a11ae0a5d58 Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Tue, 21 Apr 2020 21:22:13 +0100 Subject: [PATCH] Twitter Plugin: Add warning if the wiki needs to be saved and reloaded --- plugins/tiddlywiki/twitter/startup.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 plugins/tiddlywiki/twitter/startup.js diff --git a/plugins/tiddlywiki/twitter/startup.js b/plugins/tiddlywiki/twitter/startup.js new file mode 100644 index 000000000..48d106541 --- /dev/null +++ b/plugins/tiddlywiki/twitter/startup.js @@ -0,0 +1,27 @@ +/*\ +title: $:/plugins/tiddlywiki/twitter/startup.js +type: application/javascript +module-type: startup + +Twitter initialisation + +\*/ +(function(){ + +/*jslint node: true, browser: true */ +/*global $tw: false */ +"use strict"; + +// Export name and synchronous status +exports.name = "twitter"; +exports.before = ["startup"]; +exports.synchronous = true; + +exports.startup = function() { + var logger = new $tw.utils.Logger("twitter-plugin"); + if($tw.browser && !window.twttr) { + logger.alert("The plugin 'tiddlywiki/twitter' is disabled until this wiki is saved and reloaded again"); + } +}; + +})();