Merge pull request #6 from vector-im/bwindels/more-renaming

more brawl -> hydrogen renaming
This commit is contained in:
Bruno Windels 2020-08-12 09:53:35 +00:00 committed by GitHub
commit 720e14a22a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 21 additions and 17 deletions

View file

@ -3,16 +3,15 @@
<head>
<meta charset="utf-8">
<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-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">
<link rel="stylesheet" type="text/css" href="src/ui/web/css/main.css">
</head>
<body class="brawl">
<body class="hydrogen">
<script id="version" type="disabled">
window.BRAWL_VERSION = "%%VERSION%%";
</script>
<script id="phone-debug-pre" type="disabled">
window.DEBUG = true;
@ -26,6 +25,7 @@
console.log = console.info = console.warn = (...params) => {
window.debugConsoleBuffer = window.debugConsoleBuffer + params.join(" ") + "\n";
};
window.HYDROGEN_VERSION = "%%VERSION%%";
</script>
<script id="main" type="module">
import main from "./src/main.js";

View file

@ -23,14 +23,14 @@ limitations under the License.
@import url('spinner.css');
/* 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 */
overscroll-behavior: none;
/* disable rubberband scrolling on document in IE11 */
overflow: hidden;
}
.brawl {
.hydrogen {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, Cantarell, sans-serif,
"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 {brawlGithubLink} from "./common.js";
import {hydrogenGithubLink} from "./common.js";
import {SessionLoadView} from "./SessionLoadView.js";
export class LoginView extends TemplateView {
@ -35,8 +35,9 @@ export class LoginView extends TemplateView {
disabled
}, vm.i18n`Log In`)),
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.p(brawlGithubLink(t))
t.p(hydrogenGithubLink(t))
]);
}
}

View file

@ -16,7 +16,7 @@ limitations under the License.
import {ListView} from "../general/ListView.js";
import {TemplateView} from "../general/TemplateView.js";
import {brawlGithubLink} from "./common.js";
import {hydrogenGithubLink} from "./common.js";
import {SessionLoadView} from "./SessionLoadView.js";
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: async () => vm.import(await selectFileAsText("application/json"))}, "Import")),
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.
*/
export function brawlGithubLink(t) {
if (window.BRAWL_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`);
export function hydrogenGithubLink(t) {
if (window.HYDROGEN_VERSION) {
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 {
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>
<h1>View Gallery</h1>
<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">
import {SessionStatusView} from "./session/SessionStatusView.js";
const view = new SessionStatusView(vm({
@ -38,7 +38,7 @@
document.getElementById("session-status").appendChild(view.mount());
</script>
<h2 name="login">Login</h2>
<div id="login" class="brawl"></div>
<div id="login" class="hydrogen"></div>
<script id="main" type="module">
import {LoginView} from "./login/LoginView.js";
const view = new LoginView(vm({
@ -49,7 +49,7 @@
document.getElementById("login").appendChild(view.mount());
</script>
<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">
import {LoginView} from "./login/LoginView.js";
const view = new LoginView(vm({