the format is exports.startup = function() { var fields = Object.create(null);fields.title="testing";fields.text="hi"; if($tw.browser) {$tw.wiki.addTiddler(new $tw.Tiddler($tw.wiki.getModificationFields(),fields,$tw.wiki.getCreationFields()))}
} On Monday, December 19, 2016 at 11:41:05 AM UTC+1, sini-Kit wrote: > > /*changes to tiddlers*/ - what code must be here if I want to create > tiddler $:/_FlagSpecialCss with text field "yes"? > > понедельник, 19 декабря 2016 г., 12:08:15 UTC+3 пользователь BJ написал: >> >> The only part of the tw api defined in the boot prefix is the modules >> system. This can be used to conditionally create a startup module that will >> change tiddlers: >> >> >> if (/* time is between 1 and 5*/){ >> $tw.modules.define("my_startup","startup", >> function(module,exports,require){ >> >> /*jslint node: true, browser: true */ >> /*global $tw: false */ >> "use strict"; >> >> // Export name and synchronous status >> exports.name = "mystartup"; >> exports.after = ["startup"]; >> exports.synchronous = true; >> >> >> exports.startup = function() { >> >> /*changes to tiddlers*/ >> >> } >> return exports; >> }); >> >> all the best >> BJ >> >> On Sunday, December 18, 2016 at 9:22:25 PM UTC+1, Siniy-Kit wrote: >>> >>> Hi! I am writing a little script to $:/boot/bootprefix.js. This script >>> connects to other site time API, get time from it and if hours in this time >>> between 1 and 5 it must change css styles of tw5 >>> so I want this script to add tag $:/tags/Stylesheet to mycssstyle >>> tiddler. I write the first part with time, but don't know TW5 function to >>> add tag to tiddler >>> >>> found >>> >>> FieldManglerWidget.prototype.handleRemoveTagEvent = function(event) >>> >>> FieldManglerWidget.prototype.handleAddTagEvent = function(event) >>> >>> >>> but I don't understand how to use this functions. >>> >> -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/c5e4aa64-ba2b-420a-981a-7e3764a52c07%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.