| 1 |
|
| 2 |
jQuery(function (){ |
| 3 |
jQuery('#pgbadger-brand').tooltip(); |
| 4 |
|
| 5 |
jQuery("#pop-infos").popover('hide'); |
| 6 |
jQuery('.slide').hide(); |
| 7 |
jQuery('.active-slide').show(); |
| 8 |
|
| 9 |
|
| 10 |
var activeMenu = location.hash; |
| 11 |
if (activeMenu) { |
| 12 |
activeMenu = activeMenu.substring(1); |
| 13 |
var lkobj = document.getElementById(activeMenu); |
| 14 |
var liId = jQuery(lkobj).parent().attr("id"); |
| 15 |
if (liId != undefined) { |
| 16 |
var slideId = '#'+liId; |
| 17 |
jQuery('#main-container li.slide').removeClass('active-slide').hide(); |
| 18 |
jQuery(slideId).addClass("active-slide").fadeIn(); |
| 19 |
window.location.hash = '#'+activeMenu; |
| 20 |
} |
| 21 |
} |
| 22 |
|
| 23 |
jQuery('.navbar li.dropdown').click(function() { |
| 24 |
var id = jQuery(this).attr("id"); |
| 25 |
id = id.substring(5); |
| 26 |
var slideId = '#'+id+'-slide'; |
| 27 |
var currentSlide = jQuery('#main-container .active-slide').attr("id"); |
| 28 |
currentSlide = '#'+currentSlide; |
| 29 |
|
| 30 |
if(slideId != currentSlide) { |
| 31 |
jQuery('#main-container li.slide').removeClass('active-slide').hide(); |
| 32 |
jQuery(slideId).addClass("active-slide").fadeIn(); |
| 33 |
} |
| 34 |
scrollTo(0,0); |
| 35 |
draw_charts(); |
| 36 |
}); |
| 37 |
|
| 38 |
jQuery('.navbar li ul li').click(function() { |
| 39 |
var liId = jQuery(this).parent().parent().attr("id"); |
| 40 |
var id = liId.substring(5); |
| 41 |
var slideId = '#'+id+'-slide'; |
| 42 |
jQuery('#main-container li.slide').removeClass('active-slide').hide(); |
| 43 |
jQuery(slideId).addClass("active-slide").fadeIn(); |
| 44 |
draw_charts(); |
| 45 |
}); |
| 46 |
|
| 47 |
draw_charts(); |
| 48 |
}); |
| 49 |
|
| 50 |
jQuery(document).ready(function () { |
| 51 |
jQuery('.sql').dblclick(function () { |
| 52 |
if (this.style == undefined || this.style.whiteSpace == 'pre') { |
| 53 |
this.style.whiteSpace ='normal'; |
| 54 |
} else { |
| 55 |
this.style.whiteSpace = 'pre'; |
| 56 |
} |
| 57 |
}); |
| 58 |
jQuery('.icon-copy').click(function () { |
| 59 |
var obj = $(this).parent()[0]; |
| 60 |
if (window.getSelection) { |
| 61 |
var sel = window.getSelection(); |
| 62 |
sel.removeAllRanges(); |
| 63 |
var range = document.createRange(); |
| 64 |
range.selectNodeContents(obj); |
| 65 |
sel.addRange(range); |
| 66 |
} else if (document.selection) { |
| 67 |
var textRange = document.body.createTextRange(); |
| 68 |
textRange.moveToElementText(obj); |
| 69 |
textRange.select(); |
| 70 |
} |
| 71 |
}); |
| 72 |
|
| 73 |
function shiftWindow() { |
| 74 |
scrollBy(0, -50); |
| 75 |
} |
| 76 |
|
| 77 |
if (location.hash) { |
| 78 |
shiftWindow(); |
| 79 |
} |
| 80 |
window.addEventListener("hashchange",shiftWindow); |
| 81 |
}); |
| 82 |
|