mirror of
https://github.com/leanote/desktop-app.git
synced 2025-12-12 02:01:28 +08:00
leanote协议完成
This commit is contained in:
@@ -422,6 +422,10 @@ Note.genAbstract = function(content, len) {
|
||||
return d.innerHTML;
|
||||
};
|
||||
|
||||
Note.fixImageSrc = function(src) {
|
||||
return fixContentUrl(src);
|
||||
};
|
||||
|
||||
Note.getImgSrc = function(content) {
|
||||
if(!content) {
|
||||
return "";
|
||||
@@ -779,9 +783,9 @@ Note.renderChangedNote = function(changedNote) {
|
||||
$thumb = $leftNoteNav.find(".item-thumb");
|
||||
// 有可能之前没有图片
|
||||
if($thumb.length > 0) {
|
||||
$thumb.find("img").attr("src", changedNote.ImgSrc);
|
||||
$thumb.find("img").attr("src", Note.fixImageSrc(changedNote.ImgSrc));
|
||||
} else {
|
||||
$leftNoteNav.append(tt('<div class="item-thumb" style=""><img src="?"></div>', changedNote.ImgSrc));
|
||||
$leftNoteNav.append(tt('<div class="item-thumb" style=""><img src="?"></div>', Note.fixImageSrc(changedNote.ImgSrc)));
|
||||
$leftNoteNav.addClass("item-image");
|
||||
}
|
||||
$leftNoteNav.find(".item-desc").removeAttr("style");
|
||||
@@ -982,7 +986,7 @@ Note._getNoteHtmlObjct = function(note, isShared) {
|
||||
|
||||
var tmp;
|
||||
if(note.ImgSrc) {
|
||||
tmp = tt(Note.itemTpl, classes, this.newNoteSeq(), note.NoteId, note.ImgSrc, note.Title, Notebook.getNotebookTitle(note.NotebookId), goNowToDatetime(note.UpdatedTime), note.Desc);
|
||||
tmp = tt(Note.itemTpl, classes, this.newNoteSeq(), note.NoteId, Note.fixImageSrc(note.ImgSrc), note.Title, Notebook.getNotebookTitle(note.NotebookId), goNowToDatetime(note.UpdatedTime), note.Desc);
|
||||
} else {
|
||||
tmp = tt(Note.itemTplNoImg, classes, this.newNoteSeq(), note.NoteId, note.Title, Notebook.getNotebookTitle(note.NotebookId), goNowToDatetime(note.UpdatedTime), note.Desc);
|
||||
}
|
||||
@@ -1028,7 +1032,7 @@ Note._renderNotes = function(notes, forNewNote, isShared, tang) { // 第几趟
|
||||
|
||||
var tmp;
|
||||
if(note.ImgSrc) {
|
||||
tmp = tt(Note.itemTpl, classes, i, note.NoteId, note.ImgSrc, note.Title, Notebook.getNotebookTitle(note.NotebookId), goNowToDatetime(note.UpdatedTime), note.Desc || '');
|
||||
tmp = tt(Note.itemTpl, classes, i, note.NoteId, Note.fixImageSrc(note.ImgSrc), note.Title, Notebook.getNotebookTitle(note.NotebookId), goNowToDatetime(note.UpdatedTime), note.Desc || '');
|
||||
} else {
|
||||
tmp = tt(Note.itemTplNoImg, classes, i, note.NoteId, note.Title, Notebook.getNotebookTitle(note.NotebookId), goNowToDatetime(note.UpdatedTime), note.Desc || '');
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ var Evt = require('evt');
|
||||
var app = require('remote').require('app');
|
||||
var basePath = app.getPath('appData') + '/leanote'; // /Users/life/Library/Application Support/Leanote'; // require('nw.gui').App.dataPath;
|
||||
Evt.setDataBasePath(basePath);
|
||||
var protocol = require('remote').require('protocol');
|
||||
|
||||
if(!/login.html/.test(location.href)) {
|
||||
// 启动服务器, 图片
|
||||
|
||||
Reference in New Issue
Block a user