stephenjbell

jQuery - Hassle Web Editors

Aug 9th, 2013
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.51 KB | None | 0 0
  1. $(document).ready(function() {
  2.     // Hassle web editors when they make questionable formatting choices
  3.     // Add a class of "allowformatting" to turn off warning
  4.     $('#main [style*="font-family"], #main [style*="font-size"], #main [style*="text-justify"], #main [style*="text-align"], #main center, #main font')
  5.     .not('.allowformatting')
  6.     .each(function(){
  7.         $(this).css('background-color','#f00');
  8.         $(this).append('<p style="color:#fff;">Formatting error. Please contact OC Marketing to fix this problem.</p>');
  9.     })
  10. });
Advertisement
Add Comment
Please, Sign In to add comment