more brawl -> hydrogen renaming

This commit is contained in:
Bruno Windels 2020-08-12 11:42:42 +02:00
parent b9621d9b9b
commit 5546460510
6 changed files with 21 additions and 17 deletions

View file

@ -3,16 +3,15 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no"> <meta name="viewport" content="width=device-width, user-scalable=no">
<meta name="application-name" content="Brawl Chat"/> <meta name="application-name" content="Hydrogen Chat"/>
<meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="Brawl Chat"> <meta name="apple-mobile-web-app-title" content="Hydrogen Chat">
<meta name="description" content="A matrix chat application"> <meta name="description" content="A matrix chat application">
<link rel="stylesheet" type="text/css" href="src/ui/web/css/main.css"> <link rel="stylesheet" type="text/css" href="src/ui/web/css/main.css">
</head> </head>
<body class="brawl"> <body class="hydrogen">
<script id="version" type="disabled"> <script id="version" type="disabled">
window.BRAWL_VERSION = "%%VERSION%%";
</script> </script>
<script id="phone-debug-pre" type="disabled"> <script id="phone-debug-pre" type="disabled">
window.DEBUG = true; window.DEBUG = true;
@ -26,6 +25,7 @@
console.log = console.info = console.warn = (...params) => { console.log = console.info = console.warn = (...params) => {
window.debugConsoleBuffer = window.debugConsoleBuffer + params.join(" ") + "\n"; window.debugConsoleBuffer = window.debugConsoleBuffer + params.join(" ") + "\n";
}; };
window.HYDROGEN_VERSION = "%%VERSION%%";
</script> </script>
<script id="main" type="module"> <script id="main" type="module">
import main from "./src/main.js"; import main from "./src/main.js";

View file

@ -23,14 +23,14 @@ limitations under the License.
@import url('spinner.css'); @import url('spinner.css');
/* only if the body contains the whole app (e.g. we're not embedded in a page), make some changes */ /* only if the body contains the whole app (e.g. we're not embedded in a page), make some changes */
body.brawl { body.hydrogen {
/* make sure to disable rubber-banding and pull to refresh in a PWA if we'd end up having a scrollbar */ /* make sure to disable rubber-banding and pull to refresh in a PWA if we'd end up having a scrollbar */
overscroll-behavior: none; overscroll-behavior: none;
/* disable rubberband scrolling on document in IE11 */ /* disable rubberband scrolling on document in IE11 */
overflow: hidden; overflow: hidden;
} }
.brawl { .hydrogen {
margin: 0; margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, sans-serif, font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, sans-serif,
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";

View file

@ -15,7 +15,7 @@ limitations under the License.
*/ */
import {TemplateView} from "../general/TemplateView.js"; import {TemplateView} from "../general/TemplateView.js";
import {brawlGithubLink} from "./common.js"; import {hydrogenGithubLink} from "./common.js";
import {SessionLoadView} from "./SessionLoadView.js"; import {SessionLoadView} from "./SessionLoadView.js";
export class LoginView extends TemplateView { export class LoginView extends TemplateView {
@ -35,8 +35,9 @@ export class LoginView extends TemplateView {
disabled disabled
}, vm.i18n`Log In`)), }, vm.i18n`Log In`)),
t.div(t.button({onClick: () => vm.cancel(), disabled}, [vm.i18n`Pick an existing session`])), t.div(t.button({onClick: () => vm.cancel(), disabled}, [vm.i18n`Pick an existing session`])),
// use t.mapView rather than t.if to create a new view when the view model changes too
t.mapView(vm => vm.loadViewModel, loadViewModel => loadViewModel ? new SessionLoadView(loadViewModel) : null), t.mapView(vm => vm.loadViewModel, loadViewModel => loadViewModel ? new SessionLoadView(loadViewModel) : null),
t.p(brawlGithubLink(t)) t.p(hydrogenGithubLink(t))
]); ]);
} }
} }

View file

