mirror of
https://github.com/perlbot/perlbuut-pastebin
synced 2025-06-07 14:17:26 -04:00
Add some simple javascript to autoselect the channel
This commit is contained in:
parent
ad1dde4810
commit
55254c752a
2 changed files with 23 additions and 0 deletions
BIN
pastes.db
BIN
pastes.db
Binary file not shown.
|
@ -16,6 +16,29 @@
|
|||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(function() {
|
||||
var hostname = $(location).attr('hostname');
|
||||
var channel = $(location).attr('hash');
|
||||
|
||||
// console.log("host: " + hostname + " channel: " + channel);
|
||||
|
||||
// fuck parsing the hostname
|
||||
var servers = {
|
||||
"f.perlbot.pl": "localhost:perlbot:",
|
||||
"freenode.perlbot.pl": "localhost:perlbot:",
|
||||
"m.perlbot.pl": "localhost:perlbot-magnet:",
|
||||
"magnet.perlbot.pl": "localhost:perlbot-magnet:",
|
||||
};
|
||||
|
||||
if (channel && servers[hostname]) { // only do this if we have a channel and a valid server
|
||||
// console.log("found default channel to post: "+servers[hostname]+channel);
|
||||
var option = $("option[value='"+servers[hostname]+channel+"']");
|
||||
// console.log(option);
|
||||
option.prop('selected', true)
|
||||
}
|
||||
});
|
||||
</script>
|
||||
[% END %]
|
||||
|
||||
[% BLOCK page_header %]
|
||||
|
|
Loading…
Add table
Reference in a new issue