From e87e269f2ad36b9be82b6cc442363d27611f8579 Mon Sep 17 00:00:00 2001 From: akashnimare Date: Tue, 28 Jun 2016 16:04:01 +0530 Subject: [PATCH] Prompt UI + placeholder Updated --- app/renderer/index.html | 16 +-------- app/renderer/main.css | 77 +++++++++++++++++++++++++++++------------ app/renderer/main.js | 36 ++++++++++--------- 3 files changed, 75 insertions(+), 54 deletions(-) diff --git a/app/renderer/index.html b/app/renderer/index.html index 39d1f68c..4de3a2ac 100644 --- a/app/renderer/index.html +++ b/app/renderer/index.html @@ -2,21 +2,7 @@ - + diff --git a/app/renderer/main.css b/app/renderer/main.css index 1f7c2ec5..8575678f 100644 --- a/app/renderer/main.css +++ b/app/renderer/main.css @@ -1,28 +1,61 @@ -body { - background: #6BB6C7; +.dialog-widget.background { + background: #6BB6C7 !important; } - -.about { - margin-top: 50px; +.dialog-widget .title { + font-size: 18px !important; + font-family: Tahoma, Arial, sans-serif !important; } - -.left { - position: absolute; - top:89%; - left:76%; +.dialog-widget input { + font-size: 14px !important; + font-family: monospace !important; } - -.about p { - font-size: 20px; - color: rgba(0, 0, 0, 0.62); +.dialog-widget.prompt { + padding: 15px 15px 20px 15px !important; } - -.about img { - width:160px; +.cancel { + display: none !important; } - -.detail { - text-align: left; - margin-left: 35%; +.dialog-widget .ok { + margin-left: 20% !important; } - +.dialog-widget .ok, +.dialog-widget .cancel { + color: #ffffff !important; + padding: 16px !important; + width: 167px !important; + font-size: 13px !important; + background-color: #458C9C !important; +} +.dialog-widget input { + padding: 8px !important; + border: solid 1px #ccc; + margin: 15px 5px 5px 5px !important; + width: 271px !important; + height: 30px !important; + font-size: 15px !important; +} +.dialog-widget .title { + font-size: 19px !important; + font-family: Tahoma, Arial, sans-serif !important; + padding-bottom: 5px !important; +} +.dialog-widget.prompt { + position: fixed; + left: calc(50% - 160px); + width: 300px !important; + top: calc(50% - 115px); + box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5); + color: black; + padding: 15px 10px 15px 10px !important; +} +.dialog-widget.prompt { + padding: 20px 25px 20px 25px !important; +} +.dialog-widget .divider { + border-top: none !important; + padding: 0; + margin-top: 25px !important; +} +button { + cursor: pointer !important; +} \ No newline at end of file diff --git a/app/renderer/main.js b/app/renderer/main.js index 752f2f41..c33df15f 100644 --- a/app/renderer/main.js +++ b/app/renderer/main.js @@ -1,19 +1,21 @@ - window.onload = function getURL () { + 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("/"); + 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; - }) - } -} \ No newline at end of file + if (data["domain"] !== undefined) { + window.location.href = 'https://' + data["domain"]; + } else { + var dialogs = require('dialogs')() + dialogs.prompt('Enter the URL for your Zulip server', function(ok) { + db.push("/domain", ok); + console.log(db); + window.location.href = 'https://' + ok; + }) + } + + var addPlaceHolder = document.getElementsByTagName('input')[0]; + addPlaceHolder.setAttribute('placeholder', 'zulip.example.com'); + } \ No newline at end of file