").append( jQuery.parseHTML( responseText ) ).find( selector ) :
- } else {
- return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
- ret :
- elem[ name ];
- }
- },
+ // Otherwise use the full result
+ responseText );
- propHooks: {
- tabIndex: {
- get: function( elem ) {
- return elem.hasAttribute( "tabindex" ) || rfocusable.test( elem.nodeName ) || elem.href ?
- elem.tabIndex :
- -1;
- }
- }
+ }).complete( callback && function( jqXHR, status ) {
+ self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
+ });
}
-});
-// Support: IE9+
-// Selectedness for an option in an optgroup can be inaccurate
-if ( !support.optSelected ) {
- jQuery.propHooks.selected = {
- get: function( elem ) {
- var parent = elem.parentNode;
- if ( parent && parent.parentNode ) {
- parent.parentNode.selectedIndex;
- }
- return null;
- }
+ return this;
+};
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){
+ jQuery.fn[ type ] = function( fn ){
+ return this.on( type, fn );
};
-}
-
-jQuery.each([
- "tabIndex",
- "readOnly",
- "maxLength",
- "cellSpacing",
- "cellPadding",
- "rowSpan",
- "colSpan",
- "useMap",
- "frameBorder",
- "contentEditable"
-], function() {
- jQuery.propFix[ this.toLowerCase() ] = this;
});
+jQuery.extend({
+ // Counter for holding the number of active queries
+ active: 0,
+ // Last-Modified header cache for next request
+ lastModified: {},
+ etag: {},
-var rclass = /[\t\r\n\f]/g;
+ ajaxSettings: {
+ url: ajaxLocation,
+ type: "GET",
+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
+ global: true,
+ processData: true,
+ async: true,
+ contentType: "application/x-www-form-urlencoded; charset=UTF-8",
+ /*
+ timeout: 0,
+ data: null,
+ dataType: null,
+ username: null,
+ password: null,
+ cache: null,
+ throws: false,
+ traditional: false,
+ headers: {},
+ */
-jQuery.fn.extend({
- addClass: function( value ) {
- var classes, elem, cur, clazz, j, finalValue,
- proceed = typeof value === "string" && value,
- i = 0,
- len = this.length;
+ accepts: {
+ "*": allTypes,
+ text: "text/plain",
+ html: "text/html",
+ xml: "application/xml, text/xml",
+ json: "application/json, text/javascript"
+ },
- if ( jQuery.isFunction( value ) ) {
- return this.each(function( j ) {
- jQuery( this ).addClass( value.call( this, j, this.className ) );
- });
- }
+ contents: {
+ xml: /xml/,
+ html: /html/,
+ json: /json/
+ },
- if ( proceed ) {
- // The disjunction here is for better compressibility (see removeClass)
- classes = ( value || "" ).match( rnotwhite ) || [];
+ responseFields: {
+ xml: "responseXML",
+ text: "responseText",
+ json: "responseJSON"
+ },
- for ( ; i < len; i++ ) {
- elem = this[ i ];
- cur = elem.nodeType === 1 && ( elem.className ?
- ( " " + elem.className + " " ).replace( rclass, " " ) :
- " "
- );
+ // Data converters
+ // Keys separate source (or catchall "*") and destination types with a single space
+ converters: {
- if ( cur ) {
- j = 0;
- while ( (clazz = classes[j++]) ) {
- if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
- cur += clazz + " ";
- }
- }
+ // Convert anything to text
+ "* text": String,
- // only assign if different to avoid unneeded rendering.
- finalValue = jQuery.trim( cur );
- if ( elem.className !== finalValue ) {
- elem.className = finalValue;
- }
- }
- }
- }
+ // Text to html (true = no transformation)
+ "text html": true,
- return this;
- },
+ // Evaluate text as a json expression
+ "text json": jQuery.parseJSON,
- removeClass: function( value ) {
- var classes, elem, cur, clazz, j, finalValue,
- proceed = arguments.length === 0 || typeof value === "string" && value,
- i = 0,
- len = this.length;
+ // Parse text as xml
+ "text xml": jQuery.parseXML
+ },
- if ( jQuery.isFunction( value ) ) {
- return this.each(function( j ) {
- jQuery( this ).removeClass( value.call( this, j, this.className ) );
- });
+ // For options that shouldn't be deep extended:
+ // you can add your own custom options here if
+ // and when you create one that shouldn't be
+ // deep extended (see ajaxExtend)
+ flatOptions: {
+ url: true,
+ context: true
}
- if ( proceed ) {
- classes = ( value || "" ).match( rnotwhite ) || [];
-
- for ( ; i < len; i++ ) {
- elem = this[ i ];
- // This expression is here for better compressibility (see addClass)
- cur = elem.nodeType === 1 && ( elem.className ?
- ( " " + elem.className + " " ).replace( rclass, " " ) :
- ""
- );
+ },
- if ( cur ) {
- j = 0;
- while ( (clazz = classes[j++]) ) {
- // Remove *all* instances
- while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
- cur = cur.replace( " " + clazz + " ", " " );
- }
- }
+ // Creates a full fledged settings object into target
+ // with both ajaxSettings and settings fields.
+ // If target is omitted, writes into ajaxSettings.
+ ajaxSetup: function( target, settings ) {
+ return settings ?
- // only assign if different to avoid unneeded rendering.
- finalValue = value ? jQuery.trim( cur ) : "";
- if ( elem.className !== finalValue ) {
- elem.className = finalValue;
- }
- }
- }
- }
+ // Building a settings object
+ ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
- return this;
+ // Extending ajaxSettings
+ ajaxExtend( jQuery.ajaxSettings, target );
},
- toggleClass: function( value, stateVal ) {
- var type = typeof value;
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
+ ajaxTransport: addToPrefiltersOrTransports( transports ),
- if ( typeof stateVal === "boolean" && type === "string" ) {
- return stateVal ? this.addClass( value ) : this.removeClass( value );
- }
+ // Main method
+ ajax: function( url, options ) {
- if ( jQuery.isFunction( value ) ) {
- return this.each(function( i ) {
- jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
- });
+ // If url is an object, simulate pre-1.5 signature
+ if ( typeof url === "object" ) {
+ options = url;
+ url = undefined;
}
- return this.each(function() {
- if ( type === "string" ) {
- // toggle individual class names
- var className,
- i = 0,
- self = jQuery( this ),
- classNames = value.match( rnotwhite ) || [];
-
- while ( (className = classNames[ i++ ]) ) {
- // check each className given, space separated list
- if ( self.hasClass( className ) ) {
- self.removeClass( className );
- } else {
- self.addClass( className );
- }
- }
+ // Force options to be an object
+ options = options || {};
- // Toggle whole class name
- } else if ( type === strundefined || type === "boolean" ) {
- if ( this.className ) {
- // store className if set
- data_priv.set( this, "__className__", this.className );
- }
+ var // Cross-domain detection vars
+ parts,
+ // Loop variable
+ i,
+ // URL without anti-cache param
+ cacheURL,
+ // Response headers as string
+ responseHeadersString,
+ // timeout handle
+ timeoutTimer,
- // If the element has a class name or if we're passed "false",
- // then remove the whole classname (if there was one, the above saved it).
- // Otherwise bring back whatever was previously saved (if anything),
- // falling back to the empty string if nothing was stored.
- this.className = this.className || value === false ? "" : data_priv.get( this, "__className__" ) || "";
- }
- });
- },
+ // To know if global events are to be dispatched
+ fireGlobals,
- hasClass: function( selector ) {
- var className = " " + selector + " ",
- i = 0,
- l = this.length;
- for ( ; i < l; i++ ) {
- if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
- return true;
- }
- }
+ transport,
+ // Response headers
+ responseHeaders,
+ // Create the final options object
+ s = jQuery.ajaxSetup( {}, options ),
+ // Callbacks context
+ callbackContext = s.context || s,
+ // Context for global events is callbackContext if it is a DOM node or jQuery collection
+ globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
+ jQuery( callbackContext ) :
+ jQuery.event,
+ // Deferreds
+ deferred = jQuery.Deferred(),
+ completeDeferred = jQuery.Callbacks("once memory"),
+ // Status-dependent callbacks
+ statusCode = s.statusCode || {},
+ // Headers (they are sent all at once)
+ requestHeaders = {},
+ requestHeadersNames = {},
+ // The jqXHR state
+ state = 0,
+ // Default abort message
+ strAbort = "canceled",
+ // Fake xhr
+ jqXHR = {
+ readyState: 0,
- return false;
- }
-});
+ // Builds headers hashtable if needed
+ getResponseHeader: function( key ) {
+ var match;
+ if ( state === 2 ) {
+ if ( !responseHeaders ) {
+ responseHeaders = {};
+ while ( (match = rheaders.exec( responseHeadersString )) ) {
+ responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
+ }
+ }
+ match = responseHeaders[ key.toLowerCase() ];
+ }
+ return match == null ? null : match;
+ },
+ // Raw string
+ getAllResponseHeaders: function() {
+ return state === 2 ? responseHeadersString : null;
+ },
+ // Caches the header
+ setRequestHeader: function( name, value ) {
+ var lname = name.toLowerCase();
+ if ( !state ) {
+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
+ requestHeaders[ name ] = value;
+ }
+ return this;
+ },
+ // Overrides response content-type header
+ overrideMimeType: function( type ) {
+ if ( !state ) {
+ s.mimeType = type;
+ }
+ return this;
+ },
-var rreturn = /\r/g;
+ // Status-dependent callbacks
+ statusCode: function( map ) {
+ var code;
+ if ( map ) {
+ if ( state < 2 ) {
+ for ( code in map ) {
+ // Lazy-add the new callback in a way that preserves old ones
+ statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
+ }
+ } else {
+ // Execute the appropriate callbacks
+ jqXHR.always( map[ jqXHR.status ] );
+ }
+ }
+ return this;
+ },
-jQuery.fn.extend({
- val: function( value ) {
- var hooks, ret, isFunction,
- elem = this[0];
+ // Cancel the request
+ abort: function( statusText ) {
+ var finalText = statusText || strAbort;
+ if ( transport ) {
+ transport.abort( finalText );
+ }
+ done( 0, finalText );
+ return this;
+ }
+ };
- if ( !arguments.length ) {
- if ( elem ) {
- hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
+ // Attach deferreds
+ deferred.promise( jqXHR ).complete = completeDeferred.add;
+ jqXHR.success = jqXHR.done;
+ jqXHR.error = jqXHR.fail;
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
- return ret;
- }
+ // Remove hash character (#7531: and string promotion)
+ // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
+ // Handle falsy url in the settings object (#10093: consistency with old signature)
+ // We also use the url parameter if available
+ s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
- ret = elem.value;
+ // Alias method option to type as per ticket #12004
+ s.type = options.method || options.type || s.method || s.type;
- return typeof ret === "string" ?
- // handle most common string cases
- ret.replace(rreturn, "") :
- // handle cases where value is null/undef or number
- ret == null ? "" : ret;
- }
+ // Extract dataTypes list
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""];
- return;
+ // A cross-domain request is in order when we have a protocol:host:port mismatch
+ if ( s.crossDomain == null ) {
+ parts = rurl.exec( s.url.toLowerCase() );
+ s.crossDomain = !!( parts &&
+ ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
+ );
}
- isFunction = jQuery.isFunction( value );
+ // Convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
+ s.data = jQuery.param( s.data, s.traditional );
+ }
- return this.each(function( i ) {
- var val;
+ // Apply prefilters
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
- if ( this.nodeType !== 1 ) {
- return;
- }
+ // If request was aborted inside a prefilter, stop there
+ if ( state === 2 ) {
+ return jqXHR;
+ }
- if ( isFunction ) {
- val = value.call( this, i, jQuery( this ).val() );
- } else {
- val = value;
- }
+ // We can fire global events as of now if asked to
+ fireGlobals = s.global;
- // Treat null/undefined as ""; convert numbers to string
- if ( val == null ) {
- val = "";
+ // Watch for a new set of requests
+ if ( fireGlobals && jQuery.active++ === 0 ) {
+ jQuery.event.trigger("ajaxStart");
+ }
- } else if ( typeof val === "number" ) {
- val += "";
+ // Uppercase the type
+ s.type = s.type.toUpperCase();
- } else if ( jQuery.isArray( val ) ) {
- val = jQuery.map( val, function( value ) {
- return value == null ? "" : value + "";
- });
- }
+ // Determine if request has content
+ s.hasContent = !rnoContent.test( s.type );
- hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
+ // Save the URL in case we're toying with the If-Modified-Since
+ // and/or If-None-Match header later on
+ cacheURL = s.url;
- // If set returns undefined, fall back to normal setting
- if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
- this.value = val;
- }
- });
- }
-});
+ // More options handling for requests with no content
+ if ( !s.hasContent ) {
-jQuery.extend({
- valHooks: {
- option: {
- get: function( elem ) {
- var val = jQuery.find.attr( elem, "value" );
- return val != null ?
- val :
- // Support: IE10-11+
- // option.text throws exceptions (#14686, #14858)
- jQuery.trim( jQuery.text( elem ) );
+ // If data is available, append data to url
+ if ( s.data ) {
+ cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
+ // #9682: remove data so that it's not used in an eventual retry
+ delete s.data;
}
- },
- select: {
- get: function( elem ) {
- var value, option,
- options = elem.options,
- index = elem.selectedIndex,
- one = elem.type === "select-one" || index < 0,
- values = one ? null : [],
- max = one ? index + 1 : options.length,
- i = index < 0 ?
- max :
- one ? index : 0;
- // Loop through all the selected options
- for ( ; i < max; i++ ) {
- option = options[ i ];
-
- // IE6-9 doesn't update selected after form reset (#2551)
- if ( ( option.selected || i === index ) &&
- // Don't return options that are disabled or in a disabled optgroup
- ( support.optDisabled ? !option.disabled : option.getAttribute( "disabled" ) === null ) &&
- ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
-
- // Get the specific value for the option
- value = jQuery( option ).val();
-
- // We don't need an array for one selects
- if ( one ) {
- return value;
- }
-
- // Multi-Selects return an array
- values.push( value );
- }
- }
-
- return values;
- },
-
- set: function( elem, value ) {
- var optionSet, option,
- options = elem.options,
- values = jQuery.makeArray( value ),
- i = options.length;
+ // Add anti-cache in url if needed
+ if ( s.cache === false ) {
+ s.url = rts.test( cacheURL ) ?
- while ( i-- ) {
- option = options[ i ];
- if ( (option.selected = jQuery.inArray( option.value, values ) >= 0) ) {
- optionSet = true;
- }
- }
+ // If there is already a '_' parameter, set its value
+ cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) :
- // force browsers to behave consistently when non-matching value is set
- if ( !optionSet ) {
- elem.selectedIndex = -1;
- }
- return values;
+ // Otherwise add one to the end
+ cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++;
}
}
- }
-});
-// Radios and checkboxes getter/setter
-jQuery.each([ "radio", "checkbox" ], function() {
- jQuery.valHooks[ this ] = {
- set: function( elem, value ) {
- if ( jQuery.isArray( value ) ) {
- return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ if ( jQuery.lastModified[ cacheURL ] ) {
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
}
- }
- };
- if ( !support.checkOn ) {
- jQuery.valHooks[ this ].get = function( elem ) {
- // Support: Webkit
- // "" is returned instead of "on" if a value isn't specified
- return elem.getAttribute("value") === null ? "on" : elem.value;
- };
- }
-});
-
-
-
-
-// Return jQuery for attributes-only inclusion
-
-
-jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
- "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
- "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
-
- // Handle event binding
- jQuery.fn[ name ] = function( data, fn ) {
- return arguments.length > 0 ?
- this.on( name, null, data, fn ) :
- this.trigger( name );
- };
-});
-
-jQuery.fn.extend({
- hover: function( fnOver, fnOut ) {
- return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
- },
-
- bind: function( types, data, fn ) {
- return this.on( types, null, data, fn );
- },
- unbind: function( types, fn ) {
- return this.off( types, null, fn );
- },
+ if ( jQuery.etag[ cacheURL ] ) {
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
+ }
+ }
- delegate: function( selector, types, data, fn ) {
- return this.on( types, selector, data, fn );
- },
- undelegate: function( selector, types, fn ) {
- // ( namespace ) or ( selector, types [, fn] )
- return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
- }
-});
+ // Set the correct header, if data is being sent
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
+ }
+ // Set the Accepts header for the server, depending on the dataType
+ jqXHR.setRequestHeader(
+ "Accept",
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
+ s.accepts[ "*" ]
+ );
-var nonce = jQuery.now();
+ // Check for headers option
+ for ( i in s.headers ) {
+ jqXHR.setRequestHeader( i, s.headers[ i ] );
+ }
-var rquery = (/\?/);
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
+ // Abort if not done already and return
+ return jqXHR.abort();
+ }
+ // aborting is no longer a cancellation
+ strAbort = "abort";
+ // Install callbacks on deferreds
+ for ( i in { success: 1, error: 1, complete: 1 } ) {
+ jqXHR[ i ]( s[ i ] );
+ }
-// Support: Android 2.3
-// Workaround failure to string-cast null input
-jQuery.parseJSON = function( data ) {
- return JSON.parse( data + "" );
-};
+ // Get transport
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
+ // If no transport, we auto-abort
+ if ( !transport ) {
+ done( -1, "No Transport" );
+ } else {
+ jqXHR.readyState = 1;
-// Cross-browser xml parsing
-jQuery.parseXML = function( data ) {
- var xml, tmp;
- if ( !data || typeof data !== "string" ) {
- return null;
- }
+ // Send global event
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
+ }
+ // Timeout
+ if ( s.async && s.timeout > 0 ) {
+ timeoutTimer = setTimeout(function() {
+ jqXHR.abort("timeout");
+ }, s.timeout );
+ }
- // Support: IE9
- try {
- tmp = new DOMParser();
- xml = tmp.parseFromString( data, "text/xml" );
- } catch ( e ) {
- xml = undefined;
- }
+ try {
+ state = 1;
+ transport.send( requestHeaders, done );
+ } catch ( e ) {
+ // Propagate exception as error if not done
+ if ( state < 2 ) {
+ done( -1, e );
+ // Simply rethrow otherwise
+ } else {
+ throw e;
+ }
+ }
+ }
- if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
- jQuery.error( "Invalid XML: " + data );
- }
- return xml;
-};
+ // Callback for when everything is done
+ function done( status, nativeStatusText, responses, headers ) {
+ var isSuccess, success, error, response, modified,
+ statusText = nativeStatusText;
+ // Called once
+ if ( state === 2 ) {
+ return;
+ }
-var
- // Document location
- ajaxLocParts,
- ajaxLocation,
+ // State is "done" now
+ state = 2;
- rhash = /#.*$/,
- rts = /([?&])_=[^&]*/,
- rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
- // #7653, #8125, #8152: local protocol detection
- rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
- rnoContent = /^(?:GET|HEAD)$/,
- rprotocol = /^\/\//,
- rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
+ // Clear timeout if it exists
+ if ( timeoutTimer ) {
+ clearTimeout( timeoutTimer );
+ }
- /* Prefilters
- * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
- * 2) These are called:
- * - BEFORE asking for a transport
- * - AFTER param serialization (s.data is a string if s.processData is true)
- * 3) key is the dataType
- * 4) the catchall symbol "*" can be used
- * 5) execution will start with transport dataType and THEN continue down to "*" if needed
- */
- prefilters = {},
+ // Dereference transport for early garbage collection
+ // (no matter how long the jqXHR object will be used)
+ transport = undefined;
- /* Transports bindings
- * 1) key is the dataType
- * 2) the catchall symbol "*" can be used
- * 3) selection will start with transport dataType and THEN go to "*" if needed
- */
- transports = {},
+ // Cache response headers
+ responseHeadersString = headers || "";
- // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
- allTypes = "*/".concat("*");
+ // Set readyState
+ jqXHR.readyState = status > 0 ? 4 : 0;
-// #8138, IE may throw an exception when accessing
-// a field from window.location if document.domain has been set
-try {
- ajaxLocation = location.href;
-} catch( e ) {
- // Use the href attribute of an A element
- // since IE will modify it given document.location
- ajaxLocation = document.createElement( "a" );
- ajaxLocation.href = "";
- ajaxLocation = ajaxLocation.href;
-}
+ // Determine if successful
+ isSuccess = status >= 200 && status < 300 || status === 304;
-// Segment location into parts
-ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
+ // Get response data
+ if ( responses ) {
+ response = ajaxHandleResponses( s, jqXHR, responses );
+ }
-// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
-function addToPrefiltersOrTransports( structure ) {
+ // Convert no matter what (that way responseXXX fields are always set)
+ response = ajaxConvert( s, response, jqXHR, isSuccess );
- // dataTypeExpression is optional and defaults to "*"
- return function( dataTypeExpression, func ) {
+ // If successful, handle type chaining
+ if ( isSuccess ) {
- if ( typeof dataTypeExpression !== "string" ) {
- func = dataTypeExpression;
- dataTypeExpression = "*";
- }
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ modified = jqXHR.getResponseHeader("Last-Modified");
+ if ( modified ) {
+ jQuery.lastModified[ cacheURL ] = modified;
+ }
+ modified = jqXHR.getResponseHeader("etag");
+ if ( modified ) {
+ jQuery.etag[ cacheURL ] = modified;
+ }
+ }
- var dataType,
- i = 0,
- dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
+ // if no content
+ if ( status === 204 || s.type === "HEAD" ) {
+ statusText = "nocontent";
- if ( jQuery.isFunction( func ) ) {
- // For each dataType in the dataTypeExpression
- while ( (dataType = dataTypes[i++]) ) {
- // Prepend if requested
- if ( dataType[0] === "+" ) {
- dataType = dataType.slice( 1 ) || "*";
- (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
+ // if not modified
+ } else if ( status === 304 ) {
+ statusText = "notmodified";
- // Otherwise append
+ // If we have data, let's convert it
} else {
- (structure[ dataType ] = structure[ dataType ] || []).push( func );
+ statusText = response.state;
+ success = response.data;
+ error = response.error;
+ isSuccess = !error;
+ }
+ } else {
+ // We extract error from statusText
+ // then normalize statusText and status for non-aborts
+ error = statusText;
+ if ( status || !statusText ) {
+ statusText = "error";
+ if ( status < 0 ) {
+ status = 0;
+ }
}
}
- }
- };
-}
-// Base inspection function for prefilters and transports
-function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
+ // Set data for the fake xhr object
+ jqXHR.status = status;
+ jqXHR.statusText = ( nativeStatusText || statusText ) + "";
- var inspected = {},
- seekingTransport = ( structure === transports );
+ // Success/Error
+ if ( isSuccess ) {
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
+ } else {
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
+ }
- function inspect( dataType ) {
- var selected;
- inspected[ dataType ] = true;
- jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
- var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
- if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
- options.dataTypes.unshift( dataTypeOrTransport );
- inspect( dataTypeOrTransport );
- return false;
- } else if ( seekingTransport ) {
- return !( selected = dataTypeOrTransport );
+ // Status-dependent callbacks
+ jqXHR.statusCode( statusCode );
+ statusCode = undefined;
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
+ [ jqXHR, s, isSuccess ? success : error ] );
}
- });
- return selected;
- }
- return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
-}
+ // Complete
+ completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
-// A special extend for ajax options
-// that takes "flat" options (not to be deep extended)
-// Fixes #9887
-function ajaxExtend( target, src ) {
- var key, deep,
- flatOptions = jQuery.ajaxSettings.flatOptions || {};
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
+ // Handle the global AJAX counter
+ if ( !( --jQuery.active ) ) {
+ jQuery.event.trigger("ajaxStop");
+ }
+ }
+ }
+
+ return jqXHR;
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get( url, data, callback, "json" );
+ },
+
+ getScript: function( url, callback ) {
+ return jQuery.get( url, undefined, callback, "script" );
+ }
+});
- for ( key in src ) {
- if ( src[ key ] !== undefined ) {
- ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
+jQuery.each( [ "get", "post" ], function( i, method ) {
+ jQuery[ method ] = function( url, data, callback, type ) {
+ // shift arguments if data argument was omitted
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = undefined;
}
- }
- if ( deep ) {
- jQuery.extend( true, target, deep );
- }
- return target;
-}
+ return jQuery.ajax({
+ url: url,
+ type: method,
+ dataType: type,
+ data: data,
+ success: callback
+ });
+ };
+});
/* Handles responses to an ajax request:
* - finds the right dataType (mediates between content-type and expected dataType)
* - returns the corresponding response
*/
function ajaxHandleResponses( s, jqXHR, responses ) {
-
- var ct, type, finalDataType, firstDataType,
+ var firstDataType, ct, finalDataType, type,
contents = s.contents,
dataTypes = s.dataTypes;
// Remove auto dataType and get content-type in the process
- while ( dataTypes[ 0 ] === "*" ) {
+ while( dataTypes[ 0 ] === "*" ) {
dataTypes.shift();
if ( ct === undefined ) {
ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
@@ -7737,7 +8394,7 @@ function ajaxConvert( s, response, jqXHR, isSuccess ) {
if ( current ) {
- // There's only work to do if current dataType is non-auto
+ // There's only work to do if current dataType is non-auto
if ( current === "*" ) {
current = prev;
@@ -7795,1136 +8452,1170 @@ function ajaxConvert( s, response, jqXHR, isSuccess ) {
return { state: "success", data: response };
}
+// Install script dataType
+jQuery.ajaxSetup({
+ accepts: {
+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
+ },
+ contents: {
+ script: /(?:java|ecma)script/
+ },
+ converters: {
+ "text script": function( text ) {
+ jQuery.globalEval( text );
+ return text;
+ }
+ }
+});
-jQuery.extend({
-
- // Counter for holding the number of active queries
- active: 0,
-
- // Last-Modified header cache for next request
- lastModified: {},
- etag: {},
-
- ajaxSettings: {
- url: ajaxLocation,
- type: "GET",
- isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
- global: true,
- processData: true,
- async: true,
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
- /*
- timeout: 0,
- data: null,
- dataType: null,
- username: null,
- password: null,
- cache: null,
- throws: false,
- traditional: false,
- headers: {},
- */
-
- accepts: {
- "*": allTypes,
- text: "text/plain",
- html: "text/html",
- xml: "application/xml, text/xml",
- json: "application/json, text/javascript"
- },
-
- contents: {
- xml: /xml/,
- html: /html/,
- json: /json/
- },
-
- responseFields: {
- xml: "responseXML",
- text: "responseText",
- json: "responseJSON"
- },
-
- // Data converters
- // Keys separate source (or catchall "*") and destination types with a single space
- converters: {
-
- // Convert anything to text
- "* text": String,
+// Handle cache's special case and global
+jQuery.ajaxPrefilter( "script", function( s ) {
+ if ( s.cache === undefined ) {
+ s.cache = false;
+ }
+ if ( s.crossDomain ) {
+ s.type = "GET";
+ s.global = false;
+ }
+});
- // Text to html (true = no transformation)
- "text html": true,
+// Bind script tag hack transport
+jQuery.ajaxTransport( "script", function(s) {
- // Evaluate text as a json expression
- "text json": jQuery.parseJSON,
+ // This transport only deals with cross domain requests
+ if ( s.crossDomain ) {
- // Parse text as xml
- "text xml": jQuery.parseXML
- },
+ var script,
+ head = document.head || jQuery("head")[0] || document.documentElement;
- // For options that shouldn't be deep extended:
- // you can add your own custom options here if
- // and when you create one that shouldn't be
- // deep extended (see ajaxExtend)
- flatOptions: {
- url: true,
- context: true
- }
- },
+ return {
- // Creates a full fledged settings object into target
- // with both ajaxSettings and settings fields.
- // If target is omitted, writes into ajaxSettings.
- ajaxSetup: function( target, settings ) {
- return settings ?
+ send: function( _, callback ) {
- // Building a settings object
- ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
+ script = document.createElement("script");
- // Extending ajaxSettings
- ajaxExtend( jQuery.ajaxSettings, target );
- },
+ script.async = true;
- ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
- ajaxTransport: addToPrefiltersOrTransports( transports ),
+ if ( s.scriptCharset ) {
+ script.charset = s.scriptCharset;
+ }
- // Main method
- ajax: function( url, options ) {
+ script.src = s.url;
- // If url is an object, simulate pre-1.5 signature
- if ( typeof url === "object" ) {
- options = url;
- url = undefined;
- }
+ // Attach handlers for all browsers
+ script.onload = script.onreadystatechange = function( _, isAbort ) {
- // Force options to be an object
- options = options || {};
+ if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
- var transport,
- // URL without anti-cache param
- cacheURL,
- // Response headers
- responseHeadersString,
- responseHeaders,
- // timeout handle
- timeoutTimer,
- // Cross-domain detection vars
- parts,
- // To know if global events are to be dispatched
- fireGlobals,
- // Loop variable
- i,
- // Create the final options object
- s = jQuery.ajaxSetup( {}, options ),
- // Callbacks context
- callbackContext = s.context || s,
- // Context for global events is callbackContext if it is a DOM node or jQuery collection
- globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
- jQuery( callbackContext ) :
- jQuery.event,
- // Deferreds
- deferred = jQuery.Deferred(),
- completeDeferred = jQuery.Callbacks("once memory"),
- // Status-dependent callbacks
- statusCode = s.statusCode || {},
- // Headers (they are sent all at once)
- requestHeaders = {},
- requestHeadersNames = {},
- // The jqXHR state
- state = 0,
- // Default abort message
- strAbort = "canceled",
- // Fake xhr
- jqXHR = {
- readyState: 0,
+ // Handle memory leak in IE
+ script.onload = script.onreadystatechange = null;
- // Builds headers hashtable if needed
- getResponseHeader: function( key ) {
- var match;
- if ( state === 2 ) {
- if ( !responseHeaders ) {
- responseHeaders = {};
- while ( (match = rheaders.exec( responseHeadersString )) ) {
- responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
- }
+ // Remove the script
+ if ( script.parentNode ) {
+ script.parentNode.removeChild( script );
}
- match = responseHeaders[ key.toLowerCase() ];
- }
- return match == null ? null : match;
- },
-
- // Raw string
- getAllResponseHeaders: function() {
- return state === 2 ? responseHeadersString : null;
- },
-
- // Caches the header
- setRequestHeader: function( name, value ) {
- var lname = name.toLowerCase();
- if ( !state ) {
- name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
- requestHeaders[ name ] = value;
- }
- return this;
- },
- // Overrides response content-type header
- overrideMimeType: function( type ) {
- if ( !state ) {
- s.mimeType = type;
- }
- return this;
- },
+ // Dereference the script
+ script = null;
- // Status-dependent callbacks
- statusCode: function( map ) {
- var code;
- if ( map ) {
- if ( state < 2 ) {
- for ( code in map ) {
- // Lazy-add the new callback in a way that preserves old ones
- statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
- }
- } else {
- // Execute the appropriate callbacks
- jqXHR.always( map[ jqXHR.status ] );
+ // Callback if not abort
+ if ( !isAbort ) {
+ callback( 200, "success" );
}
}
- return this;
- },
-
- // Cancel the request
- abort: function( statusText ) {
- var finalText = statusText || strAbort;
- if ( transport ) {
- transport.abort( finalText );
- }
- done( 0, finalText );
- return this;
- }
- };
-
- // Attach deferreds
- deferred.promise( jqXHR ).complete = completeDeferred.add;
- jqXHR.success = jqXHR.done;
- jqXHR.error = jqXHR.fail;
-
- // Remove hash character (#7531: and string promotion)
- // Add protocol if not provided (prefilters might expect it)
- // Handle falsy url in the settings object (#10093: consistency with old signature)
- // We also use the url parameter if available
- s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" )
- .replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
+ };
- // Alias method option to type as per ticket #12004
- s.type = options.method || options.type || s.method || s.type;
+ // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
+ // Use native DOM manipulation to avoid our domManip AJAX trickery
+ head.insertBefore( script, head.firstChild );
+ },
- // Extract dataTypes list
- s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
+ abort: function() {
+ if ( script ) {
+ script.onload( undefined, true );
+ }
+ }
+ };
+ }
+});
+var oldCallbacks = [],
+ rjsonp = /(=)\?(?=&|$)|\?\?/;
- // A cross-domain request is in order when we have a protocol:host:port mismatch
- if ( s.crossDomain == null ) {
- parts = rurl.exec( s.url.toLowerCase() );
- s.crossDomain = !!( parts &&
- ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
- ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
- ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
- );
- }
+// Default jsonp settings
+jQuery.ajaxSetup({
+ jsonp: "callback",
+ jsonpCallback: function() {
+ var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) );
+ this[ callback ] = true;
+ return callback;
+ }
+});
- // Convert data if not already a string
- if ( s.data && s.processData && typeof s.data !== "string" ) {
- s.data = jQuery.param( s.data, s.traditional );
- }
+// Detect, normalize options and install callbacks for jsonp requests
+jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
- // Apply prefilters
- inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
+ var callbackName, overwritten, responseContainer,
+ jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
+ "url" :
+ typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
+ );
- // If request was aborted inside a prefilter, stop there
- if ( state === 2 ) {
- return jqXHR;
- }
+ // Handle iff the expected data type is "jsonp" or we have a parameter to set
+ if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
- // We can fire global events as of now if asked to
- fireGlobals = s.global;
+ // Get callback name, remembering preexisting value associated with it
+ callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
+ s.jsonpCallback() :
+ s.jsonpCallback;
- // Watch for a new set of requests
- if ( fireGlobals && jQuery.active++ === 0 ) {
- jQuery.event.trigger("ajaxStart");
+ // Insert callback into url or form data
+ if ( jsonProp ) {
+ s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
+ } else if ( s.jsonp !== false ) {
+ s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
}
- // Uppercase the type
- s.type = s.type.toUpperCase();
+ // Use data converter to retrieve json after script execution
+ s.converters["script json"] = function() {
+ if ( !responseContainer ) {
+ jQuery.error( callbackName + " was not called" );
+ }
+ return responseContainer[ 0 ];
+ };
- // Determine if request has content
- s.hasContent = !rnoContent.test( s.type );
+ // force json dataType
+ s.dataTypes[ 0 ] = "json";
- // Save the URL in case we're toying with the If-Modified-Since
- // and/or If-None-Match header later on
- cacheURL = s.url;
+ // Install callback
+ overwritten = window[ callbackName ];
+ window[ callbackName ] = function() {
+ responseContainer = arguments;
+ };
- // More options handling for requests with no content
- if ( !s.hasContent ) {
+ // Clean-up function (fires after converters)
+ jqXHR.always(function() {
+ // Restore preexisting value
+ window[ callbackName ] = overwritten;
- // If data is available, append data to url
- if ( s.data ) {
- cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
- // #9682: remove data so that it's not used in an eventual retry
- delete s.data;
+ // Save back as free
+ if ( s[ callbackName ] ) {
+ // make sure that re-using the options doesn't screw things around
+ s.jsonpCallback = originalSettings.jsonpCallback;
+
+ // save the callback name for future use
+ oldCallbacks.push( callbackName );
}
- // Add anti-cache in url if needed
- if ( s.cache === false ) {
- s.url = rts.test( cacheURL ) ?
+ // Call if it was a function and we have a response
+ if ( responseContainer && jQuery.isFunction( overwritten ) ) {
+ overwritten( responseContainer[ 0 ] );
+ }
- // If there is already a '_' parameter, set its value
- cacheURL.replace( rts, "$1_=" + nonce++ ) :
+ responseContainer = overwritten = undefined;
+ });
- // Otherwise add one to the end
- cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
- }
+ // Delegate to script
+ return "script";
+ }
+});
+var xhrCallbacks, xhrSupported,
+ xhrId = 0,
+ // #5280: Internet Explorer will keep connections alive if we don't abort on unload
+ xhrOnUnloadAbort = window.ActiveXObject && function() {
+ // Abort all pending requests
+ var key;
+ for ( key in xhrCallbacks ) {
+ xhrCallbacks[ key ]( undefined, true );
}
+ };
- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
- if ( s.ifModified ) {
- if ( jQuery.lastModified[ cacheURL ] ) {
- jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
- }
- if ( jQuery.etag[ cacheURL ] ) {
- jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
- }
- }
+// Functions to create xhrs
+function createStandardXHR() {
+ try {
+ return new window.XMLHttpRequest();
+ } catch( e ) {}
+}
- // Set the correct header, if data is being sent
- if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
- jqXHR.setRequestHeader( "Content-Type", s.contentType );
- }
+function createActiveXHR() {
+ try {
+ return new window.ActiveXObject("Microsoft.XMLHTTP");
+ } catch( e ) {}
+}
- // Set the Accepts header for the server, depending on the dataType
- jqXHR.setRequestHeader(
- "Accept",
- s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
- s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
- s.accepts[ "*" ]
- );
+// Create the request object
+// (This is still attached to ajaxSettings for backward compatibility)
+jQuery.ajaxSettings.xhr = window.ActiveXObject ?
+ /* Microsoft failed to properly
+ * implement the XMLHttpRequest in IE7 (can't request local files),
+ * so we use the ActiveXObject when it is available
+ * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
+ * we need a fallback.
+ */
+ function() {
+ return !this.isLocal && createStandardXHR() || createActiveXHR();
+ } :
+ // For all other browsers, use the standard XMLHttpRequest object
+ createStandardXHR;
- // Check for headers option
- for ( i in s.headers ) {
- jqXHR.setRequestHeader( i, s.headers[ i ] );
- }
+// Determine support properties
+xhrSupported = jQuery.ajaxSettings.xhr();
+jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
+xhrSupported = jQuery.support.ajax = !!xhrSupported;
- // Allow custom headers/mimetypes and early abort
- if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
- // Abort if not done already and return
- return jqXHR.abort();
- }
+// Create transport if the browser can provide an xhr
+if ( xhrSupported ) {
- // aborting is no longer a cancellation
- strAbort = "abort";
+ jQuery.ajaxTransport(function( s ) {
+ // Cross domain only allowed if supported through XMLHttpRequest
+ if ( !s.crossDomain || jQuery.support.cors ) {
- // Install callbacks on deferreds
- for ( i in { success: 1, error: 1, complete: 1 } ) {
- jqXHR[ i ]( s[ i ] );
- }
+ var callback;
- // Get transport
- transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
+ return {
+ send: function( headers, complete ) {
- // If no transport, we auto-abort
- if ( !transport ) {
- done( -1, "No Transport" );
- } else {
- jqXHR.readyState = 1;
+ // Get a new xhr
+ var handle, i,
+ xhr = s.xhr();
- // Send global event
- if ( fireGlobals ) {
- globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
- }
- // Timeout
- if ( s.async && s.timeout > 0 ) {
- timeoutTimer = setTimeout(function() {
- jqXHR.abort("timeout");
- }, s.timeout );
- }
+ // Open the socket
+ // Passing null username, generates a login popup on Opera (#2865)
+ if ( s.username ) {
+ xhr.open( s.type, s.url, s.async, s.username, s.password );
+ } else {
+ xhr.open( s.type, s.url, s.async );
+ }
- try {
- state = 1;
- transport.send( requestHeaders, done );
- } catch ( e ) {
- // Propagate exception as error if not done
- if ( state < 2 ) {
- done( -1, e );
- // Simply rethrow otherwise
- } else {
- throw e;
- }
- }
- }
+ // Apply custom fields if provided
+ if ( s.xhrFields ) {
+ for ( i in s.xhrFields ) {
+ xhr[ i ] = s.xhrFields[ i ];
+ }
+ }
- // Callback for when everything is done
- function done( status, nativeStatusText, responses, headers ) {
- var isSuccess, success, error, response, modified,
- statusText = nativeStatusText;
+ // Override mime type if needed
+ if ( s.mimeType && xhr.overrideMimeType ) {
+ xhr.overrideMimeType( s.mimeType );
+ }
- // Called once
- if ( state === 2 ) {
- return;
- }
+ // X-Requested-With header
+ // For cross-domain requests, seeing as conditions for a preflight are
+ // akin to a jigsaw puzzle, we simply never set it to be sure.
+ // (it can always be set on a per-request basis or even using ajaxSetup)
+ // For same-domain requests, won't change header if already provided.
+ if ( !s.crossDomain && !headers["X-Requested-With"] ) {
+ headers["X-Requested-With"] = "XMLHttpRequest";
+ }
- // State is "done" now
- state = 2;
+ // Need an extra try/catch for cross domain requests in Firefox 3
+ try {
+ for ( i in headers ) {
+ xhr.setRequestHeader( i, headers[ i ] );
+ }
+ } catch( err ) {}
- // Clear timeout if it exists
- if ( timeoutTimer ) {
- clearTimeout( timeoutTimer );
- }
+ // Do send the request
+ // This may raise an exception which is actually
+ // handled in jQuery.ajax (so no try/catch here)
+ xhr.send( ( s.hasContent && s.data ) || null );
- // Dereference transport for early garbage collection
- // (no matter how long the jqXHR object will be used)
- transport = undefined;
+ // Listener
+ callback = function( _, isAbort ) {
+ var status, responseHeaders, statusText, responses;
- // Cache response headers
- responseHeadersString = headers || "";
+ // Firefox throws exceptions when accessing properties
+ // of an xhr when a network error occurred
+ // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
+ try {
- // Set readyState
- jqXHR.readyState = status > 0 ? 4 : 0;
+ // Was never called and is aborted or complete
+ if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
- // Determine if successful
- isSuccess = status >= 200 && status < 300 || status === 304;
+ // Only called once
+ callback = undefined;
- // Get response data
- if ( responses ) {
- response = ajaxHandleResponses( s, jqXHR, responses );
- }
+ // Do not keep as active anymore
+ if ( handle ) {
+ xhr.onreadystatechange = jQuery.noop;
+ if ( xhrOnUnloadAbort ) {
+ delete xhrCallbacks[ handle ];
+ }
+ }
- // Convert no matter what (that way responseXXX fields are always set)
- response = ajaxConvert( s, response, jqXHR, isSuccess );
+ // If it's an abort
+ if ( isAbort ) {
+ // Abort it manually if needed
+ if ( xhr.readyState !== 4 ) {
+ xhr.abort();
+ }
+ } else {
+ responses = {};
+ status = xhr.status;
+ responseHeaders = xhr.getAllResponseHeaders();
+
+ // When requesting binary data, IE6-9 will throw an exception
+ // on any attempt to access responseText (#11426)
+ if ( typeof xhr.responseText === "string" ) {
+ responses.text = xhr.responseText;
+ }
- // If successful, handle type chaining
- if ( isSuccess ) {
+ // Firefox throws an exception when accessing
+ // statusText for faulty cross-domain requests
+ try {
+ statusText = xhr.statusText;
+ } catch( e ) {
+ // We normalize with Webkit giving an empty statusText
+ statusText = "";
+ }
- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
- if ( s.ifModified ) {
- modified = jqXHR.getResponseHeader("Last-Modified");
- if ( modified ) {
- jQuery.lastModified[ cacheURL ] = modified;
+ // Filter status for non standard behaviors
+
+ // If the request is local and we have data: assume a success
+ // (success with no data won't get notified, that's the best we
+ // can do given current implementations)
+ if ( !status && s.isLocal && !s.crossDomain ) {
+ status = responses.text ? 200 : 404;
+ // IE - #1450: sometimes returns 1223 when it should be 204
+ } else if ( status === 1223 ) {
+ status = 204;
+ }
+ }
+ }
+ } catch( firefoxAccessException ) {
+ if ( !isAbort ) {
+ complete( -1, firefoxAccessException );
+ }
+ }
+
+ // Call complete if needed
+ if ( responses ) {
+ complete( status, statusText, responses, responseHeaders );
+ }
+ };
+
+ if ( !s.async ) {
+ // if we're in sync mode we fire the callback
+ callback();
+ } else if ( xhr.readyState === 4 ) {
+ // (IE6 & IE7) if it's in cache and has been
+ // retrieved directly we need to fire the callback
+ setTimeout( callback );
+ } else {
+ handle = ++xhrId;
+ if ( xhrOnUnloadAbort ) {
+ // Create the active xhrs callbacks list if needed
+ // and attach the unload handler
+ if ( !xhrCallbacks ) {
+ xhrCallbacks = {};
+ jQuery( window ).unload( xhrOnUnloadAbort );
+ }
+ // Add to list of active xhrs callbacks
+ xhrCallbacks[ handle ] = callback;
+ }
+ xhr.onreadystatechange = callback;
}
- modified = jqXHR.getResponseHeader("etag");
- if ( modified ) {
- jQuery.etag[ cacheURL ] = modified;
+ },
+
+ abort: function() {
+ if ( callback ) {
+ callback( undefined, true );
}
}
+ };
+ }
+ });
+}
+var fxNow, timerId,
+ rfxtypes = /^(?:toggle|show|hide)$/,
+ rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
+ rrun = /queueHooks$/,
+ animationPrefilters = [ defaultPrefilter ],
+ tweeners = {
+ "*": [function( prop, value ) {
+ var tween = this.createTween( prop, value ),
+ target = tween.cur(),
+ parts = rfxnum.exec( value ),
+ unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
- // if no content
- if ( status === 204 || s.type === "HEAD" ) {
- statusText = "nocontent";
+ // Starting value computation is required for potential unit mismatches
+ start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
+ rfxnum.exec( jQuery.css( tween.elem, prop ) ),
+ scale = 1,
+ maxIterations = 20;
- // if not modified
- } else if ( status === 304 ) {
- statusText = "notmodified";
+ if ( start && start[ 3 ] !== unit ) {
+ // Trust units reported by jQuery.css
+ unit = unit || start[ 3 ];
- // If we have data, let's convert it
- } else {
- statusText = response.state;
- success = response.data;
- error = response.error;
- isSuccess = !error;
- }
- } else {
- // We extract error from statusText
- // then normalize statusText and status for non-aborts
- error = statusText;
- if ( status || !statusText ) {
- statusText = "error";
- if ( status < 0 ) {
- status = 0;
- }
- }
- }
+ // Make sure we update the tween properties later on
+ parts = parts || [];
- // Set data for the fake xhr object
- jqXHR.status = status;
- jqXHR.statusText = ( nativeStatusText || statusText ) + "";
+ // Iteratively approximate from a nonzero starting point
+ start = +target || 1;
- // Success/Error
- if ( isSuccess ) {
- deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
- } else {
- deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
- }
+ do {
+ // If previous iteration zeroed out, double until we get *something*
+ // Use a string for doubling factor so we don't accidentally see scale as unchanged below
+ scale = scale || ".5";
- // Status-dependent callbacks
- jqXHR.statusCode( statusCode );
- statusCode = undefined;
+ // Adjust and apply
+ start = start / scale;
+ jQuery.style( tween.elem, prop, start + unit );
- if ( fireGlobals ) {
- globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
- [ jqXHR, s, isSuccess ? success : error ] );
+ // Update scale, tolerating zero or NaN from tween.cur()
+ // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
+ } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
}
- // Complete
- completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
-
- if ( fireGlobals ) {
- globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
- // Handle the global AJAX counter
- if ( !( --jQuery.active ) ) {
- jQuery.event.trigger("ajaxStop");
- }
+ // Update tween properties
+ if ( parts ) {
+ start = tween.start = +start || +target || 0;
+ tween.unit = unit;
+ // If a +=/-= token was provided, we're doing a relative animation
+ tween.end = parts[ 1 ] ?
+ start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
+ +parts[ 2 ];
}
- }
- return jqXHR;
- },
+ return tween;
+ }]
+ };
- getJSON: function( url, data, callback ) {
- return jQuery.get( url, data, callback, "json" );
- },
+// Animations created synchronously will run synchronously
+function createFxNow() {
+ setTimeout(function() {
+ fxNow = undefined;
+ });
+ return ( fxNow = jQuery.now() );
+}
- getScript: function( url, callback ) {
- return jQuery.get( url, undefined, callback, "script" );
- }
-});
+function createTween( value, prop, animation ) {
+ var tween,
+ collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
+ index = 0,
+ length = collection.length;
+ for ( ; index < length; index++ ) {
+ if ( (tween = collection[ index ].call( animation, prop, value )) ) {
-jQuery.each( [ "get", "post" ], function( i, method ) {
- jQuery[ method ] = function( url, data, callback, type ) {
- // shift arguments if data argument was omitted
- if ( jQuery.isFunction( data ) ) {
- type = type || callback;
- callback = data;
- data = undefined;
+ // we're done with this property
+ return tween;
}
+ }
+}
- return jQuery.ajax({
- url: url,
- type: method,
- dataType: type,
- data: data,
- success: callback
- });
- };
-});
+function Animation( elem, properties, options ) {
+ var result,
+ stopped,
+ index = 0,
+ length = animationPrefilters.length,
+ deferred = jQuery.Deferred().always( function() {
+ // don't match elem in the :animated selector
+ delete tick.elem;
+ }),
+ tick = function() {
+ if ( stopped ) {
+ return false;
+ }
+ var currentTime = fxNow || createFxNow(),
+ remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
+ // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
+ temp = remaining / animation.duration || 0,
+ percent = 1 - temp,
+ index = 0,
+ length = animation.tweens.length;
-// Attach a bunch of functions for handling common AJAX events
-jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
- jQuery.fn[ type ] = function( fn ) {
- return this.on( type, fn );
- };
-});
+ for ( ; index < length ; index++ ) {
+ animation.tweens[ index ].run( percent );
+ }
+ deferred.notifyWith( elem, [ animation, percent, remaining ]);
-jQuery._evalUrl = function( url ) {
- return jQuery.ajax({
- url: url,
- type: "GET",
- dataType: "script",
- async: false,
- global: false,
- "throws": true
- });
-};
+ if ( percent < 1 && length ) {
+ return remaining;
+ } else {
+ deferred.resolveWith( elem, [ animation ] );
+ return false;
+ }
+ },
+ animation = deferred.promise({
+ elem: elem,
+ props: jQuery.extend( {}, properties ),
+ opts: jQuery.extend( true, { specialEasing: {} }, options ),
+ originalProperties: properties,
+ originalOptions: options,
+ startTime: fxNow || createFxNow(),
+ duration: options.duration,
+ tweens: [],
+ createTween: function( prop, end ) {
+ var tween = jQuery.Tween( elem, animation.opts, prop, end,
+ animation.opts.specialEasing[ prop ] || animation.opts.easing );
+ animation.tweens.push( tween );
+ return tween;
+ },
+ stop: function( gotoEnd ) {
+ var index = 0,
+ // if we are going to the end, we want to run all the tweens
+ // otherwise we skip this part
+ length = gotoEnd ? animation.tweens.length : 0;
+ if ( stopped ) {
+ return this;
+ }
+ stopped = true;
+ for ( ; index < length ; index++ ) {
+ animation.tweens[ index ].run( 1 );
+ }
+ // resolve when we played the last frame
+ // otherwise, reject
+ if ( gotoEnd ) {
+ deferred.resolveWith( elem, [ animation, gotoEnd ] );
+ } else {
+ deferred.rejectWith( elem, [ animation, gotoEnd ] );
+ }
+ return this;
+ }
+ }),
+ props = animation.props;
-jQuery.fn.extend({
- wrapAll: function( html ) {
- var wrap;
+ propFilter( props, animation.opts.specialEasing );
- if ( jQuery.isFunction( html ) ) {
- return this.each(function( i ) {
- jQuery( this ).wrapAll( html.call(this, i) );
- });
+ for ( ; index < length ; index++ ) {
+ result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
+ if ( result ) {
+ return result;
}
+ }
- if ( this[ 0 ] ) {
+ jQuery.map( props, createTween, animation );
- // The elements to wrap the target around
- wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
+ if ( jQuery.isFunction( animation.opts.start ) ) {
+ animation.opts.start.call( elem, animation );
+ }
- if ( this[ 0 ].parentNode ) {
- wrap.insertBefore( this[ 0 ] );
- }
+ jQuery.fx.timer(
+ jQuery.extend( tick, {
+ elem: elem,
+ anim: animation,
+ queue: animation.opts.queue
+ })
+ );
- wrap.map(function() {
- var elem = this;
+ // attach callbacks from options
+ return animation.progress( animation.opts.progress )
+ .done( animation.opts.done, animation.opts.complete )
+ .fail( animation.opts.fail )
+ .always( animation.opts.always );
+}
- while ( elem.firstElementChild ) {
- elem = elem.firstElementChild;
- }
+function propFilter( props, specialEasing ) {
+ var index, name, easing, value, hooks;
+
+ // camelCase, specialEasing and expand cssHook pass
+ for ( index in props ) {
+ name = jQuery.camelCase( index );
+ easing = specialEasing[ name ];
+ value = props[ index ];
+ if ( jQuery.isArray( value ) ) {
+ easing = value[ 1 ];
+ value = props[ index ] = value[ 0 ];
+ }
- return elem;
- }).append( this );
+ if ( index !== name ) {
+ props[ name ] = value;
+ delete props[ index ];
}
- return this;
- },
+ hooks = jQuery.cssHooks[ name ];
+ if ( hooks && "expand" in hooks ) {
+ value = hooks.expand( value );
+ delete props[ name ];
- wrapInner: function( html ) {
- if ( jQuery.isFunction( html ) ) {
- return this.each(function( i ) {
- jQuery( this ).wrapInner( html.call(this, i) );
- });
+ // not quite $.extend, this wont overwrite keys already present.
+ // also - reusing 'index' from above because we have the correct "name"
+ for ( index in value ) {
+ if ( !( index in props ) ) {
+ props[ index ] = value[ index ];
+ specialEasing[ index ] = easing;
+ }
+ }
+ } else {
+ specialEasing[ name ] = easing;
}
+ }
+}
- return this.each(function() {
- var self = jQuery( this ),
- contents = self.contents();
-
- if ( contents.length ) {
- contents.wrapAll( html );
+jQuery.Animation = jQuery.extend( Animation, {
- } else {
- self.append( html );
- }
- });
- },
+ tweener: function( props, callback ) {
+ if ( jQuery.isFunction( props ) ) {
+ callback = props;
+ props = [ "*" ];
+ } else {
+ props = props.split(" ");
+ }
- wrap: function( html ) {
- var isFunction = jQuery.isFunction( html );
+ var prop,
+ index = 0,
+ length = props.length;
- return this.each(function( i ) {
- jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
- });
+ for ( ; index < length ; index++ ) {
+ prop = props[ index ];
+ tweeners[ prop ] = tweeners[ prop ] || [];
+ tweeners[ prop ].unshift( callback );
+ }
},
- unwrap: function() {
- return this.parent().each(function() {
- if ( !jQuery.nodeName( this, "body" ) ) {
- jQuery( this ).replaceWith( this.childNodes );
- }
- }).end();
+ prefilter: function( callback, prepend ) {
+ if ( prepend ) {
+ animationPrefilters.unshift( callback );
+ } else {
+ animationPrefilters.push( callback );
+ }
}
});
+function defaultPrefilter( elem, props, opts ) {
+ /* jshint validthis: true */
+ var prop, value, toggle, tween, hooks, oldfire,
+ anim = this,
+ orig = {},
+ style = elem.style,
+ hidden = elem.nodeType && isHidden( elem ),
+ dataShow = jQuery._data( elem, "fxshow" );
-jQuery.expr.filters.hidden = function( elem ) {
- // Support: Opera <= 12.12
- // Opera reports offsetWidths and offsetHeights less than zero on some elements
- return elem.offsetWidth <= 0 && elem.offsetHeight <= 0;
-};
-jQuery.expr.filters.visible = function( elem ) {
- return !jQuery.expr.filters.hidden( elem );
-};
-
-
+ // handle queue: false promises
+ if ( !opts.queue ) {
+ hooks = jQuery._queueHooks( elem, "fx" );
+ if ( hooks.unqueued == null ) {
+ hooks.unqueued = 0;
+ oldfire = hooks.empty.fire;
+ hooks.empty.fire = function() {
+ if ( !hooks.unqueued ) {
+ oldfire();
+ }
+ };
+ }
+ hooks.unqueued++;
+ anim.always(function() {
+ // doing this makes sure that the complete handler will be called
+ // before this completes
+ anim.always(function() {
+ hooks.unqueued--;
+ if ( !jQuery.queue( elem, "fx" ).length ) {
+ hooks.empty.fire();
+ }
+ });
+ });
+ }
-var r20 = /%20/g,
- rbracket = /\[\]$/,
- rCRLF = /\r?\n/g,
- rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
- rsubmittable = /^(?:input|select|textarea|keygen)/i;
+ // height/width overflow pass
+ if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
+ // Make sure that nothing sneaks out
+ // Record all 3 overflow attributes because IE does not
+ // change the overflow attribute when overflowX and
+ // overflowY are set to the same value
+ opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
-function buildParams( prefix, obj, traditional, add ) {
- var name;
+ // Set display property to inline-block for height/width
+ // animations on inline elements that are having width/height animated
+ if ( jQuery.css( elem, "display" ) === "inline" &&
+ jQuery.css( elem, "float" ) === "none" ) {
- if ( jQuery.isArray( obj ) ) {
- // Serialize array item.
- jQuery.each( obj, function( i, v ) {
- if ( traditional || rbracket.test( prefix ) ) {
- // Treat each array item as a scalar.
- add( prefix, v );
+ // inline-level elements accept inline-block;
+ // block-level elements need to be inline with layout
+ if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {
+ style.display = "inline-block";
} else {
- // Item is non-scalar (array or object), encode its numeric index.
- buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
+ style.zoom = 1;
}
- });
-
- } else if ( !traditional && jQuery.type( obj ) === "object" ) {
- // Serialize object item.
- for ( name in obj ) {
- buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
}
-
- } else {
- // Serialize scalar item.
- add( prefix, obj );
}
-}
-
-// Serialize an array of form elements or a set of
-// key/values into a query string
-jQuery.param = function( a, traditional ) {
- var prefix,
- s = [],
- add = function( key, value ) {
- // If value is a function, invoke it and return its value
- value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
- s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
- };
- // Set traditional to true for jQuery <= 1.3.2 behavior.
- if ( traditional === undefined ) {
- traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
+ if ( opts.overflow ) {
+ style.overflow = "hidden";
+ if ( !jQuery.support.shrinkWrapBlocks ) {
+ anim.always(function() {
+ style.overflow = opts.overflow[ 0 ];
+ style.overflowX = opts.overflow[ 1 ];
+ style.overflowY = opts.overflow[ 2 ];
+ });
+ }
}
- // If an array was passed in, assume that it is an array of form elements.
- if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
- // Serialize the form elements
- jQuery.each( a, function() {
- add( this.name, this.value );
- });
- } else {
- // If traditional, encode the "old" way (the way 1.3.2 or older
- // did it), otherwise encode params recursively.
- for ( prefix in a ) {
- buildParams( prefix, a[ prefix ], traditional, add );
+ // show/hide pass
+ for ( prop in props ) {
+ value = props[ prop ];
+ if ( rfxtypes.exec( value ) ) {
+ delete props[ prop ];
+ toggle = toggle || value === "toggle";
+ if ( value === ( hidden ? "hide" : "show" ) ) {
+ continue;
+ }
+ orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
}
}
- // Return the resulting serialization
- return s.join( "&" ).replace( r20, "+" );
-};
-
-jQuery.fn.extend({
- serialize: function() {
- return jQuery.param( this.serializeArray() );
- },
- serializeArray: function() {
- return this.map(function() {
- // Can add propHook for "elements" to filter or add form elements
- var elements = jQuery.prop( this, "elements" );
- return elements ? jQuery.makeArray( elements ) : this;
- })
- .filter(function() {
- var type = this.type;
+ if ( !jQuery.isEmptyObject( orig ) ) {
+ if ( dataShow ) {
+ if ( "hidden" in dataShow ) {
+ hidden = dataShow.hidden;
+ }
+ } else {
+ dataShow = jQuery._data( elem, "fxshow", {} );
+ }
- // Use .is( ":disabled" ) so that fieldset[disabled] works
- return this.name && !jQuery( this ).is( ":disabled" ) &&
- rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
- ( this.checked || !rcheckableType.test( type ) );
- })
- .map(function( i, elem ) {
- var val = jQuery( this ).val();
+ // store state if its toggle - enables .stop().toggle() to "reverse"
+ if ( toggle ) {
+ dataShow.hidden = !hidden;
+ }
+ if ( hidden ) {
+ jQuery( elem ).show();
+ } else {
+ anim.done(function() {
+ jQuery( elem ).hide();
+ });
+ }
+ anim.done(function() {
+ var prop;
+ jQuery._removeData( elem, "fxshow" );
+ for ( prop in orig ) {
+ jQuery.style( elem, prop, orig[ prop ] );
+ }
+ });
+ for ( prop in orig ) {
+ tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
- return val == null ?
- null :
- jQuery.isArray( val ) ?
- jQuery.map( val, function( val ) {
- return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
- }) :
- { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
- }).get();
+ if ( !( prop in dataShow ) ) {
+ dataShow[ prop ] = tween.start;
+ if ( hidden ) {
+ tween.end = tween.start;
+ tween.start = prop === "width" || prop === "height" ? 1 : 0;
+ }
+ }
+ }
}
-});
+}
+function Tween( elem, options, prop, end, easing ) {
+ return new Tween.prototype.init( elem, options, prop, end, easing );
+}
+jQuery.Tween = Tween;
-jQuery.ajaxSettings.xhr = function() {
- try {
- return new XMLHttpRequest();
- } catch( e ) {}
-};
+Tween.prototype = {
+ constructor: Tween,
+ init: function( elem, options, prop, end, easing, unit ) {
+ this.elem = elem;
+ this.prop = prop;
+ this.easing = easing || "swing";
+ this.options = options;
+ this.start = this.now = this.cur();
+ this.end = end;
+ this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
+ },
+ cur: function() {
+ var hooks = Tween.propHooks[ this.prop ];
-var xhrId = 0,
- xhrCallbacks = {},
- xhrSuccessStatus = {
- // file protocol always yields status code 0, assume 200
- 0: 200,
- // Support: IE9
- // #1450: sometimes IE returns 1223 when it should be 204
- 1223: 204
+ return hooks && hooks.get ?
+ hooks.get( this ) :
+ Tween.propHooks._default.get( this );
},
- xhrSupported = jQuery.ajaxSettings.xhr();
+ run: function( percent ) {
+ var eased,
+ hooks = Tween.propHooks[ this.prop ];
-// Support: IE9
-// Open requests must be manually aborted on unload (#5280)
-if ( window.ActiveXObject ) {
- jQuery( window ).on( "unload", function() {
- for ( var key in xhrCallbacks ) {
- xhrCallbacks[ key ]();
+ if ( this.options.duration ) {
+ this.pos = eased = jQuery.easing[ this.easing ](
+ percent, this.options.duration * percent, 0, 1, this.options.duration
+ );
+ } else {
+ this.pos = eased = percent;
}
- });
-}
+ this.now = ( this.end - this.start ) * eased + this.start;
-support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
-support.ajax = xhrSupported = !!xhrSupported;
+ if ( this.options.step ) {
+ this.options.step.call( this.elem, this.now, this );
+ }
-jQuery.ajaxTransport(function( options ) {
- var callback;
+ if ( hooks && hooks.set ) {
+ hooks.set( this );
+ } else {
+ Tween.propHooks._default.set( this );
+ }
+ return this;
+ }
+};
- // Cross domain only allowed if supported through XMLHttpRequest
- if ( support.cors || xhrSupported && !options.crossDomain ) {
- return {
- send: function( headers, complete ) {
- var i,
- xhr = options.xhr(),
- id = ++xhrId;
+Tween.prototype.init.prototype = Tween.prototype;
- xhr.open( options.type, options.url, options.async, options.username, options.password );
+Tween.propHooks = {
+ _default: {
+ get: function( tween ) {
+ var result;
- // Apply custom fields if provided
- if ( options.xhrFields ) {
- for ( i in options.xhrFields ) {
- xhr[ i ] = options.xhrFields[ i ];
- }
- }
+ if ( tween.elem[ tween.prop ] != null &&
+ (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
+ return tween.elem[ tween.prop ];
+ }
- // Override mime type if needed
- if ( options.mimeType && xhr.overrideMimeType ) {
- xhr.overrideMimeType( options.mimeType );
- }
+ // passing an empty string as a 3rd parameter to .css will automatically
+ // attempt a parseFloat and fallback to a string if the parse fails
+ // so, simple values such as "10px" are parsed to Float.
+ // complex values such as "rotate(1rad)" are returned as is.
+ result = jQuery.css( tween.elem, tween.prop, "" );
+ // Empty strings, null, undefined and "auto" are converted to 0.
+ return !result || result === "auto" ? 0 : result;
+ },
+ set: function( tween ) {
+ // use step hook for back compat - use cssHook if its there - use .style if its
+ // available and use plain properties where available
+ if ( jQuery.fx.step[ tween.prop ] ) {
+ jQuery.fx.step[ tween.prop ]( tween );
+ } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
+ jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
+ } else {
+ tween.elem[ tween.prop ] = tween.now;
+ }
+ }
+ }
+};
- // X-Requested-With header
- // For cross-domain requests, seeing as conditions for a preflight are
- // akin to a jigsaw puzzle, we simply never set it to be sure.
- // (it can always be set on a per-request basis or even using ajaxSetup)
- // For same-domain requests, won't change header if already provided.
- if ( !options.crossDomain && !headers["X-Requested-With"] ) {
- headers["X-Requested-With"] = "XMLHttpRequest";
- }
+// Support: IE <=9
+// Panic based approach to setting things on disconnected nodes
- // Set headers
- for ( i in headers ) {
- xhr.setRequestHeader( i, headers[ i ] );
- }
+Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
+ set: function( tween ) {
+ if ( tween.elem.nodeType && tween.elem.parentNode ) {
+ tween.elem[ tween.prop ] = tween.now;
+ }
+ }
+};
- // Callback
- callback = function( type ) {
- return function() {
- if ( callback ) {
- delete xhrCallbacks[ id ];
- callback = xhr.onload = xhr.onerror = null;
+jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
+ var cssFn = jQuery.fn[ name ];
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return speed == null || typeof speed === "boolean" ?
+ cssFn.apply( this, arguments ) :
+ this.animate( genFx( name, true ), speed, easing, callback );
+ };
+});
- if ( type === "abort" ) {
- xhr.abort();
- } else if ( type === "error" ) {
- complete(
- // file: protocol always yields status 0; see #8605, #14207
- xhr.status,
- xhr.statusText
- );
- } else {
- complete(
- xhrSuccessStatus[ xhr.status ] || xhr.status,
- xhr.statusText,
- // Support: IE9
- // Accessing binary-data responseText throws an exception
- // (#11426)
- typeof xhr.responseText === "string" ? {
- text: xhr.responseText
- } : undefined,
- xhr.getAllResponseHeaders()
- );
- }
- }
- };
- };
+jQuery.fn.extend({
+ fadeTo: function( speed, to, easing, callback ) {
- // Listen to events
- xhr.onload = callback();
- xhr.onerror = callback("error");
+ // show any hidden elements after setting opacity to 0
+ return this.filter( isHidden ).css( "opacity", 0 ).show()
- // Create the abort callback
- callback = xhrCallbacks[ id ] = callback("abort");
+ // animate to the value specified
+ .end().animate({ opacity: to }, speed, easing, callback );
+ },
+ animate: function( prop, speed, easing, callback ) {
+ var empty = jQuery.isEmptyObject( prop ),
+ optall = jQuery.speed( speed, easing, callback ),
+ doAnimation = function() {
+ // Operate on a copy of prop so per-property easing won't be lost
+ var anim = Animation( this, jQuery.extend( {}, prop ), optall );
- try {
- // Do send the request (this may raise an exception)
- xhr.send( options.hasContent && options.data || null );
- } catch ( e ) {
- // #14683: Only rethrow if this hasn't been notified as an error yet
- if ( callback ) {
- throw e;
- }
+ // Empty animations, or finishing resolves immediately
+ if ( empty || jQuery._data( this, "finish" ) ) {
+ anim.stop( true );
}
- },
+ };
+ doAnimation.finish = doAnimation;
- abort: function() {
- if ( callback ) {
- callback();
- }
- }
+ return empty || optall.queue === false ?
+ this.each( doAnimation ) :
+ this.queue( optall.queue, doAnimation );
+ },
+ stop: function( type, clearQueue, gotoEnd ) {
+ var stopQueue = function( hooks ) {
+ var stop = hooks.stop;
+ delete hooks.stop;
+ stop( gotoEnd );
};
- }
-});
-
-
-
-// Install script dataType
-jQuery.ajaxSetup({
- accepts: {
- script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
- },
- contents: {
- script: /(?:java|ecma)script/
- },
- converters: {
- "text script": function( text ) {
- jQuery.globalEval( text );
- return text;
+ if ( typeof type !== "string" ) {
+ gotoEnd = clearQueue;
+ clearQueue = type;
+ type = undefined;
+ }
+ if ( clearQueue && type !== false ) {
+ this.queue( type || "fx", [] );
}
- }
-});
-// Handle cache's special case and crossDomain
-jQuery.ajaxPrefilter( "script", function( s ) {
- if ( s.cache === undefined ) {
- s.cache = false;
- }
- if ( s.crossDomain ) {
- s.type = "GET";
- }
-});
+ return this.each(function() {
+ var dequeue = true,
+ index = type != null && type + "queueHooks",
+ timers = jQuery.timers,
+ data = jQuery._data( this );
-// Bind script tag hack transport
-jQuery.ajaxTransport( "script", function( s ) {
- // This transport only deals with cross domain requests
- if ( s.crossDomain ) {
- var script, callback;
- return {
- send: function( _, complete ) {
- script = jQuery("
");
}
diff --git a/src/Glimpse.Agent.AspNet.Mvc/Razor/ScriptInjectorRazorHost.cs b/src/Glimpse.Agent.Dnx.Mvc/Razor/ScriptInjectorRazorHost.cs
similarity index 94%
rename from src/Glimpse.Agent.AspNet.Mvc/Razor/ScriptInjectorRazorHost.cs
rename to src/Glimpse.Agent.Dnx.Mvc/Razor/ScriptInjectorRazorHost.cs
index 89f96369..3d270c9a 100644
--- a/src/Glimpse.Agent.AspNet.Mvc/Razor/ScriptInjectorRazorHost.cs
+++ b/src/Glimpse.Agent.Dnx.Mvc/Razor/ScriptInjectorRazorHost.cs
@@ -28,7 +28,7 @@ public override IReadOnlyList
DefaultInheritedChunks
newArray[original.Length] = new AddTagHelperChunk
{
- LookupText = "*, Glimpse.Agent.AspNet.Mvc"
+ LookupText = "*, Glimpse.Agent.Dnx.Mvc"
};
_overriddenChunks = newArray;
diff --git a/src/Glimpse.Agent.AspNet.Mvc/project.json b/src/Glimpse.Agent.Dnx.Mvc/project.json
similarity index 85%
rename from src/Glimpse.Agent.AspNet.Mvc/project.json
rename to src/Glimpse.Agent.Dnx.Mvc/project.json
index 99d27dbb..dd327067 100644
--- a/src/Glimpse.Agent.AspNet.Mvc/project.json
+++ b/src/Glimpse.Agent.Dnx.Mvc/project.json
@@ -13,9 +13,9 @@
"tags": [ "ASP.NET", "Web", "Debugging", "Diagnostics", "Razor" ],
"dependencies": {
- "Glimpse.Agent.AspNet": "",
- "Microsoft.AspNet.Mvc.Razor.Host": "6.0.0-rc1-final",
- "Microsoft.AspNet.Razor": "4.0.0-rc1-final"
+ "Glimpse.Agent.Dnx": "",
+ "Microsoft.AspNet.Mvc.Razor.Host": "6.0.0-*",
+ "Microsoft.AspNet.Razor": "4.0.0-*"
},
"frameworks": {
diff --git a/src/Glimpse.Agent.AspNet/AgentMiddleware.cs b/src/Glimpse.Agent.Dnx/AgentMiddleware.cs
similarity index 86%
rename from src/Glimpse.Agent.AspNet/AgentMiddleware.cs
rename to src/Glimpse.Agent.Dnx/AgentMiddleware.cs
index b3149db0..01d6c6b1 100644
--- a/src/Glimpse.Agent.AspNet/AgentMiddleware.cs
+++ b/src/Glimpse.Agent.Dnx/AgentMiddleware.cs
@@ -10,7 +10,7 @@ public class AgentMiddleware : IRegisterMiddleware
public void RegisterMiddleware(IApplicationBuilder appBuilder)
{
var manager = appBuilder.ApplicationServices.GetRequiredService();
- manager.Run(new StartupOptions(appBuilder));
+ manager.Run(new StartupOptions(appBuilder.ApplicationServices));
appBuilder.UseMiddleware(appBuilder);
}
diff --git a/src/Glimpse.Agent.Dnx/DependencyInjection/AgentDnxRegisterServices.cs b/src/Glimpse.Agent.Dnx/DependencyInjection/AgentDnxRegisterServices.cs
new file mode 100644
index 00000000..c091eb78
--- /dev/null
+++ b/src/Glimpse.Agent.Dnx/DependencyInjection/AgentDnxRegisterServices.cs
@@ -0,0 +1,28 @@
+using Glimpse.Agent.Inspectors;
+using Glimpse.Agent.Internal.Inspectors;
+using Glimpse.Common.Initialization;
+using Glimpse.Initialization;
+using Glimpse.Platform;
+using Microsoft.Extensions.DependencyInjection;
+
+namespace Glimpse.DependencyInjection
+{
+ public class AgentDnxRegisterServices : IRegisterServices
+ {
+ public void RegisterServices(IServiceCollection services)
+ {
+ //
+ // Common
+ //
+ services.AddTransient();
+ services.AddTransient();
+ // TODO: make work outside of DNX
+ services.AddTransient();
+
+ //
+ // Options
+ //
+ services.AddSingleton, DefaultExtensionProvider>();
+ }
+ }
+}
diff --git a/src/Glimpse.Agent.Dnx/DependencyInjection/GlimpseAgentDnxGlimpseCoreBuilder.cs b/src/Glimpse.Agent.Dnx/DependencyInjection/GlimpseAgentDnxGlimpseCoreBuilder.cs
new file mode 100644
index 00000000..25c7c2f6
--- /dev/null
+++ b/src/Glimpse.Agent.Dnx/DependencyInjection/GlimpseAgentDnxGlimpseCoreBuilder.cs
@@ -0,0 +1,33 @@
+using Microsoft.Extensions.DependencyInjection;
+using System;
+using Glimpse.Agent;
+using Glimpse.DependencyInjection;
+
+namespace Microsoft.Extensions.DependencyInjection
+{
+ public static class GlimpseAgentDnxGlimpseCoreBuilder
+ {
+ public static IGlimpseCoreBuilder RunningAgentWeb(this IGlimpseCoreBuilder builder)
+ {
+ return builder.RunningAgentWeb(null);
+ }
+
+ public static IGlimpseCoreBuilder RunningAgentWeb(this IGlimpseCoreBuilder builder, Action setupAction)
+ {
+ // TODO: switch over to static internal
+ var agentServices = new AgentRegisterServices();
+ agentServices.RegisterServices(builder.Services);
+
+ // TODO: switch over to static internal
+ var agentDnxServices = new AgentDnxRegisterServices();
+ agentDnxServices.RegisterServices(builder.Services);
+
+ if (setupAction != null)
+ {
+ builder.Services.Configure(setupAction);
+ }
+
+ return builder;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Glimpse.Agent.Dnx/Glimpse.Agent.Dnx.xproj b/src/Glimpse.Agent.Dnx/Glimpse.Agent.Dnx.xproj
new file mode 100644
index 00000000..4fa63036
--- /dev/null
+++ b/src/Glimpse.Agent.Dnx/Glimpse.Agent.Dnx.xproj
@@ -0,0 +1,20 @@
+
+
+
+ 14.0
+ $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
+
+
+
+
+ 887b32f4-2895-4ff6-be77-c521ab53c590
+ Glimpse.Agent.Dnx
+ ..\..\artifacts\obj\$(MSBuildProjectName)
+ ..\..\artifacts\bin\$(MSBuildProjectName)\
+
+
+
+ 2.0
+
+
+
diff --git a/src/Glimpse.Agent.AspNet/GlimpseAgentMiddleware.cs b/src/Glimpse.Agent.Dnx/GlimpseAgentMiddleware.cs
similarity index 99%
rename from src/Glimpse.Agent.AspNet/GlimpseAgentMiddleware.cs
rename to src/Glimpse.Agent.Dnx/GlimpseAgentMiddleware.cs
index 58444b89..31c4bf25 100644
--- a/src/Glimpse.Agent.AspNet/GlimpseAgentMiddleware.cs
+++ b/src/Glimpse.Agent.Dnx/GlimpseAgentMiddleware.cs
@@ -31,4 +31,4 @@ public async Task Invoke(HttpContext context)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/src/Glimpse.Agent.AspNet/Inspectors/DefaultInspectorFunctionManager.cs b/src/Glimpse.Agent.Dnx/Inspectors/DefaultInspectorFunctionManager.cs
similarity index 98%
rename from src/Glimpse.Agent.AspNet/Inspectors/DefaultInspectorFunctionManager.cs
rename to src/Glimpse.Agent.Dnx/Inspectors/DefaultInspectorFunctionManager.cs
index e34530a6..60d0c4a4 100644
--- a/src/Glimpse.Agent.AspNet/Inspectors/DefaultInspectorFunctionManager.cs
+++ b/src/Glimpse.Agent.Dnx/Inspectors/DefaultInspectorFunctionManager.cs
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using Glimpse.Initialization;
+using Glimpse.Platform;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http;
diff --git a/src/Glimpse.Agent.AspNet/Inspectors/IInspectorFunction.cs b/src/Glimpse.Agent.Dnx/Inspectors/IInspectorFunction.cs
similarity index 100%
rename from src/Glimpse.Agent.AspNet/Inspectors/IInspectorFunction.cs
rename to src/Glimpse.Agent.Dnx/Inspectors/IInspectorFunction.cs
diff --git a/src/Glimpse.Agent.AspNet/Inspectors/IInspectorFunctionBuilder.cs b/src/Glimpse.Agent.Dnx/Inspectors/IInspectorFunctionBuilder.cs
similarity index 100%
rename from src/Glimpse.Agent.AspNet/Inspectors/IInspectorFunctionBuilder.cs
rename to src/Glimpse.Agent.Dnx/Inspectors/IInspectorFunctionBuilder.cs
diff --git a/src/Glimpse.Agent.AspNet/Inspectors/IInspectorFunctionManager.cs b/src/Glimpse.Agent.Dnx/Inspectors/IInspectorFunctionManager.cs
similarity index 100%
rename from src/Glimpse.Agent.AspNet/Inspectors/IInspectorFunctionManager.cs
rename to src/Glimpse.Agent.Dnx/Inspectors/IInspectorFunctionManager.cs
diff --git a/src/Glimpse.Agent.AspNet/Inspectors/InspectorFunctionBuilder.cs b/src/Glimpse.Agent.Dnx/Inspectors/InspectorFunctionBuilder.cs
similarity index 100%
rename from src/Glimpse.Agent.AspNet/Inspectors/InspectorFunctionBuilder.cs
rename to src/Glimpse.Agent.Dnx/Inspectors/InspectorFunctionBuilder.cs
diff --git a/src/Glimpse.Agent.AspNet/Inspectors/InspectorsInspectorFunction.cs b/src/Glimpse.Agent.Dnx/Inspectors/InspectorsInspectorFunction.cs
similarity index 97%
rename from src/Glimpse.Agent.AspNet/Inspectors/InspectorsInspectorFunction.cs
rename to src/Glimpse.Agent.Dnx/Inspectors/InspectorsInspectorFunction.cs
index 787ab7a0..0edd2256 100644
--- a/src/Glimpse.Agent.AspNet/Inspectors/InspectorsInspectorFunction.cs
+++ b/src/Glimpse.Agent.Dnx/Inspectors/InspectorsInspectorFunction.cs
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using Glimpse.Initialization;
+using Glimpse.Platform;
namespace Glimpse.Agent.Inspectors
{
@@ -30,4 +31,4 @@ public void Configure(IInspectorFunctionBuilder builder)
});
}
}
-}
+}
\ No newline at end of file
diff --git a/src/Glimpse.Agent.AspNet/Internal/Inspectors/AgentStartupWebDiagnosticsInspector.cs b/src/Glimpse.Agent.Dnx/Internal/Inspectors/AgentStartupWebDiagnosticsInspector.cs
similarity index 99%
rename from src/Glimpse.Agent.AspNet/Internal/Inspectors/AgentStartupWebDiagnosticsInspector.cs
rename to src/Glimpse.Agent.Dnx/Internal/Inspectors/AgentStartupWebDiagnosticsInspector.cs
index 2b4e96b4..3c089d1c 100644
--- a/src/Glimpse.Agent.AspNet/Internal/Inspectors/AgentStartupWebDiagnosticsInspector.cs
+++ b/src/Glimpse.Agent.Dnx/Internal/Inspectors/AgentStartupWebDiagnosticsInspector.cs
@@ -28,4 +28,4 @@ private bool IsEnabled(string topic)
return !RequestIgnorerManager.ShouldIgnore();
}
}
-}
+}
\ No newline at end of file
diff --git a/src/Glimpse.Agent.AspNet/Internal/Inspectors/AspNet/AjaxInspector.cs b/src/Glimpse.Agent.Dnx/Internal/Inspectors/AspNet/AjaxInspector.cs
similarity index 97%
rename from src/Glimpse.Agent.AspNet/Internal/Inspectors/AspNet/AjaxInspector.cs
rename to src/Glimpse.Agent.Dnx/Internal/Inspectors/AspNet/AjaxInspector.cs
index 2f096f38..1228cde0 100644
--- a/src/Glimpse.Agent.AspNet/Internal/Inspectors/AspNet/AjaxInspector.cs
+++ b/src/Glimpse.Agent.Dnx/Internal/Inspectors/AspNet/AjaxInspector.cs
@@ -4,6 +4,7 @@
using System.Threading.Tasks;
using Glimpse.Agent.Inspectors;
using Glimpse.Common;
+using Glimpse.Platform;
using Microsoft.AspNet.Http;
using Microsoft.Extensions.Primitives;
@@ -27,4 +28,4 @@ public override void Before(HttpContext context)
}
}
}
-}
+}
\ No newline at end of file
diff --git a/src/Glimpse.Agent.AspNet/Internal/Inspectors/AspNet/AspNetDiagnosticsInspector.cs b/src/Glimpse.Agent.Dnx/Internal/Inspectors/AspNet/AspNetDiagnosticsInspector.cs
similarity index 99%
rename from src/Glimpse.Agent.AspNet/Internal/Inspectors/AspNet/AspNetDiagnosticsInspector.cs
rename to src/Glimpse.Agent.Dnx/Internal/Inspectors/AspNet/AspNetDiagnosticsInspector.cs
index 054ea829..4c38371c 100644
--- a/src/Glimpse.Agent.AspNet/Internal/Inspectors/AspNet/AspNetDiagnosticsInspector.cs
+++ b/src/Glimpse.Agent.Dnx/Internal/Inspectors/AspNet/AspNetDiagnosticsInspector.cs
@@ -116,4 +116,4 @@ private void ProcessException(IExceptionMessage message, Exception exception, bo
message.ExceptionDetails = _exceptionProcessor.GetErrorDetails(exception);
}
}
-}
+}
\ No newline at end of file
diff --git a/src/Glimpse.Agent.AspNet/Internal/Inspectors/AspNet/EnvironmentInspector.cs b/src/Glimpse.Agent.Dnx/Internal/Inspectors/AspNet/EnvironmentInspector.cs
similarity index 99%
rename from src/Glimpse.Agent.AspNet/Internal/Inspectors/AspNet/EnvironmentInspector.cs
rename to src/Glimpse.Agent.Dnx/Internal/Inspectors/AspNet/EnvironmentInspector.cs
index 5b7d64a3..a6be9118 100644
--- a/src/Glimpse.Agent.AspNet/Internal/Inspectors/AspNet/EnvironmentInspector.cs
+++ b/src/Glimpse.Agent.Dnx/Internal/Inspectors/AspNet/EnvironmentInspector.cs
@@ -42,4 +42,4 @@ public override void Before(HttpContext context)
_broker.SendMessage(_message);
}
}
-}
+}
\ No newline at end of file
diff --git a/src/Glimpse.Agent.AspNet/Internal/Inspectors/AspNet/ExceptionProcessor.cs b/src/Glimpse.Agent.Dnx/Internal/Inspectors/AspNet/ExceptionProcessor.cs
similarity index 100%
rename from src/Glimpse.Agent.AspNet/Internal/Inspectors/AspNet/ExceptionProcessor.cs
rename to src/Glimpse.Agent.Dnx/Internal/Inspectors/AspNet/ExceptionProcessor.cs
diff --git a/src/Glimpse.Agent.AspNet/Internal/Inspectors/AspNet/IExceptionProcessor.cs b/src/Glimpse.Agent.Dnx/Internal/Inspectors/AspNet/IExceptionProcessor.cs
similarity index 100%
rename from src/Glimpse.Agent.AspNet/Internal/Inspectors/AspNet/IExceptionProcessor.cs
rename to src/Glimpse.Agent.Dnx/Internal/Inspectors/AspNet/IExceptionProcessor.cs
diff --git a/src/Glimpse.Agent.AspNet/Internal/Inspectors/AspNet/UserInspector.cs b/src/Glimpse.Agent.Dnx/Internal/Inspectors/AspNet/UserInspector.cs
similarity index 99%
rename from src/Glimpse.Agent.AspNet/Internal/Inspectors/AspNet/UserInspector.cs
rename to src/Glimpse.Agent.Dnx/Internal/Inspectors/AspNet/UserInspector.cs
index e6672484..e92053d2 100644
--- a/src/Glimpse.Agent.AspNet/Internal/Inspectors/AspNet/UserInspector.cs
+++ b/src/Glimpse.Agent.Dnx/Internal/Inspectors/AspNet/UserInspector.cs
@@ -6,6 +6,7 @@
using Glimpse.Common;
using Glimpse.Internal.Extensions;
using Glimpse.Internal;
+using Glimpse.Platform;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.Http.Features;
diff --git a/src/Glimpse.Agent.AspNet/Internal/Inspectors/EF/EFDiagnosticsInspector.cs b/src/Glimpse.Agent.Dnx/Internal/Inspectors/EF/EFDiagnosticsInspector.cs
similarity index 99%
rename from src/Glimpse.Agent.AspNet/Internal/Inspectors/EF/EFDiagnosticsInspector.cs
rename to src/Glimpse.Agent.Dnx/Internal/Inspectors/EF/EFDiagnosticsInspector.cs
index 779d61dd..d8689973 100644
--- a/src/Glimpse.Agent.AspNet/Internal/Inspectors/EF/EFDiagnosticsInspector.cs
+++ b/src/Glimpse.Agent.Dnx/Internal/Inspectors/EF/EFDiagnosticsInspector.cs
@@ -74,4 +74,4 @@ public void OnAfterExecuteCommand(IDbCommand command, string executeMethod, bool
}
}
}
-}
+}
\ No newline at end of file
diff --git a/src/Glimpse.Agent.AspNet/Internal/Inspectors/EF/Proxies/IDbCommand.cs b/src/Glimpse.Agent.Dnx/Internal/Inspectors/EF/Proxies/IDbCommand.cs
similarity index 99%
rename from src/Glimpse.Agent.AspNet/Internal/Inspectors/EF/Proxies/IDbCommand.cs
rename to src/Glimpse.Agent.Dnx/Internal/Inspectors/EF/Proxies/IDbCommand.cs
index c3a5ec97..27783320 100644
--- a/src/Glimpse.Agent.AspNet/Internal/Inspectors/EF/Proxies/IDbCommand.cs
+++ b/src/Glimpse.Agent.Dnx/Internal/Inspectors/EF/Proxies/IDbCommand.cs
@@ -8,4 +8,4 @@ public interface IDbCommand
object Parameters { get; }
}
-}
+}
\ No newline at end of file
diff --git a/src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/MvcDiagnosticsInspector.cs b/src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/MvcDiagnosticsInspector.cs
similarity index 99%
rename from src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/MvcDiagnosticsInspector.cs
rename to src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/MvcDiagnosticsInspector.cs
index 28773f21..d5de473b 100644
--- a/src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/MvcDiagnosticsInspector.cs
+++ b/src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/MvcDiagnosticsInspector.cs
@@ -363,7 +363,7 @@ public void OnBeforeViewComponent(IViewComponentContext viewComponentContext)
ComponentDisplayName = viewComponentContext.ViewComponentDescriptor.FullName,
ComponentName = viewComponentContext.ViewComponentDescriptor.ShortName,
ComponentStartTime = startDateTime,
- Arguments = viewComponentContext.Arguments?.Select(x => new ArgumentData { Type = TypeNameHelper.GetTypeDisplayName(x, false), TypeFullName = TypeNameHelper.GetTypeDisplayName(x), Name = null, Value = SanitizeUserObjectsHelper.GetSafeObject(x) }).ToList()
+ Arguments = viewComponentContext.Arguments?.Select(x => new ArgumentData { Type = TypeNameHelper.GetTypeDisplayName(x.Value, false), TypeFullName = TypeNameHelper.GetTypeDisplayName(x.Value), Name = null, Value = SanitizeUserObjectsHelper.GetSafeObject(x.Value) }).ToList()
};
_broker.BeginLogicalOperation(message, startDateTime);
@@ -413,4 +413,4 @@ private IActionDescriptor ConvertActionDescriptor(object actionDescriptor)
return typedActionDescriptor;
}
}
-}
+}
\ No newline at end of file
diff --git a/src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/ActionResultTypes.cs b/src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/ActionResultTypes.cs
similarity index 100%
rename from src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/ActionResultTypes.cs
rename to src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/ActionResultTypes.cs
diff --git a/src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IActionContext.cs b/src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/IActionContext.cs
similarity index 99%
rename from src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IActionContext.cs
rename to src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/IActionContext.cs
index 4cc11929..7b7cae8f 100644
--- a/src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IActionContext.cs
+++ b/src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/IActionContext.cs
@@ -8,4 +8,4 @@ public interface IActionContext
HttpContext HttpContext { get; }
IRouteData RouteData { get; }
}
-}
+}
\ No newline at end of file
diff --git a/src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IActionDescriptor.cs b/src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/IActionDescriptor.cs
similarity index 99%
rename from src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IActionDescriptor.cs
rename to src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/IActionDescriptor.cs
index 440cdffb..54f3a6e3 100644
--- a/src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IActionDescriptor.cs
+++ b/src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/IActionDescriptor.cs
@@ -12,4 +12,4 @@ public interface IActionDescriptor
Type ControllerTypeInfo { get; }
MethodInfo MethodInfo { get; }
}
-}
+}
\ No newline at end of file
diff --git a/src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/IActionResult.cs b/src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/IActionResult.cs
new file mode 100644
index 00000000..3ba089bd
--- /dev/null
+++ b/src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/IActionResult.cs
@@ -0,0 +1,6 @@
+namespace Glimpse.Agent.Internal.Inspectors.Mvc.Proxies
+{
+ public interface IActionResult
+ {
+ }
+}
\ No newline at end of file
diff --git a/src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IRouteData.cs b/src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/IRouteData.cs
similarity index 94%
rename from src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IRouteData.cs
rename to src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/IRouteData.cs
index 6eda1cc0..b039f2db 100644
--- a/src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IRouteData.cs
+++ b/src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/IRouteData.cs
@@ -1,5 +1,4 @@
-
-using System.Collections.Generic;
+using System.Collections.Generic;
namespace Glimpse.Agent.Internal.Inspectors.Mvc.Proxies
{
@@ -29,4 +28,4 @@ public interface IRouterTemplatePart
object DefaultValue { get; }
bool IsOptional { get; }
}
-}
+}
\ No newline at end of file
diff --git a/src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IView.cs b/src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/IView.cs
similarity index 53%
rename from src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IView.cs
rename to src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/IView.cs
index 58c3da6f..254b54c4 100644
--- a/src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IView.cs
+++ b/src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/IView.cs
@@ -1,8 +1,7 @@
-
-namespace Glimpse.Agent.Internal.Inspectors.Mvc.Proxies
+namespace Glimpse.Agent.Internal.Inspectors.Mvc.Proxies
{
public interface IView
{
string Path { get; }
}
-}
+}
\ No newline at end of file
diff --git a/src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IViewComponentContext.cs b/src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/IViewComponentContext.cs
similarity index 65%
rename from src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IViewComponentContext.cs
rename to src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/IViewComponentContext.cs
index 1ca9fe15..69426c1e 100644
--- a/src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IViewComponentContext.cs
+++ b/src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/IViewComponentContext.cs
@@ -1,10 +1,11 @@
-
+using System.Collections.Generic;
+
namespace Glimpse.Agent.Internal.Inspectors.Mvc.Proxies
{
public interface IViewComponentContext
{
IViewComponentDescriptor ViewComponentDescriptor { get; }
- object[] Arguments { get; }
+ IDictionary Arguments { get; }
}
-}
+}
\ No newline at end of file
diff --git a/src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IViewComponentDescriptor.cs b/src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/IViewComponentDescriptor.cs
similarity index 100%
rename from src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IViewComponentDescriptor.cs
rename to src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/IViewComponentDescriptor.cs
diff --git a/src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IViewContext.cs b/src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/IViewContext.cs
similarity index 99%
rename from src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IViewContext.cs
rename to src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/IViewContext.cs
index 565c36b4..bb2449db 100644
--- a/src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/IViewContext.cs
+++ b/src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/IViewContext.cs
@@ -14,4 +14,4 @@ public interface IViewContext
IDictionary TempData { get; }
IDictionary ViewData { get; }
}
-}
+}
\ No newline at end of file
diff --git a/src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/ProxyAdapter.cs b/src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/ProxyAdapter.cs
similarity index 100%
rename from src/Glimpse.Agent.AspNet/Internal/Inspectors/Mvc/Proxies/ProxyAdapter.cs
rename to src/Glimpse.Agent.Dnx/Internal/Inspectors/Mvc/Proxies/ProxyAdapter.cs
diff --git a/src/Glimpse.Agent.AspNet/Internal/Inspectors/WebDiagnosticsInspector.cs b/src/Glimpse.Agent.Dnx/Internal/Inspectors/WebDiagnosticsInspector.cs
similarity index 98%
rename from src/Glimpse.Agent.AspNet/Internal/Inspectors/WebDiagnosticsInspector.cs
rename to src/Glimpse.Agent.Dnx/Internal/Inspectors/WebDiagnosticsInspector.cs
index 53f7676d..1e946626 100644
--- a/src/Glimpse.Agent.AspNet/Internal/Inspectors/WebDiagnosticsInspector.cs
+++ b/src/Glimpse.Agent.Dnx/Internal/Inspectors/WebDiagnosticsInspector.cs
@@ -1,5 +1,6 @@
using Glimpse.Agent.Internal.Inspectors.Mvc.Proxies;
using Glimpse.Internal;
+using Glimpse.Platform;
using Microsoft.Extensions.Logging;
namespace Glimpse.Agent.Internal.Inspectors
@@ -32,4 +33,4 @@ public WebDiagnosticsInspector(IExceptionProcessor exceptionProcessor, IAgentBro
partial void AspNetOnCreated();
partial void MvcOnCreated();
}
-}
+}
\ No newline at end of file
diff --git a/src/Glimpse.Agent.Dnx/Properties/AssemblyInfo.cs b/src/Glimpse.Agent.Dnx/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..c4675f4c
--- /dev/null
+++ b/src/Glimpse.Agent.Dnx/Properties/AssemblyInfo.cs
@@ -0,0 +1,23 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Glimpse.Agent.Dnx")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Glimpse.Agent.Dnx")]
+[assembly: AssemblyCopyright("Copyright © 2015")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("887b32f4-2895-4ff6-be77-c521ab53c590")]
diff --git a/src/Glimpse.Agent.Dnx/project.json b/src/Glimpse.Agent.Dnx/project.json
new file mode 100644
index 00000000..34e12f45
--- /dev/null
+++ b/src/Glimpse.Agent.Dnx/project.json
@@ -0,0 +1,25 @@
+{
+ "version": "2.0.0-*",
+ "authors": [ "nmolnar", "avanderhoorn" ],
+ "owners": [ "nmolnar", "avanderhoorn" ],
+ "title": "Glimpse Agent for ASP.NET",
+ "licenseUrl": "https://github.com/Glimpse/Glimpse.Prototype/blob/dev/LICENSE.txt",
+ "projectUrl": "http://getglimpse.com",
+ "iconUrl": "http://getglimpse.com/content/glimpse100.png",
+ "requireLicenseAcceptance": false,
+ "description": "The infrastructure and extensibility points required to enable Glimpse to gather diagnostics information from ASP.NET web applications.",
+ "summary": "Glimpse.Agent.AspNet contains infrastructure and extensibility points for gathering diagnostics information from ASP.NET web applications.",
+ "releaseNotes": "Initial release of Glimpse.Agent.AspNet.",
+ "tags": [ "ASP.NET", "Web", "Debugging", "Diagnostics", "Agent", "MVC", "EF", "EntityFramework" ],
+ "dependencies": {
+ "Glimpse.Agent.Core": "",
+ "Glimpse.Common.Dnx": "",
+ "Microsoft.AspNet.Hosting": "1.0.0-*",
+ "Microsoft.Extensions.DiagnosticAdapter": "1.0.0-*",
+ "System.Diagnostics.DiagnosticSource": "4.0.0-*"
+ },
+ "frameworks": {
+ "net451": { },
+ "dotnet5.4": { }
+ }
+}
\ No newline at end of file
diff --git a/src/Glimpse.Agent.SystemWeb/DependencyInjection/AgentSystemWebRegisterServices.cs b/src/Glimpse.Agent.SystemWeb/DependencyInjection/AgentSystemWebRegisterServices.cs
new file mode 100644
index 00000000..d12b6e4b
--- /dev/null
+++ b/src/Glimpse.Agent.SystemWeb/DependencyInjection/AgentSystemWebRegisterServices.cs
@@ -0,0 +1,17 @@
+using Glimpse.Agent.Inspectors;
+using Glimpse.Initialization;
+using Microsoft.Extensions.DependencyInjection;
+
+namespace Glimpse.DependencyInjection
+{
+ public class AgentSystemWebRegisterServices : IRegisterServices
+ {
+ public void RegisterServices(IServiceCollection services)
+ {
+ //
+ // Common
+ //
+ services.AddSingleton();
+ }
+ }
+}
diff --git a/src/Glimpse.Agent.SystemWeb/DependencyInjection/GlimpseAgentSystemWebGlimpseCoreBuilder.cs b/src/Glimpse.Agent.SystemWeb/DependencyInjection/GlimpseAgentSystemWebGlimpseCoreBuilder.cs
new file mode 100644
index 00000000..11cd89c7
--- /dev/null
+++ b/src/Glimpse.Agent.SystemWeb/DependencyInjection/GlimpseAgentSystemWebGlimpseCoreBuilder.cs
@@ -0,0 +1,32 @@
+using System;
+using Glimpse.Agent;
+using Glimpse.DependencyInjection;
+
+namespace Microsoft.Extensions.DependencyInjection
+{
+ public static class GlimpseAgentSystemWebGlimpseCoreBuilder
+ {
+ public static IGlimpseCoreBuilder RunningAgentWeb(this IGlimpseCoreBuilder builder)
+ {
+ return builder.RunningAgentWeb(null);
+ }
+
+ public static IGlimpseCoreBuilder RunningAgentWeb(this IGlimpseCoreBuilder builder, Action setupAction)
+ {
+ // TODO: switch over to static internal
+ var agentServices = new AgentRegisterServices();
+ agentServices.RegisterServices(builder.Services);
+
+ // TODO: switch over to static internal
+ var agentSystemWebServices = new AgentSystemWebRegisterServices();
+ agentSystemWebServices.RegisterServices(builder.Services);
+
+ if (setupAction != null)
+ {
+ builder.Services.Configure(setupAction);
+ }
+
+ return builder;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Glimpse.Agent.SystemWeb/Glimpse.Agent.SystemWeb.xproj b/src/Glimpse.Agent.SystemWeb/Glimpse.Agent.SystemWeb.xproj
new file mode 100644
index 00000000..cc5f1461
--- /dev/null
+++ b/src/Glimpse.Agent.SystemWeb/Glimpse.Agent.SystemWeb.xproj
@@ -0,0 +1,21 @@
+
+
+
+ 14.0
+ $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
+
+
+
+ 1fba7f1f-f4e8-4780-a795-88fab4d10c0e
+ Glimpse.Agent.SystemWeb
+ ..\..\artifacts\obj\$(MSBuildProjectName)
+ ..\..\artifacts\bin\$(MSBuildProjectName)\
+
+
+ 2.0
+
+
+ True
+
+
+
\ No newline at end of file
diff --git a/src/Glimpse.Agent.SystemWeb/GlimpseAgentModule.cs b/src/Glimpse.Agent.SystemWeb/GlimpseAgentModule.cs
new file mode 100644
index 00000000..3bd275c8
--- /dev/null
+++ b/src/Glimpse.Agent.SystemWeb/GlimpseAgentModule.cs
@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Web;
+using SystemWebAdapter;
+using Glimpse.Agent.Configuration;
+using Glimpse.Agent.Inspectors;
+using Glimpse.Initialization;
+
+namespace Glimpse
+{
+ public class GlimpseAgentModule : IHttpModule
+ {
+ private IInspectorRuntimeManager _inspectorRuntimeManager; // TODO: need to set
+
+ public void Init(HttpApplication httpApplication)
+ {
+ httpApplication.BeginRequest += (context, e) => BeginRequest(GetHttpContext(context));
+ httpApplication.PostReleaseRequestState += (context, e) => EndRequest(GetHttpContext(context));
+ }
+
+ private void BeginRequest(Microsoft.AspNet.Http.HttpContext context)
+ {
+ _inspectorRuntimeManager.BeginRequest(context);
+ }
+
+ private void EndRequest(Microsoft.AspNet.Http.HttpContext context)
+ {
+ _inspectorRuntimeManager.EndRequest(context);
+ }
+
+ private static Microsoft.AspNet.Http.HttpContext GetHttpContext(object sender)
+ {
+ var httpApplication = (HttpApplication)sender;
+
+ // convert SystemWeb HttpContext to DNX HttpContext
+ return httpApplication.Context.CreateContext();
+ }
+
+ public void Dispose()
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Glimpse.Agent.SystemWeb/Inspectors/IInspectorRuntimeManager.cs b/src/Glimpse.Agent.SystemWeb/Inspectors/IInspectorRuntimeManager.cs
new file mode 100644
index 00000000..34454fc0
--- /dev/null
+++ b/src/Glimpse.Agent.SystemWeb/Inspectors/IInspectorRuntimeManager.cs
@@ -0,0 +1,11 @@
+using Microsoft.AspNet.Http;
+
+namespace Glimpse.Agent.Inspectors
+{
+ public interface IInspectorRuntimeManager
+ {
+ void BeginRequest(HttpContext context);
+
+ void EndRequest(HttpContext context);
+ }
+}
\ No newline at end of file
diff --git a/src/Glimpse.Agent.SystemWeb/Inspectors/InspectorRuntimeManager.cs b/src/Glimpse.Agent.SystemWeb/Inspectors/InspectorRuntimeManager.cs
new file mode 100644
index 00000000..1caf5e73
--- /dev/null
+++ b/src/Glimpse.Agent.SystemWeb/Inspectors/InspectorRuntimeManager.cs
@@ -0,0 +1,48 @@
+using System.Collections.Generic;
+using Microsoft.AspNet.Http;
+using Glimpse.Agent.Configuration;
+using Glimpse.Initialization;
+using Glimpse.Platform;
+
+namespace Glimpse.Agent.Inspectors
+{
+ public class InspectorRuntimeManager : IInspectorRuntimeManager
+ {
+ private const string ShouldIgnoreResultKey = "__GlimpseShouldIgnoreResult";
+ private readonly IRequestIgnorerManager _requestIgnorerManager;
+ private readonly IEnumerable _inspectors;
+
+ public InspectorRuntimeManager(IRequestIgnorerManager requestIgnorerManager, IExtensionProvider inspectorProvider)
+ {
+ _requestIgnorerManager = requestIgnorerManager;
+ _inspectors = inspectorProvider.Instances;
+ }
+
+ public void BeginRequest(HttpContext context)
+ {
+ var shouldIgnore = _requestIgnorerManager.ShouldIgnore(context);
+ if (!shouldIgnore)
+ {
+ foreach (var inspector in _inspectors)
+ {
+ inspector.Before(context);
+ }
+ }
+
+ // store result so we don't need to evaluate again later
+ context.Items[ShouldIgnoreResultKey] = shouldIgnore;
+ }
+
+ public void EndRequest(HttpContext context)
+ {
+ var shouldIgnore = context.Items[ShouldIgnoreResultKey] as bool?;
+ if (shouldIgnore.HasValue && !shouldIgnore.Value)
+ {
+ foreach (var inspector in _inspectors)
+ {
+ inspector.After(context);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Glimpse.Agent.SystemWeb/Properties/AssemblyInfo.cs b/src/Glimpse.Agent.SystemWeb/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..b15abb9e
--- /dev/null
+++ b/src/Glimpse.Agent.SystemWeb/Properties/AssemblyInfo.cs
@@ -0,0 +1,23 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Glimpse.Agent.SystemWeb")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Glimpse.Agent.SystemWeb")]
+[assembly: AssemblyCopyright("Copyright © 2015")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("1fba7f1f-f4e8-4780-a795-88fab4d10c0e")]
diff --git a/src/Glimpse.Agent.SystemWeb/project.json b/src/Glimpse.Agent.SystemWeb/project.json
new file mode 100644
index 00000000..049b8f51
--- /dev/null
+++ b/src/Glimpse.Agent.SystemWeb/project.json
@@ -0,0 +1,22 @@
+{
+ "version": "2.0.0-*",
+ "authors": [ "nmolnar", "avanderhoorn" ],
+ "owners": [ "nmolnar", "avanderhoorn" ],
+ "title": "Glimpse Agent for ASP.NET",
+ "licenseUrl": "https://github.com/Glimpse/Glimpse.Prototype/blob/dev/LICENSE.txt",
+ "projectUrl": "http://getglimpse.com",
+ "iconUrl": "http://getglimpse.com/content/glimpse100.png",
+ "requireLicenseAcceptance": false,
+ "description": "The infrastructure and extensibility points required to enable Glimpse to gather diagnostics information from ASP.NET web applications.",
+ "summary": "Glimpse.Agent.AspNet contains infrastructure and extensibility points for gathering diagnostics information from ASP.NET web applications.",
+ "releaseNotes": "Initial release of Glimpse.Agent.AspNet.",
+ "tags": [ "ASP.NET", "Web", "Debugging", "Diagnostics", "Agent", "MVC", "EF", "EntityFramework" ],
+ "dependencies": {
+ "Glimpse.Agent.Core": "",
+ "Glimpse.Common.SystemWeb": "",
+ "SystemWebAdapter": ""
+ },
+ "frameworks": {
+ "net451": { }
+ }
+}
\ No newline at end of file
diff --git a/src/Glimpse.Client.Web.Simple/ApplicationBuilderExtensions.cs b/src/Glimpse.Client.Web.Simple/ApplicationBuilderExtensions.cs
deleted file mode 100644
index 35cd7611..00000000
--- a/src/Glimpse.Client.Web.Simple/ApplicationBuilderExtensions.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-
-using System.Reflection;
-using Microsoft.AspNet.FileProviders;
-using Microsoft.AspNet.StaticFiles;
-
-namespace Microsoft.AspNet.Builder
-{
- public static class ApplicationBuilderExtensions
- {
- public static IApplicationBuilder UseGlimpseUI(this IApplicationBuilder app)
- {
- var options = new FileServerOptions();
- options.RequestPath = "/GlimpseUI";
- options.EnableDefaultFiles = false;
- options.StaticFileOptions.ContentTypeProvider = new FileExtensionContentTypeProvider();
- options.FileProvider = new EmbeddedFileProvider(
- typeof(ApplicationBuilderExtensions).GetTypeInfo().Assembly,
- "Glimpse.Client.Web.Simple.Resources");
-
- app.UseFileServer(options);
-
- return app;
- }
- }
-}
diff --git a/src/Glimpse.Client.Web.Simple/Glimpse.Client.Web.Simple.xproj b/src/Glimpse.Client.Web.Simple/Glimpse.Client.Web.Simple.xproj
deleted file mode 100644
index 50443a4d..00000000
--- a/src/Glimpse.Client.Web.Simple/Glimpse.Client.Web.Simple.xproj
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
- 14.0
- $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
-
-
- 0abe752b-1074-4a17-b97a-ea8ac800736a
- Glimpse.Client.Web.Simple
- ..\..\artifacts\obj\$(MSBuildProjectName)
- ..\..\artifacts\bin\$(MSBuildProjectName)\
-
-
- 2.0
- 1561
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Glimpse.Client.Web.Simple/Startup.cs b/src/Glimpse.Client.Web.Simple/Startup.cs
deleted file mode 100644
index c0ea5114..00000000
--- a/src/Glimpse.Client.Web.Simple/Startup.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-using Microsoft.AspNet.Builder;
-using Microsoft.AspNet.Http;
-
-namespace Glimpse.Client.Web.Simple
-{
- public class Startup
- {
- public void Configure(IApplicationBuilder app)
- {
- // For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940
- app.UseStaticFiles();
- }
- }
-}
diff --git a/src/Glimpse.Client.Web.Simple/project.json b/src/Glimpse.Client.Web.Simple/project.json
deleted file mode 100644
index 12d5fd7b..00000000
--- a/src/Glimpse.Client.Web.Simple/project.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "version": "1.0.0-*",
- "packExclude": [
- "**.kproj",
- "**.user",
- "**.vspscc"
- ],
- "resource": [ "Resources" ],
- "dependencies": {
- "Microsoft.AspNet.FileProviders.Embedded": "1.0.0-*",
- "Microsoft.AspNet.StaticFiles": "1.0.0-*"
- },
- "frameworks": {
- "dnx451": { },
- "dnxcore50": { }
- }
-}
diff --git a/src/Glimpse.Common/Initialization/IResourceOptionsProvider.cs b/src/Glimpse.Common.Core/Configuration/IResourceOptionsProvider.cs
similarity index 60%
rename from src/Glimpse.Common/Initialization/IResourceOptionsProvider.cs
rename to src/Glimpse.Common.Core/Configuration/IResourceOptionsProvider.cs
index 1fab60da..a7ce6e4c 100644
--- a/src/Glimpse.Common/Initialization/IResourceOptionsProvider.cs
+++ b/src/Glimpse.Common.Core/Configuration/IResourceOptionsProvider.cs
@@ -1,4 +1,6 @@
-namespace Glimpse.Initialization
+using Glimpse.Initialization;
+
+namespace Glimpse.Configuration
{
public interface IResourceOptionsProvider
{
diff --git a/src/Glimpse.Common/Initialization/OptionsResourceOptionsProvider.cs b/src/Glimpse.Common.Core/Configuration/OptionsResourceOptionsProvider.cs
similarity index 80%
rename from src/Glimpse.Common/Initialization/OptionsResourceOptionsProvider.cs
rename to src/Glimpse.Common.Core/Configuration/OptionsResourceOptionsProvider.cs
index 931182d5..cf7931ae 100644
--- a/src/Glimpse.Common/Initialization/OptionsResourceOptionsProvider.cs
+++ b/src/Glimpse.Common.Core/Configuration/OptionsResourceOptionsProvider.cs
@@ -1,6 +1,7 @@
-using Microsoft.Extensions.OptionsModel;
+using Glimpse.Initialization;
+using Microsoft.Extensions.Options;
-namespace Glimpse.Initialization
+namespace Glimpse.Configuration
{
public class OptionsResourceOptionsProvider : IResourceOptionsProvider
{
@@ -16,4 +17,4 @@ public ResourceOptions BuildInstance()
return _resourceOptions;
}
}
-}
+}
\ No newline at end of file
diff --git a/src/Glimpse.Common/Initialization/ResourceOptions.cs b/src/Glimpse.Common.Core/Configuration/ResourceOptions.cs
similarity index 91%
rename from src/Glimpse.Common/Initialization/ResourceOptions.cs
rename to src/Glimpse.Common.Core/Configuration/ResourceOptions.cs
index 202b471b..8d028918 100644
--- a/src/Glimpse.Common/Initialization/ResourceOptions.cs
+++ b/src/Glimpse.Common.Core/Configuration/ResourceOptions.cs
@@ -1,4 +1,4 @@
-namespace Glimpse.Initialization
+namespace Glimpse.Configuration
{
public class ResourceOptions
{
diff --git a/src/Glimpse.Common.Core/DependencyInjection/GlimpseCoreServiceCollectionExtensions.cs b/src/Glimpse.Common.Core/DependencyInjection/GlimpseCoreServiceCollectionExtensions.cs
new file mode 100644
index 00000000..d3e17f3f
--- /dev/null
+++ b/src/Glimpse.Common.Core/DependencyInjection/GlimpseCoreServiceCollectionExtensions.cs
@@ -0,0 +1,52 @@
+using Glimpse;
+using Glimpse.Initialization;
+using Glimpse.Internal;
+using Glimpse.Internal.Serialization;
+using Glimpse.Platform;
+using Microsoft.Extensions.DependencyInjection.Extensions;
+using Newtonsoft.Json;
+
+namespace Microsoft.Extensions.DependencyInjection
+{
+ public static class GlimpseCoreServiceCollectionExtensions
+ {
+ public static IGlimpseCoreBuilder AddGlimpseCore(this IServiceCollection services)
+ {
+ return services.AddGlimpseCore(true);
+ }
+
+ public static IGlimpseCoreBuilder AddGlimpseCore(this IServiceCollection services, bool autoRegisterComponents)
+ {
+ //
+ // Platform
+ //
+ services.AddTransient();
+ services.AddTransient();
+ services.AddTransient();
+ services.AddSingleton, DefaultExtensionProvider>();
+ services.AddSingleton(typeof(IContextData<>), typeof(ContextData<>));
+ services.AddSingleton();
+
+ //
+ // Internal
+ //
+ services.AddTransient();
+ services.AddSingleton();
+
+ //
+ // Dynamic
+ //
+ if (autoRegisterComponents)
+ {
+ // run all other service registrations (i.e. agent and server)
+ var extensionProvider = services.BuildServiceProvider().GetService>();
+ foreach (var registration in extensionProvider.Instances)
+ {
+ registration.RegisterServices(services);
+ }
+ }
+
+ return new GlimpseBuilder(services);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Glimpse.Common.Core/DependencyInjection/IGlimpseBuilder.cs b/src/Glimpse.Common.Core/DependencyInjection/IGlimpseBuilder.cs
new file mode 100644
index 00000000..3b179e7e
--- /dev/null
+++ b/src/Glimpse.Common.Core/DependencyInjection/IGlimpseBuilder.cs
@@ -0,0 +1,7 @@
+namespace Microsoft.Extensions.DependencyInjection
+{
+ public interface IGlimpseBuilder
+ {
+ IServiceCollection Services { get; }
+ }
+}
\ No newline at end of file
diff --git a/src/Glimpse.Common.Core/DependencyInjection/IGlimpseCoreBuilder.cs b/src/Glimpse.Common.Core/DependencyInjection/IGlimpseCoreBuilder.cs
new file mode 100644
index 00000000..97a3d7f7
--- /dev/null
+++ b/src/Glimpse.Common.Core/DependencyInjection/IGlimpseCoreBuilder.cs
@@ -0,0 +1,7 @@
+namespace Microsoft.Extensions.DependencyInjection
+{
+ public interface IGlimpseCoreBuilder
+ {
+ IServiceCollection Services { get; }
+ }
+}
diff --git a/src/Glimpse.Common/Glimpse.Common.xproj b/src/Glimpse.Common.Core/Glimpse.Common.Core.xproj
similarity index 84%
rename from src/Glimpse.Common/Glimpse.Common.xproj
rename to src/Glimpse.Common.Core/Glimpse.Common.Core.xproj
index a93ff1df..bb27b59e 100644
--- a/src/Glimpse.Common/Glimpse.Common.xproj
+++ b/src/Glimpse.Common.Core/Glimpse.Common.Core.xproj
@@ -4,9 +4,10 @@
14.0
$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
+
c0fb7983-e851-4567-8540-153f9b7ec42d
- Glimpse
+ Glimpse.Core
..\..\artifacts\obj\$(MSBuildProjectName)
..\..\artifacts\bin\$(MSBuildProjectName)\
@@ -16,11 +17,13 @@
2.0
+
+ True
+
-
+
-
\ No newline at end of file
diff --git a/src/Glimpse.Common.Core/Initialization/IRegisterServices.cs b/src/Glimpse.Common.Core/Initialization/IRegisterServices.cs
new file mode 100644
index 00000000..aa2c3ed5
--- /dev/null
+++ b/src/Glimpse.Common.Core/Initialization/IRegisterServices.cs
@@ -0,0 +1,9 @@
+using Microsoft.Extensions.DependencyInjection;
+
+namespace Glimpse.Initialization
+{
+ public interface IRegisterServices
+ {
+ void RegisterServices(IServiceCollection services);
+ }
+}
\ No newline at end of file
diff --git a/src/Glimpse.Common/Initialization/IStartupOptions.cs b/src/Glimpse.Common.Core/Initialization/IStartupOptions.cs
similarity index 100%
rename from src/Glimpse.Common/Initialization/IStartupOptions.cs
rename to src/Glimpse.Common.Core/Initialization/IStartupOptions.cs
diff --git a/src/Glimpse.Common.Core/Initialization/StartupOptions.cs b/src/Glimpse.Common.Core/Initialization/StartupOptions.cs
new file mode 100644
index 00000000..5c782fc2
--- /dev/null
+++ b/src/Glimpse.Common.Core/Initialization/StartupOptions.cs
@@ -0,0 +1,14 @@
+using System;
+
+namespace Glimpse.Initialization
+{
+ public class StartupOptions : IStartupOptions
+ {
+ public StartupOptions(IServiceProvider serviceProvider)
+ {
+ ApplicationServices = serviceProvider;
+ }
+
+ public IServiceProvider ApplicationServices { get; }
+ }
+}
\ No newline at end of file
diff --git a/src/Glimpse.Common/Internal/Extensions/DictionaryExtensions.cs b/src/Glimpse.Common.Core/Internal/Extensions/DictionaryExtensions.cs
similarity index 100%
rename from src/Glimpse.Common/Internal/Extensions/DictionaryExtensions.cs
rename to src/Glimpse.Common.Core/Internal/Extensions/DictionaryExtensions.cs
diff --git a/src/Glimpse.Common/Internal/Extensions/HashExtensions.cs b/src/Glimpse.Common.Core/Internal/Extensions/HashExtensions.cs
similarity index 100%
rename from src/Glimpse.Common/Internal/Extensions/HashExtensions.cs
rename to src/Glimpse.Common.Core/Internal/Extensions/HashExtensions.cs
diff --git a/src/Glimpse.Common/Internal/Extensions/JsonSerializerExtensions.cs b/src/Glimpse.Common.Core/Internal/Extensions/JsonSerializerExtensions.cs
similarity index 88%
rename from src/Glimpse.Common/Internal/Extensions/JsonSerializerExtensions.cs
rename to src/Glimpse.Common.Core/Internal/Extensions/JsonSerializerExtensions.cs
index b4c384a6..b63ad26d 100644
--- a/src/Glimpse.Common/Internal/Extensions/JsonSerializerExtensions.cs
+++ b/src/Glimpse.Common.Core/Internal/Extensions/JsonSerializerExtensions.cs
@@ -2,9 +2,11 @@
using System.Globalization;
using System.IO;
using System.Text;
+using Glimpse.Internal.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
-using GuidConverter = Glimpse.Common.Internal.Serialization.GuidConverter;
+using GuidConverter = Glimpse.Internal.Serialization.GuidConverter;
+using TimeSpanConverter = Glimpse.Internal.Serialization.TimeSpanConverter;
namespace Glimpse.Internal.Extensions
{
diff --git a/src/Glimpse.Common/Internal/Extensions/PathStringExtension.cs b/src/Glimpse.Common.Core/Internal/Extensions/PathStringExtension.cs
similarity index 100%
rename from src/Glimpse.Common/Internal/Extensions/PathStringExtension.cs
rename to src/Glimpse.Common.Core/Internal/Extensions/PathStringExtension.cs
diff --git a/src/Glimpse.Common/Internal/Extensions/ReflectionExtensions.cs b/src/Glimpse.Common.Core/Internal/Extensions/ReflectionExtensions.cs
similarity index 100%
rename from src/Glimpse.Common/Internal/Extensions/ReflectionExtensions.cs
rename to src/Glimpse.Common.Core/Internal/Extensions/ReflectionExtensions.cs
diff --git a/src/Glimpse.Common/Internal/Extensions/StringExtensions.cs b/src/Glimpse.Common.Core/Internal/Extensions/StringExtensions.cs
similarity index 100%
rename from src/Glimpse.Common/Internal/Extensions/StringExtensions.cs
rename to src/Glimpse.Common.Core/Internal/Extensions/StringExtensions.cs
diff --git a/src/Glimpse.Common/Internal/Extensions/TypeExtension.cs b/src/Glimpse.Common.Core/Internal/Extensions/TypeExtension.cs
similarity index 100%
rename from src/Glimpse.Common/Internal/Extensions/TypeExtension.cs
rename to src/Glimpse.Common.Core/Internal/Extensions/TypeExtension.cs
diff --git a/src/Glimpse.Common.Core/Internal/GlimpseBuilder.cs b/src/Glimpse.Common.Core/Internal/GlimpseBuilder.cs
new file mode 100644
index 00000000..4dfb7587
--- /dev/null
+++ b/src/Glimpse.Common.Core/Internal/GlimpseBuilder.cs
@@ -0,0 +1,15 @@
+using System;
+using Microsoft.Extensions.DependencyInjection;
+
+namespace Glimpse.Internal
+{
+ public class GlimpseBuilder : IGlimpseBuilder, IGlimpseCoreBuilder
+ {
+ public GlimpseBuilder(IServiceCollection services)
+ {
+ Services = services;
+ }
+
+ public IServiceCollection Services { get; }
+ }
+}
diff --git a/src/Glimpse.Common/Internal/SanitizeUserObjectsHelper.cs b/src/Glimpse.Common.Core/Internal/SanitizeUserObjectsHelper.cs
similarity index 94%
rename from src/Glimpse.Common/Internal/SanitizeUserObjectsHelper.cs
rename to src/Glimpse.Common.Core/Internal/SanitizeUserObjectsHelper.cs
index d8ce385e..5b92f2c2 100644
--- a/src/Glimpse.Common/Internal/SanitizeUserObjectsHelper.cs
+++ b/src/Glimpse.Common.Core/Internal/SanitizeUserObjectsHelper.cs
@@ -1,9 +1,6 @@
using System;
-using System.CodeDom;
using System.Collections.Generic;
-using System.Linq;
using System.Reflection;
-using System.Threading.Tasks;
namespace Glimpse.Internal
{
diff --git a/src/Glimpse.Common/Internal/Serialization/DefaultJsonSerializerProvider.cs b/src/Glimpse.Common.Core/Internal/Serialization/DefaultJsonSerializerProvider.cs
similarity index 90%
rename from src/Glimpse.Common/Internal/Serialization/DefaultJsonSerializerProvider.cs
rename to src/Glimpse.Common.Core/Internal/Serialization/DefaultJsonSerializerProvider.cs
index 30fa2b5c..6b6ae2f1 100644
--- a/src/Glimpse.Common/Internal/Serialization/DefaultJsonSerializerProvider.cs
+++ b/src/Glimpse.Common.Core/Internal/Serialization/DefaultJsonSerializerProvider.cs
@@ -1,7 +1,7 @@
using Glimpse.Internal.Extensions;
using Newtonsoft.Json;
-namespace Glimpse.Common.Internal.Serialization
+namespace Glimpse.Internal.Serialization
{
public class DefaultJsonSerializerProvider : IJsonSerializerProvider
{
diff --git a/src/Glimpse.Common/Internal/Serialization/GuidConverter.cs b/src/Glimpse.Common.Core/Internal/Serialization/GuidConverter.cs
similarity index 95%
rename from src/Glimpse.Common/Internal/Serialization/GuidConverter.cs
rename to src/Glimpse.Common.Core/Internal/Serialization/GuidConverter.cs
index 90175415..bccc83cd 100644
--- a/src/Glimpse.Common/Internal/Serialization/GuidConverter.cs
+++ b/src/Glimpse.Common.Core/Internal/Serialization/GuidConverter.cs
@@ -1,7 +1,7 @@
using System;
using Newtonsoft.Json;
-namespace Glimpse.Common.Internal.Serialization
+namespace Glimpse.Internal.Serialization
{
public class GuidConverter : JsonConverter
{
diff --git a/src/Glimpse.Common/Internal/Serialization/IJsonSerializerProvider.cs b/src/Glimpse.Common.Core/Internal/Serialization/IJsonSerializerProvider.cs
similarity index 73%
rename from src/Glimpse.Common/Internal/Serialization/IJsonSerializerProvider.cs
rename to src/Glimpse.Common.Core/Internal/Serialization/IJsonSerializerProvider.cs
index 430045c4..8841e8ed 100644
--- a/src/Glimpse.Common/Internal/Serialization/IJsonSerializerProvider.cs
+++ b/src/Glimpse.Common.Core/Internal/Serialization/IJsonSerializerProvider.cs
@@ -1,6 +1,6 @@
using Newtonsoft.Json;
-namespace Glimpse.Common.Internal.Serialization
+namespace Glimpse.Internal.Serialization
{
public interface IJsonSerializerProvider
{
diff --git a/src/Glimpse.Common/Internal/Serialization/StringValuesConverter.cs b/src/Glimpse.Common.Core/Internal/Serialization/StringValuesConverter.cs
similarity index 85%
rename from src/Glimpse.Common/Internal/Serialization/StringValuesConverter.cs
rename to src/Glimpse.Common.Core/Internal/Serialization/StringValuesConverter.cs
index 8d8dc4e9..866c6aed 100644
--- a/src/Glimpse.Common/Internal/Serialization/StringValuesConverter.cs
+++ b/src/Glimpse.Common.Core/Internal/Serialization/StringValuesConverter.cs
@@ -1,11 +1,8 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
using Microsoft.Extensions.Primitives;
using Newtonsoft.Json;
-namespace Glimpse.Internal
+namespace Glimpse.Internal.Serialization
{
public class StringValuesConverter : JsonConverter
{
diff --git a/src/Glimpse.Common/Internal/Serialization/TimeSpanConverter.cs b/src/Glimpse.Common.Core/Internal/Serialization/TimeSpanConverter.cs
similarity index 95%
rename from src/Glimpse.Common/Internal/Serialization/TimeSpanConverter.cs
rename to src/Glimpse.Common.Core/Internal/Serialization/TimeSpanConverter.cs
index a9bf7288..1ea4f778 100644
--- a/src/Glimpse.Common/Internal/Serialization/TimeSpanConverter.cs
+++ b/src/Glimpse.Common.Core/Internal/Serialization/TimeSpanConverter.cs
@@ -1,7 +1,7 @@
using System;
using Newtonsoft.Json;
-namespace Glimpse.Internal
+namespace Glimpse.Internal.Serialization
{
public class TimeSpanConverter : JsonConverter
{
diff --git a/src/Glimpse.Common/Internal/TypeNameHelper.cs b/src/Glimpse.Common.Core/Internal/TypeNameHelper.cs
similarity index 98%
rename from src/Glimpse.Common/Internal/TypeNameHelper.cs
rename to src/Glimpse.Common.Core/Internal/TypeNameHelper.cs
index 0ed4b1a2..c1b4f404 100644
--- a/src/Glimpse.Common/Internal/TypeNameHelper.cs
+++ b/src/Glimpse.Common.Core/Internal/TypeNameHelper.cs
@@ -1,9 +1,7 @@
using System;
using System.Collections.Generic;
-using System.Linq;
using System.Reflection;
using System.Text;
-using System.Threading.Tasks;
namespace Glimpse.Internal
{
diff --git a/src/Glimpse.Common/Messaging/AgentBrokerObservations.cs b/src/Glimpse.Common.Core/Messaging/AgentBrokerObservations.cs
similarity index 100%
rename from src/Glimpse.Common/Messaging/AgentBrokerObservations.cs
rename to src/Glimpse.Common.Core/Messaging/AgentBrokerObservations.cs
diff --git a/src/Glimpse.Common/Messaging/AgentBrokerPayload.cs b/src/Glimpse.Common.Core/Messaging/AgentBrokerPayload.cs
similarity index 100%
rename from src/Glimpse.Common/Messaging/AgentBrokerPayload.cs
rename to src/Glimpse.Common.Core/Messaging/AgentBrokerPayload.cs
diff --git a/src/Glimpse.Common/Messaging/IAgentBroker.cs b/src/Glimpse.Common.Core/Messaging/IAgentBroker.cs
similarity index 100%
rename from src/Glimpse.Common/Messaging/IAgentBroker.cs
rename to src/Glimpse.Common.Core/Messaging/IAgentBroker.cs
diff --git a/src/Glimpse.Common/Messaging/IMessage.cs b/src/Glimpse.Common.Core/Messaging/IMessage.cs
similarity index 100%
rename from src/Glimpse.Common/Messaging/IMessage.cs
rename to src/Glimpse.Common.Core/Messaging/IMessage.cs
diff --git a/src/Glimpse.Common/Messaging/IMessagePublisher.cs b/src/Glimpse.Common.Core/Messaging/IMessagePublisher.cs
similarity index 100%
rename from src/Glimpse.Common/Messaging/IMessagePublisher.cs
rename to src/Glimpse.Common.Core/Messaging/IMessagePublisher.cs
diff --git a/src/Glimpse.Common/Messaging/IMessageTypeProvider.cs b/src/Glimpse.Common.Core/Messaging/IMessageTypeProvider.cs
similarity index 79%
rename from src/Glimpse.Common/Messaging/IMessageTypeProvider.cs
rename to src/Glimpse.Common.Core/Messaging/IMessageTypeProvider.cs
index 9564cbc0..92c20a00 100644
--- a/src/Glimpse.Common/Messaging/IMessageTypeProvider.cs
+++ b/src/Glimpse.Common.Core/Messaging/IMessageTypeProvider.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
-namespace Glimpse.Common.Messaging
+namespace Glimpse.Messaging
{
public interface IMessageTypeProvider
{
diff --git a/src/Glimpse.Common/Messaging/Message.cs b/src/Glimpse.Common.Core/Messaging/Message.cs
similarity index 95%
rename from src/Glimpse.Common/Messaging/Message.cs
rename to src/Glimpse.Common.Core/Messaging/Message.cs
index 970533c6..0a3feef5 100644
--- a/src/Glimpse.Common/Messaging/Message.cs
+++ b/src/Glimpse.Common.Core/Messaging/Message.cs
@@ -2,8 +2,6 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
-using Glimpse.Internal;
-using Newtonsoft.Json;
namespace Glimpse
{
diff --git a/src/Glimpse.Common/Messaging/MessageContext.cs b/src/Glimpse.Common.Core/Messaging/MessageContext.cs
similarity index 100%
rename from src/Glimpse.Common/Messaging/MessageContext.cs
rename to src/Glimpse.Common.Core/Messaging/MessageContext.cs
diff --git a/src/Glimpse.Common/Internal/Messaging/Operation.cs b/src/Glimpse.Common.Core/Messaging/Operation.cs
similarity index 94%
rename from src/Glimpse.Common/Internal/Messaging/Operation.cs
rename to src/Glimpse.Common.Core/Messaging/Operation.cs
index be35cdad..aacec04c 100644
--- a/src/Glimpse.Common/Internal/Messaging/Operation.cs
+++ b/src/Glimpse.Common.Core/Messaging/Operation.cs
@@ -1,7 +1,7 @@
using System;
using System.Diagnostics;
-namespace Glimpse.Internal
+namespace Glimpse.Messaging
{
public class Operation
{
diff --git a/src/Glimpse.Common/Internal/Messaging/OperationOffset.cs b/src/Glimpse.Common.Core/Messaging/OperationOffset.cs
similarity index 79%
rename from src/Glimpse.Common/Internal/Messaging/OperationOffset.cs
rename to src/Glimpse.Common.Core/Messaging/OperationOffset.cs
index 1d25304a..f4dd7409 100644
--- a/src/Glimpse.Common/Internal/Messaging/OperationOffset.cs
+++ b/src/Glimpse.Common.Core/Messaging/OperationOffset.cs
@@ -1,10 +1,7 @@
using System;
-using System.Collections.Generic;
using System.Diagnostics;
-using System.Linq;
-using System.Threading.Tasks;
-namespace Glimpse.Common.Internal.Messaging
+namespace Glimpse.Messaging
{
public class OperationOffset
{
diff --git a/src/Glimpse.Common/Internal/Messaging/OperationStack.cs b/src/Glimpse.Common.Core/Messaging/OperationStack.cs
similarity index 96%
rename from src/Glimpse.Common/Internal/Messaging/OperationStack.cs
rename to src/Glimpse.Common.Core/Messaging/OperationStack.cs
index de2ea75f..9cb0a51d 100644
--- a/src/Glimpse.Common/Internal/Messaging/OperationStack.cs
+++ b/src/Glimpse.Common.Core/Messaging/OperationStack.cs
@@ -1,7 +1,7 @@
using System;
-using Glimpse.Common.Internal.Messaging;
+using Glimpse.Platform;
-namespace Glimpse.Internal
+namespace Glimpse.Messaging
{
public class OperationStack
{
diff --git a/src/Glimpse.Common/Internal/Messaging/OperationTiming.cs b/src/Glimpse.Common.Core/Messaging/OperationTiming.cs
similarity index 93%
rename from src/Glimpse.Common/Internal/Messaging/OperationTiming.cs
rename to src/Glimpse.Common.Core/Messaging/OperationTiming.cs
index 4718673d..212aec56 100644
--- a/src/Glimpse.Common/Internal/Messaging/OperationTiming.cs
+++ b/src/Glimpse.Common.Core/Messaging/OperationTiming.cs
@@ -1,8 +1,7 @@
using System;
using System.Diagnostics;
-using System.Threading;
-namespace Glimpse.Internal
+namespace Glimpse.Messaging
{
public class OperationTiming
{
diff --git a/src/Glimpse.Common/Messaging/PromoteToAttribute.cs b/src/Glimpse.Common.Core/Messaging/PromoteToAttribute.cs
similarity index 100%
rename from src/Glimpse.Common/Messaging/PromoteToAttribute.cs
rename to src/Glimpse.Common.Core/Messaging/PromoteToAttribute.cs
diff --git a/src/Glimpse.Common/Internal/Messaging/Timing.cs b/src/Glimpse.Common.Core/Messaging/Timing.cs
similarity index 92%
rename from src/Glimpse.Common/Internal/Messaging/Timing.cs
rename to src/Glimpse.Common.Core/Messaging/Timing.cs
index 17671952..a6d0954a 100644
--- a/src/Glimpse.Common/Internal/Messaging/Timing.cs
+++ b/src/Glimpse.Common.Core/Messaging/Timing.cs
@@ -1,6 +1,6 @@
using System;
-namespace Glimpse.Internal
+namespace Glimpse.Messaging
{
public struct Timing
{
diff --git a/src/Glimpse.Common/Internal/ContextData.cs b/src/Glimpse.Common.Core/Platform/ContextData.cs
similarity index 96%
rename from src/Glimpse.Common/Internal/ContextData.cs
rename to src/Glimpse.Common.Core/Platform/ContextData.cs
index ea6c1d6c..adb149e7 100644
--- a/src/Glimpse.Common/Internal/ContextData.cs
+++ b/src/Glimpse.Common.Core/Platform/ContextData.cs
@@ -6,7 +6,7 @@
using System.Threading;
#endif
-namespace Glimpse.Internal
+namespace Glimpse.Platform
{
public class ContextData : IContextData
{
diff --git a/src/Glimpse.Common/Initialization/DefaultExtensionProvider.cs b/src/Glimpse.Common.Core/Platform/DefaultExtensionProvider.cs
similarity index 89%
rename from src/Glimpse.Common/Initialization/DefaultExtensionProvider.cs
rename to src/Glimpse.Common.Core/Platform/DefaultExtensionProvider.cs
index f23c1956..60f8de07 100644
--- a/src/Glimpse.Common/Initialization/DefaultExtensionProvider.cs
+++ b/src/Glimpse.Common.Core/Platform/DefaultExtensionProvider.cs
@@ -1,8 +1,9 @@
using System.Collections.Generic;
using System.Linq;
+using Glimpse.Initialization;
using Glimpse.Internal;
-namespace Glimpse.Initialization
+namespace Glimpse.Platform
{
public class DefaultExtensionProvider : IExtensionProvider
where T : class
diff --git a/src/Glimpse.Common/DefaultGlimpseContextAccessor.cs b/src/Glimpse.Common.Core/Platform/DefaultGlimpseContextAccessor.cs
similarity index 87%
rename from src/Glimpse.Common/DefaultGlimpseContextAccessor.cs
rename to src/Glimpse.Common.Core/Platform/DefaultGlimpseContextAccessor.cs
index 7274fed6..2b055eb4 100644
--- a/src/Glimpse.Common/DefaultGlimpseContextAccessor.cs
+++ b/src/Glimpse.Common.Core/Platform/DefaultGlimpseContextAccessor.cs
@@ -1,7 +1,6 @@
using System;
-using Glimpse.Internal;
-namespace Glimpse.Common
+namespace Glimpse.Platform
{
public class DefaultGlimpseContextAccessor : IGlimpseContextAccessor
{
diff --git a/src/Glimpse.Common/Internal/Reflection/DefaultTypeActivator.cs b/src/Glimpse.Common.Core/Platform/DefaultTypeActivator.cs
similarity index 97%
rename from src/Glimpse.Common/Internal/Reflection/DefaultTypeActivator.cs
rename to src/Glimpse.Common.Core/Platform/DefaultTypeActivator.cs
index c85eb76c..7bd4dacd 100644
--- a/src/Glimpse.Common/Internal/Reflection/DefaultTypeActivator.cs
+++ b/src/Glimpse.Common.Core/Platform/DefaultTypeActivator.cs
@@ -2,9 +2,10 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
+using Glimpse.Internal;
using Microsoft.Extensions.DependencyInjection;
-namespace Glimpse.Internal
+namespace Glimpse.Platform
{
public class DefaultTypeActivator : ITypeActivator
{
diff --git a/src/Glimpse.Common/Internal/Reflection/DefaultTypeSelector.cs b/src/Glimpse.Common.Core/Platform/DefaultTypeSelector.cs
similarity index 50%
rename from src/Glimpse.Common/Internal/Reflection/DefaultTypeSelector.cs
rename to src/Glimpse.Common.Core/Platform/DefaultTypeSelector.cs
index f2277530..939a23f7 100644
--- a/src/Glimpse.Common/Internal/Reflection/DefaultTypeSelector.cs
+++ b/src/Glimpse.Common.Core/Platform/DefaultTypeSelector.cs
@@ -2,15 +2,16 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
+using Glimpse.Internal;
-namespace Glimpse.Internal
+namespace Glimpse.Platform
{
public class DefaultTypeSelector : ITypeSelector
{
public IEnumerable FindTypes(IEnumerable targetAssmblies, TypeInfo targetTypeInfo)
{
var types = targetAssmblies
- .SelectMany(a => a.DefinedTypes)
+ .SelectMany(GetLoadableTypes)
.Where(t => t.IsClass &&
!t.IsAbstract &&
!t.ContainsGenericParameters &&
@@ -18,5 +19,21 @@ public IEnumerable FindTypes(IEnumerable targetAssmblies, Ty
return types;
}
+
+ private static IEnumerable GetLoadableTypes(Assembly assembly)
+ {
+ try
+ {
+ return assembly.DefinedTypes;
+ }
+ catch (ReflectionTypeLoadException e)
+ {
+ return e.Types.Where(t => t != null).Select(t => t.GetTypeInfo());
+ }
+ catch (Exception)
+ {
+ return Enumerable.Empty();
+ }
+ }
}
}
\ No newline at end of file
diff --git a/src/Glimpse.Common/Internal/Reflection/DefaultTypeService.cs b/src/Glimpse.Common.Core/Platform/DefaultTypeService.cs
similarity index 98%
rename from src/Glimpse.Common/Internal/Reflection/DefaultTypeService.cs
rename to src/Glimpse.Common.Core/Platform/DefaultTypeService.cs
index ecc6a368..17bbe21f 100644
--- a/src/Glimpse.Common/Internal/Reflection/DefaultTypeService.cs
+++ b/src/Glimpse.Common.Core/Platform/DefaultTypeService.cs
@@ -1,15 +1,16 @@
using System;
using System.Collections.Generic;
using System.Reflection;
+using Glimpse.Internal;
-namespace Glimpse.Internal
+namespace Glimpse.Platform
{
public class DefaultTypeService : ITypeService
{
private readonly ITypeActivator _typesActivator;
private readonly ITypeSelector _typeDiscovery;
private readonly IAssemblyProvider _assemblyProvider;
- private readonly string _defaultLibrary = "Glimpse.Common";
+ private readonly string _defaultLibrary = "Glimpse.Common.Core";
public DefaultTypeService(ITypeActivator typesActivator, ITypeSelector typeDiscovery, IAssemblyProvider assemblyProvider)
{
diff --git a/src/Glimpse.Common/Initialization/FixedExtensionProvider.cs b/src/Glimpse.Common.Core/Platform/FixedExtensionProvider.cs
similarity index 90%
rename from src/Glimpse.Common/Initialization/FixedExtensionProvider.cs
rename to src/Glimpse.Common.Core/Platform/FixedExtensionProvider.cs
index 59032482..efd00217 100644
--- a/src/Glimpse.Common/Initialization/FixedExtensionProvider.cs
+++ b/src/Glimpse.Common.Core/Platform/FixedExtensionProvider.cs
@@ -1,7 +1,8 @@
using System.Collections.Generic;
using System.Linq;
+using Glimpse.Initialization;
-namespace Glimpse.Initialization
+namespace Glimpse.Platform
{
public class FixedExtensionProvider : IExtensionProvider
where T : class
diff --git a/src/Glimpse.Common/Internal/Reflection/IAssemblyProvider.cs b/src/Glimpse.Common.Core/Platform/IAssemblyProvider.cs
similarity index 88%
rename from src/Glimpse.Common/Internal/Reflection/IAssemblyProvider.cs
rename to src/Glimpse.Common.Core/Platform/IAssemblyProvider.cs
index c799836c..06d50ecf 100644
--- a/src/Glimpse.Common/Internal/Reflection/IAssemblyProvider.cs
+++ b/src/Glimpse.Common.Core/Platform/IAssemblyProvider.cs
@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Reflection;
-namespace Glimpse.Internal
+namespace Glimpse.Platform
{
public interface IAssemblyProvider
{
diff --git a/src/Glimpse.Common/Internal/IContextData.cs b/src/Glimpse.Common.Core/Platform/IContextData.cs
similarity index 64%
rename from src/Glimpse.Common/Internal/IContextData.cs
rename to src/Glimpse.Common.Core/Platform/IContextData.cs
index 581b0a0e..62ce6de0 100644
--- a/src/Glimpse.Common/Internal/IContextData.cs
+++ b/src/Glimpse.Common.Core/Platform/IContextData.cs
@@ -1,6 +1,4 @@
-using System;
-
-namespace Glimpse.Internal
+namespace Glimpse.Platform
{
public interface IContextData
{
diff --git a/src/Glimpse.Common/Initialization/IExtensionProvider.cs b/src/Glimpse.Common.Core/Platform/IExtensionProvider.cs
similarity index 83%
rename from src/Glimpse.Common/Initialization/IExtensionProvider.cs
rename to src/Glimpse.Common.Core/Platform/IExtensionProvider.cs
index a0eef229..14ccc208 100644
--- a/src/Glimpse.Common/Initialization/IExtensionProvider.cs
+++ b/src/Glimpse.Common.Core/Platform/IExtensionProvider.cs
@@ -1,6 +1,6 @@
using System.Collections.Generic;
-namespace Glimpse.Initialization
+namespace Glimpse.Platform
{
public interface IExtensionProvider
where T : class
diff --git a/src/Glimpse.Common/IGlimpseContextAccessor.cs b/src/Glimpse.Common.Core/Platform/IGlimpseContextAccessor.cs
similarity index 80%
rename from src/Glimpse.Common/IGlimpseContextAccessor.cs
rename to src/Glimpse.Common.Core/Platform/IGlimpseContextAccessor.cs
index 2e18c51d..5a1d653c 100644
--- a/src/Glimpse.Common/IGlimpseContextAccessor.cs
+++ b/src/Glimpse.Common.Core/Platform/IGlimpseContextAccessor.cs
@@ -1,6 +1,6 @@
using System;
-namespace Glimpse.Common
+namespace Glimpse.Platform
{
public interface IGlimpseContextAccessor
{
diff --git a/src/Glimpse.Common/Internal/Reflection/ITypeActivator.cs b/src/Glimpse.Common.Core/Platform/ITypeActivator.cs
similarity index 93%
rename from src/Glimpse.Common/Internal/Reflection/ITypeActivator.cs
rename to src/Glimpse.Common.Core/Platform/ITypeActivator.cs
index d80490a3..aa9e8ae0 100644
--- a/src/Glimpse.Common/Internal/Reflection/ITypeActivator.cs
+++ b/src/Glimpse.Common.Core/Platform/ITypeActivator.cs
@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Reflection;
-namespace Glimpse.Internal
+namespace Glimpse.Platform
{
public interface ITypeActivator
{
diff --git a/src/Glimpse.Common/Internal/Reflection/ITypeSelector.cs b/src/Glimpse.Common.Core/Platform/ITypeSelector.cs
similarity index 89%
rename from src/Glimpse.Common/Internal/Reflection/ITypeSelector.cs
rename to src/Glimpse.Common.Core/Platform/ITypeSelector.cs
index 3c83dcfc..376c913f 100644
--- a/src/Glimpse.Common/Internal/Reflection/ITypeSelector.cs
+++ b/src/Glimpse.Common.Core/Platform/ITypeSelector.cs
@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Reflection;
-namespace Glimpse.Internal
+namespace Glimpse.Platform
{
public interface ITypeSelector
{
diff --git a/src/Glimpse.Common/Internal/Reflection/ITypeService.cs b/src/Glimpse.Common.Core/Platform/ITypeService.cs
similarity index 97%
rename from src/Glimpse.Common/Internal/Reflection/ITypeService.cs
rename to src/Glimpse.Common.Core/Platform/ITypeService.cs
index 433849bf..6f92c43c 100644
--- a/src/Glimpse.Common/Internal/Reflection/ITypeService.cs
+++ b/src/Glimpse.Common.Core/Platform/ITypeService.cs
@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Reflection;
-namespace Glimpse.Internal
+namespace Glimpse.Platform
{
public interface ITypeService
{
diff --git a/src/Glimpse.Common/project.json b/src/Glimpse.Common.Core/project.json
similarity index 59%
rename from src/Glimpse.Common/project.json
rename to src/Glimpse.Common.Core/project.json
index 40d0ca02..7a99a0a7 100644
--- a/src/Glimpse.Common/project.json
+++ b/src/Glimpse.Common.Core/project.json
@@ -11,29 +11,24 @@
"summary": "Glimpse.Common contains common Glimpse interfaces and components, and is not intended for direct consumption.",
"releaseNotes": "Initial release of Glimpse.Common.",
"tags": [ "ASP.NET", "Web", "Debugging", "Diagnostics" ],
-
"dependencies": {
- "Microsoft.AspNet.Http.Abstractions": "1.0.0-rc1-final",
- "Microsoft.Extensions.DependencyInjection": "1.0.0-rc1-final",
- "Microsoft.Extensions.Logging": "1.0.0-rc1-final",
- "Microsoft.Extensions.OptionsModel": "1.0.0-rc1-final",
- "Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc1-final",
+ "Microsoft.AspNet.Http.Abstractions": "1.0.0-*",
+ "Microsoft.Extensions.DependencyInjection": "1.0.0-*",
+ "Microsoft.Extensions.Logging": "1.0.0-*",
+ "Microsoft.Extensions.Options": "1.0.0-*",
"Newtonsoft.Json": "6.0.6",
"Rx-Linq": "2.2.5",
"Rx-PlatformServices": "2.2.5"
},
"frameworks": {
- "net451": {
- "dependencies": {
- }
- },
+ "net451": { },
"dotnet5.4": {
"dependencies": {
- "System.ObjectModel": "4.0.11-beta-23516",
- "System.Runtime": "4.0.21-beta-23516",
- "System.Security.Cryptography.Algorithms": "4.0.0-beta-23516",
- "System.Text.RegularExpressions": "4.0.11-beta-23516",
- "System.Threading": "4.0.11-beta-23516"
+ "System.ObjectModel": "4.0.12-*",
+ "System.Runtime": "4.1.0-*",
+ "System.Security.Cryptography.Algorithms": "4.0.0-*",
+ "System.Text.RegularExpressions": "4.0.12-*",
+ "System.Threading": "4.0.11-*"
}
}
}
diff --git a/src/Glimpse.Common/ApplicationBuilderExtensions.cs b/src/Glimpse.Common.Dnx/Builder/GlimpseApplicationBuilderExtensions.cs
similarity index 83%
rename from src/Glimpse.Common/ApplicationBuilderExtensions.cs
rename to src/Glimpse.Common.Dnx/Builder/GlimpseApplicationBuilderExtensions.cs
index 42dfe808..65c88ced 100644
--- a/src/Glimpse.Common/ApplicationBuilderExtensions.cs
+++ b/src/Glimpse.Common.Dnx/Builder/GlimpseApplicationBuilderExtensions.cs
@@ -1,11 +1,12 @@
using Glimpse.Common.Initialization;
using Glimpse.Initialization;
+using Glimpse.Platform;
using Microsoft.AspNet.Builder;
using Microsoft.Extensions.DependencyInjection;
-namespace Glimpse
+namespace Microsoft.AspNet.Builder
{
- public static class ApplicationBuilderExtensions
+ public static class GlimpseApplicationBuilderExtensions
{
public static IApplicationBuilder UseGlimpse(this IApplicationBuilder appBuilder)
{
@@ -19,4 +20,4 @@ public static IApplicationBuilder UseGlimpse(this IApplicationBuilder appBuilder
return appBuilder;
}
}
-}
+}
\ No newline at end of file
diff --git a/src/Glimpse.Common.Dnx/DependencyInjection/GlimpseDnxServiceCollectionExtensions.cs b/src/Glimpse.Common.Dnx/DependencyInjection/GlimpseDnxServiceCollectionExtensions.cs
new file mode 100644
index 00000000..00cd7485
--- /dev/null
+++ b/src/Glimpse.Common.Dnx/DependencyInjection/GlimpseDnxServiceCollectionExtensions.cs
@@ -0,0 +1,32 @@
+using Glimpse.Common.Initialization;
+using Glimpse.Platform;
+using Microsoft.AspNet.Http;
+using Microsoft.AspNet.Http.Internal;
+using Microsoft.Extensions.DependencyInjection.Extensions;
+using Microsoft.Extensions.PlatformAbstractions;
+
+namespace Microsoft.Extensions.DependencyInjection
+{
+ public static class GlimpseDnxServiceCollectionExtensions
+ {
+ public static IGlimpseBuilder AddGlimpse(this IServiceCollection services)
+ {
+ return services.AddGlimpse(true);
+ }
+
+ public static IGlimpseBuilder AddGlimpse(this IServiceCollection services, bool autoRegisterComponents)
+ {
+ //
+ // Platform
+ //
+ services.AddSingleton(DnxPlatformServices.Default.AssemblyLoadContextAccessor);
+ services.AddSingleton(DnxPlatformServices.Default.AssemblyLoaderContainer);
+ services.AddSingleton(DnxPlatformServices.Default.LibraryManager);
+ services.TryAddSingleton();
+ services.AddTransient();
+ services.AddSingleton, DefaultExtensionProvider>();
+
+ return (IGlimpseBuilder)services.AddGlimpseCore(autoRegisterComponents);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Glimpse.Common.Dnx/Glimpse.Common.Dnx.xproj b/src/Glimpse.Common.Dnx/Glimpse.Common.Dnx.xproj
new file mode 100644
index 00000000..8110a161
--- /dev/null
+++ b/src/Glimpse.Common.Dnx/Glimpse.Common.Dnx.xproj
@@ -0,0 +1,20 @@
+
+
+
+ 14.0
+ $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
+
+
+
+
+ a55a56e3-e96d-4771-90cc-ebeba98f8233
+ Glimpse.Common.Dnx
+ ..\..\artifacts\obj\$(MSBuildProjectName)
+ ..\..\artifacts\bin\$(MSBuildProjectName)\
+
+
+
+ 2.0
+
+
+
diff --git a/src/Glimpse.Common/Initialization/IRegisterMiddleware.cs b/src/Glimpse.Common.Dnx/Initialization/IRegisterMiddleware.cs
similarity index 98%
rename from src/Glimpse.Common/Initialization/IRegisterMiddleware.cs
rename to src/Glimpse.Common.Dnx/Initialization/IRegisterMiddleware.cs
index c961d6bc..cfa3628f 100644
--- a/src/Glimpse.Common/Initialization/IRegisterMiddleware.cs
+++ b/src/Glimpse.Common.Dnx/Initialization/IRegisterMiddleware.cs
@@ -6,4 +6,4 @@ public interface IRegisterMiddleware
{
void RegisterMiddleware(IApplicationBuilder appBuilder);
}
-}
+}
\ No newline at end of file
diff --git a/src/Glimpse.Common/Internal/Reflection/DefaultAssemblyProvider.cs b/src/Glimpse.Common.Dnx/Platform/LibraryManagerAssemblyProvider.cs
similarity index 78%
rename from src/Glimpse.Common/Internal/Reflection/DefaultAssemblyProvider.cs
rename to src/Glimpse.Common.Dnx/Platform/LibraryManagerAssemblyProvider.cs
index adfa6fec..7f3ae79b 100644
--- a/src/Glimpse.Common/Internal/Reflection/DefaultAssemblyProvider.cs
+++ b/src/Glimpse.Common.Dnx/Platform/LibraryManagerAssemblyProvider.cs
@@ -3,13 +3,13 @@
using System.Linq;
using System.Reflection;
-namespace Glimpse.Internal
+namespace Glimpse.Platform
{
- public class DefaultAssemblyProvider : IAssemblyProvider
+ public class LibraryManagerAssemblyProvider : IAssemblyProvider
{
private readonly ILibraryManager _manager;
- public DefaultAssemblyProvider(ILibraryManager manager)
+ public LibraryManagerAssemblyProvider(ILibraryManager manager)
{
_manager = manager;
}
diff --git a/src/Glimpse.Common.Dnx/Properties/AssemblyInfo.cs b/src/Glimpse.Common.Dnx/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..d5b1fee5
--- /dev/null
+++ b/src/Glimpse.Common.Dnx/Properties/AssemblyInfo.cs
@@ -0,0 +1,23 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Glimpse.Common.Dnx")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Glimpse.Common.Dnx")]
+[assembly: AssemblyCopyright("Copyright © 2015")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("a55a56e3-e96d-4771-90cc-ebeba98f8233")]
diff --git a/src/Glimpse.Common.Dnx/project.json b/src/Glimpse.Common.Dnx/project.json
new file mode 100644
index 00000000..cb064f92
--- /dev/null
+++ b/src/Glimpse.Common.Dnx/project.json
@@ -0,0 +1,24 @@
+{
+ "version": "2.0.0-*",
+ "authors": [ "nmolnar", "avanderhoorn" ],
+ "owners": [ "nmolnar", "avanderhoorn" ],
+ "title": "Glimpse Common",
+ "licenseUrl": "https://github.com/Glimpse/Glimpse.Prototype/blob/dev/LICENSE.txt",
+ "projectUrl": "http://getglimpse.com",
+ "iconUrl": "http://getglimpse.com/content/glimpse100.png",
+ "requireLicenseAcceptance": false,
+ "description": "This package contains common Glimpse interfaces and components, and is not intended for direct consumption.",
+ "summary": "Glimpse.Common contains common Glimpse interfaces and components, and is not intended for direct consumption.",
+ "releaseNotes": "Initial release of Glimpse.Common.",
+ "tags": [ "ASP.NET", "Web", "Debugging", "Diagnostics" ],
+ "dependencies": {
+ "Glimpse.Common.Core": "",
+ "Microsoft.AspNet.Http": "1.0.0-*",
+ "Microsoft.Extensions.PlatformAbstractions": "1.0.0-*",
+ "Microsoft.Extensions.PlatformAbstractions.Dnx": "1.0.0-*"
+ },
+ "frameworks": {
+ "net451": { },
+ "dotnet5.4": { }
+ }
+}
\ No newline at end of file
diff --git a/src/Glimpse.Common.SystemWeb/DependencyInjection/GlimpseSystemWebServiceCollectionExtensions.cs b/src/Glimpse.Common.SystemWeb/DependencyInjection/GlimpseSystemWebServiceCollectionExtensions.cs
new file mode 100644
index 00000000..011c5012
--- /dev/null
+++ b/src/Glimpse.Common.SystemWeb/DependencyInjection/GlimpseSystemWebServiceCollectionExtensions.cs
@@ -0,0 +1,22 @@
+using Glimpse.Platform;
+
+namespace Microsoft.Extensions.DependencyInjection
+{
+ public static class GlimpseSystemWebServiceCollectionExtensions
+ {
+ public static IGlimpseBuilder AddGlimpse(this IServiceCollection services)
+ {
+ return services.AddGlimpse(true);
+ }
+
+ public static IGlimpseBuilder AddGlimpse(this IServiceCollection services, bool autoRegisterComponents)
+ {
+ //
+ // Discovery & Reflection.
+ //
+ services.AddTransient();
+
+ return (IGlimpseBuilder)services.AddGlimpseCore(autoRegisterComponents);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Glimpse.Common.SystemWeb/Glimpse.Common.SystemWeb.xproj b/src/Glimpse.Common.SystemWeb/Glimpse.Common.SystemWeb.xproj
new file mode 100644
index 00000000..fc1db649
--- /dev/null
+++ b/src/Glimpse.Common.SystemWeb/Glimpse.Common.SystemWeb.xproj
@@ -0,0 +1,21 @@
+
+
+
+ 14.0
+ $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
+
+
+
+ 4fc0ba37-9de2-4c18-8a46-ec68f9fbc92d
+ Glimpse.Common.SystemWeb
+ ..\..\artifacts\obj\$(MSBuildProjectName)
+ ..\..\artifacts\bin\$(MSBuildProjectName)\
+
+
+ 2.0
+
+
+ True
+
+
+
\ No newline at end of file
diff --git a/src/Glimpse.Common.SystemWeb/Glimpse.cs b/src/Glimpse.Common.SystemWeb/Glimpse.cs
new file mode 100644
index 00000000..25d4991f
--- /dev/null
+++ b/src/Glimpse.Common.SystemWeb/Glimpse.cs
@@ -0,0 +1,26 @@
+using Microsoft.Extensions.DependencyInjection;
+
+namespace Glimpse
+{
+ public static class Glimpse
+ {
+ public static IGlimpseBuilder Start()
+ {
+ return Start(new ServiceCollection());
+ }
+
+ public static IGlimpseBuilder Start(IServiceCollection serviceProvider)
+ {
+ return serviceProvider.AddGlimpse();
+ }
+ public static IGlimpseBuilder Start(bool autoRegisterComponents)
+ {
+ return Start(new ServiceCollection(), autoRegisterComponents);
+ }
+
+ public static IGlimpseBuilder Start(IServiceCollection serviceProvider, bool autoRegisterComponents)
+ {
+ return serviceProvider.AddGlimpse(autoRegisterComponents);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Glimpse.Common.SystemWeb/Platform/AppDomainAssemblyBlackList.cs b/src/Glimpse.Common.SystemWeb/Platform/AppDomainAssemblyBlackList.cs
new file mode 100644
index 00000000..f31fbbe7
--- /dev/null
+++ b/src/Glimpse.Common.SystemWeb/Platform/AppDomainAssemblyBlackList.cs
@@ -0,0 +1,104 @@
+using System.Collections.Generic;
+using System.Reflection;
+
+namespace Glimpse.Platform
+{
+ public static class AppDomainAssemblyBlackList
+ {
+ private readonly static HashSet BlackList = new HashSet();
+
+ static AppDomainAssemblyBlackList()
+ {
+ BlackList.Add("mscorlib");
+ BlackList.Add("System.Web");
+ BlackList.Add("System");
+ BlackList.Add("System.Core");
+ BlackList.Add("System.Web.ApplicationServices");
+ BlackList.Add("System.Configuration");
+ BlackList.Add("System.Xml");
+ BlackList.Add("System.Runtime.Caching");
+ BlackList.Add("Microsoft.Build.Utilities.v4.0");
+ BlackList.Add("Microsoft.JScript");
+ BlackList.Add("Microsoft.CSharp");
+ BlackList.Add("System.Data");
+ BlackList.Add("System.Web.Services");
+ BlackList.Add("System.Drawing");
+ BlackList.Add("System.EnterpriseServices");
+ BlackList.Add("System.IdentityModel");
+ BlackList.Add("System.Runtime.Serialization");
+ BlackList.Add("System.ServiceModel");
+ BlackList.Add("System.ServiceModel.Activation");
+ BlackList.Add("System.ServiceModel.Web");
+ BlackList.Add("System.Activities");
+ BlackList.Add("System.ServiceModel.Activities");
+ BlackList.Add("System.WorkflowServices");
+ BlackList.Add("System.Web.Extensions");
+ BlackList.Add("System.Data.DataSetExtensions");
+ BlackList.Add("System.Xml.Linq");
+ BlackList.Add("System.ComponentModel.DataAnnotations");
+ BlackList.Add("System.Web.DynamicData");
+ BlackList.Add("AntiXssLibrary");
+ BlackList.Add("Antlr3.Runtime");
+ BlackList.Add("Antlr4.StringTemplate");
+ BlackList.Add("Castle.Core");
+ BlackList.Add("DotNetOpenAuth.AspNet");
+ BlackList.Add("DotNetOpenAuth.Core");
+ BlackList.Add("DotNetOpenAuth.OAuth.Consumer");
+ BlackList.Add("DotNetOpenAuth.OAuth");
+ BlackList.Add("DotNetOpenAuth.OpenId");
+ BlackList.Add("DotNetOpenAuth.OpenId.RelyingParty");
+ BlackList.Add("EntityFramework");
+ BlackList.Add("EntityFramework.SqlServer");
+ BlackList.Add("Microsoft.Web.Infrastructure");
+ BlackList.Add("Microsoft.Web.WebPages.OAuth");
+ BlackList.Add("Mono.Math");
+ BlackList.Add("Newtonsoft.Json");
+ BlackList.Add("NLog");
+ BlackList.Add("Org.Mentalis.Security.Cryptography");
+ BlackList.Add("System.Net.Http");
+ BlackList.Add("System.Net.Http.Formatting");
+ BlackList.Add("System.Net.Http.WebRequest");
+ BlackList.Add("System.Web.Helpers");
+ BlackList.Add("System.Web.Http");
+ BlackList.Add("System.Web.Http.WebHost");
+ BlackList.Add("System.Web.Mvc");
+ BlackList.Add("System.Web.Optimization");
+ BlackList.Add("System.Web.Razor");
+ BlackList.Add("System.Web.WebPages.Deployment");
+ BlackList.Add("System.Web.WebPages");
+ BlackList.Add("System.Web.WebPages.Razor");
+ BlackList.Add("Tavis.UriTemplates");
+ BlackList.Add("WebGrease");
+ BlackList.Add("WebMatrix.Data");
+ BlackList.Add("WebMatrix.WebData");
+ BlackList.Add("Microsoft.VisualStudio.Web.PageInspector.Loader");
+ BlackList.Add("Microsoft.VisualStudio.Web.PageInspector.Runtime");
+ BlackList.Add("Microsoft.VisualStudio.Web.PageInspector.Tracing");
+ BlackList.Add("System.Xaml");
+ BlackList.Add("System.Numerics");
+ BlackList.Add("System.Data.OracleClient");
+ BlackList.Add("System.Data.SqlServerCe");
+ BlackList.Add("System.Web.RegularExpressions");
+ BlackList.Add("System.Data.Services.Design");
+ BlackList.Add("System.Windows.Forms");
+ BlackList.Add("System.ServiceModel.Internals");
+ BlackList.Add("System.Workflow.ComponentModel");
+ BlackList.Add("System.Workflow.Activities");
+ BlackList.Add("System.Workflow.Runtime");
+ BlackList.Add("System.Data.Linq");
+ BlackList.Add("System.Transactions");
+ BlackList.Add("System.Data.SqlXml");
+ BlackList.Add("Microsoft.Build.Framework");
+ BlackList.Add("System.Xaml.Hosting");
+ BlackList.Add("Microsoft.VisualBasic.Activities.Compiler");
+ BlackList.Add("System.Runtime.DurableInstancing");
+ BlackList.Add("System.Security");
+ BlackList.Add("System.Dynamic");
+ }
+
+ public static bool IsBlackListed(Assembly assembly)
+ {
+ return BlackList.Contains(assembly.GetName().Name);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Glimpse.Common.SystemWeb/Platform/AppDomainAssemblyProvider.cs b/src/Glimpse.Common.SystemWeb/Platform/AppDomainAssemblyProvider.cs
new file mode 100644
index 00000000..9fea135f
--- /dev/null
+++ b/src/Glimpse.Common.SystemWeb/Platform/AppDomainAssemblyProvider.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+
+namespace Glimpse.Platform
+{
+ public class AppDomainAssemblyProvider : IAssemblyProvider
+ {
+ public IEnumerable GetCandidateAssemblies(string coreLibrary)
+ {
+ return AppDomain.CurrentDomain.GetAssemblies().Where(x => !AppDomainAssemblyBlackList.IsBlackListed(x));
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Glimpse.Common.SystemWeb/Properties/AssemblyInfo.cs b/src/Glimpse.Common.SystemWeb/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..ce8cad59
--- /dev/null
+++ b/src/Glimpse.Common.SystemWeb/Properties/AssemblyInfo.cs
@@ -0,0 +1,23 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Glimpse.Common.SystemWeb")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Glimpse.Common.SystemWeb")]
+[assembly: AssemblyCopyright("Copyright © 2015")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("4fc0ba37-9de2-4c18-8a46-ec68f9fbc92d")]
diff --git a/src/Glimpse.Common.SystemWeb/project.json b/src/Glimpse.Common.SystemWeb/project.json
new file mode 100644
index 00000000..5a94070f
--- /dev/null
+++ b/src/Glimpse.Common.SystemWeb/project.json
@@ -0,0 +1,20 @@
+{
+ "version": "2.0.0-*",
+ "authors": [ "nmolnar", "avanderhoorn" ],
+ "owners": [ "nmolnar", "avanderhoorn" ],
+ "title": "Glimpse Common",
+ "licenseUrl": "https://github.com/Glimpse/Glimpse.Prototype/blob/dev/LICENSE.txt",
+ "projectUrl": "http://getglimpse.com",
+ "iconUrl": "http://getglimpse.com/content/glimpse100.png",
+ "requireLicenseAcceptance": false,
+ "description": "This package contains common Glimpse interfaces and components, and is not intended for direct consumption.",
+ "summary": "Glimpse.Common contains common Glimpse interfaces and components, and is not intended for direct consumption.",
+ "releaseNotes": "Initial release of Glimpse.Common.",
+ "tags": [ "ASP.NET", "Web", "Debugging", "Diagnostics" ],
+ "dependencies": {
+ "Glimpse.Common.Core": ""
+ },
+ "frameworks": {
+ "net451": { }
+ }
+}
\ No newline at end of file
diff --git a/src/Glimpse.Common/GlimpseOptions.cs b/src/Glimpse.Common/GlimpseOptions.cs
deleted file mode 100644
index 9ac66c42..00000000
--- a/src/Glimpse.Common/GlimpseOptions.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using System;
-
-namespace Glimpse
-{
- public class GlimpseOptions
- {
-
- }
-}
\ No newline at end of file
diff --git a/src/Glimpse.Common/GlimpseServiceCollectionBuilder.cs b/src/Glimpse.Common/GlimpseServiceCollectionBuilder.cs
deleted file mode 100644
index 031cd006..00000000
--- a/src/Glimpse.Common/GlimpseServiceCollectionBuilder.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using Glimpse.Internal;
-using Microsoft.Extensions.DependencyInjection;
-
-namespace Glimpse
-{
- public class GlimpseServiceCollectionBuilder : ServiceCollectionWrapper
- {
- public GlimpseServiceCollectionBuilder(IServiceCollection innerCollection)
- : base(innerCollection)
- {
- }
- }
-}
\ No newline at end of file
diff --git a/src/Glimpse.Common/GlimpseServiceCollectionExtensions.cs b/src/Glimpse.Common/GlimpseServiceCollectionExtensions.cs
deleted file mode 100644
index 4b08ed6c..00000000
--- a/src/Glimpse.Common/GlimpseServiceCollectionExtensions.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-using Glimpse.Common.Initialization;
-using Glimpse.Initialization;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.DependencyInjection.Extensions;
-
-namespace Glimpse
-{
- public static class GlimpseServiceCollectionExtensions
- {
- public static GlimpseServiceCollectionBuilder AddGlimpse(this IServiceCollection services)
- {
- services.TryAdd(GlimpseServices.GetDefaultServices());
-
- var extensionProvider = services.BuildServiceProvider().GetService>();
-
- var glimpseServiceCollectionBuilder = new GlimpseServiceCollectionBuilder(services);
-
- foreach (var registration in extensionProvider.Instances)
- {
- registration.RegisterServices(glimpseServiceCollectionBuilder);
- }
-
- return glimpseServiceCollectionBuilder;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Glimpse.Common/GlimpseServices.cs b/src/Glimpse.Common/GlimpseServices.cs
deleted file mode 100644
index b59d43d8..00000000
--- a/src/Glimpse.Common/GlimpseServices.cs
+++ /dev/null
@@ -1,45 +0,0 @@
-using System.Collections.Generic;
-using Glimpse.Common;
-using Glimpse.Common.Initialization;
-using Glimpse.Common.Internal.Serialization;
-using Glimpse.Initialization;
-using Microsoft.Extensions.DependencyInjection;
-using Glimpse.Internal;
-using Newtonsoft.Json;
-
-namespace Glimpse
-{
- public class GlimpseServices
- {
- public static IEnumerable GetDefaultServices()
- {
- var services = new ServiceCollection();
-
- //
- // Discovery & Reflection.
- //
- services.AddTransient();
- services.AddTransient();
- services.AddTransient();
- services.AddTransient();
- // TODO: consider making above singleton
-
- services.AddSingleton, DefaultExtensionProvider>();
- services.AddSingleton, DefaultExtensionProvider>();
-
- //
- // Context.
- //
- services.AddSingleton(typeof(IContextData<>), typeof(ContextData<>));
- services.AddSingleton();
-
- //
- // JSON.Net.
- //
- services.AddTransient();
- services.AddSingleton();
-
- return services;
- }
- }
-}
\ No newline at end of file
diff --git a/src/Glimpse.Common/Initialization/IRegisterServices.cs b/src/Glimpse.Common/Initialization/IRegisterServices.cs
deleted file mode 100644
index 7c8b1c51..00000000
--- a/src/Glimpse.Common/Initialization/IRegisterServices.cs
+++ /dev/null
@@ -1,7 +0,0 @@
-namespace Glimpse.Common.Initialization
-{
- public interface IRegisterServices
- {
- void RegisterServices(GlimpseServiceCollectionBuilder services);
- }
-}
diff --git a/src/Glimpse.Common/Initialization/StartupOptions.cs b/src/Glimpse.Common/Initialization/StartupOptions.cs
deleted file mode 100644
index 1a766ca2..00000000
--- a/src/Glimpse.Common/Initialization/StartupOptions.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-using Microsoft.AspNet.Builder;
-
-namespace Glimpse.Initialization
-{
- public class StartupOptions : IStartupOptions
- {
- public StartupOptions(IApplicationBuilder builder)
- {
- Builder = builder;
- }
-
- private IApplicationBuilder Builder { get; }
-
- public IServiceProvider ApplicationServices => Builder.ApplicationServices;
- }
-}
\ No newline at end of file
diff --git a/src/Glimpse.Common/Internal/ServiceCollectionWrapper.cs b/src/Glimpse.Common/Internal/ServiceCollectionWrapper.cs
deleted file mode 100644
index 11c1d15a..00000000
--- a/src/Glimpse.Common/Internal/ServiceCollectionWrapper.cs
+++ /dev/null
@@ -1,95 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using Microsoft.Extensions.DependencyInjection;
-
-namespace Glimpse.Internal
-{
- public class ServiceCollectionWrapper : IServiceCollection
- {
- private readonly IServiceCollection _innerCollection;
-
- public ServiceCollectionWrapper(IServiceCollection innerCollection)
- {
- _innerCollection = innerCollection;
- }
-
- public IEnumerator GetEnumerator()
- {
- return _innerCollection.GetEnumerator();
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
-
- /*
- public IServiceCollection Add(ServiceDescriptor descriptor)
- {
- _innerCollection.Add(descriptor);
- return this;
- }
-
- public IServiceCollection Add(IEnumerable descriptors)
- {
- _innerCollection.Add(descriptors);
- return this;
- }
- */
- public void Add(ServiceDescriptor item)
- {
- _innerCollection.Add(item);
- }
-
- public void Clear()
- {
- _innerCollection.Clear();
- }
-
- public bool Contains(ServiceDescriptor item)
- {
- return _innerCollection.Contains(item);
- }
-
- public void CopyTo(ServiceDescriptor[] array, int arrayIndex)
- {
- _innerCollection.CopyTo(array, arrayIndex);
- }
-
- public bool Remove(ServiceDescriptor item)
- {
- return _innerCollection.Remove(item);
- }
-
- public int Count
- {
- get { return _innerCollection.Count; }
- }
-
- public bool IsReadOnly
- {
- get { return _innerCollection.IsReadOnly; }
- }
-
- public int IndexOf(ServiceDescriptor item)
- {
- return _innerCollection.IndexOf(item);
- }
-
- public void Insert(int index, ServiceDescriptor item)
- {
- _innerCollection.Insert(index, item);
- }
-
- public void RemoveAt(int index)
- {
- _innerCollection.RemoveAt(index);
- }
-
- public ServiceDescriptor this[int index]
- {
- get { return _innerCollection[index]; }
- set { _innerCollection[index] = value; }
- }
- }
-}
\ No newline at end of file
diff --git a/src/Glimpse.Server/Configuration/AllowAgentAccessOptions.cs b/src/Glimpse.Server.Core/Configuration/AllowAgentAccessOptions.cs
similarity index 93%
rename from src/Glimpse.Server/Configuration/AllowAgentAccessOptions.cs
rename to src/Glimpse.Server.Core/Configuration/AllowAgentAccessOptions.cs
index 40a7a82b..1ff2817e 100644
--- a/src/Glimpse.Server/Configuration/AllowAgentAccessOptions.cs
+++ b/src/Glimpse.Server.Core/Configuration/AllowAgentAccessOptions.cs
@@ -1,7 +1,7 @@
using System;
using Glimpse.Server;
using Microsoft.AspNet.Http;
-using Microsoft.Extensions.OptionsModel;
+using Microsoft.Extensions.Options;
namespace Glimpse.Server.Configuration
{
@@ -19,4 +19,4 @@ public bool AllowAgent(HttpContext context)
return _allowAgentAccess != null ? _allowAgentAccess(context) : true;
}
}
-}
+}
\ No newline at end of file
diff --git a/src/Glimpse.Server/Configuration/AllowClientAccessOptions.cs b/src/Glimpse.Server.Core/Configuration/AllowClientAccessOptions.cs
similarity index 92%
rename from src/Glimpse.Server/Configuration/AllowClientAccessOptions.cs
rename to src/Glimpse.Server.Core/Configuration/AllowClientAccessOptions.cs
index 1c66c0ed..31c62311 100644
--- a/src/Glimpse.Server/Configuration/AllowClientAccessOptions.cs
+++ b/src/Glimpse.Server.Core/Configuration/AllowClientAccessOptions.cs
@@ -1,7 +1,7 @@
using System;
using Glimpse.Server;
using Microsoft.AspNet.Http;
-using Microsoft.Extensions.OptionsModel;
+using Microsoft.Extensions.Options;
namespace Glimpse.Server.Configuration
{
@@ -19,4 +19,4 @@ public bool AllowUser(HttpContext context)
return _allowAccess != null ? _allowAccess(context) : true;
}
}
-}
+}
\ No newline at end of file
diff --git a/src/Glimpse.Server/Configuration/AllowClientAccessRemote.cs b/src/Glimpse.Server.Core/Configuration/AllowClientAccessRemote.cs
similarity index 80%
rename from src/Glimpse.Server/Configuration/AllowClientAccessRemote.cs
rename to src/Glimpse.Server.Core/Configuration/AllowClientAccessRemote.cs
index 653b7a51..322511ab 100644
--- a/src/Glimpse.Server/Configuration/AllowClientAccessRemote.cs
+++ b/src/Glimpse.Server.Core/Configuration/AllowClientAccessRemote.cs
@@ -15,7 +15,7 @@ public AllowClientAccessRemote(IAllowRemoteProvider allowRemoteProvider)
public bool AllowUser(HttpContext context)
{
var connectionFeature = context.Features.Get();
- return _allowRemoteProvider.AllowRemote || (connectionFeature != null && connectionFeature.IsLocal);
+ return _allowRemoteProvider.AllowRemote; // || (connectionFeature != null && connectionFeature.IsLocal); Is Local went away.
}
}
}
\ No newline at end of file
diff --git a/src/Glimpse.Server/Configuration/DefaultAllowRemoteProvider.cs b/src/Glimpse.Server.Core/Configuration/DefaultAllowRemoteProvider.cs
similarity index 90%
rename from src/Glimpse.Server/Configuration/DefaultAllowRemoteProvider.cs
rename to src/Glimpse.Server.Core/Configuration/DefaultAllowRemoteProvider.cs
index 6eb6b9d4..120ad33b 100644
--- a/src/Glimpse.Server/Configuration/DefaultAllowRemoteProvider.cs
+++ b/src/Glimpse.Server.Core/Configuration/DefaultAllowRemoteProvider.cs
@@ -1,5 +1,5 @@
using Glimpse.Server;
-using Microsoft.Extensions.OptionsModel;
+using Microsoft.Extensions.Options;
namespace Glimpse.Server.Configuration
{
diff --git a/src/Glimpse.Server/Configuration/DefaultMetadataProvider.cs b/src/Glimpse.Server.Core/Configuration/DefaultMetadataProvider.cs
similarity index 97%
rename from src/Glimpse.Server/Configuration/DefaultMetadataProvider.cs
rename to src/Glimpse.Server.Core/Configuration/DefaultMetadataProvider.cs
index 0bf0aa0b..0e2d8a49 100644
--- a/src/Glimpse.Server/Configuration/DefaultMetadataProvider.cs
+++ b/src/Glimpse.Server.Core/Configuration/DefaultMetadataProvider.cs
@@ -3,7 +3,7 @@
using Glimpse.Server.Internal;
using Glimpse.Internal.Extensions;
using Microsoft.AspNet.Http;
-using Microsoft.Extensions.OptionsModel;
+using Microsoft.Extensions.Options;
namespace Glimpse.Server.Configuration
{
diff --git a/src/Glimpse.Server/Configuration/DefaultResourceOptionsProvider.cs b/src/Glimpse.Server.Core/Configuration/DefaultResourceOptionsProvider.cs
similarity index 98%
rename from src/Glimpse.Server/Configuration/DefaultResourceOptionsProvider.cs
rename to src/Glimpse.Server.Core/Configuration/DefaultResourceOptionsProvider.cs
index 2e9a6403..e54cc921 100644
--- a/src/Glimpse.Server/Configuration/DefaultResourceOptionsProvider.cs
+++ b/src/Glimpse.Server.Core/Configuration/DefaultResourceOptionsProvider.cs
@@ -1,4 +1,5 @@
using System.Collections.Generic;
+using Glimpse.Configuration;
using Glimpse.Initialization;
using Glimpse.Internal.Extensions;
using Glimpse.Server.Internal.Extensions;
diff --git a/src/Glimpse.Server/Configuration/IAllowAgentAccess.cs b/src/Glimpse.Server.Core/Configuration/IAllowAgentAccess.cs
similarity index 100%
rename from src/Glimpse.Server/Configuration/IAllowAgentAccess.cs
rename to src/Glimpse.Server.Core/Configuration/IAllowAgentAccess.cs
diff --git a/src/Glimpse.Server/Configuration/IAllowClientAccess.cs b/src/Glimpse.Server.Core/Configuration/IAllowClientAccess.cs
similarity index 100%
rename from src/Glimpse.Server/Configuration/IAllowClientAccess.cs
rename to src/Glimpse.Server.Core/Configuration/IAllowClientAccess.cs
diff --git a/src/Glimpse.Server/Configuration/IAllowRemoteProvider.cs b/src/Glimpse.Server.Core/Configuration/IAllowRemoteProvider.cs
similarity index 100%
rename from src/Glimpse.Server/Configuration/IAllowRemoteProvider.cs
rename to src/Glimpse.Server.Core/Configuration/IAllowRemoteProvider.cs
diff --git a/src/Glimpse.Server/Configuration/IMetadataProvider.cs b/src/Glimpse.Server.Core/Configuration/IMetadataProvider.cs
similarity index 100%
rename from src/Glimpse.Server/Configuration/IMetadataProvider.cs
rename to src/Glimpse.Server.Core/Configuration/IMetadataProvider.cs
diff --git a/src/Glimpse.Server/Configuration/Metadata.cs b/src/Glimpse.Server.Core/Configuration/Metadata.cs
similarity index 100%
rename from src/Glimpse.Server/Configuration/Metadata.cs
rename to src/Glimpse.Server.Core/Configuration/Metadata.cs
diff --git a/src/Glimpse.Server/ServerServices.cs b/src/Glimpse.Server.Core/DependencyInjection/ServerRegisterServices.cs
similarity index 67%
rename from src/Glimpse.Server/ServerServices.cs
rename to src/Glimpse.Server.Core/DependencyInjection/ServerRegisterServices.cs
index 3c82af15..9aceb5b9 100644
--- a/src/Glimpse.Server/ServerServices.cs
+++ b/src/Glimpse.Server.Core/DependencyInjection/ServerRegisterServices.cs
@@ -1,20 +1,21 @@
using System.Linq;
-using Glimpse.Common.Initialization;
+using Glimpse.Configuration;
using Glimpse.Initialization;
using Glimpse.Server;
using Glimpse.Server.Configuration;
using Glimpse.Server.Internal;
using Glimpse.Server.Resources;
using Glimpse.Server.Storage;
+using Glimpse.Platform;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
-using Microsoft.Extensions.OptionsModel;
+using Microsoft.Extensions.Options;
-namespace Glimpse
+namespace Glimpse.DependencyInjection
{
- public class ServerServices : IRegisterServices
+ public class ServerRegisterServices : IRegisterServices
{
- public void RegisterServices(GlimpseServiceCollectionBuilder services)
+ public void RegisterServices(IServiceCollection services)
{
services.AddOptions();
@@ -24,7 +25,10 @@ public void RegisterServices(GlimpseServiceCollectionBuilder services)
services.AddSingleton();
services.AddSingleton();
services.AddSingleton();
-
+ services.TryAddSingleton();
+ services.AddSingleton();
+ services.AddSingleton();
+
//
// Options
//
@@ -32,22 +36,13 @@ public void RegisterServices(GlimpseServiceCollectionBuilder services)
services.AddTransient, DefaultExtensionProvider>();
services.AddTransient, DefaultExtensionProvider>();
services.AddTransient, DefaultExtensionProvider>();
- services.AddTransient, DefaultExtensionProvider>();
services.AddSingleton();
services.AddSingleton();
-
- if (!services.Any(s => s.ServiceType == typeof (IMessagePublisher)))
- {
- services.AddSingleton();
- }
-
-
+
+ // this is done as we don't know the order in which things will be defined
if (services.Any(s => s.ServiceType == typeof(IResourceOptionsProvider)))
{
- services.Replace(new ServiceDescriptor(
- typeof(IResourceOptionsProvider),
- typeof(DefaultResourceOptionsProvider),
- ServiceLifetime.Singleton));
+ services.Replace(new ServiceDescriptor(typeof(IResourceOptionsProvider), typeof(DefaultResourceOptionsProvider), ServiceLifetime.Singleton));
}
else
{
diff --git a/src/Glimpse.Server/Glimpse.Server.xproj b/src/Glimpse.Server.Core/Glimpse.Server.Core.xproj
similarity index 89%
rename from src/Glimpse.Server/Glimpse.Server.xproj
rename to src/Glimpse.Server.Core/Glimpse.Server.Core.xproj
index e5fbfcd5..acc8cf54 100644
--- a/src/Glimpse.Server/Glimpse.Server.xproj
+++ b/src/Glimpse.Server.Core/Glimpse.Server.Core.xproj
@@ -4,21 +4,23 @@
14.0
$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
+
c6effa30-9d16-412c-8fd7-c87b909e030e
- Glimpse.Server
+ Glimpse.Server.Core
..\..\artifacts\obj\$(MSBuildProjectName)
..\..\artifacts\bin\$(MSBuildProjectName)\
2.0
-
+
+ True
+
-
\ No newline at end of file
diff --git a/src/Glimpse.Server/GlimpseServerOptions.cs b/src/Glimpse.Server.Core/GlimpseServerOptions.cs
similarity index 100%
rename from src/Glimpse.Server/GlimpseServerOptions.cs
rename to src/Glimpse.Server.Core/GlimpseServerOptions.cs
diff --git a/src/Glimpse.Server/GlimpseServerOptionsSetup.cs b/src/Glimpse.Server.Core/GlimpseServerOptionsSetup.cs
similarity index 92%
rename from src/Glimpse.Server/GlimpseServerOptionsSetup.cs
rename to src/Glimpse.Server.Core/GlimpseServerOptionsSetup.cs
index a1aec8c0..6117a012 100644
--- a/src/Glimpse.Server/GlimpseServerOptionsSetup.cs
+++ b/src/Glimpse.Server.Core/GlimpseServerOptionsSetup.cs
@@ -1,4 +1,4 @@
-using Microsoft.Extensions.OptionsModel;
+using Microsoft.Extensions.Options;
namespace Glimpse.Server
{
diff --git a/src/Glimpse.Server/Internal/Extensions/JsonStringExtensions.cs b/src/Glimpse.Server.Core/Internal/Extensions/JsonStringExtensions.cs
similarity index 100%
rename from src/Glimpse.Server/Internal/Extensions/JsonStringExtensions.cs
rename to src/Glimpse.Server.Core/Internal/Extensions/JsonStringExtensions.cs
diff --git a/src/Glimpse.Server/Internal/Extensions/ParameterExtensions.cs b/src/Glimpse.Server.Core/Internal/Extensions/ParameterExtensions.cs
similarity index 100%
rename from src/Glimpse.Server/Internal/Extensions/ParameterExtensions.cs
rename to src/Glimpse.Server.Core/Internal/Extensions/ParameterExtensions.cs
diff --git a/src/Glimpse.Server/Internal/Extensions/UriTemplateExtensions.cs b/src/Glimpse.Server.Core/Internal/Extensions/UriTemplateExtensions.cs
similarity index 100%
rename from src/Glimpse.Server/Internal/Extensions/UriTemplateExtensions.cs
rename to src/Glimpse.Server.Core/Internal/Extensions/UriTemplateExtensions.cs
diff --git a/src/Glimpse.Server/Internal/IResourceManager.cs b/src/Glimpse.Server.Core/Internal/IResourceManager.cs
similarity index 100%
rename from src/Glimpse.Server/Internal/IResourceManager.cs
rename to src/Glimpse.Server.Core/Internal/IResourceManager.cs
diff --git a/src/Glimpse.Server/Internal/ResourceManager.cs b/src/Glimpse.Server.Core/Internal/ResourceManager.cs
similarity index 99%
rename from src/Glimpse.Server/Internal/ResourceManager.cs
rename to src/Glimpse.Server.Core/Internal/ResourceManager.cs
index 2c7aca53..d399ce52 100644
--- a/src/Glimpse.Server/Internal/ResourceManager.cs
+++ b/src/Glimpse.Server.Core/Internal/ResourceManager.cs
@@ -22,8 +22,9 @@ public void Register(string name, string uriTemplate)
public void Register(string name, string uriTemplate, ResourceType type, Func, Task> resource)
{
- _resourceTable.Add(name, new ResourceManagerItem(name, type, uriTemplate, resource));
Register(name, uriTemplate);
+
+ _resourceTable.Add(name, new ResourceManagerItem(name, type, uriTemplate, resource));
}
public ResourceManagerResult Match(HttpContext context)
diff --git a/src/Glimpse.Server/Internal/ResourceManagerResult.cs b/src/Glimpse.Server.Core/Internal/ResourceManagerResult.cs
similarity index 100%
rename from src/Glimpse.Server/Internal/ResourceManagerResult.cs
rename to src/Glimpse.Server.Core/Internal/ResourceManagerResult.cs
diff --git a/src/Glimpse.Server/Internal/Resources/Embeded/Agent/agent/agent.js b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Agent/agent/agent.js
similarity index 100%
rename from src/Glimpse.Server/Internal/Resources/Embeded/Agent/agent/agent.js
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Agent/agent/agent.js
diff --git a/src/Glimpse.Server/Internal/Resources/Embeded/Client/client/assets/favicon.png b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/client/assets/favicon.png
similarity index 100%
rename from src/Glimpse.Server/Internal/Resources/Embeded/Client/client/assets/favicon.png
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/client/assets/favicon.png
diff --git a/src/Glimpse.Server/Internal/Resources/Embeded/Client/client/assets/logo-long-white.png b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/client/assets/logo-long-white.png
similarity index 100%
rename from src/Glimpse.Server/Internal/Resources/Embeded/Client/client/assets/logo-long-white.png
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/client/assets/logo-long-white.png
diff --git a/src/Glimpse.Server/Internal/Resources/Embeded/Client/client/assets/selawk.woff b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/client/assets/selawk.woff
similarity index 100%
rename from src/Glimpse.Server/Internal/Resources/Embeded/Client/client/assets/selawk.woff
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/client/assets/selawk.woff
diff --git a/src/Glimpse.Server/Internal/Resources/Embeded/Client/client/assets/selawk.woff2 b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/client/assets/selawk.woff2
similarity index 100%
rename from src/Glimpse.Server/Internal/Resources/Embeded/Client/client/assets/selawk.woff2
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/client/assets/selawk.woff2
diff --git a/src/Glimpse.Server/Internal/Resources/Embeded/Client/client/assets/selawkl.woff b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/client/assets/selawkl.woff
similarity index 100%
rename from src/Glimpse.Server/Internal/Resources/Embeded/Client/client/assets/selawkl.woff
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/client/assets/selawkl.woff
diff --git a/src/Glimpse.Server/Internal/Resources/Embeded/Client/client/assets/selawkl.woff2 b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/client/assets/selawkl.woff2
similarity index 100%
rename from src/Glimpse.Server/Internal/Resources/Embeded/Client/client/assets/selawkl.woff2
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/client/assets/selawkl.woff2
diff --git a/src/Glimpse.Server/Internal/Resources/Embeded/Client/client/index.html b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/client/index.html
similarity index 100%
rename from src/Glimpse.Server/Internal/Resources/Embeded/Client/client/index.html
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/client/index.html
diff --git a/src/Glimpse.Server/Internal/Resources/Embeded/Client/client/main.js b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/client/main.js
similarity index 100%
rename from src/Glimpse.Server/Internal/Resources/Embeded/Client/client/main.js
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/client/main.js
diff --git a/src/Glimpse.Server/Internal/Resources/Embeded/Client/client/main.min.js b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/client/main.min.js
similarity index 100%
rename from src/Glimpse.Server/Internal/Resources/Embeded/Client/client/main.min.js
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/client/main.min.js
diff --git a/src/Glimpse.Client.Web.Simple/Diagnostics/index.html b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/diagnostics/index.html
similarity index 100%
rename from src/Glimpse.Client.Web.Simple/Diagnostics/index.html
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/diagnostics/index.html
diff --git a/src/Glimpse.Client.Web.Simple/Diagnostics/scripts/jquery/jquery-2.1.1.js b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/diagnostics/scripts/jquery/jquery-2.1.1.js
similarity index 100%
rename from src/Glimpse.Client.Web.Simple/Diagnostics/scripts/jquery/jquery-2.1.1.js
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/diagnostics/scripts/jquery/jquery-2.1.1.js
diff --git a/src/Glimpse.Client.Web.Simple/Diagnostics/scripts/jquery/jquery-2.1.1.min.js b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/diagnostics/scripts/jquery/jquery-2.1.1.min.js
similarity index 100%
rename from src/Glimpse.Client.Web.Simple/Diagnostics/scripts/jquery/jquery-2.1.1.min.js
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/diagnostics/scripts/jquery/jquery-2.1.1.min.js
diff --git a/src/Glimpse.Client.Web.Simple/Diagnostics/scripts/reactjs/JSXTransformer.js b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/diagnostics/scripts/reactjs/JSXTransformer.js
similarity index 100%
rename from src/Glimpse.Client.Web.Simple/Diagnostics/scripts/reactjs/JSXTransformer.js
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/diagnostics/scripts/reactjs/JSXTransformer.js
diff --git a/src/Glimpse.Client.Web.Simple/Diagnostics/scripts/reactjs/react-with-addons.js b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/diagnostics/scripts/reactjs/react-with-addons.js
similarity index 100%
rename from src/Glimpse.Client.Web.Simple/Diagnostics/scripts/reactjs/react-with-addons.js
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/diagnostics/scripts/reactjs/react-with-addons.js
diff --git a/src/Glimpse.Client.Web.Simple/Diagnostics/scripts/reactjs/react-with-addons.min.js b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/diagnostics/scripts/reactjs/react-with-addons.min.js
similarity index 100%
rename from src/Glimpse.Client.Web.Simple/Diagnostics/scripts/reactjs/react-with-addons.min.js
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/diagnostics/scripts/reactjs/react-with-addons.min.js
diff --git a/src/Glimpse.Client.Web.Simple/Diagnostics/scripts/reactjs/react.js b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/diagnostics/scripts/reactjs/react.js
similarity index 100%
rename from src/Glimpse.Client.Web.Simple/Diagnostics/scripts/reactjs/react.js
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/diagnostics/scripts/reactjs/react.js
diff --git a/src/Glimpse.Client.Web.Simple/Diagnostics/scripts/reactjs/react.min.js b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/diagnostics/scripts/reactjs/react.min.js
similarity index 100%
rename from src/Glimpse.Client.Web.Simple/Diagnostics/scripts/reactjs/react.min.js
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/diagnostics/scripts/reactjs/react.min.js
diff --git a/src/Glimpse.Client.Web.Simple/Diagnostics/scripts/signalr/jquery.signalR-2.2.0.js b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/diagnostics/scripts/signalr/jquery.signalR-2.2.0.js
similarity index 100%
rename from src/Glimpse.Client.Web.Simple/Diagnostics/scripts/signalr/jquery.signalR-2.2.0.js
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/diagnostics/scripts/signalr/jquery.signalR-2.2.0.js
diff --git a/src/Glimpse.Client.Web.Simple/Diagnostics/scripts/signalr/jquery.signalR-2.2.0.min.js b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/diagnostics/scripts/signalr/jquery.signalR-2.2.0.min.js
similarity index 100%
rename from src/Glimpse.Client.Web.Simple/Diagnostics/scripts/signalr/jquery.signalR-2.2.0.min.js
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/diagnostics/scripts/signalr/jquery.signalR-2.2.0.min.js
diff --git a/src/Glimpse.Server/Internal/Resources/Embeded/Client/hud/assets/glimpse-logo.png b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/hud/assets/glimpse-logo.png
similarity index 100%
rename from src/Glimpse.Server/Internal/Resources/Embeded/Client/hud/assets/glimpse-logo.png
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/hud/assets/glimpse-logo.png
diff --git a/src/Glimpse.Server/Internal/Resources/Embeded/Client/hud/assets/selawk.woff b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/hud/assets/selawk.woff
similarity index 100%
rename from src/Glimpse.Server/Internal/Resources/Embeded/Client/hud/assets/selawk.woff
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/hud/assets/selawk.woff
diff --git a/src/Glimpse.Server/Internal/Resources/Embeded/Client/hud/assets/selawk.woff2 b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/hud/assets/selawk.woff2
similarity index 100%
rename from src/Glimpse.Server/Internal/Resources/Embeded/Client/hud/assets/selawk.woff2
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/hud/assets/selawk.woff2
diff --git a/src/Glimpse.Server/Internal/Resources/Embeded/Client/hud/assets/selawkl.woff b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/hud/assets/selawkl.woff
similarity index 100%
rename from src/Glimpse.Server/Internal/Resources/Embeded/Client/hud/assets/selawkl.woff
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/hud/assets/selawkl.woff
diff --git a/src/Glimpse.Server/Internal/Resources/Embeded/Client/hud/assets/selawkl.woff2 b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/hud/assets/selawkl.woff2
similarity index 100%
rename from src/Glimpse.Server/Internal/Resources/Embeded/Client/hud/assets/selawkl.woff2
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/hud/assets/selawkl.woff2
diff --git a/src/Glimpse.Server/Internal/Resources/Embeded/Client/hud/hud.js b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/hud/hud.js
similarity index 98%
rename from src/Glimpse.Server/Internal/Resources/Embeded/Client/hud/hud.js
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/hud/hud.js
index b9463d95..293b78b4 100644
--- a/src/Glimpse.Server/Internal/Resources/Embeded/Client/hud/hud.js
+++ b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/hud/hud.js
@@ -131,7 +131,7 @@
// module
- exports.push([module.id, "@font-face {\n font-family: 'Selawik';\n src: url('/glimpse/hud/assets/selawk.woff2') format('woff2'), url('/glimpse/hud/assets/selawk.woff') format('woff'); }\n\n@font-face {\n font-family: 'Selawik Light';\n src: url('/glimpse/hud/assets/selawkl.woff2') format('woff2'), url('/glimpse/hud/assets/selawkl.woff') format('woff'); }\n\n.glimpse, .glimpse *, .glimpse a, .glimpse td, .glimpse th, .glimpse table {\n font-family: 'Segoe UI', 'Selawik', Tahoma, Geneva, Verdana, sans-serif;\n background-color: transparent;\n border: 0px;\n text-align: left;\n padding: 0;\n margin: 0;\n box-sizing: content-box;\n direction: ltr; }\n\n.glimpse {\n right: 0;\n bottom: 0;\n float: right;\n position: fixed;\n min-width: 1370px;\n -webkit-transform: translatez(0);\n transform: translatez(0);\n z-index: 100000;\n height: 36px; }\n\n.glimpse td, .glimpse span, .glimpse div, .glimpse th {\n color: #fff;\n font-size: 13px;\n line-height: 13px; }\n\n.glimpse table {\n min-width: 0;\n border-collapse: collapse;\n border-spacing: 0;\n width: 100%; }\n\n.glimpse .glimpse-icon {\n background-color: #3c454f;\n margin: 0;\n padding: 0 8px;\n float: right;\n width: 39px;\n background-image: url(/glimpse/hud/assets/glimpse-logo.png);\n background-repeat: no-repeat;\n background-size: 47px 37px;\n height: 36px; }\n\n.glimpse .glimpse-icon-text {\n font-size: 5px;\n color: #3c454f;\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg);\n margin-left: 45px;\n margin-top: 25px; }\n\n.glimpse .glimpse-hud {\n padding: 0 5px 0 0;\n float: right;\n background-color: #3c454f; }\n\n.glimpse .glimpse-hud-section {\n float: left;\n transition: all 0.3s ease;\n border-left: 11px solid #71b1d1;\n position: relative;\n cursor: default;\n height: 37px; }\n\n.glimpse .glimpse-hud-title {\n position: absolute;\n color: white;\n text-transform: uppercase;\n cursor: pointer;\n font-weight: bold;\n height: 100%;\n width: 12px;\n left: -12px; }\n\n.glimpse .glimpse-hud-title span {\n position: absolute;\n line-height: 100%;\n font-size: 9px;\n top: 5px;\n -webkit-transform-origin: 15px 13px;\n transform-origin: 15px 13px;\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg); }\n\n.glimpse .glimpse-hud-section-inner {\n transition: all 0.3s ease;\n max-width: 999px;\n min-width: 0px;\n margin-top: -1px;\n overflow: hidden;\n height: 37px; }\n\n.glimpse .glimpse-hud-section-input {\n display: none !important;\n font-size: 12px; }\n\n.glimpse .glimpse-hud-section-input:checked ~ .glimpse-hud-section-inner, .glimpse .glimpse-hud-section-input:checked ~ .glimpse-hud-popup-expander {\n max-width: 0px;\n overflow: hidden; }\n\n.glimpse .glimpse-hud-section-input:checked ~ .glimpse-hud-popup {\n max-height: 0px;\n overflow: hidden; }\n\n.glimpse .glimpse-hud-detail {\n display: inline-block;\n padding: 1px 10px 0; }\n\n.glimpse .glimpse-hud-section-inner .glimpse-hud-detail:first-child {\n padding-left: 15px; }\n\n.glimpse .glimpse-hud-section-inner .glimpse-hud-detail:last-child {\n padding-right: 20px; }\n\n.glimpse .glimpse-hud-data {\n transition: color 0.3s ease; }\n\n.glimpse .glimpse-hud-data-important {\n font-size: 1.2em;\n font-weight: bold; }\n\n.glimpse .glimpse-hud-value-update {\n color: #71b1d1; }\n\n.glimpse .glimpse-hud-detail-align-right .glimpse-hud-header {\n text-align: right; }\n\n.glimpse .glimpse-hud-detail-extra-large, .glimpse-hud-detail-extra-large span {\n font-size: 2em;\n line-height: 100%; }\n\n.glimpse .glimpse-hud-detail-large, .glimpse-hud-detail-large span {\n font-size: 1.45em;\n line-height: 100%; }\n\n.glimpse .glimpse-hud-detail-normal, .glimpse-hud-detail-normal span, .glimpse-hud-detail-normal div {\n font-size: 1.2em;\n line-height: 100%; }\n\n.glimpse .glimpse-hud-detail-small, .glimpse-hud-detail-small span, .glimpse-hud-detail-small div {\n font-size: 1.1em; }\n\n.glimpse .glimpse-hud-detail-extra-small, .glimpse-hud-detail-extra-small span, .glimpse-hud-detail-extra-small div {\n font-size: 1em; }\n\n.glimpse .glimpse-hud-detail-position-left .glimpse-hud-value, .glimpse .glimpse-hud-detail-position-left div, .glimpse .glimpse-hud-detail-position-right div {\n display: inline-block; }\n\n.glimpse .glimpse-hud-detail-position-left .glimpse-hud-header {\n margin-right: 5px; }\n\n.glimpse .glimpse-hud-detail-position-right .glimpse-hud-header {\n margin-left: 5px; }\n\n.glimpse .glimpse-hud-value {\n font-size: 1em;\n line-height: 100%;\n margin-top: -3px; }\n\n@media screen\\0 {\n .glimpse .glimpse-hud-value {\n margin-top: -4px; }\n .glimpse .glimpse-hud-detail-normal .glimpse-hud-header {\n margin-bottom: 2px; } }\n\n.glimpse .glimpse-hud-header {\n opacity: 0.6;\n font-size: 0.7em;\n line-height: 100%;\n white-space: nowrap; }\n\n.glimpse .glimpse-hud-detail-extra-large .glimpse-hud-header {\n font-size: 0.5em; }\n\n.glimpse .glimpse-hud-detail-large .glimpse-hud-header {\n font-size: 0.6em; }\n\n.glimpse .glimpse-hud-detail-normal.glimpse-hud-detail-position-top .glimpse-hud-header {\n padding-bottom: 2px; }\n\n.glimpse .glimpse-hud-prefix, .glimpse .glimpse-hud-postfix, .glimpse .glimpse-hud-spacer, .glimpse .glimpse-hud-plain {\n opacity: 0.4;\n font-size: 0.9em; }\n\n.glimpse .glimpse-hud-postfix {\n padding-left: 2px; }\n\n.glimpse .glimpse-hud-prefix {\n padding-right: 2px; }\n\n.glimpse .glimpse-hud-prefix-super {\n font-size: 0.4em;\n font-weight: normal;\n opacity: 0.4;\n position: relative;\n top: -0.5em; }\n\n.glimpse .glimpse-hud-spacer {\n padding: 0 10px; }\n\n.glimpse .glimpse-hud-quite, .glimpse .glimpse-hud-quite * {\n opacity: 0.6; }\n\n.glimpse .glimpse-hud-error, .glimpse .glimpse-hud-error * {\n color: #FF8C80; }\n\n.glimpse .glimpse-data-trivial {\n display: none; }\n\n.glimpse .glimpse-hud-section-inner:hover ~ .glimpse-hud-popup, .glimpse .glimpse-hud-popup:hover {\n max-height: 999px;\n transition: max-height 0.3s ease 0.3s; }\n\n.glimpse .glimpse-hud-popup {\n background-color: #3c454f;\n border-left: 11px solid #71b1d1;\n position: absolute;\n left: -11px;\n right: 0;\n z-index: 1;\n bottom: 0px;\n max-height: 0px;\n transition: max-height 0.3s ease 0.2s; }\n\n.glimpse .glimpse-hud-popup-expander {\n min-width: 0px;\n height: 1px;\n transition: min-width 0.1s ease 0.5s; }\n\n.glimpse .glimpse-hud-section-inner:hover ~ .glimpse-hud-popup-expander, .glimpse .glimpse-hud-popup:hover ~ .glimpse-hud-popup-expander {\n transition: min-width 0.1s ease 0.2s; }\n\n.glimpse .glimpse-hud-section-http .glimpse-hud-section-inner:hover ~ .glimpse-hud-popup-expander, .glimpse .glimpse-hud-section-http .glimpse-hud-popup:hover ~ .glimpse-hud-popup-expander {\n min-width: 400px; }\n\n.glimpse .glimpse-hud-section-host .glimpse-hud-section-inner:hover ~ .glimpse-hud-popup-expander, .glimpse .glimpse-hud-section-host .glimpse-hud-popup:hover ~ .glimpse-hud-popup-expander {\n min-width: 600px; }\n\n.glimpse .glimpse-hud-section-ajax .glimpse-hud-section-inner:hover ~ .glimpse-hud-popup-expander, .glimpse .glimpse-hud-section-ajax .glimpse-hud-popup:hover ~ .glimpse-hud-popup-expander {\n min-width: 450px; }\n\n.glimpse .glimpse-hud-popup-clear {\n clear: both; }\n\n.glimpse .glimpse-hud-popup-header {\n margin-bottom: 5px; }\n\n.glimpse .glimpse-hud-popup .glimpse-hud-detail-extra-large {\n margin-left: -2px; }\n\n.glimpse .glimpse-hud-popup-inner {\n padding: 10px 15px; }\n\n.glimpse .glimpse-hud-popup .glimpse-hud-detail {\n padding: 0; }\n\n.glimpse .glimpse-hud-bar {\n height: 12px;\n width: 100%;\n margin: 5px 0 10px; }\n\n.glimpse .glimpse-hud-bar > div {\n position: relative; }\n\n.glimpse .glimpse-hud-bar-item {\n position: absolute;\n height: 12px;\n min-width: 1px; }\n\n.glimpse .glimpse-hud-summary {\n width: auto; }\n\n.glimpse .glimpse-hud-summary-left {\n float: left; }\n\n.glimpse .glimpse-hud-summary-right {\n float: right; }\n\n.glimpse .glimpse-hud-summary tr {\n vertical-align: bottom; }\n\n.glimpse .glimpse-hud-summary-space tr:first-child {\n height: 65px; }\n\n.glimpse .glimpse-hud-summary tr {\n height: 27px; }\n\n.glimpse .glimpse-hud-summary tr:last-child {\n height: 35px; }\n\n.glimpse .glimpse-hud-summary-space tr:last-child {\n height: 46px; }\n\n.glimpse .glimpse-hud-summary th {\n font-weight: normal; }\n\n.glimpse .glimpse-hud-summary td .glimpse-hud-detail {\n float: right; }\n\n.glimpse table.glimpse-hud-listing {\n max-width: 100%;\n width: 100%; }\n\n.glimpse .glimpse-hud-popup .glimpse-hud-listing {\n margin-top: 10px; }\n\n.glimpse .glimpse-hud-listing td {\n font-size: 1.025em;\n line-height: 100%;\n padding-top: 3px; }\n\n.glimpse .glimpse-hud-listing-row {\n padding: 2px 0; }\n\n.glimpse .glimpse-hud-listing-row > div {\n display: inline-block; }\n\n.glimpse .glimpse-hud-listing tr:first-child td {\n padding-top: 1px; }\n\n.glimpse .glimpse-hud-listing td {\n padding-bottom: 1px; }\n\n.glimpse .glimpse-hud-listing thead th {\n white-space: nowrap;\n opacity: 0.6;\n font-weight: normal;\n color: white;\n line-height: 100%;\n padding-bottom: 5px; }\n\n.glimpse .glimpse-hud-listing-overflow {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis; }\n\n.glimpse td.glimpse-hud-listing-value, .glimpse th.glimpse-hud-listing-value {\n text-align: right; }\n\n.glimpse td.glimpse-hud-listing-value, .glimpse span.glimpse-hud-listing-value {\n font-family: Consolas, monospace, serif;\n opacity: 0.85; }\n\n.glimpse .glimpse-hud .glimpse-data-childless-duration, .glimpse .glimpse-hud .glimpse-data-duration, .glimpse .glimpse-hud .glimpse-data-content-type {\n width: 90px; }\n\n.glimpse .glimpse-hud .glimpse-data-size {\n width: 60px; }\n\n.glimpse .glimpse-hud .glimpse-data-content-method {\n width: 40px; }\n\n.glimpse .glimpse-hud .glimpse-data-content-type, .glimpse .glimpse-hud .glimpse-data-content-time {\n text-align: right; }\n\n.glimpse .glimpse-hud .glimpse-data-childless-start-point {\n width: 100px; }\n\n.glimpse .glimpse-hud .glimpse-data-request-parts {\n margin-top: 15px; }\n\n.glimpse .glimpse-hud .glimpse-data-wire-part {\n width: 33%; }\n\n.glimpse .glimpse-hud .glimpse-data-server-part {\n width: 34%;\n text-align: center; }\n\n.glimpse .glimpse-hud .glimpse-data-client-part {\n text-align: right;\n width: 33%; }\n\n.glimpse .glimpse-hud .glimpse-data-ajax-method {\n width: 30px;\n text-align: right; }\n\n.glimpse .glimpse-hud .glimpse-data-ajax-uri {\n max-width: 230px;\n padding: 0 20px; }\n\n.glimpse .glimpse-hud .glimpse-data-query-summary .glimpse-hud-listing-value {\n color: #e2875e; }\n\n.glimpse .glimpse-hud .glimpse-hud-section-ajax .glimpse-hud-listing-row {\n position: relative;\n top: -20px;\n opacity: 0;\n transition: all 0.6s ease; }\n\n.glimpse .glimpse-hud .glimpse-hud-section-ajax .glimpse-hud-listing-row.added {\n top: 0px;\n opacity: 1; }\n\n.glimpse .glimpse-hud .glimpse-data-ajax-detail tbody tr:first-child td {\n padding-top: 10px; }\n\n.glimpse .glimpse-hud-controls {\n text-align: right;\n font-size: 1.2em;\n margin-top: 7px; }\n\n.glimpse .glimpse-hud-controls span {\n font-weight: bold;\n color: #71b1d1;\n cursor: pointer; }\n\n.glimpse .glimpse-data-ajax-detail a {\n color: inherit; }\n", ""]);
+ exports.push([module.id, "@font-face {\n font-family: 'Selawik';\n src: url('/glimpse/hud/assets/selawk.woff2') format('woff2'), url('/glimpse/hud/assets/selawk.woff') format('woff'); }\n\n@font-face {\n font-family: 'Selawik Light';\n src: url('/glimpse/hud/assets/selawkl.woff2') format('woff2'), url('/glimpse/hud/assets/selawkl.woff') format('woff'); }\n\n.glimpse, .glimpse *, .glimpse a, .glimpse td, .glimpse th, .glimpse table {\n font-family: 'Segoe UI', 'Selawik', Tahoma, Geneva, Verdana, sans-serif;\n background-color: transparent;\n border: 0px;\n text-align: left;\n padding: 0;\n margin: 0;\n box-sizing: content-box;\n direction: ltr; }\n\n.glimpse {\n right: 0;\n bottom: 0;\n float: right;\n position: fixed;\n min-width: 0px;\n -webkit-transform: translatez(0);\n transform: translatez(0);\n z-index: 100000;\n height: 36px; }\n\n.glimpse td, .glimpse span, .glimpse div, .glimpse th {\n color: #fff;\n font-size: 13px;\n line-height: 13px; }\n\n.glimpse table {\n min-width: 0;\n border-collapse: collapse;\n border-spacing: 0;\n width: 100%; }\n\n.glimpse .glimpse-icon {\n background-color: #3c454f;\n margin: 0;\n padding: 0 8px;\n float: right;\n width: 39px;\n background-image: url(/glimpse/hud/assets/glimpse-logo.png);\n background-repeat: no-repeat;\n background-size: 47px 37px;\n height: 36px; }\n\n.glimpse .glimpse-icon-text {\n font-size: 5px;\n color: #3c454f;\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg);\n margin-left: 45px;\n margin-top: 25px; }\n\n.glimpse .glimpse-hud {\n padding: 0 5px 0 0;\n float: right;\n background-color: #3c454f; }\n\n.glimpse .glimpse-hud-section {\n float: left;\n transition: all 0.3s ease;\n border-left: 11px solid #71b1d1;\n position: relative;\n cursor: default;\n height: 37px; }\n\n.glimpse .glimpse-hud-title {\n position: absolute;\n color: white;\n text-transform: uppercase;\n cursor: pointer;\n font-weight: bold;\n height: 100%;\n width: 12px;\n left: -12px; }\n\n.glimpse .glimpse-hud-title span {\n position: absolute;\n line-height: 100%;\n font-size: 9px;\n top: 5px;\n -webkit-transform-origin: 15px 13px;\n transform-origin: 15px 13px;\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg); }\n\n.glimpse .glimpse-hud-section-inner {\n transition: all 0.3s ease;\n max-width: 999px;\n min-width: 0px;\n margin-top: -1px;\n overflow: hidden;\n height: 37px; }\n\n.glimpse .glimpse-hud-section-input {\n display: none !important;\n font-size: 12px; }\n\n.glimpse .glimpse-hud-section-input:checked ~ .glimpse-hud-section-inner, .glimpse .glimpse-hud-section-input:checked ~ .glimpse-hud-popup-expander {\n max-width: 0px;\n overflow: hidden; }\n\n.glimpse .glimpse-hud-section-input:checked ~ .glimpse-hud-popup {\n max-height: 0px;\n overflow: hidden; }\n\n.glimpse .glimpse-hud-detail {\n display: inline-block;\n padding: 1px 10px 0; }\n\n.glimpse .glimpse-hud-section-inner .glimpse-hud-detail:first-child {\n padding-left: 15px; }\n\n.glimpse .glimpse-hud-section-inner .glimpse-hud-detail:last-child {\n padding-right: 20px; }\n\n.glimpse .glimpse-hud-data {\n transition: color 0.3s ease; }\n\n.glimpse .glimpse-hud-data-important {\n font-size: 1.2em;\n font-weight: bold; }\n\n.glimpse .glimpse-hud-value-update {\n color: #71b1d1; }\n\n.glimpse .glimpse-hud-detail-align-right .glimpse-hud-header {\n text-align: right; }\n\n.glimpse .glimpse-hud-detail-extra-large, .glimpse-hud-detail-extra-large span {\n font-size: 2em;\n line-height: 100%; }\n\n.glimpse .glimpse-hud-detail-large, .glimpse-hud-detail-large span {\n font-size: 1.45em;\n line-height: 100%; }\n\n.glimpse .glimpse-hud-detail-normal, .glimpse-hud-detail-normal span, .glimpse-hud-detail-normal div {\n font-size: 1.2em;\n line-height: 100%; }\n\n.glimpse .glimpse-hud-detail-small, .glimpse-hud-detail-small span, .glimpse-hud-detail-small div {\n font-size: 1.1em; }\n\n.glimpse .glimpse-hud-detail-extra-small, .glimpse-hud-detail-extra-small span, .glimpse-hud-detail-extra-small div {\n font-size: 1em; }\n\n.glimpse .glimpse-hud-detail-position-left .glimpse-hud-value, .glimpse .glimpse-hud-detail-position-left div, .glimpse .glimpse-hud-detail-position-right div {\n display: inline-block; }\n\n.glimpse .glimpse-hud-detail-position-left .glimpse-hud-header {\n margin-right: 5px; }\n\n.glimpse .glimpse-hud-detail-position-right .glimpse-hud-header {\n margin-left: 5px; }\n\n.glimpse .glimpse-hud-value {\n font-size: 1em;\n line-height: 100%;\n margin-top: -3px; }\n\n@media screen\\0 {\n .glimpse .glimpse-hud-value {\n margin-top: -4px; }\n .glimpse .glimpse-hud-detail-normal .glimpse-hud-header {\n margin-bottom: 2px; } }\n\n.glimpse .glimpse-hud-header {\n opacity: 0.6;\n font-size: 0.7em;\n line-height: 100%;\n white-space: nowrap; }\n\n.glimpse .glimpse-hud-detail-extra-large .glimpse-hud-header {\n font-size: 0.5em; }\n\n.glimpse .glimpse-hud-detail-large .glimpse-hud-header {\n font-size: 0.6em; }\n\n.glimpse .glimpse-hud-detail-normal.glimpse-hud-detail-position-top .glimpse-hud-header {\n padding-bottom: 2px; }\n\n.glimpse .glimpse-hud-prefix, .glimpse .glimpse-hud-postfix, .glimpse .glimpse-hud-spacer, .glimpse .glimpse-hud-plain {\n opacity: 0.4;\n font-size: 0.9em; }\n\n.glimpse .glimpse-hud-postfix {\n padding-left: 2px; }\n\n.glimpse .glimpse-hud-prefix {\n padding-right: 2px; }\n\n.glimpse .glimpse-hud-prefix-super {\n font-size: 0.4em;\n font-weight: normal;\n opacity: 0.4;\n position: relative;\n top: -0.5em; }\n\n.glimpse .glimpse-hud-spacer {\n padding: 0 10px; }\n\n.glimpse .glimpse-hud-quite, .glimpse .glimpse-hud-quite * {\n opacity: 0.6; }\n\n.glimpse .glimpse-hud-error, .glimpse .glimpse-hud-error * {\n color: #FF8C80; }\n\n.glimpse .glimpse-data-trivial {\n display: none; }\n\n.glimpse .glimpse-hud-section-inner:hover ~ .glimpse-hud-popup, .glimpse .glimpse-hud-popup:hover {\n max-height: 999px;\n transition: max-height 0.3s ease 0.3s; }\n\n.glimpse .glimpse-hud-popup {\n background-color: #3c454f;\n border-left: 11px solid #71b1d1;\n position: absolute;\n left: -11px;\n right: 0;\n z-index: 1;\n bottom: 0px;\n max-height: 0px;\n transition: max-height 0.3s ease 0.2s; }\n\n.glimpse .glimpse-hud-popup-expander {\n min-width: 0px;\n height: 1px;\n transition: min-width 0.1s ease 0.5s; }\n\n.glimpse .glimpse-hud-section-inner:hover ~ .glimpse-hud-popup-expander, .glimpse .glimpse-hud-popup:hover ~ .glimpse-hud-popup-expander {\n transition: min-width 0.1s ease 0.2s; }\n\n.glimpse .glimpse-hud-section-http .glimpse-hud-section-inner:hover ~ .glimpse-hud-popup-expander, .glimpse .glimpse-hud-section-http .glimpse-hud-popup:hover ~ .glimpse-hud-popup-expander {\n min-width: 400px; }\n\n.glimpse .glimpse-hud-section-host .glimpse-hud-section-inner:hover ~ .glimpse-hud-popup-expander, .glimpse .glimpse-hud-section-host .glimpse-hud-popup:hover ~ .glimpse-hud-popup-expander {\n min-width: 600px; }\n\n.glimpse .glimpse-hud-section-ajax .glimpse-hud-section-inner:hover ~ .glimpse-hud-popup-expander, .glimpse .glimpse-hud-section-ajax .glimpse-hud-popup:hover ~ .glimpse-hud-popup-expander {\n min-width: 450px; }\n\n.glimpse .glimpse-hud-popup-clear {\n clear: both; }\n\n.glimpse .glimpse-hud-popup-header {\n margin-bottom: 5px; }\n\n.glimpse .glimpse-hud-popup .glimpse-hud-detail-extra-large {\n margin-left: -2px; }\n\n.glimpse .glimpse-hud-popup-inner {\n padding: 10px 15px; }\n\n.glimpse .glimpse-hud-popup .glimpse-hud-detail {\n padding: 0; }\n\n.glimpse .glimpse-hud-bar {\n height: 12px;\n width: 100%;\n margin: 5px 0 10px; }\n\n.glimpse .glimpse-hud-bar > div {\n position: relative; }\n\n.glimpse .glimpse-hud-bar-item {\n position: absolute;\n height: 12px;\n min-width: 1px; }\n\n.glimpse .glimpse-hud-summary {\n width: auto; }\n\n.glimpse .glimpse-hud-summary-left {\n float: left; }\n\n.glimpse .glimpse-hud-summary-right {\n float: right; }\n\n.glimpse .glimpse-hud-summary tr {\n vertical-align: bottom; }\n\n.glimpse .glimpse-hud-summary-space tr:first-child {\n height: 65px; }\n\n.glimpse .glimpse-hud-summary tr {\n height: 27px; }\n\n.glimpse .glimpse-hud-summary tr:last-child {\n height: 35px; }\n\n.glimpse .glimpse-hud-summary-space tr:last-child {\n height: 46px; }\n\n.glimpse .glimpse-hud-summary th {\n font-weight: normal; }\n\n.glimpse .glimpse-hud-summary td .glimpse-hud-detail {\n float: right; }\n\n.glimpse table.glimpse-hud-listing {\n max-width: 100%;\n width: 100%; }\n\n.glimpse .glimpse-hud-popup .glimpse-hud-listing {\n margin-top: 10px; }\n\n.glimpse .glimpse-hud-listing td {\n font-size: 1.025em;\n line-height: 100%;\n padding-top: 3px; }\n\n.glimpse .glimpse-hud-listing-row {\n padding: 2px 0; }\n\n.glimpse .glimpse-hud-listing-row > div {\n display: inline-block; }\n\n.glimpse .glimpse-hud-listing tr:first-child td {\n padding-top: 1px; }\n\n.glimpse .glimpse-hud-listing td {\n padding-bottom: 1px; }\n\n.glimpse .glimpse-hud-listing thead th {\n white-space: nowrap;\n opacity: 0.6;\n font-weight: normal;\n color: white;\n line-height: 100%;\n padding-bottom: 5px; }\n\n.glimpse .glimpse-hud-listing-overflow {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis; }\n\n.glimpse td.glimpse-hud-listing-value, .glimpse th.glimpse-hud-listing-value {\n text-align: right; }\n\n.glimpse td.glimpse-hud-listing-value, .glimpse span.glimpse-hud-listing-value {\n font-family: Consolas, monospace, serif;\n opacity: 0.85; }\n\n.glimpse .glimpse-hud .glimpse-data-childless-duration, .glimpse .glimpse-hud .glimpse-data-duration, .glimpse .glimpse-hud .glimpse-data-content-type {\n width: 90px; }\n\n.glimpse .glimpse-hud .glimpse-data-size {\n width: 60px; }\n\n.glimpse .glimpse-hud .glimpse-data-content-method {\n width: 40px; }\n\n.glimpse .glimpse-hud .glimpse-data-content-type, .glimpse .glimpse-hud .glimpse-data-content-time {\n text-align: right; }\n\n.glimpse .glimpse-hud .glimpse-data-childless-start-point {\n width: 100px; }\n\n.glimpse .glimpse-hud .glimpse-data-request-parts {\n margin-top: 15px; }\n\n.glimpse .glimpse-hud .glimpse-data-wire-part {\n width: 33%; }\n\n.glimpse .glimpse-hud .glimpse-data-server-part {\n width: 34%;\n text-align: center; }\n\n.glimpse .glimpse-hud .glimpse-data-client-part {\n text-align: right;\n width: 33%; }\n\n.glimpse .glimpse-hud .glimpse-data-ajax-method {\n width: 30px;\n text-align: right; }\n\n.glimpse .glimpse-hud .glimpse-data-ajax-uri {\n max-width: 230px;\n padding: 0 20px; }\n\n.glimpse .glimpse-hud .glimpse-data-query-summary .glimpse-hud-listing-value {\n color: #e2875e; }\n\n.glimpse .glimpse-hud .glimpse-hud-section-ajax .glimpse-hud-listing-row {\n position: relative;\n top: -20px;\n opacity: 0;\n transition: all 0.6s ease; }\n\n.glimpse .glimpse-hud .glimpse-hud-section-ajax .glimpse-hud-listing-row.added {\n top: 0px;\n opacity: 1; }\n\n.glimpse .glimpse-hud .glimpse-data-ajax-detail tbody tr:first-child td {\n padding-top: 10px; }\n\n.glimpse .glimpse-hud-controls {\n text-align: right;\n font-size: 1.2em;\n margin-top: 7px; }\n\n.glimpse .glimpse-hud-controls span {\n font-weight: bold;\n color: #71b1d1;\n cursor: pointer; }\n\n.glimpse .glimpse-data-ajax-detail a {\n color: inherit; }\n", ""]);
// exports
diff --git a/src/Glimpse.Server/Internal/Resources/Embeded/Client/hud/hud.min.js b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/hud/hud.min.js
similarity index 66%
rename from src/Glimpse.Server/Internal/Resources/Embeded/Client/hud/hud.min.js
rename to src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/hud/hud.min.js
index 48a12c02..fb822608 100644
--- a/src/Glimpse.Server/Internal/Resources/Embeded/Client/hud/hud.min.js
+++ b/src/Glimpse.Server.Core/Internal/Resources/Embeded/Client/hud/hud.min.js
@@ -1,3 +1,3 @@
!function(e){function t(n){if(i[n])return i[n].exports;var r=i[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){"use strict";i(51);var n=i(2),r=i(8),s=i(56),o=i(52),a=i(9),l=s.current();n(function(){var e=r.resolveClientUrl(r.currentRequestId(),!0),t='';n(t).appendTo("body")}),o.getData(function(e){n(function(){setTimeout(function(){var t=a.render(e,l),i=n(t).appendTo(".glimpse-hud");s.setup(i),a.postRender(i,e)},0)})})},function(e,t,i){var n,r;n=[i(6),i(15),i(26),i(28),i(14),i(13),i(49),i(27),i(7)],r=function(e,t,i,n,r,s,o,a,l){function p(e){var t="length"in e&&e.length,i=c.type(e);return"function"===i||c.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===i||0===t||"number"==typeof t&&t>0&&t-1 in e}var u=window.document,d="@VERSION",c=function(e,t){return new c.fn.init(e,t)},m=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,g=/^-ms-/,h=/-([\da-z])/gi,f=function(e,t){return t.toUpperCase()};return c.fn=c.prototype={jquery:d,constructor:c,selector:"",length:0,toArray:function(){return t.call(this)},get:function(e){return null!=e?0>e?this[e+this.length]:this[e]:t.call(this)},pushStack:function(e){var t=c.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return c.each(this,e,t)},map:function(e){return this.pushStack(c.map(this,function(t,i){return e.call(t,i,t)}))},slice:function(){return this.pushStack(t.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,i=+e+(0>e?t:0);return this.pushStack(i>=0&&t>i?[this[i]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:n,sort:e.sort,splice:e.splice},c.extend=c.fn.extend=function(){var e,t,i,n,r,s,o=arguments[0]||{},a=1,l=arguments.length,p=!1;for("boolean"==typeof o&&(p=o,o=arguments[a]||{},a++),"object"==typeof o||c.isFunction(o)||(o={}),a===l&&(o=this,a--);l>a;a++)if(null!=(e=arguments[a]))for(t in e)i=o[t],n=e[t],o!==n&&(p&&n&&(c.isPlainObject(n)||(r=c.isArray(n)))?(r?(r=!1,s=i&&c.isArray(i)?i:[]):s=i&&c.isPlainObject(i)?i:{},o[t]=c.extend(p,s,n)):void 0!==n&&(o[t]=n));return o},c.extend({expando:"jQuery"+(d+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===c.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){return!c.isArray(e)&&e-parseFloat(e)+1>=0},isPlainObject:function(e){return"object"!==c.type(e)||e.nodeType||c.isWindow(e)?!1:e.constructor&&!a.call(e.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?s[o.call(e)]||"object":typeof e},globalEval:function(e){var t,i=eval;e=c.trim(e),e&&(1===e.indexOf("use strict")?(t=u.createElement("script"),t.text=e,u.head.appendChild(t).parentNode.removeChild(t)):i(e))},camelCase:function(e){return e.replace(g,"ms-").replace(h,f)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,i){var n,r=0,s=e.length,o=p(e);if(i){if(o)for(;s>r&&(n=t.apply(e[r],i),n!==!1);r++);else for(r in e)if(n=t.apply(e[r],i),n===!1)break}else if(o)for(;s>r&&(n=t.call(e[r],r,e[r]),n!==!1);r++);else for(r in e)if(n=t.call(e[r],r,e[r]),n===!1)break;return e},trim:function(e){return null==e?"":(e+"").replace(m,"")},makeArray:function(e,t){var i=t||[];return null!=e&&(p(Object(e))?c.merge(i,"string"==typeof e?[e]:e):n.call(i,e)),i},inArray:function(e,t,i){return null==t?-1:r.call(t,e,i)},merge:function(e,t){for(var i=+t.length,n=0,r=e.length;i>n;n++)e[r++]=t[n];return e.length=r,e},grep:function(e,t,i){for(var n,r=[],s=0,o=e.length,a=!i;o>s;s++)n=!t(e[s],s),n!==a&&r.push(e[s]);return r},map:function(e,t,n){var r,s=0,o=e.length,a=p(e),l=[];if(a)for(;o>s;s++)r=t(e[s],s,n),null!=r&&l.push(r);else for(s in e)r=t(e[s],s,n),null!=r&&l.push(r);return i.apply([],l)},guid:1,proxy:function(e,i){var n,r,s;return"string"==typeof i&&(n=e[i],i=e,e=n),c.isFunction(e)?(r=t.call(arguments,2),s=function(){return e.apply(i||this,r.concat(t.call(arguments)))},s.guid=e.guid=e.guid||c.guid++,s):void 0},now:Date.now,support:l}),c.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){s["[object "+t+"]"]=t.toLowerCase()}),c}.apply(t,n),!(void 0!==r&&(e.exports=r))},function(e,t,i){"use strict";var n=i(1);i(47),i(12),i(43),i(23),i(19),i(35),i(40),i(37),i(36),e.exports=n},function(e,t,i){var n,r;n=["./selector-sizzle"],r="function"==typeof n?n.call(t,i,t,e):n,!(void 0!==r&&(e.exports=r))},function(e,t,i){var n;n=function(){return/\S+/g}.call(t,i,t,e),!(void 0!==n&&(e.exports=n))},function(e,t,i){var n,r;n=[i(1),i(21),i(24)],r=function(e,t){var i,n=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,r=e.fn.init=function(r,s){var o,a;if(!r)return this;if("string"==typeof r){if(o="<"===r[0]&&">"===r[r.length-1]&&r.length>=3?[null,r,null]:n.exec(r),!o||!o[1]&&s)return!s||s.jquery?(s||i).find(r):this.constructor(s).find(r);if(o[1]){if(s=s instanceof e?s[0]:s,e.merge(this,e.parseHTML(o[1],s&&s.nodeType?s.ownerDocument||s:document,!0)),t.test(o[1])&&e.isPlainObject(s))for(o in s)e.isFunction(this[o])?this[o](s[o]):this.attr(o,s[o]);return this}return a=document.getElementById(o[2]),a&&a.parentNode&&(this.length=1,this[0]=a),this.context=document,this.selector=r,this}return r.nodeType?(this.context=this[0]=r,this.length=1,this):e.isFunction(r)?"undefined"!=typeof i.ready?i.ready(r):r(e):(void 0!==r.selector&&(this.selector=r.selector,this.context=r.context),e.makeArray(r,this))};return r.prototype=e.fn,i=e(document),r}.apply(t,n),!(void 0!==r&&(e.exports=r))},function(e,t,i){var n;n=function(){return[]}.call(t,i,t,e),!(void 0!==n&&(e.exports=n))},function(e,t,i){var n;n=function(){return{}}.call(t,i,t,e),!(void 0!==n&&(e.exports=n))},function(e,t,i){"use strict";var n=(i(2),/^([A-Z])|[\s-_](\w)/g),r=function(){return"environment,user-identification,end-request,begin-request,after-action-invoked,after-action-view-invoked,before-execute-command,after-execute-command,after-view-component"},s=document.getElementById("__glimpse_hud");e.exports={localStorage:function(e,t){return 1==arguments.length?JSON.parse(localStorage.getItem(e)):void localStorage.setItem(e,JSON.stringify(t))},toCamelCase:function(e){return e.replace(n,function(e,t,i,n){return i?i.toUpperCase():t.toLowerCase()})},currentRequestId:function(){return s.getAttribute("data-request-id")},resolveClientUrl:function(e,t){var i=s.getAttribute("data-client-template"),n="&requestId="+e;return n+="&metadataUri="+encodeURIComponent(s.getAttribute("data-metadata-template")),n+=t?"&follow=true":"",i.replace("{&requestId,follow,metadataUri}",n)},resolveContextUrl:function(e){var t=s.getAttribute("data-context-template"),i=e+"&types="+r(),n=t.replace("{contextId}{&types}",i);return encodeURI(n)},isLocalUri:function(e){return e&&(!(0==e.indexOf("http://")||0==e.indexOf("https://")||0==e.indexOf("//"))||0==(e.substring(e.indexOf("//")+2,e.length)+"/").indexOf(window.location.host+"/"))},htmlEncode:function(e){return null!=e?e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">"):""}}},function(e,t,i){"use strict";var n=[],r=function(e){n.push(e)},s=function(e,t){for(var i="",r=0;r=0&&(v=f.split("."),f=v.shift(),v.sort()),d=f.indexOf(":")<0&&"on"+f,t=t[e.expando]?t:new e.Event(f,"object"==typeof t&&t),t.isTrigger=s?2:3,t.namespace=v.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),i=null==i?[t]:e.makeArray(i,[t]),g=e.event.special[f]||{},s||!g.trigger||g.trigger.apply(r,i)!==!1)){if(!s&&!g.noBubble&&!e.isWindow(r)){for(u=g.delegateType||f,c.test(u+f)||(l=l.parentNode);l;l=l.parentNode)h.push(l),p=l;p===(r.ownerDocument||document)&&h.push(p.defaultView||p.parentWindow||window)}for(a=0;(l=h[a++])&&!t.isPropagationStopped();)t.type=a>1?u:g.bindType||f,m=(o.get(l,"events")||{})[t.type]&&o.get(l,"handle"),m&&m.apply(l,i),m=d&&l[d],m&&m.apply&&e.acceptData(l)&&(t.result=m.apply(l,i),t.result===!1&&t.preventDefault());return t.type=f,s||t.isDefaultPrevented()||g._default&&g._default.apply(h.pop(),i)!==!1||!e.acceptData(r)||d&&e.isFunction(r[f])&&!e.isWindow(r)&&(p=r[d],p&&(r[d]=null),e.event.triggered=f,r[f](),e.event.triggered=void 0,p&&(r[d]=p)),t.result}},dispatch:function(t){t=e.event.fix(t);var i,n,s,a,l,p=[],u=r.call(arguments),d=(o.get(this,"events")||{})[t.type]||[],c=e.event.special[t.type]||{};if(u[0]=t,t.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,t)!==!1){for(p=e.event.handlers.call(this,t,d),i=0;(a=p[i++])&&!t.isPropagationStopped();)for(t.currentTarget=a.elem,n=0;(l=a.handlers[n++])&&!t.isImmediatePropagationStopped();)(!t.namespace_re||t.namespace_re.test(l.namespace))&&(t.handleObj=l,t.data=l.data,s=((e.event.special[l.origType]||{}).handle||l.handler).apply(a.elem,u),void 0!==s&&(t.result=s)===!1&&(t.preventDefault(),t.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,t),t.result}},handlers:function(t,i){var n,r,s,o,a=[],l=i.delegateCount,p=t.target;if(l&&p.nodeType&&(!t.button||"click"!==t.type))for(;p!==this;p=p.parentNode||this)if(p.disabled!==!0||"click"!==t.type){for(r=[],n=0;l>n;n++)o=i[n],s=o.selector+" ",void 0===r[s]&&(r[s]=o.needsContext?e(s,this).index(p)>=0:e.find(s,this,null,[p]).length),r[s]&&r.push(o);r.length&&a.push({elem:p,handlers:r})}return l