diff options
| author | spider@dev <spiderr@bitweaver.org> | 2016-08-17 00:17:14 -0400 |
|---|---|---|
| committer | spider@dev <spiderr@bitweaver.org> | 2016-08-17 00:17:14 -0400 |
| commit | e0706c8db672831701766fc86227321d0b2e8752 (patch) | |
| tree | e150b8c3c7121fca4c9f17302b699ff325343047 /javascript | |
| parent | b596c8fb0f832d0ea8c0b95680d018d68f1de9a3 (diff) | |
| download | util-e0706c8db672831701766fc86227321d0b2e8752.tar.gz util-e0706c8db672831701766fc86227321d0b2e8752.tar.bz2 util-e0706c8db672831701766fc86227321d0b2e8752.zip | |
update colorbox to 1.6.4
Diffstat (limited to 'javascript')
46 files changed, 1049 insertions, 425 deletions
diff --git a/javascript/jquery/plugins/colorbox/colorbox.css b/javascript/jquery/plugins/colorbox/colorbox.css index 1dedd90..c210ec4 100644 --- a/javascript/jquery/plugins/colorbox/colorbox.css +++ b/javascript/jquery/plugins/colorbox/colorbox.css @@ -2,7 +2,8 @@ Colorbox Core Style: The following CSS is consistent between example themes and should not be altered. */ -#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} +#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden; -webkit-transform: translate3d(0,0,0);} +#cboxWrapper {max-width:none;} #cboxOverlay{position:fixed; width:100%; height:100%;} #cboxMiddleLeft, #cboxBottomLeft{clear:left;} #cboxContent{position:relative;} @@ -11,7 +12,7 @@ #cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;} #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;} .cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;} -.cboxIframe{width:100%; height:100%; display:block; border:0;} +.cboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;} #colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;} /* @@ -19,7 +20,7 @@ Change the following styles to modify the appearance of Colorbox. They are ordered & tabbed in a way that represents the nesting of the generated HTML. */ -#cboxOverlay{background:url(images/overlay.png) repeat 0 0;} +#cboxOverlay{background:url(images/overlay.png) repeat 0 0; opacity: 0.9; filter: alpha(opacity = 90);} #colorbox{outline:0;} #cboxTopLeft{width:21px; height:21px; background:url(images/controls.png) no-repeat -101px 0;} #cboxTopRight{width:21px; height:21px; background:url(images/controls.png) no-repeat -130px 0;} diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-ar.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-ar.js new file mode 100644 index 0000000..6c4228c --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-ar.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Arabic (ar) + translated by: A.Rhman Sayes +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "الصورة {current} من {total}", + previous: "السابق", + next: "التالي", + close: "إغلاق", + xhrError: "حدث خطأ أثناء تحميل المحتوى.", + imgError: "حدث خطأ أثناء تحميل الصورة.", + slideshowStart: "تشغيل العرض", + slideshowStop: "إيقاف العرض" +}); diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-bg.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-bg.js new file mode 100644 index 0000000..de7e4a1 --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-bg.js @@ -0,0 +1,16 @@ +/* + jQuery Colorbox language configuration + language: Bulgarian (bg) + translated by: Marian M.Bida + site: webmax.bg +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "изображение {current} от {total}", + previous: "предишна", + next: "следваща", + close: "затвори", + xhrError: "Неуспешно зареждане на съдържанието.", + imgError: "Неуспешно зареждане на изображението.", + slideshowStart: "пусни слайд-шоу", + slideshowStop: "спри слайд-шоу" +}); diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-bn.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-bn.js new file mode 100644 index 0000000..946229d --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-bn.js @@ -0,0 +1,16 @@ +/* +jQuery Colorbox language configuration +language: Bengali (bn) +translated by: Arkaprava Majumder +http://github.com/arkaindas +*/ +jQuery.extend(jQuery.colorbox.settings, { +current: "ছবি {current} এর {total}", +previous: "আগে", +next: "পরে", +close: "বন্ধ", +xhrError: "এই কন্টেন্ট লোড করা যায়নি.", +imgError: "এই ছবিটি লোড করা যায়নি.", +slideshowStart: "স্লাইডশো শুরু", +slideshowStop: "স্লাইডশো বন্ধ" +}); diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-ca.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-ca.js new file mode 100644 index 0000000..173c05f --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-ca.js @@ -0,0 +1,13 @@ +/* + jQuery Colorbox language configuration + language: Catala (ca) + translated by: eduard salla +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Imatge {current} de {total}", + previous: "Anterior", + next: "Següent", + close: "Tancar", + xhrError: "Error en la càrrega del contingut.", + imgError: "Error en la càrrega de la imatge." +}); diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-cs.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-cs.js new file mode 100644 index 0000000..9649fd4 --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-cs.js @@ -0,0 +1,16 @@ +/* + jQuery Colorbox language configuration + language: Czech (cs) + translated by: Filip Novak + site: mame.napilno.cz/filip-novak +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "{current}. obrázek z {total}", + previous: "Předchozí", + next: "Následující", + close: "Zavřít", + xhrError: "Obsah se nepodařilo načíst.", + imgError: "Obrázek se nepodařilo načíst.", + slideshowStart: "Spustit slideshow", + slideshowStop: "Zastavit slideshow" +});
\ No newline at end of file diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-da.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-da.js new file mode 100644 index 0000000..676fffe --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-da.js @@ -0,0 +1,16 @@ +/* + jQuery Colorbox language configuration + language: Danish (da) + translated by: danieljuhl + site: danieljuhl.dk +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Billede {current} af {total}", + previous: "Forrige", + next: "Næste", + close: "Luk", + xhrError: "Indholdet fejlede i indlæsningen.", + imgError: "Billedet fejlede i indlæsningen.", + slideshowStart: "Start slideshow", + slideshowStop: "Stop slideshow" +}); diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-de.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-de.js new file mode 100644 index 0000000..d489379 --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-de.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: German (de) + translated by: wallenium +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Bild {current} von {total}", + previous: "Zurück", + next: "Vor", + close: "Schließen", + xhrError: "Dieser Inhalt konnte nicht geladen werden.", + imgError: "Dieses Bild konnte nicht geladen werden.", + slideshowStart: "Slideshow starten", + slideshowStop: "Slideshow anhalten" +});
\ No newline at end of file diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-es.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-es.js new file mode 100644 index 0000000..11296fc --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-es.js @@ -0,0 +1,13 @@ +/* + jQuery Colorbox language configuration + language: Spanish (es) + translated by: migolo +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Imagen {current} de {total}", + previous: "Anterior", + next: "Siguiente", + close: "Cerrar", + xhrError: "Error en la carga del contenido.", + imgError: "Error en la carga de la imagen." +}); diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-et.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-et.js new file mode 100644 index 0000000..60a4e88 --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-et.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Estonian (et) + translated by: keevitaja +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "{current}/{total}", + previous: "eelmine", + next: "järgmine", + close: "sulge", + xhrError: "Sisu ei õnnestunud laadida.", + imgError: "Pilti ei õnnestunud laadida.", + slideshowStart: "Käivita slaidid", + slideshowStop: "Peata slaidid" +});
\ No newline at end of file diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-fa.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-fa.js new file mode 100644 index 0000000..32869a4 --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-fa.js @@ -0,0 +1,18 @@ +/*
+ jQuery Colorbox language configuration
+ language: Persian (Farsi)
+ translated by: Mahdi Jaberzadeh Ansari (MJZSoft)
+ site: www.mjzsoft.ir
+ email: mahdijaberzadehansari (at) yahoo.co.uk
+ Please note : Persian language is right to left like arabic.
+*/
+jQuery.extend(jQuery.colorbox.settings, {
+ current: "تصویر {current} از {total}",
+ previous: "قبلی",
+ next: "بعدی",
+ close: "بستن",
+ xhrError: "متاسفانه محتویات مورد نظر قابل نمایش نیست.",
+ imgError: "متاسفانه بارگذاری این عکس با مشکل مواجه شده است.",
+ slideshowStart: "آغاز نمایش خودکار",
+ slideshowStop: "توقف نمایش خودکار"
+});
diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-fi.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-fi.js new file mode 100644 index 0000000..ac03fe0 --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-fi.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Finnish (fi) + translated by: Mikko +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Kuva {current} / {total}", + previous: "Edellinen", + next: "Seuraava", + close: "Sulje", + xhrError: "Sisällön lataaminen epäonnistui.", + imgError: "Kuvan lataaminen epäonnistui.", + slideshowStart: "Aloita kuvaesitys.", + slideshowStop: "Lopeta kuvaesitys." +}); diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-fr.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-fr.js new file mode 100644 index 0000000..f76352b --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-fr.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: French (fr) + translated by: oaubert +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "image {current} sur {total}", + previous: "précédente", + next: "suivante", + close: "fermer", + xhrError: "Impossible de charger ce contenu.", + imgError: "Impossible de charger cette image.", + slideshowStart: "démarrer la présentation", + slideshowStop: "arrêter la présentation" +}); diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-gl.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-gl.js new file mode 100644 index 0000000..3641b51 --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-gl.js @@ -0,0 +1,13 @@ +/* + jQuery Colorbox language configuration + language: Galician (gl) + translated by: donatorouco +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Imaxe {current} de {total}", + previous: "Anterior", + next: "Seguinte", + close: "Pechar", + xhrError: "Erro na carga do contido.", + imgError: "Erro na carga da imaxe." +}); diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-gr.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-gr.js new file mode 100644 index 0000000..0d2c1bb --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-gr.js @@ -0,0 +1,16 @@ +/* + jQuery Colorbox language configuration + language: Greek (gr) + translated by: S.Demirtzoglou + site: webiq.gr +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Εικόνα {current} από {total}", + previous: "Προηγούμενη", + next: "Επόμενη", + close: "Απόκρυψη", + xhrError: "Το περιεχόμενο δεν μπόρεσε να φορτωθεί.", + imgError: "Απέτυχε η φόρτωση της εικόνας.", + slideshowStart: "Έναρξη παρουσίασης", + slideshowStop: "Παύση παρουσίασης" +}); diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-he.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-he.js new file mode 100644 index 0000000..05e8460 --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-he.js @@ -0,0 +1,16 @@ +/* + jQuery Colorbox language configuration + language: Hebrew (he) + translated by: David Cohen + site: dav.co.il +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "תמונה {current} מתוך {total}", + previous: "הקודם", + next: "הבא", + close: "סגור", + xhrError: "שגיאה בטעינת התוכן.", + imgError: "שגיאה בטעינת התמונה.", + slideshowStart: "התחל מצגת", + slideshowStop: "עצור מצגת" +}); diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-hr.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-hr.js new file mode 100644 index 0000000..7eb62be --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-hr.js @@ -0,0 +1,15 @@ +/*
+ jQuery Colorbox language configuration
+ language: Croatian (hr)
+ translated by: Mladen Bicanic (base.hr)
+*/
+jQuery.extend(jQuery.colorbox.settings, {
+ current: "Slika {current} od {total}",
+ previous: "Prethodna",
+ next: "Sljedeća",
+ close: "Zatvori",
+ xhrError: "Neuspješno učitavanje sadržaja.",
+ imgError: "Neuspješno učitavanje slike.",
+ slideshowStart: "Pokreni slideshow",
+ slideshowStop: "Zaustavi slideshow"
+});
\ No newline at end of file diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-hu.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-hu.js new file mode 100644 index 0000000..72e9d36 --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-hu.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Hungarian (hu) + translated by: kovadani +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "{current}/{total} kép", + previous: "Előző", + next: "Következő", + close: "Bezár", + xhrError: "A tartalmat nem sikerült betölteni.", + imgError: "A képet nem sikerült betölteni.", + slideshowStart: "Diavetítés indítása", + slideshowStop: "Diavetítés leállítása" +});
\ No newline at end of file diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-id.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-id.js new file mode 100644 index 0000000..81a62df --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-id.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Indonesian (id) + translated by: sarwasunda +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "ke {current} dari {total}", + previous: "Sebelumnya", + next: "Berikutnya", + close: "Tutup", + xhrError: "Konten ini tidak dapat dimuat.", + imgError: "Gambar ini tidak dapat dimuat.", + slideshowStart: "Putar", + slideshowStop: "Berhenti" +}); diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-it.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-it.js new file mode 100644 index 0000000..2a4af64 --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-it.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Italian (it) + translated by: maur8ino +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Immagine {current} di {total}", + previous: "Precedente", + next: "Successiva", + close: "Chiudi", + xhrError: "Errore nel caricamento del contenuto.", + imgError: "Errore nel caricamento dell'immagine.", + slideshowStart: "Inizia la presentazione", + slideshowStop: "Termina la presentazione" +}); diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-ja.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-ja.js new file mode 100644 index 0000000..5480de3 --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-ja.js @@ -0,0 +1,15 @@ +/*
+ jQuery Colorbox language configuration
+ language: Japanaese (ja)
+ translated by: Hajime Fujimoto
+*/
+jQuery.extend(jQuery.colorbox.settings, {
+ current: "{total}枚中{current}枚目",
+ previous: "前",
+ next: "次",
+ close: "閉じる",
+ xhrError: "コンテンツの読み込みに失敗しました",
+ imgError: "画像の読み込みに失敗しました",
+ slideshowStart: "スライドショー開始",
+ slideshowStop: "スライドショー終了"
+});
diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-kr.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-kr.js new file mode 100644 index 0000000..b95702b --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-kr.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Korean (kr) + translated by: lunareffect +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "총 {total} 중 {current}", + previous: "이전", + next: "다음", + close: "닫기", + xhrError: "컨텐츠를 불러오는 데 실패했습니다.", + imgError: "이미지를 불러오는 데 실패했습니다.", + slideshowStart: "슬라이드쇼 시작", + slideshowStop: "슬라이드쇼 중지" +}); diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-lt.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-lt.js new file mode 100644 index 0000000..a513fcf --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-lt.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Lithuanian (lt) + translated by: Tomas Norkūnas +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Nuotrauka {current} iš {total}", + previous: "Atgal", + next: "Pirmyn", + close: "Uždaryti", + xhrError: "Nepavyko užkrauti turinio.", + imgError: "Nepavyko užkrauti nuotraukos.", + slideshowStart: "Pradėti automatinę peržiūrą", + slideshowStop: "Sustabdyti automatinę peržiūrą" +});
\ No newline at end of file diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-lv.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-lv.js new file mode 100644 index 0000000..e376366 --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-lv.js @@ -0,0 +1,16 @@ +/* + jQuery Colorbox language configuration + language: Latvian (lv) + translated by: Matiss Roberts Treinis + site: x0.lv +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "attēls {current} no {total}", + previous: "iepriekšējais", + next: "nākamais", + close: "aizvērt", + xhrError: "Neizdevās ielādēt saturu.", + imgError: "Neizdevās ielādēt attēlu.", + slideshowStart: "sākt slaidrādi", + slideshowStop: "apturēt slaidrādi" +}); diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-my.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-my.js new file mode 100644 index 0000000..216e252 --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-my.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Myanmar (my) + translated by: Yan Naing +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "ပုံ {total} မှာ {current} မြောက်ပုံ", + previous: "ရှေ့သို့", + next: "နောက်သို့", + close: "ပိတ်မည်", + xhrError: "ပါဝင်သော အကြောင်းအရာများ ဖော်ပြရာတွင် အနည်းငယ် ချို့ယွင်းမှုရှိနေပါသည်", + imgError: "ပုံပြသရာတွင် အနည်းငယ် ချို့ယွင်းချက် ရှိနေပါသည်", + slideshowStart: "ပုံများ စတင်ပြသမည်", + slideshowStop: "ပုံပြသခြင်း ရပ်ဆိုင်မည်" +}); diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-nl.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-nl.js new file mode 100644 index 0000000..dfc658e --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-nl.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Dutch (nl) + translated by: barryvdh +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Afbeelding {current} van {total}", + previous: "Vorige", + next: "Volgende", + close: "Sluiten", + xhrError: "Deze inhoud kan niet geladen worden.", + imgError: "Deze afbeelding kan niet geladen worden.", + slideshowStart: "Diashow starten", + slideshowStop: "Diashow stoppen" +});
\ No newline at end of file diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-no.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-no.js new file mode 100644 index 0000000..277c5d3 --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-no.js @@ -0,0 +1,16 @@ +/* + jQuery Colorbox language configuration + language: Norwegian (no) + translated by: lars-erik + site: markedspartner.no +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Bilde {current} av {total}", + previous: "Forrige", + next: "Neste", + close: "Lukk", + xhrError: "Feil ved lasting av innhold.", + imgError: "Feil ved lasting av bilde.", + slideshowStart: "Start lysbildefremvisning", + slideshowStop: "Stopp lysbildefremvisning" +}); diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-pl.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-pl.js new file mode 100644 index 0000000..1c04dae --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-pl.js @@ -0,0 +1,16 @@ +/*
+ jQuery Colorbox language configuration
+ language: Polski (pl)
+ translated by: Tomasz Wasiński
+ site: 2bevisible.pl
+*/
+jQuery.extend(jQuery.colorbox.settings, {
+ current: "{current}. obrazek z {total}",
+ previous: "Poprzedni",
+ next: "Następny",
+ close: "Zamknij",
+ xhrError: "Nie udało się załadować treści.",
+ imgError: "Nie udało się załadować obrazka.",
+ slideshowStart: "rozpocznij pokaz slajdów",
+ slideshowStop: "zatrzymaj pokaz slajdów"
+});
\ No newline at end of file diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-pt-BR.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-pt-BR.js new file mode 100644 index 0000000..a405d93 --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-pt-BR.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Brazilian Portuguese (pt-BR) + translated by: ReinaldoMT +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Imagem {current} de {total}", + previous: "Anterior", + next: "Próxima", + close: "Fechar", + slideshowStart: "iniciar apresentação de slides", + slideshowStop: "parar apresentação de slides", + xhrError: "Erro ao carregar o conteúdo.", + imgError: "Erro ao carregar a imagem." +});
\ No newline at end of file diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-ro.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-ro.js new file mode 100644 index 0000000..0a461e2 --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-ro.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Romanian (ro) + translated by: shurub3l +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "imagine {current} din {total}", + previous: "precedenta", + next: "următoarea", + close: "închideți", + xhrError: "Acest conținut nu poate fi încărcat.", + imgError: "Această imagine nu poate fi încărcată", + slideshowStart: "începeți prezentarea (slideshow)", + slideshowStop: "opriți prezentarea (slideshow)" +});
\ No newline at end of file diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-ru.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-ru.js new file mode 100644 index 0000000..1d88b8c --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-ru.js @@ -0,0 +1,16 @@ +/*
+ jQuery Colorbox language configuration
+ language: Russian (ru)
+ translated by: Marfa
+ site: themarfa.name
+*/
+jQuery.extend(jQuery.colorbox.settings, {
+ current: "изображение {current} из {total}",
+ previous: "назад",
+ next: "вперёд",
+ close: "закрыть",
+ xhrError: "Не удалось загрузить содержимое.",
+ imgError: "Не удалось загрузить изображение.",
+ slideshowStart: "начать слайд-шоу",
+ slideshowStop: "остановить слайд-шоу"
+});
\ No newline at end of file diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-si.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-si.js new file mode 100644 index 0000000..034b5b3 --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-si.js @@ -0,0 +1,15 @@ +/*
+ jQuery Colorbox language configuration
+ language: Slovenian (si)
+ translated by: Boštjan Pišler (pisler.si)
+*/
+jQuery.extend(jQuery.colorbox.settings, {
+ current: "Slika {current} od {total}",
+ previous: "Prejšnja",
+ next: "Naslednja",
+ close: "Zapri",
+ xhrError: "Vsebine ni bilo mogoče naložiti.",
+ imgError: "Slike ni bilo mogoče naložiti.",
+ slideshowStart: "Zaženi prezentacijo",
+ slideshowStop: "Zaustavi prezentacijo"
+});
\ No newline at end of file diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-sk.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-sk.js new file mode 100644 index 0000000..faa9291 --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-sk.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Slovak (sk) + translated by: Jaroslav Kostal +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "{current}. obrázok z {total}", + previous: "Predchádzajúci", + next: "Následujúci", + close: "Zatvoriť", + xhrError: "Obsah sa nepodarilo načítať.", + imgError: "Obrázok sa nepodarilo načítať.", + slideshowStart: "Spustiť slideshow", + slideshowStop: "zastaviť slideshow" +});
\ No newline at end of file diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-sr.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-sr.js new file mode 100644 index 0000000..618e73c --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-sr.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Serbian (sr) + translated by: Sasa Stefanovic (baguje.com) +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Slika {current} od {total}", + previous: "Prethodna", + next: "Sledeća", + close: "Zatvori", + xhrError: "Neuspešno učitavanje sadržaja.", + imgError: "Neuspešno učitavanje slike.", + slideshowStart: "Pokreni slideshow", + slideshowStop: "Zaustavi slideshow" +}); diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-sv.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-sv.js new file mode 100644 index 0000000..01bb1d8 --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-sv.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Swedish (sv) + translated by: Mattias Reichel +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Bild {current} av {total}", + previous: "Föregående", + next: "Nästa", + close: "Stäng", + xhrError: "Innehållet kunde inte laddas.", + imgError: "Den här bilden kunde inte laddas.", + slideshowStart: "Starta bildspel", + slideshowStop: "Stoppa bildspel" +});
\ No newline at end of file diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-tr.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-tr.js new file mode 100644 index 0000000..d467c2e --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-tr.js @@ -0,0 +1,19 @@ +/* + jQuery Colorbox language configuration + language: Turkish (tr) + translated by: Caner ÖNCEL + site: egonomik.com + + edited by: Sinan Eldem + www.sinaneldem.com.tr +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "Görsel {current} / {total}", + previous: "Önceki", + next: "Sonraki", + close: "Kapat", + xhrError: "İçerik yüklenirken hata meydana geldi.", + imgError: "Resim yüklenirken hata meydana geldi.", + slideshowStart: "Slaytı Başlat", + slideshowStop: "Slaytı Durdur" +}); diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-uk.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-uk.js new file mode 100644 index 0000000..3f786d3 --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-uk.js @@ -0,0 +1,16 @@ +/* + jQuery ColorBox language configuration + language: Ukrainian (uk) + translated by: Andrew + http://acisoftware.com.ua +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "зображення {current} з {total}", + previous: "попереднє", + next: "наступне", + close: "закрити", + xhrError: "Не вдалося завантажити вміст.", + imgError: "Не вдалося завантажити зображення.", + slideshowStart: "почати слайд-шоу", + slideshowStop: "зупинити слайд-шоу" +});
\ No newline at end of file diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-zh-CN.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-zh-CN.js new file mode 100644 index 0000000..770d8ea --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-zh-CN.js @@ -0,0 +1,15 @@ +/*
+ jQuery Colorbox language configuration
+ language: Chinese Simplified (zh-CN)
+ translated by: zhao weiming
+*/
+jQuery.extend(jQuery.colorbox.settings, {
+ current: "当前图像 {current} 总共 {total}",
+ previous: "前一页",
+ next: "后一页",
+ close: "关闭",
+ xhrError: "此内容无法加载",
+ imgError: "此图片无法加载",
+ slideshowStart: "开始播放幻灯片",
+ slideshowStop: "停止播放幻灯片"
+});
\ No newline at end of file diff --git a/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-zh-TW.js b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-zh-TW.js new file mode 100644 index 0000000..d72b742 --- /dev/null +++ b/javascript/jquery/plugins/colorbox/i18n/jquery.colorbox-zh-TW.js @@ -0,0 +1,15 @@ +/* + jQuery Colorbox language configuration + language: Chinese Traditional (zh-TW) + translated by: Atans Chiu +*/ +jQuery.extend(jQuery.colorbox.settings, { + current: "圖片 {current} 總共 {total}", + previous: "上一頁", + next: "下一頁", + close: "關閉", + xhrError: "此內容載入失敗.", + imgError: "此圖片加入失敗.", + slideshowStart: "開始幻燈片", + slideshowStop: "結束幻燈片" +}); diff --git a/javascript/jquery/plugins/colorbox/images/border.png b/javascript/jquery/plugins/colorbox/images/border.png Binary files differindex f463a10..9386f35 100644 --- a/javascript/jquery/plugins/colorbox/images/border.png +++ b/javascript/jquery/plugins/colorbox/images/border.png diff --git a/javascript/jquery/plugins/colorbox/images/controls.png b/javascript/jquery/plugins/colorbox/images/controls.png Binary files differindex dcfd6fb..1ec3cb1 100644 --- a/javascript/jquery/plugins/colorbox/images/controls.png +++ b/javascript/jquery/plugins/colorbox/images/controls.png diff --git a/javascript/jquery/plugins/colorbox/images/loading.gif b/javascript/jquery/plugins/colorbox/images/loading.gif Binary files differindex b4695d8..0325c8d 100644 --- a/javascript/jquery/plugins/colorbox/images/loading.gif +++ b/javascript/jquery/plugins/colorbox/images/loading.gif diff --git a/javascript/jquery/plugins/colorbox/images/loading_background.png b/javascript/jquery/plugins/colorbox/images/loading_background.png Binary files differindex 6ae83e6..23a336b 100644 --- a/javascript/jquery/plugins/colorbox/images/loading_background.png +++ b/javascript/jquery/plugins/colorbox/images/loading_background.png diff --git a/javascript/jquery/plugins/colorbox/images/overlay.png b/javascript/jquery/plugins/colorbox/images/overlay.png Binary files differindex 53ea98f..10362a4 100644 --- a/javascript/jquery/plugins/colorbox/images/overlay.png +++ b/javascript/jquery/plugins/colorbox/images/overlay.png diff --git a/javascript/jquery/plugins/colorbox/jquery.colorbox-min.js b/javascript/jquery/plugins/colorbox/jquery.colorbox-min.js index 230da8f..b5109a2 100644 --- a/javascript/jquery/plugins/colorbox/jquery.colorbox-min.js +++ b/javascript/jquery/plugins/colorbox/jquery.colorbox-min.js @@ -1,7 +1,6 @@ /*! - Colorbox v1.4.27 - 2013-07-16 - jQuery lightbox and modal window plugin - (c) 2013 Jack Moore - http://www.jacklmoore.com/colorbox - license: http://www.opensource.org/licenses/mit-license.php + Colorbox 1.6.4 + license: MIT + http://www.jacklmoore.com/colorbox */ -(function(t,e,i){function o(i,o,n){var r=e.createElement(i);return o&&(r.id=te+o),n&&(r.style.cssText=n),t(r)}function n(){return i.innerHeight?i.innerHeight:t(i).height()}function r(t){var e=E.length,i=(j+t)%e;return 0>i?e+i:i}function l(t,e){return Math.round((/%/.test(t)?("x"===e?H.width():n())/100:1)*parseInt(t,10))}function h(t,e){return t.photo||t.photoRegex.test(e)}function s(t,e){return t.retinaUrl&&i.devicePixelRatio>1?e.replace(t.photoRegex,t.retinaSuffix):e}function a(t){"contains"in v[0]&&!v[0].contains(t.target)&&(t.stopPropagation(),v.focus())}function d(){var e,i=t.data(A,Z);null==i?(O=t.extend({},Y),console&&console.log&&console.log("Error: cboxElement missing settings object")):O=t.extend({},i);for(e in O)t.isFunction(O[e])&&"on"!==e.slice(0,2)&&(O[e]=O[e].call(A));O.rel=O.rel||A.rel||t(A).data("rel")||"nofollow",O.href=O.href||t(A).attr("href"),O.title=O.title||A.title,"string"==typeof O.href&&(O.href=t.trim(O.href))}function c(i,o){t(e).trigger(i),se.trigger(i),t.isFunction(o)&&o.call(A)}function u(){var t,e,i,o,n,r=te+"Slideshow_",l="click."+te;O.slideshow&&E[1]?(e=function(){clearTimeout(t)},i=function(){(O.loop||E[j+1])&&(t=setTimeout(J.next,O.slideshowSpeed))},o=function(){R.html(O.slideshowStop).unbind(l).one(l,n),se.bind(ne,i).bind(oe,e).bind(re,n),v.removeClass(r+"off").addClass(r+"on")},n=function(){e(),se.unbind(ne,i).unbind(oe,e).unbind(re,n),R.html(O.slideshowStart).unbind(l).one(l,function(){J.next(),o()}),v.removeClass(r+"on").addClass(r+"off")},O.slideshowAuto?o():n()):v.removeClass(r+"off "+r+"on")}function p(i){G||(A=i,d(),E=t(A),j=0,"nofollow"!==O.rel&&(E=t("."+ee).filter(function(){var e,i=t.data(this,Z);return i&&(e=t(this).data("rel")||i.rel||this.rel),e===O.rel}),j=E.index(A),-1===j&&(E=E.add(A),j=E.length-1)),g.css({opacity:parseFloat(O.opacity),cursor:O.overlayClose?"pointer":"auto",visibility:"visible"}).show(),V&&v.add(g).removeClass(V),O.className&&v.add(g).addClass(O.className),V=O.className,O.closeButton?P.html(O.close).appendTo(x):P.appendTo("<div/>"),$||($=q=!0,v.css({visibility:"hidden",display:"block"}),W=o(ae,"LoadedContent","width:0; height:0; overflow:hidden"),x.css({width:"",height:""}).append(W),_=b.height()+k.height()+x.outerHeight(!0)-x.height(),D=T.width()+C.width()+x.outerWidth(!0)-x.width(),N=W.outerHeight(!0),z=W.outerWidth(!0),O.w=l(O.initialWidth,"x"),O.h=l(O.initialHeight,"y"),J.position(),u(),c(ie,O.onOpen),B.add(S).hide(),v.focus(),O.trapFocus&&e.addEventListener&&(e.addEventListener("focus",a,!0),se.one(le,function(){e.removeEventListener("focus",a,!0)})),O.returnFocus&&se.one(le,function(){t(A).focus()})),w())}function f(){!v&&e.body&&(X=!1,H=t(i),v=o(ae).attr({id:Z,"class":t.support.opacity===!1?te+"IE":"",role:"dialog",tabindex:"-1"}).hide(),g=o(ae,"Overlay").hide(),L=t([o(ae,"LoadingOverlay")[0],o(ae,"LoadingGraphic")[0]]),y=o(ae,"Wrapper"),x=o(ae,"Content").append(S=o(ae,"Title"),M=o(ae,"Current"),K=t('<button type="button"/>').attr({id:te+"Previous"}),I=t('<button type="button"/>').attr({id:te+"Next"}),R=o("button","Slideshow"),L),P=t('<button type="button"/>').attr({id:te+"Close"}),y.append(o(ae).append(o(ae,"TopLeft"),b=o(ae,"TopCenter"),o(ae,"TopRight")),o(ae,!1,"clear:left").append(T=o(ae,"MiddleLeft"),x,C=o(ae,"MiddleRight")),o(ae,!1,"clear:left").append(o(ae,"BottomLeft"),k=o(ae,"BottomCenter"),o(ae,"BottomRight"))).find("div div").css({"float":"left"}),F=o(ae,!1,"position:absolute; width:9999px; visibility:hidden; display:none"),B=I.add(K).add(M).add(R),t(e.body).append(g,v.append(y,F)))}function m(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.ctrlKey||(t.preventDefault(),p(this))}return v?(X||(X=!0,I.click(function(){J.next()}),K.click(function(){J.prev()}),P.click(function(){J.close()}),g.click(function(){O.overlayClose&&J.close()}),t(e).bind("keydown."+te,function(t){var e=t.keyCode;$&&O.escKey&&27===e&&(t.preventDefault(),J.close()),$&&O.arrowKey&&E[1]&&!t.altKey&&(37===e?(t.preventDefault(),K.click()):39===e&&(t.preventDefault(),I.click()))}),t.isFunction(t.fn.on)?t(e).on("click."+te,"."+ee,i):t("."+ee).live("click."+te,i)),!0):!1}function w(){var n,r,a,u=J.prep,p=++de;q=!0,U=!1,A=E[j],d(),c(he),c(oe,O.onLoad),O.h=O.height?l(O.height,"y")-N-_:O.innerHeight&&l(O.innerHeight,"y"),O.w=O.width?l(O.width,"x")-z-D:O.innerWidth&&l(O.innerWidth,"x"),O.mw=O.w,O.mh=O.h,O.maxWidth&&(O.mw=l(O.maxWidth,"x")-z-D,O.mw=O.w&&O.w<O.mw?O.w:O.mw),O.maxHeight&&(O.mh=l(O.maxHeight,"y")-N-_,O.mh=O.h&&O.h<O.mh?O.h:O.mh),n=O.href,Q=setTimeout(function(){L.show()},100),O.inline?(a=o(ae).hide().insertBefore(t(n)[0]),se.one(he,function(){a.replaceWith(W.children())}),u(t(n))):O.iframe?u(" "):O.html?u(O.html):h(O,n)?(n=s(O,n),U=e.createElement("img"),t(U).addClass(te+"Photo").bind("error",function(){O.title=!1,u(o(ae,"Error").html(O.imgError))}).one("load",function(){var e;p===de&&(U.alt=t(A).attr("alt")||t(A).attr("data-alt")||"",O.retinaImage&&i.devicePixelRatio>1&&(U.height=U.height/i.devicePixelRatio,U.width=U.width/i.devicePixelRatio),O.scalePhotos&&(r=function(){U.height-=U.height*e,U.width-=U.width*e},O.mw&&U.width>O.mw&&(e=(U.width-O.mw)/U.width,r()),O.mh&&U.height>O.mh&&(e=(U.height-O.mh)/U.height,r())),O.h&&(U.style.marginTop=Math.max(O.mh-U.height,0)/2+"px"),E[1]&&(O.loop||E[j+1])&&(U.style.cursor="pointer",U.onclick=function(){J.next()}),U.style.width=U.width+"px",U.style.height=U.height+"px",setTimeout(function(){u(U)},1))}),setTimeout(function(){U.src=n},1)):n&&F.load(n,O.data,function(e,i){p===de&&u("error"===i?o(ae,"Error").html(O.xhrError):t(this).contents())})}var g,v,y,x,b,T,C,k,E,H,W,F,L,S,M,R,I,K,P,B,O,_,D,N,z,A,j,U,$,q,G,Q,J,V,X,Y={transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,className:!1,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",open:!1,returnFocus:!0,trapFocus:!0,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp)((#|\?).*)?$/i,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0},Z="colorbox",te="cbox",ee=te+"Element",ie=te+"_open",oe=te+"_load",ne=te+"_complete",re=te+"_cleanup",le=te+"_closed",he=te+"_purge",se=t("<a/>"),ae="div",de=0,ce={};t.colorbox||(t(f),J=t.fn[Z]=t[Z]=function(e,i){var o=this;if(e=e||{},f(),m()){if(t.isFunction(o))o=t("<a/>"),e.open=!0;else if(!o[0])return o;i&&(e.onComplete=i),o.each(function(){t.data(this,Z,t.extend({},t.data(this,Z)||Y,e))}).addClass(ee),(t.isFunction(e.open)&&e.open.call(o)||e.open)&&p(o[0])}return o},J.position=function(e,i){function o(){b[0].style.width=k[0].style.width=x[0].style.width=parseInt(v[0].style.width,10)-D+"px",x[0].style.height=T[0].style.height=C[0].style.height=parseInt(v[0].style.height,10)-_+"px"}var r,h,s,a=0,d=0,c=v.offset();if(H.unbind("resize."+te),v.css({top:-9e4,left:-9e4}),h=H.scrollTop(),s=H.scrollLeft(),O.fixed?(c.top-=h,c.left-=s,v.css({position:"fixed"})):(a=h,d=s,v.css({position:"absolute"})),d+=O.right!==!1?Math.max(H.width()-O.w-z-D-l(O.right,"x"),0):O.left!==!1?l(O.left,"x"):Math.round(Math.max(H.width()-O.w-z-D,0)/2),a+=O.bottom!==!1?Math.max(n()-O.h-N-_-l(O.bottom,"y"),0):O.top!==!1?l(O.top,"y"):Math.round(Math.max(n()-O.h-N-_,0)/2),v.css({top:c.top,left:c.left,visibility:"visible"}),y[0].style.width=y[0].style.height="9999px",r={width:O.w+z+D,height:O.h+N+_,top:a,left:d},e){var u=0;t.each(r,function(t){return r[t]!==ce[t]?(u=e,void 0):void 0}),e=u}ce=r,e||v.css(r),v.dequeue().animate(r,{duration:e||0,complete:function(){o(),q=!1,y[0].style.width=O.w+z+D+"px",y[0].style.height=O.h+N+_+"px",O.reposition&&setTimeout(function(){H.bind("resize."+te,J.position)},1),i&&i()},step:o})},J.resize=function(t){var e;$&&(t=t||{},t.width&&(O.w=l(t.width,"x")-z-D),t.innerWidth&&(O.w=l(t.innerWidth,"x")),W.css({width:O.w}),t.height&&(O.h=l(t.height,"y")-N-_),t.innerHeight&&(O.h=l(t.innerHeight,"y")),t.innerHeight||t.height||(e=W.scrollTop(),W.css({height:"auto"}),O.h=W.height()),W.css({height:O.h}),e&&W.scrollTop(e),J.position("none"===O.transition?0:O.speed))},J.prep=function(i){function n(){return O.w=O.w||W.width(),O.w=O.mw&&O.mw<O.w?O.mw:O.w,O.w}function l(){return O.h=O.h||W.height(),O.h=O.mh&&O.mh<O.h?O.mh:O.h,O.h}if($){var a,d="none"===O.transition?0:O.speed;W.empty().remove(),W=o(ae,"LoadedContent").append(i),W.hide().appendTo(F.show()).css({width:n(),overflow:O.scrolling?"auto":"hidden"}).css({height:l()}).prependTo(x),F.hide(),t(U).css({"float":"none"}),a=function(){function i(){t.support.opacity===!1&&v[0].style.removeAttribute("filter")}var n,l,a=E.length,u="frameBorder",p="allowTransparency";$&&(l=function(){clearTimeout(Q),L.hide(),c(ne,O.onComplete)},S.html(O.title).add(W).show(),a>1?("string"==typeof O.current&&M.html(O.current.replace("{current}",j+1).replace("{total}",a)).show(),I[O.loop||a-1>j?"show":"hide"]().html(O.next),K[O.loop||j?"show":"hide"]().html(O.previous),O.slideshow&&R.show(),O.preloading&&t.each([r(-1),r(1)],function(){var i,o,n=E[this],r=t.data(n,Z);r&&r.href?(i=r.href,t.isFunction(i)&&(i=i.call(n))):i=t(n).attr("href"),i&&h(r,i)&&(i=s(r,i),o=e.createElement("img"),o.src=i)})):B.hide(),O.iframe?(n=o("iframe")[0],u in n&&(n[u]=0),p in n&&(n[p]="true"),O.scrolling||(n.scrolling="no"),t(n).attr({src:O.href,name:(new Date).getTime(),"class":te+"Iframe",allowFullScreen:!0,webkitAllowFullScreen:!0,mozallowfullscreen:!0}).one("load",l).appendTo(W),se.one(he,function(){n.src="//about:blank"}),O.fastIframe&&t(n).trigger("load")):l(),"fade"===O.transition?v.fadeTo(d,1,i):i())},"fade"===O.transition?v.fadeTo(d,0,function(){J.position(0,a)}):J.position(d,a)}},J.next=function(){!q&&E[1]&&(O.loop||E[j+1])&&(j=r(1),p(E[j]))},J.prev=function(){!q&&E[1]&&(O.loop||j)&&(j=r(-1),p(E[j]))},J.close=function(){$&&!G&&(G=!0,$=!1,c(re,O.onCleanup),H.unbind("."+te),g.fadeTo(O.fadeOut||0,0),v.stop().fadeTo(O.fadeOut||0,0,function(){v.add(g).css({opacity:1,cursor:"auto"}).hide(),c(he),W.empty().remove(),setTimeout(function(){G=!1,c(le,O.onClosed)},1)}))},J.remove=function(){v&&(v.stop(),t.colorbox.close(),v.stop().remove(),g.remove(),G=!1,v=null,t("."+ee).removeData(Z).removeClass(ee),t(e).unbind("click."+te))},J.element=function(){return t(A)},J.settings=Y)})(jQuery,document,window);
\ No newline at end of file +(function(t,e,i){function n(i,n,o){var r=e.createElement(i);return n&&(r.id=Z+n),o&&(r.style.cssText=o),t(r)}function o(){return i.innerHeight?i.innerHeight:t(i).height()}function r(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var n;return void 0===this.cache[e]&&(n=t(this.el).attr("data-cbox-"+e),void 0!==n?this.cache[e]=n:void 0!==i[e]?this.cache[e]=i[e]:void 0!==X[e]&&(this.cache[e]=X[e])),this.cache[e]},this.get=function(e){var i=this.value(e);return t.isFunction(i)?i.call(this.el,this):i}}function h(t){var e=W.length,i=(A+t)%e;return 0>i?e+i:i}function a(t,e){return Math.round((/%/.test(t)?("x"===e?E.width():o())/100:1)*parseInt(t,10))}function s(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function l(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function d(t){"contains"in x[0]&&!x[0].contains(t.target)&&t.target!==v[0]&&(t.stopPropagation(),x.focus())}function c(t){c.str!==t&&(x.add(v).removeClass(c.str).addClass(t),c.str=t)}function g(e){A=0,e&&e!==!1&&"nofollow"!==e?(W=t("."+te).filter(function(){var i=t.data(this,Y),n=new r(this,i);return n.get("rel")===e}),A=W.index(_.el),-1===A&&(W=W.add(_.el),A=W.length-1)):W=t(_.el)}function u(i){t(e).trigger(i),ae.triggerHandler(i)}function f(i){var o;if(!G){if(o=t(i).data(Y),_=new r(i,o),g(_.get("rel")),!U){U=$=!0,c(_.get("className")),x.css({visibility:"hidden",display:"block",opacity:""}),I=n(se,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),b.css({width:"",height:""}).append(I),j=T.height()+k.height()+b.outerHeight(!0)-b.height(),D=C.width()+H.width()+b.outerWidth(!0)-b.width(),N=I.outerHeight(!0),z=I.outerWidth(!0);var h=a(_.get("initialWidth"),"x"),s=a(_.get("initialHeight"),"y"),l=_.get("maxWidth"),f=_.get("maxHeight");_.w=Math.max((l!==!1?Math.min(h,a(l,"x")):h)-z-D,0),_.h=Math.max((f!==!1?Math.min(s,a(f,"y")):s)-N-j,0),I.css({width:"",height:_.h}),J.position(),u(ee),_.get("onOpen"),O.add(F).hide(),x.focus(),_.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",d,!0),ae.one(re,function(){e.removeEventListener("focus",d,!0)})),_.get("returnFocus")&&ae.one(re,function(){t(_.el).focus()})}var p=parseFloat(_.get("opacity"));v.css({opacity:p===p?p:"",cursor:_.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),_.get("closeButton")?B.html(_.get("close")).appendTo(b):B.appendTo("<div/>"),w()}}function p(){x||(V=!1,E=t(i),x=n(se).attr({id:Y,"class":t.support.opacity===!1?Z+"IE":"",role:"dialog",tabindex:"-1"}).hide(),v=n(se,"Overlay").hide(),L=t([n(se,"LoadingOverlay")[0],n(se,"LoadingGraphic")[0]]),y=n(se,"Wrapper"),b=n(se,"Content").append(F=n(se,"Title"),R=n(se,"Current"),P=t('<button type="button"/>').attr({id:Z+"Previous"}),K=t('<button type="button"/>').attr({id:Z+"Next"}),S=t('<button type="button"/>').attr({id:Z+"Slideshow"}),L),B=t('<button type="button"/>').attr({id:Z+"Close"}),y.append(n(se).append(n(se,"TopLeft"),T=n(se,"TopCenter"),n(se,"TopRight")),n(se,!1,"clear:left").append(C=n(se,"MiddleLeft"),b,H=n(se,"MiddleRight")),n(se,!1,"clear:left").append(n(se,"BottomLeft"),k=n(se,"BottomCenter"),n(se,"BottomRight"))).find("div div").css({"float":"left"}),M=n(se,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),O=K.add(P).add(R).add(S)),e.body&&!x.parent().length&&t(e.body).append(v,x.append(y,M))}function m(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.ctrlKey||(t.preventDefault(),f(this))}return x?(V||(V=!0,K.click(function(){J.next()}),P.click(function(){J.prev()}),B.click(function(){J.close()}),v.click(function(){_.get("overlayClose")&&J.close()}),t(e).bind("keydown."+Z,function(t){var e=t.keyCode;U&&_.get("escKey")&&27===e&&(t.preventDefault(),J.close()),U&&_.get("arrowKey")&&W[1]&&!t.altKey&&(37===e?(t.preventDefault(),P.click()):39===e&&(t.preventDefault(),K.click()))}),t.isFunction(t.fn.on)?t(e).on("click."+Z,"."+te,i):t("."+te).live("click."+Z,i)),!0):!1}function w(){var e,o,r,h=J.prep,d=++le;if($=!0,q=!1,u(he),u(ie),_.get("onLoad"),_.h=_.get("height")?a(_.get("height"),"y")-N-j:_.get("innerHeight")&&a(_.get("innerHeight"),"y"),_.w=_.get("width")?a(_.get("width"),"x")-z-D:_.get("innerWidth")&&a(_.get("innerWidth"),"x"),_.mw=_.w,_.mh=_.h,_.get("maxWidth")&&(_.mw=a(_.get("maxWidth"),"x")-z-D,_.mw=_.w&&_.w<_.mw?_.w:_.mw),_.get("maxHeight")&&(_.mh=a(_.get("maxHeight"),"y")-N-j,_.mh=_.h&&_.h<_.mh?_.h:_.mh),e=_.get("href"),Q=setTimeout(function(){L.show()},100),_.get("inline")){var c=t(e).eq(0);r=t("<div>").hide().insertBefore(c),ae.one(he,function(){r.replaceWith(c)}),h(c)}else _.get("iframe")?h(" "):_.get("html")?h(_.get("html")):s(_,e)?(e=l(_,e),q=_.get("createImg"),t(q).addClass(Z+"Photo").bind("error."+Z,function(){h(n(se,"Error").html(_.get("imgError")))}).one("load",function(){d===le&&setTimeout(function(){var e;_.get("retinaImage")&&i.devicePixelRatio>1&&(q.height=q.height/i.devicePixelRatio,q.width=q.width/i.devicePixelRatio),_.get("scalePhotos")&&(o=function(){q.height-=q.height*e,q.width-=q.width*e},_.mw&&q.width>_.mw&&(e=(q.width-_.mw)/q.width,o()),_.mh&&q.height>_.mh&&(e=(q.height-_.mh)/q.height,o())),_.h&&(q.style.marginTop=Math.max(_.mh-q.height,0)/2+"px"),W[1]&&(_.get("loop")||W[A+1])&&(q.style.cursor="pointer",t(q).bind("click."+Z,function(){J.next()})),q.style.width=q.width+"px",q.style.height=q.height+"px",h(q)},1)}),q.src=e):e&&M.load(e,_.get("data"),function(e,i){d===le&&h("error"===i?n(se,"Error").html(_.get("xhrError")):t(this).contents())})}var v,x,y,b,T,C,H,k,W,E,I,M,L,F,R,S,K,P,B,O,_,j,D,N,z,A,q,U,$,G,Q,J,V,X={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return t(this).attr("href")},title:function(){return this.title},createImg:function(){var e=new Image,i=t(this).data("cbox-img-attrs");return"object"==typeof i&&t.each(i,function(t,i){e[t]=i}),e},createIframe:function(){var i=e.createElement("iframe"),n=t(this).data("cbox-iframe-attrs");return"object"==typeof n&&t.each(n,function(t,e){i[t]=e}),"frameBorder"in i&&(i.frameBorder=0),"allowTransparency"in i&&(i.allowTransparency="true"),i.name=(new Date).getTime(),i.allowFullscreen=!0,i}},Y="colorbox",Z="cbox",te=Z+"Element",ee=Z+"_open",ie=Z+"_load",ne=Z+"_complete",oe=Z+"_cleanup",re=Z+"_closed",he=Z+"_purge",ae=t("<a/>"),se="div",le=0,de={},ce=function(){function t(){clearTimeout(h)}function e(){(_.get("loop")||W[A+1])&&(t(),h=setTimeout(J.next,_.get("slideshowSpeed")))}function i(){S.html(_.get("slideshowStop")).unbind(s).one(s,n),ae.bind(ne,e).bind(ie,t),x.removeClass(a+"off").addClass(a+"on")}function n(){t(),ae.unbind(ne,e).unbind(ie,t),S.html(_.get("slideshowStart")).unbind(s).one(s,function(){J.next(),i()}),x.removeClass(a+"on").addClass(a+"off")}function o(){r=!1,S.hide(),t(),ae.unbind(ne,e).unbind(ie,t),x.removeClass(a+"off "+a+"on")}var r,h,a=Z+"Slideshow_",s="click."+Z;return function(){r?_.get("slideshow")||(ae.unbind(oe,o),o()):_.get("slideshow")&&W[1]&&(r=!0,ae.one(oe,o),_.get("slideshowAuto")?i():n(),S.show())}}();t[Y]||(t(p),J=t.fn[Y]=t[Y]=function(e,i){var n,o=this;return e=e||{},t.isFunction(o)&&(o=t("<a/>"),e.open=!0),o[0]?(p(),m()&&(i&&(e.onComplete=i),o.each(function(){var i=t.data(this,Y)||{};t.data(this,Y,t.extend(i,e))}).addClass(te),n=new r(o[0],e),n.get("open")&&f(o[0])),o):o},J.position=function(e,i){function n(){T[0].style.width=k[0].style.width=b[0].style.width=parseInt(x[0].style.width,10)-D+"px",b[0].style.height=C[0].style.height=H[0].style.height=parseInt(x[0].style.height,10)-j+"px"}var r,h,s,l=0,d=0,c=x.offset();if(E.unbind("resize."+Z),x.css({top:-9e4,left:-9e4}),h=E.scrollTop(),s=E.scrollLeft(),_.get("fixed")?(c.top-=h,c.left-=s,x.css({position:"fixed"})):(l=h,d=s,x.css({position:"absolute"})),d+=_.get("right")!==!1?Math.max(E.width()-_.w-z-D-a(_.get("right"),"x"),0):_.get("left")!==!1?a(_.get("left"),"x"):Math.round(Math.max(E.width()-_.w-z-D,0)/2),l+=_.get("bottom")!==!1?Math.max(o()-_.h-N-j-a(_.get("bottom"),"y"),0):_.get("top")!==!1?a(_.get("top"),"y"):Math.round(Math.max(o()-_.h-N-j,0)/2),x.css({top:c.top,left:c.left,visibility:"visible"}),y[0].style.width=y[0].style.height="9999px",r={width:_.w+z+D,height:_.h+N+j,top:l,left:d},e){var g=0;t.each(r,function(t){return r[t]!==de[t]?(g=e,void 0):void 0}),e=g}de=r,e||x.css(r),x.dequeue().animate(r,{duration:e||0,complete:function(){n(),$=!1,y[0].style.width=_.w+z+D+"px",y[0].style.height=_.h+N+j+"px",_.get("reposition")&&setTimeout(function(){E.bind("resize."+Z,J.position)},1),t.isFunction(i)&&i()},step:n})},J.resize=function(t){var e;U&&(t=t||{},t.width&&(_.w=a(t.width,"x")-z-D),t.innerWidth&&(_.w=a(t.innerWidth,"x")),I.css({width:_.w}),t.height&&(_.h=a(t.height,"y")-N-j),t.innerHeight&&(_.h=a(t.innerHeight,"y")),t.innerHeight||t.height||(e=I.scrollTop(),I.css({height:"auto"}),_.h=I.height()),I.css({height:_.h}),e&&I.scrollTop(e),J.position("none"===_.get("transition")?0:_.get("speed")))},J.prep=function(i){function o(){return _.w=_.w||I.width(),_.w=_.mw&&_.mw<_.w?_.mw:_.w,_.w}function a(){return _.h=_.h||I.height(),_.h=_.mh&&_.mh<_.h?_.mh:_.h,_.h}if(U){var d,g="none"===_.get("transition")?0:_.get("speed");I.remove(),I=n(se,"LoadedContent").append(i),I.hide().appendTo(M.show()).css({width:o(),overflow:_.get("scrolling")?"auto":"hidden"}).css({height:a()}).prependTo(b),M.hide(),t(q).css({"float":"none"}),c(_.get("className")),d=function(){function i(){t.support.opacity===!1&&x[0].style.removeAttribute("filter")}var n,o,a=W.length;U&&(o=function(){clearTimeout(Q),L.hide(),u(ne),_.get("onComplete")},F.html(_.get("title")).show(),I.show(),a>1?("string"==typeof _.get("current")&&R.html(_.get("current").replace("{current}",A+1).replace("{total}",a)).show(),K[_.get("loop")||a-1>A?"show":"hide"]().html(_.get("next")),P[_.get("loop")||A?"show":"hide"]().html(_.get("previous")),ce(),_.get("preloading")&&t.each([h(-1),h(1)],function(){var i,n=W[this],o=new r(n,t.data(n,Y)),h=o.get("href");h&&s(o,h)&&(h=l(o,h),i=e.createElement("img"),i.src=h)})):O.hide(),_.get("iframe")?(n=_.get("createIframe"),_.get("scrolling")||(n.scrolling="no"),t(n).attr({src:_.get("href"),"class":Z+"Iframe"}).one("load",o).appendTo(I),ae.one(he,function(){n.src="//about:blank"}),_.get("fastIframe")&&t(n).trigger("load")):o(),"fade"===_.get("transition")?x.fadeTo(g,1,i):i())},"fade"===_.get("transition")?x.fadeTo(g,0,function(){J.position(0,d)}):J.position(g,d)}},J.next=function(){!$&&W[1]&&(_.get("loop")||W[A+1])&&(A=h(1),f(W[A]))},J.prev=function(){!$&&W[1]&&(_.get("loop")||A)&&(A=h(-1),f(W[A]))},J.close=function(){U&&!G&&(G=!0,U=!1,u(oe),_.get("onCleanup"),E.unbind("."+Z),v.fadeTo(_.get("fadeOut")||0,0),x.stop().fadeTo(_.get("fadeOut")||0,0,function(){x.hide(),v.hide(),u(he),I.remove(),setTimeout(function(){G=!1,u(re),_.get("onClosed")},1)}))},J.remove=function(){x&&(x.stop(),t[Y].close(),x.stop(!1,!0).remove(),v.remove(),G=!1,x=null,t("."+te).removeData(Y).removeClass(te),t(e).unbind("click."+Z).unbind("keydown."+Z))},J.element=function(){return t(_.el)},J.settings=X)})(jQuery,document,window);
\ No newline at end of file diff --git a/javascript/jquery/plugins/colorbox/jquery.colorbox.js b/javascript/jquery/plugins/colorbox/jquery.colorbox.js index db00dac..12dd1b2 100644 --- a/javascript/jquery/plugins/colorbox/jquery.colorbox.js +++ b/javascript/jquery/plugins/colorbox/jquery.colorbox.js @@ -1,14 +1,20 @@ /*! - Colorbox v1.4.27 - 2013-07-16 - jQuery lightbox and modal window plugin - (c) 2013 Jack Moore - http://www.jacklmoore.com/colorbox - license: http://www.opensource.org/licenses/mit-license.php + Colorbox 1.6.4 + license: MIT + http://www.jacklmoore.com/colorbox */ (function ($, document, window) { var // Default settings object. // See http://jacklmoore.com/colorbox for details. defaults = { + // data sources + html: false, + photo: false, + iframe: false, + inline: false, + + // behavior and appearance transition: "elastic", speed: 300, fadeOut: 300, @@ -22,17 +28,29 @@ maxHeight: false, scalePhotos: true, scrolling: true, - inline: false, - html: false, - iframe: false, - fastIframe: true, - photo: false, - href: false, - title: false, - rel: false, opacity: 0.9, preloading: true, className: false, + overlayClose: true, + escKey: true, + arrowKey: true, + top: false, + bottom: false, + left: false, + right: false, + fixed: false, + data: undefined, + closeButton: true, + fastIframe: true, + open: false, + reposition: true, + loop: true, + slideshow: false, + slideshowAuto: true, + slideshowSpeed: 2500, + slideshowStart: "start slideshow", + slideshowStop: "stop slideshow", + photoRegex: /\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i, // alternate image paths for high-res displays retinaImage: false, @@ -47,41 +65,67 @@ xhrError: "This content failed to load.", imgError: "This image failed to load.", - open: false, + // accessbility returnFocus: true, trapFocus: true, - reposition: true, - loop: true, - slideshow: false, - slideshowAuto: true, - slideshowSpeed: 2500, - slideshowStart: "start slideshow", - slideshowStop: "stop slideshow", - photoRegex: /\.(gif|png|jp(e|g|eg)|bmp|ico|webp)((#|\?).*)?$/i, + // callbacks onOpen: false, onLoad: false, onComplete: false, onCleanup: false, onClosed: false, - overlayClose: true, - escKey: true, - arrowKey: true, - top: false, - bottom: false, - left: false, - right: false, - fixed: false, - data: undefined, - closeButton: true + rel: function() { + return this.rel; + }, + href: function() { + // using this.href would give the absolute url, when the href may have been inteded as a selector (e.g. '#container') + return $(this).attr('href'); + }, + title: function() { + return this.title; + }, + createImg: function() { + var img = new Image(); + var attrs = $(this).data('cbox-img-attrs'); + + if (typeof attrs === 'object') { + $.each(attrs, function(key, val){ + img[key] = val; + }); + } + + return img; + }, + createIframe: function() { + var iframe = document.createElement('iframe'); + var attrs = $(this).data('cbox-iframe-attrs'); + + if (typeof attrs === 'object') { + $.each(attrs, function(key, val){ + iframe[key] = val; + }); + } + + if ('frameBorder' in iframe) { + iframe.frameBorder = 0; + } + if ('allowTransparency' in iframe) { + iframe.allowTransparency = "true"; + } + iframe.name = (new Date()).getTime(); // give the iframe a unique name to prevent caching + iframe.allowFullscreen = true; + + return iframe; + } }, - + // Abstracting the HTML and event identifiers for easy rebranding colorbox = 'colorbox', prefix = 'cbox', boxElement = prefix + 'Element', - + // Events event_open = prefix + '_open', event_load = prefix + '_load', @@ -111,15 +155,14 @@ $prev, $close, $groupControls, - $events = $('<a/>'), - + $events = $('<a/>'), // $({}) would be prefered, but there is an issue with jQuery 1.4.2 + // Variables for cached values or use across multiple functions settings, interfaceHeight, interfaceWidth, loadedHeight, loadedWidth, - element, index, photo, open, @@ -128,7 +171,6 @@ loadingTimer, publicMethod, div = "div", - className, requests = 0, previousCSS = {}, init; @@ -136,7 +178,7 @@ // **************** // HELPER FUNCTIONS // **************** - + // Convenience function for creating new jQuery objects function $tag(tag, id, css) { var element = document.createElement(tag); @@ -151,19 +193,51 @@ return $(element); } - + // Get the window height using innerHeight when available to avoid an issue with iOS // http://bugs.jquery.com/ticket/6724 function winheight() { return window.innerHeight ? window.innerHeight : $(window).height(); } + function Settings(element, options) { + if (options !== Object(options)) { + options = {}; + } + + this.cache = {}; + this.el = element; + + this.value = function(key) { + var dataAttr; + + if (this.cache[key] === undefined) { + dataAttr = $(this.el).attr('data-cbox-'+key); + + if (dataAttr !== undefined) { + this.cache[key] = dataAttr; + } else if (options[key] !== undefined) { + this.cache[key] = options[key]; + } else if (defaults[key] !== undefined) { + this.cache[key] = defaults[key]; + } + } + + return this.cache[key]; + }; + + this.get = function(key) { + var value = this.value(key); + return $.isFunction(value) ? value.call(this.el, this) : value; + }; + } + // Determine the next and previous members in a group. function getIndex(increment) { var max = $related.length, newIndex = (index + increment) % max; - + return (newIndex < 0) ? max + newIndex : newIndex; } @@ -171,189 +245,160 @@ function setSize(size, dimension) { return Math.round((/%/.test(size) ? ((dimension === 'x' ? $window.width() : winheight()) / 100) : 1) * parseInt(size, 10)); } - + // Checks an href to see if it is a photo. // There is a force photo option (photo: true) for hrefs that cannot be matched by the regex. function isImage(settings, url) { - return settings.photo || settings.photoRegex.test(url); + return settings.get('photo') || settings.get('photoRegex').test(url); } function retinaUrl(settings, url) { - return settings.retinaUrl && window.devicePixelRatio > 1 ? url.replace(settings.photoRegex, settings.retinaSuffix) : url; + return settings.get('retinaUrl') && window.devicePixelRatio > 1 ? url.replace(settings.get('photoRegex'), settings.get('retinaSuffix')) : url; } function trapFocus(e) { - if ('contains' in $box[0] && !$box[0].contains(e.target)) { + if ('contains' in $box[0] && !$box[0].contains(e.target) && e.target !== $overlay[0]) { e.stopPropagation(); $box.focus(); } } - // Assigns function results to their respective properties - function makeSettings() { - var i, - data = $.data(element, colorbox); - - if (data == null) { - settings = $.extend({}, defaults); - if (console && console.log) { - console.log('Error: cboxElement missing settings object'); - } - } else { - settings = $.extend({}, data); + function setClass(str) { + if (setClass.str !== str) { + $box.add($overlay).removeClass(setClass.str).addClass(str); + setClass.str = str; } - - for (i in settings) { - if ($.isFunction(settings[i]) && i.slice(0, 2) !== 'on') { // checks to make sure the function isn't one of the callbacks, they will be handled at the appropriate time. - settings[i] = settings[i].call(element); + } + + function getRelated(rel) { + index = 0; + + if (rel && rel !== false && rel !== 'nofollow') { + $related = $('.' + boxElement).filter(function () { + var options = $.data(this, colorbox); + var settings = new Settings(this, options); + return (settings.get('rel') === rel); + }); + index = $related.index(settings.el); + + // Check direct calls to Colorbox. + if (index === -1) { + $related = $related.add(settings.el); + index = $related.length - 1; } - } - - settings.rel = settings.rel || element.rel || $(element).data('rel') || 'nofollow'; - settings.href = settings.href || $(element).attr('href'); - settings.title = settings.title || element.title; - - if (typeof settings.href === "string") { - settings.href = $.trim(settings.href); + } else { + $related = $(settings.el); } } - function trigger(event, callback) { + function trigger(event) { // for external use $(document).trigger(event); - // for internal use - $events.trigger(event); + $events.triggerHandler(event); + } + + var slideshow = (function(){ + var active, + className = prefix + "Slideshow_", + click = "click." + prefix, + timeOut; - if ($.isFunction(callback)) { - callback.call(element); + function clear () { + clearTimeout(timeOut); } - } - // Slideshow functionality - function slideshow() { - var - timeOut, - className = prefix + "Slideshow_", - click = "click." + prefix, - clear, - set, - start, - stop; - - if (settings.slideshow && $related[1]) { - clear = function () { - clearTimeout(timeOut); - }; + function set() { + if (settings.get('loop') || $related[index + 1]) { + clear(); + timeOut = setTimeout(publicMethod.next, settings.get('slideshowSpeed')); + } + } - set = function () { - if (settings.loop || $related[index + 1]) { - timeOut = setTimeout(publicMethod.next, settings.slideshowSpeed); - } - }; + function start() { + $slideshow + .html(settings.get('slideshowStop')) + .unbind(click) + .one(click, stop); - start = function () { - $slideshow - .html(settings.slideshowStop) - .unbind(click) - .one(click, stop); + $events + .bind(event_complete, set) + .bind(event_load, clear); - $events - .bind(event_complete, set) - .bind(event_load, clear) - .bind(event_cleanup, stop); + $box.removeClass(className + "off").addClass(className + "on"); + } - $box.removeClass(className + "off").addClass(className + "on"); - }; - - stop = function () { - clear(); - - $events - .unbind(event_complete, set) - .unbind(event_load, clear) - .unbind(event_cleanup, stop); - - $slideshow - .html(settings.slideshowStart) - .unbind(click) - .one(click, function () { - publicMethod.next(); - start(); - }); + function stop() { + clear(); - $box.removeClass(className + "on").addClass(className + "off"); - }; - - if (settings.slideshowAuto) { - start(); - } else { - stop(); - } - } else { - $box.removeClass(className + "off " + className + "on"); + $events + .unbind(event_complete, set) + .unbind(event_load, clear); + + $slideshow + .html(settings.get('slideshowStart')) + .unbind(click) + .one(click, function () { + publicMethod.next(); + start(); + }); + + $box.removeClass(className + "on").addClass(className + "off"); } - } - function launch(target) { - if (!closing) { - - element = target; - - makeSettings(); - - $related = $(element); - - index = 0; - - if (settings.rel !== 'nofollow') { - $related = $('.' + boxElement).filter(function () { - var data = $.data(this, colorbox), - relRelated; + function reset() { + active = false; + $slideshow.hide(); + clear(); + $events + .unbind(event_complete, set) + .unbind(event_load, clear); + $box.removeClass(className + "off " + className + "on"); + } - if (data) { - relRelated = $(this).data('rel') || data.rel || this.rel; + return function(){ + if (active) { + if (!settings.get('slideshow')) { + $events.unbind(event_cleanup, reset); + reset(); + } + } else { + if (settings.get('slideshow') && $related[1]) { + active = true; + $events.one(event_cleanup, reset); + if (settings.get('slideshowAuto')) { + start(); + } else { + stop(); } - - return (relRelated === settings.rel); - }); - index = $related.index(element); - - // Check direct calls to Colorbox. - if (index === -1) { - $related = $related.add(element); - index = $related.length - 1; + $slideshow.show(); } } - - $overlay.css({ - opacity: parseFloat(settings.opacity), - cursor: settings.overlayClose ? "pointer" : "auto", - visibility: 'visible' - }).show(); - + }; - if (className) { - $box.add($overlay).removeClass(className); - } - if (settings.className) { - $box.add($overlay).addClass(settings.className); - } - className = settings.className; + }()); - if (settings.closeButton) { - $close.html(settings.close).appendTo($content); - } else { - $close.appendTo('<div/>'); - } + + function launch(element) { + var options; + + if (!closing) { + + options = $(element).data(colorbox); + + settings = new Settings(element, options); + + getRelated(settings.get('rel')); if (!open) { open = active = true; // Prevents the page-change action from queuing up if the visitor holds down the left or right keys. - + + setClass(settings.get('className')); + // Show colorbox so the sizes can be calculated in older versions of jQuery - $box.css({visibility:'hidden', display:'block'}); - - $loaded = $tag(div, 'LoadedContent', 'width:0; height:0; overflow:hidden'); + $box.css({visibility:'hidden', display:'block', opacity:''}); + + $loaded = $tag(div, 'LoadedContent', 'width:0; height:0; overflow:hidden; visibility:hidden'); $content.css({width:'', height:''}).append($loaded); // Cache values needed for size calculations @@ -361,28 +406,33 @@ interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width(); loadedHeight = $loaded.outerHeight(true); loadedWidth = $loaded.outerWidth(true); - + // Opens inital empty Colorbox prior to content being loaded. - settings.w = setSize(settings.initialWidth, 'x'); - settings.h = setSize(settings.initialHeight, 'y'); + var initialWidth = setSize(settings.get('initialWidth'), 'x'); + var initialHeight = setSize(settings.get('initialHeight'), 'y'); + var maxWidth = settings.get('maxWidth'); + var maxHeight = settings.get('maxHeight'); + + settings.w = Math.max((maxWidth !== false ? Math.min(initialWidth, setSize(maxWidth, 'x')) : initialWidth) - loadedWidth - interfaceWidth, 0); + settings.h = Math.max((maxHeight !== false ? Math.min(initialHeight, setSize(maxHeight, 'y')) : initialHeight) - loadedHeight - interfaceHeight, 0); + + $loaded.css({width:'', height:settings.h}); publicMethod.position(); - slideshow(); + trigger(event_open); + settings.get('onOpen'); - trigger(event_open, settings.onOpen); - $groupControls.add($title).hide(); $box.focus(); - - if (settings.trapFocus) { + if (settings.get('trapFocus')) { // Confine focus to the modal // Uses event capturing that is not supported in IE8- if (document.addEventListener) { document.addEventListener('focus', trapFocus, true); - + $events.one(event_closed, function () { document.removeEventListener('focus', trapFocus, true); }); @@ -390,13 +440,26 @@ } // Return focus on closing - if (settings.returnFocus) { + if (settings.get('returnFocus')) { $events.one(event_closed, function () { - $(element).focus(); + $(settings.el).focus(); }); } } - + + var opacity = parseFloat(settings.get('opacity')); + $overlay.css({ + opacity: opacity === opacity ? opacity : '', + cursor: settings.get('overlayClose') ? 'pointer' : '', + visibility: 'visible' + }).show(); + + if (settings.get('closeButton')) { + $close.html(settings.get('close')).appendTo($content); + } else { + $close.appendTo('<div/>'); // replace with .detach() when dropping jQuery < 1.4 + } + load(); } } @@ -404,7 +467,7 @@ // Colorbox's markup needs to be added to the DOM prior to being called // so that the browser will go ahead and load the CSS background images. function appendHTML() { - if (!$box && document.body) { + if (!$box) { init = false; $window = $(window); $box = $tag(div).attr({ @@ -421,12 +484,12 @@ $current = $tag(div, "Current"), $prev = $('<button type="button"/>').attr({id:prefix+'Previous'}), $next = $('<button type="button"/>').attr({id:prefix+'Next'}), - $slideshow = $tag('button', "Slideshow"), + $slideshow = $('<button type="button"/>').attr({id:prefix+'Slideshow'}), $loadingOverlay ); $close = $('<button type="button"/>').attr({id:prefix+'Close'}); - + $wrap.append( // The 3x3 Grid that makes up Colorbox $tag(div).append( $tag(div, "TopLeft"), @@ -444,11 +507,12 @@ $tag(div, "BottomRight") ) ).find('div div').css({'float': 'left'}); - - $loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none'); - - $groupControls = $next.add($prev).add($current).add($slideshow); + $loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;'); + + $groupControls = $next.add($prev).add($current).add($slideshow); + } + if (document.body && !$box.parent().length) { $(document.body).append($overlay, $box.append($wrap, $loadingBay)); } } @@ -479,19 +543,19 @@ publicMethod.close(); }); $overlay.click(function () { - if (settings.overlayClose) { + if (settings.get('overlayClose')) { publicMethod.close(); } }); - + // Key Bindings $(document).bind('keydown.' + prefix, function (e) { var key = e.keyCode; - if (open && settings.escKey && key === 27) { + if (open && settings.get('escKey') && key === 27) { e.preventDefault(); publicMethod.close(); } - if (open && settings.arrowKey && $related[1] && !e.altKey) { + if (open && settings.get('arrowKey') && $related[1] && !e.altKey) { if (key === 37) { e.preventDefault(); $prev.click(); @@ -518,7 +582,7 @@ } // Don't do anything if Colorbox already exists. - if ($.colorbox) { + if ($[colorbox]) { return; } @@ -531,36 +595,43 @@ // Usage format: $.colorbox.close(); // Usage from within an iframe: parent.jQuery.colorbox.close(); // **************** - + publicMethod = $.fn[colorbox] = $[colorbox] = function (options, callback) { - var $this = this; - + var settings; + var $obj = this; + options = options || {}; - + + if ($.isFunction($obj)) { // assume a call to $.colorbox + $obj = $('<a/>'); + options.open = true; + } + + if (!$obj[0]) { // colorbox being applied to empty collection + return $obj; + } + appendHTML(); if (addBindings()) { - if ($.isFunction($this)) { // assume a call to $.colorbox - $this = $('<a/>'); - options.open = true; - } else if (!$this[0]) { // colorbox being applied to empty collection - return $this; - } - + if (callback) { options.onComplete = callback; } - - $this.each(function () { - $.data(this, colorbox, $.extend({}, $.data(this, colorbox) || defaults, options)); + + $obj.each(function () { + var old = $.data(this, colorbox) || {}; + $.data(this, colorbox, $.extend(old, options)); }).addClass(boxElement); - - if (($.isFunction(options.open) && options.open.call($this)) || options.open) { - launch($this[0]); + + settings = new Settings($obj[0], options); + + if (settings.get('open')) { + launch($obj[0]); } } - - return $this; + + return $obj; }; publicMethod.position = function (speed, loadedCallback) { @@ -571,7 +642,7 @@ offset = $box.offset(), scrollTop, scrollLeft; - + $window.unbind('resize.' + prefix); // remove the modal so that it doesn't influence the document width/height @@ -580,7 +651,7 @@ scrollTop = $window.scrollTop(); scrollLeft = $window.scrollLeft(); - if (settings.fixed) { + if (settings.get('fixed')) { offset.top -= scrollTop; offset.left -= scrollLeft; $box.css({position: 'fixed'}); @@ -591,29 +662,29 @@ } // keeps the top and left positions within the browser's viewport. - if (settings.right !== false) { - left += Math.max($window.width() - settings.w - loadedWidth - interfaceWidth - setSize(settings.right, 'x'), 0); - } else if (settings.left !== false) { - left += setSize(settings.left, 'x'); + if (settings.get('right') !== false) { + left += Math.max($window.width() - settings.w - loadedWidth - interfaceWidth - setSize(settings.get('right'), 'x'), 0); + } else if (settings.get('left') !== false) { + left += setSize(settings.get('left'), 'x'); } else { left += Math.round(Math.max($window.width() - settings.w - loadedWidth - interfaceWidth, 0) / 2); } - - if (settings.bottom !== false) { - top += Math.max(winheight() - settings.h - loadedHeight - interfaceHeight - setSize(settings.bottom, 'y'), 0); - } else if (settings.top !== false) { - top += setSize(settings.top, 'y'); + + if (settings.get('bottom') !== false) { + top += Math.max(winheight() - settings.h - loadedHeight - interfaceHeight - setSize(settings.get('bottom'), 'y'), 0); + } else if (settings.get('top') !== false) { + top += setSize(settings.get('top'), 'y'); } else { top += Math.round(Math.max(winheight() - settings.h - loadedHeight - interfaceHeight, 0) / 2); } $box.css({top: offset.top, left: offset.left, visibility:'visible'}); - + // this gives the wrapper plenty of breathing room so it's floated contents can move around smoothly, // but it has to be shrank down around the size of div#colorbox when it's done. If not, // it can invoke an obscure IE bug when using iframes. $wrap[0].style.width = $wrap[0].style.height = "9999px"; - + function modalDimensions() { $topBorder[0].style.width = $bottomBorder[0].style.width = $content[0].style.width = (parseInt($box[0].style.width,10) - interfaceWidth)+'px'; $content[0].style.height = $leftBorder[0].style.height = $rightBorder[0].style.height = (parseInt($box[0].style.height,10) - interfaceHeight)+'px'; @@ -643,20 +714,20 @@ duration: speed || 0, complete: function () { modalDimensions(); - + active = false; - + // shrink the wrapper down to exactly the size of colorbox to avoid a bug in IE's iframe implementation. $wrap[0].style.width = (settings.w + loadedWidth + interfaceWidth) + "px"; $wrap[0].style.height = (settings.h + loadedHeight + interfaceHeight) + "px"; - - if (settings.reposition) { + + if (settings.get('reposition')) { setTimeout(function () { // small delay before binding onresize due to an IE8 bug. $window.bind('resize.' + prefix, publicMethod.position); }, 1); } - if (loadedCallback) { + if ($.isFunction(loadedCallback)) { loadedCallback(); } }, @@ -666,10 +737,10 @@ publicMethod.resize = function (options) { var scrolltop; - + if (open) { options = options || {}; - + if (options.width) { settings.w = setSize(options.width, 'x') - loadedWidth - interfaceWidth; } @@ -679,7 +750,7 @@ } $loaded.css({width: settings.w}); - + if (options.height) { settings.h = setSize(options.height, 'y') - loadedHeight - interfaceHeight; } @@ -699,8 +770,8 @@ if(scrolltop) { $loaded.scrollTop(scrolltop); } - - publicMethod.position(settings.transition === "none" ? 0 : settings.speed); + + publicMethod.position(settings.get('transition') === "none" ? 0 : settings.get('speed')); } }; @@ -708,13 +779,13 @@ if (!open) { return; } - - var callback, speed = settings.transition === "none" ? 0 : settings.speed; - $loaded.empty().remove(); // Using empty first may prevent some IE7 issues. + var callback, speed = settings.get('transition') === "none" ? 0 : settings.get('speed'); + + $loaded.remove(); $loaded = $tag(div, 'LoadedContent').append(object); - + function getWidth() { settings.w = settings.w || $loaded.width(); settings.w = settings.mw && settings.mw < settings.w ? settings.mw : settings.w; @@ -725,76 +796,67 @@ settings.h = settings.mh && settings.mh < settings.h ? settings.mh : settings.h; return settings.h; } - + $loaded.hide() .appendTo($loadingBay.show())// content has to be appended to the DOM for accurate size calculations. - .css({width: getWidth(), overflow: settings.scrolling ? 'auto' : 'hidden'}) + .css({width: getWidth(), overflow: settings.get('scrolling') ? 'auto' : 'hidden'}) .css({height: getHeight()})// sets the height independently from the width in case the new width influences the value of height. .prependTo($content); - + $loadingBay.hide(); - + // floating the IMG removes the bottom line-height and fixed a problem where IE miscalculates the width of the parent element as 100% of the document width. - + $(photo).css({'float': 'none'}); + setClass(settings.get('className')); + callback = function () { var total = $related.length, iframe, - frameBorder = 'frameBorder', - allowTransparency = 'allowTransparency', complete; - + if (!open) { return; } - - function removeFilter() { // Needed for IE7 & IE8 in versions of jQuery prior to 1.7.2 + + function removeFilter() { // Needed for IE8 in versions of jQuery prior to 1.7.2 if ($.support.opacity === false) { $box[0].style.removeAttribute('filter'); } } - + complete = function () { clearTimeout(loadingTimer); $loadingOverlay.hide(); - trigger(event_complete, settings.onComplete); + trigger(event_complete); + settings.get('onComplete'); }; - - $title.html(settings.title).add($loaded).show(); - + + $title.html(settings.get('title')).show(); + $loaded.show(); + if (total > 1) { // handle grouping - if (typeof settings.current === "string") { - $current.html(settings.current.replace('{current}', index + 1).replace('{total}', total)).show(); - } - - $next[(settings.loop || index < total - 1) ? "show" : "hide"]().html(settings.next); - $prev[(settings.loop || index) ? "show" : "hide"]().html(settings.previous); - - if (settings.slideshow) { - $slideshow.show(); + if (typeof settings.get('current') === "string") { + $current.html(settings.get('current').replace('{current}', index + 1).replace('{total}', total)).show(); } - + + $next[(settings.get('loop') || index < total - 1) ? "show" : "hide"]().html(settings.get('next')); + $prev[(settings.get('loop') || index) ? "show" : "hide"]().html(settings.get('previous')); + + slideshow(); + // Preloads images within a rel group - if (settings.preloading) { + if (settings.get('preloading')) { $.each([getIndex(-1), getIndex(1)], function(){ - var src, - img, + var img, i = $related[this], - data = $.data(i, colorbox); + settings = new Settings(i, $.data(i, colorbox)), + src = settings.get('href'); - if (data && data.href) { - src = data.href; - if ($.isFunction(src)) { - src = src.call(i); - } - } else { - src = $(i).attr('href'); - } - - if (src && isImage(data, src)) { - src = retinaUrl(data, src); + if (src && isImage(settings, src)) { + src = retinaUrl(settings, src); img = document.createElement('img'); img.src = src; } @@ -803,53 +865,42 @@ } else { $groupControls.hide(); } - - if (settings.iframe) { - iframe = $tag('iframe')[0]; - - if (frameBorder in iframe) { - iframe[frameBorder] = 0; - } - - if (allowTransparency in iframe) { - iframe[allowTransparency] = "true"; - } - if (!settings.scrolling) { + if (settings.get('iframe')) { + + iframe = settings.get('createIframe'); + + if (!settings.get('scrolling')) { iframe.scrolling = "no"; } - + $(iframe) .attr({ - src: settings.href, - name: (new Date()).getTime(), // give the iframe a unique name to prevent caching - 'class': prefix + 'Iframe', - allowFullScreen : true, // allow HTML5 video to go fullscreen - webkitAllowFullScreen : true, - mozallowfullscreen : true + src: settings.get('href'), + 'class': prefix + 'Iframe' }) .one('load', complete) .appendTo($loaded); - + $events.one(event_purge, function () { iframe.src = "//about:blank"; }); - if (settings.fastIframe) { + if (settings.get('fastIframe')) { $(iframe).trigger('load'); } } else { complete(); } - - if (settings.transition === 'fade') { + + if (settings.get('transition') === 'fade') { $box.fadeTo(speed, 1, removeFilter); } else { removeFilter(); } }; - - if (settings.transition === 'fade') { + + if (settings.get('transition') === 'fade') { $box.fadeTo(speed, 0, function () { publicMethod.position(0, callback); }); @@ -860,146 +911,141 @@ function load () { var href, setResize, prep = publicMethod.prep, $inline, request = ++requests; - + active = true; - + photo = false; - - element = $related[index]; - - makeSettings(); - + trigger(event_purge); - - trigger(event_load, settings.onLoad); - - settings.h = settings.height ? - setSize(settings.height, 'y') - loadedHeight - interfaceHeight : - settings.innerHeight && setSize(settings.innerHeight, 'y'); - - settings.w = settings.width ? - setSize(settings.width, 'x') - loadedWidth - interfaceWidth : - settings.innerWidth && setSize(settings.innerWidth, 'x'); - + trigger(event_load); + settings.get('onLoad'); + + settings.h = settings.get('height') ? + setSize(settings.get('height'), 'y') - loadedHeight - interfaceHeight : + settings.get('innerHeight') && setSize(settings.get('innerHeight'), 'y'); + + settings.w = settings.get('width') ? + setSize(settings.get('width'), 'x') - loadedWidth - interfaceWidth : + settings.get('innerWidth') && setSize(settings.get('innerWidth'), 'x'); + // Sets the minimum dimensions for use in image scaling settings.mw = settings.w; settings.mh = settings.h; - + // Re-evaluate the minimum width and height based on maxWidth and maxHeight values. // If the width or height exceed the maxWidth or maxHeight, use the maximum values instead. - if (settings.maxWidth) { - settings.mw = setSize(settings.maxWidth, 'x') - loadedWidth - interfaceWidth; + if (settings.get('maxWidth')) { + settings.mw = setSize(settings.get('maxWidth'), 'x') - loadedWidth - interfaceWidth; settings.mw = settings.w && settings.w < settings.mw ? settings.w : settings.mw; } - if (settings.maxHeight) { - settings.mh = setSize(settings.maxHeight, 'y') - loadedHeight - interfaceHeight; + if (settings.get('maxHeight')) { + settings.mh = setSize(settings.get('maxHeight'), 'y') - loadedHeight - interfaceHeight; settings.mh = settings.h && settings.h < settings.mh ? settings.h : settings.mh; } - - href = settings.href; - + + href = settings.get('href'); + loadingTimer = setTimeout(function () { $loadingOverlay.show(); }, 100); - - if (settings.inline) { + + if (settings.get('inline')) { + var $target = $(href).eq(0); // Inserts an empty placeholder where inline content is being pulled from. // An event is bound to put inline content back when Colorbox closes or loads new content. - $inline = $tag(div).hide().insertBefore($(href)[0]); + $inline = $('<div>').hide().insertBefore($target); $events.one(event_purge, function () { - $inline.replaceWith($loaded.children()); + $inline.replaceWith($target); }); - prep($(href)); - } else if (settings.iframe) { + prep($target); + } else if (settings.get('iframe')) { // IFrame element won't be added to the DOM until it is ready to be displayed, // to avoid problems with DOM-ready JS that might be trying to run in that iframe. prep(" "); - } else if (settings.html) { - prep(settings.html); + } else if (settings.get('html')) { + prep(settings.get('html')); } else if (isImage(settings, href)) { href = retinaUrl(settings, href); - photo = document.createElement('img'); + photo = settings.get('createImg'); $(photo) .addClass(prefix + 'Photo') - .bind('error',function () { - settings.title = false; - prep($tag(div, 'Error').html(settings.imgError)); + .bind('error.'+prefix,function () { + prep($tag(div, 'Error').html(settings.get('imgError'))); }) .one('load', function () { - var percent; - if (request !== requests) { return; } - photo.alt = $(element).attr('alt') || $(element).attr('data-alt') || ''; + // A small pause because some browsers will occassionaly report a + // img.width and img.height of zero immediately after the img.onload fires + setTimeout(function(){ + var percent; - if (settings.retinaImage && window.devicePixelRatio > 1) { - photo.height = photo.height / window.devicePixelRatio; - photo.width = photo.width / window.devicePixelRatio; - } + if (settings.get('retinaImage') && window.devicePixelRatio > 1) { + photo.height = photo.height / window.devicePixelRatio; + photo.width = photo.width / window.devicePixelRatio; + } - if (settings.scalePhotos) { - setResize = function () { - photo.height -= photo.height * percent; - photo.width -= photo.width * percent; - }; - if (settings.mw && photo.width > settings.mw) { - percent = (photo.width - settings.mw) / photo.width; - setResize(); + if (settings.get('scalePhotos')) { + setResize = function () { + photo.height -= photo.height * percent; + photo.width -= photo.width * percent; + }; + if (settings.mw && photo.width > settings.mw) { + percent = (photo.width - settings.mw) / photo.width; + setResize(); + } + if (settings.mh && photo.height > settings.mh) { + percent = (photo.height - settings.mh) / photo.height; + setResize(); + } } - if (settings.mh && photo.height > settings.mh) { - percent = (photo.height - settings.mh) / photo.height; - setResize(); + + if (settings.h) { + photo.style.marginTop = Math.max(settings.mh - photo.height, 0) / 2 + 'px'; } - } - - if (settings.h) { - photo.style.marginTop = Math.max(settings.mh - photo.height, 0) / 2 + 'px'; - } - - if ($related[1] && (settings.loop || $related[index + 1])) { - photo.style.cursor = 'pointer'; - photo.onclick = function () { - publicMethod.next(); - }; - } - photo.style.width = photo.width + 'px'; - photo.style.height = photo.height + 'px'; + if ($related[1] && (settings.get('loop') || $related[index + 1])) { + photo.style.cursor = 'pointer'; - setTimeout(function () { // A pause because Chrome will sometimes report a 0 by 0 size otherwise. + $(photo).bind('click.'+prefix, function () { + publicMethod.next(); + }); + } + + photo.style.width = photo.width + 'px'; + photo.style.height = photo.height + 'px'; prep(photo); }, 1); }); - - setTimeout(function () { // A pause because Opera 10.6+ will sometimes not run the onload function otherwise. - photo.src = href; - }, 1); + + photo.src = href; + } else if (href) { - $loadingBay.load(href, settings.data, function (data, status) { + $loadingBay.load(href, settings.get('data'), function (data, status) { if (request === requests) { - prep(status === 'error' ? $tag(div, 'Error').html(settings.xhrError) : $(this).contents()); + prep(status === 'error' ? $tag(div, 'Error').html(settings.get('xhrError')) : $(this).contents()); } }); } } - + // Navigates to the next page/image in a set. publicMethod.next = function () { - if (!active && $related[1] && (settings.loop || $related[index + 1])) { + if (!active && $related[1] && (settings.get('loop') || $related[index + 1])) { index = getIndex(1); launch($related[index]); } }; - + publicMethod.prev = function () { - if (!active && $related[1] && (settings.loop || index)) { + if (!active && $related[1] && (settings.get('loop') || index)) { index = getIndex(-1); launch($related[index]); } @@ -1008,28 +1054,24 @@ // Note: to use this within an iframe use the following format: parent.jQuery.colorbox.close(); publicMethod.close = function () { if (open && !closing) { - + closing = true; - open = false; - - trigger(event_cleanup, settings.onCleanup); - + trigger(event_cleanup); + settings.get('onCleanup'); $window.unbind('.' + prefix); - - $overlay.fadeTo(settings.fadeOut || 0, 0); - - $box.stop().fadeTo(settings.fadeOut || 0, 0, function () { - - $box.add($overlay).css({'opacity': 1, cursor: 'auto'}).hide(); - + $overlay.fadeTo(settings.get('fadeOut') || 0, 0); + + $box.stop().fadeTo(settings.get('fadeOut') || 0, 0, function () { + $box.hide(); + $overlay.hide(); trigger(event_purge); - - $loaded.empty().remove(); // Using empty first may prevent some IE7 issues. - + $loaded.remove(); + setTimeout(function () { closing = false; - trigger(event_closed, settings.onClosed); + trigger(event_closed); + settings.get('onClosed'); }, 1); }); } @@ -1040,8 +1082,8 @@ if (!$box) { return; } $box.stop(); - $.colorbox.close(); - $box.stop().remove(); + $[colorbox].close(); + $box.stop(false, true).remove(); $overlay.remove(); closing = false; $box = null; @@ -1049,13 +1091,13 @@ .removeData(colorbox) .removeClass(boxElement); - $(document).unbind('click.'+prefix); + $(document).unbind('click.'+prefix).unbind('keydown.'+prefix); }; // A method for fetching the current element Colorbox is referencing. // returns a jQuery object. publicMethod.element = function () { - return $(element); + return $(settings.el); }; publicMethod.settings = defaults; |
