抽取并删除事件属性，返回事件属性
777828
function getDomEvents(attrs, isStdTag, $actionsKeys){
	//if ( !isStdTag || !attrs ) {
	if ( !attrs ) {
		return null;
	}

	let rs = [], keys = [];
	for ( let key in attrs ) {
		if ( REG_EVENTS.test(key) ) {
			if ( !attrs[key].trim() ) {
				continue; // 未定义，忽略
			}

			// 字符串形式改成表达式形式 onclick="fnClick" => onclick="{=$actions.fnClick}"
			if ( attrs[key].indexOf('{') < 0 ) {
				// 没有表达式，检查指定方法是否存在
				if ( !$actionsKeys.includes(attrs[key].trim()) ) {
					let msg = 'action not found: ' + attrs[key];			// TODO 定位显示
					throw new Err(msg); // 指定方法找不到，需要定义
				}else{
					attrs[key] = '{=$actions.' + attrs[key].trim() + '}'; // onclick="fnClick" => onclick="{=$actions.fnClick}"
				}
			}

			// 标准标签时，保存事件名
			if ( isStdTag ) {
				// 标准标签的事件名简化去掉on，a{onclick:...}改成 a{click:...}
				rs.push( '"' + key.substring(2).toLowerCase() + '": ' + util.getExpression(attrs[key]) );
				keys.push(key);
			}

		}
	}

	// 标准标签时，从属性中删除，后续另行移到e属性中
	isStdTag && keys.forEach(k => delete attrs[k]);

	if ( rs.length ) {
		return '{' + rs.join(',') + '}';
	}
	return null;
}
757452
function handle(e) {
  co(function*() {
    log.debug('error code = %s', e.code);
    log.debug(e.stack || e);
    const handList = utils.getHandleList().concat(innerList);
    // 发送错误日志
    report.error(e.code || 'fie-error', e.stack || e, true);

    for (let i = 0; i < handList.length; i += 1) {
      const res = yield handList[i](e);
      if (res === true) {
        // 说明错误已被处理, 可以直接返回了
        return;
      }
    }
  }).catch(err => {
    console.log(err);
  });
}
41743
function bind(from, node, comPrefix, valPrefix, clsPrefix, ignores) {
  ignores = Object.assign({
    true: true,
    false: true,
    null: true,
    undefined: true
  }, ignores);

  let hasPath = false;

  //处理节点属性
  let attributes = node.attributes;
  for (let i in attributes) {
    if (!/^\d+$/.test(i)) continue;
    let attr = attributes[i];

    //处理属性值
    if (attr.value.indexOf('{') > -1) {
      attr.value = replaceString(from, attr.value, valPrefix, ignores);
    }

    //绑定事件
    if (/^(bind|catch)\w+/.test(attr.name)) {
      node.setAttribute('data-' + attr.name, attr.value);
      attr.value = '_dispatch';
      if (!hasPath && comPrefix) {
        node.setAttribute('data-path', comPrefix);
      }
    }

    //如果是循环标签,则在子标签中忽略循环索引和值变量
    if (attr.name === 'wx:for') {
      let index = node.getAttribute('wx:for-index') || 'index';
      let item = node.getAttribute('wx:for-item') || 'item';
      ignores[index] = true;
      ignores[item] = true;
    }

    if (clsPrefix && attr.name === 'class') {
      const matchArr = [];
      // "xxx {{a ? 'b' : 'c'}}"
      // => "xxx $"
      attr.value = attr.value.replace(/\{\{([^}]+)\}\}/ig, function (match) {
        matchArr.push(match);
        matchArr.push(match);
        return '$';
      });

      // => "xxx prefix-xxx $ prefix-$"
      attr.value = attr.value.split(' ').map(cls => `${cls} ${clsPrefix}-${cls}`).join(' ');

      // => "xxx prefix-xxx {{a ? 'b' : 'c'}} prefix-{{a ? 'b' : 'c'}}"
      attr.value = attr.value.replace(/\$/g, function () {
        const matchItem = matchArr.shift();
        return matchItem;
      });
    }
  }

  //如果节点为文本
  if (node.nodeName === '#text') {
    let data = node.data;
    if (data) {
      node.replaceData(0, data.length, replaceString(from, data, valPrefix, ignores));
    }
  }

  //递归处理子节点
  for (let i in node.childNodes) {
    if (!/^\d+$/.test(i)) continue;
    let n = node.childNodes[i];
    // 不转换template 定义
    if (n.nodeName === 'template' && n.getAttribute('name')) {
      bindTemplateEvents(n);
      continue;
    }
    bind(from, n, comPrefix, valPrefix, clsPrefix, ignores);
  }
}
371541
function () {

    var keys = Object.keys(wating);

    /*
     * 检测依赖关系，
     * FIXME 暂时未处理循环依赖.以及始终不满足执行条件的情况.
     */
    keys.forEach(function (name) {
        var args = [];
        var factory = wating[name][0];
        var depends = wating[name][1];
        var done = wating[name][2];

        var canDo = depends.every(function (name) {

            // 插件系统中内容优先，资源池中置后
            var value = working[name] || Resource[name];

            if (value) {
                args.push(value);
                return true;
            }

            return false;
        });

        if (canDo) {
            // 先移除，防止callback中检测依赖时产生的循环
            delete wating[name];

            //  判断异步及同步
            if (done) {
                args.push(done);
                factory.apply( {}, args);
            } else {
                try {
                    var value = working[name] = factory.apply( {}, args);

                    oldDefineOfPlugin.call(Plugin, name, value);
                }catch(err) {
                    stdLog(['%s, can not start the plug-in [%s], \nstack:', err.stack, name], 'crash');
                    process.exit(0);
                    return;
                }
            }
        }
    });
}
931740
protected void startEventParserInternal(CanalEventParser eventParser, boolean isGroup) {
        if (eventParser instanceof AbstractEventParser) {
            AbstractEventParser abstractEventParser = (AbstractEventParser) eventParser;
            // 首先启动log position管理器
            CanalLogPositionManager logPositionManager = abstractEventParser.getLogPositionManager();
            if (!logPositionManager.isStart()) {
                logPositionManager.start();
            }
        }

        if (eventParser instanceof MysqlEventParser) {
            MysqlEventParser mysqlEventParser = (MysqlEventParser) eventParser;
            CanalHAController haController = mysqlEventParser.getHaController();

            if (haController instanceof HeartBeatHAController) {
                ((HeartBeatHAController) haController).setCanalHASwitchable(mysqlEventParser);
            }

            if (!haController.isStart()) {
                haController.start();
            }

        }
    }
1006796
function (_this) {
    // 抽屉栏滑动手势控制
    var openNavEventHandler;
    var touchStartX;
    var touchStartY;
    var swipeStartX;
    var swiping = false;
    var maybeSwiping = false;
    var $body = $('body');

    // 手势触发的范围
    var swipeAreaWidth = 24;

    function enableSwipeHandling() {
      if (!openNavEventHandler) {
        $body.on('touchstart', onBodyTouchStart);
        openNavEventHandler = onBodyTouchStart;
      }
    }

    function setPosition(translateX, closeTransform) {
      var rtlTranslateMultiplier = _this.position === 'right' ? -1 : 1;
      var transformCSS = 'translate(' + (-1 * rtlTranslateMultiplier * translateX) + 'px, 0) !important;';
      _this.$drawer.css(
        'cssText',
        'transform:' + transformCSS + (closeTransform ? 'transition: initial !important;' : '')
      );
    }

    function cleanPosition() {
      _this.$drawer.css({
        transform: '',
        transition: '',
      });
    }

    function getMaxTranslateX() {
      return _this.$drawer.width() + 10;
    }

    function getTranslateX(currentX) {
      return Math.min(
        Math.max(
          swiping === 'closing' ? (swipeStartX - currentX) : (getMaxTranslateX() + swipeStartX - currentX),
          0
        ),
        getMaxTranslateX()
      );
    }

    function onBodyTouchStart(event) {
      touchStartX = event.touches[0].pageX;
      if (_this.position === 'right') {
        touchStartX = $body.width() - touchStartX;
      }

      touchStartY = event.touches[0].pageY;

      if (_this.state !== 'opened') {
        if (touchStartX > swipeAreaWidth || openNavEventHandler !== onBodyTouchStart) {
          return;
        }
      }

      maybeSwiping = true;

      $body.on({
        touchmove: onBodyTouchMove,
        touchend: onBodyTouchEnd,
        touchcancel: onBodyTouchMove,
      });
    }

    function onBodyTouchMove(event) {
      var touchX = event.touches[0].pageX;
      if (_this.position === 'right') {
        touchX = $body.width() - touchX;
      }

      var touchY = event.touches[0].pageY;

      if (swiping) {
        setPosition(getTranslateX(touchX), true);
      } else if (maybeSwiping) {
        var dXAbs = Math.abs(touchX - touchStartX);
        var dYAbs = Math.abs(touchY - touchStartY);
        var threshold = 8;

        if (dXAbs > threshold && dYAbs <= threshold) {
          swipeStartX = touchX;
          swiping = _this.state === 'opened' ? 'closing' : 'opening';
          $.lockScreen();
          setPosition(getTranslateX(touchX), true);
        } else if (dXAbs <= threshold && dYAbs > threshold) {
          onBodyTouchEnd();
        }
      }
    }

    function onBodyTouchEnd(event) {
      if (swiping) {
        var touchX = event.changedTouches[0].pageX;
        if (_this.position === 'right') {
          touchX = $body.width() - touchX;
        }

        var translateRatio = getTranslateX(touchX) / getMaxTranslateX();

        maybeSwiping = false;
        var swipingState = swiping;
        swiping = null;

        if (swipingState === 'opening') {
          if (translateRatio < 0.92) {
            cleanPosition();
            _this.open();
          } else {
            cleanPosition();
          }
        } else {
          if (translateRatio > 0.08) {
            cleanPosition();
            _this.close();
          } else {
            cleanPosition();
          }
        }

        $.unlockScreen();
      } else {
        maybeSwiping = false;
      }

      $body.off({
        touchmove: onBodyTouchMove,
        touchend: onBodyTouchEnd,
        touchcancel: onBodyTouchMove,
      });
    }

    if (_this.options.swipe) {
      enableSwipeHandling();
    }
  }
