aboutsummaryrefslogtreecommitdiff
path: root/js/infos.js
diff options
context:
space:
mode:
authors1n <[email protected]>2020-03-28 10:36:41 -0700
committers1n <[email protected]>2020-03-28 10:36:41 -0700
commit25b7d2aab61ae6421398d3abae5da6ffe590333d (patch)
tree611985ec78bb2d94099c9fd5dd687f5c9cee6f3e /js/infos.js
parentInitial commit (diff)
downloadcrack.cf-backup-master.tar.xz
crack.cf-backup-master.zip
3/28/2020, 10:36HEADmaster
Diffstat (limited to 'js/infos.js')
-rw-r--r--js/infos.js48
1 files changed, 48 insertions, 0 deletions
diff --git a/js/infos.js b/js/infos.js
new file mode 100644
index 0000000..0828a30
--- /dev/null
+++ b/js/infos.js
@@ -0,0 +1,48 @@
+
+$(document).ready(function(){
+ $('ul.toggle_display').css('display', 'block');
+ $('.tab h2').css('display','none');
+
+ // Toggle tabs
+ $('ul.toggle_display li a').click(function(){
+ var target = $(this).attr('href').replace('#', ''); // 'stat_tab_location'
+ var divs = target.split('_')[1]; // 'tab'
+ $('div.'+divs).css('display', 'none');
+ $('div#'+target).css('display', 'block');
+ $('ul.stat_'+divs+' li a').removeClass('selected');
+ $('ul.stat_'+divs+' li a[href="#'+target+'"]').addClass('selected').css('outline', 'none').blur();
+ return false;
+ });
+
+ // Activate main tab
+ if (location.hash) {
+ $('#tabs ul#headers li a[href="'+location.hash+'"]').click();
+ } else {
+ $('#tabs ul#headers li a:first').click();
+ }
+
+ // Activate first line graph
+ $('#stats_lines li a:first').click();
+
+ // Prettify list
+ $('#historical_clicks li:odd').css('background', '#E3F3FF');
+
+ // Toggle detail lists
+ $('a.details').click(function(){
+ var target = $(this).attr('id').replace('more_', 'details_');
+ $('#'+target).toggle();
+ return false;
+ });
+
+ // If an image src is erroneous (404 or anything) replace it with a transparent gif
+ $('.fix_images').each(function(i,img) {
+ $(img).on("error", function(){
+ $(img).attr('src', 'images/blank.gif');
+ });
+ });
+
+ // If we have the zeroclipboard thing, init it when Share Tab is displayed
+ $('#tabs ul#headers li a[href="#stat_tab_share"]').click(function(){
+ init_clipboard();
+ });
+});