tinymce.full.js
function fix(originalEvent, data) {
      var name, event = data || {}, undef;

      // Dummy function that gets replaced on the delegation state functions
      function returnFalse() {
        return false;
      }

      // Dummy function that gets replaced on the delegation state functions
      function returnTrue() {
        return true;
      }

      // Copy all properties from the original event
      for (name in originalEvent) {
        // layerX/layerY is deprecated in Chrome and produces a warning
        if (!deprecated[name]) {
          event[name] = originalEvent[name];
        }
      }

      // Normalize target IE uses srcElement
      if (!event.target) {
        event.target = event.srcElement || document;
      }

      // Experimental shadow dom support
      if (Env.experimentalShadowDom) {
        event.target = getTargetFromShadowDom(originalEvent, event.target);
      }

      // Calculate pageX/Y if missing and clientX/Y available
      if (originalEvent && mouseEventRe.test(originalEvent.type) && originalEvent.pageX === undef && originalEvent.clientX !== undef) {
        var eventDoc = event.target.ownerDocument || document;
        var doc = eventDoc.documentElement;
        var body = eventDoc.body;

        event.pageX = originalEvent.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) -
          (doc && doc.clientLeft || body && body.clientLeft || 0);

        event.pageY = originalEvent.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) -
          (doc && doc.clientTop || body && body.clientTop || 0);
      }

      // Add preventDefault method
      event.preventDefault = function () {
        event.isDefaultPrevented = returnTrue;

        // Execute preventDefault on the original event object
        if (originalEvent) {
          if (originalEvent.preventDefault) {
            originalEvent.preventDefault();
          } else {
            originalEvent.returnValue = false; // IE
          }
        }
      };

      // Add stopPropagation
      event.stopPropagation = function () {
        event.isPropagationStopped = returnTrue;

        // Execute stopPropagation on the original event object
        if (originalEvent) {
          if (originalEvent.stopPropagation) {
            originalEvent.stopPropagation();
          } else {
            originalEvent.cancelBubble = true; // IE
          }
        }
      };

      // Add stopImmediatePropagation
      event.stopImmediatePropagation = function () {
        event.isImmediatePropagationStopped = returnTrue;
        event.stopPropagation();
      };

      // Add event delegation states
      if (!event.isDefaultPrevented) {
        event.isDefaultPrevented = returnFalse;
        event.isPropagationStopped = returnFalse;
        event.isImmediatePropagationStopped = returnFalse;
      }

      // Add missing metaKey for IE 8
      if (typeof event.metaKey == 'undefined') {
        event.metaKey = false;
      }

      return event;
    }
function fix(originalEvent, data) {
      var name, event = data || {}, undef;

      // Dummy function that gets replaced on the delegation state functions
      function returnFalse() {
        return false;
      }

      // Dummy function that gets replaced on the delegation state functions
      function returnTrue() {
        return true;
      }

      // Copy all properties from the original event
      for (name in originalEvent) {
        // layerX/layerY is deprecated in Chrome and produces a warning
        if (!deprecated[name]) {
          event[name] = originalEvent[name];
        }
      }

      // Normalize target IE uses srcElement
      if (!event.target) {
        event.target = event.srcElement || document;
      }

      // Experimental shadow dom support
      if (Env.experimentalShadowDom) {
        event.target = getTargetFromShadowDom(originalEvent, event.target);
      }

      // Calculate pageX/Y if missing and clientX/Y available
      if (originalEvent && mouseEventRe.test(originalEvent.type) && originalEvent.pageX === undef && originalEvent.clientX !== undef) {
        var eventDoc = event.target.ownerDocument || document;
        var doc = eventDoc.documentElement;
        var body = eventDoc.body;

        event.pageX = originalEvent.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) -
          (doc && doc.clientLeft || body && body.clientLeft || 0);

        event.pageY = originalEvent.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) -
          (doc && doc.clientTop || body && body.clientTop || 0);
      }

      // Add preventDefault method
      event.preventDefault = function () {
        event.isDefaultPrevented = returnTrue;

        // Execute preventDefault on the original event object
        if (originalEvent) {
          if (originalEvent.preventDefault) {
            originalEvent.preventDefault();
          } else {
            originalEvent.returnValue = false; // IE
          }
        }
      };

      // Add stopPropagation
      event.stopPropagation = function () {
        event.isPropagationStopped = returnTrue;

        // Execute stopPropagation on the original event object
        if (originalEvent) {
          if (originalEvent.stopPropagation) {
            originalEvent.stopPropagation();
          } else {
            originalEvent.cancelBubble = true; // IE
          }
        }
      };

      // Add stopImmediatePropagation
      event.stopImmediatePropagation = function () {
        event.isImmediatePropagationStopped = returnTrue;
        event.stopPropagation();
      };

      // Add event delegation states
      if (!event.isDefaultPrevented) {
        event.isDefaultPrevented = returnFalse;
        event.isPropagationStopped = returnFalse;
        event.isImmediatePropagationStopped = returnFalse;
      }

      // Add missing metaKey for IE 8
      if (typeof event.metaKey == 'undefined') {
        event.metaKey = false;
      }

      return event;
    }
