🚀 New feature - Add your Zulip Domain

This commit is contained in:
akashnimare
2016-06-24 13:57:58 +05:30
parent 9193a79fc0
commit 320a04cac8
5 changed files with 48 additions and 2 deletions

24
app/renderer/index.html Normal file
View 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
View 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;
})
}
}