3 "DELETE_SHELF": "Czy na pewno usunąć półkę",
4 "HIDE_DESCRIPTION": "Zwiń opis",
5 "EXPAND_DESCRIPTION": "Rozwiń opis",
9 "DELETE_SHELF": "Translate me!",
10 "HIDE_DESCRIPTION": "Translate me!",
11 "EXPAND_DESCRIPTION": "Translate me!",
12 "LOADING": "Translate me!"
15 "DELETE_SHELF": "Translate me!",
16 "HIDE_DESCRIPTION": "Translate me!",
17 "EXPAND_DESCRIPTION": "Translate me!",
18 "LOADING": "Translate me!"
21 "DELETE_SHELF": "Translate me!",
22 "HIDE_DESCRIPTION": "Translate me!",
23 "EXPAND_DESCRIPTION": "Translate me!",
24 "LOADING": "Translate me!"
27 "DELETE_SHELF": "Translate me!",
28 "HIDE_DESCRIPTION": "Translate me!",
29 "EXPAND_DESCRIPTION": "Translate me!",
30 "LOADING": "Translate me!"
33 "DELETE_SHELF": "Translate me!",
34 "HIDE_DESCRIPTION": "Translate me!",
35 "EXPAND_DESCRIPTION": "Translate me!",
36 "LOADING": "Translate me!"
39 "DELETE_SHELF": "Translate me!",
40 "HIDE_DESCRIPTION": "Translate me!",
41 "EXPAND_DESCRIPTION": "Translate me!",
42 "LOADING": "Translate me!"
45 "DELETE_SHELF": "Translate me!",
46 "HIDE_DESCRIPTION": "Translate me!",
47 "EXPAND_DESCRIPTION": "Translate me!",
48 "LOADING": "Translate me!"
52 'Przekaż 1% żeby ukryć ten baner.',
53 'Jak dobrze wydać 1% swojego podatku? <strong>Poradnik dla opornych</strong>.',
54 'Wiadomość systemowa: wystąpił błąd brak funduszy. Wykonaj procedurę 1%.',
55 '<strong>FREE!</strong> Wygraj darmowe lektury!',
56 'Confidential business offer. Not scam! 1% for you.',
57 'Biblioteka Wolne Lektury wymaga aktualizacji. Kliknij dalej.',
58 '1000 lektur. <strong>1 procent</strong>.',
59 '1% dla biblioteki lektur szkolnych. 1% dla Twojej biblioteki.',
60 '1% na lektury szkolne.',
61 '1% dla wolności lektur szkolnych.',
62 'Podaruj Jeden Procent na rzecz szkolnej biblioteki internetowej.',
63 '1% podatku dla biblioteki szkolnej Wolne Lektury.',
64 '1% na rzecz darmowego dostępu do szkolnych lektur.',
65 'Żeby czytać teksty a nie skany. Przekaż 1%.',
66 'Czytaj teksty a nie skany. Przekaż 1%',
67 'Motyw artysty w literaturze - 47 cytatów. Pomóż znaleźć następne.',
68 'Twój 1% uwolni więcej lektur.',
69 'Ponad 400 motywów, blisko 10 000 000 cytatów. Pomóż znaleźć następne. Przekaż swój 1%.',
70 'Twój 1% uwolni lektury.',
71 'Rozlicz swój PIT z Wolnymi Lekturami. Skorzystaj z darmowego programu do rozliczania podatków.',
72 'Lektury 2010: Pan Tadeusz, Trylogia.',
73 'Pan Tadeusz też chce być w Internecie! Przekaż 1% swojego podatku.',
74 'Pomóż uwolnić 286 utworów z listy lektur szkolnych. Przekaż swój 1% na Wolne Lektury.'
78 function changeBannerText() {
79 var index = Math.floor(Math.random() * BANNER_TEXTS.length);
80 if (BANNER_TEXTS[index] == $('#onepercent-text').html()) {
84 $('#onepercent-text').fadeOut('slow', function() {
85 $(this).html(BANNER_TEXTS[index]);
86 $(this).fadeIn('slow');
89 setTimeout(changeBannerText, 30 * 1000);
93 function autocomplete_result_handler(event, item) {
94 $(event.target).closest('form').submit();
96 function serverTime() {
98 $.ajax({url: '/katalog/zegar/',
99 async: false, dataType: 'text',
100 success: function(text) {
101 time = new Date(text);
102 }, error: function(http, message, exc) {
111 $.fn.toggle_slide = function(p) {
113 short_el = p['short_el'] || $(':first-child', this);
114 long_el = p['long_el'] || short_el.next();
115 button = p['button'];
116 short_text = p['short_text'],
117 long_text = p['long_text'];
119 var toggle = function() {
120 if (cont.hasClass('short')) {
121 cont.animate({"height": long_el.attr("cont_h")+'px'}, {duration: "fast" }).removeClass('short');
124 if (button && long_text) button.html(long_text);
126 cont.animate({"height": short_el.attr("cont_h")+'px'}, {duration: "fast" }).addClass('short');
129 if (button && short_text) button.html(short_text);
133 if (long_el.html().length <= short_el.html().length)
136 // ensure long element shown first
137 long_el.show();short_el.hide();
138 long_el.attr("cont_h", $(this).height()).hide();
139 short_el.show().attr("cont_h", $(this).height());
140 $(this).addClass('short');
142 if (button && short_text) button.html(short_text);
143 if (button) button.hover(
144 function() { $(this).css({background: '#F3F3F3', cursor: 'pointer'}); },
145 function() { $(this).css({background: '#EEE'}); }
148 function() { $(this).css({background: '#F3F3F3', cursor: 'pointer'}); },
149 function() { $(this).css({background: '#FFF'}); }
152 function() { $(this).css({background: '#F3F3F3', cursor: 'pointer'}); },
153 function() { $(this).css({background: '#FFF'}); }
157 $('form input').labelify({labelledClass: 'blur'});
159 target = $('#login-register-window div.target');
161 $('#show-registration-form').click(function() {
162 $('#login-form').hide();
163 $('#registration-form').show();
166 $('#show-login-form').click(function() {
167 $('#registration-form').hide();
168 $('#login-form').show();
172 $('.fragment-short-text').each(function() {
173 var fragment = $(this).closest('.fragment');
174 fragment.toggle_slide({
176 long_el: fragment.find('.fragment-text')
180 $('.show-all-tags').click(function() {
181 $(this).parent().parent().fadeOut(function() {
182 $(this).next().fadeIn();
187 $('.hide-all-tags').click(function() {
188 $(this).parent().parent().fadeOut(function() {
189 $(this).prev().fadeIn();
194 $('#registration-form').ajaxForm({
196 beforeSubmit: function() {
197 $('#registration-form input[type=submit]')
198 .attr('disabled', 'disabled')
199 .after('<img src="/static/img/indicator.gif" style="margin-left: 0.5em"/>');
201 success: function(response) {
202 if (response.success) {
203 location.reload(true);
205 $('#registration-form span.error').remove();
206 $.each(response.errors, function(id, errors) {
207 $('#id_registration-' + id).before('<span class="error">' + errors[0] + '</span>');
209 $('#registration-form input[type=submit]').removeAttr('disabled');
210 $('#registration-form img').remove();
215 $('#login-form').ajaxForm({
217 beforeSubmit: function() {
218 $('#login-form input[type=submit]')
219 .attr('disabled', 'disabled')
220 .after('<img src="/static/img/indicator.gif" style="margin-left: 0.5em"/>');
222 success: function(response) {
223 if (response.success) {
224 location.reload(true);
226 $('#login-form span.error').remove();
227 $.each(response.errors, function(id, errors) {
228 $('#id_login-' + id).before('<span class="error">' + errors[0] + '</span>');
230 $('#login-form input[type=submit]').removeAttr('disabled');
231 $('#login-form img').remove();
236 $('#login-register-window').jqm({
239 trigger: '.login-register-link',
240 onShow: function(hash) {
241 var offset = $(hash.t).offset();
242 hash.w.css({position: 'absolute', left: offset.left - hash.w.width() + $(hash.t).width(), top: offset.top});
243 $('div.header', hash.w).css({width: $(hash.t).width()});
248 $('ul.shelf-list li').hover(function() {
249 $(this).css({background: '#EEE', cursor: 'pointer'});
251 $(this).css({background: 'transparent'});
252 }).click(function() {
253 location.href = $('a.visit-shelf', this).attr('href');
256 $('.delete-shelf').click(function() {
258 var shelf_name = $('.visit-shelf', link.parent()).text();
259 if (confirm(LOCALE_TEXTS[LANGUAGE_CODE]['DELETE_SHELF']+ ' '+ shelf_name + '?')) {
260 $.post(link.attr('href'), function(data, textStatus) {
261 link.parent().remove();
267 $('#user-shelves-window').jqm({
269 target: $('#user-shelves-window div.target')[0],
271 trigger: '#user-shelves-link',
272 onShow: function(hash) {
273 var offset = $(hash.t).offset();
274 hash.w.css({position: 'absolute', left: offset.left - hash.w.width() + $(hash.t).width(), top: offset.top});
275 $('div.header', hash.w).css({width: $(hash.t).width()});
278 onLoad: function(hash) {
279 $('form', hash.w).ajaxForm({
280 target: $('#user-shelves-window div.target'),
281 success: function() { setTimeout(function() { $('#user-shelves-window').jqmHide() }, 1000) }
284 $('input', hash.w).labelify({labelledClass: 'blur'});
286 $('ul.shelf-list li', hash.w).hover(function() {
287 $(this).css({background: '#EEE', cursor: 'pointer'});
289 $(this).css({background: 'transparent'});
290 }).click(function() {
291 location.href = $('a.visit-shelf', this).attr('href');
294 $('.delete-shelf').click(function() {
296 var shelf_name = $('.visit-shelf', link.parent()).text();
297 if (confirm(LOCALE_TEXTS[LANGUAGE_CODE]['DELETE_SHELF'] + ' ' + shelf_name + '?')) {
298 $.post(link.attr('href'), function(data, textStatus) {
299 link.parent().remove();
307 $('#suggest-window').jqm({
309 target: $('#suggest-window div.target')[0],
311 trigger: '#suggest-link',
312 onShow: function(hash) {
313 var offset = $(hash.t).offset();
314 hash.w.css({position: 'absolute', left: offset.left - hash.w.width() + $(hash.t).width(), top: offset.top});
315 $('div.header', hash.w).css({width: $(hash.t).width()});
318 onLoad: function(hash) {
319 $('form', hash.w).ajaxForm({
321 target: $('#suggest-window div.target'),
322 success: function(response) {
323 if (response.success) {
324 $('#suggest-window div.target').text(response.message);
325 setTimeout(function() { $('#suggest-window').jqmHide() }, 1000)
328 $('#suggest-form .error').remove();
329 $.each(response.errors, function(id, errors) {
330 $('#suggest-form #id_' + id).before('<span class="error">' + errors[0] + '</span>');
332 $('#suggest-form input[type=submit]').removeAttr('disabled');
340 $('#books-list .book').hover(
341 function() { $(this).css({background: '#F3F3F3', cursor: 'pointer'}); },
342 function() { $(this).css({background: '#FFF'}); }
344 location.href = $('h2 a', this).attr('href');
347 $('#description').each(function(){$(this).toggle_slide({
348 long_el: $('#description-long', this),
349 short_el: $('#description-short', this),
350 button: $(this).nextAll('#toggle-description').first().find('p'),
351 long_text: LOCALE_TEXTS[LANGUAGE_CODE]['HIDE_DESCRIPTION'] + ' ▲',
352 short_text: LOCALE_TEXTS[LANGUAGE_CODE]['EXPAND_DESCRIPTION'] + ' ▼'
355 $('#toggle-share-shelf').hover(
356 function() { $(this).css({background: '#F3F3F3', cursor: 'pointer'}); },
357 function() { $(this).css({background: '#EEE'}); }
359 if ($('#share-shelf').hasClass('hidden')) {
360 $('#share-shelf').slideDown('fast').removeClass('hidden');
362 $('#share-shelf').slideUp('fast').addClass('hidden');
366 var target = $('#set-window div.target');
368 $('#set-window').jqm({
372 trigger: 'a.jqm-trigger',
373 onShow: function(hash) {
374 var offset = $(hash.t).offset();
375 target.html('<p><img src="/static/img/indicator.gif" />'+LOCALE_TEXTS[LANGUAGE_CODE]['DELETE_SHELF']+'</p>');
376 hash.w.css({position: 'absolute', left: offset.left, top: offset.top}).show() },
377 onLoad: function(hash) {
379 $('#createShelfTrigger').click(function(){
380 $('#createNewShelf').show();
384 $('form', hash.w).ajaxForm({
386 success: function() {
387 setTimeout(function() {
388 $('#set-window').jqmHide();
394 $('a.remove-from-shelf').click(function(event) {
395 event.preventDefault();
397 $.post(link.attr('href'), function(data, textStatus) {
398 link.parent().remove();
402 $('#share-shelf').hide().addClass('hidden');
403 $('#share-shelf input').focus(function(){this.select();});
405 $('#user-info').show();
407 $('#onepercent-banner').show();
409 var formatsDownloaded = false;
410 $('#download-shelf').click(function() {
411 $('#download-shelf-menu').slideDown('fast');
413 if (!formatsDownloaded) {
414 // Get info about the formats
415 formatsDownloaded = true;
417 url: $('#download-formats-form').attr('data-formats-feed'),
420 complete: function() {
421 $('#download-formats-form-submit').attr('disabled', null);
422 $('#download-formats-form-submit-li img').remove();
423 $('#updating-formats').fadeOut('fast', function() {
424 $('#formats-updated').fadeIn('fast');
427 success: function(data) {
428 $('#download-formats-form li').each(function() {
430 if (!!item.attr('data-format') && !data[item.attr('data-format')]) {
431 item.fadeOut('fast', function() {
442 $('#download-formats-form-cancel').click(function() {
443 $('#download-shelf-menu').slideUp('fast');