Abominacja
BIN
dziennik/attention.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
1477
dziennik/editor_template.js
Normal file
78
dziennik/en.js
Normal file
@@ -0,0 +1,78 @@
|
||||
tinyMCE.addI18n("en.advanced", {
|
||||
underline_desc: "Podkreślenie (Ctrl+U)", //"Podkreślenie (Ctrl+U)",
|
||||
italic_desc: "Kursywa (Ctrl+I)", //"Italic (Ctrl+I)",
|
||||
bold_desc: "Pogrubienie (Ctrl+B)", //"Bold (Ctrl+B)",
|
||||
dd: "Opis definicji", //"Definition Description",
|
||||
dt: "Termin definicji", //"Definition Term ",
|
||||
samp: "Wycinek kodu", //"Code Sample",
|
||||
code: "Kod", //"Code",
|
||||
blockquote: "Blok cytatu", //"Block Quote",
|
||||
h6: "Nagłówek 6", //"Heading 6",
|
||||
h5: "Nagłówek 5", //"Heading 5",
|
||||
h4: "Nagłówek 4", //"Heading 4",
|
||||
h3: "Nagłówek 3", //"Heading 3",
|
||||
h2: "Nagłówek 2", //"Heading 2",
|
||||
h1: "Nagłówek 1", //"Heading 1",
|
||||
pre: "Uprzednio sformatowany", //"Preformatted",
|
||||
address: "Adres", //"Address",
|
||||
div: "DIV", //"DIV",
|
||||
paragraph: "Paragraf", //"Paragraph",
|
||||
block: "Format", //"Format",
|
||||
fontdefault: "Czcionka", //"Font Family",
|
||||
font_size: "Rozmiar czcionki", //"Font Size",
|
||||
style_select: "Style", //"Styles",
|
||||
anchor_delta_height: "", //"",
|
||||
anchor_delta_width: "", //"",
|
||||
charmap_delta_height: "", //"",
|
||||
charmap_delta_width: "", //"",
|
||||
colorpicker_delta_height: "", //"",
|
||||
colorpicker_delta_width: "", //"",
|
||||
link_delta_height: "", //"",
|
||||
link_delta_width: "", //"",
|
||||
image_delta_height: "", //"",
|
||||
image_delta_width: "", //"",
|
||||
more_colors: "Więcej Kolorów", //"More Colors...",
|
||||
toolbar_focus:
|
||||
"Przeskocz do przycisków narzędzi - Alt+Q, Przeskocz do edytora - Alt-Z, Przeskocz do ścieżki elementów - Alt+X", //"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X",
|
||||
newdocument: "Czy jesteś pewny że chcesz wyczyścić całą zawartość", //"Are you sure you want clear all contents?",
|
||||
path: "Ścieżka", //"Path",
|
||||
clipboard_msg:
|
||||
"Kopiuj/wytnij/wklej nie jest dostępne w Mozilli i Firefoxie. Czy chcesz więcej informacji na temat tego problemu?", //"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?",
|
||||
blockquote_desc: "Blok cytatu", //"Block Quote",
|
||||
help_desc: "Pomoc", //"Help",
|
||||
newdocument_desc: "Nowy dokument", //"New Document",
|
||||
image_props_desc: "Parametry obrazka", //"Image Properties",
|
||||
paste_desc: "Wklej (Ctrl+V)", //"Paste (Ctrl+V)",
|
||||
copy_desc: "Kopiuj (Ctrl+C)", //"Copy (Ctrl+C)",
|
||||
cut_desc: "Wytnij (Ctrl+X)", //"Cut (Ctrl+X)",
|
||||
anchor_desc: "Wstaw/edytuj zakotwiczenie", //"Insert/Edit Anchor",
|
||||
visualaid_desc: "Pokaż/ukryj wskazówki/niewidoczne elementy", //"show/Hide Guidelines/Invisible Elements",
|
||||
charmap_desc: "Wstaw znak specjalny", //"Insert Special Character",
|
||||
backcolor_desc: "Wybierz kolor tła", //"Select Background Color",
|
||||
forecolor_desc: "Wybierz kolor tekstu", //"Select Text Color",
|
||||
custom1_desc: "Twój własny opis tutaj", //"Your Custom Description Here",
|
||||
removeformat_desc: "Usuń formatowanie", //"Remove Formatting",
|
||||
hr_desc: "Dodaj linię poziomą", //"Insert Horizontal Line",
|
||||
sup_desc: "Indeks górny", //"Superscript",
|
||||
sub_desc: "Indeks dolny", //"Subscript",
|
||||
code_desc: "Edytuj HTML", //"Edit HTML Source",
|
||||
cleanup_desc: "Wyczyść brudny kod", //"Cleanup Messy Code",
|
||||
image_desc: "Wstaw/edytuj obraz", //"Insert/Edit Image",
|
||||
unlink_desc: "Odlinkuj", //"Unlink",
|
||||
link_desc: "Wstaw/edytuj odnośnik", //"Insert/Edit Link",
|
||||
redo_desc: "Powtórz (Ctrl+Y)", //"Redo (Ctrl+Y)",
|
||||
undo_desc: "Cofnij (Ctrl+Z)", //"Undo (Ctrl+Z)",
|
||||
indent_desc: "Zwiększ wcięcie", //"Increase Indent",
|
||||
outdent_desc: "Zmniejsz wcięcie", //"Decrease Indent",
|
||||
numlist_desc: "Wstaw/usuń listę numerowaną", //"Insert/Remove Numbered List",
|
||||
bullist_desc: "Wstaw/usuń listę punktowaną", //"Insert/Remove Bulleted List",
|
||||
justifyfull_desc: "Justowanie", //"Align Full",
|
||||
justifyright_desc: "Wyrównanie do prawej", //"Align Right",
|
||||
justifycenter_desc: "Wyśrodkowanie", //"Align Center",
|
||||
justifyleft_desc: "Wyrównanie do lewej", //"Align Left",
|
||||
striketrough_desc: "Przekreślenie", //"Strikethrough",
|
||||
help_shortcut: "Naciśnij Alt-F10 po pasek narzędzi. Naciśnij ALT-0 po pomoc", //"Press ALT-F10 for toolbar. Press ALT-0 for help",
|
||||
rich_text_area: "Strefa tekstu formatowanego", //"Rich Text Area",
|
||||
shortcuts_desc: "Pomoc ułatwiania dostępu", //"Accessability Help",
|
||||
toolbar: "Pasek narzędzi", //"Toolbar",
|
||||
});
|
||||
BIN
dziennik/gray.gif
Normal file
|
After Width: | Height: | Size: 821 B |
BIN
dziennik/icons.gif
Normal file
|
After Width: | Height: | Size: 12 KiB |
934
dziennik/index.php
Normal file
@@ -0,0 +1,934 @@
|
||||
<?php
|
||||
function ip() {
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
|
||||
$ip = $_SERVER['HTTP_CLIENT_IP'];
|
||||
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
||||
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
} else {
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
return $ip;
|
||||
}
|
||||
|
||||
function nazwa() {
|
||||
if (isset($_COOKIE["nazwa"])) {
|
||||
$nazwa = htmlspecialchars($_COOKIE["nazwa"]);
|
||||
} else {
|
||||
$nazwa = "anon";
|
||||
}
|
||||
return $nazwa;
|
||||
}
|
||||
|
||||
setlocale(LC_ALL, 'pl_PL');
|
||||
date_default_timezone_set("Europe/Warsaw");
|
||||
?>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
|
||||
<head>
|
||||
<meta http-equiv="Content-Language" content="pl" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="Window-target" content="_top" />
|
||||
<title>MaszTenPseudoDziennikDomowy.com</title>
|
||||
<link rel="stylesheet" type="text/css" href="style.css" />
|
||||
<script src="jquery-2.2.1.min.js?jsv=2" type="text/javascript"></script>
|
||||
<script src="jquery-migrate.min.js?jsv=2"></script>
|
||||
<script
|
||||
src="jquery.form.js?jsv=2"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<script
|
||||
src="jquery.checkbox.js?jsv=2"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<script
|
||||
src="jquery.mask.min.js?jsv=2"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="jquery-ui-1.10.3.custom.min.js?jsv=2"
|
||||
></script>
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="jquery.ui.datepicker-pl.js?jsv=2"
|
||||
></script>
|
||||
<script
|
||||
src="jquery.tipsy.js?jsv=2"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<script
|
||||
src="skrypty_funkcje.js?ver=19.1&jsv=2"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
<script
|
||||
src="skrypty.js?ver=19.1&jsv=2"
|
||||
type="text/javascript"
|
||||
></script>
|
||||
</head>
|
||||
|
||||
<body contextmenu="body_right_click_menu">
|
||||
<a href="#tresc" class="sr-only">Przejdź do treści</a>
|
||||
<!-- TOP -->
|
||||
<div id="top_green">
|
||||
<div class="width1000">
|
||||
<div class="logo">
|
||||
<h1>
|
||||
<img src="/favicon.ico" width="32" height="32" style="position:relative;float: left;">
|
||||
Mas<span style="color: yellow">z</span>TenPseudoDzi<span
|
||||
style="color: yellow"
|
||||
>e</span
|
||||
>nnikDomowy.com
|
||||
<small>
|
||||
<a
|
||||
class="historia"
|
||||
href="https://www.mobidziennik.pl/historia-zmian"
|
||||
title="Historia Zmian"
|
||||
target="_blank"
|
||||
>
|
||||
powstały na bazie ver. 19.1</a
|
||||
>
|
||||
|
||||
<span class="top-archiwum">
|
||||
PODRÓBKA
|
||||
</span>
|
||||
</small>
|
||||
</h1>
|
||||
</div>
|
||||
<div class="headerprawo">
|
||||
<a
|
||||
id="menu10"
|
||||
|
||||
title="Przegląd instrukcji dziennika (dostępna również po wciśnięciu klawisza F2)"
|
||||
>Instrukcje</a
|
||||
>
|
||||
<a
|
||||
id="menu7"
|
||||
|
||||
>Powiadomienia</a
|
||||
>
|
||||
|
||||
<span id="wyloguj_box" tabindex="0" title="Furas">
|
||||
<span id="rola">
|
||||
Uczeń
|
||||
<b class="arrow_down"></b>
|
||||
</span>
|
||||
|
||||
<div id="profil_box">
|
||||
<ul>
|
||||
<li class="li_no_hover">
|
||||
<strong><?php echo(nazwa()); ?></strong>
|
||||
<small class="szary2">
|
||||
<br />
|
||||
<?php echo(nazwa()); ?>
|
||||
</small>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
|
||||
title="Przeglądaj archiwalne dzienniki"
|
||||
>Poprzednie lata</a
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
|
||||
title="Przegląd i zarządzanie kontem"
|
||||
>Moje konto</a
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href="/"
|
||||
title="Wyloguj się z systemu"
|
||||
id="wyloguj"
|
||||
>Wyloguj</a
|
||||
>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</span>
|
||||
|
||||
<style type="text/css">
|
||||
#wyloguj_box {
|
||||
color: #fff;
|
||||
font-size: 10pt;
|
||||
margin-right: 15px;
|
||||
text-shadow: 1px 1px 0px #222;
|
||||
cursor: pointer;
|
||||
}
|
||||
/*#wyloguj_box:hover #rola {
|
||||
background:#fff;
|
||||
}*/
|
||||
#profil_box {
|
||||
position: absolute;
|
||||
background: #1783db;
|
||||
/* border:Solid 1px #1783DB; */
|
||||
z-index: 99999999999999999999999 !important;
|
||||
/*box-shadow: 0 2px 10px rgba(0,0,0,.2);*/
|
||||
text-align: left;
|
||||
top: 50px;
|
||||
box-shadow: rgba(0, 0, 0, 0.35) 0px 2px 5px;
|
||||
transition:
|
||||
visibility 0.1s linear,
|
||||
opacity 0.1s linear;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
}
|
||||
#profil_box ul {
|
||||
list-style-type: none;
|
||||
text-shadow: none;
|
||||
color: #fff;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
#profil_box ul li {
|
||||
border-bottom: Solid 1px #1a90f1;
|
||||
}
|
||||
#profil_box ul li.przelacz_konto {
|
||||
padding-left: 30px;
|
||||
}
|
||||
.li_no_hover {
|
||||
padding: 10px 17px;
|
||||
cursor: default;
|
||||
background: #1577c1;
|
||||
}
|
||||
#profil_box ul li:not(.li_no_hover):hover {
|
||||
-webkit-transition: all 0.2s;
|
||||
transition: all 0.2s;
|
||||
background-color: #186eb3;
|
||||
color: #fff;
|
||||
}
|
||||
#profil_box a {
|
||||
text-shadow: none;
|
||||
color: #fff;
|
||||
display: block;
|
||||
text-decoration: none;
|
||||
padding: 10px 17px;
|
||||
margin: 0;
|
||||
}
|
||||
#profil_box a:hover,
|
||||
#profil_box a:hover > * {
|
||||
color: #fff;
|
||||
}
|
||||
.szary2 {
|
||||
color: #e6e6e6;
|
||||
}
|
||||
.arrow_down {
|
||||
display: inline-block;
|
||||
width: 0;
|
||||
height: 0;
|
||||
margin-left: 2px;
|
||||
vertical-align: middle;
|
||||
border-top: 4px dashed;
|
||||
border-right: 4px solid transparent;
|
||||
border-left: 4px solid transparent;
|
||||
}
|
||||
#profil_box ul li.edytuj_wyloguj {
|
||||
float: left;
|
||||
width: 50%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
var wyloguj = $("#wyloguj_box");
|
||||
var profil_box = $("#profil_box");
|
||||
|
||||
$(window).resize(function () {
|
||||
profil_box.css(
|
||||
"left",
|
||||
wyloguj.offset().left + wyloguj.width() - profil_box.width(),
|
||||
);
|
||||
});
|
||||
$(window).resize();
|
||||
|
||||
var profil_box_interval;
|
||||
|
||||
var wylogujOn = function () {
|
||||
if (profil_box_interval != undefined) {
|
||||
clearTimeout(profil_box_interval);
|
||||
}
|
||||
profil_box.css("visibility", "visible").css("opacity", "1");
|
||||
};
|
||||
|
||||
var wylogujOff = function () {
|
||||
profil_box_interval = setTimeout(function () {
|
||||
profil_box.css("visibility", "hidden").css("opacity", "0");
|
||||
}, 500);
|
||||
};
|
||||
|
||||
wyloguj.mouseenter(wylogujOn).focusin(wylogujOn);
|
||||
wyloguj.mouseleave(wylogujOff).focusout(wylogujOff);
|
||||
});
|
||||
</script>
|
||||
<a
|
||||
style="margin-left: 10px; position: relative"
|
||||
href=""
|
||||
title="Przejście do wersji mobilnej systemu"
|
||||
><img
|
||||
src="mobilna.png"
|
||||
alt="Przejście do wersji mobilnej systemu"
|
||||
style="position: absolute; left: -25px; top: -15px; height: 49px"
|
||||
/></a>
|
||||
</div>
|
||||
<div class="cleft"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="menu_gray">
|
||||
<div class="width1000">
|
||||
<!-- MENU START -->
|
||||
<ul class="dropdown dropdown-horizontal">
|
||||
<li>
|
||||
<a
|
||||
id="menu15"
|
||||
|
||||
>Historia</a
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
id="menu1"
|
||||
|
||||
>Wiadomości <span class="powiadomienie_menu">100</span></a
|
||||
>
|
||||
<ul>
|
||||
<li class="first">
|
||||
<a
|
||||
class="dir"
|
||||
|
||||
id="menu81"
|
||||
>Foldery</a
|
||||
>
|
||||
<ul>
|
||||
<li>
|
||||
<a
|
||||
id="menu19"
|
||||
|
||||
>Nowy folder</a
|
||||
>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
id="menu18"
|
||||
|
||||
>Nowa wiadomość</a
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
id="menu20"
|
||||
|
||||
>Wiadomości wysłane</a
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
id="menu24"
|
||||
|
||||
>Oświadczenia</a
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
id="menu22"
|
||||
|
||||
>Komunikaty</a
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
id="menu23"
|
||||
|
||||
>Biblioteka</a
|
||||
>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
id="menu2"
|
||||
>Plan lekcji</a
|
||||
>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a
|
||||
id="menu16"
|
||||
|
||||
>Zastępstwa</a
|
||||
>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a
|
||||
id="menu3"
|
||||
|
||||
>Oceny</a
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
id="menu4"
|
||||
|
||||
>Zachowanie</a
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
id="menu5"
|
||||
|
||||
>Frekwencja</a
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
id="menu13"
|
||||
|
||||
>Zadania<span class="powiadomienie_menu" style="">999</span></a
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
id="menu9"
|
||||
|
||||
>Sprawdziany<span class="powiadomienie_menu" style="">999</span></a
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
id="menu11"
|
||||
|
||||
>Kalendarz<span class="powiadomienie_menu" style="">999</span></a
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
id="menu21"
|
||||
|
||||
>Pliki<span class="powiadomienie_menu" style="">999</span></a
|
||||
>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="cleft"></div>
|
||||
<!-- MENU STOP -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- CONTENT -->
|
||||
<div id="content">
|
||||
<a name="tresc"></a>
|
||||
<div class="fright">
|
||||
<a
|
||||
class="button"
|
||||
id="wczytaj_z_kopii"
|
||||
href="#"
|
||||
title="Wczytaj temat i treść z kopii roboczych"
|
||||
>Wczytaj z kopii roboczych</a
|
||||
>
|
||||
<a
|
||||
class="button"
|
||||
|
||||
title="Skrzynka odbiorcza"
|
||||
>Wiadomości</a
|
||||
>
|
||||
</div>
|
||||
<h1>Nowa wiadomość</h1>
|
||||
<form id="f" method="post">
|
||||
<table>
|
||||
<tr>
|
||||
<td height="77" colspan="2" style="position: relative">
|
||||
<b>Wybrani odbiorcy</b>
|
||||
<a
|
||||
href="#"
|
||||
id="skasuj_odbiorcow"
|
||||
class="button_right"
|
||||
style="margin: -6px 0 0 0; visibility: hidden"
|
||||
title="Skasuj wszystkich wybranych odbiorców"
|
||||
>skasuj wszystkich wybranych odbiorców</a
|
||||
>
|
||||
<div id="wiadomosci_wybrani_odbiorcy"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 525px; padding-bottom: 5px">
|
||||
<b>Temat:</b>
|
||||
<input
|
||||
type="text"
|
||||
style="width: 473px; float: right; margin: -3px 24px 0 0"
|
||||
name="nazwa"
|
||||
maxlength="100"
|
||||
value=""
|
||||
/>
|
||||
</td>
|
||||
<td style="width: 418px; padding-bottom: 5px">
|
||||
<div style="margin-top: 5px; float: left; font-weight: bold">
|
||||
Grupy odbiorców
|
||||
</div>
|
||||
<select name="typodbiorcow" style="float: right; width: 320px">
|
||||
<option value=""></option>
|
||||
<option value="1">Webmaster</option>
|
||||
<option value="2">Pomysłotwórca</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<textarea
|
||||
id="tresc"
|
||||
name="tresc"
|
||||
style="height: 450px; width: 532px"
|
||||
></textarea>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<div id="wiadomosci_odbiorcy"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><hr /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" colspan="2">
|
||||
<input type="submit" value="Wyślij wiadomość" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="tiny_mce.js?jsv=2"
|
||||
></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$("a#menu1, a#menu18").addClass("current");
|
||||
|
||||
$(".checkbox").checkbox();
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
window.onbeforeunload = function () {
|
||||
var tresc = tinyMCE.get("tresc").getContent();
|
||||
if (tresc != "") {
|
||||
return "";
|
||||
}
|
||||
};
|
||||
|
||||
tinyMCE.init({
|
||||
mode: "textareas",
|
||||
theme: "advanced",
|
||||
theme_advanced_buttons1:
|
||||
"bold,italic,underline,strikethrough,|,bullist,numlist,|,sub,sup,|,forecolor,backcolor,|,undo,redo",
|
||||
|
||||
theme_advanced_buttons2: "",
|
||||
theme_advanced_buttons3: "",
|
||||
theme_advanced_buttons4: "",
|
||||
theme_advanced_toolbar_location: "top",
|
||||
theme_advanced_toolbar_align: "left",
|
||||
theme_advanced_statusbar_location: "none",
|
||||
|
||||
gecko_spellcheck: true,
|
||||
onchange_callback: "extSession",
|
||||
setup: function (editor) {
|
||||
editor.onKeyDown.add(function () {
|
||||
extendSession = 1;
|
||||
});
|
||||
|
||||
editor.onPaste.add(function (editor, e) {
|
||||
e.preventDefault();
|
||||
var data =
|
||||
(e.originalEvent || e).clipboardData || window.clipboardData;
|
||||
var content = data.getData("text/html");
|
||||
if (!content) {
|
||||
content = data
|
||||
.getData("text")
|
||||
.replace(/\n/gmu, "<br />")
|
||||
.replace(/ /gmu, " ");
|
||||
}
|
||||
|
||||
if (content.length) {
|
||||
content = $("<div />").html(content);
|
||||
content.find('*[style*="background-color"]').each(function () {
|
||||
if (
|
||||
$(this).css("background-color") === "rgb(255, 255, 255)"
|
||||
) {
|
||||
$(this).css("background-color", "transparent");
|
||||
}
|
||||
});
|
||||
content.find("a[href]").each(function () {
|
||||
$(this).replaceWith(
|
||||
"<span>" + $(this).attr("href") + "</span>",
|
||||
);
|
||||
});
|
||||
content.find("img").remove();
|
||||
editor.execCommand("mceInsertContent", false, content.html());
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
// wybór rodzaju odbiorców i wczytanie listy
|
||||
$("select[name=typodbiorcow]").change(function () {
|
||||
var typ = $(this).val();
|
||||
if (!typ.length) {
|
||||
$("div.odbiorcy_lista").hide();
|
||||
return;
|
||||
}
|
||||
var odbiorcy_div = $("div#wiadomosci_odbiorcy");
|
||||
var odbiorcy_div_id =
|
||||
"odbiorcy_lista" +
|
||||
(isNaN(typ) ? typ.replace(/[^A-Za-z0-9]+/g, "") : typ);
|
||||
if (odbiorcy_div.find("div#" + odbiorcy_div_id).get(0) == undefined) {
|
||||
odbiorcy_div.append(
|
||||
'<div class="odbiorcy_lista" id="' + odbiorcy_div_id + '"></div>',
|
||||
);
|
||||
$.post(
|
||||
"odbiorcyWiadomosci.php",
|
||||
{ typ: typ, odpowiedz: 0, wiadomosci: true },
|
||||
function (data) {
|
||||
var div = $("div#" + odbiorcy_div_id);
|
||||
div.html(data);
|
||||
if (div.find("label.label1").get(0) != undefined) {
|
||||
div.prepend(
|
||||
'<a class="zmien_zaznaczenia wiadomosci_zmien_zaznaczenia_wszystkie" href="#">zaznacz/odznacz wszystkich w bieżącej grupie odbiorców</a>',
|
||||
);
|
||||
}
|
||||
|
||||
var ileGrup = div.find(
|
||||
"div.wiadomosci_odbiorcy_klasa_naglowek",
|
||||
).length;
|
||||
div
|
||||
.find("div.wiadomosci_odbiorcy_klasa_naglowek")
|
||||
.each(function () {
|
||||
var klasa = $(this).attr("data-klasa");
|
||||
var cnt = div.find(
|
||||
'.wiadomosci_odbiorcy_klasa_cnt[data-klasa="' +
|
||||
klasa +
|
||||
'"]',
|
||||
);
|
||||
if (!cnt.children("label").length) {
|
||||
$(this).remove();
|
||||
cnt.remove();
|
||||
} else if (
|
||||
cnt.find('input[name*="odbiorcy"]:checked').length ||
|
||||
ileGrup === 1
|
||||
) {
|
||||
$(this)
|
||||
.addClass("rozwiniete")
|
||||
.attr("title", "Zwiń listę kont");
|
||||
cnt.css("display", "block");
|
||||
}
|
||||
});
|
||||
|
||||
if ($.trim(div.html()) == "") {
|
||||
div.html(
|
||||
'<div style="font-weight:bold; padding:10px;">Brak pasujących kont lub opcja została wyłączona<br/>przez dyrekcję.</div>',
|
||||
);
|
||||
}
|
||||
|
||||
odswiezOdbiorcow();
|
||||
},
|
||||
);
|
||||
}
|
||||
$("div.odbiorcy_lista").hide();
|
||||
$("div#" + odbiorcy_div_id).show();
|
||||
return false;
|
||||
});
|
||||
|
||||
//$("select[name=typodbiorcow]").find('option[value=2]').attr('selected','selected');
|
||||
|
||||
// $("select[name=typodbiorcow]").change();
|
||||
|
||||
// odswiezanie listy odbiorcow wiadomosci (wyswietlanie imion i nazwisk)
|
||||
function odswiezOdbiorcow() {
|
||||
var odbiorcy_div = $("#wiadomosci_wybrani_odbiorcy");
|
||||
//var odbiorcy_html = odbiorcy_div.html();
|
||||
var wybrani = $("input[name*=odbiorcy]:checked");
|
||||
var skasuj_odbiorcow = $("#skasuj_odbiorcow");
|
||||
|
||||
if (skasuj_odbiorcow.get(0) == undefined) {
|
||||
skasuj_odbiorcow = $("#skasuj_odbiorcow");
|
||||
}
|
||||
|
||||
if (wybrani.length == 0) {
|
||||
odbiorcy_div.html(
|
||||
'<img src="attention.png" alt="" style="width:20px; height:20px;position:relative;top:4px;"> Nie wybrano żadnego odbiorcy',
|
||||
);
|
||||
skasuj_odbiorcow.css("visibility", "hidden");
|
||||
$("input[type=submit]").val("Wyślij wiadomość");
|
||||
} else {
|
||||
var odbiorcy = [];
|
||||
var odbiorcyID = [];
|
||||
wybrani.each(function () {
|
||||
var odbiorca = $.trim(
|
||||
$(this).parent().children(".nazwa-uzytkownika").text(),
|
||||
);
|
||||
var idOdbiorcy = $(this).val();
|
||||
if (jQuery.inArray(idOdbiorcy, odbiorcyID) == -1) {
|
||||
odbiorcyID.push(idOdbiorcy);
|
||||
odbiorcy.push(odbiorca);
|
||||
$(
|
||||
'input[name="odbiorcy[]"][value="' +
|
||||
idOdbiorcy +
|
||||
'"]:not(:checked)',
|
||||
).prop("checked", true);
|
||||
}
|
||||
});
|
||||
odbiorcy_div.html(odbiorcy.join(", "));
|
||||
skasuj_odbiorcow.css("visibility", "visible");
|
||||
$("input[type=submit]").val(
|
||||
"Wyślij wiadomość do " +
|
||||
(odbiorcy.length == 1
|
||||
? "1 odbiorcy"
|
||||
: odbiorcy.length + " odbiorców"),
|
||||
);
|
||||
}
|
||||
|
||||
sprawdzenieZaznaczenNaglowkowKlas();
|
||||
}
|
||||
//setInterval(odswiezOdbiorcow,1000);
|
||||
|
||||
$("body").on("click", "#skasuj_odbiorcow", function () {
|
||||
if (confirm("Wyczyścić listę odbiorców?")) {
|
||||
$("input[name*=odbiorcy]:checked").prop("checked", false);
|
||||
}
|
||||
|
||||
odswiezOdbiorcow();
|
||||
return false;
|
||||
});
|
||||
|
||||
var rozwinZwinKlaseOdbiorcow = function (ths) {
|
||||
var klasa = ths.attr("data-klasa");
|
||||
var cnt = ths
|
||||
.parent()
|
||||
.find('.wiadomosci_odbiorcy_klasa_cnt[data-klasa="' + klasa + '"]');
|
||||
|
||||
if (cnt.is(":visible")) {
|
||||
ths.removeClass("rozwiniete").attr("title", "Rozwiń listę kont");
|
||||
cnt.stop(true, true).slideUp("fast");
|
||||
ths.children(".wiadomosci_zmien_zaznacz_klasa").fadeOut("fast");
|
||||
} else {
|
||||
ths.addClass("rozwiniete").attr("title", "Zwiń listę kont");
|
||||
cnt.stop(true, true).slideDown("fast");
|
||||
ths.children(".wiadomosci_zmien_zaznacz_klasa").fadeIn("fast");
|
||||
}
|
||||
};
|
||||
|
||||
// rozwijanie listy danej klasy
|
||||
$("body").on(
|
||||
"click",
|
||||
".wiadomosci_odbiorcy_klasa_naglowek",
|
||||
function () {
|
||||
rozwinZwinKlaseOdbiorcow($(this));
|
||||
},
|
||||
);
|
||||
|
||||
$("body").on(
|
||||
"keydown",
|
||||
".wiadomosci_odbiorcy_klasa_naglowek",
|
||||
function (ev) {
|
||||
if (ev.keyCode == 32) {
|
||||
rozwinZwinKlaseOdbiorcow($(this));
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// sprawdzanie czy naglowek klasy powinien byc zaznaczony, czy nie
|
||||
function sprawdzenieZaznaczenNaglowkowKlas() {
|
||||
$(".wiadomosci_odbiorcy_klasa_naglowek").each(function () {
|
||||
var klasa = $(this).attr("data-klasa");
|
||||
var cnt = $(this)
|
||||
.parent()
|
||||
.find(
|
||||
'.wiadomosci_odbiorcy_klasa_cnt[data-klasa="' + klasa + '"]',
|
||||
);
|
||||
var check = cnt.find("input:not(:checked)").length ? false : true;
|
||||
|
||||
$(this).children("input").prop("checked", check);
|
||||
});
|
||||
}
|
||||
|
||||
// zaznaczanie pojedynczego odbiorcy
|
||||
$("body").on("click", "input[name*=odbiorcy]", function () {
|
||||
var pola = $(
|
||||
"input[name*=odbiorcy][value=" + $(this).attr("value") + "]",
|
||||
);
|
||||
|
||||
pola.prop("checked", $(this).is(":checked"));
|
||||
|
||||
sprawdzenieZaznaczenNaglowkowKlas();
|
||||
|
||||
odswiezOdbiorcow();
|
||||
});
|
||||
|
||||
// zaznaczanie wszystkich odbiorców z danej klasy
|
||||
$("body").on(
|
||||
"click",
|
||||
".wiadomosci_odbiorcy_klasa_naglowek input",
|
||||
function (e) {
|
||||
var klasa = $(this).parent().attr("data-klasa");
|
||||
var cnt = $(this)
|
||||
.parent()
|
||||
.parent()
|
||||
.find(
|
||||
'.wiadomosci_odbiorcy_klasa_cnt[data-klasa="' + klasa + '"]',
|
||||
);
|
||||
|
||||
var checked = $(this).is(":checked");
|
||||
cnt.find("input").each(function () {
|
||||
$(
|
||||
"input[name*=odbiorcy][value=" + $(this).attr("value") + "]",
|
||||
).prop("checked", checked);
|
||||
});
|
||||
|
||||
sprawdzenieZaznaczenNaglowkowKlas();
|
||||
|
||||
odswiezOdbiorcow();
|
||||
|
||||
e.stopPropagation();
|
||||
},
|
||||
);
|
||||
|
||||
odswiezOdbiorcow();
|
||||
|
||||
// zaznaczanie wszystkich odbiorcow z biezacej listy
|
||||
var confirmZmienZaznaczeniaWszystkie = false;
|
||||
$("body").on(
|
||||
"click",
|
||||
".wiadomosci_zmien_zaznaczenia_wszystkie",
|
||||
function () {
|
||||
if (
|
||||
confirmZmienZaznaczeniaWszystkie ||
|
||||
confirm(
|
||||
"Czy na pewno chcesz zaznaczyć/odznaczyć wszystkich w bieżącej grupie odbiorców?",
|
||||
)
|
||||
) {
|
||||
confirmZmienZaznaczeniaWszystkie = true;
|
||||
var cnt = $(this).parent();
|
||||
|
||||
var state = cnt.find("input:not(:checked)").length ? true : false;
|
||||
|
||||
var users = new Array();
|
||||
cnt.find("input").each(function () {
|
||||
if (users.indexOf($(this).attr("value")) != -1) {
|
||||
return true;
|
||||
}
|
||||
users.push($(this).attr("value"));
|
||||
$(
|
||||
"input[name*=odbiorcy][value=" + $(this).attr("value") + "]",
|
||||
).prop("checked", state);
|
||||
});
|
||||
|
||||
odswiezOdbiorcow();
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// automatyczny zapis wiadomości co 15 sek
|
||||
var autosave = setInterval(function () {
|
||||
var tresc = tinyMCE.get("tresc").getContent();
|
||||
if (!tresc.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
$.post("autosave.php", {
|
||||
nazwa: $("input[name=nazwa]").val(),
|
||||
tresc: tresc,
|
||||
});
|
||||
}, 15000);
|
||||
|
||||
// wczytywanie wiadomosci z kopii
|
||||
$("#wczytaj_z_kopii").click(function () {
|
||||
$.post(
|
||||
"wiadomoscikopierobocze.php",
|
||||
function (data) {
|
||||
oknoDynamiczne(data);
|
||||
$("div.podswietl").first().focus();
|
||||
},
|
||||
);
|
||||
return false;
|
||||
});
|
||||
|
||||
// walidacja i wysylka formularza
|
||||
$("form#f").submit(function () {
|
||||
var nazwa = $("input[name=nazwa]").val();
|
||||
var tresc = tinyMCE.get("tresc").getContent();
|
||||
var info = "";
|
||||
if (nazwa == "") {
|
||||
info += "Proszę podać temat wiadomości\n";
|
||||
}
|
||||
if (tresc == "") {
|
||||
info += "Proszę podać treść wiadomości\n";
|
||||
}
|
||||
if ($("input[name*=odbiorcy]").is(":checked") == false) {
|
||||
info += "Prosze wybrać przynajmniej jednego odbiorce";
|
||||
}
|
||||
if (info != "") {
|
||||
alert("Pojawiły się następujące problemy:\n" + info);
|
||||
return false;
|
||||
}
|
||||
window.onbeforeunload = function () {};
|
||||
przerwij_sprawdzanie_logowania = true;
|
||||
clearInterval(autosave);
|
||||
return true;
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<!-- BOTTOM -->
|
||||
<div id="bottom">
|
||||
<div
|
||||
style="
|
||||
float: left;
|
||||
text-align: left;
|
||||
width: 796px;
|
||||
font-size: 8pt;
|
||||
font-family: Tahoma;
|
||||
color: #000;
|
||||
"
|
||||
>
|
||||
Jesteś zalogowany jako <strong><?php echo(nazwa()); ?></strong>. Ostatnie
|
||||
logowanie:
|
||||
<i><?php echo(date("l, d F Y\, \g\o\d\z\i\\n\a H:i:s"));?> z <?php echo(ip()); ?></i> |
|
||||
<a
|
||||
class="moje_logowania"
|
||||
|
||||
title="Historia logowań"
|
||||
>moje logowania</a
|
||||
>
|
||||
|
|
||||
<a
|
||||
class="moje_logowania"
|
||||
|
||||
title="Mapa strony"
|
||||
>mapa strony</a
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
style="
|
||||
float: left;
|
||||
text-align: right;
|
||||
width: 204px;
|
||||
font-family: Tahoma;
|
||||
font-weight: bold;
|
||||
font-size: 8pt;
|
||||
"
|
||||
>
|
||||
mobiDziennik © 2009 - 2026
|
||||
<a
|
||||
class="copyrights"
|
||||
href="http://www.oswiata.wizja.net"
|
||||
title="Strona Internetowa - WizjaNET"
|
||||
target="_blank"
|
||||
>WizjaNet</a
|
||||
>
|
||||
®
|
||||
</div>
|
||||
<div style="clear: both"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
BIN
dziennik/info.png
Normal file
|
After Width: | Height: | Size: 739 B |
4
dziennik/jquery-2.2.1.min.js
vendored
Normal file
2
dziennik/jquery-migrate.min.js
vendored
Normal file
6
dziennik/jquery-ui-1.10.3.custom.min.js
vendored
Normal file
69
dziennik/jquery.checkbox.js
Normal file
@@ -0,0 +1,69 @@
|
||||
/**
|
||||
* @Author: Dawid Pośliński
|
||||
* @Website: http://poslinski.net
|
||||
* @Modified: Bartek Medoń, www.bmedon.net
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
$.fn.checkbox = function(method) {
|
||||
if(typeof method === 'boolean'){
|
||||
var div = $(this).parent().children('div.checkbox');
|
||||
if(div){
|
||||
if(method === true) div.removeClass("checked");
|
||||
else div.addClass("checked");
|
||||
|
||||
onClick(3, $(this).parent().children('div.checkbox'));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
$('body').off('click.checkbox', 'div.checkbox:not(.disabled)').on('click.checkbox', 'div.checkbox:not(.disabled)', onClick);
|
||||
$('body').off('keypress.checkbox', 'div.checkbox:not(.disabled)').on('keypress.checkbox', 'div.checkbox:not(.disabled)', onKeypress);
|
||||
$('body').off('click.checkbox-label', 'label').on('click.checkbox-label', 'label', onClickLabel);
|
||||
|
||||
return this.each(function(){
|
||||
if(!$(this).filter('.checkboxed').length){
|
||||
var checked = "";
|
||||
var disabled = '';
|
||||
if( $(this).attr('disabled') != undefined) disabled = ' disabled';
|
||||
if ( $(this).attr("checked") != undefined) checked = " checked";
|
||||
|
||||
$(this).addClass('checkboxed').after('<div data-val="'+$(this).attr('value')+'" class="checkbox'+checked+disabled+'" tabindex="0"></div>').hide();
|
||||
}
|
||||
// $(this).next().unbind('click').click(onClick);
|
||||
// $(this).next().unbind('keypress').keypress(onKeypress);
|
||||
});
|
||||
|
||||
|
||||
function onClickLabel(e){
|
||||
if($(this).children('input.checkbox[type="checkbox"]').length === 1){
|
||||
e.preventDefault();
|
||||
if(!$(e.target).is('div.checkbox')){
|
||||
onClick(2, $(this).children('div.checkbox'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onClick(type, ths) {
|
||||
if(!ths){
|
||||
ths = $(this);
|
||||
}
|
||||
if ( ths.hasClass("checked") ) {
|
||||
ths.removeClass("checked");
|
||||
ths.parent().children(":checkbox[value="+ths.attr("data-val")+"]").removeAttr("checked").prop('checked', false).trigger('change');
|
||||
}
|
||||
else {
|
||||
ths.addClass("checked");
|
||||
ths.parent().children(":checkbox[value="+ths.attr("data-val")+"]").attr("checked","checked").prop('checked', true).trigger('change');
|
||||
}
|
||||
}
|
||||
|
||||
function onKeypress(event) {
|
||||
if (event.keyCode === 32) {
|
||||
onClick(2, $(this));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
})(jQuery);
|
||||
803
dziennik/jquery.form.js
Normal file
@@ -0,0 +1,803 @@
|
||||
/*!
|
||||
* jQuery Form Plugin
|
||||
* version: 2.63 (29-JAN-2011)
|
||||
* @requires jQuery v1.3.2 or later
|
||||
*
|
||||
* Examples and documentation at: http://malsup.com/jquery/form/
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*/
|
||||
;(function($) {
|
||||
|
||||
/*
|
||||
Usage Note:
|
||||
-----------
|
||||
Do not use both ajaxSubmit and ajaxForm on the same form. These
|
||||
functions are intended to be exclusive. Use ajaxSubmit if you want
|
||||
to bind your own submit handler to the form. For example,
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#myForm').bind('submit', function(e) {
|
||||
e.preventDefault(); // <-- important
|
||||
$(this).ajaxSubmit({
|
||||
target: '#output'
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Use ajaxForm when you want the plugin to manage all the event binding
|
||||
for you. For example,
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#myForm').ajaxForm({
|
||||
target: '#output'
|
||||
});
|
||||
});
|
||||
|
||||
When using ajaxForm, the ajaxSubmit function will be invoked for you
|
||||
at the appropriate time.
|
||||
*/
|
||||
|
||||
/**
|
||||
* ajaxSubmit() provides a mechanism for immediately submitting
|
||||
* an HTML form using AJAX.
|
||||
*/
|
||||
$.fn.ajaxSubmit = function(options) {
|
||||
// fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
|
||||
if (!this.length) {
|
||||
log('ajaxSubmit: skipping submit process - no element selected');
|
||||
return this;
|
||||
}
|
||||
|
||||
if (typeof options == 'function') {
|
||||
options = { success: options };
|
||||
}
|
||||
|
||||
var action = this.attr('action');
|
||||
var url = (typeof action === 'string') ? $.trim(action) : '';
|
||||
if (url) {
|
||||
// clean url (don't include hash vaue)
|
||||
url = (url.match(/^([^#]+)/)||[])[1];
|
||||
}
|
||||
url = url || window.location.href || '';
|
||||
|
||||
options = $.extend(true, {
|
||||
url: url,
|
||||
type: this[0].getAttribute('method') || 'GET', // IE7 massage (see issue 57)
|
||||
iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'
|
||||
}, options);
|
||||
|
||||
// hook for manipulating the form data before it is extracted;
|
||||
// convenient for use with rich editors like tinyMCE or FCKEditor
|
||||
var veto = {};
|
||||
this.trigger('form-pre-serialize', [this, options, veto]);
|
||||
if (veto.veto) {
|
||||
log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');
|
||||
return this;
|
||||
}
|
||||
|
||||
// provide opportunity to alter form data before it is serialized
|
||||
if (options.beforeSerialize && options.beforeSerialize(this, options) === false) {
|
||||
log('ajaxSubmit: submit aborted via beforeSerialize callback');
|
||||
return this;
|
||||
}
|
||||
|
||||
var n,v,a = this.formToArray(options.semantic);
|
||||
if (options.data) {
|
||||
options.extraData = options.data;
|
||||
for (n in options.data) {
|
||||
if(options.data[n] instanceof Array) {
|
||||
for (var k in options.data[n]) {
|
||||
a.push( { name: n, value: options.data[n][k] } );
|
||||
}
|
||||
}
|
||||
else {
|
||||
v = options.data[n];
|
||||
v = $.isFunction(v) ? v() : v; // if value is fn, invoke it
|
||||
a.push( { name: n, value: v } );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// give pre-submit callback an opportunity to abort the submit
|
||||
if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {
|
||||
log('ajaxSubmit: submit aborted via beforeSubmit callback');
|
||||
return this;
|
||||
}
|
||||
|
||||
// fire vetoable 'validate' event
|
||||
this.trigger('form-submit-validate', [a, this, options, veto]);
|
||||
if (veto.veto) {
|
||||
log('ajaxSubmit: submit vetoed via form-submit-validate trigger');
|
||||
return this;
|
||||
}
|
||||
|
||||
var q = $.param(a);
|
||||
|
||||
if (options.type.toUpperCase() == 'GET') {
|
||||
options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
|
||||
options.data = null; // data is null for 'get'
|
||||
}
|
||||
else {
|
||||
options.data = q; // data is the query string for 'post'
|
||||
}
|
||||
|
||||
var $form = this, callbacks = [];
|
||||
if (options.resetForm) {
|
||||
callbacks.push(function() { $form.resetForm(); });
|
||||
}
|
||||
if (options.clearForm) {
|
||||
callbacks.push(function() { $form.clearForm(); });
|
||||
}
|
||||
|
||||
// perform a load on the target only if dataType is not provided
|
||||
if (!options.dataType && options.target) {
|
||||
var oldSuccess = options.success || function(){};
|
||||
callbacks.push(function(data) {
|
||||
var fn = options.replaceTarget ? 'replaceWith' : 'html';
|
||||
$(options.target)[fn](data).each(oldSuccess, arguments);
|
||||
});
|
||||
}
|
||||
else if (options.success) {
|
||||
callbacks.push(options.success);
|
||||
}
|
||||
|
||||
options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg
|
||||
var context = options.context || options; // jQuery 1.4+ supports scope context
|
||||
for (var i=0, max=callbacks.length; i < max; i++) {
|
||||
callbacks[i].apply(context, [data, status, xhr || $form, $form]);
|
||||
}
|
||||
};
|
||||
|
||||
// are there files to upload?
|
||||
var fileInputs = $('input:file', this).length > 0;
|
||||
var mp = 'multipart/form-data';
|
||||
var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);
|
||||
|
||||
// options.iframe allows user to force iframe mode
|
||||
// 06-NOV-09: now defaulting to iframe mode if file input is detected
|
||||
if (options.iframe !== false && (fileInputs || options.iframe || multipart)) {
|
||||
// hack to fix Safari hang (thanks to Tim Molendijk for this)
|
||||
// see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
|
||||
if (options.closeKeepAlive) {
|
||||
$.get(options.closeKeepAlive, fileUpload);
|
||||
}
|
||||
else {
|
||||
fileUpload();
|
||||
}
|
||||
}
|
||||
else {
|
||||
$.ajax(options);
|
||||
}
|
||||
|
||||
// fire 'notify' event
|
||||
this.trigger('form-submit-notify', [this, options]);
|
||||
return this;
|
||||
|
||||
|
||||
// private function for handling file uploads (hat tip to YAHOO!)
|
||||
function fileUpload() {
|
||||
var form = $form[0];
|
||||
|
||||
if ($(':input[name=submit],:input[id=submit]', form).length) {
|
||||
// if there is an input with a name or id of 'submit' then we won't be
|
||||
// able to invoke the submit fn on the form (at least not x-browser)
|
||||
alert('Error: Form elements must not have name or id of "submit".');
|
||||
return;
|
||||
}
|
||||
|
||||
var s = $.extend(true, {}, $.ajaxSettings, options);
|
||||
s.context = s.context || s;
|
||||
var id = 'jqFormIO' + (new Date().getTime()), fn = '_'+id;
|
||||
var $io = $('<iframe id="' + id + '" name="' + id + '" src="'+ s.iframeSrc +'" />');
|
||||
var io = $io[0];
|
||||
|
||||
$io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
|
||||
|
||||
var xhr = { // mock object
|
||||
aborted: 0,
|
||||
responseText: null,
|
||||
responseXML: null,
|
||||
status: 0,
|
||||
statusText: 'n/a',
|
||||
getAllResponseHeaders: function() {},
|
||||
getResponseHeader: function() {},
|
||||
setRequestHeader: function() {},
|
||||
abort: function() {
|
||||
this.aborted = 1;
|
||||
$io.attr('src', s.iframeSrc); // abort op in progress
|
||||
}
|
||||
};
|
||||
|
||||
var g = s.global;
|
||||
// trigger ajax global events so that activity/block indicators work like normal
|
||||
if (g && ! $.active++) {
|
||||
$.event.trigger("ajaxStart");
|
||||
}
|
||||
if (g) {
|
||||
$.event.trigger("ajaxSend", [xhr, s]);
|
||||
}
|
||||
|
||||
if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {
|
||||
if (s.global) {
|
||||
$.active--;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (xhr.aborted) {
|
||||
return;
|
||||
}
|
||||
|
||||
var timedOut = 0;
|
||||
|
||||
// add submitting element to data if we know it
|
||||
var sub = form.clk;
|
||||
if (sub) {
|
||||
var n = sub.name;
|
||||
if (n && !sub.disabled) {
|
||||
s.extraData = s.extraData || {};
|
||||
s.extraData[n] = sub.value;
|
||||
if (sub.type == "image") {
|
||||
s.extraData[n+'.x'] = form.clk_x;
|
||||
s.extraData[n+'.y'] = form.clk_y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// take a breath so that pending repaints get some cpu time before the upload starts
|
||||
function doSubmit() {
|
||||
// make sure form attrs are set
|
||||
var t = $form.attr('target'), a = $form.attr('action');
|
||||
|
||||
// update form attrs in IE friendly way
|
||||
form.setAttribute('target',id);
|
||||
if (form.getAttribute('method') != 'POST') {
|
||||
form.setAttribute('method', 'POST');
|
||||
}
|
||||
if (form.getAttribute('action') != s.url) {
|
||||
form.setAttribute('action', s.url);
|
||||
}
|
||||
|
||||
// ie borks in some cases when setting encoding
|
||||
if (! s.skipEncodingOverride) {
|
||||
$form.attr({
|
||||
encoding: 'multipart/form-data',
|
||||
enctype: 'multipart/form-data'
|
||||
});
|
||||
}
|
||||
|
||||
// support timout
|
||||
if (s.timeout) {
|
||||
setTimeout(function() { timedOut = true; cb(); }, s.timeout);
|
||||
}
|
||||
|
||||
// add "extra" data to form if provided in options
|
||||
var extraInputs = [];
|
||||
try {
|
||||
if (s.extraData) {
|
||||
for (var n in s.extraData) {
|
||||
extraInputs.push(
|
||||
$('<input type="hidden" name="'+n+'" value="'+s.extraData[n]+'" />')
|
||||
.appendTo(form)[0]);
|
||||
}
|
||||
}
|
||||
|
||||
// add iframe to doc and submit the form
|
||||
$io.appendTo('body');
|
||||
io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
|
||||
form.submit();
|
||||
}
|
||||
finally {
|
||||
// reset attrs and remove "extra" input elements
|
||||
form.setAttribute('action',a);
|
||||
if(t) {
|
||||
form.setAttribute('target', t);
|
||||
} else {
|
||||
$form.removeAttr('target');
|
||||
}
|
||||
$(extraInputs).remove();
|
||||
}
|
||||
}
|
||||
|
||||
if (s.forceSync) {
|
||||
doSubmit();
|
||||
}
|
||||
else {
|
||||
setTimeout(doSubmit, 10); // this lets dom updates render
|
||||
}
|
||||
|
||||
var data, doc, domCheckCount = 50;
|
||||
|
||||
function cb() {
|
||||
doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document;
|
||||
if (!doc || doc.location.href == s.iframeSrc) {
|
||||
// response not received yet
|
||||
return;
|
||||
}
|
||||
io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
|
||||
|
||||
var ok = true;
|
||||
try {
|
||||
if (timedOut) {
|
||||
throw 'timeout';
|
||||
}
|
||||
|
||||
var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc);
|
||||
log('isXml='+isXml);
|
||||
if (!isXml && window.opera && (doc.body == null || doc.body.innerHTML == '')) {
|
||||
if (--domCheckCount) {
|
||||
// in some browsers (Opera) the iframe DOM is not always traversable when
|
||||
// the onload callback fires, so we loop a bit to accommodate
|
||||
log('requeing onLoad callback, DOM not available');
|
||||
setTimeout(cb, 250);
|
||||
return;
|
||||
}
|
||||
// let this fall through because server response could be an empty document
|
||||
//log('Could not access iframe DOM after mutiple tries.');
|
||||
//throw 'DOMException: not available';
|
||||
}
|
||||
|
||||
//log('response detected');
|
||||
xhr.responseText = doc.body ? doc.body.innerHTML : doc.documentElement ? doc.documentElement.innerHTML : null;
|
||||
xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
|
||||
xhr.getResponseHeader = function(header){
|
||||
var headers = {'content-type': s.dataType};
|
||||
return headers[header];
|
||||
};
|
||||
|
||||
var scr = /(json|script)/.test(s.dataType);
|
||||
if (scr || s.textarea) {
|
||||
// see if user embedded response in textarea
|
||||
var ta = doc.getElementsByTagName('textarea')[0];
|
||||
if (ta) {
|
||||
xhr.responseText = ta.value;
|
||||
}
|
||||
else if (scr) {
|
||||
// account for browsers injecting pre around json response
|
||||
var pre = doc.getElementsByTagName('pre')[0];
|
||||
var b = doc.getElementsByTagName('body')[0];
|
||||
if (pre) {
|
||||
xhr.responseText = pre.textContent;
|
||||
}
|
||||
else if (b) {
|
||||
xhr.responseText = b.innerHTML;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (s.dataType == 'xml' && !xhr.responseXML && xhr.responseText != null) {
|
||||
xhr.responseXML = toXml(xhr.responseText);
|
||||
}
|
||||
|
||||
data = httpData(xhr, s.dataType, s);
|
||||
}
|
||||
catch(e){
|
||||
log('error caught:',e);
|
||||
ok = false;
|
||||
xhr.error = e;
|
||||
s.error.call(s.context, xhr, 'error', e);
|
||||
g && $.event.trigger("ajaxError", [xhr, s, e]);
|
||||
}
|
||||
|
||||
if (xhr.aborted) {
|
||||
log('upload aborted');
|
||||
ok = false;
|
||||
}
|
||||
|
||||
// ordering of these callbacks/triggers is odd, but that's how $.ajax does it
|
||||
if (ok) {
|
||||
s.success.call(s.context, data, 'success', xhr);
|
||||
g && $.event.trigger("ajaxSuccess", [xhr, s]);
|
||||
}
|
||||
|
||||
g && $.event.trigger("ajaxComplete", [xhr, s]);
|
||||
|
||||
if (g && ! --$.active) {
|
||||
$.event.trigger("ajaxStop");
|
||||
}
|
||||
|
||||
s.complete && s.complete.call(s.context, xhr, ok ? 'success' : 'error');
|
||||
|
||||
// clean up
|
||||
setTimeout(function() {
|
||||
$io.removeData('form-plugin-onload');
|
||||
$io.remove();
|
||||
xhr.responseXML = null;
|
||||
}, 100);
|
||||
}
|
||||
|
||||
var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+)
|
||||
if (window.ActiveXObject) {
|
||||
doc = new ActiveXObject('Microsoft.XMLDOM');
|
||||
doc.async = 'false';
|
||||
doc.loadXML(s);
|
||||
}
|
||||
else {
|
||||
doc = (new DOMParser()).parseFromString(s, 'text/xml');
|
||||
}
|
||||
return (doc && doc.documentElement && doc.documentElement.nodeName != 'parsererror') ? doc : null;
|
||||
};
|
||||
var parseJSON = $.parseJSON || function(s) {
|
||||
return window['eval']('(' + s + ')');
|
||||
};
|
||||
|
||||
var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4
|
||||
var ct = xhr.getResponseHeader('content-type') || '',
|
||||
xml = type === 'xml' || !type && ct.indexOf('xml') >= 0,
|
||||
data = xml ? xhr.responseXML : xhr.responseText;
|
||||
|
||||
if (xml && data.documentElement.nodeName === 'parsererror') {
|
||||
$.error && $.error('parsererror');
|
||||
}
|
||||
if (s && s.dataFilter) {
|
||||
data = s.dataFilter(data, type);
|
||||
}
|
||||
if (typeof data === 'string') {
|
||||
if (type === 'json' || !type && ct.indexOf('json') >= 0) {
|
||||
data = parseJSON(data);
|
||||
} else if (type === "script" || !type && ct.indexOf("javascript") >= 0) {
|
||||
$.globalEval(data);
|
||||
}
|
||||
}
|
||||
return data;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* ajaxForm() provides a mechanism for fully automating form submission.
|
||||
*
|
||||
* The advantages of using this method instead of ajaxSubmit() are:
|
||||
*
|
||||
* 1: This method will include coordinates for <input type="image" /> elements (if the element
|
||||
* is used to submit the form).
|
||||
* 2. This method will include the submit element's name/value data (for the element that was
|
||||
* used to submit the form).
|
||||
* 3. This method binds the submit() method to the form for you.
|
||||
*
|
||||
* The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely
|
||||
* passes the options argument along after properly binding events for submit elements and
|
||||
* the form itself.
|
||||
*/
|
||||
$.fn.ajaxForm = function(options) {
|
||||
// in jQuery 1.3+ we can fix mistakes with the ready state
|
||||
if (this.length === 0) {
|
||||
var o = { s: this.selector, c: this.context };
|
||||
if (!$.isReady && o.s) {
|
||||
log('DOM not ready, queuing ajaxForm');
|
||||
$(function() {
|
||||
$(o.s,o.c).ajaxForm(options);
|
||||
});
|
||||
return this;
|
||||
}
|
||||
// is your DOM ready? http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
|
||||
log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
|
||||
return this;
|
||||
}
|
||||
|
||||
return this.ajaxFormUnbind().bind('submit.form-plugin', function(e) {
|
||||
if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed
|
||||
e.preventDefault();
|
||||
$(this).ajaxSubmit(options);
|
||||
}
|
||||
}).bind('click.form-plugin', function(e) {
|
||||
var target = e.target;
|
||||
var $el = $(target);
|
||||
if (!($el.is(":submit,input:image"))) {
|
||||
// is this a child element of the submit el? (ex: a span within a button)
|
||||
var t = $el.closest(':submit');
|
||||
if (t.length == 0) {
|
||||
return;
|
||||
}
|
||||
target = t[0];
|
||||
}
|
||||
var form = this;
|
||||
form.clk = target;
|
||||
if (target.type == 'image') {
|
||||
if (e.offsetX != undefined) {
|
||||
form.clk_x = e.offsetX;
|
||||
form.clk_y = e.offsetY;
|
||||
} else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin
|
||||
var offset = $el.offset();
|
||||
form.clk_x = e.pageX - offset.left;
|
||||
form.clk_y = e.pageY - offset.top;
|
||||
} else {
|
||||
form.clk_x = e.pageX - target.offsetLeft;
|
||||
form.clk_y = e.pageY - target.offsetTop;
|
||||
}
|
||||
}
|
||||
// clear form vars
|
||||
setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100);
|
||||
});
|
||||
};
|
||||
|
||||
// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
|
||||
$.fn.ajaxFormUnbind = function() {
|
||||
return this.unbind('submit.form-plugin click.form-plugin');
|
||||
};
|
||||
|
||||
/**
|
||||
* formToArray() gathers form element data into an array of objects that can
|
||||
* be passed to any of the following ajax functions: $.get, $.post, or load.
|
||||
* Each object in the array has both a 'name' and 'value' property. An example of
|
||||
* an array for a simple login form might be:
|
||||
*
|
||||
* [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
|
||||
*
|
||||
* It is this array that is passed to pre-submit callback functions provided to the
|
||||
* ajaxSubmit() and ajaxForm() methods.
|
||||
*/
|
||||
$.fn.formToArray = function(semantic) {
|
||||
var a = [];
|
||||
if (this.length === 0) {
|
||||
return a;
|
||||
}
|
||||
|
||||
var form = this[0];
|
||||
var els = semantic ? form.getElementsByTagName('*') : form.elements;
|
||||
if (!els) {
|
||||
return a;
|
||||
}
|
||||
|
||||
var i,j,n,v,el,max,jmax;
|
||||
for(i=0, max=els.length; i < max; i++) {
|
||||
el = els[i];
|
||||
n = el.name;
|
||||
if (!n) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (semantic && form.clk && el.type == "image") {
|
||||
// handle image inputs on the fly when semantic == true
|
||||
if(!el.disabled && form.clk == el) {
|
||||
a.push({name: n, value: $(el).val()});
|
||||
a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
v = $.fieldValue(el, true);
|
||||
if (v && v.constructor == Array) {
|
||||
for(j=0, jmax=v.length; j < jmax; j++) {
|
||||
a.push({name: n, value: v[j]});
|
||||
}
|
||||
}
|
||||
else if (v !== null && typeof v != 'undefined') {
|
||||
a.push({name: n, value: v});
|
||||
}
|
||||
}
|
||||
|
||||
if (!semantic && form.clk) {
|
||||
// input type=='image' are not found in elements array! handle it here
|
||||
var $input = $(form.clk), input = $input[0];
|
||||
n = input.name;
|
||||
if (n && !input.disabled && input.type == 'image') {
|
||||
a.push({name: n, value: $input.val()});
|
||||
a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
|
||||
}
|
||||
}
|
||||
return a;
|
||||
};
|
||||
|
||||
/**
|
||||
* Serializes form data into a 'submittable' string. This method will return a string
|
||||
* in the format: name1=value1&name2=value2
|
||||
*/
|
||||
$.fn.formSerialize = function(semantic) {
|
||||
//hand off to jQuery.param for proper encoding
|
||||
return $.param(this.formToArray(semantic));
|
||||
};
|
||||
|
||||
/**
|
||||
* Serializes all field elements in the jQuery object into a query string.
|
||||
* This method will return a string in the format: name1=value1&name2=value2
|
||||
*/
|
||||
$.fn.fieldSerialize = function(successful) {
|
||||
var a = [];
|
||||
this.each(function() {
|
||||
var n = this.name;
|
||||
if (!n) {
|
||||
return;
|
||||
}
|
||||
var v = $.fieldValue(this, successful);
|
||||
if (v && v.constructor == Array) {
|
||||
for (var i=0,max=v.length; i < max; i++) {
|
||||
a.push({name: n, value: v[i]});
|
||||
}
|
||||
}
|
||||
else if (v !== null && typeof v != 'undefined') {
|
||||
a.push({name: this.name, value: v});
|
||||
}
|
||||
});
|
||||
//hand off to jQuery.param for proper encoding
|
||||
return $.param(a);
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the value(s) of the element in the matched set. For example, consider the following form:
|
||||
*
|
||||
* <form><fieldset>
|
||||
* <input name="A" type="text" />
|
||||
* <input name="A" type="text" />
|
||||
* <input name="B" type="checkbox" value="B1" />
|
||||
* <input name="B" type="checkbox" value="B2"/>
|
||||
* <input name="C" type="radio" value="C1" />
|
||||
* <input name="C" type="radio" value="C2" />
|
||||
* </fieldset></form>
|
||||
*
|
||||
* var v = $(':text').fieldValue();
|
||||
* // if no values are entered into the text inputs
|
||||
* v == ['','']
|
||||
* // if values entered into the text inputs are 'foo' and 'bar'
|
||||
* v == ['foo','bar']
|
||||
*
|
||||
* var v = $(':checkbox').fieldValue();
|
||||
* // if neither checkbox is checked
|
||||
* v === undefined
|
||||
* // if both checkboxes are checked
|
||||
* v == ['B1', 'B2']
|
||||
*
|
||||
* var v = $(':radio').fieldValue();
|
||||
* // if neither radio is checked
|
||||
* v === undefined
|
||||
* // if first radio is checked
|
||||
* v == ['C1']
|
||||
*
|
||||
* The successful argument controls whether or not the field element must be 'successful'
|
||||
* (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
|
||||
* The default value of the successful argument is true. If this value is false the value(s)
|
||||
* for each element is returned.
|
||||
*
|
||||
* Note: This method *always* returns an array. If no valid value can be determined the
|
||||
* array will be empty, otherwise it will contain one or more values.
|
||||
*/
|
||||
$.fn.fieldValue = function(successful) {
|
||||
for (var val=[], i=0, max=this.length; i < max; i++) {
|
||||
var el = this[i];
|
||||
var v = $.fieldValue(el, successful);
|
||||
if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) {
|
||||
continue;
|
||||
}
|
||||
v.constructor == Array ? $.merge(val, v) : val.push(v);
|
||||
}
|
||||
return val;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the value of the field element.
|
||||
*/
|
||||
$.fieldValue = function(el, successful) {
|
||||
var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
|
||||
if (successful === undefined) {
|
||||
successful = true;
|
||||
}
|
||||
|
||||
if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
|
||||
(t == 'checkbox' || t == 'radio') && !el.checked ||
|
||||
(t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
|
||||
tag == 'select' && el.selectedIndex == -1)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (tag == 'select') {
|
||||
var index = el.selectedIndex;
|
||||
if (index < 0) {
|
||||
return null;
|
||||
}
|
||||
var a = [], ops = el.options;
|
||||
var one = (t == 'select-one');
|
||||
var max = (one ? index+1 : ops.length);
|
||||
for(var i=(one ? index : 0); i < max; i++) {
|
||||
var op = ops[i];
|
||||
if (op.selected) {
|
||||
var v = op.value;
|
||||
if (!v) { // extra pain for IE...
|
||||
v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value;
|
||||
}
|
||||
if (one) {
|
||||
return v;
|
||||
}
|
||||
a.push(v);
|
||||
}
|
||||
}
|
||||
return a;
|
||||
}
|
||||
return $(el).val();
|
||||
};
|
||||
|
||||
/**
|
||||
* Clears the form data. Takes the following actions on the form's input fields:
|
||||
* - input text fields will have their 'value' property set to the empty string
|
||||
* - select elements will have their 'selectedIndex' property set to -1
|
||||
* - checkbox and radio inputs will have their 'checked' property set to false
|
||||
* - inputs of type submit, button, reset, and hidden will *not* be effected
|
||||
* - button elements will *not* be effected
|
||||
*/
|
||||
$.fn.clearForm = function() {
|
||||
return this.each(function() {
|
||||
$('input,select,textarea', this).clearFields();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Clears the selected form elements.
|
||||
*/
|
||||
$.fn.clearFields = $.fn.clearInputs = function() {
|
||||
return this.each(function() {
|
||||
var t = this.type, tag = this.tagName.toLowerCase();
|
||||
if (t == 'text' || t == 'password' || tag == 'textarea') {
|
||||
this.value = '';
|
||||
}
|
||||
else if (t == 'checkbox' || t == 'radio') {
|
||||
this.checked = false;
|
||||
}
|
||||
else if (tag == 'select') {
|
||||
this.selectedIndex = -1;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Resets the form data. Causes all form elements to be reset to their original value.
|
||||
*/
|
||||
$.fn.resetForm = function() {
|
||||
return this.each(function() {
|
||||
// guard against an input with the name of 'reset'
|
||||
// note that IE reports the reset function as an 'object'
|
||||
if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) {
|
||||
this.reset();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Enables or disables any matching elements.
|
||||
*/
|
||||
$.fn.enable = function(b) {
|
||||
if (b === undefined) {
|
||||
b = true;
|
||||
}
|
||||
return this.each(function() {
|
||||
this.disabled = !b;
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks/unchecks any matching checkboxes or radio buttons and
|
||||
* selects/deselects and matching option elements.
|
||||
*/
|
||||
$.fn.selected = function(select) {
|
||||
if (select === undefined) {
|
||||
select = true;
|
||||
}
|
||||
return this.each(function() {
|
||||
var t = this.type;
|
||||
if (t == 'checkbox' || t == 'radio') {
|
||||
this.checked = select;
|
||||
}
|
||||
else if (this.tagName.toLowerCase() == 'option') {
|
||||
var $sel = $(this).parent('select');
|
||||
if (select && $sel[0] && $sel[0].type == 'select-one') {
|
||||
// deselect all other options
|
||||
$sel.find('option').selected(false);
|
||||
}
|
||||
this.selected = select;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// helper fn for console logging
|
||||
// set $.fn.ajaxSubmit.debug to true to enable debug logging
|
||||
function log() {
|
||||
if ($.fn.ajaxSubmit.debug) {
|
||||
var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');
|
||||
if (window.console && window.console.log) {
|
||||
window.console.log(msg);
|
||||
}
|
||||
else if (window.opera && window.opera.postError) {
|
||||
window.opera.postError(msg);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
19
dziennik/jquery.mask.min.js
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
// jQuery Mask Plugin v1.14.16
|
||||
// github.com/igorescobar/jQuery-Mask-Plugin
|
||||
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,n,f){a instanceof String&&(a=String(a));for(var p=a.length,k=0;k<p;k++){var b=a[k];if(n.call(f,b,k,a))return{i:k,v:b}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
|
||||
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,n,f){a!=Array.prototype&&a!=Object.prototype&&(a[n]=f.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);
|
||||
$jscomp.polyfill=function(a,n,f,p){if(n){f=$jscomp.global;a=a.split(".");for(p=0;p<a.length-1;p++){var k=a[p];k in f||(f[k]={});f=f[k]}a=a[a.length-1];p=f[a];n=n(p);n!=p&&null!=n&&$jscomp.defineProperty(f,a,{configurable:!0,writable:!0,value:n})}};$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,f){return $jscomp.findInternal(this,a,f).v}},"es6","es3");
|
||||
(function(a,n,f){"function"===typeof define&&define.amd?define(["jquery"],a):"object"===typeof exports&&"undefined"===typeof Meteor?module.exports=a(require("jquery")):a(n||f)})(function(a){var n=function(b,d,e){var c={invalid:[],getCaret:function(){try{var a=0,r=b.get(0),h=document.selection,d=r.selectionStart;if(h&&-1===navigator.appVersion.indexOf("MSIE 10")){var e=h.createRange();e.moveStart("character",-c.val().length);a=e.text.length}else if(d||"0"===d)a=d;return a}catch(C){}},setCaret:function(a){try{if(b.is(":focus")){var c=
|
||||
b.get(0);if(c.setSelectionRange)c.setSelectionRange(a,a);else{var g=c.createTextRange();g.collapse(!0);g.moveEnd("character",a);g.moveStart("character",a);g.select()}}}catch(B){}},events:function(){b.on("keydown.mask",function(a){b.data("mask-keycode",a.keyCode||a.which);b.data("mask-previus-value",b.val());b.data("mask-previus-caret-pos",c.getCaret());c.maskDigitPosMapOld=c.maskDigitPosMap}).on(a.jMaskGlobals.useInput?"input.mask":"keyup.mask",c.behaviour).on("paste.mask drop.mask",function(){setTimeout(function(){b.keydown().keyup()},
|
||||
100)}).on("change.mask",function(){b.data("changed",!0)}).on("blur.mask",function(){f===c.val()||b.data("changed")||b.trigger("change");b.data("changed",!1)}).on("blur.mask",function(){f=c.val()}).on("focus.mask",function(b){!0===e.selectOnFocus&&a(b.target).select()}).on("focusout.mask",function(){e.clearIfNotMatch&&!k.test(c.val())&&c.val("")})},getRegexMask:function(){for(var a=[],b,c,e,t,f=0;f<d.length;f++)(b=l.translation[d.charAt(f)])?(c=b.pattern.toString().replace(/.{1}$|^.{1}/g,""),e=b.optional,
|
||||
(b=b.recursive)?(a.push(d.charAt(f)),t={digit:d.charAt(f),pattern:c}):a.push(e||b?c+"?":c)):a.push(d.charAt(f).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"));a=a.join("");t&&(a=a.replace(new RegExp("("+t.digit+"(.*"+t.digit+")?)"),"($1)?").replace(new RegExp(t.digit,"g"),t.pattern));return new RegExp(a)},destroyEvents:function(){b.off("input keydown keyup paste drop blur focusout ".split(" ").join(".mask "))},val:function(a){var c=b.is("input")?"val":"text";if(0<arguments.length){if(b[c]()!==a)b[c](a);
|
||||
c=b}else c=b[c]();return c},calculateCaretPosition:function(a){var d=c.getMasked(),h=c.getCaret();if(a!==d){var e=b.data("mask-previus-caret-pos")||0;d=d.length;var g=a.length,f=a=0,l=0,k=0,m;for(m=h;m<d&&c.maskDigitPosMap[m];m++)f++;for(m=h-1;0<=m&&c.maskDigitPosMap[m];m--)a++;for(m=h-1;0<=m;m--)c.maskDigitPosMap[m]&&l++;for(m=e-1;0<=m;m--)c.maskDigitPosMapOld[m]&&k++;h>g?h=10*d:e>=h&&e!==g?c.maskDigitPosMapOld[h]||(e=h,h=h-(k-l)-a,c.maskDigitPosMap[h]&&(h=e)):h>e&&(h=h+(l-k)+f)}return h},behaviour:function(d){d=
|
||||
d||window.event;c.invalid=[];var e=b.data("mask-keycode");if(-1===a.inArray(e,l.byPassKeys)){e=c.getMasked();var h=c.getCaret(),g=b.data("mask-previus-value")||"";setTimeout(function(){c.setCaret(c.calculateCaretPosition(g))},a.jMaskGlobals.keyStrokeCompensation);c.val(e);c.setCaret(h);return c.callbacks(d)}},getMasked:function(a,b){var h=[],f=void 0===b?c.val():b+"",g=0,k=d.length,n=0,p=f.length,m=1,r="push",u=-1,w=0;b=[];if(e.reverse){r="unshift";m=-1;var x=0;g=k-1;n=p-1;var A=function(){return-1<
|
||||
g&&-1<n}}else x=k-1,A=function(){return g<k&&n<p};for(var z;A();){var y=d.charAt(g),v=f.charAt(n),q=l.translation[y];if(q)v.match(q.pattern)?(h[r](v),q.recursive&&(-1===u?u=g:g===x&&g!==u&&(g=u-m),x===u&&(g-=m)),g+=m):v===z?(w--,z=void 0):q.optional?(g+=m,n-=m):q.fallback?(h[r](q.fallback),g+=m,n-=m):c.invalid.push({p:n,v:v,e:q.pattern}),n+=m;else{if(!a)h[r](y);v===y?(b.push(n),n+=m):(z=y,b.push(n+w),w++);g+=m}}a=d.charAt(x);k!==p+1||l.translation[a]||h.push(a);h=h.join("");c.mapMaskdigitPositions(h,
|
||||
b,p);return h},mapMaskdigitPositions:function(a,b,d){a=e.reverse?a.length-d:0;c.maskDigitPosMap={};for(d=0;d<b.length;d++)c.maskDigitPosMap[b[d]+a]=1},callbacks:function(a){var g=c.val(),h=g!==f,k=[g,a,b,e],l=function(a,b,c){"function"===typeof e[a]&&b&&e[a].apply(this,c)};l("onChange",!0===h,k);l("onKeyPress",!0===h,k);l("onComplete",g.length===d.length,k);l("onInvalid",0<c.invalid.length,[g,a,b,c.invalid,e])}};b=a(b);var l=this,f=c.val(),k;d="function"===typeof d?d(c.val(),void 0,b,e):d;l.mask=
|
||||
d;l.options=e;l.remove=function(){var a=c.getCaret();l.options.placeholder&&b.removeAttr("placeholder");b.data("mask-maxlength")&&b.removeAttr("maxlength");c.destroyEvents();c.val(l.getCleanVal());c.setCaret(a);return b};l.getCleanVal=function(){return c.getMasked(!0)};l.getMaskedVal=function(a){return c.getMasked(!1,a)};l.init=function(g){g=g||!1;e=e||{};l.clearIfNotMatch=a.jMaskGlobals.clearIfNotMatch;l.byPassKeys=a.jMaskGlobals.byPassKeys;l.translation=a.extend({},a.jMaskGlobals.translation,e.translation);
|
||||
l=a.extend(!0,{},l,e);k=c.getRegexMask();if(g)c.events(),c.val(c.getMasked());else{e.placeholder&&b.attr("placeholder",e.placeholder);b.data("mask")&&b.attr("autocomplete","off");g=0;for(var f=!0;g<d.length;g++){var h=l.translation[d.charAt(g)];if(h&&h.recursive){f=!1;break}}f&&b.attr("maxlength",d.length).data("mask-maxlength",!0);c.destroyEvents();c.events();g=c.getCaret();c.val(c.getMasked());c.setCaret(g)}};l.init(!b.is("input"))};a.maskWatchers={};var f=function(){var b=a(this),d={},e=b.attr("data-mask");
|
||||
b.attr("data-mask-reverse")&&(d.reverse=!0);b.attr("data-mask-clearifnotmatch")&&(d.clearIfNotMatch=!0);"true"===b.attr("data-mask-selectonfocus")&&(d.selectOnFocus=!0);if(p(b,e,d))return b.data("mask",new n(this,e,d))},p=function(b,d,e){e=e||{};var c=a(b).data("mask"),f=JSON.stringify;b=a(b).val()||a(b).text();try{return"function"===typeof d&&(d=d(b)),"object"!==typeof c||f(c.options)!==f(e)||c.mask!==d}catch(w){}},k=function(a){var b=document.createElement("div");a="on"+a;var e=a in b;e||(b.setAttribute(a,
|
||||
"return;"),e="function"===typeof b[a]);return e};a.fn.mask=function(b,d){d=d||{};var e=this.selector,c=a.jMaskGlobals,f=c.watchInterval;c=d.watchInputs||c.watchInputs;var k=function(){if(p(this,b,d))return a(this).data("mask",new n(this,b,d))};a(this).each(k);e&&""!==e&&c&&(clearInterval(a.maskWatchers[e]),a.maskWatchers[e]=setInterval(function(){a(document).find(e).each(k)},f));return this};a.fn.masked=function(a){return this.data("mask").getMaskedVal(a)};a.fn.unmask=function(){clearInterval(a.maskWatchers[this.selector]);
|
||||
delete a.maskWatchers[this.selector];return this.each(function(){var b=a(this).data("mask");b&&b.remove().removeData("mask")})};a.fn.cleanVal=function(){return this.data("mask").getCleanVal()};a.applyDataMask=function(b){b=b||a.jMaskGlobals.maskElements;(b instanceof a?b:a(b)).filter(a.jMaskGlobals.dataMaskAttr).each(f)};k={maskElements:"input,td,span,div",dataMaskAttr:"*[data-mask]",dataMask:!0,watchInterval:300,watchInputs:!0,keyStrokeCompensation:10,useInput:!/Chrome\/[2-4][0-9]|SamsungBrowser/.test(window.navigator.userAgent)&&
|
||||
k("input"),watchDataMask:!1,byPassKeys:[9,16,17,18,36,37,38,39,40,91],translation:{0:{pattern:/\d/},9:{pattern:/\d/,optional:!0},"#":{pattern:/\d/,recursive:!0},A:{pattern:/[a-zA-Z0-9]/},S:{pattern:/[a-zA-Z]/}}};a.jMaskGlobals=a.jMaskGlobals||{};k=a.jMaskGlobals=a.extend(!0,{},k,a.jMaskGlobals);k.dataMask&&a.applyDataMask();setInterval(function(){a.jMaskGlobals.watchDataMask&&a.applyDataMask()},k.watchInterval)},window.jQuery,window.Zepto);
|
||||
267
dziennik/jquery.tipsy.js
Normal file
@@ -0,0 +1,267 @@
|
||||
// tipsy, facebook style tooltips for jquery
|
||||
// version 1.0.0a
|
||||
// (c) 2008-2010 jason frame [jason@onehackoranother.com]
|
||||
// releated under the MIT license
|
||||
|
||||
(function($) {
|
||||
|
||||
function maybeCall(thing, ctx) {
|
||||
return (typeof thing == 'function') ? (thing.call(ctx)) : thing;
|
||||
}
|
||||
|
||||
function fixTitle($ele) {
|
||||
if ($ele.attr('title') || typeof($ele.attr('original-title')) != 'string') {
|
||||
$ele.attr('original-title', $ele.attr('title') || '').removeAttr('title');
|
||||
$ele.append('<span class="sr-only">' + $ele.attr('original-title') + '</span>')
|
||||
}
|
||||
}
|
||||
|
||||
function Tipsy(element, options) {
|
||||
this.$element = $(element);
|
||||
this.options = options;
|
||||
this.enabled = true;
|
||||
fixTitle(this.$element);
|
||||
}
|
||||
|
||||
Tipsy.prototype = {
|
||||
show: function() {
|
||||
var title = this.getTitle();
|
||||
if (title && this.enabled) {
|
||||
var $tip = this.tip();
|
||||
|
||||
$tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title);
|
||||
$tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity
|
||||
$tip.children('.tipsy-inner').css('max-width',this.options.width).css('text-align', this.options.align);
|
||||
$tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).appendTo(document.body);
|
||||
|
||||
var pos = $.extend({}, this.$element.offset(), {
|
||||
width: this.$element[0].offsetWidth,
|
||||
height: this.$element[0].offsetHeight
|
||||
});
|
||||
|
||||
var actualWidth = $tip[0].offsetWidth, actualHeight = $tip[0].offsetHeight;
|
||||
var gravity = (typeof this.options.gravity == 'function')
|
||||
? this.options.gravity.call(this.$element[0])
|
||||
: this.options.gravity;
|
||||
|
||||
var tp;
|
||||
switch (gravity.charAt(0)) {
|
||||
case 'n':
|
||||
tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
|
||||
break;
|
||||
case 's':
|
||||
tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
|
||||
break;
|
||||
case 'e':
|
||||
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset};
|
||||
break;
|
||||
case 'w':
|
||||
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset};
|
||||
break;
|
||||
}
|
||||
|
||||
if (gravity.length == 2) {
|
||||
if (gravity.charAt(1) == 'w') {
|
||||
tp.left = pos.left + pos.width / 2 - 15;
|
||||
} else {
|
||||
tp.left = pos.left + pos.width / 2 - actualWidth + 15;
|
||||
}
|
||||
}
|
||||
|
||||
if(tp.top < 0) tp.top = 0;
|
||||
if(tp.left < 0){
|
||||
tp.left = 0;
|
||||
$tip.children('.tipsy-arrow').css('display', 'none');
|
||||
}
|
||||
|
||||
if(tp.left+actualWidth > $(window).width()){
|
||||
$tip.children('.tipsy-arrow').css('display', 'none');
|
||||
tp.left -= tp.left + actualWidth - $(window).width();
|
||||
if(tp.left < 0){
|
||||
$tip.children('.tipsy-inner').css('width', this.options.width + tp.left );
|
||||
tp.left = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$tip.css(tp).addClass('tipsy-' + gravity);
|
||||
if (this.options.className) {
|
||||
$tip.addClass(maybeCall(this.options.className, this.$element[0]));
|
||||
}
|
||||
|
||||
if(this.options.onShow){
|
||||
this.options.onShow($tip);
|
||||
}
|
||||
|
||||
if (this.options.fade) {
|
||||
$tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity});
|
||||
} else {
|
||||
$tip.css({visibility: 'visible', opacity: this.options.opacity});
|
||||
}
|
||||
|
||||
var ths = this;
|
||||
setTimeout(function(){
|
||||
if(['n', 's'].indexOf(ths.options.gravity) !== -1) {
|
||||
var too = parseFloat($tip.position().top) + parseFloat($tip.height()) - parseFloat($('body').height());
|
||||
if (too > 0) {
|
||||
|
||||
tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2};
|
||||
$tip.css(tp);
|
||||
$tip.children('.tipsy-arrow').css('display', 'none');
|
||||
}
|
||||
}
|
||||
}, 200);
|
||||
}
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
if (this.options.fade) {
|
||||
this.tip().stop().fadeOut(function() { $(this).remove(); });
|
||||
} else {
|
||||
this.tip().remove();
|
||||
}
|
||||
},
|
||||
|
||||
getTitle: function() {
|
||||
var title, $e = this.$element, o = this.options;
|
||||
fixTitle($e);
|
||||
var title, o = this.options;
|
||||
if (typeof o.title == 'string') {
|
||||
title = $e.attr(o.title == 'title' ? 'original-title' : o.title);
|
||||
} else if (typeof o.title == 'function') {
|
||||
title = o.title.call($e[0]);
|
||||
}
|
||||
title = ('' + title).replace(/(^\s*|\s*$)/, "");
|
||||
return title || o.fallback;
|
||||
},
|
||||
|
||||
tip: function() {
|
||||
if (!this.$tip) {
|
||||
this.$tip = $('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"/></div>');
|
||||
}
|
||||
return this.$tip;
|
||||
},
|
||||
|
||||
validate: function() {
|
||||
if (!this.$element[0].parentNode) {
|
||||
this.hide();
|
||||
this.$element = null;
|
||||
this.options = null;
|
||||
}
|
||||
},
|
||||
|
||||
enable: function() { this.enabled = true; },
|
||||
disable: function() { this.enabled = false; },
|
||||
toggleEnabled: function() { this.enabled = !this.enabled; }
|
||||
};
|
||||
|
||||
$.fn.tipsy = function(options) {
|
||||
|
||||
if (options === true) {
|
||||
return this.data('tipsy');
|
||||
} else if (typeof options == 'string') {
|
||||
return this.data('tipsy')[options]();
|
||||
}
|
||||
|
||||
options = $.extend({}, $.fn.tipsy.defaults, options);
|
||||
|
||||
function get(ele) {
|
||||
var tipsy = $.data(ele, 'tipsy');
|
||||
if (!tipsy) {
|
||||
tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options));
|
||||
$.data(ele, 'tipsy', tipsy);
|
||||
}
|
||||
return tipsy;
|
||||
}
|
||||
|
||||
function enter() {
|
||||
var tipsy = get(this);
|
||||
tipsy.hoverState = 'in';
|
||||
if (options.delayIn == 0) {
|
||||
$('.tipsy').remove();
|
||||
tipsy.show();
|
||||
if(tipsy.$tip){
|
||||
tipsy.$tip.data('tipsy', tipsy.$element);
|
||||
}
|
||||
if(options.allowCopy || $(tipsy.$element).attr('data-tooltip-copy') == 'true'){
|
||||
tipsy.$tip.off('mouseenter').on('mouseenter', function(){
|
||||
var tipsy = get($(this).data('tipsy')[0]);
|
||||
clearTimeout(tipsy.outTimeout);
|
||||
}).off('mouseleave').on('mouseleave', function(){
|
||||
tipsy.hoverState = 'out';
|
||||
tipsy.outTimeout = setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn);
|
||||
}
|
||||
};
|
||||
|
||||
function leave() {
|
||||
var tipsy = get(this);
|
||||
tipsy.hoverState = 'out';
|
||||
if (options.delayOut == 0) {
|
||||
tipsy.hide();
|
||||
} else {
|
||||
tipsy.outTimeout = setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut);
|
||||
}
|
||||
};
|
||||
|
||||
if (!options.live) this.each(function() { get(this); });
|
||||
|
||||
if (options.trigger != 'manual') {
|
||||
var binder = options.live ? 'live' : 'bind',
|
||||
//eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus',
|
||||
//eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur';
|
||||
eventIn = 'mouseenter focus',
|
||||
eventOut = 'mouseleave blur';
|
||||
|
||||
this.unbind('mouseenter focus').unbind('mouseleave blur');
|
||||
this[binder](eventIn, enter)[binder](eventOut, leave);
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
$.fn.tipsy.defaults = {
|
||||
className: null,
|
||||
delayIn: 0,
|
||||
delayOut: 100,
|
||||
fade: false,
|
||||
fallback: '',
|
||||
gravity: 'n',
|
||||
html: false,
|
||||
live: false,
|
||||
offset: 0,
|
||||
opacity: 0.8,
|
||||
title: 'title',
|
||||
trigger: 'hover',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
onShow: null,
|
||||
allowCopy: false
|
||||
};
|
||||
|
||||
// Overwrite this method to provide options on a per-element basis.
|
||||
// For example, you could store the gravity in a 'tipsy-gravity' attribute:
|
||||
// return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' });
|
||||
// (remember - do not modify 'options' in place!)
|
||||
$.fn.tipsy.elementOptions = function(ele, options) {
|
||||
if($(ele).data('tipsy-width')){
|
||||
options.width = $(ele).data('tipsy-width');
|
||||
}
|
||||
|
||||
if($(ele).data('tipsy-gravity')){
|
||||
options.gravity = $(ele).data('tipsy-gravity');
|
||||
}
|
||||
return $.metadata ? $.extend({}, options, $(ele).metadata()) : options;
|
||||
};
|
||||
|
||||
$.fn.tipsy.autoNS = function() {
|
||||
return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n';
|
||||
};
|
||||
|
||||
$.fn.tipsy.autoWE = function() {
|
||||
return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w';
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
23
dziennik/jquery.ui.datepicker-pl.js
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
/* Polish initialisation for the jQuery UI date picker plugin. */
|
||||
/* Written by Jacek Wysocki (jacek.wysocki@gmail.com). */
|
||||
jQuery(function($){
|
||||
$.datepicker.regional['pl'] = {
|
||||
closeText: 'Zamknij',
|
||||
prevText: '<Poprzedni',
|
||||
nextText: 'Następny>',
|
||||
currentText: 'Dziś',
|
||||
monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec',
|
||||
'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'],
|
||||
monthNamesShort: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec',//['Sty','Lu','Mar','Kw','Maj','Cze',
|
||||
'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'],//'Lip','Sie','Wrz','Pa','Lis','Gru'],
|
||||
dayNames: ['Niedziela','Poniedziałek','Wtorek','Środa','Czwartek','Piątek','Sobota'],
|
||||
dayNamesShort: ['Nie','Pn','Wt','Śr','Czw','Pt','So'],
|
||||
dayNamesMin: ['N','Pn','Wt','Śr','Cz','Pt','So'],
|
||||
weekHeader: 'Tydz',
|
||||
dateFormat: 'dd.mm.yy',
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: ''};
|
||||
$.datepicker.setDefaults($.datepicker.regional['pl']);
|
||||
});
|
||||
BIN
dziennik/mobilna.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
dziennik/nav-arrow-right.gif
Normal file
|
After Width: | Height: | Size: 54 B |
28
dziennik/odbiorcyWiadomosci.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
$kontakty = [
|
||||
1 => [
|
||||
"Ghostfox"
|
||||
],
|
||||
2 => [
|
||||
"Youpiter"
|
||||
]
|
||||
];
|
||||
|
||||
$typ = $_POST["typ"];
|
||||
|
||||
if (!isset($typ) || !array_key_exists($typ, $kontakty)) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($kontakty[$typ] as $indeks => $nazwa) {
|
||||
$indeks++;
|
||||
$komorka = $indeks % 2 == 0 ? "komorka_kolor" : "komorka_biala";
|
||||
|
||||
echo("
|
||||
<label class=\"label1 $komorka\">
|
||||
<input name=\"odbiorcy[]\" type=\"checkbox\" value=\"$indeks\"/>
|
||||
<span class=\"nazwa-uzytkownika\">$nazwa</span>
|
||||
</label>
|
||||
");
|
||||
}
|
||||
?>
|
||||
BIN
dziennik/pasek_gorny.jpg
Normal file
|
After Width: | Height: | Size: 325 B |
538
dziennik/skrypty.js
Normal file
@@ -0,0 +1,538 @@
|
||||
/* WINDOW onLOAD jQUERY */
|
||||
var szerokoscOkna;
|
||||
var extendSession = 0;
|
||||
var ajax_wait_cursor = true;
|
||||
|
||||
// window.addEventListener("error", function(e){
|
||||
// if(!system_url){
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// $.post(system_url+'/helper/blad', {
|
||||
// url: document.location.href,
|
||||
// blad: e.message,
|
||||
// skrot: e.error.message,
|
||||
// stos: e.error.stack,
|
||||
// plik: e.filename,
|
||||
// linia: e.lineno,
|
||||
// kolumna: e.colno
|
||||
// });
|
||||
// });
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
//setInterval(function(){alert('test: '+$('*[src=""],*[href=""]').length);},3000);
|
||||
//ustawTabIndexy()
|
||||
/*if(typeof system_url=='undefined')
|
||||
{
|
||||
var c = getCookie('system_url');
|
||||
if(c!='')
|
||||
{
|
||||
system_url = decodeURIComponent(c);
|
||||
delete c;
|
||||
}
|
||||
}*/
|
||||
document.cookie = 'rozdzielczosc=' + screen.width + 'x' + screen.height + '; path=/';
|
||||
|
||||
document.onkeydown = function(evt) {
|
||||
evt = evt || window.event;
|
||||
if (evt.keyCode == 27) {
|
||||
if($("#zakryjcontent:visible").height() != null)
|
||||
{
|
||||
$("#zakryjcontent .zamknij").click();
|
||||
}
|
||||
}
|
||||
else if(evt.keyCode==8)
|
||||
{
|
||||
if($("[id*=niebezpiecznaOperacja]:visible").height() != null)
|
||||
{
|
||||
evt.preventDefault();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
kasowanieClick();
|
||||
|
||||
/*$("a#wyloguj").click(
|
||||
function() {
|
||||
return confirm("Wylogować ?");
|
||||
}
|
||||
);*/
|
||||
|
||||
if ( self != top )
|
||||
{
|
||||
top.location = self.location;
|
||||
}
|
||||
|
||||
repozytorium();
|
||||
|
||||
$(window).resize(function() {
|
||||
if($("#zakryjcontent:visible").height() != null) {
|
||||
oknoDynamiczneResize(1,szerokoscOkna);
|
||||
}
|
||||
repozytorium();
|
||||
});
|
||||
|
||||
|
||||
$('form').submit(
|
||||
function() {
|
||||
var form = $(this);
|
||||
var submit = form.find('input[type=submit]');
|
||||
form.css('opacity','0.8');
|
||||
submit.attr('disabled','true').css('opacity','0.5');
|
||||
setTimeout(function(){submit.removeAttr('disabled').css('opacity','1'),form.css('opacity','1')},2000);
|
||||
|
||||
var liczbaPol = $(this).serializeArray().length;
|
||||
if(liczbaPol > 5990){
|
||||
alert('Formularz nie może zostać przesłany, gdyż przekroczono limit 6000 pól.');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
/* AJAX INFO */
|
||||
var content = $('#content');
|
||||
if(content.length==1)
|
||||
{
|
||||
//if($('#ajax_loading_e_dziennik').get(0)==undefined)
|
||||
//{
|
||||
// $('body').append('<div id="ajax_loading_e_dziennik" style="display:none; padding:5px; position:fixed; bottom:10px; -moz-border-radius: 2px; -webkit-border-radius: 2px; -moz-box-shadow: 0px 0px 2px #1783DB; -webkit-box-shadow: 0px 0px 2px #1783DB; box-shadow: 0px 0px 2px #1783DB; border-radius: 2px;"><img src="'+system_url+'/dziennik/wait_iam_loading3.gif" alt=""/></div>');
|
||||
// var ajax_loading = $('#ajax_loading_e_dziennik');
|
||||
// ajax_loading.css({
|
||||
// 'left' : parseInt(content.offset().left+parseInt(content.css('width'))+20)
|
||||
// });
|
||||
//}
|
||||
|
||||
$(document).ajaxSend(function() {
|
||||
//ajax_loading.stop(true, false).fadeIn('normal');
|
||||
if(ajax_wait_cursor)
|
||||
{
|
||||
$('body').prepend('<style id="cursor_loading">*{cursor:wait;}</style>');
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ajaxComplete(function(event, xhr, settings) {
|
||||
// if(settings.url!=system_url+'/helper/generujtokenos' &&
|
||||
// settings.url!=system_url+'/dyrektor/ajaxzastepstwaplandladnia' &&
|
||||
// settings.url!=system_url+'/helper/numerlekcji'){
|
||||
// //alert(xhr.responseText);
|
||||
// generowanieTokenow();
|
||||
// }
|
||||
|
||||
if(strpos(xhr.responseText, '<form')){
|
||||
//alert(xhr.responseText);
|
||||
generowanieTokenow();
|
||||
}
|
||||
|
||||
//ajax_loading.stop(true, false).fadeOut('normal');
|
||||
okienkaInformacyjne();
|
||||
//ustawTabIndexy();
|
||||
$('style#cursor_loading').remove();
|
||||
});
|
||||
|
||||
// do autozalogowania, by przedluzyc sesje
|
||||
$('body').on('change', 'input, textarea, select', function(){
|
||||
extendSession = 1;
|
||||
});
|
||||
|
||||
sprawdzZalogowanie(); // dołożone dodatkowo 09.01.2014
|
||||
//zapiszLekcjeOffline();
|
||||
okienkaInformacyjne();
|
||||
|
||||
generowanieTokenow();
|
||||
|
||||
$('input[autocomplete=off]').filter(":visible").attr('readonly','1').focus(
|
||||
function(){
|
||||
$(this).removeAttr('readonly');
|
||||
}
|
||||
);
|
||||
}
|
||||
/* AJAX INFO STOP */
|
||||
|
||||
$('a.szczesliwy_numerek').tipsy({html:false,gravity: "w",opacity: 1}).click(function() {return false;});
|
||||
|
||||
$('.powiadomienie_menu').parent('a').css('position','relative');
|
||||
|
||||
$("body").on('mouseover mouseleave focus blur','a.info:not(.info-click)', function(e){
|
||||
if (e.type === 'mouseover' || e.type === 'focusin')
|
||||
{
|
||||
var dymek = $(this).find('span:not(.sr-only)');
|
||||
if(!dymek.length) return false;
|
||||
|
||||
if($(this).data('tooltip')){
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!dymek.html().trim().length){
|
||||
dymek.css('display','none');
|
||||
return false;
|
||||
}
|
||||
|
||||
var elOffset = $(this).offset();
|
||||
|
||||
var dymek_style = '';
|
||||
if(dymek.attr('style') != undefined){
|
||||
dymek_style = ' style="'+dymek.attr('style')+'"';
|
||||
}
|
||||
|
||||
if(!$('#mbtooltips').length)
|
||||
$('body').append('<div id="mbtooltips"></div>');
|
||||
|
||||
$('body #mbtooltips').html('');
|
||||
$('body #mbtooltips').append('<span'+dymek_style+'>'+dymek.html()+'</span>');
|
||||
|
||||
var tooltip = $('body #mbtooltips span:last');
|
||||
tooltip.css('top', '1px').css('left', '1px').css('width', dymek.width()).height(dymek.height()).css('display','block');
|
||||
|
||||
var top = elOffset.top-15-tooltip.height();
|
||||
var left = elOffset.left;
|
||||
|
||||
|
||||
if(left+tooltip.width()+15 > $(window).scrollLeft()+$(window).width()){
|
||||
left -= (left+tooltip.width()+15) - ($(window).scrollLeft()+$(window).width());
|
||||
}
|
||||
|
||||
if(top < $(window).scrollTop()){
|
||||
top = elOffset.top+25;
|
||||
}
|
||||
|
||||
tooltip.css('top', top+'px').css('left', left+'px');
|
||||
|
||||
dymek.css('display','none');
|
||||
|
||||
if (!dymek.parent().find('.sr-only').length) {
|
||||
dymek.after('<span class="sr-only">' + dymek.html() + '</span>');
|
||||
}
|
||||
|
||||
$(this).data('tooltip', { tooltip: tooltip });
|
||||
tooltip.data('tooltip', { parent: $(this) });
|
||||
|
||||
tooltip.on('mouseenter', function(){
|
||||
clearTimeout($(this).data('tooltip').parent.data('tooltip').tmt);
|
||||
}).off('mouseleave').on('mouseleave', function(){
|
||||
var parent = $(this).data('tooltip').parent;
|
||||
var data = parent.data('tooltip');
|
||||
data.tmt = setTimeout(function(){
|
||||
if(data && data.tooltip){
|
||||
data.tooltip.remove();
|
||||
parent.data('tooltip', false);
|
||||
}
|
||||
}, 100);
|
||||
parent.data('tooltip', data);
|
||||
});
|
||||
|
||||
}else if(e.type === 'mouseleave' || e.type === 'focusout'){
|
||||
var ths = $(this);
|
||||
var data = $(this).data('tooltip');
|
||||
data.tmt = setTimeout(function(){
|
||||
if(data && data.tooltip){
|
||||
data.tooltip.remove();
|
||||
ths.data('tooltip', false);
|
||||
}
|
||||
}, 100);
|
||||
$(this).data('tooltip', data);
|
||||
// $('body #mbtooltips').html('');
|
||||
}
|
||||
});
|
||||
//setInterval(function(){ustawTabIndexy();},1000);
|
||||
|
||||
// do wyłączania tooltipów przy klikaniu na inny element w przeglądarce mobilnej
|
||||
if(isMobile()){
|
||||
$('body').on('click', '*', function(){
|
||||
$('body #mbtooltips').html('');
|
||||
});
|
||||
}
|
||||
|
||||
$('.info-click').live('click',
|
||||
function() {
|
||||
$(this).find('span').toggle();
|
||||
}
|
||||
).mouseleave(
|
||||
function() {
|
||||
$(this).find('span:visible').toggle();
|
||||
}
|
||||
);
|
||||
|
||||
$('.przecinek_na_kropke').live('change',
|
||||
function() {
|
||||
var wartosc = $(this).val();
|
||||
if(wartosc!='' && wartosc!=undefined)
|
||||
{
|
||||
$(this).val($(this).val().replace(",", "."));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
);
|
||||
|
||||
$('body').on('focusout', 'input', function(){
|
||||
var type = $(this).attr('type');
|
||||
var types = new Array('text', 'number', 'email', 'color', 'date', 'month', 'range', 'search', 'tel', 'time', 'url', 'week');
|
||||
if($(this).attr('data-dozwolona-spacja') || types.indexOf(type) == -1){
|
||||
return true;
|
||||
}
|
||||
|
||||
$(this).val( $(this).val().trim() );
|
||||
});
|
||||
|
||||
$('.bez_spacji').keyup(
|
||||
function() {
|
||||
var wartosc = $(this).val();
|
||||
if(wartosc!='' && wartosc!=undefined)
|
||||
{
|
||||
$(this).val($(this).val().replace(" ", ""));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
);
|
||||
|
||||
$('.walidacja_liczba').live('change',
|
||||
function() {
|
||||
var wartosc = $(this).val();
|
||||
if(wartosc!='' && wartosc!==undefined)
|
||||
{
|
||||
$(this).val($(this).val().replace(",", "."));
|
||||
if(isNaN($(this).val()))
|
||||
{
|
||||
alert('Podano niepoprawną wartość - wymagana jest liczba.');
|
||||
$(this).val('');
|
||||
}
|
||||
else if($(this).hasClass('kwota'))
|
||||
{
|
||||
$(this).val(parseFloat($(this).val()).toFixed(2));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
);
|
||||
|
||||
$('.walidacja_pesel').live('change',
|
||||
function() {
|
||||
var pole = $(this);
|
||||
var wartosc = pole.val();
|
||||
if(wartosc!='' && wartosc!==undefined)
|
||||
{
|
||||
$.post(
|
||||
system_url+'/helper/sprawdzpesel', {pesel:wartosc},
|
||||
function(data)
|
||||
{
|
||||
if(data==0)
|
||||
{
|
||||
alert('Podany nr PESEL jest nieprawidłowy!');
|
||||
pole.val('');
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
);
|
||||
|
||||
$('.walidacja_email').change(
|
||||
function()
|
||||
{
|
||||
var pole = $(this);
|
||||
var email = pole.val();
|
||||
if(email!='' && email!==undefined)
|
||||
{
|
||||
$.post(
|
||||
system_url+'/helper/sprawdzmaila', {email:email},
|
||||
function(data)
|
||||
{
|
||||
if(data!=1)
|
||||
{
|
||||
alert("Wygląda na to, że podany adres e-mail \""+email+"\" jest niepoprawny!");
|
||||
pole.val('');
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
);
|
||||
|
||||
$('body').on('change', '.walidacja_isbn', function(){
|
||||
var pole = $(this);
|
||||
var wartosc = pole.val();
|
||||
pole.attr('walidacja', 'false');
|
||||
if(wartosc!='' && wartosc!==undefined){
|
||||
$.post(system_url+'/helper/sprawdzisbn', {isbn:wartosc},
|
||||
function(data){
|
||||
if(data==0){
|
||||
pole.attr('walidacja','false');
|
||||
}else{
|
||||
pole.val(data);
|
||||
pole.attr('walidacja','true');
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
// uruchomienie podstrony przez rekord tabeli
|
||||
$('body').on('mouseup keypress', 'table[link] tbody tr.podswietl[rel], table[link] tr.podswietl[rel]', function(e){
|
||||
|
||||
if($(e.target).is('[data-link-no-click]') || $(e.target).parents('[data-link-no-click]').length){
|
||||
return true;
|
||||
}else if($(e.target).is('a')){
|
||||
var url = $(e.target).attr('href');
|
||||
}else if($(e.target).parents('a').length){
|
||||
var url = $(e.target).parents('a').attr('href');
|
||||
}else{
|
||||
var url = $(this).parents().filter('table[link]').eq(0).attr('link')+$(this).attr('rel');
|
||||
}
|
||||
|
||||
otworzLink(url, e);
|
||||
return true;
|
||||
});
|
||||
|
||||
// zapobieganie uruchamiania scrollowania
|
||||
$('body').on('mousedown', 'table[link] tbody tr.podswietl[rel], table[link] tr.podswietl[rel]', function(e){
|
||||
if(e.which === 2){
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
// tooltip
|
||||
$('.autoTooltip').tipsy({html:true,gravity: 's',opacity: 1, live: true, align: 'left'});
|
||||
|
||||
// automatyczne zaznaczenie pola option o podanej wartosci
|
||||
$('select[opt]').each(function(){
|
||||
$(this).val( $(this).attr('opt') );
|
||||
});
|
||||
|
||||
// wczytywanie do tooltipa tresci z url podanego w atrybucie
|
||||
$('body').on('click', '[clickTooltipAjax]', function(e){
|
||||
var ths = $(this);
|
||||
|
||||
if(ths.attr('original-title')){
|
||||
e.stopImmediatePropagation();
|
||||
|
||||
ths.tipsy("show");
|
||||
$('body').one('click', clickTooltipAjaxHide);
|
||||
}else{
|
||||
|
||||
$.post(ths.attr('clickTooltipAjax'), jQuery.parseJSON(ths.attr('data-json')),
|
||||
function(data){
|
||||
ths.attr('title', data);
|
||||
ths.tipsy({trigger: 'manual', html:true, gravity: 'n', opacity: 1, width: ths.data('width')}).tipsy('show');
|
||||
$('body').one('click', clickTooltipAjaxHide);
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
var clickTooltipAjaxHide = function(e){
|
||||
$('[clickTooltipAjax][original-title]').tipsy("hide");
|
||||
}
|
||||
|
||||
$('body').on('click', 'tr.zaznacz-checkbox', function(event){
|
||||
if($(event.target).is('input.zaznacz[type=checkbox], .nie-zaznaczaj')){
|
||||
return true;
|
||||
}
|
||||
|
||||
var checkbox = $(this).find('input.zaznacz[type=checkbox]:not([disabled])').first();
|
||||
checkbox.attr('checked', !checkbox.is(':checked') ).change();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('body').on('click', 'tr.zaznacz-radio', function(event){
|
||||
$(this).find('input.zaznacz[type=radio]:not([disabled])').first().attr('checked', true).change();
|
||||
});
|
||||
|
||||
|
||||
$('body').on('click', '.mobidziennik_wiadomosci_link_confirm', function(event){
|
||||
return confirm("Jeśli stronę \""+$(this).attr('href')+"\" uznajesz za bezpieczną, potwierdź OK w celu przejścia do niej.");
|
||||
});
|
||||
|
||||
|
||||
// scrolltop by attr in url
|
||||
if(document.location.hash.length && document.location.hash.indexOf('scrolltop:')){
|
||||
var scrolltop = document.location.hash.split('scrolltop:');
|
||||
$('body, html').scrollTop( parseInt(scrolltop[1]) );
|
||||
}
|
||||
|
||||
var mouseleaveItems = [];
|
||||
var mouseleaveTimeouts = [];
|
||||
|
||||
function showMenuItem(item) {
|
||||
$(item).css('background', '#fff');
|
||||
$(item).css('position', 'relative');
|
||||
$(item).children('ul').css('visibility', 'visible').css('opacity', '1');
|
||||
}
|
||||
|
||||
function hideMenuItem(item) {
|
||||
$(item).css('background', '');
|
||||
var ul = $(item).find('ul');
|
||||
ul.css('visibility', '').css('opacity', '0');
|
||||
}
|
||||
|
||||
function getMenuLevel(item) {
|
||||
var level = 0;
|
||||
if ($(item).parent().parent().parent().parent().parent().prop('id') === 'menu_gray') {
|
||||
level = 1;
|
||||
} else if ($(item).parent().parent().parent().parent().parent().parent().parent().prop('id') === 'menu_gray') {
|
||||
level = 2;
|
||||
} else if ($(item).parent().parent().parent().parent().parent().parent().parent().parent().parent().prop('id') === 'menu_gray') {
|
||||
level = 3;
|
||||
}
|
||||
return level;
|
||||
}
|
||||
|
||||
function menuMouseenter() {
|
||||
var level = getMenuLevel(this);
|
||||
for (var i = level; i <= 3; i++) {
|
||||
clearTimeout(mouseleaveTimeouts[i]);
|
||||
if (mouseleaveItems[level] !== this) {
|
||||
hideMenuItem(mouseleaveItems[i]);
|
||||
}
|
||||
}
|
||||
showMenuItem(this);
|
||||
}
|
||||
|
||||
function menuMouseleave() {
|
||||
var item = this;
|
||||
var level = getMenuLevel(item);
|
||||
if (level === 0 && $(item).find('ul').length === 0) {
|
||||
hideMenuItem(item);
|
||||
} else {
|
||||
mouseleaveItems[level] = item;
|
||||
mouseleaveTimeouts[level] = setTimeout(function() {
|
||||
hideMenuItem(item);
|
||||
}, 400);
|
||||
}
|
||||
}
|
||||
|
||||
function menuFocus() {
|
||||
|
||||
$(this).mouseenter();
|
||||
}
|
||||
|
||||
function menuBlur() {
|
||||
$(this).mouseleave();
|
||||
}
|
||||
|
||||
$('body').on('mouseenter', '#menu_gray li', menuMouseenter);
|
||||
$('body').on('mouseleave', '#menu_gray li', menuMouseleave);
|
||||
$('body').on('focus', '#menu_gray a', menuFocus);
|
||||
$('body').on('blur', '#menu_gray a', menuBlur);
|
||||
|
||||
if($('body').attr('data-zablokowany') == 'true'){
|
||||
$('body').on('click change', 'input[type=text], input[type=password], input[type=checkbox], input[type=radio], textarea, select, .ui-dropdownchecklist, .ui-dropdownchecklist-selector', function(){
|
||||
if($(this).attr('data-dostepnosc-zablokowany') == 'true' || getCookie('dziennik-zablokowany-alert')){
|
||||
return true;
|
||||
}
|
||||
|
||||
setCookie('dziennik-zablokowany-alert', '1', 0.0416); // 1h
|
||||
alert('Dziennik został zablokowany lub przeniesiony do archiwum. Dokonywanie wszelkich zmian jest niemożliwe.');
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
$('body').on('change', 'input.hasDatepicker:not([readonly])', function(){
|
||||
if(!isValidDate($(this).val())){
|
||||
$(this).val('');
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
2641
dziennik/skrypty_funkcje.js
Normal file
4292
dziennik/style.css
Normal file
16113
dziennik/tiny_mce.js
vendored
Normal file
58
dziennik/wiadomoscikopierobocze.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
echo("
|
||||
<a href=\"#\" class=\"button_right zamknij\" title=\"Zamknij okno\">X</a>
|
||||
<h1>Kopie robocze</h1>
|
||||
<script type=\"text/javascript\">
|
||||
<!--
|
||||
$(document).ready(
|
||||
function()
|
||||
{
|
||||
$('div.podswietl').click(
|
||||
function() {
|
||||
if(confirm('Wczytać temat oraz treść do formularza tworzenia wiadomości ?')==true)
|
||||
{
|
||||
$('input[name=nazwa]').val($(this).find('span.temat').html());
|
||||
tinyMCE.get('tresc').setContent($(this).find('span.tresc').html());
|
||||
$('#zakryjcontent').scrollTop(0);
|
||||
$('.zamknij').click();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
);
|
||||
|
||||
$('div.podswietl').keypress(
|
||||
function (event) {
|
||||
if (event.which == 13) {
|
||||
$(event.target).click();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$('div.podswietl button.usun').click(
|
||||
function() {
|
||||
if(confirm('Czy na pewno usunąć kopie roboczą ?')==true)
|
||||
{
|
||||
alert(this.parentElement.tabIndex);
|
||||
$('#zakryjcontent').scrollTop(0);
|
||||
$('.zamknij').click();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
//-->
|
||||
</script>
|
||||
");
|
||||
|
||||
|
||||
echo("
|
||||
<div class=\"podswietl komorka_biala\" style=\"padding:10px; margin-bottom:10px; border: 1px solid #aaa; border-radius: 4px;\" tabindex=\"0\">
|
||||
<span class=\"tresc\"><p>Test</p></span>
|
||||
<br/><br/>
|
||||
Temat: <strong><span class=\"temat\">Test</span></strong><br/>
|
||||
Zapisano: <strong>wtorek, 10 lutego 2026, godzina 14:16:13</strong>
|
||||
<button style=\"float: right;\" class=\"usun\">Usuń</button>
|
||||
</div>
|
||||
");
|
||||
?>
|
||||