Skip to content

Commit 5776187

Browse files
author
Rafael J. Staib
committed
Rename global helper methods to avoid future conflicts and remove footer file
1 parent 961c6b6 commit 5776187

File tree

6 files changed

+109
-110
lines changed

6 files changed

+109
-110
lines changed

build/jquery.steps.js

+54-54
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jquery-steps v1.0.0pre - 08/11/2013
2+
* jquery-steps v1.0.0pre - 08/13/2013
33
* Copyright (c) 2013 Rafael J. Staib (http://www.jquery-steps.com)
44
* Licensed under MIT http://www.opensource.org/licenses/MIT
55
*/
@@ -576,12 +576,12 @@ function loadAsyncContent(wizard, options, state)
576576
break;
577577

578578
case contentMode.async:
579-
var currentStepContent = getStepPanel(wizard, state.currentIndex).aria("busy", "true")
579+
var currentStepContent = getStepPanel(wizard, state.currentIndex)._aria("busy", "true")
580580
.empty().append(renderTemplate(options.loadingTemplate, { text: options.labels.loading }));
581581

582582
$.ajax({ url: currentStep.contentUrl, cache: false }).done(function (data)
583583
{
584-
currentStepContent.empty().html(data).aria("busy", "false").data("loaded", "1");
584+
currentStepContent.empty().html(data)._aria("busy", "false").data("loaded", "1");
585585
});
586586
break;
587587
}
@@ -612,14 +612,14 @@ function paginationClick(wizard, options, state, index)
612612
isDisabled = parent.hasClass("disabled");
613613

614614
// Enable the step to make the anchor clickable!
615-
parent.enableAria();
615+
parent._enableAria();
616616
anchor.click();
617617

618618
// An error occured
619619
if (oldIndex === state.currentIndex && isDisabled)
620620
{
621621
// Disable the step again if current index has not changed; prevents click action.
622-
parent.disableAria();
622+
parent._disableAria();
623623
return false;
624624
}
625625

@@ -685,52 +685,52 @@ function refreshPagination(wizard, options, state)
685685
var previous = wizard.find(".actions a[href$='#previous']").parent();
686686
if (state.currentIndex > 0)
687687
{
688-
previous.enableAria();
688+
previous._enableAria();
689689
}
690690
else
691691
{
692-
previous.disableAria();
692+
previous._disableAria();
693693
}
694694
}
695695

696696
if (options.enableFinishButton && options.showFinishButtonAlways)
697697
{
698698
if (state.stepCount === 0)
699699
{
700-
finish.disableAria();
701-
next.disableAria();
700+
finish._disableAria();
701+
next._disableAria();
702702
}
703703
else if (state.stepCount > 1 && state.stepCount > (state.currentIndex + 1))
704704
{
705-
finish.enableAria();
706-
next.enableAria();
705+
finish._enableAria();
706+
next._enableAria();
707707
}
708708
else
709709
{
710-
finish.enableAria();
711-
next.disableAria();
710+
finish._enableAria();
711+
next._disableAria();
712712
}
713713
}
714714
else
715715
{
716716
if (state.stepCount === 0)
717717
{
718-
finish.hideAria();
719-
next.showAria().disableAria();
718+
finish._hideAria();
719+
next._showAria()._disableAria();
720720
}
721721
else if (state.stepCount > (state.currentIndex + 1))
722722
{
723-
finish.hideAria();
724-
next.showAria().enableAria();
723+
finish._hideAria();
724+
next._showAria()._enableAria();
725725
}
726726
else if (!options.enableFinishButton)
727727
{
728-
next.disableAria();
728+
next._disableAria();
729729
}
730730
else
731731
{
732-
finish.showAria();
733-
next.hideAria();
732+
finish._showAria();
733+
next._hideAria();
734734
}
735735
}
736736
}
@@ -756,13 +756,13 @@ function refreshStepNavigation(wizard, options, state, oldIndex)
756756
if (oldIndex != null)
757757
{
758758
var oldStepAnchor = getStepAnchor(wizard, oldIndex);
759-
oldStepAnchor.parent().addClass("done").removeClass("error").deselectAria();
759+
oldStepAnchor.parent().addClass("done").removeClass("error")._deselectAria();
760760
stepTitles.eq(oldIndex).removeClass("current").next(".body").removeClass("current");
761761
currentInfo = oldStepAnchor.find(".current-info");
762762
currentOrNewStepAnchor.focus();
763763
}
764764

765-
currentOrNewStepAnchor.prepend(currentInfo).parent().selectAria().removeClass("done").enableAria();
765+
currentOrNewStepAnchor.prepend(currentInfo).parent()._selectAria().removeClass("done")._enableAria();
766766
stepTitles.eq(state.currentIndex).addClass("current").next(".body").addClass("current");
767767
}
768768

@@ -786,13 +786,13 @@ function refreshSteps(wizard, options, state, index)
786786
var uniqueStepId = uniqueId + _tabSuffix + i,
787787
uniqueBodyId = uniqueId + _tabpanelSuffix + i,
788788
uniqueHeaderId = uniqueId + _titleSuffix + i,
789-
title = wizard.find(".title").eq(i).setId(uniqueHeaderId);
789+
title = wizard.find(".title").eq(i)._setId(uniqueHeaderId);
790790

