/**
* @author Michael Stuhr
* @url http://onenterframe.de
*/
function markHeadlines(doc){
unMarkHeadlines(doc);
$.each($(doc).find('h1, h2, h3, h4, h5, h6'), function(){
var html = '<span class="jpheadline">#' + $(this).context.nodeName + '</span>';
$(this).prepend(html);
});
var style = '<style id="jp-css" type="text/css">.jpheadline {color:white; background:red; padding:0.2em; font-size:70%; fonct-family:"Courier New"!important; }</style>';
$(doc).find('head').append(style);
}
function unMarkHeadlines(doc)
{
$(doc).find('#jp-css, .jpheadline').remove();
}
jetpack.statusBar.append(
{
html: '<hx><input type="checkbox">',
width: 70,
onReady: function(wdgt)
{
$('input', wdgt).click(function ()
{
if(this.checked)
{
jetpack.tabs.onReady.unbind( unMarkHeadlines );
jetpack.tabs.onReady (markHeadlines);
markHeadlines(jetpack.tabs.focused.contentDocument);
}
else
{
jetpack.tabs.onReady.unbind( markHeadlines );
jetpack.tabs.onReady (unMarkHeadlines);
unMarkHeadlines(jetpack.tabs.focused.contentDocument);
}
});
}
});