Skip to content

Commit a8993db

Browse files
author
Jessica Lord
committed
Merge branch 'master' of https://github.com/jlord/sheetsee.js
2 parents 0cc7795 + e541fe6 commit a8993db

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

docs/basics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,4 @@ You should have an address in a box at the bottom, your key is the portion betwe
9191

9292
### CSS
9393

94-
Sheetsee.js comes with a bare minimum stylesheet, `sss.csss`, which contains elements you'll want to style when using the feature they correspond to.
94+
Sheetsee.js comes with a bare minimum stylesheet, `sss.css`, which contains elements you'll want to style when using the feature they correspond to.

js/tabletop1.3.3.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,8 @@
9696
}
9797

9898
if(/pubhtml/.test(this.key)) {
99-
alert("You passed a new Google Spreadsheets url as the key! This won't work yet, you'll need to change back to old Sheets.");
99+
this.log("You passed a new Google Spreadsheets url as the key! Attempting to parse.");
100100
this.key = this.key.match("d\\/(.*?)\\/pubhtml")[1];
101-
console.log(this.key);
102101
}
103102

104103
if(!this.key) {
@@ -309,13 +308,17 @@
309308
this.foundSheetNames.push(data.feed.entry[i].title.$t);
310309
// Only pull in desired sheets to reduce loading
311310
if( this.isWanted(data.feed.entry[i].content.$t) ) {
312-
var sheet_id = data.feed.entry[i].link[3].href.substr( data.feed.entry[i].link[3].href.length - 3, 3);
313-
var json_path = "/feeds/list/" + this.key + "/" + sheet_id + "/public/values?sq=" + this.query + '&alt='
311+
var linkIdx = data.feed.entry[i].link.length-1;
312+
var sheet_id = data.feed.entry[i].link[linkIdx].href.substr( data.feed.entry[i].link[linkIdx].href.length - 3, 3);
313+
var json_path = "/feeds/list/" + this.key + "/" + sheet_id + "/public/values?alt="
314314
if (inNodeJS || supportsCORS) {
315315
json_path += 'json';
316316
} else {
317317
json_path += 'json-in-script';
318318
}
319+
if(this.query) {
320+
json_path += "&sq=" + this.query;
321+
}
319322
if(this.orderby) {
320323
json_path += "&orderby=column:" + this.orderby.toLowerCase();
321324
}
@@ -468,4 +471,4 @@
468471
global.Tabletop = Tabletop;
469472
}
470473

471-
})(this);
474+
})(this);

0 commit comments

Comments
 (0)