From 54e9eb2a69e55eb5205108e6e3d791decd75a1b0 Mon Sep 17 00:00:00 2001 From: life Date: Mon, 26 Oct 2015 18:04:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=AF=BC=E5=87=BAtags?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/plugins/export_evernote/plugin.js | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/public/plugins/export_evernote/plugin.js b/public/plugins/export_evernote/plugin.js index 8c596205..1f3fb268 100644 --- a/public/plugins/export_evernote/plugin.js +++ b/public/plugins/export_evernote/plugin.js @@ -14,12 +14,13 @@ define(function() { var evernoteTpl = ` - + {title} {content} ]]> {createdTime} {updatedTime} + {tags} @@ -122,8 +123,8 @@ define(function() { render: function(note, callback) { var me = this; - var keys = ['title', 'content', 'createdTime', 'updatedTime', - 'isMarkdown', 'exportTime', 'appVersion', 'authorEmail', 'platform', 'resources']; + var keys = ['title', 'content', 'createdTime', 'updatedTime', 'tags', + 'isMarkdown', 'exportedTime', 'appVersion', 'authorEmail', 'platform', 'resources']; var tpl = evernoteTpl; var appVersion = Api.getCurVersion() || {version: 'unknown'}; var info = { @@ -131,12 +132,13 @@ define(function() { content: note.Content, createdTime: me.getEvernoteTime(note.createdTime), updatedTime: me.getEvernoteTime(note.updatedTime), - exportTime: me.getEvernoteTime(), + exportedTime: me.getEvernoteTime(), appVersion: '1.0', authorEmail: Api.userService.email || Api.userService.username, platform: process.platform, appVersion: appVersion.version, - isMarkdown: note.isMarkdown ? 'true' : 'false' + isMarkdown: note.isMarkdown ? 'true' : 'false', + tags: me.renderTags(note.Tags) }; me.fixResources(note.Content, function (content, resources) { @@ -156,6 +158,17 @@ define(function() { }); }, + renderTags: function (tags) { + if (!tags || tags.length === 0){ + return '' + } + var str = ''; + for (var i = 0; i < tags.length; ++i) { + str += '' + tags[i] + ''; + } + return str; + }, + // 得到resource renderResource: function (fileInfo) { var me = this;