Skip to content

Instantly share code, notes, and snippets.

Last active Nov 9, 2019
What would you like to do?
Create a new page in Scrapbox (
<!DOCTYPE html>
<html lang="ja">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<script src="" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<link rel="stylesheet" href="" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<script src="" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<div class="container-fluid">
<div class="row">
<div class="col-xs-3">
<div class="panel panel-primary">
<div class="panel-heading">Create a new page</div>
<div class="panel-body">
<textarea id="SCRAPBOX-NEW" style="border:none; box-shadow:none; width:100%; outline:none;" class="list-group-item form-control" placeholder=""></textarea>
<div class="panel-footer">
<a id="SCRAPBOX-CREATE" class="btn btn-primary">Create</a>
</div><!-- /container-fluid -->
$(function() {
const project = '';
function create() {
if (!navigator.onLine) {
alert("Network is offline.");
} else if (confirm('Create a new page in Scrapbox')) {
const val = $('#SCRAPBOX-NEW').val();
const ar = val.split('\n');
const title = ar.shift();
const body = ar.join("\n"); + encodeURIComponent(title) + '?body=' + encodeURIComponent(body));
$('#SCRAPBOX-NEW').attr('placeholder', 'Title'+"\n"+'Body');
$('#SCRAPBOX-NEW').keydown(function(e) {
if (e.metaKey && e.keyCode == 13) {
return false;
return true;
$('#SCRAPBOX-CREATE').click(function(e) {
Copy link

hyuki commented Nov 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment