foreground.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. jQuery(document).ready(function() {
  2. // Add the 'less than IE9' class to appropriate version of IE by checking for their support of cssFloat (true in v9)
  3. if (!jQuery.support.cssFloat) { jQuery('html').addClass('lt-ie9').addClass('no-js'); }
  4. jQuery(document).foundation(function (response) {
  5. // console.log(response.errors); < this line will produce error in ie9!
  6. if (window.console) console.log(response.errors);
  7. });
  8. jQuery('[id^=ca-nstab] a').addClass('icon-file').text(' ' + jQuery('[id^=ca-nstab] a').text());
  9. jQuery('li#ca-talk a').addClass('icon-comments').text(' ' + jQuery('li#ca-talk a').text());
  10. jQuery('li#ca-talk.new a').addClass('icon-comments-alt').text(' ' + jQuery('li#ca-talk.new a').text());
  11. jQuery('li#ca-edit a').addClass('icon-edit').text(' ' + jQuery('li#ca-edit a').text());
  12. jQuery('li#ca-viewsource a').addClass('icon-book').text(' ' + jQuery('li#ca-viewsource a').text());
  13. jQuery('li#ca-form_edit a').addClass('icon-edit-sign').text(' ' + jQuery('li#ca-form_edit a').text());
  14. jQuery('li#ca-history a').addClass('icon-archive').text(' ' + jQuery('li#ca-history a').text());
  15. jQuery('li#ca-delete a').addClass('icon-remove').text(' ' + jQuery('li#ca-delete a').text());
  16. jQuery('li#ca-move a').addClass('icon-truck').text(' ' + jQuery('li#ca-move a').text());
  17. jQuery('li#ca-protect a').addClass('icon-shield').text(' ' + jQuery('li#ca-protect a').text());
  18. jQuery('li#ca-unprotect a').addClass('icon-shield').text(' ' + jQuery('li#ca-unprotect a').text());
  19. jQuery('li#ca-watch a').addClass('icon-star-empty').text(' ' + jQuery('li#ca-watch a').text());
  20. jQuery('li#ca-unwatch a').addClass('icon-star').text(' ' + jQuery('li#ca-unwatch a').text());
  21. jQuery('li#ca-purge a').addClass('icon-refresh').text(' ' + jQuery('li#ca-purge a').text());
  22. jQuery('li#t-smwbrowselink a').addClass('icon-eye-open').text(' ' + jQuery('li#t-smwbrowselink a').text());
  23. jQuery('li#ca-ask_delete_permanently a').addClass('icon-cut').text(' ' + jQuery('li#ca-ask_delete_permanently a').text());
  24. if ( jQuery( '#ca-addsection' ).length ) {
  25. jQuery('li#ca-addsection a').addClass('icon-plus-sign').text(' ' + jQuery('li#ca-addsection a').attr('title').replace(/\[.+/g,""));
  26. }
  27. // Turn categories into labels
  28. jQuery('#mw-normal-catlinks ul li a').addClass('label');
  29. // Make the Page Action button respond to hover
  30. jQuery('a.button.dropdown').mouseenter(function(){
  31. jQuery('ul#drop1').addClass('open').addClass('right').css('top', '32px').css('left', '785px');
  32. });
  33. jQuery('ul#drop1').mouseleave(function(){
  34. jQuery('ul#drop1').removeClass('open').css('top', '-9999px').css('left', '785px');
  35. });
  36. // The Echo extension puts an item in personal tools that Foreground really should have in the top menu
  37. // to make this easier, we move it here
  38. jQuery("#pt-notifications").prependTo("#top-bar-right");
  39. });