Ações de moderação em dropdown
3 participantes
Fórum dos Fóruns :: Ajuda e atendimento ao utilizador :: Questões sobre códigos :: Questões resolvidas sobre códigos Javascript e jQuery
Página 1 de 1 • Compartilhe
Ações de moderação em dropdown
Detalhes da questão
Endereço do fórum: https://yahforum.forumeiros.com
Versão do fórum: Invision
Descrição
Olá, boa noite!
Então, quando eu adiciono este código (tópico do código) a Engrenagem fica totalmente (invisivel) veja: https://imgur.com/a/9TbCHNj
E na conta de um moderador não aparece nada do print mostrado acima. veja: https://i.imgur.com/5OBgi1J.png
Se puder, nesse fundo branco que aparece, deixar ele verde ou vermelho, https://imgur.com/jDXnN6h
Re: Ações de moderação em dropdown
Não está invisível, mas a coloração das letras está bem fraca, o dropbox só vai aparecer a membros com administração no fórum. Coloque esse javascript no lugar do outro e vamos ver se trouxeram resultados:
- Código:
/***
* Application: Actions of moderation.
* Description: This application shows a shortcut menu for the moderation in the list of topics.
* Version: 1.03182014-jq1.9.1 - (Dodekatheon / 2) + (Hermes = Zeus + Maia)
* Made and Optimizations by JScript - 2014/03/18
* View more in: http://ajuda.forumeiros.com
* Copyright (c) 2013 JScript <jscriptbrasil at live dot com>
* This work is free. You can redistribute it and/or modify it
* under the terms of the WTFPL, Version 2
*/
/***
* System Defined Variables - Do not edit if you don't know!
***/
var oMTConfig = {
sInfo: '<!--' +
'* Application: Actions of moderation.' +
'* Description: This application shows a shortcut menu for the moderation in the list of topics.' +
'* Version: 1.03182014-jq1.9.1 - (Dodekatheon / 2) + (Hermes = Zeus + Maia)' +
'* Made and Optimizations by JScript - 2014/03/18' +
'* View more in: http://punbb.forumeiros.com/forum & http://ajuda.forumeiros.com' +
'* Copyright (c) 2014 JScript <jscriptbrasil at live dot com>' +
'* This work is free. You can redistribute it and/or modify it' +
'* under the terms of the WTFPL, Version 2' +
'-->',
sErrorMsg: '',
oTopicTitle: {},
sTopicHref: '',
iTopicID: 0,
sTopicTitle: '',
sContent: '<a title="Ações da Moderação" class="ipsModMenu" href="#"> </a>',
sMenu: '<ul style="display: none; position: absolute; z-index: 9999;" class="ipbmenu_content" id="topic_mod_menucontent">' +
'<li style="z-index: 10000;"><a title="Renomear tópico" href="" id="t_rename" onclick="_rename_Topic();return false;" style="z-index: 10000;">Renomear tópico</a></li>' +
//'<li style="z-index: 10000;"><a title="Destacar tópico" href="" id="t_pin" style="z-index: 10000;">Destacar tópico</a></li>' +
//'<li style="z-index: 10000;"><a title="Mudar ícone" href="" id="t_icon" style="z-index: 10000;">Mudar ícone</a></li>' +
'<li style="z-index: 10000;"><a title="Fechar tópico" href="" id="t_lock" style="z-index: 10000;">Fechar tópico</a></li>' +
'<li style="z-index: 10000;"><a title="Mover tópico" href="" id="t_move" style="z-index: 10000;">Mover tópico</a></li>' +
'<li style="z-index: 10000;"><a title="Enviar para lixeira" href="" id="t_hide" style="z-index: 10000;">Reciclar (Ocultar)</a></li>' +
'<li style="z-index: 10000;"><a title="Excluir tópico" href="" id="t_delete" style="z-index: 10000;">Excluir tópico</a></li>' +
'</ul>',
sCSS: '<style>' +
/*'#rename-topic {' +
'display: block;' +
'}' +*/
'.statused tr:hover > .tcr .ipsModMenu, ' +
'.forumline tr td:hover > .postdetails .ipsModMenu, ' +
'ul.topiclist.topics.bg_none dl.icon:hover > .lastpost .ipsModMenu, ' +
'table.ipbtable tbody tr:hover > td.row1.lastaction .ipsModMenu{' +
'visibility: visible;' +
'}' +
'.ipsModMenu {' +
'background: url("http://i55.servimg.com/u/f55/18/17/62/92/modera10.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);' +
'display: inline-block;' +
'height: 15px;' +
'margin: 0 8px;' +
'text-indent: -2000em;' +
'vertical-align: middle;' +
'width: 15px;' +
'float: right;' +
'visibility: hidden;' +
/*'margin-top: -6px;' +*/
'}' +
'.ipbmenu_content {' +
'font-size: 12px;' +
'min-width: 85px;' +
'z-index: 2000;' +
'color: black' +
'}' +
'.ipbmenu_content {' +
'background-color: #F7F9FB;' +
'border: 1px solid #D5DDE5;' +
'box-shadow: 0 6px 6px rgba(0, 0, 0, 0.3);' +
'}' +
'.ipbmenu_content li:first-child {' +
'padding-top: 0;' +
'}' +
'.ipbmenu_content li {' +
'border-bottom: 1px solid #D5DDE5;' +
'}' +
'.ipbmenu_content a {' +
'display: block;' +
'padding: 6px 10px;' +
'text-align: left;' +
'text-decoration: none;' +
'}' +
'.ipbmenu_content a:hover {' +
'background: none repeat scroll 0 0 #D5DDE5;' +
'}' +
'.cancel {' +
'font-size: 0.9em;' +
'font-weight: bold;' +
'color: black' +
'}' +
'.input_text {' +
'background: none repeat scroll 0 0 #FFFFFF !important;' +
'border-color: #848484 #C1C1C1 #E1E1E1 !important;' +
'border-radius: 2px 2px 2px 2px !important;' +
'border-style: solid !important;' +
'border-width: 1px !important;' +
'padding: 4px !important;' +
'font: 13px helvetica,arial,sans-serif !important;' +
'color: black' +
'}' +
'#rename-topic .button2 {' +
/*'border-color: #212121;' +
'border-radius: 3px 3px 3px 3px;' +
'box-shadow: 0 1px 0 0 #5C5C5C inset, 0 2px 3px rgba(0, 0, 0, 0.2);' +
'border-style: solid;' +
'border-width: 1px;' +*/
'cursor: pointer;' +
'padding: 4px 10px !important;' +
'min-width: 0 !important;' +
'font: 13px helvetica,arial,sans-serif !important;' +
'color: black' +
'}' +
'.input_text:focus {' +
'border-color: #4E4E4E #7C7C7C #A3A3A3;' +
'box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);' +
'}' +
'#ipsGlobalNotification {' +
'font-weight: bold;' +
'left: 50%;' +
'margin-left: -250px;' +
'position: fixed;' +
'text-align: center;' +
'top: 20px;' +
'z-index: 10000;' +
'color: black' +
'}' +
'.popupWrapper {' +
'background-color: rgba(70, 70, 70, 0.6);' +
'border-radius: 4px 4px 4px 4px;' +
'box-shadow: 0 12px 25px rgba(0, 0, 0, 0.7);' +
'padding: 4px;' +
'}' +
'.popupInner {' +
'background: none repeat scroll 0 0 #FFFFFF;' +
'box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);' +
'overflow-x: hidden;' +
'overflow-y: auto;' +
'width: 500px;' +
'}' +
'.ipsPad {' +
'padding: 9px;' +
'}' +
'</style>',
sTarget: '',
sSearch: '',
sExpression0: '',
sExpression1: ''
};
/***
* User Definition Variables
***/
oMTConfig.sErrorMsg = 'Atenção!\n\n Ocorreu um erro ao editar o título, aguarde 10 segundos e tente novamente!';
oMTConfig.sSavingMsg = 'Atualizando o título do tópico, aguarde...';
oMTConfig.sDoneMsg = 'O título do tópico foi atualizado!';
jQuery(function() {
if (_userdata.user_level >= 1) {
/* Forum versions! */
var phpBB2 = jQuery('.bodyline');
var phpBB3 = jQuery('#phpbb');
var punbb = jQuery('#pun-intro');
var invision = jQuery('#ipbwrapper');
if (phpBB2.length) {
oMTConfig.sTarget = '.forumline td.row3Right span.postdetails';
oMTConfig.sExpression0 = 'oClicked.parent().parent().parent().find("td a.topictitle");';
oMTConfig.sExpression1 = 'jQuery("#page-body .forumline .postbody:first", data).parents("tr:eq(1)").attr("id").split("p")[1];'
} else if (phpBB3.length) {
oMTConfig.sTarget = 'ul.topiclist.bg_none dd.lastpost div[style="float:left;"] span';
oMTConfig.sExpression0 = 'oClicked.parent().parents("dl.icon").find("dd.dterm a.topictitle");';
oMTConfig.sExpression1 = 'jQuery("#main-content .post:first", data).attr("id").split("p")[1];';
} else if (punbb.length) {
oMTConfig.sTarget = '.statused td.tcr';
oMTConfig.sExpression0 = 'oClicked.parents("tr").find(".tcl.tdtopics a.topictitle");';
oMTConfig.sExpression1 = 'jQuery(".posthead:first", data).attr("id").split("p")[1];';
} else if (invision.length) {
oMTConfig.sTarget = 'table.ipbtable tbody td.row1.lastaction';
oMTConfig.sExpression0 = 'oClicked.parents("tr").find("td a.topictitle");';
oMTConfig.sExpression1 = 'jQuery("#main-content .borderwrap .post:first", data).attr("id").split("p")[1];';
};
jQuery(oMTConfig.sCSS).insertBefore('body');
jQuery('body').append(oMTConfig.sInfo + oMTConfig.sMenu);
jQuery(oMTConfig.sTarget).append(oMTConfig.sInfo + oMTConfig.sContent);
jQuery('a.ipsModMenu').click(function() {
var oClicked = jQuery(this);
var oTarget = jQuery('#topic_mod_menucontent');
if (oTarget[0].style.display == 'none') {
oClicked.addClass('menu_active');
oMTConfig.oTopicTitle = eval(oMTConfig.sExpression0);
oMTConfig.sTopicHref = oMTConfig.oTopicTitle.attr('href');
oMTConfig.iTopicID = oMTConfig.sTopicHref.substring(2, oMTConfig.sTopicHref.indexOf("-")); // .split(/[\/t-]/)[2]; <- More fast???
oMTConfig.sTopicTitle = oMTConfig.oTopicTitle.text();
var TID = jQuery('input[name="tid"]').val();
jQuery('#t_lock').attr('href', '/modcp?mode=lock&t=' + oMTConfig.iTopicID + '&tid=' + TID);
jQuery('#t_move').attr('href', '/modcp?mode=move&t=' + oMTConfig.iTopicID + '&tid=' + TID);
jQuery('#t_hide').attr('href', '/modcp?mode=trash&t=' + oMTConfig.iTopicID + '&tid=' + TID);
jQuery('#t_delete').attr('href', '/modcp?mode=delete&t=' + oMTConfig.iTopicID + '&tid=' + TID);
oTarget
.css({
'left': (oClicked.offset().left + oClicked.outerWidth()) - oTarget.outerWidth(),
'top': oClicked.offset().top + oClicked.outerHeight()
})
.fadeIn(400);
jQuery(document).mousedown(function() {
if (!oTarget.is(":hover")) {
jQuery(document).unbind('mousedown');
oClicked.removeClass('menu_active');
oTarget.fadeOut(400);
}
});
} else {
oClicked.removeClass('menu_active');
oTarget.fadeOut(400);
}
return false;
});
}
});
function _rename_Topic() {
oMTConfig.oTopicTitle.hide();
var sHtml =
'<span id="rename-topic">' +
'<input type="text" maxlength="150" size="50" class="input_text" value="' + oMTConfig.sTopicTitle + '" id="rt_input" style="width: 56%; margin-right: 4px;">' +
'<input type="submit" id="rt_submit" class="button2" value="Atualizar" onclick="_rt_commit()" style="margin-right: 4px;">' +
'<a title="Cancelar" class="cancel" id="rt_cancel" href="#" onclick="jQuery(\'#rename-topic\').remove();oMTConfig.oTopicTitle.show();return false;">Cancelar</a>' +
'</span>';
oMTConfig.oTopicTitle.before(sHtml);
jQuery('#rt_input').keydown(function(e) {
if (e.keyCode == 13 && jQuery('#rt_input').val() !== '') {
_rt_commit();
}
});
}
function _rt_commit() {
var iPostID = 0,
user_Msg = '';
var sNewTitle = jQuery('#rt_input').val();
if (sNewTitle == '') return false;
jQuery('body').append('<div id="ipsGlobalNotification"><div class="popupWrapper"><div class="popupInner"><div class="ipsPad">' + oMTConfig.sSavingMsg + '</div></div></div></div>');
jQuery('#rename-topic').css('opacity', '0.4');
jQuery.get(oMTConfig.sTopicHref, function(data) {
iPostID = eval(oMTConfig.sExpression1);
}).done(function() {
jQuery.get("/post?p=" + iPostID + "&mode=editpost", function(data) {
user_Msg = jQuery(data).find('#text_editor_textarea[name="message"]').val();
}).done(function() {
jQuery.post("/post?p=" + iPostID + "&mode=editpost", {
subject: sNewTitle,
message: user_Msg,
edit_reason: 'Título anterior: ' + oMTConfig.sTopicTitle,
attach_sig: '1',
notify: "0",
post: 'Enviar'
}).done(function() {
jQuery('#ipsGlobalNotification').remove();
jQuery('#rename-topic').remove();
oMTConfig.oTopicTitle.show().text(sNewTitle);
jQuery('body').append('<div id="ipsGlobalNotification"><div class="popupWrapper"><div class="popupInner"><div class="ipsPad">' + oMTConfig.sDoneMsg + '</div></div></div></div>');
setTimeout(function() {
jQuery('#ipsGlobalNotification').remove();
}, 4000);
}).fail(function() {
jQuery('#ipsGlobalNotification').remove();
oMTConfig.oTopicTitle.show();
alert(oMTConfig.sErrorMsg);
});
}).fail(function() {
jQuery('#ipsGlobalNotification').remove();
oMTConfig.oTopicTitle.show();
alert(oMTConfig.sErrorMsg);
});
}).fail(function() {
jQuery('#ipsGlobalNotification').remove();
oMTConfig.oTopicTitle.show();
alert(oMTConfig.sErrorMsg);
});
}
Re: Ações de moderação em dropdown
Strilk escreveu:Não está invisível, mas a coloração das letras está bem fraca, o dropbox só vai aparecer a membros com administração no fórum. Coloque esse javascript no lugar do outro e vamos ver se trouxeram resultados:
- Código:
/***
* Application: Actions of moderation.
* Description: This application shows a shortcut menu for the moderation in the list of topics.
* Version: 1.03182014-jq1.9.1 - (Dodekatheon / 2) + (Hermes = Zeus + Maia)
* Made and Optimizations by JScript - 2014/03/18
* View more in: http://ajuda.forumeiros.com
* Copyright (c) 2013 JScript <jscriptbrasil at live dot com>
* This work is free. You can redistribute it and/or modify it
* under the terms of the WTFPL, Version 2
*/
/***
* System Defined Variables - Do not edit if you don't know!
***/
var oMTConfig = {
sInfo: '<!--' +
'* Application: Actions of moderation.' +
'* Description: This application shows a shortcut menu for the moderation in the list of topics.' +
'* Version: 1.03182014-jq1.9.1 - (Dodekatheon / 2) + (Hermes = Zeus + Maia)' +
'* Made and Optimizations by JScript - 2014/03/18' +
'* View more in: http://punbb.forumeiros.com/forum & http://ajuda.forumeiros.com' +
'* Copyright (c) 2014 JScript <jscriptbrasil at live dot com>' +
'* This work is free. You can redistribute it and/or modify it' +
'* under the terms of the WTFPL, Version 2' +
'-->',
sErrorMsg: '',
oTopicTitle: {},
sTopicHref: '',
iTopicID: 0,
sTopicTitle: '',
sContent: '<a title="Ações da Moderação" class="ipsModMenu" href="#"> </a>',
sMenu: '<ul style="display: none; position: absolute; z-index: 9999;" class="ipbmenu_content" id="topic_mod_menucontent">' +
'<li style="z-index: 10000;"><a title="Renomear tópico" href="" id="t_rename" onclick="_rename_Topic();return false;" style="z-index: 10000;">Renomear tópico</a></li>' +
//'<li style="z-index: 10000;"><a title="Destacar tópico" href="" id="t_pin" style="z-index: 10000;">Destacar tópico</a></li>' +
//'<li style="z-index: 10000;"><a title="Mudar ícone" href="" id="t_icon" style="z-index: 10000;">Mudar ícone</a></li>' +
'<li style="z-index: 10000;"><a title="Fechar tópico" href="" id="t_lock" style="z-index: 10000;">Fechar tópico</a></li>' +
'<li style="z-index: 10000;"><a title="Mover tópico" href="" id="t_move" style="z-index: 10000;">Mover tópico</a></li>' +
'<li style="z-index: 10000;"><a title="Enviar para lixeira" href="" id="t_hide" style="z-index: 10000;">Reciclar (Ocultar)</a></li>' +
'<li style="z-index: 10000;"><a title="Excluir tópico" href="" id="t_delete" style="z-index: 10000;">Excluir tópico</a></li>' +
'</ul>',
sCSS: '<style>' +
/*'#rename-topic {' +
'display: block;' +
'}' +*/
'.statused tr:hover > .tcr .ipsModMenu, ' +
'.forumline tr td:hover > .postdetails .ipsModMenu, ' +
'ul.topiclist.topics.bg_none dl.icon:hover > .lastpost .ipsModMenu, ' +
'table.ipbtable tbody tr:hover > td.row1.lastaction .ipsModMenu{' +
'visibility: visible;' +
'}' +
'.ipsModMenu {' +
'background: url("http://i55.servimg.com/u/f55/18/17/62/92/modera10.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);' +
'display: inline-block;' +
'height: 15px;' +
'margin: 0 8px;' +
'text-indent: -2000em;' +
'vertical-align: middle;' +
'width: 15px;' +
'float: right;' +
'visibility: hidden;' +
/*'margin-top: -6px;' +*/
'}' +
'.ipbmenu_content {' +
'font-size: 12px;' +
'min-width: 85px;' +
'z-index: 2000;' +
'color: black' +
'}' +
'.ipbmenu_content {' +
'background-color: #F7F9FB;' +
'border: 1px solid #D5DDE5;' +
'box-shadow: 0 6px 6px rgba(0, 0, 0, 0.3);' +
'}' +
'.ipbmenu_content li:first-child {' +
'padding-top: 0;' +
'}' +
'.ipbmenu_content li {' +
'border-bottom: 1px solid #D5DDE5;' +
'}' +
'.ipbmenu_content a {' +
'display: block;' +
'padding: 6px 10px;' +
'text-align: left;' +
'text-decoration: none;' +
'}' +
'.ipbmenu_content a:hover {' +
'background: none repeat scroll 0 0 #D5DDE5;' +
'}' +
'.cancel {' +
'font-size: 0.9em;' +
'font-weight: bold;' +
'color: black' +
'}' +
'.input_text {' +
'background: none repeat scroll 0 0 #FFFFFF !important;' +
'border-color: #848484 #C1C1C1 #E1E1E1 !important;' +
'border-radius: 2px 2px 2px 2px !important;' +
'border-style: solid !important;' +
'border-width: 1px !important;' +
'padding: 4px !important;' +
'font: 13px helvetica,arial,sans-serif !important;' +
'color: black' +
'}' +
'#rename-topic .button2 {' +
/*'border-color: #212121;' +
'border-radius: 3px 3px 3px 3px;' +
'box-shadow: 0 1px 0 0 #5C5C5C inset, 0 2px 3px rgba(0, 0, 0, 0.2);' +
'border-style: solid;' +
'border-width: 1px;' +*/
'cursor: pointer;' +
'padding: 4px 10px !important;' +
'min-width: 0 !important;' +
'font: 13px helvetica,arial,sans-serif !important;' +
'color: black' +
'}' +
'.input_text:focus {' +
'border-color: #4E4E4E #7C7C7C #A3A3A3;' +
'box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);' +
'}' +
'#ipsGlobalNotification {' +
'font-weight: bold;' +
'left: 50%;' +
'margin-left: -250px;' +
'position: fixed;' +
'text-align: center;' +
'top: 20px;' +
'z-index: 10000;' +
'color: black' +
'}' +
'.popupWrapper {' +
'background-color: rgba(70, 70, 70, 0.6);' +
'border-radius: 4px 4px 4px 4px;' +
'box-shadow: 0 12px 25px rgba(0, 0, 0, 0.7);' +
'padding: 4px;' +
'}' +
'.popupInner {' +
'background: none repeat scroll 0 0 #FFFFFF;' +
'box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);' +
'overflow-x: hidden;' +
'overflow-y: auto;' +
'width: 500px;' +
'}' +
'.ipsPad {' +
'padding: 9px;' +
'}' +
'</style>',
sTarget: '',
sSearch: '',
sExpression0: '',
sExpression1: ''
};
/***
* User Definition Variables
***/
oMTConfig.sErrorMsg = 'Atenção!\n\n Ocorreu um erro ao editar o título, aguarde 10 segundos e tente novamente!';
oMTConfig.sSavingMsg = 'Atualizando o título do tópico, aguarde...';
oMTConfig.sDoneMsg = 'O título do tópico foi atualizado!';
jQuery(function() {
if (_userdata.user_level >= 1) {
/* Forum versions! */
var phpBB2 = jQuery('.bodyline');
var phpBB3 = jQuery('#phpbb');
var punbb = jQuery('#pun-intro');
var invision = jQuery('#ipbwrapper');
if (phpBB2.length) {
oMTConfig.sTarget = '.forumline td.row3Right span.postdetails';
oMTConfig.sExpression0 = 'oClicked.parent().parent().parent().find("td a.topictitle");';
oMTConfig.sExpression1 = 'jQuery("#page-body .forumline .postbody:first", data).parents("tr:eq(1)").attr("id").split("p")[1];'
} else if (phpBB3.length) {
oMTConfig.sTarget = 'ul.topiclist.bg_none dd.lastpost div[style="float:left;"] span';
oMTConfig.sExpression0 = 'oClicked.parent().parents("dl.icon").find("dd.dterm a.topictitle");';
oMTConfig.sExpression1 = 'jQuery("#main-content .post:first", data).attr("id").split("p")[1];';
} else if (punbb.length) {
oMTConfig.sTarget = '.statused td.tcr';
oMTConfig.sExpression0 = 'oClicked.parents("tr").find(".tcl.tdtopics a.topictitle");';
oMTConfig.sExpression1 = 'jQuery(".posthead:first", data).attr("id").split("p")[1];';
} else if (invision.length) {
oMTConfig.sTarget = 'table.ipbtable tbody td.row1.lastaction';
oMTConfig.sExpression0 = 'oClicked.parents("tr").find("td a.topictitle");';
oMTConfig.sExpression1 = 'jQuery("#main-content .borderwrap .post:first", data).attr("id").split("p")[1];';
};
jQuery(oMTConfig.sCSS).insertBefore('body');
jQuery('body').append(oMTConfig.sInfo + oMTConfig.sMenu);
jQuery(oMTConfig.sTarget).append(oMTConfig.sInfo + oMTConfig.sContent);
jQuery('a.ipsModMenu').click(function() {
var oClicked = jQuery(this);
var oTarget = jQuery('#topic_mod_menucontent');
if (oTarget[0].style.display == 'none') {
oClicked.addClass('menu_active');
oMTConfig.oTopicTitle = eval(oMTConfig.sExpression0);
oMTConfig.sTopicHref = oMTConfig.oTopicTitle.attr('href');
oMTConfig.iTopicID = oMTConfig.sTopicHref.substring(2, oMTConfig.sTopicHref.indexOf("-")); // .split(/[\/t-]/)[2]; <- More fast???
oMTConfig.sTopicTitle = oMTConfig.oTopicTitle.text();
var TID = jQuery('input[name="tid"]').val();
jQuery('#t_lock').attr('href', '/modcp?mode=lock&t=' + oMTConfig.iTopicID + '&tid=' + TID);
jQuery('#t_move').attr('href', '/modcp?mode=move&t=' + oMTConfig.iTopicID + '&tid=' + TID);
jQuery('#t_hide').attr('href', '/modcp?mode=trash&t=' + oMTConfig.iTopicID + '&tid=' + TID);
jQuery('#t_delete').attr('href', '/modcp?mode=delete&t=' + oMTConfig.iTopicID + '&tid=' + TID);
oTarget
.css({
'left': (oClicked.offset().left + oClicked.outerWidth()) - oTarget.outerWidth(),
'top': oClicked.offset().top + oClicked.outerHeight()
})
.fadeIn(400);
jQuery(document).mousedown(function() {
if (!oTarget.is(":hover")) {
jQuery(document).unbind('mousedown');
oClicked.removeClass('menu_active');
oTarget.fadeOut(400);
}
});
} else {
oClicked.removeClass('menu_active');
oTarget.fadeOut(400);
}
return false;
});
}
});
function _rename_Topic() {
oMTConfig.oTopicTitle.hide();
var sHtml =
'<span id="rename-topic">' +
'<input type="text" maxlength="150" size="50" class="input_text" value="' + oMTConfig.sTopicTitle + '" id="rt_input" style="width: 56%; margin-right: 4px;">' +
'<input type="submit" id="rt_submit" class="button2" value="Atualizar" onclick="_rt_commit()" style="margin-right: 4px;">' +
'<a title="Cancelar" class="cancel" id="rt_cancel" href="#" onclick="jQuery(\'#rename-topic\').remove();oMTConfig.oTopicTitle.show();return false;">Cancelar</a>' +
'</span>';
oMTConfig.oTopicTitle.before(sHtml);
jQuery('#rt_input').keydown(function(e) {
if (e.keyCode == 13 && jQuery('#rt_input').val() !== '') {
_rt_commit();
}
});
}
function _rt_commit() {
var iPostID = 0,
user_Msg = '';
var sNewTitle = jQuery('#rt_input').val();
if (sNewTitle == '') return false;
jQuery('body').append('<div id="ipsGlobalNotification"><div class="popupWrapper"><div class="popupInner"><div class="ipsPad">' + oMTConfig.sSavingMsg + '</div></div></div></div>');
jQuery('#rename-topic').css('opacity', '0.4');
jQuery.get(oMTConfig.sTopicHref, function(data) {
iPostID = eval(oMTConfig.sExpression1);
}).done(function() {
jQuery.get("/post?p=" + iPostID + "&mode=editpost", function(data) {
user_Msg = jQuery(data).find('#text_editor_textarea[name="message"]').val();
}).done(function() {
jQuery.post("/post?p=" + iPostID + "&mode=editpost", {
subject: sNewTitle,
message: user_Msg,
edit_reason: 'Título anterior: ' + oMTConfig.sTopicTitle,
attach_sig: '1',
notify: "0",
post: 'Enviar'
}).done(function() {
jQuery('#ipsGlobalNotification').remove();
jQuery('#rename-topic').remove();
oMTConfig.oTopicTitle.show().text(sNewTitle);
jQuery('body').append('<div id="ipsGlobalNotification"><div class="popupWrapper"><div class="popupInner"><div class="ipsPad">' + oMTConfig.sDoneMsg + '</div></div></div></div>');
setTimeout(function() {
jQuery('#ipsGlobalNotification').remove();
}, 4000);
}).fail(function() {
jQuery('#ipsGlobalNotification').remove();
oMTConfig.oTopicTitle.show();
alert(oMTConfig.sErrorMsg);
});
}).fail(function() {
jQuery('#ipsGlobalNotification').remove();
oMTConfig.oTopicTitle.show();
alert(oMTConfig.sErrorMsg);
});
}).fail(function() {
jQuery('#ipsGlobalNotification').remove();
oMTConfig.oTopicTitle.show();
alert(oMTConfig.sErrorMsg);
});
}
Ainda continua na mesma, só mudou uns pontinhos preto aparecendo quando abre a engrenagem.
Eu tenho um outro fórumteste, e lá aparece normal. Mas a versão é phpBB2
Re: Ações de moderação em dropdown
Tente esse:
- Código:
/***
* Application: Actions of moderation.
* Description: This application shows a shortcut menu for the moderation in the list of topics.
* Version: 1.03182014-jq1.9.1 - (Dodekatheon / 2) + (Hermes = Zeus + Maia)
* Made and Optimizations by JScript - 2014/03/18
* View more in: http://ajuda.forumeiros.com
* Copyright (c) 2013 JScript <jscriptbrasil at live dot com>
* This work is free. You can redistribute it and/or modify it
* under the terms of the WTFPL, Version 2
*/
/***
* System Defined Variables - Do not edit if you don't know!
***/
var oMTConfig = {
sInfo: '<!--' +
'* Application: Actions of moderation.' +
'* Description: This application shows a shortcut menu for the moderation in the list of topics.' +
'* Version: 1.03182014-jq1.9.1 - (Dodekatheon / 2) + (Hermes = Zeus + Maia)' +
'* Made and Optimizations by JScript - 2014/03/18' +
'* View more in: http://punbb.forumeiros.com/forum & http://ajuda.forumeiros.com' +
'* Copyright (c) 2014 JScript <jscriptbrasil at live dot com>' +
'* This work is free. You can redistribute it and/or modify it' +
'* under the terms of the WTFPL, Version 2' +
'-->',
sErrorMsg: '',
oTopicTitle: {},
sTopicHref: '',
iTopicID: 0,
sTopicTitle: '',
sContent: '<a title="Ações da Moderação" class="ipsModMenu" href="#"> </a>',
sMenu: '<ul style="display: none; position: absolute; z-index: 9999;" class="ipbmenu_content" id="topic_mod_menucontent">' +
'<li style="z-index: 10000;"><a title="Renomear tópico" href="" id="t_rename" onclick="_rename_Topic();return false;" style="z-index: 10000;">Renomear tópico</a></li>' +
//'<li style="z-index: 10000;"><a title="Destacar tópico" href="" id="t_pin" style="z-index: 10000;">Destacar tópico</a></li>' +
//'<li style="z-index: 10000;"><a title="Mudar ícone" href="" id="t_icon" style="z-index: 10000;">Mudar ícone</a></li>' +
'<li style="z-index: 10000;"><a title="Fechar tópico" href="" id="t_lock" style="z-index: 10000;">Fechar tópico</a></li>' +
'<li style="z-index: 10000;"><a title="Mover tópico" href="" id="t_move" style="z-index: 10000;">Mover tópico</a></li>' +
'<li style="z-index: 10000;"><a title="Enviar para lixeira" href="" id="t_hide" style="z-index: 10000;">Reciclar (Ocultar)</a></li>' +
'<li style="z-index: 10000;"><a title="Excluir tópico" href="" id="t_delete" style="z-index: 10000;">Excluir tópico</a></li>' +
'</ul>',
sCSS: '<style>' +
/*'#rename-topic {' +
'display: block;' +
'}' +*/
'.statused tr:hover > .tcr .ipsModMenu, ' +
'.forumline tr td:hover > .postdetails .ipsModMenu, ' +
'ul.topiclist.topics.bg_none dl.icon:hover > .lastpost .ipsModMenu, ' +
'table.ipbtable tbody tr:hover > td.row1.lastaction .ipsModMenu{' +
'visibility: visible;' +
'color: black' +
'}' +
'.ipsModMenu {' +
'background: url("http://i55.servimg.com/u/f55/18/17/62/92/modera10.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);' +
'display: inline-block;' +
'height: 15px;' +
'margin: 0 8px;' +
'text-indent: -2000em;' +
'vertical-align: middle;' +
'width: 15px;' +
'float: right;' +
'visibility: hidden;' +
/*'margin-top: -6px;' +*/
'color: black' +
'}' +
'.ipbmenu_content {' +
'font-size: 12px;' +
'min-width: 85px;' +
'z-index: 2000;' +
'color: black' +
'}' +
'.ipbmenu_content {' +
'background-color: #F7F9FB;' +
'border: 1px solid #D5DDE5;' +
'box-shadow: 0 6px 6px rgba(0, 0, 0, 0.3);' +
'color: black' +
'}' +
'.ipbmenu_content li:first-child {' +
'padding-top: 0;' +
'color: black' +
'}' +
'.ipbmenu_content li {' +
'border-bottom: 1px solid #D5DDE5;' +
'color: black' +
'}' +
'.ipbmenu_content a {' +
'display: block;' +
'padding: 6px 10px;' +
'text-align: left;' +
'text-decoration: none;' +
'color: black' +
'}' +
'.ipbmenu_content a:hover {' +
'background: none repeat scroll 0 0 #D5DDE5;' +
'color: black' +
'}' +
'.cancel {' +
'font-size: 0.9em;' +
'font-weight: bold;' +
'color: black' +
'}' +
'.input_text {' +
'background: none repeat scroll 0 0 #FFFFFF !important;' +
'border-color: #848484 #C1C1C1 #E1E1E1 !important;' +
'border-radius: 2px 2px 2px 2px !important;' +
'border-style: solid !important;' +
'border-width: 1px !important;' +
'padding: 4px !important;' +
'font: 13px helvetica,arial,sans-serif !important;' +
'color: black' +
'}' +
'#rename-topic .button2 {' +
/*'border-color: #212121;' +
'border-radius: 3px 3px 3px 3px;' +
'box-shadow: 0 1px 0 0 #5C5C5C inset, 0 2px 3px rgba(0, 0, 0, 0.2);' +
'border-style: solid;' +
'border-width: 1px;' +*/
'cursor: pointer;' +
'padding: 4px 10px !important;' +
'min-width: 0 !important;' +
'font: 13px helvetica,arial,sans-serif !important;' +
'color: black' +
'}' +
'.input_text:focus {' +
'border-color: #4E4E4E #7C7C7C #A3A3A3;' +
'box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);' +
'color: black' +
'}' +
'#ipsGlobalNotification {' +
'font-weight: bold;' +
'left: 50%;' +
'margin-left: -250px;' +
'position: fixed;' +
'text-align: center;' +
'top: 20px;' +
'z-index: 10000;' +
'color: black' +
'}' +
'.popupWrapper {' +
'background-color: rgba(70, 70, 70, 0.6);' +
'border-radius: 4px 4px 4px 4px;' +
'box-shadow: 0 12px 25px rgba(0, 0, 0, 0.7);' +
'padding: 4px;' +
'color: black' +
'}' +
'.popupInner {' +
'background: none repeat scroll 0 0 #FFFFFF;' +
'box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);' +
'overflow-x: hidden;' +
'overflow-y: auto;' +
'width: 500px;' +
'color: black' +
'}' +
'.ipsPad {' +
'padding: 9px;' +
'color: black' +
'}' +
'</style>',
sTarget: '',
sSearch: '',
sExpression0: '',
sExpression1: ''
};
/***
* User Definition Variables
***/
oMTConfig.sErrorMsg = 'Atenção!\n\n Ocorreu um erro ao editar o título, aguarde 10 segundos e tente novamente!';
oMTConfig.sSavingMsg = 'Atualizando o título do tópico, aguarde...';
oMTConfig.sDoneMsg = 'O título do tópico foi atualizado!';
jQuery(function() {
if (_userdata.user_level >= 1) {
/* Forum versions! */
var phpBB2 = jQuery('.bodyline');
var phpBB3 = jQuery('#phpbb');
var punbb = jQuery('#pun-intro');
var invision = jQuery('#ipbwrapper');
if (phpBB2.length) {
oMTConfig.sTarget = '.forumline td.row3Right span.postdetails';
oMTConfig.sExpression0 = 'oClicked.parent().parent().parent().find("td a.topictitle");';
oMTConfig.sExpression1 = 'jQuery("#page-body .forumline .postbody:first", data).parents("tr:eq(1)").attr("id").split("p")[1];'
} else if (phpBB3.length) {
oMTConfig.sTarget = 'ul.topiclist.bg_none dd.lastpost div[style="float:left;"] span';
oMTConfig.sExpression0 = 'oClicked.parent().parents("dl.icon").find("dd.dterm a.topictitle");';
oMTConfig.sExpression1 = 'jQuery("#main-content .post:first", data).attr("id").split("p")[1];';
} else if (punbb.length) {
oMTConfig.sTarget = '.statused td.tcr';
oMTConfig.sExpression0 = 'oClicked.parents("tr").find(".tcl.tdtopics a.topictitle");';
oMTConfig.sExpression1 = 'jQuery(".posthead:first", data).attr("id").split("p")[1];';
} else if (invision.length) {
oMTConfig.sTarget = 'table.ipbtable tbody td.row1.lastaction';
oMTConfig.sExpression0 = 'oClicked.parents("tr").find("td a.topictitle");';
oMTConfig.sExpression1 = 'jQuery("#main-content .borderwrap .post:first", data).attr("id").split("p")[1];';
};
jQuery(oMTConfig.sCSS).insertBefore('body');
jQuery('body').append(oMTConfig.sInfo + oMTConfig.sMenu);
jQuery(oMTConfig.sTarget).append(oMTConfig.sInfo + oMTConfig.sContent);
jQuery('a.ipsModMenu').click(function() {
var oClicked = jQuery(this);
var oTarget = jQuery('#topic_mod_menucontent');
if (oTarget[0].style.display == 'none') {
oClicked.addClass('menu_active');
oMTConfig.oTopicTitle = eval(oMTConfig.sExpression0);
oMTConfig.sTopicHref = oMTConfig.oTopicTitle.attr('href');
oMTConfig.iTopicID = oMTConfig.sTopicHref.substring(2, oMTConfig.sTopicHref.indexOf("-")); // .split(/[\/t-]/)[2]; <- More fast???
oMTConfig.sTopicTitle = oMTConfig.oTopicTitle.text();
var TID = jQuery('input[name="tid"]').val();
jQuery('#t_lock').attr('href', '/modcp?mode=lock&t=' + oMTConfig.iTopicID + '&tid=' + TID);
jQuery('#t_move').attr('href', '/modcp?mode=move&t=' + oMTConfig.iTopicID + '&tid=' + TID);
jQuery('#t_hide').attr('href', '/modcp?mode=trash&t=' + oMTConfig.iTopicID + '&tid=' + TID);
jQuery('#t_delete').attr('href', '/modcp?mode=delete&t=' + oMTConfig.iTopicID + '&tid=' + TID);
oTarget
.css({
'left': (oClicked.offset().left + oClicked.outerWidth()) - oTarget.outerWidth(),
'top': oClicked.offset().top + oClicked.outerHeight()
})
.fadeIn(400);
jQuery(document).mousedown(function() {
if (!oTarget.is(":hover")) {
jQuery(document).unbind('mousedown');
oClicked.removeClass('menu_active');
oTarget.fadeOut(400);
}
});
} else {
oClicked.removeClass('menu_active');
oTarget.fadeOut(400);
}
return false;
});
}
});
function _rename_Topic() {
oMTConfig.oTopicTitle.hide();
var sHtml =
'<span id="rename-topic">' +
'<input type="text" maxlength="150" size="50" class="input_text" value="' + oMTConfig.sTopicTitle + '" id="rt_input" style="width: 56%; margin-right: 4px;">' +
'<input type="submit" id="rt_submit" class="button2" value="Atualizar" onclick="_rt_commit()" style="margin-right: 4px;">' +
'<a title="Cancelar" class="cancel" id="rt_cancel" href="#" onclick="jQuery(\'#rename-topic\').remove();oMTConfig.oTopicTitle.show();return false;">Cancelar</a>' +
'</span>';
oMTConfig.oTopicTitle.before(sHtml);
jQuery('#rt_input').keydown(function(e) {
if (e.keyCode == 13 && jQuery('#rt_input').val() !== '') {
_rt_commit();
}
});
}
function _rt_commit() {
var iPostID = 0,
user_Msg = '';
var sNewTitle = jQuery('#rt_input').val();
if (sNewTitle == '') return false;
jQuery('body').append('<div id="ipsGlobalNotification"><div class="popupWrapper"><div class="popupInner"><div class="ipsPad">' + oMTConfig.sSavingMsg + '</div></div></div></div>');
jQuery('#rename-topic').css('opacity', '0.4');
jQuery.get(oMTConfig.sTopicHref, function(data) {
iPostID = eval(oMTConfig.sExpression1);
}).done(function() {
jQuery.get("/post?p=" + iPostID + "&mode=editpost", function(data) {
user_Msg = jQuery(data).find('#text_editor_textarea[name="message"]').val();
}).done(function() {
jQuery.post("/post?p=" + iPostID + "&mode=editpost", {
subject: sNewTitle,
message: user_Msg,
edit_reason: 'Título anterior: ' + oMTConfig.sTopicTitle,
attach_sig: '1',
notify: "0",
post: 'Enviar'
}).done(function() {
jQuery('#ipsGlobalNotification').remove();
jQuery('#rename-topic').remove();
oMTConfig.oTopicTitle.show().text(sNewTitle);
jQuery('body').append('<div id="ipsGlobalNotification"><div class="popupWrapper"><div class="popupInner"><div class="ipsPad">' + oMTConfig.sDoneMsg + '</div></div></div></div>');
setTimeout(function() {
jQuery('#ipsGlobalNotification').remove();
}, 4000);
}).fail(function() {
jQuery('#ipsGlobalNotification').remove();
oMTConfig.oTopicTitle.show();
alert(oMTConfig.sErrorMsg);
});
}).fail(function() {
jQuery('#ipsGlobalNotification').remove();
oMTConfig.oTopicTitle.show();
alert(oMTConfig.sErrorMsg);
});
}).fail(function() {
jQuery('#ipsGlobalNotification').remove();
oMTConfig.oTopicTitle.show();
alert(oMTConfig.sErrorMsg);
});
}
Re: Ações de moderação em dropdown
Strilk escreveu:Tente esse:
Bom, melhorou em questão do visual (nas letras) a engrenagem mesmo continua (sem aparecer) Mas acho que já está de bom tamanho.
Re: Ações de moderação em dropdown
Me envie como a engrenagem deveria ficar e como está agora, para que possamos fazer algo a respeito disso.
Re: Ações de moderação em dropdown
Strilk escreveu:Me envie como a engrenagem deveria ficar e como está agora, para que possamos fazer algo a respeito disso.
Estou usando o mesmo código em outro fórum, e veja como ela fica (visivel) quando se passa o mouse em cima: https://imgur.com/8w31mrU
Porém, no meu atual fórum ela já não aparece igual a da imagem acima quando tento passar o mouse (por cima) dela, Veja: https://imgur.com/4xTMk87
Eu até tentei mudar a engrenagem para uma outra que upei e mesmo assim não apareceu
Desde já agradeço muito pela ajuda
Re: Ações de moderação em dropdown
Como eu vi em uma resposta sua, dizendo que em outra versão a engrenagem aparece normal, provavelmente a versão na qual está usando, não suporta o código inteiro, e alterações precisarão ser modificadas. Tudo bem se ao invés de uma ''foto'' eu alojar um ícone font-awesome?
Re: Ações de moderação em dropdown
Strilk escreveu:Como eu vi em uma resposta sua, dizendo que em outra versão a engrenagem aparece normal, provavelmente a versão na qual está usando, não suporta o código inteiro, e alterações precisarão ser modificadas. Tudo bem se ao invés de uma ''foto'' eu alojar um ícone font-awesome?
Pode sim, amigo! obrigado
Re: Ações de moderação em dropdown
Boa noite, peço desculpas pela demora, veja se resolve seu problema:
- Código:
/***
* Application: Actions of moderation.
* Description: This application shows a shortcut menu for the moderation in the list of topics.
* Version: 1.03182014-jq1.9.1 - (Dodekatheon / 2) + (Hermes = Zeus + Maia)
* Made and Optimizations by JScript - 2014/03/18
* View more in: http://ajuda.forumeiros.com
* Copyright (c) 2013 JScript <jscriptbrasil at live dot com>
* This work is free. You can redistribute it and/or modify it
* under the terms of the WTFPL, Version 2
*/
/***
* System Defined Variables - Do not edit if you don't know!
***/
var oMTConfig = {
sInfo: '<!--' +
'* Application: Actions of moderation.' +
'* Description: This application shows a shortcut menu for the moderation in the list of topics.' +
'* Version: 1.03182014-jq1.9.1 - (Dodekatheon / 2) + (Hermes = Zeus + Maia)' +
'* Made and Optimizations by JScript - 2014/03/18' +
'* View more in: http://punbb.forumeiros.com/forum & http://ajuda.forumeiros.com' +
'* Copyright (c) 2014 JScript <jscriptbrasil at live dot com>' +
'* This work is free. You can redistribute it and/or modify it' +
'* under the terms of the WTFPL, Version 2' +
'-->',
sErrorMsg: '',
oTopicTitle: {},
sTopicHref: '',
iTopicID: 0,
sTopicTitle: '',
sContent: '<a title="Ações da Moderação" class="ipsModMenu" href="#"> </a>',
sMenu: '<ul style="display: none; position: absolute; z-index: 9999;" class="ipbmenu_content" id="topic_mod_menucontent">' +
'<li style="z-index: 10000;"><a title="Renomear tópico" href="" id="t_rename" onclick="_rename_Topic();return false;" style="z-index: 10000;">Renomear tópico</a></li>' +
//'<li style="z-index: 10000;"><a title="Destacar tópico" href="" id="t_pin" style="z-index: 10000;">Destacar tópico</a></li>' +
//'<li style="z-index: 10000;"><a title="Mudar ícone" href="" id="t_icon" style="z-index: 10000;">Mudar ícone</a></li>' +
'<li style="z-index: 10000;"><a title="Fechar tópico" href="" id="t_lock" style="z-index: 10000;">Fechar tópico</a></li>' +
'<li style="z-index: 10000;"><a title="Mover tópico" href="" id="t_move" style="z-index: 10000;">Mover tópico</a></li>' +
'<li style="z-index: 10000;"><a title="Enviar para lixeira" href="" id="t_hide" style="z-index: 10000;">Reciclar (Ocultar)</a></li>' +
'<li style="z-index: 10000;"><a title="Excluir tópico" href="" id="t_delete" style="z-index: 10000;">Excluir tópico</a></li>' +
'</ul>',
sCSS: '<style>' +
/*'#rename-topic {' +
'display: block;' +
'}' +*/
'.statused tr:hover > .tcr .ipsModMenu, ' +
'.forumline tr td:hover > .postdetails .ipsModMenu, ' +
'ul.topiclist.topics.bg_none dl.icon:hover > .lastpost .ipsModMenu, ' +
'table.ipbtable tbody tr:hover > td.row1.lastaction .ipsModMenu{' +
'visibility: visible;' +
'color: black' +
'}' +
'.ipsModMenu {' +
'content: /f013 +
'display: inline-block;' +
'height: 15px;' +
'margin: 0 8px;' +
'text-indent: -2000em;' +
'vertical-align: middle;' +
'width: 15px;' +
'float: right;' +
'visibility: hidden;' +
/*'margin-top: -6px;' +*/
'color: black' +
'}' +
'.ipbmenu_content {' +
'font-size: 12px;' +
'min-width: 85px;' +
'z-index: 2000;' +
'color: black' +
'}' +
'.ipbmenu_content {' +
'background-color: #F7F9FB;' +
'border: 1px solid #D5DDE5;' +
'box-shadow: 0 6px 6px rgba(0, 0, 0, 0.3);' +
'color: black' +
'}' +
'.ipbmenu_content li:first-child {' +
'padding-top: 0;' +
'color: black' +
'}' +
'.ipbmenu_content li {' +
'border-bottom: 1px solid #D5DDE5;' +
'color: black' +
'}' +
'.ipbmenu_content a {' +
'display: block;' +
'padding: 6px 10px;' +
'text-align: left;' +
'text-decoration: none;' +
'color: black' +
'}' +
'.ipbmenu_content a:hover {' +
'background: none repeat scroll 0 0 #D5DDE5;' +
'color: black' +
'}' +
'.cancel {' +
'font-size: 0.9em;' +
'font-weight: bold;' +
'color: black' +
'}' +
'.input_text {' +
'background: none repeat scroll 0 0 #FFFFFF !important;' +
'border-color: #848484 #C1C1C1 #E1E1E1 !important;' +
'border-radius: 2px 2px 2px 2px !important;' +
'border-style: solid !important;' +
'border-width: 1px !important;' +
'padding: 4px !important;' +
'font: 13px helvetica,arial,sans-serif !important;' +
'color: black' +
'}' +
'#rename-topic .button2 {' +
/*'border-color: #212121;' +
'border-radius: 3px 3px 3px 3px;' +
'box-shadow: 0 1px 0 0 #5C5C5C inset, 0 2px 3px rgba(0, 0, 0, 0.2);' +
'border-style: solid;' +
'border-width: 1px;' +*/
'cursor: pointer;' +
'padding: 4px 10px !important;' +
'min-width: 0 !important;' +
'font: 13px helvetica,arial,sans-serif !important;' +
'color: black' +
'}' +
'.input_text:focus {' +
'border-color: #4E4E4E #7C7C7C #A3A3A3;' +
'box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);' +
'color: black' +
'}' +
'#ipsGlobalNotification {' +
'font-weight: bold;' +
'left: 50%;' +
'margin-left: -250px;' +
'position: fixed;' +
'text-align: center;' +
'top: 20px;' +
'z-index: 10000;' +
'color: black' +
'}' +
'.popupWrapper {' +
'background-color: rgba(70, 70, 70, 0.6);' +
'border-radius: 4px 4px 4px 4px;' +
'box-shadow: 0 12px 25px rgba(0, 0, 0, 0.7);' +
'padding: 4px;' +
'color: black' +
'}' +
'.popupInner {' +
'background: none repeat scroll 0 0 #FFFFFF;' +
'box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);' +
'overflow-x: hidden;' +
'overflow-y: auto;' +
'width: 500px;' +
'color: black' +
'}' +
'.ipsPad {' +
'padding: 9px;' +
'color: black' +
'}' +
'</style>',
sTarget: '',
sSearch: '',
sExpression0: '',
sExpression1: ''
};
/***
* User Definition Variables
***/
oMTConfig.sErrorMsg = 'Atenção!\n\n Ocorreu um erro ao editar o título, aguarde 10 segundos e tente novamente!';
oMTConfig.sSavingMsg = 'Atualizando o título do tópico, aguarde...';
oMTConfig.sDoneMsg = 'O título do tópico foi atualizado!';
jQuery(function() {
if (_userdata.user_level >= 1) {
/* Forum versions! */
var phpBB2 = jQuery('.bodyline');
var phpBB3 = jQuery('#phpbb');
var punbb = jQuery('#pun-intro');
var invision = jQuery('#ipbwrapper');
if (phpBB2.length) {
oMTConfig.sTarget = '.forumline td.row3Right span.postdetails';
oMTConfig.sExpression0 = 'oClicked.parent().parent().parent().find("td a.topictitle");';
oMTConfig.sExpression1 = 'jQuery("#page-body .forumline .postbody:first", data).parents("tr:eq(1)").attr("id").split("p")[1];'
} else if (phpBB3.length) {
oMTConfig.sTarget = 'ul.topiclist.bg_none dd.lastpost div[style="float:left;"] span';
oMTConfig.sExpression0 = 'oClicked.parent().parents("dl.icon").find("dd.dterm a.topictitle");';
oMTConfig.sExpression1 = 'jQuery("#main-content .post:first", data).attr("id").split("p")[1];';
} else if (punbb.length) {
oMTConfig.sTarget = '.statused td.tcr';
oMTConfig.sExpression0 = 'oClicked.parents("tr").find(".tcl.tdtopics a.topictitle");';
oMTConfig.sExpression1 = 'jQuery(".posthead:first", data).attr("id").split("p")[1];';
} else if (invision.length) {
oMTConfig.sTarget = 'table.ipbtable tbody td.row1.lastaction';
oMTConfig.sExpression0 = 'oClicked.parents("tr").find("td a.topictitle");';
oMTConfig.sExpression1 = 'jQuery("#main-content .borderwrap .post:first", data).attr("id").split("p")[1];';
};
jQuery(oMTConfig.sCSS).insertBefore('body');
jQuery('body').append(oMTConfig.sInfo + oMTConfig.sMenu);
jQuery(oMTConfig.sTarget).append(oMTConfig.sInfo + oMTConfig.sContent);
jQuery('a.ipsModMenu').click(function() {
var oClicked = jQuery(this);
var oTarget = jQuery('#topic_mod_menucontent');
if (oTarget[0].style.display == 'none') {
oClicked.addClass('menu_active');
oMTConfig.oTopicTitle = eval(oMTConfig.sExpression0);
oMTConfig.sTopicHref = oMTConfig.oTopicTitle.attr('href');
oMTConfig.iTopicID = oMTConfig.sTopicHref.substring(2, oMTConfig.sTopicHref.indexOf("-")); // .split(/[\/t-]/)[2]; <- More fast???
oMTConfig.sTopicTitle = oMTConfig.oTopicTitle.text();
var TID = jQuery('input[name="tid"]').val();
jQuery('#t_lock').attr('href', '/modcp?mode=lock&t=' + oMTConfig.iTopicID + '&tid=' + TID);
jQuery('#t_move').attr('href', '/modcp?mode=move&t=' + oMTConfig.iTopicID + '&tid=' + TID);
jQuery('#t_hide').attr('href', '/modcp?mode=trash&t=' + oMTConfig.iTopicID + '&tid=' + TID);
jQuery('#t_delete').attr('href', '/modcp?mode=delete&t=' + oMTConfig.iTopicID + '&tid=' + TID);
oTarget
.css({
'left': (oClicked.offset().left + oClicked.outerWidth()) - oTarget.outerWidth(),
'top': oClicked.offset().top + oClicked.outerHeight()
})
.fadeIn(400);
jQuery(document).mousedown(function() {
if (!oTarget.is(":hover")) {
jQuery(document).unbind('mousedown');
oClicked.removeClass('menu_active');
oTarget.fadeOut(400);
}
});
} else {
oClicked.removeClass('menu_active');
oTarget.fadeOut(400);
}
return false;
});
}
});
function _rename_Topic() {
oMTConfig.oTopicTitle.hide();
var sHtml =
'<span id="rename-topic">' +
'<input type="text" maxlength="150" size="50" class="input_text" value="' + oMTConfig.sTopicTitle + '" id="rt_input" style="width: 56%; margin-right: 4px;">' +
'<input type="submit" id="rt_submit" class="button2" value="Atualizar" onclick="_rt_commit()" style="margin-right: 4px;">' +
'<a title="Cancelar" class="cancel" id="rt_cancel" href="#" onclick="jQuery(\'#rename-topic\').remove();oMTConfig.oTopicTitle.show();return false;">Cancelar</a>' +
'</span>';
oMTConfig.oTopicTitle.before(sHtml);
jQuery('#rt_input').keydown(function(e) {
if (e.keyCode == 13 && jQuery('#rt_input').val() !== '') {
_rt_commit();
}
});
}
function _rt_commit() {
var iPostID = 0,
user_Msg = '';
var sNewTitle = jQuery('#rt_input').val();
if (sNewTitle == '') return false;
jQuery('body').append('<div id="ipsGlobalNotification"><div class="popupWrapper"><div class="popupInner"><div class="ipsPad">' + oMTConfig.sSavingMsg + '</div></div></div></div>');
jQuery('#rename-topic').css('opacity', '0.4');
jQuery.get(oMTConfig.sTopicHref, function(data) {
iPostID = eval(oMTConfig.sExpression1);
}).done(function() {
jQuery.get("/post?p=" + iPostID + "&mode=editpost", function(data) {
user_Msg = jQuery(data).find('#text_editor_textarea[name="message"]').val();
}).done(function() {
jQuery.post("/post?p=" + iPostID + "&mode=editpost", {
subject: sNewTitle,
message: user_Msg,
edit_reason: 'Título anterior: ' + oMTConfig.sTopicTitle,
attach_sig: '1',
notify: "0",
post: 'Enviar'
}).done(function() {
jQuery('#ipsGlobalNotification').remove();
jQuery('#rename-topic').remove();
oMTConfig.oTopicTitle.show().text(sNewTitle);
jQuery('body').append('<div id="ipsGlobalNotification"><div class="popupWrapper"><div class="popupInner"><div class="ipsPad">' + oMTConfig.sDoneMsg + '</div></div></div></div>');
setTimeout(function() {
jQuery('#ipsGlobalNotification').remove();
}, 4000);
}).fail(function() {
jQuery('#ipsGlobalNotification').remove();
oMTConfig.oTopicTitle.show();
alert(oMTConfig.sErrorMsg);
});
}).fail(function() {
jQuery('#ipsGlobalNotification').remove();
oMTConfig.oTopicTitle.show();
alert(oMTConfig.sErrorMsg);
});
}).fail(function() {
jQuery('#ipsGlobalNotification').remove();
oMTConfig.oTopicTitle.show();
alert(oMTConfig.sErrorMsg);
});
}
Re: Ações de moderação em dropdown
Olá, bom dia! me parece que a versão do meu fórum não está aceitando de nenhuma forma a visibilidade dessa "plataforma" agora usando este último código nem mesmo o painel abre ou aparece ao passar o mouse em cima. Acho que vou continuar com o código sugerido com visual mais (visivel) de qualquer forma, obrigado pela ajuda. @"Strilk"
Re: Ações de moderação em dropdown
Olá @Fiel Luis,
Verifique se as engrenagens aparecem com este código:
Atenciosamente,
RafaelS.
Verifique se as engrenagens aparecem com este código:
- Código:
/***
* Application: Actions of moderation.
* Description: This application shows a shortcut menu for the moderation in the list of topics.
* Version: 1.03182014-jq1.9.1 - (Dodekatheon / 2) + (Hermes = Zeus + Maia)
* Made and Optimizations by JScript - 2014/03/18
* View more in: http://ajuda.forumeiros.com
* Copyright (c) 2013 JScript <jscriptbrasil at live dot com>
* This work is free. You can redistribute it and/or modify it
* under the terms of the WTFPL, Version 2
*/
/***
* System Defined Variables - Do not edit if you don't know!
***/
var oMTConfig = {
sInfo: '<!--' +
'* Application: Actions of moderation.' +
'* Description: This application shows a shortcut menu for the moderation in the list of topics.' +
'* Version: 1.03182014-jq1.9.1 - (Dodekatheon / 2) + (Hermes = Zeus + Maia)' +
'* Made and Optimizations by JScript - 2014/03/18' +
'* View more in: http://punbb.forumeiros.com/forum & http://ajuda.forumeiros.com' +
'* Copyright (c) 2014 JScript <jscriptbrasil at live dot com>' +
'* This work is free. You can redistribute it and/or modify it' +
'* under the terms of the WTFPL, Version 2' +
'-->',
sErrorMsg: '',
oTopicTitle: {},
sTopicHref: '',
iTopicID: 0,
sTopicTitle: '',
sContent: '<a title="Ações da Moderação" class="ipsModMenu" href="#"> </a>',
sMenu: '<ul style="display: none; position: absolute; z-index: 9999;" class="ipbmenu_content" id="topic_mod_menucontent">' +
'<li style="z-index: 10000;"><a title="Renomear tópico" href="" id="t_rename" onclick="_rename_Topic();return false;" style="z-index: 10000;">Renomear tópico</a></li>' +
//'<li style="z-index: 10000;"><a title="Destacar tópico" href="" id="t_pin" style="z-index: 10000;">Destacar tópico</a></li>' +
//'<li style="z-index: 10000;"><a title="Mudar ícone" href="" id="t_icon" style="z-index: 10000;">Mudar ícone</a></li>' +
'<li style="z-index: 10000;"><a title="Fechar tópico" href="" id="t_lock" style="z-index: 10000;">Fechar tópico</a></li>' +
'<li style="z-index: 10000;"><a title="Mover tópico" href="" id="t_move" style="z-index: 10000;">Mover tópico</a></li>' +
'<li style="z-index: 10000;"><a title="Enviar para lixeira" href="" id="t_hide" style="z-index: 10000;">Reciclar (Ocultar)</a></li>' +
'<li style="z-index: 10000;"><a title="Excluir tópico" href="" id="t_delete" style="z-index: 10000;">Excluir tópico</a></li>' +
'</ul>',
sCSS: '<style>' +
/*'#rename-topic {' +
'display: block;' +
'}' +*/
'.statused tr:hover > .tcr .ipsModMenu, ' +
'.forumline tr td:hover > .postdetails .ipsModMenu, ' +
'ul.topiclist.topics.bg_none dl.icon:hover > .lastpost .ipsModMenu, ' +
'table.ipbtable tbody tr:hover > td.row1.lastaction .ipsModMenu{' +
'visibility: visible;' +
'color: black' +
'}' +
'.ipsModMenu {' +
'background: url("http://i55.servimg.com/u/f55/18/17/62/92/modera10.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0) !important;' +
'display: inline-block;' +
'height: 15px;' +
'margin: 0 8px;' +
'text-indent: -2000em;' +
'vertical-align: middle;' +
'width: 15px;' +
'float: right;' +
'visibility: hidden;' +
/*'margin-top: -6px;' +*/
'color: black' +
'}' +
'.ipbmenu_content {' +
'font-size: 12px;' +
'min-width: 85px;' +
'z-index: 2000;' +
'color: black' +
'}' +
'.ipbmenu_content {' +
'background-color: #F7F9FB;' +
'border: 1px solid #D5DDE5;' +
'box-shadow: 0 6px 6px rgba(0, 0, 0, 0.3);' +
'color: black' +
'}' +
'.ipbmenu_content li:first-child {' +
'padding-top: 0;' +
'color: black' +
'}' +
'.ipbmenu_content li {' +
'border-bottom: 1px solid #D5DDE5;' +
'color: black' +
'}' +
'.ipbmenu_content a {' +
'display: block;' +
'padding: 6px 10px;' +
'text-align: left;' +
'text-decoration: none;' +
'color: black' +
'}' +
'.ipbmenu_content a:hover {' +
'background: none repeat scroll 0 0 #D5DDE5;' +
'color: black' +
'}' +
'.cancel {' +
'font-size: 0.9em;' +
'font-weight: bold;' +
'color: black' +
'}' +
'.input_text {' +
'background: none repeat scroll 0 0 #FFFFFF !important;' +
'border-color: #848484 #C1C1C1 #E1E1E1 !important;' +
'border-radius: 2px 2px 2px 2px !important;' +
'border-style: solid !important;' +
'border-width: 1px !important;' +
'padding: 4px !important;' +
'font: 13px helvetica,arial,sans-serif !important;' +
'color: black' +
'}' +
'#rename-topic .button2 {' +
/*'border-color: #212121;' +
'border-radius: 3px 3px 3px 3px;' +
'box-shadow: 0 1px 0 0 #5C5C5C inset, 0 2px 3px rgba(0, 0, 0, 0.2);' +
'border-style: solid;' +
'border-width: 1px;' +*/
'cursor: pointer;' +
'padding: 4px 10px !important;' +
'min-width: 0 !important;' +
'font: 13px helvetica,arial,sans-serif !important;' +
'color: black' +
'}' +
'.input_text:focus {' +
'border-color: #4E4E4E #7C7C7C #A3A3A3;' +
'box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);' +
'color: black' +
'}' +
'#ipsGlobalNotification {' +
'font-weight: bold;' +
'left: 50%;' +
'margin-left: -250px;' +
'position: fixed;' +
'text-align: center;' +
'top: 20px;' +
'z-index: 10000;' +
'color: black' +
'}' +
'.popupWrapper {' +
'background-color: rgba(70, 70, 70, 0.6);' +
'border-radius: 4px 4px 4px 4px;' +
'box-shadow: 0 12px 25px rgba(0, 0, 0, 0.7);' +
'padding: 4px;' +
'color: black' +
'}' +
'.popupInner {' +
'background: none repeat scroll 0 0 #FFFFFF;' +
'box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);' +
'overflow-x: hidden;' +
'overflow-y: auto;' +
'width: 500px;' +
'color: black' +
'}' +
'.ipsPad {' +
'padding: 9px;' +
'color: black' +
'}' +
'</style>',
sTarget: '',
sSearch: '',
sExpression0: '',
sExpression1: ''
};
/***
* User Definition Variables
***/
oMTConfig.sErrorMsg = 'Atenção!\n\n Ocorreu um erro ao editar o título, aguarde 10 segundos e tente novamente!';
oMTConfig.sSavingMsg = 'Atualizando o título do tópico, aguarde...';
oMTConfig.sDoneMsg = 'O título do tópico foi atualizado!';
jQuery(function() {
if (_userdata.user_level >= 1) {
/* Forum versions! */
var phpBB2 = jQuery('.bodyline');
var phpBB3 = jQuery('#phpbb');
var punbb = jQuery('#pun-intro');
var invision = jQuery('#ipbwrapper');
if (phpBB2.length) {
oMTConfig.sTarget = '.forumline td.row3Right span.postdetails';
oMTConfig.sExpression0 = 'oClicked.parent().parent().parent().find("td a.topictitle");';
oMTConfig.sExpression1 = 'jQuery("#page-body .forumline .postbody:first", data).parents("tr:eq(1)").attr("id").split("p")[1];'
} else if (phpBB3.length) {
oMTConfig.sTarget = 'ul.topiclist.bg_none dd.lastpost div[style="float:left;"] span';
oMTConfig.sExpression0 = 'oClicked.parent().parents("dl.icon").find("dd.dterm a.topictitle");';
oMTConfig.sExpression1 = 'jQuery("#main-content .post:first", data).attr("id").split("p")[1];';
} else if (punbb.length) {
oMTConfig.sTarget = '.statused td.tcr';
oMTConfig.sExpression0 = 'oClicked.parents("tr").find(".tcl.tdtopics a.topictitle");';
oMTConfig.sExpression1 = 'jQuery(".posthead:first", data).attr("id").split("p")[1];';
} else if (invision.length) {
oMTConfig.sTarget = 'table.ipbtable tbody td.row1.lastaction';
oMTConfig.sExpression0 = 'oClicked.parents("tr").find("td a.topictitle");';
oMTConfig.sExpression1 = 'jQuery("#main-content .borderwrap .post:first", data).attr("id").split("p")[1];';
};
jQuery(oMTConfig.sCSS).insertBefore('body');
jQuery('body').append(oMTConfig.sInfo + oMTConfig.sMenu);
jQuery(oMTConfig.sTarget).append(oMTConfig.sInfo + oMTConfig.sContent);
jQuery('a.ipsModMenu').click(function() {
var oClicked = jQuery(this);
var oTarget = jQuery('#topic_mod_menucontent');
if (oTarget[0].style.display == 'none') {
oClicked.addClass('menu_active');
oMTConfig.oTopicTitle = eval(oMTConfig.sExpression0);
oMTConfig.sTopicHref = oMTConfig.oTopicTitle.attr('href');
oMTConfig.iTopicID = oMTConfig.sTopicHref.substring(2, oMTConfig.sTopicHref.indexOf("-")); // .split(/[\/t-]/)[2]; <- More fast???
oMTConfig.sTopicTitle = oMTConfig.oTopicTitle.text();
var TID = jQuery('input[name="tid"]').val();
jQuery('#t_lock').attr('href', '/modcp?mode=lock&t=' + oMTConfig.iTopicID + '&tid=' + TID);
jQuery('#t_move').attr('href', '/modcp?mode=move&t=' + oMTConfig.iTopicID + '&tid=' + TID);
jQuery('#t_hide').attr('href', '/modcp?mode=trash&t=' + oMTConfig.iTopicID + '&tid=' + TID);
jQuery('#t_delete').attr('href', '/modcp?mode=delete&t=' + oMTConfig.iTopicID + '&tid=' + TID);
oTarget
.css({
'left': (oClicked.offset().left + oClicked.outerWidth()) - oTarget.outerWidth(),
'top': oClicked.offset().top + oClicked.outerHeight()
})
.fadeIn(400);
jQuery(document).mousedown(function() {
if (!oTarget.is(":hover")) {
jQuery(document).unbind('mousedown');
oClicked.removeClass('menu_active');
oTarget.fadeOut(400);
}
});
} else {
oClicked.removeClass('menu_active');
oTarget.fadeOut(400);
}
return false;
});
}
});
function _rename_Topic() {
oMTConfig.oTopicTitle.hide();
var sHtml =
'<span id="rename-topic">' +
'<input type="text" maxlength="150" size="50" class="input_text" value="' + oMTConfig.sTopicTitle + '" id="rt_input" style="width: 56%; margin-right: 4px;">' +
'<input type="submit" id="rt_submit" class="button2" value="Atualizar" onclick="_rt_commit()" style="margin-right: 4px;">' +
'<a title="Cancelar" class="cancel" id="rt_cancel" href="#" onclick="jQuery(\'#rename-topic\').remove();oMTConfig.oTopicTitle.show();return false;">Cancelar</a>' +
'</span>';
oMTConfig.oTopicTitle.before(sHtml);
jQuery('#rt_input').keydown(function(e) {
if (e.keyCode == 13 && jQuery('#rt_input').val() !== '') {
_rt_commit();
}
});
}
function _rt_commit() {
var iPostID = 0,
user_Msg = '';
var sNewTitle = jQuery('#rt_input').val();
if (sNewTitle == '') return false;
jQuery('body').append('<div id="ipsGlobalNotification"><div class="popupWrapper"><div class="popupInner"><div class="ipsPad">' + oMTConfig.sSavingMsg + '</div></div></div></div>');
jQuery('#rename-topic').css('opacity', '0.4');
jQuery.get(oMTConfig.sTopicHref, function(data) {
iPostID = eval(oMTConfig.sExpression1);
}).done(function() {
jQuery.get("/post?p=" + iPostID + "&mode=editpost", function(data) {
user_Msg = jQuery(data).find('#text_editor_textarea[name="message"]').val();
}).done(function() {
jQuery.post("/post?p=" + iPostID + "&mode=editpost", {
subject: sNewTitle,
message: user_Msg,
edit_reason: 'Título anterior: ' + oMTConfig.sTopicTitle,
attach_sig: '1',
notify: "0",
post: 'Enviar'
}).done(function() {
jQuery('#ipsGlobalNotification').remove();
jQuery('#rename-topic').remove();
oMTConfig.oTopicTitle.show().text(sNewTitle);
jQuery('body').append('<div id="ipsGlobalNotification"><div class="popupWrapper"><div class="popupInner"><div class="ipsPad">' + oMTConfig.sDoneMsg + '</div></div></div></div>');
setTimeout(function() {
jQuery('#ipsGlobalNotification').remove();
}, 4000);
}).fail(function() {
jQuery('#ipsGlobalNotification').remove();
oMTConfig.oTopicTitle.show();
alert(oMTConfig.sErrorMsg);
});
}).fail(function() {
jQuery('#ipsGlobalNotification').remove();
oMTConfig.oTopicTitle.show();
alert(oMTConfig.sErrorMsg);
});
}).fail(function() {
jQuery('#ipsGlobalNotification').remove();
oMTConfig.oTopicTitle.show();
alert(oMTConfig.sErrorMsg);
});
}
Atenciosamente,
RafaelS.
Re: Ações de moderação em dropdown
RafaelS. escreveu:Olá @"Fiel Luis",
Verifique se as engrenagens aparecem com este código:
- Código:
/***
* Application: Actions of moderation.
* Description: This application shows a shortcut menu for the moderation in the list of topics.
* Version: 1.03182014-jq1.9.1 - (Dodekatheon / 2) + (Hermes = Zeus + Maia)
* Made and Optimizations by JScript - 2014/03/18
* View more in: http://ajuda.forumeiros.com
* Copyright (c) 2013 JScript <jscriptbrasil at live dot com>
* This work is free. You can redistribute it and/or modify it
* under the terms of the WTFPL, Version 2
*/
/***
* System Defined Variables - Do not edit if you don't know!
***/
var oMTConfig = {
sInfo: '<!--' +
'* Application: Actions of moderation.' +
'* Description: This application shows a shortcut menu for the moderation in the list of topics.' +
'* Version: 1.03182014-jq1.9.1 - (Dodekatheon / 2) + (Hermes = Zeus + Maia)' +
'* Made and Optimizations by JScript - 2014/03/18' +
'* View more in: http://punbb.forumeiros.com/forum & http://ajuda.forumeiros.com' +
'* Copyright (c) 2014 JScript <jscriptbrasil at live dot com>' +
'* This work is free. You can redistribute it and/or modify it' +
'* under the terms of the WTFPL, Version 2' +
'-->',
sErrorMsg: '',
oTopicTitle: {},
sTopicHref: '',
iTopicID: 0,
sTopicTitle: '',
sContent: '<a title="Ações da Moderação" class="ipsModMenu" href="#"> </a>',
sMenu: '<ul style="display: none; position: absolute; z-index: 9999;" class="ipbmenu_content" id="topic_mod_menucontent">' +
'<li style="z-index: 10000;"><a title="Renomear tópico" href="" id="t_rename" onclick="_rename_Topic();return false;" style="z-index: 10000;">Renomear tópico</a></li>' +
//'<li style="z-index: 10000;"><a title="Destacar tópico" href="" id="t_pin" style="z-index: 10000;">Destacar tópico</a></li>' +
//'<li style="z-index: 10000;"><a title="Mudar ícone" href="" id="t_icon" style="z-index: 10000;">Mudar ícone</a></li>' +
'<li style="z-index: 10000;"><a title="Fechar tópico" href="" id="t_lock" style="z-index: 10000;">Fechar tópico</a></li>' +
'<li style="z-index: 10000;"><a title="Mover tópico" href="" id="t_move" style="z-index: 10000;">Mover tópico</a></li>' +
'<li style="z-index: 10000;"><a title="Enviar para lixeira" href="" id="t_hide" style="z-index: 10000;">Reciclar (Ocultar)</a></li>' +
'<li style="z-index: 10000;"><a title="Excluir tópico" href="" id="t_delete" style="z-index: 10000;">Excluir tópico</a></li>' +
'</ul>',
sCSS: '<style>' +
/*'#rename-topic {' +
'display: block;' +
'}' +*/
'.statused tr:hover > .tcr .ipsModMenu, ' +
'.forumline tr td:hover > .postdetails .ipsModMenu, ' +
'ul.topiclist.topics.bg_none dl.icon:hover > .lastpost .ipsModMenu, ' +
'table.ipbtable tbody tr:hover > td.row1.lastaction .ipsModMenu{' +
'visibility: visible;' +
'color: black' +
'}' +
'.ipsModMenu {' +
'background: url("http://i55.servimg.com/u/f55/18/17/62/92/modera10.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0) !important;' +
'display: inline-block;' +
'height: 15px;' +
'margin: 0 8px;' +
'text-indent: -2000em;' +
'vertical-align: middle;' +
'width: 15px;' +
'float: right;' +
'visibility: hidden;' +
/*'margin-top: -6px;' +*/
'color: black' +
'}' +
'.ipbmenu_content {' +
'font-size: 12px;' +
'min-width: 85px;' +
'z-index: 2000;' +
'color: black' +
'}' +
'.ipbmenu_content {' +
'background-color: #F7F9FB;' +
'border: 1px solid #D5DDE5;' +
'box-shadow: 0 6px 6px rgba(0, 0, 0, 0.3);' +
'color: black' +
'}' +
'.ipbmenu_content li:first-child {' +
'padding-top: 0;' +
'color: black' +
'}' +
'.ipbmenu_content li {' +
'border-bottom: 1px solid #D5DDE5;' +
'color: black' +
'}' +
'.ipbmenu_content a {' +
'display: block;' +
'padding: 6px 10px;' +
'text-align: left;' +
'text-decoration: none;' +
'color: black' +
'}' +
'.ipbmenu_content a:hover {' +
'background: none repeat scroll 0 0 #D5DDE5;' +
'color: black' +
'}' +
'.cancel {' +
'font-size: 0.9em;' +
'font-weight: bold;' +
'color: black' +
'}' +
'.input_text {' +
'background: none repeat scroll 0 0 #FFFFFF !important;' +
'border-color: #848484 #C1C1C1 #E1E1E1 !important;' +
'border-radius: 2px 2px 2px 2px !important;' +
'border-style: solid !important;' +
'border-width: 1px !important;' +
'padding: 4px !important;' +
'font: 13px helvetica,arial,sans-serif !important;' +
'color: black' +
'}' +
'#rename-topic .button2 {' +
/*'border-color: #212121;' +
'border-radius: 3px 3px 3px 3px;' +
'box-shadow: 0 1px 0 0 #5C5C5C inset, 0 2px 3px rgba(0, 0, 0, 0.2);' +
'border-style: solid;' +
'border-width: 1px;' +*/
'cursor: pointer;' +
'padding: 4px 10px !important;' +
'min-width: 0 !important;' +
'font: 13px helvetica,arial,sans-serif !important;' +
'color: black' +
'}' +
'.input_text:focus {' +
'border-color: #4E4E4E #7C7C7C #A3A3A3;' +
'box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);' +
'color: black' +
'}' +
'#ipsGlobalNotification {' +
'font-weight: bold;' +
'left: 50%;' +
'margin-left: -250px;' +
'position: fixed;' +
'text-align: center;' +
'top: 20px;' +
'z-index: 10000;' +
'color: black' +
'}' +
'.popupWrapper {' +
'background-color: rgba(70, 70, 70, 0.6);' +
'border-radius: 4px 4px 4px 4px;' +
'box-shadow: 0 12px 25px rgba(0, 0, 0, 0.7);' +
'padding: 4px;' +
'color: black' +
'}' +
'.popupInner {' +
'background: none repeat scroll 0 0 #FFFFFF;' +
'box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);' +
'overflow-x: hidden;' +
'overflow-y: auto;' +
'width: 500px;' +
'color: black' +
'}' +
'.ipsPad {' +
'padding: 9px;' +
'color: black' +
'}' +
'</style>',
sTarget: '',
sSearch: '',
sExpression0: '',
sExpression1: ''
};
/***
* User Definition Variables
***/
oMTConfig.sErrorMsg = 'Atenção!\n\n Ocorreu um erro ao editar o título, aguarde 10 segundos e tente novamente!';
oMTConfig.sSavingMsg = 'Atualizando o título do tópico, aguarde...';
oMTConfig.sDoneMsg = 'O título do tópico foi atualizado!';
jQuery(function() {
if (_userdata.user_level >= 1) {
/* Forum versions! */
var phpBB2 = jQuery('.bodyline');
var phpBB3 = jQuery('#phpbb');
var punbb = jQuery('#pun-intro');
var invision = jQuery('#ipbwrapper');
if (phpBB2.length) {
oMTConfig.sTarget = '.forumline td.row3Right span.postdetails';
oMTConfig.sExpression0 = 'oClicked.parent().parent().parent().find("td a.topictitle");';
oMTConfig.sExpression1 = 'jQuery("#page-body .forumline .postbody:first", data).parents("tr:eq(1)").attr("id").split("p")[1];'
} else if (phpBB3.length) {
oMTConfig.sTarget = 'ul.topiclist.bg_none dd.lastpost div[style="float:left;"] span';
oMTConfig.sExpression0 = 'oClicked.parent().parents("dl.icon").find("dd.dterm a.topictitle");';
oMTConfig.sExpression1 = 'jQuery("#main-content .post:first", data).attr("id").split("p")[1];';
} else if (punbb.length) {
oMTConfig.sTarget = '.statused td.tcr';
oMTConfig.sExpression0 = 'oClicked.parents("tr").find(".tcl.tdtopics a.topictitle");';
oMTConfig.sExpression1 = 'jQuery(".posthead:first", data).attr("id").split("p")[1];';
} else if (invision.length) {
oMTConfig.sTarget = 'table.ipbtable tbody td.row1.lastaction';
oMTConfig.sExpression0 = 'oClicked.parents("tr").find("td a.topictitle");';
oMTConfig.sExpression1 = 'jQuery("#main-content .borderwrap .post:first", data).attr("id").split("p")[1];';
};
jQuery(oMTConfig.sCSS).insertBefore('body');
jQuery('body').append(oMTConfig.sInfo + oMTConfig.sMenu);
jQuery(oMTConfig.sTarget).append(oMTConfig.sInfo + oMTConfig.sContent);
jQuery('a.ipsModMenu').click(function() {
var oClicked = jQuery(this);
var oTarget = jQuery('#topic_mod_menucontent');
if (oTarget[0].style.display == 'none') {
oClicked.addClass('menu_active');
oMTConfig.oTopicTitle = eval(oMTConfig.sExpression0);
oMTConfig.sTopicHref = oMTConfig.oTopicTitle.attr('href');
oMTConfig.iTopicID = oMTConfig.sTopicHref.substring(2, oMTConfig.sTopicHref.indexOf("-")); // .split(/[\/t-]/)[2]; <- More fast???
oMTConfig.sTopicTitle = oMTConfig.oTopicTitle.text();
var TID = jQuery('input[name="tid"]').val();
jQuery('#t_lock').attr('href', '/modcp?mode=lock&t=' + oMTConfig.iTopicID + '&tid=' + TID);
jQuery('#t_move').attr('href', '/modcp?mode=move&t=' + oMTConfig.iTopicID + '&tid=' + TID);
jQuery('#t_hide').attr('href', '/modcp?mode=trash&t=' + oMTConfig.iTopicID + '&tid=' + TID);
jQuery('#t_delete').attr('href', '/modcp?mode=delete&t=' + oMTConfig.iTopicID + '&tid=' + TID);
oTarget
.css({
'left': (oClicked.offset().left + oClicked.outerWidth()) - oTarget.outerWidth(),
'top': oClicked.offset().top + oClicked.outerHeight()
})
.fadeIn(400);
jQuery(document).mousedown(function() {
if (!oTarget.is(":hover")) {
jQuery(document).unbind('mousedown');
oClicked.removeClass('menu_active');
oTarget.fadeOut(400);
}
});
} else {
oClicked.removeClass('menu_active');
oTarget.fadeOut(400);
}
return false;
});
}
});
function _rename_Topic() {
oMTConfig.oTopicTitle.hide();
var sHtml =
'<span id="rename-topic">' +
'<input type="text" maxlength="150" size="50" class="input_text" value="' + oMTConfig.sTopicTitle + '" id="rt_input" style="width: 56%; margin-right: 4px;">' +
'<input type="submit" id="rt_submit" class="button2" value="Atualizar" onclick="_rt_commit()" style="margin-right: 4px;">' +
'<a title="Cancelar" class="cancel" id="rt_cancel" href="#" onclick="jQuery(\'#rename-topic\').remove();oMTConfig.oTopicTitle.show();return false;">Cancelar</a>' +
'</span>';
oMTConfig.oTopicTitle.before(sHtml);
jQuery('#rt_input').keydown(function(e) {
if (e.keyCode == 13 && jQuery('#rt_input').val() !== '') {
_rt_commit();
}
});
}
function _rt_commit() {
var iPostID = 0,
user_Msg = '';
var sNewTitle = jQuery('#rt_input').val();
if (sNewTitle == '') return false;
jQuery('body').append('<div id="ipsGlobalNotification"><div class="popupWrapper"><div class="popupInner"><div class="ipsPad">' + oMTConfig.sSavingMsg + '</div></div></div></div>');
jQuery('#rename-topic').css('opacity', '0.4');
jQuery.get(oMTConfig.sTopicHref, function(data) {
iPostID = eval(oMTConfig.sExpression1);
}).done(function() {
jQuery.get("/post?p=" + iPostID + "&mode=editpost", function(data) {
user_Msg = jQuery(data).find('#text_editor_textarea[name="message"]').val();
}).done(function() {
jQuery.post("/post?p=" + iPostID + "&mode=editpost", {
subject: sNewTitle,
message: user_Msg,
edit_reason: 'Título anterior: ' + oMTConfig.sTopicTitle,
attach_sig: '1',
notify: "0",
post: 'Enviar'
}).done(function() {
jQuery('#ipsGlobalNotification').remove();
jQuery('#rename-topic').remove();
oMTConfig.oTopicTitle.show().text(sNewTitle);
jQuery('body').append('<div id="ipsGlobalNotification"><div class="popupWrapper"><div class="popupInner"><div class="ipsPad">' + oMTConfig.sDoneMsg + '</div></div></div></div>');
setTimeout(function() {
jQuery('#ipsGlobalNotification').remove();
}, 4000);
}).fail(function() {
jQuery('#ipsGlobalNotification').remove();
oMTConfig.oTopicTitle.show();
alert(oMTConfig.sErrorMsg);
});
}).fail(function() {
jQuery('#ipsGlobalNotification').remove();
oMTConfig.oTopicTitle.show();
alert(oMTConfig.sErrorMsg);
});
}).fail(function() {
jQuery('#ipsGlobalNotification').remove();
oMTConfig.oTopicTitle.show();
alert(oMTConfig.sErrorMsg);
});
}
Atenciosamente,
RafaelS.
Olá, boa tarde! Obrigado o problema foi resolvido.
Obrigado pela dedicação em tentar me ajudar também, Strilk.
Re: Ações de moderação em dropdown
Tópico resolvidoMovido para "Questões resolvidas". |
Tópicos semelhantes
» Ações de moderação com menu dropdown
» Ações de moderação em drop down
» Ações de moderação com menu drop-down
» [Dúvida] Ações de moderação com menu drop-down
» [TUTORIAL] Ações de moderação em menu drop-down
» Ações de moderação em drop down
» Ações de moderação com menu drop-down
» [Dúvida] Ações de moderação com menu drop-down
» [TUTORIAL] Ações de moderação em menu drop-down
Fórum dos Fóruns :: Ajuda e atendimento ao utilizador :: Questões sobre códigos :: Questões resolvidas sobre códigos Javascript e jQuery
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos