public/tutor_register_wizard/vendor/jquery-steps/jquery.steps.js
/**
     * Inserts a new step to a specific position.
     *
     * @static
     * @private
     * @method insertStep
     * @param wizard {Object} The jQuery wizard object
     * @param options {Object} Settings of the current wizard
     * @param state {Object} The state container of the current wizard
     * @param index {Integer} The position (zero-based) to add
     * @param step {Object} The step object to add
     * @example
     *     $("#wizard").steps().insert(0, {
     *         title: "Title",
     *         content: "", // optional
     *         contentMode: "async", // optional
     *         contentUrl: "/Content/Step/1" // optional
     *     });
     * @chainable
     **/
Inserts a new step to a specific position.
Inserts a new step to a specific position .
function insertStep(wizard, options, state, index, step) {
        if (index < 0 || index > state.stepCount) {
            throwError(_indexOutOfRangeErrorMessage);
        }
        step = $.extend({}, stepModel, step);
        insertStepToCache(wizard, index, step);
        if (state.currentIndex !== state.stepCount && state.currentIndex >= index) {
            state.currentIndex++;
            saveCurrentStateToCookie(wizard, options, state);
        }
        state.stepCount++;
        var contentContainer = wizard.find(".content"),
            header = $("<{0}>{1}</{0}>".format(options.headerTag, step.title)),
            body = $("<{0}></{0}>".format(options.bodyTag));
        if (step.contentMode == null || step.contentMode === contentMode.html) {
            body.html(step.content);
        }
        if (index === 0) {
            contentContainer.prepend(body).prepend(header);
        } else {
            getStepPanel(wizard, (index - 1)).after(body).after(header);
        }
        renderBody(wizard, state, body, index);
        renderTitle(wizard, options, state, header, index);
        refreshSteps(wizard, options, state, index);
        if (index === state.currentIndex) {
            refreshStepNavigation(wizard, options, state);
        }
        refreshPagination(wizard, options, state);
        return wizard;
    }
function insertStep ( wizard , options , state , index , step ) { if ( index < 0 || index > state . stepCount ) { throwError ( _indexOutOfRangeErrorMessage ) ; } step = $ . extend ( { } , stepModel , step ) ; insertStepToCache ( wizard , index , step ) ; if ( state . currentIndex !== state . stepCount && state . currentIndex >= index ) { state . currentIndex ++ ; saveCurrentStateToCookie ( wizard , options , state ) ; } state . stepCount ++ ; var contentContainer = wizard . find ( ".content" ) , header = $ ( "<{0}>{1}</{0}>" . format ( options . headerTag , step . title ) ) , body = $ ( "<{0}></{0}>" . format ( options . bodyTag ) ) ; if ( step . contentMode == null || step . contentMode === contentMode . html ) { body . html ( step . content ) ; } if ( index === 0 ) { contentContainer . prepend ( body ) . prepend ( header ) ; } else { getStepPanel ( wizard , ( index - 1 ) ) . after ( body ) . after ( header ) ; } renderBody ( wizard , state , body , index ) ; renderTitle ( wizard , options , state , header , index ) ; refreshSteps ( wizard , options , state , index ) ; if ( index === state . currentIndex ) { refreshStepNavigation ( wizard , options , state ) ; } refreshPagination ( wizard , options , state ) ; return wizard ; }
Inserts a new step to a specific position.
Inserts a new step to a specific position .
// TODO: Validate step object // Change data