Guest User

Untitled

a guest
Jun 20th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. // Run the scripts
  2.  
  3. $(document).ready(function(){
  4. mgFormFieldHighlight();
  5. mgPageAdminAmination();
  6. initLightbox();
  7. initSuperfish();
  8. $('.required label,.optional label').mgToolTipIcons();
  9. mgToolTipsHover();
  10. $.mask.masks : {
  11. .'JaseMask' : { mask : '9999 9999 9999 9999' }
  12. };
  13. });
  14.  
  15. // JQuery Superfish Dropdowns
  16.  
  17. function initSuperfish(){
  18. $("ul.nav").superfish();
  19. };
  20.  
  21. // JQuery Lightbox
  22.  
  23. function initLightbox(){
  24. $('a[@rel*=lightbox]').lightBox();
  25. };
  26.  
  27. // Mongoose JQuery Page Admin Animation
  28.  
  29. function mgPageAdminAmination(){
  30. $(".page_admin_panel").prepend("<a href='' class='toggle_page_admin'>Page Admin</a>");
  31. $(".toggle_page_admin").click(function(event){
  32. $(".page_details").slideToggle('fast');
  33. // Stop the link click from doing its normal thing
  34. return false;
  35. });
  36. };
  37.  
  38. // Mongoose JQuery Form Field Highlighting
  39.  
  40. function mgFormFieldHighlight(){
  41. $('.required *,.optional *,.required_float *').focus(function(){
  42. $(this).parent().addClass('highlight');
  43. });
  44. $('.required *,.optional *,.required_float *').blur(function(){
  45. $(this).parent().removeClass('highlight');
  46. });
  47. };
  48.  
  49. // Mongoose JQuery Tooltips
  50.  
  51. // First create Tool Tip Icons based off the Label Titles
  52. $.fn.mgToolTipIcons = function(){
  53. return this.each(function(){
  54. var label = $(this);
  55. var titleText = label.attr('title');
  56. if (titleText) {
  57. label.prepend(' <span class="mgToolTipIcon">' + titleText + '</span>');
  58. label.removeAttr('title');
  59. }
  60. });
  61. };
  62.  
  63. // Then attach hover events to the Tool Tip Icons
  64. function mgToolTipsHover() {
  65. $('.mgToolTipIcon').hover(
  66. function() {
  67. var tooltipText = $(this).text();
  68. $(this).append('<div class="mgToolTip">' + tooltipText + '</div>');
  69. $('.mgToolTip').fadeIn(300);
  70. },
  71. function() {
  72. $('.mgToolTip').fadeOut(300);
  73. $(this).children().remove();
  74. }
  75. );
  76. };
Add Comment
Please, Sign In to add comment