Skip to content

Commit

Permalink
Correct using of JS and CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
Razzo1987 committed Aug 23, 2020
1 parent ff9ab41 commit 340ea4e
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
/*
Code inspired from Image Comparison Slider
https://github.com/CodyHouse/image-comparison-slider
/**
* Image Comparison Slider
* A handy draggable slider to quickly compare 2 images, powered by CSS3 and jQuery.
* https://github.com/CodyHouse/image-comparison-slider
*
* Copyright CodyHouse - https://codyhouse.co
*
* Released under the MIT License
*
* Released on: May 2, 2016
*/

.cs-image-container {
Expand Down
13 changes: 10 additions & 3 deletions src/imagecomparisonslider.js → media/js/imagecomparisonslider.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
/*
Code inspired from Image Comparison Slider
https://github.com/CodyHouse/image-comparison-slider
/**
* Image Comparison Slider
* A handy draggable slider to quickly compare 2 images, powered by CSS3 and jQuery.
* https://github.com/CodyHouse/image-comparison-slider
*
* Copyright CodyHouse - https://codyhouse.co
*
* Released under the MIT License
*
* Released on: May 2, 2016
*/

jQuery(document).ready(function($){
Expand Down
9 changes: 7 additions & 2 deletions mod_joomlalabs_imagecomparisonslider_module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,22 @@
<authorUrl>https://joomlalabs.com</authorUrl>
<copyright>Copyright (C) 2015 - 2020 Joomla!LABS. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>1.0.1</version>
<version>1.1.0</version>
<description>MOD_JOOMLALABS_IMAGECOMPARISONSLIDER_MODULE_XML_DESCRIPTION</description>

<files>
<filename module="mod_joomlalabs_imagecomparisonslider_module">mod_joomlalabs_imagecomparisonslider_module.php</filename>
<folder>tmpl</folder>
<folder>language</folder>
<folder>src</folder>
<folder>media</folder>
<filename>mod_joomlalabs_imagecomparisonslider_module.xml</filename>
</files>

<media destination="mod_joomlalabs_imagecomparisonslider_module" folder="media">
<folder>css</folder>
<folder>js</folder>
</media>

<!-- Update servers -->
<updateservers>
<server type="extension" priority="1" name="Joomla!LABS Image Comparison Slider Module Update Server">
Expand Down
5 changes: 3 additions & 2 deletions tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@

defined('_JEXEC') or die;


$document = $app->getDocument();
$document->addStyleSheet('/modules/mod_joomlalabs_imagecomparisonslider_module/src/imagecomparisonslider.css');
$document->addScript('/modules/mod_joomlalabs_imagecomparisonslider_module/src/imagecomparisonslider.js');
$document->addStyleSheet('/media/mod_joomlalabs_imagecomparisonslider_module/css/imagecomparisonslider.css', array('version' => 'auto'));
$document->addScript('/media/mod_joomlalabs_imagecomparisonslider_module/js/imagecomparisonslider.js', array('version' => 'auto'));

// Access to module parameters
$left_image = $params->get('left_image');
Expand Down

0 comments on commit 340ea4e

Please sign in to comment.