Merge branch 'master' of github.com:Microsoft/TouchDevelop
This commit is contained in:
Коммит
3078ea913f
|
@ -1426,7 +1426,7 @@ module TDev {
|
|||
public md_onlyOn(...s: string[]) { this.availableOnlyOn = s.map(ss => api.getKind(ss)) }
|
||||
public md_import(manager: string, name: string, version: string) {
|
||||
if (!this._imports) this._imports = [];
|
||||
this._imports.push({ manager: manager, name: name, version: version });
|
||||
this._imports.push({ manager: manager, name: name, version: version || "*" });
|
||||
}
|
||||
public md_oldName(s:string) {
|
||||
var pref = this.parentKind.getName() + "->"
|
||||
|
|
|
@ -291,6 +291,8 @@ module TDev.AST {
|
|||
this.setupForEdit()
|
||||
}
|
||||
|
||||
public forSearch() { return this.getName() + " " + this.dataKind.toString(); }
|
||||
|
||||
// The calculator will call this method before editing us, so that our
|
||||
// exprholder is not left in a stale state from a previous
|
||||
// (unsuccessful) edit.
|
||||
|
|
|
@ -70,7 +70,7 @@ module TDev {
|
|||
export var deviceOrientation = false;
|
||||
export var deviceHeading = false;
|
||||
export var audioDataUrls = true;
|
||||
export var audioWav = true;
|
||||
export var audioWav = false;
|
||||
export var compilerInlining = false;
|
||||
export var compilerOkElimination = true; // always on
|
||||
export var compilerBlockChaining = false;
|
||||
|
|
|
@ -85,8 +85,9 @@
|
|||
this.updateScroll()
|
||||
elt("root").appendChild(this.theRoot);
|
||||
|
||||
Util.onInputChange(this.searchBox,
|
||||
Util.catchErrors("slSearch-searchKey", () => this.searchKey()));
|
||||
var up = KeyboardAutoUpdate.mkInput(this.searchBox, () => this.searchKey())
|
||||
up.attach()
|
||||
|
||||
this.searchBox.onclick = Util.catchErrors("slSearch-click", () => this.showSidePane());
|
||||
this.searchBox.placeholder = lf("Search here...");
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ module TDev
|
|||
else if (bangOp)
|
||||
specialCommand = tt;
|
||||
else
|
||||
terms.push(tt);
|
||||
terms.push(tt.toLowerCase());
|
||||
}
|
||||
refOp = false;
|
||||
bangOp = false;
|
||||
|
|
|
@ -78,7 +78,7 @@ module TDev.RT {
|
|||
if (/^\.\/art\//.test(url)) {
|
||||
url = Sound.patchLocalArtUrl(url);
|
||||
}
|
||||
if (!Browser.audioWav && ArtCache.isArtResource(url)) {
|
||||
if (!Browser.audioWav) {
|
||||
url = HTML.patchWavToMp4Url(url);
|
||||
Util.log('fixed art sound: ' + url);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,8 @@ module TDev.RT {
|
|||
|
||||
export var isArtResource = (url: string) : boolean => {
|
||||
return /^https:\/\/az31353\.vo\.msecnd\.net\/pub\//i.test(url)
|
||||
|| /^http:\/\/cdn.touchdevelop.com\/pub\//i.test(url);
|
||||
|| /^http:\/\/cdn.touchdevelop.com\/pub\//i.test(url)
|
||||
|| /\.\/art\//i.test(url);
|
||||
}
|
||||
|
||||
export function responseToDataUrl(response: TDev.RT.WebResponse): string {
|
||||
|
|
|
@ -38,16 +38,18 @@ module TDev.RT.Cordova {
|
|||
Util.log('wab: boosting PLAY_SOUND');
|
||||
Sound.prototype.initAsync = function () {
|
||||
var sound: Sound = <Sound>this;
|
||||
if ((<any>sound)._audio) return Promise.as(sound);
|
||||
return sound.createUrlAsync()
|
||||
.then(url => {
|
||||
(<any>sound)._audio = new MediaShim(url);
|
||||
return sound;
|
||||
});
|
||||
}
|
||||
|
||||
Sound.prototype.resetAsync = function () {
|
||||
var sound: Sound = <Sound>this;
|
||||
var media : Media = (<any>sound)._audio;
|
||||
if (media) media.seekTo(0);
|
||||
if (media && media.seekTo) media.seekTo(0);
|
||||
return Promise.as();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -179,11 +179,9 @@ module TDev.HTML {
|
|||
export function patchWavToMp4Url(url: string): string {
|
||||
if (url) {
|
||||
var m = url.match(/^http(s?):\/\/(cdn\.touchdevelop\.com|az31353\.vo\.msecnd\.net)\/pub\/(\w+)/i);
|
||||
if (m) {
|
||||
url = 'http' + m[1] + '://' + m[2] + '/aac/' + m[3] + '.m4a';
|
||||
}
|
||||
if (m) return 'https://' + m[2] + '/aac/' + m[3] + '.m4a';
|
||||
if (/^\.\/art\//i.test(url)) return url + '.m4a';
|
||||
}
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
|
|
4
rt/rt.ts
4
rt/rt.ts
|
@ -2977,7 +2977,9 @@ module TDev
|
|||
)._value;
|
||||
break;
|
||||
case "Sound":
|
||||
v = TDev.RT.Sound.mk("https://az31353.vo.msecnd.net/pub/pxiraczt");
|
||||
var missingUrl = "https://az31353.vo.msecnd.net/pub/pxiraczt";
|
||||
if (!Browser.audioWav) missingUrl = HTML.patchWavToMp4Url(missingUrl);
|
||||
v = TDev.RT.Sound.mk(missingUrl);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
Загрузка…
Ссылка в новой задаче