mirror of
https://github.com/arfct/itty-bitty.git
synced 2026-03-11 08:54:33 +00:00
Better twitter sharing, added copy confirmation to copy link
This commit is contained in:
parent
becc28d51c
commit
7af47b5101
3 changed files with 23 additions and 5 deletions
17
edit.css
17
edit.css
|
|
@ -164,6 +164,23 @@ body.edited #doc-title:empty:before,
|
|||
cursor:pointer;
|
||||
}
|
||||
|
||||
|
||||
#copy-message {
|
||||
background:#2d2d2d;
|
||||
color:white;
|
||||
top:0.5em;
|
||||
right:0.5em;
|
||||
position:absolute;
|
||||
padding:0.5em 1em;
|
||||
z-index:100;
|
||||
font-family:monospace;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
body:not(.copied) #copy-message {
|
||||
display:none;
|
||||
}
|
||||
|
||||
#menus-share-hint {
|
||||
content:'hello';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<html>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; connect-src https://codepen.io; style-src 'unsafe-inline' 'self'">
|
||||
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; connect-src https://codepen.io; style-src 'unsafe-inline' 'self'">
|
||||
<title>itty.bitty</title>
|
||||
<script src="lzma/lzma_worker-min.js"></script>
|
||||
<script src="jquery-3.3.1.min.js"></script>
|
||||
|
|
@ -19,6 +19,7 @@ itty bitty things<br>
|
|||
can be conveyed in a link.<br>
|
||||
type here – and then share!<p><a id="ib-info" href="http://about.bitty.site" target="_blank">about itty bitty</a><br>
|
||||
</div>
|
||||
<div id="copy-message">Link copied to clipboard.</div>
|
||||
<div id="content"></div>
|
||||
<span id="toolbar">
|
||||
<a target="_blank" id="length"></a> <a target="_blank" id="qrcode" href="https://zxing.appspot.com/generator/">qr code</a> <a target="_blank" id="menu">menu</a>
|
||||
|
|
|
|||
8
edit.js
8
edit.js
|
|
@ -26,7 +26,7 @@ window.onload = function() {
|
|||
content.focus();
|
||||
document.execCommand('selectAll',false,null);
|
||||
QS('#qrcode').onclick = makeQRCode
|
||||
QS('#twitter').onclick = copyThenLink
|
||||
QS('#twitter').onclick = tweetLink
|
||||
QS('#copy').onclick = copyLink
|
||||
QS('#menu').onclick = toggleMenu
|
||||
var hash = window.location.hash.substring(1)
|
||||
|
|
@ -240,10 +240,10 @@ function copyLink() {
|
|||
document.execCommand("copy");
|
||||
document.body.removeChild(dummy);
|
||||
|
||||
document.body.addClass("copied")
|
||||
document.body.classList.add("copied")
|
||||
setTimeout(function() {
|
||||
document.body.removeClass("copied")
|
||||
}, 300);
|
||||
document.body.classList.remove("copied")
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
function saveLink() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue