From: Radek Czajka Date: Thu, 14 Feb 2013 10:24:34 +0000 (+0100) Subject: images X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/3268c2681874b53c1a9fbda5f7ab1388d62226b4?ds=sidebyside;hp=594930a0723314b1d76f5128638ed42ec31c9493 images --- diff --git a/catalogue/publish.py b/catalogue/publish.py index 87f4d90..f79a809 100755 --- a/catalogue/publish.py +++ b/catalogue/publish.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 +from django.core.files.base import ContentFile from django.core.files import File from librarian import DocProvider, IOFile from librarian.pyhtml import EduModuleFormat @@ -6,7 +7,7 @@ from .models import Lesson, Attachment class HtmlFormat(EduModuleFormat): - def url_for_material(self, slug, fmt): + def find_attachment(self, slug, fmt): lesson_slug = self.wldoc.book_info.url.slug try: # If already saved, use it. @@ -24,9 +25,40 @@ class HtmlFormat(EduModuleFormat): lesson = Lesson.objects.get(slug=lesson_slug) att = lesson.attachment_set.create(slug=slug, ext=fmt) att.file.save(att_name, File(att_file.get_file())) - return att.file.url + return att else: - return att.file.url + return att + + def url_for_material(self, slug, fmt): + return self.find_attachment(slug, fmt).file.url + + def url_for_image(self, slug, fmt, width=None): + if width is None: + return self.url_for_material(slug, fmt) + + lesson_slug = self.wldoc.book_info.url.slug + th_slug = "thumb/%s__th%d" % (slug, width) + try: + # If already saved, use it. + att = Attachment.objects.get(lesson__slug=lesson_slug, + slug=th_slug, ext=fmt) + except Attachment.DoesNotExist, e: + from PIL import Image + from StringIO import StringIO + # Find full image, create thumbnail, save. + src_att = self.find_attachment(slug, fmt) + simg = Image.open(src_att.file.path) + size = (width, simg.size[1]*width/simg.size[0]) + simg = simg.resize(size, Image.ANTIALIAS) + + tempfile = StringIO() + img_format = "JPEG" if fmt.upper() == "JPG" else fmt + simg.save(tempfile, format=img_format) + att_name = "%s.%s" % (th_slug, fmt) + lesson = Lesson.objects.get(slug=lesson_slug) + att = lesson.attachment_set.create(slug=th_slug, ext=fmt) + att.file.save(att_name, ContentFile(tempfile.getvalue())) + return att.file.url class OrmDocProvider(DocProvider): diff --git a/catalogue/static/catalogue/js/lesson.js b/catalogue/static/catalogue/js/lesson.js new file mode 100755 index 0000000..6b22a83 --- /dev/null +++ b/catalogue/static/catalogue/js/lesson.js @@ -0,0 +1,9 @@ +(function($){ +$(function() { + + +$('a.image').colorbox(); + + +}); +})($); diff --git a/curriculum/static/curriculum/curriculum.js b/curriculum/static/curriculum/curriculum.js index e30375a..0bdafc2 100755 --- a/curriculum/static/curriculum/curriculum.js +++ b/curriculum/static/curriculum/curriculum.js @@ -1,5 +1,5 @@ $(function() { - if (curriculum_hide_form) { + if (typeof(curriculum_hide_form) != "undefined") { $('.curriculum-form form').hide(); $('.curriculum-form h2 a span').show(); } diff --git a/edumed/settings.d/50-static.py b/edumed/settings.d/50-static.py index 750caf0..23de9b2 100644 --- a/edumed/settings.d/50-static.py +++ b/edumed/settings.d/50-static.py @@ -15,6 +15,7 @@ PIPELINE_JS_COMPRESSOR = None PIPELINE_CSS = { 'base': { 'source_filenames': ( + 'jquery/colorbox/colorbox.css', 'css/base.scss', 'css/main.scss', 'catalogue/css/carousel.scss', @@ -32,7 +33,10 @@ PIPELINE_JS = { 'source_filenames': ( 'catalogue/js/jquery-ui-1.10.0.custom.js', 'catalogue/js/jquery.cycle.all.js', + 'jquery/colorbox/jquery.colorbox-min.js', + 'jquery/colorbox/jquery.colorbox-pl.js', 'catalogue/js/edumed.js', + 'catalogue/js/lesson.js', 'catalogue/js/carousel.js', 'sponsors/js/sponsors.js', 'curriculum/curriculum.js', diff --git a/edumed/static/jquery/colorbox/colorbox.css b/edumed/static/jquery/colorbox/colorbox.css new file mode 100644 index 0000000..b75b0ce --- /dev/null +++ b/edumed/static/jquery/colorbox/colorbox.css @@ -0,0 +1,93 @@ +/* + 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;} +#cboxOverlay{position:fixed; width:100%; height:100%;} +#cboxMiddleLeft, #cboxBottomLeft{clear:left;} +#cboxContent{position:relative;} +#cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;} +#cboxTitle{margin:0;} +#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;} +.cboxIframe{width:100%; height:100%; display:block; border:0;} +#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;} + +/* + User Style: + 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;} +#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;} + #cboxBottomLeft{width:21px; height:21px; background:url(images/controls.png) no-repeat -101px -29px;} + #cboxBottomRight{width:21px; height:21px; background:url(images/controls.png) no-repeat -130px -29px;} + #cboxMiddleLeft{width:21px; background:url(images/controls.png) left top repeat-y;} + #cboxMiddleRight{width:21px; background:url(images/controls.png) right top repeat-y;} + #cboxTopCenter{height:21px; background:url(images/border.png) 0 0 repeat-x;} + #cboxBottomCenter{height:21px; background:url(images/border.png) 0 -29px repeat-x;} + #cboxContent{background:#fff; overflow:hidden;} + .cboxIframe{background:#fff;} + #cboxError{padding:50px; border:1px solid #ccc;} + #cboxLoadedContent{margin-bottom:28px;} + #cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;} + #cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;} + #cboxLoadingOverlay{background:url(images/loading_background.png) no-repeat center center;} + #cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;} + + /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */ + #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; } + + /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */ + #cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;} + + #cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;} + #cboxPrevious{position:absolute; bottom:0; left:0; background:url(images/controls.png) no-repeat -75px 0; width:25px; height:25px; text-indent:-9999px;} + #cboxPrevious:hover{background-position:-75px -25px;} + #cboxNext{position:absolute; bottom:0; left:27px; background:url(images/controls.png) no-repeat -50px 0; width:25px; height:25px; text-indent:-9999px;} + #cboxNext:hover{background-position:-50px -25px;} + #cboxClose{position:absolute; bottom:0; right:0; background:url(images/controls.png) no-repeat -25px 0; width:25px; height:25px; text-indent:-9999px;} + #cboxClose:hover{background-position:-25px -25px;} + +/* + The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill + when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9. + See: http://jacklmoore.com/notes/ie-transparency-problems/ +*/ +.cboxIE #cboxTopLeft, +.cboxIE #cboxTopCenter, +.cboxIE #cboxTopRight, +.cboxIE #cboxBottomLeft, +.cboxIE #cboxBottomCenter, +.cboxIE #cboxBottomRight, +.cboxIE #cboxMiddleLeft, +.cboxIE #cboxMiddleRight { + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF); +} + +/* + The following provides PNG transparency support for IE6 + Feel free to remove this and the /ie6/ directory if you have dropped IE6 support. +*/ +.cboxIE6 #cboxTopLeft{background:url(images/ie6/borderTopLeft.png);} +.cboxIE6 #cboxTopCenter{background:url(images/ie6/borderTopCenter.png);} +.cboxIE6 #cboxTopRight{background:url(images/ie6/borderTopRight.png);} +.cboxIE6 #cboxBottomLeft{background:url(images/ie6/borderBottomLeft.png);} +.cboxIE6 #cboxBottomCenter{background:url(images/ie6/borderBottomCenter.png);} +.cboxIE6 #cboxBottomRight{background:url(images/ie6/borderBottomRight.png);} +.cboxIE6 #cboxMiddleLeft{background:url(images/ie6/borderMiddleLeft.png);} +.cboxIE6 #cboxMiddleRight{background:url(images/ie6/borderMiddleRight.png);} + +.cboxIE6 #cboxTopLeft, +.cboxIE6 #cboxTopCenter, +.cboxIE6 #cboxTopRight, +.cboxIE6 #cboxBottomLeft, +.cboxIE6 #cboxBottomCenter, +.cboxIE6 #cboxBottomRight, +.cboxIE6 #cboxMiddleLeft, +.cboxIE6 #cboxMiddleRight { + _behavior: expression(this.src = this.src ? this.src : this.currentStyle.backgroundImage.split('"')[1], this.style.background = "none", this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + this.src + ", sizingMethod='scale')"); +} diff --git a/edumed/static/jquery/colorbox/images/border.png b/edumed/static/jquery/colorbox/images/border.png new file mode 100644 index 0000000..f463a10 Binary files /dev/null and b/edumed/static/jquery/colorbox/images/border.png differ diff --git a/edumed/static/jquery/colorbox/images/controls.png b/edumed/static/jquery/colorbox/images/controls.png new file mode 100644 index 0000000..dcfd6fb Binary files /dev/null and b/edumed/static/jquery/colorbox/images/controls.png differ diff --git a/edumed/static/jquery/colorbox/images/ie6/borderBottomCenter.png b/edumed/static/jquery/colorbox/images/ie6/borderBottomCenter.png new file mode 100644 index 0000000..0d4475e Binary files /dev/null and b/edumed/static/jquery/colorbox/images/ie6/borderBottomCenter.png differ diff --git a/edumed/static/jquery/colorbox/images/ie6/borderBottomLeft.png b/edumed/static/jquery/colorbox/images/ie6/borderBottomLeft.png new file mode 100644 index 0000000..2775eba Binary files /dev/null and b/edumed/static/jquery/colorbox/images/ie6/borderBottomLeft.png differ diff --git a/edumed/static/jquery/colorbox/images/ie6/borderBottomRight.png b/edumed/static/jquery/colorbox/images/ie6/borderBottomRight.png new file mode 100644 index 0000000..f7f5137 Binary files /dev/null and b/edumed/static/jquery/colorbox/images/ie6/borderBottomRight.png differ diff --git a/edumed/static/jquery/colorbox/images/ie6/borderMiddleLeft.png b/edumed/static/jquery/colorbox/images/ie6/borderMiddleLeft.png new file mode 100644 index 0000000..a2d63d1 Binary files /dev/null and b/edumed/static/jquery/colorbox/images/ie6/borderMiddleLeft.png differ diff --git a/edumed/static/jquery/colorbox/images/ie6/borderMiddleRight.png b/edumed/static/jquery/colorbox/images/ie6/borderMiddleRight.png new file mode 100644 index 0000000..fd7c3e8 Binary files /dev/null and b/edumed/static/jquery/colorbox/images/ie6/borderMiddleRight.png differ diff --git a/edumed/static/jquery/colorbox/images/ie6/borderTopCenter.png b/edumed/static/jquery/colorbox/images/ie6/borderTopCenter.png new file mode 100644 index 0000000..2937a9c Binary files /dev/null and b/edumed/static/jquery/colorbox/images/ie6/borderTopCenter.png differ diff --git a/edumed/static/jquery/colorbox/images/ie6/borderTopLeft.png b/edumed/static/jquery/colorbox/images/ie6/borderTopLeft.png new file mode 100644 index 0000000..f9d458b Binary files /dev/null and b/edumed/static/jquery/colorbox/images/ie6/borderTopLeft.png differ diff --git a/edumed/static/jquery/colorbox/images/ie6/borderTopRight.png b/edumed/static/jquery/colorbox/images/ie6/borderTopRight.png new file mode 100644 index 0000000..74b8583 Binary files /dev/null and b/edumed/static/jquery/colorbox/images/ie6/borderTopRight.png differ diff --git a/edumed/static/jquery/colorbox/images/loading.gif b/edumed/static/jquery/colorbox/images/loading.gif new file mode 100644 index 0000000..b4695d8 Binary files /dev/null and b/edumed/static/jquery/colorbox/images/loading.gif differ diff --git a/edumed/static/jquery/colorbox/images/loading_background.png b/edumed/static/jquery/colorbox/images/loading_background.png new file mode 100644 index 0000000..6ae83e6 Binary files /dev/null and b/edumed/static/jquery/colorbox/images/loading_background.png differ diff --git a/edumed/static/jquery/colorbox/images/overlay.png b/edumed/static/jquery/colorbox/images/overlay.png new file mode 100644 index 0000000..53ea98f Binary files /dev/null and b/edumed/static/jquery/colorbox/images/overlay.png differ diff --git a/edumed/static/jquery/colorbox/jquery.colorbox-min.js b/edumed/static/jquery/colorbox/jquery.colorbox-min.js new file mode 100644 index 0000000..45295d2 --- /dev/null +++ b/edumed/static/jquery/colorbox/jquery.colorbox-min.js @@ -0,0 +1,6 @@ +/*! + jQuery ColorBox v1.4.1 - 2013-02-14 + (c) 2013 Jack Moore - jacklmoore.com/colorbox + license: http://www.opensource.org/licenses/mit-license.php +*/ +(function(e,t,i){function o(i,o,n){var r=t.createElement(i);return o&&(r.id=Y+o),n&&(r.style.cssText=n),e(r)}function n(e){var t=T.length,i=(A+e)%t;return 0>i?t+i:i}function r(e,t){return Math.round((/%/.test(e)?("x"===t?k.width():k.height())/100:1)*parseInt(e,10))}function h(e){return K.photo||K.photoRegex.test(e)}function l(e){return K.retinaUrl&&i.devicePixelRatio>1?e.replace(K.photoRegex,K.retinaSuffix):e}function s(t){e.contains(w[0],t.target)||w[0]===t.target||(t.stopPropagation(),w.focus())}function a(){var t,i=e.data(N,V);null==i?(K=e.extend({},J),console&&console.log&&console.log("Error: cboxElement missing settings object")):K=e.extend({},i);for(t in K)e.isFunction(K[t])&&"on"!==t.slice(0,2)&&(K[t]=K[t].call(N));K.rel=K.rel||N.rel||e(N).data("rel")||"nofollow",K.href=K.href||e(N).attr("href"),K.title=K.title||N.title,"string"==typeof K.href&&(K.href=e.trim(K.href))}function d(i,o){e(t).trigger(i),at.trigger(i),e.isFunction(o)&&o.call(N)}function c(){var e,t,i,o,n,r=Y+"Slideshow_",h="click."+Y;K.slideshow&&T[1]?(t=function(){clearTimeout(e)},i=function(){(K.loop||T[A+1])&&(e=setTimeout(G.next,K.slideshowSpeed))},o=function(){M.html(K.slideshowStop).unbind(h).one(h,n),at.bind(it,i).bind(tt,t).bind(ot,n),w.removeClass(r+"off").addClass(r+"on")},n=function(){t(),at.unbind(it,i).unbind(tt,t).unbind(ot,n),M.html(K.slideshowStart).unbind(h).one(h,function(){G.next(),o()}),w.removeClass(r+"on").addClass(r+"off")},K.slideshowAuto?o():n()):w.removeClass(r+"off "+r+"on")}function u(i){U||(N=i,a(),T=e(N),A=0,"nofollow"!==K.rel&&(T=e("."+Z).filter(function(){var t,i=e.data(this,V);return i&&(t=e(this).data("rel")||i.rel||this.rel),t===K.rel}),A=T.index(N),-1===A&&(T=T.add(N),A=T.length-1)),m.css({opacity:parseFloat(K.opacity),cursor:K.overlayClose?"pointer":"auto",visibility:"visible"}).show(),j||(j=q=!0,w.css({visibility:"hidden",display:"block"}),E=o(dt,"LoadedContent","width:0; height:0; overflow:hidden").appendTo(v),_=x.height()+C.height()+v.outerHeight(!0)-v.height(),z=y.width()+b.width()+v.outerWidth(!0)-v.width(),D=E.outerHeight(!0),B=E.outerWidth(!0),K.w=r(K.initialWidth,"x"),K.h=r(K.initialHeight,"y"),G.position(),lt&&k.bind("resize."+st+" scroll."+st,function(){m.css({width:k.width(),height:k.height(),top:k.scrollTop(),left:k.scrollLeft()})}).trigger("resize."+st),c(),d(et,K.onOpen),P.add(W).hide(),R.html(K.close).show(),w.focus(),t.addEventListener&&(t.addEventListener("focus",s,!0),at.one(nt,function(){t.removeEventListener("focus",s,!0)})),K.returnFocus&&at.one(nt,function(){e(N).focus()})),G.load(!0))}function f(){!w&&t.body&&(X=!1,k=e(i),w=o(dt).attr({id:V,"class":ht?Y+(lt?"IE6":"IE"):"",role:"dialog",tabindex:"-1"}).hide(),m=o(dt,"Overlay",lt?"position:absolute":"").hide(),L=o(dt,"LoadingOverlay").add(o(dt,"LoadingGraphic")),g=o(dt,"Wrapper"),v=o(dt,"Content").append(W=o(dt,"Title"),H=o(dt,"Current"),F=o("button","Previous"),S=o("button","Next"),M=o("button","Slideshow"),L,R=o("button","Close")),g.append(o(dt).append(o(dt,"TopLeft"),x=o(dt,"TopCenter"),o(dt,"TopRight")),o(dt,!1,"clear:left").append(y=o(dt,"MiddleLeft"),v,b=o(dt,"MiddleRight")),o(dt,!1,"clear:left").append(o(dt,"BottomLeft"),C=o(dt,"BottomCenter"),o(dt,"BottomRight"))).find("div div").css({"float":"left"}),I=o(dt,!1,"position:absolute; width:9999px; visibility:hidden; display:none"),P=S.add(F).add(H).add(M),e(t.body).append(m,w.append(g,I)))}function p(){function i(e){e.which>1||e.shiftKey||e.altKey||e.metaKey||(e.preventDefault(),u(this))}return w?(X||(X=!0,S.click(function(){G.next()}),F.click(function(){G.prev()}),R.click(function(){G.close()}),m.click(function(){K.overlayClose&&G.close()}),e(t).bind("keydown."+Y,function(e){var t=e.keyCode;j&&K.escKey&&27===t&&(e.preventDefault(),G.close()),j&&K.arrowKey&&T[1]&&!e.altKey&&(37===t?(e.preventDefault(),F.click()):39===t&&(e.preventDefault(),S.click()))}),e.isFunction(e.fn.on)?e(t).on("click."+Y,"."+Z,i):e("."+Z).live("click."+Y,i)),!0):!1}var m,w,g,v,x,y,b,C,T,k,E,I,L,W,H,M,S,F,R,P,K,_,z,D,B,N,A,O,j,q,U,$,G,Q,X,J={transition:"elastic",speed: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,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)((#|\?).*)?$/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},V="colorbox",Y="cbox",Z=Y+"Element",et=Y+"_open",tt=Y+"_load",it=Y+"_complete",ot=Y+"_cleanup",nt=Y+"_closed",rt=Y+"_purge",ht=!e.support.leadingWhitespace,lt=ht&&!i.XMLHttpRequest,st=Y+"_IE6",at=e({}),dt="div";e.colorbox||(e(f),G=e.fn[V]=e[V]=function(t,i){var o=this;if(t=t||{},f(),p()){if(e.isFunction(o))o=e(""),t.open=!0;else if(!o[0])return o;i&&(t.onComplete=i),o.each(function(){e.data(this,V,e.extend({},e.data(this,V)||J,t))}).addClass(Z),(e.isFunction(t.open)&&t.open.call(o)||t.open)&&u(o[0])}return o},G.position=function(e,t){function i(e){x[0].style.width=C[0].style.width=v[0].style.width=parseInt(e.style.width,10)-z+"px",v[0].style.height=y[0].style.height=b[0].style.height=parseInt(e.style.height,10)-_+"px"}var o,n,h,l=0,s=0,a=w.offset();k.unbind("resize."+Y),w.css({top:-9e4,left:-9e4}),n=k.scrollTop(),h=k.scrollLeft(),K.fixed&&!lt?(a.top-=n,a.left-=h,w.css({position:"fixed"})):(l=n,s=h,w.css({position:"absolute"})),s+=K.right!==!1?Math.max(k.width()-K.w-B-z-r(K.right,"x"),0):K.left!==!1?r(K.left,"x"):Math.round(Math.max(k.width()-K.w-B-z,0)/2),l+=K.bottom!==!1?Math.max(k.height()-K.h-D-_-r(K.bottom,"y"),0):K.top!==!1?r(K.top,"y"):Math.round(Math.max(k.height()-K.h-D-_,0)/2),w.css({top:a.top,left:a.left,visibility:"visible"}),e=w.width()===K.w+B&&w.height()===K.h+D?0:e||0,g[0].style.width=g[0].style.height="9999px",o={width:K.w+B+z,height:K.h+D+_,top:l,left:s},0===e&&w.css(o),w.dequeue().animate(o,{duration:e,complete:function(){i(this),q=!1,g[0].style.width=K.w+B+z+"px",g[0].style.height=K.h+D+_+"px",K.reposition&&setTimeout(function(){k.bind("resize."+Y,G.position)},1),t&&t()},step:function(){i(this)}})},G.resize=function(e){j&&(e=e||{},e.width&&(K.w=r(e.width,"x")-B-z),e.innerWidth&&(K.w=r(e.innerWidth,"x")),E.css({width:K.w}),e.height&&(K.h=r(e.height,"y")-D-_),e.innerHeight&&(K.h=r(e.innerHeight,"y")),e.innerHeight||e.height||(E.css({height:"auto"}),K.h=E.height()),E.css({height:K.h}),G.position("none"===K.transition?0:K.speed))},G.prep=function(t){function i(){return K.w=K.w||E.width(),K.w=K.mw&&K.mw1?("string"==typeof K.current&&H.html(K.current.replace("{current}",A+1).replace("{total}",l)).show(),S[K.loop||l-1>A?"show":"hide"]().html(K.next),F[K.loop||A?"show":"hide"]().html(K.previous),K.slideshow&&M.show(),K.preloading&&e.each([n(-1),n(1)],function(){var t,i,o=T[this],n=e.data(o,V);n&&n.href?(t=n.href,e.isFunction(t)&&(t=t.call(o))):t=e(o).attr("href"),t&&(h(t)||n.photo)&&(i=new Image,i.src=t)})):P.hide(),K.iframe?(i=o("iframe")[0],a in i&&(i[a]=0),c in i&&(i[c]="true"),K.scrolling||(i.scrolling="no"),e(i).attr({src:K.href,name:(new Date).getTime(),"class":Y+"Iframe",allowFullScreen:!0,webkitAllowFullScreen:!0,mozallowfullscreen:!0}).one("load",r).appendTo(E),at.one(rt,function(){i.src="//about:blank"}),K.fastIframe&&e(i).trigger("load")):r(),"fade"===K.transition?w.fadeTo(s,1,t):t())},"fade"===K.transition?w.fadeTo(s,0,function(){G.position(0,l)}):G.position(s,l)}},G.load=function(t){var n,s,c,u=G.prep;q=!0,O=!1,N=T[A],t||a(),Q&&w.add(m).removeClass(Q),K.className&&w.add(m).addClass(K.className),Q=K.className,d(rt),d(tt,K.onLoad),K.h=K.height?r(K.height,"y")-D-_:K.innerHeight&&r(K.innerHeight,"y"),K.w=K.width?r(K.width,"x")-B-z:K.innerWidth&&r(K.innerWidth,"x"),K.mw=K.w,K.mh=K.h,K.maxWidth&&(K.mw=r(K.maxWidth,"x")-B-z,K.mw=K.w&&K.w1&&(O.height=O.height/i.devicePixelRatio,O.width=O.width/i.devicePixelRatio),K.scalePhotos&&(s=function(){O.height-=O.height*e,O.width-=O.width*e},K.mw&&O.width>K.mw&&(e=(O.width-K.mw)/O.width,s()),K.mh&&O.height>K.mh&&(e=(O.height-K.mh)/O.height,s())),K.h&&(O.style.marginTop=Math.max(K.mh-O.height,0)/2+"px"),T[1]&&(K.loop||T[A+1])&&(O.style.cursor="pointer",O.onclick=function(){G.next()}),ht&&(O.style.msInterpolationMode="bicubic"),setTimeout(function(){u(O)},1)}),setTimeout(function(){O.src=n},1)):n&&I.load(n,K.data,function(t,i){u("error"===i?o(dt,"Error").html(K.xhrError):e(this).contents())})},G.next=function(){!q&&T[1]&&(K.loop||T[A+1])&&(A=n(1),G.load())},G.prev=function(){!q&&T[1]&&(K.loop||A)&&(A=n(-1),G.load())},G.close=function(){j&&!U&&(U=!0,j=!1,d(ot,K.onCleanup),k.unbind("."+Y+" ."+st),m.fadeTo(200,0),w.stop().fadeTo(300,0,function(){w.add(m).css({opacity:1,cursor:"auto"}).hide(),d(rt),E.empty().remove(),setTimeout(function(){U=!1,d(nt,K.onClosed)},1)}))},G.remove=function(){e([]).add(w).add(m).remove(),w=null,e("."+Z).removeData(V).removeClass(Z),e(t).unbind("click."+Y)},G.element=function(){return e(N)},G.settings=J)})(jQuery,document,window); \ No newline at end of file diff --git a/edumed/static/jquery/colorbox/jquery.colorbox-pl.js b/edumed/static/jquery/colorbox/jquery.colorbox-pl.js new file mode 100644 index 0000000..370cdca --- /dev/null +++ b/edumed/static/jquery/colorbox/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