Skip to content

Commit

Permalink
Merge pull request RocketChat#147 from RocketChat/develop
Browse files Browse the repository at this point in the history
Version 1.2.0
  • Loading branch information
rodrigok committed Mar 21, 2016
2 parents fe90b38 + f74b825 commit c4d41d6
Show file tree
Hide file tree
Showing 31 changed files with 163,054 additions and 637 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
electron-boilerplate
Rocket.Chat.Electron
==============
Comprehensive boilerplate application for [Electron runtime](http://electron.atom.io).

Expand Down
51 changes: 51 additions & 0 deletions app/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!doctype html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<style>
html {
background-color: #ececec;
font-family: helvetica;
text-align: center;
padding: 10px;
}

body {
margin: 0px;
}

img {
height: 60px;
margin-bottom: 10px;
}

.app-name {
font-size: 14px;
font-weight: bold;
}

.app-version {
font-size: 11px;
position: fixed;
bottom: 30px;
left: 0;
right: 0;
}
</style>
</head>
<body>
<img src="images/icon.png">
<div class="app-name">

</div>
<div class="app-version">

</div>
<script>
var remote = require('remote');
document.querySelector('.app-name').innerHTML = remote.app.getName();
document.querySelector('.app-version').innerHTML = 'Version '+remote.app.getVersion();
</script>
</body>
</html>
2 changes: 1 addition & 1 deletion app/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<link rel="stylesheet" type="text/css" href="./stylesheets/base.css">
<link rel="stylesheet" type="text/css" href="./stylesheets/main.css">
<link rel="stylesheet" type="text/css" href="./stylesheets/start-page.css">
<link rel="stylesheet" type="text/css" href="./branding/branding.css">
<script type="text/javascript" src="lib/bugsnag.js"></script>
Expand Down
38 changes: 37 additions & 1 deletion app/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ import env from './env';

var mainWindow;

if (process.platform !== 'darwin') {
var shouldQuit = app.makeSingleInstance(function() {
// Someone tried to run a second instance, we should focus our window.
if (mainWindow) {
mainWindow.restore();
mainWindow.show();
mainWindow.focus();
}
});

if (shouldQuit) {
app.quit();
}
}

// Preserver of the window size and position between app launches.
var mainWindowState = windowStateKeeper('main', {
width: 1000,
Expand All @@ -32,6 +47,14 @@ app.on('ready', function () {
mainWindow.maximize();
}

if (mainWindowState.isMinimized) {
mainWindow.minimize();
}

if (mainWindowState.isHidden) {
mainWindow.hide();
}

if (env.name === 'test') {
mainWindow.loadURL('file://' + __dirname + '/spec.html');
} else {
Expand All @@ -43,8 +66,21 @@ app.on('ready', function () {
mainWindow.openDevTools();
}

mainWindow.on('close', function () {
mainWindow.on('close', function (event) {
mainWindowState.saveState(mainWindow);
if (mainWindow.forceClose) {
return;
}
event.preventDefault();
mainWindow.hide();
});

app.on('before-quit', function() {
mainWindow.forceClose = true;
});

app.on('activate', function(){
mainWindow.show();
});

mainWindow.webContents.on('will-navigate', function(event) {
Expand Down
6 changes: 3 additions & 3 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "rocketchat",
"productName": "Rocket.Chat",
"productName": "Rocket.Chat+",
"identifier": "chat.rocket",
"description": "Rocket.Chat Native Cross-Platform Desktop Application via Electron.",
"version": "1.1.0",
"build": "10",
"version": "1.2.0",
"build": "13",
"author": "Rocket.Chat Support <[email protected]>",
"copyright": "© 2016, Rocket.Chat",
"main": "background.js",
Expand Down
3 changes: 0 additions & 3 deletions app/scripts/config.js

This file was deleted.

Loading

0 comments on commit c4d41d6

Please sign in to comment.