function fix ( originalEvent , data ) { var name , event = data || { } , undef ; // Dummy function that gets replaced on the delegation state functions function returnFalse ( ) { return false ; } // Dummy function that gets replaced on the delegation state functions function returnTrue ( ) { return true ; } // Copy all properties from the original event for ( name in originalEvent ) { // layerX/layerY is deprecated in Chrome and produces a warning if ( ! deprecated [ name ] ) { event [ name ] = originalEvent [ name ] ; } } // Normalize target IE uses srcElement if ( ! event . target ) { event . target = event . srcElement || document ; } // Experimental shadow dom support if ( Env . experimentalShadowDom ) { event . target = getTargetFromShadowDom ( originalEvent , event . target ) ; } // Calculate pageX/Y if missing and clientX/Y available if ( originalEvent && mouseEventRe . test ( originalEvent . type ) && originalEvent . pageX === undef && originalEvent . clientX !== undef ) { var eventDoc = event . target . ownerDocument || document ; var doc = eventDoc . documentElement ; var body = eventDoc . body ; event . pageX = originalEvent . clientX + ( doc && doc . scrollLeft || body && body . scrollLeft || 0 ) - ( doc && doc . clientLeft || body && body . clientLeft || 0 ) ; event . pageY = originalEvent . clientY + ( doc && doc . scrollTop || body && body . scrollTop || 0 ) - ( doc && doc . clientTop || body && body . clientTop || 0 ) ; } // Add preventDefault method event . preventDefault = function ( ) { event . isDefaultPrevented = returnTrue ; // Execute preventDefault on the original event object if ( originalEvent ) { if ( originalEvent . preventDefault ) { originalEvent . preventDefault ( ) ; } else { originalEvent . returnValue = false ; // IE } } } ; // Add stopPropagation event . stopPropagation = function ( ) { event . isPropagationStopped = returnTrue ; // Execute stopPropagation on the original event object if ( originalEvent ) { if ( originalEvent . stopPropagation ) { originalEvent . stopPropagation ( ) ; } else { originalEvent . cancelBubble = true ; // IE } } } ; // Add stopImmediatePropagation event . stopImmediatePropagation = function ( ) { event . isImmediatePropagationStopped = returnTrue ; event . stopPropagation ( ) ; } ; // Add event delegation states if ( ! event . isDefaultPrevented ) { event . isDefaultPrevented = returnFalse ; event . isPropagationStopped = returnFalse ; event . isImmediatePropagationStopped = returnFalse ; } // Add missing metaKey for IE 8 if ( typeof event . metaKey == 'undefined' ) { event . metaKey = false ; } return event ; }
Normalizes a native event object or just adds the event specific methods on a custom event.
Normalizes a native event object or just adds the event specific methods on a custom event .