Swap over to the new mime type conventions

Discussed in
https://groups.google.com/forum/#!topic/tiddlywikidev/re8xfLqZNCE
This commit is contained in:
Jeremy Ruston
2012-11-18 15:22:13 +00:00
parent 744699fa35
commit 84650b9a54
41 changed files with 49 additions and 49 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ $tw.config.fileExtensionInfo = {
// Content type mappings
$tw.config.contentTypeInfo = {
"text/x-tiddlywiki": {encoding: "utf8", extension: ".tid"},
"text/vnd.tiddlywiki": {encoding: "utf8", extension: ".tid"},
"application/x-tiddler": {encoding: "utf8", extension: ".tid"},
"application/x-tiddler-html-div": {encoding: "utf8", extension: ".tiddler"},
"application/x-tiddlywiki-recipe": {encoding: "utf8", extension: ".recipe"},
+1 -1
View File
@@ -1,5 +1,5 @@
title: $:/messages/Download
type: text/x-tiddlywiki
type: text/vnd.tiddlywiki
subtitle: Download changes
footer: <<button close class:"btn btn-primary"><Close>>
help: http://five.tiddlywiki.com/#help:DownloadingChanges
+1 -1
View File
@@ -1,5 +1,5 @@
title: $:/messages/EnterEditMode
type: text/x-tiddlywiki
type: text/vnd.tiddlywiki
subtitle: Editing this wiki
footer: <<button close class:"btn btn-primary"><Close>>
help: http://five.tiddlywiki.com/#help:EditMode
+1 -1
View File
@@ -1,5 +1,5 @@
title: $:/messages/SaveInstructions
type: text/x-tiddlywiki
type: text/vnd.tiddlywiki
subtitle: Save your work
footer: <<button close class:"btn btn-primary"><Close>>
help: http://five.tiddlywiki.com/#help:SavingChanges
+1 -1
View File
@@ -53,7 +53,7 @@ exports.executeMacro = function() {
Editor = this.wiki.macros.edit.editors[tiddler.fields.type];
}
if(!Editor) {
Editor = this.wiki.macros.edit.editors["text/x-tiddlywiki"];
Editor = this.wiki.macros.edit.editors["text/vnd.tiddlywiki"];
}
this.editor = new Editor(this);
// Call the editor to generate the child nodes
@@ -145,7 +145,7 @@ TextEditor.prototype.refreshInDom = function() {
this.fixHeight();
};
exports["text/x-tiddlywiki"] = TextEditor;
exports["text/vnd.tiddlywiki"] = TextEditor;
exports["text/plain"] = TextEditor;
})();
+1 -1
View File
@@ -102,7 +102,7 @@ exports.getTiddlerList = function() {
Create and execute the nodes representing the empty message
*/
exports.getEmptyMessage = function() {
var nodes = this.wiki.parseText("text/x-tiddlywiki",this.params.emptyMessage).tree;
var nodes = this.wiki.parseText("text/vnd.tiddlywiki",this.params.emptyMessage).tree;
for(var c=0; c<nodes.length; c++) {
nodes[c].execute(this.parents,this.tiddlerTitle);
}
+1 -1
View File
@@ -99,7 +99,7 @@ exports.executeMacro = function() {
}
// Get the render tree for the template
if(this.hasParameter("templateText")) {
renderTemplateTree = this.wiki.parseText("text/x-tiddlywiki",this.params.templateText).tree;
renderTemplateTree = this.wiki.parseText("text/vnd.tiddlywiki",this.params.templateText).tree;
} else {
if(this.hasParameter("template")) {
renderTemplateTitle = this.params.template;
+1 -1
View File
@@ -32,7 +32,7 @@ WikifiedViewer.prototype.render = function() {
parents = parents.slice(0);
parents.push(this.tiddler.fields.title);
} else {
children = this.viewMacro.wiki.parseText("text/x-tiddlywiki",this.value).tree;
children = this.viewMacro.wiki.parseText("text/vnd.tiddlywiki",this.value).tree;
}
// Clone and execute the parsed wikitext
for(t=0; t<children.length; t++) {
@@ -63,13 +63,13 @@ JavaScriptParser.prototype.parse = function(type,code) {
element = "div";
classes.push("javascript-block-comment");
content.push($tw.Tree.Text("/*"));
content.push.apply(content,self.wiki.parseText("text/x-tiddlywiki",text).tree);
content.push.apply(content,self.wiki.parseText("text/vnd.tiddlywiki",text).tree);
content.push($tw.Tree.Text("*/"));
} else {
element = "span";
classes.push("javascript-line-comment");
content.push($tw.Tree.Text("//"));
content.push.apply(content,self.wiki.parseText("text/x-tiddlywiki-run",text).tree);
content.push.apply(content,self.wiki.parseText("text/vnd.tiddlywiki-run",text).tree);
content.push($tw.Tree.Text("\n"));
}
result.push($tw.Tree.Element(element,{"class": classes},content));
+2 -2
View File
@@ -58,7 +58,7 @@ TiddlyTextParser.prototype.parse = function(type,text) {
return new $tw.Renderer(output,dependencies);
};
exports["text/x-tiddlywiki-css"] = TiddlyTextParser;
exports["text/x-tiddlywiki-html"] = TiddlyTextParser;
exports["text/vnd.tiddlywiki-css"] = TiddlyTextParser;
exports["text/vnd.tiddlywiki-html"] = TiddlyTextParser;
})();
@@ -288,12 +288,12 @@ WikiTextParser.prototype.parse = function(type,text) {
return new WikiTextRenderer(text,{
wiki: this.wiki,
parser: this,
isRun: type === "text/x-tiddlywiki-run"
isRun: type === "text/vnd.tiddlywiki-run"
});
};
exports["text/x-tiddlywiki"] = WikiTextParser;
exports["text/vnd.tiddlywiki"] = WikiTextParser;
exports["text/x-tiddlywiki-run"] = WikiTextParser;
exports["text/vnd.tiddlywiki-run"] = WikiTextParser;
})();
+2 -2
View File
@@ -61,7 +61,7 @@ Modal.prototype.display = function(title,options) {
} else {
titleText = title;
}
var headerRenderer = this.wiki.parseText("text/x-tiddlywiki-run",titleText);
var headerRenderer = this.wiki.parseText("text/vnd.tiddlywiki-run",titleText);
headerRenderer.execute([],title);
headerRenderer.renderInDom(headerTitle);
this.wiki.addEventListener("",function(changes) {
@@ -95,7 +95,7 @@ Modal.prototype.display = function(title,options) {
} else {
footerText = "<<button close class:'btn btn-primary'><Close>>";
}
var footerRenderer = this.wiki.parseText("text/x-tiddlywiki-run",footerText);
var footerRenderer = this.wiki.parseText("text/vnd.tiddlywiki-run",footerText);
footerRenderer.execute([],title);
footerRenderer.renderInDom(modalFooterButtons);
this.wiki.addEventListener("",function(changes) {
+2 -2
View File
@@ -397,7 +397,7 @@ exports.initParsers = function(moduleType) {
}
});
// Install the rules for the old wikitext parser rules
var wikitextparser = this.parsers["text/x-tiddlywiki-old"];
var wikitextparser = this.parsers["text/vnd.tiddlywiki2"];
if(wikitextparser) {
wikitextparser.installRules();
}
@@ -418,7 +418,7 @@ exports.parseText = function(type,text,options) {
parser = this.parsers[$tw.config.fileExtensionInfo[type].type];
}
if(!parser) {
parser = this.parsers[options.defaultType || "text/x-tiddlywiki"];
parser = this.parsers[options.defaultType || "text/vnd.tiddlywiki"];
}
if(!parser) {
return null;
+1 -1
View File
@@ -1,5 +1,5 @@
title: $:/templates/StaticContent
type: text/x-tiddlywiki
type: text/vnd.tiddlywiki
<<! For Google, and people without JavaScript >>
((( [!is[shadow]sort[title]] )) <div><<view title text>></div> )
+1 -1
View File
@@ -1,5 +1,5 @@
title: $:/core/templates/static.template.html
type: text/x-tiddlywiki-html
type: text/vnd.tiddlywiki-html
<!doctype html>
<head>
@@ -1,5 +1,5 @@
title: $:/core/templates/tiddlywiki5.encrypted.template.html
type: text/x-tiddlywiki-html
type: text/vnd.tiddlywiki-html
<!doctype html>
<head>
+1 -1
View File
@@ -1,5 +1,5 @@
title: $:/core/templates/tiddlywiki5.template.html
type: text/x-tiddlywiki-html
type: text/vnd.tiddlywiki-html
<!doctype html>
<head>
+1 -1
View File
@@ -1,4 +1,4 @@
title: $:/core/wiki/title
type: text/x-tiddlywiki
type: text/vnd.tiddlywiki
<<tiddler SiteTitle>> --- <<tiddler SiteSubtitle>>