Skip to content

Commit

Permalink
Merge pull request #30 from sylouuu/feature/add-thumb-event
Browse files Browse the repository at this point in the history
added thumbEvent property #29
  • Loading branch information
sylouuu authored Jun 28, 2016
2 parents c82d4d0 + 78623dc commit 11e6e6d
Show file tree
Hide file tree
Showing 19 changed files with 471 additions and 346 deletions.
22 changes: 19 additions & 3 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{
"disallowQuotedKeysInObjects": true,
"requireCapitalizedConstructors": true,
"requireDotNotation": true,
"requireMatchingFunctionName": true,
"requireSemicolons": true,
"requireSpaceBetweenArguments": true,
"requireSpacesInForStatement": true,
"requireCurlyBraces": [
"if",
"else",
Expand All @@ -8,6 +15,11 @@
"try",
"catch"
],
"requireSpaceBeforeKeywords": [
"else",
"while",
"catch"
],
"requireSpaceAfterKeywords": [
"if",
"else",
Expand All @@ -28,9 +40,11 @@
"beforeAlternate": true
},
"requireSpacesInFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
"requireSpacesInAnonymousFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
"requireSpacesInNamedFunctionExpression": {
Expand All @@ -42,15 +56,18 @@
"beforeOpeningCurlyBrace": true
},
"requireSpacesInFunction": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
},
"requireMultipleVarDecl": true,
"requireBlocksOnNewline": true,
"disallowEmptyBlocks": true,
"disallowSpacesInsideArrayBrackets": "all",
"disallowSpacesInsideParentheses": true,
"disallowSpacesInsideParenthesizedExpression": true,
"requireSpacesInsideObjectBrackets": "all",
"disallowSpaceAfterObjectKeys": true,
"requireSpaceBeforeObjectValues": true,
"requireCommaBeforeLineBreak": true,
"requireOperatorBeforeLineBreak": [
"?",
Expand All @@ -77,19 +94,18 @@
"validateQuoteMarks": "'",
"validateIndentation": 4,
"disallowMixedSpacesAndTabs": true,
"disallowTrailingWhitespace": true,
"disallowTrailingComma": true,
"disallowKeywordsOnNewLine": ["else"],
"requireLineFeedAtFileEnd": true,
"maximumLineLength": {
"value": 200,
"value": 600,
"allowComments": true,
"allowUrlComments": true,
"allowRegex": true
},
"requireCapitalizedConstructors": true,
"safeContextKeyword": ["that", "self"],
"disallowYodaConditions": true,
"requireSpaceAfterLineComment": true,
"requireSpaceAfterLineComment": false,
"disallowNewlineBeforeBlockStatements": true
}
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "desoslide",
"version": "2.1.0",
"version": "2.2.0",
"homepage": "https://github.com/sylouuu/desoslide",
"description": "Take control of your slideshow with this powerful jQuery plugin",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion desoslide.jquery.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "desoslide",
"title": "desoSlide",
"version": "2.1.0",
"version": "2.2.0",
"description": "Take control of your slideshow with this powerful jQuery plugin",
"keywords": [
"slider",
Expand Down
2 changes: 1 addition & 1 deletion dist/css/jquery.desoslide.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* desoslide - Take control of your slideshow with this powerful jQuery plugin
* @version 2.1.0
* @version 2.2.0
* @link https://github.com/sylouuu/desoslide
* @license MIT
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/css/jquery.desoslide.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/js/jquery.desoslide.min.js

Large diffs are not rendered by default.

37 changes: 19 additions & 18 deletions doc/assets/js/app/demo.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
$(function() {
$(function () {

// Demo
// ----------------------------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------------------------

$('a.back-to-top').on('click', function(e) {
$('a.back-to-top').on('click', function (e) {
e.preventDefault();

$('html, body').stop().animate({
Expand All @@ -16,10 +16,10 @@ $(function() {
// ----------------------------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------------------------

$('#toggle_thumbs').on('click', function(e) {
$('#toggle_thumbs').on('click', function (e) {
e.preventDefault();

var $this = $(this),
var $this = $(this),
$slideshow_1_thumbs_1 = $('#slideshow_1_thumbs_1'),
$slideshow_1_thumbs_2 = $('#slideshow_1_thumbs_2');

Expand All @@ -41,8 +41,8 @@ $(function() {
// Syntax highlighting
// ----------------------------------------------------------------------------------------------------------

var syntaxHighlight = function() {
$('pre code').each(function(i, e) {
var syntaxHighlight = function () {
$('pre code').each(function (i, e) {
hljs.highlightBlock(e);
});
};
Expand Down Expand Up @@ -106,22 +106,22 @@ $(function() {
};

// Change provider
var changeProvider = function(provider, effect) {
var changeProvider = function (provider, effect) {
var tmp = '';

$.each(effects[provider], function(i, item) {
if(effect !== undefined && effect === item) {
tmp += '<option value="'+ item +'" selected="selected">'+ item +'</option>';
$.each(effects[provider], function (i, item) {
if (effect !== undefined && effect === item) {
tmp += '<option value="' + item + '" selected="selected">' + item + '</option>';
} else {
tmp += '<option value="'+ item +'">'+ item +'</option>';
tmp += '<option value="' + item + '">' + item + '</option>';
}
});

$effect_name.html(tmp);
};

// Set effect
var setEffect = function(provider, effect) {
var setEffect = function (provider, effect) {
// Pausing
$slideshow1.desoSlide('pause');

Expand All @@ -134,26 +134,26 @@ $(function() {
var code = "$('#slideshow').desoSlide({\n";
code += " thumbs: $('ul.slideshow_thumbs li > a'),\n";
code += " effect: {\n";
code += " provider: '"+ $effect_provider.val() +"',\n";
code += " name: '"+ $effect_name.val() +"'\n";
code += " provider: '" + $effect_provider.val() + "',\n";
code += " name: '" + $effect_name.val() + "'\n";
code += " }\n";
code += "});";

$('#html_code1').html('&lt;link rel="stylesheet" href="path/to/'+ $effect_provider.val() +'.min.css"&gt;');
$('#html_code1').html('&lt;link rel="stylesheet" href="path/to/' + $effect_provider.val() + '.min.css"&gt;');
$('#js_code1').html(code);

syntaxHighlight();
};

// On change effect provider
$effect_provider.on('change', function() {
$effect_provider.on('change', function () {
changeProvider($(this).val());

setEffect();
});

// On change effect name
$effect_name.on('change', function() {
$effect_name.on('change', function () {
setEffect();
});

Expand Down Expand Up @@ -207,7 +207,8 @@ $(function() {

$('#slideshow2').desoSlide({
thumbs: $('#slideshow2_thumbs li > a'),
first: 2
first: 2,
thumbEvent: 'mouseover'
});

// Demo 3
Expand Down
6 changes: 3 additions & 3 deletions doc/assets/js/app/documentation.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
$(function() {
$(function () {

$('a.back-to-top').on('click', function(e) {
$('a.back-to-top').on('click', function (e) {
e.preventDefault();

$('html, body').stop().animate({
scrollTop: $('html, body').offset().top
}, 1000);
});

$('pre code').each(function(i, e) {
$('pre code').each(function (i, e) {
hljs.highlightBlock(e);
});

Expand Down
6 changes: 3 additions & 3 deletions doc/assets/js/app/home.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
$(function() {
$(function () {

$('a.back-to-top').on('click', function(e) {
$('a.back-to-top').on('click', function (e) {
e.preventDefault();

$('html, body').stop().animate({
scrollTop: $('html, body').offset().top
}, 1000);
});

$('pre code').each(function(i, e) {
$('pre code').each(function (i, e) {
hljs.highlightBlock(e);
});

Expand Down
6 changes: 3 additions & 3 deletions doc/assets/js/app/release-notes.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
$(function() {
$(function () {

$('a.back-to-top').on('click', function(e) {
$('a.back-to-top').on('click', function (e) {
e.preventDefault();

$('html, body').stop().animate({
scrollTop: $('html, body').offset().top
}, 1000);
});

$('pre code').each(function(i, e) {
$('pre code').each(function (i, e) {
hljs.highlightBlock(e);
});

Expand Down
7 changes: 4 additions & 3 deletions doc/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ <h3 class="page-header">
<div class="row">
<div class="col-lg-12 col-md-12">
<p>
Show the third slide at loading.
Show the third slide at loading, large image shown on mouse over, not click.
</p>
</div>
</div>
Expand Down Expand Up @@ -318,6 +318,7 @@ <h4>Result</h4>
<h4>Code</h4>
<pre><code>$('#slideshow').desoSlide({
thumbs: $('#slideshow_thumbs li > a'),
thumbEvent: 'mouseover',
first: 2
});</code></pre>
</article>
Expand Down Expand Up @@ -588,7 +589,7 @@ <h3 class="page-header">
</article>

<article class="col-lg-3 col-md-3 col-sm-3 text-right">
<p>&copy; 2014 desoSlide</p>
<p>&copy; 2014-2016 desoSlide</p>
</article>
</div>
</div>
Expand All @@ -598,7 +599,7 @@ <h3 class="page-header">
<script src="assets/js/vendor/bootstrap/bootstrap.min.js"></script>
<script src="assets/js/vendor/highlight/highlight.pack.js"></script>

<script src="../src/js/jquery.desoslide.js"></script>
<script src="../dist/js/jquery.desoslide.min.js"></script>
<script src="assets/js/app/demo.js"></script>

</body>
Expand Down
39 changes: 24 additions & 15 deletions doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ <h1>Documentation</h1>
<div class="row">
<article class="col-lg-12">
<p>
Documentation covers: 2.1.0
Documentation covers: 2.2.0
</p>
</article>
</div>
Expand Down Expand Up @@ -221,6 +221,7 @@ <h3 id="configuration" class="page-header">

<pre><code>defaults = {
thumbs: null, // An anchors (`&lt;a&gt;`) collection
thumbEvent: 'click', // What event to capture on thumbnail ('click', 'mouseover')
imageClass: 'img-responsive', // Image class(es)
auto: {
load: true, // Preloading images
Expand All @@ -240,19 +241,20 @@ <h3 id="configuration" class="page-header">
keys: false // Able to control by using the keyboard shortcuts (left/space/right)
},
events: {
onThumbClick: null, // On thumb click
onImageShow: null, // On image show
onImageShown: null, // On image shown
onImageHide: null, // On image hide
onImageHidden: null, // On image hidden
onImageClick: null, // On image click
onPrev: null, // On previous
onPause: null, // On pause
onPlay: null, // On play
onNext: null, // On next
onError: null, // On error
onWarning: null, // On warning
onSuccess: null // On success
onThumbClick: null, // On thumb click if thumbEvent: 'click'
onThumbMouseOver: null, // On thumb mouseover if thumbEvent: 'mouseover'
onImageShow: null, // On image show
onImageShown: null, // On image shown
onImageHide: null, // On image hide
onImageHidden: null, // On image hidden
onImageClick: null, // On image click
onPrev: null, // On previous
onPause: null, // On pause
onPlay: null, // On play
onNext: null, // On next
onError: null, // On error
onWarning: null, // On warning
onSuccess: null // On success
}
}</code></pre>

Expand Down Expand Up @@ -508,6 +510,10 @@ <h3 id="events" class="page-header">
// on thumbClick
});

$('#slideshow').on('thumbMouseOver.desoslide', function() {
// on thumbMouseOver
});

$('#slideshow').on('imageShow.desoslide', function() {
// on imageShow
});
Expand Down Expand Up @@ -565,6 +571,9 @@ <h3 id="events" class="page-header">
'thumbClick.desoslide': function() {
// on thumbClick
},
'thumbMouseOver.desoslide': function() {
// on thumbMouseOver
},
'imageShow.desoslide': function() {
// on imageShow
},
Expand Down Expand Up @@ -749,7 +758,7 @@ <h4>Jaoued</h4>
</article>

<article class="col-lg-3 col-md-3 col-sm-3 text-right">
<p>&copy; 2014 desoSlide</p>
<p>&copy; 2014-2016 desoSlide</p>
</article>
</div>
</div>
Expand Down
Loading

0 comments on commit 11e6e6d

Please sign in to comment.