Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

66 lines (58 sloc) 2.246 kB
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="bar.css" type="text/css" />
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="utils.js"></script>
<script type="text/javascript">
function submit(e) {
if (clickOpenURL(e, 'http://reddit.com/submit/?resubmit=true'+
'&url='+window.location.hash.substr(1)+
'&title='+encodeURIComponent($('#title-input').val()))) {
// If the page is going away, show a working indicator.
$('#submit span').css('background-image', 'url(images/working0.png)');
$('#submit').css('opacity', .5).unbind();
}
// Pause for a moment, then zip away.
window.setTimeout(function() {
msgJSON({action:'close'});
}, 500);
}
function update() {
$('#title-input').attr('placeholder', function(i, val) {
var adjs = ['a clever', 'a snarky', 'a nifty', 'an exciting', 'an alluring', 'a juicy', 'an engaging', 'a concise'];
var ends = ['Be witty!', 'Be silly!', 'Be nice!', 'Huzzah!', 'Have fun!', 'Good luck!'];
return 'Enter '+randomChoice(adjs)+' title to share this page with reddit. '+randomChoice(ends);
});
window.setTimeout(function() {
msgJSON({action:'size', width:$('#bar').outerWidth(), height:$('#bar').outerHeight()});
}, 10);
}
$(document).ready(function() {
$(window).resize(function() {
update();
});
$('#submit').click(submit);
$('#title-input').keypress(function(e) {
if (e.which == 13) {
submit(e);
}
});
$('#close').click(function() {
msgJSON({action:'close'});
});
update();
});
</script>
</head>
<body>
<div id="bar">
<a id="logo" href="http://www.reddit.com" target="_top"></a>
<input id="title-input">
<div id="buttons">
<button id="submit"><span>Submit</span></button>
<button id="close" ><img src="/images/close.svg" alt="close"/></button>
</div>
</div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.