foreground.js 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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('fa fa-file fa-fw').text(' ' + jQuery('[id^=ca-nstab] a').text());
  9. jQuery('li#ca-talk a').addClass('fa fa-comments fa-fw').text(' ' + jQuery('li#ca-talk a').text());
  10. jQuery('li#ca-talk.new a').addClass('fa fa-comments-o fa-fw').text(' ' + jQuery('li#ca-talk.new a').text());
  11. jQuery('li#ca-edit a').addClass('fa fa-pencil-square-o fa-fw').text(' ' + jQuery('li#ca-edit a').text());
  12. jQuery('li#ca-viewsource a').addClass('fa fa-book fa-fw').text(' ' + jQuery('li#ca-viewsource a').text());
  13. jQuery('li#ca-form_edit a').addClass('fa fa-pencil-square fa-fw').text(' ' + jQuery('li#ca-form_edit a').text());
  14. jQuery('li#ca-history a').addClass('fa fa-archive fa-fw').text(' ' + jQuery('li#ca-history a').text());
  15. jQuery('li#ca-delete a').addClass('fa fa-trash-o fa-fw').text(' ' + jQuery('li#ca-delete a').text());
  16. jQuery('li#ca-undelete a').addClass('fa fa-undo fa-fw').text(' ' + jQuery('li#ca-undelete a').text());
  17. jQuery('li#ca-move a').addClass('fa fa-truck fa-fw').text(' ' + jQuery('li#ca-move a').text());
  18. jQuery('li#ca-protect a').addClass('fa fa-shield fa-fw').text(' ' + jQuery('li#ca-protect a').text());
  19. jQuery('li#ca-unprotect a').addClass('fa fa-shield fa-fw').text(' ' + jQuery('li#ca-unprotect a').text());
  20. jQuery('li#ca-watch a').addClass('fa fa-star-o fa-fw').text(' ' + jQuery('li#ca-watch a').text());
  21. jQuery('li#ca-unwatch a').addClass('fa fa-star fa-fw').text(' ' + jQuery('li#ca-unwatch a').text());
  22. jQuery('li#ca-purge a').addClass('fa fa-refresh fa-fw').text(' ' + jQuery('li#ca-purge a').text());
  23. jQuery('li#ca-ask_delete_permanently a').addClass('fa fa-cut fa-fw').text(' ' + jQuery('li#ca-ask_delete_permanently a').text());
  24. if ( jQuery( '#ca-addsection' ).length ) {
  25. jQuery('li#ca-addsection a').addClass('fa fa-plus-sign fa-fw').text(' ' + jQuery('li#ca-addsection a').attr('title').replace(/\[.+/g,""));
  26. }
  27. jQuery('li#t-smwbrowselink a').addClass('fa fa-eye').text(' ' + jQuery('li#t-smwbrowselink a').text());
  28. jQuery('li#t-whatlinkshere a').addClass('fa fa-arrows').text(' ' + jQuery('li#t-whatlinkshere a').text());
  29. jQuery('li#t-blockip a').addClass('fa fa-ban').text(' ' + jQuery('li#t-blockip a').text());
  30. jQuery('li#t-recentchangeslinked a').addClass('fa fa-bars').text(' ' + jQuery('li#t-recentchangeslinked a').text());
  31. jQuery('li#t-contributions a').addClass('fa fa-smile-o').text(' ' + jQuery('li#t-contributions a').text());
  32. jQuery('li#t-log a').addClass('fa fa-bars').text(' ' + jQuery('li#t-log a').text());
  33. jQuery('li#t-emailuser a').addClass('fa fa-envelope').text(' ' + jQuery('li#t-emailuser a').text());
  34. jQuery('li#t-userrights a').addClass('fa fa-gavel').text(' ' + jQuery('li#t-userrights a').text());
  35. jQuery('li#t-upload a').addClass('fa fa-upload').text(' ' + jQuery('li#t-upload a').text());
  36. jQuery('li#t-specialpages a').addClass('fa fa-magic').text(' ' + jQuery('li#t-specialpages a').text());
  37. jQuery('li#t-print a').addClass('fa fa-print').text(' ' + jQuery('li#t-print a').text());
  38. jQuery('li#t-permalink a').addClass('fa fa-dot-circle-o').text(' ' + jQuery('li#t-permalink a').text());
  39. jQuery('li#t-info a').addClass('fa fa-info').text(' ' + jQuery('li#t-info a').text());
  40. jQuery('ul#toolbox-dropdown.dropdown>li#n-recentchanges a').addClass('fa fa-tasks').text(' ' + jQuery('ul#toolbox-dropdown.dropdown>li#n-recentchanges a').text());
  41. jQuery('ul#toolbox-dropdown.dropdown>li#n-help a').addClass('fa fa-question').text(' ' + jQuery('ul#toolbox-dropdown.dropdown>li#n-help a').text());
  42. // Turn categories into labels
  43. jQuery('#mw-normal-catlinks ul li a').addClass('label');
  44. // Make the Page Action button respond to hover
  45. jQuery('a.button.dropdown').mouseenter(function(){
  46. jQuery('ul#drop1').addClass('open').addClass('right').css('top', '32px').css('left', '785px');
  47. });
  48. jQuery('ul#drop1').mouseleave(function(){
  49. jQuery('ul#drop1').removeClass('open').css('top', '-9999px').css('left', '785px');
  50. });
  51. // The Echo extension puts an item in personal tools that Foreground really should have in the top menu
  52. // to make this easier, we move it here
  53. jQuery("#pt-notifications").prependTo("#top-bar-right");
  54. });