function inlineAndCompile(filenames, options, reporter, callback, errback) {

  var depTarget = options && options.depTarget;
  var referrerName = options && options.referrer;

  var basePath;
  if (referrerName) {
    // The compile occurs two directories down from current directory,
    // in src/node.  Thus the names will appear as eg ../src/x.
    // We want something like referrerName/src/x. So we need to give
    // the normalize() the 'package' or root name with src/node append
    // to represent the referrer from here.
    referrerName = referrerName && referrerName + 'src/node';
    // The basePath will replace options.referrer in our final filename.
    // Since we are in src/node, we need to back up two directories.
    basePath = path.join(__dirname, '../../');
  } else {
    basePath = path.resolve('./') + '/';
  }
  basePath = basePath.replace(/\\/g, '/');

  var scriptsCount = options.scripts.length;

  var loadCount = 0;
  var elements = [];
  var hooks = new InlineLoaderHooks(reporter, basePath, elements, depTarget);
  var loader = new TraceurLoader(hooks);

  function appendEvaluateModule(name, referrerName) {
    var normalizedName =
        traceur.ModuleStore.normalize(name, referrerName);
    // Create tree for System.get('normalizedName');
    var tree =
        traceur.codegeneration.module.createModuleEvaluationStatement(normalizedName);
    elements.push(tree);
  }

  function loadNext() {
    var loadAsScript = scriptsCount && (loadCount < scriptsCount);
    var doEvaluateModule = false;
    var loadFunction = loader.import;
    var name = filenames[loadCount];
    if (loadAsScript) {
      loadFunction = loader.loadAsScript;
    } else {
      name = name.replace(/\.js$/,'');
      if (options.modules !== 'inline' && options.modules !== 'instantiate')
        doEvaluateModule = true;
    }
    var loadOptions = {referrerName: referrerName};
    var codeUnit = loadFunction.call(loader, name, loadOptions).then(
        function() {
          if (doEvaluateModule)
            appendEvaluateModule(name, referrerName);
          loadCount++;
          if (loadCount < filenames.length) {
            loadNext();
          } else if (depTarget) {
            callback(null);
          } else {
            var tree = allLoaded(basePath, reporter, elements);
            callback(tree);
          }
        }, function(err) {
          errback(err);
        }).catch(function(ex) {
          console.error('Internal error ' + (ex.stack || ex));
        });
  }

  loadNext();
}

Compiles the files in "filenames" along with any associated modules, into a
single js file, in proper module dependency order.

@param {Array.<string>} filenames The list of files to compile and concat.
@param {Object} options A container for misc options. 'depTarget' is the
only currently available option, which results in the dependencies for
'filenames' being printed to stdout, with 'depTarget' as the target.
@param {ErrorReporter} reporter
@param {Function} callback Callback used to return the result. A null result
indicates that inlineAndCompile has returned successfully from a
non-compile request.
@param {Function} errback Callback used to return errors.

Compiles the files in filenames along with any associated modules into a single js file in proper module dependency order .


function Simple() {

  // If arguments passed in, try and parse the simple date
  if(arguments.length > 0) {
    this._parse(arguments[0]);
  } else {
    // Note that all dates and times are UTC internally!
    var date = new Date();
    this._year = date.getUTCFullYear();
    this._month = date.getUTCMonth();
    this._day = date.getUTCDay();
    this._hours = date.getUTCHours();
    this._minutes = date.getUTCMinutes();
    this._seconds = date.getUTCSeconds();
    this._tzHours = 0;
    this._tzMinutes = 0;
  }
}


function () {
        var me = this, ret = {
            minWidth: 20,
            width: Ext.themeName === 'neptune' ? 70 : 60,
            items: [],
            enableOverflow: true
        };

        Ext.each(this.quickStart, function (item) {
            ret.items.push({
                tooltip: { text: item.name, align: 'bl-tl' },
                //tooltip: item.name,
                overflowText: item.name,
                iconCls: item.iconCls,
                module: item.module,
                handler: me.onQuickStartClick,
                scope: me
            });
        });

        return ret;
    }

function
(
)
{
var
me
=
this
,
ret
=
{
minWidth
:
20
,
width
:
Ext
.
themeName
===
'neptune'
70
:
60
,
items
:
[
]
,
enableOverflow
:
true
}
;
Ext
.
each
(
this
.
quickStart
,
function
(
item
)
{
ret
.
items
.
push
(
{
tooltip
:
{
text
:
item
.
name
,
align
:
'bl-tl'
}
,
//tooltip: item.name,
overflowText
:
item
.
name
,
iconCls
:
item
.
iconCls
,
module
:
item
.
module
,
handler
:
me
.
onQuickStartClick
,
scope
:
me
}
)
;
}
)
;
return
ret
;
}

This method returns the configuration object for the Quick Start toolbar. A derived
class can override this method, call the base version to build the config and
then modify the returned object before returning it.

This method returns the configuration object for the Quick Start toolbar . A derived class can override this method call the base version to build the config and then modify the returned object before returning it .


function applyEachOptimization(rel){

	var originalRel = rel
	rel = JSON.parse(JSON.stringify(rel))

	//console.log('rel: ' + JSON.stringify(rel))
	try{
		var newImplicits = [rel.params[1].implicits[0]]
		var bindingsUsed = _.extend({}, rel.params[1].bindingsUsed)
		//1. extract macro params to one or more ~:property maps
		var maps = []
		var failed = false
		var newMacroExpr = replaceMacroPropertyExpressions(rel.params[1].expr, rel.params[1].implicits, function(macroPropertyExpr){
			if(macroPropertyExpr.schemaType.type === 'map'){
				failed = true
				return
			}
			var uid = 'extproperty_'+Math.random()
			var bu = {}
			bu[uid] = true
			var m = {
				type: 'view',
				view: 'map',
				params: [
					rel.params[0],
					{
						type: 'macro',
						manyImplicits: 1,
						expr: {type: 'param', name: uid, schemaType: rel.params[0].schemaType.members},
						bindingsUsed: bu,
						implicits: [uid],
						schemaType: rel.params[0].schemaType.members,
						implicitTypes: [rel.params[0].schemaType.members]
					},{
						type: 'macro',
						manyImplicits: 1,
						expr: JSON.parse(JSON.stringify(macroPropertyExpr)),
						bindingsUsed: bu,
						implicits: [rel.params[1].implicits[0]],
						schemaType: macroPropertyExpr.schemaType,
						implicitTypes: [rel.params[1].implicitTypes[0]]
					}
				],
				willBeOptimized: true,
				uid: uid
			}
			m.schemaType = {type: 'map', key: m.params[1].schemaType, value: m.params[2].schemaType}
			maps.push(applyEachOptimizationToView(m))
			newImplicits.push(uid)
			bindingsUsed[uid] = true
			_.assertDefined(macroPropertyExpr.schemaType)
			return {type: 'param', name: uid, schemaType: macroPropertyExpr.schemaType}
		})
		if(failed) return originalRel
		var newMacro = {
			type: 'macro',
			expr: newMacroExpr,
			manyImplicits: newImplicits.length,
			implicits: newImplicits,
			implicitTypes: [rel.params[0].schemaType.members],
			bindingsUsed: bindingsUsed,//newImplicits
			schemaType: newMacroExpr.schemaType
		}
		//console.log('created m: ' + JSON.stringify(newMacro, null, 2))
		return {
			type: 'view',
			view: 'each-optimization',
			params: [rel.params[0], newMacro].concat(maps),
			schemaType: rel.schemaType,
			code: rel.code
		}
	}catch(e){
		//console.log('could not optimize each + e.stack)
		return originalRel
	}
}


function makeSyncOpGenericGetChangesBetween(handle, ws, rel, recurse, paramFuncs){

	//paramFuncs.forEach(function(pf){
	for(var i=0;i<paramFuncs.length;++i){
		var pf = paramFuncs[i]
		if(pf.isMacro){
			//_.errout('cannot apply this method if a param is a macro: ' + JSON.stringify(rel))
			return makeGenericGetChangesBetween(handle, ws, rel)
		}
	}
	//})
	//console.log(new Error().stack)
	function syncGenericGetChangesBetween(bindings, startEditId, endEditId, cb){
		_.assertLength(arguments, 4)

		if(startEditId === endEditId) _.errout('wasting time')

		var snaps = []

		var editIds = []
		var has = {}

		//console.log('getting ' + JSON.stringify(rel))

		var cdl = _.latch(paramFuncs.length, function(){
			if(editIds.length === 0){
				//console.log('no changes ' + startEditId + ' ' + endEditId)
				cb([])
				return
			}

			handle.getStateAt(bindings, startEditId, function(startState){
				handle.getStateAt(bindings, endEditId, function(state){
					if(startState === state){
						cb([])
					}else{
						var es = ws.diffFinder(startState, state)
						var changes = []
						es.forEach(function(e){
							e.editId = endEditId
							changes.push(e)
						})
						cb(changes)
					}
				})
			})
		})
		//console.log('here2')
		for(var i=0;i<paramFuncs.length;++i){
			paramFuncs[i].getChangesBetween(bindings, startEditId, endEditId, function(changes){
				changes.forEach(function(c){
					var editId = c.editId
					if(has[editId]) return
					has[editId] = true
					editIds.push(editId)
				})

				cdl()
			})
		}
	}
	return syncGenericGetChangesBetween
}

