Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Attach(e, t) {
- if (t.search(__PREFIX) == -1 && t.search("admin/") == -1) {
- t = __PREFIX + arguments[1]
- }
- return $("#" + e).loading().load(t)
- }
- function fSubmit(object) {
- object.id.search("Add") !== -1 ? prefix = "a_" : prefix = "e_";
- if (eval("object." + prefix + "mat.value") == -1) {
- prefix == "a_" ? ShowBox("Add", 1) : ShowBox("Edit", 1);
- alert("Selecione uma matéria!");
- return false
- }
- prefix == "a_" ? url = __PREFIX + "addA.php?d=" + gToken() : url = __PREFIX + "edit.php?d=" + gToken() + "&step=2&NOTICE_ID=" + $("#e_id").val();
- if (prefix == "a_") {
- stuff = function () {
- $.post(url, {
- a_til: $("#a_til").val(),
- a_cont: $("#a_cont").val(),
- a_mat: $("#a_mat").val(),
- a_data: $("#a_data").val()
- }, function (c) {
- eval(c)
- })
- };
- if (W.GCasync) {
- $.post("inc/other/google_calendar/Post.php", {
- t: $("#a_til").val(),
- c: $("#a_cont").val(),
- m: parseMat($("#a_mat").val()),
- d: $("#a_data").val()
- }, function (e) {
- k("G-Mail response: " + e, 1);
- if (e.search("Enviado")!==-1) stuff();
- else k("Ocorreu um erro no envio ao g-mail, tente novamente.")
- })
- } else {
- stuff()
- }
- } else {
- $.post(url, {
- e_til: $("#e_til").val(),
- e_cont: $("#e_cont").val(),
- e_mat: $("#e_mat").val(),
- e_data: $("#e_data").val()
- }, function (c) {
- eval(c)
- })
- }
- }
- function ValidForm(e) {
- if (e.id.search("Add") !== -1) {
- prefix = "a_"
- } else {
- prefix = "e_"
- }
- for (var t in [prefix + "til", prefix + "cont", prefix + "data", prefix + "mat"]) {
- if (t == prefix + "mat" && isNaN($("#" + t).val())) {
- return alert("Valor inválido para data")
- }
- if ($("#" + t).val() == "") {
- return alert("Preencha todos os campos!")
- }
- }
- fSubmit(e);
- return true
- }
- function ShowBox() {
- objName = arguments[0], eShake = arguments[1] || 0;
- switch (objName) {
- case "Add":
- if (!loggedin) {
- login();
- return k("Você precisa estar autenticado para fazer isso.")
- }
- if (fbAuth) {
- if ($("body").html().search("fb-root") == -1 || typeof W.fbName !== "string") {
- $.getScript("inc/js/FB.root.js?d=" + gToken())
- }
- }
- $("#Add-A-Box").dialog({
- width: "480px",
- resizable: false,
- modal: true,
- buttons: [{
- text: "Adicionar atividade",
- click: function () {
- $("#Add-A-Box").next(".ui-dialog-buttonpane button:contains('Confirm')").attr("disabled", false);
- if (fbAuth) {
- iAdd = W.setInterval(function () {
- if (location.hash.search("user=") !== -1) {
- W.clearInterval(iAdd);
- $("#Add-A-Form").submit()
- }
- }, 100)
- } else {
- $("#Add-A-Form").submit()
- }
- $(".ui-dialog button:nth-child(1)").button("disable")
- }
- }
- ]
- }).each(function () {
- if (eShake) {
- $(this).effect("shake", 3e3)
- }
- });
- break;
- case "Edit":
- $("#e_id").val(location.href.split("?id=")[1]);
- $.ajax(__PREFIX + "edit.php?d=" + gToken() + "&step=1&NOTICE_ID=" + location.href.split("?id=")[1], {
- success: function (e) {
- if (e.match("INVALID")) {
- alert("Ocorreu um erro fatal.");
- location.reload()
- }
- var t = e.split("%%");
- $("#e_til").val(t[0]);
- $("#e_cont").val(t[1]);
- $("#e_mat").val(t[2]);
- $("#e-select").val(t[2]);
- $("#e_data").val(t[3]);
- $("#Edit-A-Box").dialog({
- width: "480px",
- resizable: false,
- modal: true,
- buttons: [{
- text: "Editar atividade",
- click: function () {
- $("#Edit-A-Form").submit()
- }
- }, {
- text: "Restaurar formulário",
- click: function () {
- $("#Edit-A-Form").each(function () {
- $(this).reset()
- })
- }
- }
- ]
- }).each(function () {
- if (eShake) {
- $(this).effect("shake", 3e3)
- }
- })
- },
- error: function () {
- alert("Ocorreu uma falha na autenticação com o Banco de Dados.\n\nO Script tentará, automaticamente, refazer o pedido em alguns segundos.");
- return setTimeout(function () {
- location.reload()
- }, 3e3)
- }
- });
- break;
- case "Del":
- nID = location.href.split("?id=")[1];
- $("#Del-A-Box").dialog({
- width: "480px",
- resizable: false,
- modal: true,
- buttons: [{
- text: "Prosseguir",
- click: function () {
- $.get(__PREFIX + "delete.php?d=" + gToken(), {
- i: nID
- }, function (D) {
- eval(D);
- $("#Del-A-Box").dialog("destroy")
- })
- }
- }
- ]
- });
- break;
- default:
- break
- }
- }
- function HideBox(e) {
- switch (e) {
- case "Add":
- $("#Add-A-Box").dialog("destroy");
- break;
- case "Edit":
- $("#Edit-A-Box").dialog("destroy");
- break;
- case "Del":
- $("#Del-A-Box").dialog("destroy");
- break;
- case "Log":
- $("#usr-login").dialog("destroy");
- break;
- case "Reg":
- $("#usr-reg").dialog("destroy");
- $("#usr-go-reg").dialog("destroy");
- break;
- case "All":
- try {
- $("#Add-A-Box").dialog("destroy")
- } catch (t) {}
- try {
- $("#Edit-A-Box").dialog("destroy")
- } catch (t) {}
- try {
- $("#Del-A-Box").dialog("destroy")
- } catch (t) {}
- try {
- $("#usr-login").dialog("destroy")
- } catch (t) {}
- try {
- $("#usr-reg").dialog("destroy")
- } catch (t) {}
- try {
- $("#usr-go-reg").dialog("destroy")
- } catch (t) {}
- break
- }
- }
- function reg() {
- $("#usr-reg").dialog({
- width: "480px",
- resizable: false,
- modal: true,
- buttons: [{
- text: "Ciente, e desejo prosseguir com meu registro",
- click: function () {
- $("#usr-reg").dialog("destroy");
- $("#usr-go-reg").dialog({
- width: "480px",
- resizable: false,
- modal: true,
- buttons: [{
- text: "Registrar",
- click: function () {
- $.get(__PREFIX + "register.php?token=" + gToken(), {
- u: $("#r-name").val(),
- p: $("#r-pass").val()
- }, function (E) {
- eval(E)
- })
- }
- }
- ]
- })
- }
- }
- ]
- })
- }
- function login() {
- $("#usr-login").dialog({
- width: "240px",
- resizable: false,
- modal: true,
- buttons: [{
- text: "Autenticar",
- click: function () {
- usr = $("#l-name").val(), passwd = $("#l-pass").val();
- if (usr == "" || passwd == "") {
- k("Preencha todos os campos!");
- return this
- }
- $.get(__PREFIX + "login.php?token=" + gToken(), {
- u: $("#l-name").val(),
- p: $("#l-pass").val()
- }, function (E) {
- eval(E);
- if (E.match("não existe")) {
- $("#usr-login").dialog("destroy")
- }
- })
- }
- }, {
- text: "Criar uma conta",
- click: function () {
- HideBox("Log");
- reg()
- }
- }
- ]
- })
- }
- function logout() {
- $.cookie("user", "", {
- expires: -3600,
- path: "/"
- });
- $.cookie("pass", {
- expires: -3600,
- path: "/"
- });
- W.open("", "_self", "");
- W.close();
- window.W = undefined;
- return false
- }
- function conc(Id) {
- confirm("Você tem certeza?", function () {
- i = parseInt(Id);
- if (!isNaN(i)) {
- $.get(__PREFIX + "conc_actv.php?token=" + gToken(), {
- nID: i
- }, function (f) {
- eval(f)
- })
- }
- })
- }
- function unconc(Id) {
- confirm("Você tem certeza?", function () {
- i = parseInt(Id);
- if (!isNaN(i)) {
- $.get(__PREFIX + "desfconc_actv.php?token=" + gToken(), {
- nID: i
- }, function (f) {
- eval(f)
- })
- }
- })
- }
- top.location != self.location ? top.location = self.location : null;
- $(function () {
- if (navigator.userAgent.search("Chrome") == -1) alert("Para uma melhor exibição deste site, é recomendado usar o Google Chrome.", {
- f: OPTIONS_SHOW_OR_NOT,
- s: 0
- });
- setInterval(function () {
- try {
- $("label").each(function () {
- if ($(this).hasClass("select") == false && $(this).html().match(/option/gi)) $(this).addClass("select")
- });
- if (loggedin == true && typeof W == "object") {
- if ($.cookie("user") == null || $.cookie("user") == "" || $.cookie("pass") == null || $.cookie("pass") == "") {
- W.loggedin = false;
- alert("Sua sessão expirou.");
- dReload()
- }
- }
- $('input[type="submit"],input[type="button"],button').button().css("-webkit-appearance", "none").css("outline", "none");
- $("input,textarea").css("outline", "none");
- $('input[type="data"]').datepicker({
- yearRange: "2013:2013",
- monthNamesShort: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"],
- monthNames: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],
- minDate: Tdate,
- maxDate: "02/12",
- gotoCurrent: true,
- dayNamesShort: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"],
- dayNamesMin: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"],
- dayNames: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"],
- dateFormat: "dd/mm",
- currentText: "Hoje"
- });
- $("#act-accordion").accordion({
- heightStyle: "content"
- })
- } catch (e) {}
- }, 1);
- $("#g-last").load(__PREFIX + "show_actv.php?d=" + gToken(), {}, function (e) {
- $(this).html(e);
- var t = ["fade", "fold", "pulsate", "slide"],
- n = function () {
- return t[Math.floor(Math.random() * t.length)]
- };
- $("#gsite").tabs({
- fx: {
- height: "toggle",
- opacity: "toggle"
- }
- }).show(n(), 1500, function () {
- $("#copyright").show(n(), 3e3)
- })
- });
- $("#l-forgot").click(function (e) {
- var t = e,
- n = e.timeStamp;
- Attach("g-last", "forgot.php?from=" + n);
- HideBox("Log");
- return false
- })
- });
- $.fn.loading = function () {
- $(this).html("<div id='pbar_text'>Carregando (0%)...</div><br><br><div id='progressbar' style='width:600px'></div>");
- return this
- };
- jQuery.fn.load = function (t, n, r) {
- $("#progressbar").progressbar();
- if (typeof t !== "string" && _load) {
- return _load.apply(this, arguments)
- }
- var i, s, o, u = this,
- a = t.indexOf(" ");
- if (a >= 0) {
- i = t.slice(a, t.length);
- t = t.slice(0, a)
- }
- if (jQuery.isFunction(n)) {
- r = n;
- n = undefined
- } else if (n && typeof n == "object") {
- o = "POST"
- }
- if (u.length > 0) {
- jQuery.ajax({
- xhr: function () {
- var t = new W.XMLHttpRequest;
- t.upload.addEventListener("progress", function (t) {
- if (t.lengthComputable) {
- Percent = Math.round(100 * e.loaded / e.total);
- $("#progressbar").progressbar({
- value: Percent
- });
- $("#pbar_text").html(Percent + "%")
- }
- }, false);
- t.addEventListener("progress", function (e) {
- if (e.lengthComputable) {
- Percent = Math.round(100 * e.loaded / e.total);
- $("#progressbar").progressbar({
- value: Percent
- });
- $("#pbar_text").html(Percent + "%")
- }
- });
- return t
- },
- url: t,
- type: o,
- dataType: "html",
- data: n
- }).done(function (e) {
- s = arguments;
- u.html(i ? jQuery("<div>").append(jQuery.parseHTML(e)).find(i) : e)
- }).complete(r && function (e, t) {
- u.each(r, s || [e.responseText, t, e])
- })
- }
- return this
- };
- $.fn.reset = function () {
- $(this).each(function () {
- this.reset()
- });
- return this
- };
- $.cookie = function (e, t, n) {
- if (arguments.length > 1 && String(t) !== "[object Object]") {
- n = jQuery.extend({}, n);
- if (t == null || t == undefined) {
- n.expires = -1
- }
- if (typeof n.expires == "number") {
- var r = n.expires,
- i = n.expires = new Date;
- i.setDate(i.getDate() + r)
- }
- t = String(t);
- return document.cookie = [encodeURIComponent(e), "=", n.raw ? t : encodeURIComponent(t), n.expires ? "; expires=" + n.expires.toUTCString() : "", n.path ? "; path=" + n.path : "", n.domain ? "; domain=" + n.domain : "", n.secure ? "; secure" : ""].join("")
- }
- n = t || {};
- var s, o = n.raw ? function (e) {
- return e
- } : decodeURIComponent;
- return (s = (new RegExp("(?:^|; )" + encodeURIComponent(e) + "=([^;]*)")).exec(document.cookie)) ? o(s[1]) : null
- };
- $(W).keydown(function (e) {
- if (e.ctrlKey && e.altKey) {
- switch (e.keyCode) {
- case 65:
- Attach("g-last", "admin/rcon/index.php?s=" + prompt("Senha de acesso: ", ""));
- break;
- case 66:
- dReload();
- break
- }
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement