From: Marek Stępniowski Date: Sun, 7 Sep 2008 20:37:22 +0000 (+0200) Subject: Moved project files to wolnelektury directory. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/2f1c330e555c24deb17b7d6018b59c52dab7aafd?page=%7B%7B%20page%20%7D%7D%7B%7B%20getvars%20%7D%7D Moved project files to wolnelektury directory. --- diff --git a/README b/README deleted file mode 100644 index 8c024c0d5..000000000 --- a/README +++ /dev/null @@ -1,5 +0,0 @@ -Dependencies -============ - - * `Django 1.0 `_ (application framework) - * `lxml 2.0.0 `_ (for importing books) \ No newline at end of file diff --git a/__init__.py b/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/locale/pl/LC_MESSAGES/django.mo b/locale/pl/LC_MESSAGES/django.mo deleted file mode 100644 index 216cfcd22..000000000 Binary files a/locale/pl/LC_MESSAGES/django.mo and /dev/null differ diff --git a/locale/pl/LC_MESSAGES/django.po b/locale/pl/LC_MESSAGES/django.po deleted file mode 100644 index b09ad0913..000000000 --- a/locale/pl/LC_MESSAGES/django.po +++ /dev/null @@ -1,156 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-09-04 06:17-0500\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: catalogue/models.py:15 -msgid "author" -msgstr "autor" - -#: catalogue/models.py:16 -msgid "epoch" -msgstr "epoka" - -#: catalogue/models.py:17 -msgid "kind" -msgstr "rodzaj" - -#: catalogue/models.py:18 -msgid "genre" -msgstr "gatunek" - -#: catalogue/models.py:19 -msgid "theme" -msgstr "motyw" - -#: catalogue/models.py:20 -msgid "set" -msgstr "zestaw" - -#: catalogue/models.py:34 -msgid "name" -msgstr "nazwa" - -#: catalogue/models.py:35 catalogue/models.py:71 -msgid "slug" -msgstr "slug" - -#: catalogue/models.py:36 -msgid "sort key" -msgstr "klucz sortowania" - -#: catalogue/models.py:37 -msgid "category" -msgstr "kategoria" - -#: catalogue/models.py:45 catalogue/models.py:72 catalogue/models.py:86 -#: chunks/models.py:11 -msgid "description" -msgstr "opis" - -#: catalogue/models.py:54 newtagging/models.py:470 -msgid "tag" -msgstr "tag" - -#: catalogue/models.py:55 newtagging/admin.py:38 -msgid "tags" -msgstr "tagi" - -#: catalogue/models.py:70 -msgid "title" -msgstr "tytuł" - -#: catalogue/models.py:73 -msgid "creation date" -msgstr "data utworzenia" - -#: catalogue/models.py:76 -msgid "XML file" -msgstr "plik XML" - -#: catalogue/models.py:77 -msgid "PDF file" -msgstr "plik PDF" - -#: catalogue/models.py:78 -msgid "ODT file" -msgstr "plik ODT" - -#: catalogue/models.py:79 -msgid "HTML file" -msgstr "plik HTML" - -#: catalogue/models.py:162 -msgid "book" -msgstr "książka" - -#: catalogue/models.py:163 -msgid "books" -msgstr "książki" - -#: catalogue/models.py:180 -msgid "fragment" -msgstr "fragment" - -#: catalogue/models.py:181 -msgid "fragments" -msgstr "fragmenty" - -#: chunks/models.py:10 -msgid "key" -msgstr "klucz" - -#: chunks/models.py:10 -msgid "A unique name for this chunk of content" -msgstr "Unikalna nazwa dla tego kawałka treści" - -#: chunks/models.py:12 -#, fuzzy -msgid "content" -msgstr "typ zawartości" - -#: chunks/models.py:16 -msgid "chunk" -msgstr "kawałek" - -#: chunks/models.py:17 -msgid "chunks" -msgstr "kawałki" - -#: newtagging/models.py:471 -msgid "content type" -msgstr "typ zawartości" - -#: newtagging/models.py:472 -msgid "object id" -msgstr "id obiektu" - -#: newtagging/views.py:29 -msgid "tagged_object_list must be called with a queryset or a model." -msgstr "" - -#: newtagging/views.py:31 -msgid "tagged_object_list must be called with a tag model." -msgstr "" - -#: newtagging/views.py:33 -msgid "tagged_object_list must be called with a tag." -msgstr "" - -#: newtagging/views.py:37 -#, python-format -msgid "No tags found matching \"%s\"." -msgstr "Nie znaleziono tagów zgodnych z \"%s\"." diff --git a/manage.py b/manage.py deleted file mode 100755 index 5e78ea979..000000000 --- a/manage.py +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env python -from django.core.management import execute_manager -try: - import settings # Assumed to be in the same directory. -except ImportError: - import sys - sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) - sys.exit(1) - -if __name__ == "__main__": - execute_manager(settings) diff --git a/media/css/jquery.autocomplete.css b/media/css/jquery.autocomplete.css deleted file mode 100644 index 9c5a36dfb..000000000 --- a/media/css/jquery.autocomplete.css +++ /dev/null @@ -1,36 +0,0 @@ -.ac_results { - padding: 0px; - border: 0.1em solid #999; - background-color: #FFF; - overflow: hidden; - z-index: 99999; -} - -.ac_results ul { - width: 100%; - list-style-position: outside; - list-style: none; - padding: 0; - margin: 0; -} - -.ac_results li { - margin: 0; - padding: 0.2em 0.5em; - cursor: default; - display: block; - overflow: hidden; -} - -.ac_loading { - background: white url(/media/img/indicator.gif) right center no-repeat; -} - -.ac_odd { - background-color: #EEE; -} - -.ac_over { - background-color: #0A246A; - color: #FFF; -} diff --git a/media/css/master.css b/media/css/master.css deleted file mode 100644 index 6615ee6c8..000000000 --- a/media/css/master.css +++ /dev/null @@ -1,454 +0,0 @@ -body { - margin: 0 2em 2em 2em; - font: 70% Verdana, Arial, Helvetica, sans-serif; - line-height: 1.5em; - background: #FFF url(/media/img/bg.png) repeat-x; - color: #2F4110; -} - -img { - border: none; -} - -a { - color: #295158; - text-decoration: none; -} - -a:hover, a:active { - text-decoration: underline; -} - -input { - font: 1em Verdana, Arial, Helvetica, sans-serif; -} - -h1 { - font: normal normal bold 1.75em Arial, sans-serif; - color: #2F4110; - margin: 0.55em 0 0 0; -} - -h2 { - font-size: 1.2em; - font-weight: bold; - color: #2F4110; - margin: 0; -} - -h3 { - font-size: 1.3em; - font-weight: bold; - margin: 0.2em 0 0 0; - color: #333; -} - -em { - font-style: normal; - background-color: #F5DC7D; -} - -.clearboth { - clear: both; -} - -.blur { - color: #777; -} - -/* ================================== */ -/* = Header with logo and user-info = */ -/* ================================== */ -#header { - position: relative; - margin-top: 1.5em; -} - -#header #logo { - float: left; -} - -#header #user-info { - margin: 0 0 0 auto; - width: 40em; - text-align: right; -} - -#site-description { - margin-top: -1.5em; - height:4.5em; - overflow: hidden; - float: right; - width: 42em; - text-align: right; - color: #777; -} - -/* ======================== */ -/* = Footer with sponsors = */ -/* ======================== */ -#footer { - border-top: 0.1em solid #999; - color: #999; - font-size: 0.8em; - padding-top: 0.5em; - margin: 2em 0 0 0; -} - -#footer p { - margin: 0; -} - -#footer a { - color: #999; - text-decoration: underline; -} - - -/* =============== */ -/* = Search form = */ -/* =============== */ -#search-form { - margin: 0.5em 0; - padding: 0.5em; - background-color: rgb(132, 191, 42); - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px; - border-bottom: 0.15em solid #7B9C2D; - border-right: 0.15em solid #7B9C2D; -} - -#search-form p { - margin: 0em 0 0 0; -} - -#search-form ol { - margin: 0; - padding: 0; -} - -#search-form li { - margin: 0; - padding: 0; - list-style: none; - display: inline; -} - -#search-form li.category, #search-form li.book-title { - padding: 0.2em 0.5em 0.2em 0.5em; - background-color: rgb(242, 163, 15); - border: 1px solid #BA8722; - border-right: 1px solid #555; - border-bottom: 1px solid #555; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; -} - -#search-form li.book-title { - background-color: #DDD; - border: 1px solid #999; - border-right: 1px solid #555; - border-bottom: 1px solid #555; -} - -#search-form input[type=submit] { - color: #444; -} - -/* TODO: Shouldn't be needed */ -#book-detail #search-form { - padding: 0.75em 0.5em; -} - -.ac_input { - width: 20em; -} - - -/* ============= */ -/* = Tags list = */ -/* ============= */ -#tags-list { - margin-top: 1em; - padding: 1em; - background-color: #FBEF90; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px; - border-bottom: 0.15em solid #E3D888; - border-right: 0.15em solid #E3D888; -} - -#books #tags-list, #book-detail #tags-list { - margin-left: 39em; -} - -#tags-list ol, #tags-list ul { - padding: 0; - margin: 0.3em 0 1.2em 0; -} - -#tags-list li { - list-style: none; - padding: 0; - margin: 0; -} - -#main-page #categories-list { - float: left; - width: 50%; -} - -#main-page #themes-list { - margin-left: 50%; -} - - -.column { - padding-right: 1em; -} - -.last.column { - padding-right: 0; -} - - -#books-list { - width: 38em; - float: left; -} - -/* ===================== */ -/* = Latest blog posts = */ -/* ===================== */ -#latest-blog-posts { - padding: 0.5em; - margin-top: 0.5em; -} - -#latest-blog-posts ol { - padding: 0 0 0 1.5em; - margin: 0.3em 0 0 0; - list-style-type: square; - color: #D13628; -} - -/* =============== */ -/* = Description = */ -/* =============== */ -#description { - margin-top: 0.5em; - text-align: justify; -} - -#toggle-description, #books .pagination { - width: 100%; - height: 1.5em; - background-color: #EEE; - margin-top: 0.5em; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px; - text-align: center; -} - -#toggle-description p { - margin: 0; - padding: 0; - color: #999; -} - -/* ============================ */ -/* = Books and fragments list = */ -/* ============================ */ -#books-list { - margin: 0; -} - -#books-list ol { - list-style: none; - padding: 0; - margin: 1.5em 0; -} - -.book { - padding: 0.5em; - background-color: #FFF; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; -} - -.fragment { - border-bottom: 0.1em solid #EEE; - margin-top: 0.5em; -} - -.fragment-text, .fragment-short-text { - padding: 0.5em; - background-color: #FFF; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; -} - -.fragment-metadata { - padding: 0.5em 0.5em 1.5em 0.5em; - float: right; -} - -.change-sets { - float: right; -} - -.book-description { - margin-left: 3.5em; -} - -.book-thumbnail { - background: transparent url(/media/img/book.png) no-repeat 0 0; - width: 3em; - height: 3em; - float: left; -} - -/* =============== */ -/* = Simple form = */ -/* =============== */ -.cuteform ol, .cuteform ul { - padding: 0; - margin: 0; - list-style: none; -} - -.cuteform ol li, .cuteform ul li { - margin-top: 0.7em; -} - -.cuteform label { - display: block; -} - -.cuteform span.help-text { - display: block; - font-size: 0.8em; - color: #999; -} - -.cuteform .error { - color: #BF3024; -} - -/* ================ */ -/* = Modal Window = */ -/* ================ */ -.jqmOverlay { background-color: #000; } - -#set-window { - position: absolute; - display: none; - width: 32em; - background-color: transparent; - margin-top: -0.5em; - margin-left: -1em; -} - -#set-window div.header { - background-color: #FFF; - border-right: 0.25em solid #DDD; - width: 4em; - padding: 0.5em 1em 0.5em 1em; -} - -#set-window div.target { - background-color: #FFF; - border-right: 0.3em solid #DDD; - border-bottom: 0.3em solid #DDD; - padding: 1em; -} - -#login-register-window { - position: absolute; - display: none; - width: 24em; - background-color: transparent; - margin-top: -0.5em; - margin-left: 1em; -} - -#login-register-window div.header { - background-color: #FFF; - border-right: 0.3em solid #DDD; - width: 4em; - right: 0; - left: auto; - padding: 0.5em 1em 0.5em 1em; - float: right; - text-align: center; -} - -#login-register-window div.target { - clear: both; - background-color: #FFF; - border-right: 0.3em solid #DDD; - border-bottom: 0.3em solid #DDD; - padding: 1em; -} - -#user-shelves-window { - position: absolute; - display: none; - width: 28em; - background-color: transparent; - margin-top: -0.5em; - margin-left: 1em; -} - -#user-shelves-window div.header { - background-color: #FFF; - border-right: 0.3em solid #DDD; - width: 4em; - right: 0; - left: auto; - padding: 0.5em 1em 0.5em 1em; - float: right; - text-align: center; -} - -#user-shelves-window div.target { - clear: both; - background-color: #FFF; - border-right: 0.3em solid #DDD; - border-bottom: 0.3em solid #DDD; - padding: 1em; -} - -#user-shelves-window ul { - list-style: none; - padding: 0; -} - -#user-shelves-window a.delete-shelf { - color: #900; - float: right; -} - -/* ======================== */ -/* = Alphabetic book list = */ -/* ======================== */ -#book-a-list #book-list ol { - padding: 0; - margin: 0.3em 0 1.2em 0; - list-style: none; -} - -#top-message { - background-color: #2F4110; - color: #FFF; - margin: 0 -2em; - padding: 0 2em; - line-height: 2em; -} - diff --git a/media/css/master.plain.css b/media/css/master.plain.css deleted file mode 100644 index 55bc023ff..000000000 --- a/media/css/master.plain.css +++ /dev/null @@ -1,116 +0,0 @@ -/* =================================================== */ -/* = Common elements: headings, paragraphs and lines = */ -/* =================================================== */ -.fragment h1 { - font-size: 3em; - margin: 1.5em 0; - text-align: center; - line-height: 1.5em; - font-weight: bold; -} - -.fragment h2 { - font-size: 2em; - margin: 1.5em 0 0; - font-weight: bold; - line-height: 1.5em; -} - -.fragment h3 { - font-size: 1.5em; - margin: 1.5em 0 0; - font-weight: normal; - line-height: 1.5em; -} - -.fragment h4 { - font-size: 1em; - margin: 1.5em 0 0; - line-height: 1.5em; -} - -.fragment p { - margin: 0; -} - -/* ======================== */ -/* = Footnotes and themes = */ -/* ======================== */ -.theme-begin { - display: none; -} - -.annotation { - display: none; -} - -/* =================== */ -/* = Custom elements = */ -/* =================== */ -span.author { - font-size: 0.75em; - display: block; - line-height: 1.5em; - margin-bottom: 0.25em; -} - -span.collection { - font-size: 0.75em; - display: block; - line-height: 1.5em; - margin-bottom: -0.25em; -} - -span.subtitle { - font-size: 0.75em; - display: block; - line-height: 1.5em; - margin-top: -0.25em; -} - -div.didaskalia { - font-style: italic; - margin: 0.5em 0 0; -} - -div.kwestia { - margin: 0.5em 0 0; -} - -div.stanza { - margin: 1.5em 0 0; -} - -div.kwestia div.stanza { - margin: 0; -} - -p.paragraph { - text-align: justify; - margin: 1.5em 0 0; -} - -p.motto { - text-align: justify; - font-style: italic; - margin: 1.5em 0 0; -} - -p.motto_podpis { - font-size: 0.875em; -} - -/*div.fragment { - border-bottom: 0.1em solid #999; - padding-bottom: 1.5em; -}*/ - -div.note p, div.note p.paragraph { - text-align: right; - font-style: italic; -} - -hr.spacer { - height: 3em; - visibility: hidden; -} diff --git a/media/img/bg.png b/media/img/bg.png deleted file mode 100644 index be7d63a7c..000000000 Binary files a/media/img/bg.png and /dev/null differ diff --git a/media/img/book.png b/media/img/book.png deleted file mode 100644 index f26483979..000000000 Binary files a/media/img/book.png and /dev/null differ diff --git a/media/img/favicon.png b/media/img/favicon.png deleted file mode 100644 index 6cffce8e5..000000000 Binary files a/media/img/favicon.png and /dev/null differ diff --git a/media/img/footer.png b/media/img/footer.png deleted file mode 100644 index 78634239c..000000000 Binary files a/media/img/footer.png and /dev/null differ diff --git a/media/img/indicator.gif b/media/img/indicator.gif deleted file mode 100644 index 085ccaeca..000000000 Binary files a/media/img/indicator.gif and /dev/null differ diff --git a/media/img/logo.png b/media/img/logo.png deleted file mode 100644 index bf92ee069..000000000 Binary files a/media/img/logo.png and /dev/null differ diff --git a/media/js/catalogue.js b/media/js/catalogue.js deleted file mode 100644 index ad5a7c2c8..000000000 --- a/media/js/catalogue.js +++ /dev/null @@ -1,131 +0,0 @@ -(function($) { - $(function() { - $('#id_q').labelify({labelledClass: 'blur'}); - - target = $('#login-register-window div.target'); - - $('#show-registration-form').click(function() { - $('#login-form').hide(); - $('#registration-form').show(); - }); - - $('#show-login-form').click(function() { - $('#registration-form').hide(); - $('#login-form').show(); - }); - - // Fragments - $('.fragment-text').each(function() { - if ($(this).prev().filter('.fragment-short-text').length) { - $(this).hover( - function() { $(this).css({background: '#F3F3F3', cursor: 'pointer'}); }, - function() { $(this).css({background: '#FFF'}); } - ).click(function() { - $(this).fadeOut(function() { - $(this).prev().fadeIn() - }); - }) - } - }); - - $('.fragment-short-text').click(function() { - $(this).fadeOut(function() { $(this).next().fadeIn() }); - }).hover( - function() { $(this).css({background: '#F3F3F3', cursor: 'pointer'}); }, - function() { $(this).css({background: '#FFF'}); } - ); - - $('#registration-form').ajaxForm({ - dataType: 'json', - beforeSubmit: function() { - $('#registration-form input[type=submit]') - .attr('disabled', 'disabled') - .after(''); - }, - success: function(response) { - if (response.success) { - location.reload(true); - } else { - $('#registration-form span.error').remove(); - $.each(response.errors, function(id, errors) { - $('#id_registration-' + id).before('' + errors[0] + ''); - }); - $('#registration-form input[type=submit]').removeAttr('disabled'); - $('#registration-form img').remove(); - } - } - }); - - $('#login-form').ajaxForm({ - dataType: 'json', - beforeSubmit: function() { - $('#login-form input[type=submit]') - .attr('disabled', 'disabled') - .after(''); - }, - success: function(response) { - if (response.success) { - location.reload(true); - } else { - $('#login-form span.error').remove(); - $.each(response.errors, function(id, errors) { - $('#id_login-' + id).before('' + errors[0] + ''); - }); - $('#login-form input[type=submit]').removeAttr('disabled'); - $('#login-form img').remove(); - } - } - }); - - $('#login-register-window').jqm({ - target: target[0], - overlay: 60, - trigger: '#login-register-link', - onShow: function(hash) { - var offset = $(hash.t).offset(); - hash.w.css({position: 'absolute', left: offset.left - hash.w.width() + $(hash.t).width(), top: offset.top}); - $('div.header', hash.w).css({width: $(hash.t).width()}); - hash.w.show(); - } - }); - - $('#user-shelves-window').jqm({ - ajax: '@href', - target: $('#user-shelves-window div.target')[0], - overlay: 60, - trigger: '#user-shelves-link', - onShow: function(hash) { - var offset = $(hash.t).offset(); - hash.w.css({position: 'absolute', left: offset.left - hash.w.width() + $(hash.t).width(), top: offset.top}); - $('div.header', hash.w).css({width: $(hash.t).width()}); - hash.w.show(); - }, - onLoad: function(hash) { - var shelf_name = $('a.visit-shelf', this).html(); - - $('form', hash.w).ajaxForm({ - target: $('#user-shelves-window div.target'), - success: function() { setTimeout(function() { $('#user-shelves-window').jqmHide() }, 1000) } - }); - - $('ul.shelf-list li', hash.w).hover(function() { - $(this).css({background: '#EEE', cursor: 'pointer'}); - }, function() { - $(this).css({background: 'transparent'}); - }).click(function() { - location.href = $('a.visit-shelf', this).attr('href'); - }); - - $('.delete-shelf').click(function() { - if (confirm('Czy na pewno usunąć półkę ' + shelf_name + '?')) { - $.post($(this).attr('href'), function(data, textStatus) { - $('#user-shelves-window div.target').html(data); - setTimeout(function() { $('#user-shelves-window').jqmHide() }, 1000); - }); - } - return false; - }); - } - }); - }); -})(jQuery) \ No newline at end of file diff --git a/media/js/jquery.autocolumn.js b/media/js/jquery.autocolumn.js deleted file mode 100644 index ea896b67f..000000000 --- a/media/js/jquery.autocolumn.js +++ /dev/null @@ -1,202 +0,0 @@ -// version 1.1.0 -// http://welcome.totheinter.net/columnizer-jquery-plugin/ -// created by: Adam Wulf adam.wulf@gmail.com - -(function($){ - $.fn.columnize = function(options) { - - - var defaults = { - width: 400, - columns : false, - buildOnce : false - }; - var options = $.extend(defaults, options); - - return this.each(function() { - var $inBox = $(this); - var maxHeight = $inBox.height(); - var $cache = $('
'); // this is where we'll put the real content - var lastWidth = 0; - var columnizing = false; - $cache.append($inBox.children().clone()); - - columnizeIt(); - - $(window).resize(function() { - if(!options.buildOnce && $.browser.msie){ - if($inBox.data("timeout")){ - clearTimeout($inBox.data("timeout")); - } - $inBox.data("timeout", setTimeout(columnizeIt, 200)); - }else if(!options.buildOnce){ - columnizeIt(); - }else{ - // don't rebuild - } - }); - - /** - * return a node that has a height - * less than or equal to height - * - * @param putInHere, a dom element - * @$pullOutHere, a jQuery element - */ - function columnize($putInHere, $pullOutHere, $parentColumn, height){ - while($parentColumn.height() < height && - $pullOutHere[0].childNodes.length){ - $putInHere.append($pullOutHere[0].childNodes[0]); - } - if($putInHere[0].childNodes.length == 0) return; - - // now we're too tall, undo the last one - var kids = $putInHere[0].childNodes; - var lastKid = kids[kids.length-1]; - $putInHere[0].removeChild(lastKid); - var $item = $(lastKid); - if($item[0].nodeType == 3){ - // it's a text node, split it up - var oText = $item[0].nodeValue; - var counter2 = options.width / 8; - var columnText; - while($parentColumn.height() < height && oText.length){ - if (oText.indexOf(' ', counter2) != '-1') { - columnText = oText.substring(0, oText.indexOf(' ', counter2)); - } else { - columnText = oText; - } - $putInHere.append(document.createTextNode(columnText)); - if(oText.length > counter2){ - oText = oText.substring(oText.indexOf(' ', counter2)); - }else{ - oText = ""; - } - } - if(oText.length){ - $item[0].nodeValue = oText; - }else{ - return; - } - } - - if($pullOutHere.children().length){ - $pullOutHere.prepend($item); - }else{ - $pullOutHere.append($item); - } - } - - function split($putInHere, $pullOutHere, $parentColumn, height){ - if($pullOutHere.children().length){ - $cloneMe = $pullOutHere.children(":first"); - $clone = $cloneMe.clone(); - if($clone.attr("nodeType") == 1){ - $putInHere.append($clone); - if($clone.is("img") && $parentColumn.height() < height + 20){ - $cloneMe.remove(); - }else if(!$cloneMe.hasClass("dontsplit") && $parentColumn.height() < height + 20){ - $cloneMe.remove(); - }else if($clone.is("img") || $cloneMe.hasClass("dontsplit")){ - $clone.remove(); - }else{ - $clone.empty(); - columnize($clone, $cloneMe, $parentColumn, height); - if($cloneMe.children().length){ - split($clone, $cloneMe, $parentColumn, height); - } - } - } - } - } - - - function singleColumnizeIt() { - if ($inBox.data("columnized") && $inBox.children().length == 1) { - return; - } - $inBox.data("columnized", true); - $inBox.data("columnizing", true); - - $inBox.empty(); - $inBox.append($("
")); //" - $col = $inBox.children().eq($inBox.children().length-1); - $col.append($cache.clone()); - - $inBox.data("columnizing", false); - } - - - function columnizeIt() { - if(lastWidth == $inBox.width()) return; - lastWidth = $inBox.width(); - - var numCols = Math.round($inBox.width() / options.width); - if(options.columns) numCols = options.columns; -// if ($inBox.data("columnized") && numCols == $inBox.children().length) { -// return; -// } - if(numCols <= 1){ - return singleColumnizeIt(); - } - if($inBox.data("columnizing")) return; - $inBox.data("columnized", true); - $inBox.data("columnizing", true); - - $inBox.empty(); - $inBox.append($("
")); //" - $col = $inBox.children(":last"); - $col.append($cache.clone()); - maxHeight = $col.height(); - $inBox.empty(); - - var targetHeight = maxHeight / numCols; - var firstTime = true; - var maxLoops = 3; - for(var loopCount=0;loopCount")); //" - } - - // fill all but the last column - for (var i = 0; i < numCols-1; i++) { - var $col = $inBox.children().eq(i); - columnize($col, $destroyable, $col, targetHeight); - split($col, $destroyable, $col, targetHeight); - } - // the last column in the series - $col = $inBox.children().eq($inBox.children().length-1); - while($destroyable.children().length) $col.append($destroyable.children(":first")); - var afterH = $col.height(); - var diff = afterH - targetHeight; - var totalH = 0; - var min = 10000000; - var max = 0; - $inBox.children().each(function($inBox){ return function($item){ - var h = $inBox.children().eq($item).height(); - totalH += h; - if(h > max) max = h; - if(h < min) min = h; - }}($inBox)); - var avgH = totalH / numCols; - if(max - min > 30){ - targetHeight = avgH + 30; - }else if(Math.abs(avgH-targetHeight) > 20){ - targetHeight = avgH; - }else{ - loopCount = maxLoops; - } - $inBox.append($("
")); - } - $inBox.data("columnizing", false); - } - }); - }; -})(jQuery); diff --git a/media/js/jquery.autocomplete.js b/media/js/jquery.autocomplete.js deleted file mode 100644 index 5ad9178f8..000000000 --- a/media/js/jquery.autocomplete.js +++ /dev/null @@ -1,759 +0,0 @@ -/* - * Autocomplete - jQuery plugin 1.0.2 - * - * Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer - * - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - * - * Revision: $Id: jquery.autocomplete.js 5747 2008-06-25 18:30:55Z joern.zaefferer $ - * - */ - -;(function($) { - -$.fn.extend({ - autocomplete: function(urlOrData, options) { - var isUrl = typeof urlOrData == "string"; - options = $.extend({}, $.Autocompleter.defaults, { - url: isUrl ? urlOrData : null, - data: isUrl ? null : urlOrData, - delay: isUrl ? $.Autocompleter.defaults.delay : 10, - max: options && !options.scroll ? 10 : 150 - }, options); - - // if highlight is set to false, replace it with a do-nothing function - options.highlight = options.highlight || function(value) { return value; }; - - // if the formatMatch option is not specified, then use formatItem for backwards compatibility - options.formatMatch = options.formatMatch || options.formatItem; - - return this.each(function() { - new $.Autocompleter(this, options); - }); - }, - result: function(handler) { - return this.bind("result", handler); - }, - search: function(handler) { - return this.trigger("search", [handler]); - }, - flushCache: function() { - return this.trigger("flushCache"); - }, - setOptions: function(options){ - return this.trigger("setOptions", [options]); - }, - unautocomplete: function() { - return this.trigger("unautocomplete"); - } -}); - -$.Autocompleter = function(input, options) { - - var KEY = { - UP: 38, - DOWN: 40, - DEL: 46, - TAB: 9, - RETURN: 13, - ESC: 27, - COMMA: 188, - PAGEUP: 33, - PAGEDOWN: 34, - BACKSPACE: 8 - }; - - // Create $ object for input element - var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass); - - var timeout; - var previousValue = ""; - var cache = $.Autocompleter.Cache(options); - var hasFocus = 0; - var lastKeyPressCode; - var config = { - mouseDownOnSelect: false - }; - var select = $.Autocompleter.Select(options, input, selectCurrent, config); - - var blockSubmit; - - // prevent form submit in opera when selecting with return key - $.browser.opera && $(input.form).bind("submit.autocomplete", function() { - if (blockSubmit) { - blockSubmit = false; - return false; - } - }); - - // only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all - $input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) { - // track last key pressed - lastKeyPressCode = event.keyCode; - switch(event.keyCode) { - - case KEY.UP: - event.preventDefault(); - if ( select.visible() ) { - select.prev(); - } else { - onChange(0, true); - } - break; - - case KEY.DOWN: - event.preventDefault(); - if ( select.visible() ) { - select.next(); - } else { - onChange(0, true); - } - break; - - case KEY.PAGEUP: - event.preventDefault(); - if ( select.visible() ) { - select.pageUp(); - } else { - onChange(0, true); - } - break; - - case KEY.PAGEDOWN: - event.preventDefault(); - if ( select.visible() ) { - select.pageDown(); - } else { - onChange(0, true); - } - break; - - // matches also semicolon - case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA: - case KEY.TAB: - case KEY.RETURN: - if( selectCurrent() ) { - // stop default to prevent a form submit, Opera needs special handling - event.preventDefault(); - blockSubmit = true; - return false; - } - break; - - case KEY.ESC: - select.hide(); - break; - - default: - clearTimeout(timeout); - timeout = setTimeout(onChange, options.delay); - break; - } - }).focus(function(){ - // track whether the field has focus, we shouldn't process any - // results if the field no longer has focus - hasFocus++; - }).blur(function() { - hasFocus = 0; - if (!config.mouseDownOnSelect) { - hideResults(); - } - }).click(function() { - // show select when clicking in a focused field - if ( hasFocus++ > 1 && !select.visible() ) { - onChange(0, true); - } - }).bind("search", function() { - // TODO why not just specifying both arguments? - var fn = (arguments.length > 1) ? arguments[1] : null; - function findValueCallback(q, data) { - var result; - if( data && data.length ) { - for (var i=0; i < data.length; i++) { - if( data[i].result.toLowerCase() == q.toLowerCase() ) { - result = data[i]; - break; - } - } - } - if( typeof fn == "function" ) fn(result); - else $input.trigger("result", result && [result.data, result.value]); - } - $.each(trimWords($input.val()), function(i, value) { - request(value, findValueCallback, findValueCallback); - }); - }).bind("flushCache", function() { - cache.flush(); - }).bind("setOptions", function() { - $.extend(options, arguments[1]); - // if we've updated the data, repopulate - if ( "data" in arguments[1] ) - cache.populate(); - }).bind("unautocomplete", function() { - select.unbind(); - $input.unbind(); - $(input.form).unbind(".autocomplete"); - }); - - - function selectCurrent() { - var selected = select.selected(); - if( !selected ) - return false; - - var v = selected.result; - previousValue = v; - - if ( options.multiple ) { - var words = trimWords($input.val()); - if ( words.length > 1 ) { - v = words.slice(0, words.length - 1).join( options.multipleSeparator ) + options.multipleSeparator + v; - } - v += options.multipleSeparator; - } - - $input.val(v); - hideResultsNow(); - $input.trigger("result", [selected.data, selected.value]); - return true; - } - - function onChange(crap, skipPrevCheck) { - if( lastKeyPressCode == KEY.DEL ) { - select.hide(); - return; - } - - var currentValue = $input.val(); - - if ( !skipPrevCheck && currentValue == previousValue ) - return; - - previousValue = currentValue; - - currentValue = lastWord(currentValue); - if ( currentValue.length >= options.minChars) { - $input.addClass(options.loadingClass); - if (!options.matchCase) - currentValue = currentValue.toLowerCase(); - request(currentValue, receiveData, hideResultsNow); - } else { - stopLoading(); - select.hide(); - } - }; - - function trimWords(value) { - if ( !value ) { - return [""]; - } - var words = value.split( options.multipleSeparator ); - var result = []; - $.each(words, function(i, value) { - if ( $.trim(value) ) - result[i] = $.trim(value); - }); - return result; - } - - function lastWord(value) { - if ( !options.multiple ) - return value; - var words = trimWords(value); - return words[words.length - 1]; - } - - // fills in the input box w/the first match (assumed to be the best match) - // q: the term entered - // sValue: the first matching result - function autoFill(q, sValue){ - // autofill in the complete box w/the first match as long as the user hasn't entered in more data - // if the last user key pressed was backspace, don't autofill - if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE ) { - // fill in the value (keep the case the user has typed) - $input.val($input.val() + sValue.substring(lastWord(previousValue).length)); - // select the portion of the value not typed by the user (so the next character will erase) - $.Autocompleter.Selection(input, previousValue.length, previousValue.length + sValue.length); - } - }; - - function hideResults() { - clearTimeout(timeout); - timeout = setTimeout(hideResultsNow, 200); - }; - - function hideResultsNow() { - var wasVisible = select.visible(); - select.hide(); - clearTimeout(timeout); - stopLoading(); - if (options.mustMatch) { - // call search and run callback - $input.search( - function (result){ - // if no value found, clear the input box - if( !result ) { - if (options.multiple) { - var words = trimWords($input.val()).slice(0, -1); - $input.val( words.join(options.multipleSeparator) + (words.length ? options.multipleSeparator : "") ); - } - else - $input.val( "" ); - } - } - ); - } - if (wasVisible) - // position cursor at end of input field - $.Autocompleter.Selection(input, input.value.length, input.value.length); - }; - - function receiveData(q, data) { - if ( data && data.length && hasFocus ) { - stopLoading(); - select.display(data, q); - autoFill(q, data[0].value); - select.show(); - } else { - hideResultsNow(); - } - }; - - function request(term, success, failure) { - if (!options.matchCase) - term = term.toLowerCase(); - var data = cache.load(term); - // recieve the cached data - if (data && data.length) { - success(term, data); - // if an AJAX url has been supplied, try loading the data now - } else if( (typeof options.url == "string") && (options.url.length > 0) ){ - - var extraParams = { - timestamp: +new Date() - }; - $.each(options.extraParams, function(key, param) { - extraParams[key] = typeof param == "function" ? param() : param; - }); - - $.ajax({ - // try to leverage ajaxQueue plugin to abort previous requests - mode: "abort", - // limit abortion to this input - port: "autocomplete" + input.name, - dataType: options.dataType, - url: options.url, - data: $.extend({ - q: lastWord(term), - limit: options.max - }, extraParams), - success: function(data) { - var parsed = options.parse && options.parse(data) || parse(data); - cache.add(term, parsed); - success(term, parsed); - } - }); - } else { - // if we have a failure, we need to empty the list -- this prevents the the [TAB] key from selecting the last successful match - select.emptyList(); - failure(term); - } - }; - - function parse(data) { - var parsed = []; - var rows = data.split("\n"); - for (var i=0; i < rows.length; i++) { - var row = $.trim(rows[i]); - if (row) { - row = row.split("|"); - parsed[parsed.length] = { - data: row, - value: row[0], - result: options.formatResult && options.formatResult(row, row[0]) || row[0] - }; - } - } - return parsed; - }; - - function stopLoading() { - $input.removeClass(options.loadingClass); - }; - -}; - -$.Autocompleter.defaults = { - inputClass: "ac_input", - resultsClass: "ac_results", - loadingClass: "ac_loading", - minChars: 1, - delay: 400, - matchCase: false, - matchSubset: true, - matchContains: false, - cacheLength: 10, - max: 100, - mustMatch: false, - extraParams: {}, - selectFirst: true, - formatItem: function(row) { return row[0]; }, - formatMatch: null, - autoFill: false, - width: 0, - multiple: false, - multipleSeparator: ", ", - highlight: function(value, term) { - return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "$1"); - }, - scroll: true, - scrollHeight: 180 -}; - -$.Autocompleter.Cache = function(options) { - - var data = {}; - var length = 0; - - function matchSubset(s, sub) { - if (!options.matchCase) - s = s.toLowerCase(); - var i = s.indexOf(sub); - if (i == -1) return false; - return i == 0 || options.matchContains; - }; - - function add(q, value) { - if (length > options.cacheLength){ - flush(); - } - if (!data[q]){ - length++; - } - data[q] = value; - } - - function populate(){ - if( !options.data ) return false; - // track the matches - var stMatchSets = {}, - nullData = 0; - - // no url was specified, we need to adjust the cache length to make sure it fits the local data store - if( !options.url ) options.cacheLength = 1; - - // track all options for minChars = 0 - stMatchSets[""] = []; - - // loop through the array and create a lookup structure - for ( var i = 0, ol = options.data.length; i < ol; i++ ) { - var rawValue = options.data[i]; - // if rawValue is a string, make an array otherwise just reference the array - rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue; - - var value = options.formatMatch(rawValue, i+1, options.data.length); - if ( value === false ) - continue; - - var firstChar = value.charAt(0).toLowerCase(); - // if no lookup array for this character exists, look it up now - if( !stMatchSets[firstChar] ) - stMatchSets[firstChar] = []; - - // if the match is a string - var row = { - value: value, - data: rawValue, - result: options.formatResult && options.formatResult(rawValue) || value - }; - - // push the current match into the set list - stMatchSets[firstChar].push(row); - - // keep track of minChars zero items - if ( nullData++ < options.max ) { - stMatchSets[""].push(row); - } - }; - - // add the data items to the cache - $.each(stMatchSets, function(i, value) { - // increase the cache size - options.cacheLength++; - // add to the cache - add(i, value); - }); - } - - // populate any existing data - setTimeout(populate, 25); - - function flush(){ - data = {}; - length = 0; - } - - return { - flush: flush, - add: add, - populate: populate, - load: function(q) { - if (!options.cacheLength || !length) - return null; - /* - * if dealing w/local data and matchContains than we must make sure - * to loop through all the data collections looking for matches - */ - if( !options.url && options.matchContains ){ - // track all matches - var csub = []; - // loop through all the data grids for matches - for( var k in data ){ - // don't search through the stMatchSets[""] (minChars: 0) cache - // this prevents duplicates - if( k.length > 0 ){ - var c = data[k]; - $.each(c, function(i, x) { - // if we've got a match, add it to the array - if (matchSubset(x.value, q)) { - csub.push(x); - } - }); - } - } - return csub; - } else - // if the exact item exists, use it - if (data[q]){ - return data[q]; - } else - if (options.matchSubset) { - for (var i = q.length - 1; i >= options.minChars; i--) { - var c = data[q.substr(0, i)]; - if (c) { - var csub = []; - $.each(c, function(i, x) { - if (matchSubset(x.value, q)) { - csub[csub.length] = x; - } - }); - return csub; - } - } - } - return null; - } - }; -}; - -$.Autocompleter.Select = function (options, input, select, config) { - var CLASSES = { - ACTIVE: "ac_over" - }; - - var listItems, - active = -1, - data, - term = "", - needsInit = true, - element, - list; - - // Create results - function init() { - if (!needsInit) - return; - element = $("
") - .hide() - .addClass(options.resultsClass) - .css("position", "absolute") - .appendTo(document.body); - - list = $("
    ").appendTo(element).mouseover( function(event) { - if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') { - active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event)); - $(target(event)).addClass(CLASSES.ACTIVE); - } - }).click(function(event) { - $(target(event)).addClass(CLASSES.ACTIVE); - select(); - // TODO provide option to avoid setting focus again after selection? useful for cleanup-on-focus - input.focus(); - return false; - }).mousedown(function() { - config.mouseDownOnSelect = true; - }).mouseup(function() { - config.mouseDownOnSelect = false; - }); - - if( options.width > 0 ) - element.css("width", options.width); - - needsInit = false; - } - - function target(event) { - var element = event.target; - while(element && element.tagName != "LI") - element = element.parentNode; - // more fun with IE, sometimes event.target is empty, just ignore it then - if(!element) - return []; - return element; - } - - function moveSelect(step) { - listItems.slice(active, active + 1).removeClass(CLASSES.ACTIVE); - movePosition(step); - var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE); - if(options.scroll) { - var offset = 0; - listItems.slice(0, active).each(function() { - offset += this.offsetHeight; - }); - if((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) { - list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight()); - } else if(offset < list.scrollTop()) { - list.scrollTop(offset); - } - } - }; - - function movePosition(step) { - active += step; - if (active < 0) { - active = listItems.size() - 1; - } else if (active >= listItems.size()) { - active = 0; - } - } - - function limitNumberOfItems(available) { - return options.max && options.max < available - ? options.max - : available; - } - - function fillList() { - list.empty(); - var max = limitNumberOfItems(data.length); - for (var i=0; i < max; i++) { - if (!data[i]) - continue; - var formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term); - if ( formatted === false ) - continue; - var li = $("
  • ").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ac_even" : "ac_odd").appendTo(list)[0]; - $.data(li, "ac_data", data[i]); - } - listItems = list.find("li"); - if ( options.selectFirst ) { - listItems.slice(0, 1).addClass(CLASSES.ACTIVE); - active = 0; - } - // apply bgiframe if available - if ( $.fn.bgiframe ) - list.bgiframe(); - } - - return { - display: function(d, q) { - init(); - data = d; - term = q; - fillList(); - }, - next: function() { - moveSelect(1); - }, - prev: function() { - moveSelect(-1); - }, - pageUp: function() { - if (active != 0 && active - 8 < 0) { - moveSelect( -active ); - } else { - moveSelect(-8); - } - }, - pageDown: function() { - if (active != listItems.size() - 1 && active + 8 > listItems.size()) { - moveSelect( listItems.size() - 1 - active ); - } else { - moveSelect(8); - } - }, - hide: function() { - element && element.hide(); - listItems && listItems.removeClass(CLASSES.ACTIVE); - active = -1; - }, - visible : function() { - return element && element.is(":visible"); - }, - current: function() { - return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]); - }, - show: function() { - var offset = $(input).offset(); - element.css({ - width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(), - top: offset.top + input.offsetHeight, - left: offset.left - }).show(); - if(options.scroll) { - list.scrollTop(0); - list.css({ - maxHeight: options.scrollHeight, - overflow: 'auto' - }); - - if($.browser.msie && typeof document.body.style.maxHeight === "undefined") { - var listHeight = 0; - listItems.each(function() { - listHeight += this.offsetHeight; - }); - var scrollbarsVisible = listHeight > options.scrollHeight; - list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight ); - if (!scrollbarsVisible) { - // IE doesn't recalculate width when scrollbar disappears - listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) ); - } - } - - } - }, - selected: function() { - var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE); - return selected && selected.length && $.data(selected[0], "ac_data"); - }, - emptyList: function (){ - list && list.empty(); - }, - unbind: function() { - element && element.remove(); - } - }; -}; - -$.Autocompleter.Selection = function(field, start, end) { - if( field.createTextRange ){ - var selRange = field.createTextRange(); - selRange.collapse(true); - selRange.moveStart("character", start); - selRange.moveEnd("character", end); - selRange.select(); - } else if( field.setSelectionRange ){ - field.setSelectionRange(start, end); - } else { - if( field.selectionStart ){ - field.selectionStart = start; - field.selectionEnd = end; - } - } - field.focus(); -}; - -})(jQuery); \ No newline at end of file diff --git a/media/js/jquery.form.js b/media/js/jquery.form.js deleted file mode 100644 index 659baa989..000000000 --- a/media/js/jquery.form.js +++ /dev/null @@ -1,601 +0,0 @@ -/* - * jQuery Form Plugin - * version: 2.12 (06/07/2008) - * @requires jQuery v1.2.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 - * - * Revision: $Id$ - */ -(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() { - $(this).ajaxSubmit({ - target: '#output' - }); - return false; // <-- important! - }); - }); - - 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 }; - - options = $.extend({ - url: this.attr('action') || window.location.toString(), - type: this.attr('method') || 'GET' - }, 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; - } - - var a = this.formToArray(options.semantic); - if (options.data) { - options.extraData = options.data; - for (var n in options.data) - a.push( { name: n, value: options.data[n] } ); - } - - // 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) { - $(options.target).html(data).each(oldSuccess, arguments); - }); - } - else if (options.success) - callbacks.push(options.success); - - options.success = function(data, status) { - for (var i=0, max=callbacks.length; i < max; i++) - callbacks[i](data, status, $form); - }; - - // are there files to upload? - var files = $('input:file', this).fieldValue(); - var found = false; - for (var j=0; j < files.length; j++) - if (files[j]) - found = true; - - // options.iframe allows user to force iframe mode - if (options.iframe || found) { - // hack to fix Safari hang (thanks to Tim Molendijk for this) - // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d - if ($.browser.safari && 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]', form).length) { - alert('Error: Form elements must not be named "submit".'); - return; - } - - var opts = $.extend({}, $.ajaxSettings, options); - - var id = 'jqFormIO' + (new Date().getTime()); - var $io = $('').css({opacity:0}), - -// O: The jqModal default Open Callback; -// IF ie6; Add the iframe to the overlay (if overlay exists) OR to the modal (if an iframe doesn't already exist from a previous opening) -// Execute the Modal Focus Function -O=function(h){if(ie6)h.o&&h.o.html('

    ').prepend(i)||(!$('iframe.jqm',h.w)[0]&&h.w.prepend(i)); f(h);}, - -// f: The Modal Focus Function; -// Attempt to focus the first visible input within the modal -f=function(h){try{$(':input:visible',h.w)[0].focus();}catch(e){}}, - -// F: The Keep Focus Function; -// Binds or Unbinds (t) the Focus Examination Function to keypresses and clicks -F=function(t){$()[t]("keypress",x)[t]("keydown",x)[t]("mousedown",x);}, - -// x: The Focus Examination Function; -// Fetch the current modal's Hash as h (supports nested modals) -// Determine if the click/press falls within the modal. If not (r===true); -// call the Modal Focus Function and prevent click/press follow-through (return false [!true]) -// ELSE if so (r===false); follow event (return true [!false]) -x=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);r&&f(h);return !r;}, - -// hide-show function; assigns click events to trigger elements that -// hide, show, or hide AND show modals. - -// Expandos (jqmShow and/or jqmHide) are added to all trigger elements. -// These Expandos hold an array of modal serials {INT} to show or hide. - -// w: {DOM Element} The modal element (window/dialog/notice/etc. container) -// e: {DOM Elemet||jQ Selector String} The triggering element -// y: {String} Type (jqmHide||jqmShow) - -// s: {array} the serial number of passed modals, calculated below; -HS=function(w,e,y){var s=[];w.each(function(){s.push(this._jqm)}); - -// for each triggering element attach the jqmHide or jqmShow expando (y) -// or else expand the expando with the current serial array - $(e).each(function(){if(this[y])$.extend(this[y],s); - - // Assign a click event on the trigger element which examines the element's - // jqmHide/Show expandos and attempts to execute $.jqmHide/Show on matching modals - else{this[y]=s;$(this).click(function(){for(var i in {jqmShow:1,jqmHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return false;});}});return w;}; -})(jQuery); \ No newline at end of file diff --git a/media/js/jquery.js b/media/js/jquery.js deleted file mode 100644 index 82b98e1d7..000000000 --- a/media/js/jquery.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * jQuery 1.2.6 - New Wave Javascript - * - * Copyright (c) 2008 John Resig (jquery.com) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $ - * $Rev: 5685 $ - */ -(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else -return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else -return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else -selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else -this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else -return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else -jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else -jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("",""]||!tags.indexOf("",""]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
    "]||!tags.indexOf("",""]||(!tags.indexOf("",""]||!tags.indexOf("",""]||jQuery.browser.msie&&[1,"div

    ","
    "]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf(""&&tags.indexOf("=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else -ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&¬xml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&¬xml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&¬xml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else -while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return im[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else -for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("
    ").append(res.responseText.replace(//g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else -xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else -jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else -for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else -s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else -e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;ithis.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})(); \ No newline at end of file diff --git a/media/js/jquery.labelify.js b/media/js/jquery.labelify.js deleted file mode 100644 index 13196b289..000000000 --- a/media/js/jquery.labelify.js +++ /dev/null @@ -1,89 +0,0 @@ -/** - * jQuery.labelify - Display in-textbox hints - * Stuart Langridge, http://www.kryogenix.org/ - * Released into the public domain - * Date: 25th June 2008 - * @author Stuart Langridge - * @version 1.3 - * - * - * Basic calling syntax: $("input").labelify(); - * Defaults to taking the in-field label from the field's title attribute - * - * You can also pass an options object with the following keys: - * text - * "title" to get the in-field label from the field's title attribute - * (this is the default) - * "label" to get the in-field label from the inner text of the field's label - * (note that the label must be attached to the field with for="fieldid") - * a function which takes one parameter, the input field, and returns - * whatever text it likes - * - * labelledClass - * a class that will be applied to the input field when it contains the - * label and removed when it contains user input. Defaults to blank. - * - */ -jQuery.fn.labelify = function(settings) { - settings = jQuery.extend({ - text: "title", - labelledClass: "" - }, settings); - var lookups = { - title: function(input) { - return $(input).attr("title"); - }, - label: function(input) { - return $("label[for=" + input.id +"]").text(); - } - }; - var lookup; - var jQuery_labellified_elements = $(this); - return $(this).each(function() { - if (typeof settings.text === "string") { - lookup = lookups[settings.text]; // what if not there? - } else { - lookup = settings.text; // what if not a fn? - }; - // bail if lookup isn't a function or if it returns undefined - if (typeof lookup !== "function") { return; } - var lookupval = lookup(this); - if (!lookupval) { return; } - - // need to strip newlines because the browser strips them - // if you set textbox.value to a string containing them - $(this).data("label",lookup(this).replace(/\n/g,'')); - $(this).focus(function() { - if (this.value === $(this).data("label")) { - this.value = this.defaultValue; - $(this).removeClass(settings.labelledClass); - } - }).blur(function(){ - if (this.value === this.defaultValue) { - this.value = $(this).data("label"); - $(this).addClass(settings.labelledClass); - } - }); - - var removeValuesOnExit = function() { - jQuery_labellified_elements.each(function(){ - if (this.value === $(this).data("label")) { - this.value = this.defaultValue; - $(this).removeClass(settings.labelledClass); - } - }) - }; - - $(this).parents("form").submit(removeValuesOnExit); - $(window).unload(removeValuesOnExit); - - if (this.value !== this.defaultValue) { - // user already started typing; don't overwrite their work! - return; - } - // actually set the value - this.value = $(this).data("label"); - $(this).addClass(settings.labelledClass); - - }); -}; \ No newline at end of file diff --git a/middleware.py b/middleware.py deleted file mode 100644 index c9a17dc3a..000000000 --- a/middleware.py +++ /dev/null @@ -1,126 +0,0 @@ -# Orignal version taken from http://www.djangosnippets.org/snippets/186/ -# Original author: udfalkso -# Modified by: Shwagroo Team - -import sys -import os -import re -import hotshot, hotshot.stats -import tempfile -import StringIO -import pprint - -from django.conf import settings -from django.db import connection - - -words_re = re.compile( r'\s+' ) - -group_prefix_re = [ - re.compile( "^.*/django/[^/]+" ), - re.compile( "^(.*)/[^/]+$" ), # extract module path - re.compile( ".*" ), # catch strange entries -] - - -class ProfileMiddleware(object): - """ - Displays hotshot profiling for any view. - http://yoursite.com/yourview/?prof - - Add the "prof" key to query string by appending ?prof (or &prof=) - and you'll see the profiling results in your browser. - It's set up to only be available in django's debug mode, is available for superuser otherwise, - but you really shouldn't add this middleware to any production configuration. - - WARNING: It uses hotshot profiler which is not thread safe. - """ - def process_request(self, request): - if (settings.DEBUG or request.user.is_superuser) and request.GET.has_key('prof'): - connection.queries = [] - self.tmpfile = tempfile.mktemp() - self.prof = hotshot.Profile(self.tmpfile) - - def process_view(self, request, callback, callback_args, callback_kwargs): - if (settings.DEBUG or request.user.is_superuser) and request.GET.has_key('prof'): - return self.prof.runcall(callback, request, *callback_args, **callback_kwargs) - - def get_group(self, file): - for g in group_prefix_re: - name = g.findall( file ) - if name: - return name[0] - - def get_summary(self, results_dict, sum): - list = [ (item[1], item[0]) for item in results_dict.items() ] - list.sort( reverse = True ) - list = list[:40] - - res = " tottime\n" - for item in list: - if sum == 0: - foo = 0 - else: - foo = 100*item[0]/sum - res += "%4.1f%% %7.3f %s\n" % (foo, item[0], item[1] ) - - return res - - def summary_for_files(self, stats_str): - stats_str = stats_str.split("\n")[5:] - - mystats = {} - mygroups = {} - - sum = 0 - - for s in stats_str: - fields = words_re.split(s); - if len(fields) == 7: - time = float(fields[2]) - sum += time - file = fields[6].split(":")[0] - - if not file in mystats: - mystats[file] = 0 - mystats[file] += time - - group = self.get_group(file) - if not group in mygroups: - mygroups[ group ] = 0 - mygroups[ group ] += time - - return "
    " + \
    -               " ---- By file ----\n\n" + self.get_summary(mystats,sum) + "\n" + \
    -               " ---- By group ---\n\n" + self.get_summary(mygroups,sum) + \
    -               "
    " - - def process_response(self, request, response): - if (settings.DEBUG or request.user.is_superuser) and request.GET.has_key('prof'): - self.prof.close() - - out = StringIO.StringIO() - old_stdout = sys.stdout - sys.stdout = out - - stats = hotshot.stats.load(self.tmpfile) - stats.sort_stats('time', 'calls') - stats.print_stats() - - sys.stdout = old_stdout - stats_str = out.getvalue() - - if response and response.content and stats_str: - response.content = "
    " + stats_str + "
    " - - response.content = "\n".join(response.content.split("\n")[:40]) - - response.content += self.summary_for_files(stats_str) - - os.unlink(self.tmpfile) - - response.content += '\n%d SQL Queries:\n' % len(connection.queries) - response.content += pprint.pformat(connection.queries) - - return response - diff --git a/settings.py b/settings.py deleted file mode 100644 index 04b5fd568..000000000 --- a/settings.py +++ /dev/null @@ -1,123 +0,0 @@ -# -*- coding: utf-8 -*- -# Django settings for wolnelektury project. -from os import path - -PROJECT_DIR = path.abspath(path.dirname(__file__)) - -DEBUG = True -TEMPLATE_DEBUG = DEBUG - -ADMINS = ( - (u'Marek Stępniowski', 'marek@stepniowski.com'), -) - -MANAGERS = ADMINS - -DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. -DATABASE_NAME = path.join(PROJECT_DIR, 'lektury.sqlite') # Or path to database file if using sqlite3. -DATABASE_USER = '' # Not used with sqlite3. -DATABASE_PASSWORD = '' # Not used with sqlite3. -DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. -DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. - -# Local time zone for this installation. Choices can be found here: -# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name -# although not all choices may be available on all operating systems. -# If running in a Windows environment this must be set to the same as your -# system time zone. -TIME_ZONE = 'America/Chicago' - -# Language code for this installation. All choices can be found here: -# http://www.i18nguy.com/unicode/language-identifiers.html -LANGUAGE_CODE = 'pl' - -SITE_ID = 1 - -# If you set this to False, Django will make some optimizations so as not -# to load the internationalization machinery. -USE_I18N = True - -# Absolute path to the directory that holds media. -# Example: "/home/media/media.lawrence.com/" -MEDIA_ROOT = PROJECT_DIR + '/media/' - -# URL that handles the media served from MEDIA_ROOT. Make sure to use a -# trailing slash if there is a path component (optional in other cases). -# Examples: "http://media.lawrence.com", "http://example.com/media/" -MEDIA_URL = '/media/' - -# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a -# trailing slash. -# Examples: "http://foo.com/media/", "/media/". -ADMIN_MEDIA_PREFIX = '/admin-media/' - -# Make this unique, and don't share it with anybody. - -# List of callables that know how to import templates from various sources. -TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.load_template_source', - 'django.template.loaders.app_directories.load_template_source', -# 'django.template.loaders.eggs.load_template_source', -) - -TEMPLATE_CONTEXT_PROCESSORS = ( - 'django.core.context_processors.auth', - 'django.core.context_processors.debug', - 'django.core.context_processors.i18n', - 'django.core.context_processors.media', - 'django.core.context_processors.request', -) - -MIDDLEWARE_CLASSES = [ - 'django.middleware.common.CommonMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.middleware.doc.XViewMiddleware', - 'pagination.middleware.PaginationMiddleware', -] - -# If DEBUG is enabled add query log to bottom of every template -if DEBUG: - MIDDLEWARE_CLASSES.append('middleware.ProfileMiddleware') - -ROOT_URLCONF = 'wolnelektury.urls' - -TEMPLATE_DIRS = ( - PROJECT_DIR + '/templates/' -) - -# CSS and JS files to compress -COMPRESS_CSS = { - 'all': { - 'source_filenames': ('css/master.css', 'css/jquery.autocomplete.css', 'css/master.plain.css',), - 'output_filename': 'css/all.min.css', - } -} - -COMPRESS_JS = { - 'all': { - 'source_filenames': ('js/jquery.js', 'js/jquery.autocolumn.js', 'js/jquery.autocomplete.js', - 'js/jquery.form.js', 'js/jquery.jqmodal.js', 'js/jquery.labelify.js', 'js/catalogue.js',), - 'output_filename': 'js/all.min.js', - } -} - -COMPRESS_CSS_FILTERS = None - -LOGIN_URL = '/uzytkownicy/zaloguj/' - -LOGIN_REDIRECT_URL = '/' - -INSTALLED_APPS = ( - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.sites', - 'django.contrib.admin', - 'newtagging', - 'pagination', - 'chunks', - 'compress', - 'catalogue', -) - diff --git a/templates/404.html b/templates/404.html deleted file mode 100644 index 5003eae87..000000000 --- a/templates/404.html +++ /dev/null @@ -1,3 +0,0 @@ -

    Blad 404 - Strona nie istnieje

    - -

    (Tutaj później będzie coś więcej, naprawdę)

    \ No newline at end of file diff --git a/templates/admin/base_site.html b/templates/admin/base_site.html deleted file mode 100644 index d0ca937a0..000000000 --- a/templates/admin/base_site.html +++ /dev/null @@ -1,9 +0,0 @@ -{% extends "admin/base.html" %} - -{% block title %}{{ title }} | Administracja stroną WolneLektury.pl{% endblock %} - -{% block branding %} -

    Administracja stroną WolneLektury.pl

    -{% endblock %} - -{% block nav-global %}{% endblock %} \ No newline at end of file diff --git a/templates/auth/login.html b/templates/auth/login.html deleted file mode 100644 index 6db94aa22..000000000 --- a/templates/auth/login.html +++ /dev/null @@ -1,24 +0,0 @@ -{% extends "base.html" %} - -{% block title %}Zaloguj / Zarejestruj się w WolneLektury.pl{% endblock %} - -{% block body %} -

    Zaloguj się / Załóż konto

    -
    -

  • {{ search_form.q }}
  • lub wróć do strony głównej

    -
    -
    -

    Zaloguj się

    -
      - {{ form.as_ul }} -
    1. -
    -

    -
    - -
    -

    Załóż konto

    - -

    -
    -{% endblock %} diff --git a/templates/base.html b/templates/base.html deleted file mode 100644 index 8c8f1c68b..000000000 --- a/templates/base.html +++ /dev/null @@ -1,99 +0,0 @@ -{% load chunks compressed catalogue_tags %} - - - - - {% block title %}WolneLektury.pl{% endblock %} - - {% compressed_css "all" %} - {% compressed_js "all" %} - {% block extrahead %} - {% endblock %} - - -
    - {% chunk "top-message" %} -
    - -
    - {% block body %} - {% endblock %} -
    -
    - -
    - -
    -
    -

    Zaloguj się / Załóż konto

    -

    -
      - {% authentication_form %} -
    1. -
    -
    - -
    -
    -
    - -
    -

    * Ładowanie

    -
    -
    - - diff --git a/templates/catalogue/book_detail.html b/templates/catalogue/book_detail.html deleted file mode 100644 index ff9278030..000000000 --- a/templates/catalogue/book_detail.html +++ /dev/null @@ -1,107 +0,0 @@ -{% extends "base.html" %} -{% load catalogue_tags %} - -{% block title %}Lektura {{ book.title }} w WolneLektury.pl{% endblock %} - -{% block bodyid %}book-detail{% endblock %} - -{% block extrahead %} - -{% endblock %} - -{% block body %} -

    {{ book.title }}, {{ categories.author|join:", " }}

    -
    -
      - {# {% for tag in tags %} #} - {#
    1. {{ tag }} | x
    2. #} - {# {% endfor %} #} -
    3. {{ book.title }} | x
    4. -
    -
    - -
    - {% if book.has_description %} -
    - {{ book.description|safe }} -
    -

    Zwiń opis ▲

    - {% endif %} -
    - -
    - - {% if book.children.all %} -
    -

    Utwory składające się na ten utwór:

    - {% for book in book.children.all %} -
  • {{ book.title }}
  • - {% endfor %} -
- {% endif %} - - - -
-

O utworze

-
    -
  • - Autor: - {% for tag in categories.author %} - {{ tag }} - {% endfor %} -
  • -
  • - Epoka: - {% for tag in categories.epoch %} - {{ tag }} - {% endfor %} -
  • -
  • - Rodzaj: - {% for tag in categories.kind %} - {{ tag }} - {% endfor %} -
  • -
  • - Gatunek: - {% for tag in categories.genre %} - {{ tag }} - {% endfor %} -
  • -
- {% if categories.theme %} -

Motywy w utworze

-
    - {% for theme in categories.theme %} -
  • {{ theme }}
  • - {% endfor %} -
- {% endif %} -
-{% endblock %} \ No newline at end of file diff --git a/templates/catalogue/book_list.html b/templates/catalogue/book_list.html deleted file mode 100644 index f4f575c7f..000000000 --- a/templates/catalogue/book_list.html +++ /dev/null @@ -1,35 +0,0 @@ -{% extends "base.html" %} -{% load catalogue_tags chunks %} - -{% block bodyid %}book-a-list{% endblock %} - -{% block title %}Alfabetyczny spis utworów w WolneLektury.pl{% endblock %} - -{% block extrahead %} - -{% endblock %} - -{% block body %} -

Alfabetyczny spis utworów

-
-

{{ form.q }} lub wróć do strony głównej

-
- -
- {% for first_letter, group in books_by_first_letter.items %} -
-

{{ first_letter }}

-
    - {% for book in group %} -
  1. {{ book.title }}
  2. - {% endfor %} -
-
- {% endfor %} -
-{% endblock %} diff --git a/templates/catalogue/book_sets.html b/templates/catalogue/book_sets.html deleted file mode 100644 index c7394186a..000000000 --- a/templates/catalogue/book_sets.html +++ /dev/null @@ -1,17 +0,0 @@ -

Półki zawierające utwór {{ book.title }}

-{% if not user.tag_set.count %} -

Nie posiadasz żadnych półek. Jeśli chcesz, możesz utworzyć nową półkę poniżej.

-{% else %} -
-
    -
  1. {{ form.set_ids }}
  2. -
  3. -
-
-{% endif %} -
-
-
    -
  1. {{ new_set_form.name }}
  2. -
-
\ No newline at end of file diff --git a/templates/catalogue/book_short.html b/templates/catalogue/book_short.html deleted file mode 100644 index e6a3748b8..000000000 --- a/templates/catalogue/book_short.html +++ /dev/null @@ -1,11 +0,0 @@ -
- -
-
-

{{ book.title }}

-

Formaty: {{ formats|join:", "|safe }}

-

Utwór w kategoriach: {{ tags|join:", "|safe }}

-
-
diff --git a/templates/catalogue/breadcrumbs.html b/templates/catalogue/breadcrumbs.html deleted file mode 100644 index 896d9997c..000000000 --- a/templates/catalogue/breadcrumbs.html +++ /dev/null @@ -1,9 +0,0 @@ -{% load catalogue_tags %} -
-
    - {% for tag in tag_list %} -
  1. {{ tag }} | x
  2. - {% endfor %} -
  3. {{ search_form.q }} {{ search_form.tags }}
  4. -
-
\ No newline at end of file diff --git a/templates/catalogue/fragment_sets.html b/templates/catalogue/fragment_sets.html deleted file mode 100644 index c7d641ca2..000000000 --- a/templates/catalogue/fragment_sets.html +++ /dev/null @@ -1,17 +0,0 @@ -

Półki zawierające fragment

-{% if not user.tag_set.count %} -

Nie posiadasz żadnych półek. Jeśli chcesz, możesz utworzyć nową półkę poniżej.

-{% else %} -
-
    -
  1. {{ form.set_ids }}
  2. -
  3. -
-
-{% endif %} -
-
-
    -
  1. {{ new_set_form.name }}
  2. -
-
\ No newline at end of file diff --git a/templates/catalogue/fragment_short.html b/templates/catalogue/fragment_short.html deleted file mode 100644 index 99ffacef0..000000000 --- a/templates/catalogue/fragment_short.html +++ /dev/null @@ -1,21 +0,0 @@ -
- {#
#} - {# Półki #} - {#
#} - {% if fragment.short_text %} -
- {{ fragment.short_text|safe }} - ↓ Rozwiń fragment ↓ -
- {% endif %} -
- {{ fragment.text|safe }} - {% if fragment.short_text %} - ↑ Zwiń fragment ↑ - {% endif %} -
- -
-
diff --git a/templates/catalogue/latest_blog_posts.html b/templates/catalogue/latest_blog_posts.html deleted file mode 100644 index d2c90e182..000000000 --- a/templates/catalogue/latest_blog_posts.html +++ /dev/null @@ -1,5 +0,0 @@ -
    -{% for post in posts %} -
  1. {{ post.title }}
  2. -{% endfor %} -
\ No newline at end of file diff --git a/templates/catalogue/main_page.html b/templates/catalogue/main_page.html deleted file mode 100644 index 0c58adac9..000000000 --- a/templates/catalogue/main_page.html +++ /dev/null @@ -1,90 +0,0 @@ -{% extends "base.html" %} -{% load catalogue_tags chunks cache %} - -{% block bodyid %}main-page{% endblock %} - -{% block extrahead %} - -{% endblock %} - -{% block body %} -
- {% chunk "site-description" %} -
-
-
-

{{ form.q }} {{ form.tags }} lub zobacz spis utworów w naszym zbiorze

-
- -
-
- {% if categories.set %} -

Półki

- - {% endif %} - - {% if categories.author %} -

Autorzy

- - {% endif %} - - {% if categories.epoch %} -

Epoki

- - {% endif %} - - {% if categories.kind %} -

Rodzaje

- - {% endif %} - - {% if categories.genre %} -

Gatunki literackie

- - {% endif %} -
-
- {% if categories.theme %} -

Motywy

- - {% endif %} -
-
-
- -
-

Aktualności z naszego bloga

- {% cache 1800 latest-blog-posts %} - {% latest_blog_posts "http://wolnepodreczniki.pl/feed/?s=Wolne%20Lektury" %} - {% endcache %} -
-{% endblock %} diff --git a/templates/catalogue/tagged_object_list.html b/templates/catalogue/tagged_object_list.html deleted file mode 100644 index de7d4f095..000000000 --- a/templates/catalogue/tagged_object_list.html +++ /dev/null @@ -1,146 +0,0 @@ -{% extends "base.html" %} -{% load catalogue_tags pagination_tags %} - -{% block title %}{% title_from_tags tags %} w WolneLektury.pl{% endblock %} - -{% block bodyid %}books{% endblock %} - -{% block extrahead %} - -{% endblock %} - -{% block body %} -

{% title_from_tags tags %}

- {% breadcrumbs tags %} - - {% autopaginate object_list 10 %} -
- {% with tags|last as last_tag %} - {% if last_tag.has_description %} -
- {{ last_tag.description|safe }} -
-

Zwiń opis ▲

- {% endif %} - {% endwith %} -
    - {% for book in object_list %} -
  1. {{ book.short_html }}
  2. - {% endfor %} -
- {% paginate %} -
-
-
- {% if categories.set %} -

Półki

- - {% endif %} -
-
- {% if categories.author %} -

Autorzy

- - {% endif %} -
-
- {% if categories.epoch %} -

Epoki

- - {% endif %} -
-
- {% if categories.kind %} -

Rodzaje

- - {% endif %} -
-
- {% if categories.genre %} -

Gatunki literackie

- - {% endif %} -
-
- {% if categories.theme %} -

Motywy

- - {% endif %} -
-
-
- -
-

* Ładowanie

-
-
-{% endblock %} \ No newline at end of file diff --git a/templates/catalogue/user_shelves.html b/templates/catalogue/user_shelves.html deleted file mode 100644 index 44517c550..000000000 --- a/templates/catalogue/user_shelves.html +++ /dev/null @@ -1,15 +0,0 @@ -

Moje półki

-{% if shelves %} - -{% else %} -

Nie posiadasz żadnych półek. Jeśli chcesz, możesz utworzyć półkę poniżej.

-{% endif %} -
-
-
    -
  1. {{ new_set_form.name }}
  2. -
diff --git a/templates/pagination/pagination.html b/templates/pagination/pagination.html deleted file mode 100644 index 36c297bc1..000000000 --- a/templates/pagination/pagination.html +++ /dev/null @@ -1,25 +0,0 @@ -{% if is_paginated %} - -{% endif %} diff --git a/urls.py b/urls.py deleted file mode 100644 index 104899f67..000000000 --- a/urls.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -import os - -from django.conf.urls.defaults import * -from django.contrib import admin - -admin.autodiscover() - - -urlpatterns = patterns('', - url(r'^katalog/', include('catalogue.urls')), - - # Panel administracyjny - url(r'^admin/doc/', include('django.contrib.admindocs.urls')), - url(r'^admin/(.*)$', admin.site.root), - - # Użytkownicy - url(r'^uzytkownicy/zaloguj/$', 'catalogue.views.login', name='login'), - url(r'^uzytkownicy/wyloguj/$', 'catalogue.views.logout_then_redirect', name='logout'), - url(r'^uzytkownicy/utworz/$', 'catalogue.views.register', name='register'), - - # Pliki statyczne - url(r'^media/(?P.*)$', 'django.views.static.serve', - {'document_root': os.path.join(os.path.dirname(__file__), 'media'), 'show_indexes': True}), - url(r'^$', 'django.views.generic.simple.redirect_to', {'url': 'katalog/'}), -) diff --git a/wolnelektury/README b/wolnelektury/README new file mode 100644 index 000000000..8c024c0d5 --- /dev/null +++ b/wolnelektury/README @@ -0,0 +1,5 @@ +Dependencies +============ + + * `Django 1.0 `_ (application framework) + * `lxml 2.0.0 `_ (for importing books) \ No newline at end of file diff --git a/wolnelektury/__init__.py b/wolnelektury/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/wolnelektury/locale/pl/LC_MESSAGES/django.mo b/wolnelektury/locale/pl/LC_MESSAGES/django.mo new file mode 100644 index 000000000..216cfcd22 Binary files /dev/null and b/wolnelektury/locale/pl/LC_MESSAGES/django.mo differ diff --git a/wolnelektury/locale/pl/LC_MESSAGES/django.po b/wolnelektury/locale/pl/LC_MESSAGES/django.po new file mode 100644 index 000000000..b09ad0913 --- /dev/null +++ b/wolnelektury/locale/pl/LC_MESSAGES/django.po @@ -0,0 +1,156 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-09-04 06:17-0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: catalogue/models.py:15 +msgid "author" +msgstr "autor" + +#: catalogue/models.py:16 +msgid "epoch" +msgstr "epoka" + +#: catalogue/models.py:17 +msgid "kind" +msgstr "rodzaj" + +#: catalogue/models.py:18 +msgid "genre" +msgstr "gatunek" + +#: catalogue/models.py:19 +msgid "theme" +msgstr "motyw" + +#: catalogue/models.py:20 +msgid "set" +msgstr "zestaw" + +#: catalogue/models.py:34 +msgid "name" +msgstr "nazwa" + +#: catalogue/models.py:35 catalogue/models.py:71 +msgid "slug" +msgstr "slug" + +#: catalogue/models.py:36 +msgid "sort key" +msgstr "klucz sortowania" + +#: catalogue/models.py:37 +msgid "category" +msgstr "kategoria" + +#: catalogue/models.py:45 catalogue/models.py:72 catalogue/models.py:86 +#: chunks/models.py:11 +msgid "description" +msgstr "opis" + +#: catalogue/models.py:54 newtagging/models.py:470 +msgid "tag" +msgstr "tag" + +#: catalogue/models.py:55 newtagging/admin.py:38 +msgid "tags" +msgstr "tagi" + +#: catalogue/models.py:70 +msgid "title" +msgstr "tytuł" + +#: catalogue/models.py:73 +msgid "creation date" +msgstr "data utworzenia" + +#: catalogue/models.py:76 +msgid "XML file" +msgstr "plik XML" + +#: catalogue/models.py:77 +msgid "PDF file" +msgstr "plik PDF" + +#: catalogue/models.py:78 +msgid "ODT file" +msgstr "plik ODT" + +#: catalogue/models.py:79 +msgid "HTML file" +msgstr "plik HTML" + +#: catalogue/models.py:162 +msgid "book" +msgstr "książka" + +#: catalogue/models.py:163 +msgid "books" +msgstr "książki" + +#: catalogue/models.py:180 +msgid "fragment" +msgstr "fragment" + +#: catalogue/models.py:181 +msgid "fragments" +msgstr "fragmenty" + +#: chunks/models.py:10 +msgid "key" +msgstr "klucz" + +#: chunks/models.py:10 +msgid "A unique name for this chunk of content" +msgstr "Unikalna nazwa dla tego kawałka treści" + +#: chunks/models.py:12 +#, fuzzy +msgid "content" +msgstr "typ zawartości" + +#: chunks/models.py:16 +msgid "chunk" +msgstr "kawałek" + +#: chunks/models.py:17 +msgid "chunks" +msgstr "kawałki" + +#: newtagging/models.py:471 +msgid "content type" +msgstr "typ zawartości" + +#: newtagging/models.py:472 +msgid "object id" +msgstr "id obiektu" + +#: newtagging/views.py:29 +msgid "tagged_object_list must be called with a queryset or a model." +msgstr "" + +#: newtagging/views.py:31 +msgid "tagged_object_list must be called with a tag model." +msgstr "" + +#: newtagging/views.py:33 +msgid "tagged_object_list must be called with a tag." +msgstr "" + +#: newtagging/views.py:37 +#, python-format +msgid "No tags found matching \"%s\"." +msgstr "Nie znaleziono tagów zgodnych z \"%s\"." diff --git a/wolnelektury/manage.py b/wolnelektury/manage.py new file mode 100755 index 000000000..5e78ea979 --- /dev/null +++ b/wolnelektury/manage.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python +from django.core.management import execute_manager +try: + import settings # Assumed to be in the same directory. +except ImportError: + import sys + sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) + sys.exit(1) + +if __name__ == "__main__": + execute_manager(settings) diff --git a/wolnelektury/media/css/jquery.autocomplete.css b/wolnelektury/media/css/jquery.autocomplete.css new file mode 100644 index 000000000..9c5a36dfb --- /dev/null +++ b/wolnelektury/media/css/jquery.autocomplete.css @@ -0,0 +1,36 @@ +.ac_results { + padding: 0px; + border: 0.1em solid #999; + background-color: #FFF; + overflow: hidden; + z-index: 99999; +} + +.ac_results ul { + width: 100%; + list-style-position: outside; + list-style: none; + padding: 0; + margin: 0; +} + +.ac_results li { + margin: 0; + padding: 0.2em 0.5em; + cursor: default; + display: block; + overflow: hidden; +} + +.ac_loading { + background: white url(/media/img/indicator.gif) right center no-repeat; +} + +.ac_odd { + background-color: #EEE; +} + +.ac_over { + background-color: #0A246A; + color: #FFF; +} diff --git a/wolnelektury/media/css/master.css b/wolnelektury/media/css/master.css new file mode 100644 index 000000000..6615ee6c8 --- /dev/null +++ b/wolnelektury/media/css/master.css @@ -0,0 +1,454 @@ +body { + margin: 0 2em 2em 2em; + font: 70% Verdana, Arial, Helvetica, sans-serif; + line-height: 1.5em; + background: #FFF url(/media/img/bg.png) repeat-x; + color: #2F4110; +} + +img { + border: none; +} + +a { + color: #295158; + text-decoration: none; +} + +a:hover, a:active { + text-decoration: underline; +} + +input { + font: 1em Verdana, Arial, Helvetica, sans-serif; +} + +h1 { + font: normal normal bold 1.75em Arial, sans-serif; + color: #2F4110; + margin: 0.55em 0 0 0; +} + +h2 { + font-size: 1.2em; + font-weight: bold; + color: #2F4110; + margin: 0; +} + +h3 { + font-size: 1.3em; + font-weight: bold; + margin: 0.2em 0 0 0; + color: #333; +} + +em { + font-style: normal; + background-color: #F5DC7D; +} + +.clearboth { + clear: both; +} + +.blur { + color: #777; +} + +/* ================================== */ +/* = Header with logo and user-info = */ +/* ================================== */ +#header { + position: relative; + margin-top: 1.5em; +} + +#header #logo { + float: left; +} + +#header #user-info { + margin: 0 0 0 auto; + width: 40em; + text-align: right; +} + +#site-description { + margin-top: -1.5em; + height:4.5em; + overflow: hidden; + float: right; + width: 42em; + text-align: right; + color: #777; +} + +/* ======================== */ +/* = Footer with sponsors = */ +/* ======================== */ +#footer { + border-top: 0.1em solid #999; + color: #999; + font-size: 0.8em; + padding-top: 0.5em; + margin: 2em 0 0 0; +} + +#footer p { + margin: 0; +} + +#footer a { + color: #999; + text-decoration: underline; +} + + +/* =============== */ +/* = Search form = */ +/* =============== */ +#search-form { + margin: 0.5em 0; + padding: 0.5em; + background-color: rgb(132, 191, 42); + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + border-bottom: 0.15em solid #7B9C2D; + border-right: 0.15em solid #7B9C2D; +} + +#search-form p { + margin: 0em 0 0 0; +} + +#search-form ol { + margin: 0; + padding: 0; +} + +#search-form li { + margin: 0; + padding: 0; + list-style: none; + display: inline; +} + +#search-form li.category, #search-form li.book-title { + padding: 0.2em 0.5em 0.2em 0.5em; + background-color: rgb(242, 163, 15); + border: 1px solid #BA8722; + border-right: 1px solid #555; + border-bottom: 1px solid #555; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} + +#search-form li.book-title { + background-color: #DDD; + border: 1px solid #999; + border-right: 1px solid #555; + border-bottom: 1px solid #555; +} + +#search-form input[type=submit] { + color: #444; +} + +/* TODO: Shouldn't be needed */ +#book-detail #search-form { + padding: 0.75em 0.5em; +} + +.ac_input { + width: 20em; +} + + +/* ============= */ +/* = Tags list = */ +/* ============= */ +#tags-list { + margin-top: 1em; + padding: 1em; + background-color: #FBEF90; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + border-bottom: 0.15em solid #E3D888; + border-right: 0.15em solid #E3D888; +} + +#books #tags-list, #book-detail #tags-list { + margin-left: 39em; +} + +#tags-list ol, #tags-list ul { + padding: 0; + margin: 0.3em 0 1.2em 0; +} + +#tags-list li { + list-style: none; + padding: 0; + margin: 0; +} + +#main-page #categories-list { + float: left; + width: 50%; +} + +#main-page #themes-list { + margin-left: 50%; +} + + +.column { + padding-right: 1em; +} + +.last.column { + padding-right: 0; +} + + +#books-list { + width: 38em; + float: left; +} + +/* ===================== */ +/* = Latest blog posts = */ +/* ===================== */ +#latest-blog-posts { + padding: 0.5em; + margin-top: 0.5em; +} + +#latest-blog-posts ol { + padding: 0 0 0 1.5em; + margin: 0.3em 0 0 0; + list-style-type: square; + color: #D13628; +} + +/* =============== */ +/* = Description = */ +/* =============== */ +#description { + margin-top: 0.5em; + text-align: justify; +} + +#toggle-description, #books .pagination { + width: 100%; + height: 1.5em; + background-color: #EEE; + margin-top: 0.5em; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + text-align: center; +} + +#toggle-description p { + margin: 0; + padding: 0; + color: #999; +} + +/* ============================ */ +/* = Books and fragments list = */ +/* ============================ */ +#books-list { + margin: 0; +} + +#books-list ol { + list-style: none; + padding: 0; + margin: 1.5em 0; +} + +.book { + padding: 0.5em; + background-color: #FFF; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} + +.fragment { + border-bottom: 0.1em solid #EEE; + margin-top: 0.5em; +} + +.fragment-text, .fragment-short-text { + padding: 0.5em; + background-color: #FFF; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} + +.fragment-metadata { + padding: 0.5em 0.5em 1.5em 0.5em; + float: right; +} + +.change-sets { + float: right; +} + +.book-description { + margin-left: 3.5em; +} + +.book-thumbnail { + background: transparent url(/media/img/book.png) no-repeat 0 0; + width: 3em; + height: 3em; + float: left; +} + +/* =============== */ +/* = Simple form = */ +/* =============== */ +.cuteform ol, .cuteform ul { + padding: 0; + margin: 0; + list-style: none; +} + +.cuteform ol li, .cuteform ul li { + margin-top: 0.7em; +} + +.cuteform label { + display: block; +} + +.cuteform span.help-text { + display: block; + font-size: 0.8em; + color: #999; +} + +.cuteform .error { + color: #BF3024; +} + +/* ================ */ +/* = Modal Window = */ +/* ================ */ +.jqmOverlay { background-color: #000; } + +#set-window { + position: absolute; + display: none; + width: 32em; + background-color: transparent; + margin-top: -0.5em; + margin-left: -1em; +} + +#set-window div.header { + background-color: #FFF; + border-right: 0.25em solid #DDD; + width: 4em; + padding: 0.5em 1em 0.5em 1em; +} + +#set-window div.target { + background-color: #FFF; + border-right: 0.3em solid #DDD; + border-bottom: 0.3em solid #DDD; + padding: 1em; +} + +#login-register-window { + position: absolute; + display: none; + width: 24em; + background-color: transparent; + margin-top: -0.5em; + margin-left: 1em; +} + +#login-register-window div.header { + background-color: #FFF; + border-right: 0.3em solid #DDD; + width: 4em; + right: 0; + left: auto; + padding: 0.5em 1em 0.5em 1em; + float: right; + text-align: center; +} + +#login-register-window div.target { + clear: both; + background-color: #FFF; + border-right: 0.3em solid #DDD; + border-bottom: 0.3em solid #DDD; + padding: 1em; +} + +#user-shelves-window { + position: absolute; + display: none; + width: 28em; + background-color: transparent; + margin-top: -0.5em; + margin-left: 1em; +} + +#user-shelves-window div.header { + background-color: #FFF; + border-right: 0.3em solid #DDD; + width: 4em; + right: 0; + left: auto; + padding: 0.5em 1em 0.5em 1em; + float: right; + text-align: center; +} + +#user-shelves-window div.target { + clear: both; + background-color: #FFF; + border-right: 0.3em solid #DDD; + border-bottom: 0.3em solid #DDD; + padding: 1em; +} + +#user-shelves-window ul { + list-style: none; + padding: 0; +} + +#user-shelves-window a.delete-shelf { + color: #900; + float: right; +} + +/* ======================== */ +/* = Alphabetic book list = */ +/* ======================== */ +#book-a-list #book-list ol { + padding: 0; + margin: 0.3em 0 1.2em 0; + list-style: none; +} + +#top-message { + background-color: #2F4110; + color: #FFF; + margin: 0 -2em; + padding: 0 2em; + line-height: 2em; +} + diff --git a/wolnelektury/media/css/master.plain.css b/wolnelektury/media/css/master.plain.css new file mode 100644 index 000000000..55bc023ff --- /dev/null +++ b/wolnelektury/media/css/master.plain.css @@ -0,0 +1,116 @@ +/* =================================================== */ +/* = Common elements: headings, paragraphs and lines = */ +/* =================================================== */ +.fragment h1 { + font-size: 3em; + margin: 1.5em 0; + text-align: center; + line-height: 1.5em; + font-weight: bold; +} + +.fragment h2 { + font-size: 2em; + margin: 1.5em 0 0; + font-weight: bold; + line-height: 1.5em; +} + +.fragment h3 { + font-size: 1.5em; + margin: 1.5em 0 0; + font-weight: normal; + line-height: 1.5em; +} + +.fragment h4 { + font-size: 1em; + margin: 1.5em 0 0; + line-height: 1.5em; +} + +.fragment p { + margin: 0; +} + +/* ======================== */ +/* = Footnotes and themes = */ +/* ======================== */ +.theme-begin { + display: none; +} + +.annotation { + display: none; +} + +/* =================== */ +/* = Custom elements = */ +/* =================== */ +span.author { + font-size: 0.75em; + display: block; + line-height: 1.5em; + margin-bottom: 0.25em; +} + +span.collection { + font-size: 0.75em; + display: block; + line-height: 1.5em; + margin-bottom: -0.25em; +} + +span.subtitle { + font-size: 0.75em; + display: block; + line-height: 1.5em; + margin-top: -0.25em; +} + +div.didaskalia { + font-style: italic; + margin: 0.5em 0 0; +} + +div.kwestia { + margin: 0.5em 0 0; +} + +div.stanza { + margin: 1.5em 0 0; +} + +div.kwestia div.stanza { + margin: 0; +} + +p.paragraph { + text-align: justify; + margin: 1.5em 0 0; +} + +p.motto { + text-align: justify; + font-style: italic; + margin: 1.5em 0 0; +} + +p.motto_podpis { + font-size: 0.875em; +} + +/*div.fragment { + border-bottom: 0.1em solid #999; + padding-bottom: 1.5em; +}*/ + +div.note p, div.note p.paragraph { + text-align: right; + font-style: italic; +} + +hr.spacer { + height: 3em; + visibility: hidden; +} diff --git a/wolnelektury/media/img/bg.png b/wolnelektury/media/img/bg.png new file mode 100644 index 000000000..be7d63a7c Binary files /dev/null and b/wolnelektury/media/img/bg.png differ diff --git a/wolnelektury/media/img/book.png b/wolnelektury/media/img/book.png new file mode 100644 index 000000000..f26483979 Binary files /dev/null and b/wolnelektury/media/img/book.png differ diff --git a/wolnelektury/media/img/favicon.png b/wolnelektury/media/img/favicon.png new file mode 100644 index 000000000..6cffce8e5 Binary files /dev/null and b/wolnelektury/media/img/favicon.png differ diff --git a/wolnelektury/media/img/footer.png b/wolnelektury/media/img/footer.png new file mode 100644 index 000000000..78634239c Binary files /dev/null and b/wolnelektury/media/img/footer.png differ diff --git a/wolnelektury/media/img/indicator.gif b/wolnelektury/media/img/indicator.gif new file mode 100644 index 000000000..085ccaeca Binary files /dev/null and b/wolnelektury/media/img/indicator.gif differ diff --git a/wolnelektury/media/img/logo.png b/wolnelektury/media/img/logo.png new file mode 100644 index 000000000..bf92ee069 Binary files /dev/null and b/wolnelektury/media/img/logo.png differ diff --git a/wolnelektury/media/js/catalogue.js b/wolnelektury/media/js/catalogue.js new file mode 100644 index 000000000..ad5a7c2c8 --- /dev/null +++ b/wolnelektury/media/js/catalogue.js @@ -0,0 +1,131 @@ +(function($) { + $(function() { + $('#id_q').labelify({labelledClass: 'blur'}); + + target = $('#login-register-window div.target'); + + $('#show-registration-form').click(function() { + $('#login-form').hide(); + $('#registration-form').show(); + }); + + $('#show-login-form').click(function() { + $('#registration-form').hide(); + $('#login-form').show(); + }); + + // Fragments + $('.fragment-text').each(function() { + if ($(this).prev().filter('.fragment-short-text').length) { + $(this).hover( + function() { $(this).css({background: '#F3F3F3', cursor: 'pointer'}); }, + function() { $(this).css({background: '#FFF'}); } + ).click(function() { + $(this).fadeOut(function() { + $(this).prev().fadeIn() + }); + }) + } + }); + + $('.fragment-short-text').click(function() { + $(this).fadeOut(function() { $(this).next().fadeIn() }); + }).hover( + function() { $(this).css({background: '#F3F3F3', cursor: 'pointer'}); }, + function() { $(this).css({background: '#FFF'}); } + ); + + $('#registration-form').ajaxForm({ + dataType: 'json', + beforeSubmit: function() { + $('#registration-form input[type=submit]') + .attr('disabled', 'disabled') + .after(''); + }, + success: function(response) { + if (response.success) { + location.reload(true); + } else { + $('#registration-form span.error').remove(); + $.each(response.errors, function(id, errors) { + $('#id_registration-' + id).before('' + errors[0] + ''); + }); + $('#registration-form input[type=submit]').removeAttr('disabled'); + $('#registration-form img').remove(); + } + } + }); + + $('#login-form').ajaxForm({ + dataType: 'json', + beforeSubmit: function() { + $('#login-form input[type=submit]') + .attr('disabled', 'disabled') + .after(''); + }, + success: function(response) { + if (response.success) { + location.reload(true); + } else { + $('#login-form span.error').remove(); + $.each(response.errors, function(id, errors) { + $('#id_login-' + id).before('' + errors[0] + ''); + }); + $('#login-form input[type=submit]').removeAttr('disabled'); + $('#login-form img').remove(); + } + } + }); + + $('#login-register-window').jqm({ + target: target[0], + overlay: 60, + trigger: '#login-register-link', + onShow: function(hash) { + var offset = $(hash.t).offset(); + hash.w.css({position: 'absolute', left: offset.left - hash.w.width() + $(hash.t).width(), top: offset.top}); + $('div.header', hash.w).css({width: $(hash.t).width()}); + hash.w.show(); + } + }); + + $('#user-shelves-window').jqm({ + ajax: '@href', + target: $('#user-shelves-window div.target')[0], + overlay: 60, + trigger: '#user-shelves-link', + onShow: function(hash) { + var offset = $(hash.t).offset(); + hash.w.css({position: 'absolute', left: offset.left - hash.w.width() + $(hash.t).width(), top: offset.top}); + $('div.header', hash.w).css({width: $(hash.t).width()}); + hash.w.show(); + }, + onLoad: function(hash) { + var shelf_name = $('a.visit-shelf', this).html(); + + $('form', hash.w).ajaxForm({ + target: $('#user-shelves-window div.target'), + success: function() { setTimeout(function() { $('#user-shelves-window').jqmHide() }, 1000) } + }); + + $('ul.shelf-list li', hash.w).hover(function() { + $(this).css({background: '#EEE', cursor: 'pointer'}); + }, function() { + $(this).css({background: 'transparent'}); + }).click(function() { + location.href = $('a.visit-shelf', this).attr('href'); + }); + + $('.delete-shelf').click(function() { + if (confirm('Czy na pewno usunąć półkę ' + shelf_name + '?')) { + $.post($(this).attr('href'), function(data, textStatus) { + $('#user-shelves-window div.target').html(data); + setTimeout(function() { $('#user-shelves-window').jqmHide() }, 1000); + }); + } + return false; + }); + } + }); + }); +})(jQuery) \ No newline at end of file diff --git a/wolnelektury/media/js/jquery.autocolumn.js b/wolnelektury/media/js/jquery.autocolumn.js new file mode 100644 index 000000000..ea896b67f --- /dev/null +++ b/wolnelektury/media/js/jquery.autocolumn.js @@ -0,0 +1,202 @@ +// version 1.1.0 +// http://welcome.totheinter.net/columnizer-jquery-plugin/ +// created by: Adam Wulf adam.wulf@gmail.com + +(function($){ + $.fn.columnize = function(options) { + + + var defaults = { + width: 400, + columns : false, + buildOnce : false + }; + var options = $.extend(defaults, options); + + return this.each(function() { + var $inBox = $(this); + var maxHeight = $inBox.height(); + var $cache = $('
'); // this is where we'll put the real content + var lastWidth = 0; + var columnizing = false; + $cache.append($inBox.children().clone()); + + columnizeIt(); + + $(window).resize(function() { + if(!options.buildOnce && $.browser.msie){ + if($inBox.data("timeout")){ + clearTimeout($inBox.data("timeout")); + } + $inBox.data("timeout", setTimeout(columnizeIt, 200)); + }else if(!options.buildOnce){ + columnizeIt(); + }else{ + // don't rebuild + } + }); + + /** + * return a node that has a height + * less than or equal to height + * + * @param putInHere, a dom element + * @$pullOutHere, a jQuery element + */ + function columnize($putInHere, $pullOutHere, $parentColumn, height){ + while($parentColumn.height() < height && + $pullOutHere[0].childNodes.length){ + $putInHere.append($pullOutHere[0].childNodes[0]); + } + if($putInHere[0].childNodes.length == 0) return; + + // now we're too tall, undo the last one + var kids = $putInHere[0].childNodes; + var lastKid = kids[kids.length-1]; + $putInHere[0].removeChild(lastKid); + var $item = $(lastKid); + if($item[0].nodeType == 3){ + // it's a text node, split it up + var oText = $item[0].nodeValue; + var counter2 = options.width / 8; + var columnText; + while($parentColumn.height() < height && oText.length){ + if (oText.indexOf(' ', counter2) != '-1') { + columnText = oText.substring(0, oText.indexOf(' ', counter2)); + } else { + columnText = oText; + } + $putInHere.append(document.createTextNode(columnText)); + if(oText.length > counter2){ + oText = oText.substring(oText.indexOf(' ', counter2)); + }else{ + oText = ""; + } + } + if(oText.length){ + $item[0].nodeValue = oText; + }else{ + return; + } + } + + if($pullOutHere.children().length){ + $pullOutHere.prepend($item); + }else{ + $pullOutHere.append($item); + } + } + + function split($putInHere, $pullOutHere, $parentColumn, height){ + if($pullOutHere.children().length){ + $cloneMe = $pullOutHere.children(":first"); + $clone = $cloneMe.clone(); + if($clone.attr("nodeType") == 1){ + $putInHere.append($clone); + if($clone.is("img") && $parentColumn.height() < height + 20){ + $cloneMe.remove(); + }else if(!$cloneMe.hasClass("dontsplit") && $parentColumn.height() < height + 20){ + $cloneMe.remove(); + }else if($clone.is("img") || $cloneMe.hasClass("dontsplit")){ + $clone.remove(); + }else{ + $clone.empty(); + columnize($clone, $cloneMe, $parentColumn, height); + if($cloneMe.children().length){ + split($clone, $cloneMe, $parentColumn, height); + } + } + } + } + } + + + function singleColumnizeIt() { + if ($inBox.data("columnized") && $inBox.children().length == 1) { + return; + } + $inBox.data("columnized", true); + $inBox.data("columnizing", true); + + $inBox.empty(); + $inBox.append($("
")); //" + $col = $inBox.children().eq($inBox.children().length-1); + $col.append($cache.clone()); + + $inBox.data("columnizing", false); + } + + + function columnizeIt() { + if(lastWidth == $inBox.width()) return; + lastWidth = $inBox.width(); + + var numCols = Math.round($inBox.width() / options.width); + if(options.columns) numCols = options.columns; +// if ($inBox.data("columnized") && numCols == $inBox.children().length) { +// return; +// } + if(numCols <= 1){ + return singleColumnizeIt(); + } + if($inBox.data("columnizing")) return; + $inBox.data("columnized", true); + $inBox.data("columnizing", true); + + $inBox.empty(); + $inBox.append($("
")); //" + $col = $inBox.children(":last"); + $col.append($cache.clone()); + maxHeight = $col.height(); + $inBox.empty(); + + var targetHeight = maxHeight / numCols; + var firstTime = true; + var maxLoops = 3; + for(var loopCount=0;loopCount")); //" + } + + // fill all but the last column + for (var i = 0; i < numCols-1; i++) { + var $col = $inBox.children().eq(i); + columnize($col, $destroyable, $col, targetHeight); + split($col, $destroyable, $col, targetHeight); + } + // the last column in the series + $col = $inBox.children().eq($inBox.children().length-1); + while($destroyable.children().length) $col.append($destroyable.children(":first")); + var afterH = $col.height(); + var diff = afterH - targetHeight; + var totalH = 0; + var min = 10000000; + var max = 0; + $inBox.children().each(function($inBox){ return function($item){ + var h = $inBox.children().eq($item).height(); + totalH += h; + if(h > max) max = h; + if(h < min) min = h; + }}($inBox)); + var avgH = totalH / numCols; + if(max - min > 30){ + targetHeight = avgH + 30; + }else if(Math.abs(avgH-targetHeight) > 20){ + targetHeight = avgH; + }else{ + loopCount = maxLoops; + } + $inBox.append($("
")); + } + $inBox.data("columnizing", false); + } + }); + }; +})(jQuery); diff --git a/wolnelektury/media/js/jquery.autocomplete.js b/wolnelektury/media/js/jquery.autocomplete.js new file mode 100644 index 000000000..5ad9178f8 --- /dev/null +++ b/wolnelektury/media/js/jquery.autocomplete.js @@ -0,0 +1,759 @@ +/* + * Autocomplete - jQuery plugin 1.0.2 + * + * Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + * Revision: $Id: jquery.autocomplete.js 5747 2008-06-25 18:30:55Z joern.zaefferer $ + * + */ + +;(function($) { + +$.fn.extend({ + autocomplete: function(urlOrData, options) { + var isUrl = typeof urlOrData == "string"; + options = $.extend({}, $.Autocompleter.defaults, { + url: isUrl ? urlOrData : null, + data: isUrl ? null : urlOrData, + delay: isUrl ? $.Autocompleter.defaults.delay : 10, + max: options && !options.scroll ? 10 : 150 + }, options); + + // if highlight is set to false, replace it with a do-nothing function + options.highlight = options.highlight || function(value) { return value; }; + + // if the formatMatch option is not specified, then use formatItem for backwards compatibility + options.formatMatch = options.formatMatch || options.formatItem; + + return this.each(function() { + new $.Autocompleter(this, options); + }); + }, + result: function(handler) { + return this.bind("result", handler); + }, + search: function(handler) { + return this.trigger("search", [handler]); + }, + flushCache: function() { + return this.trigger("flushCache"); + }, + setOptions: function(options){ + return this.trigger("setOptions", [options]); + }, + unautocomplete: function() { + return this.trigger("unautocomplete"); + } +}); + +$.Autocompleter = function(input, options) { + + var KEY = { + UP: 38, + DOWN: 40, + DEL: 46, + TAB: 9, + RETURN: 13, + ESC: 27, + COMMA: 188, + PAGEUP: 33, + PAGEDOWN: 34, + BACKSPACE: 8 + }; + + // Create $ object for input element + var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass); + + var timeout; + var previousValue = ""; + var cache = $.Autocompleter.Cache(options); + var hasFocus = 0; + var lastKeyPressCode; + var config = { + mouseDownOnSelect: false + }; + var select = $.Autocompleter.Select(options, input, selectCurrent, config); + + var blockSubmit; + + // prevent form submit in opera when selecting with return key + $.browser.opera && $(input.form).bind("submit.autocomplete", function() { + if (blockSubmit) { + blockSubmit = false; + return false; + } + }); + + // only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all + $input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) { + // track last key pressed + lastKeyPressCode = event.keyCode; + switch(event.keyCode) { + + case KEY.UP: + event.preventDefault(); + if ( select.visible() ) { + select.prev(); + } else { + onChange(0, true); + } + break; + + case KEY.DOWN: + event.preventDefault(); + if ( select.visible() ) { + select.next(); + } else { + onChange(0, true); + } + break; + + case KEY.PAGEUP: + event.preventDefault(); + if ( select.visible() ) { + select.pageUp(); + } else { + onChange(0, true); + } + break; + + case KEY.PAGEDOWN: + event.preventDefault(); + if ( select.visible() ) { + select.pageDown(); + } else { + onChange(0, true); + } + break; + + // matches also semicolon + case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA: + case KEY.TAB: + case KEY.RETURN: + if( selectCurrent() ) { + // stop default to prevent a form submit, Opera needs special handling + event.preventDefault(); + blockSubmit = true; + return false; + } + break; + + case KEY.ESC: + select.hide(); + break; + + default: + clearTimeout(timeout); + timeout = setTimeout(onChange, options.delay); + break; + } + }).focus(function(){ + // track whether the field has focus, we shouldn't process any + // results if the field no longer has focus + hasFocus++; + }).blur(function() { + hasFocus = 0; + if (!config.mouseDownOnSelect) { + hideResults(); + } + }).click(function() { + // show select when clicking in a focused field + if ( hasFocus++ > 1 && !select.visible() ) { + onChange(0, true); + } + }).bind("search", function() { + // TODO why not just specifying both arguments? + var fn = (arguments.length > 1) ? arguments[1] : null; + function findValueCallback(q, data) { + var result; + if( data && data.length ) { + for (var i=0; i < data.length; i++) { + if( data[i].result.toLowerCase() == q.toLowerCase() ) { + result = data[i]; + break; + } + } + } + if( typeof fn == "function" ) fn(result); + else $input.trigger("result", result && [result.data, result.value]); + } + $.each(trimWords($input.val()), function(i, value) { + request(value, findValueCallback, findValueCallback); + }); + }).bind("flushCache", function() { + cache.flush(); + }).bind("setOptions", function() { + $.extend(options, arguments[1]); + // if we've updated the data, repopulate + if ( "data" in arguments[1] ) + cache.populate(); + }).bind("unautocomplete", function() { + select.unbind(); + $input.unbind(); + $(input.form).unbind(".autocomplete"); + }); + + + function selectCurrent() { + var selected = select.selected(); + if( !selected ) + return false; + + var v = selected.result; + previousValue = v; + + if ( options.multiple ) { + var words = trimWords($input.val()); + if ( words.length > 1 ) { + v = words.slice(0, words.length - 1).join( options.multipleSeparator ) + options.multipleSeparator + v; + } + v += options.multipleSeparator; + } + + $input.val(v); + hideResultsNow(); + $input.trigger("result", [selected.data, selected.value]); + return true; + } + + function onChange(crap, skipPrevCheck) { + if( lastKeyPressCode == KEY.DEL ) { + select.hide(); + return; + } + + var currentValue = $input.val(); + + if ( !skipPrevCheck && currentValue == previousValue ) + return; + + previousValue = currentValue; + + currentValue = lastWord(currentValue); + if ( currentValue.length >= options.minChars) { + $input.addClass(options.loadingClass); + if (!options.matchCase) + currentValue = currentValue.toLowerCase(); + request(currentValue, receiveData, hideResultsNow); + } else { + stopLoading(); + select.hide(); + } + }; + + function trimWords(value) { + if ( !value ) { + return [""]; + } + var words = value.split( options.multipleSeparator ); + var result = []; + $.each(words, function(i, value) { + if ( $.trim(value) ) + result[i] = $.trim(value); + }); + return result; + } + + function lastWord(value) { + if ( !options.multiple ) + return value; + var words = trimWords(value); + return words[words.length - 1]; + } + + // fills in the input box w/the first match (assumed to be the best match) + // q: the term entered + // sValue: the first matching result + function autoFill(q, sValue){ + // autofill in the complete box w/the first match as long as the user hasn't entered in more data + // if the last user key pressed was backspace, don't autofill + if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE ) { + // fill in the value (keep the case the user has typed) + $input.val($input.val() + sValue.substring(lastWord(previousValue).length)); + // select the portion of the value not typed by the user (so the next character will erase) + $.Autocompleter.Selection(input, previousValue.length, previousValue.length + sValue.length); + } + }; + + function hideResults() { + clearTimeout(timeout); + timeout = setTimeout(hideResultsNow, 200); + }; + + function hideResultsNow() { + var wasVisible = select.visible(); + select.hide(); + clearTimeout(timeout); + stopLoading(); + if (options.mustMatch) { + // call search and run callback + $input.search( + function (result){ + // if no value found, clear the input box + if( !result ) { + if (options.multiple) { + var words = trimWords($input.val()).slice(0, -1); + $input.val( words.join(options.multipleSeparator) + (words.length ? options.multipleSeparator : "") ); + } + else + $input.val( "" ); + } + } + ); + } + if (wasVisible) + // position cursor at end of input field + $.Autocompleter.Selection(input, input.value.length, input.value.length); + }; + + function receiveData(q, data) { + if ( data && data.length && hasFocus ) { + stopLoading(); + select.display(data, q); + autoFill(q, data[0].value); + select.show(); + } else { + hideResultsNow(); + } + }; + + function request(term, success, failure) { + if (!options.matchCase) + term = term.toLowerCase(); + var data = cache.load(term); + // recieve the cached data + if (data && data.length) { + success(term, data); + // if an AJAX url has been supplied, try loading the data now + } else if( (typeof options.url == "string") && (options.url.length > 0) ){ + + var extraParams = { + timestamp: +new Date() + }; + $.each(options.extraParams, function(key, param) { + extraParams[key] = typeof param == "function" ? param() : param; + }); + + $.ajax({ + // try to leverage ajaxQueue plugin to abort previous requests + mode: "abort", + // limit abortion to this input + port: "autocomplete" + input.name, + dataType: options.dataType, + url: options.url, + data: $.extend({ + q: lastWord(term), + limit: options.max + }, extraParams), + success: function(data) { + var parsed = options.parse && options.parse(data) || parse(data); + cache.add(term, parsed); + success(term, parsed); + } + }); + } else { + // if we have a failure, we need to empty the list -- this prevents the the [TAB] key from selecting the last successful match + select.emptyList(); + failure(term); + } + }; + + function parse(data) { + var parsed = []; + var rows = data.split("\n"); + for (var i=0; i < rows.length; i++) { + var row = $.trim(rows[i]); + if (row) { + row = row.split("|"); + parsed[parsed.length] = { + data: row, + value: row[0], + result: options.formatResult && options.formatResult(row, row[0]) || row[0] + }; + } + } + return parsed; + }; + + function stopLoading() { + $input.removeClass(options.loadingClass); + }; + +}; + +$.Autocompleter.defaults = { + inputClass: "ac_input", + resultsClass: "ac_results", + loadingClass: "ac_loading", + minChars: 1, + delay: 400, + matchCase: false, + matchSubset: true, + matchContains: false, + cacheLength: 10, + max: 100, + mustMatch: false, + extraParams: {}, + selectFirst: true, + formatItem: function(row) { return row[0]; }, + formatMatch: null, + autoFill: false, + width: 0, + multiple: false, + multipleSeparator: ", ", + highlight: function(value, term) { + return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "$1"); + }, + scroll: true, + scrollHeight: 180 +}; + +$.Autocompleter.Cache = function(options) { + + var data = {}; + var length = 0; + + function matchSubset(s, sub) { + if (!options.matchCase) + s = s.toLowerCase(); + var i = s.indexOf(sub); + if (i == -1) return false; + return i == 0 || options.matchContains; + }; + + function add(q, value) { + if (length > options.cacheLength){ + flush(); + } + if (!data[q]){ + length++; + } + data[q] = value; + } + + function populate(){ + if( !options.data ) return false; + // track the matches + var stMatchSets = {}, + nullData = 0; + + // no url was specified, we need to adjust the cache length to make sure it fits the local data store + if( !options.url ) options.cacheLength = 1; + + // track all options for minChars = 0 + stMatchSets[""] = []; + + // loop through the array and create a lookup structure + for ( var i = 0, ol = options.data.length; i < ol; i++ ) { + var rawValue = options.data[i]; + // if rawValue is a string, make an array otherwise just reference the array + rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue; + + var value = options.formatMatch(rawValue, i+1, options.data.length); + if ( value === false ) + continue; + + var firstChar = value.charAt(0).toLowerCase(); + // if no lookup array for this character exists, look it up now + if( !stMatchSets[firstChar] ) + stMatchSets[firstChar] = []; + + // if the match is a string + var row = { + value: value, + data: rawValue, + result: options.formatResult && options.formatResult(rawValue) || value + }; + + // push the current match into the set list + stMatchSets[firstChar].push(row); + + // keep track of minChars zero items + if ( nullData++ < options.max ) { + stMatchSets[""].push(row); + } + }; + + // add the data items to the cache + $.each(stMatchSets, function(i, value) { + // increase the cache size + options.cacheLength++; + // add to the cache + add(i, value); + }); + } + + // populate any existing data + setTimeout(populate, 25); + + function flush(){ + data = {}; + length = 0; + } + + return { + flush: flush, + add: add, + populate: populate, + load: function(q) { + if (!options.cacheLength || !length) + return null; + /* + * if dealing w/local data and matchContains than we must make sure + * to loop through all the data collections looking for matches + */ + if( !options.url && options.matchContains ){ + // track all matches + var csub = []; + // loop through all the data grids for matches + for( var k in data ){ + // don't search through the stMatchSets[""] (minChars: 0) cache + // this prevents duplicates + if( k.length > 0 ){ + var c = data[k]; + $.each(c, function(i, x) { + // if we've got a match, add it to the array + if (matchSubset(x.value, q)) { + csub.push(x); + } + }); + } + } + return csub; + } else + // if the exact item exists, use it + if (data[q]){ + return data[q]; + } else + if (options.matchSubset) { + for (var i = q.length - 1; i >= options.minChars; i--) { + var c = data[q.substr(0, i)]; + if (c) { + var csub = []; + $.each(c, function(i, x) { + if (matchSubset(x.value, q)) { + csub[csub.length] = x; + } + }); + return csub; + } + } + } + return null; + } + }; +}; + +$.Autocompleter.Select = function (options, input, select, config) { + var CLASSES = { + ACTIVE: "ac_over" + }; + + var listItems, + active = -1, + data, + term = "", + needsInit = true, + element, + list; + + // Create results + function init() { + if (!needsInit) + return; + element = $("
") + .hide() + .addClass(options.resultsClass) + .css("position", "absolute") + .appendTo(document.body); + + list = $("
    ").appendTo(element).mouseover( function(event) { + if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') { + active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event)); + $(target(event)).addClass(CLASSES.ACTIVE); + } + }).click(function(event) { + $(target(event)).addClass(CLASSES.ACTIVE); + select(); + // TODO provide option to avoid setting focus again after selection? useful for cleanup-on-focus + input.focus(); + return false; + }).mousedown(function() { + config.mouseDownOnSelect = true; + }).mouseup(function() { + config.mouseDownOnSelect = false; + }); + + if( options.width > 0 ) + element.css("width", options.width); + + needsInit = false; + } + + function target(event) { + var element = event.target; + while(element && element.tagName != "LI") + element = element.parentNode; + // more fun with IE, sometimes event.target is empty, just ignore it then + if(!element) + return []; + return element; + } + + function moveSelect(step) { + listItems.slice(active, active + 1).removeClass(CLASSES.ACTIVE); + movePosition(step); + var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE); + if(options.scroll) { + var offset = 0; + listItems.slice(0, active).each(function() { + offset += this.offsetHeight; + }); + if((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) { + list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight()); + } else if(offset < list.scrollTop()) { + list.scrollTop(offset); + } + } + }; + + function movePosition(step) { + active += step; + if (active < 0) { + active = listItems.size() - 1; + } else if (active >= listItems.size()) { + active = 0; + } + } + + function limitNumberOfItems(available) { + return options.max && options.max < available + ? options.max + : available; + } + + function fillList() { + list.empty(); + var max = limitNumberOfItems(data.length); + for (var i=0; i < max; i++) { + if (!data[i]) + continue; + var formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term); + if ( formatted === false ) + continue; + var li = $("
  • ").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ac_even" : "ac_odd").appendTo(list)[0]; + $.data(li, "ac_data", data[i]); + } + listItems = list.find("li"); + if ( options.selectFirst ) { + listItems.slice(0, 1).addClass(CLASSES.ACTIVE); + active = 0; + } + // apply bgiframe if available + if ( $.fn.bgiframe ) + list.bgiframe(); + } + + return { + display: function(d, q) { + init(); + data = d; + term = q; + fillList(); + }, + next: function() { + moveSelect(1); + }, + prev: function() { + moveSelect(-1); + }, + pageUp: function() { + if (active != 0 && active - 8 < 0) { + moveSelect( -active ); + } else { + moveSelect(-8); + } + }, + pageDown: function() { + if (active != listItems.size() - 1 && active + 8 > listItems.size()) { + moveSelect( listItems.size() - 1 - active ); + } else { + moveSelect(8); + } + }, + hide: function() { + element && element.hide(); + listItems && listItems.removeClass(CLASSES.ACTIVE); + active = -1; + }, + visible : function() { + return element && element.is(":visible"); + }, + current: function() { + return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]); + }, + show: function() { + var offset = $(input).offset(); + element.css({ + width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(), + top: offset.top + input.offsetHeight, + left: offset.left + }).show(); + if(options.scroll) { + list.scrollTop(0); + list.css({ + maxHeight: options.scrollHeight, + overflow: 'auto' + }); + + if($.browser.msie && typeof document.body.style.maxHeight === "undefined") { + var listHeight = 0; + listItems.each(function() { + listHeight += this.offsetHeight; + }); + var scrollbarsVisible = listHeight > options.scrollHeight; + list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight ); + if (!scrollbarsVisible) { + // IE doesn't recalculate width when scrollbar disappears + listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) ); + } + } + + } + }, + selected: function() { + var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE); + return selected && selected.length && $.data(selected[0], "ac_data"); + }, + emptyList: function (){ + list && list.empty(); + }, + unbind: function() { + element && element.remove(); + } + }; +}; + +$.Autocompleter.Selection = function(field, start, end) { + if( field.createTextRange ){ + var selRange = field.createTextRange(); + selRange.collapse(true); + selRange.moveStart("character", start); + selRange.moveEnd("character", end); + selRange.select(); + } else if( field.setSelectionRange ){ + field.setSelectionRange(start, end); + } else { + if( field.selectionStart ){ + field.selectionStart = start; + field.selectionEnd = end; + } + } + field.focus(); +}; + +})(jQuery); \ No newline at end of file diff --git a/wolnelektury/media/js/jquery.form.js b/wolnelektury/media/js/jquery.form.js new file mode 100644 index 000000000..659baa989 --- /dev/null +++ b/wolnelektury/media/js/jquery.form.js @@ -0,0 +1,601 @@ +/* + * jQuery Form Plugin + * version: 2.12 (06/07/2008) + * @requires jQuery v1.2.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 + * + * Revision: $Id$ + */ +(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() { + $(this).ajaxSubmit({ + target: '#output' + }); + return false; // <-- important! + }); + }); + + 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 }; + + options = $.extend({ + url: this.attr('action') || window.location.toString(), + type: this.attr('method') || 'GET' + }, 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; + } + + var a = this.formToArray(options.semantic); + if (options.data) { + options.extraData = options.data; + for (var n in options.data) + a.push( { name: n, value: options.data[n] } ); + } + + // 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) { + $(options.target).html(data).each(oldSuccess, arguments); + }); + } + else if (options.success) + callbacks.push(options.success); + + options.success = function(data, status) { + for (var i=0, max=callbacks.length; i < max; i++) + callbacks[i](data, status, $form); + }; + + // are there files to upload? + var files = $('input:file', this).fieldValue(); + var found = false; + for (var j=0; j < files.length; j++) + if (files[j]) + found = true; + + // options.iframe allows user to force iframe mode + if (options.iframe || found) { + // hack to fix Safari hang (thanks to Tim Molendijk for this) + // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d + if ($.browser.safari && 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]', form).length) { + alert('Error: Form elements must not be named "submit".'); + return; + } + + var opts = $.extend({}, $.ajaxSettings, options); + + var id = 'jqFormIO' + (new Date().getTime()); + var $io = $('').css({opacity:0}), + +// O: The jqModal default Open Callback; +// IF ie6; Add the iframe to the overlay (if overlay exists) OR to the modal (if an iframe doesn't already exist from a previous opening) +// Execute the Modal Focus Function +O=function(h){if(ie6)h.o&&h.o.html('

    ').prepend(i)||(!$('iframe.jqm',h.w)[0]&&h.w.prepend(i)); f(h);}, + +// f: The Modal Focus Function; +// Attempt to focus the first visible input within the modal +f=function(h){try{$(':input:visible',h.w)[0].focus();}catch(e){}}, + +// F: The Keep Focus Function; +// Binds or Unbinds (t) the Focus Examination Function to keypresses and clicks +F=function(t){$()[t]("keypress",x)[t]("keydown",x)[t]("mousedown",x);}, + +// x: The Focus Examination Function; +// Fetch the current modal's Hash as h (supports nested modals) +// Determine if the click/press falls within the modal. If not (r===true); +// call the Modal Focus Function and prevent click/press follow-through (return false [!true]) +// ELSE if so (r===false); follow event (return true [!false]) +x=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);r&&f(h);return !r;}, + +// hide-show function; assigns click events to trigger elements that +// hide, show, or hide AND show modals. + +// Expandos (jqmShow and/or jqmHide) are added to all trigger elements. +// These Expandos hold an array of modal serials {INT} to show or hide. + +// w: {DOM Element} The modal element (window/dialog/notice/etc. container) +// e: {DOM Elemet||jQ Selector String} The triggering element +// y: {String} Type (jqmHide||jqmShow) + +// s: {array} the serial number of passed modals, calculated below; +HS=function(w,e,y){var s=[];w.each(function(){s.push(this._jqm)}); + +// for each triggering element attach the jqmHide or jqmShow expando (y) +// or else expand the expando with the current serial array + $(e).each(function(){if(this[y])$.extend(this[y],s); + + // Assign a click event on the trigger element which examines the element's + // jqmHide/Show expandos and attempts to execute $.jqmHide/Show on matching modals + else{this[y]=s;$(this).click(function(){for(var i in {jqmShow:1,jqmHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return false;});}});return w;}; +})(jQuery); \ No newline at end of file diff --git a/wolnelektury/media/js/jquery.js b/wolnelektury/media/js/jquery.js new file mode 100644 index 000000000..82b98e1d7 --- /dev/null +++ b/wolnelektury/media/js/jquery.js @@ -0,0 +1,32 @@ +/* + * jQuery 1.2.6 - New Wave Javascript + * + * Copyright (c) 2008 John Resig (jquery.com) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $ + * $Rev: 5685 $ + */ +(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else +return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else +return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else +selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else +this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else +return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else +jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else +jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("",""]||!tags.indexOf("",""]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
    "]||!tags.indexOf("",""]||(!tags.indexOf("",""]||!tags.indexOf("",""]||jQuery.browser.msie&&[1,"div

    ","
    "]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf(""&&tags.indexOf("=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else +ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&¬xml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&¬xml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&¬xml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else +while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return im[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else +for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("
    ").append(res.responseText.replace(//g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else +xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else +jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else +for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else +s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else +e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;ithis.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})(); \ No newline at end of file diff --git a/wolnelektury/media/js/jquery.labelify.js b/wolnelektury/media/js/jquery.labelify.js new file mode 100644 index 000000000..13196b289 --- /dev/null +++ b/wolnelektury/media/js/jquery.labelify.js @@ -0,0 +1,89 @@ +/** + * jQuery.labelify - Display in-textbox hints + * Stuart Langridge, http://www.kryogenix.org/ + * Released into the public domain + * Date: 25th June 2008 + * @author Stuart Langridge + * @version 1.3 + * + * + * Basic calling syntax: $("input").labelify(); + * Defaults to taking the in-field label from the field's title attribute + * + * You can also pass an options object with the following keys: + * text + * "title" to get the in-field label from the field's title attribute + * (this is the default) + * "label" to get the in-field label from the inner text of the field's label + * (note that the label must be attached to the field with for="fieldid") + * a function which takes one parameter, the input field, and returns + * whatever text it likes + * + * labelledClass + * a class that will be applied to the input field when it contains the + * label and removed when it contains user input. Defaults to blank. + * + */ +jQuery.fn.labelify = function(settings) { + settings = jQuery.extend({ + text: "title", + labelledClass: "" + }, settings); + var lookups = { + title: function(input) { + return $(input).attr("title"); + }, + label: function(input) { + return $("label[for=" + input.id +"]").text(); + } + }; + var lookup; + var jQuery_labellified_elements = $(this); + return $(this).each(function() { + if (typeof settings.text === "string") { + lookup = lookups[settings.text]; // what if not there? + } else { + lookup = settings.text; // what if not a fn? + }; + // bail if lookup isn't a function or if it returns undefined + if (typeof lookup !== "function") { return; } + var lookupval = lookup(this); + if (!lookupval) { return; } + + // need to strip newlines because the browser strips them + // if you set textbox.value to a string containing them + $(this).data("label",lookup(this).replace(/\n/g,'')); + $(this).focus(function() { + if (this.value === $(this).data("label")) { + this.value = this.defaultValue; + $(this).removeClass(settings.labelledClass); + } + }).blur(function(){ + if (this.value === this.defaultValue) { + this.value = $(this).data("label"); + $(this).addClass(settings.labelledClass); + } + }); + + var removeValuesOnExit = function() { + jQuery_labellified_elements.each(function(){ + if (this.value === $(this).data("label")) { + this.value = this.defaultValue; + $(this).removeClass(settings.labelledClass); + } + }) + }; + + $(this).parents("form").submit(removeValuesOnExit); + $(window).unload(removeValuesOnExit); + + if (this.value !== this.defaultValue) { + // user already started typing; don't overwrite their work! + return; + } + // actually set the value + this.value = $(this).data("label"); + $(this).addClass(settings.labelledClass); + + }); +}; \ No newline at end of file diff --git a/wolnelektury/middleware.py b/wolnelektury/middleware.py new file mode 100644 index 000000000..c9a17dc3a --- /dev/null +++ b/wolnelektury/middleware.py @@ -0,0 +1,126 @@ +# Orignal version taken from http://www.djangosnippets.org/snippets/186/ +# Original author: udfalkso +# Modified by: Shwagroo Team + +import sys +import os +import re +import hotshot, hotshot.stats +import tempfile +import StringIO +import pprint + +from django.conf import settings +from django.db import connection + + +words_re = re.compile( r'\s+' ) + +group_prefix_re = [ + re.compile( "^.*/django/[^/]+" ), + re.compile( "^(.*)/[^/]+$" ), # extract module path + re.compile( ".*" ), # catch strange entries +] + + +class ProfileMiddleware(object): + """ + Displays hotshot profiling for any view. + http://yoursite.com/yourview/?prof + + Add the "prof" key to query string by appending ?prof (or &prof=) + and you'll see the profiling results in your browser. + It's set up to only be available in django's debug mode, is available for superuser otherwise, + but you really shouldn't add this middleware to any production configuration. + + WARNING: It uses hotshot profiler which is not thread safe. + """ + def process_request(self, request): + if (settings.DEBUG or request.user.is_superuser) and request.GET.has_key('prof'): + connection.queries = [] + self.tmpfile = tempfile.mktemp() + self.prof = hotshot.Profile(self.tmpfile) + + def process_view(self, request, callback, callback_args, callback_kwargs): + if (settings.DEBUG or request.user.is_superuser) and request.GET.has_key('prof'): + return self.prof.runcall(callback, request, *callback_args, **callback_kwargs) + + def get_group(self, file): + for g in group_prefix_re: + name = g.findall( file ) + if name: + return name[0] + + def get_summary(self, results_dict, sum): + list = [ (item[1], item[0]) for item in results_dict.items() ] + list.sort( reverse = True ) + list = list[:40] + + res = " tottime\n" + for item in list: + if sum == 0: + foo = 0 + else: + foo = 100*item[0]/sum + res += "%4.1f%% %7.3f %s\n" % (foo, item[0], item[1] ) + + return res + + def summary_for_files(self, stats_str): + stats_str = stats_str.split("\n")[5:] + + mystats = {} + mygroups = {} + + sum = 0 + + for s in stats_str: + fields = words_re.split(s); + if len(fields) == 7: + time = float(fields[2]) + sum += time + file = fields[6].split(":")[0] + + if not file in mystats: + mystats[file] = 0 + mystats[file] += time + + group = self.get_group(file) + if not group in mygroups: + mygroups[ group ] = 0 + mygroups[ group ] += time + + return "
    " + \
    +               " ---- By file ----\n\n" + self.get_summary(mystats,sum) + "\n" + \
    +               " ---- By group ---\n\n" + self.get_summary(mygroups,sum) + \
    +               "
    " + + def process_response(self, request, response): + if (settings.DEBUG or request.user.is_superuser) and request.GET.has_key('prof'): + self.prof.close() + + out = StringIO.StringIO() + old_stdout = sys.stdout + sys.stdout = out + + stats = hotshot.stats.load(self.tmpfile) + stats.sort_stats('time', 'calls') + stats.print_stats() + + sys.stdout = old_stdout + stats_str = out.getvalue() + + if response and response.content and stats_str: + response.content = "
    " + stats_str + "
    " + + response.content = "\n".join(response.content.split("\n")[:40]) + + response.content += self.summary_for_files(stats_str) + + os.unlink(self.tmpfile) + + response.content += '\n%d SQL Queries:\n' % len(connection.queries) + response.content += pprint.pformat(connection.queries) + + return response + diff --git a/wolnelektury/settings.py b/wolnelektury/settings.py new file mode 100644 index 000000000..c5b8d6797 --- /dev/null +++ b/wolnelektury/settings.py @@ -0,0 +1,123 @@ +# -*- coding: utf-8 -*- +# Django settings for wolnelektury project. +from os import path + +PROJECT_DIR = path.abspath(path.dirname(__file__)) + +DEBUG = True +TEMPLATE_DEBUG = DEBUG + +ADMINS = ( + (u'Marek Stępniowski', 'marek@stepniowski.com'), +) + +MANAGERS = ADMINS + +DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. +DATABASE_NAME = path.join(PROJECT_DIR, 'lektury.sqlite') # Or path to database file if using sqlite3. +DATABASE_USER = '' # Not used with sqlite3. +DATABASE_PASSWORD = '' # Not used with sqlite3. +DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. +DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. + +# Local time zone for this installation. Choices can be found here: +# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name +# although not all choices may be available on all operating systems. +# If running in a Windows environment this must be set to the same as your +# system time zone. +TIME_ZONE = 'America/Chicago' + +# Language code for this installation. All choices can be found here: +# http://www.i18nguy.com/unicode/language-identifiers.html +LANGUAGE_CODE = 'pl' + +SITE_ID = 1 + +# If you set this to False, Django will make some optimizations so as not +# to load the internationalization machinery. +USE_I18N = True + +# Absolute path to the directory that holds media. +# Example: "/home/media/media.lawrence.com/" +MEDIA_ROOT = PROJECT_DIR + '/media/' + +# URL that handles the media served from MEDIA_ROOT. Make sure to use a +# trailing slash if there is a path component (optional in other cases). +# Examples: "http://media.lawrence.com", "http://example.com/media/" +MEDIA_URL = '/media/' + +# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a +# trailing slash. +# Examples: "http://foo.com/media/", "/media/". +ADMIN_MEDIA_PREFIX = '/admin-media/' + +# Make this unique, and don't share it with anybody. + +# List of callables that know how to import templates from various sources. +TEMPLATE_LOADERS = ( + 'django.template.loaders.filesystem.load_template_source', + 'django.template.loaders.app_directories.load_template_source', +# 'django.template.loaders.eggs.load_template_source', +) + +TEMPLATE_CONTEXT_PROCESSORS = ( + 'django.core.context_processors.auth', + 'django.core.context_processors.debug', + 'django.core.context_processors.i18n', + 'django.core.context_processors.media', + 'django.core.context_processors.request', +) + +MIDDLEWARE_CLASSES = [ + 'django.middleware.common.CommonMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.middleware.doc.XViewMiddleware', + 'pagination.middleware.PaginationMiddleware', +] + +# If DEBUG is enabled add query log to bottom of every template +if DEBUG: + MIDDLEWARE_CLASSES.append('middleware.ProfileMiddleware') + +ROOT_URLCONF = 'urls' + +TEMPLATE_DIRS = ( + PROJECT_DIR + '/templates/' +) + +# CSS and JS files to compress +COMPRESS_CSS = { + 'all': { + 'source_filenames': ('css/master.css', 'css/jquery.autocomplete.css', 'css/master.plain.css',), + 'output_filename': 'css/all.min.css', + } +} + +COMPRESS_JS = { + 'all': { + 'source_filenames': ('js/jquery.js', 'js/jquery.autocolumn.js', 'js/jquery.autocomplete.js', + 'js/jquery.form.js', 'js/jquery.jqmodal.js', 'js/jquery.labelify.js', 'js/catalogue.js',), + 'output_filename': 'js/all.min.js', + } +} + +COMPRESS_CSS_FILTERS = None + +LOGIN_URL = '/uzytkownicy/zaloguj/' + +LOGIN_REDIRECT_URL = '/' + +INSTALLED_APPS = ( + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.sites', + 'django.contrib.admin', + 'newtagging', + 'pagination', + 'chunks', + 'compress', + 'catalogue', +) + diff --git a/wolnelektury/templates/404.html b/wolnelektury/templates/404.html new file mode 100644 index 000000000..5003eae87 --- /dev/null +++ b/wolnelektury/templates/404.html @@ -0,0 +1,3 @@ +

    Blad 404 - Strona nie istnieje

    + +

    (Tutaj później będzie coś więcej, naprawdę)

    \ No newline at end of file diff --git a/wolnelektury/templates/admin/base_site.html b/wolnelektury/templates/admin/base_site.html new file mode 100644 index 000000000..d0ca937a0 --- /dev/null +++ b/wolnelektury/templates/admin/base_site.html @@ -0,0 +1,9 @@ +{% extends "admin/base.html" %} + +{% block title %}{{ title }} | Administracja stroną WolneLektury.pl{% endblock %} + +{% block branding %} +

    Administracja stroną WolneLektury.pl

    +{% endblock %} + +{% block nav-global %}{% endblock %} \ No newline at end of file diff --git a/wolnelektury/templates/auth/login.html b/wolnelektury/templates/auth/login.html new file mode 100644 index 000000000..6db94aa22 --- /dev/null +++ b/wolnelektury/templates/auth/login.html @@ -0,0 +1,24 @@ +{% extends "base.html" %} + +{% block title %}Zaloguj / Zarejestruj się w WolneLektury.pl{% endblock %} + +{% block body %} +

    Zaloguj się / Załóż konto

    + +

  • {{ search_form.q }}
  • lub wróć do strony głównej

    + +
    +

    Zaloguj się

    +
      + {{ form.as_ul }} +
    1. +
    +

    +
    + +
    +

    Załóż konto

    + +

    +
    +{% endblock %} diff --git a/wolnelektury/templates/base.html b/wolnelektury/templates/base.html new file mode 100644 index 000000000..8c8f1c68b --- /dev/null +++ b/wolnelektury/templates/base.html @@ -0,0 +1,99 @@ +{% load chunks compressed catalogue_tags %} + + + + + {% block title %}WolneLektury.pl{% endblock %} + + {% compressed_css "all" %} + {% compressed_js "all" %} + {% block extrahead %} + {% endblock %} + + +
    + {% chunk "top-message" %} +
    + +
    + {% block body %} + {% endblock %} +
    +
    + +
    + +
    +
    +

    Zaloguj się / Załóż konto

    +

    +
      + {% authentication_form %} +
    1. +
    +
    + +
    +
    +
    + +
    +

    * Ładowanie

    +
    +
    + + diff --git a/wolnelektury/templates/catalogue/book_detail.html b/wolnelektury/templates/catalogue/book_detail.html new file mode 100644 index 000000000..ff9278030 --- /dev/null +++ b/wolnelektury/templates/catalogue/book_detail.html @@ -0,0 +1,107 @@ +{% extends "base.html" %} +{% load catalogue_tags %} + +{% block title %}Lektura {{ book.title }} w WolneLektury.pl{% endblock %} + +{% block bodyid %}book-detail{% endblock %} + +{% block extrahead %} + +{% endblock %} + +{% block body %} +

    {{ book.title }}, {{ categories.author|join:", " }}

    +
    +
      + {# {% for tag in tags %} #} + {#
    1. {{ tag }} | x
    2. #} + {# {% endfor %} #} +
    3. {{ book.title }} | x
    4. +
    +
    + +
    + {% if book.has_description %} +
    + {{ book.description|safe }} +
    +

    Zwiń opis ▲

    + {% endif %} +
    + +
    + + {% if book.children.all %} +
    +

    Utwory składające się na ten utwór:

    + {% for book in book.children.all %} +
  • {{ book.title }}
  • + {% endfor %} +
    + {% endif %} + +
    + +
    +

    O utworze

    +
      +
    • + Autor: + {% for tag in categories.author %} + {{ tag }} + {% endfor %} +
    • +
    • + Epoka: + {% for tag in categories.epoch %} + {{ tag }} + {% endfor %} +
    • +
    • + Rodzaj: + {% for tag in categories.kind %} + {{ tag }} + {% endfor %} +
    • +
    • + Gatunek: + {% for tag in categories.genre %} + {{ tag }} + {% endfor %} +
    • +
    + {% if categories.theme %} +

    Motywy w utworze

    +
      + {% for theme in categories.theme %} +
    • {{ theme }}
    • + {% endfor %} +
    + {% endif %} +
    +{% endblock %} \ No newline at end of file diff --git a/wolnelektury/templates/catalogue/book_list.html b/wolnelektury/templates/catalogue/book_list.html new file mode 100644 index 000000000..f4f575c7f --- /dev/null +++ b/wolnelektury/templates/catalogue/book_list.html @@ -0,0 +1,35 @@ +{% extends "base.html" %} +{% load catalogue_tags chunks %} + +{% block bodyid %}book-a-list{% endblock %} + +{% block title %}Alfabetyczny spis utworów w WolneLektury.pl{% endblock %} + +{% block extrahead %} + +{% endblock %} + +{% block body %} +

    Alfabetyczny spis utworów

    +
    +

    {{ form.q }} lub wróć do strony głównej

    +
    + +
    + {% for first_letter, group in books_by_first_letter.items %} +
    +

    {{ first_letter }}

    +
      + {% for book in group %} +
    1. {{ book.title }}
    2. + {% endfor %} +
    +
    + {% endfor %} +
    +{% endblock %} diff --git a/wolnelektury/templates/catalogue/book_sets.html b/wolnelektury/templates/catalogue/book_sets.html new file mode 100644 index 000000000..c7394186a --- /dev/null +++ b/wolnelektury/templates/catalogue/book_sets.html @@ -0,0 +1,17 @@ +

    Półki zawierające utwór {{ book.title }}

    +{% if not user.tag_set.count %} +

    Nie posiadasz żadnych półek. Jeśli chcesz, możesz utworzyć nową półkę poniżej.

    +{% else %} +
    +
      +
    1. {{ form.set_ids }}
    2. +
    3. +
    +
    +{% endif %} +
    +
    +
      +
    1. {{ new_set_form.name }}
    2. +
    +
    \ No newline at end of file diff --git a/wolnelektury/templates/catalogue/book_short.html b/wolnelektury/templates/catalogue/book_short.html new file mode 100644 index 000000000..e6a3748b8 --- /dev/null +++ b/wolnelektury/templates/catalogue/book_short.html @@ -0,0 +1,11 @@ +
    + +
    +
    +

    {{ book.title }}

    +

    Formaty: {{ formats|join:", "|safe }}

    +

    Utwór w kategoriach: {{ tags|join:", "|safe }}

    +
    +
    diff --git a/wolnelektury/templates/catalogue/breadcrumbs.html b/wolnelektury/templates/catalogue/breadcrumbs.html new file mode 100644 index 000000000..896d9997c --- /dev/null +++ b/wolnelektury/templates/catalogue/breadcrumbs.html @@ -0,0 +1,9 @@ +{% load catalogue_tags %} +
    +
      + {% for tag in tag_list %} +
    1. {{ tag }} | x
    2. + {% endfor %} +
    3. {{ search_form.q }} {{ search_form.tags }}
    4. +
    +
    \ No newline at end of file diff --git a/wolnelektury/templates/catalogue/fragment_sets.html b/wolnelektury/templates/catalogue/fragment_sets.html new file mode 100644 index 000000000..c7d641ca2 --- /dev/null +++ b/wolnelektury/templates/catalogue/fragment_sets.html @@ -0,0 +1,17 @@ +

    Półki zawierające fragment

    +{% if not user.tag_set.count %} +

    Nie posiadasz żadnych półek. Jeśli chcesz, możesz utworzyć nową półkę poniżej.

    +{% else %} +
    +
      +
    1. {{ form.set_ids }}
    2. +
    3. +
    +
    +{% endif %} +
    +
    +
      +
    1. {{ new_set_form.name }}
    2. +
    +
    \ No newline at end of file diff --git a/wolnelektury/templates/catalogue/fragment_short.html b/wolnelektury/templates/catalogue/fragment_short.html new file mode 100644 index 000000000..99ffacef0 --- /dev/null +++ b/wolnelektury/templates/catalogue/fragment_short.html @@ -0,0 +1,21 @@ +
    + {#
    #} + {# Półki #} + {#
    #} + {% if fragment.short_text %} +
    + {{ fragment.short_text|safe }} + ↓ Rozwiń fragment ↓ +
    + {% endif %} +
    + {{ fragment.text|safe }} + {% if fragment.short_text %} + ↑ Zwiń fragment ↑ + {% endif %} +
    + +
    +
    diff --git a/wolnelektury/templates/catalogue/latest_blog_posts.html b/wolnelektury/templates/catalogue/latest_blog_posts.html new file mode 100644 index 000000000..d2c90e182 --- /dev/null +++ b/wolnelektury/templates/catalogue/latest_blog_posts.html @@ -0,0 +1,5 @@ +
      +{% for post in posts %} +
    1. {{ post.title }}
    2. +{% endfor %} +
    \ No newline at end of file diff --git a/wolnelektury/templates/catalogue/main_page.html b/wolnelektury/templates/catalogue/main_page.html new file mode 100644 index 000000000..0c58adac9 --- /dev/null +++ b/wolnelektury/templates/catalogue/main_page.html @@ -0,0 +1,90 @@ +{% extends "base.html" %} +{% load catalogue_tags chunks cache %} + +{% block bodyid %}main-page{% endblock %} + +{% block extrahead %} + +{% endblock %} + +{% block body %} +
    + {% chunk "site-description" %} +
    +
    +
    +

    {{ form.q }} {{ form.tags }} lub zobacz spis utworów w naszym zbiorze

    +
    + +
    +
    + {% if categories.set %} +

    Półki

    + + {% endif %} + + {% if categories.author %} +

    Autorzy

    + + {% endif %} + + {% if categories.epoch %} +

    Epoki

    + + {% endif %} + + {% if categories.kind %} +

    Rodzaje

    + + {% endif %} + + {% if categories.genre %} +

    Gatunki literackie

    + + {% endif %} +
    +
    + {% if categories.theme %} +

    Motywy

    + + {% endif %} +
    +
    +
    + +
    +

    Aktualności z naszego bloga

    + {% cache 1800 latest-blog-posts %} + {% latest_blog_posts "http://wolnepodreczniki.pl/feed/?s=Wolne%20Lektury" %} + {% endcache %} +
    +{% endblock %} diff --git a/wolnelektury/templates/catalogue/tagged_object_list.html b/wolnelektury/templates/catalogue/tagged_object_list.html new file mode 100644 index 000000000..de7d4f095 --- /dev/null +++ b/wolnelektury/templates/catalogue/tagged_object_list.html @@ -0,0 +1,146 @@ +{% extends "base.html" %} +{% load catalogue_tags pagination_tags %} + +{% block title %}{% title_from_tags tags %} w WolneLektury.pl{% endblock %} + +{% block bodyid %}books{% endblock %} + +{% block extrahead %} + +{% endblock %} + +{% block body %} +

    {% title_from_tags tags %}

    + {% breadcrumbs tags %} + + {% autopaginate object_list 10 %} +
    + {% with tags|last as last_tag %} + {% if last_tag.has_description %} +
    + {{ last_tag.description|safe }} +
    +

    Zwiń opis ▲

    + {% endif %} + {% endwith %} +
      + {% for book in object_list %} +
    1. {{ book.short_html }}
    2. + {% endfor %} +
    + {% paginate %} +
    +
    +
    + {% if categories.set %} +

    Półki

    + + {% endif %} +
    +
    + {% if categories.author %} +

    Autorzy

    + + {% endif %} +
    +
    + {% if categories.epoch %} +

    Epoki

    + + {% endif %} +
    +
    + {% if categories.kind %} +

    Rodzaje

    + + {% endif %} +
    +
    + {% if categories.genre %} +

    Gatunki literackie

    + + {% endif %} +
    +
    + {% if categories.theme %} +

    Motywy

    + + {% endif %} +
    +
    +
    + +
    +

    * Ładowanie

    +
    +
    +{% endblock %} \ No newline at end of file diff --git a/wolnelektury/templates/catalogue/user_shelves.html b/wolnelektury/templates/catalogue/user_shelves.html new file mode 100644 index 000000000..44517c550 --- /dev/null +++ b/wolnelektury/templates/catalogue/user_shelves.html @@ -0,0 +1,15 @@ +

    Moje półki

    +{% if shelves %} + +{% else %} +

    Nie posiadasz żadnych półek. Jeśli chcesz, możesz utworzyć półkę poniżej.

    +{% endif %} +
    +
    +
      +
    1. {{ new_set_form.name }}
    2. +
    diff --git a/wolnelektury/templates/pagination/pagination.html b/wolnelektury/templates/pagination/pagination.html new file mode 100644 index 000000000..36c297bc1 --- /dev/null +++ b/wolnelektury/templates/pagination/pagination.html @@ -0,0 +1,25 @@ +{% if is_paginated %} + +{% endif %} diff --git a/wolnelektury/urls.py b/wolnelektury/urls.py new file mode 100644 index 000000000..104899f67 --- /dev/null +++ b/wolnelektury/urls.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +import os + +from django.conf.urls.defaults import * +from django.contrib import admin + +admin.autodiscover() + + +urlpatterns = patterns('', + url(r'^katalog/', include('catalogue.urls')), + + # Panel administracyjny + url(r'^admin/doc/', include('django.contrib.admindocs.urls')), + url(r'^admin/(.*)$', admin.site.root), + + # Użytkownicy + url(r'^uzytkownicy/zaloguj/$', 'catalogue.views.login', name='login'), + url(r'^uzytkownicy/wyloguj/$', 'catalogue.views.logout_then_redirect', name='logout'), + url(r'^uzytkownicy/utworz/$', 'catalogue.views.register', name='register'), + + # Pliki statyczne + url(r'^media/(?P.*)$', 'django.views.static.serve', + {'document_root': os.path.join(os.path.dirname(__file__), 'media'), 'show_indexes': True}), + url(r'^$', 'django.views.generic.simple.redirect_to', {'url': 'katalog/'}), +)