1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 03:57:21 +00:00

Do some content type jiggling with TiddlyWeb

To be fixed up later
This commit is contained in:
Jeremy Ruston 2012-11-18 14:57:54 +00:00
parent b962739f04
commit 951c53c982

View File

@ -202,6 +202,7 @@ Convert a TiddlyWeb JSON tiddler into a TiddlyWiki5 tiddler
*/
TiddlyWebSyncer.prototype.convertTiddler = function(tiddlerFields) {
var result = {};
// Transfer the fields, pulling down the `fields` hashmap
for(var f in tiddlerFields) {
switch(f) {
case "fields":
@ -214,6 +215,12 @@ TiddlyWebSyncer.prototype.convertTiddler = function(tiddlerFields) {
break;
}
}
// Some unholy freaking of content types
if(result.type === "text/javascript") {
result.type = "application/javascript";
} else if(!result.type || result.type === "None") {
result.type = "text/x-tiddlywiki-old";
}
return result;
};