-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.js
More file actions
26 lines (20 loc) · 787 Bytes
/
Copy pathsetup.js
File metadata and controls
26 lines (20 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const setup = async () => {
// divを作る
$("textarea[name=msg]").before('<div id="pukiwiki-editor-container"></div>');
// previewの取得
const preview = await fetchPreview();
// divの中にtextareaとpreviewを入れる
$("#pukiwiki-editor-container").append($("textarea[name=msg]"));
$("#pukiwiki-editor-container").append(preview);
// textareaにidを付加
$("textarea[name=msg]").attr("id", "edit-pane");
$("input[name=template]").after(
'<button type="button" id="reload">プレビュー更新</button>'
);
chrome.storage.sync.get(null, (options) => {
if (options.font !== undefined && options.font !== "default") {
$("#edit-pane").css("font-family", options.font);
}
});
$("input[name=preview]").css("display", "none");
};