res/sources/array.js
function (sourceName, referenceSourceName) {
            var sourceToMove,
                sourcePos,
                referenceSourcePos;
            if (!this._sources.every(function (source, index) {
                var name = source.getName();
                if (name === sourceName) {
                    sourceToMove = source;
                    sourcePos = index;
                } else if (name === referenceSourceName) {
                    referenceSourcePos = index;
                }
                return sourcePos === undefined || referenceSourcePos === undefined;
            })) {
                var KEEP_ITEM = 0,
                    REMOVE_ITEM = 1;
                this._sources.splice(sourcePos, REMOVE_ITEM);
                if (sourcePos > referenceSourcePos) {
                    ++referenceSourcePos;
                }
                this._sources.splice(referenceSourcePos, KEEP_ITEM, sourceToMove);
                this._rebuildSourcesIndex();
            }
        }
function (sourceName, referenceSourceName) {
            var sourceToMove,
                sourcePos,
                referenceSourcePos;
            if (!this._sources.every(function (source, index) {
                var name = source.getName();
                if (name === sourceName) {
                    sourceToMove = source;
                    sourcePos = index;
                } else if (name === referenceSourceName) {
                    referenceSourcePos = index;
                }
                return sourcePos === undefined || referenceSourcePos === undefined;
            })) {
                var KEEP_ITEM = 0,
                    REMOVE_ITEM = 1;
                this._sources.splice(sourcePos, REMOVE_ITEM);
                if (sourcePos > referenceSourcePos) {
                    ++referenceSourcePos;
                }
                this._sources.splice(referenceSourcePos, KEEP_ITEM, sourceToMove);
                this._rebuildSourcesIndex();
            }
        }
function ( sourceName , referenceSourceName ) { var sourceToMove , sourcePos , referenceSourcePos ; if ( ! this . _sources . every ( function ( source , index ) { var name = source . getName ( ) ; if ( name === sourceName ) { sourceToMove = source ; sourcePos = index ; } else if ( name === referenceSourceName ) { referenceSourcePos = index ; } return sourcePos === undefined || referenceSourcePos === undefined ; } ) ) { var KEEP_ITEM = 0 , REMOVE_ITEM = 1 ; this . _sources . splice ( sourcePos , REMOVE_ITEM ) ; if ( sourcePos > referenceSourcePos ) { ++ referenceSourcePos ; } this . _sources . splice ( referenceSourcePos , KEEP_ITEM , sourceToMove ) ; this . _rebuildSourcesIndex ( ) ; } }
Moves source after the referenced one

@param {String} sourceName Name of the source to move
@param {String} referenceSourceName Name of the source to be used as a position reference
Moves source after the referenced one