Skip to content

Commit 45d8962

Browse files
author
Rafael J. Staib
committed
Add a small part of the architectual change
1 parent b8d0081 commit 45d8962

File tree

8 files changed

+9994
-14
lines changed

8 files changed

+9994
-14
lines changed

jquery.steps.js

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*/
3838
;(function ($, undefined)
3939
{
40-
"use strict";
40+
//"use strict";
4141

4242
/**
4343
* A global unique id count.
@@ -982,18 +982,18 @@
982982
}).promise();
983983
break;
984984

985-
case $.fn.steps.transitionEffect.slideLeft:
986-
var newStep = stepContents.eq(index),
987-
currentStep = stepContents.eq(oldIndex),
988-
outerWidth = currentStep.outerWidth(true),
989-
posFadeOut = (index > oldIndex) ? -(outerWidth) : outerWidth,
990-
posFadeIn = (index > oldIndex) ? outerWidth : -(outerWidth);
991-
992-
currentStep.animate({ left: posFadeOut }, options.transitionEffectSpeed,
993-
function () { $(this).hide().attr("aria-hidden", "true"); }).promise();
994-
newStep.css("left", posFadeIn + "px").show().attr("aria-hidden", "false");
995-
newStep.animate({ left: 0 }, options.transitionEffectSpeed).promise();
996-
break;
985+
case $.fn.steps.transitionEffect.slideLeft:
986+
var newStep = stepContents.eq(index),
987+
currentStep = stepContents.eq(oldIndex),
988+
outerWidth = currentStep.outerWidth(true),
989+
posFadeOut = (index > oldIndex) ? -(outerWidth) : outerWidth,
990+
posFadeIn = (index > oldIndex) ? outerWidth : -(outerWidth);
991+
992+
currentStep.animate({ left: posFadeOut }, options.transitionEffectSpeed,
993+
function () { $(this).hide().attr("aria-hidden", "true"); }).promise();
994+
newStep.css("left", posFadeIn + "px").show().attr("aria-hidden", "false");
995+
newStep.animate({ left: 0 }, options.transitionEffectSpeed).promise();
996+
break;
997997

998998
default:
999999
stepContents.eq(oldIndex).hide().attr("aria-hidden", "true");
@@ -1530,7 +1530,8 @@
15301530
*/
15311531
function getStepPosition(anchor)
15321532
{
1533-
return parseInt(anchor.attr("href").substring(anchor.attr("href").lastIndexOf("-") + 1), 0);
1533+
var href = anchor.attr("href");
1534+
return parseInt(href.substring(href.lastIndexOf("-") + 1), 0);
15341535
}
15351536

15361537
/**

src/banner.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*!
2+
* jQuery Steps Plugin v0.9.7 - A powerful jQuery wizard plugin that supports accessibility and HTML5
3+
* https://github.com/rstaib/jquery-steps
4+
*
5+
* Copyright (c) 2013 Rafael J. Staib
6+
* Released under the MIT license
7+
*
8+
* Follow me on twitter: https://twitter.com/@RafaelStaib
9+
*
10+
* Requires jQuery version 1.4.4 or higher
11+
* Please report issues at: https://github.com/rstaib/jquery-steps/issues
12+
*/
13+
14+
/*
15+
* TODOs:
16+
* - Add tests and styles for loading animation (Spinner)
17+
* - Add tests for add, insert and remove
18+
* - Add tests in general
19+
* - Shrink the comprehensive code
20+
*
21+
* Planed Features:
22+
* - Progress bar
23+
* - Implement preloadContent for async and iframe content types.
24+
* - Implement functionality to skip a certain amount of steps
25+
* - Dynamic settings change (setOptions({ enablePagination: false }))
26+
* - Dynamic step update (setStepContent(0, { title: "", content: "" }))
27+
* - Jump from any page to a specific step (via uri hash tag test.html#steps-uid-1-3)
28+
* - Add Swipe gesture for devices that support touch
29+
* - Allow clicking on the next step even if it is disabled (so that people can decide whether they use prev button or the step button next to the current step)
30+
* - Property to set the step orientation (horizontal/vertical) [stepOrientation: "horizontal" v 0]
31+
*
32+
*/
33+
34+
/**
35+
* @module jQuery.steps
36+
* @requires jQuery (always required), jQuery.cookie (only required if saveState is `true`)
37+
*/
38+
;(function ($, undefined)
39+
{
40+
"use strict";

src/footer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
};

src/globals.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
$.fn.extends({
2+
_ariaPrefix: "aria-",
3+
4+
aria: function (name, value)
5+
{
6+
return this.attr(_ariaPrefix + name, value);
7+
},
8+
9+
removeAria: function (name)
10+
{
11+
return this.attr(_ariaPrefix + name);
12+
},
13+
14+
enableAria: function()
15+
{
16+
return this.removeClass("disabled").aria("disabled", "false");
17+
},
18+
19+
disableAria: function ()
20+
{
21+
return this.addClass("disabled").aria("disabled", "true");
22+
},
23+
24+
hideAria: function ()
25+
{
26+
return this.hide().aria("hidden", "true");
27+
},
28+
29+
showAria: function ()
30+
{
31+
return this.show().aria("hidden", "false");
32+
}
33+
});

0 commit comments

Comments
 (0)