mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-16 16:04:56 +00:00
custom server
This commit is contained in:
45
login.html
45
login.html
@@ -6,9 +6,9 @@
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta name="keywords" content="leanote,leanote.com">
|
<meta name="keywords" content="leanote,leanote.com">
|
||||||
<meta name="description" content="leanote, 不只是笔记!">
|
<meta name="description" content="leanote, Not Just A Notebook!">
|
||||||
<meta name="author" content="leanote">
|
<meta name="author" content="leanote">
|
||||||
<title>登录</title>
|
<title>Leanote login</title>
|
||||||
<link href="public/css/bootstrap.css" rel="stylesheet">
|
<link href="public/css/bootstrap.css" rel="stylesheet">
|
||||||
<link href="public/css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet">
|
<link href="public/css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet">
|
||||||
<link href="public/css/index.css" rel="stylesheet">
|
<link href="public/css/index.css" rel="stylesheet">
|
||||||
@@ -25,6 +25,7 @@ if(process.platform != 'darwin') {
|
|||||||
<div id="winTool" class="win-tool clearfix">
|
<div id="winTool" class="win-tool clearfix">
|
||||||
<a class="tool-close-blur"></a>
|
<a class="tool-close-blur"></a>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="server"><a id="customServer">Custom server</a></div>
|
||||||
<section id="box" class="animated fadeInUp">
|
<section id="box" class="animated fadeInUp">
|
||||||
<div class="drag"></div>
|
<div class="drag"></div>
|
||||||
<div>
|
<div>
|
||||||
@@ -38,9 +39,14 @@ if(process.platform != 'darwin') {
|
|||||||
<div class="alert alert-danger" id="loginMsg"></div>
|
<div class="alert alert-danger" id="loginMsg"></div>
|
||||||
|
|
||||||
<div id="formContainer">
|
<div id="formContainer">
|
||||||
|
<div class="form-group form-group-1 hide" id="hostGroup">
|
||||||
|
<input type="text" placeholder="Host, http://leanote.com" class="form-control" id="host" name="host">
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group form-group-1">
|
<div class="form-group form-group-1">
|
||||||
<input type="text" placeholder="Email" class="form-control" id="email" name="email" value="">
|
<input type="text" placeholder="Email" class="form-control" id="email" name="email" value="">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group pwd-group">
|
<div class="form-group pwd-group">
|
||||||
<input type="password" placeholder="Password" class="form-control" id="pwd" name="pwd">
|
<input type="password" placeholder="Password" class="form-control" id="pwd" name="pwd">
|
||||||
<button id="loginBtn" disabled><i class="fa fa-arrow-right"></i></button>
|
<button id="loginBtn" disabled><i class="fa fa-arrow-right"></i></button>
|
||||||
@@ -71,7 +77,15 @@ win.setAlwaysOnTop(true);
|
|||||||
// gui.Window.focus();
|
// gui.Window.focus();
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
|
var $hostGroup = $('#hostGroup');
|
||||||
|
var hasHost = false;
|
||||||
|
|
||||||
|
function isValidUrl(url) {
|
||||||
|
return /http(s*):\/\/.+/.test(url);
|
||||||
|
}
|
||||||
|
|
||||||
$("#email").focus();
|
$("#email").focus();
|
||||||
|
|
||||||
if($("#email").val()) {
|
if($("#email").val()) {
|
||||||
$("#pwd").focus();
|
$("#pwd").focus();
|
||||||
}
|
}
|
||||||
@@ -88,7 +102,8 @@ $(function() {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var email = $("#email").val();
|
var email = $("#email").val();
|
||||||
var pwd = $("#pwd").val();
|
var pwd = $("#pwd").val();
|
||||||
var captcha = $("#captcha").val()
|
var host = $('#host').val();
|
||||||
|
|
||||||
if(!email) {
|
if(!email) {
|
||||||
showMsg("Email is required", "email");
|
showMsg("Email is required", "email");
|
||||||
return;
|
return;
|
||||||
@@ -102,11 +117,19 @@ $(function() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(hasHost && (!host || !isValidUrl(host))) {
|
||||||
|
showMsg('Invalid host', 'host');
|
||||||
|
return;
|
||||||
|
}
|
||||||
$('#loadingLogo').addClass('loading');
|
$('#loadingLogo').addClass('loading');
|
||||||
|
hideMsg();
|
||||||
// TODO show loading
|
// TODO show loading
|
||||||
// console.log(33);
|
// console.log(33);
|
||||||
// $("#loginBtn").html("loading...").addClass("disabled");
|
// $("#loginBtn").html("loading...").addClass("disabled");
|
||||||
ApiService.auth(email, pwd, function(ret) {
|
if(!hasHost) {
|
||||||
|
host = '';
|
||||||
|
}
|
||||||
|
ApiService.auth(email, pwd, host, function(ret) {
|
||||||
$('#loadingLogo').removeClass('loading');
|
$('#loadingLogo').removeClass('loading');
|
||||||
// $("#loginBtn").html("Sign in").removeClass("disabled");
|
// $("#loginBtn").html("Sign in").removeClass("disabled");
|
||||||
if(ret.Ok) {
|
if(ret.Ok) {
|
||||||
@@ -142,10 +165,20 @@ $(function() {
|
|||||||
checkDisabled();
|
checkDisabled();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#customServer').click(function() {
|
||||||
|
if($hostGroup.hasClass('hide')) {
|
||||||
|
$hostGroup.removeClass('hide');
|
||||||
|
hasHost = true;
|
||||||
|
} else {
|
||||||
|
$hostGroup.addClass('hide');
|
||||||
|
hasHost = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
win.resizeTo(258, 326);
|
// win.resizeTo(268, 356);
|
||||||
win.setPosition('center');
|
// win.setPosition('center');
|
||||||
|
|
||||||
// $('body').on('keydown', function(e) {
|
// $('body').on('keydown', function(e) {
|
||||||
// commonCmd(e);
|
// commonCmd(e);
|
||||||
|
9
node_modules/api.js
generated
vendored
9
node_modules/api.js
generated
vendored
@@ -51,8 +51,9 @@ var Api = {
|
|||||||
// 是否断网
|
// 是否断网
|
||||||
unConnected: function(error) {
|
unConnected: function(error) {
|
||||||
var me = this;
|
var me = this;
|
||||||
// console.log(error);
|
|
||||||
if(error && (error.code == "ECONNREFUSED" || error.code == 'ECONNRESET')) { // socket hand up
|
if(error && (error.code == "ECONNREFUSED" || error.code == 'ECONNRESET')) { // socket hand up
|
||||||
|
console.error('---------------------')
|
||||||
|
console.error(error);
|
||||||
Web.unConnected();
|
Web.unConnected();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -79,9 +80,12 @@ var Api = {
|
|||||||
return url;
|
return url;
|
||||||
},
|
},
|
||||||
// 登录
|
// 登录
|
||||||
auth: function(email, pwd, callback) {
|
auth: function(email, pwd, host, callback) {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
|
// 设置server host
|
||||||
|
Evt.setHost(host);
|
||||||
|
|
||||||
// log({emai: email, pwd: pwd});
|
// log({emai: email, pwd: pwd});
|
||||||
console.log(this.getUrl('auth/login', {email: email, pwd: pwd}));
|
console.log(this.getUrl('auth/login', {email: email, pwd: pwd}));
|
||||||
// console.log('????????????')
|
// console.log('????????????')
|
||||||
@@ -97,6 +101,7 @@ var Api = {
|
|||||||
// console.log(ret);
|
// console.log(ret);
|
||||||
if(Common.isOk(ret)) {
|
if(Common.isOk(ret)) {
|
||||||
ret.Pwd = pwd;
|
ret.Pwd = pwd;
|
||||||
|
ret['Host'] = Evt.leanoteUrl;
|
||||||
User.setCurUser(ret);
|
User.setCurUser(ret);
|
||||||
callback && callback(ret);
|
callback && callback(ret);
|
||||||
} else {
|
} else {
|
||||||
|
19
node_modules/evt.js
generated
vendored
19
node_modules/evt.js
generated
vendored
@@ -16,12 +16,27 @@ if(!fs.existsSync(dataBasePath)) {
|
|||||||
// dataBasePath = '';
|
// dataBasePath = '';
|
||||||
|
|
||||||
var Evt = {
|
var Evt = {
|
||||||
// leanoteUrl: 'http://leanote.com',
|
defaultUrl: 'http://leanote.com',
|
||||||
leanoteUrl: 'http://localhost:9000',
|
|
||||||
|
leanoteUrl: 'http://leanote.com',
|
||||||
|
// leanoteUrl: 'http://localhost:9000',
|
||||||
|
|
||||||
|
setHost: function(host) {
|
||||||
|
if(!host) {
|
||||||
|
this.leanoteUrl = this.defaultUrl;
|
||||||
|
} else {
|
||||||
|
this.leanoteUrl = host;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
getHost: function() {
|
||||||
|
return this.leanoteUrl;
|
||||||
|
},
|
||||||
|
|
||||||
port: 8008,
|
port: 8008,
|
||||||
localUrl: 'http://127.0.0.1:8008',
|
localUrl: 'http://127.0.0.1:8008',
|
||||||
dataBasePath: '',
|
dataBasePath: '',
|
||||||
|
|
||||||
getImageLocalUrl: function(fileId) {
|
getImageLocalUrl: function(fileId) {
|
||||||
return this.localUrl + '/api/file/getImage?fileId=' + fileId;
|
return this.localUrl + '/api/file/getImage?fileId=' + fileId;
|
||||||
},
|
},
|
||||||
|
6
node_modules/user.js
generated
vendored
6
node_modules/user.js
generated
vendored
@@ -23,6 +23,7 @@ User = {
|
|||||||
userId: '',
|
userId: '',
|
||||||
email: '',
|
email: '',
|
||||||
username: '',
|
username: '',
|
||||||
|
host: '', // 服务
|
||||||
LastSyncUsn: -1,
|
LastSyncUsn: -1,
|
||||||
LastSyncTime: null,
|
LastSyncTime: null,
|
||||||
// 登录后保存当前
|
// 登录后保存当前
|
||||||
@@ -33,6 +34,7 @@ User = {
|
|||||||
this.userId = user.UserId;
|
this.userId = user.UserId;
|
||||||
this.email = user.Email;
|
this.email = user.Email;
|
||||||
this.username = user.Username;
|
this.username = user.Username;
|
||||||
|
this.host = user.Host; // http://leanote.com, http://localhost
|
||||||
// 保存到数据库中
|
// 保存到数据库中
|
||||||
this.saveCurUser(user);
|
this.saveCurUser(user);
|
||||||
|
|
||||||
@@ -40,6 +42,7 @@ User = {
|
|||||||
me.setUserDataPath();
|
me.setUserDataPath();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 不同host的userId可能一样, 潜在的bug
|
||||||
saveCurUser: function(user, callback) {
|
saveCurUser: function(user, callback) {
|
||||||
// 当前用户是否在数据库中
|
// 当前用户是否在数据库中
|
||||||
db.users.count({_id: user.UserId}, function(err, count) {
|
db.users.count({_id: user.UserId}, function(err, count) {
|
||||||
@@ -101,6 +104,9 @@ User = {
|
|||||||
me.username = user.Username;
|
me.username = user.Username;
|
||||||
me.LastSyncUsn = user.LastSyncUsn;
|
me.LastSyncUsn = user.LastSyncUsn;
|
||||||
me.LastSyncTime = user.LastSyncTime;
|
me.LastSyncTime = user.LastSyncTime;
|
||||||
|
me.host = user.Host;
|
||||||
|
|
||||||
|
Evt.setHost(me.host);
|
||||||
|
|
||||||
// 全局配置也在user中, 到web端
|
// 全局配置也在user中, 到web端
|
||||||
for(var i in me.g) {
|
for(var i in me.g) {
|
||||||
|
@@ -23,14 +23,16 @@
|
|||||||
<link rel="stylesheet" href="public/css/theme/presentation.css" type="text/css" disabled id="themePresentation"/>
|
<link rel="stylesheet" href="public/css/theme/presentation.css" type="text/css" disabled id="themePresentation"/>
|
||||||
<link rel="stylesheet" href="public/css/theme/writting.css" type="text/css" disabled id="themeWritting"/>
|
<link rel="stylesheet" href="public/css/theme/writting.css" type="text/css" disabled id="themeWritting"/>
|
||||||
|
|
||||||
|
<!-- mdeditor -->
|
||||||
|
<link href="public/dist/themes/default.css" rel="stylesheet" />
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// for windows
|
// for windows
|
||||||
if(process.platform != 'darwin') {
|
if(process.platform != 'darwin') {
|
||||||
document.write('<link rel="stylesheet" href="public/css/theme/windows.css" type="text/css" />');
|
document.write('<link rel="stylesheet" href="public/css/theme/windows.css" type="text/css" />');
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<!-- mdeditor -->
|
|
||||||
<link href="public/dist/themes/default.css" rel="stylesheet" />
|
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
11
package.json
11
package.json
@@ -10,12 +10,15 @@
|
|||||||
"frame": true,
|
"frame": true,
|
||||||
"transparent": false,
|
"transparent": false,
|
||||||
|
|
||||||
"min_width": 258,
|
"min_width": 268,
|
||||||
"min_height": 326,
|
"min_height": 346,
|
||||||
// "width": 400, // 1100,
|
// "width": 400, // 1100,
|
||||||
// "height": 300 // 600
|
// "height": 300 // 600
|
||||||
"width": 258,
|
"width": 278,
|
||||||
"height": 326
|
"height": 356
|
||||||
|
|
||||||
|
// width: 268px;
|
||||||
|
// height: 346px;
|
||||||
},
|
},
|
||||||
"chromium-args": "--enable-smooth-scrolling"
|
"chromium-args": "--enable-smooth-scrolling"
|
||||||
}
|
}
|
||||||
|
@@ -326,7 +326,7 @@ input,
|
|||||||
#box {
|
#box {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
color: #000;
|
color: #000;
|
||||||
padding-top: 40px;
|
padding-top: 30px;
|
||||||
}
|
}
|
||||||
#box h1 {
|
#box h1 {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
@@ -718,8 +718,8 @@ body {
|
|||||||
body #container {
|
body #container {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: 5px auto;
|
margin: 5px auto;
|
||||||
width: 248px;
|
width: 268px;
|
||||||
height: 316px;
|
height: 346px;
|
||||||
background-color: rgba(247, 249, 250, 0.99);
|
background-color: rgba(247, 249, 250, 0.99);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
border: 1px solid #eee;
|
border: 1px solid #eee;
|
||||||
@@ -762,6 +762,24 @@ btns {
|
|||||||
#loginBtn[disabled] .fa {
|
#loginBtn[disabled] .fa {
|
||||||
color: #ccc;
|
color: #ccc;
|
||||||
}
|
}
|
||||||
|
form {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
#loginMsg {
|
||||||
|
position: absolute;
|
||||||
|
top: -30px;
|
||||||
|
}
|
||||||
|
.server {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 5px;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.server a {
|
||||||
|
color: #666;
|
||||||
|
font-size: 85%;
|
||||||
|
}
|
||||||
.win-tool {
|
.win-tool {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@@ -336,7 +336,7 @@ input, .form-control {
|
|||||||
#box {
|
#box {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
color: #000;
|
color: #000;
|
||||||
padding-top: 40px;
|
padding-top: 30px;
|
||||||
h1 {
|
h1 {
|
||||||
width: @boxWidth;;
|
width: @boxWidth;;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
@@ -346,8 +346,6 @@ input, .form-control {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#boxHeader {
|
#boxHeader {
|
||||||
border-color: #e8e8e8;
|
border-color: #e8e8e8;
|
||||||
color: #333;
|
color: #333;
|
||||||
@@ -791,8 +789,8 @@ body {
|
|||||||
// bottom: 5px;
|
// bottom: 5px;
|
||||||
// padding: 5px;
|
// padding: 5px;
|
||||||
// padding-top: 0;
|
// padding-top: 0;
|
||||||
width: 248px;
|
width: 268px;
|
||||||
height: 316px;
|
height: 346px;
|
||||||
background-color: rgba(247,249,250,0.99);
|
background-color: rgba(247,249,250,0.99);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
border: 1px solid #eee;
|
border: 1px solid #eee;
|
||||||
@@ -843,6 +841,26 @@ body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
form {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
#loginMsg {
|
||||||
|
position: absolute;
|
||||||
|
top: -30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.server {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 5px;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
text-align: center;
|
||||||
|
a {
|
||||||
|
color: #666;
|
||||||
|
font-size: 85%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@import "traffic.less";
|
@import "traffic.less";
|
||||||
|
|
||||||
|
@@ -1219,7 +1219,7 @@ top: 4px;
|
|||||||
#editorContent {
|
#editorContent {
|
||||||
// border: 1px solid #ccc;
|
// border: 1px solid #ccc;
|
||||||
// border-radius: 5px;
|
// border-radius: 5px;
|
||||||
padding: 5px;
|
padding: 5px 10px;
|
||||||
outline: none;
|
outline: none;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
bottom: 5px !important;
|
bottom: 5px !important;
|
||||||
@@ -1744,5 +1744,10 @@ body {
|
|||||||
}
|
}
|
||||||
//--------- end
|
//--------- end
|
||||||
|
|
||||||
|
// 没有starred, 没有tag
|
||||||
|
.no-info {
|
||||||
|
text-align: center; margin: 10px 0; opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
@import '../traffic.less';
|
@import '../traffic.less';
|
||||||
@import '../ani.less';
|
@import '../ani.less';
|
||||||
|
@@ -55,3 +55,6 @@
|
|||||||
/* WebKit browsers */
|
/* WebKit browsers */
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
.no-info {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
@@ -58,3 +58,7 @@
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.no-info {
|
||||||
|
color: #fff;
|
||||||
|
}
|
@@ -58,3 +58,6 @@
|
|||||||
/* WebKit browsers */
|
/* WebKit browsers */
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
.no-info {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
@@ -62,3 +62,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.no-info {
|
||||||
|
color: #fff;
|
||||||
|
}
|
@@ -1118,7 +1118,7 @@ h3 {
|
|||||||
cursor: pointer !important;
|
cursor: pointer !important;
|
||||||
}
|
}
|
||||||
#editorContent {
|
#editorContent {
|
||||||
padding: 5px;
|
padding: 5px 10px;
|
||||||
outline: none;
|
outline: none;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
bottom: 5px !important;
|
bottom: 5px !important;
|
||||||
@@ -1534,6 +1534,11 @@ body.init #pageInner {
|
|||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
cursor: move;
|
cursor: move;
|
||||||
}
|
}
|
||||||
|
.no-info {
|
||||||
|
text-align: center;
|
||||||
|
margin: 10px 0;
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
.win-tool {
|
.win-tool {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@@ -35,6 +35,9 @@
|
|||||||
#editorContent:hover ::-webkit-scrollbar-thumb {
|
#editorContent:hover ::-webkit-scrollbar-thumb {
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
|
* {
|
||||||
|
font-family: 'Microsoft YaHei', '微软雅黑', ' WenQuanYi Micro Hei', 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', sans-serif;
|
||||||
|
}
|
||||||
body {
|
body {
|
||||||
border: none;
|
border: none;
|
||||||
border-shadow: none;
|
border-shadow: none;
|
||||||
@@ -42,10 +45,9 @@ body {
|
|||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
font-family: '微软雅黑';
|
|
||||||
}
|
}
|
||||||
* {
|
#newMyNote * {
|
||||||
font-family: '微软雅黑';
|
font-family: 'Arial';
|
||||||
}
|
}
|
||||||
html,
|
html,
|
||||||
body,
|
body,
|
||||||
|
@@ -52,6 +52,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@fontFamily: 'Microsoft YaHei', '微软雅黑',' WenQuanYi Micro Hei','Open Sans', 'Helvetica Neue',Arial,'Hiragino Sans GB',sans-serif;
|
||||||
|
|
||||||
|
* {
|
||||||
|
font-family: @fontFamily;
|
||||||
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
border: none;
|
border: none;
|
||||||
@@ -60,11 +65,13 @@ body {
|
|||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
font-family: '微软雅黑';
|
// font-family: '微软雅黑';
|
||||||
}
|
}
|
||||||
* {
|
|
||||||
font-family: '微软雅黑';
|
#newMyNote * {
|
||||||
|
font-family: 'Arial';
|
||||||
}
|
}
|
||||||
|
|
||||||
html, body, #page, #pageInner, #noteList, #notebook, #leftNotebook {
|
html, body, #page, #pageInner, #noteList, #notebook, #leftNotebook {
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
}
|
}
|
||||||
|
3
public/dist/themes/default.css
vendored
3
public/dist/themes/default.css
vendored
@@ -1469,13 +1469,14 @@ a.input-group-addon {
|
|||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
padding: 0 3px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
#mdEditor .preview-panel {
|
#mdEditor .preview-panel {
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
padding: 10px;
|
||||||
}
|
}
|
||||||
#mdEditor .wmd-button,
|
#mdEditor .wmd-button,
|
||||||
#mdEditor .preview-button {
|
#mdEditor .preview-button {
|
||||||
|
@@ -1804,6 +1804,10 @@ Note.renderStars = function(notes) {
|
|||||||
var t = tt(me.starItemT, note.NoteId, note.Title || 'Untitled');
|
var t = tt(me.starItemT, note.NoteId, note.Title || 'Untitled');
|
||||||
me.starNotesO.append(t);
|
me.starNotesO.append(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(notes.length == 0) {
|
||||||
|
me.starNotesO.html('<p class="no-info">No Starred Note</p>');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 点击笔记, 判断是否在star中, 如果在, 则也选中
|
// 点击笔记, 判断是否在star中, 如果在, 则也选中
|
||||||
|
@@ -398,7 +398,7 @@ function initEditor() {
|
|||||||
selector : "#editorContent",
|
selector : "#editorContent",
|
||||||
// height: 100,//这个应该是文档的高度, 而其上层的高度是$("#content").height(),
|
// height: 100,//这个应该是文档的高度, 而其上层的高度是$("#content").height(),
|
||||||
// parentHeight: $("#content").height(),
|
// parentHeight: $("#content").height(),
|
||||||
content_css : ["public/css/editor/editor.css"],
|
// content_css : ["public/css/editor/editor.css"],
|
||||||
skin : "custom",
|
skin : "custom",
|
||||||
language: LEA.locale, // 语言
|
language: LEA.locale, // 语言
|
||||||
plugins : [
|
plugins : [
|
||||||
@@ -1519,9 +1519,17 @@ function userMenu() {
|
|||||||
function menu() {
|
function menu() {
|
||||||
var me = this;
|
var me = this;
|
||||||
// this.target = '';
|
// this.target = '';
|
||||||
|
var shortHost = UserInfo.Host;
|
||||||
|
if(shortHost) {
|
||||||
|
var ret = /http(s*):\/\/([a-zA-Z0-9\.\-]+)/.exec(shortHost);
|
||||||
|
if(ret && ret.length == 3) {
|
||||||
|
shortHost = ret[2];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.menu = new gui.Menu();
|
this.menu = new gui.Menu();
|
||||||
this.email = new gui.MenuItem({
|
this.email = new gui.MenuItem({
|
||||||
label: UserInfo.Email,
|
label: UserInfo.Email + ' (' + shortHost + ')',
|
||||||
enabled: false,
|
enabled: false,
|
||||||
click: function(e) {
|
click: function(e) {
|
||||||
}
|
}
|
||||||
|
@@ -264,6 +264,10 @@ Tag.renderTagNav = function(tags) {
|
|||||||
// 笔记数量先隐藏, 不准确
|
// 笔记数量先隐藏, 不准确
|
||||||
$("#tagNav").append(tt('<li data-tag="?"><a> <span class="?">? <em style="display: none">(?)</em></span> <i class="tag-delete">X</i></li>', tag, classes, text, noteTag.Count));
|
$("#tagNav").append(tt('<li data-tag="?"><a> <span class="?">? <em style="display: none">(?)</em></span> <i class="tag-delete">X</i></li>', tag, classes, text, noteTag.Count));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(tags.length == 0) {
|
||||||
|
$("#tagNav").html('<p class="no-info">No tag</p>');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 添加的标签重新render到左边, 放在第一个位置
|
// 添加的标签重新render到左边, 放在第一个位置
|
||||||
|
@@ -417,27 +417,33 @@ function pasteImage(e) {
|
|||||||
// find pasted image among pasted items
|
// find pasted image among pasted items
|
||||||
var blob;
|
var blob;
|
||||||
for (var i = 0; i < items.length; i++) {
|
for (var i = 0; i < items.length; i++) {
|
||||||
if (items[i].type.indexOf("image") === 0) {
|
// if (items[i].type.indexOf("image") === 0) {
|
||||||
blob = items[i].getAsFile();
|
blob = items[i].getAsFile();
|
||||||
}
|
console.log("paste images");
|
||||||
}
|
console.log(blob);
|
||||||
// console.log("paste images");
|
|
||||||
// console.log(blob);
|
|
||||||
// load image if there is a pasted image
|
// load image if there is a pasted image
|
||||||
if (blob) {
|
if (blob) {
|
||||||
// console.log("??");
|
// console.log("??");
|
||||||
var reader = new FileReader();
|
var reader = new FileReader();
|
||||||
reader.onloadend = function() {
|
reader.onloadend = function() {
|
||||||
console.log('read end');
|
console.log('read end');
|
||||||
|
console.log(reader);
|
||||||
console.log(reader.result);
|
console.log(reader.result);
|
||||||
if(reader.result) {
|
if(reader.result) {
|
||||||
|
if(blob.type.indexOf('image/') === 0) { // image类型
|
||||||
FileService.pasteImage2(reader.result, function(url) {
|
FileService.pasteImage2(reader.result, function(url) {
|
||||||
insertImage(url);
|
insertImage(url);
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
// 作为附件上传
|
||||||
|
// mac下还是图片
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
reader.readAsDataURL(blob);
|
reader.readAsDataURL(blob);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 插入图片(链接)
|
// 插入图片(链接)
|
||||||
@@ -1376,7 +1382,11 @@ var ContextTips = {
|
|||||||
function switchAccount() {
|
function switchAccount() {
|
||||||
SyncService.stop();
|
SyncService.stop();
|
||||||
// location.href = 'login.html';
|
// location.href = 'login.html';
|
||||||
var w = gui.Window.open('login.html', {frame: false, toolbar: false, resizable: false, transparent: true, width: 258, max_width: 258});
|
var w = gui.Window.open('login.html', {
|
||||||
|
frame: false, toolbar: false, resizable: false,
|
||||||
|
transparent: true,
|
||||||
|
width: 278,
|
||||||
|
max_width: 278});
|
||||||
// w.focus();
|
// w.focus();
|
||||||
// gui.Window.close();
|
// gui.Window.close();
|
||||||
win.close();
|
win.close();
|
||||||
|
@@ -117,12 +117,14 @@ define("tinymce/pasteplugin/Plugin", [
|
|||||||
active: self.clipboard.pasteFormat == "text"
|
active: self.clipboard.pasteFormat == "text"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
editor.addButton('pasteCopyImage', {
|
editor.addButton('pasteCopyImage', {
|
||||||
icon: 'copy',
|
icon: 'copy',
|
||||||
tooltip: "When Paste other site's image, copy it into my album as public image",
|
tooltip: "When Paste other site's image, copy it into my album as public image",
|
||||||
onclick: togglePasteCopyImage,
|
onclick: togglePasteCopyImage,
|
||||||
active: self.clipboard.copyImage === true
|
active: self.clipboard.copyImage === true
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
editor.addMenuItem('pastetext', {
|
editor.addMenuItem('pastetext', {
|
||||||
text: 'Paste as text',
|
text: 'Paste as text',
|
||||||
|
@@ -1192,12 +1192,14 @@ define("tinymce/pasteplugin/Plugin", [
|
|||||||
active: self.clipboard.pasteFormat == "text"
|
active: self.clipboard.pasteFormat == "text"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
editor.addButton('pasteCopyImage', {
|
editor.addButton('pasteCopyImage', {
|
||||||
icon: 'copy',
|
icon: 'copy',
|
||||||
tooltip: "When Paste other site's image, copy it into my album as public image",
|
tooltip: "When Paste other site's image, copy it into my album as public image",
|
||||||
onclick: togglePasteCopyImage,
|
onclick: togglePasteCopyImage,
|
||||||
active: self.clipboard.copyImage === true
|
active: self.clipboard.copyImage === true
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
editor.addMenuItem('pastetext', {
|
editor.addMenuItem('pastetext', {
|
||||||
text: 'Paste as text',
|
text: 'Paste as text',
|
||||||
|
Reference in New Issue
Block a user