Commit ebf0093c authored by Vincent Bechu's avatar Vincent Bechu

[documentstorage] allow all utf-8 character

parent 7ba58f18
/*jslint nomen: true*/ /*jslint nomen: true*/
/*global Blob, atob, btoa, RSVP*/ /*global Blob, RSVP, unescape, escape*/
(function (jIO, Blob, atob, btoa, RSVP) { (function (jIO, Blob, RSVP, unescape, escape) {
"use strict"; "use strict";
/** /**
* The jIO DocumentStorage extension * The jIO DocumentStorage extension
* *
...@@ -18,7 +17,13 @@ ...@@ -18,7 +17,13 @@
var DOCUMENT_EXTENSION = ".json", var DOCUMENT_EXTENSION = ".json",
DOCUMENT_REGEXP = new RegExp("^jio_document/([\\w=]+)" + DOCUMENT_REGEXP = new RegExp("^jio_document/([\\w=]+)" +
DOCUMENT_EXTENSION + "$"), DOCUMENT_EXTENSION + "$"),
ATTACHMENT_REGEXP = new RegExp("^jio_attachment/([\\w=]+)/([\\w=]+)$"); ATTACHMENT_REGEXP = new RegExp("^jio_attachment/([\\w=]+)/([\\w=]+)$"),
btoa = function (str) {
return window.btoa(unescape(encodeURIComponent(str)));
},
atob = function (str) {
return decodeURIComponent(escape(window.atob(str)));
};
function getSubAttachmentIdFromParam(id, name) { function getSubAttachmentIdFromParam(id, name) {
if (name === undefined) { if (name === undefined) {
...@@ -225,4 +230,4 @@ ...@@ -225,4 +230,4 @@
jIO.addStorage('document', DocumentStorage); jIO.addStorage('document', DocumentStorage);
}(jIO, Blob, atob, btoa, RSVP)); }(jIO, Blob, RSVP, unescape, escape));
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment