mirror of
https://codeberg.org/valpackett/tiddlypwa.git
synced 2025-12-06 02:30:48 -08:00
Plugin: save any JS module (inc. shadow overrides) to app html, fix #22
Also replace the theme-plugin-lang prefixes in the filter with the type&field check that matches saveTiddler
This commit is contained in:
parent
e97a4451c6
commit
e48955e5dc
2 changed files with 6 additions and 3 deletions
|
|
@ -1,3 +1,3 @@
|
|||
title: $:/plugins/valpackett/tiddlypwa/app-filter
|
||||
|
||||
-[is[tiddler]] [[$:/core]] [[$:/favicon.ico]] [[$:/SiteTitle]] [[$:/SiteSubtitle]] [[$:/language]] [[$:/theme]] [[$:/palette]] [prefix[$:/themes/]] [prefix[$:/plugins/]] [prefix[$:/languages/]]
|
||||
-[is[tiddler]] [[$:/core]] [[$:/favicon.ico]] [[$:/SiteTitle]] [[$:/SiteSubtitle]] [[$:/language]] [[$:/theme]] [[$:/palette]] [has[plugin-type]field:type[application/json]] [has[module-type]field:type[application/javascript]] -[prefix[$:/temp/]]
|
||||
|
|
|
|||
|
|
@ -837,14 +837,17 @@ Formatted with `deno fmt`.
|
|||
|
||||
saveTiddler(tiddler, cb) {
|
||||
if (tiddler.fields._is_skinny) {
|
||||
// Shouldn't get these, but just to be 100% sure.
|
||||
// This probably has prevented data loss in the Section Editor case #23
|
||||
return cb(null, '', 1);
|
||||
}
|
||||
if (tiddler.fields.title === '$:/Import') {
|
||||
// For some reason this is not in the default $:/config/SyncFilter but no one would want this actually stored.
|
||||
return cb(null, '', 1);
|
||||
}
|
||||
if (tiddler.fields.type === 'application/json' && tiddler.fields['plugin-type']) {
|
||||
if (
|
||||
(tiddler.fields.type === 'application/json' && tiddler.fields['plugin-type']) ||
|
||||
(tiddler.fields.type === 'application/javascript' && tiddler.fields['module-type'])
|
||||
) {
|
||||
// By ignoring the callback we make TW think there's something unsaved now, which there is!
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue