触发selectionchange
@param {Object} _document 文档对象
@param  {Event} _event 事件对象
507088
function(_document,_force){
                var _r = _getSelectionRange(_document);
                if (_force || !_sameRange(_r, _ranges.get(_document))) {
                    _ranges.set(_document, _r);
                    setTimeout(function(){
                        console.log('selectionchange')
                        _v._$dispatchEvent(_document,'selectionchange');
                    }, 0);
                }
            }
1074090
function trigger (el, event) {
  if (document.createEvent) {
    var ev = document.createEvent('HTMLEvents')
    ev.initEvent(event, true, false)
    el.dispatchEvent(ev)
  } else {
    el.fireEvent('on' + event)
  }
}
681196
function onEnter(
    event: *,
    change: Change,
    editor: *,
    opts: Options
): void | Change {
    event.preventDefault();
    const { selection, document } = change.value;
    const pos = TablePosition.create(opts, document, selection.startKey);

    if (
        !selection.hasFocusAtStartOf(pos.cell) &&
        !selection.hasFocusAtEndOf(pos.cell)
    ) {
        return undefined;
    }

    if (event.shiftKey) {
        return change
            .splitBlock()
            .setBlocks({ type: opts.typeContent, data: {} });
    }

    return insertRow(opts, change);
}
60050
function () {
                if (this._document) {
                    utilsEvent.removeListener(this._document, "mousedown", {
                        fn : this.onDocumentClick
                    });
                    utilsEvent.removeListener(this._document, "touchend", {
                        fn : this.onDocumentClick
                    });
                    utilsEvent.removeListener(this._document, "mouseout", {
                        fn : this.onDocumentMouseOut
                    });
                    utilsEvent.removeListener(this._document, "mousewheel", {
                        fn : this.onDocumentMouseScroll
                    });
                    utilsEvent.removeListener(this._document.body, "focusin", {
                        fn : this.onDocumentFocusIn
                    });
                    ariaUtilsAriaWindow.detachWindow();
                    this._document = null;
                    if (ariaCoreBrowser.isOldIE) {
                        ariaUtilsEvent.removeListener(Aria.$window, "mousewheel", {
                            fn : this._onScroll
                        });
                    } else {
                        ariaUtilsEvent.removeListener(Aria.$window, "scroll", {
                            fn : this._onScroll
                        });
                    }
                }
            }
1297504
function _handleActiveEditorChange(event, current, previous) {
        if (current) { // Handle only full editors
            if (_mrofList.length === 0) {
                _initRecentFilesList();
            }

            var file = current.document.file;
            var paneId = current._paneId;
            _addToMROFList(file, paneId, current.getCursorPos(true, "first"));
        }

        if (previous) { // Capture the last know cursor position
            _updateCursorPosition(previous.document.file.fullPath, previous._paneId, previous.getCursorPos(true, "first"));
        }
    }
985854
@Override
    @InterfaceAudience.Private
    public void changed(Database.ChangeEvent event) {
        final List<DocumentChange> changes = event.getChanges();
        supportExecutor.submit(new Runnable() {
            @Override
            public void run() {
                submitRevisions(changes);
            }
        });
    }
690234
function _onDocumentSaved(event, doc) {
        if (!isActive() || !_server) {
            return;
        }

        var absolutePath            = doc.file.fullPath,
            liveDocument            = absolutePath && _server.get(absolutePath),
            liveEditingEnabled      = liveDocument && liveDocument.isLiveEditingEnabled  && liveDocument.isLiveEditingEnabled();

        // Skip reload if the saved document has live editing enabled
        if (liveEditingEnabled) {
            return;
        }

        // reload the page if the given document is a JS file related
        // to the current live document.
        if (_liveDocument.isRelated(absolutePath)) {
            if (doc.getLanguage().getId() === "javascript") {
                _setStatus(STATUS_RELOADING);
                _protocol.reload();
            }
        }
    }
400152
function docPreEventFunction(event, socket) {
				// send update info to global log 
				live.emit('log:doc', event);			
				/* send the users change events */
				socket.emit('doc:pre', event);
				socket.emit('doc:pre:' + event.type, event);
			}
1188519
function documentLeave ( event, data ) {
            if ( event.type === "mouseout" && event.target.nodeName === "HTML" && event.relatedTarget === null ){
                eventEnd (event, data);
            }
        }
1082983
def perform_matched_selection(self, event):
        
        selected = TextHelper(self.editor).match_select()
        if selected and event:
            event.accept()
382101
def trigger(self, attr, old, new, hint=None, setter=None):
        ''' 

        '''
        def invoke():
            callbacks = self._callbacks.get(attr)
            if callbacks:
                for callback in callbacks:
                    callback(attr, old, new)
        if hasattr(self, '_document') and self._document is not None:
            self._document._notify_change(self, attr, old, new, hint, setter, invoke)
        else:
            invoke()
