mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-06 15:03:20 +00:00
🚀 New feature - Add your Zulip Domain
This commit is contained in:
@@ -12,7 +12,8 @@ const {linkIsInternal} = link;
|
|||||||
require('electron-debug')();
|
require('electron-debug')();
|
||||||
|
|
||||||
// Load this url in main window
|
// Load this url in main window
|
||||||
const targetUrl = "https://zulip.com/login"
|
const targetUrl = 'file://' + path.join(__dirname, '../renderer', 'index.html');
|
||||||
|
|
||||||
|
|
||||||
// prevent window being garbage collected
|
// prevent window being garbage collected
|
||||||
let mainWindow;
|
let mainWindow;
|
||||||
|
|||||||
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;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
1
domain.json
Normal file
1
domain.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
@@ -26,7 +26,8 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"electron-debug": "^1.0.0",
|
"electron-debug": "^1.0.0",
|
||||||
"electron-dl": "^0.2.0",
|
"electron-dl": "^0.2.0",
|
||||||
"wurl": "^2.1.0"
|
"wurl": "^2.1.0",
|
||||||
|
"node-json-db": "^0.7.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"devtron": "^1.1.0",
|
"devtron": "^1.1.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user