leanote 信息栏显示笔记本和笔记类型

本文解决如下两个问题:

1. 在列表视图下使用搜索时,不知道搜出来的笔记属于哪个笔记本。(摘要视图下是有显示的)

2. 增加显示笔记类型(markdown 或 富文本)

 

修改resources\app\public\js\app\note.js:

1918行,添加如下带注释的两行:

if (note.IsMarkdown) {
    $('#mdInfoToolbar .created-time').html(goNowToDatetime(note.CreatedTime));
    $('#mdInfoToolbar .updated-time').html(goNowToDatetime(note.UpdatedTime));
    $('#mdInfoToolbar .notebook').html(Notebook.getNotebookTitle(note.NotebookId)); // added by wangyong
} else {
    $('#infoToolbar .created-time').html(goNowToDatetime(note.CreatedTime));
    $('#infoToolbar .updated-time').html(goNowToDatetime(note.UpdatedTime));
    $('#infoToolbar .notebook').html(Notebook.getNotebookTitle(note.NotebookId)); // added by wangyong
}

 

修改resources\app\note.html:

找到361行,添加如下一行:

<!-- 查看信息 -->
<div id="infoToolbar" class="info-toolbar">

  <span class="lang">Created</span>: <span class="created-time">2015-04-03</span>
  <span class="lang">Updated</span>: <span class="updated-time">2015-05-01</span>
  <span class="lang">Notebook</span>: <span class="notebook">unknown</span> <!-- added by wy-->
</div>

再找到404行,添加如下两行:

<div id="mdInfoToolbar" class="info-toolbar">

  <span class="lang"> MD </span> <!-- added by wy-->
  <span class="lang">Created</span>: <span class="created-time">2015-04-03</span>
  <span class="lang">Updated</span>: <span class="updated-time">2015-05-01</span>
  <span class="lang">Notebook</span>: <span class="notebook">unknown</span> <!-- added by wy-->
</div>

MD 表示这是一篇markdown格式的笔记。

效果如下:

 

posted @ 2018-03-19 20:49  duanguyuan  阅读(249)  评论(0编辑  收藏