791-
wizard.find(".steps a").eq(i).setId(uniqueStepId)
792-
.aria("controls", uniqueBodyId).attr("href", "#" + uniqueHeaderId)
791+
wizard.find(".steps a").eq(i)._setId(uniqueStepId)
792+
._aria("controls", uniqueBodyId).attr("href", "#" + uniqueHeaderId)
793793
.html(renderTemplate(options.titleTemplate, { index: i + 1, title: title.html() }));
794-
wizard.find(".body").eq(i).setId(uniqueBodyId)
795-
.aria("labelledby", uniqueHeaderId);
794+
wizard.find(".body").eq(i)._setId(uniqueBodyId)
795+
._aria("labelledby", uniqueHeaderId);
796796
}
797797
}
798798

@@ -899,7 +899,7 @@ function render(wizard, options, state)
899899
});
900900

901901
// Make the start step visible
902-
stepContents.eq(state.currentIndex).showAria();
902+
stepContents.eq(state.currentIndex)._showAria();
903903

904904
stepTitles.each(function (index)
905905
{
@@ -926,8 +926,8 @@ function renderBody(wizard, body, index)
926926
uniqueBodyId = uniqueId + _tabpanelSuffix + index,
927927
uniqueHeaderId = uniqueId + _titleSuffix + index;
928928

929-
body.setId(uniqueBodyId).attr("role", "tabpanel").aria("labelledby", uniqueHeaderId)
930-
.addClass("body").hideAria();
929+
body._setId(uniqueBodyId).attr("role", "tabpanel")._aria("labelledby", uniqueHeaderId)
930+
.addClass("body")._hideAria();
931931
}
932932

933933
/**
@@ -1025,15 +1025,15 @@ function renderTitle(wizard, options, state, header, index)
10251025

10261026
if (!options.enableAllSteps)
10271027
{
1028-
stepItem.disableAria();
1028+
stepItem._disableAria();
10291029
}
10301030

10311031
if (state.currentIndex > index)
10321032
{
1033-
stepItem.enableAria().addClass("done");
1033+
stepItem._enableAria().addClass("done");
10341034
}
10351035

1036-
header.setId(uniqueHeaderId).attr("tabindex", "-1").addClass("title");
1036+
header._setId(uniqueHeaderId).attr("tabindex", "-1").addClass("title");
10371037

10381038
if (index === 0)
10391039
{
@@ -1096,14 +1096,14 @@ function startTransitionEffect(wizard, options, state, index, oldIndex)
10961096
state.transitionElement = newStep;
10971097
currentStep[hide](effectSpeed, function ()
10981098
{
1099-
var wizard = $(this).hideAria().parents(":has(.steps)"),
1099+
var wizard = $(this)._hideAria().parents(":has(.steps)"),
11001100
state = getState(wizard);
11011101

11021102
if (state.transitionElement)
11031103
{
11041104
state.transitionElement[show](effectSpeed, function ()
11051105
{
1106-
$(this).showAria();
1106+
$(this)._showAria();
11071107
});
11081108
state.transitionElement = null;
11091109
}
@@ -1117,14 +1117,14 @@ function startTransitionEffect(wizard, options, state, index, oldIndex)
11171117
posLeft = currentStep.parent().position().left;
11181118

11191119
currentStep.animate({ left: posFadeOut }, effectSpeed,
1120-
function () { $(this).hideAria(); }).promise();
1121-
newStep.css("left", posFadeIn + "px").showAria()
1120+
function () { $(this)._hideAria(); }).promise();
1121+
newStep.css("left", posFadeIn + "px")._showAria()
11221122
.animate({ left: posLeft }, effectSpeed).promise();
11231123
break;
11241124

11251125
default:
1126-
currentStep.hideAria();
1127-
newStep.showAria();
1126+
currentStep._hideAria();
1127+
newStep._showAria();
11281128
break;
11291129
}
11301130
}
@@ -1883,47 +1883,47 @@ var defaults = $.fn.steps.defaults = {
18831883
};
18841884

18851885
$.fn.extend({
1886-
aria: function (name, value)
1886+
_aria: function (name, value)
18871887
{
18881888
return this.attr("aria-" + name, value);
18891889
},
18901890

1891-
removeAria: function (name)
1891+
_removeAria: function (name)
18921892
{
18931893
return this.removeAttr("aria-" + name);
18941894
},
18951895

1896-
enableAria: function()
1896+
_enableAria: function ()
18971897
{
1898-
return this.removeClass("disabled").aria("disabled", "false");
1898+
return this.removeClass("disabled")._aria("disabled", "false");
18991899
},
19001900

1901-
disableAria: function ()
1901+
_disableAria: function ()
19021902
{
1903-
return this.addClass("disabled").aria("disabled", "true");
1903+
return this.addClass("disabled")._aria("disabled", "true");
19041904
},
19051905

1906-
hideAria: function ()
1906+
_hideAria: function ()
19071907
{
1908-
return this.hide().aria("hidden", "true");
1908+
return this.hide()._aria("hidden", "true");
19091909
},
19101910

1911-
showAria: function ()
1911+
_showAria: function ()
19121912
{
1913-
return this.show().aria("hidden", "false");
1913+
return this.show()._aria("hidden", "false");
19141914
},
19151915

1916-
selectAria: function ()
1916+
_selectAria: function ()
19171917
{
1918-
return this.addClass("current").aria("selected", "true");
1918+
return this.addClass("current")._aria("selected", "true");
19191919
},
19201920

1921-
deselectAria: function ()
1921+
_deselectAria: function ()
19221922
{
1923-
return this.removeClass("current").aria("selected", "false");
1923+
return this.removeClass("current")._aria("selected", "false");
19241924
},
19251925

1926-
setId: function (id)
1926+
_setId: function (id)
19271927
{
19281928
return this.attr("id", id);
19291929
}

0 commit comments

Comments
 (0)