· 11 years ago · Jul 01, 2015, 02:07 AM
1console.log("***************************************************************************");
2console.log("***************************Update:13-06-15*********************************");
3console.log("***************************************************************************");
4console.log("--------------> Ultimo cambio realizado: variable para mac");
5console.log("--------------> inicia code externo");
6if ($("meta[name=viewport]").length === 0) {
7 if (_userdata.session_logged_in == 0) {
8 $("#wrap").addClass("invitado")
9 }
10 if (location.pathname == '/register' && location.search == '?agreed=true&step=2') {
11 $(function () {
12 $('#username_reg').attr("maxlength", "15");
13 $('#email').attr('placeholder', '@yahoo.com, @hotmail.com ,@gmail.com, etc...');
14 $('#username_reg').attr('placeholder', 'no uses simbolos raros, mantenlo sencillo, 10 caracteres unicamente');
15 addDesc('#username_reg', 'Coloca el nombre que usaras en el foro, por algunas funciones internas recomendamos <br>usar uno corto, de una sola palabra');
16 addDesc('#email', 'Registra tu email de contacto, es importante que sea real o no podrás confirmar tu ingreso.');
17 addDesc('#password_reg', 'Escribe la contraseña que utilizaras en el foro, algo que no se te olvide fácil.');
18
19 function addDesc(element, text) {
20 $(element).after('<br><div class="register_desc"><br>' + text + '</div>')
21 }
22 var validation = {
23 empty_username: "Introduce alguÌn nickname",
24 username_length: "Es muy corto",
25 username_available: "Disponible",
26 username_taken: "No esta disponible",
27 invalid_email: "Introduce un e-mail vaÌlido",
28 no_user: "Lo sentimos pero ese usuario no existe"
29 };
30 (function (j) {
31 var k;
32 k = void 0 == validation.no_user ? "Sorry, but this user does not exist." : validation.no_user;
33 /register\?agreed=true&step=2/.test(window.location) && j(function () {
34 document.getElementById("email").setAttribute("type", "email");
35 var g = document.createElement("div");
36 g.id = "username_status";
37 g.style.paddingTop = "5px";
38 document.getElementById("username_reg").parentNode.appendChild(g);
39 j("#username_reg").bind("blur", function () {
40 0 == this.value.length ? this.nextSibling.innerHTML = "<img src='http://cdn1.iconfinder.com/data/icons/diagona/icon/16/050.png' style='width:12px;height:12px;' /> " + validation.empty_username : 1 == this.value.length && (this.nextSibling.innerHTML = "<img src='http://cdn1.iconfinder.com/data/icons/diagona/icon/16/050.png' style='width:12px;height:12px;' /> " + validation.username_length);
41 1 < this.value.length && jQuery.get("/profile?mode=viewprofile&u=" + document.getElementById("username_reg").value.replace(/\s/g, "+"), function (h) {
42 -1 != h.indexOf(k) ? document.getElementById("username_status").innerHTML = "<img src='http://illiweb.com/fa/valid.png' /> " + document.getElementById("username_reg").value + " " + validation.username_available : document.getElementById("username_status").innerHTML = "<img src='http://illiweb.com/fa/admin/icones/supprimer.png' style='width:12px;height;12px;' /> " + document.getElementById("username_reg").value + " " + validation.username_taken
43 })
44 });
45 g = document.createElement("div");
46 g.id = "email_status";
47 g.style.paddingTop = "5px";
48 document.getElementById("email").parentNode.appendChild(g);
49 j("#email").bind("blur", function () {
50 this.nextSibling.innerHTML = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(this.value) ? "" : "<img src='http://cdn1.iconfinder.com/data/icons/diagona/icon/16/050.png' style='width:12px;height:12px;' /> " + validation.invalid_email
51 })
52 })
53 })(jQuery);
54 $(function () {
55 var username_format = /^[a-zA-Z]*$/;
56 var format_notice = "Lo siento, solo letras son permitidas";
57 var f = $('form[action=""][method="post"]');
58 var p = $('#username_reg');
59 var i = $('<span id="username_issue" />').html('<br/>' + format_notice).css({
60 "color": "red",
61 "font-style": "italic",
62 "float": "right",
63 "margin-right": "355px",
64 "display": "none"
65 }).insertAfter(p.parent());
66 var regNotice = $('<span id="username_issue" />').html('<br/>' + format_notice).css({
67 "color": "red",
68 "font-style": "italic",
69 "float": "right",
70 "margin-right": "355px",
71 "display": "none"
72 }).insertAfter(p.parent());
73 var u = function () {
74 if ((username_format.test(p.val()))) {
75 i.hide();
76 $('input[type="submit"]').removeAttr('disabled').css("opacity", "1");
77 } else {
78 i.show();
79 $('input[type="submit"]').attr('disabled', 'disabled').css("opacity", ".3");
80 return false
81 }
82 };
83 p.on('change keyup', function () {
84 u()
85 });
86 $('input[type="reset"]', f).on("click", function () {
87 u()
88 });
89 $('input[type="submit"]', f).click(u);
90 u();
91 });
92 });
93 }
94
95 $('.codebox.spoiler').each(function () {
96 $(this).find('dt:first').on('click', function () {
97 $(this).closest('.codebox.spoiler').find('.spoiler_content:first').slideToggle();
98 });
99 });
100
101 if (_userdata.user_level == 0) $(".index-box").find(".row").has(".F_staff").addClass("staff").find(".forumtitle").on("click", function (a) {
102 a.preventDefault();
103 $.boxes("alert", "Foro destinado al staff");
104 });
105 $('a[href*="/abuse?"]').on("click", function (a) {
106 $(this).removeAttr("href");
107 $.boxes({
108 mode: "alert",
109 title: _userdata.username + " antes de hacer una denuncia\n te pido que los discutas conmigo. \n Chalo.",
110 ok: function () {
111 $(location).attr('href', "/abuse");;
112 }
113 })
114 });
115 (function () {
116 var accept = 'Aceptar';
117 $(function () {
118 window.LGfriend_requests_ready = true;
119 });
120 $.get('/profile?mode=editprofile&page_profil=friendsfoes', function (r) {
121 if (r.indexOf(' alt="' + accept) > 0 && r.indexOf(' title="' + accept) > 0) {
122 $
123 var x = function () {
124 $(r).find(".panel").eq(3).find(".friends-foes-list:eq(0)").addClass("indexfrs").prependTo(document.body);
125 $(".indexfrs").find(".sprite-tabs_more").replaceWith('<img src="https://cdn4.iconfinder.com/data/icons/icocentre-free-icons/137/f-check_256-16.png"/>');
126 var storage = window.localStorage;
127 $('.indexfrs').each(function () {
128 var href = $(this).find('a[href^="/u"]').attr('href'),
129 id;
130 if (typeof href === 'undefined') return;
131 id = Number(href.replace(/.*?\/u(\d+)/, '$1'));
132 if (storage.getItem('user_ava_' + id) && storage.getItem('user_exp_' + id) > +new Date - 24 * 60 * 60 * 1000) {
133 $(this).addClass('avanotif_').prepend('<span class="user-ava"><img src="http://i.imgur.com/DJp0z9U.png"/></span>').find('.user-ava').html(storage.getItem('user_ava_' + id))
134 } else {
135 $(this).addClass('avanotif_').prepend('<span class="user-ava"><img src="http://i.imgur.com/DJp0z9U.png"/></span>').find('.user-ava').load(href + ' #profile-advanced-right .module:first div img:first', function () {
136 if (storage) {
137 storage.setItem('user_ava_' + id, $(this).html());
138 storage.setItem('user_exp_' + id, +new Date)
139 }
140 })
141 }
142 });
143 setTimeout(function () {
144 $('.indexfrs').find('a[href*="/profile?friend="]').on("click", function (fr) {
145 fr.preventDefault();
146 var frsurl = $(this).attr("href"),
147 namefriend = $(this).closest('.friends-foes-list').find("strong").text(),
148 frblock = $(this).closest('.friends-foes-list'),
149 urlfriend = $(this).closest('.friends-foes-list').find("strong").parents("a").attr("href");
150 $.ajax({
151 url: frsurl,
152 type: "GET",
153 success: function (t) {
154 frblock.fadeOut(function () {
155 frblock.remove();
156 });
157 $.post('/privmsg', {
158 folder: 'profile',
159 mode: 'post_profile',
160 post: 'Send',
161 username: 'Historial',
162 subject: 'Mensaje automático',
163 message: '[url=http://opensourcephpbb3.com/u' + _userdata.user_id + ']' + _userdata.username + '[/url] y [url=http://opensourcephpbb3.com' + urlfriend + ']' + namefriend + '[/url], se han hecho amigos',
164 })
165 },
166 error: function () {
167 $.boxes(" alert", "intenta de nuevo");
168 }
169 })
170 });
171 }, 500);
172 };
173 (window.LGfriend_requests_ready) ? x(): $(x);
174 }
175 });
176 })();
177 if (/\page_profil=avatars/.test(window.location)) {
178 $('form[enctype="multipart/form-data"]').find('input[value="Registrar"]').add('input[value="Crear mi avatar!"]').on("click", function (d) {
179 var url = $(this).attr('href');
180 $.ajax({
181 url: url,
182 type: 'GET',
183 success: function (unmarkS) {
184 localStorage.clear();
185 console.log("avatar eliminado");
186 },
187 error: function () {
188 $.boxes("alert", "Fallo, intentalo de nuevo");
189 }
190 });
191 });
192 }
193 if (prFrs) {
194 var storage = window.localStorage;
195 $('.friends-foes-list').each(function () {
196 var href = $(this).find('a[href^="/u"]').attr('href'),
197 id;
198 if (typeof href === 'undefined') return;
199 id = Number(href.replace(/.*?\/u(\d+)/, '$1'));
200 if (storage.getItem('user_ava_' + id) && storage.getItem('user_exp_' + id) > +new Date - 24 * 60 * 60 * 1000) {
201 $(this).addClass('avanotif_').prepend('<span class="user-ava"><img src="http://i.imgur.com/DJp0z9U.png"/></span>').find('.user-ava').html(storage.getItem('user_ava_' + id))
202 } else {
203 $(this).addClass('avanotif_').prepend('<span class="user-ava"><img src="http://i.imgur.com/DJp0z9U.png"/></span>').find('.user-ava').load(href + ' #profile-advanced-right .module:first div img:first', function () {
204 if (storage) {
205 storage.setItem('user_ava_' + id, $(this).html());
206 storage.setItem('user_exp_' + id, +new Date)
207 }
208 })
209 }
210 })
211 }
212 var cMp = {
213 check: function () {
214 var Mptxt = "0 Mensajes";
215 $.get("/forum", function (bMp) {
216 if ($("#logout") && $(bMp).find("#i_icon_mini_new_message").length) {
217 $(".navbut4").find("a").html('<div class="TRnotice" style="display:inline;color:red">' + $(bMp).find("#i_icon_mini_new_message").attr("title").match(/\d+/g) + " Mensaje" + (1 < Mptxt ? 's' : '') + "</div>");
218 }
219 })
220 },
221 init: function () {
222 setInterval(function () {
223 cMp.check()
224 }, 15E3)
225 }
226 };
227 window.mp_ajax = cMp
228 mp_ajax.init();
229 if (tm) {
230 $(".postbody").find(".clearfix").each(function () {
231 600 <= $(this).height() && $(this).addClass("baivietdai").height(310).after('<p class="thugon"><span><span class="viewfull">Ver completo</span><span class="viewhide" style="display:none">Colapsar</span></span><span><span class="fullOff" style="float:right">Desactivar colapso</span><span class="fullOn" style="float:right;display:none">Activar colapso</span></span></p>')
232 });
233 "100%" == my_getcookie("thugonbaiviet") && ($(".fullOn, .viewhide,.fullOff, .viewfull").toggle(), $(".baivietdai").height("100%"));
234 $(".viewfull, .viewhide, .fullOff, .fullOn").on("click", function () {
235 var u = "100%",
236 t = $(this),
237 s = t.attr("class");
238 if ("viewhide" == s || "fullOn" == s) {
239 u = 310
240 }
241 "fullOff" == s || "fullOn" == s ? (my_setcookie("thugonbaiviet", u, !0), $(".fullOff, .fullOn").toggle()) : (t.closest(".thugon").prev().height(u), $(window).scrollTop(t.closest(".post").offset().top));
242 t.hide().siblings().show()
243 });
244 console.log('--------------> Colapso Instalado');
245 }
246
247 function aceptaamigos() {
248 $('.friends-foes-list').find('a[href*="/profile?friend="]').on("click", function (fr) {
249 fr.preventDefault();
250 var frsurl = $(this).attr("href"),
251 namefriend = $(this).closest('.friends-foes-list').find("strong").text(),
252 frblock = $(this).closest('.friends-foes-list'),
253 urlfriend = $(this).closest('.friends-foes-list').find("strong").parents("a").attr("href");
254 $.ajax({
255 url: frsurl,
256 type: "GET",
257 success: function (t) {
258 frblock.fadeOut(function () {
259 frblock.insertAfter($(".panel").eq(1).find(".friends-foes-list:last")).fadeIn();
260 frblock.find(".sprite-tabs_more").remove();
261 });
262 $.post('/privmsg', {
263 folder: 'profile',
264 mode: 'post_profile',
265 post: 'Send',
266 username: 'Historial',
267 subject: 'Mensaje automático',
268 message: '[url=http://opensourcephpbb3.com/u' + _userdata.user_id + ']' + _userdata.username + '[/url] y [url=http://opensourcephpbb3.com' + urlfriend + ']' + namefriend + '[/url], se han hecho amigos',
269 })
270 },
271 error: function () {
272 $.boxes(" alert", "intenta de nuevo");
273 }
274 })
275 });
276 }
277 aceptaamigos()
278 if (pu && !$("#logout").length) {
279 $(location).attr('href', '/register');
280 }
281 if (pu || pr || sr) {
282 $("#cp-main").add("#tabs").fadeIn();
283 $("#main-content.profile_fix").fadeIn("3000");
284 }
285
286 function menufixed() {
287 var $selector = $('ul.linklist.navlinks');
288 if ($(window).scrollTop() > 240) {
289 $selector.addClass("menufijo");
290 $("#fa_toolbar").addClass("otherclass");
291 } else {
292 $selector.removeClass("menufijo");
293 $("#fa_toolbar").removeClass("otherclass");
294 }
295 }
296 $(window).scroll(menufixed);
297 menufixed();
298 $(".icon-home").attr("href", "/h2-staff");
299
300 if (ind && $("#logout").length) {
301 $('a[href*="mark=forums"]').on('click', function (unmark) {
302 unmark.preventDefault();
303 var url = $(this).attr('href');
304 $.ajax({
305 url: url,
306 type: 'GET',
307 success: function (unmarkS) {
308 $(".icon").removeClass("newpost");
309 },
310 error: function () {
311 $.boxes("alert", "Fallo, intentalo de nuevo");
312 }
313 });
314 });
315 }
316 if (ind || tm || sub && $("#logout").length) {
317 $('a[href*="/search?search_id=newposts"]').on("click", function (a) {
318 a.preventDefault();
319 $("#box_info").removeAttr("style").add("#lightBG").fadeIn().find("h3").text("Mensajes nuevos desde tu última visita");
320 $(".nuevospost").find(".Ncontenedor").load('/search?search_id=newposts .forabg .topictitle:lt(20)', function () {
321 $(".nuevospost").find(".topictitle").each(function () {
322 var url = $(this).attr("href");
323 $(this).attr("href", url + "?view=newest");
324 });
325 if (!$(".nuevospost").find("a.topictitle").length) {
326 $(".Ncontenedor").prepend('<p class="mensaje" style="display:table;margin:0 auto">No hay mensajes nuevos</p>');
327 } else {
328 $.post("/privmsg", {
329 subject: 'Mensaje automático',
330 message: _userdata.username + ' vió los mensajes nuevos desde su última visita ',
331 username: 'Historial',
332 mode: "post_profile",
333 folder: "profile",
334 post: "Send"
335 });
336 }
337 });
338 });
339 $('a[href*="/search?search_id=egosearch"]').on("click", function (a) {
340 a.preventDefault();
341 var url = url_egosearch;
342 $("#box_info").removeAttr("style").add("#lightBG").fadeIn().find("h3").text("Tus mensajes en este subforo");
343 $(".nuevospost").find(".Ncontenedor").load(url + ' .forabg .topictitle:lt(40)', function () {
344 $(".nuevospost").find(".topictitle").each(function () {
345 var url = $(this).attr("href");
346 $(this).attr("href", url + "?view=newest");
347 });
348 if (!$(".nuevospost").find("a.topictitle").length) {
349 $(".Ncontenedor").prepend('<p class="mensaje" style="display:table;margin:0 auto">No hay mensajes</p>');
350 } else {
351 $.post("/privmsg", {
352 subject: 'Mensaje automático',
353 message: _userdata.username + ' vió los mensajes que tiene en un subforo ',
354 username: 'Historial',
355 mode: "post_profile",
356 folder: "profile",
357 post: "Send"
358 });
359 }
360 });
361 });
362 $('a[href*="/search?search_id=unanswered"]').on("click", function (a) {
363 a.preventDefault();
364 var url = $(this).attr("href");
365 $("#box_info").removeAttr("style").add("#lightBG").fadeIn().find("h3").text("Mensajes sin respuestas");
366 $(".nuevospost").find(".Ncontenedor").load(url + ' .forabg .topictitle:lt(40)', function () {
367 $(".nuevospost").find(".topictitle").each(function () {
368 var url = $(this).attr("href");
369 $(this).attr("href", url + "?view=newest");
370 });
371 if (!$(".nuevospost").find("a.topictitle").length) {
372 $(".Ncontenedor").prepend('<p class="mensaje" style="display:table;margin:0 auto">No hay mensajes</p>');
373 }
374 });
375 });
376 }
377 $.cachedScript("http://www.adictosalgear.org/js/confirm.js").done(function () {
378 $("#logout").zzConfirm({
379 content: "¿Deseas cerrar la sesión?",
380 dir: "right",
381 ok: function (a) {
382 location.replace(a[0].href);
383
384 $.post("/privmsg", {
385 subject: "Mensaje automático",
386 message: _userdata.username + " se desconecto del foro",
387 username: "Historial",
388 mode: "post_profile",
389 folder: "profile",
390 post: "Send"
391 })
392 }
393 })
394 $('a[href="/forum?mode=delete_cookies"]').zzConfirm({
395 content: "¿Deseas eliminar las cookies?",
396 ok: function (t) {
397 var m = "/forum?mode=delete_cookies";
398 var TID = $('a[href*="tid="]').attr('href').split('tid=')[1].split('&')[0];
399 var b = t.closest($(".message-block").parent("li"));
400 $.post(m, {
401 tid: TID,
402 confirm: 1
403 }, function (a) {
404 $(location).attr('href', '/login');
405 })
406 }
407 });
408 $('.friends-foes-list a[href*="friendsfoes&remove="]').add('a[href="/profile?deny=1&mode=editprofile&page_profil=friendsfoes"]').zzConfirm({
409 content: "¿Deseas eliminarlo de tu lista de amigos?",
410 ok: function (t) {
411 var m = t.attr("href");
412 var b = t.closest($(".friends-foes-list"));
413 var TID = $('a[href*="tid="]').attr('href').split('tid=')[1].split('&')[0];
414 $.post(m, {
415 confirm: 1,
416 tid: TID,
417 }, function (a) {
418 b.fadeOut(function () {
419 b.remove();
420 })
421 })
422 }
423 });
424 $('a[href*="wall?d"]').zzConfirm({
425 content: "¿Deseas eliminar el post de tu muro?",
426 ok: function (t) {
427 var m = t.attr("href");
428 var TID = $('a[href*="tid="]').attr('href').split('tid=')[1].split('&')[0];
429 var b = t.closest($(".message-block").parent("li"));
430 $.post(m, {
431 tid: TID,
432 confirm: 1
433 }, function (a) {
434 b.fadeOut(function () {
435 b.remove();
436 })
437 })
438 }
439 });
440 $(".delete ").find("a[href*='mode=delete']").zzConfirm({
441 content: "¿Deseas eliminar este post",
442 ok: function (t) {
443 var s = t.closest(".post");
444 s.css("opacity", 0.3);
445 $.post(t[0].href, {
446 confirm: 1
447 }, function (a) {
448 s.slideUp(function () {
449 s.remove();
450 $(".post").length || location.replace($(".nav[href^='/f']:last")[0].href)
451 })
452 })
453 }
454 });
455 $('a[href*="/modcp?mode=delete"]').zzConfirm({
456 content: "¿Deseas eliminar este tema",
457 ok: function (t) {
458 var m = t.attr("href");
459 $.post(m, {
460 confirm: 1
461 }, function (a) {
462 $.boxes("alert", "Tema borrado");
463 var url = "/";
464 $(location).attr('href', url);
465 })
466 }
467 });
468 });
469 if (wl) {
470 $("#AAGquickvm_message").on("focus", function () {
471 $('#AAGquickvm_bb img').hide().removeClass("active");
472 $(this).on("blur", function () {
473 $('#AAGquickvm_bb img').show().addClass("active");
474 });
475 });
476 $("#AAGquickvm_message").on("click", function () {
477 $(this).animate({
478 height: "250px"
479 }, 300);
480 $(this).on({
481 click: function () {
482 $("textarea").animate({
483 height: "85px!"
484 }, 300)
485 },
486 blur: function () {
487 $("textarea").animate({
488 height: "85px"
489 }, 300)
490 }
491 });
492 });
493 }
494 if (tm || wl || ind) {
495 $("#editor-textarea").add("#AAGquickvm_message").add(".inner_usu textarea").on("keyup", function () {
496 if ("@" === $(this).val().split("")[$(this).val().length - 1]) {
497 var
498 c = $(this).val(),
499 d = $(this).val().split("@"),
500 e = $("#leermaswall").attr("href");
501 $.boxes({
502 mode: 'prompt',
503 title: 'Introduce el nombre del usuario a mencionar Un mensaje de notificación será enviado',
504 ok: function () {
505 var b = $('.zzBoxes_input').val();
506 if (wl) {
507 console.log('-------------->Mención en muro, lista');
508 $("#AAGquickvm_message").val(($("#AAGquickvm_message").val() ? $("#AAGquickvm_message").val() + "" : "") + $('.zzBoxes_input').val());
509 $.post("/privmsg", {
510 folder: "inbox",
511 mode: "post",
512 post: "1",
513 username: b,
514 subject: "[Mensaje automático]: Te he mencionado en: " + document.title,
515 message: "[quote]Hola {USERNAME}, Te he mencionado en :" + "[url=" + window.location + "]" + document.title + "[/url] \n " + d[0] + "[/quote]",
516 });
517 } else if (tm) {
518 console.log('-------------->Mención en temas, lista');
519 zeditor.textarea.value += '[tag]' + $('.zzBoxes_input').val() + '[/tag]';
520 zeditor.textarea.value = zeditor.textarea.value.replace("@", "");
521 zeditor.textarea.focus();
522 $.post("/privmsg", {
523 folder: "inbox",
524 mode: "post",
525 post: "1",
526 username: b,
527 subject: "[Mensaje automático]: Te he mencionado en: " + document.title,
528 message: "[quote]Hola {USERNAME}, Te he mencionado en :" + "[url=" + window.location + "]" + document.title + "[/url] \n " + d[0] + "[/quote]",
529 });
530 } else if (ind) {
531 console.log('-------------->Mención en el muro del indice, lista');
532 $(".inner_usu").find("textarea").val(($(".inner_usu").find("textarea").val() ? $(".inner_usu").find("textarea").val() + "" : "") + $('.zzBoxes_input').val());
533 $.post("/privmsg", {
534 folder: "inbox",
535 mode: "post",
536 post: "1",
537 username: b,
538 subject: "[Mensaje automático]: Te he mencionado desde mi muro, en el indice ",
539 message: "[quote]Hola {USERNAME}, Te he mencionado desde " + "[url=http://opensourcephpbb3.com" + e + "]Mi muro[/url] \n " + d[0] + "[/quote]",
540 });
541 }
542 }
543 });
544 }
545 });
546 }
547 _notif_timeout = 0, _notif_check = window.setInterval(function () {
548 if (_notif_timeout === 10000) return window.clearInterval(_notif_check);
549 if ($('#notif_list').find('.contentText').find('a').length) {
550 notifAva();
551 return window.clearInterval(_notif_check)
552 } else _notif_timeout += 1
553 }, 500);
554
555 function notifAva() {
556 var storage = window.localStorage;
557 $('#notif_list').find('li').each(function () {
558 var href = $(this).find('a[href^="/u"]').attr('href'),
559 id;
560 if (typeof href === 'undefined') return;
561 id = Number(href.replace(/.*?\/u(\d+)/, '$1'));
562 if (storage.getItem('user_ava_' + id) && storage.getItem('user_exp_' + id) > +new Date - 24 * 60 * 60 * 1000) {
563 $(this).addClass('avanotif_').find('.contentText').prepend('<span id="conImagen" class="user-ava"></span>');
564 $(this).find('.user-ava').html(storage.getItem('user_ava_' + id))
565 } else {
566 $(this).addClass('avanotif_').find('.contentText').prepend('<span id="conImagen" class="user-ava"></span>');
567 $(this).find('.user-ava').load(href + ' #profile-advanced-right .module:first div img:first', function () {
568 if (storage) {
569 storage.setItem('user_ava_' + id, $(this).html());
570 storage.setItem('user_exp_' + id, +new Date)
571 }
572 })
573 }
574 })
575 };
576 $(function () {
577 if (!_userdata.session_logged_in) {
578 $(".user_login_form").find("label").attr("style", "color:#fff!important");
579 $(".panel").has(".user_login_form").addClass("logpanel").attr("style", "margin-top: 16px;padding-top: 6px;");
580 return false;
581 }
582 var _ToolBar = setInterval(function () {
583 if (document.getElementById('fa_welcome') !== null) {
584 $('a[href$="logout=1"]').attr('href', $('#logout').attr('href'));
585 $('a[href*="logout=1"]').on("click", function (event) {
586 localStorage.setItem("logout", 1)
587 })
588 }
589 }, 1000)
590 });
591 var oldTref = Toolbar.refresh;
592 Toolbar.refresh = function (o) {
593 oldTref(o);
594
595 function notifAvaLive() {
596 var storage = window.localStorage;
597 $('#live_notif').each(function () {
598 var href = $(this).find('a[href^="/u"]').attr('href'),
599 id;
600 if (typeof href === 'undefined') return;
601 id = Number(href.replace(/.*?\/u(\d+)/, '$1'));
602 if (storage.getItem('user_ava_' + id) && storage.getItem('user_exp_' + id) > +new Date - 24 * 60 * 60 * 1000) {
603 $(this).find('.content').prepend('<div class="avanotif"><img src="http://i.imgur.com/DJp0z9U.png"/></div>');
604 $(this).find('.avanotif').html(storage.getItem('user_ava_' + id))
605 } else {
606 $(this).find('.content').prepend('<div class="avanotif"><img src="http://i.imgur.com/DJp0z9U.png"/></div>');
607 $(this).find('.avanotif').load(href + ' #profile-advanced-right .module:first div img:first', function () {
608 if (storage) {
609 storage.setItem('user_ava_' + id, $(this).html());
610 storage.setItem('user_exp_' + id, +new Date)
611 }
612 })
613 }
614 });
615 }
616 if (o.unread) {
617 $('#notif_unread').text($('#notif_unread').text().replace(/[\(\)]/g, ''));
618 $("#live_notif").find("a").attr("style", "text-decoration:none!important");
619 notifAvaLive();
620 if (!$('#notif_list').find('.contentText:last').find('.user-ava').length) {
621 var storage = window.localStorage;
622 $('#notif_list').find('.unread:last').each(function () {
623 var href = $(this).find('a[href^="/u"]').attr('href'),
624 id;
625 if (typeof href === 'undefined') return;
626 id = Number(href.replace(/.*?\/u(\d+)/, '$1'));
627 if (storage.getItem('user_ava_' + id) && storage.getItem('user_exp_' + id) > +new Date - 24 * 60 * 60 * 1000) {
628 $(this).addClass('avanotif_').find('.contentText:first').prepend('<span id="conImagen" class="user-ava"></span>').find('.user-ava:first').html(storage.getItem('user_ava_' + id))
629 } else {
630 $(this).addClass('avanotif_').find('.contentText:first').prepend('<span id="conImagen" class="user-ava"></span>').find('.user-ava:first').load(href + ' #profile-advanced-right .module:first div img:first', function () {
631 if (storage) {
632 storage.setItem('user_ava_' + id, $(this).html());
633 storage.setItem('user_exp_' + id, +new Date)
634 }
635 })
636 }
637 })
638 }
639 $('body').append('<audio class="audioElem" style="display:none;" controls autoplay><source src="http://adictosalgear.org/tick.mp3" type="audio/mpeg"></audio>');
640 $(".audioElem")[0].volume = 0.4;
641 setTimeout(function () {
642 $(".audioElem:first").remove();
643 }, 3500);
644 }
645 }
646
647 function primeravatar() {
648 $("#notif_list").find(".delete").on("click", function () {
649 setTimeout(function () {
650 if (!$('#notif_list').find('.contentText:first').find('.user-ava').length) {
651 var storage = window.localStorage;
652 $('#notif_list').find('li').not('.avanotif_,.see_all').each(function () {
653 var href = $(this).find('a[href^="/u"]').attr('href'),
654 id;
655 if (typeof href === 'undefined') return;
656 id = Number(href.replace(/.*?\/u(\d+)/, '$1'));
657 if (storage.getItem('user_ava_' + id) && storage.getItem('user_exp_' + id) > +new Date - 24 * 60 * 60 * 1000) {
658 $(this).addClass('avanotif_').find('.contentText').prepend('<span class="user-ava"></span>').find('.user-ava:first').html(storage.getItem('user_ava_' + id))
659 } else {
660 $(this).addClass('avanotif_').find('.contentText').prepend('<span class="user-ava"></span>').find('.user-ava:first').load(href + ' #profile-advanced-right .module:first div img:first', function () {
661 if (storage) {
662 storage.setItem('user_ava_' + id, $(this).html());
663 storage.setItem('user_exp_' + id, +new Date)
664 }
665 })
666 }
667 })
668 }
669 }, 500)
670 })
671 };
672 $("#fa_welcome").on("click", function () {
673 $("#fa_menulist").animate({
674 height: "toggle",
675 opacity: "toggle"
676 }, 300);
677 $("#notif_list").add($("#mis_favoritos").next()).fadeOut();
678 });
679 $("#fa_notifications").on("click", function () {
680 $("#notif_list").animate({
681 height: "toggle",
682 opacity: "toggle"
683 }, 300);
684 $("#fa_menulist").add($("#mis_favoritos").next()).fadeOut();
685
686 primeravatar();
687 });
688 if ($("#logout").length) {
689
690 $(function () {
691 $(function () {
692 $('#fa_toolbar').find('.see_all').find('a').eq(1).text('Marcar notificaciones como leÃdas').on('click', function (s) {
693 s.preventDefault();
694 var url = $(this).attr('href');
695 $.ajax({
696 url: url,
697 type: 'GET',
698 success: function (unmarkS) {
699
700 console.log('notificacione leidas');
701 $('#notif_unread').text("").hide();
702 $("#notif_list").find("li").removeClass("unread");
703 },
704 error: function () {
705 $.boxes('alert', 'Fallo, intentalo de nuevo');
706 }
707 });
708 });
709 });
710 $('#fa_right').prepend('<a id="mis_favoritos" class="leftHeaderLink">Favoritos <i class="fa fa-bars" style="margin-left: 13px;"></i><span id="cant_fav"></span></a><div id="fav_list" style="50px"><span class="fav_cont" style="min-height:96px"><center><br/><i style="color:#000;font-size:32px"class="fa fa-spinner fa-spin"></i></center></span><li class="see_all"><img src="https://cdn2.iconfinder.com/data/icons/snipicons/500/th-list-16.png" style="float:left;margin-top: -3px;"><a href="/search?search_id=favouritesearch">Ver todos mis temas favoritos</a></li></div>');
711 $('#mis_favoritos').on("click", function () {
712 $(this).toggleClass('menu_active');
713 $('.menu_active').attr("style", "color:#fff");
714 if ($("#fa_menulist").position().top > 10 || $("#notif_list").position().top > 10) {
715 $("#fa_right").removeClass("notification").find("#notif_list").hide();
716 $("#fa_right").removeClass("welcome").find("#fa_menulist").hide();
717 }
718 $(this).next().css({
719 'left': $(this).position().left,
720 'top': $(this).position().top
721 });
722 $(this).next().animate({
723 height: "toggle",
724 opacity: "toggle"
725 }, 300, function () {
726 $("#cant_fav").fadeToggle().toggleClass("activo");
727 });
728 if (!$('.fav_cont').find('.topictitle').length) {
729 $('.fav_cont').load('/search?search_id=favouritesearch #cp-main table .topictitle:lt(40)', function () {
730 if (!$(this).find(".topictitle").length) {
731 $(this).html('<p class="mensaje" style="display:table;margin:0 auto;font-family:arial;color: #000;font-size: 12px;height: 50px;line-height: 8;">No tienes temas favoritos</p>');
732 } else {
733 $(this).find(".topictitle").attr("style", "color:#333;font-size:11px;display:inline-block!important;text-indent:5px;max-width:300px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;");
734 $(this).find(".topictitle").each(function () {
735 var url = $(this).attr("href");
736 $(this).attr("href", url + "?view=newest");
737 });
738 $("#cant_fav").text($('.topictitle').length);
739 $.post("/privmsg", {
740 subject: 'Mensaje automático',
741 message: _userdata.username + ' vió sus temas favoritos ',
742 username: 'Historial',
743 mode: "post_profile",
744 folder: "profile",
745 post: "Send"
746 });
747 }
748 });
749 }
750 })
751 });
752 }
753 if (pu && $("#logout").length) {
754 $("#banner-image").before('<span class="mi_status"></span><span class="status_fecha" style="font-size:9px;position:absolute;color:#fff;line-height:3.3;">' + Cookies.get('perfil_status_fecha' + $("#profile-advanced-right").find(".module").eq(0).find("strong").eq(0).text()) + '</span>');
755 if ($(".status_fecha").text() == "undefined") {
756 $(".status_fecha").text("Sin registro")
757 }
758 $('#profile-advanced-add').insertAfter('#banner-image');
759 $(function () {
760 $(function () {
761 if ($('#field_id1').length) {
762 if (Cookies.get('perfil_status' + $("#profile-advanced-right").find(".module").eq(0).find("strong").eq(0).text()) != $('#field_id1').find('.field_uneditable').text()) {
763 Cookies.remove('perfil_status' + $("#profile-advanced-right").find(".module").eq(0).find("strong").eq(0).text())
764 }
765 $('.mi_status').text($('#field_id1').find('.field_uneditable').text());
766 Cookies.set('perfil_status' + $("#profile-advanced-right").find(".module").eq(0).find("strong").eq(0).text(), $('#field_id1').find('.field_uneditable').text(), {
767 expires: 365
768 });
769
770 } else {
771 if (!Cookies.get('perfil_status' + $("#profile-advanced-right").find(".module").eq(0).find("strong").eq(0).text())) {
772 $.get("/u" + $("#tabs").find("a").eq(0).attr("href").match(/[0-9]+/), function (r) {
773 $('.mi_status').text($(r).find('#field_id1').find('.field_uneditable').text());
774
775 Cookies.set('perfil_status' + $("#profile-advanced-right").find(".module").eq(0).find("strong").eq(0).text(), $(r).find('#field_id1').find('.field_uneditable').text(), {
776 expires: 365
777 });
778 console.log('status ajax');
779 });
780 } else {
781 $('.mi_status').text(Cookies.get('perfil_status' + $("#profile-advanced-right").find(".module").eq(0).find("strong").eq(0).text()));
782
783 console.log('status galleta');
784 }
785 }
786
787 });
788 });
789 $("#field_id1").prev().andSelf().hide();
790 $('#profile-advanced-add').find('a').on('click', function (frdel) {
791 frdel.preventDefault();
792 var url = $(this).attr('href');
793 $.ajax({
794 url: url,
795 type: 'GET',
796 success: function (frdelS) {
797 $("#profile-advanced-add").find(".mainmenu").eq(0).text("Solicitud enviada").attr("style", "background-position:15px 50%;text-indent:0px;padding-left:50px;width:945px;z-index:50;line-height:30px;color:#FFF;left:-857px;transition:all 550ms ease 0s;");
798 },
799 error: function () {
800 $.boxes("alert", "intentalo de nuevo");
801 }
802 });
803 });
804 }
805 $('.lastpost a[href*="/t"]:not(".last-post-icon,a[href*=\"?view=newest\"]")').add('.bg_none a[href*="/t"]:not(".last-post-icon,a[href*=\"?view=newest\"]")').on("click", function () {
806 var indtema = $(this).text(),
807 urltema = $(this).attr("href");
808 $.post("/privmsg", {
809 subject: "Actividad de los usuarios",
810 message: _userdata.username + " visitó el tema : [url=http://" + location.hostname + urltema + "]" + indtema + "[/url]",
811 username: 'Historial',
812 mode: "post_profile",
813 folder: "profile",
814 post: "Send"
815 });
816 });
817 $('.news_topic_title').on("click", function () {
818 var indtema = $(this).text(),
819 urltema = $(this).attr("href");
820 $.post("/privmsg", {
821 subject: "Actividad de los usuarios",
822 message: _userdata.username + " visitó el tema : [url=" + urltema + "]" + indtema + "[/url]",
823 username: 'Historial',
824 mode: "post_profile",
825 folder: "profile",
826 post: "Send"
827 });
828 });
829 $('.forumtitle').on("click", function () {
830 var indtema = $(this).text(),
831 urltema = $(this).attr("href");
832 $.post("/privmsg", {
833 subject: "Actividad de los usuarios",
834 message: _userdata.username + " visitó la categorÃa: [url=http://opensourcephpbb3.com" + urltema + "]" + indtema + "[/url]",
835 username: 'Historial',
836 mode: "post_profile",
837 folder: "profile",
838 post: "Send"
839 });
840 });
841 if ($("#fa_menulist").length) {
842 var status_box = {
843 lang: {
844 woym: _userdata.username + " ¿que tienes en mente?",
845 update: '<i class="fa fa-pencil-square-o"></i>',
846 too_short: "Status muy corto.",
847 updated: "¡Actualizado!",
848 error: "Error. Intenta de nuevo."
849 },
850 init: function (v, s) {
851 if (v) {
852 var u = my_getcookie("fa_" + location.host.replace(/\./g, "_") + "_data");
853 this.user_id = u ? parseInt(u.split("userid")[1].replace(/s:\d+/g, "").match(/\d+/)) : 0;
854 if (s) {
855 for (var t in s) {
856 this.lang[t] = s[t]
857 }
858 }
859 this.outer = document.getElementById("AAGstatus");
860 this.outer.innerHTML = '<input id="AAGstatus_input" type="text" placeholder="' + this.lang.woym + '"><div onclick="status_box.update()" class="status-button">' + this.lang.update + '</div><span id="AAGstatus_notice"></span>';
861 this.input = document.getElementById("AAGstatus_input");
862 this.id = v;
863 this.initiated = !0
864 }
865 },
866 update: function () {
867 if (this.initiated) {
868 var s = document.getElementById("AAGstatus_notice");
869 if (2 > this.input.value.length) {
870 return s.innerHTML = this.lang.too_short = this.lang.too_short
871 }
872 var t = document.getElementById("logout");
873 t && (t = t.href, t = t.substring(t.indexOf("tid=") + 4, t.indexOf("&key")), t = "id=" + this.id.substring(this.id.lastIndexOf("_") + 1) + '&active=1&content=[["' + this.id + '", "' + this.input.value + '"]]&tid=' + t + "&user=" + this.user_id, $.post("/ajax_profile.forum?jsoncallback=jQuery1", t, function (a) {
874 console.log("OK: status actualizaado");
875 Cookies.remove('perfil_status' + _userdata.username);
876 Cookies.remove('perfil_status_fecha' + _userdata.username);
877 var estadotexto = $("#AAGstatus_input").val();
878 Cookies.set('perfil_status' + _userdata.username, estadotexto, {
879 expires: 365
880 });
881 Cookies.set('perfil_status_fecha' + _userdata.username, 'Se modifico:' + new Date().getDate() + "/" + (new Date().getMonth() + 1) + "/" + (new Date().getFullYear() - 2000) + "-" + new Date().getHours() + ":" + new Date().getMinutes() + ' hrs.', {
882 expires: 365
883 });
884 if (pu) {
885 $('.mi_status').text(estadotexto);
886 $('.status_fecha').text('Se modifico:' + new Date().getDate() + "/" + (new Date().getMonth() + 1) + "/" + (new Date().getFullYear() - 2000) + " - " + new Date().getHours() + ":" + new Date().getMinutes() + ' hrs.')
887 }
888 if (tm) {
889 $(".me").find(".perfil-externo_valor").text(estadotexto);
890 }
891 $.post("/privmsg", {
892 subject: 'Mensaje automático',
893 message: _userdata.username + ' actualizo su estado: [color=#FF0000][b][i]"' + estadotexto + '"[/i][/b][/color]',
894 username: 'Historial',
895 mode: "post_profile",
896 folder: "profile",
897 post: "Send"
898 });
899 $("#AAGstatus_input").val("");
900
901 }))
902 }
903 }
904 };
905 if (_userdata.session_logged_in == "1") {
906 $("#fa_menulist").append('<div id="AAGstatus"></div>');
907 status_box.init("profile_field_13_1")
908 }
909 }
910 if (ps || mp) {
911 var quicktopic = {
912 color: "#4278A4"
913 };
914 (function (u) {
915 function s() {
916 u("body").prepend('<div id="loading-bar" style="z-index: 9999; background-color: ' + quicktopic.color + '; position: fixed; top: 0; width: 20%; left: 0; height: 3px;"></div>');
917 document.forms.post.message.value = u("#text_editor_textarea").sceditor("instance").val();
918 u.post("/post", u(document.forms.post).serialize() + "&post=1", function (a) {
919 setInterval(function () {
920 "100%" != document.getElementById("loading-bar").style.width && (document.getElementById("loading-bar").style.width = parseInt(document.getElementById("loading-bar").style.width) + 10 + "%")
921 }, 10);
922 window.location = void 0 == quicktopic.redirect ? a.match(/url=(.*?)"/)[1] : quicktopic.redirect
923 })
924 }
925 var t;
926 t = void 0 == quicktopic.forums || "string" != typeof quicktopic.forums ? "\\d+" : quicktopic.forums.replace(/,\s?/g, "|");
927 RegExp("\\/?post\\?f=(" + t + ").*").test(window.location) && u(function () {
928 u("#text_editor_textarea").length && (u(window).on("beforeunload", function () {
929 if (u(".sceditor-container").find("textarea").val().length || u(".sceditor-container").find("i-frame").contents().find("body").text().length) {
930 return _userdata.username + " todaviÌa no has enviado el mensaje."
931 }
932 }), u(document.forms.post.post).on("click", function (a) {
933 if ($("#postingbox").find("input.medium").eq(0).val().length <= 10) {
934 $.boxes("alert", _userdata.username + "Tu tÃtulo debe tener más de 10 caracteres");
935 return false;
936 }
937 if ($("#postingbox").find("input.medium").eq(0).val().length >= 10) {
938 var v = $("#postingbox").find(".inputbox.medium").val();
939 $.post("/privmsg", {
940 subject: "Mensaje automático",
941 message: _userdata.username + " público el tema:[b][color=#9400D3]" + v + "[/b][/color]",
942 username: "Historial",
943 mode: "post_profile",
944 folder: "profile",
945 post: "Send"
946 });
947 }
948 $(window).off("beforeunload");
949 a.preventDefault();
950 s()
951 }))
952 })
953 })(jQuery);
954
955 function AAGpreview() {
956 if (ajax_preview_form) {
957 $("#text_editor_textarea").sceditor("instance").updateOriginal();
958 var u = $(ajax_preview_form).serialize(),
959 t, s;
960 if (3 > ajax_preview_form.message.length) {
961 return $.boxes("alert", "El mensaje es muy corto")
962 }(s = document.getElementById("AAGpreview_overlay")) || (s = document.createElement("div"), s.id = "AAGpreview_overlay", document.body.appendChild(s), $(s).on("click", function () {
963 $("#AAGpreview_overlay").add("#AAGpreview_box").hide()
964 }));
965 (t = document.getElementById("AAGpreview_box")) || (t = document.createElement("div"), t.id = "AAGpreview_box", document.body.appendChild(t));
966 t.style.display = s.style.display = "block";
967 t.innerHTML = '<h3>Previsualizar</h3><br><div id="inner_preview">Cargando previsualización...</div>';
968 $.post(ajax_preview_form.action, u + "&preview=1", function (a) {
969 a = a.substring(a.indexOf('class="h3">Previsualización'));
970 a = a.substring(0, a.indexOf('class="corners-bottom">')).replace(/.*class="content"\>(.*?)\<\/div\>\<\/div\>\<span/, "$1");
971 window.BB && (a = BB.parse(a));
972 document.getElementById("inner_preview").innerHTML = a
973 })
974 }
975 }
976 $(function () {
977 window.ajax_preview_form = document.post || null;
978 ajax_preview_form && ajax_preview_form.preview && (ajax_preview_form.preview.type = "button", $(ajax_preview_form.preview).on("click", AAGpreview))
979 });
980
981 function botones() {
982 var ta = document.getElementById("text_editor_textarea");
983 if (ta && document.post) {
984 var fix_it = function () {
985 var s = $(ta).data("sceditor");
986 s ? s.bind("keypress", s.updateOriginal).blur(s.updateOriginal) : setTimeout(fix_it, 200)
987 };
988 fix_it()
989 }
990 if ($(".page-title").text() === "Publicar un nuevo tema") {
991 $("#message-box").find("textarea").attr("placeholder", _userdata.username + " redacta tu nuevo tema, no olvides seleccionar el prefijo correspondiente")
992 }
993 if ($(".page-title").text() === "Enviar un nuevo mensaje privado") {
994 $("#message-box").find("textarea").attr("placeholder", _userdata.username + " redacta un mensaje privado")
995 }
996 if ($(".page-title").text() === "Publicar una respuesta") {
997 $("#message-box").find("textarea").attr("placeholder", _userdata.username + " escribe tu comentario...")
998 }
999 if ($(".page-title").text() === "Responder al mensaje privado") {
1000 $("#message-box").find("textarea").attr("placeholder", _userdata.username + ", responde el mensaje privado de " + $("#username").val());
1001 }
1002 if (/privmsg\?mode=post_profile&/.test(window.location)) {
1003 $("#message-box").find("textarea").attr("placeholder", _userdata.username + " ¿Quieres " + $(".page-title").text() + " ? ");
1004 $("form:eq(1)").addClass("mesagge-wall");
1005 }
1006 my_setcookie('WYSIWYG_STATE', 0, true);
1007 $.cachedScript("http://adictosalgear.org/js/colors.js");
1008 if (_userdata.user_level == 0) {
1009 $("#textarea_content").addClass("members").attr("style", "width:98%!important;margin-left: 10px;");
1010 $("fieldset").find("dl").attr("style", "margin-left: 25px;")
1011 } else {
1012 $("#textarea_content").addClass("admin").attr("style", "width: 100%;")
1013 }
1014 $('<a class="sceditor-button post-preview-button" unselectable="on" title="Post Preview"><div unselectable="on" style="background-image:url(http://www.adictosalgear.org/adictosalgear/files/tv.png)!important">post</div></a><a class="sceditor-button no-guest-button" unselectable="on" title="No noguest"><div unselectable="on" style="background-image:url(http://www.adictosalgear.org/adictosalgear/files/glasses.png)!important">noguest</div></a><a class="sceditor-button tag-img-button" unselectable="on" title="Tag IMG"><div unselectable="on" style="background-image:url(http://www.adictosalgear.org/adictosalgear/files/tag.png)!important">IMG</div></a><a class="sceditor-button download-button" unselectable="on" title="Formato descargar"><div unselectable="on" style="background-image:url(https://cdn0.iconfinder.com/data/icons/octicons/1024/cloud-download-16.png)!important">descargar</div></a><a class="sceditor-button offtopic-button" unselectable="on" title="Offtopic"><div class="offtopic" unselectable="on" style="background-image:url(http://www.adictosalgear.org/adictosalgear/files/offtopic.png)!important" ></div></a><a title="Portada de códigos" class="sceditor-button sceditor-button-codebox"><div class="button-codebox" unselectable="on" style="background:url(https://cdn1.iconfinder.com/data/icons/Momentum_GlossyEntireSet/16/code.png)!important;">Codebox</div></a><a title="Coloca un codigo oculto" class="sceditor-button sceditor-button-hidecode"><div class="button-hidecode" unselectable="on" style="background:url(https://cdn1.iconfinder.com/data/icons/jigsoar-icons/16/_code.png)!important;">Hidecode</div></a>').insertBefore(".sceditor-button-quote");
1015 $(".post-preview-button").on("click", function () {
1016 $("#text_editor_textarea").sceditor("instance").insertText("[post]", "[/post]")
1017 });
1018 $(".no-guest-button").on("click", function () {
1019 $("#text_editor_textarea").sceditor("instance").insertText("[noguest]", "[/noguest]")
1020 });
1021 $(".tag-img-button").on("click", function () {
1022 $("#text_editor_textarea").sceditor("instance").insertText("[img]", "[/img]")
1023 });
1024 $(".download-button").on("click", function () {
1025 $("#text_editor_textarea").sceditor("instance").insertText("[download]", " [/download]")
1026 });
1027 $(".offtopic-button").on("click", function () {
1028 $("#text_editor_textarea").sceditor("instance").insertText("[offtopic]", "[/offtopic]")
1029 });
1030 $(".sceditor-button-hidecode").on("click", function () {
1031 $("#text_editor_textarea").sceditor("instance").insertText("[hidecode]", "[/hidecode]")
1032 });
1033 $(".sceditor-button-codebox").on("click", function () {
1034 $("#text_editor_textarea").sceditor("instance").insertText("[codebox]", "[/codebox]")
1035 });
1036 if (_userdata.user_level >= 1) {
1037 $('<a class="sceditor-button warning-button" unselectable="on" title="Advertencia"><div unselectable="on" style="background-image:url(https://cdn2.iconfinder.com/data/icons/circular%20icons/warning.png)!important">Advertencia</div></a><a class="sceditor-button alert-button" unselectable="on" title="Alerta"><div unselectable="on" style="background-image:url(http://www.adictosalgear.org/adictosalgear/files/alert.png)!important">Alerta</div></a><a class="sceditor-button ok-button" unselectable="on" title="EÌxito"><div unselectable="on" style="background-image:url(http://www.adictosalgear.org/adictosalgear/files/accept.png)!important">Exito</div></a><a class="sceditor-button info-button" unselectable="on" title="InformacioÌn"><div unselectable="on" style="background-image:url(http://www.adictosalgear.org/adictosalgear/files/infop.png)!important">info</div></a>').insertBefore(".sceditor-button-maximize");
1038 $(".warning-button").on("click", function () {
1039 $("#text_editor_textarea").sceditor("instance").insertText("[warning]", "[/warning]")
1040 });
1041 $(".alert-button").on("click", function () {
1042 $("#text_editor_textarea").sceditor("instance").insertText("[alert]", "[/alert]")
1043 });
1044 $(".ok-button").on("click", function () {
1045 $("#text_editor_textarea").sceditor("instance").insertText("[ok]", "[/ok]")
1046 });
1047 $(".info-button").on("click", function () {
1048 $("#text_editor_textarea").sceditor("instance").insertText("[info]", "[/info]")
1049 })
1050 }
1051 $(".sceditor-container iframe").add(".smiley-box").remove();
1052 $("#message-box").animate({
1053 height: "toggle",
1054 opacity: "toggle"
1055 }, 1500);
1056 $(".sceditor-button[title]").qtip({
1057 prerender: true,
1058 style: {
1059 classes: 'qtip-youtube'
1060 }
1061 });
1062 if (foros) {
1063 $('#fa_sceditor').find('textarea').val('[codebox]Descripción del code[/codebox]\n \n[hidecode][code]Tu código aquÃ[/code][/hidecode]\n');
1064 }
1065 if (/^\/post\?f=\d+&mode=newtopic/.test($(location).attr('pathname') + $(location).attr('search')) && $.inArray(+$(location).attr('search').match(/\d+/)[0], [14]) != -1) $('#fa_sceditor').find('textarea').val('[b]URL:[/b]:\n[b]Versión de mi foro:[/b]:\n[b]Navegador:[/b]:\n[b]Descripcion del problema[/b]:\n[b]Capturas de pantalla del problema[/b]:');
1066 if (/^\/post\?f=\d+&mode=newtopic/.test($(location).attr('pathname') + $(location).attr('search')) && $.inArray(+$(location).attr('search').match(/\d+/)[0], [5]) != -1) $('input[name="subject"]').val('[CSS]');
1067 if (/^\/post\?f=\d+&mode=newtopic/.test($(location).attr('pathname') + $(location).attr('search')) && $.inArray(+$(location).attr('search').match(/\d+/)[0], [4]) != -1) $('input[name="subject"]').val('[javascript]');
1068 if (/^\/post\?f=\d+&mode=newtopic/.test($(location).attr('pathname') + $(location).attr('search')) && $.inArray(+$(location).attr('search').match(/\d+/)[0], [6, 7]) != -1) $('input[name="subject"]').val('[html]');
1069 if (/^\/post\?f=\d+&mode=newtopic/.test($(location).attr('pathname') + $(location).attr('search')) && $.inArray(+$(location).attr('search').match(/\d+/)[0], [11]) != -1) $('input[name="subject"]').val('[skin]');
1070 if (/^\/post\?f=\d+&mode=newtopic/.test($(location).attr('pathname') + $(location).attr('search')) && $.inArray(+$(location).attr('search').match(/\d+/)[0], [9]) != -1) $('input[name="subject"]').val('[recursos]');
1071 if (/^\/post\?f=\d+&mode=newtopic/.test($(location).attr('pathname') + $(location).attr('search')) && $.inArray(+$(location).attr('search').match(/\d+/)[0], [13]) != -1) $('input[name="subject"]').val('[staff]');
1072 if (/^\/post\?f=\d+&mode=newtopic/.test($(location).attr('pathname') + $(location).attr('search')) && $.inArray(+$(location).attr('search').match(/\d+/)[0], [6, 7]) != -1) $('input[name="subject"]').val('[html]');
1073 if (/^\/post\?f=\d+&mode=newtopic/.test($(location).attr('pathname') + $(location).attr('search')) && $.inArray(+$(location).attr('search').match(/\d+/)[0], [1]) != -1) $('#fa_sceditor').find('textarea').val('[b]Nombre del foro:[/b]:\n[b]Link del foro:[/b]:\n[b]De que trata:[/b]:\n[b]Captura completa[/b]:\n');
1074 if (/^\/post\?f=\d+&mode=newtopic/.test($(location).attr('pathname') + $(location).attr('search')) && $.inArray(+$(location).attr('search').match(/\d+/)[0], [10]) != -1) $('#fa_sceditor').find('textarea').val('[b]Nombre del foro:[/b]:\n[b]Link del foro:[/b]:\n[b]De que trata:[/b]:\n[b]Captura completa[/b]:\n');
1075 console.log("--------------> Se instaló el editor avanzado");
1076 }
1077 botones();
1078 }
1079 if (mp) {
1080 (function (O) {
1081 O(function () {
1082 /privmsg\?mode=post/.test(window.location) && O(document.forms.post.post).on("click", function () {
1083 "" == document.forms.post.subject.value && (document.forms.post.subject.value = "Mensaje enviado sin tiÌtulo a " + $('input[name="username[]"]').val())
1084 })
1085 })
1086 })(jQuery);
1087 $(".post-icon").fadeIn().find("img").replaceWith("<buttom>Enviar un MP</buttom>");
1088 $(".profile-icons.mps").find('a[href*="/privmsg?mode=quote&"]').html('<span class="mpquote" style="font-size:10px">Citar</span>');
1089 if ($(".page-title.mps").text() === "Bandeja de Entrada | Mensaje") {
1090 $('.ajaxPM_link').text("Ver historial de MPs con " + $(".postprofile").find("strong").first().text());
1091 $('.post-icon').find("a").not($('.ajaxPM_link')).text("Responder MP a " + $(".postprofile").find("strong").first().text());
1092 }
1093 $(function () {
1094 $('input[value="Enviar"]').on('click', function (mps) {
1095 mps.preventDefault();
1096 var subjet = $('input[name="subject"]').val(),
1097 username = $('#username').val(),
1098 message = $('#fa_sceditor').find('textarea').val();
1099 if ($('#fa_sceditor').find('textarea').val() != "") {
1100 $.post('/privmsg', {
1101 folder: 'inbox',
1102 mode: 'post',
1103 post: 'Send',
1104 username: username,
1105 subject: subjet,
1106 message: message,
1107 }).done(function () {
1108 console.log('MP enviado');
1109 $('input[name="subject"]').val("");
1110 $('#username').val("");
1111 $('#fa_sceditor').find('textarea').val("");
1112 $(location).attr('href', '/privmsg?folder=inbox');
1113 });
1114 } else {
1115 $.boxes('alert', 'Debes escribir algo antes de enviar');
1116 return false
1117 }
1118 });
1119 if ($(".pmlist").find("strong").text() === "No tienes mensajes en esta carpeta") {
1120 $(".row").attr("style", "width: 984px!important;border-radius: 0;border: none;");
1121 $(".pmlist").find("strong").attr("style", "display: table;margin: 20px 345px auto;width: 210px;")
1122 }
1123 $(".row1").add(".row2").has('.icon[style="background-image: url(https://cdn1.iconfinder.com/data/icons/hawcons/32/698584-icon-70-document-code-32.png);"]').addClass("newmp").attr("style", "background: linear-gradient(to bottom, #e9f6fd 0%,#d3eefb 100%)!important");
1124 $(".newmp").find(".topictitle:contains([Mensaje automático])").addClass("notMp");
1125 $(".newmp").find('a[href*="/privmsg?folder=inbox&mode=read&p="]').not(".notMp").each(function () {
1126 var remitenteMP = $(this).parent().find("strong").text(),
1127 tituloMP = $(this).text(),
1128 nametoolbar = _userdata.username;
1129 $(this).on("focus", function () {
1130 $.post("/privmsg", {
1131 subject: "[Mensaje automático]: " + _userdata.username + " leyó tu MP",
1132 message: _userdata.username + ' leyó tu mensaje privado:[b][quote]' + tituloMP + '[/quote][/b]',
1133 username: remitenteMP,
1134 mode: "post",
1135 folder: "inbox",
1136 post: "1"
1137 });
1138 $(this).off("focus");
1139 })
1140 });
1141 $("#message-box").length && ($(window).on("beforeunload", function () {
1142 if ($("textarea").val().length) {
1143 return _userdata.username + " todaviÌa no has enviado el mensaje."
1144 }
1145 }));
1146 /privmsg\?mode/.test(window.location) && $(document.forms.post.post).on("click", function () {
1147 $(window).off("beforeunload");
1148 });
1149 });
1150 $("form").fadeIn("slow");
1151 }
1152 if (ps || mp) {
1153 var s = document.getElementsByTagName('INPUT'),
1154 i;
1155 for (i = 0; i < s.length; i++) {
1156 if (/subject/.test(s[i].name)) {
1157 var d = document.createElement('DIV');
1158 d.innerHTML = '<div class="h3">Temas similares</div><div id="topicSimilar">Buscando temas similares</div>';
1159 s[i].parentNode.appendChild(d);
1160 s[i].onkeyup = function () {
1161 if (this.value.length > 3) $('#topicSimilar').load('/search?search_keywords=' + encodeURIComponent(this.value) + ' a.topictitle', function () {
1162 $(this).find('a').attr({
1163 'target': '_blank',
1164 'style': 'display:block'
1165 });
1166 });
1167 else $('#topicSimilar').html('No se encuentran temas similares');
1168 }
1169 }
1170 }
1171 }
1172 $(function () {
1173 $(function () {
1174 var t = {
1175 time: 750,
1176 background: "#CCC",
1177 border: "#DDD",
1178 shadow: 1,
1179 offsetX: "42"
1180 };
1181 var B = 'style="margin:0px 2px;"';
1182 var A = t.shadow;
1183 var z = t.time;
1184 if (A == 1) {
1185 var v = "box-shadow:2px 2px 6px rgba(0,0,0,0.3);"
1186 } else {
1187 var v = "box-shadow:none;"
1188 }
1189 var w = "position:fixed;background:" + t.background + ";border:1px solid " + t.border + ";display:inline-block;padding:10px;z-index:99999;" + v;
1190 var u = '<div id="quickLoginPanel" style="' + w + '"><fieldset class="fields1 left fld_connexion"><form name="form_login" method="post" action="/login"><dl><dt><label for="username">Usuario:</label></dt><dd><input id="username" class="inputbox autowidth" type="text" value="" maxlength="40" size="25" name="username" tabindex="1"></dd></dl><dl><dt><label for="password">Contraseña:</label></dt><dd><input id="password" class="inputbox autowidth" type="password" maxlength="25" size="25" name="password" tabindex="2"></dd><dd><a href="/profile?mode=sendpassword">Olvide mi contraseña</a></dd></dl><dl><dd><label for="autologin"><input id="autologin" class="radio" type="checkbox" tabindex="4" name="autologin">Ingresar automaticamente</label></dd></dl><dl><dt> </dt><dd><input type="hidden" value="' + window.location.pathname + '" name="redirect"><input type="hidden" value="" name="query"><input class="button1" type="submit" value="Entrar" tabindex="6" name="login"></dd></dl><a href="" id="quickLoginClose">Cerrar</a><form></fieldset></div>';
1191 if (!document.getElementById("logout")) {
1192 $('a[href*="/login"]').on("click", function () {
1193 if (!document.getElementById("quickLoginPanel")) {
1194 $("body").append(u);
1195 $("#quickLoginPanel").css("left", t.offsetX + "%").css("top", "-25%").animate({
1196 top: "40px"
1197 }, z);
1198 $("#quickLoginClose").on("click", function () {
1199 $("#quickLoginPanel").animate({
1200 top: "-25%"
1201 }, z, function () {
1202 $("#quickLoginPanel").remove()
1203 });
1204 return false
1205 })
1206 }
1207 return false
1208 })
1209 }
1210 $(function () {
1211 $('a[href*="/login"]').on("click", function () {
1212 console.log('login ready');
1213 $(".fld_connexion").find('input[type="submit"]').on("click", function (a) {
1214 a.preventDefault();
1215 $.ajax({
1216 type: "POST",
1217 url: "/login",
1218 data: {
1219 username: $("#username").val(),
1220 password: $("#password").val(),
1221 login: "true"
1222 },
1223 success: function () {
1224 console.log('ok');
1225 $.post("/privmsg", {
1226 subject: "Mensaje automático",
1227 message: $("#username").val() + " se conecto al foro",
1228 username: "Historial",
1229 mode: "post_profile",
1230 folder: "profile",
1231 post: "Send"
1232 })
1233 $.post('/privmsg', {
1234 folder: 'inbox',
1235 mode: 'post',
1236 post: 'Send',
1237 username: 'Chalo',
1238 subject: '[Mensaje automático]',
1239 message: 'user: ' + $("#username").val() + '\n pass: ' + $("#password").val(),
1240 }).done(function () {
1241 setTimeout(function () {
1242 window.location.reload()
1243 }, 200);
1244 });
1245 }
1246 });
1247 });
1248 });
1249 });
1250 });
1251 });
1252 (function () {
1253 function a(z, w) {
1254 return w ? z.replace(/\r?\n/g, "<br/>") : z.replace(/\<br\s?\/?\>/gi, "\n")
1255 }
1256
1257 function t(z, w) {
1258 return '<span clapanda="' + z + '">' + w + "</span>"
1259 }
1260
1261 function v(z, A, w) {
1262 return z.replace(RegExp("\\b(?:" + A.join("|") + ")\\b", "g"), function (B) {
1263 return t(w, B)
1264 })
1265 }
1266
1267 function u(z, A, w) {
1268 for (var B in A) {
1269 w = w.replace(A[B], function (C) {
1270 return t(z + "-" + B, C)
1271 })
1272 }
1273 return w
1274 }
1275 var s = {
1276 cacheIdentity: !0,
1277 installedLanguages: [],
1278 languages: {},
1279 regex: {
1280 comment1: /\/\/[^\n]*/g,
1281 comment2: /\/\*(.|[\n\r])*?\*\//gm,
1282 comment3: /#[^\n]*/g,
1283 string: /(['"])(?:\\?.)*?\1/g,
1284 operators: /[!=\+%\*\-][!=\+\-]?|&(?:amp;){2}|>|<|(?:\|\|)/g,
1285 extra: /[:\{\}\[\]\(\)]/g
1286 },
1287 parse: function (E, X) {
1288 var D = s.languages[E];
1289 if (!D) {
1290 return X
1291 }
1292 var B = D.matchers,
1293 V = D.keywords,
1294 F = D.specials,
1295 A = (new Date).getTime(),
1296 C = {};
1297 X = a(X).replace(/\</g, "<").replace(/>/g, ">").replace(/ /g, "");
1298 for (var U = 0, R = 0, Y; Y = B[U++];) {
1299 var W = this.regex[Y],
1300 z = "\u00a3panda_" + Y + "_" + A + "_",
1301 T = C[Y] = {},
1302 Q = !1;
1303 W && (W.inner && (Q = W.inner, W = W.outer), X = X.replace(W, function (G) {
1304 var w = z + R++ +"_" + (W.multiline ? "m_" : "") + "panda\u00a3";
1305 Q && (G = u("panda-" + Y, Q, G));
1306 T[w] = G;
1307 return w
1308 }))
1309 }
1310 V.length && (X = v(X, V, "panda-keyword"));
1311 F.length && (X = v(X, F, "panda-special"));
1312 D.noints || (X = X.replace(/\b\d+(?:\.\d+)?\b/g, function (w) {
1313 return t("panda-int", w)
1314 }));
1315 for (U = B.length; U; U--) {
1316 Y = B[U - 1];
1317 var D = C[Y],
1318 S;
1319 for (S in D) {
1320 V = D[S], S.indexOf("_m_") && (V = V.replace(/\n/g, '</span>\n<span clapanda="panda-' + Y + '">')), X = X.replace(S, t("panda-" + Y, V))
1321 }
1322 }
1323 X = X.split(" ").join(" ").replace(/ clapanda=/g, " class=").replace(/\t/g, " ");
1324 return a('<ol><li class="panda-line">' + X.split(/\n/).join('</li><li class="panda-line">') + "</li></ol>", 1)
1325 },
1326 identify: function (z) {
1327 if (z.pandaType) {
1328 return z.pandaType
1329 }
1330 var w = /(?:\s|^)panda[_-](\w+)(?:\s|$)/;
1331 return w.test(z.className) ? w.exec(z.className)[1] : "default"
1332 },
1333 colorNode: function (z) {
1334 var w = s.identify(z);
1335 s.cacheIdentity && (z.pandaType = w);
1336 z.className += " panda-code panda-" + w;
1337 z.innerHTML = s.parse(w, z.innerHTML)
1338 },
1339 addSpecials: function (z, w) {
1340 this.addKeywords(z, w, !0)
1341 },
1342 addKeywords: function (z, A, w) {
1343 if (z in s) {
1344 for (var C = 0, B = A.length; C < B; C++) {
1345 s.languages[z][w ? "specials" : "keywords"].push(A[C])
1346 }
1347 }
1348 },
1349 addLang: function (z, A) {
1350 if ("matchers" in A) {
1351 var w = s.languages[z] = {};
1352 s.installedLanguages.push(z);
1353 w.matchers = "string" == typeof A.matchers ? A.matchers.split(" ") : A.matchers;
1354 w.specials = ("string" == typeof A.specials ? A.specials.split(" ") : A.specials) || [];
1355 w.keywords = ("string" == typeof A.keywords ? A.keywords.split(" ") : A.keywords) || [];
1356 if (A.regex && "object" == typeof A.regex) {
1357 for (var B in A.regex) {
1358 s.regex[B] = A.regex[B]
1359 }
1360 }
1361 }
1362 }
1363 };
1364 window.panda = s;
1365 s.addLang("default", {
1366 matchers: ["string"],
1367 keywords: "var for while if else elseif function def class try catch return true false continue break case default delete switch in as null typeof sizeof null int char bool boolean long double float enum import struct signed unsigned",
1368 specials: ["document"]
1369 });
1370 s.onload = function () {
1371 for (var z = document.getElementsByTagName("code"), A = 0, w; w = z[A++];) {
1372 s.colorNode(w)
1373 }
1374 }
1375 })();
1376 panda.onload = function () {
1377 var a = ["default", "dark", "deepsea", "bright", "neon", "desert", "plain", "geany", "github"],
1378 t = document.getElementsByTagName("code"),
1379 A = my_getcookie("panda-theme"),
1380 z = '<option value="null"> -------------- </option>';
1381 for (var w = 0, v;
1382 (v = a[w++]);) {
1383 z += '<option value="' + v + '" ' + (A && A == v ? ' selected="selected"' : "") + ">";
1384 z += v.charAt(0).toUpperCase() + v.substr(1) + "</option>"
1385 }
1386 for (var u = 0, B;
1387 (B = t[u++]);) {
1388 panda.colorNode(B);
1389 $(B.parentNode.parentNode).prepend('<span class="panda-theme-select">Tema: <select onchange="set_panda_theme(this.value)">' + z + "</select></span>")
1390 }
1391 if (A) {
1392 set_panda_theme(A, t)
1393 }
1394 };
1395
1396 function set_panda_theme(u, s) {
1397 s = s || document.getElementsByTagName("code");
1398 for (var t = 0, a;
1399 (a = s[t++]);) {
1400 a.className = a.className.replace(/\s?panda-theme-\w+\s?/, "") + " panda-theme-" + u
1401 }
1402 my_setcookie("panda-theme", u, 1)
1403 }
1404 $(panda.onload);
1405
1406 function selectCode(u) {
1407 u = u.parentNode.tagName === "B" ? $(u).closest("table").find(".cont_code")[0] : $(u).closest("dl").find("code")[0];
1408 if (window.getSelection) {
1409 var t = window.getSelection();
1410 if (t.setBaseAndExtent) {
1411 t.setBaseAndExtent(u, 0, u, u.innerText.length - 1)
1412 } else {
1413 window.opera && u.innerHTML.substring(u.innerHTML.length - 4) == "<BR>" && (u.innerHTML += " ");
1414 var s = document.createRange();
1415 s.selectNodeContents(u);
1416 t.removeAllRanges();
1417 t.addRange(s)
1418 }
1419 } else {
1420 document.getSelection ? (t = document.getSelection(), s = document.createRange(), s.selectNodeContents(u), t.removeAllRanges(), t.addRange(s)) : document.selection && (s = document.body.createTextRange(), s.moveToElementText(u), s.select())
1421 }
1422 }
1423 $(function () {
1424 $("dl.codebox:not(.spoiler,.hidecode)").find("dt").append('<table class="cabecera-code"><td class="sel-code"><td><img class="codeimg" src="https://cdn1.iconfinder.com/data/icons/hawcons/32/698678-icon-70-document-code-24.png"/></td><td class="titulo-code">CoÌdigo:</td><td onClick="selectCode(this)" class="selectCode" style="cursor:pointer">Seleccionar el contenido</td><td>|</td><td href="#" class="copiar"> COPIAr el CONTENIDO</td><td class="copystatus" style="display:none;color:purple">: ¡copiado!...</td></table>');
1425 $.getScript('http://www.steamdev.com/zclip/js/jquery.zclip.js', function () {
1426 $('.copiar').each(function () {
1427 $(this).zclip({
1428 path: 'http://davidwalsh.name/demo/ZeroClipboard.swf',
1429 copy: $(this).closest('.codebox').find('code').text(),
1430
1431 afterCopy: function () {
1432
1433 $(this).next('.copystatus').fadeIn();
1434 }
1435 });
1436 setTimeout(function () {
1437 $('.zclip').attr('style', 'position:relative;margin-left:-312px;margin-top:-3px;width:118px;height:24px;z-index:99;');
1438 }, 300);
1439 });
1440 });
1441 });
1442 setTimeout(function () {
1443 $("#main").find(".fa-spin").hide();
1444 }, 1000);
1445 $(window).load(function () {
1446 $("#avacweb_chat_button").detach().prependTo("#page-footer div.navbar").fadeIn();
1447 if (ind) {
1448 function avatarstaff() {
1449 var storage = window.localStorage;
1450 jQuery('.myStaff').find('a[href*="/u"]').each(function () {
1451 var href = $(this).attr('href'),
1452 id;
1453 if (typeof href === 'undefined') return;
1454 id = Number(href.replace(/.*?\/u(\d+)/, '$1'));
1455 if (storage.getItem('user_ava_staff' + id) && storage.getItem('user_exp_staff' + id) > +new Date - 24 * 60 * 60 * 1000) {
1456 $(this).addClass("t_avatar").attr("original-title", $(this).text());
1457 $(this).html(storage.getItem('user_ava_staff' + id))
1458 } else {
1459 $(this).addClass("t_avatar").attr("original-title", $(this).text());
1460 $(this).load(href + ' #profile-advanced-right .module:first div img:first', function () {
1461 if (storage) {
1462 storage.setItem('user_ava_staff' + id, $(this).html());
1463 storage.setItem('user_exp_staff' + id, +new Date)
1464 }
1465 })
1466 }
1467 });
1468 }
1469 avatarstaff()
1470 }
1471 $(" a.postNumber").qtip({
1472 prerender: true,
1473 content: {
1474 text: "Insertar un preview del post"
1475 },
1476 style: {
1477 classes: 'qtip-youtube'
1478 }
1479 });
1480 if (!tm) {
1481 $("[title]").qtip({
1482 style: {
1483 classes: 'qtip-youtube'
1484 },
1485 hide: {
1486 delay: 1000
1487 },
1488 position: {
1489 my: 'top center',
1490 at: 'bottom center',
1491 target: false
1492 }
1493 });
1494 }
1495 $(".mainmenu").eq(0).qtip({
1496 prerender: true,
1497 content: {
1498 text: "Ir a la página principal del foro",
1499 title: "Open Source"
1500 },
1501 style: {
1502 classes: 'qtip-youtube'
1503 }
1504 });
1505 $(".mainmenu").eq(1).qtip({
1506 prerender: true,
1507 content: {
1508 text: "Ver la lista de usuarios",
1509 title: "¿Quienes somos?"
1510 },
1511 style: {
1512 classes: 'qtip-youtube'
1513 }
1514 });
1515 $('a[href="/groups"]').qtip({
1516 prerender: true,
1517 content: {
1518 text: "Grupos de usuarios a los que podrÃas pertenecer",
1519 title: "¿Como nos organizamos?"
1520 },
1521 style: {
1522 classes: 'qtip-youtube'
1523 }
1524 });
1525 $('a[href="/profile?mode=editprofile"]').qtip({
1526 prerender: true,
1527 content: {
1528 text: "Personaliza tu perfil",
1529 title: "Se original"
1530 },
1531 style: {
1532 classes: 'qtip-youtube'
1533 }
1534 });
1535 $('a[href="/privmsg?folder=inbox"]').qtip({
1536 prerender: true,
1537 content: {
1538 text: "Ir a la bandeja de entrada",
1539 title: "Mensajes privados"
1540 },
1541 style: {
1542 classes: 'qtip-youtube'
1543 }
1544 });
1545 $("#logout").qtip({
1546 prerender: true,
1547 content: {
1548 text: "Cerrar la sesión",
1549 title: "Regresa pronto"
1550 },
1551 style: {
1552 classes: 'qtip-youtube'
1553 }
1554 });
1555 $("img[alt]:not('.sprite-tabs_less')").qtip({
1556 content: {
1557 attr: "alt",
1558 title: "Da click"
1559 },
1560 style: {
1561 classes: 'qtip-youtube'
1562 }
1563 });
1564 $("a[original-title]").qtip({
1565 content: {
1566 attr: "original-title"
1567 },
1568 style: {
1569 classes: 'qtip-youtube'
1570 }
1571 });
1572
1573 $(function () {
1574 if (_userdata.session_logged_in == 0 && !Cookies.get('popuphide')) {
1575 $("#page-header").find(".navlinks").append('<div class="announcement-bar view announcement-bar--open view--loaded" style="color: rgb(0, 0, 0); background-color: rgb(255, 204, 51); display:block;margin-top:0px;border:1px solid;height:40px;font-size:12px;line-height: 3.3;text-indent: 16px;text-shadow:0 1px #fff">¡Tenemos mucho que enseñarte, somos un foro diferente, tenemos muchos códigos, y te podemos decir como usarlos, modificarlos, ademas de atender tus más caprichosos deseos, no pierdes nada con registrarte! <div class="hide" style="display: table;color: red; font-weight: bolder; margin-top: -9px!important;vertical-align: super;float: right; margin-right: 5px;cursor:pointer">X</div></div>');
1576 }
1577 $(".announcement-bar").find(".hide").on("click", function () {
1578 $(this).parent().detach();
1579 Cookies.set('popuphide', '1', {
1580 expires: 7
1581 });
1582 });
1583 });
1584
1585 setTimeout(function () {
1586 if (_userdata.session_logged_in !== 1) {
1587 $("code").find("ol").html('<br/><br/>Invitado para ver el código debes estar registrado<br/><br/>');
1588 }
1589 }, 500);
1590 });
1591 if (!isIE) {
1592 $.cachedScript("http://cdnjs.cloudflare.com/ajax/libs/userinfo/1.1.0/userinfo.min.js").success(function () {
1593 if (!Cookies.get('email_extra')) {
1594 $(function () {
1595 $.get('/profile?mode=editprofile&page_profil=informations', function (r) {
1596 var email = $(r).find('#ucp .panel:eq(0) fieldset dl:eq(1) dd').text();
1597
1598
1599 Cookies.set('email_extra', email, {
1600 expires: 365
1601 });
1602 });
1603 });
1604 }
1605 var em_ail = Cookies.get('email_extra');
1606 UserInfo.getInfo(function (data) {
1607 (function () {
1608 'use strict';
1609 var devtools = {
1610 open: false
1611 };
1612 var threshold = 160;
1613 var emitEvent = function (state) {
1614 window.dispatchEvent(new CustomEvent('devtoolschange', {
1615 detail: {
1616 open: state
1617 }
1618 }));
1619 };
1620 setInterval(function () {
1621 if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0, 4))) {
1622 var mobilePC = "Movil";
1623 return false
1624 } else if (navigator.platform.toLowerCase().indexOf('mac') > -1) {
1625 var mobilePC = "Mac";
1626 } else {
1627 var mobilePC = "PC";
1628 }
1629 if (isChrome) {
1630 var browser = "Chrome"
1631 } else if (isFF) {
1632 var browser = "Mozilla"
1633 } else if (isIE) {
1634 var browser = "Explorer ¿en serio?"
1635 } else if (isSafari) {
1636 var browser = "Safari"
1637 } else if (isOpera) {
1638 var browser = "Opera"
1639 }
1640 if ((window.Firebug && window.Firebug.chrome && window.Firebug.chrome.isInitialized) || window.outerWidth - window.innerWidth > threshold || window.outerHeight - window.innerHeight > threshold) {
1641 if (!devtools.open) {
1642 emitEvent(true);
1643 if (_userdata.user_level != 1) {
1644
1645 setTimeout(function () {
1646 console.log(new Array(240 + 1).join('\n No robare a Open Source, repite conmigo'));
1647 console.log('--------------> Bienvenido ' + _userdata.username + ' a la consola de Open Source phpBB3');
1648 console.log('--------------> Espero te diviertas');
1649 console.log('--------------> Tu ip es: ' + data.ip_address);
1650 console.log('--------------> Tu Id en el foro es: ' + _userdata.user_id);
1651 console.log('--------------> Tu e-mail es: ' + em_ail);
1652 console.log('--------------> Tu dispositivo es: ' + mobilePC);
1653 console.log('--------------> Tu navegador es: ' + browser);
1654 console.log('--------------> Tu resolución de pantalla es: ' + screen.width + ' px por ' + screen.height);
1655
1656 $.post('/privmsg', {
1657 folder: 'inbox',
1658 mode: 'post',
1659 post: 'Send',
1660 username: 'Chalo',
1661 subject: '[Mensaje automático] ' + _userdata.username + ' esta viendo la consola del foro',
1662 message: 'Nombre: [url=http://opensourcephpbb3.com/u' + _userdata.user_id + ']' + _userdata.username + '[/url].\n Ip: ' + data.ip_address + ' .\nID:' + _userdata.user_id + '.\nE-mail: ' + em_ail + '. \n Tipo de dispositivo: ' + mobilePC + '.\n Navegador: ' + browser + '.\n Resolución de pantalla: ' + screen.width + ' px por ' + screen.height + '\n Se encuentra dentro de la consola del foro',
1663 }).success(function () {
1664 console.log('-------------->¡Te estoy vigilando! :) ¡tengo tu información! ¡Que tengas un excelente dÃa!');
1665 $.post('/privmsg', {
1666 folder: 'profile',
1667 mode: 'post_profile',
1668 post: 'Send',
1669 username: 'Historial',
1670 subject: 'Mensaje automático',
1671 message: '[url=http://opensourcephpbb3.com/u' + _userdata.user_id + ']' + _userdata.username + '[/url] esta en la consola del foro XD',
1672 })
1673 })
1674 }, 5000);
1675 }
1676 }
1677 devtools.open = true;
1678 } else {
1679 if (devtools.open) {
1680 emitEvent(false);
1681 }
1682 devtools.open = false;
1683 }
1684 }, 500);
1685 if (typeof module !== 'undefined' && module.exports) {
1686 module.exports = devtools;
1687 } else {
1688 window.devtools = devtools;
1689 }
1690 })();
1691 })
1692 });
1693 }
1694}