841914
function(evts, callback, scope) {
			if(!$.isFunction(callback) || !evts) {
				//如果不是函数，或者evts为空，则直接返回
				//不抛出异常
				return this;
			}

			scope = scope || null; //回调作用域
			
			evts = $.isArray(evts) ? evts : evts.split(',');

			var uuid = getUUid();
			this.cbMap[uuid] = {
				fn: callback,
				scope: scope
			};
			this._cbMap[callback] = uuid;

			$.each(evts, function(e, i) {
				this.list[e] = this.list[e] || {
					handlers: [],
					//待处理的uuid
					data: '',
					state: 0
				};

				(this.uuid2Evts[uuid] = this.uuid2Evts[uuid] || []).push(e);

				this.list[e].handlers.push(uuid); //使用uuid记录
			}, this)


			return this;
		}
926494
function initListener ( controller ) {

            // 记录是否允许所有事件的监听
        var isBegin = false,
            // 记录是否需要更新曲线
            isUpdateable = false,
            paper = controller.paper,
            currentBezier = null,
            currentPointGroup = null;

        paper.on( "mousedown", function ( e ) {

            var point = null;

            e.preventDefault();

            if ( !controller.drawState ) {
                return;
            }

            // 切换监听状态
            if ( !isBegin ) {
                isBegin = true;
                currentBezier = createBezier( paper );
                currentPointGroup = createPointGroup( paper );

                listenPointGroup( currentPointGroup, controller );

                //设置当前controller处理的贝塞尔曲线
                controller.setBezier( currentBezier );
                controller.setPointGroup( currentPointGroup );
            }

            isUpdateable = false;

            // 获取当前鼠标点击在用户坐标系上的映射点
            point = e.getPosition();

            updateBezier( controller, point );

        } );

        // 绘制时 更新控制点
        paper.on( "mousemove", function ( e ) {

            var point = null,
                bezierPoint = null;

            e.preventDefault();

            if ( !controller.drawState ) {
                return;
            }

            if ( !isBegin || isUpdateable ) {
                return;
            }

            point = e.getPosition();

            currentBezier.getLastPoint().setForward( point.x, point.y );
            currentPointGroup.getLastPoint().setForward( point.x, point.y );

        } );

        // 编辑时拖动更新
        paper.on( "mousemove", function ( e ) {

            var mousePoint = null,
                currentPoint = null,
                pointIndex = -1;

            e.preventDefault();

            // 不可编辑
            if ( !controller.editable ) {
                return;
            }

            mousePoint = e.getPosition();
            pointIndex = controller._modifyStatus.pointIndex;
            currentPoint = currentPointGroup.getPointByIndex( pointIndex );

            switch ( controller._modifyStatus.pointType ) {

                case PointGroup.TYPE_FORWARD:
                    currentPoint.setForward( mousePoint.x, mousePoint.y );
                    currentBezier.getPoint( pointIndex ).setForward( mousePoint.x, mousePoint.y );
                    break;

                case PointGroup.TYPE_BACKWARD:
                    currentPoint.setBackward( mousePoint.x, mousePoint.y );
                    currentBezier.getPoint( pointIndex ).setBackward( mousePoint.x, mousePoint.y );
                    break;

                case PointGroup.TYPE_VERTEX:
                    currentPoint.moveTo( mousePoint.x, mousePoint.y );
                    currentBezier.getPoint( pointIndex ).moveTo( mousePoint.x, mousePoint.y );
                    break;

            }


        } );

        paper.on( "mouseup", function () {

            if ( controller.drawState ) {

                isUpdateable = isBegin;

            } else if ( controller.modifyState ) {

                controller.disableEdit();
                // 清空状态
                controller.clearModifySatus();

            }

        } );

    }
