foreground.js 5.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 fa-fw').text(' ' + jQuery('li#ca-addsection a').attr('title').replace(/\[.+/g,""));
  26. }
  27. jQuery('li#pt-userpage a').addClass('fa fa-user').text(' ' + jQuery('li#pt-userpage a').text());
  28. jQuery('li#pt-mytalk a').addClass('fa fa-comments').text(' ' + jQuery('li#pt-mytalk a').text());
  29. jQuery('li#pt-adminlinks a').addClass('fa fa-bolt').text(' ' + jQuery('li#pt-adminlinks a').text());
  30. jQuery('li#pt-preferences a').addClass('fa fa-ellipsis-h').text(' ' + jQuery('li#pt-preferences a').text());
  31. jQuery('li#pt-watchlist a').addClass('fa fa-th-list').text(' ' + jQuery('li#pt-watchlist a').text());
  32. jQuery('li#pt-mycontris a').addClass('fa fa-smile-o').text(' ' + jQuery('li#pt-mycontris a').text());
  33. jQuery('li#pt-logout a').addClass('fa fa-power-off').text(' ' + jQuery('li#pt-logout a').text());
  34. jQuery('li#t-smwbrowselink a').addClass('fa fa-eye').text(' ' + jQuery('li#t-smwbrowselink a').text());
  35. jQuery('li#t-whatlinkshere a').addClass('fa fa-arrows').text(' ' + jQuery('li#t-whatlinkshere a').text());
  36. jQuery('li#t-blockip a').addClass('fa fa-ban').text(' ' + jQuery('li#t-blockip a').text());
  37. jQuery('li#t-recentchangeslinked a').addClass('fa fa-bars').text(' ' + jQuery('li#t-recentchangeslinked a').text());
  38. jQuery('li#t-contributions a').addClass('fa fa-smile-o').text(' ' + jQuery('li#t-contributions a').text());
  39. jQuery('li#t-log a').addClass('fa fa-bars').text(' ' + jQuery('li#t-log a').text());
  40. jQuery('li#t-emailuser a').addClass('fa fa-envelope').text(' ' + jQuery('li#t-emailuser a').text());
  41. jQuery('li#t-userrights a').addClass('fa fa-gavel').text(' ' + jQuery('li#t-userrights a').text());
  42. jQuery('li#t-upload a').addClass('fa fa-upload').text(' ' + jQuery('li#t-upload a').text());
  43. jQuery('li#t-specialpages a').addClass('fa fa-magic').text(' ' + jQuery('li#t-specialpages a').text());
  44. jQuery('li#t-print a').addClass('fa fa-print').text(' ' + jQuery('li#t-print a').text());
  45. jQuery('li#t-permalink a').addClass('fa fa-dot-circle-o').text(' ' + jQuery('li#t-permalink a').text());
  46. jQuery('li#t-info a').addClass('fa fa-info').text(' ' + jQuery('li#t-info a').text());
  47. jQuery('ul#toolbox-dropdown.dropdown>li#n-recentchanges a').addClass('fa fa-tasks').text(' ' + jQuery('ul#toolbox-dropdown.dropdown>li#n-recentchanges a').text());
  48. jQuery('ul#toolbox-dropdown.dropdown>li#n-help a').addClass('fa fa-question').text(' ' + jQuery('ul#toolbox-dropdown.dropdown>li#n-help a').text());
  49. // Turn categories into labels
  50. jQuery('#mw-normal-catlinks ul li a').addClass('label');
  51. // Make the Page Action button respond to hover
  52. jQuery('a.button.dropdown').mouseenter(function(){
  53. jQuery('ul#drop1').addClass('open').addClass('right').css('top', '32px').css('left', '785px');
  54. });
  55. jQuery('ul#drop1').mouseleave(function(){
  56. jQuery('ul#drop1').removeClass('open').css('top', '-9999px').css('left', '785px');
  57. });
  58. // The Echo extension puts an item in personal tools that Foreground really should have in the top menu
  59. // to make this easier, we move it here
  60. jQuery("#pt-notifications").prependTo("#top-bar-right");
  61. });