function makeReallyGenericSyncOpGenericGetChangesBetween( find the union of the changed versions for the input parameters, use that to reduce the number of comparisons necessary


function (key, task, done, ttl) {
    const queue     = this.queue;
    const semaphore = this.semaphore;

    if (!ttl) ttl = this.ttl;

    const runTask = (res) => new Promise((resolve) =>
      task( (...args) => resolve(Response.setData(res, args)) )
    );

    const startThenRunTask = (lock_key) =>
      queue.start(key, Response.factory(ttl))
      .then(runTask)
      .then(queue.dequeue.bind(null, key))
      .then(() => semaphore.release(key, lock_key))
      .catch((err) => {
        semaphore.release(key, lock_key);
        throw err;
      })
    ;

    const startIfNotWaiting = () =>
      Promise.all([
        queue.isWaiting(key)
      , semaphore.lock(key)
      ])
      .then(([ is_waiting, lock_key ]) =>
        (!is_waiting && lock_key) ? startThenRunTask(lock_key) : null
      )

    return queue
      .add(key, done)
      .then(startIfNotWaiting)
    ;
  }

function ( key , task , done , ttl ) { const queue = this . queue ; const semaphore = this . semaphore ; if ( ! ttl ) ttl = this . ttl ; const runTask = ( res ) => new Promise ( ( resolve ) => task ( ( ... args ) => resolve ( Response . setData ( res , args ) ) ) ) ; const startThenRunTask = ( lock_key ) => queue . start ( key , Response . factory ( ttl ) ) . then ( runTask ) . then ( queue . dequeue . bind ( null , key ) ) . then ( ( ) => semaphore . release ( key , lock_key ) ) . catch ( ( err ) => { semaphore . release ( key , lock_key ) ; throw err ; } ) ; const startIfNotWaiting = ( ) => Promise . all ( [ queue . isWaiting ( key ) , semaphore . lock ( key ) ] ) . then ( ( [ is_waiting , lock_key ] ) => ( ! is_waiting && lock_key ) ? startThenRunTask ( lock_key ) : null ) return queue . add ( key , done ) . then ( startIfNotWaiting ) ; }

Queue up the given task using the given key as an identifier. @param {string} key @param {Function} task @param {Function} done @param {number} ttl - the time to live for the queue cache. @return {Queue}

Queue up the given task using the given key as an identifier .


function Iterator(options, fn) {
  if (typeof options === 'function') {
    fn = options;
    options = {};
  }
  if (typeof fn !== 'function') {
    throw new TypeError('Iterator expects `fn` to be a function.');
  }
  this.options = options || {};
  this.fn = fn;
}

Create a new instance of `Iterator`

```js
var iterator = new Iterator();
```
@api public


function domGen(tagName) {

  /**
   * Generates a dom with the given params.
   * @param {object} [opts] The options to pass as the second arg of $('<tag/>', arg)
   * @param {object[]} args The objects to append to the element
   * @return {jQuery}
   */
  return (opts, ...args) => {
    if (!seemLikePlainObject(opts)) {
      args.unshift(opts)
      opts = undefined
    }

    return $('<' + tagName + '/>', opts).append(...[].concat(...args))
  }
}

Returns a generator of the doms of the given tag name.
@param {string} tagName The tag name of the dom to create
@return {Function}

Returns a generator of the doms of the given tag name .


function(v){
  var ots = Object.prototype.toString;
  var s=typeof v;
    if(s=='object'){
      if(v){
        if((ots.call(v).indexOf('HTML')!==-1 && ots.call(v).indexOf('Element')!=-1)){return 'element'}
        if(v instanceof Array||(!(v instanceof Object)&&(ots.call(v)=='[object Array]')||typeof v.length=='number'&&typeof v.splice!='undefined'&&typeof v.propertyIsEnumerable!='undefined'&&!v.propertyIsEnumerable('splice'))){return 'array'}
        if(!(v instanceof Object)&&(ots.call(v)=='[object Function]'|| typeof v.call!='undefined'&& typeof v.propertyIsEnumerable!='undefined'&&!v.propertyIsEnumerable('call'))){return 'function'}
      }
      return 'null';
    }
    else if(s=='function'&&typeof v.call=='undefined'){return 'object'}
  return s;
}

function
(
v
)
{
var
ots
=
Object
.
prototype
.
toString
;
var
s
=
typeof
v
;
if
(
s
==
'object'
)
{
if
(
v
)
{
if
(
(
ots
.
call
(
v
)
.
indexOf
(
'HTML'
)
!==
1
&&
ots
.
call
(
v
)
.
indexOf
(
'Element'
)
!=
1
)
)
{
return
'element'
}
if
(
v
instanceof
Array
||
(
!
(
v
instanceof
Object
)
&&
(
ots
.
call
(
v
)
==
'[object Array]'
)
||
typeof
v
.
length
==
'number'
&&
typeof
v
.
splice
!=
'undefined'
&&
typeof
v
.
propertyIsEnumerable
!=
'undefined'
&&
!
v
.
propertyIsEnumerable
(
'splice'
)
)
)
{
return
'array'
}
if
(
!
(
v
instanceof
Object
)
&&
(
ots
.
call
(
v
)
==
'[object Function]'
||
typeof
v
.
call
!=
'undefined'
&&
typeof
v
.
propertyIsEnumerable
!=
'undefined'
&&
!
v
.
propertyIsEnumerable
(
'call'
)
)
)
{
return
'function'
}
}
return
'null'
;
}
else
if
(
s
==
'function'
&&
typeof
v
.
call
==
'undefined'
)
{
return
'object'
}
return
s
;
}


function(identifier){
            if(!Bella.contains(this.lines, identifier)){
                this.lines.push(identifier);
                this.Event.onAddOnlineUser(identifier);
                return true;
            }
            return false;
        }

function ( identifier ) { if ( ! Bella . contains ( this . lines , identifier ) ) { this . lines . push ( identifier ) ; this . Event . onAddOnlineUser ( identifier ) ; return true ; } return false ; }


function(value) {
            value = value || '';
            return this.setStyle({
                left : value,
                right : value,
                top : value,
                bottom : value,
                'z-index' : '',
                position : STATIC
            });
        }

function ( value ) { value = value || '' ; return this . setStyle ( { left : value , right : value , top : value , bottom : value , 'z-index' : '' , position : STATIC } ) ; }

Clears positioning back to the default when the document was loaded.
@param {String} [value=''] The value to use for the left, right, top, bottom.
You could use 'auto'.
@return {Ext.dom.Element} this

Clears positioning back to the default when the document was loaded .


function() {
            var me = this,
                offsetParent = me.dom.offsetParent,
                x = me.getStyle('left');

            if (!x || x === 'auto') {
                x = 0;
            } else if (me.pxRe.test(x)) {
                x = parseFloat(x);
            } else {
                x = me.getX();
                if (offsetParent) {
                    x -= Element.getX(offsetParent);
                }
            }

            return x;
        }

function ( ) { var me = this , offsetParent = me . dom . offsetParent , x = me . getStyle ( 'left' ) ; if ( ! x || x === 'auto' ) { x = 0 ; } else if ( me . pxRe . test ( x ) ) { x = parseFloat ( x ) ; } else { x = me . getX ( ) ; if ( offsetParent ) { x -= Element . getX ( offsetParent ) ; } } return x ; }

Gets the local CSS X position for the element

@return {Number}


function() {
            var me = this,
                offsetParent = me.dom.offsetParent,
                style = me.getStyle(['left', 'top']),
                x = style.left,
                y = style.top;

            if (!x || x === 'auto') {
                x = 0;
            } else if (me.pxRe.test(x)) {
                x = parseFloat(x);
            } else {
                x = me.getX();
                if (offsetParent) {
                    x -= Element.getX(offsetParent);
                }
            }

            if (!y || y === 'auto') {
                y = 0;
            } else if (me.pxRe.test(y)) {
                y = parseFloat(y);
            } else {
                y = me.getY();
                if (offsetParent) {
                    y -= Element.getY(offsetParent);
                }
            }

            return [x, y];
        }

function ( ) { var me = this , offsetParent = me . dom . offsetParent , style = me . getStyle ( [ 'left' , 'top' ] ) , x = style . left , y = style . top ; if ( ! x || x === 'auto' ) { x = 0 ; } else if ( me . pxRe . test ( x ) ) { x = parseFloat ( x ) ; } else { x = me . getX ( ) ; if ( offsetParent ) { x -= Element . getX ( offsetParent ) ; } } if ( ! y || y === 'auto' ) { y = 0 ; } else if ( me . pxRe . test ( y ) ) { y = parseFloat ( y ) ; } else { y = me . getY ( ) ; if ( offsetParent ) { y -= Element . getY ( offsetParent ) ; } } return [ x , y ] ; }

Gets the local CSS X and Y position for the element

@return {Array} [x, y]


function() {
            var me = this,
                offsetParent = me.dom.offsetParent,
                y = me.getStyle('top');

            if (!y || y === 'auto') {
                y = 0;
            } else if (me.pxRe.test(y)) {
                y = parseFloat(y);
            } else {
                y = me.getY();
                if (offsetParent) {
                    y -= Element.getY(offsetParent);
                }
            }

            return y;
        }

function ( ) { var me = this , offsetParent = me . dom . offsetParent , y = me . getStyle ( 'top' ) ; if ( ! y || y === 'auto' ) { y = 0 ; } else if ( me . pxRe . test ( y ) ) { y = parseFloat ( y ) ; } else { y = me . getY ( ) ; if ( offsetParent ) { y -= Element . getY ( offsetParent ) ; } } return y ; }

Gets the local CSS Y position for the element

@return {Number}


function(pos, zIndex, x, y) {
            var me = this;

            if (!pos && me.isStyle(POSITION, STATIC)) {
                me.setStyle(POSITION, RELATIVE);
            } else if (pos) {
                me.setStyle(POSITION, pos);
            }
            if (zIndex) {
                me.setStyle(ZINDEX, zIndex);
            }
            if (x || y) {
                me.setXY([x || false, y || false]);
            }
        }

function ( pos , zIndex , x , y ) { var me = this ; if ( ! pos && me . isStyle ( POSITION , STATIC ) ) { me . setStyle ( POSITION , RELATIVE ) ; } else if ( pos ) { me . setStyle ( POSITION , pos ) ; } if ( zIndex ) { me . setStyle ( ZINDEX , zIndex ) ; } if ( x || y ) { me . setXY ( [ x || false , y || false ] ) ; } }

Initializes positioning on this element. If a desired position is not passed,
it will make the the element positioned relative IF it is not already positioned.
@param {String} [pos] Positioning to use "relative", "absolute" or "fixed"
@param {Number} [zIndex] The zIndex to apply
@param {Number} [x] Set the page X position
@param {Number} [y] Set the page Y position

Initializes positioning on this element . If a desired position is not passed it will make the the element positioned relative IF it is not already positioned .


function(x, y, width, height, animate) {
            return this.setBox({
                x: x,
                y: y,
                width: width,
                height: height
            }, animate);
        }

function ( x , y , width , height , animate ) { return this . setBox ( { x : x , y : y , width : width , height : height } , animate ) ; }

Sets the element's position and size in one shot. If animation is true then
width, height, x and y will be animated concurrently.

@param {Number} x X value for new position (coordinates are page-based)
@param {Number} y Y value for new position (coordinates are page-based)
@param {Number/String} width The new width. This may be one of:

- A Number specifying the new width in this Element's
{@link #defaultUnit}s (by default, pixels)
- A String used to set the CSS width style. Animation may **not** be used.

@param {Number/String} height The new height. This may be one of:

- A Number specifying the new height in this Element's
{@link #defaultUnit}s (by default, pixels)
- A String used to set the CSS height style. Animation may **not** be used.

@param {Boolean/Object} [animate] true for the default animation or
a standard Element animation config object

@return {Ext.dom.Element} this
@deprecated Use {@link Ext.util.Positionable#setBox} instead.

Sets the element s position and size in one shot . If animation is true then width height x and y will be animated concurrently .


function(left, top) {
            var me = this,
                style = me.dom.style;

            style.left = me.addUnits(left);
            style.top = me.addUnits(top);

            return me;
        }

function ( left , top ) { var me = this , style = me . dom . style ; style . left = me . addUnits ( left ) ; style . top = me . addUnits ( top ) ; return me ; }

Sets the element's left and top positions directly using CSS style
@param {Number/String} left Number of pixels or CSS string value to
set as the left CSS property value
@param {Number/String} top Number of pixels or CSS string value to
set as the top CSS property value
@return {Ext.dom.Element} this
@deprecated

Sets the element s left and top positions directly using CSS style


function(rec){
        var me          = this,
            node        = me.getNode(rec, true),
            el          = me.el,
            adjustmentY = 0,
            adjustmentX = 0,
            elRegion    = el.getRegion(),
            nodeRegion;

        // Viewable region must not include scrollbars, so use
        // DOM client dimensions
        elRegion.bottom = elRegion.top + el.dom.clientHeight;
        elRegion.right = elRegion.left + el.dom.clientWidth;
        if (node) {
            nodeRegion = Ext.fly(node).getRegion();
            // node is above
            if (nodeRegion.top < elRegion.top) {
                adjustmentY = nodeRegion.top - elRegion.top;
            // node is below
            } else if (nodeRegion.bottom > elRegion.bottom) {
                adjustmentY = nodeRegion.bottom - elRegion.bottom;
            }

            // node is left
            if (nodeRegion.left < elRegion.left) {
                adjustmentX = nodeRegion.left - elRegion.left;
            // node is right
            } else if (nodeRegion.right > elRegion.right) {
                adjustmentX = nodeRegion.right - elRegion.right;
            }

            if (adjustmentX || adjustmentY) {
                me.scrollBy(adjustmentX, adjustmentY, false);
            }
            el.focus();
        }
    }

Focuses a node in the view.
@param {Ext.data.Model} rec The record associated to the node that is to be focused.


function(card) {
        var me = this,
            previous;

        card = me.getComponent(card);
        if (card) {
            previous = me.getActiveTab();

            if (previous !== card && me.fireEvent('beforetabchange', me, card, previous) === false) {
                return false;
            }

            // We may be passed a config object, so add it.
            // Without doing a layout!
            if (!card.isComponent) {
                Ext.suspendLayouts();
                card = me.add(card);
                Ext.resumeLayouts();
            }

            // MUST set the activeTab first so that the machinery which listens for show doesn't
            // think that the show is "driving" the activation and attempt to recurse into here.
            me.activeTab = card;

            // Attempt to switch to the requested card. Suspend layouts because if that was successful
            // we have to also update the active tab in the tab bar which is another layout operation
            // and we must coalesce them.
            Ext.suspendLayouts();
            me.layout.setActiveItem(card);

            // Read the result of the card layout. Events dear boy, events!
            card = me.activeTab = me.layout.getActiveItem();

            // Card switch was not vetoed by an event listener
            if (card && card !== previous) {

                // Update the active tab in the tab bar and resume layouts.
                me.tabBar.setActiveTab(card.tab);
                Ext.resumeLayouts(true);

                // previous will be undefined or this.activeTab at instantiation
                if (previous !== card) {
                    me.fireEvent('tabchange', me, card, previous);
                }
            }
            // Card switch was vetoed by an event listener. Resume layouts (Nothing should have changed on a veto).
            else {
                Ext.resumeLayouts(true);
            }
            return card;
        }
    }

Makes the given card active. Makes it the visible card in the TabPanel's CardLayout and highlights the Tab.
@param {String/Number/Ext.Component} card The card to make active. Either an ID, index or the component itself.
@return {Ext.Component} The resulting active child Component. The call may have been vetoed, or otherwise
modified by an event listener.

Makes the given card active . Makes it the visible card in the TabPanel s CardLayout and highlights the Tab .


function() {
        var me = this,
            // Ensure the calculated result references a Component
            result = me.getComponent(me.activeTab);

        // Sanitize the result in case the active tab is no longer there.
        if (result && me.items.indexOf(result) != -1) {
            me.activeTab = result;
        } else {
            me.activeTab = null;
        }

        return me.activeTab;
    }

Returns the item that is currently active inside this TabPanel.
@return {Ext.Component} The currently active item.

Returns the item that is currently active inside this TabPanel .


function(syncId, blockCb, makeCb, reifyCb, cb){
			_.assertLength(arguments, 5)
			//_.assertFunction(listenerCb)
			//_.assertFunction(objectCb)
			_.assertFunction(blockCb)
			_.assertFunction(makeCb)
			_.assertFunction(reifyCb)
			_.assertFunction(cb);
			_.assertString(syncId)
			var e = {syncId: syncId};
			//applyRequestId(e, wrapper.bind(undefined, cb, makeCb));

			log('BEGAN SYNC CLIENT')

			w.beginSync(e);
			/*syncListenersByRequestId[e.requestId]*/
			syncListenersBySyncId[syncId] = {block: blockCb, make: makeCb, reify: reifyCb}

			cb(makeSyncHandle(syncId, makeCb))
		}

even though we provide a default sync handle, we include the ability to create them for the purposes of proxying.

even though we provide a default sync handle we include the ability to create them for the purposes of proxying .


function resize() {
				var deltaSize, d = ed.getDoc(), body = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight;

				// Get height differently depending on the browser used
				myHeight = tinymce.isIE ? body.scrollHeight : (tinymce.isWebKit && body.clientHeight == 0 ? 0 : body.offsetHeight);

				// Don't make it smaller than the minimum height
				if (myHeight > t.autoresize_min_height)
					resizeHeight = myHeight;

				// If a maximum height has been defined don't exceed this height
				if (t.autoresize_max_height && myHeight > t.autoresize_max_height) {
					resizeHeight = t.autoresize_max_height;
					body.style.overflowY = "auto";
					de.style.overflowY = "auto"; // Old IE
				} else {
					body.style.overflowY = "hidden";
					de.style.overflowY = "hidden"; // Old IE
					body.scrollTop = 0;
				}

				// Resize content element
				if (resizeHeight !== oldSize) {
					deltaSize = resizeHeight - oldSize;
					DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
					oldSize = resizeHeight;

					// WebKit doesn't decrease the size of the body element until the iframe gets resized
					// So we need to continue to resize the iframe down until the size gets fixed
					if (tinymce.isWebKit && deltaSize < 0)
						resize();
				}
			}

This method gets executed each time the editor needs to resize.

This method gets executed each time the editor needs to resize .


function LoaderType(options, fn) {
  if (!(this instanceof LoaderType)) {
    return new LoaderType(options);
  }
  LoaderStack.call(this);
  this.iterator = new Iterator(options, fn);
}

function LoaderType ( options , fn ) { if ( ! ( this instanceof LoaderType ) ) { return new LoaderType ( options ) ; } LoaderStack . call ( this ) ; this . iterator = new Iterator ( options , fn ) ; }

Create a new instance of `LoaderType`

```js
var LoaderType = require('loader-cache');
var loaders = new LoaderType();
```
@api public


function(oldKey, newKey) {
        var me = this,
            map = me.map,
            indexMap = me.indexMap,
            index = me.indexOfKey(oldKey),
            item;

        if (index > -1) {
            item = map[oldKey];
            delete map[oldKey];
            delete indexMap[oldKey];
            map[newKey] = item;
            indexMap[newKey] = index;
            me.keys[index] = newKey;
            me.generation++;

        }
    }

function ( oldKey , newKey ) { var me = this , map = me . map , indexMap = me . indexMap , index = me . indexOfKey ( oldKey ) , item ; if ( index > - 1 ) { item = map [ oldKey ] ; delete map [ oldKey ] ; delete indexMap [ oldKey ] ; map [ newKey ] = item ; indexMap [ newKey ] = index ; me . keys [ index ] = newKey ; me . generation ++ ; } }

Change the key for an existing item in the collection. If the old key
does not exist this is a no-op.
@param {Object} oldKey The old key
@param {Object} newKey The new key

Change the key for an existing item in the collection . If the old key does not exist this is a no - op .


function(objs) {
        var me = this,
            key;

        if (arguments.length > 1 || Ext.isArray(objs)) {
            me.insert(me.length, arguments.length > 1 ? arguments : objs);
        } else {
            for (key in objs) {
                if (objs.hasOwnProperty(key)) {
                    if (me.allowFunctions || typeof objs[key] != 'function') {
                        me.add(key, objs[key]);
                    }
                }
            }
        }
    }

function ( objs ) { var me = this , key ; if ( arguments . length > 1 || Ext . isArray ( objs ) ) { me . insert ( me . length , arguments . length > 1 ? arguments : objs ) ; } else { for ( key in objs ) { if ( objs . hasOwnProperty ( key ) ) { if ( me . allowFunctions || typeof objs [ key ] != 'function' ) { me . add ( key , objs [ key ] ) ; } } } } }

Adds all elements of an Array or an Object to the collection.
@param {Object/Array} objs An Object containing properties which will be added
to the collection, or an Array of values, each of which are added to the collection.
Functions references will be added to the collection if `{@link #allowFunctions}`
has been set to `true`.
@since Ext 1

Adds all elements of an Array or an Object to the collection .


function(fn, scope){
        var items = Ext.Array.push([], this.items), // each safe for removal
            i = 0,
            len = items.length,
            item;

        for (; i < len; i++) {
            item = items[i];
            if (fn.call(scope || item, item, i, len) === false) {
                break;
            }
        }
    }

function
(
fn
,
scope
)
{
var
items
=
Ext
.
Array
.
push
(
[
]
,
this
.
items
)
,
// each safe for removal
i
=
0
,
len
=
items
.
length
,
item
;
for
(
;
i
<
len
;
i
++
)
{
item
=
items
[
i
]
;
if
(
fn
.
call
(
scope
||
item
,
item
,
i
,
len
)
===
false
)
{
break
;
}
}
}

Executes the specified function once for every item in the collection.
The function should return a boolean value.
Returning false from the function will stop the iteration.

@param {Function} fn The function to execute for each item.
@param {Mixed} fn.item The collection item.
@param {Number} fn.index The index of item.
@param {Number} fn.len Total length of collection.
@param {Object} scope (optional) The scope (this reference)
in which the function is executed. Defaults to the current item in the iteration.

@since Ext 1

Executes the specified function once for every item in the collection . The function should return a boolean value . Returning false from the function will stop the iteration .


function(index, keys, objects) {
        var me = this,
            itemKey,
            removeIndex,
            i, len = keys.length,
            fireAdd = me.hasListeners.add,
            syncIndices;

        // External key(s) passed. We cannot reliably find an object's index using the key extraction fn.
        // Set a flag for use by contains, indexOf and remove
        if (objects != null) {
            me.useLinearSearch = true
        }
        // No external keys: calculate keys array if not passed
        else {
            objects = keys;
            keys = new Array(len);
            for (i = 0; i < len; i++) {
                keys[i] = this.getKey(objects[i]);
            }
        }

        // First, remove duplicates of the keys. If a removal point is less than insertion index, decr insertion index
        me.suspendEvents();
        for (i = 0; i < len; i++) {
            // Must use indexOf - map might be out of sync
            removeIndex = me.indexOfKey(keys[i]);
            if (removeIndex !== -1) {
                if (removeIndex < index) {
                    index--;
                }
                me.removeAt(removeIndex);
            }
        }
        me.resumeEvents();

        // If we are appending and the indices are in sync, its cheap to kep them that way
        syncIndices = index === me.length && me.indexGeneration === me.generation;

        // Insert the new items and new keys in at the insertion point
        Ext.Array.insert(me.items, index, objects);
        Ext.Array.insert(me.keys,  index, keys);
        me.length += len;
        me.generation++;
        if (syncIndices) {
            me.indexGeneration = me.generation;
        }
        for (i = 0; i < len; i++, index++) {
            itemKey = keys[i];
            if (itemKey != null) {
                me.map[itemKey] = objects[i];

                // If the index is still in sync, keep it that way
                if (syncIndices) {
                    me.indexMap[itemKey] = index;
                }
            }
            if (fireAdd) {
                me.fireEvent('add', index, objects[i], itemKey);
            }
        }
        return objects;
    }


function(o) {
        var me = this,
            removeKey,
            index;

        // If
        //     We have not been forced into using linear lookup by a usage of the 2 arg form of add
        // and
        //     The key extraction function yields a key
        // Then use indexOfKey. This will use the indexMap - rebuilding it if necessary.
        if (!me.useLinearSearch && (removeKey = me.getKey(o))) {
            index = me.indexOfKey(removeKey);
        }

        // Otherwise we have to do it the slow way with a linear search.
        else {
            index = Ext.Array.indexOf(me.items, o);
        }

        return (index === -1) ? false : me.removeAt(index);
    }

Remove an item from the collection.
@param {Object} o The item to remove.
@return {Object} The item removed or false if no item was removed.
@since Ext 1


function(items) {
        var me = this,
            i;

        if (items || me.hasListeners.remove) {
            // Only perform expensive item-by-item removal if there's a listener or specific items
            if (items) {
                for (i = items.length - 1; i >= 0; --i) {
                    me.remove(items[i]);
                }
            } else {
                while (me.length) {
                    me.removeAt(0);
                }
            }
        } else {
            me.length = me.items.length = me.keys.length = 0;
            me.map = {};
            me.indexMap = {};
            me.generation++;
            me.indexGeneration = me.generation;
        }
    }

Remove all items in the collection. Can also be used
to remove only the items in the passed array.
@param {Array} [items] An array of items to be removed.
@return {Ext.util.MixedCollection} this object

Remove all items in the collection . Can also be used to remove only the items in the passed array .


function(o) {
        var me = this,
            key;

        if (o != null) {
            // If
            //     We have not been forced into using linear lookup by a usage of the 2 arg form of add
            // and
            //     The key extraction function yields a key
            // Then use the map to determine object presence.
            if (!me.useLinearSearch && (key = me.getKey(o))) {
                return this.map[key] != null;
            }

            // Fallback: Use linear search
            return Ext.Array.indexOf(this.items, o) !== -1;
        }

        return false;
    }

Returns true if the collection contains the passed Object as an item.
@param {Object} o  The Object to look for in the collection.
@return {Boolean} True if the collection contains the Object as an item.
@since Ext 1

Returns true if the collection contains the passed Object as an item .


function(property, root, start, end) {
        var values = this.extractValues(property, root),
            length = values.length,
            sum    = 0,
            i;

        start = start || 0;
        end   = (end || end === 0) ? end : length - 1;

        for (i = start; i <= end; i++) {
            sum += values[i];
        }

        return sum;
    }

function ( property , root , start , end ) { var values = this . extractValues ( property , root ) , length = values . length , sum = 0 , i ; start = start || 0 ; end = ( end || end === 0 ) ? end : length - 1 ; for ( i = start ; i <= end ; i ++ ) { sum += values [ i ] ; } return sum ; }

Collects all of the values of the given property and returns their sum
@param {String} property The property to sum by
@param {String} [root] 'root' property to extract the first argument from. This is used mainly when
summing fields in records, where the fields are all stored inside the 'data' object
@param {Number} [start=0] The record index to start at
@param {Number} [end=-1] The record index to end at
@return {Number} The total


function(property, root, allowNull) {
        var values = this.extractValues(property, root),
            length = values.length,
            hits   = {},
            unique = [],
            value, strValue, i;

        for (i = 0; i < length; i++) {
            value = values[i];
            strValue = String(value);

            if ((allowNull || !Ext.isEmpty(value)) && !hits[strValue]) {
                hits[strValue] = true;
                unique.push(value);
            }
        }

        return unique;
    }

function ( property , root , allowNull ) { var values = this . extractValues ( property , root ) , length = values . length , hits = { } , unique = [ ] , value , strValue , i ; for ( i = 0 ; i < length ; i ++ ) { value = values [ i ] ; strValue = String ( value ) ; if ( ( allowNull || ! Ext . isEmpty ( value ) ) && ! hits [ strValue ] ) { hits [ strValue ] = true ; unique . push ( value ) ; } } return unique ; }

Collects unique values of a particular property in this MixedCollection
@param {String} property The property to collect on
@param {String} root (optional) 'root' property to extract the first argument from. This is used mainly when
summing fields in records, where the fields are all stored inside the 'data' object
@param {Boolean} allowBlank (optional) Pass true to allow null, undefined or empty string values
@return {Array} The unique values


function() {
        var me = this,
            copy = new this.self(me.initialConfig);

        copy.add(me.keys, me.items);
        return copy;
    }

function ( ) { var me = this , copy = new this . self ( me . initialConfig ) ; copy . add ( me . keys , me . items ) ; return copy ; }

Creates a shallow copy of this collection
@return {Ext.util.MixedCollection}
@since Ext 1


function(data, force_absolute) {
			var self = this, editor = self.editor, baseUri = editor.documentBaseURI, sources, attrs, img, i;

			data.params.src = self.convertUrl(data.params.src, force_absolute);

			attrs = data.video.attrs;
			if (attrs)
				attrs.src = self.convertUrl(attrs.src, force_absolute);

			if (attrs)
				attrs.poster = self.convertUrl(attrs.poster, force_absolute);

			sources = toArray(data.video.sources);
			if (sources) {
				for (i = 0; i < sources.length; i++)
					sources[i].src = self.convertUrl(sources[i].src, force_absolute);
			}

			img = self.editor.dom.create('img', {
				id : data.id,
				style : data.style,
				align : data.align,
				hspace : data.hspace,
				vspace : data.vspace,
				src : self.editor.theme.url + '/img/trans.gif',
				'class' : 'mceItemMedia mceItem' + self.getType(data.type).name,
				'data-mce-json' : JSON.serialize(data, "'")
			});

			img.width = data.width = normalizeSize(data.width || (data.type == 'audio' ? "300" : "320"));
			img.height = data.height = normalizeSize(data.height || (data.type == 'audio' ? "32" : "240"));

			return img;
		}

function
(
data
,
force_absolute
)
{
var
self
=
this
,
editor
=
self
.
editor
,
baseUri
=
editor
.
documentBaseURI
,
sources
,
attrs
,
img
,
i
;
data
.
params
.
src
=
self
.
convertUrl
(
data
.
params
.
src
,
force_absolute
)
;
attrs
=
data
.
video
.
attrs
;
if
(
attrs
)
attrs
.
src
=
self
.
convertUrl
(
attrs
.
src
,
force_absolute
)
;
if
(
attrs
)
attrs
.
poster
=
self
.
convertUrl
(
attrs
.
poster
,
force_absolute
)
;
sources
=
toArray
(
data
.
video
.
sources
)
;
if
(
sources
)
{
for
(
i
=
0
;
i
<
sources
.
length
;
i
++
)
sources
[
i
]
.
src
=
self
.
convertUrl
(
sources
[
i
]
.
src
,
force_absolute
)
;
}
img
=
self
.
editor
.
dom
.
create
(
'img'
,
{
id
:
data
.
id
,
style
:
data
.
style
,
align
:
data
.
align
,
hspace
:
data
.
hspace
,
vspace
:
data
.
vspace
,
src
:
self
.
editor
.
theme
.
url
+
'/img/trans.gif'
,
'class'
:
'mceItemMedia mceItem'
+
self
.
getType
(
data
.
type
)
.
name
,
'data-mce-json'
:
JSON
.
serialize
(
data
,
"'"
)
}
)
;
img
.
width
=
data
.
width
=
normalizeSize
(
data
.
width
||
(
data
.
type
==
'audio'
"300"
:
"320"
)
)
;
img
.
height
=
data
.
height
=
normalizeSize
(
data
.
height
||
(
data
.
type
==
'audio'
"32"
:
"240"
)
)
;
return
img
;
}

Converts the JSON data object to an img node.

Converts the JSON data object to an img node .


function(value) {
			var i, values, typeItem;

			// Find type by checking the classes
			values = tinymce.explode(value, ' ');
			for (i = 0; i < values.length; i++) {
				typeItem = this.lookup[values[i]];

				if (typeItem)
					return typeItem;
			}
		}

function
(
value
)
{
var
i
,
values
,
typeItem
;
// Find type by checking the classes
values
=
tinymce
.
explode
(
value
,
' '
)
;
for
(
i
=
0
;
i
<
values
.
length
;
i
++
)
{
typeItem
=
this
.
lookup
[
values
[
i
]
]
;
if
(
typeItem
)
return
typeItem
;
}
}

Get type item by extension, class, clsid or mime type.

@method getType
@param {String} value Value to get type item by.
@return {Object} Type item object or undefined.

Get type item by extension class clsid or mime type .


function addPlayer(video_src, poster_src) {
				var baseUri, flashVars, flashVarsOutput, params, flashPlayer;

				flashPlayer = editor.getParam('flash_video_player_url', self.convertUrl(self.url + '/moxieplayer.swf'));
				if (flashPlayer) {
					baseUri = editor.documentBaseURI;
					data.params.src = flashPlayer;

					// Convert the movie url to absolute urls
					if (editor.getParam('flash_video_player_absvideourl', true)) {
						video_src = baseUri.toAbsolute(video_src || '', true);
						poster_src = baseUri.toAbsolute(poster_src || '', true);
					}

					// Generate flash vars
					flashVarsOutput = '';
					flashVars = editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'});
					tinymce.each(flashVars, function(value, name) {
						// Replace $url and $poster variables in flashvars value
						value = value.replace(/\$url/, video_src || '');
						value = value.replace(/\$poster/, poster_src || '');

						if (value.length > 0)
							flashVarsOutput += (flashVarsOutput ? '&' : '') + name + '=' + escape(value);
					});

					if (flashVarsOutput.length)
						data.params.flashvars = flashVarsOutput;

					params = editor.getParam('flash_video_player_params', {
						allowfullscreen: true,
						allowscriptaccess: true
					});

					tinymce.each(params, function(value, name) {
						data.params[name] = "" + value;
					});
				}
			}


function(binding){
        var me = this,
            keyCode = binding.key,
            i,
            len;

        if (me.processing) {
            me.bindings = bindings.slice(0);
        }

        if (Ext.isArray(binding)) {
            for (i = 0, len = binding.length; i < len; i++) {
                me.addBinding(binding[i]);
            }
            return;
        }

        me.bindings.push(Ext.apply({
            keyCode: me.processKeys(keyCode)
        }, binding));
    }

function ( binding ) { var me = this , keyCode = binding . key , i , len ; if ( me . processing ) { me . bindings = bindings . slice ( 0 ) ; } if ( Ext . isArray ( binding ) ) { for ( i = 0 , len = binding . length ; i < len ; i ++ ) { me . addBinding ( binding [ i ] ) ; } return ; } me . bindings . push ( Ext . apply ( { keyCode : me . processKeys ( keyCode ) } , binding ) ) ; }

Add a new binding to this KeyMap.

Usage:

// Create a KeyMap
var map = new Ext.util.KeyMap(document, {
key: Ext.EventObject.ENTER,
fn: handleKey,
scope: this
});

//Add a new binding to the existing KeyMap later
map.addBinding({
key: 'abc',
shift: true,
fn: handleKey,
scope: this
});

@param {Object/Object[]} binding A single KeyMap config or an array of configs.
The following config object properties are supported:
@param {String/Array} binding.key A single keycode or an array of keycodes to handle.
@param {Boolean} binding.shift True to handle key only when shift is pressed,
False to handle the keyonly when shift is not pressed (defaults to undefined).
@param {Boolean} binding.ctrl True to handle key only when ctrl is pressed,
False to handle the key only when ctrl is not pressed (defaults to undefined).
@param {Boolean} binding.alt True to handle key only when alt is pressed,
False to handle the key only when alt is not pressed (defaults to undefined).
@param {Function} binding.handler The function to call when KeyMap finds the
expected key combination.
@param {Function} binding.fn Alias of handler (for backwards-compatibility).
@param {Object} binding.scope The scope of the callback function.
@param {String} binding.defaultEventAction A default action to apply to the event.
Possible values are: stopEvent, stopPropagation, preventDefault. If no value is
set no action is performed..


function(binding){
        var me = this,
            bindings = me.bindings,
            len = bindings.length,
            i, item, keys;

        if (me.processing) {
            me.bindings = bindings.slice(0);
        }

        keys = me.processKeys(binding.key);
        for (i = 0; i < len; ++i) {
            item = bindings[i];
            if (item.fn === binding.fn && item.scope === binding.scope) {
                if (binding.alt == item.alt && binding.crtl == item.crtl && binding.shift == item.shift) {
                    if (Ext.Array.equals(item.keyCode, keys)) {
                        Ext.Array.erase(me.bindings, i, 1);
                        return;
                    }
                }
            }
        }
    }

function ( binding ) { var me = this , bindings = me . bindings , len = bindings . length , i , item , keys ; if ( me . processing ) { me . bindings = bindings . slice ( 0 ) ; } keys = me . processKeys ( binding . key ) ; for ( i = 0 ; i < len ; ++ i ) { item = bindings [ i ] ; if ( item . fn === binding . fn && item . scope === binding . scope ) { if ( binding . alt == item . alt && binding . crtl == item . crtl && binding . shift == item . shift ) { if ( Ext . Array . equals ( item . keyCode , keys ) ) { Ext . Array . erase ( me . bindings , i , 1 ) ; return ; } } } } }

Remove a binding from this KeyMap.
@param {Object} binding See {@link #addBinding for options}


function(binding, event){
        if (this.checkModifiers(binding, event)) {
            var key = event.getKey(),
                handler = binding.fn || binding.handler,
                scope = binding.scope || this,
                keyCode = binding.keyCode,
                defaultEventAction = binding.defaultEventAction,
                i,
                len,
                keydownEvent = new Ext.EventObjectImpl(event);

            for (i = 0, len = keyCode.length; i < len; ++i) {
                if (key === keyCode[i]) {
                    if (handler.call(scope, key, event) !== true && defaultEventAction) {
                        keydownEvent[defaultEventAction]();
                    }
                    break;
                }
            }
        }
    }

function ( binding , event ) { if ( this . checkModifiers ( binding , event ) ) { var key = event . getKey ( ) , handler = binding . fn || binding . handler , scope = binding . scope || this , keyCode = binding . keyCode , defaultEventAction = binding . defaultEventAction , i , len , keydownEvent = new Ext . EventObjectImpl ( event ) ; for ( i = 0 , len = keyCode . length ; i < len ; ++ i ) { if ( key === keyCode [ i ] ) { if ( handler . call ( scope , key , event ) !== true && defaultEventAction ) { keydownEvent [ defaultEventAction ] ( ) ; } break ; } } } }

Process a particular binding and fire the handler if necessary.
@private
@param {Object} binding The binding information
@param {Ext.EventObject} event

Process a particular binding and fire the handler if necessary .


function(binding, e) {
        var keys = ['shift', 'ctrl', 'alt'],
            i = 0,
            len = keys.length,
            val, key;

        for (; i < len; ++i){
            key = keys[i];
            val = binding[key];
            if (!(val === undefined || (val === e[key + 'Key']))) {
                return false;
            }
        }
        return true;
    }

function ( binding , e ) { var keys = [ 'shift' , 'ctrl' , 'alt' ] , i = 0 , len = keys . length , val , key ; for ( ; i < len ; ++ i ) { key = keys [ i ] ; val = binding [ key ] ; if ( ! ( val === undefined || ( val === e [ key + 'Key' ] ) ) ) { return false ; } } return true ; }

Check if the modifiers on the event match those on the binding
@private
@param {Object} binding
@param {Ext.EventObject} event
@return {Boolean} True if the event matches the binding


function(key, fn, scope) {
        var keyCode, shift, ctrl, alt;
        if (Ext.isObject(key) && !Ext.isArray(key)) {
            keyCode = key.key;
            shift = key.shift;
            ctrl = key.ctrl;
            alt = key.alt;
        } else {
            keyCode = key;
        }
        this.addBinding({
            key: keyCode,
            shift: shift,
            ctrl: ctrl,
            alt: alt,
            fn: fn,
            scope: scope
        });
    }

function ( key , fn , scope ) { var keyCode , shift , ctrl , alt ; if ( Ext . isObject ( key ) && ! Ext . isArray ( key ) ) { keyCode = key . key ; shift = key . shift ; ctrl = key . ctrl ; alt = key . alt ; } else { keyCode = key ; } this . addBinding ( { key : keyCode , shift : shift , ctrl : ctrl , alt : alt , fn : fn , scope : scope } ) ; }

Shorthand for adding a single key listener.

@param {Number/Number[]/Object} key Either the numeric key code, array of key codes or an object with the
following options: `{key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}`
@param {Function} fn The function to call
@param {Object} [scope] The scope (`this` reference) in which the function is executed.
Defaults to the browser window.

Shorthand for adding a single key listener .


function() {
        var me = this;

        if (!me.enabled) {
            me.target.on(me.eventName, me.handleTargetEvent, me);
            me.enabled = true;
        }
    }

function ( ) { var me = this ; if ( ! me . enabled ) { me . target . on ( me . eventName , me . handleTargetEvent , me ) ; me . enabled = true ; } }


function() {
        var me = this;

        if (me.enabled) {
            me.target.removeListener(me.eventName, me.handleTargetEvent, me);
            me.enabled = false;
        }
    }

function ( ) { var me = this ; if ( me . enabled ) { me . target . removeListener ( me . eventName , me . handleTargetEvent , me ) ; me . enabled = false ; } }


function(removeTarget) {
        var me = this,
            target = me.target;

        me.bindings = [];
        me.disable();
        if (removeTarget === true) {
            if (target.isComponent) {
                target.destroy();
            } else {
                target.remove();
            }
        }
        delete me.target;
    }

function ( removeTarget ) { var me = this , target = me . target ; me . bindings = [ ] ; me . disable ( ) ; if ( removeTarget === true ) { if ( target . isComponent ) { target . destroy ( ) ; } else { target . remove ( ) ; } } delete me . target ; }

Destroys the KeyMap instance and removes all handlers.
@param {Boolean} removeTarget True to also remove the {@link #target}

Destroys the KeyMap instance and removes all handlers .


function () {
        var me = this,
            items = me.flushQueue.clear(),
            length = items.length, i;

        if (length) {
            ++me.flushCount;

            for (i = 0; i < length; ++i) {
                items[i].flush();
            }
        }
    }

function ( ) { var me = this , items = me . flushQueue . clear ( ) , length = items . length , i ; if ( length ) { ++ me . flushCount ; for ( i = 0 ; i < length ; ++ i ) { items [ i ] . flush ( ) ; } } }

Flushes any pending writes to the DOM by calling each ContextItem in the flushQueue.

Flushes any pending writes to the DOM by calling each ContextItem in the flushQueue .


function (parent, el) {
        var id = el.id,
            children = parent.children,
            items = this.items;

        if(children) {
            Ext.Array.remove(children, items[id]);
        }
        delete items[id];
    }

function ( parent , el ) { var id = el . id , children = parent . children , items = this . items ; if ( children ) { Ext . Array . remove ( children , items [ id ] ) ; } delete items [ id ] ; }

Removes the ContextItem for an element from the cache and from the parent's
"children" array.
@param {Ext.layout.ContextItem} parent
@param {Ext.dom.Element} el

Removes the ContextItem for an element from the cache and from the parent s children array .


function () {
        var me = this,
            layouts = me.layoutQueue.clear(),
            length = layouts.length,
            i;

        ++me.cycleCount;

        // This value is incremented by ContextItem#setProp whenever new values are set
        // (thereby detecting forward progress):
        me.progressCount = 0;

        for (i = 0; i < length; ++i) {
            me.runLayout(me.currentLayout = layouts[i]);
        }

        me.currentLayout = null;

        return me.progressCount > 0;
    }

Performs one layout cycle by calling each layout in the layout queue.
@return {Boolean} True if some progress was made, false if not.
@protected

Performs one layout cycle by calling each layout in the layout queue .


function (layout) {
        var me = this,
            ownerContext = me.getCmp(layout.owner);

        layout.pending = false;

        if (ownerContext.state.blocks) {
            return;
        }

        // We start with the assumption that the layout will finish and if it does not, it
        // must clear this flag. It turns out this is much simpler than knowing when a layout
        // is done (100% correctly) when base classes and derived classes are collaborating.
        // Knowing that some part of the layout is not done is much more obvious.
        layout.done = true;

        ++layout.calcCount;
        ++me.calcCount;

        layout.calculate(ownerContext);

        if (layout.done) {
            me.layoutDone(layout);

            if (layout.completeLayout) {
                me.queueCompletion(layout);
            }
            if (layout.finalizeLayout) {
                me.queueFinalize(layout);
            }
        } else if (!layout.pending && !layout.invalid && !(layout.blockCount + layout.triggerCount - layout.firedTriggers)) {
            // A layout that is not done and has no blocks or triggers that will queue it
            // automatically, must be queued now:
            me.queueLayout(layout);
        }
    }

Runs one layout as part of a cycle.
@private


function(item, width, height) {
        var items = item,
            len = 1,
            contextItem, i;

        // NOTE: we don't pre-check for validity because:
        //  - maybe only one dimension is valid
        //  - the diagnostics layer will track the setProp call to help find who is trying
        //      (but failing) to set a property
        //  - setProp already checks this anyway

        if (item.isComposite) {
            items = item.elements;
            len = items.length;
            item = items[0];
        } else if (!item.dom && !item.el) { // array by process of elimination
            len = items.length;
            item = items[0];
        }
        // else len = 1 and items = item (to avoid error on "items[++i]")

        for (i = 0; i < len; ) {
            contextItem = this.get(item);
            contextItem.setSize(width, height);

            item = items[++i]; // this accomodation avoids making an array of 1
        }
    }

//  - setProp already checks this anyway

Set the size of a component, element or composite or an array of components or elements.
@param {Ext.Component/Ext.Component[]/Ext.dom.Element/Ext.dom.Element[]/Ext.dom.CompositeElement}
The item(s) to size.
@param {Number} width The new width to set (ignored if undefined or NaN).
@param {Number} height The new height to set (ignored if undefined or NaN).

Set the size of a component element or composite or an array of components or elements .


function(model, setOnStore) {
        var me = this;

        me.model = Ext.ModelManager.getModel(model);

        me.setReader(this.reader);
        me.setWriter(this.writer);

        if (setOnStore && me.store) {
            me.store.setModel(me.model);
        }
    }

function ( model , setOnStore ) { var me = this ; me . model = Ext . ModelManager . getModel ( model ) ; me . setReader ( this . reader ) ; me . setWriter ( this . writer ) ; if ( setOnStore && me . store ) { me . store . setModel ( me . model ) ; } }

Sets the model associated with this proxy. This will only usually be called by a Store

@param {String/Ext.data.Model} model The new model. Can be either the model name string,
or a reference to the model's constructor
@param {Boolean} setOnStore Sets the new model on the associated Store, if one is present

Sets the model associated with this proxy . This will only usually be called by a Store


function(reader) {
        var me = this,
            needsCopy = true,
            current = me.reader;

        if (reader === undefined || typeof reader == 'string') {
            reader = {
                type: reader
            };
            needsCopy = false;
        }

        if (reader.isReader) {
            reader.setModel(me.model);
        } else {
            if (needsCopy) {
                reader = Ext.apply({}, reader);
            }
            Ext.applyIf(reader, {
                proxy: me,
                model: me.model,
                type : me.defaultReaderType
            });

            reader = Ext.createByAlias('reader.' + reader.type, reader);
        }

        if (reader !== current && reader.onMetaChange) {
            reader.onMetaChange = Ext.Function.createSequence(reader.onMetaChange, this.onMetaChange, this);
        }

        me.reader = reader;
        return me.reader;
    }

function ( reader ) { var me = this , needsCopy = true , current = me . reader ; if ( reader === undefined || typeof reader == 'string' ) { reader = { type : reader } ; needsCopy = false ; } if ( reader . isReader ) { reader . setModel ( me . model ) ; } else { if ( needsCopy ) { reader = Ext . apply ( { } , reader ) ; } Ext . applyIf ( reader , { proxy : me , model : me . model , type : me . defaultReaderType } ) ; reader = Ext . createByAlias ( 'reader.' + reader . type , reader ) ; } if ( reader !== current && reader . onMetaChange ) { reader . onMetaChange = Ext . Function . createSequence ( reader . onMetaChange , this . onMetaChange , this ) ; } me . reader = reader ; return me . reader ; }

Sets the Proxy's Reader by string, config object or Reader instance

@param {String/Object/Ext.data.reader.Reader} reader The new Reader, which can be either a type string,
a configuration object or an Ext.data.reader.Reader instance
@return {Ext.data.reader.Reader} The attached Reader object

Sets the Proxy s Reader by string config object or Reader instance


function(writer) {
        var me = this,
            needsCopy = true;

        if (writer === undefined || typeof writer == 'string') {
            writer = {
                type: writer
            };
            needsCopy = false;
        }

        if (!writer.isWriter) {
            if (needsCopy) {
                writer = Ext.apply({}, writer);
            }
            Ext.applyIf(writer, {
                model: me.model,
                type : me.defaultWriterType
            });

            writer = Ext.createByAlias('writer.' + writer.type, writer);
        }

        me.writer = writer;

        return me.writer;
    }

function ( writer ) { var me = this , needsCopy = true ; if ( writer === undefined || typeof writer == 'string' ) { writer = { type : writer } ; needsCopy = false ; } if ( ! writer . isWriter ) { if ( needsCopy ) { writer = Ext . apply ( { } , writer ) ; } Ext . applyIf ( writer , { model : me . model , type : me . defaultWriterType } ) ; writer = Ext . createByAlias ( 'writer.' + writer . type , writer ) ; } me . writer = writer ; return me . writer ; }

Sets the Proxy's Writer by string, config object or Writer instance

@param {String/Object/Ext.data.writer.Writer} writer The new Writer, which can be either a type string,
a configuration object or an Ext.data.writer.Writer instance
@return {Ext.data.writer.Writer} The attached Writer object

Sets the Proxy s Writer by string config object or Writer instance


function getRequiredFilename (name, callback) {
  var filepath = path.join(LOG_DIR, name);

  function getStats () {

    fs.stat(filepath, function (err, stats) {
      if (err) {
        callback(err, null);
      } else if (stats && stats.size >= MAX_FILE_SIZE) {
        createFile();
      } else {
        callback(null, name);
      }
    });
  }

  function createFile () {
    fs.writeFile(filepath, '[]', function (err) {
      if (err) {
        callback(err, null);
      } else {
        callback(null, name);
      }
    });
  }

  fs.exists(filepath, function (exists) {
    if (exists) {
      getStats();
    } else {
      createFile();
    }
  });
}

function getRequiredFilename ( name , callback ) { var filepath = path . join ( LOG_DIR , name ) ; function getStats ( ) { fs . stat ( filepath , function ( err , stats ) { if ( err ) { callback ( err , null ) ; } else if ( stats && stats . size >= MAX_FILE_SIZE ) { createFile ( ) ; } else { callback ( null , name ) ; } } ) ; } function createFile ( ) { fs . writeFile ( filepath , '[]' , function ( err ) { if ( err ) { callback ( err , null ) ; } else { callback ( null , name ) ; } } ) ; } fs . exists ( filepath , function ( exists ) { if ( exists ) { getStats ( ) ; } else { createFile ( ) ; } } ) ; }

Determine the file to write the current log file to
@param  {String}   name
@param  {Function} callback


function getWriteFunction(log) {
  return function writeLogFile (name, qcb) {
    var dir = path.join(LOG_DIR, name);

    function readFile (cb) {
      fs.readFile(dir, cb);
    }

    function updateLogs (logs, cb) {
      logs.push(log.toJSON());
      cb(null, logs);
    }

    function writeFile (str, cb) {
      fs.writeFile(dir, str, cb);
    }

    async.waterfall([
      readFile,
      safejson.parse,
      updateLogs,
      safejson.stringify,
      writeFile
    ], qcb);
  };
}

function getWriteFunction ( log ) { return function writeLogFile ( name , qcb ) { var dir = path . join ( LOG_DIR , name ) ; function readFile ( cb ) { fs . readFile ( dir , cb ) ; } function updateLogs ( logs , cb ) { logs . push ( log . toJSON ( ) ) ; cb ( null , logs ) ; } function writeFile ( str , cb ) { fs . writeFile ( dir , str , cb ) ; } async . waterfall ( [ readFile , safejson . parse , updateLogs , safejson . stringify , writeFile ] , qcb ) ; } ; }

Generates a function that will perform logic required
to update a log file with a new log entry.
@param  {Log} log [description]

Generates a function that will perform logic required to update a log file with a new log entry .


function getLogsObject (name, callback) {
  fs.readFile(path.join(LOG_DIR, name), function (err, data) {
    if (err) {
      return callback(err, null);
    }

    safejson.parse(data, function (err, logArray) {
      if (err) {
        return callback(err, null);
      }

      callback(null, {
        logs: logArray
      });
    });
  });
}

function getLogsObject ( name , callback ) { fs . readFile ( path . join ( LOG_DIR , name ) , function ( err , data ) { if ( err ) { return callback ( err , null ) ; } safejson . parse ( data , function ( err , logArray ) { if ( err ) { return callback ( err , null ) ; } callback ( null , { logs : logArray } ) ; } ) ; } ) ; }

Read a log file with the given name
@param  {String}   name
@param  {Function} callback


function deleteFile(name, callback) {
  fs.unlink(path.join(LOG_DIR, name), callback);
}

function deleteFile ( name , callback ) { fs . unlink ( path . join ( LOG_DIR , name ) , callback ) ; }

Delete a log file with the given name
@param  {String}   name
@param  {Function} callback


function () {
    this.port = DEFAULT_STUBBATTI_PORT;
    this.app = express();
    this.console = global.console;

    var stubbatti = this;

    this.app[KILL_METHOD](KILL_PATH, function (req, res) {
        res.set('Connection', 'close');
        res.end();

        stubbatti.stop();

    });
}

function ( ) { this . port = DEFAULT_STUBBATTI_PORT ; this . app = express ( ) ; this . console = global . console ; var stubbatti = this ; this . app [ KILL_METHOD ] ( KILL_PATH , function ( req , res ) { res . set ( 'Connection' , 'close' ) ; res . end ( ) ; stubbatti . stop ( ) ; } ) ; }

Stubbatti class represents a stub server instance.

Stubbatti class represents a stub server instance .


function bravojs_print()
{
  var output="";
  var i;
  var stdout;

  for (i=0; i < arguments.length; i++)
    output += arguments[i] + (i===arguments.length - 1 ? "" : " ");
  output.replace(/\t/, "        ");

  if (typeof window.document != "undefined" && (stdout = window.document.getElementById('stdout')))
  {
    output += "\n";

    if (typeof stdout.value !== "undefined")
    {
      stdout.value += output;
      if (stdout.focus)
        stdout.focus();

      if (stdout.tagName === "TEXTAREA")
        stdout.scrollTop = stdout.scrollHeight;
    }
    else
    {
      if (typeof stdout.innerText !== "undefined")
      {
        stdout.innerText = stdout.innerText.slice(0,-1) + output + " "; 	/* IE normalizes trailing newlines away */
      }
      else
        stdout.textContent += output;
    }
  }
  else if (typeof console === "object" && console.print)
  {
    console.print(output);
  }
  else if (typeof console === "object" && console.log)
  {
    console.log(output);
  }
  // WebWorker
  else if (typeof importScripts === "function" && typeof postMessage === "function")
  {
      postMessage({type: "log", data: output});
  }
  else
    alert(" * BravoJS stdout: " + output);
}


function Setting(settingSpec, settings) {
    this._settings = settings;

    Object.keys(settingSpec).forEach(function(key) {
        this[key] = settingSpec[key];
    }, this);

    this.type = types.getType(this.type);
    if (this.type == null) {
        throw new Error('In ' + this.name +
            ': can\'t find type for: ' + JSON.stringify(settingSpec.type));
    }

    if (!this.name) {
        throw new Error('Setting.name == undefined. Ignoring.', this);
    }

    if (!this.defaultValue === undefined) {
        throw new Error('Setting.defaultValue == undefined', this);
    }

    if (this.onChange) {
        this.on('change', this.onChange.bind(this))
    }

    this.set(this.defaultValue);
}

function
Setting
(
settingSpec
,
settings
)
{
this
.
_settings
=
settings
;
Object
.
keys
(
settingSpec
)
.
forEach
(
function
(
key
)
{
this
[
key
]
=
settingSpec
[
key
]
;
}
,
this
)
;
this
.
type
=
types
.
getType
(
this
.
type
)
;
if
(
this
.
type
==
)
{
throw
new
Error
(
'In '
+
this
.
name
+
': can\'t find type for: '
+
JSON
.
stringify
(
settingSpec
.
type
)
)
;
}
if
(
!
this
.
name
)
{
throw
new
Error
(
'Setting.name == undefined. Ignoring.'
,
this
)
;
}
if
(
!
this
.
defaultValue
===
undefined
)
{
throw
new
Error
(
'Setting.defaultValue == undefined'
,
this
)
;
}
if
(
this
.
onChange
)
{
this
.
on
(
'change'
,
this
.
onChange
.
bind
(
this
)
)
}
this
.
set
(
this
.
defaultValue
)
;
}

Create a new setting.
@param settingSpec An object literal that looks like this:
{
name: 'thing',
description: 'Thing is an example setting',
type: 'string',
defaultValue: 'something'
}


function() {
        var reply = [];
        this.getSettingNames().forEach(function(setting) {
            reply.push({
                'key': setting,
                'value': this.getSetting(setting).get()
            });
        }, this);
        return reply;
    }

function ( ) { var reply = [ ] ; this . getSettingNames ( ) . forEach ( function ( setting ) { reply . push ( { 'key' : setting , 'value' : this . getSetting ( setting ) . get ( ) } ) ; } , this ) ; return reply ; }

Retrieve a list of the known settings and their values


function(data) {
        // We iterate over data rather than keys so we don't forget values
        // which don't have a setting yet.
        for (var key in data) {
            if (data.hasOwnProperty(key)) {
                var setting = this._settings[key];
                if (setting) {
                    var value = setting.type.parse(data[key]);
                    this.set(key, value);
                } else {
                    this.set(key, data[key]);
                }
            }
        }
    }


function() {
        return this.getSettingNames().map(function(key) {
            return this._settings[key].type.stringify(this.get(key));
        }.bind(this));
    }

function ( ) { return this . getSettingNames ( ) . map ( function ( key ) { return this . _settings [ key ] . type . stringify ( this . get ( key ) ) ; } . bind ( this ) ) ; }

Utility to grab all the settings and export them into an object


function(statuses) {
        var combined = Status.VALID;
        for (var i = 0; i < statuses.length; i++) {
            if (statuses[i].valueOf() > combined.valueOf()) {
                combined = statuses[i];
            }
        }
        return combined;
    }

function ( statuses ) { var combined = Status . VALID ; for ( var i = 0 ; i < statuses . length ; i ++ ) { if ( statuses [ i ] . valueOf ( ) > combined . valueOf ( ) ) { combined = statuses [ i ] ; } } return combined ; }

A combined status is the worser of the provided statuses


function defaultArgsProvider(request, callback) {
    var args  = request.args,
        params = request.command.params;

    for (var i = 0; i < params.length; i++) {
        var param = params[i];

        // If the parameter is already valid, then don't ask for it anymore.
        if (request.getParamStatus(param) != Status.VALID ||
            // Ask for optional parameters as well.
            param.defaultValue === null)
        {
            var paramPrompt = param.description;
            if (param.defaultValue === null) {
                paramPrompt += " (optional)";
            }
            var value = prompt(paramPrompt, param.defaultValue || "");
            // No value but required -> nope.
            if (!value) {
                callback();
                return;
            } else {
                args[param.name] = value;
            }
        }
    }
    callback();
}

Default ArgumentProvider that is used if no ArgumentProvider is provided
by the command's sender.

Default ArgumentProvider that is used if no ArgumentProvider is provided by the command s sender .


function execute() {
        command.exec(env, request.args, request);

        // If the request isn't asnync and isn't done, then make it done.
        if (!request.isAsync && !request.isDone) {
            request.done();
        }
    }

Executes the command and ensures request.done is called on the request in
case it's not marked to be done already or async.

Executes the command and ensures request . done is called on the request in case it s not marked to be done already or async .


function consume_doctype_or_comment (proc_stack) {
  let html = "<!";
  proc_stack.tSkip(2);
  html += proc_stack.tAcceptUntil(">") + proc_stack.tAccept();
  return html;
}

function consume_doctype_or_comment ( proc_stack ) { let html = "<!" ; proc_stack . tSkip ( 2 ) ; html += proc_stack . tAcceptUntil ( ">" ) + proc_stack . tAccept ( ) ; return html ; }


function consume_opening_or_closing_tag (proc_stack) {
  proc_stack.tSkip();
  let is_closing = proc_stack.tSkipIf("/");
  let tag_name = proc_stack.tAcceptUntilSet(TAG_NAME_DELIMITER).toLocaleLowerCase();
  if (!/^[a-z0-9]+(-[a-z0-9]+)*(:[a-z0-9]+(-[a-z0-9]+)*)?$/.test(tag_name)) {
    throw new SyntaxError(`Invalid HTML tag name "${tag_name}"`);
  }

  if (!is_closing && /^zc-/.test(tag_name)) {
    return consume_directive_tag(proc_stack, tag_name);
  }

  let parts = []; // Parts are needed for attribute value directives

  let html = "<" + (is_closing ? "/" : "") + tag_name;
  let done = false;
  while (!done) {
    html += proc_stack.tAcceptUntilSet(ATTR_VAL_START_OR_TAG_END_DELIMITER);
    let c = proc_stack.tAccept();
    html += c;

    switch (c) {
    case "\"":
      parts.push(html);
      Array.prototype.push.apply(parts, consume_char_data_with_entity_directives(proc_stack, false, "\""));
      html = proc_stack.tAccept();
      break;

    case ">":
      done = true;
      break;

    default:
      throw new Error(`INTERR Invalid char after ATTR_VAL_START_OR_TAG_END_DELIMITER`);
    }
  }

  parts.push(html);

  return parts;
}


function consume_directive_entity (proc_stack) {
  let pos = proc_stack._tGetNPos();

  proc_stack.tSkip(4);
  let directive_name = proc_stack.tAcceptUntil("(");
  proc_stack.tSkip();

  let raw_args = {};
  do {
    proc_stack.tSkipWhile(WHITESPACE);
    if (proc_stack.tPeek() == ")") {
      break;
    }

    let arg_name = proc_stack.tAcceptUntil("=");
    proc_stack.tSkip();

    raw_args[arg_name] = consume_char_data_with_entity_directives(proc_stack, true, ",", ")");
  } while (proc_stack.tSkipIf(","));

  if (!proc_stack.tSkipIf(")")) {
    throw new SyntaxError(`HTML directive entity is missing closing parenthesis`);
  }
  proc_stack.tSkipIf(";");

  return new DirectiveExpr(proc_stack, pos, directive_name, raw_args);
}


function (method, path, cb) {

    http.request({hostname: DEFAULT_HOST, port: DEFAULT_PORT, path: path, method: method}, function (res) {

        res.pipe(concat({encoding: 'string'}, function (data) {
            cb(data, res.headers, res.statusCode);
        }));

    }).end();

}

function ( method , path , cb ) { http . request ( { hostname : DEFAULT_HOST , port : DEFAULT_PORT , path : path , method : method } , function ( res ) { res . pipe ( concat ( { encoding : 'string' } , function ( data ) { cb ( data , res . headers , res . statusCode ) ; } ) ) ; } ) . end ( ) ; }


function init() {
	SXE.initElementDialog('del');
	if (SXE.currentAction == "update") {
		setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime'));
		setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite'));
		SXE.showRemoveButton();
	}
}

function init ( ) { SXE . initElementDialog ( 'del' ) ; if ( SXE . currentAction == "update" ) { setFormValue ( 'datetime' , tinyMCEPopup . editor . dom . getAttrib ( SXE . updateElement , 'datetime' ) ) ; setFormValue ( 'cite' , tinyMCEPopup . editor . dom . getAttrib ( SXE . updateElement , 'cite' ) ) ; SXE . showRemoveButton ( ) ; } }

del.js

Copyright 2009, Moxiecode Systems AB
Released under LGPL License.

License: http://tinymce.moxiecode.com/license
Contributing: http://tinymce.moxiecode.com/contributing


function() {
        var me = this,
            obj = me.getStorageObject(),
            ids = me.getIds(),
            len = ids.length,
            i;

        //remove all the records
        for (i = 0; i < len; i++) {
            obj.removeItem(me.getRecordKey(ids[i]));
        }

        //remove the supporting objects
        obj.removeItem(me.getRecordCounterKey());
        obj.removeItem(me.getTreeKey());
        obj.removeItem(me.id);

        // clear the cache
        me.cache = {};
    }

function
(
)
{
var
me
=
this
,
obj
=
me
.
getStorageObject
(
)
,
ids
=
me
.
getIds
(
)
,
len
=
ids
.
length
,
i
;
//remove all the records
for
(
i
=
0
;
i
<
len
;
i
++
)
{
obj
.
removeItem
(
me
.
getRecordKey
(
ids
[
i
]
)
)
;
}
//remove the supporting objects
obj
.
removeItem
(
me
.
getRecordCounterKey
(
)
)
;
obj
.
removeItem
(
me
.
getTreeKey
(
)
)
;
obj
.
removeItem
(
me
.
id
)
;
// clear the cache
me
.
cache
=
{
}
;
}

Destroys all records stored in the proxy and removes all keys and values used to support the proxy from the
storage object.

Destroys all records stored in the proxy and removes all keys and values used to support the proxy from the storage object .


function(packageName, version) {
            Ext.versions[packageName] = new Version(version);
            Ext.lastRegisteredVersion = Ext.versions[packageName];

            return this;
        }

function ( packageName , version ) { Ext . versions [ packageName ] = new Version ( version ) ; Ext . lastRegisteredVersion = Ext . versions [ packageName ] ; return this ; }

Set version number for the given package name.

@param {String} packageName The package name, for example: 'core', 'touch', 'extjs'
@param {String/Ext.Version} version The version, for example: '1.2.3alpha', '2.4.0-dev'
@return {Ext}

Set version number for the given package name .


function(packageName, since, closure, scope) {
            if (Version.compare(Ext.getVersion(packageName), since) < 1) {
                closure.call(scope);
            }
        }

function ( packageName , since , closure , scope ) { if ( Version . compare ( Ext . getVersion ( packageName ) , since ) < 1 ) { closure . call ( scope ) ; } }

Create a closure for deprecated code.

// This means Ext.oldMethod is only supported in 4.0.0beta and older.
// If Ext.getVersion('extjs') returns a version that is later than '4.0.0beta', for example '4.0.0RC',
// the closure will not be invoked
Ext.deprecate('extjs', '4.0.0beta', function() {
Ext.oldMethod = Ext.newMethod;

...
});

@param {String} packageName The package name
@param {String} since The last version before it's deprecated
@param {Function} closure The callback function to be executed with the specified version is less than the current version
@param {Object} scope The execution scope (`this`) if the closure


function setFromObject(object) {
  Object.keys(object).forEach((name) => {
    options[name] = object[name];
  });
}

function setFromObject ( object ) { Object . keys ( object ) . forEach ( ( name ) => { options [ name ] = object [ name ] ; } ) ; }


function addOptions(flags) {
  Object.keys(options).forEach(function(name) {
    var dashedName = toDashCase(name);
    if ((name in parseOptions) && (name in transformOptions)) {
      flags.option('--' + dashedName + ' [true|false|parse]',
                   descriptions[name]);
      flags.on(dashedName, (value) => setOption(dashedName, value));
    }
    // If the option value is null then it's not a boolean option and should
    // be added separately.
    else if (options[name] !== null) {
      flags.option('--' + dashedName, descriptions[name]);
      flags.on(dashedName, () => setOption(dashedName, true));
    }
  });
  flags.option('--referrer <name>',
    'Bracket output code with System.referrerName=<name>',
    (name) => {
      setOption('referrer', name);
      return name;
    });
  flags.option('--type-assertion-module <path>',
    'Absolute path to the type assertion module.',
    (path) => {
      setOption('type-assertion-module', path);
      return path;
    });
  flags.option('--script <fileName>',
    'Parse as Script (must precede modules)',
    (fileName) => {
      options.scripts.push(fileName);
    });
}

This is called by build.js to add options to the commander command line
library.
@param {Commander} flags The commander object.

This is called by build . js to add options to the commander command line library .


function addFeatureOption(name, kind) {
  if (kind === EXPERIMENTAL)
    experimentalOptions[name] = true;

  Object.defineProperty(parseOptions, name, {
    get: function() {
      return !!options[name];
    },
    enumerable: true,
    configurable: true
  });

  Object.defineProperty(transformOptions, name, {
    get: function() {
      var v = options[name];
      if (v === 'parse')
        return false;
      return v;
    },
    enumerable: true,
    configurable: true
  });

  var defaultValue = options[name] || kind === ON_BY_DEFAULT;
  options[name] = defaultValue;
  defaultValues[name] = defaultValue;
}

function addFeatureOption ( name , kind ) { if ( kind === EXPERIMENTAL ) experimentalOptions [ name ] = true ; Object . defineProperty ( parseOptions , name , { get : function ( ) { return ! ! options [ name ] ; } , enumerable : true , configurable : true } ) ; Object . defineProperty ( transformOptions , name , { get : function ( ) { var v = options [ name ] ; if ( v === 'parse' ) return false ; return v ; } , enumerable : true , configurable : true } ) ; var defaultValue = options [ name ] || kind === ON_BY_DEFAULT ; options [ name ] = defaultValue ; defaultValues [ name ] = defaultValue ; }

Adds a feature option.
This also adds a view from the parseOption and the transformOption to the
underlying value.

Adds a feature option . This also adds a view from the parseOption and the transformOption to the underlying value .


function() {
        this.addEvents(
            /**
             * @event change
             * Fires when the value of a field is changed via the {@link #setValue} method.
             * @param {Ext.form.field.Field} this
             * @param {Object} newValue The new value
             * @param {Object} oldValue The original value
             */
            'change',
            /**
             * @event validitychange
             * Fires when a change in the field's validity is detected.
             * @param {Ext.form.field.Field} this
             * @param {Boolean} isValid Whether or not the field is now valid
             */
            'validitychange',
            /**
             * @event dirtychange
             * Fires when a change in the field's {@link #isDirty} state is detected.
             * @param {Ext.form.field.Field} this
             * @param {Boolean} isDirty Whether or not the field is now dirty
             */
            'dirtychange'
        );

        this.initValue();

        //<debug>
        var badNames = [
            'tagName',
            'nodeName',
            'children',
            'childNodes'
        ], name = this.name;

        if (name && Ext.Array.indexOf(badNames, name) > -1) {
            Ext.log.warn(
                ['It is recommended to not use "', name, '" as a field name, because it ',
                'can cause naming collisions during form submission.'].join('')
            );
        }
        //</debug>
    }

Initializes this Field mixin on the current instance. Components using this mixin should call this method during
their own initialization process.

Initializes this Field mixin on the current instance . Components using this mixin should call this method during their own initialization process .


function munge(str, options) {

    var aMunged = [];
    var aChars, i;

    //  initialize default options
    options = options || {};

    if (options.encoding) {
        // validate encoding option

        if (encoder.TYPES.indexOf(options.encoding) < 0)
            throw Error('Invalid encoding option given: ' + options.encoding);
    } else
        options.encoding = encoder.DEFAULT;

    if (str) {

        aChars = str.split('');

        for (i in aChars)
            aMunged[i] = '&#' + encoder[options.encoding](aChars[i]) + ';';
    }

    return aMunged.join('');
}

function
munge
(
str
,
options
)
{
var
aMunged
=
[
]
;
var
aChars
,
i
;
//  initialize default options
options
=
options
||
{
}
;
if
(
options
.
encoding
)
{
// validate encoding option
if
(
encoder
.
TYPES
.
indexOf
(
options
.
encoding
)
<
0
)
throw
Error
(
'Invalid encoding option given: '
+
options
.
encoding
)
;
}
else
options
.
encoding
=
encoder
.
DEFAULT
;
if
(
str
)
{
aChars
=
str
.
split
(
''
)
;
for
(
i
in
aChars
)
aMunged
[
i
]
=
'&#'
+
encoder
[
options
.
encoding
]
(
aChars
[
i
]
)
+
';'
;
}
return
aMunged
.
join
(
''
)
;
}

the one and only public function of this module. It takes any string and munges
it according to the options. By default it uses a random encoding.

@param {String} str any string to munge, for example 'spacemonkey@moon.com'
@param {Object} options for munging
@param options.encoding can be 'ascii', 'utf8' or 'random' (default)
@return {String} the munged string
@api public

the one and only public function of this module . It takes any string and munges it according to the options . By default it uses a random encoding .


function() {
			var headerFragment = this._parseHeader(), data = {}, nodes, elm, matches, editor = this.editor;

			function getAttr(elm, name) {
				var value = elm.attr(name);

				return value || '';
			};

			// Default some values
			data.fontface = editor.getParam("fullpage_default_fontface", "");
			data.fontsize = editor.getParam("fullpage_default_fontsize", "");

			// Parse XML PI
			elm = headerFragment.firstChild;
			if (elm.type == 7) {
				data.xml_pi = true;
				matches = /encoding="([^"]+)"/.exec(elm.value);
				if (matches)
					data.docencoding = matches[1];
			}

			// Parse doctype
			elm = headerFragment.getAll('#doctype')[0];
			if (elm)
				data.doctype = '<!DOCTYPE' + elm.value + ">";

			// Parse title element
			elm = headerFragment.getAll('title')[0];
			if (elm && elm.firstChild) {
				data.metatitle = elm.firstChild.value;
			}

			// Parse meta elements
			each(headerFragment.getAll('meta'), function(meta) {
				var name = meta.attr('name'), httpEquiv = meta.attr('http-equiv'), matches;

				if (name)
					data['meta' + name.toLowerCase()] = meta.attr('content');
				else if (httpEquiv == "Content-Type") {
					matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content'));

					if (matches)
						data.docencoding = matches[1];
				}
			});

			// Parse html attribs
			elm = headerFragment.getAll('html')[0];
			if (elm)
				data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang');

			// Parse stylesheet
			elm = headerFragment.getAll('link')[0];
			if (elm && elm.attr('rel') == 'stylesheet')
				data.stylesheet = elm.attr('href');

			// Parse body parts
			elm = headerFragment.getAll('body')[0];
			if (elm) {
				data.langdir = getAttr(elm, 'dir');
				data.style = getAttr(elm, 'style');
				data.visited_color = getAttr(elm, 'vlink');
				data.link_color = getAttr(elm, 'link');
				data.active_color = getAttr(elm, 'alink');
			}

			return data;
		}

function
(
)
{
var
headerFragment
=
this
.
_parseHeader
(
)
,
data
=
{
}
,
nodes
,
elm
,
matches
,
editor
=
this
.
editor
;
function
getAttr
(
elm
,
name
)
{
var
value
=
elm
.
attr
(
name
)
;
return
value
||
''
;
}
;
// Default some values
data
.
fontface
=
editor
.
getParam
(
"fullpage_default_fontface"
,
""
)
;
data
.
fontsize
=
editor
.
getParam
(
"fullpage_default_fontsize"
,
""
)
;
// Parse XML PI
elm
=
headerFragment
.
firstChild
;
if
(
elm
.
type
==
7
)
{
data
.
xml_pi
=
true
;
matches
=
/
encoding="([^"]+)"
/
.
exec
(
elm
.
value
)
;
if
(
matches
)
data
.
docencoding
=
matches
[
1
]
;
}
// Parse doctype
elm
=
headerFragment
.
getAll
(
'#doctype'
)
[
0
]
;
if
(
elm
)
data
.
doctype
=
'<!DOCTYPE'
+
elm
.
value
+
">"
;
// Parse title element
elm
=
headerFragment
.
getAll
(
'title'
)
[
0
]
;
if
(
elm
&&
elm
.
firstChild
)
{
data
.
metatitle
=
elm
.
firstChild
.
value
;
}
// Parse meta elements
each
(
headerFragment
.
getAll
(
'meta'
)
,
function
(
meta
)
{
var
name
=
meta
.
attr
(
'name'
)
,
httpEquiv
=
meta
.
attr
(
'http-equiv'
)
,
matches
;
if
(
name
)
data
[
'meta'
+
name
.
toLowerCase
(
)
]
=
meta
.
attr
(
'content'
)
;
else
if
(
httpEquiv
==
"Content-Type"
)
{
matches
=
/
charset\s*=\s*(.*)\s*
/
gi
.
exec
(
meta
.
attr
(
'content'
)
)
;
if
(
matches
)
data
.
docencoding
=
matches
[
1
]
;
}
}
)
;
// Parse html attribs
elm
=
headerFragment
.
getAll
(
'html'
)
[
0
]
;
if
(
elm
)
data
.
langcode
=
getAttr
(
elm
,
'lang'
)
||
getAttr
(
elm
,
'xml:lang'
)
;
// Parse stylesheet
elm
=
headerFragment
.
getAll
(
'link'
)
[
0
]
;
if
(
elm
&&
elm
.
attr
(
'rel'
)
==
'stylesheet'
)
data
.
stylesheet
=
elm
.
attr
(
'href'
)
;
// Parse body parts
elm
=
headerFragment
.
getAll
(
'body'
)
[
0
]
;
if
(
elm
)
{
data
.
langdir
=
getAttr
(
elm
,
'dir'
)
;
data
.
style
=
getAttr
(
elm
,
'style'
)
;
data
.
visited_color
=
getAttr
(
elm
,
'vlink'
)
;
data
.
link_color
=
getAttr
(
elm
,
'link'
)
;
data
.
active_color
=
getAttr
(
elm
,
'alink'
)
;
}
return
data
;
}


function() {
        var me = this,
            menuTrigger = me.menuTrigger,
            names = me.layout.names;

        // The rendering flag is set when getRenderTree is called which we do when returning markup string for the owning layout's "suffix"
        if (menuTrigger.rendering) {
            menuTrigger.finishRender();
            me.triggerTotalWidth = menuTrigger[names.getWidth]() + menuTrigger.el.getMargin(names.parallelMargins);
        }
    }

Finishes the render operation of the trigger Button.
@private

Finishes the render operation of the trigger Button .


function(width, height) {
        var me = this;
        me.target.setSize(width, height);
        me.fireEvent('resize', me, width, height, null);
    }

function ( width , height ) { var me = this ; me . target . setSize ( width , height ) ; me . fireEvent ( 'resize' , me , width , height , null ) ; }

Perform a manual resize and fires the 'resize' event.
@param {Number} width
@param {Number} height

Perform a manual resize and fires the resize event .


function(date, format) {
        var formatFunctions = utilDate.formatFunctions;

        if (!Ext.isDate(date)) {
            return '';
        }

        if (formatFunctions[format] == null) {
            utilDate.createFormat(format);
        }

        return formatFunctions[format].call(date) + '';
    }

function ( date , format ) { var formatFunctions = utilDate . formatFunctions ; if ( ! Ext . isDate ( date ) ) { return '' ; } if ( formatFunctions [ format ] == null ) { utilDate . createFormat ( format ) ; } return formatFunctions [ format ] . call ( date ) + '' ; }

Formats a date given the supplied format string.
@param {Date} date The date to format
@param {String} format The format string
@return {String} The formatted date or an empty string if date parameter is not a JavaScript Date object

Formats a date given the supplied format string .


function(date) {
        var num = 0,
            d = Ext.Date.clone(date),
            m = date.getMonth(),
            i;

        for (i = 0, d.setDate(1), d.setMonth(0); i < m; d.setMonth(++i)) {
            num += utilDate.getDaysInMonth(d);
        }
        return num + date.getDate() - 1;
    }

function ( date ) { var num = 0 , d = Ext . Date . clone ( date ) , m = date . getMonth ( ) , i ; for ( i = 0 , d . setDate ( 1 ) , d . setMonth ( 0 ) ; i < m ; d . setMonth ( ++ i ) ) { num += utilDate . getDaysInMonth ( d ) ; } return num + date . getDate ( ) - 1 ; }

Get the numeric day number of the year, adjusted for leap year.
@param {Date} date The date
@return {Number} 0 to 364 (365 in leap years).

Get the numeric day number of the year adjusted for leap year .


function() {
        var nativeDate = window.Date,
            p,
            statics = ['useStrict', 'formatCodeToRegex', 'parseFunctions', 'parseRegexes', 'formatFunctions', 'y2kYear', 'MILLI', 'SECOND', 'MINUTE', 'HOUR', 'DAY', 'MONTH', 'YEAR', 'defaults', 'dayNames', 'monthNames', 'monthNumbers', 'getShortMonthName', 'getShortDayName', 'getMonthNumber', 'formatCodes', 'isValid', 'parseDate', 'getFormatCode', 'createFormat', 'createParser', 'parseCodes'],
            proto = ['dateFormat', 'format', 'getTimezone', 'getGMTOffset', 'getDayOfYear', 'getWeekOfYear', 'isLeapYear', 'getFirstDayOfMonth', 'getLastDayOfMonth', 'getDaysInMonth', 'getSuffix', 'clone', 'isDST', 'clearTime', 'add', 'between'],
            sLen    = statics.length,
            pLen    = proto.length,
            stat, prot, s;

        //Append statics
        for (s = 0; s < sLen; s++) {
            stat = statics[s];
            nativeDate[stat] = utilDate[stat];
        }

        //Append to prototype
        for (p = 0; p < pLen; p++) {
            prot = proto[p];
            nativeDate.prototype[prot] = function() {
                var args = Array.prototype.slice.call(arguments);
                args.unshift(this);
                return utilDate[prot].apply(utilDate, args);
            };
        }
    }

function
(
)
{
var
nativeDate
=
window
.
Date
,
p
,
statics
=
[
'useStrict'
,
'formatCodeToRegex'
,
'parseFunctions'
,
'parseRegexes'
,
'formatFunctions'
,
'y2kYear'
,
'MILLI'
,
'SECOND'
,
'MINUTE'
,
'HOUR'
,
'DAY'
,
'MONTH'
,
'YEAR'
,
'defaults'
,
'dayNames'
,
'monthNames'
,
'monthNumbers'
,
'getShortMonthName'
,
'getShortDayName'
,
'getMonthNumber'
,
'formatCodes'
,
'isValid'
,
'parseDate'
,
'getFormatCode'
,
'createFormat'
,
'createParser'
,
'parseCodes'
]
,
proto
=
[
'dateFormat'
,
'format'
,
'getTimezone'
,
'getGMTOffset'
,
'getDayOfYear'
,
'getWeekOfYear'
,
'isLeapYear'
,
'getFirstDayOfMonth'
,
'getLastDayOfMonth'
,
'getDaysInMonth'
,
'getSuffix'
,
'clone'
,
'isDST'
,
'clearTime'
,
'add'
,
'between'
]
,
sLen
=
statics
.
length
,
pLen
=
proto
.
length
,
stat
,
prot
,
s
;
//Append statics
for
(
s
=
0
;
s
<
sLen
;
s
++
)
{
stat
=
statics
[
s
]
;
nativeDate
[
stat
]
=
utilDate
[
stat
]
;
}
//Append to prototype
for
(
p
=
0
;
p
<
pLen
;
p
++
)
{
prot
=
proto
[
p
]
;
nativeDate
.
prototype
[
prot
]
=
function
(
)
{
var
args
=
Array
.
prototype
.
slice
.
call
(
arguments
)
;
args
.
unshift
(
this
)
;
return
utilDate
[
prot
]
.
apply
(
utilDate
,
args
)
;
}
;
}
}

Maintains compatibility with old static and prototype window.Date methods.

Maintains compatibility with old static and prototype window . Date methods .


function readSync() {
    const TLS_CERT = process.env.TLS_CERT;
    const TLS_KEY = process.env.TLS_KEY;
    const TLS_CA = process.env.TLS_CA;
    const tls_cert = readOpt("--tls-cert");
    const tls_key = readOpt("--tls-key");
    const tls_ca = readOpt("--tls-ca");
    const result = {
        secureOptions: constants.SSL_OP_NO_TLSv1
    };

    if (tls_cert) {
        if (tls_key) {
            result.cert = fs.readFileSync(tls_cert);
            result.key = fs.readFileSync(tls_key);

            if (tls_ca) {
                result.ca = fs.readFileSync(tls_ca);
            }
        } else {
            result.pfx = fs.readFileSync(tls_cert);
        }
    } else if (TLS_CERT) {
        if (TLS_KEY) {
            result.cert = fs.readFileSync(TLS_CERT);
            result.key = fs.readFileSync(TLS_KEY);

            if (TLS_CA) {
                result.ca = fs.readFileSync(TLS_CA);
            }
        } else {
            result.pfx = fs.readFileSync(TLS_CERT);
        }
    }

    return result;
}

function readSync ( ) { const TLS_CERT = process . env . TLS_CERT ; const TLS_KEY = process . env . TLS_KEY ; const TLS_CA = process . env . TLS_CA ; const tls_cert = readOpt ( "--tls-cert" ) ; const tls_key = readOpt ( "--tls-key" ) ; const tls_ca = readOpt ( "--tls-ca" ) ; const result = { secureOptions : constants . SSL_OP_NO_TLSv1 } ; if ( tls_cert ) { if ( tls_key ) { result . cert = fs . readFileSync ( tls_cert ) ; result . key = fs . readFileSync ( tls_key ) ; if ( tls_ca ) { result . ca = fs . readFileSync ( tls_ca ) ; } } else { result . pfx = fs . readFileSync ( tls_cert ) ; } } else if ( TLS_CERT ) { if ( TLS_KEY ) { result . cert = fs . readFileSync ( TLS_CERT ) ; result . key = fs . readFileSync ( TLS_KEY ) ; if ( TLS_CA ) { result . ca = fs . readFileSync ( TLS_CA ) ; } } else { result . pfx = fs . readFileSync ( TLS_CERT ) ; } } return result ; }

Read TLS options from filesystem synchronously.  Paths are read from CLI
options or environment variables.
@returns {object}

Read TLS options from filesystem synchronously . Paths are read from CLI options or environment variables .