kopia lustrzana https://github.com/miklobit/TiddlyWiki5
				
				
				
			Swap over to the new mime type conventions
Discussed in https://groups.google.com/forum/#!topic/tiddlywikidev/re8xfLqZNCEprint-window-tiddler
							rodzic
							
								
									744699fa35
								
							
						
					
					
						commit
						84650b9a54
					
				|  | @ -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,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,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,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 | ||||
|  |  | |||
|  | @ -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; | ||||
| 
 | ||||
| })(); | ||||
|  |  | |||
|  | @ -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); | ||||
| 	} | ||||
|  |  | |||
|  | @ -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; | ||||
|  |  | |||
|  | @ -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)); | ||||
|  |  | |||
|  | @ -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; | ||||
| 
 | ||||
| })(); | ||||
|  |  | |||
|  | @ -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) { | ||||
|  |  | |||
|  | @ -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,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,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,5 +1,5 @@ | |||
| title: $:/core/templates/tiddlywiki5.template.html | ||||
| type: text/x-tiddlywiki-html | ||||
| type: text/vnd.tiddlywiki-html | ||||
| 
 | ||||
| <!doctype html> | ||||
| <head> | ||||
|  |  | |||
|  | @ -1,4 +1,4 @@ | |||
| title: $:/core/wiki/title | ||||
| type: text/x-tiddlywiki | ||||
| type: text/vnd.tiddlywiki | ||||
| 
 | ||||
| <<tiddler SiteTitle>> --- <<tiddler SiteSubtitle>> | ||||
|  | @ -1,5 +1,5 @@ | |||
| title: $:/core/templates/tiddlywiki2.template.html | ||||
| type: text/x-tiddlywiki-html | ||||
| type: text/vnd.tiddlywiki-html | ||||
| 
 | ||||
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||||
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| title: HelloThere | ||||
| modifier: JeremyRuston | ||||
| tags: introduction greetings | ||||
| type: text/x-tiddlywiki | ||||
| type: text/vnd.tiddlywiki | ||||
| modified: 201208121934 | ||||
| 
 | ||||
| Welcome to TiddlyWiki5, a reboot of TiddlyWiki, the reusable non-linear personal web notebook [[first released in 2004|History]]. It is a complete interactive wiki in JavaScript that can be run from a single HTML file in the browser or as a powerful [[node.js application|node.js]]. | ||||
|  |  | |||
|  | @ -6,7 +6,7 @@ tags: docs internals | |||
| 
 | ||||
| The heart of TiddlyWiki can be seen as an extensible representation transformation engine. Given the text of a tiddler and its associated ContentType, the engine can produce a rendering of the tiddler in a new ContentType. Furthermore, it can efficiently selectively update the rendering to track any changes in the tiddler or its dependents. | ||||
| 
 | ||||
| The most important transformations are from `text/x-tiddlywiki` wikitext into `text/html` or `text/plain` but the engine is used throughout the system for other transformations, such as converting images for display in HTML, sanitising fragments of JavaScript, and processing CSS. | ||||
| The most important transformations are from `text/vnd.tiddlywiki` wikitext into `text/html` or `text/plain` but the engine is used throughout the system for other transformations, such as converting images for display in HTML, sanitising fragments of JavaScript, and processing CSS. | ||||
| 
 | ||||
| You can explore this mechanism by opening the JavaScript console in your browser. Typing this command will replace the text of the tiddler `HelloThere` with new content: | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
| title: WikiText | ||||
| type: text/x-tiddlywiki | ||||
| type: text/vnd.tiddlywiki | ||||
| tags: docs concepts | ||||
| 
 | ||||
| WikiText is a concise, expressive way of typing a wide range of text formatting, hypertext and interactive features. It allows you to focus on writing without a complex user interface getting in the way. It is somewhat similar to [[MarkDown|http://daringfireball.net/projects/markdown/]], but with more of a focus on linking and the interactive features. | ||||
|  |  | |||
|  | @ -13,13 +13,13 @@ The parse tree is built when needed, and then cached by the WikiStore until the | |||
| 
 | ||||
| TiddlyWiki5 uses multiple parsers: | ||||
| 
 | ||||
| * Wikitext ({{{text/x-tiddlywiki}}}) in `js/WikiTextParser.js` | ||||
| * Wikitext ({{{text/vnd.tiddlywiki}}}) in `js/WikiTextParser.js` | ||||
| * JavaScript ({{{text/javascript}}}) in `js/JavaScriptParser.js` | ||||
| * Images ({{{image/png}}} and {{{image/jpg}}}) in `js/ImageParser.js` | ||||
| * JSON ({{{application/json}}}) in `js/JSONParser.js` | ||||
| Additional parsers are planned: | ||||
| * CSS ({{{text/css}}}) | ||||
| * Recipe ({{{text/x-tiddlywiki-recipe}}}) | ||||
| * Recipe ({{{text/vnd.tiddlywiki-recipe}}}) | ||||
| 
 | ||||
| One global instance of each parser is instantiated in `js/App.js` and registered with the main WikiStore object. | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
| title: $:/plugins/dropbox/index.template.html | ||||
| type: text/x-tiddlywiki-html | ||||
| type: text/vnd.tiddlywiki-html | ||||
| 
 | ||||
| <!doctype html> | ||||
| <head> | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
| title: $:/plugins/dropbox/styles.template.css | ||||
| type: text/x-tiddlywiki-html | ||||
| type: text/vnd.tiddlywiki-html | ||||
| 
 | ||||
| /* utf8beacon: éçñøåá— */ | ||||
| <<serialize "[is[shadow]type[text/css]]" text/plain>> | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
| title: $:/plugins/dropbox/tw5dropbox.template.js | ||||
| type: text/x-tiddlywiki-html | ||||
| type: text/vnd.tiddlywiki-html | ||||
| 
 | ||||
| /* utf8beacon: éçñøåá— */ | ||||
| <<serialize "[is[shadow]type[application/javascript]library[yes]] -[[$:/library/sjcl.js]]" text/plain>> | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| title: HelloThere | ||||
| modifier: JeremyRuston | ||||
| tags: introduction greetings | ||||
| type: text/x-tiddlywiki | ||||
| type: text/vnd.tiddlywiki | ||||
| 
 | ||||
| Welcome to TiddlyWiki5, a reboot of TiddlyWiki, the reusable non-linear personal web notebook [[first released in 2004|History]]. It is a complete interactive wiki in JavaScript that can be run from a single HTML file in the browser or as a powerful [[node.js application|node.js]]. | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
| title: $:/plugins/dropbox/index.template.html | ||||
| type: text/x-tiddlywiki-html | ||||
| type: text/vnd.tiddlywiki-html | ||||
| 
 | ||||
| <!doctype html> | ||||
| <head> | ||||
|  |  | |||
|  | @ -424,7 +424,7 @@ $tw.plugins.dropbox.syncChanges = function(changes,wiki) { | |||
| 		var tiddler = wiki.getTiddler(title), | ||||
| 			filename = $tw.plugins.dropbox.titleInfo[title], | ||||
| 			contentType = tiddler ? tiddler.fields.type : null; | ||||
| 		contentType = contentType || "text/x-tiddlywiki"; | ||||
| 		contentType = contentType || "text/vnd.tiddlywiki"; | ||||
| 		var contentTypeInfo = $tw.config.contentTypeInfo[contentType], | ||||
| 			isNew = false; | ||||
| 		// Figure out the pathname of the tiddler
 | ||||
|  | @ -436,7 +436,7 @@ $tw.plugins.dropbox.syncChanges = function(changes,wiki) { | |||
| 		} | ||||
| 		// Push the appropriate task
 | ||||
| 		if(tiddler) { | ||||
| 			if(contentType === "text/x-tiddlywiki") { | ||||
| 			if(contentType === "text/vnd.tiddlywiki") { | ||||
| 				// .tid file
 | ||||
| 				q.push({ | ||||
| 					type: "save", | ||||
|  |  | |||
|  | @ -219,7 +219,7 @@ TiddlyWebSyncer.prototype.convertTiddler = function(tiddlerFields) { | |||
| 	if(result.type === "text/javascript") { | ||||
| 		result.type = "application/javascript"; | ||||
| 	} else if(!result.type || result.type === "None") { | ||||
| 		result.type = "text/x-tiddlywiki-old"; | ||||
| 		result.type = "text/vnd.tiddlywiki2"; | ||||
| 	} | ||||
| 	return result; | ||||
| }; | ||||
|  |  | |||
|  | @ -183,6 +183,6 @@ WikiTextParser.prototype.subWikifyTerm = function(output,terminatorRegExp) { | |||
| 	this.output = oldOutput; | ||||
| }; | ||||
| 
 | ||||
| exports["text/x-tiddlywiki-old"] = WikiTextParser; | ||||
| exports["text/vnd.tiddlywiki2"] = WikiTextParser; | ||||
| 
 | ||||
| })(); | ||||
|  |  | |||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							|  | @ -1,5 +1,5 @@ | |||
| title: EighthTiddler | ||||
| type: text/x-tiddlywiki-old | ||||
| type: text/vnd.tiddlywiki2 | ||||
| 
 | ||||
| <<tiddler SixthTiddler>> | ||||
| <<tiddler target:SixthTiddler>> | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
| title: Fifth Tiddler | ||||
| type: text/x-tiddlywiki-old | ||||
| type: text/vnd.tiddlywiki2 | ||||
| 
 | ||||
| |A caption above the table|c | ||||
| | Left | Middle | Right |h | ||||
|  |  | |||
|  | @ -1,4 +1,4 @@ | |||
| title: FirstTiddler | ||||
| type: text/x-tiddlywiki-old | ||||
| type: text/vnd.tiddlywiki2 | ||||
| 
 | ||||
| This is the ''text'' of the first tiddler, with a @@font-size:8em;color:red;link@@ to the SecondTiddler, too. And a link to http://tiddlywiki.com/. | ||||
|  |  | |||
|  | @ -1,4 +1,4 @@ | |||
| title: Fourth Tiddler | ||||
| type: text/x-tiddlywiki-old | ||||
| type: text/vnd.tiddlywiki2 | ||||
| 
 | ||||
| A missing image [img[Something.jpg]] and a $1 couple of Ç Ç "HTML Entity" | ||||
|  | @ -1,5 +1,5 @@ | |||
| title: SecondTiddler | ||||
| type: text/x-tiddlywiki-old | ||||
| type: text/vnd.tiddlywiki2 | ||||
| 
 | ||||
| !!Heading | ||||
| This is the second tiddler. It has a list: | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
| title: SeventhTiddler | ||||
| type: text/x-tiddlywiki-old | ||||
| type: text/vnd.tiddlywiki2 | ||||
| 
 | ||||
| <<echo {{2+2}}>> | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
| title: SixthTiddler | ||||
| type: text/x-tiddlywiki-old | ||||
| type: text/vnd.tiddlywiki2 | ||||
| modified: 20110211110621 | ||||
| modifier: Jermolene | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
| title: ThirdTiddler | ||||
| type: text/x-tiddlywiki-old | ||||
| type: text/vnd.tiddlywiki2 | ||||
| 
 | ||||
| An explicit link [[Fourth Tiddler]] and [[a pretty link|Fourth Tiddler]] and a transclusion <<tiddler [[Fourth Tiddler]] with:Stringy>> | ||||
| 
 | ||||
|  |  | |||
		Ładowanie…
	
		Reference in New Issue
	
	 Jeremy Ruston
						Jeremy Ruston