From ba6d37138fed6e3f3c13579143df096274fcad82 Mon Sep 17 00:00:00 2001 From: Kenshin Date: Wed, 18 Dec 2019 10:15:00 +0800 Subject: [PATCH] Optimize offline html lgoic. --- src/service/output.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/service/output.js b/src/service/output.js index 48ef50a6..a816b983 100644 --- a/src/service/output.js +++ b/src/service/output.js @@ -91,18 +91,18 @@ function action( type, title, desc, content ) { }); break; case "html": - /* const notify2 = new Notify().Render({ content: "图片转换中吗,请稍等...", state: "loading" }); offline.getImages( () => { notify2.complete(); new Notify().Render( 0, "全部图片已经转换完毕,马上开始下载,请稍等。" ); + const theme = th.Get( storage.read.theme ), + global = th.Get( "global" ), + common = th.Get( "common" ), + html = offline.HTML( title, desc, $( "sr-rd-content" ).html(), { global, common, theme } ); + browser.runtime.sendMessage( msg.Add( msg.MESSAGE_ACTION.download, { data: html, name: `simpread-${title}.html` }), result => { + console.log( "Current download result: ", result ) + }); }); - */ - const theme = th.Get( storage.read.theme ), - global = th.Get( "global" ), - common = th.Get( "common" ); - const html = offline.HTML( title, desc, content, { global, common, theme } ); - exp.Download( "data:text/plain;charset=utf-8," + encodeURIComponent(html), `simpread-${title}.html` ); break; case "temp": case "kindle":