var solved_button = {
reg_exp_forums: /f(2|24)-/,
solved_icon_id: 'post_icon_1',
solved_tag: '[Resolvido] ',
solved_icon_img: 'http://i45.servimg.com/u/f45/11/65/59/72/resolu11.png',
html_end_message: '
Com minha resposta seu caso foi resolvido? Se sim, clique aqui.
',
solved_button_img: 'http://i53.tinypic.com/2qi22iq.jpg'
};
jQuery(document).ready(function() {
if(window.location.href.match(/post.forum/)) {
jQuery('#' + solved_button.solved_icon_id).click(function() {
subject = jQuery('input[name=subject]').val();
if(subject.indexOf(solved_button.solved_tag) == -1) {
jQuery('input[name=subject]').val(solved_button.solved_tag + jQuery('input[name=subject]').val());
}
});
}
if(window.location.href.match(/&solved=true/)) {
document.getElementById(solved_button.solved_icon_id).checked=true;
jQuery('input[name=subject]').val(solved_button.solved_tag + jQuery('input[name=subject]').val());
jQuery('.submit-buttons input[name=post]').click();
}
can_edit = (jQuery('div.post:first img.i_icon_edit').length > 0) ? true : false;
is_solved = (jQuery('h2.topic-title:first img').attr('src') == solved_button.solved_icon_img) ? true : false;
solved_button.html_end_message = solved_button.html_end_message.replace('{SOLVED_LINK}', jQuery('.i_icon_edit:first').parent().attr('href') + '&solved=true');
if(window.location.href.match(solved_button.reg_exp_forums) && is_solved !== true && can_edit === true) {
jQuery('.content:not(:first)').after(solved_button.html_end_message);
jQuery('.i_reply').parent().after('
');
}
});