Add [is[binary]] operator

fix-syncer
Jeremy Ruston 2019-09-16 16:15:26 +01:00
rodzic 36498867d5
commit 1150c87edb
2 zmienionych plików z 12 dodań i 1 usunięć

Wyświetl plik

@ -221,6 +221,16 @@ exports.isImageTiddler = function(title) {
}
};
exports.isBinaryTiddler = function(title) {
var tiddler = this.getTiddler(title);
if(tiddler) {
var contentTypeInfo = $tw.config.contentTypeInfo[tiddler.fields.type || "text/vnd.tiddlywiki"];
return !!contentTypeInfo && contentTypeInfo.encoding === "base64";
} else {
return null;
}
};
/*
Like addTiddler() except it will silently reject any plugin tiddlers that are older than the currently loaded version. Returns true if the tiddler was imported
*/

Wyświetl plik

@ -1,5 +1,5 @@
created: 20140410103123179
modified: 20190225130632157
modified: 20190916151432497
tags: [[Filter Operators]] [[Common Operators]] [[Negatable Operators]]
title: is Operator
type: text/vnd.tiddlywiki
@ -16,6 +16,7 @@ The parameter <<.place C>> is one of the following fundamental categories:
|!Category |!Matches any tiddler title that... |
|^`current` |is the [[current tiddler|Current Tiddler]] |
|^`image` |has an image ContentType |
|^`binary` |has a binary ContentType |
|^`missing` |does not exist (other than possibly as a shadow tiddler), regardless of whether there are any links to it |
|^`orphan` |has no [[hard links|Hard and Soft Links]] to it |
|^`shadow` |is a [[shadow tiddler|ShadowTiddlers]], regardless of whether it has been overridden with a non-shadow tiddler |