Skip to content

Commit 8d9afb8

Browse files
committed
Fixed Google Drive integration issues.
There are still some remaining issues.
1 parent 833b2a9 commit 8d9afb8

File tree

9 files changed

+145
-144
lines changed

9 files changed

+145
-144
lines changed

package-lock.json

Lines changed: 15 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"markdownlint-cli": "^0.8.1",
2828
"mv": "^2.1.1",
2929
"nw": "^0.31.5",
30-
"nw-builder": "^3.5.6",
30+
"nw-builder": "^3.5.7",
3131
"replace-in-file": "^3.4.3",
3232
"rimraf": "^2.6.3"
3333
},

src/file_format/file_format.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,6 @@ cwc.fileFormat.File.prototype.loadJSON = function(data) {
519519
* @return {!Object}
520520
*/
521521
cwc.fileFormat.File.prototype.toJSON = function() {
522-
console.log(cwc.fileFormat.File.toJSON(this));
523522
return cwc.fileFormat.File.toJSON(this);
524523
};
525524

src/file_handler/file_saver.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ cwc.fileHandler.FileSaver = function(helper) {
6262
* @export
6363
*/
6464
cwc.fileHandler.FileSaver.prototype.saveFile = function(autoDetect = false) {
65-
this.log_.info('saveFile...');
6665
this.prepareContent();
6766
if (autoDetect && this.gDriveId) {
6867
this.saveGDriveFile(true);
@@ -78,7 +77,6 @@ cwc.fileHandler.FileSaver.prototype.saveFile = function(autoDetect = false) {
7877
* @export
7978
*/
8079
cwc.fileHandler.FileSaver.prototype.saveFileAs = function() {
81-
this.log_.info('saveFileAs...');
8280
this.prepareContent();
8381
this.selectFileToSave(this.filename, this.fileData);
8482
};
@@ -90,7 +88,7 @@ cwc.fileHandler.FileSaver.prototype.saveFileAs = function() {
9088
* @export
9189
*/
9290
cwc.fileHandler.FileSaver.prototype.saveGDriveFile = function(save_file) {
93-
this.log_.info('Save file in Google Drive', this.gDriveId);
91+
this.log_.info('Save file', this.filename, 'in Google Drive', this.gDriveId);
9492
let gDriveInstance = this.helper.getInstance('gapi').getDrive();
9593
this.prepareContent();
9694
if (save_file) {
@@ -105,7 +103,7 @@ cwc.fileHandler.FileSaver.prototype.saveGDriveFile = function(save_file) {
105103
* @export
106104
*/
107105
cwc.fileHandler.FileSaver.prototype.saveGCloudFile = function() {
108-
this.log_.info('Save file in Google Cloud');
106+
this.log_.info('Save file', this.filename, 'in Google Cloud');
109107
let gCloudInstance = this.helper.getInstance('gapi').getCloud();
110108
this.prepareContent();
111109
gCloudInstance.publishDialog(this.filename, this.fileData, this.mimeType);
@@ -116,6 +114,7 @@ cwc.fileHandler.FileSaver.prototype.saveGCloudFile = function() {
116114
* Prepares file and ensures we have the latest editor content.
117115
*/
118116
cwc.fileHandler.FileSaver.prototype.prepareContent = function() {
117+
this.log_.info('Prepare Content for saving file...');
119118
let editorInstance = this.helper.getInstance('editor');
120119
let fileInstance = this.helper.getInstance('file');
121120
let fileTitle = fileInstance.getFileTitle();
@@ -167,10 +166,12 @@ cwc.fileHandler.FileSaver.prototype.prepareContent = function() {
167166
*/
168167
cwc.fileHandler.FileSaver.prototype.addFileExtension = function(
169168
filename, extension = cwc.utils.mime.Type.CWC.ext[0]) {
170-
if (filename.includes(extension)) {
171-
return filename;
169+
console.log('addFileExtension', filename);
170+
if (!filename) {
171+
this.log_.error('Invalid filename', filename, 'for', extension);
172+
return;
172173
}
173-
return filename + extension;
174+
return filename.includes(extension) ? filename : filename + extension;
174175
};
175176

176177

src/ui/gapi/gdrive/gdrive.gss

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@
4848
font-weight: bold;
4949
}
5050

51+
#{$prefix}gdrive-wait {
52+
margin: auto;
53+
padding: 10px;
54+
width: 50%
55+
}
56+
5157
#{$prefix}gdrive-content {
5258
overflow: hidden;
5359
height: 450px;
@@ -56,8 +62,9 @@
5662
#{$prefix}gdrive-file_list {
5763
position: relative;
5864
min-width: 750px;
59-
height: 350px;
60-
overflow: scroll;
65+
height: 414px;
66+
overflow-y: scroll;
67+
overflow-x: auto;
6168
}
6269

6370
#{$prefix}gdrive-file_list td {
@@ -80,3 +87,7 @@
8087
width: 16px;
8188
height: 16px;
8289
}
90+
91+
#{$prefix}gdrive-file_list .mdl-data-table {
92+
min-width: 735px;
93+
}

0 commit comments

Comments
 (0)