Skip to content

Commit

Permalink
Changes for version 0.3.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
muratpurc committed Nov 11, 2019
1 parent a5ab3b7 commit 71073b7
Show file tree
Hide file tree
Showing 17 changed files with 164 additions and 75 deletions.
9 changes: 7 additions & 2 deletions cms/includes/class.module.mpnivoslider.input.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
* @package CONTENIDO_Modules
* @subpackage mpNivoSlider
* @author Murat Purc <murat@purc.de>
* @copyright Copyright (c) 2011-2012 Murat Purc (http://www.purc.de)
* @copyright Copyright (c) 2011-2013 Murat Purc (http://www.purc.de)
* @license http://www.gnu.org/licenses/gpl-2.0.html - GNU General Public License, version 2
* @version $Id: class.module.mpnivoslider.input.php 5 2012-09-07 19:22:49Z murat $
* @version $Id: class.module.mpnivoslider.input.php 34 2013-11-14 19:53:12Z murat $
*/


Expand Down Expand Up @@ -92,6 +92,11 @@ protected function _validate()
$this->imageQuality = self::DEFAULT_QUALITY;
}

$this->responsiveMode = (int) $this->responsiveMode;
if ($this->responsiveMode < 0) {
$this->responsiveMode = '';
}

$this->maxCachetime = (int) $this->maxCachetime;
if ($this->maxCachetime < 0) {
$this->maxCachetime = '';
Expand Down
32 changes: 23 additions & 9 deletions cms/includes/class.module.mpnivoslider.output.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
* @package CONTENIDO_Modules
* @subpackage mpNivoSlider
* @author Murat Purc <murat@purc.de>
* @copyright Copyright (c) 2011-2012 Murat Purc (http://www.purc.de)
* @copyright Copyright (c) 2011-2013 Murat Purc (http://www.purc.de)
* @license http://www.gnu.org/licenses/gpl-2.0.html - GNU General Public License, version 2
* @version $Id: class.module.mpnivoslider.output.php 16 2013-03-23 14:22:06Z murat $
* @version $Id: class.module.mpnivoslider.output.php 34 2013-11-14 19:53:12Z murat $
*/


Expand Down Expand Up @@ -101,6 +101,12 @@ protected function _validate()
$this->imageQuality = self::DEFAULT_QUALITY;
}

// responsive mode flag
$this->responsiveMode = (int) $this->responsiveMode;
if ($this->responsiveMode < 0) {
$this->responsiveMode = '';
}

// max cachetime in minutes 4 resized images
$this->maxCachetime = (int) $this->maxCachetime;
if ($this->maxCachetime < 0) {
Expand Down Expand Up @@ -332,11 +338,14 @@ public function generateOutput()

// additional styles
$moduleStyle = '';
if (is_numeric($this->maxWidth)) {
$moduleStyle .= 'width:' . $this->maxWidth . 'px;';
}
if (is_numeric($this->maxHeight)) {
$moduleStyle .= 'height:' . $this->maxHeight . 'px;';
if (!$this->responsiveMode) {
// add module dimensions only if responsive mode is off
if (is_numeric($this->maxWidth)) {
$moduleStyle .= 'width:' . $this->maxWidth . 'px;';
}
if (is_numeric($this->maxHeight)) {
$moduleStyle .= 'height:' . $this->maxHeight . 'px;';
}
}
$oTemplate->set('s', 'MODULE.STYLE', $moduleStyle);

Expand Down Expand Up @@ -451,6 +460,11 @@ protected function _getImageData($file, $maxWidth, $maxHeight, $oUploadItem)
$downsizeFactor = $maxHeight / $size[1];
}

// prevent scalip up of small images
if ($downsizeFactor > 1) {
$downsizeFactor = 1;
}

// calculate dimensions
$maxWidth = round($size[0] * $downsizeFactor);
$maxHeight = round($size[1] * $downsizeFactor);
Expand All @@ -468,9 +482,9 @@ protected function _getImageData($file, $maxWidth, $maxHeight, $oUploadItem)
$file = $this->_sUploadDir . $oUploadItem->get('dirname') . $oUploadItem->get('filename');
}

// get'n store image dimensions
// get'n store image dimensions, but save width/height attributes only for disabled responsive mode
$size = $this->_getImageSize($file);
$attr = (is_array($size)) ? ' ' . $size[3] : '';
$attr = (is_array($size) && !$this->responsiveMode) ? ' ' . $size[3] : '';

// add new images array item
return array(
Expand Down
7 changes: 4 additions & 3 deletions cms/includes/class.module.mpnivoslider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
* @package CONTENIDO_Modules
* @subpackage mpNivoSlider
* @author Murat Purc <murat@purc.de>
* @copyright Copyright (c) 2011-2012 Murat Purc (http://www.purc.de)
* @copyright Copyright (c) 2011-2013 Murat Purc (http://www.purc.de)
* @license http://www.gnu.org/licenses/gpl-2.0.html - GNU General Public License, version 2
* @version $Id: class.module.mpnivoslider.php 5 2012-09-07 19:22:49Z murat $
* @version $Id: class.module.mpnivoslider.php 34 2013-11-14 19:53:12Z murat $
*/


Expand All @@ -37,7 +37,7 @@ abstract class ModuleMpNivoSliderAbstract
* Default quality for downsized jpeg images
* @var int
*/
const DEFAULT_QUALITY = 85;
const DEFAULT_QUALITY = 90;

/**
* Default image width
Expand Down Expand Up @@ -111,6 +111,7 @@ abstract class ModuleMpNivoSliderAbstract
'selectedOrder' => '',
'darkImages' => '',
'imageQuality' => '',
'responsiveMode' => '',

'effect' => '',
'slices' => '',
Expand Down
2 changes: 1 addition & 1 deletion cms/js/nivo-slider/demo/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</div>

</div>
<script type="text/javascript" src="scripts/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="scripts/jquery-1.9.0.min.js"></script>
<script type="text/javascript" src="../jquery.nivo.slider.js"></script>
<script type="text/javascript">
$(window).load(function() {
Expand Down
4 changes: 0 additions & 4 deletions cms/js/nivo-slider/demo/scripts/jquery-1.7.1.min.js

This file was deleted.

4 changes: 4 additions & 0 deletions cms/js/nivo-slider/demo/scripts/jquery-1.9.0.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions cms/js/nivo-slider/jquery.nivo.slider.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* jQuery Nivo Slider v3.1
* jQuery Nivo Slider v3.2
* http://nivo.dev7studios.com
*
* Copyright 2012, Dev7studios
Expand Down Expand Up @@ -74,7 +74,7 @@
}

// Set first background
var sliderImg = $('<img class="nivo-main-image" src="#" />');
var sliderImg = $('<img/>').addClass('nivo-main-image');
sliderImg.attr('src', vars.currentImage.attr('src')).show();
slider.append(sliderImg);

Expand Down Expand Up @@ -123,15 +123,15 @@
if(settings.directionNav){
slider.append('<div class="nivo-directionNav"><a class="nivo-prevNav">'+ settings.prevText +'</a><a class="nivo-nextNav">'+ settings.nextText +'</a></div>');

$('a.nivo-prevNav', slider).live('click', function(){
$(slider).on('click', 'a.nivo-prevNav', function(){
if(vars.running) { return false; }
clearInterval(timer);
timer = '';
vars.currentSlide -= 2;
nivoRun(slider, kids, settings, 'prev');
});

$('a.nivo-nextNav', slider).live('click', function(){
$(slider).on('click', 'a.nivo-nextNav', function(){
if(vars.running) { return false; }
clearInterval(timer);
timer = '';
Expand Down
4 changes: 2 additions & 2 deletions cms/js/nivo-slider/jquery.nivo.slider.pack.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions cms/js/nivo-slider/mpNivoSlider.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
* @package CONTENIDO_Modules
* @subpackage mpNivoSlider
* @author Murat Purc <murat@purc.de>
* @copyright Copyright (c) 2011-2012 Murat Purc (http://www.purc.de)
* @copyright Copyright (c) 2011-2013 Murat Purc (http://www.purc.de)
* @license http://www.gnu.org/licenses/gpl-2.0.html - GNU General Public License, version 2
* @version $Id: mpNivoSlider.css 4 2012-09-07 19:20:11Z murat $
* @version $Id: mpNivoSlider.css 34 2013-11-14 19:53:12Z murat $
*/


Expand Down
5 changes: 4 additions & 1 deletion cms/js/nivo-slider/nivo-slider.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* jQuery Nivo Slider v3.1
* jQuery Nivo Slider v3.2
* http://nivo.dev7studios.com
*
* Copyright 2012, Dev7studios
Expand Down Expand Up @@ -38,6 +38,9 @@
margin:0;
z-index:6;
display:none;
background:white;
filter:alpha(opacity=0);
opacity:0;
}
/* The slices and boxes in the Slider */
.nivo-slice {
Expand Down
37 changes: 28 additions & 9 deletions cms/js/nivo-slider/themes/default/default.css
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
/*
Skin Name: Nivo Slider Default Theme
Skin URI: http://nivo.dev7studios.com
Skin Type: flexible
Description: The default skin for the Nivo Slider.
Version: 1.0
Version: 1.3
Author: Gilbert Pellegrom
Author URI: http://dev7studios.com
Supports Thumbs: true
*/

.theme-default .nivoSlider {
position:relative;
background:#fff url(loading.gif) no-repeat 50% 50%;
margin-bottom:10px;
-webkit-box-shadow: 0px 1px 5px 0px #4a4a4a;
-moz-box-shadow: 0px 1px 5px 0px #4a4a4a;
box-shadow: 0px 1px 5px 0px #4a4a4a;
Expand All @@ -27,20 +28,17 @@ Author URI: http://dev7studios.com
}

.theme-default .nivo-controlNav {
position:absolute;
left:50%;
bottom:-42px;
margin-left:-40px; /* Tweak this to center bullets */
text-align: center;
padding: 20px 0;
}
.theme-default .nivo-controlNav a {
display:block;
display:inline-block;
width:22px;
height:22px;
background:url(bullets.png) no-repeat;
text-indent:-9999px;
border:0;
margin-right:3px;
float:left;
margin: 0 2px;
}
.theme-default .nivo-controlNav a.active {
background-position:0 -22px;
Expand All @@ -53,7 +51,13 @@ Author URI: http://dev7studios.com
background:url(arrows.png) no-repeat;
text-indent:-9999px;
border:0;
opacity: 0;
-webkit-transition: all 200ms ease-in-out;
-moz-transition: all 200ms ease-in-out;
-o-transition: all 200ms ease-in-out;
transition: all 200ms ease-in-out;
}
.theme-default:hover .nivo-directionNav a { opacity: 1; }
.theme-default a.nivo-nextNav {
background-position:-30px 0;
right:15px;
Expand All @@ -71,4 +75,19 @@ Author URI: http://dev7studios.com
}
.theme-default .nivo-caption a:hover {
color:#fff;
}

.theme-default .nivo-controlNav.nivo-thumbs-enabled {
width: 100%;
}
.theme-default .nivo-controlNav.nivo-thumbs-enabled a {
width: auto;
height: auto;
background: none;
margin-bottom: 5px;
}
.theme-default .nivo-controlNav.nivo-thumbs-enabled img {
display: block;
width: 120px;
height: auto;
}
Loading

0 comments on commit 71073b7

Please sign in to comment.