This commit is contained in:
life
2016-05-22 22:40:28 +08:00
parent faa9f8b308
commit c6865abb40
16 changed files with 79 additions and 40 deletions

View File

@@ -41,9 +41,8 @@ if(process.platform != 'darwin') {
<div>
<h1 id="logo">
<a onclick="openExternal('https://leanote.com')" id="loadingLogo" title="leanote">
<img src="public/images/logo/leanote_icon_blue.png">
<span class="logo"></span>
</a>
<span class="lang customServer">Self-hosted Service</span>
</h1>

View File

@@ -33,7 +33,8 @@ app.on('open-file', function(e) {
});
// var appIsReady = false;
app.on('activate-with-no-open-windows', function() {
app.on('activate', function() {
console.log('activate');
if(mainWindow) {
mainWindow.show();
}
@@ -110,6 +111,7 @@ function openIt() {
// Emitted when the window is closed.
mainWindow.on('closed', function() {
console.log('closed');
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
@@ -117,17 +119,20 @@ function openIt() {
});
mainWindow.on('focus', function() {
console.log('focus');
// ipc.send('focusWindow'); mainProcess没有该方法
if(mainWindow && mainWindow.webContents)
mainWindow.webContents.send('focusWindow');
});
mainWindow.on('blur', function() {
console.log('blur');
if(mainWindow && mainWindow.webContents)
mainWindow.webContents.send('blurWindow');
});
// 关闭,先保存数据
mainWindow.on('close', function(e) {
console.log('close');
mainWindow.hide();
e.preventDefault();
mainWindow.webContents.send('closeWindow');

View File

@@ -73,8 +73,8 @@ function log(o) {
<div id="page" class="clearfix">
<div id="mainMask">
<table><tr><td>
<div id="loadingLogo" class="loading">
<img src="public/images/logo/leanote_icon_blue.png">
<div id="loadingLogo">
<span class="logo"></span>
</div>
<div id="allProcess" class="lang">
loading...

View File

@@ -29,6 +29,6 @@ var Config = {
"name": "日本語"
}
],
"lang": "zh-cn",
"lang": "en-us",
"theme": ""
};

View File

@@ -10,15 +10,20 @@
#loadingLogo {
position: relative;
width: 100px;
height: 100px;
// width: 100px;
// height: 100px;
display: block;
margin: auto;
border: 1px solid #4092C5;
border-radius: 50%;
img {
width: 100px;
padding: 20px;
// border: 1px solid #4092C5;
// border-radius: 50%;
.logo {
display: inline-block;
background-image: url('../images/logo/leanote-icon-en.png');
height: 50px;
width: 200px;
background-repeat: no-repeat;
background-size: auto 50px;
}
&.loading {
@@ -26,6 +31,11 @@
-webkit-animation: rond 2s infinite;
}
}
.lang-zh-cn #loadingLogo .logo {
width: 170px;
background-image: url('../images/logo/leanote-icon-zh.png');
}
.loading-spin {
animation: rond 2s infinite;
-webkit-animation: rond 2s infinite;

View File

@@ -16,21 +16,25 @@
}
#loadingLogo {
position: relative;
width: 100px;
height: 100px;
display: block;
margin: auto;
border: 1px solid #4092C5;
border-radius: 50%;
}
#loadingLogo img {
width: 100px;
padding: 20px;
#loadingLogo .logo {
display: inline-block;
background-image: url('../images/logo/leanote-icon-en.png');
height: 50px;
width: 200px;
background-repeat: no-repeat;
background-size: auto 50px;
}
#loadingLogo.loading {
animation: rond 2s infinite;
-webkit-animation: rond 2s infinite;
}
.lang-zh-cn #loadingLogo .logo {
width: 170px;
background-image: url('../images/logo/leanote-icon-zh.png');
}
.loading-spin {
animation: rond 2s infinite;
-webkit-animation: rond 2s infinite;
@@ -237,7 +241,7 @@ input,
height: 102px;
text-align: center;
}
#box h1 span {
#box h1 .customServer {
display: none;
font-size: 24px;
color: #000;
@@ -713,6 +717,9 @@ form {
.custom-server .bottom .loginWithLeanote {
display: block;
}
#loadingLogo {
padding-top: 30px;
}
.custom-server .host-group {
display: block;
}

View File

@@ -235,7 +235,7 @@ input, .form-control {
height: 102px;
text-align: center;
span {
.customServer {
display: none;
font-size: 24px;
color: #000;
@@ -787,7 +787,9 @@ form {
}
}
#loadingLogo {
padding-top: 30px;
}
.custom-server {
.host-group {
display: block;

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -1309,7 +1309,7 @@ var State = {
var me = this;
me.recoverEnd = true;
// 先隐藏, 再resize, 再显示
$('body').hide();
// $('body').hide();
// 延迟, 让body先隐藏, 效果先显示出来
setTimeout(function() {
if(isMac()) {
@@ -1320,7 +1320,7 @@ var State = {
}
}
setTimeout(function() {
$('body').show();
// $('body').show();
$('body').removeClass('init');
$("#mainMask").html("");
$("#mainMask").hide(0);
@@ -1800,8 +1800,17 @@ var Pren = {
me.preOrNext();
}
// 各个平台都要
// e切换只读和可写
if(keyCode == 69) {
if ( (isMac() && e.metaKey) || (!isMac() && e.ctrlKey)) {
Note.toggleWriteableAndReadOnly();
}
}
// linux,windows下需要
if(!isMac() && e.ctrlKey) {
else if(!isMac() && e.ctrlKey) {
// p
if(keyCode == 80) {
me.togglePren();
@@ -1810,10 +1819,7 @@ var Pren = {
else if(keyCode == 187) {
me.toggleFullscreen();
}
// e
else if(keyCode == 69) {
Note.toggleWriteableAndReadOnly();
}
// t
else if(keyCode == 84) {
me.togglePren(true);

View File

@@ -1,7 +1,7 @@
var Common = require('common');
var Evt = require('evt');
var app = require('electron').app; // .require('app');
var app = require('electron').remote.app; // .require('app');
var basePath = app.getPath('appData') + '/leanote'; // /Users/life/Library/Application Support/Leanote'; // require('nw.gui').App.dataPath;
Evt.setDataBasePath(basePath);

View File

@@ -1507,10 +1507,14 @@ function goToMainPage() {
function toLogin() {
var BrowserWindow = gui.remote.BrowserWindow;
if(isMac()) {
var win = new BrowserWindow({ width: 278, height: 326, show: true, frame: false, resizable: false });
var win = new BrowserWindow(
{ width: 278, height: 370, show: true, frame: false, resizable: false }
);
win.loadURL('file://' + __dirname + '/login.html');
} else {
var win = new BrowserWindow({ width: 278, height: 400, show: true, frame: true, resizable: false });
var win = new BrowserWindow(
{ width: 278, height: 400, show: true, frame: true, resizable: false }
);
win.loadURL('file://' + __dirname + '/login.html');
}
gui.getCurrentWindow().close();

View File

@@ -24,6 +24,8 @@ var lang = {
window.curLang = curLang;
window.langData = langData;
$('body').addClass('lang-' + curLang);
me.renderHtml();
},

View File

@@ -2100,21 +2100,25 @@ img::selection {
}
#loadingLogo {
position: relative;
width: 100px;
height: 100px;
display: block;
margin: auto;
border: 1px solid #4092C5;
border-radius: 50%;
}
#loadingLogo img {
width: 100px;
padding: 20px;
#loadingLogo .logo {
display: inline-block;
background-image: url('../images/logo/leanote-icon-en.png');
height: 50px;
width: 200px;
background-repeat: no-repeat;
background-size: auto 50px;
}
#loadingLogo.loading {
animation: rond 2s infinite;
-webkit-animation: rond 2s infinite;
}
.lang-zh-cn #loadingLogo .logo {
width: 170px;
background-image: url('../images/logo/leanote-icon-zh.png');
}
.loading-spin {
animation: rond 2s infinite;
-webkit-animation: rond 2s infinite;