Commit 40c8a850 authored by Xiaowu Zhang's avatar Xiaowu Zhang

add httpstorage check format

parent dc4e3bc8
...@@ -9616,7 +9616,6 @@ decodeURI, encodeURI*/ ...@@ -9616,7 +9616,6 @@ decodeURI, encodeURI*/
result, result,
index, index,
name, name,
type,
that = this; that = this;
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
xml.onerror = function (e) { xml.onerror = function (e) {
...@@ -9634,23 +9633,20 @@ decodeURI, encodeURI*/ ...@@ -9634,23 +9633,20 @@ decodeURI, encodeURI*/
result = result.substring(index + 7); result = result.substring(index + 7);
index = result.indexOf("\">"); index = result.indexOf("\">");
url = result.substring(0, index); url = result.substring(0, index);
if (url.indexOf(".mp3") === -1 && url.indexOf(".mp4") === -1 if (url.indexOf(".mp3") === -1) {
&& url.indexOf(".webm") === -1) { name = decodeURI(url);
rows.push({
"id": url,
"doc": {"title" : name,
"type" : "video/webm"}
});
result = result.substring(index + 2); result = result.substring(index + 2);
} else { } else {
if (url.indexOf(".mp4") !== -1) {
type = "video/mp4";
} else if (url.indexOf(".webm") !== -1 ) {
type = "audio/webm"
} else {
type = "audio/mp3";
}
name = decodeURI(url); name = decodeURI(url);
rows.push({ rows.push({
"id": url, "id": url,
"doc": {"title" : name, "doc": {"title" : name,
"type" : type "type" : "audio/mpeg"}
}
}); });
} }
} }
...@@ -9675,10 +9671,8 @@ decodeURI, encodeURI*/ ...@@ -9675,10 +9671,8 @@ decodeURI, encodeURI*/
.then(function (result) { .then(function (result) {
length = result.data.rows.length; length = result.data.rows.length;
for (i = 0; i < length; i += 1) { for (i = 0; i < length; i += 1) {
if ((result.data.rows[i].id === encodeURI(param._id)) if (result.data.rows[i].id === encodeURI(param._id)) { //xxx
|| (result.data.rows[i].id === param._id)) { //xxx return ({"data": {"title" : result.data.rows[i].doc.title}});
return ({"data": {"title" : result.data.rows[i].doc.title,
"type": result.data.rows[i].doc.type}});
} }
} }
}) })
...@@ -9713,6 +9707,11 @@ decodeURI, encodeURI*/ ...@@ -9713,6 +9707,11 @@ decodeURI, encodeURI*/
pro.then(command.success, command.error, command.notify); pro.then(command.success, command.error, command.notify);
}; };
httpStorage.prototype.put = function (command) {
command.success();
};
httpStorage.prototype.allDocs = function (command) { httpStorage.prototype.allDocs = function (command) {
this.getList() this.getList()
.then(command.success, command.error, command.notify); .then(command.success, command.error, command.notify);
......
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