auto-caching of selected scripts
This commit is contained in:
Родитель
59e8c2c762
Коммит
f2e98204dc
|
@ -174,7 +174,7 @@
|
|||
this.rightPane.withClick(() => this.hideSidePane(), true);
|
||||
this.listHeaderHider.withClick(() => this.hideSidePane());
|
||||
|
||||
this.setBackButton();
|
||||
this.setBackButton();
|
||||
this.initMeAsync().done(() => { }, () => { });
|
||||
|
||||
if (dbg) bugsEnabled = true;
|
||||
|
@ -229,7 +229,17 @@
|
|||
} catch (e) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private initCachedScripts(): Promise {
|
||||
var cached = Cloud.config.cachedScripts;
|
||||
if (cached)
|
||||
return Promise.join(cached.map(id =>
|
||||
External.pullLatestLibraryVersion(id)
|
||||
.then(scriptid => World.getAnyScriptAsync(scriptid))
|
||||
));
|
||||
return Promise.as();
|
||||
}
|
||||
|
||||
public initMeAsync(): Promise {
|
||||
var id = Cloud.getUserId();
|
||||
if (!id) {
|
||||
|
@ -237,6 +247,7 @@
|
|||
return Promise.as();
|
||||
}
|
||||
this.initBadgeTag();
|
||||
this.initCachedScripts().done(() => { }, () => { });
|
||||
if (!Cloud.lite)
|
||||
TheApiCacheMgr.getAnd("me", (u: JsonUser) => {
|
||||
(<any>window).userName = u.name;
|
||||
|
|
|
@ -211,6 +211,8 @@ module TDev.Cloud {
|
|||
printHeaderHtml?: string;
|
||||
companyLogoHorizontalUrl?: string;
|
||||
touchDevelopLogoUrl?: string;
|
||||
|
||||
cachedScripts?: string[];
|
||||
}
|
||||
|
||||
export var config: ClientConfig = {
|
||||
|
|
Загрузка…
Ссылка в новой задаче