Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
107 lines (96 sloc) 3.85 KB
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta property="og:image" content="https://i.giphy.com/media/4k184nfxSphcs/200_s.gif">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-39936633-2', 'auto');
ga('send', 'pageview');
</script>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-2169254822168146",
enable_page_level_ads: true
});
</script>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function () {
var button = document.getElementById(
'button'
), input = document.getElementById(
'input'
), form = document.getElementById(
'form'
), result = document.getElementById(
'result'
), clap = ' 👏 ',
strs = [],
i = 0,
action = function (e) {
e.preventDefault();
var value = input.value.trim() + ' ',
strippedValue = value.replace(new RegExp('[' + ' ' + ']', 'g'), clap),
html;
if (value === "") {
return;
}
html = '<p><span id="select_'+ i +'">';
html += strippedValue;
html += ' </span><a target="_blank"' +
' href="https://twitter.com/intent/tweet?text=' +
encodeURIComponent(strippedValue) +
'">'+
'tweet</a> | <a href="#" onclick="return select(' + i + ')">copy</a>';
html += '</p>';
strs.unshift(html);
result.innerHTML = strs.join('');
input.value = '';
};
form.addEventListener('submit', action);
input.focus();
select = function (id) {
var str = "select_" + id;
var text = document.getElementById(str);
var selection = window.getSelection();
var range = document.createRange();
range.selectNodeContents(text);
selection.removeAllRanges();
selection.addRange(range);
//add to clipboard.
document.execCommand('copy');
return false;
};
i++;
});
</script>
<title>Add Claps</title>
</head>
<body>
<div class="container">
<h1>Add Claps</h1>
<form class="form" id="form" autocomplete="off">
<div class="form-group">
<div class="row">
<div class="col-sm-10">
<input type="text" id="input" class="form-control input-lg" placeholder="type stuff here to add claps" />
</div>
<div class="col-sm-2">
<button type="submit" id="button" class="form-control input-lg" style="margin: auto;">
<span class="glyphicon glyphicon-ok"></span>
</button>
</div>
</div>
</div>
</form>
<div id="result" style="font-size: 26px; line-height: 50px;"></div>
</div>
</body>
</html>