1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-11-13 22:07:15 +00:00

Add banner for binary tiddlers in edit mode

Makes it easier to add tags to a binary tiddler (eg a PDF).
This commit is contained in:
Jermolene
2014-05-02 09:43:39 +01:00
parent bced7124e4
commit a4294b55f0
5 changed files with 91 additions and 1 deletions

View File

@@ -56,7 +56,15 @@ EditWidget.prototype.execute = function() {
}
type = type || "text/vnd.tiddlywiki";
// Choose the appropriate edit widget
var editorType = this.wiki.getTiddlerText(EDITOR_MAPPING_PREFIX + type) || "text";
var editorType = this.wiki.getTiddlerText(EDITOR_MAPPING_PREFIX + type);
if(!editorType) {
var typeInfo = $tw.config.contentTypeInfo[type];
if(typeInfo && typeInfo.encoding === "base64") {
editorType = "binary";
} else {
editorType = "text";
}
}
// Make the child widgets
this.makeChildWidgets([{
type: "edit-" + editorType,