smurfa_vr HL-BG Community
Брой мнения : 8114 Дата на регистрация : 31.03.2011 Местожителство : Враца
| Заглавие: Re: Какъв е кода при добавянето на коментар, страницата да не се презарежда? Сря 01 Май 2019, 01:30 | |
| Отговорих ти в другата тема.Кода които променя бутоните на БГ всъщност е този които искаш в тази тема. [You must be registered and logged in to see this link.] ЩЕ ГО ДОБАВЯ И ТУК ЗА ВСЕКИ СЛУЧАИ. Създаваш нов Javascript Codes слагаш кода и поставяш отметка на I n the topics - Код:
-
console.log('//-Written by Chalo ------ Open Source 2014-2016 -----//'); console.log('//--------- http://www.opensourcephpbb3.com ----------//'); console.log('//------------------- Version: 1.5.2 -------------------//'); var os = { lang: { success_reply: 'Съобщението е изпратено успешно', // <--- change this text exactly like is display in your language board flood: 'Flood control is active on this forum, please wait 10 second(s) before replying or posting', newpost: 'A new message has been posted', error_reply: 'Опитай пак', words_reply: 'Съобщението трябва да съдържа поне 5 знака', button_send_reply: 'Изпраща се...', notice_original: 'Няма предварително зададен текст', wait_notice: 'Съобщението се изпраща.', color_a: 'linear-gradient(to bottom, #febbbb 0%,#fe9090 45%,#ff5c5c 100%)', color_b: 'linear-gradient(to bottom, #ffaf4b 0%,#ff920a 100%)', color_c: 'linear-gradient(to bottom, #87e0fd 0%,#53cbf1 40%,#05abe0 100%)', color_d: 'linear-gradient(to bottom, #ff3019 0%,#cf0404 100%)', color_e: 'linear-gradient(to bottom, #d2ff52 0%,#91e842 100%)' }, length_reply: 5, //min letters in the textarea before reply time: 3500, init: function() { os.isTheme = /\/t\d+/g.test(window.location.pathname); os.phpbb2 = document.getElementsByClassName('bodylinewidth').length; os.phpbb3 = document.getElementById('phpbb'); os.invision = document.getElementById('ipbwrapper'); os.punbb = document.getElementById('pun-intro'); os.form_reply = document.forms.post; os.button_reply = os.form_reply.post; os.button_value_reply = os.form_reply.post.value; os.textarea = os.form_reply.message; os.action_reply = os.form_reply.action; os.isTheme && os.post(); }, notice_div: function(c, f) { var a, b, d, e, g; g = document.getElementsByClassName('notice_reply'); b = document.getElementsByClassName('sceditor-group')[0]; d = b.parentNode; a = !g.length ? document.createElement('DIV') : g[0]; e = 'height:20px;line-height: 1.5;border-radius: 3px; text-shadow: 0 1px rgba(255, 255, 255, 0.46);text-align:center'; !g.length && (a.classList.add('notice_reply'), a.setAttribute('style', e), d.insertBefore(a, b)); a.style.display = 'block'; a.innerHTML = 'undefined' == typeof c ? os.lang.notice_original : c; a.style.background = 'undefined' == typeof f ? os.lang.color_a : f; setTimeout(function() { a.style.display == 'block' && (a.style.display = 'none') }, os.time) }, post: function() { var c, h, a, d, b, v, i, x, y, z; h = os.action_reply; os.form_reply && (os.button_reply.onclick = function() { return os.sceditor = $(os.textarea).sceditor('instance'), os.sceditor.updateOriginal(), z = document.getElementsByClassName('new_ajax_post'), z.length && z[0].classList.remove('new_ajax_post'), os.sceditor.val().length > os.length_reply ? (os.button_reply.value = os.lang.button_send_reply, os.XML(os.serialize(os.form_reply) + '&post=1&prevent_post=1', h, function(e) { for (x = e.responseXML, y = x.getElementById(os.phpbb2 ? 'page-body' : 'main'), a = y.innerHTML.indexOf(os.lang.success_reply), b = y.innerHTML.indexOf(os.lang.flood), v = x.getElementsByTagName('a'), i = 0; i < v.length; i++) /\/viewtopic/g.test(v[i].href) && (c = v[i].href, d = v[i].href.match(/(\d+)$/g)[0]); b > 0 ? (os.notice_div(os.lang.flood, os.lang.color_b), os.button_reply.value = os.button_value_reply) : y.innerHTML.indexOf(os.lang.newpost) > 0 ? os.XML(os.serialize(x.forms.posts), '/post', function() { 0 > a ? os.notice_div(os.lang.error_reply) : (os.get_post(c, d), os.button_reply.value = os.button_value_reply) }) : 0 > a ? os.notice_div(os.lang.error_reply) : (os.get_post(c, d), os.button_reply.value = os.button_value_reply, os.notice_div(os.lang.wait_notice, os.lang.color_c)) })) : os.notice_div(os.lang.words_reply, os.lang.color_d), !1 }); }, get_post: function(c, a) { var b, d; os.XML('', c, function(e) { d = e.responseXML; b = d.getElementsByClassName('post--' + a)[0]; b.style.display = 'none'; b.className += ' new_ajax_post'; os.set_post(b); os.sceditor.val(''); os.notice_div(os.lang.success_reply, os.lang.color_e); }) }, set_post: function(h) { var e = os.punbb ? document.getElementsByClassName('topic')[0] : os.phpbb2 ? document.getElementsByClassName('catBottom')[0].parentNode.previousElementSibling : os.phpbb3 ? document.getElementsByName('bottomtitle')[0].previousElementSibling : os.invision && document.getElementsByClassName('topic-footer')[0].previousElementSibling; os.punbb ? e.appendChild(h) : e.parentNode.insertBefore(h, e.nextSibling); os.fadeIn(h, 500); }, XML: function(a, b, f) { var c; c = window.XMLHttpRequest ? new XMLHttpRequest : window.ActiveXObject && (new ActiveXObject('Microsoft.XMLHTTP')); 'undefined' != typeof a ? c.open('POST', b) : c.open('GET', b, true); c.responseType = 'document'; c.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); 'undefined' != typeof a ? c.send(a) : c.send(); c.onreadystatechange = function() { this.readyState == 4 && this.status == 200 && (f(this)); }; }, serialize: function(b) { var a, i, j, s = []; if ('object' == typeof b && 'FORM' == b.nodeName) { var len = b.elements.length; for (i = 0; len > i; i++) if (a = b.elements[i], a.name && !a.disabled && 'file' != a.type && 'reset' != a.type && 'submit' != a.type && 'button' != a.type) if ('select-multiple' == a.type) for (j = b.elements[i].options.length - 1; j >= 0; j--) a.options[j].selected && (s[s.length] = encodeURIComponent(a.name) + '=' + encodeURIComponent(a.options[j].value)); else('checkbox' != a.type && 'radio' != a.type || a.checked) && (s[s.length] = encodeURIComponent(a.name) + '=' + encodeURIComponent(a.value)) } return s.join('&').replace(/%20/g, '+'); }, fadeIn: function(a, b) { var e, d; if (!a) return; a.style.opacity = 0, a.style.filter = 'alpha(opacity=0)', a.style.display = '', a.style.visibility = 'visible', b ? (e = 0, d = setInterval(function() { e += 50 / b, e >= 1 && (clearInterval(d), e = 1), a.style.opacity = e, a.style.filter = 'alpha(opacity=' + e * 100 + ')' }, 50)) : (a.style.opacity = 1, a.style.filter = 'alpha(opacity=1)') } }; $(function() { (document.getElementById('logout') && /\/t\d+/g.test(window.location.pathname) && $.sceditor) && os.init() }); __________________________________________________________________________ [You must be registered and logged in to see this image.] |
|