mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-06-14 01:26:48 +00:00
More MIME type shenanigans
This commit is contained in:
parent
84650b9a54
commit
f07bc18204
|
@ -66,7 +66,7 @@ $tw.config.jsModuleHeaderRegExpString = "^\\/\\*\\\\\\n((?:^[^\\n]*\\n)+?)(^\\\\
|
||||||
$tw.config.fileExtensionInfo = {
|
$tw.config.fileExtensionInfo = {
|
||||||
".tid": {type: "application/x-tiddler"},
|
".tid": {type: "application/x-tiddler"},
|
||||||
".tiddler": {type: "application/x-tiddler-html-div"},
|
".tiddler": {type: "application/x-tiddler-html-div"},
|
||||||
".recipe": {type: "application/x-tiddlywiki-recipe"},
|
".recipe": {type: "application/vnd.tiddlywiki2-recipe"},
|
||||||
".txt": {type: "text/plain"},
|
".txt": {type: "text/plain"},
|
||||||
".css": {type: "text/css"},
|
".css": {type: "text/css"},
|
||||||
".html": {type: "text/html"},
|
".html": {type: "text/html"},
|
||||||
|
@ -85,7 +85,7 @@ $tw.config.contentTypeInfo = {
|
||||||
"text/vnd.tiddlywiki": {encoding: "utf8", extension: ".tid"},
|
"text/vnd.tiddlywiki": {encoding: "utf8", extension: ".tid"},
|
||||||
"application/x-tiddler": {encoding: "utf8", extension: ".tid"},
|
"application/x-tiddler": {encoding: "utf8", extension: ".tid"},
|
||||||
"application/x-tiddler-html-div": {encoding: "utf8", extension: ".tiddler"},
|
"application/x-tiddler-html-div": {encoding: "utf8", extension: ".tiddler"},
|
||||||
"application/x-tiddlywiki-recipe": {encoding: "utf8", extension: ".recipe"},
|
"application/vnd.tiddlywiki2-recipe": {encoding: "utf8", extension: ".recipe"},
|
||||||
"text/plain": {encoding: "utf8", extension: ".txt"},
|
"text/plain": {encoding: "utf8", extension: ".txt"},
|
||||||
"text/css": {encoding: "utf8", extension: ".css"},
|
"text/css": {encoding: "utf8", extension: ".css"},
|
||||||
"text/html": {encoding: "utf8", extension: ".html"},
|
"text/html": {encoding: "utf8", extension: ".html"},
|
||||||
|
|
|
@ -36,7 +36,7 @@ Command.prototype.execute = function() {
|
||||||
} else {
|
} else {
|
||||||
var fields = {title: self.params[0]},
|
var fields = {title: self.params[0]},
|
||||||
extname = path.extname(self.params[0]),
|
extname = path.extname(self.params[0]),
|
||||||
type = extname === ".html" ? "application/x-tiddlywiki" : extname;
|
type = extname === ".html" ? "application/vnd.tiddlywiki2" : extname;
|
||||||
var tiddlers = self.commander.wiki.deserializeTiddlers(type,data,fields);
|
var tiddlers = self.commander.wiki.deserializeTiddlers(type,data,fields);
|
||||||
if(!tiddlers) {
|
if(!tiddlers) {
|
||||||
self.callback("No tiddlers found in file \"" + self.params[0] + "\"");
|
self.callback("No tiddlers found in file \"" + self.params[0] + "\"");
|
||||||
|
|
|
@ -75,7 +75,7 @@ exports["application/json"] = function(text,fields) {
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
exports["application/x-tiddlywiki"] = function(text,fields) {
|
exports["application/vnd.tiddlywiki2"] = function(text,fields) {
|
||||||
var locateStoreArea = function(tiddlywikidoc) {
|
var locateStoreArea = function(tiddlywikidoc) {
|
||||||
var startSaveArea = '<div id="' + 'storeArea">',
|
var startSaveArea = '<div id="' + 'storeArea">',
|
||||||
startSaveAreaRegExp = /<div id=["']?storeArea['"]?>/gi,
|
startSaveAreaRegExp = /<div id=["']?storeArea['"]?>/gi,
|
||||||
|
|
|
@ -14,7 +14,7 @@ The idea is to process the recipe file recursively, loading tiddlers into the ma
|
||||||
/*global $tw: false */
|
/*global $tw: false */
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
exports["application/x-tiddlywiki-recipe"] = function(text,fields) {
|
exports["application/vnd.tiddlywiki2-recipe"] = function(text,fields) {
|
||||||
var self = this,
|
var self = this,
|
||||||
path = require("path"),
|
path = require("path"),
|
||||||
fs = require("fs"),
|
fs = require("fs"),
|
||||||
|
|
|
@ -54,4 +54,4 @@ These files are a straightforward array of hashmaps of name:value fields. Curren
|
||||||
|
|
||||||
TiddlyWiki HTML files contain a collection of tiddlers encoded in `<DIV>` format.
|
TiddlyWiki HTML files contain a collection of tiddlers encoded in `<DIV>` format.
|
||||||
|
|
||||||
//The ContentType `application/x-tiddlywiki` is used internally for these files//
|
//The ContentType `application/vnd.tiddlywiki2` is used internally for these files//
|
||||||
|
|
Loading…
Reference in New Issue
Block a user