1+ /**
2+ * An object that represents the default settings.
3+ * There are two possibities to override the sub-properties.
4+ * Either by doing it generally (global) or on initialization.
5+ *
6+ * @static
7+ * @class defaults
8+ * @for steps
9+ * @example
10+ * // Global approach
11+ * $.steps.defaults.headerTag = "h3";
12+ * @example
13+ * // Initialization approach
14+ * $("#wizard").steps({ headerTag: "h3" });
15+ **/
16+ $ . fn . steps . defaults = {
17+ /**
18+ * The header tag is used to find the step button text within the declared wizard area.
19+ *
20+ * @property headerTag
21+ * @type String
22+ * @default "h1"
23+ * @for defaults
24+ **/
25+ headerTag : "h1" ,
26+
27+ /**
28+ * The body tag is used to find the step content within the declared wizard area.
29+ *
30+ * @property bodyTag
31+ * @type String
32+ * @default "div"
33+ * @for defaults
34+ **/
35+ bodyTag : "div" ,
36+
37+ /**
38+ * The content container tag which will be used to wrap all step contents.
39+ *
40+ * @property contentContainerTag
41+ * @type String
42+ * @default "div"
43+ * @for defaults
44+ **/
45+ contentContainerTag : "div" ,
46+
47+ /**
48+ * The action container tag which will be used to wrap the pagination navigation.
49+ *
50+ * @property actionContainerTag
51+ * @type String
52+ * @default "div"
53+ * @for defaults
54+ **/
55+ actionContainerTag : "div" ,
56+
57+ /**
58+ * The steps container tag which will be used to wrap the steps navigation.
59+ *
60+ * @property stepsContainerTag
61+ * @type String
62+ * @default "div"
63+ * @for defaults
64+ **/
65+ stepsContainerTag : "div" ,
66+
67+ /**
68+ * The css class which will be added to the outer component wrapper.
69+ *
70+ * @property cssClass
71+ * @type String
72+ * @default "wizard"
73+ * @for defaults
74+ * @example
75+ * <div class="wizard">
76+ * ...
77+ * </div>
78+ **/
79+ cssClass : "wizard" ,
80+
81+ /*
82+ * Tempplates
83+ */
84+
85+ /**
86+ * The title template which will be used to create a step button.
87+ *
88+ * @property titleTemplate
89+ * @type String
90+ * @default "<span class=\"number\">#index#.</span> #title#"
91+ * @for defaults
92+ **/
93+ titleTemplate : "<span class=\"number\">#index#.</span> #title#" ,
94+
95+ /**
96+ * The loading template which will be used to create the loading animation.
97+ *
98+ * @property loadingTemplate
99+ * @type String
100+ * @default "<span class=\"spinner\"></span> #text#"
101+ * @for defaults
102+ **/
103+ loadingTemplate : "<span class=\"spinner\"></span> #text#" ,
104+
105+ /*
106+ * Behaviour
107+ */
108+
109+ /**
110+ * Sets the focus to the first wizard instance in order to enable the key navigation from the begining if `true`.
111+ *
112+ * @property autoFocus
113+ * @type Boolean
114+ * @default false
115+ * @for defaults
116+ * @since 0.9.4
117+ **/
118+ autoFocus : false ,
119+
120+ /**
121+ * Enables all steps from the begining if `true` (all steps are clickable).
122+ *
123+ * @property enableAllSteps
124+ * @type Boolean
125+ * @default false
126+ * @for defaults
127+ **/
128+ enableAllSteps : false ,
129+
130+ /**
131+ * Enables keyboard navigation if `true` (arrow left and arrow right).
132+ *
133+ * @property enableKeyNavigation
134+ * @type Boolean
135+ * @default true
136+ * @for defaults
137+ **/
138+ enableKeyNavigation : true ,
139+
140+ /**
141+ * Enables pagination if `true`.
142+ *
143+ * @property enablePagination
144+ * @type Boolean
145+ * @default true
146+ * @for defaults
147+ **/
148+ enablePagination : true ,
149+
150+ /**
151+ * Suppresses pagination if a form field is focused.
152+ *
153+ * @property suppressPaginationOnFocus
154+ * @type Boolean
155+ * @default true
156+ * @for defaults
157+ **/
158+ suppressPaginationOnFocus : true ,
159+
160+ /**
161+ * Enables cache for async loaded or iframe embedded content.
162+ *
163+ * @property enableContentCache
164+ * @type Boolean
165+ * @default true
166+ * @for defaults
167+ **/
168+ enableContentCache : true ,
169+
170+ /**
171+ * Shows the finish button if enabled.
172+ *
173+ * @property enableFinishButton
174+ * @type Boolean
175+ * @default true
176+ * @for defaults
177+ **/
178+ enableFinishButton : true ,
179+
180+ /**
181+ * Not yet implemented.
182+ *
183+ * @property preloadContent
184+ * @type Boolean
185+ * @default false
186+ * @for defaults
187+ **/
188+ preloadContent : false ,
189+
190+ /**
191+ * Shows the finish button always (on each step; right beside the next button) if `true`.
192+ * Otherwise the next button will be replaced by the finish button if the last step becomes active.
193+ *
194+ * @property showFinishButtonAlways
195+ * @type Boolean
196+ * @default false
197+ * @for defaults
198+ **/
199+ showFinishButtonAlways : false ,
200+
201+ /**
202+ * Prevents jumping to a previous step.
203+ *
204+ * @property forceMoveForward
205+ * @type Boolean
206+ * @default false
207+ * @for defaults
208+ **/
209+ forceMoveForward : false ,
210+
211+ /**
212+ * Saves the current state (step position) to a cookie.
213+ * By coming next time the last active step becomes activated.
214+ *
215+ * @property saveState
216+ * @type Boolean
217+ * @default false
218+ * @for defaults
219+ **/
220+ saveState : false ,
221+
222+ /**
223+ * The position to start on (zero-based).
224+ *
225+ * @property startIndex
226+ * @type Integer
227+ * @default 0
228+ * @for defaults
229+ **/
230+ startIndex : 0 ,
231+
232+ /*
233+ * Animation Effect Configuration
234+ */
235+
236+ /**
237+ * The animation effect which will be used for step transitions.
238+ *
239+ * @property transitionEffect
240+ * @type transitionEffect
241+ * @default none
242+ * @for defaults
243+ **/
244+ transitionEffect : $ . fn . steps . transitionEffect . none ,
245+
246+ /**
247+ * Animation speed for step transitions (in milliseconds).
248+ *
249+ * @property transitionEffectSpeed
250+ * @type Integer
251+ * @default 200
252+ * @for defaults
253+ **/
254+ transitionEffectSpeed : 200 ,
255+
256+ /*
257+ * Events
258+ */
259+
260+ /**
261+ * Fires before the step changes and can be used to prevent step changing by returning `false`.
262+ * Very useful for form validation.
263+ *
264+ * @property onStepChanging
265+ * @type Event
266+ * @default function (event, currentIndex, newIndex) { return true; }
267+ * @for defaults
268+ **/
269+ onStepChanging : function ( event , currentIndex , newIndex ) { return true ; } ,
270+
271+ /**
272+ * Fires after the step has change.
273+ *
274+ * @property onStepChanged
275+ * @type Event
276+ * @default function (event, currentIndex, priorIndex) { }
277+ * @for defaults
278+ **/
279+ onStepChanged : function ( event , currentIndex , priorIndex ) { } ,
280+
281+ /**
282+ * Fires before finishing and can be used to prevent completion by returning `false`.
283+ * Very useful for form validation.
284+ *
285+ * @property onFinishing
286+ * @type Event
287+ * @default function (event, currentIndex) { return true; }
288+ * @for defaults
289+ **/
290+ onFinishing : function ( event , currentIndex ) { return true ; } ,
291+
292+ /**
293+ * Fires after completion.
294+ *
295+ * @property onFinished
296+ * @type Event
297+ * @default function (event, currentIndex) { }
298+ * @for defaults
299+ **/
300+ onFinished : function ( event , currentIndex ) { } ,
301+
302+ /**
303+ * Contains all labels.
304+ *
305+ * @property labels
306+ * @type Object
307+ * @for defaults
308+ **/
309+ labels : {
310+ /**
311+ * This label is important for accessability reasons.
312+ * Indicates which step is activated.
313+ *
314+ * @property current
315+ * @type String
316+ * @default "current step:"
317+ * @for defaults
318+ **/
319+ current : "current step:" ,
320+
321+ /**
322+ * This label is important for accessability reasons and describes the kind of navigation.
323+ *
324+ * @property pagination
325+ * @type String
326+ * @default "Pagination"
327+ * @for defaults
328+ * @since 0.9.7
329+ **/
330+ pagination : "Pagination" ,
331+
332+ /**
333+ * Label for the finish button.
334+ *
335+ * @property finish
336+ * @type String
337+ * @default "Finish"
338+ * @for defaults
339+ **/
340+ finish : "Finish" ,
341+
342+ /**
343+ * Label for the next button.
344+ *
345+ * @property next
346+ * @type String
347+ * @default "Next"
348+ * @for defaults
349+ **/
350+ next : "Next" ,
351+
352+ /**
353+ * Label for the previous button.
354+ *
355+ * @property previous
356+ * @type String
357+ * @default "Previous"
358+ * @for defaults
359+ **/
360+ previous : "Previous" ,
361+
362+ /**
363+ * Label for the loading animation.
364+ *
365+ * @property loading
366+ * @type String
367+ * @default "Loading ..."
368+ * @for defaults
369+ **/
370+ loading : "Loading ..."
371+ }
372+ } ;
0 commit comments