1195781
public function init() {
		//触发应用开始事件
		$this->eventDispatcher->dispatchEvent(new \Fasim\Event\Event(\Fasim\Event\Event::$APP_START));

		//初始化配置
		$this->registerFacdes();

		//设置时区
		$timezone = $this->make('config')->get('timezone', 'Asia/Shanghai');
		date_default_timezone_set($timezone);

		//设置调试模式
		$debugMode = $this->make('config')->get('debug') === true;
		$this->setDebugMode($debugMode);
		$this->eventDispatcher->dispatchEvent(new \Fasim\Event\Event(\Fasim\Event\Event::$APP_READY));
	}
200032
function emit(resolver) {
        var items = resolver.status === STATUS.FULFILLED
            ? resolver.fulfillList
            : resolver.rejectList;

        emitGlobalEvent(resolver);

        if (!items.length) {
            return;
        }

        // 触发注册的回调函数必须
        // 在状态改变完成后
        // see #2.2.2 #2.2.3 #2.2.4
        Resolver.nextTick(
            function () {
                var item;
                while (item = items.shift()) {
                    item(resolver.data);
                }
            }
        );
    }
608819
function() {
			var oThis = this;
			// 拖动
			this.initContentDivEventFun();
			// 全选
			$('#' + this.options.id + '_header_multi_input').on('click', function(e) {
				if(this.hasChecked){
					oThis.setAllRowUnSelect();
					this.hasChecked = false;
				}else{
					oThis.setAllRowSelect();
					this.hasChecked = true;
					
				}
			});
		}
895736
protected function listenForEvents()
    {
        // -- Worker处理的事件
        //listener:beforeDaemonLoop
        //listener:beforeGetJob
        //listener:afterGetJob
        //listener:beforeJobHandle
        //listener:logger
        //listener:afterJobHandle
        //listener:jobException
        //listener:jobFailed
        //listener:afterDaemonLoop
        //listener:stop
        $this->eventsManager->attach('listener', function (Event $event, $source, $data) {
            $date = date('Y-m-d H:i:s');
            $class = get_class($source);
            $event = $event->getType();
            $payload = '';
            $message = '';
            if (is_array($data)) {
                $job = $data[0];
                $e = $data[1];
                if ($job instanceof Job) {
                    $payload = $job->getPayload();
                } elseif (is_scalar($data)) {
                    $payload = $data;
                } else {
                    $payload = serialize($job);
                }
                if ($e instanceof \Exception) {
                    $message = $data[1]->getMessage();
                } else {
                    $message = serialize($job);
                }
            } else {
                if ($data instanceof Job) {
                    $payload = $data->getPayload();
                } elseif (is_scalar($data)) {
                    $message = $data;
                } else {
                    $message = serialize($data);
                }
            }
            $this->line('[' . $date . '] Event=listener:' . $event . ', Class=' . $class . ', Msg=' . $message . ', Payload=' . $payload);
        });
    }
