添加全局 toggle modify with readonly; 发布1.4.1
This commit is contained in:
1
public/css/css/default.css
Normal file
1
public/css/css/default.css
Normal file
File diff suppressed because one or more lines are too long
1
public/css/css/simple.css
Normal file
1
public/css/css/simple.css
Normal file
File diff suppressed because one or more lines are too long
1
public/css/css/writting-overwrite.css
Normal file
1
public/css/css/writting-overwrite.css
Normal file
File diff suppressed because one or more lines are too long
1
public/css/css/writting.css
Normal file
1
public/css/css/writting.css
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -286,3 +286,17 @@ a.raw:hover {
|
||||
.modal-footer {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
// 不让选择, 双击
|
||||
#editorTool,
|
||||
#newNoteWrap,
|
||||
#myBlog,
|
||||
.lea-blog,
|
||||
#myProfile,
|
||||
#toggleEditorMode,
|
||||
.folderHeader
|
||||
{
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
user-select: none;
|
||||
}
|
@ -100,3 +100,17 @@
|
||||
color: #666;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
// read-only-editor
|
||||
.read-only-editor #editBtn span {
|
||||
&:before {
|
||||
content: "\f044";
|
||||
}
|
||||
}
|
||||
|
||||
// eye
|
||||
#editBtn span {
|
||||
&:before {
|
||||
content: "\f06e";
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
6
public/js/app.min.js
vendored
6
public/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
@ -416,14 +416,14 @@ Note.curChangedSaveIt = function(force, callback) {
|
||||
// 如果当前没有笔记, 不保存
|
||||
// 或者是共享的只读笔记
|
||||
if(!Note.curNoteId || Note.isReadOnly) {
|
||||
log(!Note.curNoteId ? '无当前笔记' : '共享只读');
|
||||
// log(!Note.curNoteId ? '无当前笔记' : '共享只读');
|
||||
return;
|
||||
}
|
||||
var hasChanged;
|
||||
try {
|
||||
hasChanged = Note.curHasChanged(force);
|
||||
} catch(e) {
|
||||
console.error('获取当前改变的笔记错误!');
|
||||
// console.error('获取当前改变的笔记错误!');
|
||||
callback && callback(false);
|
||||
return;
|
||||
}
|
||||
@ -1560,6 +1560,7 @@ Note.toggleReadOnly = function(needSave) {
|
||||
|
||||
// markdown
|
||||
$('#mdEditor').addClass('read-only');
|
||||
$('#note').addClass('read-only-editor');
|
||||
|
||||
if(!note) {
|
||||
return;
|
||||
@ -1596,6 +1597,7 @@ LEA.toggleWriteable = Note.toggleWriteable = function(isFromNewNote) {
|
||||
|
||||
// $('#infoToolbar').hide();
|
||||
$('#editor').removeClass('read-only');
|
||||
$('#note').removeClass('read-only-editor');
|
||||
$('#editorContent').attr('contenteditable', true);
|
||||
|
||||
// markdown
|
||||
@ -1623,6 +1625,8 @@ LEA.toggleWriteable = Note.toggleWriteable = function(isFromNewNote) {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// page ctrl+e也会
|
||||
Note.toggleWriteableAndReadOnly = function () {
|
||||
if (LEA.readOnly) {
|
||||
Note.toggleWriteable();
|
||||
@ -2500,6 +2504,9 @@ $(function() {
|
||||
$('.toolbar-update').click(function() {
|
||||
Note.toggleWriteable();
|
||||
});
|
||||
$("#editBtn").click(function() {
|
||||
Note.toggleWriteableAndReadOnly();
|
||||
});
|
||||
|
||||
//
|
||||
// 笔记内容里的链接跳转
|
||||
|
Reference in New Issue
Block a user