Skip to content

Commit

Permalink
Merge pull request #31 from JoomShaper/2.0.2
Browse files Browse the repository at this point in the history
2.0.2
  • Loading branch information
siddik-web authored Sep 2, 2021
2 parents fadab83 + 69f5645 commit 2ccf702
Show file tree
Hide file tree
Showing 6 changed files with 2,474 additions and 63 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
__MACOSX
robots.txt.dist
*.zip
/api
/dist.zip
/bin
/cache
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public static function isPageBuilderIntegrated($item) {

if ($hasPage) {

$app = JApplication::getInstance('site');
$app = Factory::getApplication();
$router = $app->getRouter();

$lang_code = (isset($item->language) && $item->language && explode('-',$item->language)[0])? explode('-',$item->language)[0] : '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<authorUrl>http://www.joomshaper.com</authorUrl>
<copyright>Copyright (c) 2010- 2021 JoomShaper. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later</license>
<version>2.0.1</version>
<version>2.0.2</version>
<description>Simple Portfolio Component for Joomla</description>
<scriptfile>installer.script.php</scriptfile>

Expand Down
48 changes: 22 additions & 26 deletions components/com_spsimpleportfolio/assets/js/spsimpleportfolio.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,31 @@
* @license GNU General Public License version 2 or later.
*/

jQuery(function($) {

$(window).on('load', function() {
var $container = $('.sp-simpleportfolio-items');
var $sizer = $container.find('.shuffle__sizer');

$container.shuffle({
itemSelector: '.sp-simpleportfolio-item',
sequentialFadeDelay: 150,
sizer: $sizer
});
jQuery(window).on('load', function() {
var $container = jQuery('.sp-simpleportfolio-items');
var $sizer = $container.find('.shuffle__sizer');

$container.shuffle({
itemSelector: '.sp-simpleportfolio-item',
sequentialFadeDelay: 150,
sizer: $sizer
});

// Filters
$('.sp-simpleportfolio-filter li a').on('click', function(event){
event.preventDefault();
var $self = $(this);
var $this = $(this).parent();
// Filters
jQuery('.sp-simpleportfolio-filter li a').on('click', function(event){
event.preventDefault();
var $self = jQuery(this);
var $this = jQuery(this).parent();

if($this.hasClass('active')) {
return;
}
if($this.hasClass('active')) {
return;
}

$self.closest('ul').children().removeClass('active');
$self.parent().addClass('active');
$self.closest('ul').children().removeClass('active');
$self.parent().addClass('active');

var $local = $self.closest('.sp-simpleportfolio').children('.sp-simpleportfolio-items');

$local.shuffle( 'shuffle', $this.data('group') );
});
var $local = $self.closest('.sp-simpleportfolio').children('.sp-simpleportfolio-items');

$local.shuffle( 'shuffle', $this.data('group') );
});

});
85 changes: 50 additions & 35 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,80 +6,95 @@ var uglify = require('gulp-uglify-es').default;

// Create a build
function cleanBuild() {
return src('./build', {read: false, allowEmpty: true})
.pipe(clean());
return src('./build', { read: false, allowEmpty: true }).pipe(clean());
}

function cleanZip() {
return src('./com_spsimpleportfolio.zip', {read: false, allowEmpty: true})
.pipe(clean());
return src('./com_spsimpleportfolio.zip', { read: false, allowEmpty: true }).pipe(clean());
}

function copySite() {
return src(['./components/com_spsimpleportfolio/**/*.*', '!./components/com_spsimpleportfolio/assets/reactjs/**/*.*', '!./components/com_spsimpleportfolio/assets/js/engine.js.map'])
.pipe(dest('build/site'));
return src([
'./components/com_spsimpleportfolio/**/*.*',
'!./components/com_spsimpleportfolio/assets/reactjs/**/*.*',
'!./components/com_spsimpleportfolio/assets/js/engine.js.map',
]).pipe(dest('build/site'));
}

function copyAdmin() {
return src(['./administrator/components/com_spsimpleportfolio/**/*.*', '!./administrator/components/com_spsimpleportfolio/assets/reactjs/**/*.*', '!./administrator/components/com_spsimpleportfolio/installer.script.php', '!./administrator/components/com_spsimpleportfolio/sppagebuilder.xml', '!./administrator/components/com_spsimpleportfolio/assets/js/engine.js.map'])
.pipe(dest('build/admin'));
return src([
'./administrator/components/com_spsimpleportfolio/**/*.*',
'!./administrator/components/com_spsimpleportfolio/assets/reactjs/**/*.*',
'!./administrator/components/com_spsimpleportfolio/installer.script.php',
'!./administrator/components/com_spsimpleportfolio/sppagebuilder.xml',
'!./administrator/components/com_spsimpleportfolio/assets/js/engine.js.map',
]).pipe(dest('build/admin'));
}

function copy_lang_site() {
return src('./language/en-GB/en-GB.com_spsimpleportfolio.ini')
.pipe(dest('build/language/site/en-GB'));
return src('./language/en-GB/en-GB.com_spsimpleportfolio.ini').pipe(dest('build/language/site/en-GB'));
}

function copy_lang_admin() {
return src(['./administrator/language/en-GB/en-GB.com_spsimpleportfolio.ini', './administrator/language/en-GB/en-GB.com_spsimpleportfolio.sys.ini'])
.pipe(dest('build/language/admin/en-GB'));
return src([
'./administrator/language/en-GB/en-GB.com_spsimpleportfolio.ini',
'./administrator/language/en-GB/en-GB.com_spsimpleportfolio.sys.ini',
]).pipe(dest('build/language/admin/en-GB'));
}

function copy_modules() {
return src('./modules/mod_spsimpleportfolio/**/*.*')
.pipe(dest('build/modules/mod_spsimpleportfolio'));
return src('./modules/mod_spsimpleportfolio/**/*.*').pipe(dest('build/modules/mod_spsimpleportfolio'));
}

function copy_modules_lang() {
return src('./language/en-GB/en-GB.mod_spsimpleportfolio.ini')
.pipe(dest('build/modules/mod_spsimpleportfolio/language'));
return src('./language/en-GB/en-GB.mod_spsimpleportfolio.ini').pipe(
dest('build/modules/mod_spsimpleportfolio/language')
);
}

function copy_installer() {
return src(['./administrator/components/com_spsimpleportfolio/installer.script.php', './administrator/components/com_spsimpleportfolio/spsimpleportfolio.xml'])
.pipe(dest('build'));
return src([
'./administrator/components/com_spsimpleportfolio/installer.script.php',
'./administrator/components/com_spsimpleportfolio/spsimpleportfolio.xml',
]).pipe(dest('build'));
}

function minify_admin_css() {
return src(['./build/admin/assets/css/*.css'])
.pipe(minifyCSS())
.pipe(dest('./build/admin/assets/css/'));
return src(['./build/admin/assets/css/*.css']).pipe(minifyCSS()).pipe(dest('./build/admin/assets/css/'));
}

function minify_site_css() {
return src(['./build/site/assets/css/*.css'])
.pipe(minifyCSS())
.pipe(dest('./build/site/assets/css/'));
return src(['./build/site/assets/css/*.css']).pipe(minifyCSS()).pipe(dest('./build/site/assets/css/'));
}

function minify_site_js() {
return src(['./build/site/assets/js/*.js', '!build/admin/assets/js/featherlight.min.js', '!build/admin/assets/js/jquery.shuffle.modernizr.min.js'])
.pipe(uglify())
.pipe(dest('./build/site/assets/js/'));
return src([
'./build/site/assets/js/*.js',
'!build/admin/assets/js/featherlight.min.js',
'!build/admin/assets/js/jquery.shuffle.modernizr.min.js',
])
.pipe(uglify())
.pipe(dest('./build/site/assets/js/'));
}

function minify_admin_js() {
return src(['./build/admin/assets/js/*.js'])
.pipe(uglify())
.pipe(dest('./build/admin/assets/js/'));
return src(['./build/admin/assets/js/*.js']).pipe(uglify()).pipe(dest('./build/admin/assets/js/'));
}

function makeZip() {
return src('./build/**/*.*')
.pipe(zip('com_spsimpleportfolio.zip'))
.pipe(dest('./'));
return src('./build/**/*.*').pipe(zip('com_spsimpleportfolio_v2.0.2.zip')).pipe(dest('./'));
}

exports.copy = series(cleanBuild, cleanZip, copySite, copyAdmin, copy_lang_site, copy_lang_admin, copy_modules, copy_modules_lang, copy_installer);
exports.copy = series(
cleanBuild,
cleanZip,
copySite,
copyAdmin,
copy_lang_site,
copy_lang_admin,
copy_modules,
copy_modules_lang,
copy_installer
);
exports.minify = series(minify_admin_css, minify_site_css, minify_site_js, minify_admin_js);
exports.default = series(exports.copy, exports.minify, makeZip, cleanBuild);
exports.default = series(exports.copy, exports.minify, makeZip, cleanBuild);
Loading

0 comments on commit 2ccf702

Please sign in to comment.