Skip to content

Commit

Permalink
Merge changes from jsoma's latest master.
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Seaward committed Mar 5, 2012
2 parents e6bb4f0 + 5fe6248 commit 41d3b32
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
1 change: 0 additions & 1 deletion examples/handlebars/handlebars.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ <h3>age {{age}}</h3>
var template = Handlebars.compile(source);

$.each( tabletop.sheets("Cats").all(), function(i, cat) {
console.log(cat);
var html = template(cat);
$("#content").append(html);
});
Expand Down
18 changes: 12 additions & 6 deletions src/tabletop.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@

/* Be friendly about what you accept */
if(/key=/.test(this.key)) {
if(this.debug)
console.debug("You passed a key as a URL! Attempting to parse.");

this.log("You passed a key as a URL! Attempting to parse.");
this.key = this.key.match("key=(.*?)&")[1];
}

Expand All @@ -40,8 +38,7 @@
return;
}

if(this.debug)
console.debug("Initializing with key %s", this.key);
this.log("Initializing with key %s", this.key);

this.models = {};
this.model_names = [];
Expand Down Expand Up @@ -159,7 +156,16 @@
doCallback: function() {
if(this.sheetsToLoad === 0)
this.callback(this.data(), this);
},

log: function(msg) {
if(this.debug) {
if(typeof console !== "undefined" && typeof console.log !== "undefined") {
console.log(msg)
}
}
}

};

/*
Expand All @@ -183,7 +189,7 @@
var source = options.data.feed.entry[i];
var element = {};

for(j = 0; j < this.column_names.length; j++) {
for(var j = 0; j < this.column_names.length; j++) {
var cell = source[ "gsx$" + this.column_names[j] ];
if(options.parseNumbers && cell.$t !== '' && !isNaN(cell.$t))
element[ this.column_names[j] ] = +cell.$t;
Expand Down

0 comments on commit 41d3b32

Please sign in to comment.