Clean up layout deferral. Require login.
This commit is contained in:
2
app.yaml
2
app.yaml
@@ -9,12 +9,14 @@ handlers:
|
|||||||
static_files: static/babystats.html
|
static_files: static/babystats.html
|
||||||
upload: static/babystats.html
|
upload: static/babystats.html
|
||||||
secure: always
|
secure: always
|
||||||
|
login: required
|
||||||
http_headers:
|
http_headers:
|
||||||
X-Content-Type-Options: nosniff
|
X-Content-Type-Options: nosniff
|
||||||
|
|
||||||
- url: /static
|
- url: /static
|
||||||
static_dir: static
|
static_dir: static
|
||||||
secure: always
|
secure: always
|
||||||
|
login: required
|
||||||
http_headers:
|
http_headers:
|
||||||
X-Content-Type-Options: nosniff
|
X-Content-Type-Options: nosniff
|
||||||
|
|
||||||
|
|||||||
@@ -24,9 +24,22 @@ var BabyStats = function(container) {
|
|||||||
this.intervals_ = {};
|
this.intervals_ = {};
|
||||||
|
|
||||||
this.cosmo_ = new Cosmopolite();
|
this.cosmo_ = new Cosmopolite();
|
||||||
hogfather.PublicChat.Create(this.cosmo_).then(function(chat) {
|
if (window.location.hash) {
|
||||||
|
var id = window.location.hash.substring(1);
|
||||||
|
hogfather.PublicChat.Join(this.cosmo_, id).then(
|
||||||
|
this.onChatReady_.bind(this));
|
||||||
|
} else {
|
||||||
|
hogfather.PublicChat.Create(this.cosmo_).then(
|
||||||
|
this.onChatReady_.bind(this));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
BabyStats.prototype.onChatReady_ = function(chat) {
|
||||||
this.chat_ = chat;
|
this.chat_ = chat;
|
||||||
|
|
||||||
|
window.location.hash = this.chat_.getID();
|
||||||
|
|
||||||
this.buildCells_();
|
this.buildCells_();
|
||||||
this.buildStylesheet_();
|
this.buildStylesheet_();
|
||||||
this.buildLayout_();
|
this.buildLayout_();
|
||||||
@@ -37,7 +50,6 @@ var BabyStats = function(container) {
|
|||||||
this.gridWidthCells_ = grid.gridWidthCells;
|
this.gridWidthCells_ = grid.gridWidthCells;
|
||||||
this.gridHeightCells_ = grid.gridHeightCells;
|
this.gridHeightCells_ = grid.gridHeightCells;
|
||||||
this.buildGrid_();
|
this.buildGrid_();
|
||||||
}.bind(this));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user