LoginSignup
0
3

More than 3 years have passed since last update.

Scrapboxのuserscriptを使ってリンク先をプレビューする

Last updated at Posted at 2019-06-23

Demo

Image from Gyazo

Userscriptの使いかた

については下記のサイトなどを参照してほしい。
https://qiita.com/beeeyan/items/0d04b1859943a9a1e92c

ライブプレビューのjQueryプラグイン

http://www.ampedupdesigns.com/blog/show?bid=49を採用。コードをここからダウンロード > https://github.com/alanphoon/jquery-live-preview

userscriptは以下を参照

https://scrapbox.io/wordbook/yamato

ポイント:jquery-live-preview.js をそのままコピペしても動かないです。

jquery-live-preview.js
//(function($) {

(省略)

//})(jQuery);

という感じでコメントアウトしてください。

CSS

livepreview-demo.css を usercss として settings にコピペ。
例:https://scrapbox.io/wordbook/settings

ローディングアイコン

上記のSettingsの中でどこか参照できるところにこれを置く。

icon_loading.gif

というかこれで置かれているので、settingsの中のlivepreview-demo.cssをコピペした内容の下記のところを書きかえる。

livepreview-demo.css
//background-image:url('/images/icon_loading.gif');
     background-image:url('https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/18839/5d8154ec-88d8-5ce6-24a2-57f44c20a0ce.gif');

課題

現状はリロードしないとaタグのclassが書き変わらないときがある。どうしたものだろう。

以上です。これで英語の勉強が益々捗る。

0
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
3