Merge branch 'soon' into staging
commit
5dacc6ceeb
|
@ -138,7 +138,7 @@ define([
|
|||
}
|
||||
postMessage("SET", {
|
||||
key:['drive'],
|
||||
value: data
|
||||
value: data.drive
|
||||
}, function (obj) {
|
||||
cb(obj);
|
||||
}, {
|
||||
|
|
|
@ -1036,6 +1036,9 @@ define([
|
|||
var isInSharedFolder = _isInSharedFolder;
|
||||
|
||||
/* Generic: doesn't need access to a proxy */
|
||||
var isValidDrive = function (Env, obj) {
|
||||
return Env.user.userObject.isValidDrive(obj);
|
||||
};
|
||||
var isFile = function (Env, el, allowStr) {
|
||||
return Env.user.userObject.isFile(el, allowStr);
|
||||
};
|
||||
|
@ -1131,6 +1134,7 @@ define([
|
|||
getUserObjectPath: callWithEnv(getUserObjectPath),
|
||||
isDuplicateOwned: callWithEnv(isDuplicateOwned),
|
||||
// Generic
|
||||
isValidDrive: callWithEnv(isValidDrive),
|
||||
isFile: callWithEnv(isFile),
|
||||
isFolder: callWithEnv(isFolder),
|
||||
isSharedFolder: callWithEnv(isSharedFolder),
|
||||
|
|
|
@ -72,8 +72,22 @@ define([
|
|||
a[TRASH] = {};
|
||||
a[FILES_DATA] = {};
|
||||
a[TEMPLATE] = [];
|
||||
a[SHARED_FOLDERS] = {};
|
||||
return a;
|
||||
};
|
||||
|
||||
var type = function (dat) {
|
||||
return dat === null? 'null': Array.isArray(dat)?'array': typeof(dat);
|
||||
};
|
||||
exp.isValidDrive = function (obj) {
|
||||
var base = exp.getStructure();
|
||||
return typeof (obj) === "object" &&
|
||||
Object.keys(base).every(function (key) {
|
||||
console.log(key, obj[key], type(obj[key]));
|
||||
return obj[key] && type(base[key]) === type(obj[key]);
|
||||
});
|
||||
};
|
||||
|
||||
var getHrefArray = function () {
|
||||
return [TEMPLATE];
|
||||
};
|
||||
|
|
|
@ -4245,6 +4245,10 @@ define([
|
|||
return;
|
||||
}
|
||||
history.sfId = false;
|
||||
|
||||
var ok = manager.isValidDrive(obj.drive);
|
||||
if (!ok) { return; }
|
||||
|
||||
copyObjectValue(files, obj.drive);
|
||||
appStatus.isReady = true;
|
||||
refresh();
|
||||
|
|
Loading…
Reference in New Issue