858243
function _onActiveEditorChange(event, current, previous) {
        if (previous) {
            previous.off(".statusbar");
            previous.document.off(".statusbar");
            previous.document.releaseRef();
        }

        if (!current) {
            StatusBar.hideAllPanes();
        } else {
            var fullPath = current.document.file.fullPath;
            StatusBar.showAllPanes();

            current.on("cursorActivity.statusbar", _updateCursorInfo);
            current.on("optionChange.statusbar", function () {
                _updateIndentType(fullPath);
                _updateIndentSize(fullPath);
            });
            current.on("change.statusbar", function () {
                // async update to keep typing speed smooth
                window.setTimeout(function () { _updateFileInfo(current); }, 0);
            });
            current.on("overwriteToggle.statusbar", _updateOverwriteLabel);

            current.document.addRef();
            current.document.on("languageChanged.statusbar", function () {
                _updateLanguageInfo(current);
            });

            _updateCursorInfo(null, current);
            _updateLanguageInfo(current);
            _updateEncodingInfo(current);
            _updateFileInfo(current);
            _initOverwriteMode(current);
            _updateIndentType(fullPath);
            _updateIndentSize(fullPath);
        }
    }
738326
public void onSelectionChanged(SelectionEvent event) {
		int count = event.getSelection().length;
		if (count == 0) {
			focusButton.setDisabled(true);
			showButton.setDisabled(true);
		} else if (count == 1) {
			focusButton.setDisabled(false);
			showButton.setDisabled(false);
		} else {
			focusButton.setDisabled(false);
			showButton.setDisabled(true);
		}
		for (ToolStripButton button : extraButtons) {
			button.setDisabled(count == 0);
		}
	}
1124777
function handleDirtyChange(event, changedDoc) {
        var currentDoc = DocumentManager.getCurrentDocument();

        if (currentDoc && changedDoc.file.fullPath === currentDoc.file.fullPath) {
            _updateTitle();
        }
    }
1304251
function mouseup(event) {
                    // Prevent default dragging of selected content
                    event.preventDefault();
                    // Remove helper
                    helper.remove();
                    // Change all selecting items to selected
                    var childs = getSelectableElements(element);

                    for (var i = 0; i < childs.length; i++) {
                        if (childs[i].scope().isSelecting === true) {
                            childs[i].scope().isSelecting = false;

                            childs[i].scope().isSelected = event.ctrlKey ? !childs[i].scope().isSelected : true;
                            childs[i].scope().$apply();
                        } else {
                            if (checkElementHitting(transformBox(childs[i].prop('offsetLeft'), childs[i].prop('offsetTop'), childs[i].prop('offsetLeft') + childs[i].prop('offsetWidth'), childs[i].prop('offsetTop') + childs[i].prop('offsetHeight')), transformBox(event.pageX, event.pageY, event.pageX, event.pageY))) {
                                if (childs[i].scope().isSelected === false) {
                                    childs[i].scope().isSelected = true;
                                    childs[i].scope().$apply();
                                }
                            }
                        }
                    }
                    // Remove listeners
                    $document.off('mousemove', mousemove);
                    $document.off('mouseup', mouseup);
                }
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);
    }
  }
1291906
function eventStart ( event, data ) {

            if ( data.handleNumbers.length === 1 ) {

                var handle = scope_Handles[data.handleNumbers[0]];

                // Ignore 'disabled' handles
                if ( handle.hasAttribute('disabled') ) {
                    return false;
                }

                // Mark the handle as 'active' so it can be styled.
                scope_ActiveHandle = handle.children[0];
                addClass(scope_ActiveHandle, options.cssClasses.active);
            }

            // Fix #551, where a handle gets selected instead of dragged.
            event.preventDefault();

            // A drag should never propagate up to the 'tap' event.
            event.stopPropagation();

            // Attach the move and end events.
            var moveEvent = attachEvent(actions.move, document.documentElement, eventMove, {
                startCalcPoint: event.calcPoint,
                baseSize: baseSize(),
                pageOffset: event.pageOffset,
                handleNumbers: data.handleNumbers,
                buttonsProperty: event.buttons,
                locations: scope_Locations.slice()
            });

            var endEvent = attachEvent(actions.end, document.documentElement, eventEnd, {
                handleNumbers: data.handleNumbers
            });

            var outEvent = attachEvent("mouseout", document.documentElement, documentLeave, {
                handleNumbers: data.handleNumbers
            });

            document.documentElement.noUiListeners = moveEvent.concat(endEvent, outEvent);

            // Text selection isn't an issue on touch devices,
            // so adding cursor styles can be skipped.
            if ( event.cursor ) {

                // Prevent the 'I' cursor and extend the range-drag cursor.
                document.body.style.cursor = getComputedStyle(event.target).cursor;

                // Mark the target with a dragging state.
                if ( scope_Handles.length > 1 ) {
                    addClass(scope_Target, options.cssClasses.drag);
                }

                var f = function(){
                    return false;
                };

                document.body.noUiListener = f;

                // Prevent text selection when dragging the handles.
                document.body.addEventListener('selectstart', f, false);
            }

            data.handleNumbers.forEach(function(handleNumber){
                fireEvent('start', handleNumber);
            });
        }