From d316a52151685a1b7c295baa12b73a73eabe5657 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 10 Apr 2012 16:59:17 +0200 Subject: [PATCH 1/1] move to django 1.4 and django-pipeline, better mobile style matching --- .gitignore | 9 +- .../catalogue}/static/jplayer/Jplayer.swf | Bin .../static/jplayer/jplayer.blue.monday.css | 0 .../static/jplayer/jplayer.blue.monday.jpg | Bin .../jplayer/jplayer.blue.monday.seeking.gif | Bin .../jplayer.blue.monday.video.play.png | Bin .../static/jplayer/jplayer.playlist.min.js | 0 .../static/jplayer/jquery.jplayer.min.js | 0 .../catalogue/static/player}/player.css | 0 .../catalogue/static/player}/player.js | 0 .../templates/catalogue/book_text.html | 5 +- .../catalogue/templates/catalogue/player.html | 2 +- apps/compress/__init__.py | 0 apps/compress/conf/__init__.py | 0 apps/compress/conf/settings.py | 22 - apps/compress/filter_base.py | 14 - apps/compress/filters/__init__.py | 0 apps/compress/filters/csstidy/__init__.py | 33 - .../filters/csstidy_python/__init__.py | 19 - .../filters/csstidy_python/csstidy.py | 636 ------------------ apps/compress/filters/csstidy_python/data.py | 421 ------------ .../filters/csstidy_python/optimizer.py | 383 ----------- .../compress/filters/csstidy_python/output.py | 101 --- apps/compress/filters/csstidy_python/tools.py | 109 --- apps/compress/filters/jsmin/__init__.py | 6 - apps/compress/filters/jsmin/jsmin.py | 218 ------ apps/compress/filters/yui/__init__.py | 44 -- apps/compress/management/__init__.py | 0 apps/compress/management/commands/__init__.py | 0 .../management/commands/synccompress.py | 59 -- apps/compress/models.py | 0 apps/compress/signals.py | 4 - apps/compress/templates/compress/css.html | 1 - apps/compress/templates/compress/css_ie.html | 1 - apps/compress/templates/compress/js.html | 1 - apps/compress/templates/compress/js_ie.html | 1 - apps/compress/templatetags/__init__.py | 0 apps/compress/templatetags/compressed.py | 104 --- apps/compress/utils.py | 130 ---- .../templates/lesmianator/poem.html | 5 +- .../pdcounter/static/pdcounter}/pdcounter.js | 2 +- .../static/sponsors}/css/sponsors.css | 0 .../sponsors/static/sponsors}/js/sponsors.js | 0 apps/waiter/templates/waiter/wait.html | 3 +- .../static/css/antiscreen.css | 149 ++++ .../wolnelektury_core}/static/css/auth.css | 0 .../wolnelektury_core}/static/css/base.css | 3 - .../static/css/book_box.css | 0 .../static/css/catalogue.css | 0 .../wolnelektury_core}/static/css/cite.css | 0 apps/wolnelektury_core/static/css/core.css | 3 + .../wolnelektury_core}/static/css/dialogs.css | 0 .../wolnelektury_core}/static/css/error.css | 0 .../wolnelektury_core}/static/css/header.css | 4 - .../wolnelektury_core}/static/css/ie.css | 0 .../static/css/jquery.autocomplete.css | 0 .../static/css/jquery.countdown.css | 0 .../static/css/main_page.css | 3 - .../static/css/master.book.css | 0 .../wolnelektury_core}/static/css/master.css | 0 .../static/css/master.plain.css | 0 .../static/css/picture_box.css | 0 .../wolnelektury_core}/static/css/screen.css | 19 +- .../wolnelektury_core}/static/css/simple.css | 0 .../static/css/social/shelf_tags.css | 0 .../ui-bg_diagonals-thick_18_b81900_40x40.png | Bin .../ui-bg_diagonals-thick_20_666666_40x40.png | Bin .../images/ui-bg_flat_10_000000_40x100.png | Bin .../images/ui-bg_glass_100_f6f6f6_1x400.png | Bin .../images/ui-bg_glass_100_fdf5ce_1x400.png | Bin .../images/ui-bg_glass_65_ffffff_1x400.png | Bin .../ui-bg_gloss-wave_35_f6a828_500x100.png | Bin .../ui-bg_highlight-soft_100_eeeeee_1x100.png | Bin .../ui-bg_highlight-soft_75_ffe45c_1x100.png | Bin .../images/ui-icons_222222_256x240.png | Bin .../images/ui-icons_228ef1_256x240.png | Bin .../images/ui-icons_ef8c08_256x240.png | Bin .../images/ui-icons_ffd27a_256x240.png | Bin .../images/ui-icons_ffffff_256x240.png | Bin .../ui-lightness/jquery-ui-1.8.16.custom.css | 0 .../wolnelektury_core}/static/css/widget.css | 0 .../static/fonts/WL-Nav.eot | Bin .../static/fonts/WL-Nav.ttf | Bin .../wolnelektury_core}/static/fonts/WL.eot | Bin .../wolnelektury_core}/static/fonts/WL.ttf | Bin .../static/img/1percent-big.png | Bin .../static/img/android-poster.png | Bin .../static/img/arrow-down.png | Bin .../static/img/arrow-up.png | Bin .../static/img/auth/facebook.png | Bin .../static/img/auth/google.png | Bin .../static/img/auth/openid.png | Bin .../static/img/auth/twitter.png | Bin .../img/backdrop/boltron-3212284622.jpg | Bin .../static/img/backdrop/book-drawer2.jpg | Bin .../img/backdrop/horiavarlan-4268896468.jpg | Bin .../static/img/bg-header.png | Bin .../wolnelektury_core}/static/img/bg.png | Bin .../static/img/book-parent.png | Bin .../wolnelektury_core}/static/img/book.png | Bin .../static/img/doodle/20110908-android.png | Bin .../static/img/doodle/20110908-logo.png | Bin .../static/img/epub-www.jpg | Bin .../wolnelektury_core}/static/img/epub.png | Bin .../wolnelektury_core}/static/img/favicon.ico | Bin .../wolnelektury_core}/static/img/favicon.png | Bin .../static/img/indicator.gif | Bin .../static/img/kindle-poster-260.png | Bin .../static/img/kindle-poster.png | Bin .../static/img/logo-220.png | Bin .../static/img/logo-bez.png | Bin .../static/img/logo-big.png | Bin .../static/img/logo-neon.png | Bin .../wolnelektury_core}/static/img/logo.png | Bin .../wolnelektury_core}/static/img/mobi.png | Bin .../wolnelektury_core}/static/img/odt.png | Bin .../wolnelektury_core}/static/img/pdf.png | Bin .../wolnelektury_core}/static/img/procent.png | Bin .../static/img/s5/blank.gif | Bin .../static/img/s5/bodybg.gif | Bin .../static/img/s5/iepngfix.htc | 0 .../wolnelektury_core}/static/img/search.png | Bin .../static/img/social/facebook.png | Bin .../static/img/social/naszaklasa.png | Bin .../static/img/social/twitter.png | Bin .../wolnelektury_core}/static/img/speaker.png | Bin .../static/img/turniej-maly.png | Bin .../wolnelektury_core}/static/img/txt.png | Bin .../wolnelektury_core}/static/img/wiatrak.png | Bin .../static/img/wl_icon_64.png | Bin .../static/img/zabawnik.png | Bin .../wolnelektury_core}/static/js/base.js | 2 +- .../wolnelektury_core}/static/js/book.js | 0 .../wolnelektury_core}/static/js/dialogs.js | 6 +- .../static/js/ierange-m2.js | 0 .../static/js/jquery-ui-1.8.16.custom.min.js | 0 .../static/js/jquery-ui-1.8.2.custom.min.js | 0 .../static/js/jquery.autocomplete.js | 0 .../static/js/jquery.countdown-de.js | 0 .../static/js/jquery.countdown-es.js | 0 .../static/js/jquery.countdown-fr.js | 0 .../static/js/jquery.countdown-lt.js | 0 .../static/js/jquery.countdown-pl.js | 0 .../static/js/jquery.countdown-ru.js | 0 .../static/js/jquery.countdown-uk.js | 0 .../static/js/jquery.countdown.js | 0 .../static/js/jquery.cycle.min.js | 2 +- .../static/js/jquery.eventdelegation.js | 0 .../static/js/jquery.form.js | 0 .../static/js/jquery.highlightfade.js | 0 .../static/js/jquery.jqmodal.js | 0 .../wolnelektury_core}/static/js/jquery.js | 0 .../static/js/jquery.scrollto.js | 0 .../wolnelektury_core}/static/js/locale.js | 0 .../static/js/modernizr.custom.19652.js | 0 .../static/js/ordered_select_multiple.js | 0 .../wolnelektury_core}/static/js/search.js | 0 .../wolnelektury_core}/static/js/widget.js | 0 .../static/js/widgetInit.js | 0 .../wolnelektury_core}/static/opensearch.xml | 0 .../wolnelektury_core}/static/widget.html | 0 .../socialaccount/snippets/provider_list.html | 14 +- .../templates/superbase.html | 17 +- requirements.txt | 6 +- wolnelektury.vhost.template | 11 +- wolnelektury/settings/__init__.py | 4 +- wolnelektury/settings/static.py | 53 +- wolnelektury/static/css/facelist_2-0.css | 182 ----- wolnelektury/static/css/s5/framing.css | 23 - wolnelektury/static/css/s5/opera.css | 7 - wolnelektury/static/css/s5/outline.css | 16 - wolnelektury/static/css/s5/pretty.css | 86 --- wolnelektury/static/css/s5/print.css | 1 - wolnelektury/static/css/s5/s5-core.css | 9 - wolnelektury/static/css/s5/slides.css | 3 - wolnelektury/static/infobar/infobar.css | 4 - wolnelektury/static/infobar/infobar.gif | Bin 247 -> 0 bytes wolnelektury/static/infobar/infobar.js | 2 - wolnelektury/static/js/catalogue.js | 603 ----------------- wolnelektury/static/js/slides.js | 559 --------------- wolnelektury/static/player.swf | Bin 6887 -> 0 bytes .../static/sponsors/css/footer_admin.css | 73 -- .../static/sponsors/js/footer_admin.js | 131 ---- .../static/sponsors/js/jquery.json.min.js | 31 - 184 files changed, 227 insertions(+), 4132 deletions(-) rename {wolnelektury => apps/catalogue}/static/jplayer/Jplayer.swf (100%) rename {wolnelektury => apps/catalogue}/static/jplayer/jplayer.blue.monday.css (100%) rename {wolnelektury => apps/catalogue}/static/jplayer/jplayer.blue.monday.jpg (100%) rename {wolnelektury => apps/catalogue}/static/jplayer/jplayer.blue.monday.seeking.gif (100%) rename {wolnelektury => apps/catalogue}/static/jplayer/jplayer.blue.monday.video.play.png (100%) rename {wolnelektury => apps/catalogue}/static/jplayer/jplayer.playlist.min.js (100%) rename {wolnelektury => apps/catalogue}/static/jplayer/jquery.jplayer.min.js (100%) rename {wolnelektury/static/css => apps/catalogue/static/player}/player.css (100%) rename {wolnelektury/static/js => apps/catalogue/static/player}/player.js (100%) delete mode 100644 apps/compress/__init__.py delete mode 100644 apps/compress/conf/__init__.py delete mode 100644 apps/compress/conf/settings.py delete mode 100644 apps/compress/filter_base.py delete mode 100644 apps/compress/filters/__init__.py delete mode 100644 apps/compress/filters/csstidy/__init__.py delete mode 100644 apps/compress/filters/csstidy_python/__init__.py delete mode 100644 apps/compress/filters/csstidy_python/csstidy.py delete mode 100644 apps/compress/filters/csstidy_python/data.py delete mode 100644 apps/compress/filters/csstidy_python/optimizer.py delete mode 100644 apps/compress/filters/csstidy_python/output.py delete mode 100644 apps/compress/filters/csstidy_python/tools.py delete mode 100644 apps/compress/filters/jsmin/__init__.py delete mode 100644 apps/compress/filters/jsmin/jsmin.py delete mode 100644 apps/compress/filters/yui/__init__.py delete mode 100644 apps/compress/management/__init__.py delete mode 100644 apps/compress/management/commands/__init__.py delete mode 100644 apps/compress/management/commands/synccompress.py delete mode 100644 apps/compress/models.py delete mode 100644 apps/compress/signals.py delete mode 100644 apps/compress/templates/compress/css.html delete mode 100644 apps/compress/templates/compress/css_ie.html delete mode 100644 apps/compress/templates/compress/js.html delete mode 100644 apps/compress/templates/compress/js_ie.html delete mode 100644 apps/compress/templatetags/__init__.py delete mode 100644 apps/compress/templatetags/compressed.py delete mode 100644 apps/compress/utils.py rename {wolnelektury/static/js => apps/pdcounter/static/pdcounter}/pdcounter.js (98%) rename {wolnelektury/static => apps/sponsors/static/sponsors}/css/sponsors.css (100%) rename {wolnelektury/static => apps/sponsors/static/sponsors}/js/sponsors.js (100%) create mode 100644 apps/wolnelektury_core/static/css/antiscreen.css rename {wolnelektury => apps/wolnelektury_core}/static/css/auth.css (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/base.css (97%) rename {wolnelektury => apps/wolnelektury_core}/static/css/book_box.css (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/catalogue.css (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/cite.css (100%) create mode 100644 apps/wolnelektury_core/static/css/core.css rename {wolnelektury => apps/wolnelektury_core}/static/css/dialogs.css (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/error.css (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/header.css (97%) rename {wolnelektury => apps/wolnelektury_core}/static/css/ie.css (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/jquery.autocomplete.css (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/jquery.countdown.css (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/main_page.css (98%) rename {wolnelektury => apps/wolnelektury_core}/static/css/master.book.css (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/master.css (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/master.plain.css (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/picture_box.css (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/screen.css (86%) rename {wolnelektury => apps/wolnelektury_core}/static/css/simple.css (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/social/shelf_tags.css (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/ui-lightness/images/ui-icons_222222_256x240.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/ui-lightness/images/ui-icons_228ef1_256x240.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/ui-lightness/images/ui-icons_ef8c08_256x240.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/ui-lightness/images/ui-icons_ffd27a_256x240.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/ui-lightness/images/ui-icons_ffffff_256x240.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/ui-lightness/jquery-ui-1.8.16.custom.css (100%) rename {wolnelektury => apps/wolnelektury_core}/static/css/widget.css (100%) rename {wolnelektury => apps/wolnelektury_core}/static/fonts/WL-Nav.eot (100%) rename {wolnelektury => apps/wolnelektury_core}/static/fonts/WL-Nav.ttf (100%) rename {wolnelektury => apps/wolnelektury_core}/static/fonts/WL.eot (100%) rename {wolnelektury => apps/wolnelektury_core}/static/fonts/WL.ttf (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/1percent-big.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/android-poster.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/arrow-down.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/arrow-up.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/auth/facebook.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/auth/google.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/auth/openid.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/auth/twitter.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/backdrop/boltron-3212284622.jpg (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/backdrop/book-drawer2.jpg (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/backdrop/horiavarlan-4268896468.jpg (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/bg-header.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/bg.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/book-parent.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/book.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/doodle/20110908-android.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/doodle/20110908-logo.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/epub-www.jpg (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/epub.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/favicon.ico (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/favicon.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/indicator.gif (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/kindle-poster-260.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/kindle-poster.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/logo-220.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/logo-bez.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/logo-big.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/logo-neon.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/logo.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/mobi.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/odt.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/pdf.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/procent.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/s5/blank.gif (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/s5/bodybg.gif (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/s5/iepngfix.htc (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/search.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/social/facebook.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/social/naszaklasa.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/social/twitter.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/speaker.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/turniej-maly.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/txt.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/wiatrak.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/wl_icon_64.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/img/zabawnik.png (100%) rename {wolnelektury => apps/wolnelektury_core}/static/js/base.js (99%) rename {wolnelektury => apps/wolnelektury_core}/static/js/book.js (100%) rename {wolnelektury => apps/wolnelektury_core}/static/js/dialogs.js (97%) rename {wolnelektury => apps/wolnelektury_core}/static/js/ierange-m2.js (100%) rename {wolnelektury => apps/wolnelektury_core}/static/js/jquery-ui-1.8.16.custom.min.js (100%) rename {wolnelektury => apps/wolnelektury_core}/static/js/jquery-ui-1.8.2.custom.min.js (100%) rename {wolnelektury => apps/wolnelektury_core}/static/js/jquery.autocomplete.js (100%) rename {wolnelektury => apps/wolnelektury_core}/static/js/jquery.countdown-de.js (100%) rename {wolnelektury => apps/wolnelektury_core}/static/js/jquery.countdown-es.js (100%) rename {wolnelektury => apps/wolnelektury_core}/static/js/jquery.countdown-fr.js (100%) rename {wolnelektury => apps/wolnelektury_core}/static/js/jquery.countdown-lt.js (100%) rename {wolnelektury => apps/wolnelektury_core}/static/js/jquery.countdown-pl.js (100%) rename {wolnelektury => apps/wolnelektury_core}/static/js/jquery.countdown-ru.js (100%) rename {wolnelektury => apps/wolnelektury_core}/static/js/jquery.countdown-uk.js (100%) rename {wolnelektury => apps/wolnelektury_core}/static/js/jquery.countdown.js (100%) rename {wolnelektury => apps/wolnelektury_core}/static/js/jquery.cycle.min.js (98%) rename {wolnelektury => apps/wolnelektury_core}/static/js/jquery.eventdelegation.js (100%) rename {wolnelektury => apps/wolnelektury_core}/static/js/jquery.form.js (100%) rename {wolnelektury => apps/wolnelektury_core}/static/js/jquery.highlightfade.js (100%) rename {wolnelektury => apps/wolnelektury_core}/static/js/jquery.jqmodal.js (100%) rename {wolnelektury => apps/wolnelektury_core}/static/js/jquery.js (100%) rename {wolnelektury => apps/wolnelektury_core}/static/js/jquery.scrollto.js (100%) rename {wolnelektury => apps/wolnelektury_core}/static/js/locale.js (100%) rename {wolnelektury => apps/wolnelektury_core}/static/js/modernizr.custom.19652.js (100%) rename {wolnelektury => apps/wolnelektury_core}/static/js/ordered_select_multiple.js (100%) rename {wolnelektury => apps/wolnelektury_core}/static/js/search.js (100%) rename {wolnelektury => apps/wolnelektury_core}/static/js/widget.js (100%) rename {wolnelektury => apps/wolnelektury_core}/static/js/widgetInit.js (100%) rename {wolnelektury => apps/wolnelektury_core}/static/opensearch.xml (100%) rename {wolnelektury => apps/wolnelektury_core}/static/widget.html (100%) delete mode 100644 wolnelektury/static/css/facelist_2-0.css delete mode 100644 wolnelektury/static/css/s5/framing.css delete mode 100644 wolnelektury/static/css/s5/opera.css delete mode 100644 wolnelektury/static/css/s5/outline.css delete mode 100644 wolnelektury/static/css/s5/pretty.css delete mode 100644 wolnelektury/static/css/s5/print.css delete mode 100644 wolnelektury/static/css/s5/s5-core.css delete mode 100644 wolnelektury/static/css/s5/slides.css delete mode 100644 wolnelektury/static/infobar/infobar.css delete mode 100644 wolnelektury/static/infobar/infobar.gif delete mode 100644 wolnelektury/static/infobar/infobar.js delete mode 100644 wolnelektury/static/js/catalogue.js delete mode 100644 wolnelektury/static/js/slides.js delete mode 100644 wolnelektury/static/player.swf delete mode 100644 wolnelektury/static/sponsors/css/footer_admin.css delete mode 100644 wolnelektury/static/sponsors/js/footer_admin.js delete mode 100644 wolnelektury/static/sponsors/js/jquery.json.min.js diff --git a/.gitignore b/.gitignore index cef8774d8..c3e3e48b6 100644 --- a/.gitignore +++ b/.gitignore @@ -7,14 +7,7 @@ dev.sqlite *.log # Compress output -/wolnelektury/static/css/all.min*.css -/wolnelektury/static/js/all*.min.js -/wolnelektury/static/css/book.min*.css -/wolnelektury/static/js/book*.min.js -/wolnelektury/static/js/jquery.min.js -/wolnelektury/static/css/ie.min*.css -/wolnelektury/static/css/screen.min*.css -/wolnelektury/static/js/base*.min.js +/static # Python garbage *.pyc diff --git a/wolnelektury/static/jplayer/Jplayer.swf b/apps/catalogue/static/jplayer/Jplayer.swf similarity index 100% rename from wolnelektury/static/jplayer/Jplayer.swf rename to apps/catalogue/static/jplayer/Jplayer.swf diff --git a/wolnelektury/static/jplayer/jplayer.blue.monday.css b/apps/catalogue/static/jplayer/jplayer.blue.monday.css similarity index 100% rename from wolnelektury/static/jplayer/jplayer.blue.monday.css rename to apps/catalogue/static/jplayer/jplayer.blue.monday.css diff --git a/wolnelektury/static/jplayer/jplayer.blue.monday.jpg b/apps/catalogue/static/jplayer/jplayer.blue.monday.jpg similarity index 100% rename from wolnelektury/static/jplayer/jplayer.blue.monday.jpg rename to apps/catalogue/static/jplayer/jplayer.blue.monday.jpg diff --git a/wolnelektury/static/jplayer/jplayer.blue.monday.seeking.gif b/apps/catalogue/static/jplayer/jplayer.blue.monday.seeking.gif similarity index 100% rename from wolnelektury/static/jplayer/jplayer.blue.monday.seeking.gif rename to apps/catalogue/static/jplayer/jplayer.blue.monday.seeking.gif diff --git a/wolnelektury/static/jplayer/jplayer.blue.monday.video.play.png b/apps/catalogue/static/jplayer/jplayer.blue.monday.video.play.png similarity index 100% rename from wolnelektury/static/jplayer/jplayer.blue.monday.video.play.png rename to apps/catalogue/static/jplayer/jplayer.blue.monday.video.play.png diff --git a/wolnelektury/static/jplayer/jplayer.playlist.min.js b/apps/catalogue/static/jplayer/jplayer.playlist.min.js similarity index 100% rename from wolnelektury/static/jplayer/jplayer.playlist.min.js rename to apps/catalogue/static/jplayer/jplayer.playlist.min.js diff --git a/wolnelektury/static/jplayer/jquery.jplayer.min.js b/apps/catalogue/static/jplayer/jquery.jplayer.min.js similarity index 100% rename from wolnelektury/static/jplayer/jquery.jplayer.min.js rename to apps/catalogue/static/jplayer/jquery.jplayer.min.js diff --git a/wolnelektury/static/css/player.css b/apps/catalogue/static/player/player.css similarity index 100% rename from wolnelektury/static/css/player.css rename to apps/catalogue/static/player/player.css diff --git a/wolnelektury/static/js/player.js b/apps/catalogue/static/player/player.js similarity index 100% rename from wolnelektury/static/js/player.js rename to apps/catalogue/static/player/player.js diff --git a/apps/catalogue/templates/catalogue/book_text.html b/apps/catalogue/templates/catalogue/book_text.html index 027a75807..53a0c6a5f 100644 --- a/apps/catalogue/templates/catalogue/book_text.html +++ b/apps/catalogue/templates/catalogue/book_text.html @@ -1,4 +1,5 @@ {% load i18n %} +{% load static from staticfiles %} {% load chunks compressed catalogue_tags %} @@ -6,7 +7,7 @@ {% trans "Wolne Lektury" %} :: {{ book.pretty_title }} - + {% compressed_css "book" %} {% compressed_js "book" %} @@ -47,7 +48,7 @@
    diff --git a/apps/catalogue/templates/catalogue/player.html b/apps/catalogue/templates/catalogue/player.html index a3ef25ca5..7ecf3e669 100755 --- a/apps/catalogue/templates/catalogue/player.html +++ b/apps/catalogue/templates/catalogue/player.html @@ -9,7 +9,7 @@ content="{{ book.title }} - darmowy audiobook na wolnej licencji" /> {% trans "Wolne Lektury" %} :: {{ book.title }} - {{ audiobook }} - + {% compressed_css "all" %} {% compressed_css "player" %} diff --git a/apps/compress/__init__.py b/apps/compress/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/apps/compress/conf/__init__.py b/apps/compress/conf/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/apps/compress/conf/settings.py b/apps/compress/conf/settings.py deleted file mode 100644 index f6949a201..000000000 --- a/apps/compress/conf/settings.py +++ /dev/null @@ -1,22 +0,0 @@ -from django.core.exceptions import ImproperlyConfigured -from django.conf import settings - -COMPRESS = getattr(settings, 'COMPRESS', not settings.DEBUG) -COMPRESS_AUTO = getattr(settings, 'COMPRESS_AUTO', True) -COMPRESS_VERSION = getattr(settings, 'COMPRESS_VERSION', False) -COMPRESS_VERSION_PLACEHOLDER = getattr(settings, 'COMPRESS_VERSION_PLACEHOLDER', '?') -COMPRESS_VERSION_DEFAULT = getattr(settings, 'COMPRESS_VERSION_DEFAULT', '0') - -COMPRESS_CSS_FILTERS = getattr(settings, 'COMPRESS_CSS_FILTERS', ['compress.filters.csstidy.CSSTidyFilter']) -COMPRESS_JS_FILTERS = getattr(settings, 'COMPRESS_JS_FILTERS', ['compress.filters.jsmin.JSMinFilter']) -COMPRESS_CSS = getattr(settings, 'COMPRESS_CSS', {}) -COMPRESS_JS = getattr(settings, 'COMPRESS_JS', {}) - -if COMPRESS_CSS_FILTERS is None: - COMPRESS_CSS_FILTERS = [] - -if COMPRESS_JS_FILTERS is None: - COMPRESS_JS_FILTERS = [] - -if COMPRESS_VERSION and not COMPRESS_AUTO: - raise ImproperlyConfigured('COMPRESS_AUTO needs to be True when using COMPRESS_VERSION.') diff --git a/apps/compress/filter_base.py b/apps/compress/filter_base.py deleted file mode 100644 index 9bb23b2ff..000000000 --- a/apps/compress/filter_base.py +++ /dev/null @@ -1,14 +0,0 @@ -class FilterBase: - def __init__(self, verbose): - self.verbose = verbose - - def filter_css(self, css): - raise NotImplementedError - def filter_js(self, js): - raise NotImplementedError - -class FilterError(Exception): - """ - This exception is raised when a filter fails - """ - pass \ No newline at end of file diff --git a/apps/compress/filters/__init__.py b/apps/compress/filters/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/apps/compress/filters/csstidy/__init__.py b/apps/compress/filters/csstidy/__init__.py deleted file mode 100644 index ae7c10313..000000000 --- a/apps/compress/filters/csstidy/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -import os -import warnings -import tempfile - -from django.conf import settings - -from compress.filter_base import FilterBase - -BINARY = getattr(settings, 'CSSTIDY_BINARY', 'csstidy') -ARGUMENTS = getattr(settings, 'CSSTIDY_ARGUMENTS', '--template=highest') - -warnings.simplefilter('ignore', RuntimeWarning) - -class CSSTidyFilter(FilterBase): - def filter_css(self, css): - tmp_file = tempfile.NamedTemporaryFile(mode='w+b') - tmp_file.write(css) - tmp_file.flush() - - output_file = tempfile.NamedTemporaryFile(mode='w+b') - - command = '%s %s %s %s' % (BINARY, tmp_file.name, ARGUMENTS, output_file.name) - - command_output = os.popen(command).read() - - filtered_css = output_file.read() - output_file.close() - tmp_file.close() - - if self.verbose: - print command_output - - return filtered_css diff --git a/apps/compress/filters/csstidy_python/__init__.py b/apps/compress/filters/csstidy_python/__init__.py deleted file mode 100644 index 03a4ac012..000000000 --- a/apps/compress/filters/csstidy_python/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -from django.conf import settings - -from compress.filter_base import FilterBase -from compress.filters.csstidy_python.csstidy import CSSTidy - -COMPRESS_CSSTIDY_SETTINGS = getattr(settings, 'COMPRESS_CSSTIDY_SETTINGS', {}) - -class CSSTidyFilter(FilterBase): - def filter_css(self, css): - tidy = CSSTidy() - - for k, v in COMPRESS_CSSTIDY_SETTINGS.items(): - tidy.setSetting(k, v) - - tidy.parse(css) - - r = tidy.Output('string') - - return r diff --git a/apps/compress/filters/csstidy_python/csstidy.py b/apps/compress/filters/csstidy_python/csstidy.py deleted file mode 100644 index 6ae8dc732..000000000 --- a/apps/compress/filters/csstidy_python/csstidy.py +++ /dev/null @@ -1,636 +0,0 @@ -# CSSTidy - CSS Parse -# -# CSS Parser class -# -# This file is part of CSSTidy. -# -# CSSTidy is free software you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation either version 2 of the License, or -# (at your option) any later version. -# -# CSSTidy is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with CSSTidy if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# -# @license http://opensource.org/licenses/gpl-license.php GNU Public License -# @package csstidy -# @author Dj Gilcrease (digitalxero at gmail dot com) 2005-2006 - -import re - -from optimizer import CSSOptimizer -from output import CSSPrinter -import data -from tools import SortedDict - -class CSSTidy(object): - #Saves the parsed CSS - _css = "" - _raw_css = SortedDict() - _optimized_css = SortedDict() - - #List of Tokens - _tokens = [] - - #Printer class - _output = None - - #Optimiser class - _optimizer = None - - #Saves the CSS charset (@charset) - _charset = '' - - #Saves all @import URLs - _import = [] - - #Saves the namespace - _namespace = '' - - #Contains the version of csstidy - _version = '1.3' - - #Stores the settings - _settings = {} - - # Saves the parser-status. - # - # Possible values: - # - is = in selector - # - ip = in property - # - iv = in value - # - instr = in string (started at " or ' or ( ) - # - ic = in comment (ignore everything) - # - at = in @-block - _status = 'is' - - #Saves the current at rule (@media) - _at = '' - - #Saves the current selector - _selector = '' - - #Saves the current property - _property = '' - - #Saves the position of , in selectors - _sel_separate = [] - - #Saves the current value - _value = '' - - #Saves the current sub-value - _sub_value = '' - - #Saves all subvalues for a property. - _sub_value_arr = [] - - #Saves the char which opened the last string - _str_char = '' - _cur_string = '' - - #Status from which the parser switched to ic or instr - _from = '' - - #Variable needed to manage string-in-strings, for example url("foo.png") - _str_in_str = False - - #=True if in invalid at-rule - _invalid_at = False - - #=True if something has been added to the current selector - _added = False - - #Saves the message log - _log = SortedDict() - - #Saves the line number - _line = 1 - - def __init__(self): - self._settings['remove_bslash'] = True - self._settings['compress_colors'] = True - self._settings['compress_font-weight'] = True - self._settings['lowercase_s'] = False - self._settings['optimise_shorthands'] = 2 - self._settings['remove_last_'] = False - self._settings['case_properties'] = 1 - self._settings['sort_properties'] = False - self._settings['sort_selectors'] = False - self._settings['merge_selectors'] = 2 - self._settings['discard_invalid_properties'] = False - self._settings['css_level'] = 'CSS2.1' - self._settings['preserve_css'] = False - self._settings['timestamp'] = False - self._settings['template'] = 'highest_compression' - - #Maps self._status to methods - self.__statusMethod = {'is':self.__parseStatus_is, 'ip': self.__parseStatus_ip, 'iv':self.__parseStatus_iv, 'instr':self.__parseStatus_instr, 'ic':self.__parseStatus_ic, 'at':self.__parseStatus_at} - - self._output = CSSPrinter(self) - self._optimizer = CSSOptimizer(self) - - #Public Methods - def getSetting(self, setting): - return self._settings.get(setting, False) - - #Set the value of a setting. - def setSetting(self, setting, value): - self._settings[setting] = value - return True - - def log(self, message, ttype, line = -1): - if line == -1: - line = self._line - - line = int(line) - - add = {'m': message, 't': ttype} - - if not self._log.has_key(line): - self._log[line] = [] - self._log[line].append(add) - elif add not in self._log[line]: - self._log[line].append(add) - - - #Checks if a character is escaped (and returns True if it is) - def escaped(self, string, pos): - return not (string[pos-1] != '\\' or self.escaped(string, pos-1)) - - #Adds CSS to an existing media/selector - def merge_css_blocks(self, media, selector, css_add): - for prop, value in css_add.iteritems(): - self.__css_add_property(media, selector, prop, value, False) - - #Checks if $value is !important. - def is_important(self, value): - return '!important' in value.lower() - - #Returns a value without !important - def gvw_important(self, value): - if self.is_important(value): - ret = value.strip() - ret = ret[0:-9] - ret = ret.strip() - ret = ret[0:-1] - ret = ret.strip() - return ret - - return value - - def parse(self, cssString): - #Switch from \r\n to \n - self._css = cssString.replace("\r\n", "\n") + ' ' - self._raw_css = {} - self._optimized_css = {} - self._curComment = '' - - #Start Parsing - i = 0 - while i < len(cssString): - if self._css[i] == "\n" or self._css[i] == "\r": - self._line += 1 - - i += self.__statusMethod[self._status](i) - - i += 1; - - self._optimized_css = self._optimizer.optimize(self._raw_css) - - def parseFile(self, filename): - try: - f = open(filename, "r") - self.parse(f.read()) - finally: - f.close() - - #Private Methods - def __parseStatus_is(self, idx): - """ - Parse in Selector - """ - ret = 0 - - if self.__is_token(self._css, idx): - if self._css[idx] == '/' and self._css[idx+1] == '*' and self._selector.strip() == '': - self._status = 'ic' - self._from = 'is' - return 1 - - elif self._css[idx] == '@' and self._selector.strip() == '': - #Check for at-rule - self._invalid_at = True - - for name, ttype in data.at_rules.iteritems(): - if self._css[idx+1:len(name)].lower() == name.lower(): - if ttype == 'at': - self._at = '@' + name - else: - self._selector = '@' + name - - self._status = ttype - self._invalid_at = False - ret += len(name) - - if self._invalid_at: - self._selector = '@' - invalid_at_name = '' - for j in xrange(idx+1, len(self._css)): - if not self._css[j].isalpha(): - break; - - invalid_at_name += self._css[j] - - self.log('Invalid @-rule: ' + invalid_at_name + ' (removed)', 'Warning') - - elif self._css[idx] == '"' or self._css[idx] == "'": - self._cur_string = self._css[idx] - self._status = 'instr' - self._str_char = self._css[idx] - self._from = 'is' - - elif self._invalid_at and self._css[idx] == ';': - self._invalid_at = False - self._status = 'is' - - elif self._css[idx] == '{': - self._status = 'ip' - self.__add_token(data.SEL_START, self._selector) - self._added = False; - - elif self._css[idx] == '}': - self.__add_token(data.AT_END, self._at) - self._at = '' - self._selector = '' - self._sel_separate = [] - - elif self._css[idx] == ',': - self._selector = self._selector.strip() + ',' - self._sel_separate.append(len(self._selector)) - - elif self._css[idx] == '\\': - self._selector += self.__unicode(idx) - - #remove unnecessary universal selector, FS#147 - elif not (self._css[idx] == '*' and self._css[idx+1] in ('.', '#', '[', ':')): - self._selector += self._css[idx] - - else: - lastpos = len(self._selector)-1 - - if lastpos == -1 or not ((self._selector[lastpos].isspace() or self.__is_token(self._selector, lastpos) and self._selector[lastpos] == ',') and self._css[idx].isspace()): - self._selector += self._css[idx] - - return ret - - def __parseStatus_ip(self, idx): - """ - Parse in property - """ - if self.__is_token(self._css, idx): - if (self._css[idx] == ':' or self._css[idx] == '=') and self._property != '': - self._status = 'iv' - - if not self.getSetting('discard_invalid_properties') or self.__property_is_valid(self._property): - self.__add_token(data.PROPERTY, self._property) - - elif self._css[idx] == '/' and self._css[idx+1] == '*' and self._property == '': - self._status = 'ic' - self._from = 'ip' - return 1 - - elif self._css[idx] == '}': - self.__explode_selectors() - self._status = 'is' - self._invalid_at = False - self.__add_token(data.SEL_END, self._selector) - self._selector = '' - self._property = '' - - elif self._css[idx] == ';': - self._property = '' - - elif self._css[idx] == '\\': - self._property += self.__unicode(idx) - - elif not self._css[idx].isspace(): - self._property += self._css[idx] - - return 0 - - def __parseStatus_iv(self, idx): - """ - Parse in value - """ - pn = (( self._css[idx] == "\n" or self._css[idx] == "\r") and self.__property_is_next(idx+1) or idx == len(self._css)) #CHECK# - if self.__is_token(self._css, idx) or pn: - if self._css[idx] == '/' and self._css[idx+1] == '*': - self._status = 'ic' - self._from = 'iv' - return 1 - - elif self._css[idx] == '"' or self._css[idx] == "'" or self._css[idx] == '(': - self._cur_string = self._css[idx] - self._str_char = ')' if self._css[idx] == '(' else self._css[idx] - self._status = 'instr' - self._from = 'iv' - - elif self._css[idx] == ',': - self._sub_value = self._sub_value.strip() + ',' - - elif self._css[idx] == '\\': - self._sub_value += self.__unicode(idx) - - elif self._css[idx] == ';' or pn: - if len(self._selector) > 0 and self._selector[0] == '@' and data.at_rules.has_key(self._selector[1:]) and data.at_rules[self._selector[1:]] == 'iv': - self._sub_value_arr.append(self._sub_value.strip()) - - self._status = 'is' - - if '@charset' in self._selector: - self._charset = self._sub_value_arr[0] - - elif '@namespace' in self._selector: - self._namespace = ' '.join(self._sub_value_arr) - - elif '@import' in self._selector: - self._import.append(' '.join(self._sub_value_arr)) - - - self._sub_value_arr = [] - self._sub_value = '' - self._selector = '' - self._sel_separate = [] - - else: - self._status = 'ip' - - elif self._css[idx] != '}': - self._sub_value += self._css[idx] - - if (self._css[idx] == '}' or self._css[idx] == ';' or pn) and self._selector != '': - if self._at == '': - self._at = data.DEFAULT_AT - - #case settings - if self.getSetting('lowercase_s'): - self._selector = self._selector.lower() - - self._property = self._property.lower() - - if self._sub_value != '': - self._sub_value_arr.append(self._sub_value) - self._sub_value = '' - - self._value = ' '.join(self._sub_value_arr) - - - self._selector = self._selector.strip() - - valid = self.__property_is_valid(self._property) - - if (not self._invalid_at or self.getSetting('preserve_css')) and (not self.getSetting('discard_invalid_properties') or valid): - self.__css_add_property(self._at, self._selector, self._property, self._value) - self.__add_token(data.VALUE, self._value) - - if not valid: - if self.getSetting('discard_invalid_properties'): - self.log('Removed invalid property: ' + self._property, 'Warning') - - else: - self.log('Invalid property in ' + self.getSetting('css_level').upper() + ': ' + self._property, 'Warning') - - self._property = ''; - self._sub_value_arr = [] - self._value = '' - - if self._css[idx] == '}': - self.__explode_selectors() - self.__add_token(data.SEL_END, self._selector) - self._status = 'is' - self._invalid_at = False - self._selector = '' - - elif not pn: - self._sub_value += self._css[idx] - - if self._css[idx].isspace(): - if self._sub_value != '': - self._sub_value_arr.append(self._sub_value) - self._sub_value = '' - - return 0 - - def __parseStatus_instr(self, idx): - """ - Parse in String - """ - if self._str_char == ')' and (self._css[idx] == '"' or self._css[idx] == "'") and not self.escaped(self._css, idx): - self._str_in_str = not self._str_in_str - - temp_add = self._css[idx] # ...and no not-escaped backslash at the previous position - if (self._css[idx] == "\n" or self._css[idx] == "\r") and not (self._css[idx-1] == '\\' and not self.escaped(self._css, idx-1)): - temp_add = "\\A " - self.log('Fixed incorrect newline in string', 'Warning') - - if not (self._str_char == ')' and self._css[idx].isspace() and not self._str_in_str): - self._cur_string += temp_add - - if self._css[idx] == self._str_char and not self.escaped(self._css, idx) and not self._str_in_str: - self._status = self._from - regex = re.compile(r'([\s]+)', re.I | re.U | re.S) - if regex.match(self._cur_string) is None and self._property != 'content': - if self._str_char == '"' or self._str_char == "'": - self._cur_string = self._cur_string[1:-1] - - elif len(self._cur_string) > 3 and (self._cur_string[1] == '"' or self._cur_string[1] == "'"): - self._cur_string = self._cur_string[0] + self._cur_string[2:-2] + self._cur_string[-1] - - if self._from == 'iv': - self._sub_value += self._cur_string - - elif self._from == 'is': - self._selector += self._cur_string - - return 0 - - def __parseStatus_ic(self, idx): - """ - Parse css In Comment - """ - if self._css[idx] == '*' and self._css[idx+1] == '/': - self._status = self._from - self.__add_token(data.COMMENT, self._curComment) - self._curComment = '' - return 1 - - else: - self._curComment += self._css[idx] - - return 0 - - def __parseStatus_at(self, idx): - """ - Parse in at-block - """ - if self.__is_token(string, idx): - if self._css[idx] == '/' and self._css[idx+1] == '*': - self._status = 'ic' - self._from = 'at' - return 1 - - elif self._css[i] == '{': - self._status = 'is' - self.__add_token(data.AT_START, self._at) - - elif self._css[i] == ',': - self._at = self._at.strip() + ',' - - elif self._css[i] == '\\': - self._at += self.__unicode(i) - else: - lastpos = len(self._at)-1 - if not (self._at[lastpos].isspace() or self.__is_token(self._at, lastpos) and self._at[lastpos] == ',') and self._css[i].isspace(): - self._at += self._css[i] - - return 0 - - def __explode_selectors(self): - #Explode multiple selectors - if self.getSetting('merge_selectors') == 1: - new_sels = [] - lastpos = 0; - self._sel_separate.append(len(self._selector)) - - for num in xrange(len(self._sel_separate)): - pos = self._sel_separate[num] - if num == (len(self._sel_separate)): #CHECK# - pos += 1 - - new_sels.append(self._selector[lastpos:(pos-lastpos-1)]) - lastpos = pos - - if len(new_sels) > 1: - for selector in new_sels: - self.merge_css_blocks(self._at, selector, self._raw_css[self._at][self._selector]) - - del self._raw_css[self._at][self._selector] - - self._sel_separate = [] - - #Adds a property with value to the existing CSS code - def __css_add_property(self, media, selector, prop, new_val): - if self.getSetting('preserve_css') or new_val.strip() == '': - return - - if not self._raw_css.has_key(media): - self._raw_css[media] = SortedDict() - - if not self._raw_css[media].has_key(selector): - self._raw_css[media][selector] = SortedDict() - - self._added = True - if self._raw_css[media][selector].has_key(prop): - if (self.is_important(self._raw_css[media][selector][prop]) and self.is_important(new_val)) or not self.is_important(self._raw_css[media][selector][prop]): - del self._raw_css[media][selector][prop] - self._raw_css[media][selector][prop] = new_val.strip() - - else: - self._raw_css[media][selector][prop] = new_val.strip() - - #Checks if the next word in a string from pos is a CSS property - def __property_is_next(self, pos): - istring = self._css[pos: len(self._css)] - pos = istring.find(':') - if pos == -1: - return False; - - istring = istring[:pos].strip().lower() - if data.all_properties.has_key(istring): - self.log('Added semicolon to the end of declaration', 'Warning') - return True - - return False; - - #Checks if a property is valid - def __property_is_valid(self, prop): - return (data.all_properties.has_key(prop) and data.all_properties[prop].find(self.getSetting('css_level').upper()) != -1) - - #Adds a token to self._tokens - def __add_token(self, ttype, cssdata, do=False): - if self.getSetting('preserve_css') or do: - if ttype == data.COMMENT: - token = [ttype, cssdata] - else: - token = [ttype, cssdata.strip()] - - self._tokens.append(token) - - #Parse unicode notations and find a replacement character - def __unicode(self, idx): - ##FIX## - return '' - - #Starts parsing from URL - ##USED? - def __parse_from_url(self, url): - try: - if "http" in url.lower() or "https" in url.lower(): - f = urllib.urlopen(url) - else: - f = open(url) - - data = f.read() - return self.parse(data) - finally: - f.close() - - #Checks if there is a token at the current position - def __is_token(self, string, idx): - return (string[idx] in data.tokens and not self.escaped(string, idx)) - - - #Property Methods - def _getOutput(self): - self._output.prepare(self._optimized_css) - return self._output.render - - def _getLog(self): - ret = "" - ks = self._log.keys() - ks.sort() - for line in ks: - for msg in self._log[line]: - ret += "Type: " + msg['t'] + "\n" - ret += "Message: " + msg['m'] + "\n" - ret += "\n" - - return ret - - def _getCSS(self): - return self._css - - - #Properties - Output = property(_getOutput, None) - Log = property(_getLog, None) - CSS = property(_getCSS, None) - - -if __name__ == '__main__': - import sys - tidy = CSSTidy() - f = open(sys.argv[1], "r") - css = f.read() - f.close() - tidy.parse(css) - tidy.Output('file', filename="Stylesheet.min.css") - print tidy.Output() - #print tidy._import \ No newline at end of file diff --git a/apps/compress/filters/csstidy_python/data.py b/apps/compress/filters/csstidy_python/data.py deleted file mode 100644 index bd728cbaa..000000000 --- a/apps/compress/filters/csstidy_python/data.py +++ /dev/null @@ -1,421 +0,0 @@ -# Various CSS Data for CSSTidy -# -# This file is part of CSSTidy. -# -# CSSTidy is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# CSSTidy is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with CSSTidy; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# -# @license http://opensource.org/licenses/gpl-license.php GNU Public License -# @package csstidy -# @author Florian Schmitz (floele at gmail dot com) 2005 - -AT_START = 1 -AT_END = 2 -SEL_START = 3 -SEL_END = 4 -PROPERTY = 5 -VALUE = 6 -COMMENT = 7 -DEFAULT_AT = 41 - -# All whitespace allowed in CSS -# -# @global array whitespace -# @version 1.0 -whitespace = frozenset([' ',"\n","\t","\r","\x0B"]) - -# All CSS tokens used by csstidy -# -# @global string tokens -# @version 1.0 -tokens = '/@}{;:=\'"(,\\!$%&)#+.<>?[]^`|~' - -# All CSS units (CSS 3 units included) -# -# @see compress_numbers() -# @global array units -# @version 1.0 -units = frozenset(['in','cm','mm','pt','pc','px','rem','em','%','ex','gd','vw','vh','vm','deg','grad','rad','ms','s','khz','hz']) - -# Available at-rules -# -# @global array at_rules -# @version 1.0 -at_rules = {'page':'is', 'font-face':'is', 'charset':'iv', 'import':'iv', 'namespace':'iv', 'media':'at'} - -# Properties that need a value with unit -# -# @todo CSS3 properties -# @see compress_numbers() -# @global array unit_values -# @version 1.2 -unit_values = frozenset(['background', 'background-position', 'border', 'border-top', 'border-right', 'border-bottom', - 'border-left', 'border-width', 'border-top-width', 'border-right-width', 'border-left-width', - 'border-bottom-width', 'bottom', 'border-spacing', 'font-size','height', 'left', 'margin', 'margin-top', - 'margin-right', 'margin-bottom', 'margin-left', 'max-height', 'max-width', 'min-height', 'min-width', - 'outline-width', 'padding', 'padding-top', 'padding-right', 'padding-bottom', 'padding-left','position', - 'right', 'top', 'text-indent', 'letter-spacing', 'word-spacing', 'width' - ]) - - -# Properties that allow as value -# -# @todo CSS3 properties -# @see compress_numbers() -# @global array color_values -# @version 1.0 -color_values = frozenset(['background-color', 'border-color', 'border-top-color', 'border-right-color', - 'border-bottom-color', 'border-left-color', 'color', 'outline-color']) - - -# Default values for the background properties -# -# @todo Possibly property names will change during CSS3 development -# @global array background_prop_default -# @see dissolve_short_bg() -# @see merge_bg() -# @version 1.0 -background_prop_default = {} -background_prop_default['background-image'] = 'none' -background_prop_default['background-size'] = 'auto' -background_prop_default['background-repeat'] = 'repeat' -background_prop_default['background-position'] = '0 0' -background_prop_default['background-attachment'] = 'scroll' -background_prop_default['background-clip'] = 'border' -background_prop_default['background-origin'] = 'padding' -background_prop_default['background-color'] = 'transparent' - -# A list of non-W3C color names which get replaced by their hex-codes -# -# @global array replace_colors -# @see cut_color() -# @version 1.0 -replace_colors = {} -replace_colors['aliceblue'] = '#F0F8FF' -replace_colors['antiquewhite'] = '#FAEBD7' -replace_colors['aquamarine'] = '#7FFFD4' -replace_colors['azure'] = '#F0FFFF' -replace_colors['beige'] = '#F5F5DC' -replace_colors['bisque'] = '#FFE4C4' -replace_colors['blanchedalmond'] = '#FFEBCD' -replace_colors['blueviolet'] = '#8A2BE2' -replace_colors['brown'] = '#A52A2A' -replace_colors['burlywood'] = '#DEB887' -replace_colors['cadetblue'] = '#5F9EA0' -replace_colors['chartreuse'] = '#7FFF00' -replace_colors['chocolate'] = '#D2691E' -replace_colors['coral'] = '#FF7F50' -replace_colors['cornflowerblue'] = '#6495ED' -replace_colors['cornsilk'] = '#FFF8DC' -replace_colors['crimson'] = '#DC143C' -replace_colors['cyan'] = '#00FFFF' -replace_colors['darkblue'] = '#00008B' -replace_colors['darkcyan'] = '#008B8B' -replace_colors['darkgoldenrod'] = '#B8860B' -replace_colors['darkgray'] = '#A9A9A9' -replace_colors['darkgreen'] = '#006400' -replace_colors['darkkhaki'] = '#BDB76B' -replace_colors['darkmagenta'] = '#8B008B' -replace_colors['darkolivegreen'] = '#556B2F' -replace_colors['darkorange'] = '#FF8C00' -replace_colors['darkorchid'] = '#9932CC' -replace_colors['darkred'] = '#8B0000' -replace_colors['darksalmon'] = '#E9967A' -replace_colors['darkseagreen'] = '#8FBC8F' -replace_colors['darkslateblue'] = '#483D8B' -replace_colors['darkslategray'] = '#2F4F4F' -replace_colors['darkturquoise'] = '#00CED1' -replace_colors['darkviolet'] = '#9400D3' -replace_colors['deeppink'] = '#FF1493' -replace_colors['deepskyblue'] = '#00BFFF' -replace_colors['dimgray'] = '#696969' -replace_colors['dodgerblue'] = '#1E90FF' -replace_colors['feldspar'] = '#D19275' -replace_colors['firebrick'] = '#B22222' -replace_colors['floralwhite'] = '#FFFAF0' -replace_colors['forestgreen'] = '#228B22' -replace_colors['gainsboro'] = '#DCDCDC' -replace_colors['ghostwhite'] = '#F8F8FF' -replace_colors['gold'] = '#FFD700' -replace_colors['goldenrod'] = '#DAA520' -replace_colors['greenyellow'] = '#ADFF2F' -replace_colors['honeydew'] = '#F0FFF0' -replace_colors['hotpink'] = '#FF69B4' -replace_colors['indianred'] = '#CD5C5C' -replace_colors['indigo'] = '#4B0082' -replace_colors['ivory'] = '#FFFFF0' -replace_colors['khaki'] = '#F0E68C' -replace_colors['lavender'] = '#E6E6FA' -replace_colors['lavenderblush'] = '#FFF0F5' -replace_colors['lawngreen'] = '#7CFC00' -replace_colors['lemonchiffon'] = '#FFFACD' -replace_colors['lightblue'] = '#ADD8E6' -replace_colors['lightcoral'] = '#F08080' -replace_colors['lightcyan'] = '#E0FFFF' -replace_colors['lightgoldenrodyellow'] = '#FAFAD2' -replace_colors['lightgrey'] = '#D3D3D3' -replace_colors['lightgreen'] = '#90EE90' -replace_colors['lightpink'] = '#FFB6C1' -replace_colors['lightsalmon'] = '#FFA07A' -replace_colors['lightseagreen'] = '#20B2AA' -replace_colors['lightskyblue'] = '#87CEFA' -replace_colors['lightslateblue'] = '#8470FF' -replace_colors['lightslategray'] = '#778899' -replace_colors['lightsteelblue'] = '#B0C4DE' -replace_colors['lightyellow'] = '#FFFFE0' -replace_colors['limegreen'] = '#32CD32' -replace_colors['linen'] = '#FAF0E6' -replace_colors['magenta'] = '#FF00FF' -replace_colors['mediumaquamarine'] = '#66CDAA' -replace_colors['mediumblue'] = '#0000CD' -replace_colors['mediumorchid'] = '#BA55D3' -replace_colors['mediumpurple'] = '#9370D8' -replace_colors['mediumseagreen'] = '#3CB371' -replace_colors['mediumslateblue'] = '#7B68EE' -replace_colors['mediumspringgreen'] = '#00FA9A' -replace_colors['mediumturquoise'] = '#48D1CC' -replace_colors['mediumvioletred'] = '#C71585' -replace_colors['midnightblue'] = '#191970' -replace_colors['mintcream'] = '#F5FFFA' -replace_colors['mistyrose'] = '#FFE4E1' -replace_colors['moccasin'] = '#FFE4B5' -replace_colors['navajowhite'] = '#FFDEAD' -replace_colors['oldlace'] = '#FDF5E6' -replace_colors['olivedrab'] = '#6B8E23' -replace_colors['orangered'] = '#FF4500' -replace_colors['orchid'] = '#DA70D6' -replace_colors['palegoldenrod'] = '#EEE8AA' -replace_colors['palegreen'] = '#98FB98' -replace_colors['paleturquoise'] = '#AFEEEE' -replace_colors['palevioletred'] = '#D87093' -replace_colors['papayawhip'] = '#FFEFD5' -replace_colors['peachpuff'] = '#FFDAB9' -replace_colors['peru'] = '#CD853F' -replace_colors['pink'] = '#FFC0CB' -replace_colors['plum'] = '#DDA0DD' -replace_colors['powderblue'] = '#B0E0E6' -replace_colors['rosybrown'] = '#BC8F8F' -replace_colors['royalblue'] = '#4169E1' -replace_colors['saddlebrown'] = '#8B4513' -replace_colors['salmon'] = '#FA8072' -replace_colors['sandybrown'] = '#F4A460' -replace_colors['seagreen'] = '#2E8B57' -replace_colors['seashell'] = '#FFF5EE' -replace_colors['sienna'] = '#A0522D' -replace_colors['skyblue'] = '#87CEEB' -replace_colors['slateblue'] = '#6A5ACD' -replace_colors['slategray'] = '#708090' -replace_colors['snow'] = '#FFFAFA' -replace_colors['springgreen'] = '#00FF7F' -replace_colors['steelblue'] = '#4682B4' -replace_colors['tan'] = '#D2B48C' -replace_colors['thistle'] = '#D8BFD8' -replace_colors['tomato'] = '#FF6347' -replace_colors['turquoise'] = '#40E0D0' -replace_colors['violet'] = '#EE82EE' -replace_colors['violetred'] = '#D02090' -replace_colors['wheat'] = '#F5DEB3' -replace_colors['whitesmoke'] = '#F5F5F5' -replace_colors['yellowgreen'] = '#9ACD32' - -#A list of optimized colors -optimize_colors = {} -optimize_colors['black'] = '#000' -optimize_colors['fuchsia'] = '#F0F' -optimize_colors['white'] = '#FFF' -optimize_colors['yellow'] = '#FF0' -optimize_colors['cyan'] = '#0FF' -optimize_colors['magenta'] = '#F0F' -optimize_colors['lightslategray'] = '#789' - -optimize_colors['#800000'] = 'maroon' -optimize_colors['#FFA500'] = 'orange' -optimize_colors['#808000'] = 'olive' -optimize_colors['#800080'] = 'purple' -optimize_colors['#008000'] = 'green' -optimize_colors['#000080'] = 'navy' -optimize_colors['#008080'] = 'teal' -optimize_colors['#C0C0C0'] = 'silver' -optimize_colors['#808080'] = 'gray' -optimize_colors['#4B0082'] = 'indigo' -optimize_colors['#FFD700'] = 'gold' -optimize_colors['#A52A2A'] = 'brown' -optimize_colors['#00FFFF'] = 'cyan' -optimize_colors['#EE82EE'] = 'violet' -optimize_colors['#DA70D6'] = 'orchid' -optimize_colors['#FFE4C4'] = 'bisque' -optimize_colors['#F0E68C'] = 'khaki' -optimize_colors['#F5DEB3'] = 'wheat' -optimize_colors['#FF7F50'] = 'coral' -optimize_colors['#F5F5DC'] = 'beige' -optimize_colors['#F0FFFF'] = 'azure' -optimize_colors['#A0522D'] = 'sienna' -optimize_colors['#CD853F'] = 'peru' -optimize_colors['#FFFFF0'] = 'ivory' -optimize_colors['#DDA0DD'] = 'plum' -optimize_colors['#D2B48C'] = 'tan' -optimize_colors['#FFC0CB'] = 'pink' -optimize_colors['#FFFAFA'] = 'snow' -optimize_colors['#FA8072'] = 'salmon' -optimize_colors['#FF6347'] = 'tomato' -optimize_colors['#FAF0E6'] = 'linen' -optimize_colors['#F00'] = 'red' - - -# A list of all shorthand properties that are devided into four properties and/or have four subvalues -# -# @global array shorthands -# @todo Are there new ones in CSS3? -# @see dissolve_4value_shorthands() -# @see merge_4value_shorthands() -# @version 1.0 -shorthands = {} -shorthands['border-color'] = ['border-top-color','border-right-color','border-bottom-color','border-left-color'] -shorthands['border-style'] = ['border-top-style','border-right-style','border-bottom-style','border-left-style'] -shorthands['border-width'] = ['border-top-width','border-right-width','border-bottom-width','border-left-width'] -shorthands['margin'] = ['margin-top','margin-right','margin-bottom','margin-left'] -shorthands['padding'] = ['padding-top','padding-right','padding-bottom','padding-left'] -shorthands['-moz-border-radius'] = 0 - -# All CSS Properties. Needed for csstidy::property_is_next() -# -# @global array all_properties -# @todo Add CSS3 properties -# @version 1.0 -# @see csstidy::property_is_next() -all_properties = {} -all_properties['background'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['background-color'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['background-image'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['background-repeat'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['background-attachment'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['background-position'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['border'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['border-top'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['border-right'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['border-bottom'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['border-left'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['border-color'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['border-top-color'] = 'CSS2.0,CSS2.1' -all_properties['border-bottom-color'] = 'CSS2.0,CSS2.1' -all_properties['border-left-color'] = 'CSS2.0,CSS2.1' -all_properties['border-right-color'] = 'CSS2.0,CSS2.1' -all_properties['border-style'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['border-top-style'] = 'CSS2.0,CSS2.1' -all_properties['border-right-style'] = 'CSS2.0,CSS2.1' -all_properties['border-left-style'] = 'CSS2.0,CSS2.1' -all_properties['border-bottom-style'] = 'CSS2.0,CSS2.1' -all_properties['border-width'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['border-top-width'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['border-right-width'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['border-left-width'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['border-bottom-width'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['border-collapse'] = 'CSS2.0,CSS2.1' -all_properties['border-spacing'] = 'CSS2.0,CSS2.1' -all_properties['bottom'] = 'CSS2.0,CSS2.1' -all_properties['caption-side'] = 'CSS2.0,CSS2.1' -all_properties['content'] = 'CSS2.0,CSS2.1' -all_properties['clear'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['clip'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['color'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['counter-reset'] = 'CSS2.0,CSS2.1' -all_properties['counter-increment'] = 'CSS2.0,CSS2.1' -all_properties['cursor'] = 'CSS2.0,CSS2.1' -all_properties['empty-cells'] = 'CSS2.0,CSS2.1' -all_properties['display'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['direction'] = 'CSS2.0,CSS2.1' -all_properties['float'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['font'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['font-family'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['font-style'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['font-variant'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['font-weight'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['font-stretch'] = 'CSS2.0' -all_properties['font-size-adjust'] = 'CSS2.0' -all_properties['font-size'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['height'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['left'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['line-height'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['list-style'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['list-style-type'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['list-style-image'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['list-style-position'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['margin'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['margin-top'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['margin-right'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['margin-bottom'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['margin-left'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['marks'] = 'CSS1.0,CSS2.0' -all_properties['marker-offset'] = 'CSS2.0' -all_properties['max-height'] = 'CSS2.0,CSS2.1' -all_properties['max-width'] = 'CSS2.0,CSS2.1' -all_properties['min-height'] = 'CSS2.0,CSS2.1' -all_properties['min-width'] = 'CSS2.0,CSS2.1' -all_properties['overflow'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['orphans'] = 'CSS2.0,CSS2.1' -all_properties['outline'] = 'CSS2.0,CSS2.1' -all_properties['outline-width'] = 'CSS2.0,CSS2.1' -all_properties['outline-style'] = 'CSS2.0,CSS2.1' -all_properties['outline-color'] = 'CSS2.0,CSS2.1' -all_properties['padding'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['padding-top'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['padding-right'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['padding-bottom'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['padding-left'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['page-break-before'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['page-break-after'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['page-break-inside'] = 'CSS2.0,CSS2.1' -all_properties['page'] = 'CSS2.0' -all_properties['position'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['quotes'] = 'CSS2.0,CSS2.1' -all_properties['right'] = 'CSS2.0,CSS2.1' -all_properties['size'] = 'CSS1.0,CSS2.0' -all_properties['speak-header'] = 'CSS2.0,CSS2.1' -all_properties['table-layout'] = 'CSS2.0,CSS2.1' -all_properties['top'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['text-indent'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['text-align'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['text-decoration'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['text-shadow'] = 'CSS2.0' -all_properties['letter-spacing'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['word-spacing'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['text-transform'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['white-space'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['unicode-bidi'] = 'CSS2.0,CSS2.1' -all_properties['vertical-align'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['visibility'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['width'] = 'CSS1.0,CSS2.0,CSS2.1' -all_properties['widows'] = 'CSS2.0,CSS2.1' -all_properties['z-index'] = 'CSS1.0,CSS2.0,CSS2.1' - -# Speech # -all_properties['volume'] = 'CSS2.0,CSS2.1' -all_properties['speak'] = 'CSS2.0,CSS2.1' -all_properties['pause'] = 'CSS2.0,CSS2.1' -all_properties['pause-before'] = 'CSS2.0,CSS2.1' -all_properties['pause-after'] = 'CSS2.0,CSS2.1' -all_properties['cue'] = 'CSS2.0,CSS2.1' -all_properties['cue-before'] = 'CSS2.0,CSS2.1' -all_properties['cue-after'] = 'CSS2.0,CSS2.1' -all_properties['play-during'] = 'CSS2.0,CSS2.1' -all_properties['azimuth'] = 'CSS2.0,CSS2.1' -all_properties['elevation'] = 'CSS2.0,CSS2.1' -all_properties['speech-rate'] = 'CSS2.0,CSS2.1' -all_properties['voice-family'] = 'CSS2.0,CSS2.1' -all_properties['pitch'] = 'CSS2.0,CSS2.1' -all_properties['pitch-range'] = 'CSS2.0,CSS2.1' -all_properties['stress'] = 'CSS2.0,CSS2.1' -all_properties['richness'] = 'CSS2.0,CSS2.1' -all_properties['speak-punctuation'] = 'CSS2.0,CSS2.1' -all_properties['speak-numeral'] = 'CSS2.0,CSS2.1' \ No newline at end of file diff --git a/apps/compress/filters/csstidy_python/optimizer.py b/apps/compress/filters/csstidy_python/optimizer.py deleted file mode 100644 index 7cd284cfc..000000000 --- a/apps/compress/filters/csstidy_python/optimizer.py +++ /dev/null @@ -1,383 +0,0 @@ -# CSSTidy - CSS Optimizer -# -# CSS Optimizer class -# -# This file is part of CSSTidy. -# -# CSSTidy is free software you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation either version 2 of the License, or -# (at your option) any later version. -# -# CSSTidy is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with CSSTidy if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# -# @license http://opensource.org/licenses/gpl-license.php GNU Public License -# @package csstidy -# @author Dj Gilcrease (digitalxero at gmail dot com) 2005-2006 - -import data -from tools import SortedDict - - -class CSSOptimizer(object): - def __init__(self, parser): - #raw_css is a dict - self.parser = parser - self._optimized_css = SortedDict - - -#PUBLIC METHODS - def optimize(self, raw_css): - if self.parser.getSetting('preserve_css'): - return raw_css - - self._optimized_css = raw_css - - if self.parser.getSetting('merge_selectors') == 2: - self.__merge_selectors() - - ##OPTIMIZE## - for media, css in self._optimized_css.iteritems(): - for selector, cssdata in css.iteritems(): - if self.parser.getSetting('optimise_shorthands') >= 1: - cssdata = self.__merge_4value_shorthands(cssdata) - - if self.parser.getSetting('optimise_shorthands') >= 2: - cssdata = self.__merge_bg(cssdata) - - for item, value in cssdata.iteritems(): - value = self.__compress_numbers(item, value) - value = self.__compress_important(value) - - if item in data.color_values and self.parser.getSetting('compress_colors'): - old = value[:] - value = self.__compress_color(value) - if old != value: - self.parser.log('In "' + selector + '" Optimised ' + item + ': Changed ' + old + ' to ' + value, 'Information') - - if item == 'font-weight' and self.parser.getSetting('compress_font-weight'): - if value == 'bold': - value = '700' - self.parser.log('In "' + selector + '" Optimised font-weight: Changed "bold" to "700"', 'Information') - - elif value == 'normal': - value = '400' - self.parser.log('In "' + selector + '" Optimised font-weight: Changed "normal" to "400"', 'Information') - - self._optimized_css[media][selector][item] = value - - - return self._optimized_css - - -#PRIVATE METHODS - def __merge_bg(self, cssdata): - """ - Merges all background properties - @cssdata (dict) is a dictionary of the selector properties - """ - #Max number of background images. CSS3 not yet fully implemented - img = 1 - clr = 1 - bg_img_list = [] - if cssdata.has_key('background-image'): - img = len(cssdata['background-image'].split(',')) - bg_img_list = self.parser.gvw_important(cssdata['background-image']).split(',') - - elif cssdata.has_key('background-color'): - clr = len(cssdata['background-color'].split(',')) - - - number_of_values = max(img, clr, 1) - - new_bg_value = '' - important = '' - - for i in xrange(number_of_values): - for bg_property, default_value in data.background_prop_default.iteritems(): - #Skip if property does not exist - if not cssdata.has_key(bg_property): - continue - - cur_value = cssdata[bg_property] - - #Skip some properties if there is no background image - if (len(bg_img_list) > i and bg_img_list[i] == 'none') and bg_property in frozenset(['background-size', 'background-position', 'background-attachment', 'background-repeat']): - continue - - #Remove !important - if self.parser.is_important(cur_value): - important = ' !important' - cur_value = self.parser.gvw_important(cur_value) - - #Do not add default values - if cur_value == default_value: - continue - - temp = cur_value.split(',') - - if len(temp) > i: - if bg_property == 'background-size': - new_bg_value += '(' + temp[i] + ') ' - - else: - new_bg_value += temp[i] + ' ' - - new_bg_value = new_bg_value.strip() - if i != (number_of_values-1): - new_bg_value += ',' - - #Delete all background-properties - for bg_property, default_value in data.background_prop_default.iteritems(): - try: - del cssdata[bg_property] - except: - pass - - #Add new background property - if new_bg_value != '': - cssdata['background'] = new_bg_value + important - - return cssdata - - def __merge_4value_shorthands(self, cssdata): - """ - Merges Shorthand properties again, the opposite of dissolve_4value_shorthands() - @cssdata (dict) is a dictionary of the selector properties - """ - for key, value in data.shorthands.iteritems(): - important = '' - if value != 0 and cssdata.has_key(value[0]) and cssdata.has_key(value[1]) and cssdata.has_key(value[2]) and cssdata.has_key(value[3]): - cssdata[key] = '' - - for i in xrange(4): - val = cssdata[value[i]] - if self.parser.is_important(val): - important = '!important' - cssdata[key] += self.parser.gvw_important(val) + ' ' - - else: - cssdata[key] += val + ' ' - - del cssdata[value[i]] - if cssdata.has_key(key): - cssdata[key] = self.__shorthand(cssdata[key] + important.strip()) - - return cssdata - - - def __merge_selectors(self): - """ - Merges selectors with same properties. Example: a{color:red} b{color:red} . a,b{color:red} - Very basic and has at least one bug. Hopefully there is a replacement soon. - @selector_one (string) is the current selector - @value_one (dict) is a dictionary of the selector properties - Note: Currently is the elements of a selector are identical, but in a different order, they are not merged - """ - - ##OPTIMIZE## - ##FIX## - - raw_css = self._optimized_css.copy() - delete = [] - add = SortedDict() - for media, css in raw_css.iteritems(): - for selector_one, value_one in css.iteritems(): - newsel = selector_one - - for selector_two, value_two in css.iteritems(): - if selector_one == selector_two: - #We need to skip self - continue - - if value_one == value_two: - #Ok, we need to merge these two selectors - newsel += ', ' + selector_two - delete.append((media, selector_two)) - - - if not add.has_key(media): - add[media] = SortedDict() - - add[media][newsel] = value_one - delete.append((media, selector_one)) - - for item in delete: - try: - del self._optimized_css[item[0]][item[1]] - except: - #Must have already been deleted - continue - - for media, css in add.iteritems(): - self._optimized_css[media].update(css) - - - - def __shorthand(self, value): - """ - Compresses shorthand values. Example: margin:1px 1px 1px 1px . margin:1px - @value (string) - """ - - ##FIX## - - important = ''; - if self.parser.is_important(value): - value_list = self.parser.gvw_important(value) - important = '!important' - else: - value_list = value - - ret = value - value_list = value_list.split(' ') - - if len(value_list) == 4: - if value_list[0] == value_list[1] and value_list[0] == value_list[2] and value_list[0] == value_list[3]: - ret = value_list[0] + important - - elif value_list[1] == value_list[3] and value_list[0] == value_list[2]: - ret = value_list[0] + ' ' + value_list[1] + important - - elif value_list[1] == value_list[3]: - ret = value_list[0] + ' ' + value_list[1] + ' ' + value_list[2] + important - - elif len(value_list) == 3: - if value_list[0] == value_list[1] and value_list[0] == value_list[2]: - ret = value_list[0] + important - - elif value_list[0] == value_list[2]: - return value_list[0] + ' ' + value_list[1] + important - - elif len(value_list) == 2: - if value_list[0] == value_list[1]: - ret = value_list[0] + important - - if ret != value: - self.parser.log('Optimised shorthand notation: Changed "' + value + '" to "' + ret + '"', 'Information') - - return ret - - def __compress_important(self, value): - """ - Removes unnecessary whitespace in ! important - @value (string) - """ - if self.parser.is_important(value): - value = self.parser.gvw_important(value) + '!important' - - return value - - def __compress_numbers(self, prop, value): - """ - Compresses numbers (ie. 1.0 becomes 1 or 1.100 becomes 1.1 ) - @value (string) is the posible number to be compressed - """ - - ##FIX## - - value = value.split('/') - - for l in xrange(len(value)): - #continue if no numeric value - if not (len(value[l]) > 0 and (value[l][0].isdigit() or value[l][0] in ('+', '-') )): - continue - - #Fix bad colors - if prop in data.color_values: - value[l] = '#' + value[l] - - is_floatable = False - try: - float(value[l]) - is_floatable = True - except: - pass - - if is_floatable and float(value[l]) == 0: - value[l] = '0' - - elif value[l][0] != '#': - unit_found = False - for unit in data.units: - pos = value[l].lower().find(unit) - if pos != -1 and prop not in data.shorthands: - value[l] = self.__remove_leading_zeros(float(value[l][:pos])) + unit - unit_found = True - break; - - if not unit_found and prop in data.unit_values and prop not in data.shorthands: - value[l] = self.__remove_leading_zeros(float(value[l])) + 'px' - - elif not unit_found and prop not in data.shorthands: - value[l] = self.__remove_leading_zeros(float(value[l])) - - - if len(value) > 1: - return '/'.join(value) - - return value[0] - - def __remove_leading_zeros(self, float_val): - """ - Removes the leading zeros from a float value - @float_val (float) - @returns (string) - """ - #Remove leading zero - if abs(float_val) < 1: - if float_val < 0: - float_val = '-' . str(float_val)[2:] - else: - float_val = str(float_val)[1:] - - return str(float_val) - - def __compress_color(self, color): - """ - Color compression function. Converts all rgb() values to #-values and uses the short-form if possible. Also replaces 4 color names by #-values. - @color (string) the {posible} color to change - """ - - #rgb(0,0,0) . #000000 (or #000 in this case later) - if color[:4].lower() == 'rgb(': - color_tmp = color[4:(len(color)-5)] - color_tmp = color_tmp.split(',') - - for c in color_tmp: - c = c.strip() - if c[:-1] == '%': - c = round((255*color_tmp[i])/100) - - if color_tmp[i] > 255: - color_tmp[i] = 255 - - color = '#' - - for i in xrange(3): - if color_tmp[i] < 16: - color += '0' + str(hex(color_tmp[i])).replace('0x', '') - else: - color += str(hex(color_tmp[i])).replace('0x', '') - - #Fix bad color names - if data.replace_colors.has_key(color.lower()): - color = data.replace_colors[color.lower()] - - #aabbcc . #abc - if len(color) == 7: - color_temp = color.lower() - if color_temp[0] == '#' and color_temp[1] == color_temp[2] and color_temp[3] == color_temp[4] and color_temp[5] == color_temp[6]: - color = '#' + color[1] + color[3] + color[5] - - if data.optimize_colors.has_key(color.lower()): - color = data.optimize_colors[color.lower()] - - return color \ No newline at end of file diff --git a/apps/compress/filters/csstidy_python/output.py b/apps/compress/filters/csstidy_python/output.py deleted file mode 100644 index 795a0d050..000000000 --- a/apps/compress/filters/csstidy_python/output.py +++ /dev/null @@ -1,101 +0,0 @@ -# CSSTidy - CSS Printer -# -# CSS Printer class -# -# This file is part of CSSTidy. -# -# CSSTidy is free software you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation either version 2 of the License, or -# (at your option) any later version. -# -# CSSTidy is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with CSSTidy if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# -# @license http://opensource.org/licenses/gpl-license.php GNU Public License -# @package csstidy -# @author Dj Gilcrease (digitalxero at gmail dot com) 2005-2006 - -import data - -class CSSPrinter(object): - def __init__(self, parser): - self.parser = parser - self._css = {} - self.__renderMethods = {'string': self.__renderString, 'file': self.__renderFile} - -#PUBLIC METHODS - def prepare(self, css): - self._css = css - - def render(self, output="string", *args, **kwargs): - return self.__renderMethods[output](*args, **kwargs) - -#PRIVATE METHODS - def __renderString(self, *args, **kwargs): - ##OPTIMIZE## - template = self.parser.getSetting('template') - ret = "" - - if template == 'highest_compression': - top_line_end = "" - iner_line_end = "" - bottom_line_end = "" - indent = "" - - elif template == 'high_compression': - top_line_end = "\n" - iner_line_end = "" - bottom_line_end = "\n" - indent = "" - - elif template == 'default': - top_line_end = "\n" - iner_line_end = "\n" - bottom_line_end = "\n\n" - indent = "" - - elif template == 'low_compression': - top_line_end = "\n" - iner_line_end = "\n" - bottom_line_end = "\n\n" - indent = " " - - if self.parser.getSetting('timestamp'): - ret += '/# CSSTidy ' + self.parser.version + ': ' + datetime.now().strftime("%a, %d %b %Y %H:%M:%S +0000") + ' #/' + top_line_end - - for item in self.parser._import: - ret += '@import(' + item + ');' + top_line_end - - for item in self.parser._charset: - ret += '@charset(' + item + ');' + top_line_end - - for item in self.parser._namespace: - ret += '@namespace(' + item + ');' + top_line_end - - for media, css in self._css.iteritems(): - for selector, cssdata in css.iteritems(): - ret += selector + '{' + top_line_end - - for item, value in cssdata.iteritems(): - ret += indent + item + ':' + value + ';' + iner_line_end - - ret += '}' + bottom_line_end - - return ret - - def __renderFile(self, filename=None, *args, **kwargs): - if filename is None: - return self.__renderString() - - try: - f = open(filename, "w") - f.write(self.__renderString()) - finally: - f.close() \ No newline at end of file diff --git a/apps/compress/filters/csstidy_python/tools.py b/apps/compress/filters/csstidy_python/tools.py deleted file mode 100644 index e62faef2c..000000000 --- a/apps/compress/filters/csstidy_python/tools.py +++ /dev/null @@ -1,109 +0,0 @@ - -class SortedDict(dict): - """ - A dictionary that keeps its keys in the order in which they're inserted. - """ - def __init__(self, data=None): - if data is None: - data = {} - super(SortedDict, self).__init__(data) - if isinstance(data, dict): - self.keyOrder = data.keys() - else: - self.keyOrder = [] - for key, value in data: - if key not in self.keyOrder: - self.keyOrder.append(key) - - def __deepcopy__(self, memo): - from copy import deepcopy - return self.__class__([(key, deepcopy(value, memo)) - for key, value in self.iteritems()]) - - def __setitem__(self, key, value): - super(SortedDict, self).__setitem__(key, value) - if key not in self.keyOrder: - self.keyOrder.append(key) - - def __delitem__(self, key): - super(SortedDict, self).__delitem__(key) - self.keyOrder.remove(key) - - def __iter__(self): - for k in self.keyOrder: - yield k - - def pop(self, k, *args): - result = super(SortedDict, self).pop(k, *args) - try: - self.keyOrder.remove(k) - except ValueError: - # Key wasn't in the dictionary in the first place. No problem. - pass - return result - - def popitem(self): - result = super(SortedDict, self).popitem() - self.keyOrder.remove(result[0]) - return result - - def items(self): - return zip(self.keyOrder, self.values()) - - def iteritems(self): - for key in self.keyOrder: - yield key, super(SortedDict, self).__getitem__(key) - - def keys(self): - return self.keyOrder[:] - - def iterkeys(self): - return iter(self.keyOrder) - - def values(self): - return [super(SortedDict, self).__getitem__(k) for k in self.keyOrder] - - def itervalues(self): - for key in self.keyOrder: - yield super(SortedDict, self).__getitem__(key) - - def update(self, dict_): - for k, v in dict_.items(): - self.__setitem__(k, v) - - def setdefault(self, key, default): - if key not in self.keyOrder: - self.keyOrder.append(key) - return super(SortedDict, self).setdefault(key, default) - - def value_for_index(self, index): - """Returns the value of the item at the given zero-based index.""" - return self[self.keyOrder[index]] - - def insert(self, index, key, value): - """Inserts the key, value pair before the item with the given index.""" - if key in self.keyOrder: - n = self.keyOrder.index(key) - del self.keyOrder[n] - if n < index: - index -= 1 - self.keyOrder.insert(index, key) - super(SortedDict, self).__setitem__(key, value) - - def copy(self): - """Returns a copy of this object.""" - # This way of initializing the copy means it works for subclasses, too. - obj = self.__class__(self) - obj.keyOrder = self.keyOrder[:] - return obj - - def __repr__(self): - """ - Replaces the normal dict.__repr__ with a version that returns the keys - in their sorted order. - """ - return '{%s}' % ', '.join(['%r: %r' % (k, v) for k, v in self.items()]) - - def clear(self): - super(SortedDict, self).clear() - self.keyOrder = [] \ No newline at end of file diff --git a/apps/compress/filters/jsmin/__init__.py b/apps/compress/filters/jsmin/__init__.py deleted file mode 100644 index d22620081..000000000 --- a/apps/compress/filters/jsmin/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -from compress.filters.jsmin.jsmin import jsmin -from compress.filter_base import FilterBase - -class JSMinFilter(FilterBase): - def filter_js(self, js): - return jsmin(js) \ No newline at end of file diff --git a/apps/compress/filters/jsmin/jsmin.py b/apps/compress/filters/jsmin/jsmin.py deleted file mode 100644 index 4f9d384f1..000000000 --- a/apps/compress/filters/jsmin/jsmin.py +++ /dev/null @@ -1,218 +0,0 @@ -#!/usr/bin/python - -# This code is original from jsmin by Douglas Crockford, it was translated to -# Python by Baruch Even. The original code had the following copyright and -# license. -# -# /* jsmin.c -# 2007-05-22 -# -# Copyright (c) 2002 Douglas Crockford (www.crockford.com) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy of -# this software and associated documentation files (the "Software"), to deal in -# the Software without restriction, including without limitation the rights to -# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -# of the Software, and to permit persons to whom the Software is furnished to do -# so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# The Software shall be used for Good, not Evil. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. -# */ - -from StringIO import StringIO - -def jsmin(js): - ins = StringIO(js) - outs = StringIO() - JavascriptMinify().minify(ins, outs) - str = outs.getvalue() - if len(str) > 0 and str[0] == '\n': - str = str[1:] - return str - -def isAlphanum(c): - """return true if the character is a letter, digit, underscore, - dollar sign, or non-ASCII character. - """ - return ((c >= 'a' and c <= 'z') or (c >= '0' and c <= '9') or - (c >= 'A' and c <= 'Z') or c == '_' or c == '$' or c == '\\' or (c is not None and ord(c) > 126)); - -class UnterminatedComment(Exception): - pass - -class UnterminatedStringLiteral(Exception): - pass - -class UnterminatedRegularExpression(Exception): - pass - -class JavascriptMinify(object): - - def _outA(self): - self.outstream.write(self.theA) - def _outB(self): - self.outstream.write(self.theB) - - def _get(self): - """return the next character from stdin. Watch out for lookahead. If - the character is a control character, translate it to a space or - linefeed. - """ - c = self.theLookahead - self.theLookahead = None - if c == None: - c = self.instream.read(1) - if c >= ' ' or c == '\n': - return c - if c == '': # EOF - return '\000' - if c == '\r': - return '\n' - return ' ' - - def _peek(self): - self.theLookahead = self._get() - return self.theLookahead - - def _next(self): - """get the next character, excluding comments. peek() is used to see - if a '/' is followed by a '/' or '*'. - """ - c = self._get() - if c == '/': - p = self._peek() - if p == '/': - c = self._get() - while c > '\n': - c = self._get() - return c - if p == '*': - c = self._get() - while 1: - c = self._get() - if c == '*': - if self._peek() == '/': - self._get() - return ' ' - if c == '\000': - raise UnterminatedComment() - - return c - - def _action(self, action): - """do something! What you do is determined by the argument: - 1 Output A. Copy B to A. Get the next B. - 2 Copy B to A. Get the next B. (Delete A). - 3 Get the next B. (Delete B). - action treats a string as a single character. Wow! - action recognizes a regular expression if it is preceded by ( or , or =. - """ - if action <= 1: - self._outA() - - if action <= 2: - self.theA = self.theB - if self.theA == "'" or self.theA == '"': - while 1: - self._outA() - self.theA = self._get() - if self.theA == self.theB: - break - if self.theA <= '\n': - raise UnterminatedStringLiteral() - if self.theA == '\\': - self._outA() - self.theA = self._get() - - - if action <= 3: - self.theB = self._next() - if self.theB == '/' and (self.theA == '(' or self.theA == ',' or - self.theA == '=' or self.theA == ':' or - self.theA == '[' or self.theA == '?' or - self.theA == '!' or self.theA == '&' or - self.theA == '|' or self.theA == ';' or - self.theA == '{' or self.theA == '}' or - self.theA == '\n'): - self._outA() - self._outB() - while 1: - self.theA = self._get() - if self.theA == '/': - break - elif self.theA == '\\': - self._outA() - self.theA = self._get() - elif self.theA <= '\n': - raise UnterminatedRegularExpression() - self._outA() - self.theB = self._next() - - - def _jsmin(self): - """Copy the input to the output, deleting the characters which are - insignificant to JavaScript. Comments will be removed. Tabs will be - replaced with spaces. Carriage returns will be replaced with linefeeds. - Most spaces and linefeeds will be removed. - """ - self.theA = '\n' - self._action(3) - - while self.theA != '\000': - if self.theA == ' ': - if isAlphanum(self.theB): - self._action(1) - else: - self._action(2) - elif self.theA == '\n': - if self.theB in ['{', '[', '(', '+', '-']: - self._action(1) - elif self.theB == ' ': - self._action(3) - else: - if isAlphanum(self.theB): - self._action(1) - else: - self._action(2) - else: - if self.theB == ' ': - if isAlphanum(self.theA): - self._action(1) - else: - self._action(3) - elif self.theB == '\n': - if self.theA in ['}', ']', ')', '+', '-', '"', '\'']: - self._action(1) - else: - if isAlphanum(self.theA): - self._action(1) - else: - self._action(3) - else: - self._action(1) - - def minify(self, instream, outstream): - self.instream = instream - self.outstream = outstream - self.theA = '\n' - self.theB = None - self.theLookahead = None - - self._jsmin() - self.instream.close() - -if __name__ == '__main__': - import sys - jsm = JavascriptMinify() - jsm.minify(sys.stdin, sys.stdout) \ No newline at end of file diff --git a/apps/compress/filters/yui/__init__.py b/apps/compress/filters/yui/__init__.py deleted file mode 100644 index 1e2e711fd..000000000 --- a/apps/compress/filters/yui/__init__.py +++ /dev/null @@ -1,44 +0,0 @@ -import subprocess - -from django.conf import settings - -from compress.filter_base import FilterBase, FilterError - -BINARY = getattr(settings, 'COMPRESS_YUI_BINARY', 'java -jar yuicompressor.jar') -CSS_ARGUMENTS = getattr(settings, 'COMPRESS_YUI_CSS_ARGUMENTS', '') -JS_ARGUMENTS = getattr(settings, 'COMPRESS_YUI_JS_ARGUMENTS', '') - -class YUICompressorFilter(FilterBase): - - def filter_common(self, content, type_, arguments): - command = '%s --type=%s %s' % (BINARY, type_, arguments) - - if self.verbose: - command += ' --verbose' - - p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE) - p.stdin.write(content) - p.stdin.close() - - filtered_css = p.stdout.read() - p.stdout.close() - - err = p.stderr.read() - p.stderr.close() - - if p.wait() != 0: - if not err: - err = 'Unable to apply YUI Compressor filter' - - raise FilterError(err) - - if self.verbose: - print err - - return filtered_css - - def filter_js(self, js): - return self.filter_common(js, 'js', JS_ARGUMENTS) - - def filter_css(self, css): - return self.filter_common(css, 'css', CSS_ARGUMENTS) \ No newline at end of file diff --git a/apps/compress/management/__init__.py b/apps/compress/management/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/apps/compress/management/commands/__init__.py b/apps/compress/management/commands/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/apps/compress/management/commands/synccompress.py b/apps/compress/management/commands/synccompress.py deleted file mode 100644 index e2fc6aa2e..000000000 --- a/apps/compress/management/commands/synccompress.py +++ /dev/null @@ -1,59 +0,0 @@ -from django.core.management.base import NoArgsCommand -from optparse import make_option - -from django.conf import settings - -class Command(NoArgsCommand): - option_list = NoArgsCommand.option_list + ( - make_option('--force', action='store_true', default=False, help='Force update of all files, even if the source files are older than the current compressed file.'), - ) - help = 'Updates and compresses CSS and JavsScript on-demand, without restarting Django' - args = '' - - def handle_noargs(self, **options): - - force = options.get('force', False) - verbosity = int(options.get('verbosity', 1)) - - from compress.utils import needs_update, filter_css, filter_js - - for name, css in settings.COMPRESS_CSS.items(): - print css['output_filename'] - u, version = needs_update(css['output_filename'], - css['source_filenames']) - - if (force or u) or verbosity >= 2: - msg = 'CSS Group \'%s\'' % name - print msg - print len(msg) * '-' - print "Version: %s" % version - - if force or u: - filter_css(css, verbosity) - - if (force or u) or verbosity >= 2: - print - - for name, js in settings.COMPRESS_JS.items(): - u, version = needs_update(js['output_filename'], - js['source_filenames']) - - if (force or u) or verbosity >= 2: - msg = 'JavaScript Group \'%s\'' % name - print msg - print len(msg) * '-' - print "Version: %s" % version - - if force or u: - filter_js(js, verbosity) - - if (force or u) or verbosity >= 2: - print - -# Backwards compatibility for Django r9110 -if not [opt for opt in Command.option_list if opt.dest=='verbosity']: - Command.option_list += ( - make_option('--verbosity', '-v', action="store", dest="verbosity", - default='1', type='choice', choices=['0', '1', '2'], - help="Verbosity level; 0=minimal output, 1=normal output, 2=all output"), - ) diff --git a/apps/compress/models.py b/apps/compress/models.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/apps/compress/signals.py b/apps/compress/signals.py deleted file mode 100644 index bd76a76e7..000000000 --- a/apps/compress/signals.py +++ /dev/null @@ -1,4 +0,0 @@ -from django.dispatch import Signal - -css_filtered = Signal() -js_filtered = Signal() diff --git a/apps/compress/templates/compress/css.html b/apps/compress/templates/compress/css.html deleted file mode 100644 index 68ddbac25..000000000 --- a/apps/compress/templates/compress/css.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/apps/compress/templates/compress/css_ie.html b/apps/compress/templates/compress/css_ie.html deleted file mode 100644 index 80372dc8e..000000000 --- a/apps/compress/templates/compress/css_ie.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/apps/compress/templates/compress/js.html b/apps/compress/templates/compress/js.html deleted file mode 100644 index bfa2b593c..000000000 --- a/apps/compress/templates/compress/js.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/apps/compress/templates/compress/js_ie.html b/apps/compress/templates/compress/js_ie.html deleted file mode 100644 index 8235fe2c3..000000000 --- a/apps/compress/templates/compress/js_ie.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/apps/compress/templatetags/__init__.py b/apps/compress/templatetags/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/apps/compress/templatetags/compressed.py b/apps/compress/templatetags/compressed.py deleted file mode 100644 index 2a020099f..000000000 --- a/apps/compress/templatetags/compressed.py +++ /dev/null @@ -1,104 +0,0 @@ -import os - -from django import template - -from django.conf import settings as django_settings - -from compress.conf import settings -from compress.utils import media_root, media_url, needs_update, filter_css, filter_js, get_output_filename, get_version - -register = template.Library() - -def render_common(template_name, obj, filename, version): - if settings.COMPRESS: - filename = get_output_filename(filename, version) - - context = obj.get('extra_context', {}) - context['url'] = media_url(filename) - - return template.loader.render_to_string(template_name, context) - -def render_css(css, filename, version=None): - return render_common(css.get('template_name', 'compress/css.html'), css, filename, version) - -def render_js(js, filename, version=None): - return render_common(js.get('template_name', 'compress/js.html'), js, filename, version) - -class CompressedCSSNode(template.Node): - def __init__(self, name): - self.name = name - - def render(self, context): - css_name = template.Variable(self.name).resolve(context) - - try: - css = settings.COMPRESS_CSS[css_name] - except KeyError: - return '' # fail silently, do not return anything if an invalid group is specified - - if settings.COMPRESS: - - version = None - - if settings.COMPRESS_AUTO: - u, version = needs_update(css['output_filename'], css['source_filenames']) - if u: - filter_css(css) - - return render_css(css, css['output_filename'], version) - else: - # output source files - r = '' - for source_file in css['source_filenames']: - r += render_css(css, source_file) - - return r - -class CompressedJSNode(template.Node): - def __init__(self, name): - self.name = name - - def render(self, context): - js_name = template.Variable(self.name).resolve(context) - - try: - js = settings.COMPRESS_JS[js_name] - except KeyError: - return '' # fail silently, do not return anything if an invalid group is specified - - if settings.COMPRESS: - - version = None - - if settings.COMPRESS_AUTO: - u, version = needs_update(js['output_filename'], js['source_filenames']) - if u: - filter_js(js) - - return render_js(js, js['output_filename'], version) - else: - # output source files - r = '' - for source_file in js['source_filenames']: - r += render_js(js, source_file) - return r - -#@register.tag -def compressed_css(parser, token): - try: - tag_name, name = token.split_contents() - except ValueError: - raise template.TemplateSyntaxError, '%r requires exactly one argument: the name of a group in the COMPRESS_CSS setting' % token.split_contents()[0] - - return CompressedCSSNode(name) -compressed_css = register.tag(compressed_css) - -#@register.tag -def compressed_js(parser, token): - try: - tag_name, name = token.split_contents() - except ValueError: - raise template.TemplateSyntaxError, '%r requires exactly one argument: the name of a group in the COMPRESS_JS setting' % token.split_contents()[0] - - return CompressedJSNode(name) -compressed_js = register.tag(compressed_js) diff --git a/apps/compress/utils.py b/apps/compress/utils.py deleted file mode 100644 index 89b04a56e..000000000 --- a/apps/compress/utils.py +++ /dev/null @@ -1,130 +0,0 @@ -import os -import re -import tempfile - -from django.conf import settings as django_settings -from django.utils.http import urlquote -from django.dispatch import dispatcher - -from compress.conf import settings -from compress.signals import css_filtered, js_filtered - -def get_filter(compressor_class): - """ - Convert a string version of a function name to the callable object. - """ - - if not hasattr(compressor_class, '__bases__'): - - try: - compressor_class = compressor_class.encode('ascii') - mod_name, class_name = get_mod_func(compressor_class) - if class_name != '': - compressor_class = getattr(__import__(mod_name, {}, {}, ['']), class_name) - except (ImportError, AttributeError): - raise Exception('Failed to import filter %s' % compressor_class) - - return compressor_class - -def get_mod_func(callback): - """ - Converts 'django.views.news.stories.story_detail' to - ('django.views.news.stories', 'story_detail') - """ - - try: - dot = callback.rindex('.') - except ValueError: - return callback, '' - return callback[:dot], callback[dot+1:] - -def needs_update(output_file, source_files): - """ - Scan the source files for changes and returns True if the output_file needs to be updated. - """ - - mtime = max_mtime(source_files) - version = get_version(mtime) - - compressed_file_full = media_root(get_output_filename(output_file, version)) - - if not os.path.exists(compressed_file_full): - return True, version - - # Check if the output file is outdated - return (os.stat(compressed_file_full).st_mtime < mtime), mtime - -def media_root(filename): - """ - Return the full path to ``filename``. ``filename`` is a relative path name in MEDIA_ROOT - """ - return os.path.join(django_settings.STATIC_ROOT, filename) - -def media_url(url): - return django_settings.STATIC_URL + urlquote(url) - -def concat(filenames, separator=''): - """ - Concatenate the files from the list of the ``filenames``, ouput separated with ``separator``. - """ - r = '' - - for filename in filenames: - fd = open(media_root(filename), 'rb') - r += fd.read() - r += separator - fd.close() - - return r - -def max_mtime(files): - return int(max([os.stat(media_root(f)).st_mtime for f in files])) - -def save_file(filename, contents): - fd = open(media_root(filename), 'wb+') - fd.write(contents) - fd.close() - -def get_output_filename(filename, version): - if settings.COMPRESS_VERSION and version is not None: - return filename.replace(settings.COMPRESS_VERSION_PLACEHOLDER, get_version(version)) - else: - return filename.replace(settings.COMPRESS_VERSION_PLACEHOLDER, settings.COMPRESS_VERSION_DEFAULT) - -def get_version(version): - try: - return str(int(version)) - except ValueError: - return str(version) - -def remove_files(path, filename, verbosity=0): - regex = re.compile(r'^%s$' % (os.path.basename(get_output_filename(settings.COMPRESS_VERSION_PLACEHOLDER.join([re.escape(part) for part in filename.split(settings.COMPRESS_VERSION_PLACEHOLDER)]), r'\d+')))) - - for f in os.listdir(path): - if regex.match(f): - if verbosity >= 1: - print "Removing outdated file %s" % f - - os.unlink(os.path.join(path, f)) - -def filter_common(obj, verbosity, filters, attr, separator, signal): - output = concat(obj['source_filenames'], separator) - filename = get_output_filename(obj['output_filename'], get_version(max_mtime(obj['source_filenames']))) - - if settings.COMPRESS_VERSION: - remove_files(os.path.dirname(media_root(filename)), obj['output_filename'], verbosity) - - if verbosity >= 1: - print "Saving %s" % filename - - for f in filters: - output = getattr(get_filter(f)(verbose=(verbosity >= 2)), attr)(output) - - save_file(filename, output) - signal.send(None) - -def filter_css(css, verbosity=0): - return filter_common(css, verbosity, filters=settings.COMPRESS_CSS_FILTERS, attr='filter_css', separator='', signal=css_filtered) - -def filter_js(js, verbosity=0): - return filter_common(js, verbosity, filters=settings.COMPRESS_JS_FILTERS, attr='filter_js', separator=';', signal=js_filtered) diff --git a/apps/lesmianator/templates/lesmianator/poem.html b/apps/lesmianator/templates/lesmianator/poem.html index 5d44a26f9..99fe7ed5b 100644 --- a/apps/lesmianator/templates/lesmianator/poem.html +++ b/apps/lesmianator/templates/lesmianator/poem.html @@ -1,4 +1,5 @@ {% load i18n %} +{% load static from staticfiles %} {% load compressed %} @@ -6,7 +7,7 @@ {% block title %}WolneLektury.pl{% endblock %} - + {% compressed_css "book" %} @@ -20,7 +21,7 @@ Wolne Lektury przepuszczone przez mikser.

diff --git a/wolnelektury/static/js/pdcounter.js b/apps/pdcounter/static/pdcounter/pdcounter.js similarity index 98% rename from wolnelektury/static/js/pdcounter.js rename to apps/pdcounter/static/pdcounter/pdcounter.js index 00c074280..0352076b8 100755 --- a/wolnelektury/static/js/pdcounter.js +++ b/apps/pdcounter/static/pdcounter/pdcounter.js @@ -33,4 +33,4 @@ }); -})(jQuery) \ No newline at end of file +})(jQuery); \ No newline at end of file diff --git a/wolnelektury/static/css/sponsors.css b/apps/sponsors/static/sponsors/css/sponsors.css similarity index 100% rename from wolnelektury/static/css/sponsors.css rename to apps/sponsors/static/sponsors/css/sponsors.css diff --git a/wolnelektury/static/js/sponsors.js b/apps/sponsors/static/sponsors/js/sponsors.js similarity index 100% rename from wolnelektury/static/js/sponsors.js rename to apps/sponsors/static/sponsors/js/sponsors.js diff --git a/apps/waiter/templates/waiter/wait.html b/apps/waiter/templates/waiter/wait.html index e15bd6455..576fc299f 100644 --- a/apps/waiter/templates/waiter/wait.html +++ b/apps/waiter/templates/waiter/wait.html @@ -1,5 +1,6 @@ {% extends "base.html" %} {% load i18n %} +{% load static from staticfiles %} {% load url from future %} {% block titleextra %} @@ -39,7 +40,7 @@

{% else %} {% if waiting %} -

{% trans 'Please wait' %} +

{% trans 'Please wait' %} {% trans "Your file is being prepared, please wait." %}

diff --git a/apps/wolnelektury_core/static/css/antiscreen.css b/apps/wolnelektury_core/static/css/antiscreen.css new file mode 100644 index 000000000..5a8e34c59 --- /dev/null +++ b/apps/wolnelektury_core/static/css/antiscreen.css @@ -0,0 +1,149 @@ +/* + * Style for handheld devices. Should cancel screen.css. + */ + +a { + display: inline-block; + padding: .5em; +} + +.left-column { + width: auto !important; + float: none !important; +} +.right-column { + float: none !important; + width: auto !important; +} + +.hidden-box ul { + width: 20em !important; + column-width: auto !important; + -moz-column-width: auto !important; + -webkit-column-width: auto !important; +} + +#header-content, div#main-content, div#half-header-content, #footer-content { + width: auto !important; + margin: 0 !important; +} + +#promo-box { + float: none !important; + margin-top: 0 !important; +} + +#promo-box-body { + height: auto !important; +} + +#big-cite .vip { + float: none !important; + text-align: left !important; + width: auto !important; +} + +#big-cite .cite-body { + margin-left: 0 !important; +} + +#big-cite .source { + margin-left: 0 !important; +} + + +.book-wide-box { + width: auto !important; +} +.book-wide-box .book-box-body { + width: auto !important; +} + + +#tagged-object-list .left-column, #tagged-object-list .right-column { + width: auto !important; +} + + + + +.inline-body { + width: auto !important; +} + + +.search-result { + width: auto !important; +} + + +.book-list-header { + width: auto !important; +} + +.book-wide-box .right-column { + width: auto !important; + margin-top: 0 !important; +} + +.book-wide-box #theme-list-wrapper { + margin-bottom: 0 !important; +} + +.snippets { + width: auto !important; + float: none !important; + margin-top: 0 !important; +} + + +/* HEADER */ + +#header { + height: auto !important; + padding-top: 0 !important; +} +#logo { + position: static !important; +} +#user-info { + float: none !important; + padding: 1em 0 !important; +} + +#tagline { + display: block !important; + margin-left: 0 !important; +} + +#search-area { + margin-left: 0 !important; + width: auto !important; +} + +#search-field { + width: auto !important; + padding-right: 0.5em !important; +} + +#search { + width: auto !important; +} + +#search-button { + float: none !important; +} + +#promo-box { + width: auto; +} + +/* Book list */ + +#book-list-nav { + border-left: none !important; + padding: 0 !important; + position: static !important; + right: 0 !important; + width: auto !important; +} diff --git a/wolnelektury/static/css/auth.css b/apps/wolnelektury_core/static/css/auth.css similarity index 100% rename from wolnelektury/static/css/auth.css rename to apps/wolnelektury_core/static/css/auth.css diff --git a/wolnelektury/static/css/base.css b/apps/wolnelektury_core/static/css/base.css similarity index 97% rename from wolnelektury/static/css/base.css rename to apps/wolnelektury_core/static/css/base.css index cdb8b4fed..64c5de1de 100755 --- a/wolnelektury/static/css/base.css +++ b/apps/wolnelektury_core/static/css/base.css @@ -158,9 +158,6 @@ h2 { padding: 0; margin: 0; font-size: 1.1em; - column-width: 12em; - -moz-column-width: 12em; - -webkit-column-width: 12em; } .hidden-box li { margin-bottom: .5em; diff --git a/wolnelektury/static/css/book_box.css b/apps/wolnelektury_core/static/css/book_box.css similarity index 100% rename from wolnelektury/static/css/book_box.css rename to apps/wolnelektury_core/static/css/book_box.css diff --git a/wolnelektury/static/css/catalogue.css b/apps/wolnelektury_core/static/css/catalogue.css similarity index 100% rename from wolnelektury/static/css/catalogue.css rename to apps/wolnelektury_core/static/css/catalogue.css diff --git a/wolnelektury/static/css/cite.css b/apps/wolnelektury_core/static/css/cite.css similarity index 100% rename from wolnelektury/static/css/cite.css rename to apps/wolnelektury_core/static/css/cite.css diff --git a/apps/wolnelektury_core/static/css/core.css b/apps/wolnelektury_core/static/css/core.css new file mode 100644 index 000000000..b5e4432e4 --- /dev/null +++ b/apps/wolnelektury_core/static/css/core.css @@ -0,0 +1,3 @@ +@import url("screen.css"); +@import url("antiscreen.css") handheld; +@import url("antiscreen.css") only screen and (max-device-width:480px); diff --git a/wolnelektury/static/css/dialogs.css b/apps/wolnelektury_core/static/css/dialogs.css similarity index 100% rename from wolnelektury/static/css/dialogs.css rename to apps/wolnelektury_core/static/css/dialogs.css diff --git a/wolnelektury/static/css/error.css b/apps/wolnelektury_core/static/css/error.css similarity index 100% rename from wolnelektury/static/css/error.css rename to apps/wolnelektury_core/static/css/error.css diff --git a/wolnelektury/static/css/header.css b/apps/wolnelektury_core/static/css/header.css similarity index 97% rename from wolnelektury/static/css/header.css rename to apps/wolnelektury_core/static/css/header.css index c0fbbc73e..891c16318 100755 --- a/wolnelektury/static/css/header.css +++ b/apps/wolnelektury_core/static/css/header.css @@ -7,7 +7,6 @@ } #header { - padding-top: 1.9em; padding-bottom: 0; color: #989898; background: #191919; @@ -37,8 +36,6 @@ #user-info { margin: 0; - padding: 1em 0; - margin-left: 1.5em; } #search-area { @@ -50,7 +47,6 @@ #search-field { display: inline-block; padding-left: .5em; - padding-right: .5em; padding-top: 0.5em; padding-bottom: 0; } diff --git a/wolnelektury/static/css/ie.css b/apps/wolnelektury_core/static/css/ie.css similarity index 100% rename from wolnelektury/static/css/ie.css rename to apps/wolnelektury_core/static/css/ie.css diff --git a/wolnelektury/static/css/jquery.autocomplete.css b/apps/wolnelektury_core/static/css/jquery.autocomplete.css similarity index 100% rename from wolnelektury/static/css/jquery.autocomplete.css rename to apps/wolnelektury_core/static/css/jquery.autocomplete.css diff --git a/wolnelektury/static/css/jquery.countdown.css b/apps/wolnelektury_core/static/css/jquery.countdown.css similarity index 100% rename from wolnelektury/static/css/jquery.countdown.css rename to apps/wolnelektury_core/static/css/jquery.countdown.css diff --git a/wolnelektury/static/css/main_page.css b/apps/wolnelektury_core/static/css/main_page.css similarity index 98% rename from wolnelektury/static/css/main_page.css rename to apps/wolnelektury_core/static/css/main_page.css index 331e21041..cbfc3db7b 100755 --- a/wolnelektury/static/css/main_page.css +++ b/apps/wolnelektury_core/static/css/main_page.css @@ -1,7 +1,4 @@ -#promo-box { - width: 32em; -} #promo-box-header { padding-top: 2em; height: 3.1em; diff --git a/wolnelektury/static/css/master.book.css b/apps/wolnelektury_core/static/css/master.book.css similarity index 100% rename from wolnelektury/static/css/master.book.css rename to apps/wolnelektury_core/static/css/master.book.css diff --git a/wolnelektury/static/css/master.css b/apps/wolnelektury_core/static/css/master.css similarity index 100% rename from wolnelektury/static/css/master.css rename to apps/wolnelektury_core/static/css/master.css diff --git a/wolnelektury/static/css/master.plain.css b/apps/wolnelektury_core/static/css/master.plain.css similarity index 100% rename from wolnelektury/static/css/master.plain.css rename to apps/wolnelektury_core/static/css/master.plain.css diff --git a/wolnelektury/static/css/picture_box.css b/apps/wolnelektury_core/static/css/picture_box.css similarity index 100% rename from wolnelektury/static/css/picture_box.css rename to apps/wolnelektury_core/static/css/picture_box.css diff --git a/wolnelektury/static/css/screen.css b/apps/wolnelektury_core/static/css/screen.css similarity index 86% rename from wolnelektury/static/css/screen.css rename to apps/wolnelektury_core/static/css/screen.css index ca00e972c..138121e0c 100644 --- a/wolnelektury/static/css/screen.css +++ b/apps/wolnelektury_core/static/css/screen.css @@ -1,3 +1,7 @@ +/* + * Should only be applied for big-screen pc-like devices. + */ + .left-column { width: 47em; float: left; @@ -9,6 +13,9 @@ .hidden-box ul { width: 48em; + column-width: 12em; + -moz-column-width: 12em; + -webkit-column-width: 12em; } #header-content, div#main-content, div#half-header-content, #footer-content { @@ -89,6 +96,7 @@ #header { height: 3em; + padding-top: 1.9em; } #logo { @@ -98,8 +106,7 @@ #user-info { float: right; - padding: 0 !important; - margin-left: 0; + padding: 0; } #tagline { @@ -114,7 +121,7 @@ #search-field { width: 63.1em; - padding-right: 0 !important; + padding-right: 0; } #search { @@ -125,6 +132,10 @@ float: right; } +#promo-box { + width: 32em; +} + /* Book list */ @@ -134,4 +145,4 @@ position: absolute; right: 4em; width: 25em; -} \ No newline at end of file +} diff --git a/wolnelektury/static/css/simple.css b/apps/wolnelektury_core/static/css/simple.css similarity index 100% rename from wolnelektury/static/css/simple.css rename to apps/wolnelektury_core/static/css/simple.css diff --git a/wolnelektury/static/css/social/shelf_tags.css b/apps/wolnelektury_core/static/css/social/shelf_tags.css similarity index 100% rename from wolnelektury/static/css/social/shelf_tags.css rename to apps/wolnelektury_core/static/css/social/shelf_tags.css diff --git a/wolnelektury/static/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png b/apps/wolnelektury_core/static/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png similarity index 100% rename from wolnelektury/static/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png rename to apps/wolnelektury_core/static/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png diff --git a/wolnelektury/static/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png b/apps/wolnelektury_core/static/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png similarity index 100% rename from wolnelektury/static/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png rename to apps/wolnelektury_core/static/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png diff --git a/wolnelektury/static/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png b/apps/wolnelektury_core/static/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png similarity index 100% rename from wolnelektury/static/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png rename to apps/wolnelektury_core/static/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png diff --git a/wolnelektury/static/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png b/apps/wolnelektury_core/static/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png similarity index 100% rename from wolnelektury/static/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png rename to apps/wolnelektury_core/static/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png diff --git a/wolnelektury/static/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png b/apps/wolnelektury_core/static/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png similarity index 100% rename from wolnelektury/static/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png rename to apps/wolnelektury_core/static/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png diff --git a/wolnelektury/static/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png b/apps/wolnelektury_core/static/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png similarity index 100% rename from wolnelektury/static/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png rename to apps/wolnelektury_core/static/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png diff --git a/wolnelektury/static/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png b/apps/wolnelektury_core/static/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png similarity index 100% rename from wolnelektury/static/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png rename to apps/wolnelektury_core/static/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png diff --git a/wolnelektury/static/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png b/apps/wolnelektury_core/static/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png similarity index 100% rename from wolnelektury/static/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png rename to apps/wolnelektury_core/static/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png diff --git a/wolnelektury/static/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png b/apps/wolnelektury_core/static/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png similarity index 100% rename from wolnelektury/static/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png rename to apps/wolnelektury_core/static/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png diff --git a/wolnelektury/static/css/ui-lightness/images/ui-icons_222222_256x240.png b/apps/wolnelektury_core/static/css/ui-lightness/images/ui-icons_222222_256x240.png similarity index 100% rename from wolnelektury/static/css/ui-lightness/images/ui-icons_222222_256x240.png rename to apps/wolnelektury_core/static/css/ui-lightness/images/ui-icons_222222_256x240.png diff --git a/wolnelektury/static/css/ui-lightness/images/ui-icons_228ef1_256x240.png b/apps/wolnelektury_core/static/css/ui-lightness/images/ui-icons_228ef1_256x240.png similarity index 100% rename from wolnelektury/static/css/ui-lightness/images/ui-icons_228ef1_256x240.png rename to apps/wolnelektury_core/static/css/ui-lightness/images/ui-icons_228ef1_256x240.png diff --git a/wolnelektury/static/css/ui-lightness/images/ui-icons_ef8c08_256x240.png b/apps/wolnelektury_core/static/css/ui-lightness/images/ui-icons_ef8c08_256x240.png similarity index 100% rename from wolnelektury/static/css/ui-lightness/images/ui-icons_ef8c08_256x240.png rename to apps/wolnelektury_core/static/css/ui-lightness/images/ui-icons_ef8c08_256x240.png diff --git a/wolnelektury/static/css/ui-lightness/images/ui-icons_ffd27a_256x240.png b/apps/wolnelektury_core/static/css/ui-lightness/images/ui-icons_ffd27a_256x240.png similarity index 100% rename from wolnelektury/static/css/ui-lightness/images/ui-icons_ffd27a_256x240.png rename to apps/wolnelektury_core/static/css/ui-lightness/images/ui-icons_ffd27a_256x240.png diff --git a/wolnelektury/static/css/ui-lightness/images/ui-icons_ffffff_256x240.png b/apps/wolnelektury_core/static/css/ui-lightness/images/ui-icons_ffffff_256x240.png similarity index 100% rename from wolnelektury/static/css/ui-lightness/images/ui-icons_ffffff_256x240.png rename to apps/wolnelektury_core/static/css/ui-lightness/images/ui-icons_ffffff_256x240.png diff --git a/wolnelektury/static/css/ui-lightness/jquery-ui-1.8.16.custom.css b/apps/wolnelektury_core/static/css/ui-lightness/jquery-ui-1.8.16.custom.css similarity index 100% rename from wolnelektury/static/css/ui-lightness/jquery-ui-1.8.16.custom.css rename to apps/wolnelektury_core/static/css/ui-lightness/jquery-ui-1.8.16.custom.css diff --git a/wolnelektury/static/css/widget.css b/apps/wolnelektury_core/static/css/widget.css similarity index 100% rename from wolnelektury/static/css/widget.css rename to apps/wolnelektury_core/static/css/widget.css diff --git a/wolnelektury/static/fonts/WL-Nav.eot b/apps/wolnelektury_core/static/fonts/WL-Nav.eot similarity index 100% rename from wolnelektury/static/fonts/WL-Nav.eot rename to apps/wolnelektury_core/static/fonts/WL-Nav.eot diff --git a/wolnelektury/static/fonts/WL-Nav.ttf b/apps/wolnelektury_core/static/fonts/WL-Nav.ttf similarity index 100% rename from wolnelektury/static/fonts/WL-Nav.ttf rename to apps/wolnelektury_core/static/fonts/WL-Nav.ttf diff --git a/wolnelektury/static/fonts/WL.eot b/apps/wolnelektury_core/static/fonts/WL.eot similarity index 100% rename from wolnelektury/static/fonts/WL.eot rename to apps/wolnelektury_core/static/fonts/WL.eot diff --git a/wolnelektury/static/fonts/WL.ttf b/apps/wolnelektury_core/static/fonts/WL.ttf similarity index 100% rename from wolnelektury/static/fonts/WL.ttf rename to apps/wolnelektury_core/static/fonts/WL.ttf diff --git a/wolnelektury/static/img/1percent-big.png b/apps/wolnelektury_core/static/img/1percent-big.png similarity index 100% rename from wolnelektury/static/img/1percent-big.png rename to apps/wolnelektury_core/static/img/1percent-big.png diff --git a/wolnelektury/static/img/android-poster.png b/apps/wolnelektury_core/static/img/android-poster.png similarity index 100% rename from wolnelektury/static/img/android-poster.png rename to apps/wolnelektury_core/static/img/android-poster.png diff --git a/wolnelektury/static/img/arrow-down.png b/apps/wolnelektury_core/static/img/arrow-down.png similarity index 100% rename from wolnelektury/static/img/arrow-down.png rename to apps/wolnelektury_core/static/img/arrow-down.png diff --git a/wolnelektury/static/img/arrow-up.png b/apps/wolnelektury_core/static/img/arrow-up.png similarity index 100% rename from wolnelektury/static/img/arrow-up.png rename to apps/wolnelektury_core/static/img/arrow-up.png diff --git a/wolnelektury/static/img/auth/facebook.png b/apps/wolnelektury_core/static/img/auth/facebook.png similarity index 100% rename from wolnelektury/static/img/auth/facebook.png rename to apps/wolnelektury_core/static/img/auth/facebook.png diff --git a/wolnelektury/static/img/auth/google.png b/apps/wolnelektury_core/static/img/auth/google.png similarity index 100% rename from wolnelektury/static/img/auth/google.png rename to apps/wolnelektury_core/static/img/auth/google.png diff --git a/wolnelektury/static/img/auth/openid.png b/apps/wolnelektury_core/static/img/auth/openid.png similarity index 100% rename from wolnelektury/static/img/auth/openid.png rename to apps/wolnelektury_core/static/img/auth/openid.png diff --git a/wolnelektury/static/img/auth/twitter.png b/apps/wolnelektury_core/static/img/auth/twitter.png similarity index 100% rename from wolnelektury/static/img/auth/twitter.png rename to apps/wolnelektury_core/static/img/auth/twitter.png diff --git a/wolnelektury/static/img/backdrop/boltron-3212284622.jpg b/apps/wolnelektury_core/static/img/backdrop/boltron-3212284622.jpg similarity index 100% rename from wolnelektury/static/img/backdrop/boltron-3212284622.jpg rename to apps/wolnelektury_core/static/img/backdrop/boltron-3212284622.jpg diff --git a/wolnelektury/static/img/backdrop/book-drawer2.jpg b/apps/wolnelektury_core/static/img/backdrop/book-drawer2.jpg similarity index 100% rename from wolnelektury/static/img/backdrop/book-drawer2.jpg rename to apps/wolnelektury_core/static/img/backdrop/book-drawer2.jpg diff --git a/wolnelektury/static/img/backdrop/horiavarlan-4268896468.jpg b/apps/wolnelektury_core/static/img/backdrop/horiavarlan-4268896468.jpg similarity index 100% rename from wolnelektury/static/img/backdrop/horiavarlan-4268896468.jpg rename to apps/wolnelektury_core/static/img/backdrop/horiavarlan-4268896468.jpg diff --git a/wolnelektury/static/img/bg-header.png b/apps/wolnelektury_core/static/img/bg-header.png similarity index 100% rename from wolnelektury/static/img/bg-header.png rename to apps/wolnelektury_core/static/img/bg-header.png diff --git a/wolnelektury/static/img/bg.png b/apps/wolnelektury_core/static/img/bg.png similarity index 100% rename from wolnelektury/static/img/bg.png rename to apps/wolnelektury_core/static/img/bg.png diff --git a/wolnelektury/static/img/book-parent.png b/apps/wolnelektury_core/static/img/book-parent.png similarity index 100% rename from wolnelektury/static/img/book-parent.png rename to apps/wolnelektury_core/static/img/book-parent.png diff --git a/wolnelektury/static/img/book.png b/apps/wolnelektury_core/static/img/book.png similarity index 100% rename from wolnelektury/static/img/book.png rename to apps/wolnelektury_core/static/img/book.png diff --git a/wolnelektury/static/img/doodle/20110908-android.png b/apps/wolnelektury_core/static/img/doodle/20110908-android.png similarity index 100% rename from wolnelektury/static/img/doodle/20110908-android.png rename to apps/wolnelektury_core/static/img/doodle/20110908-android.png diff --git a/wolnelektury/static/img/doodle/20110908-logo.png b/apps/wolnelektury_core/static/img/doodle/20110908-logo.png similarity index 100% rename from wolnelektury/static/img/doodle/20110908-logo.png rename to apps/wolnelektury_core/static/img/doodle/20110908-logo.png diff --git a/wolnelektury/static/img/epub-www.jpg b/apps/wolnelektury_core/static/img/epub-www.jpg similarity index 100% rename from wolnelektury/static/img/epub-www.jpg rename to apps/wolnelektury_core/static/img/epub-www.jpg diff --git a/wolnelektury/static/img/epub.png b/apps/wolnelektury_core/static/img/epub.png similarity index 100% rename from wolnelektury/static/img/epub.png rename to apps/wolnelektury_core/static/img/epub.png diff --git a/wolnelektury/static/img/favicon.ico b/apps/wolnelektury_core/static/img/favicon.ico similarity index 100% rename from wolnelektury/static/img/favicon.ico rename to apps/wolnelektury_core/static/img/favicon.ico diff --git a/wolnelektury/static/img/favicon.png b/apps/wolnelektury_core/static/img/favicon.png similarity index 100% rename from wolnelektury/static/img/favicon.png rename to apps/wolnelektury_core/static/img/favicon.png diff --git a/wolnelektury/static/img/indicator.gif b/apps/wolnelektury_core/static/img/indicator.gif similarity index 100% rename from wolnelektury/static/img/indicator.gif rename to apps/wolnelektury_core/static/img/indicator.gif diff --git a/wolnelektury/static/img/kindle-poster-260.png b/apps/wolnelektury_core/static/img/kindle-poster-260.png similarity index 100% rename from wolnelektury/static/img/kindle-poster-260.png rename to apps/wolnelektury_core/static/img/kindle-poster-260.png diff --git a/wolnelektury/static/img/kindle-poster.png b/apps/wolnelektury_core/static/img/kindle-poster.png similarity index 100% rename from wolnelektury/static/img/kindle-poster.png rename to apps/wolnelektury_core/static/img/kindle-poster.png diff --git a/wolnelektury/static/img/logo-220.png b/apps/wolnelektury_core/static/img/logo-220.png similarity index 100% rename from wolnelektury/static/img/logo-220.png rename to apps/wolnelektury_core/static/img/logo-220.png diff --git a/wolnelektury/static/img/logo-bez.png b/apps/wolnelektury_core/static/img/logo-bez.png similarity index 100% rename from wolnelektury/static/img/logo-bez.png rename to apps/wolnelektury_core/static/img/logo-bez.png diff --git a/wolnelektury/static/img/logo-big.png b/apps/wolnelektury_core/static/img/logo-big.png similarity index 100% rename from wolnelektury/static/img/logo-big.png rename to apps/wolnelektury_core/static/img/logo-big.png diff --git a/wolnelektury/static/img/logo-neon.png b/apps/wolnelektury_core/static/img/logo-neon.png similarity index 100% rename from wolnelektury/static/img/logo-neon.png rename to apps/wolnelektury_core/static/img/logo-neon.png diff --git a/wolnelektury/static/img/logo.png b/apps/wolnelektury_core/static/img/logo.png similarity index 100% rename from wolnelektury/static/img/logo.png rename to apps/wolnelektury_core/static/img/logo.png diff --git a/wolnelektury/static/img/mobi.png b/apps/wolnelektury_core/static/img/mobi.png similarity index 100% rename from wolnelektury/static/img/mobi.png rename to apps/wolnelektury_core/static/img/mobi.png diff --git a/wolnelektury/static/img/odt.png b/apps/wolnelektury_core/static/img/odt.png similarity index 100% rename from wolnelektury/static/img/odt.png rename to apps/wolnelektury_core/static/img/odt.png diff --git a/wolnelektury/static/img/pdf.png b/apps/wolnelektury_core/static/img/pdf.png similarity index 100% rename from wolnelektury/static/img/pdf.png rename to apps/wolnelektury_core/static/img/pdf.png diff --git a/wolnelektury/static/img/procent.png b/apps/wolnelektury_core/static/img/procent.png similarity index 100% rename from wolnelektury/static/img/procent.png rename to apps/wolnelektury_core/static/img/procent.png diff --git a/wolnelektury/static/img/s5/blank.gif b/apps/wolnelektury_core/static/img/s5/blank.gif similarity index 100% rename from wolnelektury/static/img/s5/blank.gif rename to apps/wolnelektury_core/static/img/s5/blank.gif diff --git a/wolnelektury/static/img/s5/bodybg.gif b/apps/wolnelektury_core/static/img/s5/bodybg.gif similarity index 100% rename from wolnelektury/static/img/s5/bodybg.gif rename to apps/wolnelektury_core/static/img/s5/bodybg.gif diff --git a/wolnelektury/static/img/s5/iepngfix.htc b/apps/wolnelektury_core/static/img/s5/iepngfix.htc similarity index 100% rename from wolnelektury/static/img/s5/iepngfix.htc rename to apps/wolnelektury_core/static/img/s5/iepngfix.htc diff --git a/wolnelektury/static/img/search.png b/apps/wolnelektury_core/static/img/search.png similarity index 100% rename from wolnelektury/static/img/search.png rename to apps/wolnelektury_core/static/img/search.png diff --git a/wolnelektury/static/img/social/facebook.png b/apps/wolnelektury_core/static/img/social/facebook.png similarity index 100% rename from wolnelektury/static/img/social/facebook.png rename to apps/wolnelektury_core/static/img/social/facebook.png diff --git a/wolnelektury/static/img/social/naszaklasa.png b/apps/wolnelektury_core/static/img/social/naszaklasa.png similarity index 100% rename from wolnelektury/static/img/social/naszaklasa.png rename to apps/wolnelektury_core/static/img/social/naszaklasa.png diff --git a/wolnelektury/static/img/social/twitter.png b/apps/wolnelektury_core/static/img/social/twitter.png similarity index 100% rename from wolnelektury/static/img/social/twitter.png rename to apps/wolnelektury_core/static/img/social/twitter.png diff --git a/wolnelektury/static/img/speaker.png b/apps/wolnelektury_core/static/img/speaker.png similarity index 100% rename from wolnelektury/static/img/speaker.png rename to apps/wolnelektury_core/static/img/speaker.png diff --git a/wolnelektury/static/img/turniej-maly.png b/apps/wolnelektury_core/static/img/turniej-maly.png similarity index 100% rename from wolnelektury/static/img/turniej-maly.png rename to apps/wolnelektury_core/static/img/turniej-maly.png diff --git a/wolnelektury/static/img/txt.png b/apps/wolnelektury_core/static/img/txt.png similarity index 100% rename from wolnelektury/static/img/txt.png rename to apps/wolnelektury_core/static/img/txt.png diff --git a/wolnelektury/static/img/wiatrak.png b/apps/wolnelektury_core/static/img/wiatrak.png similarity index 100% rename from wolnelektury/static/img/wiatrak.png rename to apps/wolnelektury_core/static/img/wiatrak.png diff --git a/wolnelektury/static/img/wl_icon_64.png b/apps/wolnelektury_core/static/img/wl_icon_64.png similarity index 100% rename from wolnelektury/static/img/wl_icon_64.png rename to apps/wolnelektury_core/static/img/wl_icon_64.png diff --git a/wolnelektury/static/img/zabawnik.png b/apps/wolnelektury_core/static/img/zabawnik.png similarity index 100% rename from wolnelektury/static/img/zabawnik.png rename to apps/wolnelektury_core/static/img/zabawnik.png diff --git a/wolnelektury/static/js/base.js b/apps/wolnelektury_core/static/js/base.js similarity index 99% rename from wolnelektury/static/js/base.js rename to apps/wolnelektury_core/static/js/base.js index 32cdd7068..77315e6f7 100755 --- a/wolnelektury/static/js/base.js +++ b/apps/wolnelektury_core/static/js/base.js @@ -120,5 +120,5 @@ $('.open-player').click(function(event) { $("#search").search();}); }); -})(jQuery) +})(jQuery); diff --git a/wolnelektury/static/js/book.js b/apps/wolnelektury_core/static/js/book.js similarity index 100% rename from wolnelektury/static/js/book.js rename to apps/wolnelektury_core/static/js/book.js diff --git a/wolnelektury/static/js/dialogs.js b/apps/wolnelektury_core/static/js/dialogs.js similarity index 97% rename from wolnelektury/static/js/dialogs.js rename to apps/wolnelektury_core/static/js/dialogs.js index d44dab32e..bd412bc74 100755 --- a/wolnelektury/static/js/dialogs.js +++ b/apps/wolnelektury_core/static/js/dialogs.js @@ -18,7 +18,9 @@ trigger: trigger, 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}); + var oleft = offset.left - hash.w.width() + $(hash.t).width(); + if (oleft < 0) oleft = 0; + hash.w.css({position: 'absolute', left: oleft, top: offset.top}); var width = $(hash.t).width(); width = width > 50 ? width : 50; $('.header', hash.w).css({width: width}); @@ -193,5 +195,5 @@ }); -})(jQuery) +})(jQuery); diff --git a/wolnelektury/static/js/ierange-m2.js b/apps/wolnelektury_core/static/js/ierange-m2.js similarity index 100% rename from wolnelektury/static/js/ierange-m2.js rename to apps/wolnelektury_core/static/js/ierange-m2.js diff --git a/wolnelektury/static/js/jquery-ui-1.8.16.custom.min.js b/apps/wolnelektury_core/static/js/jquery-ui-1.8.16.custom.min.js similarity index 100% rename from wolnelektury/static/js/jquery-ui-1.8.16.custom.min.js rename to apps/wolnelektury_core/static/js/jquery-ui-1.8.16.custom.min.js diff --git a/wolnelektury/static/js/jquery-ui-1.8.2.custom.min.js b/apps/wolnelektury_core/static/js/jquery-ui-1.8.2.custom.min.js similarity index 100% rename from wolnelektury/static/js/jquery-ui-1.8.2.custom.min.js rename to apps/wolnelektury_core/static/js/jquery-ui-1.8.2.custom.min.js diff --git a/wolnelektury/static/js/jquery.autocomplete.js b/apps/wolnelektury_core/static/js/jquery.autocomplete.js similarity index 100% rename from wolnelektury/static/js/jquery.autocomplete.js rename to apps/wolnelektury_core/static/js/jquery.autocomplete.js diff --git a/wolnelektury/static/js/jquery.countdown-de.js b/apps/wolnelektury_core/static/js/jquery.countdown-de.js similarity index 100% rename from wolnelektury/static/js/jquery.countdown-de.js rename to apps/wolnelektury_core/static/js/jquery.countdown-de.js diff --git a/wolnelektury/static/js/jquery.countdown-es.js b/apps/wolnelektury_core/static/js/jquery.countdown-es.js similarity index 100% rename from wolnelektury/static/js/jquery.countdown-es.js rename to apps/wolnelektury_core/static/js/jquery.countdown-es.js diff --git a/wolnelektury/static/js/jquery.countdown-fr.js b/apps/wolnelektury_core/static/js/jquery.countdown-fr.js similarity index 100% rename from wolnelektury/static/js/jquery.countdown-fr.js rename to apps/wolnelektury_core/static/js/jquery.countdown-fr.js diff --git a/wolnelektury/static/js/jquery.countdown-lt.js b/apps/wolnelektury_core/static/js/jquery.countdown-lt.js similarity index 100% rename from wolnelektury/static/js/jquery.countdown-lt.js rename to apps/wolnelektury_core/static/js/jquery.countdown-lt.js diff --git a/wolnelektury/static/js/jquery.countdown-pl.js b/apps/wolnelektury_core/static/js/jquery.countdown-pl.js similarity index 100% rename from wolnelektury/static/js/jquery.countdown-pl.js rename to apps/wolnelektury_core/static/js/jquery.countdown-pl.js diff --git a/wolnelektury/static/js/jquery.countdown-ru.js b/apps/wolnelektury_core/static/js/jquery.countdown-ru.js similarity index 100% rename from wolnelektury/static/js/jquery.countdown-ru.js rename to apps/wolnelektury_core/static/js/jquery.countdown-ru.js diff --git a/wolnelektury/static/js/jquery.countdown-uk.js b/apps/wolnelektury_core/static/js/jquery.countdown-uk.js similarity index 100% rename from wolnelektury/static/js/jquery.countdown-uk.js rename to apps/wolnelektury_core/static/js/jquery.countdown-uk.js diff --git a/wolnelektury/static/js/jquery.countdown.js b/apps/wolnelektury_core/static/js/jquery.countdown.js similarity index 100% rename from wolnelektury/static/js/jquery.countdown.js rename to apps/wolnelektury_core/static/js/jquery.countdown.js diff --git a/wolnelektury/static/js/jquery.cycle.min.js b/apps/wolnelektury_core/static/js/jquery.cycle.min.js similarity index 98% rename from wolnelektury/static/js/jquery.cycle.min.js rename to apps/wolnelektury_core/static/js/jquery.cycle.min.js index 3db15eb8d..9311b63fe 100644 --- a/wolnelektury/static/js/jquery.cycle.min.js +++ b/apps/wolnelektury_core/static/js/jquery.cycle.min.js @@ -8,4 +8,4 @@ * http://www.gnu.org/licenses/gpl.html * Requires: jQuery v1.2.3 or later */ -(function(D){var A="Lite-1.0";D.fn.cycle=function(E){return this.each(function(){E=E||{};if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=0;this.cyclePause=0;var I=D(this);var J=E.slideExpr?D(E.slideExpr,this):I.children();var G=J.get();if(G.length<2){if(window.console&&window.console.log){window.console.log("terminating; too few slides: "+G.length)}return }var H=D.extend({},D.fn.cycle.defaults,E||{},D.metadata?I.metadata():D.meta?I.data():{});H.before=H.before?[H.before]:[];H.after=H.after?[H.after]:[];H.after.unshift(function(){H.busy=0});var F=this.className;H.width=parseInt((F.match(/w:(\d+)/)||[])[1])||H.width;H.height=parseInt((F.match(/h:(\d+)/)||[])[1])||H.height;H.timeout=parseInt((F.match(/t:(\d+)/)||[])[1])||H.timeout;if(I.css("position")=="static"){I.css("position","relative")}if(H.width){I.width(H.width)}if(H.height&&H.height!="auto"){I.height(H.height)}var K=0;J.css({position:"absolute",top:0,left:0}).hide().each(function(M){D(this).css("z-index",G.length-M)});D(G[K]).css("opacity",1).show();if(D.browser.msie){G[K].style.removeAttribute("filter")}if(H.fit&&H.width){J.width(H.width)}if(H.fit&&H.height&&H.height!="auto"){J.height(H.height)}if(H.pause){I.hover(function(){this.cyclePause=1},function(){this.cyclePause=0})}D.fn.cycle.transitions.fade(I,J,H);J.each(function(){var M=D(this);this.cycleH=(H.fit&&H.height)?H.height:M.height();this.cycleW=(H.fit&&H.width)?H.width:M.width()});J.not(":eq("+K+")").css({opacity:0});if(H.cssFirst){D(J[K]).css(H.cssFirst)}if(H.timeout){if(H.speed.constructor==String){H.speed={slow:600,fast:200}[H.speed]||400}if(!H.sync){H.speed=H.speed/2}while((H.timeout-H.speed)<250){H.timeout+=H.speed}}H.speedIn=H.speed;H.speedOut=H.speed;H.slideCount=G.length;H.currSlide=K;H.nextSlide=1;var L=J[K];if(H.before.length){H.before[0].apply(L,[L,L,H,true])}if(H.after.length>1){H.after[1].apply(L,[L,L,H,true])}if(H.click&&!H.next){H.next=H.click}if(H.next){D(H.next).bind("click",function(){return C(G,H,H.rev?-1:1)})}if(H.prev){D(H.prev).bind("click",function(){return C(G,H,H.rev?1:-1)})}if(H.timeout){this.cycleTimeout=setTimeout(function(){B(G,H,0,!H.rev)},H.timeout+(H.delay||0))}})};function B(J,E,I,K){if(E.busy){return }var H=J[0].parentNode,M=J[E.currSlide],L=J[E.nextSlide];if(H.cycleTimeout===0&&!I){return }if(I||!H.cyclePause){if(E.before.length){D.each(E.before,function(N,O){O.apply(L,[M,L,E,K])})}var F=function(){if(D.browser.msie){this.style.removeAttribute("filter")}D.each(E.after,function(N,O){O.apply(L,[M,L,E,K])})};if(E.nextSlide!=E.currSlide){E.busy=1;D.fn.cycle.custom(M,L,E,F)}var G=(E.nextSlide+1)==J.length;E.nextSlide=G?0:E.nextSlide+1;E.currSlide=G?J.length-1:E.nextSlide-1}if(E.timeout){H.cycleTimeout=setTimeout(function(){B(J,E,0,!E.rev)},E.timeout)}}function C(E,F,I){var H=E[0].parentNode,G=H.cycleTimeout;if(G){clearTimeout(G);H.cycleTimeout=0}F.nextSlide=F.currSlide+I;if(F.nextSlide<0){F.nextSlide=E.length-1}else{if(F.nextSlide>=E.length){F.nextSlide=0}}B(E,F,1,I>=0);return false}D.fn.cycle.custom=function(K,H,I,E){var J=D(K),G=D(H);G.css({opacity:0});var F=function(){G.animate({opacity:1},I.speedIn,I.easeIn,E)};J.animate({opacity:0},I.speedOut,I.easeOut,function(){J.css({display:"none"});if(!I.sync){F()}});if(I.sync){F()}};D.fn.cycle.transitions={fade:function(F,G,E){G.not(":eq(0)").css("opacity",0);E.before.push(function(){D(this).show()})}};D.fn.cycle.ver=function(){return A};D.fn.cycle.defaults={timeout:4000,speed:1000,next:null,prev:null,before:null,after:null,height:"auto",sync:1,fit:0,pause:0,delay:0,slideExpr:null}})(jQuery) \ No newline at end of file +(function(D){var A="Lite-1.0";D.fn.cycle=function(E){return this.each(function(){E=E||{};if(this.cycleTimeout){clearTimeout(this.cycleTimeout)}this.cycleTimeout=0;this.cyclePause=0;var I=D(this);var J=E.slideExpr?D(E.slideExpr,this):I.children();var G=J.get();if(G.length<2){if(window.console&&window.console.log){window.console.log("terminating; too few slides: "+G.length)}return }var H=D.extend({},D.fn.cycle.defaults,E||{},D.metadata?I.metadata():D.meta?I.data():{});H.before=H.before?[H.before]:[];H.after=H.after?[H.after]:[];H.after.unshift(function(){H.busy=0});var F=this.className;H.width=parseInt((F.match(/w:(\d+)/)||[])[1])||H.width;H.height=parseInt((F.match(/h:(\d+)/)||[])[1])||H.height;H.timeout=parseInt((F.match(/t:(\d+)/)||[])[1])||H.timeout;if(I.css("position")=="static"){I.css("position","relative")}if(H.width){I.width(H.width)}if(H.height&&H.height!="auto"){I.height(H.height)}var K=0;J.css({position:"absolute",top:0,left:0}).hide().each(function(M){D(this).css("z-index",G.length-M)});D(G[K]).css("opacity",1).show();if(D.browser.msie){G[K].style.removeAttribute("filter")}if(H.fit&&H.width){J.width(H.width)}if(H.fit&&H.height&&H.height!="auto"){J.height(H.height)}if(H.pause){I.hover(function(){this.cyclePause=1},function(){this.cyclePause=0})}D.fn.cycle.transitions.fade(I,J,H);J.each(function(){var M=D(this);this.cycleH=(H.fit&&H.height)?H.height:M.height();this.cycleW=(H.fit&&H.width)?H.width:M.width()});J.not(":eq("+K+")").css({opacity:0});if(H.cssFirst){D(J[K]).css(H.cssFirst)}if(H.timeout){if(H.speed.constructor==String){H.speed={slow:600,fast:200}[H.speed]||400}if(!H.sync){H.speed=H.speed/2}while((H.timeout-H.speed)<250){H.timeout+=H.speed}}H.speedIn=H.speed;H.speedOut=H.speed;H.slideCount=G.length;H.currSlide=K;H.nextSlide=1;var L=J[K];if(H.before.length){H.before[0].apply(L,[L,L,H,true])}if(H.after.length>1){H.after[1].apply(L,[L,L,H,true])}if(H.click&&!H.next){H.next=H.click}if(H.next){D(H.next).bind("click",function(){return C(G,H,H.rev?-1:1)})}if(H.prev){D(H.prev).bind("click",function(){return C(G,H,H.rev?1:-1)})}if(H.timeout){this.cycleTimeout=setTimeout(function(){B(G,H,0,!H.rev)},H.timeout+(H.delay||0))}})};function B(J,E,I,K){if(E.busy){return }var H=J[0].parentNode,M=J[E.currSlide],L=J[E.nextSlide];if(H.cycleTimeout===0&&!I){return }if(I||!H.cyclePause){if(E.before.length){D.each(E.before,function(N,O){O.apply(L,[M,L,E,K])})}var F=function(){if(D.browser.msie){this.style.removeAttribute("filter")}D.each(E.after,function(N,O){O.apply(L,[M,L,E,K])})};if(E.nextSlide!=E.currSlide){E.busy=1;D.fn.cycle.custom(M,L,E,F)}var G=(E.nextSlide+1)==J.length;E.nextSlide=G?0:E.nextSlide+1;E.currSlide=G?J.length-1:E.nextSlide-1}if(E.timeout){H.cycleTimeout=setTimeout(function(){B(J,E,0,!E.rev)},E.timeout)}}function C(E,F,I){var H=E[0].parentNode,G=H.cycleTimeout;if(G){clearTimeout(G);H.cycleTimeout=0}F.nextSlide=F.currSlide+I;if(F.nextSlide<0){F.nextSlide=E.length-1}else{if(F.nextSlide>=E.length){F.nextSlide=0}}B(E,F,1,I>=0);return false}D.fn.cycle.custom=function(K,H,I,E){var J=D(K),G=D(H);G.css({opacity:0});var F=function(){G.animate({opacity:1},I.speedIn,I.easeIn,E)};J.animate({opacity:0},I.speedOut,I.easeOut,function(){J.css({display:"none"});if(!I.sync){F()}});if(I.sync){F()}};D.fn.cycle.transitions={fade:function(F,G,E){G.not(":eq(0)").css("opacity",0);E.before.push(function(){D(this).show()})}};D.fn.cycle.ver=function(){return A};D.fn.cycle.defaults={timeout:4000,speed:1000,next:null,prev:null,before:null,after:null,height:"auto",sync:1,fit:0,pause:0,delay:0,slideExpr:null}})(jQuery); \ No newline at end of file diff --git a/wolnelektury/static/js/jquery.eventdelegation.js b/apps/wolnelektury_core/static/js/jquery.eventdelegation.js similarity index 100% rename from wolnelektury/static/js/jquery.eventdelegation.js rename to apps/wolnelektury_core/static/js/jquery.eventdelegation.js diff --git a/wolnelektury/static/js/jquery.form.js b/apps/wolnelektury_core/static/js/jquery.form.js similarity index 100% rename from wolnelektury/static/js/jquery.form.js rename to apps/wolnelektury_core/static/js/jquery.form.js diff --git a/wolnelektury/static/js/jquery.highlightfade.js b/apps/wolnelektury_core/static/js/jquery.highlightfade.js similarity index 100% rename from wolnelektury/static/js/jquery.highlightfade.js rename to apps/wolnelektury_core/static/js/jquery.highlightfade.js diff --git a/wolnelektury/static/js/jquery.jqmodal.js b/apps/wolnelektury_core/static/js/jquery.jqmodal.js similarity index 100% rename from wolnelektury/static/js/jquery.jqmodal.js rename to apps/wolnelektury_core/static/js/jquery.jqmodal.js diff --git a/wolnelektury/static/js/jquery.js b/apps/wolnelektury_core/static/js/jquery.js similarity index 100% rename from wolnelektury/static/js/jquery.js rename to apps/wolnelektury_core/static/js/jquery.js diff --git a/wolnelektury/static/js/jquery.scrollto.js b/apps/wolnelektury_core/static/js/jquery.scrollto.js similarity index 100% rename from wolnelektury/static/js/jquery.scrollto.js rename to apps/wolnelektury_core/static/js/jquery.scrollto.js diff --git a/wolnelektury/static/js/locale.js b/apps/wolnelektury_core/static/js/locale.js similarity index 100% rename from wolnelektury/static/js/locale.js rename to apps/wolnelektury_core/static/js/locale.js diff --git a/wolnelektury/static/js/modernizr.custom.19652.js b/apps/wolnelektury_core/static/js/modernizr.custom.19652.js similarity index 100% rename from wolnelektury/static/js/modernizr.custom.19652.js rename to apps/wolnelektury_core/static/js/modernizr.custom.19652.js diff --git a/wolnelektury/static/js/ordered_select_multiple.js b/apps/wolnelektury_core/static/js/ordered_select_multiple.js similarity index 100% rename from wolnelektury/static/js/ordered_select_multiple.js rename to apps/wolnelektury_core/static/js/ordered_select_multiple.js diff --git a/wolnelektury/static/js/search.js b/apps/wolnelektury_core/static/js/search.js similarity index 100% rename from wolnelektury/static/js/search.js rename to apps/wolnelektury_core/static/js/search.js diff --git a/wolnelektury/static/js/widget.js b/apps/wolnelektury_core/static/js/widget.js similarity index 100% rename from wolnelektury/static/js/widget.js rename to apps/wolnelektury_core/static/js/widget.js diff --git a/wolnelektury/static/js/widgetInit.js b/apps/wolnelektury_core/static/js/widgetInit.js similarity index 100% rename from wolnelektury/static/js/widgetInit.js rename to apps/wolnelektury_core/static/js/widgetInit.js diff --git a/wolnelektury/static/opensearch.xml b/apps/wolnelektury_core/static/opensearch.xml similarity index 100% rename from wolnelektury/static/opensearch.xml rename to apps/wolnelektury_core/static/opensearch.xml diff --git a/wolnelektury/static/widget.html b/apps/wolnelektury_core/static/widget.html similarity index 100% rename from wolnelektury/static/widget.html rename to apps/wolnelektury_core/static/widget.html diff --git a/apps/wolnelektury_core/templates/socialaccount/snippets/provider_list.html b/apps/wolnelektury_core/templates/socialaccount/snippets/provider_list.html index 3ca849360..1361d7018 100644 --- a/apps/wolnelektury_core/templates/socialaccount/snippets/provider_list.html +++ b/apps/wolnelektury_core/templates/socialaccount/snippets/provider_list.html @@ -1,24 +1,20 @@ +{% load static from staticfiles %} {% load allauth_tags %} {% load common_tags %} {% if allauth.openid_enabled %}
  • - Google
  • + Google {% endif %} {% if allauth.facebook_enabled %}
  • + Facebook {% endif %} {% if allauth.twitter_enabled %}
  • + Twitter {% endif %} {% if allauth.openid_enabled %} - -
  • - OpenID
  • - + OpenID {% endif %} diff --git a/apps/wolnelektury_core/templates/superbase.html b/apps/wolnelektury_core/templates/superbase.html index 2f933da53..79542ecfc 100644 --- a/apps/wolnelektury_core/templates/superbase.html +++ b/apps/wolnelektury_core/templates/superbase.html @@ -1,6 +1,7 @@ {% load cache compressed i18n %} + {% load static from staticfiles %} {% load catalogue_tags reporting_stats sponsor_tags %} @@ -16,10 +17,13 @@ {% block title %}{% trans "Wolne Lektury" %} :: {% block titleextra %}{% endblock %}{% endblock %} - - + + {% compressed_css "all" %} - {% compressed_css "screen" %} + + + {#% compressed_css "handheld" %#} @@ -38,7 +42,7 @@
    @@ -185,7 +189,7 @@
    -

    * {% trans "Loading" %}

    +

    * {% trans "Loading" %}

    @@ -213,7 +217,6 @@ {% block extrabody %} {% endblock %} - - + diff --git a/requirements.txt b/requirements.txt index 98deab79d..fb64d9501 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,11 @@ --find-links=http://www.pythonware.com/products/pil/ # django -Django>=1.3,<1.4 +Django>=1.4,<1.5 South>=0.7 # migrations for django +django-pipeline>=1.2 django-pagination>=1.0 -#django-rosetta>=0.5.3 -django-maintenancemode>=0.9 +django-maintenancemode>=0.10 django-piston django-jsonfield django-picklefield diff --git a/wolnelektury.vhost.template b/wolnelektury.vhost.template index 7d4455730..b077499ad 100644 --- a/wolnelektury.vhost.template +++ b/wolnelektury.vhost.template @@ -18,15 +18,8 @@ Allow from all - Alias /admin-media %(path)s/admin-media - - Options Indexes - Order allow,deny - Allow from all - - - Alias /static %(path)s/releases/current/%(project_name)s/static - + Alias /static %(path)s/releases/current/static + Options Indexes Order allow,deny Allow from all diff --git a/wolnelektury/settings/__init__.py b/wolnelektury/settings/__init__.py index be82e3d0b..f2314a9ad 100644 --- a/wolnelektury/settings/__init__.py +++ b/wolnelektury/settings/__init__.py @@ -53,7 +53,6 @@ INSTALLED_APPS_OUR = [ 'dictionary', 'infopages', 'lesmianator', - #'lessons', 'newtagging', 'opds', 'pdcounter', @@ -74,7 +73,9 @@ INSTALLED_APPS_CONTRIB = [ 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.admindocs', + 'django.contrib.staticfiles', 'pagination', + 'pipeline', 'piston', 'piwik.django', #'rosetta', @@ -96,7 +97,6 @@ INSTALLED_APPS_CONTRIB = [ #'allauth.twitter', # included - 'compress', 'modeltranslation', ] diff --git a/wolnelektury/settings/static.py b/wolnelektury/settings/static.py index 77aa92f28..8dcdf8f3b 100644 --- a/wolnelektury/settings/static.py +++ b/wolnelektury/settings/static.py @@ -4,7 +4,7 @@ from settings.paths import PROJECT_DIR # Absolute path to the directory that holds media. # Example: "/home/media/media.lawrence.com/" MEDIA_ROOT = path.join(PROJECT_DIR, '../media/') -STATIC_ROOT = path.join(PROJECT_DIR, 'static/') +STATIC_ROOT = path.join(PROJECT_DIR, '../static/') SEARCH_INDEX = path.join(PROJECT_DIR, '../search_index/') # URL that handles the media served from MEDIA_ROOT. Make sure to use a @@ -13,15 +13,10 @@ SEARCH_INDEX = path.join(PROJECT_DIR, '../search_index/') MEDIA_URL = '/media/' STATIC_URL = '/static/' -# 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/' - # CSS and JavaScript file groups -COMPRESS_CSS = { +PIPELINE_CSS = { 'all': { - #'source_filenames': ('css/master.css', 'css/jquery.autocomplete.css', 'css/master.plain.css', 'css/facelist_2-0.css',), + # styles both for mobile and for big screen 'source_filenames': [ 'css/jquery.countdown.css', @@ -33,47 +28,40 @@ COMPRESS_CSS = { 'css/picture_box.css', 'css/book_box.css', 'css/catalogue.css', - 'css/sponsors.css', + 'sponsors/css/sponsors.css', 'css/auth.css', 'css/social/shelf_tags.css', 'css/ui-lightness/jquery-ui-1.8.16.custom.css', ], - 'output_filename': 'css/all.min?.css', - }, - 'screen': { - 'source_filenames': ['css/screen.css'], - 'output_filename': 'css/screen.min?.css', - 'extra_context': { - 'media': 'screen and (min-width: 800px)', - }, + 'output_filename': 'css/compressed/all.css', }, 'ie': { 'source_filenames': [ 'css/ie.css', ], - 'output_filename': 'css/ie.min?.css', + 'output_filename': 'css/compressed/ie.css', }, 'book': { 'source_filenames': [ 'css/master.book.css', ], - 'output_filename': 'css/book.min?.css', + 'output_filename': 'css/compressed/book.css', }, 'player': { 'source_filenames': [ 'jplayer/jplayer.blue.monday.css', - 'css/player.css', + 'player/player.css', ], - 'output_filename': 'css/player.min?.css', + 'output_filename': 'css/compressed/player.css', }, 'simple': { 'source_filenames': ('css/simple.css',), - 'output_filename': 'css/simple.min?.css', + 'output_filename': 'css/compressed/simple.css', }, } -COMPRESS_JS = { +PIPELINE_JS = { 'base': { 'source_filenames': ( 'js/jquery.cycle.min.js', @@ -88,32 +76,33 @@ COMPRESS_JS = { 'js/locale.js', 'js/dialogs.js', - 'js/sponsors.js', 'js/base.js', - 'js/pdcounter.js', + 'pdcounter/pdcounter.js', + 'sponsors/js/sponsors.js', 'js/search.js', ), - 'output_filename': 'js/base?.min.js', + 'output_filename': 'js/base.min.js', }, 'player': { 'source_filenames': [ 'jplayer/jquery.jplayer.min.js', 'jplayer/jplayer.playlist.min.js', - 'js/player.js', + 'player/player.js', ], - 'output_filename': 'js/player.min?.js', + 'output_filename': 'js/player.min.js', }, 'book': { 'source_filenames': ('js/jquery.eventdelegation.js', 'js/jquery.scrollto.js', 'js/jquery.highlightfade.js', 'js/book.js',), - 'output_filename': 'js/book?.min.js', + 'output_filename': 'js/book.min.js', }, 'book_ie': { 'source_filenames': ('js/ierange-m2.js',), - 'output_filename': 'js/book_ie?.min.js', + 'output_filename': 'js/book_ie.min.js', } } -COMPRESS_VERSION = True -COMPRESS_CSS_FILTERS = None +STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage' +PIPELINE_CSS_COMPRESSOR = None +PIPELINE_JS_COMPRESSOR = None diff --git a/wolnelektury/static/css/facelist_2-0.css b/wolnelektury/static/css/facelist_2-0.css deleted file mode 100644 index 9f9ddc441..000000000 --- a/wolnelektury/static/css/facelist_2-0.css +++ /dev/null @@ -1,182 +0,0 @@ -.facelist-selections a { - color: black; - text-decoration: none; -} -.facelist-selections a:hover { - color: black; - text-decoration: none; -} -ul.facelist-selections { - list-style-type: none; - border-top: 1px solid #888; - border-bottom: 1px solid #b6b6b6; - border-left: 1px solid #aaa; - border-right: 1px solid #aaa; - padding: 4px 0 4px 4px; - overflow: auto; - background-color: #fff; - box-shadow:inset 0 1px 2px #888; - -webkit-box-shadow:inset 0 1px 2px #888; - -moz-box-shadow:inset 0 1px 2px #888; - width: 90%; -} - -ul.facelist-selections.loading { - background-color: #eee; -} - -ul.facelist-selections li { - float: left; - margin: 1px 4px 1px 0; - padding-top: 20px; - margin-left: 10px; -} - -ul.facelist-selections li.facelist-selection-item { - color:white; - position: relative; - background-color: #fbc11d; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; - -webkit-transition: background-color .2s ease-in; - cursor: pointer; - padding:2px 5px 2px 5px; - font-size: 13px; - font-family: "Lucida Grande", arial, sans-serif; -} - -ul.facelist-selections li.facelist-selection-item:last-child { - margin-left: 30px; -} - -ul.facelist-selections li.facelist-selection-item a.facelist-close { - float: right; - margin: 1px 0 0 7px; - padding: 0 2px; - cursor: pointer; - color: black; - font-family: "Helvetica", helvetica, arial, sans-serif; - font-size: 14px; - font-weight: bold; - -webkit-transition: color .1s ease-in; -} - -ul.facelist-selections li.facelist-selection-item.blur a.facelist-close { - color: #999; -} - -ul.facelist-selections li:hover.facelist-selection-item { - background-color: #d8dfea; -} - -ul.facelist-selections li.facelist-selection-item.selected { - background-color: #5670a6; - color: #fff; -} - -ul.facelist-selections li.facelist-original { - margin-left: 0; -} - -ul.facelist-selections li.facelist-original input { - border: none; - outline: none; - font-size: 13px; - width: 120px; - height: 18px; - padding-top: 3px; -} - -ul.facelist-list { - position: absolute; - list-style-type: none; - margin: 2px 0 0 0; - padding: 0; - font-size: 14px; - color: #000; - font-family: "Lucida Grande", arial, sans-serif; - background-color: #fff; - z-index: 2; - border: solid #ccd5e4 1px; -} - -li.facelist-result-item, li.facelist-message { - margin: 0 0 0 0; - padding: 5px 12px; - background-color: transparent; - border: 1px solid #fff; - border-bottom: 1px solid #ddd; - cursor: pointer; -} - -li:first-child.facelist-result-item { - margin: 0; -} - -li.facelist-message { - margin: 0; - cursor: default; -} - -li.facelist-result-item.active { - background-color: #3b5998; - border-color: #3342e8; - color: #fff; -} - -li.facelist-result-item em { - font-style: normal; - background: #dbe1ec; - padding: 0 2px; -} - -li.facelist-result-item.active em { - background: #5670a6; - color: #fff; -} - -/* Firefox 3.0 Hacks */ -ul.facelist-list, x:-moz-any-link, x:default { - border: 1px solid #888; -} -BODY:first-of-type ul.facelist-list, x:-moz-any-link, x:default { /* Target FF 3.5+ */ - border: none; -} - -/* Webkit Hacks */ -@media screen and (-webkit-min-device-pixel-ratio:0) { - ul.facelist-selections { - border-top-width: 2px; - } - ul.facelist-selections li.facelist-selection-item { - padding-top: 3px; - padding-bottom: 3px; - } - ul.facelist-selections li.facelist-selection-item a.facelist-close { - margin-top: -1px; - } - ul.facelist-selections li.facelist-original input { - height: 19px; - } -} - -/* Opera Hacks */ -@media all and (-webkit-min-device-pixel-ratio:10000), not all and (-webkit-min-device-pixel-ratio:0) { - ul.facelist-list { - border: 1px solid #888; - } - ul.facelist-selections li.facelist-selection-item a.facelist-close { - margin-left: 4px; - margin-top: 0; - } -} - -/* IE Hacks */ -ul.facelist-list { - border: 1px solid #888\9; -} -ul.facelist-selections li.facelist-selection-item a.facelist-close { - margin-left: 4px\9; - margin-top: 0\9; -} diff --git a/wolnelektury/static/css/s5/framing.css b/wolnelektury/static/css/s5/framing.css deleted file mode 100644 index 14d8509e9..000000000 --- a/wolnelektury/static/css/s5/framing.css +++ /dev/null @@ -1,23 +0,0 @@ -/* The following styles size, place, and layer the slide components. - Edit these if you want to change the overall slide layout. - The commented lines can be uncommented (and modified, if necessary) - to help you with the rearrangement process. */ - -/* target = 1024x768 */ - -div#header, div#footer, .slide {width: 100%; top: 0; left: 0;} -div#header {top: 0; height: 3em; z-index: 1;} -div#footer {top: auto; bottom: 0; height: 2.5em; z-index: 5;} -.slide {top: 0; width: 92%; padding: 3.5em 4% 4%; z-index: 2; list-style: none;} -div#controls {left: 50%; bottom: 0; width: 50%; z-index: 100;} -div#controls form {position: absolute; bottom: 0; right: 0; width: 100%; - margin: 0;} -#currentSlide {position: absolute; width: 10%; left: 45%; bottom: 1em; z-index: 10;} -html>body #currentSlide {position: fixed;} - -/* -div#header {background: #FCC;} -div#footer {background: #CCF;} -div#controls {background: #BBD;} -div#currentSlide {background: #FFC;} -*/ diff --git a/wolnelektury/static/css/s5/opera.css b/wolnelektury/static/css/s5/opera.css deleted file mode 100644 index 9e9d2a3c5..000000000 --- a/wolnelektury/static/css/s5/opera.css +++ /dev/null @@ -1,7 +0,0 @@ -/* DO NOT CHANGE THESE unless you really want to break Opera Show */ -.slide { - visibility: visible !important; - position: static !important; - page-break-before: always; -} -#slide0 {page-break-before: avoid;} diff --git a/wolnelektury/static/css/s5/outline.css b/wolnelektury/static/css/s5/outline.css deleted file mode 100644 index 14f6bc48f..000000000 --- a/wolnelektury/static/css/s5/outline.css +++ /dev/null @@ -1,16 +0,0 @@ -/* don't change this unless you want the layout stuff to show up in the outline view! */ - -.layout div, #footer *, #controlForm * {display: none;} -#footer, #controls, #controlForm, #navLinks, #toggle { - display: block; visibility: visible; margin: 0; padding: 0;} -#toggle {float: right; padding: 0.5em;} -html>body #toggle {position: fixed; top: 0; right: 0;} - -/* making the outline look pretty-ish */ - -#slide0 h1, #slide0 h2, #slide0 h3, #slide0 h4 {border: none; margin: 0;} -#slide0 h1 {padding-top: 1.5em;} -.slide h1 {margin: 1.5em 0 0; padding-top: 0.25em; - border-top: 1px solid #888; border-bottom: 1px solid #AAA;} -#toggle {border: 1px solid; border-width: 0 0 1px 1px; background: #FFF;} -#presentation { text-align: center; } diff --git a/wolnelektury/static/css/s5/pretty.css b/wolnelektury/static/css/s5/pretty.css deleted file mode 100644 index ab0dbeec4..000000000 --- a/wolnelektury/static/css/s5/pretty.css +++ /dev/null @@ -1,86 +0,0 @@ -/* Following are the presentation styles -- edit away! */ - -body {background: #FFF url(bodybg.gif) -16px 0 no-repeat; color: #000; font-size: 2em;} -:link, :visited {text-decoration: none; color: #00C;} -#controls :active {color: #88A !important;} -#controls :focus {outline: 1px dotted #227;} -h1, h2, h3, h4 {font-size: 100%; margin: 0; padding: 0; font-weight: inherit;} -ul, pre {margin: 0; line-height: 1em;} -html, body {margin: 0; padding: 0;} - -blockquote, q {font-style: italic;} -blockquote {padding: 0 2em 0.5em; margin: 0 1.5em 0.5em; text-align: center; font-size: 1em;} -blockquote p {margin: 0;} -blockquote i {font-style: normal;} -blockquote b {display: block; margin-top: 0.5em; font-weight: normal; font-size: smaller; font-style: normal;} -blockquote b i {font-style: italic;} - -kbd {font-weight: bold; font-size: 1em;} -sup {font-size: smaller; line-height: 1px;} - -.slide code {padding: 2px 0.25em; font-weight: bold; color: #533;} -.slide code.bad, code del {color: red;} -.slide code.old {color: silver;} -.slide pre {padding: 0; margin: 0.25em 0 0.5em 0.5em; color: #533; font-size: 90%;} -.slide pre code {display: block;} -.slide ul {margin-left: 5%; margin-right: 7%; list-style: disc;} -.slide li {margin-top: 0.75em; margin-right: 0;} -.slide ul ul {line-height: 1;} -.slide ul ul li {margin: .2em; font-size: 85%; list-style: square;} -.slide img.leader {display: block; margin: 0 auto;} - -div#header, div#footer {background: #ffffff; color: black; - font-family: Verdana, Helvetica, sans-serif;} -div#header {background: #ffffff - line-height: 1px;} -div#footer {font-size: 0.5em; font-weight: bold; padding: 1em 0;} -#footer h1, #footer h2 {display: block; padding: 0 1em;} -#footer h2 {font-style: italic;} - -div.long {font-size: 0.75em;} -.slide h1 {position: absolute; top: 0.7em; left: 87px; z-index: 1; - margin: 0; padding: 0.3em 0 0 50px; white-space: nowrap; - font: bold 150%/1em Helvetica, sans-serif; text-transform: capitalize; - color: #DDE; background: #005;} -.slide h3 {font-size: 130%;} -h1 abbr {font-variant: small-caps;} - -div#controls {position: absolute; left: 50%; bottom: 0; - width: 50%; - text-align: right; font: bold 0.9em Verdana, Helvetica, sans-serif;} -html>body div#controls {position: absolute; padding: 0 0 1em 0; - top: auto; left:0; width:500px;} -div#controls form {position: absolute; bottom: 0; right: 0; width: 100%; - margin: 0; padding: 0;} -#controls #navLinks a {padding: 0; margin: 0 0.5em; - background: #005; border: none; color: #779; - cursor: pointer;} -#controls #navList {height: 1em;} -#controls #navList #jumplist {position: absolute; bottom: 0; left: 10px; background: #DDD; color: #227; width: 300px;} - -#currentSlide {text-align: center; font-size: 0.5em; color: #449;} - -#slide0 {padding-top: 3.5em; font-size: 90%;} -#slide0 h1 {position: static; margin: 1em 0 0; padding: 0; - font: bold 2em Helvetica, sans-serif; white-space: normal; - color: #000; background: transparent;} -#slide0 h2 {font: bold italic 1em Helvetica, sans-serif; margin: 0.25em;} -#slide0 h3 {margin-top: 1.5em; font-size: 1.5em;} -#slide0 h4 {margin-top: 0; font-size: 1em;} - -ul.urls {list-style: none; display: inline; margin: 0;} -.urls li {display: inline; margin: 0;} -.note {display: none;} -.external {border-bottom: 1px dotted gray;} -html>body .external {border-bottom: none;} -.external:after {content: " \274F"; font-size: smaller; color: #77B;} - -.incremental, .incremental *, .incremental *:after {color: #DDE; visibility: visible;} -img.incremental {visibility: hidden;} -.slide .current {color: #B02;} - - -/* diagnostics - -li:after {content: " [" attr(class) "]"; color: #F88;} - */ diff --git a/wolnelektury/static/css/s5/print.css b/wolnelektury/static/css/s5/print.css deleted file mode 100644 index e7a71d145..000000000 --- a/wolnelektury/static/css/s5/print.css +++ /dev/null @@ -1 +0,0 @@ -/* The following rule is necessary to have all slides appear in print! DO NOT REMOVE IT! */ .slide, ul {page-break-inside: avoid; visibility: visible !important;} h1 {page-break-after: avoid;} body {font-size: 12pt; background: white;} * {color: black;} #slide0 h1 {font-size: 200%; border: none; margin: 0.5em 0 0.25em;} #slide0 h3 {margin: 0; padding: 0;} #slide0 h4 {margin: 0 0 0.5em; padding: 0;} #slide0 {margin-bottom: 3em;} h1 {border-top: 2pt solid gray; border-bottom: 1px dotted silver;} .extra {background: transparent !important;} div.extra, pre.extra, .example {font-size: 10pt; color: #333;} ul.extra a {font-weight: bold;} p.example {display: none;} #header {display: none;} #footer h1 {margin: 0; border-bottom: 1px solid; color: gray; font-style: italic;} #footer h2, #controls {display: none;} /* The following rule keeps the layout stuff out of print. Remove at your own risk! */ .layout, .layout * {display: none !important;} \ No newline at end of file diff --git a/wolnelektury/static/css/s5/s5-core.css b/wolnelektury/static/css/s5/s5-core.css deleted file mode 100644 index 86444e041..000000000 --- a/wolnelektury/static/css/s5/s5-core.css +++ /dev/null @@ -1,9 +0,0 @@ -/* Do not edit or override these styles! The system will likely break if you do. */ - -div#header, div#footer, div#controls, .slide {position: absolute;} -html>body div#header, html>body div#footer, - html>body div#controls, html>body .slide {position: fixed;} -.handout {display: none;} -.layout {display: block;} -.slide, .hideme, .incremental {visibility: hidden;} -#slide0 {visibility: visible;} diff --git a/wolnelektury/static/css/s5/slides.css b/wolnelektury/static/css/s5/slides.css deleted file mode 100644 index 0786d7dbd..000000000 --- a/wolnelektury/static/css/s5/slides.css +++ /dev/null @@ -1,3 +0,0 @@ -@import url(s5-core.css); /* required to make the slide show run at all */ -@import url(framing.css); /* sets basic placement and size of slide components */ -@import url(pretty.css); /* stuff that makes the slides look better than blah */ \ No newline at end of file diff --git a/wolnelektury/static/infobar/infobar.css b/wolnelektury/static/infobar/infobar.css deleted file mode 100644 index fbab95163..000000000 --- a/wolnelektury/static/infobar/infobar.css +++ /dev/null @@ -1,4 +0,0 @@ -/*Based on No IE Information Bar 0.2.6 by Martin Ng , modified by Kornel Lesinski. Under license:http://creativecommons.org/licenses/by-nc/2.0/legalcode*/ -@media screen{#viewplot{ -padding:0; /* << Tutaj ustaw margines jak dla */ -width:100%;height:95%;overflow:auto;height:expression(this.parentNode.offsetHeight-this.offsetTop);position:relative}html{border-top:0;border-left:0;border-bottom:0;overflow:hidden;height:100%}body{margin:0;padding:0;overflow:hidden;height:100%}#infobar{width:100%;font:normal 8pt/1 "MS Sans Serif"}#infobar a{display:block;font:message-box;zoom:1;color:InfoText;background:InfoBackground url(infobar.gif) no-repeat fixed .33em .2em;padding:.45em .3em .45em 2.3em;border-bottom:.16em outset;text-align:left;text-decoration:none;cursor:default}#infobar a{font-size:8pt;letter-spacing:0}#infobar a:hover{color:HighlightText;background-color:Highlight}}#infobar b{position:absolute;right:5px;top:3px;font-size:11px;font-family:webdings;cursor:hand}@media print{#infobar{display:none}} \ No newline at end of file diff --git a/wolnelektury/static/infobar/infobar.gif b/wolnelektury/static/infobar/infobar.gif deleted file mode 100644 index 12b74741f22a8aa5fa9c51cfc977f3edd5416414..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 247 zcmV4?$iRr#KlE9W#GUb?Zy%>m862><{8A^8LW0018VEC2ui01yBW000Ga;3tlsL7u1am?)||nbwj{@C3~~ zDuD+_x*C81!RdIzVgZP92m*w}Az(yJo*qkq>cONa0zn24eh6};t6(5FtOXBGW#j;} xI|REK{h18@0!eFZ5_1k5e{2L67m0reA{Psj3lf%;5*rpH5eS~2ppYLS06X-8W+4Co diff --git a/wolnelektury/static/infobar/infobar.js b/wolnelektury/static/infobar/infobar.js deleted file mode 100644 index b2e75caea..000000000 --- a/wolnelektury/static/infobar/infobar.js +++ /dev/null @@ -1,2 +0,0 @@ -/*Based on No IE Information Bar 0.2.9 by Martin Ng , Ching Yonghan, modified by Kornel Lesinski. Under license: http://creativecommons.org/licenses/by-nc/2.0/legalcode*/ -(function(){if (!infobar||!viewplot)return;if(Math.random()*10>(infobar.s||10) || document.cookie.indexOf('browsehappyinfobar=0')>=0){infobar.style.display='none';return}infobar.innerHTML='r'+infobar.innerHTML;infobar.onclick=function(){infobar.all.tags("a")[0].innerHTML='Trwa otwieranie strony informacyjnej...'};if (!infobar.offsetHeight) return;var I=infobar.runtimeStyle,V=viewplot.runtimeStyle;I.top=infobar.offsetHeight*-1;I.left=V.top=V.left=0;V.position=I.position="absolute";var T=setInterval(function(){var N=parseInt(infobar.currentStyle.top),M=-N;if(M>0){M=M>5?5:M;I.top=N+M;V.top=parseInt(V.top)+M}else{clearInterval(T);I.position=V.position="";V.top='0'}},40)})() diff --git a/wolnelektury/static/js/catalogue.js b/wolnelektury/static/js/catalogue.js deleted file mode 100644 index 485780692..000000000 --- a/wolnelektury/static/js/catalogue.js +++ /dev/null @@ -1,603 +0,0 @@ -var STATIC = '/static/'; -var LOCALE_TEXTS = { - "pl": { - "DELETE_SHELF": "Czy na pewno usunąć półkę", - "HIDE_DESCRIPTION": "Zwiń opis", - "EXPAND_DESCRIPTION": "Rozwiń opis", - "LOADING": "Ładowanie" - }, - "de": { - "DELETE_SHELF": "Möchtest du wirklich dieses Bücherregal entfernen?", - "HIDE_DESCRIPTION": "Beschreibung zuklappen", - "EXPAND_DESCRIPTION": "Beschreibung aufklappen", - "LOADING": "Herunterladen" - }, - "fr": { - "DELETE_SHELF": "Voulez-vous supprimer l'étagère définitivement?", - "HIDE_DESCRIPTION": "Montrer la description", - "EXPAND_DESCRIPTION": "Cacher la description", - "LOADING": "Chargement" - }, - "en": { - "DELETE_SHELF": "Are you sure you want to delete this shelf?", - "HIDE_DESCRIPTION": "Hide", - "EXPAND_DESCRIPTION": "Expand", - "LOADING": "Loading" - }, - "ru": { - "DELETE_SHELF": "Уверены ли вы том, чтобы удалить полку?", - "HIDE_DESCRIPTION": "Свернуть описание", - "EXPAND_DESCRIPTION": "Раскрыть описание", - "LOADING": "Загрузка" - }, - "es": { - "DELETE_SHELF": "¿Estás seguro que quieres borrar este estante?", - "HIDE_DESCRIPTION": "Esconder la descripción", - "EXPAND_DESCRIPTION": "Ampliar la descripción", - "LOADING": "Cargando" - }, - "lt":{ - "DELETE_SHELF": "Ar tikrai nori pašalinti lentną?", - "HIDE_DESCRIPTION": "Suvyniok aprašymą ", - "EXPAND_DESCRIPTION": "Išplėsk aprašymą", - "LOADING": "Krovimas" - }, - "uk":{ - "DELETE_SHELF": "Ви впевнені, що хочете видалити полицю?", - "HIDE_DESCRIPTION": "Сховати опис", - "EXPAND_DESCRIPTION": "Показати опис", - "LOADING": "Завантажується" - } -} -var BANNER_TEXTS = [ - 'Przekaż 1% żeby ukryć ten baner.', - 'Jak dobrze wydać 1% swojego podatku? Poradnik dla opornych.', - 'Wiadomość systemowa: wystąpił błąd brak funduszy. Wykonaj procedurę 1%.', - 'FREE! Wygraj darmowe lektury!', - 'Confidential business offer. Not scam! 1% for you.', - 'Biblioteka Wolne Lektury wymaga aktualizacji. Kliknij dalej.', - '1000 lektur. 1 procent.', - '1% dla biblioteki lektur szkolnych. 1% dla Twojej biblioteki.', - '1% na lektury szkolne.', - '1% dla wolności lektur szkolnych.', - 'Podaruj Jeden Procent na rzecz szkolnej biblioteki internetowej.', - '1% podatku dla biblioteki szkolnej Wolne Lektury.', - '1% na rzecz darmowego dostępu do szkolnych lektur.', - 'Żeby czytać teksty a nie skany. Przekaż 1%.', - 'Czytaj teksty a nie skany. Przekaż 1%', - 'Motyw artysty w literaturze - 47 cytatów. Pomóż znaleźć następne.', - 'Twój 1% uwolni więcej lektur.', - 'Ponad 400 motywów, blisko 10 000 000 cytatów. Pomóż znaleźć następne. Przekaż swój 1%.', - 'Twój 1% uwolni lektury.', - 'Rozlicz swój PIT z Wolnymi Lekturami. Skorzystaj z darmowego programu do rozliczania podatków.', - 'Lektury 2010: Pan Tadeusz, Trylogia.', - 'Pan Tadeusz też chce być w Internecie! Przekaż 1% swojego podatku.', - 'Pomóż uwolnić 286 utworów z listy lektur szkolnych. Przekaż swój 1% na Wolne Lektury.' -] - -function changeBannerText() { - var index = Math.floor(Math.random() * BANNER_TEXTS.length); - if (BANNER_TEXTS[index] == $('#onepercent-text').html()) { - // try again - changeBannerText(); - } else { - $('#onepercent-text').fadeOut('slow', function() { - $(this).html(BANNER_TEXTS[index]); - $(this).fadeIn('slow'); - }); - - setTimeout(changeBannerText, 30 * 1000); - } -} - -function autocomplete_format_item(ul, item) { - return $("
  • ").data('item.autocomplete', item) - .append(''+item.label+ ' ('+item.category+')') - .appendTo(ul); -} - -function autocomplete_result_handler(event, ui) { - if (ui.item.url != undefined) { - location.href = ui.item.url; - } else { - $(event.target).closest('form').submit(); - } -} - -function serverTime() { - var time = null; - $.ajax({url: '/katalog/zegar/', - async: false, dataType: 'text', - success: function(text) { - time = new Date(text); - }, error: function(http, message, exc) { - time = new Date(); - }}); - return time; -} - -(function($) { - $(function() { - - $.fn.toggle_slide = function(p) { - cont = $(this); - short_el = p['short_el'] || $(':first-child', this); - long_el = p['long_el'] || short_el.next(); - button = p['button']; - short_text = p['short_text'], - long_text = p['long_text']; - - var toggle_fun = function(cont, short_el, long_el, button, short_text, long_text) { - var toggle = function() { - if (cont.hasClass('short')) { - cont.animate({"height": long_el.attr("cont_h")+'px'}, {duration: "fast" }).removeClass('short'); - short_el.hide(); - long_el.show(); - if (button && long_text) button.html(long_text); - } else { - cont.animate({"height": short_el.attr("cont_h")+'px'}, {duration: "fast" }).addClass('short'); - long_el.hide(); - short_el.show(); - if (button && short_text) button.html(short_text); - } - return false; - } - return toggle; - } - if (long_el.html().length <= short_el.html().length) - return; - - // ensure long element shown first - long_el.show();short_el.hide(); - long_el.attr("cont_h", $(this).height()).hide(); - short_el.show().attr("cont_h", $(this).height()); - $(this).addClass('short'); - - if (button && short_text) button.html(short_text); - if (button) button.hover( - function() { $(this).css({background: '#F3F3F3', cursor: 'pointer'}); }, - function() { $(this).css({background: '#EEE'}); } - ).click(toggle_fun(cont, short_el, long_el, button, short_text, long_text)); - short_el.hover( - function() { $(this).css({background: '#F3F3F3', cursor: 'pointer'}); }, - function() { $(this).css({background: '#FFF'}); } - ).click(toggle_fun(cont, short_el, long_el, button, short_text, long_text)); - long_el.hover( - function() { $(this).css({background: '#F3F3F3', cursor: 'pointer'}); }, - function() { $(this).css({background: '#FFF'}); } - ).click(toggle_fun(cont, short_el, long_el, button, short_text, long_text)); - }; - - $('form input').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-short-text').each(function() { - var fragment = $(this).closest('.fragment'); - fragment.toggle_slide({ - short_el: $(this), - long_el: fragment.find('.fragment-text') - }) - }); - - $('.show-all-tags').click(function() { - $(this).parent().parent().fadeOut(function() { - $(this).next().fadeIn(); - }); - return false; - }); - - $('.hide-all-tags').click(function() { - $(this).parent().parent().fadeOut(function() { - $(this).prev().fadeIn(); - }); - return false; - }); - - $('#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(); - } - }); - - $('ul.shelf-list li').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() { - var link = $(this); - var shelf_name = $('.visit-shelf', link.parent()).text(); - if (confirm(LOCALE_TEXTS[LANGUAGE_CODE]['DELETE_SHELF']+ ' '+ shelf_name + '?')) { - $.post(link.attr('href'), function(data, textStatus) { - link.parent().remove(); - }); - } - return false; - }); - - var serverResponse; - $('#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) { - $('form', hash.w).ajaxForm({ - target: serverResponse, - success: function(serverResponse) { - var newShelf = $.parseJSON(serverResponse); - $('#user-shelves-window div.target').html(newShelf.msg); - setTimeout(function() { $('#user-shelves-window').jqmHide() }, 1000); - } - }); - - $('input', hash.w).labelify({labelledClass: 'blur'}); - - $('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() { - var link = $(this); - var shelf_name = $('.visit-shelf', link.parent()).text(); - if (confirm(LOCALE_TEXTS[LANGUAGE_CODE]['DELETE_SHELF'] + ' ' + shelf_name + '?')) { - $.post(link.attr('href'), function(data, textStatus) { - link.parent().remove(); - }); - } - return false; - }); - } - }); - - $('#suggest-window').jqm({ - ajax: '@href', - target: $('#suggest-window div.target')[0], - overlay: 60, - trigger: '#suggest-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) { - $('form', hash.w).ajaxForm({ - dataType: 'json', - target: $('#suggest-window div.target'), - success: function(response) { - if (response.success) { - $('#suggest-window div.target').text(response.message); - setTimeout(function() { $('#suggest-window').jqmHide() }, 1000) - } - else { - $('#suggest-form .error').remove(); - $.each(response.errors, function(id, errors) { - $('#suggest-form #id_' + id).before('' + errors[0] + ''); - }); - $('#suggest-form input[type=submit]').removeAttr('disabled'); - return false; - } - } - }); - } - }); - - $('#suggest-publishing-window').jqm({ - ajax: '@data-ajax', - target: $('#suggest-publishing-window div.target')[0], - overlay: 60, - trigger: '#suggest-publishing-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) { - $('form', hash.w).each(function() {this.action += '?ajax=1';}); - $('form', hash.w).ajaxForm({ - dataType: 'json', - target: $('#suggest-publishing-window div.target'), - success: function(response) { - if (response.success) { - $('#suggest-publishing-window div.target').text(response.message); - setTimeout(function() { $('#suggest-publishing-window').jqmHide() }, 1000) - } - else { - $('#suggest-publishing-form .error').remove(); - $.each(response.errors, function(id, errors) { - $('#suggest-publishing-form #id_' + id).before('' + errors[0] + ''); - }); - $('#suggest-publishing-form input[type=submit]').removeAttr('disabled'); - return false; - } - } - }); - } - }); - - (function($this) { - $form = $('form', $this); - $form.each(function() {this.action += '?ajax=1';}); - $form.ajaxForm({ - dataType: 'json', - target: $this, - success: function(response) { - if (response.success) { - $this.text(response.message); - } - else { - $('.error', $form).remove(); - $.each(response.errors, function(id, errors) { - $('#id_' + id, $form).before('' + errors[0] + ''); - }); - $('input[type=submit]', $form).removeAttr('disabled'); - return false; - } - } - }); - })($('.block-form')); - - $('#books-list .book').hover( - function() { $(this).css({background: '#F3F3F3', cursor: 'pointer'}); }, - function() { $(this).css({background: '#FFF'}); } - ).click(function() { - location.href = $('h2 a', this).attr('href'); - }); - - $('#description').each(function(){$(this).toggle_slide({ - long_el: $('#description-long', this), - short_el: $('#description-short', this), - button: $(this).nextAll('#toggle-description').first().find('p'), - long_text: LOCALE_TEXTS[LANGUAGE_CODE]['HIDE_DESCRIPTION'] + ' ▲', - short_text: LOCALE_TEXTS[LANGUAGE_CODE]['EXPAND_DESCRIPTION'] + ' ▼' - })}); - - $('#toggle-share-shelf').hover( - function() { $(this).css({background: '#F3F3F3', cursor: 'pointer'}); }, - function() { $(this).css({background: '#EEE'}); } - ).click(function() { - if ($('#share-shelf').hasClass('hidden')) { - $('#share-shelf').slideDown('fast').removeClass('hidden'); - } else { - $('#share-shelf').slideUp('fast').addClass('hidden'); - } - }); - - var target = $('#set-window div.target'); - - $('#set-window').jqm({ - ajax: '@href', - target: target[0], - overlay: 60, - trigger: 'a.jqm-trigger', - onShow: function(hash) { - var offset = $(hash.t).offset(); - target.html('

    '+LOCALE_TEXTS[LANGUAGE_CODE]['DELETE_SHELF']+'

    '); - hash.w.css({position: 'absolute', left: offset.left, top: offset.top}).show() }, - onLoad: function(hash) { - try { - $('#createShelfTrigger').click(function(){ - // who cares it's not needed, but I was looking for it - // that's why I want it to stay.. :) - // var slug = $(hash.t).attr('href').split("/")[3]; - $('#createNewShelf').show(); - }); - } catch (e){} - var serverResponse; - $('form', hash.w).ajaxForm({ - target: serverResponse, - success: function(serverResponse) { - var newShelf = $.parseJSON(serverResponse); - // for live shelf adding - if(newShelf.name){ - var noIds = $("#putOnShelf ol ul").children('li').length; - $("#putOnShelf ol ul").prepend('
  • '); - $("#createNewShelf ol input[name=name]").val(""); - } - if(newShelf.after == "close"){ - setTimeout(function() {$('#set-window').jqmHide();}, 1000); - } - } - }); - } - }); - - $('a.remove-from-shelf').click(function(event) { - event.preventDefault(); - link = $(this); - $.post(link.attr('href'), function(data, textStatus) { - link.parent().remove(); - }); - }); - - $('#share-shelf').hide().addClass('hidden'); - $('#share-shelf input').focus(function(){this.select();}); - - $('#user-info').show(); - changeBannerText(); - $('#onepercent-banner').show(); - - var formatsDownloaded = false; - $('#download-shelf').click(function() { - $('#download-shelf-menu').slideDown('fast'); - - if (!formatsDownloaded) { - // Get info about the formats - formatsDownloaded = true; - $.ajax({ - url: $('#download-formats-form').attr('data-formats-feed'), - type: 'GET', - dataType: 'json', - complete: function() { - $('#download-formats-form-submit').attr('disabled', null); - $('#download-formats-form-submit-li img').remove(); - $('#updating-formats').fadeOut('fast', function() { - $('#formats-updated').fadeIn('fast'); - }); - }, - success: function(data) { - $('#download-formats-form li').each(function() { - var item = $(this); - if (!!item.attr('data-format') && !data[item.attr('data-format')]) { - item.fadeOut('fast', function() { - item.remove(); - }); - } - }); - } - }); - } - return false; - }); - - $('#download-formats-form-cancel').click(function() { - $('#download-shelf-menu').slideUp('fast'); - return false; - }); - - $('.sponsor-logos').cycle({timeout: 3000}); - - $('.widget-code').focus( - function(){ - $(this).animate({rows: '11'}, 100, function(){ - this.select(); - $(this).click(function(){ - this.select(); - }); - }) - - } - ).blur( - function(){ - $(this).animate({rows: '1'}, 300, function(){ - $(this).unbind('click'); - }) - } - ); - - $('.book-list-index').click(function(){ - $('.book-list-show-index').hide('slow'); - if($(this).parent().next('ul:not(:hidden)').length == 0){ - $(this).parent().next('ul').toggle('slow'); - } - return false; - }); - - // player for audiobooks - - // event handlers for playing different formats - $('.audiotabs span').click(function(){ - $('.audiobook-list').hide(); - $('.audiotabs .active').removeClass('active'); - // we don't want to interact with "audiobook" label, just 'format' tabs - var $this = $(this); - $this.addClass("active"); - $("#"+$this.attr('data-format')+"-files").show(); - }); - - $('.audiobook-list').hide(); - if($(".audiotabs .active").length > 0) { - $("#"+$(".audiotabs .active").html().toLowerCase()+"-files").show(); - } - - /* this will be useful for javascript html player - var medias = $('.audiobook-list a'); - var mp3List = []; - var oggList = []; - var daisyList = []; - var tmpExt; - if (medias.length > 0) { - // creating sources list for player - medias.each(function(index, item) { - tmpExt = item.href.split(".").pop(); - if(tmpExt == "mp3") { - mp3List.push(item.href); - } else if (tmpExt == "ogg") { - oggList.push(item.href); - } else if(tmpExt == "daisy") { - daisyList.push(item.href); - } - }); - }*/ - $("#custom-pdf-link").toggle( - function(ev) { $(".custom-pdf").show(); return false; }, - function(ev) { $(".custom-pdf").hide(); return false; } - ); - }); -})(jQuery) - diff --git a/wolnelektury/static/js/slides.js b/wolnelektury/static/js/slides.js deleted file mode 100644 index c602054ab..000000000 --- a/wolnelektury/static/js/slides.js +++ /dev/null @@ -1,559 +0,0 @@ -// S5 v1.1 slides.js -- released into the Public Domain -// -// Please see http://www.meyerweb.com/eric/tools/s5/credits.html for information -// about all the wonderful and talented contributors to this code! - -var undef; -var slideCSS = ''; -var snum = 0; -var smax = 1; -var incpos = 0; -var number = undef; -var s5mode = true; -var defaultView = 'slideshow'; -var controlVis = 'visible'; - -var isIE = navigator.appName == 'Microsoft Internet Explorer' && navigator.userAgent.indexOf('Opera') < 1 ? 1 : 0; -var isOp = navigator.userAgent.indexOf('Opera') > -1 ? 1 : 0; -var isGe = navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('Safari') < 1 ? 1 : 0; - -function hasClass(object, className) { - if (!object.className) return false; - return (object.className.search('(^|\\s)' + className + '(\\s|$)') != -1); -} - -function hasValue(object, value) { - if (!object) return false; - return (object.search('(^|\\s)' + value + '(\\s|$)') != -1); -} - -function removeClass(object,className) { - if (!object) return; - object.className = object.className.replace(new RegExp('(^|\\s)'+className+'(\\s|$)'), RegExp.$1+RegExp.$2); -} - -function addClass(object,className) { - if (!object || hasClass(object, className)) return; - if (object.className) { - object.className += ' '+className; - } else { - object.className = className; - } -} - -function GetElementsWithClassName(elementName,className) { - var allElements = document.getElementsByTagName(elementName); - var elemColl = new Array(); - for (var i = 0; i< allElements.length; i++) { - if (hasClass(allElements[i], className)) { - elemColl[elemColl.length] = allElements[i]; - } - } - return elemColl; -} - -function isParentOrSelf(element, id) { - if (element == null || element.nodeName=='BODY') return false; - else if (element.id == id) return true; - else return isParentOrSelf(element.parentNode, id); -} - -function nodeValue(node) { - var result = ""; - if (node.nodeType == 1) { - var children = node.childNodes; - for (var i = 0; i < children.length; ++i) { - result += nodeValue(children[i]); - } - } - else if (node.nodeType == 3) { - result = node.nodeValue; - } - return(result); -} - -function slideLabel() { - var slideColl = GetElementsWithClassName('*','slide'); - var list = document.getElementById('jumplist'); - smax = slideColl.length; - for (var n = 0; n < smax; n++) { - var obj = slideColl[n]; - - var did = 'slide' + n.toString(); - obj.setAttribute('id',did); - if (isOp) continue; - - var otext = ''; - var menu = obj.firstChild; - if (!menu) continue; // to cope with empty slides - while (menu && menu.nodeType == 3) { - menu = menu.nextSibling; - } - if (!menu) continue; // to cope with slides with only text nodes - - var menunodes = menu.childNodes; - for (var o = 0; o < menunodes.length; o++) { - otext += nodeValue(menunodes[o]); - } - otext = otext.substr(0,15) + '...'; - list.options[list.length] = new Option(n + ' : ' + otext, n); - } -} -/* -function currentSlide() { - var cs; - if (document.getElementById) { - cs = document.getElementById('currentSlide'); - } else { - cs = document.currentSlide; - } - cs.innerHTML = '' + snum + '<\/span> ' + - '\/<\/span> ' + - '' + (smax-1) + '<\/span>'; - if (snum == 0) { - cs.style.visibility = 'hidden'; - } else { - cs.style.visibility = 'visible'; - } -}*/ - -function go(step) { - if (document.getElementById('slideProj').disabled || step == 0) return; - var jl = document.getElementById('jumplist'); - var cid = 'slide' + snum; - var ce = document.getElementById(cid); - if (incrementals[snum].length > 0) { - for (var i = 0; i < incrementals[snum].length; i++) { - removeClass(incrementals[snum][i], 'current'); - removeClass(incrementals[snum][i], 'incremental'); - } - } - if (step != 'j') { - snum += step; - lmax = smax - 1; - if (snum > lmax) snum = lmax; - if (snum < 0) snum = 0; - } else - snum = parseInt(jl.value); - var nid = 'slide' + snum; - var ne = document.getElementById(nid); - if (!ne) { - ne = document.getElementById('slide0'); - snum = 0; - } - if (step < 0) {incpos = incrementals[snum].length} else {incpos = 0;} - if (incrementals[snum].length > 0 && incpos == 0) { - for (var i = 0; i < incrementals[snum].length; i++) { - if (hasClass(incrementals[snum][i], 'current')) - incpos = i + 1; - else - addClass(incrementals[snum][i], 'incremental'); - } - } - if (incrementals[snum].length > 0 && incpos > 0) - addClass(incrementals[snum][incpos - 1], 'current'); - ce.style.visibility = 'hidden'; - ne.style.visibility = 'visible'; - jl.selectedIndex = snum; - //currentSlide(); - number = 0; -} - -function goTo(target) { - if (target >= smax || target == snum) return; - go(target - snum); -} - -function subgo(step) { - if (step > 0) { - removeClass(incrementals[snum][incpos - 1],'current'); - removeClass(incrementals[snum][incpos], 'incremental'); - addClass(incrementals[snum][incpos],'current'); - incpos++; - } else { - incpos--; - removeClass(incrementals[snum][incpos],'current'); - addClass(incrementals[snum][incpos], 'incremental'); - addClass(incrementals[snum][incpos - 1],'current'); - } -} - -function toggle() { - var slideColl = GetElementsWithClassName('*','slide'); - var slides = document.getElementById('slideProj'); - var outline = document.getElementById('outlineStyle'); - var controls = document.getElementById('controls'); - if (!slides.disabled) { - slides.disabled = true; - outline.disabled = false; - s5mode = false; - fontSize('1em'); - for (var n = 0; n < smax; n++) { - var slide = slideColl[n]; - slide.style.visibility = 'visible'; - } - document.getElementById("toggle").value = "Lista slajdów"; - addClass(controls, 'hideme'); - showHide('h'); - } else { - slides.disabled = false; - outline.disabled = true; - s5mode = true; - fontScale(); - for (var n = 0; n < smax; n++) { - var slide = slideColl[n]; - slide.style.visibility = 'hidden'; - } - slideColl[snum].style.visibility = 'visible'; - document.getElementById("toggle").value = "Ciągły tekst"; - showHide('s'); - } -} - -function showHide(action) { - var obj = GetElementsWithClassName('*','hideme')[0]; - switch (action) { - case 's': obj.style.visibility = 'visible'; break; - case 'h': obj.style.visibility = 'hidden'; break; - case 'k': - if (obj.style.visibility != 'visible') { - obj.style.visibility = 'visible'; - } else { - obj.style.visibility = 'hidden'; - } - break; - } -} - -// 'keys' code adapted from MozPoint (http://mozpoint.mozdev.org/) -function keys(key) { - if (!key) { - key = event; - key.which = key.keyCode; - } - if (key.which == 84) { - toggle(); - return; - } - if (s5mode) { - switch (key.which) { - case 10: // return - case 13: // enter - if (window.event && isParentOrSelf(window.event.srcElement, 'controls')) return; - if (key.target && isParentOrSelf(key.target, 'controls')) return; - if(number != undef) { - goTo(number); - break; - } - case 32: // spacebar - case 34: // page down - case 39: // rightkey - case 40: // downkey - if(number != undef) { - go(number); - } else if (!incrementals[snum] || incpos >= incrementals[snum].length) { - go(1); - } else { - subgo(1); - } - break; - case 33: // page up - case 37: // leftkey - case 38: // upkey - if(number != undef) { - go(-1 * number); - } else if (!incrementals[snum] || incpos <= 0) { - go(-1); - } else { - subgo(-1); - } - break; - case 36: // home - goTo(0); - break; - case 35: // end - goTo(smax-1); - break; - case 67: // c - showHide('k'); - break; - } - if (key.which < 48 || key.which > 57) { - number = undef; - } else { - if (window.event && isParentOrSelf(window.event.srcElement, 'controls')) return; - if (key.target && isParentOrSelf(key.target, 'controls')) return; - number = (((number != undef) ? number : 0) * 10) + (key.which - 48); - } - } - return false; -} - -function clicker(e) { - number = undef; - var target; - if (window.event) { - target = window.event.srcElement; - e = window.event; - } else target = e.target; - if (target.getAttribute('href') != null || hasValue(target.rel, 'external') || isParentOrSelf(target, 'controls') || isParentOrSelf(target,'embed') || isParentOrSelf(target,'object')) return true; - if (!e.which || e.which == 1) { - if (!incrementals[snum] || incpos >= incrementals[snum].length) { - go(1); - } else { - subgo(1); - } - } -} - -function findSlide(hash) { - var target = null; - var slides = GetElementsWithClassName('*','slide'); - for (var i = 0; i < slides.length; i++) { - var targetSlide = slides[i]; - if ( (targetSlide.name && targetSlide.name == hash) - || (targetSlide.id && targetSlide.id == hash) ) { - target = targetSlide; - break; - } - } - while(target != null && target.nodeName != 'BODY') { - if (hasClass(target, 'slide')) { - return parseInt(target.id.slice(5)); - } - target = target.parentNode; - } - return null; -} - -function slideJump() { - if (window.location.hash == null) return; - var sregex = /^#slide(\d+)$/; - var matches = sregex.exec(window.location.hash); - var dest = null; - if (matches != null) { - dest = parseInt(matches[1]); - } else { - dest = findSlide(window.location.hash.slice(1)); - } - if (dest != null) - go(dest - snum); -} - -function fixLinks() { - var thisUri = window.location.href; - thisUri = thisUri.slice(0, thisUri.length - window.location.hash.length); - var aelements = document.getElementsByTagName('A'); - for (var i = 0; i < aelements.length; i++) { - var a = aelements[i].href; - var slideID = a.match('\#slide[0-9]{1,2}'); - if ((slideID) && (slideID[0].slice(0,1) == '#')) { - var dest = findSlide(slideID[0].slice(1)); - if (dest != null) { - if (aelements[i].addEventListener) { - aelements[i].addEventListener("click", new Function("e", - "if (document.getElementById('slideProj').disabled) return;" + - "go("+dest+" - snum); " + - "if (e.preventDefault) e.preventDefault();"), true); - } else if (aelements[i].attachEvent) { - aelements[i].attachEvent("onclick", new Function("", - "if (document.getElementById('slideProj').disabled) return;" + - "go("+dest+" - snum); " + - "event.returnValue = false;")); - } - } - } - } -} - -function externalLinks() { - if (!document.getElementsByTagName) return; - var anchors = document.getElementsByTagName('a'); - for (var i=0; i<\/select><\/div>'; - /*if (controlVis == 'hidden') { - var hidden = document.getElementById('navLinks'); - } else { - var hidden = document.getElementById('jumplist'); - } - addClass(hidden,'hideme');*/ - document.getElementById("toggle").onclick = toggle; -} - -function fontScale() { // causes layout problems in FireFox that get fixed if browser's Reload is used; same may be true of other Gecko-based browsers - if (!s5mode) return false; - var vScale = 22; // both yield 32 (after rounding) at 1024x768 - var hScale = 32; // perhaps should auto-calculate based on theme's declared value? - if (window.innerHeight) { - var vSize = window.innerHeight; - var hSize = window.innerWidth; - } else if (document.documentElement.clientHeight) { - var vSize = document.documentElement.clientHeight; - var hSize = document.documentElement.clientWidth; - } else if (document.body.clientHeight) { - var vSize = document.body.clientHeight; - var hSize = document.body.clientWidth; - } else { - var vSize = 700; // assuming 1024x768, minus chrome and such - var hSize = 1024; // these do not account for kiosk mode or Opera Show - } - var newSize = Math.min(Math.round(vSize/vScale),Math.round(hSize/hScale)); - fontSize(newSize + 'px'); - if (isGe) { // hack to counter incremental reflow bugs - var obj = document.getElementsByTagName('body')[0]; - obj.style.display = 'none'; - obj.style.display = 'block'; - } -} - -function fontSize(value) { - if (!(s5ss = document.getElementById('s5ss'))) { - if (!isIE) { - document.getElementsByTagName('head')[0].appendChild(s5ss = document.createElement('style')); - s5ss.setAttribute('media','screen, projection'); - s5ss.setAttribute('id','s5ss'); - } else { - document.createStyleSheet(); - document.s5ss = document.styleSheets[document.styleSheets.length - 1]; - } - } - if (!isIE) { - while (s5ss.lastChild) s5ss.removeChild(s5ss.lastChild); - s5ss.appendChild(document.createTextNode('body {font-size: ' + value + ' !important;}')); - } else { - document.s5ss.addRule('body','font-size: ' + value + ' !important;'); - } -} - -function notOperaFix() { - slideCSS = document.getElementById('slideProj').href; - var slides = document.getElementById('slideProj'); - var outline = document.getElementById('outlineStyle'); - slides.setAttribute('media','screen'); - outline.disabled = true; - if (isGe) { - slides.setAttribute('href','null'); // Gecko fix - slides.setAttribute('href',slideCSS); // Gecko fix - } - if (isIE && document.styleSheets && document.styleSheets[0]) { - document.styleSheets[0].addRule('img', 'behavior: url(ui/default/iepngfix.htc)'); - document.styleSheets[0].addRule('div', 'behavior: url(ui/default/iepngfix.htc)'); - document.styleSheets[0].addRule('.slide', 'behavior: url(ui/default/iepngfix.htc)'); - } -} - -function getIncrementals(obj) { - var incrementals = new Array(); - if (!obj) - return incrementals; - var children = obj.childNodes; - for (var i = 0; i < children.length; i++) { - var child = children[i]; - if (hasClass(child, 'incremental')) { - if (child.nodeName == 'OL' || child.nodeName == 'UL') { - removeClass(child, 'incremental'); - for (var j = 0; j < child.childNodes.length; j++) { - if (child.childNodes[j].nodeType == 1) { - addClass(child.childNodes[j], 'incremental'); - } - } - } else { - incrementals[incrementals.length] = child; - removeClass(child,'incremental'); - } - } - if (hasClass(child, 'show-first')) { - if (child.nodeName == 'OL' || child.nodeName == 'UL') { - removeClass(child, 'show-first'); - if (child.childNodes[isGe].nodeType == 1) { - removeClass(child.childNodes[isGe], 'incremental'); - } - } else { - incrementals[incrementals.length] = child; - } - } - incrementals = incrementals.concat(getIncrementals(child)); - } - return incrementals; -} - -function createIncrementals() { - var incrementals = new Array(); - for (var i = 0; i < smax; i++) { - incrementals[i] = getIncrementals(document.getElementById('slide'+i)); - } - return incrementals; -} - -function defaultCheck() { - var allMetas = document.getElementsByTagName('meta'); - for (var i = 0; i< allMetas.length; i++) { - if (allMetas[i].name == 'defaultView') { - defaultView = allMetas[i].content; - } - if (allMetas[i].name == 'controlVis') { - controlVis = allMetas[i].content; - } - } -} - -// Key trap fix, new function body for trap() -function trap(e) { - if (!e) { - e = event; - e.which = e.keyCode; - } - try { - modifierKey = e.ctrlKey || e.altKey || e.metaKey; - } - catch(e) { - modifierKey = false; - } - return modifierKey || e.which == 0; -} - -function startup() { - defaultCheck(); - if (!isOp) - createControls(); - slideLabel(); - fixLinks(); - externalLinks(); - fontScale(); - if (!isOp) { - notOperaFix(); - incrementals = createIncrementals(); - slideJump(); - if (defaultView == 'outline') { - toggle(); - } - document.onkeyup = keys; - document.onkeypress = trap; - document.onclick = clicker; - } -} - -window.onload = startup; -window.onresize = function(){setTimeout('fontScale()', 50);} diff --git a/wolnelektury/static/player.swf b/wolnelektury/static/player.swf deleted file mode 100644 index b2fde336551eab9146fcf5e99328700d317523b8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6887 zcmVvTU+k`ID@|X}1`|LKC?dgi2^JM~tJ1X4LYmUj($+je3n>IBrSwJ1 zqfL3Xr4QV5&b;rvD=BHeugw>)?#%piX6BqTXU?3Ndrz~(cNt?JWo%P|4LFzJzt$GW zU?U0m+0(fNe&J~(n;i)zP6YW}{f3cZFq^CG3+jalcBwPxA^6N!61$jLkj)n><3W*S z8@W=o7&LOMN~MrdDB+)4rP5&eT*J?uZX7D)r*rkj{#>;&&8R$EnqU*P9Mn5dsy1ei zR!$aj1I0p>Rmum-ja=7*h*P*>rqXTJD5`)lLG$^n{Q!m!gE|_c;2NaAO3nt zH!(clhG{pAn&zd5MoVVCm3is3qqDq>sOb7Y%4>zEH9l1(6sHKdHUkF@w5Qncd?W#fhY;Dzpj*^W)!e#F&m#`o5G`1r>3J&XDp>51fT!u%vraNJ}Ej43?{u{1lwG$HSO%r*^);TY}cXr>+Td;K5^ooS)p zkilU;`amLPA`Tk*)S>h#Bq3gKW3z%QGoiuJ*ftqsBelU!d{pxOJyD}_lQ14SzeDGP zwMa8JNe#Dg9Hd=J5AyOhS*|EzkJ}{58VAwhiXdzzNp7PPvCG5rU3|D8PO?zm&fPs+ zB3(ivN<}R}G47WngkRD}en}$gm+a3?1vAA4cqaF_2tRX)^)b6h`6lFpoa76gUi^v` zSY&rv-i-DD__9Axfi*7I;BEq6hD(KFv9Jpr629zD0ht=RiQQtZ@?%&mJO{P38w)s< zt3@0NhW6jg3X?Y*3v#7AYV|-nSjzcnzGfdzM%HY%mnHR@J;~&=+e=qmX7wh zE*uz`G>3%3&awG+7!6tQ^hjUJ!>F+h>y*I^drbs zRP-)4IY@rQAfHt>&NXoE;GkU3)~Yf03zM~uI~4}sw}(qKwX81uAscaKzDX_1oTg-MI#2#eH97RfO!(q1*ME_Hr5 ziO@40iOZSJR+gwfU8yxDW*T+2w^jpdk}Z@Ajl(&32qq?QD%aWY_`SJ_hGB{-WdIzj zGK7JB7^qAdHXxXsJW{APa%J3WL1I)iU~O{5mP~FV6&30B4R?Xos)B$$ryY62>MW zjSVUFIdaW;Hf$(TykbkgWpzwr;|h)1!5(00sc-35o{Qsok$D9EzC^ZC>uWM(lD365 z1z`|hL6zR&#-$Z)PC|p))imgsgH;X;2F@f9G6^_YJqXOC<)NDyyDHouNT04#b@#B@ zoi0-HZp$&`d22JYt?}gsgIfm6yslTh(ne)Nl=@`~wsARFkAkgNFd-bA;hS*SsqMI# zXHkhTYND%&pvt!^C#I%`SH^UD!P( zhsi?U8npv`yL-fhPl^e@l_q@BobYmD9}P|yV9tN(0HV*_wI-dgO4PK+S$;gI)%nvt zAd~0e0!pI?vTvr*!2LX>an_j`qcG{r^iX-KVy3zI6*=Sd=k~%RI48o$fYmuQS}aVW z4VbACUW(9VZ2Z*G-laMbrPCGiQeT`ICWjvir!e7RD~-9BAtpn=C$7=>~MrVB;D;;#>Opw5CuqgDW!!ebdjUnhg& z4EmNiR4C@pl*WPK1JG8D?WuvjDpla|LZ4Ep)?ytF)h%1gq+>Hmic_U@hoJ)6Nh+$6X7-Z^R!tYP}rlQ ziey4Ug*A1bhRWaolqYbD!L4vyv{u8LhHS@k`9k?1c;c*BDCfp1ELWbSBr*YOVMhoK z^9pxc;NfVoIzVW+DRj2|cmXmYyEb0*0qjGr$ zl=Ad+T{Jl}Ugr~7EJh)A@l0Zv00_zRgp{3bTlo)l4CR7pCJu8$> zkTFj{PM0cNx?}^iWGRUh#)I0vJU-NNI7jrfl=e&25owwLr)ed?%9tzxlfXVfN?4yl z5xXN+|60Im<18Pr{5U|^_&5s!7L21H$M6_t3dG3w5;!49>FB{cxR9NR+lB zXJe)aeS<>9*>0hwGTJ(6v0BQjrIX6|j3!`7ZX7i@C9 z6~3k8C2RN96WTY@!B9(&+PEGTG<(G!h~ijlL~K{45qk(*>tHf&&r9{zDB*36Ybm{o zmIirR1nRf=dC?M~xA?1U$?KW#W^PM*8%D)N!Pbn(9I-PMM=e(MMaW{5eY8o{o6M?Q zB9~LB@638&o)JmnWmm)!zvj6RA6zBz=SMk_PM6{`KNQXM(kJ3FpI8kex5aj6C`3=r z>Fry^(S;FZxk|=%uh!ufCeQ6sJJ_cw8vVSj{9I3mBp*#Eve%knm>qMSXw%X=m@|oc zuCc^?5^Wi;^%*w5j(OMdP|6EL1lxNdg*L9wNc|H4D&c_vJr!J>cWpdIJE8*wZqmEK zr-}0_3`Ti3iZFu9&u55Eie>_jHStpx-l z#fIG8q~-QQ{hYZi7;gDtagv(!euS?|D8c#+ZNu3u3FNnf^*?0VrKA={azqmYwfj-( z=`Hjt1oIkUXN)2@NzX5#-UKZ!`<7$k(y8NtbVCaZG+ZLHAHYCq}QVD*bf_CdMXCE5K!`xhe8qkFUf*bWA$UK)j~ei!Hr$Va4;%1d8$J>Pf0+S) znGMgxz()=Es0|;BfgdyA$87lV82If5{B|3DM-2Ss2K?nV{LUEoT?YIv8-8~T{2l{- zj}3oC3_NSVvo`#dA^2W^2L?Q_;Tz481RY> zuf{O)RR;W3HoRuQ>Xb>$#ow>e6Rz5bc=^5<4l~RGxWC-VyW-Q#a34 zp7zG;gg-4eg-3jKO~)|-vj%|v9yTwNX^i%$R|N39`y}DK(bGdLg5$&dF`M8i^Tt(P z56kiHC#T?gXMPj&e%$*B?kweVB!(hx~_UQ8zMzK_j-bA4sRnp1&4`y`E8C47bl1+)i;++sbljWwH%Jimr)% zU5peJ{nlkjE0C-eqYIIibbnT(EM`9}6^hVZFNT(i$Rs9p!yRagPIkRrATVAQD zju!6A)!DZbeCjVg!`J@``gKExp zi@c;=6w)7u_}UhM&BnphO*!*+pT@VV7Mo)_y7LD@8Qw70i|6y?+^h3>9vJ>C?Z}hdI(IN5{AXN5bcB|?k+=JVH!vNUev>j3e^BKms7H_1r ze{%mSN}!0pQmtY#WZ&KhI<8&FddF z>k9%YCB}Cv}<3d!7gh?)s zVJl&@s2Acyy;46T&Vz|LWArn%im`aB7>oDZ$Fi`J+Ab`wwhJq%?ZOIb+oII=`w8=W z>Kh`p7**oMI3<2h6D3}ZRpLdX!y0Jmbzc*`UX0c2#TdQ*r8vD_T!mgQu0j_USD_1w zO?6>0P8Swe(uKw4bzyNOU07T}7t%@>798{3@oge?A*u@(;&kDco9M!YSY5cFI^5w~ zjuxz&YxPO0=xw{EWvR=yCh9Wg+kTR)$+_?=hQGy{V9xMOhboS4I!yHIINFiL8rTfI zT@<55gaxp@f5jSo#!9J;STpo`Ln)h$4=}CEVP*|sEw7^&n&_x}8XS%iidEJNO_Ws= zvM=2xcd)m&m|FWfky_GPyIW}OQk>TQY7?zpB6C6>?f<)A!_up825jAyl^- zR3ZHSmh2$Ud~CTIk40(#_H2q-ZN5{jHtU6z|G+Kc?Ub|nmChxaSs&z2uy=Y~23zEI z&LsKU>NNiKbgFxky2gPtrLVvT`-FFsNI$02T8?~M$&UhmC-U;4S^A-j4r~rF)dWn_ zC*t70OK14MH`tWgAZ{4Dncde9i!5iz|p89HbMkKTvVh zr1uen#5F6D_z01ZAYR081gI0r*y`~6hjzt3vR|7z}SrEXy-E}9%rPSwSzgU$VV88*>?i$wRlFFh^E z`OasFzi4=54@3H6O+2!TA2(hC*5-H>=pRVm~5m>AM9q&(x2`B0IUA~f-U2xu)v;R{{DDQ~n zCH{WeHx9ha;*-J;Hs0)QdIOTbKbK#p-{lS6W^AX-4)tcdYusWKo&8uO&dLqI2XG*f zi6|<4Jn}j%9|ElF>a}3H`$5t6qx>HBd(+(bJr!sC{;Y}dadfC1{iE*vS7z>>%Kt6sbDUK@UFWcW02W0fi!-tUJ8|Jcq zI*z@c3$vFbbeQM8(p>ePHlsPAvB=Uh%a2IHR*-`Ui%KIzgqeA2NAPsq-g#J+fs6Zj z;Yi3V={v`3;TK}GP+U3Vn^t=IbDRPmKB4lT@I~T_#vn-+Df_^N>OLeK_f+%@C}o}j zNeJ}!FNCw5Qo*<{iFC8mpSzo!{!pcP}LVe^$^>f^h_8u3N(cfa4J3c9&iQfh&DHPvG>BvS&bmoLXvo)5S zDwgq>*) z5q&Y>8|J+oZty-2e$hXwJyXbUk>3y@%&>gWFYp8SMPeq_sDXdt+gG_uemWFjcsk^E zJfmE%2NJfg6u!x^M&9Hw{fs51yayorIr=^8^UI~KwN40WxA8BkMJgTk!=FY|FH(fF zzLx1A=SF{(iO;Wp&e-k^WPL$7IneA~EQVCGR@JcIoRGsN*YZgpj_fL9A9aD*vKFt<)=^ml0cd3Lr9(5x5i{X63 z^F#ObnP%?mM%9^qvojmb&MY+P%(+mbf@Gf}IcJjW;}uz4Z=ZEjrYc|r%~0H47Sa>& zF3xlBLVYJsE_KJ58E`wRVrpmob$UTSqL*9159r_rEmH+=hHR-iD~}+8qGu?iHO{cz_ zkvH4F*R;k)tH!^m8voj~MxRyV-&Bq7n>DWF7gWqoR&BQG{ky97A7;H5>bLe_%>S8U z!|DwX@4swm{6P2BKZ|QH{5Rjuyh}neTUkOf{`(rx!CDiEDB^n-!ihorhlNPSAiiTE zTpQ7Cf9Iq%m5|?KJ4~OK6QQ~z=?ywDlD_}``(+{{d~ZsO;dVhLj;EPU+(ElLk+?H` z=FAzHxI4|Bc}6B)VG?+yAV50bk&;iH>ZwaTwW$yL_42DiJh4TLAx%o$+9E-%>CGC{ z%`YACM3o#ckvL(FxyfLP-oT$U+DWG h^ja<&2KmtJE7009600|4t|&cwgPT
    ').appendTo(input.parent()); - var groups = $.evalJSON(input.val()); - - var unusedDiv = $('
    ') - .appendTo(container) - .append('

    dostępni sponsorzy

    '); - var unusedList = $('
      ') - .appendTo(unusedDiv) - .sortable({ - connectWith: '.sponsors-sponsor-group-list' - }); - - // Edit group name inline - function editNameInline(name) { - name.unbind('click.sponsorsFooter'); - var inlineInput = $('').val(name.html()); - name.html(''); - - function endEditing() { - name.html(inlineInput.val()); - inlineInput.remove(); - name.bind('click.sponsorsFooter', function() { - editNameInline($(this)); - }); - input.parents('form').unbind('submit.sponsorsFooter', endEditing); - return false; - } - - inlineInput.appendTo(name).focus().blur(endEditing); - input.parents('form').bind('submit.sponsorsFooter', endEditing); - } - - // Remove sponsor with passed id from sponsors array and return it - function popSponsor(id) { - for (var i=0; i < settings.sponsors.length; i++) { - if (settings.sponsors[i].id == id) { - var s = settings.sponsors[i]; - settings.sponsors.splice(i, 1); - return s; - } - } - return null; - } - - // Create sponsor group and bind events - function createGroup(name, sponsors) { - if (!sponsors) { - sponsors = []; - } - - var groupDiv = $('
      '); - - $('X') - .click(function() { - groupDiv.fadeOut('slow', function() { - $('.sponsors-sponsor', groupDiv).hide().appendTo(unusedList).fadeIn(); - groupDiv.remove(); - }); - }).appendTo(groupDiv); - - $('

      ' + name + '

      ') - .bind('click.sponsorsFooter', function() { - editNameInline($(this)); - }).appendTo(groupDiv); - - var groupList = $('
        ') - .appendTo(groupDiv) - .sortable({ - connectWith: '.sponsors-sponsor-group-list' - }); - - - for (var i = 0; i < sponsors.length; i++) { - $('
      1. ' + sponsors[i].name + '
      2. ') - .data('obj_id', sponsors[i].id) - .appendTo(groupList); - } - return groupDiv; - } - - // Create groups from data in input value - for (var i = 0; i < groups.length; i++) { - var group = groups[i]; - var sponsors = []; - - for (var j = 0; j < group.sponsors.length; j++) { - var s = popSponsor(group.sponsors[j]); - if (s) { - sponsors.push(s); - } - } - createGroup(group.name, sponsors).appendTo(container); - } - - // Serialize input value before submiting form - input.parents('form').submit(function(event) { - var groups = []; - $('.sponsors-sponsor-group', container).not('.sponsors-unused-sponsor-group').each(function() { - var group = {name: $('.sponsors-sponsor-group-name', this).html(), sponsors: []}; - $('.sponsors-sponsor', this).each(function() { - group.sponsors.push($(this).data('obj_id')); - }); - groups.push(group); - }); - input.val($.toJSON(groups)); - }); - - for (i = 0; i < settings.sponsors.length; i++) { - $('
      3. ' + settings.sponsors[i].name + '
      4. ') - .data('obj_id', settings.sponsors[i].id) - .appendTo(unusedList); - } - - $('') - .click(function() { - var newGroup = createGroup('').appendTo(container); - editNameInline($('.sponsors-sponsor-group-name', newGroup)); - }).prependTo(input.parent()); - - input.parent().append('
        '); - }; -})(jQuery); diff --git a/wolnelektury/static/sponsors/js/jquery.json.min.js b/wolnelektury/static/sponsors/js/jquery.json.min.js deleted file mode 100644 index bad4a0afa..000000000 --- a/wolnelektury/static/sponsors/js/jquery.json.min.js +++ /dev/null @@ -1,31 +0,0 @@ - -(function($){$.toJSON=function(o) -{if(typeof(JSON)=='object'&&JSON.stringify) -return JSON.stringify(o);var type=typeof(o);if(o===null) -return"null";if(type=="undefined") -return undefined;if(type=="number"||type=="boolean") -return o+"";if(type=="string") -return $.quoteString(o);if(type=='object') -{if(typeof o.toJSON=="function") -return $.toJSON(o.toJSON());if(o.constructor===Date) -{var month=o.getUTCMonth()+1;if(month<10)month='0'+month;var day=o.getUTCDate();if(day<10)day='0'+day;var year=o.getUTCFullYear();var hours=o.getUTCHours();if(hours<10)hours='0'+hours;var minutes=o.getUTCMinutes();if(minutes<10)minutes='0'+minutes;var seconds=o.getUTCSeconds();if(seconds<10)seconds='0'+seconds;var milli=o.getUTCMilliseconds();if(milli<100)milli='0'+milli;if(milli<10)milli='0'+milli;return'"'+year+'-'+month+'-'+day+'T'+ -hours+':'+minutes+':'+seconds+'.'+milli+'Z"';} -if(o.constructor===Array) -{var ret=[];for(var i=0;i