@ -16,7 +16,7 @@ limitations under the License.
import {ListView} from "../general/ListView.js"; import {ListView} from "../general/ListView.js";
import {TemplateView} from "../general/TemplateView.js"; import {TemplateView} from "../general/TemplateView.js";
import {brawlGithubLink} from "./common.js"; import {hydrogenGithubLink} from "./common.js";
import {SessionLoadView} from "./SessionLoadView.js"; import {SessionLoadView} from "./SessionLoadView.js";
function selectFileAsText(mimeType) { function selectFileAsText(mimeType) {
@ -104,7 +104,7 @@ export class SessionPickerView extends TemplateView {
t.p(t.button({onClick: () => vm.cancel()}, ["Log in to a new session instead"])), t.p(t.button({onClick: () => vm.cancel()}, ["Log in to a new session instead"])),
t.p(t.button({onClick: async () => vm.import(await selectFileAsText("application/json"))}, "Import")), t.p(t.button({onClick: async () => vm.import(await selectFileAsText("application/json"))}, "Import")),
t.if(vm => vm.loadViewModel, vm => new SessionLoadView(vm.loadViewModel)), t.if(vm => vm.loadViewModel, vm => new SessionLoadView(vm.loadViewModel)),
t.p(brawlGithubLink(t)) t.p(hydrogenGithubLink(t))
]); ]);
} }
} }

View file

@ -14,10 +14,13 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
export function brawlGithubLink(t) { export function hydrogenGithubLink(t) {
if (window.BRAWL_VERSION) { if (window.HYDROGEN_VERSION) {
return t.a({target: "_blank", href: `https://github.com/bwindels/brawl-chat/releases/tag/v${window.BRAWL_VERSION}`}, `Brawl v${window.BRAWL_VERSION} on Github`); return t.a({target: "_blank",
href: `https://github.com/vector-im/hydrogen-web/releases/tag/v${window.HYDROGEN_VERSION}`},
`Hydrogen v${window.HYDROGEN_VERSION} on Github`);
} else { } else {
return t.a({target: "_blank", href: "https://github.com/bwindels/brawl-chat"}, "Brawl on Github"); return t.a({target: "_blank", href: "https://github.com/vector-im/hydrogen-web"},
"Hydrogen on Github");
} }
} }

View file

@ -25,7 +25,7 @@
</script> </script>
<h1>View Gallery</h1> <h1>View Gallery</h1>
<h2 name="session-status">Session Status Bar</h2> <h2 name="session-status">Session Status Bar</h2>
<div id="session-status" class="brawl"></div> <div id="session-status" class="hydrogen"></div>
<script id="main" type="module"> <script id="main" type="module">
import {SessionStatusView} from "./session/SessionStatusView.js"; import {SessionStatusView} from "./session/SessionStatusView.js";
const view = new SessionStatusView(vm({ const view = new SessionStatusView(vm({
@ -38,7 +38,7 @@
document.getElementById("session-status").appendChild(view.mount()); document.getElementById("session-status").appendChild(view.mount());
</script> </script>
<h2 name="login">Login</h2> <h2 name="login">Login</h2>
<div id="login" class="brawl"></div> <div id="login" class="hydrogen"></div>
<script id="main" type="module"> <script id="main" type="module">
import {LoginView} from "./login/LoginView.js"; import {LoginView} from "./login/LoginView.js";
const view = new LoginView(vm({ const view = new LoginView(vm({
@ -49,7 +49,7 @@
document.getElementById("login").appendChild(view.mount()); document.getElementById("login").appendChild(view.mount());
</script> </script>
<h2 name="login-loading">Login Loading</h2> <h2 name="login-loading">Login Loading</h2>
<div id="login-loading" class="brawl"></div> <div id="login-loading" class="hydrogen"></div>
<script id="main" type="module"> <script id="main" type="module">
import {LoginView} from "./login/LoginView.js"; import {LoginView} from "./login/LoginView.js";
const view = new LoginView(vm({ const view = new LoginView(vm({