Skip to content

Commit c87714b

Browse files
Merge pull request #40 from ritishgumber/master
Rename functionality
2 parents 6741f3f + 6e99a59 commit c87714b

File tree

4 files changed

+12716
-8
lines changed

4 files changed

+12716
-8
lines changed

dist/.DS_Store

0 Bytes
Binary file not shown.

dist/cloudboost.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -16961,13 +16961,14 @@ return /******/ (function(modules) { // webpackBootstrap
1696116961
*/
1696216962

1696316963
_CB2.default.CloudFile = _CB2.default.CloudFile || function (file, data, type, path) {
16964-
if (!path) path = '/home';
16964+
if (!path) path = '/' + _CB2.default.appId;
1696516965
if (Object.prototype.toString.call(file) === '[object File]' || Object.prototype.toString.call(file) === '[object Blob]') {
1696616966

1696716967
this.fileObj = file;
1696816968
this.document = {
1696916969
_id: null,
1697016970
_type: 'file',
16971+
_tableName: '_File',
1697116972
ACL: new _CB2.default.ACL(),
1697216973
name: file && file.name && file.name !== "" ? file.name : 'default.file',
1697316974
size: file.size,
@@ -16984,6 +16985,7 @@ return /******/ (function(modules) { // webpackBootstrap
1698416985
this.document = {
1698516986
_id: null,
1698616987
_type: 'file',
16988+
_tableName: '_File',
1698716989
ACL: new _CB2.default.ACL(),
1698816990
name: '',
1698916991
size: '',
@@ -17003,6 +17005,7 @@ return /******/ (function(modules) { // webpackBootstrap
1700317005
this.document = {
1700417006
_id: null,
1700517007
_type: 'file',
17008+
_tableName: '_File',
1700617009
ACL: new _CB2.default.ACL(),
1700717010
name: file,
1700817011
size: '',
@@ -17016,7 +17019,8 @@ return /******/ (function(modules) { // webpackBootstrap
1701617019
} else {
1701717020
this.document = {
1701817021
_id: file,
17019-
_type: 'file'
17022+
_type: 'file',
17023+
_tableName: '_File'
1702017024
};
1702117025
}
1702217026
}
@@ -17094,8 +17098,7 @@ return /******/ (function(modules) { // webpackBootstrap
1709417098
}
1709517099

1709617100
var thisObj = this;
17097-
17098-
if (!this.fileObj && !this.data && this.type != 'folder') throw "You cannot save a file which is null";
17101+
if (!this.fileObj && !this.data && this.type != 'folder' && !this.url) throw "You cannot save a file which is null";
1709917102

1710017103
if (!this.data) {
1710117104
var params = new FormData();

src/CloudFile.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ import CB from './CB'
55

66
CB.CloudFile = CB.CloudFile || function(file, data, type, path) {
77
if (!path)
8-
path = '/home';
8+
path = '/' + CB.appId;
99
if (Object.prototype.toString.call(file) === '[object File]' || Object.prototype.toString.call(file) === '[object Blob]') {
1010

1111
this.fileObj = file;
1212
this.document = {
1313
_id: null,
1414
_type: 'file',
15+
_tableName: '_File',
1516
ACL: new CB.ACL(),
1617
name: (file && file.name && file.name !== "")
1718
? file.name
@@ -33,6 +34,7 @@ CB.CloudFile = CB.CloudFile || function(file, data, type, path) {
3334
this.document = {
3435
_id: null,
3536
_type: 'file',
37+
_tableName: '_File',
3638
ACL: new CB.ACL(),
3739
name: '',
3840
size: '',
@@ -52,6 +54,7 @@ CB.CloudFile = CB.CloudFile || function(file, data, type, path) {
5254
this.document = {
5355
_id: null,
5456
_type: 'file',
57+
_tableName: '_File',
5558
ACL: new CB.ACL(),
5659
name: file,
5760
size: '',
@@ -65,7 +68,8 @@ CB.CloudFile = CB.CloudFile || function(file, data, type, path) {
6568
} else {
6669
this.document = {
6770
_id: file,
68-
_type: 'file'
71+
_type: 'file',
72+
_tableName: '_File'
6973
}
7074
}
7175
}
@@ -143,8 +147,7 @@ CB.CloudFile.prototype.save = function(callback) {
143147
}
144148

145149
var thisObj = this;
146-
147-
if (!this.fileObj && !this.data && this.type != 'folder')
150+
if (!this.fileObj && !this.data && this.type != 'folder' && !this.url)
148151
throw "You cannot save a file which is null";
149152

150153
if (!this.data) {

0 commit comments

Comments
 (0)