1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-12-06 16:58:05 +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

@@ -43,7 +43,7 @@ exports.convertStyleNameToPropertyName = function(styleName) {
// Convert it by first removing any hyphens
var propertyName = $tw.utils.unHyphenateCss(styleName);
// Then check if it needs a prefix
if(document.body.style[propertyName] === undefined) {
if($tw.browser && document.body.style[propertyName] === undefined) {
var prefixes = ["O","MS","Moz","webkit"];
for(var t=0; t<prefixes.length; t++) {
var prefixedName = prefixes[t] + propertyName.substr(0,1).toUpperCase() + propertyName.substr(1);

View File

@@ -58,7 +58,11 @@ exports.httpRequest = function(options) {
if(data && !$tw.utils.hop(headers,"Content-type")) {
request.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=UTF-8");
}
request.send(data);
try {
request.send(data);
} catch(e) {
options.callback(e);
}
return request;
};