指定位置 @param    {HTMLElement, Event}  anchor
542468
function(anchor) {

        var $elem = anchor.parentNode && $(anchor);
        var popup = this.__popup;


        if (this.__followSkin) {
            popup.removeClass(this.__followSkin);
        }


        // 隐藏元素不可用
        if ($elem) {
            var o = $elem.offset();
            if (o.left * o.top < 0) {
                return this.__center();
            }
        }

        var that = this;
        var fixed = this.fixed;

        var $window = $(window);
        var $document = $(document);
        var winWidth = $window.width();
        var winHeight = $window.height();
        var docLeft = $document.scrollLeft();
        var docTop = $document.scrollTop();


        var popupWidth = popup.width();
        var popupHeight = popup.height();
        var width = $elem ? $elem.outerWidth() : 0;
        var height = $elem ? $elem.outerHeight() : 0;
        var offset = this.__offset(anchor);
        var x = offset.left;
        var y = offset.top;
        var left = fixed ? x - docLeft : x;
        var top = fixed ? y - docTop : y;


        var minLeft = fixed ? 0 : docLeft;
        var minTop = fixed ? 0 : docTop;
        var maxLeft = minLeft + winWidth - popupWidth;
        var maxTop = minTop + winHeight - popupHeight;


        var css = {};
        var align = this.align.split(' ');
        var className = this.className + '-';
        var reverse = { top: 'bottom', bottom: 'top', left: 'right', right: 'left' };
        var name = { top: 'top', bottom: 'top', left: 'left', right: 'left' };


        var temp = [{
            top: top - popupHeight,
            bottom: top + height,
            left: left - popupWidth,
            right: left + width
        }, {
            top: top,
            bottom: top - popupHeight + height,
            left: left,
            right: left - popupWidth + width
        }];


        var center = {
            left: left + width / 2 - popupWidth / 2,
            top: top + height / 2 - popupHeight / 2
        };


        var range = {
            left: [minLeft, maxLeft],
            top: [minTop, maxTop]
        };


        // 超出可视区域重新适应位置
        $.each(align, function(i, val) {

            // 超出右或下边界：使用左或者上边对齐
            if (temp[i][val] > range[name[val]][1]) {
                val = align[i] = reverse[val];
            }

            // 超出左或右边界：使用右或者下边对齐
            if (temp[i][val] < range[name[val]][0]) {
                align[i] = reverse[val];
            }

        });


        // 一个参数的情况
        if (!align[1]) {
            name[align[1]] = name[align[0]] === 'left' ? 'top' : 'left';
            temp[1][align[1]] = center[name[align[1]]];
        }


        //添加follow的css, 为了给css使用
        className += align.join('-') + ' ' + this.className + '-follow';

        that.__followSkin = className;


        if ($elem) {
            popup.addClass(className);
        }


        css[name[align[0]]] = parseInt(temp[0][align[0]]);
        css[name[align[1]]] = parseInt(temp[1][align[1]]);
        popup.css(css);

    }
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);
    }
1274404
function(anchornode) {
                var valid =  (anchornode.get('tagName')==='A') && anchornode.getAttribute('data-pjax-mojit'),
                    attributes, i, parheader;
                if (valid) {
                    attributes = {
                        'data-pjax-mojit': anchornode.getAttribute('data-pjax-mojit'),
                        'data-pjax-action': anchornode.getAttribute('data-pjax-action'),
                        'data-pjax-container': anchornode.getAttribute('data-pjax-container'),
                        'data-pjax-preload': anchornode.getAttribute('data-pjax-preload')
                    };
                    i = 0;
        /*jshint boss:true */
                    while (parheader=anchornode.getAttribute('data-pjax-par'+(++i))) {
                        attributes['data-pjax-par'+i] = parheader;
                    }
        /*jshint boss:false */
                    Y.fire(EVT_PJAX, {uri: anchornode.getAttribute('href'), targetid: anchornode.get('id'), attributes: attributes, fromhistorychange: false});
                }
            }
