mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-11-29 21:45:16 +00:00
Fixes problem with drag and drop in Safari
Fixes #1415 The problem was that encodeURI() doesn’t encode slashes, which are not legal in a data URI, although only Safari was failing. We switch to encodeURIComponent(), which does encode slashes
This commit is contained in:
@@ -159,7 +159,7 @@ DropZoneWidget.prototype.importDataTypes = [
|
||||
}},
|
||||
{type: "URL", IECompatible: true, convertToFields: function(data) {
|
||||
// Check for tiddler data URI
|
||||
var match = decodeURI(data).match(/^data\:text\/vnd\.tiddler,(.*)/i);
|
||||
var match = decodeURIComponent(data).match(/^data\:text\/vnd\.tiddler,(.*)/i);
|
||||
if(match) {
|
||||
return JSON.parse(match[1]);
|
||||
} else {
|
||||
@@ -170,7 +170,7 @@ DropZoneWidget.prototype.importDataTypes = [
|
||||
}},
|
||||
{type: "text/x-moz-url", IECompatible: false, convertToFields: function(data) {
|
||||
// Check for tiddler data URI
|
||||
var match = decodeURI(data).match(/^data\:text\/vnd\.tiddler,(.*)/i);
|
||||
var match = decodeURIComponent(data).match(/^data\:text\/vnd\.tiddler,(.*)/i);
|
||||
if(match) {
|
||||
return JSON.parse(match[1]);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user