547904
function() {
    var self = this;

    // 遮罩层
    if (self.option('mask') && !self.mask) {
      self.mask = new Mask({
        autoShow: self.option('effect') === 'none',
        baseElement: self.option('baseElement'),
        container: self.element,
        css: {
          position: self.option('maskFixed') ? 'fixed' : self.option('css/position')
        },
        delegates: {
          'keydown': function(e) {
            (e.keyCode === 27) && self.close();
          },
          'click': function(e) {
            // shaking
            self.stop()
              .animate({
                left: '-=10'
              }, 40)
              .animate({
                left: '+=20'
              }, 80)
              .animate({
                left: '-=20'
              }, 80)
              .animate({
                left: '+=10'
              }, 40);
          }
        },
        effect: self.option('effect'),
        insert: function() {
          this.container.before(this.element);
        }
      });

      self.show(function() {
        this.mask && this.mask.show();
      }).hide(function() {
        this.mask && this.mask.hide();
      });
    }
  }
677413
function (element, type, handler, context) {
            var own = this;

            //非DOM元素不处理 handler 非function 不处理
            if (!(1 == element.nodeType || element.nodeType == 9 || element === window) || !vQ.isFunction(handler)) {
                return;
            }

            //多个事件处理
            if (vQ.isArray(type)) {
                return own._handleMultipleEvents(own.observe, element, type, handler);
            }

            var _handler = handler;

            //上下文对象处理
            if (context) {
                _handler = function () {
                    handler.apply(context, arguments);
                };
                own._contextHandler[handler.$$guid] = _handler;
                _handler.$$guid = handler.$$guid = handler.$$guid || own._guid++;
            }

            //调用原生方法绑定事件
            if (element.addEventListener) {
                element.addEventListener(type, _handler, false);
            } else {
                //IE等 自行托管事件

                // assign each event handler a unique ID
                if (!_handler.$$guid) _handler.$$guid = this._guid++;
                // create a hash table of event types for the element
                if (!element.events) element.events = {};
                // create a hash table of event handlers for each element/event pair
                var handlers = element.events[type];
                if (!handlers) {
                    handlers = element.events[type] = {};
                    // store the existing event handler (if there is one)
                    if (element['on' + type]) {
                        handlers[0] = element['on' + type];
                    }
                }
                // store the event handler in the hash table
                handlers[_handler.$$guid] = _handler;
                // assign a global event handler to do all the work
                element['on' + type] = own._handleEvent;
            }
        }
5927
function(evt, data) {
			var list = this.list[evt];
			if(!list) {
				return this;
			}
			list.state = 1; //标注为可以fire
			list.data = data || '';
			var handlers = list.handlers;
			handlers = this._findCanCallbacks(handlers);
			while(handlers[0]) {
				var cb = handlers.shift();

				var scope = cb.scope;
				var args = cb.args;

				cb.fn.apply(scope, args)
			}

			return this;
		}
367003
function(name,params,callback){

        if($bridge['callHandler']){

          $bridge.callHandler(name,params,function(data){
            if(typeof callback == 'function'){
              /* 解决部分系统加载延迟导致 ios/android 不响应问题 */
              setTimeout(function(){
                callback(data);
              },bridgeConfig.bridgeWebViewDelay)
            }
          })

        }else {
          console.log("don't built-in WebView invoking ",name,'{callHandler}')
        }
    }
258662
function (event) {
        event = normalizeEvent(this.dom, event);

        var element = event.toElement || event.relatedTarget;
        if (element !== this.dom) {
            while (element && element.nodeType !== 9) {
                // 忽略包含在root中的dom引起的mouseOut
                if (element === this.dom) {
                    return;
                }

                element = element.parentNode;
            }
        }

        this.trigger('mouseout', event);
    }