349887
function(){
        var self = this,
            list = this._listElement;            
        
        qq.attach(list, 'click', function(e){            
            e = e || window.event;
            var target = e.target || e.srcElement;
            
            if (qq.hasClass(target, self._classes.cancel)){                
                qq.preventDefault(e);
               
                var item = target.parentNode;
                self._handler.cancel(item.qqFileId);
                qq.remove(item);
            }
        });
    }
600637
function initHandlerHeader( $element, &$params )
    {
        if ( $this->anchorAsAttribute )
        {
            $anchorElement = $element->firstChild;
            if ( $anchorElement->nodeName === 'anchor' )
            {
                $element->setAttribute( 'anchor_name', $anchorElement->getAttribute( 'name' ) );
                $anchorElement = $element->removeChild( $anchorElement );
            }
        }
        $this->elementStylesToAttribute( $element );
        return null;
    }
920018
function(e) {
        if (this.options.preventDefault || e.currentTarget.getAttribute('href').substr(0, 1) !== '#') {
            e.preventDefault();
        }

        this.show(e.currentTarget);
    }
432005
function (event) {
        //event = $.event.fix(event); // jQuery event normalization.
        var element = this;//event.target;
        // @ TextNode -> nodeType == 3
        element = (element.nodeType == 3) ? element.parentNode : element;

        if (opt['disableInInput']) { // Disable shortcut keys in Input, Textarea fields
            var target = element;//$(element);
            if (target.tagName == "INPUT" || target.tagName == "TEXTAREA") {
                return;
            }
        }
        var code = event.which,
            type = event.type,
            character = String.fromCharCode(code).toLowerCase(),
            special = that.special_keys[code],
            shift = event.shiftKey,
            ctrl = event.ctrlKey,
            alt = event.altKey,
            propagate = true, // default behaivour
            mapPoint = null;

        // in opera + safari, the event.target is unpredictable.
        // for example: 'keydown' might be associated with HtmlBodyElement
        // or the element where you last clicked with your mouse.
        if (opt.checkParent) {
//              while (!that.all[element] && element.parentNode){
            while (!element['hotkeys'] && element.parentNode) {
                element = element.parentNode;
            }
        }

//          var cbMap = that.all[element].events[type].callbackMap;
        var cbMap = element['hotkeys'].events[type].callbackMap;
        if (!shift && !ctrl && !alt) { // No Modifiers
            mapPoint = cbMap[special] || cbMap[character];
        }
        // deals with combinaitons (alt|ctrl|shift+anything)
        else {
            var modif = '';
            if (alt) modif += 'alt+';
            if (ctrl) modif += 'ctrl+';
            if (shift) modif += 'shift+';
            // modifiers + special keys or modifiers + characters or modifiers + shift characters
            mapPoint = cbMap[modif + special] || cbMap[modif + character] || cbMap[modif + that.shift_nums[character]];
        }
        if (mapPoint) {
            mapPoint.cb(event);
            if (!mapPoint.propagate) {
                event.stopPropagation();
                event.preventDefault();
                return false;
            }
        }
    }
950812
function getEventAndAnchor (arg1, arg2) {
  var ev = null
  var anchor = null

  if (arguments.length === 2) {
    // Two arguments will come in this order
    ev = arg1
    anchor = arg2
  } else if (isHTMLElement(arg1)) {
    // If our first arg is an element
    // then use that as our anchor
    anchor = arg1
  } else {
    // Otherwise our argument is an event
    ev = arg1
  }

    // If there is no anchor, but we have an event
    // then use event.target
  if (!anchor && ev && ev.target) {
    anchor = ev.target
  }

    // Return an array so that it can be used with Function.apply
  return [ev, anchor]
}
416093
function () {
          if (selection.isCollapsed()) {
            var elm = editor.dom.getParent(editor.selection.getStart(), 'a');
            if (elm) {
              editor.dom.remove(elm, true);
            }

            return;
          }

          formatter.remove("link");
        }
