From deaff63e17feac4e7b6ec5e5896033b83a8a2dcf Mon Sep 17 00:00:00 2001 From: Kenshin Date: Sat, 21 Dec 2019 16:48:35 +0800 Subject: [PATCH] Add export to weizhi logic. --- src/service/output.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/service/output.js b/src/service/output.js index 76cfd9f1..ef5729a9 100644 --- a/src/service/output.js +++ b/src/service/output.js @@ -188,8 +188,8 @@ function action( type, title, desc, content ) { } break; } - } else if ( [ "dropbox", "pocket", "instapaper", "linnk", "yinxiang","evernote", "onenote", "gdrive", "jianguo", "yuque", "notion", "youdao" ].includes( type ) ) { - const { dropbox, pocket, instapaper, linnk, evernote, onenote, gdrive, jianguo, yuque, notion, youdao } = exp, + } else if ( [ "dropbox", "pocket", "instapaper", "linnk", "yinxiang","evernote", "onenote", "gdrive", "jianguo", "yuque", "notion", "youdao", "weizhi" ].includes( type ) ) { + const { dropbox, pocket, instapaper, linnk, evernote, onenote, gdrive, jianguo, yuque, notion, youdao, weizhi } = exp, id = type == "yinxiang" ? "evernote" : type; storage.Statistics( "service", type ); const service = type => { @@ -298,6 +298,18 @@ function action( type, title, desc, content ) { }); }); break; + case "weizhi": + const theme = th.Get( storage.read.theme ), + global = th.Get( "global" ), + common = th.Get( "common" ), + css = ss.GetCustomCSS(), + html = offline.HTML( title, desc, content, { global, common, theme, css } ); + weizhi.username = storage.secret.weizhi.username; + weizhi.access_token = storage.secret.weizhi.access_token; + weizhi.Add( window.location.href, title, html, ( result, error ) => { + exp.svcCbWrapper( result, error, weizhi.name, type, new Notify() ) + }); + break; } };