src/console/simpleyui.js
function(when, fn, obj, sFn) {

        // object id
        var id = Y.stamp(obj), o, sid;

        if (! this.objs[id]) {
            // create a map entry for the obj if it doesn't exist
            this.objs[id] = {};
        }

        o = this.objs[id];

        if (! o[sFn]) {
            // create a map entry for the method if it doesn't exist
            o[sFn] = new Y.Do.Method(obj, sFn);

            // re-route the method to our wrapper
            obj[sFn] = 
                function() {
                    return o[sFn].exec.apply(o[sFn], arguments);
                };
        }

        // subscriber id
        sid = id + Y.stamp(fn) + sFn;

        // register the callback
        o[sFn].register(sid, fn, when);

        return new Y.EventHandle(o[sFn], sid);

    }
function(when, fn, obj, sFn) {

        // object id
        var id = Y.stamp(obj), o, sid;

        if (! this.objs[id]) {
            // create a map entry for the obj if it doesn't exist
            this.objs[id] = {};
        }

        o = this.objs[id];

        if (! o[sFn]) {
            // create a map entry for the method if it doesn't exist
            o[sFn] = new Y.Do.Method(obj, sFn);

            // re-route the method to our wrapper
            obj[sFn] = 
                function() {
                    return o[sFn].exec.apply(o[sFn], arguments);
                };
        }

        // subscriber id
        sid = id + Y.stamp(fn) + sFn;

        // register the callback
        o[sFn].register(sid, fn, when);

        return new Y.EventHandle(o[sFn], sid);

    }
function ( when , fn , obj , sFn ) { // object id var id = Y . stamp ( obj ) , o , sid ; if ( ! this . objs [ id ] ) { // create a map entry for the obj if it doesn't exist this . objs [ id ] = { } ; } o = this . objs [ id ] ; if ( ! o [ sFn ] ) { // create a map entry for the method if it doesn't exist o [ sFn ] = new Y . Do . Method ( obj , sFn ) ; // re-route the method to our wrapper obj [ sFn ] = function ( ) { return o [ sFn ] . exec . apply ( o [ sFn ] , arguments ) ; } ; } // subscriber id sid = id + Y . stamp ( fn ) + sFn ; // register the callback o [ sFn ] . register ( sid , fn , when ) ; return new Y . EventHandle ( o [ sFn ] , sid ) ; }
Execute the supplied method after the specified function
@method _inject
@param when {string} before or after
@param fn {Function} the function to execute
@param obj the object hosting the method to displace
@param sFn {string} the name of the method to displace
@param c The execution context for fn
@return {string} handle for the subscription
@private
@static
Execute the supplied method after the specified function