1027530
function mklink (anchor, name) {
    var id = mkid(name);
    if (anchor) {
        if (!defined[id]) {
            defined[id] = true;
            return "<a name=\"" + id + "\">" + name + "</a>";
        }
        else
            return name;
    }
    else
        return "<a href=\"#" + id + "\">" + name + "</a>";
}
657285
def text_anchor(anchor)
      Kernel.raise ArgumentError, "Unknown anchor constant: #{anchor}" unless ANCHOR_TYPE_NAMES.key?(anchor.to_i)
      primitive "text-anchor #{ANCHOR_TYPE_NAMES[anchor.to_i]}"
    end
979679
function bindToClick(selector, handler) {
    var elems = document.querySelectorAll(selector);
    var i = -1;
    var len = elems.length;
    while (++i < len) {
      elems[i].addEventListener('click', handler);
    }
  }
873015
function expose(anchor, name, message) {
  Object.defineProperty(errors[anchor], name, {
    enumerable: true,
    get: function() {
      var err = new Error();

      err.name = capitalize(anchor) + 'Error';
      err.message = message;
      Error.captureStackTrace(err, arguments.callee);
      return err;
    }
  });
}
913171
function bind() {
      var _this2 = this;

      Binder.on('mouseover', Components.Html.root, function () {
        _this2.stop();
      });

      Binder.on('mouseout', Components.Html.root, function () {
        _this2.start();
      });
    }
474136
public static void rebind(Element e) {
    EventsListener ret = getGQueryEventListener(e);
    if (ret != null) {
      DOM.setEventListener((com.google.gwt.user.client.Element) e, ret);
    }
  }
571344
function(anchor) {

        if (this.destroyed) {
            return this;
        }

        var that = this;
        var popup = this.__popup;
        var backdrop = this.__backdrop;

        this.__activeElement = this.__getActive();

        this.open = true;
        this.follow = anchor || this.follow;


        // 初始化 show 方法
        if (!this.__ready) {

            popup
                .addClass(this.className)
                .attr('role', this.modal ? 'alertdialog' : 'dialog')
                .css('position', this.fixed ? 'fixed' : 'absolute');

            if (!_isIE6) {
                $(window).on('resize', $.proxy(this.reset, this));
            }

            // 模态浮层的遮罩
            if (this.modal) {
                var backdropCss = {
                    position: 'fixed',
                    left: 0,
                    top: 0,
                    width: '100%',
                    height: '100%',
                    overflow: 'hidden',
                    userSelect: 'none',
                    zIndex: this.zIndex || Popup.zIndex
                };


                popup.addClass(this.className + '-modal');


                if (!_isFixed) {
                    $.extend(backdropCss, {
                        position: 'absolute',
                        width: $(window).width() + 'px',
                        height: $(document).height() + 'px'
                    });
                }


                backdrop
                    .css(backdropCss)
                    .attr({ tabindex: '0' })
                    .on('focus', $.proxy(this.focus, this));

                // 锁定 tab 的焦点操作
                this.__mask = backdrop
                    .clone(true)
                    .attr('style', '')
                    .insertAfter(popup);

                backdrop
                    .addClass(this.className + '-backdrop')
                    .insertBefore(popup);

                this.__ready = true;
            }


            if (!popup.html()) {
                popup.html(this.innerHTML);
            }
        }


        popup
            .addClass(this.className + '-show')
            .show();

        backdrop.show();


        this.reset().focus();
        this.__dispatchEvent('show');

        return this;
    }
264921
function (event) {
				var href = event.oSource.getHref() || event.oSource.getTarget();
				href = href.replace("#/", "").split('/');
				/** @type string */
				var page = href[0];
				/** @type string */
				var parameter = href[1];

				event.preventDefault();
				this.getRouter().navTo(page, {id: parameter}, true);
			}