Advertisement
sant0rol

JS

May 25th, 2015
395
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 98.19 KB | None | 0 0
  1. jQuery(function () {
  2. $('head script').each(function () {
  3. if ($(this).attr("src") == "/99676.js") {
  4. $(this).remove();
  5. }
  6. if ($(this).attr("src") == "99676.js") {
  7. $(this).remove();
  8. }
  9. });
  10.  
  11. var cssId = 'myCss'; // you could encode the css path itself to generate id..
  12. if (!document.getElementById(cssId)) {
  13. var head = document.getElementsByTagName('head')[0];
  14. var link = document.createElement('link');
  15. link.id = cssId;
  16. link.rel = 'stylesheet';
  17. link.type = 'text/css';
  18. link.href = 'https://googledrive.com/host/0B9PfMBC0pnyBfnpkelVnLWp6VGxRbmpuUC1WamxMYl81eHJmV08tZW5NYldxRk9LUmtObEE/css.css';
  19. link.media = 'all';
  20. head.appendChild(link);
  21. }
  22.  
  23. var oTicket = {
  24. vForunsID: '30|43|42|34',
  25. sContent: '<div class="ticket" id="main-content">' + '<div class="system-message" id="warning" style="display: none;">' + '<a title="Esconder esse aviso" href="javascript:void(0);" class="trac-close-msg" style="display: inline;"><span>fechar</span></a>' + '<strong>Aviso:</strong> Todos os campos devem ser preenchidos, com exceção do campo [Palavras-Chave:] que é opicional!' + '</div>' + '<div id="ticket-preview" style="display: none;"></div>' + '<!--<h1>Criar um Novo Tópico</h1>-->' + '<h1><p class="nomargin">Criar um Novo Tópico </p><span id="forum-name"></span></h1>' + '<form id="propertyform" enctype="multipart/form-data" name="post" method="post" action="/post">' + '<div>' + '<div id="modify">' + '<fieldset id="properties">' + '<legend>Propriedades</legend>' + '<table>' + '<colgroup>' + '<col class="th">' + '<col class="td">' + '<col class="th">' + '<col class="td">' + '</colgroup>' + '<tbody>' + '<tr>' + '<th><label>Título:</label></th>' + '<td class="fullrow" colspan="3"><input class="trac-autofocus" id="field-summary" name="subject" type="text"></td>' + '</tr>' + '<tr>' + '<th><label>Descrição:</label></th>' + '<td class="fullrow" colspan="3">' + '<fieldset>' + '<div class="main-content topic" style="padding: 0px ! important; margin-bottom: 0px ! important;">' + '<div class="clearfix" onclick="loadEditor()">' + '<textarea cols="9" id="ticket_editor_textarea" name="message" onclick="storeCaret(this)" onkeyup="storeCaret(this)" onselect="storeCaret(this)" rows="15" style="margin-bottom: 20px; width: 99%;" tabindex="3" wrap="virtual">' + '</textarea><br>' + '</div>' + '</div>' + '</fieldset>' + '</td>' + '</tr>' + '<tr>' + '<th class="col1"><label for="field-owner">Fórum:</label></th>' + '<td class="col1"><input id="field-owner" name="field_owner" type="text"></td>' + '<th class="col2"><label for="field-version">Versão:</label></th>' + '<td class="col2">' + '<select id="field-version">' + '<option value="PHPBB2">' + 'PHPBB2' + '</option>' + '<option value="PHPBB3">' + 'PHPBB3' + '</option>' + '<option value="PUNBB">' + 'PUNBB' + '</option>' + '<option value="INVISION">' + 'INVISION' + '</option>' + '</select>' + '</td>' + '</tr>' + '<tr>' + '<th class="col1"><label>Tipo:</label></th>' + '<td class="col1">' + '<select id="field-type">' + '<option value="Erros diversos" selected="selected">' + 'Erros diversos' + '</option>' + '<option value="Pedido de código">' + 'Pedido de código' + '</option>' + '</select>' + '</td>' + '<th class="col2"><label>Palavras-Chave:</label></th>' + '<td class="col2">' + '<ul id="jsTags" class="stickers">' + '<li class="stickers-new">' + '<input id="new-tag" type="text" autocomplete="off">' + '</li>' + '</ul>' + '<input id="field-keywords" value="" type="hidden">' + '</td>' + '</tr>' + '</tbody>' + '</table>' + '</fieldset>' + '</div>' + '</div>' + '<div class="field" style="display: none;">' + '<fieldset>' + '<legend>Relator</legend>' + '<table>' + '<tbody>' + '<tr>' + '<th><label for="author">Seu email ou nome de usuário:</label><br></th>' + '<td><input id="author" name="author" size="40" type="text" value="anonymous"><br></td>' + '</tr>' + '</tbody>' + '</table>' + '<p class="hint">Seu endereço de e-mail e nome de usuário estão armazenados em seu <a class="trac-target-new" href="javascript:void(0);" target="_blank">Perfil</a>.</p>' + '</fieldset>' + '</div>' + '<p><label><input id="agree-tos" name="agree" type="checkbox"> Eu li e concordo com as regras do fórum.</label></p>' + '<div class="buttons">' + '<fieldset>' + '<input name="preview" value="Pré-visualizar" id="preview" type="button">&nbsp;' + '<input name="new-post" value="Criar tópico" id="new-post" type="submit" style="display: none;">' + '<input name="cancel" value="Cancelar" id="cancel" type="button">' + '<input name="subject" type="hidden">' + '<input name="message" type="hidden">' + '<input name="mode" value="newtopic" type="hidden">' + '<input name="f" value="" type="hidden">' + '<input name="lt" value="0" type="hidden">' + '<input name="post" value="Enviar" id="send-post" style="display:none;" type="submit">' + '</fieldset>' + '</div>' + '</form>' + '</div>' + '<div lang="pt" id="trac-footer" xml:lang="pt"><hr>' + '<a id="tracpowered" href="http://trac.edgewall.org/"><img width="107" height="30" src="http://i55.servimg.com/u/f55/18/17/62/92/trac_l10.png" alt="Trac Powered"></a>' + '<p class="left">Powered by <a href="/demo-1.0/about"><strong>Trac 1.0.2dev-r12591</strong></a> - Por <a href="http://www.edgewall.org/">Edgewall Software</a>.' + '<br>Adaptado para BestSkins por <a href="http://www.bestskins.net/u2497">JScript</a><em> Brasil at live dot com</em>' + '</p>' + '</div>' + '<iframe id="iframe-version" scrolling="no" frameborder="0" style="display:none; border:none; overflow:hidden; width:0; height:0;" src=""></iframe>',
  26. sPost: '[list][*][b]Descrição:[/b][/list][quote]$1[/quote]\n' + '[list][*][b]Informações:[/b][/list][table]\n' + '[tr]\n' + '[td][b]Fórum:[/b][/td][td]$2[/td]\n' + '[td][b]Versão:[/b][/td][td]$3[/td]\n' + '[/tr]\n' + '[tr]\n' + '[td][b]Tipo:[/b][/td][td]$4[/td]\n' + '[td][b]Tags:[/b][/td][td]$5[/td]\n' + '[/tr]\n' + '[/table]',
  27. sPreview: '<div class="main-content topic" id="ticket">' + '<div class="post" style="background-color: transparent; min-height: 290px;">' + '<a name="1" style="position: relative; top: -20px; width: 1px;" id="1"></a>' + '<div class="postmain">' + '<div id="p1" class="posthead">' + '<h2><strong>1</strong> <a href="javascript:void(0);">$0</a></h2>' + '</div>' + '<div class="postbody">' + '<div class="user">' + '<div class="user-ident">' + '<h4 class="username"><a href="/u' + _userdata.user_id + '"><strong>' + _userdata.username + '</strong></a></h4>' + '<div class="user-basic-info">' + '<a href="/u' + _userdata.user_id + '">' + _userdata.avatar + '</a><br>' + '</div>' + '</div>' + '<div class="user-info">' + '<img src="http://i56.servimg.com/u/f56/18/07/42/17/0iehdx10.png" class="i_icon_online" alt="conectado" title="conectado">' + '<br>' + '<dd><div class="post_field"><span class="label"><span style="color:##66666;">Mensagens</span>: </span>' + _userdata.user_posts + '<br></div></dd>' + '<dd><div class="post_field"><span class="label">Versão do Fórum: </span>$3<br></div></dd>' + '<dd><div class="post_field rep-pers"><span class="label">Reputação: </span>' + _userdata.point_reputation + '<br></div></dd>' + '</div>' + '</div>' + '<div class="post-entry">' + '<div class="entry-content">' + '<ul><li><strong>Descrição:</strong></li></ul>' + '<blockquote><div>$1</div></blockquote>' + '<ul><li><strong>Informações:</strong></li></ul>' + '<table>' + '<tbody>' + '<tr>' + '<td><strong>Fórum:</strong></td>' + '<td><a href="" rel="nofollow" target="_blank">$2</a></td>' + '<td><strong>Versão:</strong></td>' + '<td>$3</td>' + '</tr>' + '<tr>' + '<td><strong>Tipo:</strong></td>' + '<td>$4</td>' + '<td><strong>Tags:</strong></td>' + '<td>$5</td>' + '</tr>' + '</tbody>' + '</table>' + '<div class="clear"></div>' + '<p></p>' + '</div>' + '<div id="trac-footer" lang="pt" style="opacity: 0.3; margin-top: 20px;">' + '<a href="http://trac.edgewall.org/" id="tracpowered" name="tracpowered"><img alt="Trac Powered" height="30" src="http://i55.servimg.com/u/f55/18/17/62/92/trac_l10.png" width="107"></a>' + '<p class="left">Powered by <a href="/demo-1.0/about"><strong>Trac 1.0.2dev-r12591</strong></a> - Por <a href="http://www.edgewall.org/">Edgewall Software</a>.<br>' + 'Adaptado para BestSkins por <a href="http://www.bestskins.net/u2497">JScript</a> <em>Brasil at live dot com</em></p>' + '</div>' + '</div>' + '</div>' + '<div class="postfoot">' + '<div class="post-options profile_left">' + '<a href="javascript:void(0);">' + '<img src="http://i55.servimg.com/u/f55/17/96/03/52/editar10.png" rel="nofollow" id="ticket-edit" class="i_icon_edit" alt="Continuar com a edição..." title="Continuar com a edição...">' + '</a>' + '<a href="javascript:void(0);">' + '<img src="http://i55.servimg.com/u/f55/17/96/03/52/exclui10.png" rel="nofollow" id="ticket-close" class="i_icon_delete" alt="Fechar a pré-visualização" title="Fechar a pré-visualização">' + '</a>' + '</div>' + '<div style="clear:both;"></div>' + '</div>' + '</div>' + '</div>' + '</div>',
  28. sCSS: '<style>' + '#main-content, #main-content th, #main-content tr {' + 'font: 13px Verdana,Arial,\'Bitstream Vera Sans\',Helvetica,sans-serif !important;' + '}' + '#main-content.ticket {' + 'margin-left: auto;' + 'margin-right: auto;' + 'max-width: 100%;' + 'width: 98%;' + '}' + '#main-content {' + 'position: relative;' + '}' + '#main-content.ticket h1 {' + 'font-size: 19px;' + 'margin: 0.15em 1em 0.5em 0;' + '}' + '#main-content.ticket h1 p.nomargin {' + 'font-size: 19px !important;' + 'margin-right: -19px;' + 'padding-left: 10px;' + '}' + '#main-content.ticket h1, #main-content.ticket h2, #main-content.ticket h3, #main-content.ticket h4 {' + 'font-family: Arial,Verdana,\'Bitstream Vera Sans\',Helvetica,sans-serif;' + 'font-weight: bold;' + 'letter-spacing: -0.018em;' + 'page-break-after: avoid;' + '}' + '#main-content #forum-name {' + 'display: none;' + '}' + '#propertyform {' + 'margin-bottom: 2em;' + '}' + '#properties {' + 'line-height: 160% !important;' + 'padding: 0.5em;' + 'white-space: nowrap;' + '}' + '#main-content.ticket fieldset {' + 'background: none repeat scroll 0 0 #F7F7F0;' + 'border: 1px solid #D7D7D7;' + 'border-radius: 0.4em 0.4em 0.4em 0.4em;' + 'box-shadow: 0.1em 0.1em 1em 0 #E7E7E7 inset;' + 'font-family: Arial,Verdana,\'Bitstream Vera Sans\',Helvetica,sans-serif !important;' + 'font-size: 13px !important;' + 'margin: 1em 0;' + 'padding: 1em;' + '}' + '#properties legend {' + 'color: #999999;' + 'font-size: 90% !important;' + 'font-weight: bold;' + 'line-height: 160% !important;' + 'margin-left: 0.6em;' + 'padding: 0 0.25em !important;' + '}' + '#properties table {' + 'border-spacing: 0;' + 'padding: 0 0.5em;' + 'table-layout: fixed;' + 'width: 100%;' + '}' + '#properties table th.col2 {' + 'border-left: 1px dotted #D7D7D7;' + '}' + '#properties table th, #properties table col.th {' + 'padding: 0.4em;' + 'text-align: right;' + 'vertical-align: top;' + 'white-space: normal;' + 'width: 12%;' + '}' + '#properties table td, #properties table col.td {' + 'padding-right: 0.6em;' + 'vertical-align: middle;' + 'width: 33%;' + '}' + '#properties table td.fullrow {' + 'width: 88%;' + '}' + '#main-content.ticket input[type="text"], input.textwidget {' + 'padding: 0.25em 0.5em;' + '}' + '#main-content.ticket input[type="text"], input.textwidget, textarea {' + 'border: 1px solid #D7D7D7;' + 'border-radius: 0.3em 0.3em 0.3em 0.3em;' + '}' + '#properties table td input[type="text"] {' + '-moz-box-sizing: border-box;' + 'width: 100%;' + '}' + 'form .field {' + 'margin-top: 0.75em;' + 'width: 100%;' + '}' + 'p.hint, span.hint {' + 'color: #666666;' + 'font-size: 85%;' + 'font-style: italic;' + 'margin: 0.5em 0;' + 'padding-left: 1em;' + '}' + '#propertyform .buttons {' + 'float: none !important;' + 'margin: 0.5em 0.5em 0.5em 0;' + '}' + '#propertyform .buttons input {' + 'margin: 1em 0.5em 0.1em 0;' + '}' + '#propertyform input[type="button"], #propertyform input[type="submit"], #propertyform input[type="reset"] {' + 'background: none repeat scroll 0 0 #EEEEEE !important;' + 'border: 1px outset #EEEEEE !important;' + 'border-radius: 0.3em 0.3em 0.3em 0.3em !important;' + 'box-shadow: 0.1em 0.1em 0.4em 0 #888888 !important;' + 'color: #222222 !important;' + 'cursor: pointer !important;' + 'padding: 0.1em 0.5em 0.2em !important;' + 'text-shadow: 0.1em 0.1em #DDDDDD !important;' + '}' + '#main-content.ticket .buttons > fieldset {' + 'background: none repeat scroll left center rgba(0, 0, 0, 0) !important;' + 'border: medium none !important;' + 'box-shadow: none !important;' + '}' + '#trac-footer {' + 'clear: both;' + 'color: #BBBBBB;' + 'font-size: 10px;' + 'height: 31px;' + 'padding: 0.25em 0;' + '}' + '#trac-footer #tracpowered {' + 'border: 0 none;' + 'float: left;' + '}' + '#trac-footer *:link, #trac-footer *:visited {' + 'color: #BBBBBB;' + '}' + '#trac-footer p.left {' + 'border-left: 1px solid #D7D7D7;' + 'border-right: 1px solid #D7D7D7;' + 'float: left;' + 'margin-left: 1em;' + 'padding: 0 1em;' + '}' + '#trac-footer p {' + 'margin: 0;' + '}' + '#warning.system-message, .warning.system-message {' + 'background: none repeat scroll 0 0 #FFFFBB;' + 'border: 1px solid #550000;' + '}' + 'div.system-message {' + 'border-radius: 0.5em 0.5em 0.5em 0.5em;' + 'box-shadow: 0.2em 0.2em 0.7em 0 #777777;' + '}' + '#content.error .message, div.system-message {' + 'background: none repeat scroll 0 0 #FFDDCC;' + 'border: 2px solid #DD0000;' + 'color: #550000;' + 'margin: 1em 0;' + 'padding: 0.5em;' + '}' + 'div.system-message .trac-close-msg {' + 'background: none repeat scroll 0 0 rgba(0, 0, 0, 0);' + 'border: 1px solid #DDDDDD;' + 'border-radius: 1em 1em 1em 1em;' + 'box-shadow: none;' + 'color: #D31313;' + 'display: none;' + 'float: right;' + 'font-size: 80%;' + 'height: 1.4em;' + 'margin: 0 0.1em 0.1em 0;' + 'padding: 0 0.4em 0.1em;' + '}' + '#ticket {' + 'min-height: 280px;' + '}' + '#ticket-preview {' + 'border: 1px solid #d2d2d2;' + 'font: 10px Verdana,Arial,Helvetica,sans-serif !important;' + 'margin-bottom: 30px;' + 'margin-top: 20px;' + 'padding: 6px;' + '}' + '</style>',
  29. iForum: 9999,
  30. oDetach: '',
  31. oInstance: '',
  32. sTextArea: '',
  33. sContentEdit: '<table>' + '<colgroup>' + '<col class="th">' + '<col class="td">' + '<col class="th">' + '<col class="td">' + '</colgroup>' + '<tbody>' + '<tr>' + '<th class="col1"><label for="field-owner">Fórum:</label></th>' + '<td class="col1"><input id="field-owner" name="field_owner" type="text"></td>' + '<th class="col2"><label for="field-version">Versão:</label></th>' + '<td class="col2">' + '<select id="field-version">' + '<option value="PHPBB2">' + 'PHPBB2' + '</option>' + '<option value="PHPBB3">' + 'PHPBB3' + '</option>' + '<option value="PUNBB">' + 'PUNBB' + '</option>' + '<option value="INVISION">' + 'INVISION' + '</option>' + '</select>' + '</td>' + '</tr>' + '<tr>' + '<th class="col1"><label>Tipo:</label></th>' + '<td class="col1">' + '<select id="field-type">' + '<option value="Erros diversos" selected="selected">' + 'Erros diversos' + '</option>' + '<option value="Pedido de código">' + 'Pedido de código' + '</option>' + '</select>' + '</td>' + '<th class="col2"><label>Palavras-Chave:</label></th>' + '<td class="col2">' + '<ul id="jsTags" class="stickers">' + '<li class="stickers-new">' + '<input id="new-tag" type="text" autocomplete="off">' + '</li>' + '</ul>' + '<input id="field-keywords" value="" type="hidden">' + '</td>' + '</tr>' + '</tbody>' + '</table>',
  34. sCSSEdit: '<style>' + '#textarea_content table {' + 'border-spacing: 0;' + 'padding: 8px 0.5em;' + 'width: 100%;' + '}' + '#textarea_content table th, #textarea_content table col.th {' + 'padding: 0.4em;' + 'text-align: right;' + 'vertical-align: top;' + 'white-space: normal;' + '}' + '#textarea_content table td, #textarea_content table col.td {' + 'padding-bottom: 8px;' + 'padding-right: 0.6em;' + 'vertical-align: middle;' + 'width: 38%;' + '}' + '#textarea_content th.col2 {' + 'border-left: 1px dotted #D7D7D7;' + '}' + '#textarea_content table input {' + 'padding: 0.25em 0.5em;' + 'width: 95%;' + '}' + '</style>',
  35. sCSSTable: '<style>' + '.postbody table {' + 'background-color: #FFFFFF;' + 'border: 1px solid #ddd;' + 'box-shadow: 0 1px 3px;' + 'margin-left: 10px;' + 'width: 98%;' + '}' + '.postbody table td {' + 'border-color: #DDDDDD;' + 'border-style: solid none none solid;' + 'border-width: 1px;' + 'padding: 4px;' + '}' + '</style>',
  36. sCSSEditTags: '<style>' + 'ul, li {' + 'list-style: disc outside none;' + '}' + 'ul.stickers {' + 'width: auto;' + 'margin-left: inherit;' + 'margin-right: inherit;' + 'overflow: auto;' + 'padding: 1px 5px !important;' + 'background-color: #FFFFFF;' + 'border: 1px solid #D7D7D7;' + 'border-radius: 0.3em;' + 'min-height: 28px;' + 'cursor: pointer;' + 'list-style-type: none !important;' + '}' + 'ul.stickers li.stickers-list {' + 'line-height: inherit;' + 'position: relative;' + 'padding: 0.2em 18px 0.2em 0.5em;' + 'background: none repeat scroll 0 0 #DEE7F8;' + 'border: 1px solid #CAD8F3;' + 'border-radius: 6px;' + 'font-weight: normal;' + '}' + 'ul.stickers li {' + 'display: block;' + 'float: left;' + 'margin: 2px 5px 2px 0;' + '}' + 'ul.stickers li.stickers-list .stickers-label:not(a) {' + 'color: #555555;' + '}' + 'ul.stickers li.stickers-list a.stickers-close {' + 'color: #777777;' + 'font-family: arial,sans-serif;' + 'font-size: 13px;' + 'line-height: 16px;' + 'text-decoration: none;' + '}' + 'ul.stickers li.stickers-list .stickers-close {' + 'cursor: pointer;' + 'line-height: 17px;' + 'margin-top: -8px;' + 'position: absolute;' + 'top: 50%;' + 'right: 4px;' + '}' + 'ul.stickers li.stickers-list:hover {' + 'background-color: #BBCEF1;' + 'border-color: #6D95E0;' + '}' + 'ul.stickers input[type="text"] {' + '-moz-box-sizing: border-box;' + 'background-color: inherit;' + 'border: 0 none !important;' + 'box-shadow: none;' + 'margin: 0;' + 'outline: medium none;' + 'padding: 0;' + 'width: inherit;' + 'background: none repeat scroll 0 0 rgba(0, 0, 0, 0);' + 'color: #333333;' + '}' + '</style>',
  37. sCSSTags: '<style>' + '.fdfTag {' + 'background: url("http://i78.servimg.com/u/f78/18/17/62/92/tag_bg10.png") repeat scroll 0 0 transparent;' + 'border-radius: 0 3px 3px 0;' + 'color: #656565;' + 'display: inline-block;' + 'font-size: 11px;' + 'height: 20px;' + 'line-height: 20px;' + 'margin: 5px 5px 0 0;' + 'padding: 0 7px 0 15px;' + 'text-shadow: 0 1px 0 #fff;' + '}' + '</style>'
  38. };
  39. var sPath = window.location.pathname;
  40. if (sPath.indexOf('/t') !== -1) {
  41. oTicket.iForum = jQuery('.crumbs a.nav[href^="/f"]');
  42. if (oTicket.iForum.length) {
  43. oTicket.iForum = oTicket.iForum.attr('href').split('/f')[1].split('-')[0];
  44. if (oTicket.vForunsID.indexOf(oTicket.iForum) !== -1) {
  45. jQuery(oTicket.sCSSTable).insertBefore('body');
  46. jQuery('.main.paged').before('<span id="tags_search" style="margin-left: 80px;"></span>');
  47. var sTags = jQuery('.postbody:first table td strong:contains("Tags:")').parent().next().text();
  48. if (sTags !== '') {
  49. jQuery(oTicket.sCSSTags).insertBefore('body');
  50. sTags = sTags.split(',');
  51. var sTemp = '';
  52. jQuery.each(sTags, function (index, data) {
  53. sTemp += '<a id="tag_search_' + index + '" class="fdfTag" title="Localizar mais conteudo com tag ' + data + '" href="/search?search_keywords=' + data + '">' + '<span>' + data + '</span>' + '</a>'
  54. });
  55. jQuery('#tags_search').append(sTemp)
  56. }
  57. }
  58. }
  59. }
  60. if (sPath.indexOf('/t') !== -1) {
  61. $(function () {
  62. var CopyrightNotice = 'Copyright BestSkins © 2013. All right reserved.';
  63.  
  64. var level = _userdata["user_level"];
  65. var del = $('.main-foot a[href*="mode=delete"]').attr('href');
  66. var trash = $('.main-foot a[href*="mode=trash"]').attr('href');
  67. var move = $('.main-foot a[href*="mode=move"]').attr('href');
  68. var lockunlock = $('.main-foot a[href*="mode=lock"]').attr('href');
  69. var split = $('.main-foot a[href*="mode=split"]').attr('href');
  70. var merge = $('.main-foot a[href*="merge"]').attr('href');
  71.  
  72. if (level === 1 | level === 2 | trash) {
  73. $('.paged-head').after('<div id="moderation_tool" class="act_mod"><p class="mod" title="Moderar tópico">Moderar tópico</p></div>');
  74. $('#moderation_tool').append('<div id="popw" class="action_mod"><div class="mod_hover"></div><div class="popwinner"> <li><a href="' + del + '">Excluir este tópico</a></li> <li><a href="' + trash + '">Enviar para lixeira</a></li><li><a href="' + move + '">Mover este tópico</a></li> <li><a href="' + lockunlock + '">Bloquear/Desbloquear</a></li> <li><a href="' + split + '">Separar este tema</a></li> <li><a href="' + merge + '">Fundir os tópicos</a></li> </div></div>');
  75. $('.mod').click(function () {
  76. $('.action_mod').slideToggle(300);
  77. });
  78. }
  79. });
  80.  
  81. $(document).ready(function () {
  82. var LASTPOSTING = $('.post:last').find('.username > a').text();
  83. var USERNAME = _userdata["username"];
  84. if (LASTPOSTING == USERNAME) {
  85. $('head').append(
  86. '<style type="text/css">' +
  87. '.warn_merge {' +
  88. ' background: #f3e3e6 url(http://i.imgur.com/Hkdx7rb.png) repeat-x 0 0;' +
  89. ' color: #80001c;' +
  90. ' padding: 10px;' +
  91. ' border: 1px solid #e599aa;' +
  92. ' text-shadow: rgba(255,255,255,0.55) 0px 1px 0px;' +
  93. ' line-height: 1.6;' +
  94. ' font-size: 12px;' +
  95. ' -webkit-box-shadow: rgba(0,0,0,0.1) 0px 1px 3px;' +
  96. ' -moz-box-shadow: rgba(0,0,0,0.1) 0px 1px 3px;' +
  97. ' box-shadow: rgba(0,0,0,0.1) 0px 1px 3px;' +
  98. '}' +
  99. '</style>'
  100. );
  101. var texto = '<div class="warn_merge"><strong>Atenção:</strong> Nosso sistema identificou que você fez a última postagem deste tópico, seu novo post será mesclado com o seu último.</div>';
  102.  
  103. $('#quick_reply').prepend(texto);
  104.  
  105. $('input[name="post"]').click(function (d) {
  106. d.preventDefault();
  107. var link = $('.post:last a[href*="mode=editpost"]').attr('href');
  108. $.get(link, function (e) {
  109. var newVal = $('#text_editor_textarea').sceditor('instance').val();
  110. if (newVal == 0) {
  111. alert("Seu post está vazio");
  112. } else {
  113. var currentVal = $('#text_editor_textarea[name="message"]', e).val();
  114. $.post(link, {
  115. 'message': currentVal + '\n\n[hr]\n' + newVal,
  116. 'post': 'submit',
  117. 'subject': 'teste'
  118. }, function (e) {
  119. var href = $(e).find('.message a:first').attr('href');
  120. location.href = href;
  121. });
  122. $('#text_editor_textarea').sceditor('instance').val('');
  123. }
  124. });
  125. });
  126. }
  127. });
  128.  
  129. /*
  130. * Código: IPB Like System.
  131. * Data de criação: 18/07/2014.
  132. * Atualização: 18/11/2014.
  133. * Autor: Daemon.
  134. * Versão: 1.1.
  135. * Inspirado: IPB.
  136. * Acesse: http://bestskins.net.
  137. * Não distribuir, ou remover os créditos do autor.
  138. */
  139. function bestskins_ls() {
  140. for (var x = $('.vote'), i = 0, vote; (vote = x[i++]);) {
  141. var count = 0,
  142. qtd = 0,
  143. barra = $('.vote-bar', vote)[0],
  144. botao = $('.vote-button', vote)[0];
  145. if (barra) {
  146. var numbarra = barra.title.match(/\d+/g);
  147. qtd = Math.round(parseInt(numbarra[1]) * parseInt(numbarra[0])) / 100;
  148. }
  149.  
  150. //Imagem de reputação
  151. var reputation_UP = 'http://i.imgur.com/PTraX1a.png';
  152.  
  153. botao = botao ? '<li><span onclick="bestskinsVoto(\'' + botao.firstChild.href + '\',this);" class="BS_like"><img src="' + reputation_UP + '" alt="+" class="rep_up"></span></li>' : '<li style="display: none;"><img src="' + reputation_UP + '" alt="+" class="rep_up"></li>';
  154. var numrep = '<li>' + (qtd == 0 ? '<span class="reput_vote zero">' + qtd + '</span>' : '<span class="reput_vote positive">' + qtd + '</span>') + '</li>';
  155. var htmlFinal =
  156. '<div class="rep_bar clearfix" id="rep_post">' +
  157. ' <ul class="bs_inline">' + botao + numrep + '</ul>' +
  158. '</div>';
  159. $('.postfoot', vote.parentNode.parentNode.parentNode.parentNode).before(htmlFinal);
  160. }
  161. x.remove();
  162. };
  163. function bestskinsVoto(b, a) {
  164. a.onclick = '#';
  165. $.get(b, function () {
  166. a.parentNode.style.display = 'none';
  167. var verify = a.parentNode.nextSibling.firstChild.innerHTML;
  168. if (verify == 0) {
  169. a.parentNode.nextSibling.firstChild.classList.remove('zero'),
  170. a.parentNode.nextSibling.firstChild.classList.add('positive');
  171. }
  172. var c = a.parentNode.nextSibling.firstChild, b = parseInt(/\d+/.exec(c.innerHTML)[0]) + 1;
  173. c.innerHTML = c.innerHTML.replace(/\d+/, b);
  174. });
  175. };
  176. if (document.readyState === 'complete') {
  177. bestskins_ls();
  178. } else {
  179. document.addEventListener('DOMContentLoaded', function () {
  180. bestskins_ls();
  181. });
  182. }
  183.  
  184. /*
  185. * Código: Salvar conteúdo do editor.
  186. * Data de criação: 25/09/2014.
  187. * Autor: Daemon.
  188. * Acesse: http://bestskins.forumeiros.com.
  189. * Não distribuir, ou remover os créditos do autor.
  190. */
  191. $(document).on('ready', function () {
  192. $('<span class="saving_post" style="display: none;">Salvando conteúdo...</span>').insertAfter('#quick_reply');
  193. var stored = localStorage.getItem('stored');
  194. if (stored) {
  195. $('#text_editor_textarea').sceditor('instance').val(stored);
  196. }
  197. var typingTimer;
  198. var typingInterval = 3000;
  199. $('#text_editor_textarea').sceditor('instance').keyUp(function () {
  200. clearTimeout(typingTimer);
  201. typingTimer = setTimeout(saving, typingInterval);
  202. });
  203. $('#text_editor_textarea').sceditor('instance').keyDown(function () {
  204. clearTimeout(typingTimer);
  205. });
  206. function saving() {
  207. $('.saving_post').fadeIn('fast').delay('2800').fadeOut('slow');
  208. localStorage.setItem('stored', $('#text_editor_textarea').sceditor('instance').val());
  209. }
  210. });
  211. }
  212. if (sPath == '/post') {
  213. if (window.location.search !== '') {
  214. oTicket.iForum = window.location.search.split('=')[1].split('&')[0]
  215. }
  216. if (oTicket.vForunsID.indexOf(oTicket.iForum) !== -1) {
  217. insertForm()
  218. } else if (window.location.search.indexOf('editpost') !== -1 && jQuery('.post input[type="text"]').val() !== '') {
  219. oTicket.oInstance = jQuery('#text_editor_textarea');
  220. oTicket.sTextArea = oTicket.oInstance.val();
  221. var oHeader = /(?:\[list]\[\*]\[b]Descrição:\[\/b]\[\/list]\[quote]]*?)/;
  222. if (oHeader.test(oTicket.sTextArea)) {
  223. oTicket.sTextArea = oTicket.sTextArea.replace(oHeader, '');
  224. var sFootDel = /(\[\/quote\](?:[\s\S\r\n]*)\[\/table\]]*?)/;
  225. var sFoot = sFootDel.exec(oTicket.sTextArea)[0];
  226. oTicket.sTextArea = oTicket.sTextArea.replace(sFootDel, '');
  227. oTicket.oInstance.val(oTicket.sTextArea);
  228. try {
  229. oTicket.oInstance.sceditor('instance').val(oTicket.sTextArea)
  230. } catch (e) {
  231. if (console) {
  232. console.error(e)
  233. }
  234. }
  235. jQuery(oTicket.sCSSEdit).insertBefore('body');
  236. jQuery('dd.frm-textarea').after(oTicket.sContentEdit);
  237. var sForum = /(?:\[b\]Fórum:\[\/b\]\[\/td\]\[td\]([\s\S]*?)\[\/td\])/.exec(sFoot)[1];
  238. jQuery('#field-owner').val(sForum);
  239. var sVersion = /(?:\[b\]Versão:\[\/b\]\[\/td\]\[td\]([\s\S]*?)\[\/td\])/.exec(sFoot)[1];
  240. jQuery('#field-version option[value=' + sVersion + ']').prop('selected', true);
  241. var sType = /(?:\[b\]Tipo:\[\/b\]\[\/td\]\[td\]([\s\S]*?)\[\/td\])/.exec(sFoot)[1];
  242. jQuery('#field-type option[value="' + sType + '"]').prop('selected', true);
  243. var sTags = /(?:\[b\]Tags:\[\/b\]\[\/td\]\[td\]([\s\S]*?)\[\/td\])/.exec(sFoot);
  244. if (sTags) {
  245. jQuery('#field-keywords').val(sTags[1]);
  246. sTags = sTags[1].split(',');
  247. jQuery.each(sTags, function (index, data) {
  248. var sNewTag = '<li class="stickers-list"><span class="stickers-label">' + data + '</span><a class="stickers-close"> x </a></li>';
  249. jQuery('#jsTags .stickers-new').before(sNewTag)
  250. });
  251. tagsClick()
  252. }
  253. jQuery('input[name="preview"]').hide();
  254. jQuery('.submit-buttons').append('<input name="post" value="Enviar" id="send-post" style="display:none;" type="submit">');
  255. jQuery(oTicket.sCSSEditTags).insertBefore('body');
  256. insertTags();
  257. jQuery("input[name='post']").bind('click', function () {
  258. oTicket.oInstance = jQuery('#text_editor_textarea').sceditor('instance');
  259. var aArray = [oTicket.oInstance.val(), jQuery('#field-owner').val(), jQuery('#field-version').val(), jQuery('#field-type').val(), jQuery('#field-keywords').val()];
  260. var aLength = aArray.length - 1;
  261. for (var i = 0; i < aLength; i++) {
  262. if (!aArray[i].length) {
  263. return alert('Atenção:\n\nTodos os campos devem ser preenchidos, com exceção do campo [Palavras-Chave:] que é opcional!')
  264. }
  265. }
  266. var sPost = oTicket.sPost.replace('$1', aArray[0]).replace('$2', aArray[1]).replace('$3', aArray[2]).replace('$4', aArray[3]).replace('$5', aArray[4]);
  267. oTicket.oInstance.val(sPost);
  268. jQuery('#send-post').click()
  269. })
  270. }
  271. }
  272. } else if (sPath.indexOf('/f') !== -1 || sPath.indexOf('/t') !== -1) {
  273. jQuery('a[href^="/post?f="]').unbind().bind('click', function (event) {
  274. oTicket.iForum = jQuery(this).attr('href').split('=')[1].split('&')[0];
  275. if (oTicket.vForunsID.indexOf(oTicket.iForum) !== -1) {
  276. event.preventDefault();
  277. insertForm()
  278. }
  279. })
  280. }
  281. function insertForm() {
  282. jQuery(oTicket.sCSS).insertBefore('body');
  283. jQuery(oTicket.sCSSTable).insertBefore('body');
  284. jQuery(oTicket.sCSSEditTags).insertBefore('body');
  285. jQuery('#main').html(oTicket.sContent);
  286. scrollToElement('#main-content', 400, 35);
  287. var ticket_editor_textarea = jQuery('#ticket_editor_textarea');
  288. loadEditor(ticket_editor_textarea, '');
  289. insertTags();
  290. jQuery(".trac-close-msg").show().bind('click', function () {
  291. jQuery(this).closest(".system-message").hide();
  292. return false
  293. });
  294. jQuery('#agree-tos').bind('click', function () {
  295. if (jQuery(this).is(':checked')) {
  296. jQuery("#new-post").show().bind('click', function () {
  297. var aArray = [jQuery('#field-summary').val(), jQuery('#ticket_editor_textarea').sceditor('instance').val(), jQuery('#field-owner').val(), jQuery('#field-version').val(), jQuery('#field-type').val(), jQuery('#field-keywords').val()];
  298. if (aArray[0].length < 10) {
  299. alert('Informação:\n\n O título do tópico precisa ter no mínimo 10 caracteres!');
  300. document.getElementById('field-summary').focus();
  301. return scrollToElement('#field-summary', 800)
  302. }
  303. var aLength = aArray.length - 1;
  304. for (var i = 0; i < aLength; i++) {
  305. if (!aArray[i].length) {
  306. jQuery('#warning').show();
  307. return scrollToElement('#warning', 800, 30)
  308. }
  309. }
  310. var sPost = oTicket.sPost.replace('$1', aArray[1]).replace('$2', aArray[2]).replace('$3', aArray[3]).replace('$4', aArray[4]).replace('$5', aArray[5]);
  311. jQuery('input[name="f"]').val(oTicket.iForum);
  312. jQuery('input[name="message"]').val(sPost);
  313. jQuery('input[name="subject"]').val(aArray[0]);
  314. jQuery('#send-post').click();
  315. jQuery('#main-content').fadeTo(100, 0.2);
  316. return false
  317. })
  318. } else {
  319. jQuery("#new-post").hide().unbind()
  320. }
  321. });
  322. jQuery('#preview').bind('click', function (event) {
  323. event.preventDefault();
  324. var sPreview = oTicket.sPreview.replace(/\$0/g, jQuery('#field-summary').val()).replace(/\$1/g, jQuery('#ticket_editor_textarea').sceditor('instance').getWysiwygEditorValue(false)).replace(/\$2/g, jQuery('#field-owner').val()).replace(/\$3/g, jQuery('#field-version').val()).replace(/\$4/g, jQuery('#field-type').val()).replace(/\$5/g, jQuery('#field-keywords').val());
  325. jQuery('#ticket-preview').html(sPreview).show();
  326. scrollToElement('#main-content', 800, 35, function () {
  327. jQuery('#ticket-preview').slideDown(300)
  328. });
  329. jQuery('#ticket-edit, #ticket-close').bind('click', function () {
  330. jQuery(this).unbind();
  331. jQuery('#ticket-edit, #ticket-close').unbind();
  332. jQuery('#ticket-preview').slideUp(300, function () {
  333. jQuery('#ticket').remove()
  334. });
  335. return false
  336. })
  337. });
  338. jQuery('#cancel').bind('click', function () {
  339. return window.location.href = window.location.href
  340. })
  341. }
  342. });
  343. function insertTags() {
  344. jQuery('.ticket form').bind('keypress', function (e) {
  345. if (e.keyCode == 13) {
  346. e.preventDefault()
  347. }
  348. });
  349. jQuery('input[name="subject"]:first').focusout(function () {
  350. var sTags = jQuery(this).val();
  351. if (sTags !== '') {
  352. var oTarget = jQuery('#field-keywords');
  353. oTarget.val('');
  354. jQuery('#jsTags .stickers-list').remove();
  355. sTags = sTags.replace(/"/g, '').replace(/'/g, '').split(' ');
  356. jQuery.each(sTags, function (index, data) {
  357. data = data.replace(/\P{Alnum}/g, '');
  358. if (data.length > 4) {
  359. addNewTag(data)
  360. }
  361. });
  362. tagsClick()
  363. }
  364. });
  365. jQuery('#new-tag').bind('keyup', function (e) {
  366. var code = (e.keyCode ? e.keyCode : e.which);
  367. var sTarget = [13, 32, 186, 188];
  368. if (sTarget.indexOf(code) !== -1) {
  369. var sTags = jQuery(this).val().replace(/\W+/g, '');
  370. if (sTags.length > 4) {
  371. addNewTag(sTags);
  372. jQuery(this).val('');
  373. tagsClick()
  374. }
  375. }
  376. });
  377. jQuery('#jsTags').bind('click', function () {
  378. document.getElementById('new-tag').focus()
  379. })
  380. }
  381. function addNewTag(data) {
  382. var sNewTag = '<li class="stickers-list"><span class="stickers-label">' + data + '</span><a class="stickers-close"> x </a></li>';
  383. jQuery('#jsTags .stickers-new').before(sNewTag);
  384. var oTarget = jQuery('#field-keywords');
  385. if (oTarget.val() == '') {
  386. oTarget.val(oTarget.val() + data)
  387. } else {
  388. oTarget.val(oTarget.val() + ',' + data)
  389. }
  390. }
  391. function tagsClick() {
  392. jQuery('#jsTags a.stickers-close').unbind().bind('click', function () {
  393. var sSearch = jQuery(this).parent().children('.stickers-label').text();
  394. var oTarget = jQuery('#field-keywords');
  395. oTarget.val(oTarget.val().replace(sSearch + ',', '').replace(',' + sSearch, '').replace(sSearch, '').replace(',,', ','));
  396. jQuery(this).parent().remove()
  397. })
  398. }
  399. function scrollToElement(target, speed, adjust, callback) {
  400. if (speed == '' || speed == undefined) {
  401. speed = 800
  402. }
  403. if (adjust == '' || adjust == undefined) {
  404. adjust = 0
  405. }
  406. var destination = jQuery(target).offset().top - adjust;
  407. var current = jQuery('html').scrollTop() + jQuery('body').scrollTop();
  408. if (current != destination) {
  409. jQuery('html:not(:animated),body:not(:animated)').stop(true).animate({scrollTop: destination}, speed, function () {
  410. if (typeof callback === 'function')callback()
  411. })
  412. } else {
  413. if (typeof callback === 'function')callback()
  414. }
  415. return false
  416. }
  417. function loadFile(filename, filetype, id, mode) {
  418. if (filename == '' || filename == undefined)return false;
  419. if (filetype == '' || filetype == undefined)filetype = 'js';
  420. if (id == '' || id == undefined)return false;
  421. if (mode == '' || mode == undefined)mode = false;
  422. if (document.getElementById(id) !== null)return false;
  423. if (filetype == "js") {
  424. var obj = document.createElement('script');
  425. obj.type = "text/javascript";
  426. obj.async = mode;
  427. obj.src = filename;
  428. obj.id = id
  429. } else if (filetype == "css") {
  430. var obj = document.createElement("link");
  431. obj.rel = "stylesheet";
  432. obj.type = "text/css";
  433. obj.href = filename
  434. }
  435. if (typeof obj != "undefined")document.getElementsByTagName("head")[0].appendChild(obj);
  436. return true
  437. }
  438. var $executeJS = function (file, callback) {
  439. $.ajax({async: false, type: 'GET', url: file, data: null, dataType: 'script', complete: callback})
  440. };
  441. var $editorLoaded = 0;
  442. var locale = 'pt';
  443. var height = '250px';
  444. var plugin = 'bbcode';
  445. var toolbar = 'quote,code,faspoiler,fahide|servimg,image,link,youtube,dailymotion,flash|date,time,pastetext,|source';
  446. function loadEditor(text_area, value) {
  447. if (text_area == '' || text_area == undefined) {
  448. text_area = $('#text_editor_textarea')
  449. }
  450. if (value == '' || value == undefined) {
  451. value = ''
  452. }
  453. if ($editorLoaded)return runEditor(text_area, value);
  454. loadFile('http://illiweb.com/rsc/94/frm/SCEditor/minified/themes/fa.default.min.css', 'css', 'fa.default');
  455. $executeJS('http://illiweb.com/rsc/94/frm/jquery/cookie/jquery.cookie.js', function (resp) {
  456. $executeJS('http://illiweb.com/rsc/94/frm/SCEditor/src/jquery.sceditor.js', function (resp) {
  457. $executeJS('http://illiweb.com/rsc/94/frm/SCEditor/src/plugins/bbcode.js', function (resp) {
  458. runEditor(text_area, value);
  459. $editorLoaded = 1;
  460. return true
  461. })
  462. })
  463. })
  464. }
  465. function runEditor(text_area, value) {
  466. if (text_area.next('.sceditor-container').length)return false;
  467. try {
  468. localeLng();
  469. text_area.sceditor({
  470. locale: locale,
  471. width: "auto",
  472. height: height,
  473. plugins: plugin,
  474. toolbar: toolbar,
  475. rtl: false,
  476. emoticonsEnabled: false,
  477. emoticonsCompat: true,
  478. emoticonsRoot: ""
  479. });
  480. var editor = text_area.sceditor("instance");
  481. if (value !== '') {
  482. editor.val(value);
  483. editor.toggleSourceMode()
  484. }
  485. editor.focus();
  486. $("a.sceditor-button-source").addClass("hover");
  487. var container = $('.sceditor-container');
  488. var ciframe = container.find('iframe');
  489. var ctextarea = container.find('textarea');
  490. ciframe.width(ciframe.width() - 9);
  491. ctextarea.width(ctextarea.width() - 9)
  492. } catch (e) {
  493. if (typeof(console) != 'undefined') {
  494. console.error(e)
  495. }
  496. }
  497. }
  498. function localeLng() {
  499. 'use strict';
  500. $.sceditor.locale["pt"] = {
  501. "Bold": "Negrito",
  502. "Italic": "Itál.",
  503. "Underline": "Sublinhar",
  504. "Strikethrough": "Riscado",
  505. "Align left": "Alinhar à esquerda",
  506. "Center": "Centrado",
  507. "Align right": "Alinhar à direita",
  508. "Justify": "Justificado",
  509. "Bullet list": "-Lista",
  510. "Numbered list": "Lista ordenada",
  511. "Insert a horizontal rule": "Inserir uma linha",
  512. "Insert a Quote": "'Citar'",
  513. "Code": "Code",
  514. "Spoiler": "Spoiler",
  515. "Hidden": "Escondido",
  516. "Insert a table": "Inserir uma tabela",
  517. "Host an image": "Hospedar uma imagem",
  518. "Insert an image": "Inserir uma imagem",
  519. "Insert an email": "Inserir um email",
  520. "Insert a link": "Inserir um link",
  521. "Unlink": "Excluir um link",
  522. "Insert a YouTube video": "Inserir um video do Youtube",
  523. "Insert a Dailymotion Video": "Insira um video Dailymotion",
  524. "Flash": "Flash",
  525. "Font Size": "Tamanho da fonte",
  526. "Font Color": "Cor",
  527. "Font Name": "Fonte",
  528. "Remove Formatting": "Excluir a formatação do texto",
  529. "Subscript": "Índice",
  530. "Superscript": "Exposição",
  531. "Horizontal scrolling": "Desfilamento horizontal",
  532. "Vertical scrolling": "Desfilamento vertical",
  533. "WoW": "WoW",
  534. "Random": "Aleatório",
  535. "Dices roll": "Lançar dados",
  536. "Insert an emoticon": "Smileys",
  537. "Insert current date": "Data atual",
  538. "Insert current time": "Hora atual",
  539. "Paste Text": "Inserir um texto não formatado",
  540. "Switch Editor Mode": "Transferir o modo de edição",
  541. "color_dark_red": "Vermelho Escuro",
  542. "color_red": "Vermelho",
  543. "color_orange": "Laranja",
  544. "color_brown": "Marrom",
  545. "color_yellow": "Amarelo",
  546. "color_green": "Verde",
  547. "color_olive": "Azeitona",
  548. "color_cyan": "Ciano",
  549. "color_blue": "Azul",
  550. "color_dark_blue": "Azul escuro",
  551. "color_indigo": "Índigo",
  552. "color_violet": "Violeta",
  553. "color_grey": "Cinza",
  554. "color_white": "Branco",
  555. "color_black": "Preto",
  556. "More": "Mais botões",
  557. "Insert": "Inserir",
  558. "URL:": "URL",
  559. "Invalid YouTube video": "Vídeo inválido",
  560. "Author (optional)": "Autor (Opcional)",
  561. "Title (optional)": "Título (Opcional)",
  562. "Cols:": "Colunas",
  563. "Rows:": "linhas",
  564. "Width (optional):": "Largura (Opcional)",
  565. "Height (optional):": "Altura (Opcional)",
  566. "Description (optional):": "Descrição (Opcional)",
  567. "Paste your text inside the following box:": "Colar texto",
  568. "Border": "Borda (px)",
  569. "dateFormat": "day.month.year"
  570. }
  571. }
  572. topic_total_users = 'usuário(s) está(ão) lendo este tópico';
  573. topic_total_members = 'membro(s)';
  574. topic_total_visit = 'visitante(s) e';
  575. topic_total_anoni = 'membros anônimo(s)';
  576. find_user_location = 'Obtendo a localização, aguarde...';
  577. has_portal = 1;
  578. USERNAME = '';
  579. USER_ID = 0;
  580. SUPERMOD = 0;
  581. TID = 0;
  582. ACTION = 'add_field';
  583. jQuery(function () {
  584. if (location.pathname.indexOf('/u') !== -1) {
  585. jQuery('dt:contains("WhereIam")').closest('dl').remove()
  586. } else if (location.pathname.indexOf('editprofile' !== -1)) {
  587. jQuery('label:contains("WhereIam"), span:contains("WhereIam"), dt:contains("WhereIam")').closest('dl, tr').remove()
  588. }
  589. if (_userdata.session_logged_in) {
  590. USERNAME = _userdata.username;
  591. USER_ID = _userdata.user_id;
  592. SUPERMOD = _userdata.user_level;
  593. TID = jQuery('a[href*="tid="]').attr('href').split('tid=')[1].split('&')[0]
  594. }
  595. });
  596. jQuery(window).load(function () {
  597. console.log("/**************************************************************************");
  598. console.log("* Module: 'Where I am?' and 'Topic Active Users (Who is read this topic?)'!");
  599. console.log("* Description: Shows the exact location where the user is currently.");
  600. console.log("* Author: Made and Optimizations by JScript - 2013/07/12, 2014/10/13");
  601. console.log("* Version: Beta tester only!");
  602. console.log("/**************************************************************************");
  603. console.log('USERNAME: ' + USERNAME);
  604. console.log("USER_ID: " + USER_ID);
  605. console.log("TID: " + TID);
  606. var oWereIam = {
  607. pathname: location.pathname,
  608. total_users: 0,
  609. oSubForum: '',
  610. oTarget: 0,
  611. sIndex: '/forum',
  612. oHtml: {
  613. punbb: '<!-- ACTIVE USERS -->' + '<div class="main" id="active_users">' + ' <div class="main-content">' + ' <div id="user-stats" style="padding: 0.6em 1em;">' + ' </div>' + ' </div>' + '</div>',
  614. content: '<!-- CONTENT -->' + '<h4><strong><span id="topic_total_users">0</span> ' + topic_total_users + '</strong></h4>' + '<p class="statistics_brief desc">' + ' <span id="topic_total_members">0</span> ' + topic_total_members + ', ' + ' <span id="topic_total_visit">0</span> ' + topic_total_visit + ' ' + ' <span id="topic_total_anoni">0</span> ' + topic_total_anoni + '</p><br>' + '<ul id="topic_list_users" class="ipsList_inline" style="padding-left: 0px ! important;"></ul>'
  615. }
  616. };
  617. if (_userdata.session_logged_in) {
  618. WhereIam()
  619. }
  620. if (oWereIam.pathname.indexOf('/t') !== -1) {
  621. jQuery(oWereIam.oHtml.punbb).insertBefore(jQuery('#pun-info'));
  622. jQuery('#user-stats').html(oWereIam.oHtml.content);
  623. if (!has_portal)oWereIam.sIndex = '/';
  624. oWereIam.oSubForum = jQuery('.pun-crumbs.noprint a.nav[href^="/f"], #navstrip a.nav[href^="/f"], .pathname-box:first a.nav[href^="/f"], span.nav a.nav[href^="/f"]').attr('href');
  625. try {
  626. jQuery.get(oWereIam.oSubForum, function (data) {
  627. oWereIam.oTarget = jQuery('#stats > a, #info_open td[colspan="2"]:not(.catBottom) .gensmall a, #main-content > a[href^="/u"], .activeusers-box .row1 a', data)
  628. }).always(function () {
  629. if (oWereIam.oTarget.length !== 0) {
  630. var guest = Math.floor(Math.random() * (5 - 0));
  631. jQuery('#topic_total_visit').text(guest);
  632. searchActiveUsers(oWereIam.oTarget, 0, oWereIam.oTarget.length, 0, guest)
  633. } else {
  634. jQuery.get(oWereIam.sIndex, function (data) {
  635. var oOnlineList = /(?:\b<br>([\s\S]*?)<br>)/.exec(jQuery('#onlinelist > p:not(.right)', data).html())[1];
  636. var memDiv = jQuery('<div>').html(oOnlineList);
  637. oWereIam.oTarget = memDiv.find('a')
  638. }).always(function () {
  639. if (oWereIam.oTarget.length !== 0) {
  640. var guest = Math.floor(Math.random() * (5 - 0));
  641. jQuery('#topic_total_visit').text(guest);
  642. searchActiveUsers(oWereIam.oTarget, 0, oWereIam.oTarget.length, 0, guest)
  643. }
  644. })
  645. }
  646. })
  647. } catch (e) {
  648. jQuery.get(oWereIam.sIndex, function (data) {
  649. var oOnlineList = /(?:\b<br>([\s\S]*?)<br>)/.exec(jQuery('#onlinelist > p:not(.right)', data).html())[1];
  650. var memDiv = jQuery('<div>').html(oOnlineList);
  651. oWereIam.oTarget = memDiv.find('a')
  652. }).always(function () {
  653. if (oWereIam.oTarget.length !== 0) {
  654. var guest = Math.floor(Math.random() * (5 - 0));
  655. jQuery('#topic_total_visit').text(guest);
  656. searchActiveUsers(oWereIam.oTarget, 0, oWereIam.oTarget.length, 0, guest)
  657. }
  658. })
  659. }
  660. } else if (oWereIam.pathname.indexOf('/viewonline') !== -1) {
  661. oWereIam.oTarget = jQuery('#main-content > .main .main-content tbody td.tcl a');
  662. oWereIam.oTarget.each(function (index) {
  663. var oThis = jQuery(this);
  664. oThis.closest('tr').find('td.tcr').html('<a href="#">' + find_user_location + '</a>');
  665. jQuery.get(oThis.attr('href'), function (data) {
  666. var Field_Text = jQuery('dt:contains("WhereIam")', data).closest('dl').find('div.field_uneditable').text();
  667. try {
  668. var $JScript = JSON.parse(Field_Text.replace(/'/g, '"'));
  669. oThis.closest('tr').find('td.tcr').html('<a href="' + $JScript.path.url + '">' + $JScript.path.title + '</a>')
  670. } catch (e) {
  671. }
  672. })
  673. })
  674. }
  675. function searchActiveUsers(oTarget, start, len, index, guest) {
  676. if (index > 10) {
  677. return false
  678. }
  679. var oThis = jQuery(oTarget[index]), sHref = oThis.attr('href'), $JScript;
  680. if ((sHref !== undefined)) {
  681. var user_name = '<a href="' + sHref + '">' + oThis.html() + '</a>';
  682. jQuery.get(sHref, function (data) {
  683. var Field_Text = jQuery('dt:contains("WhereIam")', data).closest('dl').find('div.field_uneditable').text();
  684. try {
  685. $JScript = JSON.parse(Field_Text.replace(/'/g, '"'))
  686. } catch (e) {
  687. }
  688. console.log(Field_Text)
  689. }).always(function () {
  690. try {
  691. if ($JScript.path.url == oWereIam.pathname) {
  692. if (oWereIam.total_users == 0) {
  693. $('#topic_list_users').html('');
  694. $('#topic_list_users').append(user_name)
  695. } else {
  696. $('#topic_list_users').append(', ' + user_name)
  697. }
  698. oWereIam.total_users++;
  699. $('#topic_total_users').text(oWereIam.total_users + guest);
  700. $('#topic_total_members').text(oWereIam.total_users)
  701. }
  702. } catch (e) {
  703. }
  704. index++;
  705. try {
  706. searchActiveUsers(oTarget, start, len, index, guest)
  707. } catch (e) {
  708. }
  709. })
  710. }
  711. }
  712. });
  713. function WhereIam() {
  714. jQuery.ajaxSetup({async: false});
  715. jQuery.get('/profile?mode=editprofile', function (data) {
  716. var found = 1;
  717. var Profile_Field_ID = jQuery('label:contains("WhereIam"), span:contains("WhereIam"), dt:contains("WhereIam")', data).closest('dl, tr').find('textarea').attr('id');
  718. console.log("Profile_Field_ID: " + Profile_Field_ID);
  719. if ((Profile_Field_ID == undefined) && (SUPERMOD == 1)) {
  720. jQuery.post("/admin/index.forum?part=users_groups&sub=users&mode=avatar_profil2&extended_admin=1&tid=" + TID, {
  721. action: ACTION,
  722. id: 0,
  723. type: 0,
  724. action: 'configuration_final',
  725. list_type_field: 2,
  726. field_name: 'WhereIam',
  727. field_desc: 'Where I am? - Made and Optimizations by JScript - 2013/07/12, 2014/10/13',
  728. field_oblig: 0,
  729. field_display_profil: 1,
  730. list_field_type_view: 0,
  731. list_auth_field_modo: 1,
  732. list_auth_field_himself: 1,
  733. list_field_view: -1,
  734. list_separator: 0,
  735. field_type_2_lng_max: 15000,
  736. submit: 1,
  737. field_type_11_max_before: 14,
  738. field_type_11_max_after: 6
  739. }).done(function () {
  740. console.log('Add profile field done!');
  741. jQuery.get('/profile?mode=editprofile', function (data) {
  742. Profile_Field_ID = jQuery('label:contains("WhereIam"), span:contains("WhereIam"), dt:contains("WhereIam")', data).closest('dl, tr').find('textarea').attr('id')
  743. }).fail(function () {
  744. console.log('Failed to get field Profile_Field_ID!');
  745. found = 0
  746. })
  747. }).fail(function () {
  748. console.log('Add profile field Fail!');
  749. found = 0
  750. })
  751. }
  752. if (found) {
  753. var sTitle = jQuery('.pun-crumbs:first p strong:last').text();
  754. if ((sTitle == 'undefined') || (sTitle == ''))sTitle = location.pathname;
  755. var now = new Date;
  756. var $JScript = {
  757. appInfo: {
  758. module: 'Where I am?',
  759. description: 'Shows the exact location where the user is currently.',
  760. author: 'JScript',
  761. version: '1.00',
  762. release: '2014/10/13'
  763. },
  764. userInfo: {
  765. oscpu: navigator.oscpu,
  766. appName: navigator.appName,
  767. language: navigator.language,
  768. userAgent: navigator.userAgent
  769. },
  770. path: {
  771. title: sTitle,
  772. url: location.pathname,
  773. param: location.search,
  774. state: '0',
  775. time: now.getHours() + ":" + now.getMinutes(),
  776. date: now.getDate() + "/" + now.getMonth() + "/" + now.getFullYear()
  777. }
  778. };
  779. jQuery.post("/ajax_profile.forum?jsoncallback=?", {
  780. id: Profile_Field_ID.substring(16, Profile_Field_ID.length),
  781. user: USER_ID,
  782. active: "1",
  783. content: '[["' + Profile_Field_ID + '", "' + JSON.stringify($JScript).replace(/"/g, "'") + '"]]',
  784. tid: TID
  785. }, function (data) {
  786. console.log("OK: ajax_profile, userID = " + USER_ID)
  787. }, "json").fail(function () {
  788. console.log("error: ajax_profile, userID = " + USER_ID)
  789. })
  790. }
  791. }).done(function () {
  792. }).fail(function () {
  793. console.log('Failed to get field Profile_Field_ID')
  794. });
  795. jQuery.ajaxSetup({async: true})
  796. }
  797. $(document).ready(function () {
  798. var entry = $('.post .entry-content, .blog_message');
  799. entry.html(function () {
  800. return $(this).html().replace(/\[poll](.*?)\[\/poll\]/g, '<div class="secret_code">$1</div>')
  801. });
  802. var like_post_msg = 'Por favor, curta esta postagem para ter acesso ao conteúdo completo desta mensagem.';
  803. for (var x = entry, i = 0, e; (e = x[i++]);) {
  804. if (document.location.pathname.indexOf("/spa") >= 0 && _userdata["user_level"] < 1 || _userdata["user_level"] < 1 && $('.vote-button', e).length || _userdata["session_logged_in"] < 1)$('.secret_code', e).html(like_post_msg)
  805. }
  806. });
  807. (function () {
  808. var f = {
  809. bbcodes: {}, basics: [], attrReg: /.*?=("|'|)(.*?)\1\]/, parseTag: function (a, b, d) {
  810. return a.replace(d ? RegExp("(\\[" + b.tag + "[^\\]]*\\])((?:.|\\r?\\n)*?)\\[/" + b.tag + "]", "g" + (b.insensitive ? "i" : "")) : RegExp("\\[" + b.tag + "[^\\]]*\\]", "g" + (b.insensitive ? "i" : "")), function (a, c, e) {
  811. d || (c = a);
  812. c = f.attrReg.test(c) ? c.replace(f.attrReg, "$2") : b.defaultAttr;
  813. if (b.validate && !(d ? b.validate(e, c) : b.validate(c)))return a;
  814. b.replace && (a = d ? b.replace(e, c) : b.replace(c), "string" === typeof a ? d ? e = a : c = a : a && "object" === typeof a && (e = a.content || e, c = a.attr || c));
  815. return f.swapReplacers(b.replacement, e, c)
  816. })
  817. }, swapReplacers: function (a, b, d) {
  818. return (a || "").replace(/{CONTENT}/g, b || "").replace(/{ATTR}/g, d || "")
  819. }, parse: function (a) {
  820. for (var b = f.bbcodes, d = f.basics, g = 0, c; c = d[g++];) {
  821. var e = c[0];
  822. if ("string" === typeof e)for (; -1 !== a.indexOf(e);)a = a.replace(e, c[1]); else a = a.replace(e, c[1])
  823. }
  824. for (var h in b)(d = b[h]) && (d.replacement && d.tag) && (a = f.parseTag(a, d, d.close));
  825. return a
  826. }, add: function (a, b) {
  827. if (!/^\w+$/.test(a))throw new Exception("MBB Tag invalida: " + a);
  828. b.tag || (b.tag = a);
  829. "close"in b || (b.close = !1);
  830. f.bbcodes[a] = b
  831. }, addSwap: function (a, b) {
  832. f.basics.push([a, b])
  833. }
  834. };
  835. window.MBB = f
  836. })();
  837. $(function () {
  838. var p = $('.post .entry-content , .blog_message');
  839. for (var i = 0, e; (e = p[i++]);) {
  840. var text = e.innerHTML;
  841. text = MBB.parse(text);
  842. e.innerHTML = text
  843. }
  844. });
  845. MBB.add('offtopic', {
  846. close: true,
  847. replacement: '<div style="padding: 3px; float: right; border: 1px solid; font-size: 0.8em">Off Topic: {CONTENT}</div>'
  848. });
  849. MBB.add('sucesso', {close: true, replacement: '<div class="alert sucesso"><strong>{ATTR}</strong> {CONTENT}</div>'});
  850. MBB.add('aviso', {close: true, replacement: '<div class="alert danger"><strong>{ATTR}</strong> {CONTENT}</div>'});
  851. MBB.add('infos', {close: true, replacement: '<div class="alert infos"><strong>{ATTR}</strong> {CONTENT}</div>'});
  852. MBB.add('alertas', {close: true, replacement: '<div class="alert"><strong>{ATTR}</strong> {CONTENT}</div>'});
  853. MBB.add('codebox', {close: true, replacement: '<codebox><code>{CONTENT}</code></codebox>'});
  854. MBB.add('twitter', {close: true, replacement: '@<a href="http://www.twitter.com/{CONTENT}">{CONTENT}</a>'});
  855. MBB.add('quadrado', {
  856. close: true,
  857. replacement: '<div class="quadrado_box"><strong>{ATTR}</strong><br><img src="http://i50.tinypic.com/2lxicrn.png" title="XXXXXX" /><br>{CONTENT}</div>'
  858. });
  859. MBB.add('guest', {
  860. close: true, replacement: '<span class="guest">{CONTENT}</span>', replace: function (content) {
  861. if (!document.getElementById('logout'))return 'Você vai ser capaz de ver o conteúdo assim que efetuar o seu registro no fórum. ';
  862. return content
  863. }
  864. });
  865. jQuery(function () {
  866. if (location.pathname.indexOf('/u') == 0) {
  867. jQuery('#tabs ul').append('<li id="userInfo" ><a href="javascript:void(0);"><span>Info</span></a></li>');
  868. jQuery('#userInfo').click(function () {
  869. var oldSel = {
  870. tab: jQuery('#tabs .activetab'),
  871. html: document.getElementById('profile-advanced-details').innerHTML
  872. };
  873. oldSel.tab.removeClass('activetab');
  874. jQuery('#userInfo').addClass('activetab');
  875. JS_infoTab();
  876. oldSel.tab.click(function (event) {
  877. event.preventDefault();
  878. jQuery('#userInfo').removeClass('activetab');
  879. oldSel.tab.addClass('activetab');
  880. document.getElementById('profile-advanced-details').innerHTML = oldSel.html;
  881. oldSel.tab.unbind('click')
  882. })
  883. })
  884. }
  885. });
  886. function JS_infoTab() {
  887. document["\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64"]("\x70\x72\x6F\x66\x69\x6C\x65\x2D\x61\x64\x76\x61\x6E\x63\x65\x64\x2D\x64\x65\x74\x61\x69\x6C\x73")["\x69\x6E\x6E\x65\x72\x48\x54\x4D\x4C"] = "\x3C\x64\x69\x76\x20\x63\x6C\x61\x73\x73\x3D\x22\x6D\x61\x69\x6E\x2D\x68\x65\x61\x64\x22\x3E" + "\x20\x20\x20\x20\x3C\x64\x69\x76\x20\x63\x6C\x61\x73\x73\x3D\x22\x73\x75\x62\x74\x69\x74\x6C\x65\x22\x3E\x49\x6E\x66\x6F\x72\x6D\x61\xE7\xF5\x65\x73\x20\x64\x69\x76\x65\x72\x73\x61\x73\x3A\x3C\x2F\x73\x70\x61\x6E\x3E" + "\x20\x20\x20\x20\x3C\x2F\x64\x69\x76\x3E" + "\x3C\x2F\x64\x69\x76\x3E" + "\x3C\x64\x69\x76\x20\x63\x6C\x61\x73\x73\x3D\x22\x6D\x61\x69\x6E\x2D\x63\x6F\x6E\x74\x65\x6E\x74\x20\x63\x6C\x65\x61\x72\x66\x69\x78\x22\x3E" + "\x20\x20\x20\x20\x3C\x64\x69\x76\x20\x63\x6C\x61\x73\x73\x3D\x22\x6D\x69\x64\x64\x6C\x65\x6C\x69\x6E\x65\x22\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x6C\x20\x69\x64\x3D\x22\x22\x3E\x3C\x64\x74\x3E\x4C\x6F\x63\x61\x6C\x69\x7A\x61\xE7\xE3\x6F\x3A\x3C\x2F\x64\x74\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x64\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x73\x70\x61\x6E\x20\x69\x64\x3D\x22\x74\x69\x74\x6C\x65\x22\x3E\x43\x61\x72\x72\x65\x67\x61\x6E\x64\x6F\x2E\x2E\x2E\x3C\x2F\x73\x70\x61\x6E\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x2F\x64\x64\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x2F\x64\x6C\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x69\x76\x20\x63\x6C\x61\x73\x73\x3D\x22\x73\x65\x70\x61\x72\x61\x74\x6F\x72\x22\x3E\x26\x6E\x62\x73\x70\x3B\x3C\x2F\x64\x69\x76\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x6C\x20\x69\x64\x3D\x22\x22\x3E\x3C\x64\x74\x3E\x55\x52\x4C\x20\x64\x6F\x20\x6C\x6F\x63\x61\x6C\x3A\x3C\x2F\x64\x74\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x64\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x73\x70\x61\x6E\x20\x69\x64\x3D\x22\x75\x72\x6C\x22\x3E\x43\x61\x72\x72\x65\x67\x61\x6E\x64\x6F\x2E\x2E\x2E\x3C\x2F\x73\x70\x61\x6E\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x2F\x64\x64\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x2F\x64\x6C\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x69\x76\x20\x63\x6C\x61\x73\x73\x3D\x22\x73\x65\x70\x61\x72\x61\x74\x6F\x72\x22\x3E\x26\x6E\x62\x73\x70\x3B\x3C\x2F\x64\x69\x76\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x6C\x20\x69\x64\x3D\x22\x22\x3E\x3C\x64\x74\x3E\x45\x73\x74\x61\x64\x6F\x20\x61\x74\x75\x61\x6C\x3A\x3C\x2F\x64\x74\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x64\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x73\x70\x61\x6E\x20\x69\x64\x3D\x22\x73\x74\x61\x74\x65\x22\x3E\x43\x61\x72\x72\x65\x67\x61\x6E\x64\x6F\x2E\x2E\x2E\x3C\x2F\x73\x70\x61\x6E\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x2F\x64\x64\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x2F\x64\x6C\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x69\x76\x20\x63\x6C\x61\x73\x73\x3D\x22\x73\x65\x70\x61\x72\x61\x74\x6F\x72\x22\x3E\x26\x6E\x62\x73\x70\x3B\x3C\x2F\x64\x69\x76\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x6C\x20\x69\x64\x3D\x22\x22\x3E\x3C\x64\x74\x3E\x48\x6F\x72\x61\x20\x65\x20\x64\x61\x74\x61\x3A\x3C\x2F\x64\x74\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x64\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x73\x70\x61\x6E\x20\x69\x64\x3D\x22\x74\x69\x6D\x65\x5F\x64\x61\x74\x65\x22\x3E\x43\x61\x72\x72\x65\x67\x61\x6E\x64\x6F\x2E\x2E\x2E\x3C\x2F\x73\x70\x61\x6E\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x2F\x64\x64\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x2F\x64\x6C\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x69\x76\x20\x63\x6C\x61\x73\x73\x3D\x22\x73\x65\x70\x61\x72\x61\x74\x6F\x72\x22\x3E\x26\x6E\x62\x73\x70\x3B\x3C\x2F\x64\x69\x76\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x6C\x20\x69\x64\x3D\x22\x22\x3E\x3C\x64\x74\x3E\x53\x4F\x20\x65\x20\x43\x50\x55\x3A\x3C\x2F\x64\x74\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x64\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x73\x70\x61\x6E\x20\x69\x64\x3D\x22\x6F\x73\x63\x70\x75\x22\x3E\x43\x61\x72\x72\x65\x67\x61\x6E\x64\x6F\x2E\x2E\x2E\x3C\x2F\x73\x70\x61\x6E\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x2F\x64\x64\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x2F\x64\x6C\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x69\x76\x20\x63\x6C\x61\x73\x73\x3D\x22\x73\x65\x70\x61\x72\x61\x74\x6F\x72\x22\x3E\x26\x6E\x62\x73\x70\x3B\x3C\x2F\x64\x69\x76\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x6C\x20\x69\x64\x3D\x22\x22\x3E\x3C\x64\x74\x3E\x41\x70\x6C\x69\x63\x61\x74\x69\x76\x6F\x3A\x3C\x2F\x64\x74\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x64\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x73\x70\x61\x6E\x20\x69\x64\x3D\x22\x61\x70\x70\x4E\x61\x6D\x65\x22\x3E\x43\x61\x72\x72\x65\x67\x61\x6E\x64\x6F\x2E\x2E\x2E\x3C\x2F\x73\x70\x61\x6E\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x64\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x2F\x64\x6C\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x69\x76\x20\x63\x6C\x61\x73\x73\x3D\x22\x73\x65\x70\x61\x72\x61\x74\x6F\x72\x22\x3E\x26\x6E\x62\x73\x70\x3B\x3C\x2F\x64\x69\x76\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x6C\x20\x69\x64\x3D\x22\x22\x3E\x3C\x64\x74\x3E\x49\x64\x69\x6F\x6D\x61\x20\x6E\x61\x74\x69\x76\x6F\x3A\x3C\x2F\x64\x74\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x64\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x73\x70\x61\x6E\x20\x69\x64\x3D\x22\x6C\x61\x6E\x67\x75\x61\x67\x65\x22\x3E\x43\x61\x72\x72\x65\x67\x61\x6E\x64\x6F\x2E\x2E\x2E\x3C\x2F\x73\x70\x61\x6E\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x64\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x2F\x64\x6C\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x69\x76\x20\x63\x6C\x61\x73\x73\x3D\x22\x73\x65\x70\x61\x72\x61\x74\x6F\x72\x22\x3E\x26\x6E\x62\x73\x70\x3B\x3C\x2F\x64\x69\x76\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x6C\x20\x69\x64\x3D\x22\x22\x3E\x3C\x64\x74\x3E\x4E\x61\x76\x65\x67\x61\x64\x6F\x72\x20\x3C\x62\x72\x3E\x28\x6D\x6F\x64\x65\x6C\x6F\x2F\x76\x65\x72\x73\xE3\x6F\x29\x3A\x3C\x2F\x64\x74\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x64\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x73\x70\x61\x6E\x20\x69\x64\x3D\x22\x75\x73\x65\x72\x41\x67\x65\x6E\x74\x22\x3E\x43\x61\x72\x72\x65\x67\x61\x6E\x64\x6F\x2E\x2E\x2E\x3C\x2F\x73\x70\x61\x6E\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x64\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x2F\x64\x6C\x3E" + "\x20\x20\x20\x20\x20\x20\x20\x20\x3C\x64\x69\x76\x20\x63\x6C\x61\x73\x73\x3D\x22\x73\x65\x70\x61\x72\x61\x74\x6F\x72\x22\x3E\x26\x6E\x62\x73\x70\x3B\x3C\x2F\x64\x69\x76\x3E" + "\x20\x20\x20\x20\x3C\x2F\x64\x69\x76\x3E" + "\x3C\x2F\x64\x69\x76\x3E";
  888. jQuery["\x67\x65\x74"](/\/u\w*\d/["\x65\x78\x65\x63"](location["\x70\x61\x74\x68\x6E\x61\x6D\x65"])[0], function (_0x19d4x0) {
  889. var _0x19d4x1 = jQuery("\x23\x70\x72\x6F\x66\x69\x6C\x65\x2D\x61\x64\x76\x61\x6E\x63\x65\x64\x2D\x64\x65\x74\x61\x69\x6C\x73\x20\x64\x6C\x20\x64\x74\x3A\x63\x6F\x6E\x74\x61\x69\x6E\x73\x28\x22\x57\x68\x65\x72\x65\x49\x61\x6D\x22\x29", _0x19d4x0)["\x63\x6C\x6F\x73\x65\x73\x74"]("\x64\x6C")["\x66\x69\x6E\x64"]("\x64\x69\x76\x2E\x66\x69\x65\x6C\x64\x5F\x75\x6E\x65\x64\x69\x74\x61\x62\x6C\x65")["\x74\x65\x78\x74"]();
  890. try {
  891. var _0x19d4x2 = JSON["\x70\x61\x72\x73\x65"](_0x19d4x1["\x72\x65\x70\x6C\x61\x63\x65"](/'/g, "\x22"));
  892. document["\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64"]("\x74\x69\x74\x6C\x65")["\x69\x6E\x6E\x65\x72\x48\x54\x4D\x4C"] = _0x19d4x2["\x70\x61\x74\x68"]["\x74\x69\x74\x6C\x65"];
  893. document["\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64"]("\x75\x72\x6C")["\x69\x6E\x6E\x65\x72\x48\x54\x4D\x4C"] = _0x19d4x2["\x70\x61\x74\x68"]["\x75\x72\x6C"];
  894. document["\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64"]("\x73\x74\x61\x74\x65")["\x69\x6E\x6E\x65\x72\x48\x54\x4D\x4C"] = _0x19d4x2["\x70\x61\x74\x68"]["\x73\x74\x61\x74\x65"];
  895. document["\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64"]("\x74\x69\x6D\x65\x5F\x64\x61\x74\x65")["\x69\x6E\x6E\x65\x72\x48\x54\x4D\x4C"] = _0x19d4x2["\x70\x61\x74\x68"]["\x74\x69\x6D\x65"] + "\x2C\x20" + _0x19d4x2["\x70\x61\x74\x68"]["\x64\x61\x74\x65"];
  896. document["\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64"]("\x6F\x73\x63\x70\x75")["\x69\x6E\x6E\x65\x72\x48\x54\x4D\x4C"] = _0x19d4x2["\x75\x73\x65\x72\x49\x6E\x66\x6F"]["\x6F\x73\x63\x70\x75"];
  897. document["\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64"]("\x61\x70\x70\x4E\x61\x6D\x65")["\x69\x6E\x6E\x65\x72\x48\x54\x4D\x4C"] = _0x19d4x2["\x75\x73\x65\x72\x49\x6E\x66\x6F"]["\x61\x70\x70\x4E\x61\x6D\x65"];
  898. document["\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64"]("\x6C\x61\x6E\x67\x75\x61\x67\x65")["\x69\x6E\x6E\x65\x72\x48\x54\x4D\x4C"] = _0x19d4x2["\x75\x73\x65\x72\x49\x6E\x66\x6F"]["\x6C\x61\x6E\x67\x75\x61\x67\x65"];
  899. document["\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64"]("\x75\x73\x65\x72\x41\x67\x65\x6E\x74")["\x69\x6E\x6E\x65\x72\x48\x54\x4D\x4C"] = _0x19d4x2["\x75\x73\x65\x72\x49\x6E\x66\x6F"]["\x75\x73\x65\x72\x41\x67\x65\x6E\x74"]
  900. } catch (e) {
  901. }
  902. })
  903. };
  904. if (location.pathname == '/forum') {
  905. var lastpostAvatarExist = setInterval(function () {
  906. if (jQuery('.lastpost-avatar:last').length) {
  907. clearInterval(lastpostAvatarExist);
  908. avatarWidgetlastTopics()
  909. }
  910. }, 250)
  911. }
  912. function avatarWidgetlastTopics() {
  913. var oSearch = jQuery('#main-content .main-content td.tcr a.gensmall[href^="/u"]'), oTarget = jQuery('#right .main-content > a[href^="/t"]'), ilen = oTarget.length, index = 0;
  914. oTarget.closest('.main-content').css({'max-height': '225px', 'overflow': 'auto'});
  915. for (index; index < ilen; index++) {
  916. var oThis = jQuery(oTarget[index]), oUserInf = oThis.next().next(), sHref = oUserInf.attr('href'), sTitle = oUserInf.text();
  917. oThis.before('<a href="' + sHref + '" title="' + sTitle + '" class="lastpost-avatar"><img src="http://r26.imgfast.net/users/2617/31/90/74/avatars/1-40.png" alt="no_photo" class="avt-wid" /></a>');
  918. var oImg = oThis.prev().find('.avt-wid'), sSrc = AvatarSearch(oSearch, sHref);
  919. if (sSrc.length) {
  920. oImg.attr('src', sSrc)
  921. } else {
  922. sSrc = sessionStorage.getItem(sHref);
  923. if (sSrc) {
  924. oImg.attr('src', sSrc)
  925. } else {
  926. jQuery.get(sHref, function (data) {
  927. var image = jQuery('#profile-advanced-right .main-content img:first', data).attr('src');
  928. oImg.attr('src', image);
  929. sessionStorage.setItem(sHref, image)
  930. })
  931. }
  932. }
  933. }
  934. };
  935. function AvatarSearch(oObject, oTarget) {
  936. var ilen = oObject.length, index = 0;
  937. for (index; index < ilen; index++) {
  938. var oThis = jQuery(oObject[index]);
  939. if (oThis.attr('href') == oTarget) {
  940. var sImg = oThis.closest('td.tcr').find('.lastpost-avatar img').attr('src');
  941. if (sImg.length)return sImg
  942. }
  943. }
  944. return ''
  945. }
  946. if (location.pathname == '/forum') {
  947. jQuery(function () {
  948. var punfoot = jQuery('#pun-foot');
  949. jQuery('#pun-info').detach().prependTo(punfoot);
  950. jQuery('#statistics').detach().prependTo(punfoot)
  951. })
  952. }
  953. jQuery(function () {
  954. jQuery('a[href*="/post?f=14&mode=newtopic"]').attr('href', '/h1-');
  955. jQuery('a[href*="/post?f=4&mode=newtopic"]').attr('href', '/h14-');
  956. jQuery('a[href*="/post?f=3&mode=newtopic"]').attr('href', '/h7-');
  957. jQuery('a[href*="/post?f=20&mode=newtopic"]').attr('href', '/h17-');
  958. jQuery('a[href*="/post?f=31&mode=newtopic"]').attr('href', '/h17-');
  959. jQuery('a[href*="/post?f=15&mode=newtopic"]').attr('href', '/h5-')
  960. });
  961. var IPLocation = {
  962. profile_field: 'profile_field_13_13',
  963. error_msg: "Warning!\n\nAn error occurred while requesting registration, wait 10 seconds and refresh the page to re-register!",
  964. setLoop: 0,
  965. lInterval: 10,
  966. tTimeOut: 10000,
  967. checkTime: 300000,
  968. TID: 0
  969. };
  970. jQuery.ajaxCORS = (function (_cors) {
  971. var protocol = location.protocol, hostname = location.hostname, patt = RegExp(protocol + '//' + hostname), YQL = 'http' + (/^https/.test(protocol) ? 's' : '') + '://query.yahooapis.com/v1/public/yql?callback=?', query = 'select * from html where url="{URL}" and xpath="*"';
  972.  
  973. function isExternal(url) {
  974. return !patt.test(url) && /:\/\//.test(url)
  975. }
  976.  
  977. return function (Obj) {
  978. var url = Obj.url;
  979. if (/get/i.test(Obj.type) && !/json/i.test(Obj.dataType) && isExternal(url)) {
  980. Obj.url = YQL;
  981. Obj.dataType = 'json';
  982. Obj.data = {
  983. q: query.replace('{URL}', url + (Obj.data ? (/\?/.test(url) ? '&' : '?') + jQuery.param(Obj.data) : '')),
  984. format: 'xml'
  985. };
  986. if (!Obj.success && Obj.complete) {
  987. Obj.success = Obj.complete;
  988. delete Obj.complete
  989. }
  990. Obj.success = (function (_success) {
  991. return function (data) {
  992. if (_success) {
  993. _success.call(this, {responseText: (data.results[0] || '').replace(/<script[^>]+?\/>|<script(.|\s)*?\/script>/gi, '')}, 'success')
  994. }
  995. }
  996. })(Obj.success)
  997. }
  998. return _cors.apply(this, arguments)
  999. }
  1000. })(jQuery.ajax);
  1001. if (location.search == "?agreed=true\x26step=2") {
  1002. IPLocation.setLoop = setInterval(function () {
  1003. if (document.getElementById(IPLocation.profile_field) !== null) {
  1004. jQuery("#" + IPLocation.profile_field).closest("dl").hide();
  1005. clearInterval(IPLocation.setLoop);
  1006. $.ajax({
  1007. type: "GET", url: 'http://wtfismyip.com/json', dataType: "json", success: function (data) {
  1008. var ip = data.YourFuckingIPAddress;
  1009. jQuery("#" + IPLocation.profile_field).val(ip)
  1010. }, error: function (data) {
  1011. jQuery("#" + IPLocation.profile_field).val('127.0.0.0');
  1012. alert("Warning!\n\nAn error occurred while requesting registration, wait 10 seconds and refresh the page to re-register!")
  1013. }
  1014. })
  1015. }
  1016. }, IPLocation.lInterval)
  1017. } else {
  1018. jQuery(function () {
  1019. if (!_userdata.session_logged_in) {
  1020. return false
  1021. }
  1022. setTimeout(function () {
  1023. _SaveIPInProfile();
  1024. setInterval(function () {
  1025. _SaveIPInProfile()
  1026. }, IPLocation.checkTime)
  1027. }, IPLocation.tTimeOut);
  1028. function _SaveIPInProfile() {
  1029. IPLocation.TID = jQuery('a[href*="tid="]').attr('href').split('tid=')[1].split('&')[0];
  1030. $.ajax({
  1031. type: "GET", url: 'http://wtfismyip.com/json', dataType: "json", success: function (data) {
  1032. var ip = data.YourFuckingIPAddress;
  1033. jQuery.post("/ajax_profile.forum?jsoncallback=?", {
  1034. id: IPLocation.profile_field.substring(17, IPLocation.profile_field.length),
  1035. user: _userdata.user_id,
  1036. active: "1",
  1037. content: '[["' + IPLocation.profile_field + '", "' + ip + '"]]',
  1038. tid: IPLocation.TID
  1039. }, function (data) {
  1040. console.log("The IP was saved in profile!")
  1041. }, "json").fail(function () {
  1042. console.log("Error saving the IP to profile!")
  1043. })
  1044. }, error: function (data) {
  1045. console.log("Error getting public IP!")
  1046. }
  1047. })
  1048. }
  1049. })
  1050. }
  1051. if (location.pathname.indexOf('/profile') == 0) {
  1052. IPLocation.setLoop = setInterval(function () {
  1053. if (document.getElementById(IPLocation.profile_field) !== null) {
  1054. if (_userdata.user_level == 0) {
  1055. jQuery("#" + IPLocation.profile_field).closest("dl").remove()
  1056. }
  1057. clearInterval(IPLocation.setLoop)
  1058. }
  1059. }, IPLocation.lInterval)
  1060. }
  1061. if (location.pathname.indexOf('/u') == 0) {
  1062. IPLocation.setLoop = setInterval(function () {
  1063. if (document.getElementById('profile-advanced-right') !== null) {
  1064. if (!_userdata.session_logged_in) {
  1065. return false
  1066. }
  1067. var forbid = jQuery('#field_id' + IPLocation.profile_field.substring(17, IPLocation.profile_field.length));
  1068. if (forbid.length) {
  1069. forbid.attr('id', 'forbid');
  1070. if (_userdata.user_level == 0) {
  1071. forbid.remove()
  1072. }
  1073. }
  1074. var oTarget = jQuery('[id^=field_id]'), iLen = oTarget.length, index = 0;
  1075. for (; index < iLen; index++) {
  1076. var oThis = jQuery(oTarget[index]);
  1077. oThis.attr('id', 'JS_' + oThis.attr('id'));
  1078. IPLocation.profile_field
  1079. }
  1080. ;
  1081. clearInterval(IPLocation.setLoop);
  1082. $('[id^=JS_field_id]').each(function () {
  1083. if ($(this).find('.field_editable').is('span, div')) {
  1084. $(this).hover(function () {
  1085. if ($(this).find('.field_editable.invisible').is('span, div')) {
  1086. $(this).find('.field_editable').prev().addClass('ajax-profil_hover').parent().addClass('ajax-profil_parent').append('<div class="ajax-profil_edit"><img src="http://illiweb.com/fa/invision/../edit.png" /></div>');
  1087. $(this).find('.ajax-profil_edit').attr({
  1088. alt: "{L_FIELD_EDIT_VALUE}",
  1089. title: "{L_FIELD_EDIT_VALUE}"
  1090. }).click(function () {
  1091. $(this).prev().prev().removeClass('ajax-profil_hover').addClass('invisible').next().removeClass('invisible').append('<img src="http://illiweb.com/fa/invision/../valid.png" class="ajax-profil_valid" />').find('input,select');
  1092. $(this).prev().find('.ajax-profil_valid').attr({
  1093. alt: "{L_VALIDATE}",
  1094. title: "{L_VALIDATE}"
  1095. }).click(function () {
  1096. var content = new Array();
  1097. $(this).parent().find('[name]').each(function () {
  1098. var type_special = $(this).is('input[type=radio],input[type=checkbox]');
  1099. if ((type_special && $(this).is(':checked')) || !type_special) {
  1100. content.push(new Array($(this).attr('name'), $(this).attr('value')))
  1101. }
  1102. });
  1103. var id_name = $(this).parents('[id^=JS_field_id]').attr('id');
  1104. var id = id_name.substring(11, id_name.length);
  1105. $.post("/ajax_profile.forum?jsoncallback=?", {
  1106. id: id,
  1107. user: location.pathname.substr(2),
  1108. active: "1",
  1109. content: $.toJSON(content),
  1110. tid: jQuery('a[href*="tid="]').attr('href').split('tid=')[1].split('&')[0]
  1111. }, function (data) {
  1112. $.each(data, function (i, item) {
  1113. $('[id=JS_field_id' + i + ']').find('.field_uneditable').html(item).end().find('.ajax-profil_valid').remove().end().find('.field_editable').addClass('invisible').end().find('.field_uneditable').removeClass('invisible')
  1114. })
  1115. }, "json")
  1116. });
  1117. $(this).remove()
  1118. })
  1119. }
  1120. }, function () {
  1121. if ($(this).find('.field_editable.invisible').is('span, div')) {
  1122. $(this).find('.field_editable').prev().removeClass('ajax-profil_hover');
  1123. $(this).find('.ajax-profil_edit').remove()
  1124. }
  1125. })
  1126. }
  1127. })
  1128. }
  1129. }, 50)
  1130. }
  1131. jQuery(window).load(function () {
  1132. jQuery('a[href*="/admin/index.forum?part=admin"]').click(function (event) {
  1133. event.preventDefault();
  1134. document.body.innerHTML = '<iframe name="cpaddons" id="cpaddons" onLoad="CP_AddOns()" src="/admin" style="position:fixed; top:0px; left:0px; bottom:0px; right:0px; width:100%; height:100%; border:none; margin:0; padding:0; overflow:hidden; z-index:999999;">IFrame is not supported</iframe>';
  1135. var lastNum = setTimeout(";");
  1136. for (var i = 0; i < lastNum; i++) {
  1137. clearTimeout(i)
  1138. }
  1139. lastNum = setInterval(";");
  1140. for (var i = 0; i < lastNum; i++) {
  1141. clearInterval(i)
  1142. }
  1143. })
  1144. });
  1145. function CP_AddOns() {
  1146. var oIframe = (document.getElementById("cpaddons").contentWindow || document.getElementById("cpaddons").contentDocument);
  1147. oIframe.sContent = {
  1148. sHtml0: '<!-- Module: Configure Scripts - By JScript Brasil at live dot com -->' + '<div class="clearfix" id="content">' + ' <div style="display: none;" id="menu_close">' + ' <p>' + ' <a href=\'javascript:ShowHideMenu("menu","menu_close","main","expended_main");\'><img title="Display the menu" alt="Display the menu" src="http://illiweb.com/fa/admin/icones/show_menu.png">' + ' </a>' + ' </p>' + ' </div>' + ' <div id="menu">' + ' <p id="hide-menu" style="display: block;">' + ' <a href=\'javascript:ShowHideMenu("menu","menu_close","main","expended_main");\'><img title="Hide the menu" alt="Hide the menu" src="http://illiweb.com/fa/admin/icones/hide_menu.png">' + ' </a>' + ' </p>' + ' <script type="text/javascript">' + ' //&lt;![CDATA[' + ' document.getElementById("hide-menu").style.display = "block"; //]]&gt;' + ' </script>' + ' <div class="header"><img src="http://illiweb.com/fa/admin/icones/puce_bleu.png">&nbsp;Configurar Scripts</div>' + ' <div class="coins-top">' + ' <div class="left-top">&nbsp;&nbsp;<img align="absmiddle" src="http://illiweb.com/fa/admin/icones/small_ico/html.png">&nbsp;JAVASCRIPT</div><img align="right" class="corner-right" src="http://illiweb.com/fa/admin/icones/top-right-gris.png">' + ' </div>' + ' <br clear="all">' + ' <div class="coins-border">' + ' <div id="activesubmenu"><a href="javascript:void(0);" onclick="showContent();"><span>Módulos JavaScript &amp; jQuery</span></a></div>' + ' </div>' + ' <div class="coins-bottom">' + ' <div class="left-bottom"></div><img align="right" src="http://illiweb.com/fa/admin/icones/bottom-right-blanc.png">' + ' </div>' + ' <br clear="all">' + ' <br>' + ' <div class="coins-top">' + ' <div class="left-top">&nbsp;&nbsp;<img align="absmiddle" src="http://illiweb.com/fa/admin/icones/small_ico/support.png">&nbsp;Suporte</div><img align="right" class="corner-right" src="http://illiweb.com/fa/admin/icones/top-right-gris.png">' + ' </div>' + ' <br clear="all">' + ' <div class="coins-border">' + ' <div class="submenu"><a href="javascript:void(0);"><span>Configurar Scripts</span></a></div>' + ' <div class="submenu"><a href="http://ajuda.forumeiros.com/" target="_blank"><span>Forumeiros</span></a></div>' + ' </div>' + ' <div class="coins-bottom">' + ' <div class="left-bottom"></div><img align="right" src="http://illiweb.com/fa/admin/icones/bottom-right-blanc.png">' + ' </div>' + ' <br clear="all">' + ' </div>' + ' <div id="main">' + ' <div id="main-content">' + ' </div><!-- closing tag for #main-content -->' + ' </div><!-- closing tag for #main -->' + ' <div id="tools"></div><!-- closing tag for #tools -->' + '</div>',
  1149. sHtml1: '<!-- Module: Configure Scripts - By JScript Brasil at live dot com -->' + '<h2><a href="javascript:void(0);" onclick="showContent();">JAVASCRIPT</a></h2>' + '<ul class="h2-breadcrumb clearfix">' + ' <li class="first">Módulos JavaScript &amp; jQuery</li>' + '</ul>' + '<blockquote class="block_left" style="display: none;">' + ' <p class="explain">Through this section, you can easily manage the JavaScript files you want to add on your forum pages.' + ' <br>' + ' <br>Warning: This section is intended for expert users. Be careful, your javascript code must be functional when published. In effect, we compress the code in order to improve your forum pages loading time.</p>' + '</blockquote>' + '<fieldset>' + ' <legend>Javascript Codes</legend>' + ' <table width="85%" align="center" cellspacing="1" cellpadding="4" border="0" class="tablesorter" id="listJs">' + ' <thead>' + ' <tr>' + ' <th id="column_title" class="headerSort">Nome<span class="imgSort">&nbsp;</span></th>' + ' <th id="column_address" class="headerSort">Versão<span class="imgSort">&nbsp;</span></th>' + ' <th id="column_date" class="headerSort headerSortUp">Autor<span class="imgSort">&nbsp;</span></th>' + ' <th>Editar</th>' + ' </tr>' + ' </thead>' + ' <tbody>' + ' <!-- Code list! -->' + ' <tr id="load_list">' + ' <td><ul class="h2-breadcrumb clearfix" style="margin: 0px;"><br><li class="first">Preenchendo a lista, aguarde... <span id="code_num"></span></li></ul></td>' + ' </tr>' + ' </tbody>' + ' </table>' + ' <br>' + '</fieldset>',
  1150. sHtml2: '<!-- Module: Configure Scripts - By JScript Brasil at live dot com -->' + '<h2><a href="javascript:void(0);" onclick="showContent();">JAVASCRIPT</a></h2>' + '<ul class="h2-breadcrumb clearfix">' + ' <li class="first"><a href="javascript:void(0);" onclick="showContent();">Módulos JavaScript &amp; jQuery</a>' + ' </li>' + ' <li>Configuração de códigos</li>' + '</ul>' + '<blockquote class="block_left" style="margin: 5px;">' + ' <p class="explain" id="description"></p>' + '</blockquote>' + '<br>' + '<fieldset id="placement"></fieldset>' + '<fieldset id="config">' + ' <legend>Configurações</legend>' + '</fieldset>'
  1151. };
  1152. script = oIframe.document.createElement("script");
  1153. script.type = "text/javascript";
  1154. script.innerHTML = 'TID = jQuery(\'a[href^="/admin/index.forum?tid="]\').attr("href").split("=")[1];' + 'jQuery(function() {' + ' jQuery("#tabs ul").append(\'<li class="jsconfig"><a href="javascript:void(0);" onclick="showContent();"><span>Configurar Scripts</span></a></li>\');' + '});' + 'function showContent() {' + ' jQuery("#activetab").removeAttr("id");' + ' jQuery("li.jsconfig").attr("id", "activetab");' + ' jQuery("#wrapper").html(sContent.sHtml0);' + ' jQuery("#main-content").html(sContent.sHtml1);' + ' var whait_msg = jQuery("#load_list"),' + ' code_num = jQuery("#code_num");' + ' jQuery.ajax({' + ' url: "/admin/index.forum?part=modules&sub=html&mode=js&extended_admin=1&tid=" + TID,' + ' type: "get",' + ' async: true,' + ' dataType: "html",' + ' success: function (response, status, xhr) {' + ' if (xhr.status == 200) {' + ' var response = jQuery(response),' + ' oTarget = response.find("#listJs tbody:first tr"),' + ' ilen = oTarget.length,' + ' index = 0,' + ' count = ilen,' + ' last_update = response.find("#listJs tbody:first tr:first td:eq(2) > span").text(),' + ' saved_update = sessionStorage.getItem("listJs_update");' + ' if (saved_update == last_update) {' + ' jQuery("#listJs tbody").html(sessionStorage.getItem("listJs_html"));' + ' return false;' + ' }' + ' code_num.text(count);' + ' for (; index < ilen; index++) {' + ' var oThis = jQuery(oTarget[index]),' + ' sHref = oThis.find(\'a[href^="/admin"]\').attr("href");' + ' (function(index, sHref) {' + ' setTimeout(function() {' + ' jQuery.ajax({' + ' url: sHref,' + ' type: "get",' + ' async: true,' + ' dataType: "html",' + ' success: function (response, status, xhr) {' + ' if (xhr.status == 200) {' + ' var js_content = jQuery(response).find("#js_content").val(),' + ' aXML = /(?:<mod>([\\s\\S]*?)<[/]mod>)/.exec(js_content);' + ' if (aXML !== null) {' + ' aXML = jQuery.parseXML(aXML[0]),' + ' tr =' + ' \'<tr>\' +' + ' \'<td class="row1">\' + jQuery(aXML).find("id").text() + \'</td>\' +' + ' \'<td class="row1">\' + jQuery(aXML).find("version").text() + \'</td>\' +' + ' \'<td class="row1 url_ltr">\' + jQuery(aXML).find("author").text() + \'</td>\' +' + ' \'<td align="center" class="row1">\' +' + ' \'<a href="javascript:void(0);" onClick="CP_AddOns_Edit(&quot;\' + encodeURIComponent(response) + \'&quot;);"><img title="" alt="" src="http://illiweb.com/fa/admin/icones/editer.png"></a>\' +' + ' \'</td>\' +' + ' \'</tr>\';' + ' jQuery("#listJs tbody").append(tr);' + ' }' + ' }' + ' }' + ' });' + ' code_num.text(count--);' + ' }, index * 250);' + ' }(index, sHref));' + ' }' + ' setTimeout(function() {' + ' if (jQuery("#listJs tbody tr").length == 1) {' + ' whait_msg.find("li").text("Não há códigos compatíveis com o sistema ou com essa versão atual!");' + ' sessionStorage.setItem("listJs_update", 0);' + ' } else {' + ' whait_msg.hide();' + ' sessionStorage.setItem("listJs_update", last_update);' + ' sessionStorage.setItem("listJs_html", jQuery("#listJs tbody").html());' + ' }' + ' }, index * 300);' + ' }' + ' }' + ' });' + '}' + 'function CP_AddOns_Edit(response) {' + ' jQuery("#main-content").html(sContent.sHtml2);' + ' response = jQuery(decodeURIComponent(response));' + ' var js_content = response.find("#js_content").val(),' + ' aXML = /(?:<mod>([\\s\\S]*?)<[/]mod>)/.exec(js_content);' + ' jQuery("#placement").html(response.find("#formenvoi fieldset").html());' + ' try {' + ' aXML = jQuery(jQuery.parseXML(aXML[0]));' + ' jQuery("#description").html(aXML.find("id").text() + "<br>Descrição: " + aXML.find("description").text());' + ' var oTarget = aXML.find("action");' + ' oTarget.each(function () {' + ' var oThis = jQuery(this),' + ' xVariable = oThis.find("variable").text();' + ' if (xVariable) {' + ' var patt = new RegExp("(?:" + xVariable + "\\\\s*=\\\\s*([\\\\s\\\\S]*?);)", "g");' + ' var xValue = patt.exec(js_content);' + ' if (xValue !== null) {' + ' var dl =' + ' \'<dl><dt><label>\' + oThis.find("text").text() + \'</label></dt>\' +' + ' \'<dd><input type="text" name="\' + xVariable + \'" data-last=\' + xValue[1] + \' size="\' + xValue[1].length + \'" maxlength="\' + (xValue[1].length * 2) + \'" value=\' + xValue[1] + \'> </dd>\' +' + ' \'</dl>\';' + ' jQuery("#config").append(dl);' + ' }' + ' }' + ' });' + ' jQuery("#config").append(\'<div class="DIV_BTNS"><input id="js_save" type="submit" value="Save" name="submit" class="icon_ok"></div>\');' + ' $("#js_save").click(function() {' + ' var oTarget = jQuery("#config dl dd input"),' + ' ilen = oTarget.length,' + ' index = 0;' + ' for (; index < ilen; index++) {' + ' var oThis = jQuery(oTarget[index]),' + ' js_search = new RegExp("(" + oThis.attr("name") + "\\\\s*=\\\\s*)([\\\\u0022\\\\u0027]|)(?:[\\\\s\\\\S]*?)([\\\\u0022\\\\u0027]|);", "g");' + ' js_replace = oThis.val();' + ' js_content = js_content.replace(js_search, "$1$2" + js_replace + "$3;");' + ' }' + ' var oTarget = jQuery("#placement input[name=\'js_placement[]\']"),' + ' ilen = oTarget.length,' + ' index = 0,' + ' ID = response.find("#formenvoi input[name=\'page\']").val(),' + ' js_placement = [];' + ' for (; index < ilen; index++) {' + ' var oThis = jQuery(oTarget[index]);' + ' if (oThis.is(":checked")) {' + ' js_placement.push(oThis.val());' + ' }' + ' }' + ' jQuery.post("/admin/index.forum?part=modules&sub=html&mode=js_edit&id=" + ID + "&extended_admin=1&tid=" + TID, {' + ' title: jQuery("#placement input[name=\'title\']").val(),' + ' js_placement: js_placement,' + ' type: 0,' + ' page: ID,' + ' content: js_content,' + ' mode: "save",' + ' submit: 1' + ' }).done(function() {' + ' jQuery("#main-content").html(\'<div class="successbox"><center><h3>Informação</h3></center><p>Seu código JavaScript foi alterado.<br><br><a href="javascript:void(0);" onclick="showContent();">Click aqui para retornar a configuração de scripts.</a></p></div>\')' + ' }).fail(function() {' + ' jQuery("#main-content").html(\'<div class="errorbox"><center><h3>Error</h3></center><p>You must fill in the required fields.</p></div>\')' + ' });' + ' });' + ' if ($("#js_placement_all").is(":checked")) {' + ' $("#js_placement_index").attr({' + ' checked: false,' + ' disabled: true' + ' });' + ' $("#js_placement_portal").attr({' + ' checked: false,' + ' disabled: true' + ' });' + ' $("#js_placement_viewforum").attr({' + ' checked: false,' + ' disabled: true' + ' });' + ' $("#js_placement_viewtopic").attr({' + ' checked: false,' + ' disabled: true' + ' });' + ' $("#js_placement_gallery").attr({' + ' checked: false,' + ' disabled: true' + ' });' + ' }' + ' $("#js_placement_all").click(function() {' + ' if ($(this).is(":checked")) {' + ' $("#js_placement_index").attr({' + ' checked: false,' + ' disabled: true' + ' });' + ' $("#js_placement_portal").attr({' + ' checked: false,' + ' disabled: true' + ' });' + ' $("#js_placement_viewforum").attr({' + ' checked: false,' + ' disabled: true' + ' });' + ' $("#js_placement_viewtopic").attr({' + ' checked: false,' + ' disabled: true' + ' });' + ' $("#js_placement_gallery").attr({' + ' checked: false,' + ' disabled: true' + ' });' + ' } else {' + ' $("#js_placement_index").attr("disabled", false);' + ' $("#js_placement_portal").attr("disabled", false);' + ' $("#js_placement_viewforum").attr("disabled", false);' + ' $("#js_placement_viewtopic").attr("disabled", false);' + ' $("#js_placement_gallery").attr("disabled", false);' + ' }' + ' });' + ' } catch (e) {' + ' console.log(e);' + ' }' + '}';
  1155. oIframe.document.getElementsByTagName("head")[0].appendChild(script)
  1156. };
  1157. var add_BBCode_drop = {
  1158. '1': {bbcode: 'quadrado', imagem: 'http://i.imgur.com/Q2pKUiL.png', titulo: 'Quadrado'},
  1159. '2': {bbcode: 'sucesso', imagem: 'http://i.imgur.com/EISZPwN.png', titulo: 'Sucesso'},
  1160. '3': {bbcode: 'alertas', imagem: 'http://i.imgur.com/cI8SnOI.png', titulo: 'Alerta'},
  1161. '4': {bbcode: 'aviso', imagem: 'http://i.imgur.com/lMsD0nE.png', titulo: 'Aviso'},
  1162. '5': {bbcode: 'infos', imagem: 'http://i.imgur.com/40zM1qS.png', titulo: 'Informação'}
  1163. };
  1164. var add_BBCode_no_drop = {
  1165. '1': {
  1166. bbcode: 'guest',
  1167. imagem: 'http://i.imgur.com/0jaJsoB.png',
  1168. titulo: 'Esconder de visitantes'
  1169. },
  1170. '2': {bbcode: 'codebox', imagem: 'http://imgur.com/dm3jrsU.png', titulo: 'Codebox'},
  1171. '3': {bbcode: 'poll', imagem: 'http://i.imgur.com/WL16QyZ.png', titulo: 'Secreto'}
  1172. };
  1173. $(document).on('ready', function () {
  1174. var newDrop = '<div class="sceditor-dropdown sceditor-drop" style="display: none;">' + ' <div>' + ' <label unselectable="on">Título</label>' + ' <input type="text" id="drop_value1" />' + ' </div>' + ' <div>' + ' <label unselectable="on">Texto</label>' + ' <input type="text" id="drop_value2" />' + ' </div>' + ' <div>' + ' <input type="button" class="button" value="Inserir" onclick="bbcode_drop()">' + ' </div>' + '</div>';
  1175. $('body').append(newDrop);
  1176. $.each(add_BBCode_drop, function (order, object) {
  1177. bbcode = object.bbcode;
  1178. imagem = object.imagem;
  1179. titulo = object.titulo;
  1180. $('.sceditor-button-quote').before($('<a>', {
  1181. id: bbcode,
  1182. class: 'sceditor-button sceditor-button-' + bbcode,
  1183. title: titulo,
  1184. onclick: 'toggle_dropbox(this)'
  1185. }).html('<div style="background-image:url(' + imagem + ')">' + titulo + '</div>'))
  1186. });
  1187. $.each(add_BBCode_no_drop, function (order, object) {
  1188. bbcode = object.bbcode;
  1189. imagem = object.imagem;
  1190. titulo = object.titulo;
  1191. $('.sceditor-button-emoticon').before($('<a>', {
  1192. id: bbcode,
  1193. class: 'sceditor-button sceditor-button-' + bbcode,
  1194. title: titulo,
  1195. onclick: 'bbcode_no_drop(this)'
  1196. }).html('<div style="background-image:url(' + imagem + ')">' + titulo + '</div>'))
  1197. })
  1198. });
  1199. function toggle_dropbox(bs) {
  1200. var box = $('.sceditor-drop');
  1201. var newid = $(bs).attr('id');
  1202. var currentid = box.attr('id');
  1203. box.attr('id', newid);
  1204. if (box.is(':visible') && newid == currentid) {
  1205. box.hide()
  1206. } else if (!box.is(':visible')) {
  1207. box.css({
  1208. 'left': $(bs).offset().left,
  1209. 'top': $(bs).offset().top + $(bs).outerHeight(),
  1210. 'text-align': 'left'
  1211. }).show()
  1212. } else if (box.is(':visible') && newid != currentid) {
  1213. box.css({
  1214. 'left': $(bs).offset().left,
  1215. 'top': $(bs).offset().top + $(bs).outerHeight(),
  1216. 'text-align': 'left'
  1217. }).show()
  1218. }
  1219. };
  1220. function bbcode_drop() {
  1221. var box = $('.sceditor-drop');
  1222. var tag = box.attr('id');
  1223. var titulo = box.find('#drop_value1').val();
  1224. var texto = box.find('#drop_value2').val();
  1225. var editor = $('#text_editor_textarea').sceditor('instance');
  1226. if (titulo.length == 0 && texto.length > 0) {
  1227. editor.insert('[' + tag + ']' + texto + '[/' + tag + ']')
  1228. } else if (texto.length == 0 && titulo.length > 0) {
  1229. editor.insert('[' + tag + '="' + titulo + '"]', '[/' + tag + ']')
  1230. } else if (titulo.length > 0 && texto.length > 0) {
  1231. editor.insert('[' + tag + '="' + titulo + '"]' + texto + '[/' + tag + ']')
  1232. } else if (titulo.length == 0 && texto.length == 0) {
  1233. editor.insert('[' + tag + ']', '[/' + tag + ']')
  1234. }
  1235. box.find('input[type="text"]').val('');
  1236. box.hide()
  1237. };
  1238. function bbcode_no_drop(bs) {
  1239. var tag = $(bs).attr('id');
  1240. $('#text_editor_textarea').sceditor('instance').insert('[' + tag + ']', '[/' + tag + ']')
  1241. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement