Skip to content
This repository has been archived by the owner on Jun 7, 2020. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Helvin committed Feb 19, 2018
2 parents 9ab9bf8 + 19d9069 commit a0c187c
Show file tree
Hide file tree
Showing 3 changed files with 145 additions and 6 deletions.
86 changes: 80 additions & 6 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({
show: false,
titleBarStyle: 'hiddenInset',
width: 1000,
minWidth: 600,
Expand All @@ -22,10 +23,12 @@ function createWindow () {
},
})

$cssInclude = '#tabLayer{position:fixed;margin-top:-5px;height:45px;-webkit-app-region:drag;}.bodycontainer{padding-top:40px;}.newMenuTable{display:block;max-height:45px;}#qIconDiv{position:absolute;right:0;}';
$cssInclude = '#tabLayer{position:fixed;margin-top:-5px;height:45px;-webkit-app-region:drag;}.bodycontainer{padding-top:40px;}.newMenuTable{display:block;max-height:45px;}#qIconDiv{position:absolute;right:0;}#tabGroupMenuDiv{margin-left:65px;}';
$cssSearch = '.newsearchimg,#searchStr{padding-left:75px;}#searchdetailsform{position:fixed;width:100%;}#gsearchDiv{padding-top:70px;}';

// and load the index.html of the app.
mainWindow.loadURL('https://accounts.zoho.com/signin?servicename=ZohoCRM')
// mainWindow.loadURL('https://accounts.zoho.com/signin?servicename=ZohoCRM')
mainWindow.loadURL('https://crm.zoho.com/')

mainWindow.webContents.on('did-finish-load', function() {
mainWindow.webContents.insertCSS($cssInclude)
Expand All @@ -35,12 +38,14 @@ function createWindow () {
mainWindow.webContents.insertCSS($cssInclude)
})


mainWindow.webContents.on('dom-ready', function(e) {
mainWindow.webContents.executeJavaScript('document.getElementById("tabgrouparrow").style.marginLeft = "75px";')
mainWindow.webContents.executeJavaScript('document.getElementById("tabgrouparrow").style.marginLeft = "75px";').then(() => {setTimeout(function(){splash.destroy();mainWindow.show();}, 2000)})
// search page override
mainWindow.webContents.insertCSS($cssSearch)
})

// Open the DevTools.
mainWindow.webContents.openDevTools()
// mainWindow.webContents.openDevTools()

// Emitted when the window is closed.
mainWindow.on('closed', function () {
Expand Down Expand Up @@ -137,6 +142,51 @@ function createMenu() {
{
type: 'separator',
},
{
label: 'Home',
accelerator: 'Shift+CmdOrCtrl+Space',
click: () => {
mainWindow.webContents.executeJavaScript('document.getElementById("tab_Home").click()')
},
},
{
label: 'SalesInbox',
accelerator: 'Shift+CmdOrCtrl+I',
click: () => {
mainWindow.webContents.executeJavaScript('document.getElementById("tab_SalesInbox").click()')
},
},
{
label: 'Feeds',
accelerator: 'Shift+CmdOrCtrl+F',
click: () => {
mainWindow.webContents.executeJavaScript('document.getElementById("tab_Feeds").click()')
},
},
{
label: 'Activities',
accelerator: 'Shift+CmdOrCtrl+E',
click: () => {
mainWindow.webContents.executeJavaScript('document.getElementById("tab_Activities").click()')
},
},
{
label: 'Visits',
accelerator: 'Shift+CmdOrCtrl+V',
click: () => {
mainWindow.webContents.executeJavaScript('document.getElementById("tab_Visits").click()')
},
},
{
type: 'separator',
},
{
label: 'Leads',
accelerator: 'Shift+CmdOrCtrl+L',
click: () => {
mainWindow.webContents.executeJavaScript('document.getElementById("tab_Leads").click()')
},
},
{
label: 'Accounts',
accelerator: 'Shift+CmdOrCtrl+A',
Expand All @@ -151,6 +201,13 @@ function createMenu() {
mainWindow.webContents.executeJavaScript('document.getElementById("tab_Contacts").click()')
},
},
{
label: 'Deals',
accelerator: 'Shift+CmdOrCtrl+D',
click: () => {
mainWindow.webContents.executeJavaScript('document.getElementById("tab_Potentials").click()')
},
},
],
},
{
Expand Down Expand Up @@ -245,13 +302,30 @@ function createMenu() {
Menu.setApplicationMenu(menu);
}

function splashWindow () {
splash = new BrowserWindow({
width: 350,
minWidth: 350,
height: 350,
minHeight: 350,
frame: false,
alwaysOnTop: true,
movable: false,
closable: false,
})

splash.loadURL(`file://${__dirname}/splash.html`)
}

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', function () {
createWindow()
splashWindow()
createMenu()
createWindow()
})

// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
Expand Down
65 changes: 65 additions & 0 deletions splash.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
.splash {
margin: 0 auto;
border-radius: 10px;
text-align: center;
}
.splash img {
position: absolute;
width: 150px;
top: 100px;
left: 100px;
z-index: 999;
}
.spinner {
width: 250px;
height: 250px;

position: relative;
margin: 50px auto;
}
.double-bounce1, .double-bounce2 {
width: 100%;
height: 100%;
border-radius: 50%;
background-color: #A9A9A9;
opacity: 0.6;
position: absolute;
top: 0;
left: 0;
-webkit-animation: sk-bounce 2.0s infinite ease-in-out;
animation: sk-bounce 2.0s infinite ease-in-out;
}
.double-bounce2 {
-webkit-animation-delay: -1.0s;
animation-delay: -1.0s;
}
@-webkit-keyframes sk-bounce {
0%, 100% { -webkit-transform: scale(0.0) }
50% { -webkit-transform: scale(1.0) }
}
@keyframes sk-bounce {
0%, 100% {
transform: scale(0.0);
-webkit-transform: scale(0.0);
} 50% {
transform: scale(1.0);
-webkit-transform: scale(1.0);
}
}
</style>
</head>
<body>
<div class="splash">
<img src="splash.png" alt="Splash Logo">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
<!-- Credit: http://tobiasahlin.com/spinkit/ -->
</div>
</div>
</body>
</html>
Binary file added splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a0c187c

Please sign in to comment.