From e855617e989337839880cd2385341e7cc0b5ea1f Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Sat, 26 Dec 2015 21:06:51 +1000 Subject: [PATCH] * autoswitch 'source' radio for zerobin --- public/js/zerobin.js | 7 +++++++ templates/zerobin/create.html.ep | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/public/js/zerobin.js b/public/js/zerobin.js index 3549fdd..a5d8fa2 100644 --- a/public/js/zerobin.js +++ b/public/js/zerobin.js @@ -2,4 +2,11 @@ $(document).ready(function() { $('pre code').each(function(i, block) { hljs.highlightBlock(block); }); + + $('#paste').on('change', function() { + $('input[name=source]').val(['form']); + }); + $('#upload').on('change', function() { + $('input[name=source]').val(['file']); + }); }); diff --git a/templates/zerobin/create.html.ep b/templates/zerobin/create.html.ep index e913b8a..f39119f 100644 --- a/templates/zerobin/create.html.ep +++ b/templates/zerobin/create.html.ep @@ -2,7 +2,8 @@ % title 'Zerobin -- View'; % my %times = (day => 1, week => 7, month => 30, quarter => 90, year => 395); % my @times = map { [l($_) => $times{$_}] } sort { $times{$a} <=> $times{$b} } keys(%times); -% stash 'styles' => 'zerobin'; +% stash 'styles' => 'zerobin'; +% stash 'scripts' => 'jquery zerobin'; % param 'expire' => 30; % my $syntax = (stash 'syntax') || []; % param 'syntax' => '';