mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-02 13:03:22 +00:00
🚀 New feature - Add your Zulip Domain
This commit is contained in:
24
app/renderer/index.html
Normal file
24
app/renderer/index.html
Normal file
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<style>
|
||||
.dialog-widget.background {
|
||||
background: #6BB6C7 !important;
|
||||
}
|
||||
.dialog-widget .title {
|
||||
font-size: 18px !important;
|
||||
}
|
||||
.dialog-widget input {
|
||||
font-size:14px !important;
|
||||
font-family: monospace !important;
|
||||
}
|
||||
.dialog-widget.alert, .dialog-widget.confirm, .dialog-widget.prompt {
|
||||
padding:15px 15px 20px 15px !important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script src="main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
19
app/renderer/main.js
Normal file
19
app/renderer/main.js
Normal file
@@ -0,0 +1,19 @@
|
||||
window.onload = function getURL () {
|
||||
|
||||
var shell = require('electron').shell;
|
||||
var JsonDB = require('node-json-db');
|
||||
var db = new JsonDB("domain", true, true);
|
||||
var data = db.getData("/");
|
||||
|
||||
if (data["domain"] !== undefined) {
|
||||
window.location.href = data["domain"];
|
||||
}
|
||||
else {
|
||||
var dialogs = require('dialogs')()
|
||||
dialogs.prompt('Add your Zulip Domain', function (ok) {
|
||||
db.push("/domain", ok);
|
||||
console.log(db);
|
||||
window.location.href = ok;
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user