Skip to content

Commit

Permalink
Testing...
Browse files Browse the repository at this point in the history
  • Loading branch information
guyonroche committed Mar 18, 2016
1 parent 878a994 commit 5afb475
Show file tree
Hide file tree
Showing 10 changed files with 1,340 additions and 1,096 deletions.
26 changes: 26 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"curly": true,
"eqeqeq": true,
"immed": true,
"newcap": true,
"noarg": true,
"undef": true,
"unused": false,
"node": true ,
"bitwise": true,
"indent": 2,
"noempty": true,
"quotmark": "single",
"strict": true,
"trailing": true,
"forin": true,
"camelcase": false,
"jasmine": true,
"latedef": true,
"globals": {
"describe": false,
"it": false,
"unescape": false
},
"esnext": true
}
30 changes: 19 additions & 11 deletions lib/doc/defined-names.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ DefinedNames.prototype = {
}
},

remove: function(locStr, name) {
var location = colCache.decodeEx(locStr);
this.removeEx(location, name);
},
removeEx: function(location, name) {
var matrix = this.getMatrix(name);
matrix.removeCellEx(location);
Expand Down Expand Up @@ -132,16 +136,13 @@ DefinedNames.prototype = {
return dimensions;
},

get model() {
getRanges: function(name, matrix) {
var self = this;
matrix = matrix || this.matrixMap[name];

// Rethink!
// Have cell-matrix per name! Easy to serialise
// To get names per cell - just iterate over all names finding cells if they exist
return _.map(this.matrixMap, function(matrix, name) {
// mark and sweep!
matrix.forEach(function(cell) { cell.mark = true; });
var ranges = matrix.map(function(cell) {
// mark and sweep!
matrix.forEach(function(cell) { cell.mark = true; });
var ranges = matrix.map(function(cell) {
if (cell.mark) {
var dimensions = self._explore(matrix, cell);
var range = cell.sheetName + '!' + (dimensions.count > 1 ? dimensions.$range : dimensions.$t$l);
Expand All @@ -150,9 +151,16 @@ DefinedNames.prototype = {
})
.filter(function(range) { return range; });

return {
name: name, ranges: ranges
};
return {
name: name, ranges: ranges
};
},

get model() {
var self = this;
// To get names per cell - just iterate over all names finding cells if they exist
return _.map(this.matrixMap, function(matrix, name) {
return self.getRanges(name, matrix);
});
},
set model(value) {
Expand Down
Loading

0 comments on commit 5afb475

Please sign in to comment.