[Tens de ter uma conta e sessão iniciada para poderes visualizar este link] vamos tentar de outra forma...
Apague todos os JS de antes... e adicione os seguintes...
- Código:
jQuery(document).ready(function($) {
var bbCodes = {
sucesso: {
replacement: '<div class="alert sucesso"><p style="font-weight: 800;font-variant: small-caps;font-size: 14px;">{ATTR}</p>{CONTENT}</div>'
},
aviso: {
replacement: '<div class="alert"><p style="font-weight: 800;font-variant: small-caps;font-size: 14px;">{ATTR}</p>{CONTENT}</div>'
},
informacao: {
replacement: '<div class="alert infos"><p style="font-weight: 800;font-variant: small-caps;font-size: 14px;">{ATTR}</p>{CONTENT}</div>'
},
alerta: {
replacement: '<div class="alert danger"><p style="font-weight: 800;font-variant: small-caps;font-size: 14px;">{ATTR}</p>{CONTENT}</div>'
}
};
var p = $(".postbody , .blog_message");
for (var i = 0, e; (e = p[i++]) ; ) {
var entry = $(e);
$.each(bbCodes, function(tag, value) {
var re = new RegExp("\\[" + tag + "(?:=(\"|'?)([^\\]]+)\\1)?\\]([\\s\\S]*?)\\[/" + tag + "]","gi")
, match = entry.text().match(re);
if (match) {
for (var tag in match) {
var content = match[tag]
, b = "$3";
if (value.replace && value.replace(content)) {
b = value.replace(content)
}
replacement = value.replacement.replace(/{ATTR}/g, "$2").replace(/{CONTENT}/g, b);
var c = content.replace(re, replacement);
entry.html(entry.html().replace(content, c))
}
}
})
}
});
toolbar = toolbar.replace(/quote/, 'cmd,quote');
$('head').append('<style type="text/css">' + '.sceditor-button-cmd div {' + ' background:url(https://cdn2.iconfinder.com/data/icons/snipicons/500/th-list-16.png) !important}' + ' .sceditor-cmd {' + ' width:auto;' + ' height:auto;' + ' overflow-y:auto;' + '}' + '.sceditor-cmd select {' + ' margin: 0 0 .75em;' + '}' + '</style>')
});
E:
- Código:
$(document).ready(function() {
var entry = $('.post .postbody, .blog_message');
entry.html(function() {
return $(this).html().replace(/\[poll](.*?)\[\/poll\]/g, '<div class="vote_to_see">$1</div>')
});
var like_post_msg = 'Por favor, curta esta postagem para ter acesso ao conteúdo completo desta mensagem.';
for (var x = entry, i = 0, e; (e = x[i++]) ; ) {
if (_userdata.user_level < 1)
if (document.location.pathname.indexOf('/spa') >= 0 && $(e).parents('.post').find('.author a, .name, .user a[href^="/u"]').text() != _userdata.username || $('.vote-button', e).length)
$('.secret_code', e).html(like_post_msg)
}
});
(function() {
var f = {
bbcodes: {},
basics: [],
attrReg: /.*?=("|'|)(.*?)\1\]/,
parseTag: function(a, b, d) {
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) {
d || (c = a);
c = f.attrReg.test(c) ? c.replace(f.attrReg, "$2") : b.defaultAttr;
if (b.validate && !(d ? b.validate(e, c) : b.validate(c)))
return a;
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));
return f.swapReplacers(b.replacement, e, c)
})
},
swapReplacers: function(a, b, d) {
return (a || "").replace(/{CONTENT}/g, b || "").replace(/{ATTR}/g, d || "")
},
parse: function(a) {
for (var b = f.bbcodes, d = f.basics, g = 0, c; c = d[g++]; ) {
var e = c[0];
if ("string" === typeof e)
for (; -1 !== a.indexOf(e); )
a = a.replace(e, c[1]);
else
a = a.replace(e, c[1])
}
for (var h in b)
(d = b[h]) && (d.replacement && d.tag) && (a = f.parseTag(a, d, d.close));
return a
},
add: function(a, b) {
if (!/^\w+$/.test(a))
throw new Exception("MBB Tag invalida: " + a);
b.tag || (b.tag = a);
"close" in b || (b.close = !1);
f.bbcodes[a] = b
},
addSwap: function(a, b) {
f.basics.push([a, b])
}
};
window.MBB = f
})();
$(function() {
var p = $('.post .entry-content , .blog_message');
for (var i = 0, e; (e = p[i++]) ; ) {
var text = e.innerHTML;
text = MBB.parse(text);
e.innerHTML = text
}
});
MBB.add('offtopic', {
close: true,
replacement: '<div style="padding: 3px; float: right; border: 1px solid; font-size: 0.8em">Off Topic: {CONTENT}</div>'
});
MBB.add('sucesso', {
close: true,
replacement: '<div class="alert sucesso"><strong>{ATTR}</strong> {CONTENT}</div>'
});
MBB.add('aviso', {
close: true,
replacement: '<div class="alert danger"><strong>{ATTR}</strong> {CONTENT}</div>'
});
MBB.add('infos', {
close: true,
replacement: '<div class="alert infos"><strong>{ATTR}</strong> {CONTENT}</div>'
});
MBB.add('alerta', {
close: true,
replacement: '<div class="alert"><strong>{ATTR}</strong> {CONTENT}</div>'
});
MBB.add('codebox', {
close: true,
replacement: '<codebox><code>{CONTENT}</code></codebox>'
});
MBB.add('twitter', {
close: true,
replacement: '@<a href="http://www.twitter.com/{CONTENT}">{CONTENT}</a>'
});
MBB.add('quadrado', {
close: true,
replacement: '<div class="quadrado_box"><strong>{ATTR}</strong><br><img src="http://i50.tinypic.com/2lxicrn.png" title="XXXXXX" /><br>{CONTENT}</div>'
});
MBB.add('guest', {
close: true,
replacement: '<span class="guest">{CONTENT}</span>',
replace: function(content) {
if (!document.getElementById('logout'))
return 'Você vai ser capaz de ver o conteúdo assim que efetuar o seu registro no fórum. ';
return content
}
});
function enviar() {
var daemon = $('a[href^="/post?t="]').first().attr('href');
var status = $('#status').val();
var motivo = $('#motivo').val();
if (status.length != 0 && motivo.length != 0) {
msg = status + '\n' + motivo
} else if (status.length != 0) {
msg = status
} else if (motivo.length != 0) {
msg = motivo
}
$.post(daemon, {
'message': msg,
'post': '1',
'attach_sig': '1'
}, function(e) {
location.href = $(e).find('a[href^="/viewtopic"]').attr('href')
})
}
;$(document).on('ready', function() {
if (!$.sceditor)
return;
var add_BBCode = {
'quadrado': {
drop: 1,
imagem: 'http://i.imgur.com/Q2pKUiL.png',
titulo: 'Quadrado'
},
'sucesso': {
drop: 1,
imagem: 'http://i.imgur.com/EISZPwN.png',
titulo: 'Sucesso'
},
'alerta': {
drop: 1,
imagem: 'http://i.imgur.com/cI8SnOI.png',
titulo: 'Alerta'
},
'aviso': {
drop: 1,
imagem: 'http://i.imgur.com/lMsD0nE.png',
titulo: 'Aviso'
},
'infos': {
drop: 1,
imagem: 'http://i.imgur.com/40zM1qS.png',
titulo: 'Informação'
},
'guest': {
drop: 0,
imagem: 'http://i.imgur.com/0jaJsoB.png',
titulo: 'Esconder de visitantes'
},
'codebox': {
drop: 0,
imagem: 'http://imgur.com/dm3jrsU.png',
titulo: 'Codebox'
},
'poll': {
drop: 0,
imagem: 'http://i.imgur.com/WL16QyZ.png',
titulo: 'Secreto'
}
};
var newDrop = '<div class="sceditor-dropdown sceditor-drop" style="display: none;">' + ' <div>' + ' <label unselectable="on">Título</label>' + ' <input type="text" id="drop_valTitle" />' + ' </div>' + ' <div>' + ' <label unselectable="on">Texto</label>' + ' <input type="text" id="drop_valContent" />' + ' </div>' + ' <div>' + ' <input type="button" class="button" value="Inserir" onclick="addBBCode_drop()">' + ' </div>' + '</div>';
$('body').append(newDrop);
$.each(add_BBCode, function(key, val) {
bbcode = key;
imagem = val.imagem;
titulo = val.titulo;
drop = val.drop;
if (drop == 0) {
func = 'addBBCode_noDrop(this)'
} else if (drop == 1) {
func = 'toggleDropbox(this)'
}
$('.sceditor-button-quote').before($('<a>', {
id: bbcode,
class: 'sceditor-button sceditor-button-' + bbcode,
title: titulo,
onclick: func
}).html('<div style="background-image:url(' + imagem + ')">' + titulo + '</div>'))
})
});
function toggleDropbox(bs) {
var box = $('.sceditor-drop');
var newId = $(bs).attr('id');
var currentId = box.attr('id');
box.attr('id', newId);
if (box.is(':visible') && newId == currentId) {
box.hide()
} else if (!box.is(':visible')) {
box.css({
'left': $(bs).offset().left,
'top': $(bs).offset().top + $(bs).outerHeight(),
'text-align': 'left'
}).show()
} else if (box.is(':visible') && newId != currentId) {
box.css({
'left': $(bs).offset().left,
'top': $(bs).offset().top + $(bs).outerHeight(),
'text-align': 'left'
}).show()
}
}
;function addBBCode_drop() {
var box = $('.sceditor-drop');
var tag = box.attr('id');
var titulo = box.find('#drop_valTitle').val();
var texto = box.find('#drop_valContent').val();
var editor = $('#text_editor_textarea').sceditor('instance');
if (titulo.length == 0 && texto.length > 0) {
editor.insert('[' + tag + ']' + texto + '[/' + tag + ']')
} else if (texto.length == 0 && titulo.length > 0) {
editor.insert('[' + tag + '="' + titulo + '"]', '[/' + tag + ']')
} else if (titulo.length > 0 && texto.length > 0) {
editor.insert('[' + tag + '="' + titulo + '"]' + texto + '[/' + tag + ']')
} else if (titulo.length == 0 && texto.length == 0) {
editor.insert('[' + tag + ']', '[/' + tag + ']')
}
box.find('input[type="text"]').val('');
box.hide()
}
;function addBBCode_noDrop(bs) {
var tag = $(bs).attr('id');
$('#text_editor_textarea').sceditor('instance').insert('[' + tag + ']', '[/' + tag + ']')
};
Ambos com investimento nos tópicos.
Dessa forma irá funcionar.
Até mais.