1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-11-16 07:17:21 +00:00

Limited implementation of external text tiddlers in the browser

Triggered by the discussion in #1917
This commit is contained in:
Jermolene
2015-08-29 16:33:04 +01:00
parent abd8201aaa
commit a204784c0c
7 changed files with 3756 additions and 3 deletions

View File

@@ -26,6 +26,23 @@ Attributes are stored as hashmaps of the following objects:
var WikiParser = function(type,text,options) {
this.wiki = options.wiki;
var self = this;
// Check for an externally linked tiddler
if($tw.browser && options._canonical_uri) {
$tw.utils.httpRequest({
url: options._canonical_uri,
type: "GET",
callback: function(err,data) {
if(!err) {
var tiddlers = self.wiki.deserializeTiddlers(".tid",data,self.wiki.getCreationFields())
if(tiddlers) {
self.wiki.addTiddlers(tiddlers);
}
}
}
});
text = "Loading external text from ''" + options._canonical_uri + "''\n\nIf this message doesn't disappear you may be using a browser that doesn't support external text in this configuration. See http://tiddlywiki.com/#ExternalText";
}
// Initialise the classes if we don't have them already
if(!this.pragmaRuleClasses) {
WikiParser.prototype.pragmaRuleClasses = $tw.modules.createClassesFromModules("wikirule","pragma",$tw.WikiRuleBase);