Hello Eric,
воскресенье, 10 ноября 2013 г., 21:29:48 UTC+4 пользователь Eric Shulman
написал:
>
> On Sunday, November 10, 2013 9:24:38 AM UTC-8, Yakov wrote:
>
>> * ... recalc the styling on change of the ColorPalette
>>
> Any ideas?
>>
>
> Try adding this to your plugin:
> store.addNotification("ColorPalette",refreshStyles);
>
> This didn't work.. This thing:
var refreshMyStyles = function(smth,doc) {
refreshStyles("MyStyleSheetTiddler",doc); }
store.addNotification("ColorPalette",refreshMyStyles);
worked partially: with this changes were "applied to" MyStyleSheet(Tiddler)
when I edited ColorPalette manually. Editing programmaticaly didn't invoked
the notifier, though, until I used saveTiddler function which does the job:
goNight: function() { // doesn't check or change the cookie-parameter
var paletteName = "ColorPalette",
paletteTid = store.fetchTiddler(paletteName);
this.dayPalette = {
tid: paletteTid ? paletteTid : null,
shadow: paletteTid ? null : config.shadowTiddlers[paletteName]
};
var nigthTid = new Tiddler(paletteName);
nigthTid.assign(null,this.nightCPText)
store.saveTiddler(nigthTid); // attach the tiddler, recalc slices,
invoke notifiers
applySectionCSS("TextBoxColors");
applySectionCSS("FewerColors");
},
goDay: function() { // doesn't check or change the cookie-parameter
var paletteName = "ColorPalette";
if(this.dayPalette.shadow)
config.shadowTiddlers[paletteName] = this.dayPalette.shadow;
store.removeTiddler(paletteName); // to recalc slices of
ColorPalette
if(this.dayPalette.tid)
store.saveTiddler(this.dayPalette.tid);
removeStyleSheet("TextBoxColors");
removeStyleSheet("FewerColors");
},
Now I have to remove the baked night mode ColorPalette and use shadow one
with manual notifying to avoid situations when saving in the night mode
makes the ColorPalette permanently night.
Thanks for the pointer.
Best regards,
Yakov.
enjoy,
> -e
> Eric Shulman
> TiddlyTools / ELS Design Studios
>
> HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...
> http://TiddlyTools.github.com/fundraising.html#MakeADonation
>
> Professional TiddlyWiki Consulting Services...
> Analysis, Design, and Custom Solutions:
> http://www.TiddlyTools.com/#Contact
>
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/groups/opt_out.