mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-12 10:20:26 +00:00
WIP
This commit is contained in:
parent
3699780f90
commit
f3d0de2467
@ -68,6 +68,19 @@ HttpClient.prototype.handleHttpRequest = function(event) {
|
|||||||
contextVariables[name.substr(CONTEXT_VARIABLE_PARAMETER_PREFIX.length)] = value;
|
contextVariables[name.substr(CONTEXT_VARIABLE_PARAMETER_PREFIX.length)] = value;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// Set the request tracker tiddler
|
||||||
|
var requestTrackerTitle = this.wiki.generateNewTitle("$:/temp/HttpRequest");
|
||||||
|
this.wiki.addTiddler({
|
||||||
|
title: requestTrackerTitle,
|
||||||
|
tags: "$:/tags/HttpRequest",
|
||||||
|
text: JSON.stringify({
|
||||||
|
url: url,
|
||||||
|
type: method,
|
||||||
|
status: "inprogress",
|
||||||
|
headers: requestHeaders,
|
||||||
|
data: paramObject.body
|
||||||
|
})
|
||||||
|
});
|
||||||
$tw.utils.httpRequest({
|
$tw.utils.httpRequest({
|
||||||
url: url,
|
url: url,
|
||||||
type: method,
|
type: method,
|
||||||
@ -91,6 +104,10 @@ HttpClient.prototype.handleHttpRequest = function(event) {
|
|||||||
data: (data || "").toString(),
|
data: (data || "").toString(),
|
||||||
headers: JSON.stringify(headers)
|
headers: JSON.stringify(headers)
|
||||||
};
|
};
|
||||||
|
// Update the request tracker tiddler
|
||||||
|
self.wiki.addTiddler(new $tw.Tiddler(self.wiki.getTiddler(requestTrackerTitle),{
|
||||||
|
status: success,
|
||||||
|
}));
|
||||||
$tw.rootWidget.invokeActionString(completionActions,undefined,undefined,$tw.utils.extend({},contextVariables,results));
|
$tw.rootWidget.invokeActionString(completionActions,undefined,undefined,$tw.utils.extend({},contextVariables,results));
|
||||||
// console.log("Back!",err,data,xhr);
|
// console.log("Back!",err,data,xhr);
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user