-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
37b8249
commit c93cc91
Showing
15 changed files
with
181 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"path": "src", | ||
"fileId": "1tVx2IimBlEy63KKegPL_-a7vd0OLyfCfyz6GIi15Q96XIlgN6Yhcpxdm" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
var Cell = function (firstValue) { | ||
var value = firstValue || ""; | ||
this.setValue = function (newValue) { | ||
value = newValue; | ||
}; | ||
this.getValue = function () { | ||
return value; | ||
}; | ||
}; | ||
|
||
exports.Cell = Cell; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
var File = require('./File.js').File; | ||
var Folder = require('./Folder.js').Folder; | ||
|
||
var DriveApp = function () { | ||
return { | ||
Access: { | ||
ANYONE: 'ANYONE', | ||
ANYONE_WITH_LINK: 'ANYONE_WITH_LINK', | ||
DOMAIN: 'DOMAIN', | ||
DOMAIN_WITH_LINK: 'DOMAIN_WITH_LINK', | ||
PRIVATE: 'PRIVATE' | ||
}, | ||
Permission: { | ||
COMMENT: 'COMMENT', | ||
EDIT: 'EDIT', | ||
NONE: 'NONE', | ||
OWNER: 'OWNER', | ||
VIEW: 'VIEW' | ||
}, | ||
getFileById: function (id) { | ||
return new File(id); | ||
}, | ||
getFolderById: function (id) { | ||
return new Folder(id); | ||
} | ||
}; | ||
}; | ||
exports.DriveApp = DriveApp; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
var File = function (newId) { | ||
var properties = { | ||
id: newId || '', | ||
name: '' | ||
}; | ||
|
||
this.setSharing = function () {}; | ||
this.getId = function () { | ||
return properties.id; | ||
}; | ||
this.makeCopy = function (name, folder) { | ||
var newFile = new File(); | ||
newFile._setProperties(properties); | ||
newFile.setName(name); | ||
folder.addFile(newFile); | ||
return newFile; | ||
}; | ||
this.getName = function () { | ||
return properties.name; | ||
}; | ||
this.setName = function (newName) { | ||
properties.name = newName; | ||
}; | ||
this._setProperties = function (newProperties) { | ||
for (var propertie in newProperties) { | ||
properties[propertie] = newProperties[propertie]; | ||
} | ||
}; | ||
}; | ||
|
||
exports.File = File; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
var Folder = function (newId) { | ||
var files = [], | ||
id = newId || ''; | ||
this.getId = function () { | ||
return id; | ||
}; | ||
this.addFile = function (file) { | ||
files.push(file); | ||
}; | ||
this.getFiles = function () { | ||
return files; | ||
}; | ||
}; | ||
|
||
exports.Folder = Folder; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
var Range = function (myMatrix) { | ||
var matrix = myMatrix || [ | ||
[] | ||
]; | ||
this.getValues = function () { | ||
var values = []; | ||
for (var i = 0; i < matrix.length; i++) { | ||
values[i] = []; | ||
for (var j = 0; j < matrix[i].length; j++) { | ||
values[i][j] = matrix[i][j].getValue(); | ||
} | ||
} | ||
return values; | ||
}; | ||
|
||
this.setValue = function (value) { | ||
for (var i = 0; i < matrix.length; i++) { | ||
for (var j = 0; j < matrix.length; j++) { | ||
matrix[i][j].setValue(value); | ||
} | ||
} | ||
}; | ||
}; | ||
|
||
exports.Range = Range; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
var Range = require('./Range').Range; | ||
var Sheet = function (myMatrix) { | ||
var matrix = myMatrix || [ | ||
[] | ||
]; | ||
|
||
this.getRange = function (row, col, lines, cols) { | ||
lines = lines || 1; | ||
cols = cols || 1; | ||
if (!row || !col || row <= 0 || col <= 0 || lines > matrix.length || cols > matrix[0].length) { | ||
throw new Error('Invalid params to range.'); | ||
} | ||
var newMatrix = [ | ||
[] | ||
]; | ||
for (var i = 0; i < lines; i++) { | ||
newMatrix[i] = []; | ||
for (var j = 0; j < cols; j++) { | ||
newMatrix[i][j] = matrix[i + row - 1][j + col - 1]; | ||
} | ||
} | ||
return new Range(newMatrix); | ||
}; | ||
|
||
this.getMaxRows = function () { | ||
return matrix.length; | ||
}; | ||
|
||
this.getMaxColumns = function () { | ||
return matrix[0].length; | ||
}; | ||
}; | ||
|
||
exports.Sheet = Sheet; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
var Sheet = require('./Sheet.js').Sheet | ||
var Spreadsheet = function (mock) { | ||
var sheets = [new Sheet(mock)]; | ||
|
||
this.getSheets = function () { | ||
return sheets; | ||
}; | ||
}; | ||
exports.Spreadsheet = Spreadsheet; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
var Spreadsheet = require('./Spreadsheet.js').Spreadsheet; | ||
var SpreadsheetApp = function (mock) { | ||
return { | ||
open: function (file) { | ||
return new Spreadsheet(mock || file); | ||
} | ||
} | ||
}; | ||
|
||
exports.SpreadsheetApp = SpreadsheetApp; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters