Merge branch 'bbcmicrobitacc' into bbcmicrobit

This commit is contained in:
Peli de Halleux 2016-04-08 16:19:06 -07:00
Родитель a529c92ac0 4ff50c6a05
Коммит e3e24b28b5
7 изменённых файлов: 47 добавлений и 14 удалений

Просмотреть файл

@ -38,6 +38,9 @@
// always use in-app menu selection // always use in-app menu selection
TemplateManager.createScript(); TemplateManager.createScript();
} }, } },
{ id: "importcode", name: lf("Import Code"), tick: Ticks.siteMenuImportCode, handler: () => {
ArtUtil.importFileDialog();
}},
{ id: "help", name: lf("Help"), tick: Ticks.siteMenuHelp, handler: () => Util.navigateInWindow("/help") }, { id: "help", name: lf("Help"), tick: Ticks.siteMenuHelp, handler: () => Util.navigateInWindow("/help") },
{ id: "myscripts", name: lf("My Scripts"), tick: Ticks.siteMenuMyScripts, handler: () => { { id: "myscripts", name: lf("My Scripts"), tick: Ticks.siteMenuMyScripts, handler: () => {
this.showList("installed-scripts"); this.showList("installed-scripts");
@ -53,8 +56,6 @@
menuItems.push({ id: "signin", name: lf("● Sign in"), tick: Ticks.siteMenuSignIn, handler: () => Login.show() }); menuItems.push({ id: "signin", name: lf("● Sign in"), tick: Ticks.siteMenuSignIn, handler: () => Login.show() });
else menuItems.push({ id: "settings", name: username ? username : lf("My Profile"), tick: Ticks.siteMenuProfile, handler: () => this.loadDetails(this.getUserInfoById("me", "me")) }); else menuItems.push({ id: "settings", name: username ? username : lf("My Profile"), tick: Ticks.siteMenuProfile, handler: () => this.loadDetails(this.getUserInfoById("me", "me")) });
var siteLogo = elt("siteLogo");
if (siteLogo) siteLogo.withClick(() => window.location.href = "/");
if (Cloud.getUserId()) { if (Cloud.getUserId()) {
var siteNotifications = elt("siteNotifications"); var siteNotifications = elt("siteNotifications");
if (siteNotifications) this.addNotificationCounter(siteNotifications); if (siteNotifications) this.addNotificationCounter(siteNotifications);
@ -123,7 +124,7 @@
private theList = div("slList"); private theList = div("slList");
private header = div("sdListLabel"); private header = div("sdListLabel");
private botDiv = div(null); private botDiv = div(null);
private searchBox = HTML.mkTextInput("search", lf("Search..."), "search", lf("Search")); private searchBox = HTML.mkTextInput("text", lf("Search..."), "search", lf("Search"));
private autoUpdate:KeyboardAutoUpdate; private autoUpdate:KeyboardAutoUpdate;
private slideButton = div("slSlideContainer"); private slideButton = div("slSlideContainer");
private backContainer = div("slBackContainer"); private backContainer = div("slBackContainer");

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -154,7 +154,7 @@ module TDev {
btnsDiv = e; btnsDiv = e;
if (e.withClick && !(<any>e).clickHandler && !(<any>e).onselectstart) if (e.withClick && !(<any>e).clickHandler && !(<any>e).onselectstart)
e.tabIndex = -1; e.tabIndex = -1;
}); });
if (!what) { if (!what) {
Util.showPopup(this.floating); Util.showPopup(this.floating);
@ -191,15 +191,33 @@ module TDev {
this.dialog.setAttribute("aria-labelledby", h1.id); this.dialog.setAttribute("aria-labelledby", h1.id);
} }
// find first input field or buttondiv
setTimeout(() => { // add one more fake element to trap the keyboard focus and reset it to the first focusable element
var focus = this.dialog.getElementsByTagName("input")[0] || this.dialog.getElementsByTagName("button")[0]; var trap = div('focustrap');
if (focus) focus.focus(); trap.tabIndex = 0;
}, 10); trap.setAttribute("aria-hidden", "true");
trap.onfocus = () => this.focusFirstAsync().done();
this.dialog.appendChild(trap)
this.focusFirstAsync().done();
Ticker.dbg("ModalDialog.showBare1"); Ticker.dbg("ModalDialog.showBare1");
} }
public focusFirstAsync() {
return new Promise((onSuccess, onError, onProgress) => {
// find first input field or buttondiv
setTimeout(() => {
try {
var focus = this.dialog.getElementsByTagName("input")[0] || this.dialog.getElementsByTagName("button")[0];
if (focus) focus.focus();
} catch (e) {
}
onSuccess(undefined);
}, 10);
});
}
public dismiss() { public dismiss() {
if (!this.canDismiss) { if (!this.canDismiss) {
Ticker.dbg("ModalDialog.dismiss - cannot"); Ticker.dbg("ModalDialog.dismiss - cannot");

Просмотреть файл

@ -174,7 +174,10 @@ module TDev {
elt("root").style.height = h + "px"; elt("root").style.height = h + "px";
if (phoneSimulationW > 0) if (phoneSimulationW > 0)
elt("root").style.width = w + "px"; elt("root").style.width = w + "px";
elt("root").style.fontSize = Browser.isMobile ? topFontSize +"px" : "16px";
if (!Browser.isMobile) topFontSize = 16; // allow zooming;
elt("root").style.fontSize = topFontSize +"px";
var rootClass = portraitMode ? "portrait" : "landscape"; var rootClass = portraitMode ? "portrait" : "landscape";
if (phoneMode) rootClass += " phone"; if (phoneMode) rootClass += " phone";

Просмотреть файл

@ -178,6 +178,7 @@ module TDev {
actionPropAtomic, actionPropAtomic,
siteMenuCreateCode, siteMenuCreateCode,
siteMenuImportCode,
siteMenuGroups, siteMenuGroups,
siteMenuTutorials, siteMenuTutorials,
siteMenuProjects, siteMenuProjects,

Просмотреть файл

@ -584,6 +584,14 @@ input.wall-textbox:hover, input.wall-textbox:focus {
border-color: white; border-color: white;
} }
.modalDialog .trap {
position:absolute;
right:0;
bottom:0;
width:1px;
height:1px;
}
.modalFullYellow .modalDialog .wall-button, .modalFullYellow .modalDialog .wall-button,
.modalFullWhite .modalDialog .wall-button .modalFullWhite .modalDialog .wall-button
{ {

Просмотреть файл

@ -981,7 +981,7 @@ textarea.commentEdit {
} }
.portrait .apiBackContainer { .portrait .apiBackContainer {
max-width: 7em; max-width: 7em;
} }
.landscape .apiBackContainer { .landscape .apiBackContainer {
@ -1698,6 +1698,7 @@ div.insertStmtHint
font-size: 0.9em; font-size: 0.9em;
} }
/*
.stmt[data-current^="yes"] > .line > .hintMessage, .stmt[data-current^="yes"] > .line > .hintMessage,
.stmt[data-current^="yes"] > .hintMessage, .stmt[data-current^="yes"] > .hintMessage,
.stmt[data-current^="yes"] > .line > .errorBr, .stmt[data-current^="yes"] > .line > .errorBr,
@ -1705,7 +1706,7 @@ div.insertStmtHint
.stmt[data-current^="yes"] > .line > .errorMessage, .stmt[data-current^="yes"] > .line > .errorMessage,
.stmt[data-current^="yes"] > .errorMessage .stmt[data-current^="yes"] > .errorMessage
{ {
} } */
.stmt[data-current^="yes"] .stmt[data-current^="yes"]
{ {