diff --git a/bower.json b/bower.json index cd8cfd5cf3..1f833167fc 100644 --- a/bower.json +++ b/bower.json @@ -26,6 +26,7 @@ "moment": "~2.10.2", "angular-bootstrap": "~0.13.0", "ramda": "~0.13.0", - "jshint": "~2.7.0" + "jshint": "~2.7.0", + "lightbox2": "~2.8.1" } } diff --git a/client/less/main.less b/client/less/main.less index 6d6260aac7..f93234a75b 100644 --- a/client/less/main.less +++ b/client/less/main.less @@ -282,6 +282,10 @@ ul { margin-bottom: -6px; } +.lb-container { + padding: 0px; +} + .btn-social { width: 250px; margin: auto; diff --git a/public/js/lib/lightbox2/dist/css/lightbox.css b/public/js/lib/lightbox2/dist/css/lightbox.css deleted file mode 100644 index e48791aa26..0000000000 --- a/public/js/lib/lightbox2/dist/css/lightbox.css +++ /dev/null @@ -1,210 +0,0 @@ -/* Preload images */ -body:after { - content: url(../images/close.png) url(../images/loading.gif) url(../images/prev.png) url(../images/next.png); - display: none; -} - -.lightboxOverlay { - position: absolute; - top: 0; - left: 0; - z-index: 9999; - background-color: black; - filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); - opacity: 0.8; - display: none; -} - -.lightbox { - position: absolute; - left: 0; - width: 100%; - z-index: 10000; - text-align: center; - line-height: 0; - font-weight: normal; -} - -.lightbox .lb-image { - display: block; - height: auto; - max-width: inherit; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - -ms-border-radius: 3px; - -o-border-radius: 3px; - border-radius: 3px; -} - -.lightbox a img { - border: none; -} - -.lb-outerContainer { - position: relative; - background-color: white; - *zoom: 1; - width: 250px; - height: 250px; - margin: 0 auto; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - -ms-border-radius: 4px; - -o-border-radius: 4px; - border-radius: 4px; -} - -.lb-outerContainer:after { - content: ""; - display: table; - clear: both; -} - -.lb-container { - padding: 4px; -} - -.lb-loader { - position: absolute; - top: 43%; - left: 0; - height: 25%; - width: 100%; - text-align: center; - line-height: 0; -} - -.lb-cancel { - display: block; - width: 32px; - height: 32px; - margin: 0 auto; - background: url(../images/loading.gif) no-repeat; -} - -.lb-nav { - position: absolute; - top: 0; - left: 0; - height: 100%; - width: 100%; - z-index: 10; -} - -.lb-container > .nav { - left: 0; -} - -.lb-nav a { - outline: none; - background-image: url('data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=='); -} - -.lb-prev, .lb-next { - height: 100%; - cursor: pointer; - display: block; -} - -.lb-nav a.lb-prev { - width: 34%; - left: 0; - float: left; - background: url(../images/prev.png) left 48% no-repeat; - filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); - opacity: 0; - -webkit-transition: opacity 0.6s; - -moz-transition: opacity 0.6s; - -o-transition: opacity 0.6s; - transition: opacity 0.6s; -} - -.lb-nav a.lb-prev:hover { - filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); - opacity: 1; -} - -.lb-nav a.lb-next { - width: 64%; - right: 0; - float: right; - background: url(../images/next.png) right 48% no-repeat; - filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0); - opacity: 0; - -webkit-transition: opacity 0.6s; - -moz-transition: opacity 0.6s; - -o-transition: opacity 0.6s; - transition: opacity 0.6s; -} - -.lb-nav a.lb-next:hover { - filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); - opacity: 1; -} - -.lb-dataContainer { - margin: 0 auto; - padding-top: 5px; - *zoom: 1; - width: 100%; - -moz-border-radius-bottomleft: 4px; - -webkit-border-bottom-left-radius: 4px; - border-bottom-left-radius: 4px; - -moz-border-radius-bottomright: 4px; - -webkit-border-bottom-right-radius: 4px; - border-bottom-right-radius: 4px; -} - -.lb-dataContainer:after { - content: ""; - display: table; - clear: both; -} - -.lb-data { - padding: 0 4px; - color: #ccc; -} - -.lb-data .lb-details { - width: 85%; - float: left; - text-align: left; - line-height: 1.1em; -} - -.lb-data .lb-caption { - font-size: 13px; - font-weight: bold; - line-height: 1em; -} - -.lb-data .lb-number { - display: block; - clear: left; - padding-bottom: 1em; - font-size: 12px; - color: #999999; -} - -.lb-data .lb-close { - display: block; - float: right; - width: 30px; - height: 30px; - background: url(../images/close.png) top right no-repeat; - text-align: right; - outline: none; - filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70); - opacity: 0.7; - -webkit-transition: opacity 0.2s; - -moz-transition: opacity 0.2s; - -o-transition: opacity 0.2s; - transition: opacity 0.2s; -} - -.lb-data .lb-close:hover { - cursor: pointer; - filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); - opacity: 1; -} diff --git a/public/js/lib/lightbox2/dist/images/close.png b/public/js/lib/lightbox2/dist/images/close.png deleted file mode 100644 index 20baa1db5f..0000000000 Binary files a/public/js/lib/lightbox2/dist/images/close.png and /dev/null differ diff --git a/public/js/lib/lightbox2/dist/images/loading.gif b/public/js/lib/lightbox2/dist/images/loading.gif deleted file mode 100644 index 5087c2a644..0000000000 Binary files a/public/js/lib/lightbox2/dist/images/loading.gif and /dev/null differ diff --git a/public/js/lib/lightbox2/dist/images/next.png b/public/js/lib/lightbox2/dist/images/next.png deleted file mode 100644 index 08365ac84d..0000000000 Binary files a/public/js/lib/lightbox2/dist/images/next.png and /dev/null differ diff --git a/public/js/lib/lightbox2/dist/images/prev.png b/public/js/lib/lightbox2/dist/images/prev.png deleted file mode 100644 index 329fa98602..0000000000 Binary files a/public/js/lib/lightbox2/dist/images/prev.png and /dev/null differ diff --git a/public/js/lib/lightbox2/dist/js/lightbox.min.js b/public/js/lib/lightbox2/dist/js/lightbox.min.js deleted file mode 100644 index 14c35c8688..0000000000 --- a/public/js/lib/lightbox2/dist/js/lightbox.min.js +++ /dev/null @@ -1,13 +0,0 @@ -/*! - * Lightbox v2.8.1 - * by Lokesh Dhakar - * - * More info: - * http://lokeshdhakar.com/projects/lightbox2/ - * - * Copyright 2007, 2015 Lokesh Dhakar - * Released under the MIT license - * https://github.com/lokesh/lightbox2/blob/master/LICENSE - */ -!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],b):"object"==typeof exports?module.exports=b(require("jquery")):a.lightbox=b(a.jQuery)}(this,function(a){function b(b){this.album=[],this.currentImageIndex=void 0,this.init(),this.options=a.extend({},this.constructor.defaults),this.option(b)}return b.defaults={albumLabel:"Image %1 of %2",alwaysShowNavOnTouchDevices:!1,fadeDuration:500,fitImagesInViewport:!0,positionFromTop:50,resizeDuration:700,showImageNumberLabel:!0,wrapAround:!1},b.prototype.option=function(b){a.extend(this.options,b)},b.prototype.imageCountLabel=function(a,b){return this.options.albumLabel.replace(/%1/g,a).replace(/%2/g,b)},b.prototype.init=function(){this.enable(),this.build()},b.prototype.enable=function(){var b=this;a("body").on("click","a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]",function(c){return b.start(a(c.currentTarget)),!1})},b.prototype.build=function(){var b=this;a('
').appendTo(a("body")),this.$lightbox=a("#lightbox"),this.$overlay=a("#lightboxOverlay"),this.$outerContainer=this.$lightbox.find(".lb-outerContainer"),this.$container=this.$lightbox.find(".lb-container"),this.containerTopPadding=parseInt(this.$container.css("padding-top"),10),this.containerRightPadding=parseInt(this.$container.css("padding-right"),10),this.containerBottomPadding=parseInt(this.$container.css("padding-bottom"),10),this.containerLeftPadding=parseInt(this.$container.css("padding-left"),10),this.$overlay.hide().on("click",function(){return b.end(),!1}),this.$lightbox.hide().on("click",function(c){return"lightbox"===a(c.target).attr("id")&&b.end(),!1}),this.$outerContainer.on("click",function(c){return"lightbox"===a(c.target).attr("id")&&b.end(),!1}),this.$lightbox.find(".lb-prev").on("click",function(){return 0===b.currentImageIndex?b.changeImage(b.album.length-1):b.changeImage(b.currentImageIndex-1),!1}),this.$lightbox.find(".lb-next").on("click",function(){return b.currentImageIndex===b.album.length-1?b.changeImage(0):b.changeImage(b.currentImageIndex+1),!1}),this.$lightbox.find(".lb-loader, .lb-close").on("click",function(){return b.end(),!1})},b.prototype.start=function(b){function c(a){d.album.push({link:a.attr("href"),title:a.attr("data-title")||a.attr("title")})}var d=this,e=a(window);e.on("resize",a.proxy(this.sizeOverlay,this)),a("select, object, embed").css({visibility:"hidden"}),this.sizeOverlay(),this.album=[];var f,g=0,h=b.attr("data-lightbox");if(h){f=a(b.prop("tagName")+'[data-lightbox="'+h+'"]');for(var i=0;ij||e.height>i)&&(e.width/j>e.height/i?(h=j,g=parseInt(e.height/(e.width/h),10),d.width(h),d.height(g)):(g=i,h=parseInt(e.width/(e.height/g),10),d.width(h),d.height(g)))),c.sizeContainer(d.width(),d.height())},e.src=this.album[b].link,this.currentImageIndex=b},b.prototype.sizeOverlay=function(){this.$overlay.width(a(window).width()).height(a(document).height())},b.prototype.sizeContainer=function(a,b){function c(){d.$lightbox.find(".lb-dataContainer").width(g),d.$lightbox.find(".lb-prevLink").height(h),d.$lightbox.find(".lb-nextLink").height(h),d.showImage()}var d=this,e=this.$outerContainer.outerWidth(),f=this.$outerContainer.outerHeight(),g=a+this.containerLeftPadding+this.containerRightPadding,h=b+this.containerTopPadding+this.containerBottomPadding;e!==g||f!==h?this.$outerContainer.animate({width:g,height:h},this.options.resizeDuration,"swing",function(){c()}):c()},b.prototype.showImage=function(){this.$lightbox.find(".lb-loader").stop(!0).hide(),this.$lightbox.find(".lb-image").fadeIn("slow"),this.updateNav(),this.updateDetails(),this.preloadNeighboringImages(),this.enableKeyboardNav()},b.prototype.updateNav=function(){var a=!1;try{document.createEvent("TouchEvent"),a=this.options.alwaysShowNavOnTouchDevices?!0:!1}catch(b){}this.$lightbox.find(".lb-nav").show(),this.album.length>1&&(this.options.wrapAround?(a&&this.$lightbox.find(".lb-prev, .lb-next").css("opacity","1"),this.$lightbox.find(".lb-prev, .lb-next").show()):(this.currentImageIndex>0&&(this.$lightbox.find(".lb-prev").show(),a&&this.$lightbox.find(".lb-prev").css("opacity","1")),this.currentImageIndex1&&this.options.showImageNumberLabel){var c=this.imageCountLabel(this.currentImageIndex+1,this.album.length);this.$lightbox.find(".lb-number").text(c).fadeIn("fast")}else this.$lightbox.find(".lb-number").hide();this.$outerContainer.removeClass("animating"),this.$lightbox.find(".lb-dataContainer").fadeIn(this.options.resizeDuration,function(){return b.sizeOverlay()})},b.prototype.preloadNeighboringImages=function(){if(this.album.length>this.currentImageIndex+1){var a=new Image;a.src=this.album[this.currentImageIndex+1].link}if(this.currentImageIndex>0){var b=new Image;b.src=this.album[this.currentImageIndex-1].link}},b.prototype.enableKeyboardNav=function(){a(document).on("keyup.keyboard",a.proxy(this.keyboardAction,this))},b.prototype.disableKeyboardNav=function(){a(document).off(".keyboard")},b.prototype.keyboardAction=function(a){var b=27,c=37,d=39,e=a.keyCode,f=String.fromCharCode(e).toLowerCase();e===b||f.match(/x|o|c/)?this.end():"p"===f||e===c?0!==this.currentImageIndex?this.changeImage(this.currentImageIndex-1):this.options.wrapAround&&this.album.length>1&&this.changeImage(this.album.length-1):("n"===f||e===d)&&(this.currentImageIndex!==this.album.length-1?this.changeImage(this.currentImageIndex+1):this.options.wrapAround&&this.album.length>1&&this.changeImage(0))},b.prototype.end=function(){this.disableKeyboardNav(),a(window).off("resize",this.sizeOverlay),this.$lightbox.fadeOut(this.options.fadeDuration),this.$overlay.fadeOut(this.options.fadeDuration),a("select, object, embed").css({visibility:"visible"})},new b}); -//# sourceMappingURL=lightbox.min.map \ No newline at end of file diff --git a/server/views/coursewares/showHTML.jade b/server/views/coursewares/showHTML.jade index 93e2754bd1..7b83db4168 100644 --- a/server/views/coursewares/showHTML.jade +++ b/server/views/coursewares/showHTML.jade @@ -18,8 +18,6 @@ block content script(src='/js/lib/codemirror/mode/css/css.js') script(src='/js/lib/codemirror/mode/htmlmixed/htmlmixed.js') script(src='/js/lib/codemirror/addon/emmet/emmet.js') - script(src='/js/lib/lightbox2/dist/js/lightbox.min.js') - link(rel='stylesheet', href='/js/lib/lightbox2/dist/css/lightbox.css') .row.courseware-height .col-xs-12.col-sm-12.col-md-3.col-lg-3 .scroll-locker(id = "scroll-locker") @@ -88,7 +86,6 @@ block content a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') × .modal-body .text-center -<<<<<<< HEAD #checkmark-container.row #challenge-checkmark.animated.zoomInDown.delay-half span.completion-icon.ion-checkmark-circled.text-primary @@ -97,9 +94,4 @@ block content #submit-challenge.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit and go to my next challenge (ctrl + enter) else a.btn.btn-lg.btn-primary.btn-block(href='/challenges/next-challenge?id=' + challengeId) Go to my next challenge -======= - .animated.zoomInDown - span.completion-icon.ion-checkmark-circled.text-primary - a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress ->>>>>>> 45e8cef504bada71c3fa805b8e0422208299eada include ../partials/challenge-modals diff --git a/server/views/partials/scripts.jade b/server/views/partials/scripts.jade index 537aee61ec..26ecf3e6bf 100644 --- a/server/views/partials/scripts.jade +++ b/server/views/partials/scripts.jade @@ -28,6 +28,7 @@ script. script(src=rev('/js', 'main.js')) script(src="/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js") script(src="/bower_components/ramda/dist/ramda.min.js") +script(src='/bower_components/lightbox2/dist/js/lightbox.min.js') script. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), diff --git a/server/views/partials/stylesheets.jade b/server/views/partials/stylesheets.jade index 609bf882b5..da6d843378 100644 --- a/server/views/partials/stylesheets.jade +++ b/server/views/partials/stylesheets.jade @@ -1,4 +1,5 @@ link(rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Lato:400|Inconsolata") link(rel="stylesheet" type="text/css" href="/bower_components/cal-heatmap/cal-heatmap.css") link(rel='stylesheet', href='/bower_components/font-awesome/css/font-awesome.min.css') +link(rel='stylesheet', href='/bower_components/lightbox2/dist/css/lightbox.css') link(rel='stylesheet', href=rev('/css', 'main.css'))