Hello!
I am trying to build an Interactionmeckanism, were Useres can post
and
On
http://szen.io/Test/ it seems to work well... at least for me
becaus the speed of the connection seems to have impact on this.
I allows to import texts from my server that can be seen in an
Iframe in the sidebar, I hope this also works when you open it.
After all worked i transformed it into a plugin an entered it into
other Wikis like
https://www.szen.io/hak/ where it causes Network
errors.
You can reproduce this by clicking one of the posts in
$:/extensions/Interaction/ImportPosts
the reason seems to be
$:/extensions/Interaction/macros/geturltxt.js
The Modal gets its Text when it is called with hardcoded url, but
not something which is created and transcluded like this.
<$list filter="[[$:/Temp/URL]get[text]]" variable="url">
<$macrocall $name="geturltxt" url=<<url>> />
</$list>
Below is the code of the Macro. Do you have any suggestions to fix
this?
Tschö+Merci: Jan
/*\
title: $:/core/modules/macros/geturltxt.js
type: application/javascript
module-type: macro
Makro, das eine Textdatei darstellt
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Information about this macro
*/
exports.name = "geturltxt";
exports.params = [
{name: "url"}
];
/*
Run the macro
*/
exports.run = function(url) {
var client = new XMLHttpRequest();
var url = url.replace("+", "%20");
client.open('GET', url, false);
client.setRequestHeader('Content-type', 'Content-Type: text/html; charset=ISO-8859-1');
client.onreadystatechange = function() {
if (client.readyState == 4 && client.status == 200)
{
var urltext = unescape(client.responseText);
var fields = {title: '$:/Temp/URL-Text', text: urltext}
$tw.wiki.addTiddler(new $tw.Tiddler(fields))
}
}
client.send();
};
})();