From 49e1a9397ca86ac026e04c6f6f622952d40b73cb Mon Sep 17 00:00:00 2001 From: eterlan <703246769@qq.com> Date: Mon, 3 Mar 2025 23:28:37 +0800 Subject: [PATCH 1/5] ver 0.3 --- README.md | 7 + .../workflowy_images_tampermonkey_script.js | 148 +++++++++++++++--- 2 files changed, 130 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index e89ac6e..c98ab8e 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,13 @@ _(Credit for the Tampermonkey installation directions go to Frank Degenaar. I took the directions and screenshots he wrote from [the blogpost he wrote on the Workflowy Site](https://blog.workflowy.com/2016/01/06/inline-images/)._ +## Version History + +- 0.3: + - Add support for Bilibili videos. + - Remove images once link is removed. + - Fix some bugs + ## Credits I did not come up with this idea. diff --git a/tampermonkey/workflowy_images_tampermonkey_script.js b/tampermonkey/workflowy_images_tampermonkey_script.js index 19cc97e..ac03d82 100644 --- a/tampermonkey/workflowy_images_tampermonkey_script.js +++ b/tampermonkey/workflowy_images_tampermonkey_script.js @@ -1,26 +1,25 @@ // ==UserScript== -// @name workflowy-images +// @name workflowy-images-and-bilibili-videos // @namespace http://tampermonkey.net/ -// @version 0.2 +// @version 0.3 // @description Embed image links into workflowy -// @author Jonathan Leung (https://github.com/jonleung) +// @author Jonathan Leung (https://github.com/jonleung)&eterlan(https://github.com/eterlan) // @match https://workflowy.com/* // @grant none +// @require https://code.jquery.com/jquery-3.6.0.min.js +// @require https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.13.1/underscore-min.js // ==/UserScript== -'use strict'; +"use strict"; var IMAGE_EXTENSIONS = [".png", ".jpg", ".jpeg", ".gif", ".bmp"]; function createImageNodeAfterNode($node, imgSrc) { if ($node.parent().find(".content-img").length === 0) { - var $div = $("