// Resize Facebook on Dashboard var $fb = $('#facebook'); var sizeFB = function(){ var fb_w = $fb.width(); $fb.children('iframe').css('width',fb_w); } sizeFB(); $(window).resize(sizeFB); // make links open in new window $('.footer a, #wp-admin-bar-tbc-home a').attr('target','_blank'); $('.title_word_count').each(function() { var $this = $(this); var length = $this.val().length; var $counter = $this.parent().find('.title_counter'); $counter.html( length + ' characters'); $(this).keyup(function() { var charcount = $(this).val().length; $counter.html( charcount + ' characters') if ( charcount > 65 ) { $counter.addClass('red'); } else { $counter.removeClass('red'); } }); }); $('.desc_word_count').each(function() { var $this = $(this); var length = $this.val().length; var $counter = $this.parent().find('.desc_counter'); $counter.html( length + ' characters'); $(this).keyup(function() { var charcount = $(this).val().length; $counter.html( charcount + ' characters'); if ( charcount > 155 ) { $counter.addClass('red'); } else { $counter.removeClass('red'); } }); }); /*-------------------------------------------------------------------------------------- Custom Image Upload ======================================================================================*/